Look: Some enhancements in look and themes

This commit is contained in:
Laurent Destailleur 2009-07-07 16:28:10 +00:00
parent d5f9e9dc85
commit a126d1246b

View File

@ -274,13 +274,15 @@ if ($resql)
// Print the search-by-sale and search-by-categ filters // Print the search-by-sale and search-by-categ filters
print '<form method="get" action="prospects.php" id="formulaire_recherche">'; print '<form method="get" action="prospects.php" id="formulaire_recherche">';
$moreforfilter='';
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) if ($user->rights->societe->client->voir || $socid)
{ {
// Select each sales and print them in a select input // Select each sales and print them in a select input
print $langs->trans('SalesRepresentatives'). ': '; $moreforfilter.=$langs->trans('SalesRepresentatives'). ': ';
print '<select class="flat" name="search_sale">'; $moreforfilter.='<select class="flat" name="search_sale">';
print '<option value="">'.$langs->trans('All').'</option>'; $moreforfilter.='<option value="">'.$langs->trans('All').'</option>';
$sql_usr = "SELECT u.rowid, u.name, u.firstname, u.login"; $sql_usr = "SELECT u.rowid, u.name, u.firstname, u.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
@ -292,14 +294,14 @@ if ($resql)
{ {
while ($obj_usr = $db->fetch_object($resql_usr)) while ($obj_usr = $db->fetch_object($resql_usr))
{ {
print '<option value="'.$obj_usr->rowid.'"'; $moreforfilter.='<option value="'.$obj_usr->rowid.'"';
if ($obj_usr->rowid == $search_sale) if ($obj_usr->rowid == $search_sale)
print ' selected="true"'; $moreforfilter.=' selected="true"';
print '>'; $moreforfilter.='>';
print stripslashes($obj_usr->firstname)." ".stripslashes($obj_usr->name)." (".$obj_usr->login.')'; $moreforfilter.=stripslashes($obj_usr->firstname)." ".stripslashes($obj_usr->name)." (".$obj_usr->login.')';
print '</option>'; $moreforfilter.='</option>';
$i++; $i++;
} }
$db->free($resql_usr); $db->free($resql_usr);
@ -308,7 +310,7 @@ if ($resql)
{ {
dol_print_error($db); dol_print_error($db);
} }
print '</select> &nbsp; &nbsp; &nbsp; '; $moreforfilter.='</select> &nbsp; &nbsp; &nbsp; ';
} }
// Include Categorie class // Include Categorie class
@ -321,21 +323,21 @@ if ($resql)
$tab_categs = $static_categs->get_full_arbo(2); $tab_categs = $static_categs->get_full_arbo(2);
// Print a select with each of them // Print a select with each of them
print $langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
print '<select class="flat" name="search_categ">'; $moreforfilter.='<select class="flat" name="search_categ">';
print '<option value="">'.$langs->trans('All').'</option>'; $moreforfilter.='<option value="">'.$langs->trans('All').'</option>';
if (is_array($tab_categs)) if (is_array($tab_categs))
{ {
foreach ($tab_categs as $categ) foreach ($tab_categs as $categ)
{ {
print '<option value="'.$categ['id'].'"'; $moreforfilter.='<option value="'.$categ['id'].'"';
if ($categ['id'] == $search_categ) if ($categ['id'] == $search_categ)
print ' selected="true"'; $moreforfilter.=' selected="true"';
print '>'.$categ['fulllabel'].'</option>'; $moreforfilter.='>'.$categ['fulllabel'].'</option>';
} }
} }
print '</select><br/>'; $moreforfilter.='</select><br/>';
} }
print '<table class="liste" width="100%">'; print '<table class="liste" width="100%">';
@ -363,7 +365,7 @@ if ($resql)
print '</td>'; print '</td>';
// Added by Matelli (see http://matelli.fr/showcases/patchs-dolibarr/enhance-prospect-searching.html) // Added by Matelli (see http://matelli.fr/showcases/patchs-dolibarr/enhance-prospect-searching.html)
print '<td class="liste_titre">'; print '<td class="liste_titre" align="center">';
// Generate in $options_from the list of each option sorted // Generate in $options_from the list of each option sorted
$options_from = '<option value="">&nbsp;</option>'; $options_from = '<option value="">&nbsp;</option>';
foreach ($tab_level as $tab_level_sortorder => $tab_level_label) foreach ($tab_level as $tab_level_sortorder => $tab_level_label)
@ -402,6 +404,12 @@ if ($resql)
print "</tr>\n"; print "</tr>\n";
print '<tr class="liste_titre">';
print '<td class="liste_titre" colspan="9">';
print $moreforfilter;
print '</td></tr>';
$i = 0; $i = 0;
$var=true; $var=true;