New: [ task #454 ] Add "No category" into filters on category
combo for product list
This commit is contained in:
parent
73b17dc4c5
commit
ba25905926
@ -8,21 +8,22 @@ For users:
|
|||||||
- New: Can filter list of proposal, order or invoice on sales representative.
|
- New: Can filter list of proposal, order or invoice on sales representative.
|
||||||
- New: Add supplier ref on supplier orders.
|
- New: Add supplier ref on supplier orders.
|
||||||
- New: Can export supplier orders.
|
- New: Can export supplier orders.
|
||||||
- New: First feature to install external plugins from gui.
|
- New: First change to install external plugins from gui (experimental).
|
||||||
- New: Monaco is like France for default vat calculation
|
- New: Monaco is like France for default vat calculation
|
||||||
- New: Can list elements (invoices, orders or proposals on a particular
|
- New: Can list elements (invoices, orders or proposals) on a particular
|
||||||
user contact). This allow to view a "basket" of its elements.
|
user contact). This allow to view a "basket" of its elements.
|
||||||
- New: Add bank account on payment list of invoice card.
|
- New: Add bank account on payment list of invoice card.
|
||||||
- New: Cloning project allow to clones task, notes, files, contacts.
|
- New: Cloning project allow to clones task, notes, files, contacts.
|
||||||
- New: Enhance default style.
|
- New: Enhance default style.
|
||||||
- New: Can edit and resiliate member status from list.
|
- New: Can edit and resiliate member status from list.
|
||||||
- New: Can insert links into elements lines. Also reported into PDF.
|
- New: Can insert URL links into elements lines. Also reported into PDF.
|
||||||
- New: When a member is validated, we can subscribe to mailing-lists
|
- New: When a member is validated, we can subscribe to mailing-lists
|
||||||
according to its type.
|
according to its type.
|
||||||
- New: Add link to third party into sells and purchase journal.
|
- New: Add link to third party into sells and purchase journal.
|
||||||
- New: Suggest a method to generate a backup file for user with no access
|
- New: Suggest a method to generate a backup file for user with no access
|
||||||
to mysqldump binary.
|
to mysqldump binary.
|
||||||
- New: Can correct stock of a warehouse from warehouse card.
|
- New: Can correct stock of a warehouse from warehouse card.
|
||||||
|
- New: [ task #454 ] Add "No category" into filters on category.
|
||||||
- New: Update language files (de, tr).
|
- New: Update language files (de, tr).
|
||||||
- Fix: No images into product description lines as PDF generation does
|
- Fix: No images into product description lines as PDF generation does
|
||||||
not work with this.
|
not work with this.
|
||||||
|
|||||||
@ -241,14 +241,15 @@ class FormOther
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select list for categories (to use in form search selectors)
|
* Return select list for categories (to use in form search selectors)
|
||||||
*
|
*
|
||||||
* @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
|
* @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
|
||||||
* @param string $selected Preselected value
|
* @param string $selected Preselected value
|
||||||
* @param string $htmlname Name of combo list
|
* @param string $htmlname Name of combo list
|
||||||
* @return string Html combo list code
|
* @param int $nocateg Show also an entry "Not categorized"
|
||||||
|
* @return string Html combo list code
|
||||||
*/
|
*/
|
||||||
function select_categories($type,$selected=0,$htmlname='search_categ')
|
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||||
@ -259,8 +260,8 @@ class FormOther
|
|||||||
|
|
||||||
// Print a select with each of them
|
// Print a select with each of them
|
||||||
$moreforfilter ='<select class="flat" name="'.$htmlname.'">';
|
$moreforfilter ='<select class="flat" name="'.$htmlname.'">';
|
||||||
$moreforfilter.='<option value=""> </option>';
|
$moreforfilter.='<option value=""> </option>'; // Should use -1 to say nothing
|
||||||
|
|
||||||
if (is_array($tab_categs))
|
if (is_array($tab_categs))
|
||||||
{
|
{
|
||||||
foreach ($tab_categs as $categ)
|
foreach ($tab_categs as $categ)
|
||||||
@ -270,6 +271,11 @@ class FormOther
|
|||||||
$moreforfilter.='>'.dol_trunc($categ['fulllabel'],50,'middle').'</option>';
|
$moreforfilter.='>'.dol_trunc($categ['fulllabel'],50,'middle').'</option>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($nocateg)
|
||||||
|
{
|
||||||
|
$langs->load("categories");
|
||||||
|
$moreforfilter.='<option value="-2"'.($selected == -2 ? ' selected="selected"':'').'>- '.$langs->trans("NotCategorized").' -</option>';
|
||||||
|
}
|
||||||
$moreforfilter.='</select>';
|
$moreforfilter.='</select>';
|
||||||
|
|
||||||
return $moreforfilter;
|
return $moreforfilter;
|
||||||
|
|||||||
@ -56,6 +56,7 @@ CompanyHasNoCategory=This company is not in any categories
|
|||||||
MemberHasNoCategory=This member is not in any categories
|
MemberHasNoCategory=This member is not in any categories
|
||||||
ClassifyInCategory=Classify in category
|
ClassifyInCategory=Classify in category
|
||||||
NoneCategory=None
|
NoneCategory=None
|
||||||
|
NotCategorized=Without category
|
||||||
CategoryExistsAtSameLevel=This category already exists with this ref
|
CategoryExistsAtSameLevel=This category already exists with this ref
|
||||||
ReturnInProduct=Back to product/service card
|
ReturnInProduct=Back to product/service card
|
||||||
ReturnInSupplier=Back to supplier card
|
ReturnInSupplier=Back to supplier card
|
||||||
|
|||||||
@ -56,6 +56,7 @@ CompanyHasNoCategory=Cette société n'est dans aucune catégorie en particulier
|
|||||||
MemberHasNoCategory=Cet adhérent n'est dans aucune catégorie en particulier
|
MemberHasNoCategory=Cet adhérent n'est dans aucune catégorie en particulier
|
||||||
ClassifyInCategory=Classer dans la catégorie
|
ClassifyInCategory=Classer dans la catégorie
|
||||||
NoneCategory=Aucune
|
NoneCategory=Aucune
|
||||||
|
NotCategorized=Sans catégorie
|
||||||
CategoryExistsAtSameLevel=Cette catégorie existe déjà pour cette référence
|
CategoryExistsAtSameLevel=Cette catégorie existe déjà pour cette référence
|
||||||
ReturnInProduct=Retour sur la fiche produit/service
|
ReturnInProduct=Retour sur la fiche produit/service
|
||||||
ReturnInSupplier=Retour sur la fiche fournisseur
|
ReturnInSupplier=Retour sur la fiche fournisseur
|
||||||
|
|||||||
@ -128,14 +128,10 @@ else
|
|||||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||||
$sql.= ' p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte,';
|
$sql.= ' p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte,';
|
||||||
$sql.= ' MIN(pfp.unitprice) as minsellprice';
|
$sql.= ' MIN(pfp.unitprice) as minsellprice';
|
||||||
$sql.= ' FROM (';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
// We'll need this table joined to the select in order to filter by categ
|
if ($search_categ || $catid) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
|
||||||
if ($search_categ) $sql.= MAIN_DB_PREFIX."categorie_product as cp, ";
|
|
||||||
$sql.= MAIN_DB_PREFIX.'product as p';
|
|
||||||
$sql.= ') ';
|
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||||
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
|
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
|
||||||
if ($search_categ) $sql.= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ
|
|
||||||
if ($sall) $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
|
if ($sall) $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%')";
|
||||||
// if the type is not 1, we show all products (type = 0,2,3)
|
// if the type is not 1, we show all products (type = 0,2,3)
|
||||||
if (dol_strlen($type))
|
if (dol_strlen($type))
|
||||||
@ -148,9 +144,11 @@ else
|
|||||||
if ($snom) $sql.= " AND p.label LIKE '%".$db->escape($snom)."%'";
|
if ($snom) $sql.= " AND p.label LIKE '%".$db->escape($snom)."%'";
|
||||||
if (isset($tosell) && dol_strlen($tosell) > 0) $sql.= " AND p.tosell = ".$db->escape($tosell);
|
if (isset($tosell) && dol_strlen($tosell) > 0) $sql.= " AND p.tosell = ".$db->escape($tosell);
|
||||||
if (isset($tobuy) && dol_strlen($tobuy) > 0) $sql.= " AND p.tobuy = ".$db->escape($tobuy);
|
if (isset($tobuy) && dol_strlen($tobuy) > 0) $sql.= " AND p.tobuy = ".$db->escape($tobuy);
|
||||||
if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
|
if (dol_strlen($canvas) > 0) $sql.= " AND p.canvas = '".$db->escape($canvas)."'";
|
||||||
if ($catid) $sql.= " AND cp.fk_categorie = ".$catid;
|
if ($catid > 0) $sql.= " AND cp.fk_categorie = ".$catid;
|
||||||
if ($search_categ) $sql.= " AND cp.fk_categorie = ".$search_categ;
|
if ($catid == -2) $sql.= " AND cp.fk_categorie IS NULL";
|
||||||
|
if ($search_categ > 0) $sql.= " AND cp.fk_categorie = ".$search_categ;
|
||||||
|
if ($search_categ == -2) $sql.= " AND cp.fk_categorie IS NULL";
|
||||||
if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
|
if ($fourn_id > 0) $sql.= " AND pfp.fk_soc = ".$fourn_id;
|
||||||
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
|
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
|
||||||
$sql.= " p.fk_product_type, p.tms,";
|
$sql.= " p.fk_product_type, p.tms,";
|
||||||
@ -238,7 +236,7 @@ else
|
|||||||
if ($conf->categorie->enabled)
|
if ($conf->categorie->enabled)
|
||||||
{
|
{
|
||||||
$moreforfilter.=$langs->trans('Categories'). ': ';
|
$moreforfilter.=$langs->trans('Categories'). ': ';
|
||||||
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ');
|
$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ',1);
|
||||||
$moreforfilter.=' ';
|
$moreforfilter.=' ';
|
||||||
}
|
}
|
||||||
if ($moreforfilter)
|
if ($moreforfilter)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user