瀏覽代碼

Debug and fix when using dolibarr with jmobile

Laurent Destailleur 9 年之前
父節點
當前提交
abe3f192fa

+ 5 - 7
htdocs/compta/recap-compta.php

@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-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
@@ -19,7 +19,7 @@
 /**
  *  \file       htdocs/compta/recap-compta.php
  *	\ingroup    compta
- *  \brief      Page de fiche recap compta
+ *  \brief      Page de fiche recap customer
  */
 
 require '../main.inc.php';
@@ -61,10 +61,11 @@ if ($socid > 0)
 
 	dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company');
 	dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
-
+	dol_fiche_end();
+	
 	if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 	{
-		// Factures
+		// Invoice list
 		print load_fiche_titre($langs->trans("CustomerPreview"));
 
 		print '<table class="noborder" width="100%">';
@@ -226,10 +227,7 @@ if ($socid > 0)
 		}
 		
 		print "</table>";
-		print "<br>";
 	}
-
-	print '</div>';
 }
 else
 {

+ 1 - 1
htdocs/core/class/html.form.class.php

@@ -4850,7 +4850,7 @@ class Form
             </dt>
             <dd>
                 <div class="multiselectcheckbox'.$htmlname.'">
-                    <ul>
+                    <ul class="ul'.$htmlname.'">
                     '.$lis.'
                     </ul>
                 </div>

+ 56 - 27
htdocs/core/search_page.php

@@ -66,40 +66,69 @@ $hookmanager->initHooks(array('searchform'));
 
 // Define $searchform
 $searchform = '';
-// TODO Mutualize code here with function left_menu into main.inc.php page
-if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
-{
-	$langs->load("companies");
-	$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'sall', '', 'company');
-	$nbofsearch++;
-}
 
-if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
+// TODO Mutualize code here with function left_menu into main.inc.php page
+if ($conf->use_javascript_ajax && 1 == 2)
 {
-	$langs->load("companies");
-	$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'sall', '', 'contact');
-	$nbofsearch++;
+    if (! is_object($form)) $form=new Form($db);
+    $selected=-1;
+    $searchform.=$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, 'data-role="none"', '', 0, 1, 'vmenusearchselectcombo', 1, $langs->trans("Search"), 0);
 }
-
-if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
-	&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
+else
 {
-	$langs->load("products");
-	$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', '', 'product');
-	$nbofsearch++;
+    // Define $searchform
+    if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
+    {
+        $langs->load("companies");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company'));
+    }
+
+    if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
+    {
+        $langs->load("companies");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact'));
+    }
+
+    if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
+    && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
+    {
+        $langs->load("products");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product'));
+    }
+
+    if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled)
+    && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER))
+    {
+        $langs->load("products");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
+    }
+
+    if (! empty($conf->projet->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_PROJECT) && $user->rights->projet->lire)
+    {
+        $langs->load("projects");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub'));
+    }
+
+    if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
+    {
+        $langs->load("members");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
+    }
+
+	if (! empty($conf->user->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_USER) && $user->rights->user->user->lire)
+    {
+        $langs->load("users");
+        $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user'));
+    }
 }
 
-if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
+// Execute hook printSearchForm
+$parameters=array('searchform'=>$searchform);
+$reshook=$hookmanager->executeHooks('printSearchForm',$parameters);    // Note that $action and $object may have been modified by some hooks
+if (empty($reshook))
 {
-	$langs->load("members");
-	$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', '', 'member');
-	$nbofsearch++;
+	$searchform.=$hookmanager->resPrint;
 }
-
-// Execute hook printSearchForm
-$parameters=array();
-$reshook=$hookmanager->executeHooks('printSearchForm',$parameters);
-if (empty($reshook)) $searchform.=$hookmanager->resPrint;
 else $searchform=$hookmanager->resPrint;
 
 
@@ -113,7 +142,7 @@ print $searchform;
 print '</div>'."\n";
 //print '</div></div>';
 print '</div></div>';
-print "<!-- End SearchForm -->\n";
+print "\n<!-- End SearchForm -->\n";
 
 print '</div>';
 print '</body></html>'."\n";

+ 10 - 32
htdocs/fourn/recap-fourn.php

@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2010 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-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
@@ -19,7 +19,7 @@
 /**
  *  	\file       htdocs/fourn/recap-fourn.php
  *		\ingroup    fournisseur
- *		\brief      Page de fiche recap fournisseur
+ *		\brief      Page de fiche recap supplier
  */
 
 require '../main.inc.php';
@@ -30,7 +30,7 @@ $langs->load("companies");
 $langs->load("bills");
 
 // Security check
-$socid = $_GET["socid"];
+$socid = GETPOST("socid",'int');
 if ($user->societe_id > 0)
 {
     $action = '';
@@ -43,6 +43,9 @@ if ($user->societe_id > 0)
  * View
  */
 
+$form = new Form($db);
+$userstatic=new User($db);
+
 llxHeader();
 
 if ($socid > 0)
@@ -56,36 +59,12 @@ if ($socid > 0)
     $head = societe_prepare_head($societe);
 
     dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), 0, 'company');
-
-
-    print "<table width=\"100%\">\n";
-    print '<tr><td valign="top" width="50%">';
-
-    print '<table class="border" width="100%">';
-
-    // Nom
-    print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
-
-    // Prefix
-    if (! empty($conf->global->SOCIETE_USEPREFIX))  // Old not used prefix field
-    {
-        print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
-        print ($societe->prefix_comm?$societe->prefix_comm:'&nbsp;');
-        print '</td></tr>';
-    }
-
-    print "</table>";
-
-    print "</td></tr></table>\n";
-
-    print '</div>';
-
-
-
+	dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
+	dol_fiche_end();
 
     if (! empty($conf->fournisseur->enabled) && $user->rights->facture->lire)
     {
-        // Invoices list
+        // Invoice list
         print load_fiche_titre($langs->trans("SupplierPreview"));
 
         print '<table class="noborder" width="100%">';
@@ -203,10 +182,9 @@ if ($socid > 0)
         {
             dol_print_error($db);
         }
+        
         print "</table>";
-        print "<br>";
     }
