Add categories export dataset
This commit is contained in:
parent
4701a45ae4
commit
78f894ff25
@ -47,7 +47,7 @@ class Categorie
|
||||
var $description;
|
||||
var $socid;
|
||||
var $statut;
|
||||
var $type; // 0=Produit, 1=Fournisseur, 2=Tiers
|
||||
var $type; // 0=Produit, 1=Tiers fournisseur, 2=Tiers client/prospect
|
||||
|
||||
var $cats=array(); // Tableau en memoire des categories
|
||||
var $motherof = array(); // Tableau des correspondances id_fille -> id_mere
|
||||
|
||||
@ -45,6 +45,7 @@ $entitytoicon=array(
|
||||
'account'=>'account',
|
||||
'payment'=>'payment',
|
||||
'product'=>'product','stock'=>'generic','warehouse'=>'stock',
|
||||
'category'=>'generic',
|
||||
'other'=>'generic',
|
||||
);
|
||||
$entitytolang=array( // Translation code
|
||||
@ -58,6 +59,7 @@ $entitytolang=array( // Translation code
|
||||
'account'=>'BankTransactions',
|
||||
'payment'=>'Payment',
|
||||
'product'=>'Product','stock'=>'Stock','warehouse'=>'Warehouse',
|
||||
'category'=>'Category',
|
||||
'other'=>'Other'
|
||||
);
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ print '<br>';
|
||||
|
||||
print '<table class="notopnoleftnoright" width="100%">';
|
||||
|
||||
print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
print '<tr><td valign="top" width="40%" class="notopnoleft">';
|
||||
|
||||
|
||||
// Liste des formats d'exports disponibles
|
||||
@ -81,7 +81,7 @@ foreach($liste as $key)
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
print '</td><td valign="top" width="60%" class="notopnoleftnoright">';
|
||||
|
||||
|
||||
// Affiche les modules d'exports
|
||||
|
||||
@ -57,14 +57,18 @@ class modCategorie extends DolibarrModules
|
||||
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
$this->special = 0;
|
||||
$this->picto = '';
|
||||
$this->picto = 'generic';
|
||||
|
||||
// Dir
|
||||
$this->dirs = array();
|
||||
|
||||
// Dépendances
|
||||
// Dependencies
|
||||
$this->depends = array("modProduit");
|
||||
|
||||
// Config pages
|
||||
$this->config_page_url = array();
|
||||
$this->langfiles = array("products","companies","categories");
|
||||
|
||||
// Constantes
|
||||
$this->const = array();
|
||||
|
||||
@ -104,6 +108,46 @@ class modCategorie extends DolibarrModules
|
||||
$this->rights[$r][3] = 1; // La permission est-elle une permission par défaut
|
||||
$this->rights[$r][4] = 'voir';
|
||||
$r++;
|
||||
|
||||
// Exports
|
||||
//--------
|
||||
$r=0;
|
||||
|
||||
$r++;
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='List of supplier categories';
|
||||
$this->export_permission[$r]=array(array("categorie","lire"));
|
||||
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'CompanyId','s.nom'=>'Name');
|
||||
$this->export_entities_array[$r]=array('u.rowid'=>"category",'u.label'=>"category",'u.description'=>"category",'s.rowid'=>'company','s.nom'=>'company');
|
||||
$this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'s.rowid'=>'idsoc','s.nom'=>'name');
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s';
|
||||
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
|
||||
$this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories
|
||||
|
||||
$r++;
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='List of customer/prospect categories';
|
||||
$this->export_permission[$r]=array(array("categorie","lire"));
|
||||
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'CompanyId','s.nom'=>'Name');
|
||||
$this->export_entities_array[$r]=array('u.rowid'=>"category",'u.label'=>"category",'u.description'=>"category",'s.rowid'=>'company','s.nom'=>'company');
|
||||
$this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'s.rowid'=>'idsoc','s.nom'=>'name');
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s';
|
||||
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
|
||||
$this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories
|
||||
|
||||
$r++;
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='List of products categories';
|
||||
$this->export_permission[$r]=array(array("categorie","lire"));
|
||||
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'ProductId','p.ref'=>'Ref');
|
||||
$this->export_entities_array[$r]=array('u.rowid'=>"category",'u.label'=>"category",'u.description'=>"category",'p.rowid'=>'product','p.ref'=>'product');
|
||||
$this->export_alias_array[$r]=array('u.rowid'=>"idcateg",'u.label'=>"label",'u.description'=>"description",'p.rowid'=>'idprod','p.ref'=>'ref');
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p';
|
||||
$this->export_sql_end[$r] .=' WHERE u.rowid = cp.fk_categorie AND cp.fk_product = p.rowid';
|
||||
$this->export_sql_end[$r] .=' AND u.type = 0'; // Supplier categories
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ class modProduit extends DolibarrModules
|
||||
// Dir
|
||||
$this->dirs = array();
|
||||
|
||||
// D<EFBFBD>pendances
|
||||
// Dependencies
|
||||
$this->depends = array();
|
||||
$this->requiredby = array("modStock","modService","modBarcode");
|
||||
|
||||
|
||||
@ -15,28 +15,25 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\defgroup user Module user
|
||||
\brief Module pour g<EFBFBD>rer les utilisateurs
|
||||
* \defgroup user Module user
|
||||
* \brief Module pour gerer les utilisateurs
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/includes/modules/modUser.class.php
|
||||
\ingroup user
|
||||
\brief Fichier de description et activation du module Utilisateur
|
||||
* \file htdocs/includes/modules/modUser.class.php
|
||||
* \ingroup user
|
||||
* \brief Fichier de description et activation du module Utilisateur
|
||||
*/
|
||||
|
||||
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
|
||||
|
||||
/**
|
||||
\class modUser
|
||||
\brief Classe de description et activation du module User
|
||||
* \class modUser
|
||||
* \brief Classe de description et activation du module User
|
||||
*/
|
||||
|
||||
class modUser extends DolibarrModules
|
||||
{
|
||||
|
||||
|
||||
@ -75,4 +75,5 @@ ThisCategoryHasNoCustomer=This category does not contain any customer.
|
||||
AssignedToCustomer=Assigned to a customer
|
||||
AssignedToTheCustomer=Assigned to the customer
|
||||
InternalCategory=Inernal category
|
||||
CategoryContents=Category contents
|
||||
CategoryContents=Category contents
|
||||
CategId=Category id
|
||||
@ -75,4 +75,5 @@ ThisCategoryHasNoCustomer=Cette cat
|
||||
AssignedToCustomer=Attribuer à un client
|
||||
AssignedToTheCustomer=Attribué au client
|
||||
InternalCategory=Catégorie interne
|
||||
CategoryContents=Contenu de la catégorie
|
||||
CategoryContents=Contenu de la catégorie
|
||||
CategId=Id categorie
|
||||
Loading…
Reference in New Issue
Block a user