Debug filter during export
This commit is contained in:
parent
2e0554bfbd
commit
d9cdb542d5
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
@ -250,7 +250,7 @@ class modSociete extends DolibarrModules
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.address'=>"Address",'s.cp'=>"Zip",'s.ville'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','d.nom'=>'State');
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix';
|
||||
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.cp'=>"Text",'s.ville'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
|
||||
$this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.cp'=>"Text",'s.ville'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
|
||||
$this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.cp'=>"Text",'s.ville'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'Text');
|
||||
$this->export_entities_array[$r]=array(); // We define here only fields that use another picto
|
||||
// Add extra fields
|
||||
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'";
|
||||
|
||||
@ -339,8 +339,10 @@ class Export
|
||||
{
|
||||
$szFilterField='';
|
||||
$InfoFieldList = explode(":", $TypeField);
|
||||
|
||||
// build the input field on depend of the type of file
|
||||
switch ($InfoFieldList[0]) {
|
||||
switch ($InfoFieldList[0])
|
||||
{
|
||||
case 'Text':
|
||||
case 'Date':
|
||||
case 'Duree':
|
||||
@ -387,6 +389,13 @@ class Export
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
if ($obj->$InfoFieldList[2] == '-')
|
||||
{
|
||||
// Discard entry '-'
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$labeltoshow=dol_trunc($obj->$InfoFieldList[2],18);
|
||||
if (!empty($ValueField) && $ValueField == $obj->rowid)
|
||||
{
|
||||
@ -401,7 +410,7 @@ class Export
|
||||
}
|
||||
$szFilterField.="</select>";
|
||||
|
||||
$this->db->close();
|
||||
$this->db->free();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -767,6 +767,7 @@ if ($step == 3 && $datatoexport)
|
||||
print img_object('',$entityicon).' '.$langs->trans($entitylang);
|
||||
print '</td>';
|
||||
|
||||
// Field name
|
||||
$labelName=(! empty($fieldsarray[$code])?$fieldsarray[$code]:'');
|
||||
$ValueFilter=(! empty($array_filtervalue[$code])?$array_filtervalue[$code]:'');
|
||||
$text=$langs->trans($labelName);
|
||||
@ -777,11 +778,13 @@ if ($step == 3 && $datatoexport)
|
||||
print '<td>';
|
||||
print $form->textwithpicto($text,$htmltext);
|
||||
print '</td>';
|
||||
|
||||
// Filter value
|
||||
print '<td>';
|
||||
if (! empty($Typefieldsarray[$code]))
|
||||
{
|
||||
$szInfoFiltre=$objexport->genDocFilter($Typefieldsarray[$code]);
|
||||
if ($szInfoFiltre)
|
||||
if ($szInfoFiltre) // Is there an info help for this filter ?
|
||||
{
|
||||
$tmp=$objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
|
||||
print $form->textwithpicto($tmp, $szInfoFiltre);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user