Merge pull request #1209 from grandoc/develop
Add an additional description for the category products
This commit is contained in:
commit
bcbe4e582c
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -44,6 +45,7 @@ class Categorie
|
|||||||
var $fk_parent;
|
var $fk_parent;
|
||||||
var $label;
|
var $label;
|
||||||
var $description;
|
var $description;
|
||||||
|
var $add_description; // For taxes like DEEE...
|
||||||
var $socid;
|
var $socid;
|
||||||
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member
|
var $type; // 0=Product, 1=Supplier, 2=Customer/Prospect, 3=Member
|
||||||
var $import_key;
|
var $import_key;
|
||||||
@ -73,7 +75,7 @@ class Categorie
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type";
|
$sql = "SELECT rowid, fk_parent, entity, label, description, add_description, fk_soc, visible, type";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
if ($id)
|
if ($id)
|
||||||
{
|
{
|
||||||
@ -97,6 +99,7 @@ class Categorie
|
|||||||
$this->fk_parent = $res['fk_parent'];
|
$this->fk_parent = $res['fk_parent'];
|
||||||
$this->label = $res['label'];
|
$this->label = $res['label'];
|
||||||
$this->description = $res['description'];
|
$this->description = $res['description'];
|
||||||
|
$this->add_description = $res['add_description'];
|
||||||
$this->socid = $res['fk_soc'];
|
$this->socid = $res['fk_soc'];
|
||||||
$this->visible = $res['visible'];
|
$this->visible = $res['visible'];
|
||||||
$this->type = $res['type'];
|
$this->type = $res['type'];
|
||||||
@ -156,6 +159,7 @@ class Categorie
|
|||||||
$sql.= "fk_parent,";
|
$sql.= "fk_parent,";
|
||||||
$sql.= " label,";
|
$sql.= " label,";
|
||||||
$sql.= " description,";
|
$sql.= " description,";
|
||||||
|
$sql.= " add_description,";
|
||||||
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
|
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
|
||||||
{
|
{
|
||||||
$sql.= "fk_soc,";
|
$sql.= "fk_soc,";
|
||||||
@ -168,6 +172,7 @@ class Categorie
|
|||||||
$sql.= $this->fk_parent.",";
|
$sql.= $this->fk_parent.",";
|
||||||
$sql.= "'".$this->db->escape($this->label)."',";
|
$sql.= "'".$this->db->escape($this->label)."',";
|
||||||
$sql.= "'".$this->db->escape($this->description)."',";
|
$sql.= "'".$this->db->escape($this->description)."',";
|
||||||
|
$sql.= "'".$this->db->escape($this->add_description)."',";
|
||||||
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
|
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
|
||||||
{
|
{
|
||||||
$sql.= ($this->socid != -1 ? $this->socid : 'null').",";
|
$sql.= ($this->socid != -1 ? $this->socid : 'null').",";
|
||||||
@ -244,7 +249,14 @@ class Categorie
|
|||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
|
||||||
$sql.= " SET label = '".$this->db->escape($this->label)."',";
|
$sql.= " SET label = '".$this->db->escape($this->label)."',";
|
||||||
$sql.= " description = '".$this->db->escape($this->description)."'";
|
if (! empty($this->description))
|
||||||
|
{
|
||||||
|
$sql .= ", description = '".$this->db->escape($this->description)."'";
|
||||||
|
}
|
||||||
|
if (! empty($this->add_description))
|
||||||
|
{
|
||||||
|
$sql .= ", add_description = '".$this->db->escape($this->add_description)."'";
|
||||||
|
}
|
||||||
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
|
if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
|
||||||
{
|
{
|
||||||
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');
|
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user