From 78d18185e49a2ef2ab379819dc8701eeda1f3ff4 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Fri, 22 Apr 2016 11:11:08 +0200
Subject: [PATCH] Several css enhancements

---
 htdocs/adherents/type.php                     |  7 +--
 htdocs/categories/index.php                   |  2 +-
 htdocs/comm/action/peruser.php                |  2 +-
 .../modules/mailings/contacts3.modules.php    | 18 +++++---
 .../modules/mailings/contacts4.modules.php    | 23 ++++++----
 htdocs/langs/en_US/website.lang               |  3 +-
 htdocs/theme/eldy/style.css.php               | 43 +++++++++++--------
 htdocs/websites/index.php                     |  3 +-
 8 files changed, 61 insertions(+), 40 deletions(-)

diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index bae064bef34..dbc700a6778 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -153,6 +153,7 @@ if ($action == 'delete' && $user->rights->adherent->configurer)
 	exit;
 }
 
+
 /*
  * View
  */
@@ -236,7 +237,7 @@ if ($action == 'create')
 	print '<table class="border" width="100%">';
 	print '<tbody>';
 
-	print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
+	print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
 
 	print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
 	print $form->selectyesno("cotisation",1,1);
@@ -247,7 +248,7 @@ if ($action == 'create')
 	print '</td></tr>';
 
 	print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
-	print '<textarea name="comment" wrap="soft" cols="60" rows="3"></textarea></td></tr>';
+	print '<textarea name="comment" wrap="soft" class="centpercent" rows="3"></textarea></td></tr>';
 
 	print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
 	require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -645,7 +646,7 @@ if ($rowid > 0)
 		print '</td></tr>';
 
 		print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
-		print '<textarea name="comment" wrap="soft" cols="90" rows="3">'.$object->note.'</textarea></td></tr>';
+		print '<textarea name="comment" wrap="soft" class="centpercent" rows="3">'.$object->note.'</textarea></td></tr>';
 
 		print '<tr><td valign="top">'.$langs->trans("WelcomeEMail").'</td><td>';
 		require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php
index e57cd22d5fd..02b83fcaef8 100644
--- a/htdocs/categories/index.php
+++ b/htdocs/categories/index.php
@@ -79,7 +79,7 @@ print '<tr class="liste_titre">';
 print '<td colspan="3">'.$langs->trans("Search").'</td>';
 print '</tr>';
 print '<tr '.$bc[0].'><td>';