-
 }
 else
 {

+ 1 - 23
htdocs/main.inc.php

@@ -1683,33 +1683,11 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra
 
 	    print '<div class="vmenu">'."\n\n";
 
-    	// Show other forms
-	    /*if ($searchform)
-	    {
-	        print "\n";
-	        print "<!-- Begin SearchForm -->\n";
-	        print '<div id="blockvmenusearch" class="blockvmenusearch">'."\n";
-	        print $searchform;
-	        print '</div>'."\n";
-	        print "<!-- End SearchForm -->\n";
-	    }*/
-
+    	// Show left menu with other forms
 	    $menumanager->menu_array = $menu_array_before;
     	$menumanager->menu_array_after = $menu_array_after;
 	    $menumanager->showmenu('left', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // output menu_array and menu found in database
 
-	    // Bookmarks
-	    /*
-	    if ($bookmarks)
-	    {
-	        print "\n";
-	        print "<!-- Begin Bookmarks -->\n";
-	        print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n";
-	        print $bookmarks;
-	        print '</div>'."\n";
-	        print "<!-- End Bookmarks -->\n";
-	    }*/
-
         // Dolibarr version + help + bug report link
 		print "\n";
 	    print "<!-- Begin Help Block-->\n";

+ 4 - 4
htdocs/societe/list.php

@@ -654,7 +654,7 @@ if ($resql)
 	// Company type
     if (! empty($arrayfields['typent.code']['checked']))
     {
-        print '<td class="liste_titre" align="center">';
+        print '<td class="liste_titre maxwidthonsmartphone" align="center">';
     	print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
     	print '</td>';
     }
@@ -702,7 +702,7 @@ if ($resql)
     }
     
     // Type (customer/prospect/supplier)
-    print '<td class="liste_titre" align="middle">';
+    print '<td class="liste_titre maxwidthonsmartphone" align="middle">';
 	print '<select class="flat" name="search_type">';
 	print '<option value="-1"'.($search_type==''?' selected':'').'>&nbsp;</option>';
 	if (empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print '<option value="1,3"'.($search_type=='1,3'?' selected':'').'>'.$langs->trans('Customer').'</option>';
@@ -743,7 +743,7 @@ if ($resql)
     if (! empty($arrayfields['s.fk_stcomm']['checked']))
     {
 	    // Prospect status
-	    print '<td class="liste_titre" align="center">';
+	    print '<td class="liste_titre maxwidthonsmartphone" align="center">';
 	    $arraystcomm=array();
 		foreach($prospectstatic->cacheprospectstatus as $key => $val)
 		{
@@ -783,7 +783,7 @@ if ($resql)
     // Status
     if (! empty($arrayfields['s.status']['checked']))
     {
-        print '<td class="liste_titre" align="center">';
+        print '<td class="liste_titre maxwidthonsmartphone" align="center">';
         print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
         print '</td>';
     }

+ 11 - 4
htdocs/theme/eldy/style.css.php

@@ -582,8 +582,8 @@ td.showDragHandle {
 
 
 div.fiche {
-	margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'8':'20'):'24')); ?>px;
-	margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'12':'8')); ?>px;
+	margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'6':'20'):'24')); ?>px;
+	margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'12':'6')); ?>px;
 	<?php if (! empty($conf->dol_hide_leftmenu) && ! empty($conf->dol_hide_topmenu)) print 'margin-top: 4px;'; ?>
 }
 
@@ -3664,6 +3664,9 @@ span.noborderoncategories {
 /*  Multiselect with checkbox                                                     */
 /* ============================================================================== */
 
+ul.ulselectedfields {
+    z-index: 100;			/* To have the select box appears on first plan even when near buttons are decorated by jmobile */
+}
 dl.dropdown {
     margin:0px;
     padding:0px;
@@ -3754,8 +3757,12 @@ a.ui-link, a.ui-link:hover, .ui-btn:hover, span.ui-btn-text:hover, span.ui-btn-i
 .ui-select .ui-btn-icon-left .ui-btn-inner {
 	padding-left: 38px;
 }
-.ui-select {
-    display: inline-block;
+select {
+    /* display: inline-block; */	/* We can't set this. This disable ability to make */
+    /* TODO added by jmobile, replace jmobile with pure css*/ 
+    overflow:hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis; 
 }
 .fiche .ui-controlgroup {
 	margin: 0px;

+ 10 - 7
htdocs/theme/md/style.css.php

@@ -2039,13 +2039,13 @@ div.pagination li.pagination span {
   color: #000;
   text-decoration: none;
 
-	background-color: #f5f5f5;
-	background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
-	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
-	background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
-	background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
-	background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
-	background-repeat: repeat-x;
+    background-color: #f5f5f5;
+    background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
+    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
+    background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
+    background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
+    background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
+    background-repeat: repeat-x;
 <?php } ?>
 }
 div.pagination li.pagination span.inactive {
@@ -3511,6 +3511,9 @@ span.noborderoncategories {
 /*  Multiselect with checkbox                                                     */
 /* ============================================================================== */
 
+ul.ulselectedfields {
+    z-index: 100;			/* To have the select box appears on first plan even when near buttons are decorated by jmobile */
+}
 dl.dropdown {
     margin:0px;
     padding:0px;