From e59edca855e8c47e8abb0db606005a48cfea3776 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sun, 27 Nov 2016 20:55:59 +0100
Subject: [PATCH] Fix Responsive design

---
 htdocs/comm/propal/card.php       | 4 +++-
 htdocs/comm/propal/info.php       | 2 ++
 htdocs/commande/card.php          | 4 +++-
 htdocs/compta/facture.php         | 4 +++-
 htdocs/contrat/card.php           | 6 ++++--
 htdocs/core/tpl/ajaxrow.tpl.php   | 4 ++--
 htdocs/core/tpl/contacts.tpl.php  | 2 ++
 htdocs/fourn/commande/card.php    | 3 ++-
 htdocs/fourn/facture/card.php     | 4 ++--
 htdocs/supplier_proposal/card.php | 3 ++-
 10 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 69891ca5ad4..71e687e2168 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2209,6 +2209,7 @@ if ($action == 'create')
 		include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
 	}
 
+    print '<div class="div-table-responsive">';
 	print '<table id="tablelines" class="noborder noshadow" width="100%">';
 
 	if (! empty($object->lines))
@@ -2230,7 +2231,8 @@ if ($action == 'create')
 	}
 
 	print '</table>';
-
+    print '</div>';
+    
 	print "</form>\n";
 
 	dol_fiche_end();
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 8415cb8618f..c4f3a3e4f4e 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -43,6 +43,8 @@ $result = restrictedArea($user, 'propal', $id);
  *	View
  */
 
+$form = new Form($db);
+
 llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos');
 
 $object = new Propal($db);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 51c77e2632f..a7bd3acbbb8 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2409,6 +2409,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
 		}
 
+        print '<div class="div-table-responsive">';
 		print '<table id="tablelines" class="noborder noshadow" width="100%">';
 
 		// Show object lines
@@ -2434,7 +2435,8 @@ if ($action == 'create' && $user->rights->commande->creer)
 			}
 		}
 		print '</table>';
-
+        print '</div>';
+        
 		print "</form>\n";
 
 		dol_fiche_end();
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 2bf69038e78..07cb56b830b 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -3726,6 +3726,7 @@ else if ($id > 0 || ! empty($ref))
 		include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
 	}
 
+    print '<div class="div-table-responsive">';
 	print '<table id="tablelines" class="noborder noshadow" width="100%">';
 
 	// Show global modifiers
@@ -3797,7 +3798,8 @@ else if ($id > 0 || ! empty($ref))
 	}
 
 	print "</table>\n";
-
+    print "</div>";
+    
 	print "</form>\n";
 
 	dol_fiche_end();
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 588d6282140..c6e9a12e338 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1928,7 +1928,9 @@ else
 			';
 
 			print '<br>';
-            print '<table id="tablelines" class="noborder noshadow" width="100%">';	// Array with (n*2)+1 lines
+
+            print '<div class="div-table-responsive">';
+			print '<table id="tablelines" class="noborder noshadow" width="100%">';	// Array with (n*2)+1 lines
 
             // Trick to not show product entries
             $savproductenabled=$conf->product->enabled;
@@ -1950,7 +1952,7 @@ else
         	$conf->product->enabled = $savproductenabled;
 
             print '</table>';
-
+            print '</div>';
             print '</form>';
         }
 
diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php
index 4b8d82bce40..123fcef662c 100644
--- a/htdocs/core/tpl/ajaxrow.tpl.php
+++ b/htdocs/core/tpl/ajaxrow.tpl.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2010-2012 Regis Houssin       <regis.houssin@capnetworks.com>
- * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
+ * Copyright (C) 2010-2016 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
@@ -17,7 +17,7 @@
  *
  * Javascript code to activate drag and drop on lines
  * You can use this if you want to be abale to drag and drop rows of a table.
- * You must add id="tablelines" ont table level tag and have count($object->lines) or count($taskarray) > 0
+ * You must add id="tablelines" on table level tag and have count($object->lines) or count($taskarray) > 0
  */
 ?>
 
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 845bc30ce13..3a00ca2c060 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -52,6 +52,7 @@ $userstatic=new User($db);
 ?>
 
 <!-- BEGIN PHP TEMPLATE CONTACTS -->
+<div class="div-table-responsive">
 <div class="tagtable centpercent noborder allwidth">
 
 <?php 
@@ -237,6 +238,7 @@ if ($permission) {
 <?php $i++; ?>
 <?php } } ?>
 
+</div>
 </div>
 <!-- TEMPLATE CONTACTS HOOK BEGIN HERE -->
 <?php
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index a58bbc2cb95..dec7efa22f1 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2076,6 +2076,7 @@ elseif (! empty($object->id))
 		include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
 	}
 
+    print '<div class="div-table-responsive">';
 	print '<table id="tablelines" class="noborder noshadow" width="100%">';
 
 	// Add free products/services form
@@ -2104,7 +2105,7 @@ elseif (! empty($object->id))
 		}
 	}
 	print '</table>';
-
+    print '</div>';
 	print '</form>';
 
 	dol_fiche_end();
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 3d44d79189f..f404f5c3029 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2560,6 +2560,7 @@ else
 			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
 		}
 
+        print '<div class="div-table-responsive">';
 		print '<table id="tablelines" class="noborder noshadow" width="100%">';
 
 		global $forceall, $senderissupplier, $dateSelector, $inputalsopricewithtax;
@@ -2587,8 +2588,7 @@ else
         }
 
         print '</table>';
-
-
+        print '</div>';
         print '</form>';
 
         dol_fiche_end();
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 3ab1c159545..8717e64fe38 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1649,6 +1649,7 @@ if ($action == 'create')
 		include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
 	}
 
+    print '<div class="div-table-responsive">';
 	print '<table id="tablelines" class="noborder noshadow" width="100%">';
 
 	// Add free products/services form
@@ -1674,7 +1675,7 @@ if ($action == 'create')
 	}
 
 	print '</table>';
-
+    print '</div>';
 	print "</form>\n";
 
 	dol_fiche_end();
-- 
GitLab