Look and feel v14

This commit is contained in:
Laurent Destailleur 2021-02-15 14:19:05 +01:00
parent 026259ebd7
commit 7e7d393f30
4 changed files with 29 additions and 20 deletions

View File

@ -984,6 +984,7 @@ class Form
print '>'.$langs->trans("Service");
print '</select>';
print ajax_combobox('select_'.$htmlname);
//if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
}
if ((empty($forceall) && empty($conf->product->enabled) && !empty($conf->service->enabled)) || $forceall == 3)
@ -2753,9 +2754,10 @@ class Form
* @param int $hidelabel Hide label (0=no, 1=yes)
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
* @param string $morecss More CSS
* @param string $placeholder Placeholder
* @return void
*/
public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '')
public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '', $placeholder = '')
{
// phpcs:enable
global $langs, $conf;
@ -2776,9 +2778,9 @@ class Form
// mode=2 means suppliers products
$urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'">';
print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').'<input type="text" class="minwidth300" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.$placeholder.'"' : '').'>';
} else {
print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss);
print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder);
}
}
@ -2798,9 +2800,10 @@ class Form
* @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices
* @param string $morecss Add more CSS
* @param int $showstockinlist Show stock information (slower).
* @param string $placeholder Placeholder
* @return array Array of keys for json
*/
public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0)
public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0, $placeholder = '')
{
// phpcs:enable
global $langs, $conf, $db, $user;
@ -2884,9 +2887,9 @@ class Form
$num = $this->db->num_rows($result);
//$out.='<select class="flat" id="select'.$htmlname.'" name="'.$htmlname.'">'; // remove select to have id same with combo and ajax
$out .= '<select class="flat maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if (!$selected) $out .= '<option value="0" selected>&nbsp;</option>';
else $out .= '<option value="0">&nbsp;</option>';
$out .= '<select class="flat '.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if (!$selected) $out .= '<option value="-1" selected>'.($placeholder ? $placeholder : '&nbsp;').'</option>';
else $out .= '<option value="-1">'.($placeholder ? $placeholder : '&nbsp;').'</option>';
$i = 0;
while ($i < $num)

View File

@ -88,7 +88,7 @@ if ($absolute_creditnote > 0) {
}
if ($absolute_discount <= 0 || $isNewObject) {
$text .= '('.$addabsolutediscount.')';
$text .= ' ('.$addabsolutediscount.')';
}
if ($isNewObject) {

View File

@ -175,7 +175,7 @@ if ($nolinesbefore) {
echo ((GETPOST('prod_entry_mode', 'alpha') == 'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ? ' checked' : '');
echo '> ';
// Show type selector
echo $langs->trans("FreeLineOfType");
echo '<span class="textradioforitem">'.$langs->trans("FreeLineOfType").'</span>';
echo '</label>';
echo ' ';
} else {
@ -194,20 +194,25 @@ if ($nolinesbefore) {
// Predefined product/service
if (!empty($conf->product->enabled) || !empty($conf->service->enabled))
{
if ($forceall >= 0 && $freelines) echo '<br>';
echo '<span class="prod_entry_mode_predef">';
if ($forceall >= 0 && $freelines) echo '<br><span class="prod_entry_mode_predef paddingtop">';
else echo '<span class="prod_entry_mode_predef">';
echo '<label for="prod_entry_mode_predef">';
echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode') == 'predef' ? ' checked' : '').'> ';
if (empty($senderissupplier))
{
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');
elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
else echo $langs->trans('PredefinedProductsAndServicesToSell');
$labelforradio = '';
if (empty($conf->dol_optimize_smallscreen)) {
if (empty($senderissupplier)) {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) $labelforradio = $langs->trans('PredefinedProductsToSell');
elseif ((empty($conf->product->enabled) && !empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) $labelforradio = $langs->trans('PredefinedServicesToSell');
else $labelforradio = $langs->trans('PredefinedProductsAndServicesToSell');
} else {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) $labelforradio = $langs->trans('PredefinedProductsToPurchase');
elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) $labelforradio = $langs->trans('PredefinedServicesToPurchase');
else $labelforradio = $langs->trans('PredefinedProductsAndServicesToPurchase');
}
} else {
if (!empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase');
elseif (empty($conf->product->enabled) && !empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase');
else echo $langs->trans('PredefinedProductsAndServicesToPurchase');
$labelforradio = $langs->trans('PredefinedItem');
}
print '<span class="textradioforitem">'.$labelforradio.'</span>';
echo '</label>';
echo ' ';
$filtertype = '';
@ -255,7 +260,7 @@ if ($nolinesbefore) {
);
$alsoproductwithnosupplierprice = 1;
}
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'maxwidth500');
$form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'minwidth300imp maxwidth500');
if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_SUPPLIER_PRODUCTS))
{
?>

View File

@ -141,6 +141,7 @@ VATRateForSupplierProduct=VAT Rate (for this vendor/product)
DiscountQtyMin=Discount for this qty.
NoPriceDefinedForThisSupplier=No price/qty defined for this vendor/product
NoSupplierPriceDefinedForThisProduct=No vendor price/qty defined for this product
PredefinedItem=Predefined item
PredefinedProductsToSell=Predefined Product
PredefinedServicesToSell=Predefined Service
PredefinedProductsAndServicesToSell=Predefined products/services to sell