diff --git a/htdocs/includes/menus/standard/bureau2crea.lib.php b/htdocs/includes/menus/standard/bureau2crea.lib.php new file mode 100644 index 0000000000000000000000000000000000000000..840827f793a8fe4a139a00b67583a9004322f4e1 --- /dev/null +++ b/htdocs/includes/menus/standard/bureau2crea.lib.php @@ -0,0 +1,332 @@ +<?php +/* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net> + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/includes/menus/standard/bureau2crea.lib.php + * \brief Library for file bureau2crea menus + * \version $Id$ + */ + + + +/** + * Core function to output top menu bureau2crea + * + * @param $db + * @param $atarget + * @param $type_user 0=Internal,1=External,2=All + */ +function print_bureau2crea_menu($db,$atarget,$type_user) +{ + require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php"); + + global $user,$conf,$langs,$dolibarr_main_db_name; + + // On sauve en session le menu principal choisi + if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; + if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; + $_SESSION["leftmenuopened"]=""; + + $menuArbo = new Menubase($db,'bureau2crea','top'); + $tabMenu = $menuArbo->menuTopCharger($type_user,$_SESSION['mainmenu'], 'bureau2crea'); + + print_start_menu_array_bureau2crea(); + + for($i=0; $i<count($tabMenu); $i++) + { + if ($tabMenu[$i]['enabled'] == true) + { + $idsel=(empty($tabMenu[$i]['mainmenu'])?'none':$tabMenu[$i]['mainmenu']); + if ($tabMenu[$i]['right'] == true) // Is allowed + { + // Define url + if (preg_match("/^(http:\/\/|https:\/\/)/i",$tabMenu[$i]['url'])) + { + $url = $tabMenu[$i]['url']; + } + else + { + $url=DOL_URL_ROOT.$tabMenu[$i]['url']; + if (! preg_match('/\?/',$url)) $url.='?'; + else $url.='&'; + if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) + { + $url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=&'; + } + $url.="idmenu=".$tabMenu[$i]['rowid']; + } + + // Define the class (top menu selected or not) + if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; + else if (! empty($_SESSION['mainmenu']) && $tabMenu[$i]['mainmenu'] == $_SESSION['mainmenu']) $classname='class="tmenusel"'; + else $classname='class="tmenu"'; + + print_start_menu_entry_bureau2crea($idsel); + print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.'" id="mainmenuspan_'.$idsel.'"></span></div>'; + print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>'; + print_text_menu_entry_bureau2crea($tabMenu[$i]['titre']); + print '</a>'; + print_end_menu_entry_bureau2crea(); + } + else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) + { + if (! $type_user) + { + print_start_menu_entry_bureau2crea($idsel); + print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.'" id="mainmenuspan_'.$idsel.'"></span></div>'; + print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#">'; + print_text_menu_entry_bureau2crea($tabMenu[$i]['titre']); + print '</a>'; + print_end_menu_entry_bureau2crea(); + } + } + } + } + + print_end_menu_array_bureau2crea(); + + print "\n"; +} + + + +function print_start_menu_array_bureau2crea() +{ + global $conf; + if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '<table class="tmenu" summary="topmenu"><tr class="tmenu">'; + else print '<ul class="tmenu">'; +} + +function print_start_menu_entry_bureau2crea($idsel) { + global $conf; + if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '<td '; + else print '<li '; + + if (! empty($_SESSION['idmenu']) && $idsel == $_SESSION['idmenu']) $classname='class="tmenusel"'; + else if (! empty($_SESSION['mainmenu']) && $idsel == $_SESSION['mainmenu']) $classname='class="tmenusel"'; + else $classname='class="tmenu"'; + + print $classname; + + print ' id="mainmenutd_'.$idsel.'">'; +} + +function print_text_menu_entry_bureau2crea($text) +{ + global $conf; + print '<span class="mainmenuaspan">'; + print $text; + print '</span>'; +} + +function print_end_menu_entry_bureau2crea() +{ + global $conf; + if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '</td>'; + else print '</li>'; + print "\n"; +} + +function print_end_menu_array_bureau2crea() +{ + global $conf; + if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '</tr></table>'; + else print '</ul>'; + print "\n"; +} + + + +/** + * Core function to output left menu bureau2crea + * + * @param db Database handler + * @param menu_array_before Table of menu entries to show before entries of menu handler + * @param menu_array_after Table of menu entries to show after entries of menu handler + */ +function print_left_bureau2crea_menu($db,$menu_array_before,$menu_array_after) +{ + global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; + + $overwritemenufor = array(); + $newmenu = new Menu(); + + // Read mainmenu and leftmenu that define which menu to show + if (isset($_GET["mainmenu"])) { + // On sauve en session le menu principal choisi + $mainmenu=$_GET["mainmenu"]; + $_SESSION["mainmenu"]=$mainmenu; + $_SESSION["leftmenuopened"]=""; + } else { + // On va le chercher en session si non defini par le lien + $mainmenu=$_SESSION["mainmenu"]; + } + + if (isset($_GET["leftmenu"])) { + // On sauve en session le menu principal choisi + $leftmenu=$_GET["leftmenu"]; + $_SESSION["leftmenu"]=$leftmenu; + if ($_SESSION["leftmenuopened"]==$leftmenu) { + //$leftmenu=""; + $_SESSION["leftmenuopened"]=""; + } + else { + $_SESSION["leftmenuopened"]=$leftmenu; + } + } else { + // On va le chercher en session si non defini par le lien + $leftmenu=isset($_SESSION["leftmenu"])?$_SESSION["leftmenu"]:''; + } + + //this->menu_array contains menu in pre.inc.php + + + // Show logo company + if (! empty($conf->global->MAIN_SHOW_LOGO)) + { + $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; + if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini); + print "\n".'<!-- Show logo on menu -->'."\n"; + print '<div class="blockvmenuimpair">'."\n"; + print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n"; + print '</div>'."\n"; + } + } + + /** + * On definit newmenu en fonction de mainmenu et leftmenu + * ------------------------------------------------------ + */ + if ($mainmenu) + { + require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php"); + + $menuArbo = new Menubase($db,'bureau2crea','left'); + $overwritemenufor = $menuArbo->listeMainmenu(); + $newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'bureau2crea'); + //var_dump($newmenu); + + /* + * Menu AUTRES (Pour les menus du haut qui ne serait pas geres) + */ + if ($mainmenu && ! in_array($mainmenu,$overwritemenufor)) { $mainmenu=""; } + } + + + /** + * Si on est sur un cas gere de surcharge du menu, on ecrase celui par defaut + */ + //var_dump($menu_array_before);exit; + //var_dump($menu_array_after);exit; + $menu_array=$newmenu->liste; + //if ($mainmenu) { + if (is_array($menu_array_before)) $menu_array=array_merge($menu_array_before, $menu_array); + if (is_array($menu_array_after)) $menu_array=array_merge($menu_array, $menu_array_after); + //} + //var_dump($menu_array);exit; + + // Affichage du menu + $alt=0; + if (is_array($menu_array)) + { + for ($i = 0 ; $i < sizeof($menu_array) ; $i++) + { + $alt++; + if (empty($menu_array[$i]['level'])) + { + if (($alt%2==0)) + { + if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_ACCORDION) + { + print '<div class="blockvmenupair">'."\n"; + } + else + { + print '<div class="blockvmenuimpair">'."\n"; + } + } + else + { + print '<div class="blockvmenupair">'."\n"; + } + } + + // Place tabulation + $tabstring=''; + $tabul=($menu_array[$i]['level'] - 1); + if ($tabul > 0) + { + for ($j=0; $j < $tabul; $j++) + { + $tabstring.=' '; + } + } + + // Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser. + $url=$menu_array[$i]['url']; + if (! preg_match('/mainmenu=/i',$menu_array[$i]['url'])) + { + if (! preg_match('/\?/',$url)) $url.='?'; + else $url.='&'; + $url.='mainmenu='.$mainmenu; + } + + // Menu niveau 0 + if ($menu_array[$i]['level'] == 0) + { + if ($menu_array[$i]['enabled']) + { + print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>'; + } + else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) + { + print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'; + } + print "\n".'<div id="section_content">'."\n"; + print '<div class="menu_top"></div>'."\n"; + } + // Menu niveau > 0 + if ($menu_array[$i]['level'] > 0) + { + if ($menu_array[$i]['enabled']) + { + print '<div class="menu_contenu">'.$tabstring.'<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>'; + } + else if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) + { + print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'; + } + } + + // If next is a new block or end + if (empty($menu_array[$i+1]['level'])) + { + print '<div class="menu_end"></div>'."\n"; + print "</div><!-- end section content -->\n"; + print "</div><!-- end blockvmenu pair/impair -->\n"; + } + } + } + + return sizeof($menu_array); +} + +?> diff --git a/htdocs/theme/bureau2crea/.cvsignore b/htdocs/theme/bureau2crea/.cvsignore index 98e6ef67fad8af56cb3721edbd420b3d6fcc0bb1..77883ba2a3e31411f3207a969b98a39250af2aa3 100644 --- a/htdocs/theme/bureau2crea/.cvsignore +++ b/htdocs/theme/bureau2crea/.cvsignore @@ -1 +1,2 @@ *.db +style.css?-?Copie.php diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 62e02cea6caf85f1d4226415a3f80e93458844de..0105bef3732357d42eddf72cf341ea850192577f 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -35,7 +35,6 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -session_cache_limiter( FALSE ); require_once("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/functions.lib.php"); @@ -84,7 +83,7 @@ body { width: 100%; margin: 0px; } - + #mainbody .connexion_box { position: absolute; top: 2px; @@ -92,7 +91,7 @@ body { height: 12px; text-align: left; } - + #mainbody .connexion_box .login, #mainbody .connexion_box .printer { margin-left: 10px; font-size: 10px; @@ -100,7 +99,7 @@ body { padding: 0px !important; padding-right: 10px !important; } - + #mainbody .connexion_box .login a { color: #333; text-decoration: none; @@ -133,9 +132,6 @@ input.flat { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; } -input:disabled { -background:#ddd; -} textarea { font-size: <?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; @@ -152,9 +148,6 @@ textarea.flat { padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px; } -textarea:disabled { -background:#ddd; -} select.flat { background: #FDFDFD; font-size: <?php print $fontsize ?>px; @@ -174,7 +167,7 @@ input.button[type=submit] { margin: 0px; background-repeat: repeat-x; border: 2px solid #336600; - color: #336600; + color: #FFFFFF; cursor: pointer; font-size: 10px; } @@ -208,11 +201,6 @@ form { padding: 0em 0em 0em 0em; margin: 0em 0em 0em 0em; } -div.float -{ - float:<?php print $left; ?>; -} - /* For dragging lines */ @@ -231,10 +219,9 @@ td.showDragHandle { /* Styles de positionnement des zones */ /* ============================================================================== */ - - -td.vmenu { - width: 220px; +div.leftContent { + margin-left: 20px !important; + width: 220px !important; } div.vmenu { @@ -245,14 +232,21 @@ div.vmenu { } div.fiche { - margin-<?php print $left; ?>: 12px; - margin-<?php print $right; ?>: 10px; - margin-bottom: 10px; - padding: 0px;² + margin: 0px 20px 20px 40px; + padding: 0px; position: relative; height: auto; } + +/* ============================================================================== */ +/* Barre de redmiensionnement menu */ +/* ============================================================================== */ + +.ui-layout-resizer-west-open { + left: 240px !important; +} + /* ============================================================================== */ /* Menu top et 1ere ligne tableau */ /* ============================================================================== */ @@ -279,7 +273,7 @@ div.tmenu { white-space: nowrap; border-left: 0px; padding: 0px; - margin: 10px 0px 10px 0px; + margin: 10px 20px 10px 20px; font-size: 13px; background-image : url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_tmenu.jpg' ?>) ; height: 22px; @@ -433,36 +427,37 @@ li.tmenu, li.tmenusel { li.tmenu span, li.tmenusel span { margin: 0px 10px 0px 10px; } - + li.tmenu { background-image : url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_tmenu_btnD.jpg' ?>); background-position: right; } - + li.tmenu a { position: relative; display: block; width: 100%; + height: 22px; background-image : url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_tmenu_btnG.jpg' ?>); background-position: left; background-repeat: no-repeat; font-size: 12px; font-family: Geneva, Verdana, sans-serif; - line-height: 22px; + line-height: 25px; color: #FFF; font-weight: normal; } - + li.tmenu a:hover { color: #842F00; } - + li.tmenusel { background-image : url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_tmenusel_btnD.jpg' ?>); background-position: right; } - -li.tmenusel a { + +li.tmenusel a.tmenusel { position: relative; display: block; width: 100%; @@ -472,15 +467,15 @@ li.tmenusel a { background-repeat: no-repeat; font-size: 12px; font-family: Geneva, Verdana, sans-serif; - line-height: 22px; - color: #474747; + line-height: 25px; + color: #303030; font-weight: normal; } - + li.tmenusel a:hover { color: #474747; } - + li.tmenu a.tmenudisabled { color: #CCC; } @@ -491,17 +486,10 @@ li.tmenu a.tmenudisabled { /* Login */ -div.login_block { - <?php if (GETPOST("optioncss") == 'print') { ?> - display: none; - <?php } ?> -} - div.login { position: absolute; - <?php print $right; ?>: 60px; - top: 5px; - padding: 0px 8px; + <?php print $right; ?>: 30px; + padding: 12px 8px; margin: 0px 0px 1px 0px; font-weight: bold; } @@ -513,10 +501,9 @@ div.login a:hover { text-decoration:underline; } -img.login, img.printer, img.entity { +img.login, img.printer { position: absolute; - <?php print $right; ?>: 25px; - top: -3px; + <?php print $right; ?>: 20px; padding: 10px 0px 0px 0px; text-decoration: none; color: white; @@ -525,17 +512,14 @@ img.login, img.printer, img.entity { img.printer { <?php print $right; ?>: 4px; } -img.entity { - <?php print $right; ?>: 45px; -} - /* ============================================================================== */ /* Menu gauche */ /* ============================================================================== */ -<?php if ((! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print')) { ?> +<?php if ((! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') +|| (! empty($conf->browser->phone) && class_exists('Smartphone') && empty($conf->global->MAIN_SEARCHFORM_WITH_SMARTHPONE) && empty($conf->global->BOOKMARKS_SHOW_WITH_SMARTHPONE))) { ?> .vmenu { display: none; } @@ -896,7 +880,7 @@ td.photo { div.tabs { top: 20px; - margin: 20px 0px 0px 0px; + margin: 10px 0px 0px 0px; text-align: left; width: 100%; background-image: url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_tmenu.jpg' ?>); @@ -906,6 +890,12 @@ div.tabs { background-position: bottom; } +div.tabs a.tabTitle { + margin-right: 5px; + position: relative; + float: left; +} + div.tabs a.tab { display: block; width: auto; @@ -950,41 +940,26 @@ div.tabs a.tab:hover { color: #333333; } -a.tabTitle { - background: #D8610F; - color: white; - font-family: <?php print $fontlist ?>; - font-weight: normal; - padding: 0px 6px 0px 2px; - margin: 0px 0px 0px 6px; - float: left; - text-decoration: none; - white-space: nowrap; - border-<?php print $right; ?>: 1px solid #555555; - border-<?php print $left; ?>: 1px solid #D8D8D8; - border-top: 1px solid #D8D8D8; -} - /*div.tabs { top: 20px; margin: 1px 0px 0px 0px; padding: 0px 6px 0px 0px; text-align: <?php print $left; ?>; -}*/ +} div.tabBar { -/* color: #234046;*/ + color: #234046; margin: 0px 0px 10px 0px; -/* background: #dee7ec url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/tab_background.png' ?>) repeat-x; */ + background: #dee7ec url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/tab_background.png' ?>) repeat-x; } div.tabsAction { - margin: 12px 0em 1px 0em; + margin: 20px 0em 1px 0em; padding: 0em 0em; text-align: right; } -/* + a.tabTitle { background: #5088A9; color: white; @@ -1244,30 +1219,50 @@ table.liste td { padding-right: 2px; } +table.noborder { + background-image: url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_centerBlock-title.jpg' ?>); + background-repeat: no-repeat; + background-position: top right; + vertical-align: text-top; +} + tr.liste_titre { height: 20px; - background-image: url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_centerBlock-title.jpg' ?>); +/* background-image: url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/bg_centerBlock-title.jpg' ?>); background-repeat: no-repeat; - bakground-position: top right; - color: #FFFFFF; + background-position: top right; +*/ color: #FFFFFF; font-family: <?php print $fontlist ?>; - line-height: 8px; + line-height: 18px; padding-left: 10px; white-space: nowrap; } tr.liste_titre td { padding-left: 3px; + vertical-align: text-top; } td.liste_titre { - background: #7699A9; - background-image: url(<?php echo DOL_URL_ROOT.'/theme/bureau2crea/img/menus/trtitle.png' ?>); background-repeat: repeat-x; color: #FFFFFF; font-family: <?php print $fontlist ?>; font-weight: normal; white-space: nowrap; + background-image: none; +} + +tr.liste_titre select.flat { + float: left; + width: 200px; + position: relative; + margin: 30px 10px 10px 0px; +} + +tr.liste_titre input.button { + float: left; + position: relative; + margin: 30px 10px 10px 0px; } td.liste_titre_sel { @@ -1419,18 +1414,16 @@ div.error { background-color: #AD1800; height: 20px; line-height: 20px; - margin-top: 10px; - margin-bottom: 10px; + margin-bottom: 20px; } /* Info admin */ div.info { - color: #707070; + color: #505050; padding: 0.2em 0.2em 0.2em 0.2em; margin: 0.5em 0em 0.5em 0em; - border: 1px solid #c0c0d0; - -moz-border-radius:6px; - background: #efefd4; + border: 1px solid #878003; + background: #F4EAA2; } @@ -1969,19 +1962,20 @@ A.none, A.none:active, A.none:visited, A.none:hover { line-height:1.5; zoom:1; font-weight: normal; - font-family:<?php echo $fontlist; ?>; + font-family:Verdana,Arial,sans-serif; font-size:1em; } -.ui-widget { - font-family:<?php echo $fontlist; ?>; - font-size:<?php echo $fontsize; ?>px; + +div.tabsAction { + margin-top: 10px; } -.ui-button { margin-left: -1px; } -.ui-button-icon-only .ui-button-text { height: 8px; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: 2px 0px 6px 0px; } -.ui-button-text -{ - line-height: 1em !important; + +table.noborder { + margin-bottom: 10px; + position: relative; + float: left; } -.ui-autocomplete-input { margin: 0; padding: 1px; } +div.leftContent { + background-color: #FFF; +}