-print $langs->trans("Name").':</td><td><input class="flat" type="text" size="20" name="catname" value="' . $catname . '"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
+print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="' . $catname . '"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
 /*
 // faire une rech dans une sous categorie uniquement
 print '<tr '.$bc[0].'><td>';
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 621d3ada57a..fa24935316e 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -564,7 +564,7 @@ echo '</form>';
 //print "begin_d=".$begin_d." end_d=".$end_d;
 
 
-echo '<table width="100%" class="nocellnopadd cal_month">';
+echo '<table width="100%" class="noborder nocellnopadd cal_month">';
 
 echo '<tr class="liste_titre">';
 echo '<td></td>';
diff --git a/htdocs/core/modules/mailings/contacts3.modules.php b/htdocs/core/modules/mailings/contacts3.modules.php
index 61d992b32aa..b9878fd1c83 100644
--- a/htdocs/core/modules/mailings/contacts3.modules.php
+++ b/htdocs/core/modules/mailings/contacts3.modules.php
@@ -225,14 +225,22 @@ class mailing_contacts3 extends MailingTargets
         if ($resql)
         {
             $num = $this->db->num_rows($resql);
-            $i = 0;
-            while ($i < $num)
+            if ($num)
             {
-                $obj = $this->db->fetch_object($resql);
-                $s.='<option value="'.$obj->label.'">'.$obj->label.' ('.$obj->nb.')</option>';
-                $i++;
+                $i = 0;
+                while ($i < $num)
+                {
+                    $obj = $this->db->fetch_object($resql);
+                    $s.='<option value="'.$obj->label.'">'.$obj->label.' ('.$obj->nb.')</option>';
+                    $i++;
+                }
+            }
+            else
+            {
+                $s.='<option value="-1" disabled="disabled">'.$langs->trans("NoContactLinkedToThirdpartieWithCategoryFound").'</option>';
             }
         }
+        else dol_print_error($this->db);
         $s.='</select>';
 
         return $s;
diff --git a/htdocs/core/modules/mailings/contacts4.modules.php b/htdocs/core/modules/mailings/contacts4.modules.php
index 631f06ec8f2..421fd2676c8 100644
--- a/htdocs/core/modules/mailings/contacts4.modules.php
+++ b/htdocs/core/modules/mailings/contacts4.modules.php
@@ -222,16 +222,21 @@ class mailing_contacts4 extends MailingTargets
 	        $s='';
 	        $s.='<select name="filter" class="flat">';
 	        $s.='<option value="all"></option>';
-	        if ($resql)
+
+	        $num = $this->db->num_rows($resql);
+	        if ($num)
+	        {
+    	        $i = 0;
+                while ($i < $num)
+                {
+                    $obj = $this->db->fetch_object($resql);
+                    $s.='<option value="'.$obj->label.'">'.$obj->label.' ('.$obj->nb.')</option>';
+                    $i++;
+                }
+	        }
+	        else
 	        {
-	            $num = $this->db->num_rows($resql);
-	            $i = 0;
-	            while ($i < $num)
-	            {
-	                $obj = $this->db->fetch_object($resql);
-	                $s.='<option value="'.$obj->label.'">'.$obj->label.' ('.$obj->nb.')</option>';
-	                $i++;
-	            }
+                $s.='<option value="-1" disabled="disabled">'.$langs->trans("NoContactWithCategoryFound").'</option>';
 	        }
 	        $s.='</select>';
 	        return $s;
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index 688866a4e5b..13659bc5954 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -10,4 +10,5 @@ EditPageMeta=Edit Meta
 EditPageContent=Edit Content
 Website=Web site
 AddPage=Add page
-Page=Page
\ No newline at end of file
+Page=Page
+PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page.
\ No newline at end of file
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index e7fe3a14952..f7519e16f61 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -81,7 +81,8 @@ $dol_use_jmobile=$conf->dol_use_jmobile;
 // Colors
 $colorbackhmenu1='120,130,170';      // topmenu
 $colorbackvmenu1='255,255,255';      // vmenu
-$colorbacktitle1='230,230,230';      // title of array
+$colortopbordertitle1='40,40,40';    // top border of title
+$colorbacktitle1='230,230,230';      // title of tables,list
 $colorbacktabcard1='255,255,255';  // card
 $colorbacktabactive='234,234,234';
 $colorbacklineimpair1='255,255,255';    // line impair
@@ -345,7 +346,7 @@ input:-moz-placeholder { color:#ccc; }
 <?php if (! empty($dol_use_jmobile)) { ?>
 legend { margin-bottom: 8px; }
 <?php } ?>
-fieldset { border: 1px solid #AAAAAA !important; box-shadow: 2px 2px 3px #DDD; }
+fieldset { border: 1px solid #AAAAAA !important; }
 
 
 .button, input[name="sbmtConnexion"] {
@@ -1720,11 +1721,11 @@ div.tabBar {
 
 	background: rgb(<?php echo $colorbacktabcard1; ?>);
 
-	<?php if (empty($dol_optimize_smallscreen)) { ?>
+	/*<?php if (empty($dol_optimize_smallscreen)) { ?>
     -moz-box-shadow: 3px 3px 4px #DDD;
     -webkit-box-shadow: 3px 3px 4px #DDD;
     box-shadow: 3px 3px 4px #DDD;
-	<?php } ?>
+	<?php } ?>*/
 }
 div.popuptabset {
 	padding: 6px;
@@ -2177,17 +2178,17 @@ table.liste, table.noborder, table.formdoc, div.noborder {
 	border-spacing: 0px;
 
 	border-top-width: 1px;
-	border-top-color: #BBB;
+	border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
 	border-top-style: solid;
 
-	border-right-width: 1px;
+/*	border-right-width: 1px;
 	border-right-color: #BBB;
 	border-right-style: solid;
 
 	border-left-width: 1px;
 	border-left-color: #BBB;
 	border-left-style: solid;
-
+*/
 	border-bottom-width: 1px;
 	border-bottom-color: #BBB;
 	border-bottom-style: solid;
@@ -2538,6 +2539,10 @@ div.liste_titre {
 	border-top-style: solid;
 }
 div.liste_titre_bydiv {
+	border-top-width: 1px;
+    border-top-color: rgb(<?php echo $colortopbordertitle1 ?>);
+    border-top-style: solid;
+    
 	border-collapse: collapse;
 	display: table;
 	padding: 2px 0px 2px 0;
@@ -2555,13 +2560,13 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.list
 	color: #000 !important;*/
 
 	/* TO MATCH ELDY */
-	background: rgb(<?php echo $colorbacktitle1; ?>);
+	/*background: rgb(<?php echo $colorbacktitle1; ?>);*/
 	<?php if ($usegradient) { ?>
-	background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
+	background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
 	<?php } ?>
 	font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
 
@@ -2707,13 +2712,13 @@ tr.box_titre {
 	color: #000 !important;*/
 
 	/* TO MATCH ELDY */
-	background: rgb(<?php echo $colorbacktitle1; ?>);
+	/* background: rgb(<?php echo $colorbacktitle1; ?>); */
 	<?php if ($usegradient) { ?>
-	background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
-	background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(250,250,250,0.3) 100%);
+	background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: -ms-linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
+	background-image: linear-gradient(bottom, rgba(0,0,0,0.1) 0%, rgba(<?php echo $colorbacktitle1; ?>,0.3) 100%);
 	<?php } ?>
 
 	color: rgb(<?php echo $colortexttitle; ?>);
diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index bfcdb9e0c85..ba2a4466b4d 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -334,7 +334,8 @@ print '</form>';
 
 if ($action == 'preview')
 {
-    print '<div class="center">Preview TO DO</center>';
+    print '<br><br><div class="center">'.$langs->trans("PreviewOfSiteNotYetAvailable", $website).'</center><br><br><br>';
+    print '<div class="center"><div class="logo_setup"></div></div>';
 }
 
     
-- 
GitLab