Merge pull request #10602 from hregis/8.0_mc
FIX missing entity filter in function "build_filterField()" (export module)
This commit is contained in:
commit
c8b4265c12
@ -279,7 +279,7 @@ class modAdherent extends DolibarrModules
|
||||
'a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",
|
||||
'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",
|
||||
'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note_public'=>"Text",'a.note_private'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date',
|
||||
'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric'
|
||||
'a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle::member_type','ta.libelle'=>'Text','c.rowid'=>'Numeric','c.dateadh'=>'Date','c.subscription'=>'Numeric'
|
||||
);
|
||||
$this->export_entities_array[$r]=array(
|
||||
'a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member',
|
||||
|
||||
@ -223,7 +223,7 @@ class modCommande extends DolibarrModules
|
||||
'c.date_commande'=>"Date",'c.date_livraison'=>"Date",'c.amount_ht'=>"Numeric",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",
|
||||
'c.total_ttc'=>"Numeric",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','pj.ref'=>'Text',
|
||||
'cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",
|
||||
'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text','d.nom'=>'Text'
|
||||
'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:ref::product','p.ref'=>'Text','p.label'=>'Text','d.nom'=>'Text'
|
||||
);
|
||||
$this->export_entities_array[$r]=array(
|
||||
's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','d.nom'=>'company','co.label'=>'company',
|
||||
|
||||
@ -216,9 +216,9 @@ class modProjet extends DolibarrModules
|
||||
$this->export_permission[$r]=array(array("projet","export"));
|
||||
$this->export_dependencies_array[$r]=array('projecttask'=>'pt.rowid', 'task_time'=>'ptt.rowid');
|
||||
|
||||
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
|
||||
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
|
||||
's.phone'=>'Text','s.email'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
|
||||
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.opp_amount'=>'Numeric','p.description'=>"Text",'p.entity'=>'Numeric',
|
||||
'p.rowid'=>"List:projet:ref::project",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.opp_amount'=>'Numeric','p.description'=>"Text",'p.entity'=>'Numeric',
|
||||
'pt.rowid'=>'Text','pt.label'=>'Text','pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Numeric",'pt.progress'=>"Numeric",'pt.description'=>"Text",
|
||||
'ptt.rowid'=>'Numeric','ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)",'ptt.note'=>"Text");
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
|
||||
@ -359,7 +359,7 @@ class modProjet extends DolibarrModules
|
||||
$sql[] ="INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('beluga','project',".$conf->entity.")";
|
||||
$sql[] ="DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'baleine' AND type = 'project' AND entity = ".$conf->entity;
|
||||
$sql[] ="INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('baleine','project',".$conf->entity.")";
|
||||
|
||||
|
||||
|
||||
return $this->_init($sql,$options);
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ class modSociete extends DolibarrModules
|
||||
$this->export_TypeFields_array[$r]=array(
|
||||
'c.civility'=>"List:c_civility:label:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",
|
||||
'c.address'=>"Text",'c.zip'=>"Text",'c.town'=>"Text",'d.nom'=>'Text','co.label'=>"List:c_country:label:rowid",'co.code'=>"Text",'c.phone'=>"Text",
|
||||
'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",
|
||||
'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom::thirdparty",'s.nom'=>"Text",'s.status'=>"Status",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",
|
||||
's.client'=>"Text",'s.fournisseur'=>"Text"
|
||||
);
|
||||
$this->export_entities_array[$r]=array(
|
||||
|
||||
@ -72,9 +72,9 @@ class modStock extends DolibarrModules
|
||||
// Constants
|
||||
$this->const = array();
|
||||
$r=0;
|
||||
|
||||
|
||||
$this->const[$r] = array('STOCK_ALLOW_NEGATIVE_TRANSFER','chaine','1','',1);
|
||||
|
||||
|
||||
$r++;
|
||||
$this->const[$r][0] = "STOCK_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
@ -197,7 +197,7 @@ class modStock extends DolibarrModules
|
||||
'p.tms'=>'DateModification','p.pmp'=>'PMPValue','p.cost_price'=>'CostPrice'
|
||||
);
|
||||
$this->export_TypeFields_array[$r]=array(
|
||||
'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label",
|
||||
'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text','p.rowid'=>"List:product:label::product",
|
||||
'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",'p.price'=>"Numeric",'p.tva_tx'=>'Numeric',
|
||||
'p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date','p.pmp'=>'Numeric','p.cost_price'=>'Numeric',
|
||||
'ps.reel'=>'Numeric'
|
||||
@ -236,8 +236,8 @@ class modStock extends DolibarrModules
|
||||
'p.tms'=>'DateModification','pb.rowid'=>'Id','pb.batch'=>'Batch','pb.qty'=>'Qty','pl.eatby'=>'EatByDate','pl.sellby'=>'SellByDate'
|
||||
);
|
||||
$this->export_TypeFields_array[$r]=array(
|
||||
'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.lieu'=>'Text','e.description'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
||||
'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.lieu'=>'Text','e.description'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label::product",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
||||
'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date',
|
||||
'pb.batch'=>'Text','pb.qty'=>'Numeric','pl.eatby'=>'Date','pl.sellby'=>'Date'
|
||||
);
|
||||
@ -274,8 +274,8 @@ class modStock extends DolibarrModules
|
||||
'sm.inventorycode'=>'InventoryCode'
|
||||
);
|
||||
$this->export_TypeFields_array[$r]=array(
|
||||
'e.rowid'=>'List:entrepot:ref','e.ref'=>'Text','e.description'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
||||
'e.rowid'=>'List:entrepot:ref::stock','e.ref'=>'Text','e.description'=>'Text','e.lieu'=>'Text','e.address'=>'Text','e.zip'=>'Text','e.town'=>'Text',
|
||||
'p.rowid'=>"List:product:label::product",'p.ref'=>"Text",'p.fk_product_type'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.note'=>"Text",
|
||||
'p.price'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date',
|
||||
'sm.rowid'=>'Numeric','sm.value'=>'Numeric','sm.datem'=>'Date','sm.batch'=>'Text','sm.label'=>'Text','sm.inventorycode'=>'Text'
|
||||
);
|
||||
@ -347,8 +347,8 @@ class modStock extends DolibarrModules
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function called when module is enabled.
|
||||
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
||||
|
||||
@ -411,7 +411,9 @@ class Export
|
||||
// 1 : Nom de la table
|
||||
// 2 : Nom du champ contenant le libelle
|
||||
// 3 : Name of field with key (if it is not "rowid"). Used this field as key for combo list.
|
||||
if (count($InfoFieldList)==4)
|
||||
// 4 : Name of element for getEntity().
|
||||
|
||||
if (! empty($InfoFieldList[3]))
|
||||
$keyList=$InfoFieldList[3];
|
||||
else
|
||||
$keyList='rowid';
|
||||
@ -419,6 +421,9 @@ class Export
|
||||
if ($InfoFieldList[1] == 'c_stcomm') $sql = 'SELECT id as id, '.$keyList.' as rowid, '.$InfoFieldList[2].' as label'.(empty($InfoFieldList[3])?'':', '.$InfoFieldList[3].' as code');
|
||||
if ($InfoFieldList[1] == 'c_country') $sql = 'SELECT '.$keyList.' as rowid, '.$InfoFieldList[2].' as label, code as code';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[1];
|
||||
if (! empty($InfoFieldList[4])) {
|
||||
$sql.= ' WHERE entity IN ('.getEntity($InfoFieldList[4]).')';
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@ -52,6 +52,7 @@ if (! $sortorder) $sortorder="DESC";
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
|
||||
// Security check
|
||||
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
|
||||
$result=restrictedArea($user,'stock');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
|
||||
@ -33,6 +33,7 @@ $id = GETPOST('id','int');
|
||||
$ref = GETPOST('ref','alpha');
|
||||
|
||||
// Security check
|
||||
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
|
||||
$result=restrictedArea($user,'stock');
|
||||
|
||||
|
||||
|
||||
@ -46,9 +46,6 @@ if (! empty($conf->projet->enabled))
|
||||
$langs->loadLangs(array('products', 'stocks'));
|
||||
if (! empty($conf->productbatch->enabled)) $langs->load("productbatch");
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'stock');
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$ref = GETPOST('ref','alpha');
|
||||
$msid=GETPOST('msid','int');
|
||||
@ -57,6 +54,10 @@ $action=GETPOST('action','aZ09');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'movementlist';
|
||||
|
||||
// Security check
|
||||
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
|
||||
$result=restrictedArea($user,'stock');
|
||||
|
||||
$idproduct = GETPOST('idproduct','int');
|
||||
$year = GETPOST("year");
|
||||
$month = GETPOST("month");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user