trans('SecurityCode'); ?>
-
+
diff --git a/htdocs/includes/menus/init_menu_iphone.sql b/htdocs/includes/menus/init_menu_smartphone.sql
old mode 100644
new mode 100755
similarity index 100%
rename from htdocs/includes/menus/init_menu_iphone.sql
rename to htdocs/includes/menus/init_menu_smartphone.sql
diff --git a/htdocs/includes/menus/smartphone/iphone.lib.php b/htdocs/includes/menus/smartphone/smartphone.lib.php
old mode 100644
new mode 100755
similarity index 90%
rename from htdocs/includes/menus/smartphone/iphone.lib.php
rename to htdocs/includes/menus/smartphone/smartphone.lib.php
index 1fb1688cbc1..d9a64f4bd65
--- a/htdocs/includes/menus/smartphone/iphone.lib.php
+++ b/htdocs/includes/menus/smartphone/smartphone.lib.php
@@ -19,30 +19,30 @@
*/
/**
- * \file htdocs/includes/menus/smartphone/iphone.lib.php
- * \brief Library for file iphone menus
+ * \file htdocs/includes/menus/smartphone/smartphone.lib.php
+ * \brief Library for file smartphone menus
* \version $Id$
*/
/**
- * Core function to output top menu iphone
+ * Core function to output top menu smartphone
*
* @param $db
* @param $atarget
* @param $type_user 0=Internal,1=External,2=All
*/
-function print_iphone_menu($db,$atarget,$type_user)
+function print_smartphone_menu($db,$atarget,$type_user)
{
require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php");
global $user,$conf,$langs,$dolibarr_main_db_name;
-
+
$submenus='';
- $menutop = new Menubase($db,'iphone','top');
- $menuleft = new Menubase($db,'iphone','left');
- $tabMenu = $menutop->menuTopCharger($type_user, '', 'iphone');
+ $menutop = new Menubase($db,'smartphone','top');
+ $menuleft = new Menubase($db,'smartphone','left');
+ $tabMenu = $menutop->menuTopCharger($type_user, '', 'smartphone');
$numTabMenu = count($tabMenu);
print_start_menu_array();
@@ -64,12 +64,12 @@ function print_iphone_menu($db,$atarget,$type_user)
$title=$tabMenu[$i]['titre'];
// To remove & and special chars: $title=dol_string_unaccent(dol_string_nospecial(dol_html_entity_decode($tabMenu[$i]['titre'],ENT_QUOTES,'UTF-8'),'',array('&')));
print_text_menu_entry($title);
-
+
$newmenu = new Menu();
- $leftmenu = $menuleft->menuLeftCharger($newmenu,$tabMenu[$i]['mainmenu'],'',($user->societe_id?1:0),'iphone');
+ $leftmenu = $menuleft->menuLeftCharger($newmenu,$tabMenu[$i]['mainmenu'],'',($user->societe_id?1:0),'smartphone');
$menus = $leftmenu->liste;
//var_dump($menus);
-
+
print '';
if (is_array($menus) && !empty($menus))
{
@@ -89,11 +89,11 @@ function print_iphone_menu($db,$atarget,$type_user)
print_text_menu_entry($title);
if (empty($menus[$j+1]['level'])) print '';
}
-
+
if ($menus[$j]['level'] > 0)
{
if ($menus[$j-1]['level'] == 0) print_start_submenu_array();
-
+
$url=dol_buildpath($menus[$j]['url'],1);
$url=preg_replace('/&.*/i','',$url);
print_start_menu_entry();
@@ -103,10 +103,10 @@ function print_iphone_menu($db,$atarget,$type_user)
print_text_menu_entry($title);
print '';
print_end_menu_entry();
-
+
if (empty($menus[$j+1]['level'])) print_end_menu();
}
-
+
if (empty($menus[$j+1]['level'])) print_end_menu_entry();
}
}
@@ -115,7 +115,7 @@ function print_iphone_menu($db,$atarget,$type_user)
}
}
}
-
+
print_end_menu();
print "\n";
}
diff --git a/htdocs/includes/menus/smartphone/iphone_backoffice.php b/htdocs/includes/menus/smartphone/smartphone_backoffice.php
old mode 100644
new mode 100755
similarity index 72%
rename from htdocs/includes/menus/smartphone/iphone_backoffice.php
rename to htdocs/includes/menus/smartphone/smartphone_backoffice.php
index b976eb44c6f..153437a7dcf
--- a/htdocs/includes/menus/smartphone/iphone_backoffice.php
+++ b/htdocs/includes/menus/smartphone/smartphone_backoffice.php
@@ -18,19 +18,19 @@
*/
/**
- * \file htdocs/includes/menus/smartphone/iphone_backoffice.php
- * \brief Gestionnaire nomme iphone du menu smartphone
+ * \file htdocs/includes/menus/smartphone/smartphone_backoffice.php
+ * \brief Gestionnaire nomme smartphone du menu smartphone
* \version $Id$
*/
/**
* \class MenuSmart
- * \brief Class to manage smartphone menu Iphone (for internal users)
+ * \brief Class to manage smartphone menu smartphone (for internal users)
*/
class MenuSmart {
- var $require_left=array("iphone_backoffice"); // Si doit etre en phase avec un gestionnaire de menu particulier
+ var $require_left=array("smartphone_backoffice"); // Si doit etre en phase avec un gestionnaire de menu particulier
var $hideifnotallowed=0; // Put 0 for back office menu, 1 for front office menu
var $atarget=""; // Valeur du target a utiliser dans les liens
@@ -50,9 +50,9 @@ class MenuSmart {
*/
function showmenu()
{
- require_once(DOL_DOCUMENT_ROOT.'/includes/menus/smartphone/iphone.lib.php');
+ require_once(DOL_DOCUMENT_ROOT.'/includes/menus/smartphone/smartphone.lib.php');
- print_iphone_menu($this->db,$this->atarget,$this->hideifnotallowed);
+ print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed);
}
}
diff --git a/htdocs/includes/menus/smartphone/iphone_frontoffice.php b/htdocs/includes/menus/smartphone/smartphone_frontoffice.php
old mode 100644
new mode 100755
similarity index 73%
rename from htdocs/includes/menus/smartphone/iphone_frontoffice.php
rename to htdocs/includes/menus/smartphone/smartphone_frontoffice.php
index 125f1b3fddb..ce1e39d64aa
--- a/htdocs/includes/menus/smartphone/iphone_frontoffice.php
+++ b/htdocs/includes/menus/smartphone/smartphone_frontoffice.php
@@ -18,19 +18,19 @@
*/
/**
- * \file htdocs/includes/menus/smartphone/iphone_frontoffice.php
- * \brief Gestionnaire nomme iphone du menu smartphone
+ * \file htdocs/includes/menus/smartphone/smartphone_frontoffice.php
+ * \brief Gestionnaire nomme smartphone du menu smartphone
* \version $Id$
*/
/**
* \class MenuSmart
- * \brief Class to manage smartphone menu Iphone (for external users)
+ * \brief Class to manage smartphone menu smartphone (for external users)
*/
class MenuSmart {
- var $require_left=array("iphone_frontoffice"); // Si doit etre en phase avec un gestionnaire de menu particulier
+ var $require_left=array("smartphone_frontoffice"); // Si doit etre en phase avec un gestionnaire de menu particulier
var $hideifnotallowed=1; // Put 0 for back office menu, 1 for front office menu
var $atarget=""; // Valeur du target a utiliser dans les liens
@@ -50,9 +50,9 @@ class MenuSmart {
*/
function showmenu()
{
- require_once(DOL_DOCUMENT_ROOT.'/includes/menus/smartphone/iphone.lib.php');
+ require_once(DOL_DOCUMENT_ROOT.'/includes/menus/smartphone/smartphone.lib.php');
- print_iphone_menu($this->db,$this->atarget,$this->hideifnotallowed);
+ print_smartphone_menu($this->db,$this->atarget,$this->hideifnotallowed);
}
}
diff --git a/htdocs/index.php b/htdocs/index.php
index 48ed2481243..297836d9b5a 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -46,16 +46,6 @@ if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home";
* View
*/
-// Smartphone
-if (class_exists('Smartphone'))
-{
- // Template directory
- $smartphone->getTemplateDir();
- $smartphone->title = $langs->trans("Home");
- $smartphone->smartmenu();
- exit;
-}
-
// Check if company name is defined (first install)
if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_NOM))
{
@@ -63,6 +53,18 @@ if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_IN
exit;
}
+
+// If smartphone mode, we do no show main page, we show only menu
+if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
+{
+ include_once(DOL_DOCUMENT_ROOT.'/core/class/smartphone.class.php');
+ $smartphone = new Smartphone($db,$conf->browser->phone); // This class is only to know template dir according to phone type
+ $smartphone->title = $langs->trans("Home");
+ $smartphone->smartmenu();
+ exit;
+}
+
+
llxHeader();
print_fiche_titre($langs->trans("HomeArea"));
diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql
index 626788975b4..acfd83d1396 100644
--- a/htdocs/install/mysql/data/llx_const.sql
+++ b/htdocs/install/mysql/data/llx_const.sql
@@ -62,8 +62,8 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_S
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_STANDARD','eldy_backoffice.php','chaine','Module de gestion de la barre de menu pour utilisateurs internes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_STANDARD','eldy_frontoffice.php','chaine','Module de gestion de la barre de menu pour utilisateurs externes',0);
-insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_SMARTPHONE','iphone_backoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs internes',0);
-insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_SMARTPHONE','iphone_frontoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs externes',0);
+insert into llx_const (name, value, type, note, visible) values ('MAIN_MENU_SMARTPHONE','eldy_backoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs internes',0);
+insert into llx_const (name, value, type, note, visible) values ('MAIN_MENUFRONT_SMARTPHONE','eldy_frontoffice.php','chaine','Module de gestion de la barre de menu smartphone pour utilisateurs externes',0);
insert into llx_const (name, value, type, note, visible) values ('MAIN_THEME','eldy','chaine','Default theme',0);
diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php
index d297804754d..a1f178cfc6d 100644
--- a/htdocs/lib/security.lib.php
+++ b/htdocs/lib/security.lib.php
@@ -57,10 +57,11 @@ function dol_loginfunction($langs,$conf,$mysoc)
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE;
// Select templates
- if (class_exists('Smartphone'))
+ if (preg_match('/^smartphone/',$conf->smart_menu) && isset($conf->browser->phone))
{
// Template directory
- $smartphone->getTemplateDir();
+ include_once(DOL_DOCUMENT_ROOT.'/core/class/smartphone.class.php');
+ $smartphone = new Smartphone($db,$conf->browser->phone); // This class is only to know template dir according to phone type
$smartphone->title = $title;
$template_dir = $smartphone->template_dir;
}
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 007295de3cf..98b1c393cc3 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -264,14 +264,6 @@ if (sizeof($conf->need_smarty) > 0)
}
}
-// Init Smartphone (for dev only)
-if ($conf->global->MAIN_FEATURES_LEVEL == 2 && isset($conf->browser->phone))
-{
- include_once(DOL_DOCUMENT_ROOT."/core/class/smartphone.class.php");
-
- $smartphone = new Smartphone($db);
- $smartphone->phone = $conf->browser->phone;
-}
/*
* Phase authentication / login
@@ -666,23 +658,6 @@ if (! empty($_GET["theme"]))
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
-// Define menu manager to use
-if (empty($user->societe_id)) // If internal user or not defined
-{
- $conf->top_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED);
- $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
- // For backward compatibility
- if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_backoffice.php';
- if ($conf->top_menu == 'rodolphe.php') $conf->top_menu='eldy_backoffice.php';
-}
-else // If external user
-{
- $conf->top_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
- $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
- // For backward compatibility
- if ($conf->top_menu == 'eldy.php') $conf->top_menu='eldy_frontoffice.php';
- if ($conf->top_menu == 'rodolphe.php') $conf->top_menu='eldy_frontoffice.php';
-}
if (! defined('NOLOGIN'))
{
@@ -704,6 +679,7 @@ if (! defined('NOLOGIN'))
$user->getrights();
}
+
dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]);
//Another call for easy debugg
//dol_syslog("Access to ".$_SERVER["PHP_SELF"].' GET='.join(',',array_keys($_GET)).'->'.join(',',$_GET).' POST:'.join(',',array_keys($_POST)).'->'.join(',',$_POST));
@@ -770,8 +746,8 @@ if (! function_exists("llxHeader"))
{
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring);
- left_menu('', $help_url, '', '', 1);
- main_area();
+ left_menu('', $help_url, '', '', 1, $title);
+ main_area($title);
}
}
@@ -1075,9 +1051,9 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
// Show menu
$menutop = new MenuTop($db);
$menutop->atarget=$target;
- $menutop->showmenu();
+ $menutop->showmenu(); // This contains a \n
- print "\n\n";
+ print "\n";
// Link to login card
$loginhtmltext=''; $logintext='';
@@ -1180,6 +1156,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
print "\n";
if (! $conf->use_javascript_ajax || ! $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '