From 1897e3cbadf417748970e632b219f6272ccf7181 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sun, 30 Jul 2017 20:43:18 +0200
Subject: [PATCH] Some fix for better compatibility

---
 htdocs/main.inc.php                |  4 ++--
 htdocs/public/test/test_arrays.php | 18 ++++++------------
 htdocs/theme/eldy/style.css.php    |  5 +++++
 htdocs/theme/md/style.css.php      |  6 ++++--
 4 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 090a35d6c83..89b99a61041 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1199,7 +1199,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
             print '<!-- Includes JS for JQuery -->'."\n";
             if (defined('JS_JQUERY') && constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
             else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
-            if (! empty($conf->global->MAIN_FEATURES_LEVEL))
+            if (! empty($conf->global->MAIN_FEATURES_LEVEL) && ! defined('JS_JQUERY_MIGRATE_DISABLED'))
             {
                 if (defined('JS_JQUERY_MIGRATE') && constant('JS_JQUERY_MIGRATE')) print '<script type="text/javascript" src="'.JS_JQUERY_MIGRATE.'jquery-migrate.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
                 else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-migrate.min.js'.($ext?'?'.$ext:'').'"></script>'."\n";
@@ -2002,7 +2002,7 @@ if (! function_exists("llxFooter"))
         }
 
         // Wrapper to manage dropdown
-        if ($conf->use_javascript_ajax)
+        if (! empty($conf->use_javascript_ajax) && ! defined('JS_JQUERY_DISABLE_DROPDOWN'))
         {
             print "\n<!-- JS CODE TO ENABLE dropdown -->\n";
             print '<script type="text/javascript">
diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php
index 0776c36f74a..ce3faa4bf20 100644
--- a/htdocs/public/test/test_arrays.php
+++ b/htdocs/public/test/test_arrays.php
@@ -32,9 +32,6 @@ if (empty($usedolheader))
 	<!-- Includes for JQuery (Ajax library) -->
 	<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/css/smoothness/jquery-ui.css" />
 	<!-- <link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css" /> -->
-	<?php if ($_GET["dol_use_jmobile"] == 1) { ?>
-	<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css" />
-	<?php } ?>
 	<link rel="stylesheet" type="text/css" title="default" href="<?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php<?php echo ($_GET["dol_use_jmobile"] == 1)?'?dol_use_jmobile=1&dol_optimize_smallscreen=1':''; ?>" />
 	<!-- Includes JS for JQuery -->
 	<script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/js/jquery.min.js"></script>
@@ -43,9 +40,6 @@ if (empty($usedolheader))
 	<script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/tablednd/jquery.tablednd.0.6.min.js"></script>
 	<!-- <script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js"></script> -->
 	<script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/select2/select2.min.js?version=4.0.0-beta"></script>
-	<?php if ($_GET["dol_use_jmobile"] == 1) { ?>
-	<script type="text/javascript" src="<?php echo DOL_URL_ROOT ?>/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js"></script>
-	<?php } ?>
 	</head>
 
 	<body style="padding: 10px;">
@@ -74,7 +68,7 @@ else
 			'/includes/pdfmake/vfs_fonts.js'
 	);
     */
-    
+
 	llxHeader('','','','',0,0,$arrayjs,$arraycss);
 }
 
@@ -92,7 +86,7 @@ This page is a sample of page using tables. It is designed to make test with<br>
 - tablednd<br>
 </h2>
 
-<?php  ?> 
+<?php  ?>
 
 <br><hr><br>Example 0a : Table with div+div+div containg a select that should be overflowed and truncated => Use this to align text or form<br>
 
@@ -139,7 +133,7 @@ This page is a sample of page using tables. It is designed to make test with<br>
 
 <br><hr><br>Example 1 : Standard table/thead/tbody/tr/th-td (no class pair/impair on td) => Use this if you need the drag and drop for lines or for long result tables<br>
 
- 
+
 <script type="text/javascript" language="javascript">
 /*jQuery(document).ready(function() {
 $(document).ready(function() {
@@ -157,7 +151,7 @@ $(document).ready(function() {
 });*/
 </script>
 
- 
+
 <?php
 include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
 $productspecimen=new Product($db);
@@ -223,7 +217,7 @@ if (! empty($moreforfilter))
 }
 
 ?>
-    
+
 <table class="stripe row-border order-column centpercent tagtable liste<?php echo $moreforfilter?" listwithfilterbefore":""; ?>" id="tablelines3">
 <thead>
 <tr class="liste_titre">
@@ -243,7 +237,7 @@ if (! empty($moreforfilter))
 <br>
 
 
-<!-- 
+<!--
 <br><hr><br>Example 1b : Table using tags: table/thead/tbody/tr/th-td + dataTable => Use this for short result tables<br>
 
 
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 0fa905113ad..9127395e66e 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2185,6 +2185,11 @@ span.butAction, span.butActionDelete {
     border: 1px solid #bbb;
 }
 
+.butActionTransparent {
+	color: #222 ! important;
+	background-color: transparent ! important;
+}
+
 <?php if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (! $user->admin)) { ?>
 .butActionRefused {
 	display: none;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 741a08c4ac8..db788db3178 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -2158,7 +2158,6 @@ span.butAction, span.butActionDelete {
 }
 
 
-/* Prepare for bootstrap look */
 .button, .butAction, .butActionDelete, .butActionRefused {
 	border-color: #c5c5c5;
 	border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
@@ -2254,7 +2253,10 @@ a.butAction:hover, a.butActionDelete:hover {
 	opacity: 0.9;
 }
 
-/* End bootstrap */
+.butActionTransparent {
+	color: #222 ! important;
+	background-color: transparent ! important;
+}
 
 <?php if (! empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?>
 .butActionRefused {
-- 
GitLab