diff --git a/html/ajax_misc.php b/html/ajax_misc.php index b7646559b..5d4ebf26b 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -309,7 +309,9 @@ $path = array( // report definition "report_definition"=>"ajax_report_definition", // search all card , analytic or accounting - "search_account_card"=>"ajax_search_account_card" + "search_account_card"=>"ajax_search_account_card", + // Mobile device menu from mobile_device_mtable + "mobile_device_menu"=>"ajax_mobile_device_menu" ) ; if (array_key_exists($op, $path)) { diff --git a/html/css/style-classic7.css b/html/css/style-classic7.css index ba1352d0b..498c0844d 100644 --- a/html/css/style-classic7.css +++ b/html/css/style-classic7.css @@ -563,23 +563,53 @@ select { padding: 3px; } - - .infobulle { - position:absolute; - border:1px solid #000000; - background-color:#FCFFCC; - padding-bottom: 10px; - padding-top: 10px; - padding-left: 10px; - padding-right: 10px; - color:#000000; - top:0px;left:0px; - visibility:hidden; - width:400px; - width:25rem; - z-index:20; + position:absolute; + border:1px solid #000000; + background-color:#FCFFCC; + padding-bottom: 10px; + padding-top: 10px; + padding-left: 10px; + padding-right: 10px; + color:#000000; + top:0px;left:0px; + visibility:hidden; + width:80%; + z-index:20; + } +/* SM */ +@media (min-width: 576px) { + + .infobulle { + position:absolute; + border:1px solid #000000; + background-color:#FCFFCC; + padding-bottom: 10px; + padding-top: 10px; + padding-left: 10px; + padding-right: 10px; + color:#000000; + top:0px;left:0px; + visibility:hidden; + width:400px; + width:25rem; + z-index:20; + } } +/* MD */ +@media (min-width: 768px) { + +} +/* LG */ +@media (min-width: 992px) { + +} +/* XL */ +@media (min-width: 1200px) { + +} +/**========*/ + span.action { height:48px; @@ -1593,7 +1623,21 @@ div#bookmark_div { left:30%; width:40%; } - +#error_div{ + position:absolute; + border:1px solid #000000; + background-color:#DDE6FF; + padding-bottom: 2px; + padding-top: 2px; + padding-left: 2px; + padding-right: 2px; + color:#FF0000; + top:14%;left:2%; + visibility:hidden; + z-index:20; +} +/* SM */ +@media (min-width: 576px) { #error_div{ position:absolute; border:1px solid #000000; @@ -1609,6 +1653,36 @@ div#bookmark_div { width:40rem; z-index:20; } + +} +/* MD */ +@media (min-width: 768px) { + +} +/* LG */ +@media (min-width: 992px) { +#error_div{ + position:absolute; + border:1px solid #000000; + background-color:#DDE6FF; + padding-bottom: 2px; + padding-top: 2px; + padding-left: 2px; + padding-right: 2px; + color:#FF0000; + top:40%;left:25%; + visibility:hidden; + width:640px; + width:40rem; + z-index:20; +} +} +/* XL */ +@media (min-width: 1200px) { + +} +/**========*/ + #error_div h2 { background: #FF0000; } @@ -2960,7 +3034,7 @@ span.tagcell { color:white; } .nav-pills .nav-link.active { - background-color: #70829d !important; + background-color: hsl(224, 42%, 51.7%) !important; border-radius: 0px; } .nav-pills .nav-link { @@ -2972,7 +3046,7 @@ li.li-active { } .nav-level2 { - background-color: #0b2d99; + background-color: hsl(240, 39%, 41.2%); } .nav-level2>li { border-right: 1px #9fbcd6 ridge; @@ -3027,3 +3101,22 @@ li.li-active { color:white !important; border: 0px solid black; } +/** + * Module for smartphone menu + */ +#mobile_module .nav-pills a.nav-link { + background-color:transparent !important; + color:navy !important; + border:1px solid blue; + margin:0px; + border-radius: 0px; + } +#mobile_module .nav-pills a.nav-link:hover { + background-color: navy !important; + color:white !important; + border-radius: 0px; +} +#mobile_module h1 { + text-align: center; + font-weight: 700; +} \ No newline at end of file diff --git a/html/js/gestion.js b/html/js/gestion.js index 835657097..dec6e83d2 100644 --- a/html/js/gestion.js +++ b/html/js/gestion.js @@ -312,7 +312,6 @@ function action_add(p_dossier) { if (p_xml.responseText === 'NOCONX') { reconnect();return;} remove_waiting_box(); add_div({id: 'action_add_div', - style:"top:1%;width:80%;left:10%" , cssclass: 'inner_box'}); $('action_add_div').innerHTML=p_xml.responseText; p_xml.responseText.evalScripts(); diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js index 912fa1067..15a9c60e0 100644 --- a/html/js/noalyss_script.js +++ b/html/js/noalyss_script.js @@ -2034,7 +2034,7 @@ function show_fin_chdate(obj_id) function profile_show(p_div) { try { - var div = ['profile_gen_div', 'profile_menu_div', 'profile_print_div', 'profile_gestion_div', 'profile_repo_div']; + var div = ['profile_gen_div', 'profile_menu_div', 'profile_print_div', 'profile_gestion_div', 'profile_repo_div','profile_menu_mobile_div']; for (var r = 0; r < div.length; r++) { $(div[r]).hide(); } diff --git a/html/login.php b/html/login.php index 3e4ab0b79..70ce7ddb5 100644 --- a/html/login.php +++ b/html/login.php @@ -25,7 +25,7 @@ include_once NOALYSS_INCLUDE.'/lib/ac_common.php'; * \brief Login page */ -require_once NOALYSS_INCLUDE.'/class/database.class.php'; + // Verif if User and Pass match DB // if no, then redirect to the login page $rep=new Database(); @@ -37,11 +37,9 @@ if (defined('MULTI') && MULTI == 0) if ( isset ($_POST["p_user"] ) ) { - $g_user=strtolower(sql_string($_POST["p_user"])); - $g_pass=$_POST["p_pass"]; - $_SESSION[SESSION_KEY.'g_user']=$g_user; - $_SESSION[SESSION_KEY.'g_pass']=$g_pass; + $User=new User($rep); + $User->Check(false,'LOGIN'); /* @@ -57,9 +55,6 @@ if ( isset ($_POST["p_user"] ) ) echo ""; exit(); } - require_once NOALYSS_INCLUDE."/class/user.class.php"; - $User=new User($rep); - $User->Check(false,'LOGIN'); if (defined('NOALYSS_CAPTCHA') && NOALYSS_CAPTCHA==true) { include("securimage/securimage.php"); @@ -70,15 +65,21 @@ if ( isset ($_POST["p_user"] ) ) echo alert(_('Code invalide')); echo ""; exit(); + } } + if ($User->get_access_mode()=='PC') + { + // force the nocache + $backurl='user_login.php?v='.microtime(true); + if ( isset ($_POST['backurl'])) { + $backurl=urldecode($_POST['backurl']); + } + echo ""; + exit(); + } else { + echo ""; + exit(); } - // force the nocache - $backurl='user_login.php?v='.microtime(true); - if ( isset ($_POST['backurl'])) { - $backurl=urldecode($_POST['backurl']); - } - echo ""; - exit(); } else { @@ -99,8 +100,6 @@ else } - include_once ("class/user.class.php"); - $User=new User($rep); $User->Check(); diff --git a/html/mobile.php b/html/mobile.php new file mode 100644 index 000000000..7fc7ea7a7 --- /dev/null +++ b/html/mobile.php @@ -0,0 +1,100 @@ + + +/** + * @file + * @brief only for mobile device + */ + +require_once '../include/constant.php'; +global $g_user; + +$cn=new Database(); +$g_user=new \User($cn); +$g_user->check(); +define ('ALLOWED',true); + +//----------------------------------------------------------------- +/// if $_REQUEST['gDossier'] is not set then select the folder +//----------------------------------------------------------------- +$http=new HttpInput(); + +$dossier_id=$http->request("gDossier","number",-1); +if ($dossier_id === -1) { + // count the available folder + $cnt_folder=$g_user->get_available_folder(); + + // if there is no available folder , then exit + if ($cnt_folder==0) { + echo _("Aucun dossier disponible"); + redirect(NOALYSS_URL."/index.php", 3); + return; + } + if (count($cnt_folder ) == 1) { + // if only one folder available , connect to it + $dossier_id=$cnt_folder[0]['dos_id']; + put_global(array(['key'=>'gDossier',"value"=>$dossier_id])); + } else { + $mobile=new \Noalyss\Mobile(); + //----------------------------------------------------------------- + // --- load the javascript and start a page ---------------------- + //----------------------------------------------------------------- + $mobile->page_start(); + // propose to select the available folder + echo ''; + return; + } + +} +// we are connected to a folder +global $g_user,$cn; +$cn=Dossier::connect(); +$g_user->setDb($cn); + +global $g_parameter; +$g_parameter=new Noalyss_Parameter_Folder($cn); +$mobile=new \Noalyss\Mobile(); + +$ac=trim($http->request("ac","string","")); + +//----------------------------------------------------------------- +/// If a module is selected the execute it +//----------------------------------------------------------------- +if ( $ac !== "" && $g_user->check_module($ac) == 1) { + + // if $ac is in the mobile profile then execute it + $mobile->execute_menu($ac); +} else { +//----------------------------------------------------------------- +/// inside a folder , propose a menu +//----------------------------------------------------------------- + $mobile->page_start(); + $mobile->display_menu(); +} diff --git a/include/ajax/ajax_get_profile.php b/include/ajax/ajax_get_profile.php index 937948208..270978e55 100644 --- a/include/ajax/ajax_get_profile.php +++ b/include/ajax/ajax_get_profile.php @@ -39,18 +39,19 @@ $profile=new Profile_sql($cn,$p_id); $gDossier=Dossier::id(); $add_impression=HtmlInput::button("add", _("Ajout Menu"),"onclick=\"add_menu({dossier:$gDossier,p_id:$p_id,type:'pr'})\""); $call_tab=$http->post('tab', "string",'profile_gen_div'); -$a_tab=array('profile_gen_div'=>'tabs','profile_menu_div'=>'tabs','profile_print_div'=>'tabs','profile_gestion_div'=>'tabs','profile_repo_div'=>'tabs'); +$a_tab=array('profile_gen_div'=>'tabs','profile_menu_div'=>'tabs','profile_print_div'=>'tabs','profile_gestion_div'=>'tabs','profile_repo_div'=>'tabs',"profile_menu_mobile_div"=>"tabs"); $a_tab[$call_tab]='tabs_selected'; ?>

Profil p_name?>

0 ) : ?>