Works on product canvas
Works on custom list
This commit is contained in:
parent
48c5d8b68b
commit
d66d765df4
@ -19,16 +19,16 @@
|
|||||||
# $Source$
|
# $Source$
|
||||||
#
|
#
|
||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
# Ce makefile permet d'initialiser la base de donnée de dolibarr en manuel.
|
# Ce makefile permet d'initialiser la base de donnée de dolibarr en manuel.
|
||||||
# Il n'est utile que si vous n'utilisez pas l'installateur automatique
|
# Il n'est utile que si vous n'utilisez pas l'installateur automatique
|
||||||
# accessible à http://localhost/dolibarr/install/
|
# accessible à http://localhost/dolibarr/install/
|
||||||
#
|
#
|
||||||
# Pour une installation manuelle, créer la base dolibarr puis faire:
|
# Pour une installation manuelle, créer la base dolibarr puis faire:
|
||||||
# make mysql.sql
|
# make mysql.sql
|
||||||
# mysql dolibarr < mysql.sql
|
# mysql dolibarr < mysql.sql
|
||||||
#
|
#
|
||||||
# Le script mysql.sql cotient tous le ordres sql pour créer la base
|
# Le script mysql.sql cotient tous le ordres sql pour créer la base
|
||||||
# Tables + Index et Clés + Données
|
# Tables + Index et Clés + Données
|
||||||
#
|
#
|
||||||
# **********************************************************************
|
# **********************************************************************
|
||||||
|
|
||||||
@ -87,8 +87,8 @@ createpriv:
|
|||||||
|
|
||||||
|
|
||||||
mysql.sql: $(TABLES) data/data.sql Makefile
|
mysql.sql: $(TABLES) data/data.sql Makefile
|
||||||
echo "-- Fichier généré par make mysql.sql" > mysql.sql
|
echo "-- Fichier généré par make mysql.sql" > mysql.sql
|
||||||
echo "-- Contient les ordres de creation des tables + les clés + les données" >> mysql.sql
|
echo "-- Contient les ordres de creation des tables + les clés + les données" >> mysql.sql
|
||||||
echo "-- ;" >> mysql.sql
|
echo "-- ;" >> mysql.sql
|
||||||
$(FIND) tables/ -name "*sql" | grep -v "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mysql.sql
|
$(FIND) tables/ -name "*sql" | grep -v "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mysql.sql
|
||||||
$(FIND) tables/ -name "*sql" | grep "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mysql.sql
|
$(FIND) tables/ -name "*sql" | grep "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mysql.sql
|
||||||
|
|||||||
@ -151,12 +151,12 @@ create table llx_c_field_list
|
|||||||
)type=innodb;
|
)type=innodb;
|
||||||
|
|
||||||
INSERT INTO `llx_c_field_list` (`rowid`, `element`, `entity`, `name`, `alias`, `title`, `align`, `sort`, `search`, `enabled`, `rang`) VALUES
|
INSERT INTO `llx_c_field_list` (`rowid`, `element`, `entity`, `name`, `alias`, `title`, `align`, `sort`, `search`, `enabled`, `rang`) VALUES
|
||||||
(1, 'product_default', 1, 'ref', NULL, 'Ref', 'left', 1, 1, '1', 1),
|
(1, 'product_default', 1, 'p.ref', 'ref', 'Ref', 'left', 1, 1, '1', 1),
|
||||||
(2, 'product_default', 1, 'label', NULL, 'Label', 'left', 1, 1, '1', 2),
|
(2, 'product_default', 1, 'p.label', 'label', 'Label', 'left', 1, 1, '1', 2),
|
||||||
(3, 'product_default', 1, 'barcode', NULL, 'BarCode', 'center', 1, 1, '$conf->barcode->enabled', 3),
|
(3, 'product_default', 1, 'p.barcode', 'barcode', 'BarCode', 'center', 1, 1, '$conf->barcode->enabled', 3),
|
||||||
(4, 'product_default', 1, 'tms', 'datem', 'DateModification', 'center', 1, 0, '1', 4),
|
(4, 'product_default', 1, 'p.tms', 'datem', 'DateModification', 'center', 1, 0, '1', 4),
|
||||||
(5, 'product_default', 1, 'price', NULL, 'SellingPriceHT', 'right', 1, 0, '1', 5),
|
(5, 'product_default', 1, 'p.price', 'price', 'SellingPriceHT', 'right', 1, 0, '1', 5),
|
||||||
(6, 'product_default', 1, 'price_ttc', NULL, 'SellingPriceTTC', 'right', 1, 0, '1', 6),
|
(6, 'product_default', 1, 'p.price_ttc', 'price_ttc', 'SellingPriceTTC', 'right', 1, 0, '1', 6),
|
||||||
(7, 'product_default', 1, 'stock', NULL, 'Stock', 'right', 0, 0, '$conf->stock->enabled', 7),
|
(7, 'product_default', 1, 'p.stock', 'stock', 'Stock', 'right', 0, 0, '$conf->stock->enabled', 7),
|
||||||
(8, 'product_default', 1, 'envente', 'status', 'Status', 'right', 1, 0, '1', 8);
|
(8, 'product_default', 1, 'p.envente', 'status', 'Status', 'right', 1, 0, '1', 8);
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class ProductDefault extends Product
|
|||||||
{
|
{
|
||||||
if ($field['enabled'])
|
if ($field['enabled'])
|
||||||
{
|
{
|
||||||
$fieldname = "s".$field['name'];
|
$fieldname = "s".$field['alias'];
|
||||||
$$fieldname = trim(isset($_GET[$fieldname])?$_GET[$fieldname]:$_POST[$fieldname]);
|
$$fieldname = trim(isset($_GET[$fieldname])?$_GET[$fieldname]:$_POST[$fieldname]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,14 +93,14 @@ class ProductDefault extends Product
|
|||||||
$sql = 'SELECT DISTINCT ';
|
$sql = 'SELECT DISTINCT ';
|
||||||
|
|
||||||
// Fields requiered
|
// Fields requiered
|
||||||
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte, p.price_ttc';
|
$sql.= 'p.rowid, p.price_base_type, p.fk_product_type, p.seuil_stock_alerte';
|
||||||
|
|
||||||
// Fields not requiered
|
// Fields not requiered
|
||||||
foreach($this->field_list as $field)
|
foreach($this->field_list as $field)
|
||||||
{
|
{
|
||||||
if ($field['enabled'])
|
if ($field['enabled'])
|
||||||
{
|
{
|
||||||
$sql.= ", p.".$field['name']." as ".$field['alias'];
|
$sql.= ", ".$field['name']." as ".$field['alias'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ class ProductDefault extends Product
|
|||||||
{
|
{
|
||||||
if ($field['enabled'])
|
if ($field['enabled'])
|
||||||
{
|
{
|
||||||
$sql.= $clause." p.".$field['name']." LIKE '%".addslashes($sall)."%'";
|
$sql.= $clause." ".$field['name']." LIKE '%".addslashes($sall)."%'";
|
||||||
if ($clause=='') $clause = ' OR';
|
if ($clause=='') $clause = ' OR';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,8 +128,8 @@ class ProductDefault extends Product
|
|||||||
{
|
{
|
||||||
if ($field['enabled'])
|
if ($field['enabled'])
|
||||||
{
|
{
|
||||||
$fieldname = "s".$field['name'];
|
$fieldname = "s".$field['alias'];
|
||||||
if (${$fieldname}) $sql.= " AND p.".$field['name']." LIKE '%".addslashes(${$fieldname})."%'";
|
if (${$fieldname}) $sql.= " AND ".$field['name']." LIKE '%".addslashes(${$fieldname})."%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,10 +43,10 @@
|
|||||||
{if $fieldlist[field].enabled}
|
{if $fieldlist[field].enabled}
|
||||||
{if $fieldlist[field].sort}
|
{if $fieldlist[field].sort}
|
||||||
<td class="liste_titre" align="{$fieldlist[field].align}">{$fieldlist[field].title}
|
<td class="liste_titre" align="{$fieldlist[field].align}">{$fieldlist[field].title}
|
||||||
<a href="liste.php?sortfield=p.{$fieldlist[field].name}&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
<a href="liste.php?sortfield={$fieldlist[field].name}&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
<img src="{$url_root}/theme/{$theme}/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
||||||
</a>
|
</a>
|
||||||
<a href="liste.php?sortfield=p.{$fieldlist[field].name}&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
<a href="liste.php?sortfield={$fieldlist[field].name}&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
||||||
<img src="{$url_root}/theme/{$theme}/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
<img src="{$url_root}/theme/{$theme}/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
{if $fieldlist[searchfield].enabled}
|
{if $fieldlist[searchfield].enabled}
|
||||||
{if $fieldlist[searchfield].search}
|
{if $fieldlist[searchfield].search}
|
||||||
<td class="liste_titre" align="{$fieldlist[searchfield].align}"><input class="flat" type="text" name="s{$fieldlist[searchfield].name}" value=""></td>
|
<td class="liste_titre" align="{$fieldlist[searchfield].align}"><input class="flat" type="text" name="s{$fieldlist[searchfield].alias}" value=""></td>
|
||||||
{elseif $smarty.section.search.last}
|
{elseif $smarty.section.search.last}
|
||||||
<td class="liste_titre" align="right">
|
<td class="liste_titre" align="right">
|
||||||
<input type="image" class="liste_titre" name="button_search" src="{$url_root}/theme/{$theme}/img/search.png" alt="{$langs->trans('Search')}">
|
<input type="image" class="liste_titre" name="button_search" src="{$url_root}/theme/{$theme}/img/search.png" alt="{$langs->trans('Search')}">
|
||||||
|
|||||||
@ -49,10 +49,10 @@
|
|||||||
if ($field['enabled']) {
|
if ($field['enabled']) {
|
||||||
if ($field['sort']) { ?>
|
if ($field['sort']) { ?>
|
||||||
<td class="liste_titre" align="<?php echo $field['align']; ?>"><?php echo $field['title']; ?>
|
<td class="liste_titre" align="<?php echo $field['align']; ?>"><?php echo $field['title']; ?>
|
||||||
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=p.<?php echo $field['name']; ?>&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&sortorder=asc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
||||||
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
|
||||||
</a>
|
</a>
|
||||||
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=p.<?php echo $field['name']; ?>&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
|
||||||
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@ -69,7 +69,7 @@
|
|||||||
foreach($fieldlist as $key => $searchfield) {
|
foreach($fieldlist as $key => $searchfield) {
|
||||||
if ($searchfield['enabled']) {
|
if ($searchfield['enabled']) {
|
||||||
if ($searchfield['search']) { ?>
|
if ($searchfield['search']) { ?>
|
||||||
<td class="liste_titre" align="<?php echo $searchfield['align']; ?>"><input class="flat" type="text" name="s<?php echo $searchfield['name']; ?>" value=""></td>
|
<td class="liste_titre" align="<?php echo $searchfield['align']; ?>"><input class="flat" type="text" name="s<?php echo $searchfield['alias']; ?>" value=""></td>
|
||||||
<?php } else if ($key == $num) { ?>
|
<?php } else if ($key == $num) { ?>
|
||||||
<td class="liste_titre" align="right">
|
<td class="liste_titre" align="right">
|
||||||
<input type="image" class="liste_titre" name="button_search" src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/search.png" alt="<?php echo $langs->trans('Search'); ?>">
|
<input type="image" class="liste_titre" name="button_search" src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/search.png" alt="<?php echo $langs->trans('Search'); ?>">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user