Look and feel v14

This commit is contained in:
Laurent Destailleur 2021-03-27 13:17:56 +01:00
parent 50de0777e4
commit 1d48b883a7
4 changed files with 41 additions and 26 deletions

View File

@ -1831,7 +1831,7 @@ class Form
* *
* @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed) * @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed)
* @param string $htmlname Field name in form * @param string $htmlname Field name in form
* @param int $show_empty 0=list with no empty value, 1=add also an empty value into list * @param int|string $show_empty 0=list with no empty value, 1=add also an empty value into list
* @param array $exclude Array list of users id to exclude * @param array $exclude Array list of users id to exclude
* @param int $disabled If select list must be disabled * @param int $disabled If select list must be disabled
* @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me * @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
@ -1949,7 +1949,14 @@ class Form
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>'; $out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
if ($show_empty && !$multiple) { if ($show_empty && !$multiple) {
$out .= '<option value="-1"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>&nbsp;</option>'."\n"; $textforempty = ' ';
if (!empty($conf->use_javascript_ajax)) {
$textforempty = '&nbsp;'; // If we use ajaxcombo, we need &nbsp; here to avoid to have an empty element that is too small.
}
if (!is_numeric($show_empty)) {
$textforempty = $show_empty;
}
$out .= '<option class="optiongrey" value="'.($show_empty < 0 ? $show_empty : -1).'"'.((empty($selected) || in_array(-1, $selected)) ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
} }
if ($show_every) { if ($show_every) {
$out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n"; $out .= '<option value="-2"'.((in_array(-2, $selected)) ? ' selected' : '').'>-- '.$langs->trans("Everybody").' --</option>'."\n";

View File

@ -511,31 +511,37 @@ $moreforfilter = '';
if ($user->rights->societe->client->voir || $socid) { if ($user->rights->societe->client->voir || $socid) {
$langs->load("commercial"); $langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative').': '; $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200'); $moreforfilter .= img_picto($tmptitle, 'user');
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth200');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view other users // If the user can view other users
if ($user->rights->user->user->lire) { if ($user->rights->user->user->lire) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('LinkedToSpecificUsers').': '; $tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= img_picto($tmptitle, 'user');
$moreforfilter .= $form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('IncludingProductWithTag').': '; $tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); $moreforfilter .= img_picto($tmptitle, 'category');
$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); //$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
//$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'parent', 1, $tmptitle);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': '; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1); $moreforfilter .= img_picto($tmptitle, 'category');
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
$parameters = array(); $parameters = array();

View File

@ -1491,9 +1491,9 @@ if ($resql) {
print '<td class="right nowraponall">'; print '<td class="right nowraponall">';
if ($obj->tosell) { if ($obj->tosell) {
if ($obj->price_base_type == 'TTC') { if ($obj->price_base_type == 'TTC') {
print price($obj->price_ttc).' '.$langs->trans("TTC"); print '<span class="amount">'.price($obj->price_ttc).' '.$langs->trans("TTC").'</span>';
} else { } else {
print price($obj->price).' '.$langs->trans("HT"); print '<span class="amount">'.price($obj->price).' '.$langs->trans("HT").'</span>';
} }
} }
print '</td>'; print '</td>';
@ -1546,9 +1546,9 @@ if ($resql) {
print '<td class="right nowraponall">'; print '<td class="right nowraponall">';
if (!empty($productpricescache[$obj->rowid])) { if (!empty($productpricescache[$obj->rowid])) {
if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') { if ($productpricescache[$obj->rowid][$key]['price_base_type'] == 'TTC') {
print price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC"); print '<span class="amount">'.price($productpricescache[$obj->rowid][$key]['price_ttc']).' '.$langs->trans("TTC").'</span>';
} else { } else {
print price($productpricescache[$obj->rowid][$key]['price']).' '.$langs->trans("HT"); print '<span class="amount">'.price($productpricescache[$obj->rowid][$key]['price']).' '.$langs->trans("HT").'</span>';
} }
} }
print '</td>'; print '</td>';
@ -1568,9 +1568,9 @@ if ($resql) {
if ($product_fourn->product_fourn_price_id > 0) { if ($product_fourn->product_fourn_price_id > 0) {
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) {
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1); $htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
print $form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext); print '<span class="amount">'.$form->textwithpicto(price($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent / 100) - $product_fourn->fourn_remise).' '.$langs->trans("HT"), $htmltext).'</span>';
} else { } else {
print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); print '<span class="amount">'.price($product_fourn->fourn_unitprice).' '.$langs->trans("HT").'</span>';
} }
} }
} }
@ -1606,14 +1606,14 @@ if ($resql) {
// WAP // WAP
if (!empty($arrayfields['p.pmp']['checked'])) { if (!empty($arrayfields['p.pmp']['checked'])) {
print '<td class="nowrap right">'; print '<td class="nowrap right">';
print price($product_static->pmp, 1, $langs); print '<span class="amount">'.price($product_static->pmp, 1, $langs)."</span>";
print '</td>'; print '</td>';
} }
// Cost price // Cost price
if (!empty($arrayfields['p.cost_price']['checked'])) { if (!empty($arrayfields['p.cost_price']['checked'])) {
print '<td class="nowrap right">'; print '<td class="nowrap right">';
//print $obj->cost_price; //print $obj->cost_price;
print price($obj->cost_price).' '.$langs->trans("HT"); print '<span class="amount">'.price($obj->cost_price).' '.$langs->trans("HT").'</span>';
print '</td>'; print '</td>';
} }

View File

@ -280,14 +280,14 @@ if ($result) {
$line = $total = $totalsell = $totalStock = 0; $line = $total = $totalsell = $totalStock = 0;
while ($line < $totalnboflines) { while ($line < $totalnboflines) {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$total += price2num($objp->estimatedvalue, 'MU'); $total += $objp->estimatedvalue;
$totalsell += price2num($objp->sellvalue, 'MU'); $totalsell += $objp->sellvalue;
$totalStock += $objp->stockqty; $totalStock += $objp->stockqty;
$line++; $line++;
} }
$totalarray['val']['stockqty'] = $totalStock; $totalarray['val']['stockqty'] = price2num($totalStock, 'MS');
$totalarray['val']['estimatedvalue'] = $total; $totalarray['val']['estimatedvalue'] = price2num($total, 'MT');
$totalarray['val']['estimatedstockvaluesell'] = $totalsell; $totalarray['val']['estimatedstockvaluesell'] = price2num($totalsell, 'MT');
} }
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
@ -633,7 +633,7 @@ if ($num) {
if (!empty($arrayfields["estimatedvalue"]['checked'])) { if (!empty($arrayfields["estimatedvalue"]['checked'])) {
print '<td class="right">'; print '<td class="right">';
if (price2num($obj->estimatedvalue, 'MT')) { if (price2num($obj->estimatedvalue, 'MT')) {
print price(price2num($obj->estimatedvalue, 'MT'), 1); print '<span class="amount">'.price(price2num($obj->estimatedvalue, 'MT'), 1).'</span>';
} else { } else {
print ''; print '';
} }
@ -650,7 +650,9 @@ if ($num) {
if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) { if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) {
print '<td class="right">'; print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) { if (empty($conf->global->PRODUIT_MULTIPRICES)) {
print price(price2num($obj->sellvalue, 'MT'), 1); if ($obj->sellvalue) {
print '<span class="amount">'.price(price2num($obj->sellvalue, 'MT'), 1).'</span>';
}
} else { } else {
$htmltext = $langs->trans("OptionMULTIPRICESIsOn"); $htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext); print $form->textwithtooltip($langs->trans("Variable"), $htmltext);