Can delete an export profil.
This commit is contained in:
parent
93a47a9c1e
commit
174dcf24fc
@ -59,8 +59,8 @@ class Export
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Charge les lots de donn<EFBFBD>es exportables
|
* \brief Load an exportable dataset
|
||||||
* \param user Objet utilisateur qui exporte
|
* \param user Object user making export
|
||||||
* \param filter Code export pour charger un lot de donn<EFBFBD>es particulier
|
* \param filter Code export pour charger un lot de donn<EFBFBD>es particulier
|
||||||
*/
|
*/
|
||||||
function load_arrays($user,$filter='')
|
function load_arrays($user,$filter='')
|
||||||
@ -120,17 +120,19 @@ class Export
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nom module
|
// Module
|
||||||
$this->array_export_module[$i]=$module;
|
$this->array_export_module[$i]=$module;
|
||||||
|
// Icon
|
||||||
|
$this->array_export_icon[$i]=(isset($module->export_icon[$r])?$module->export_icon[$r]:$module->picto);
|
||||||
// Code du dataset export
|
// Code du dataset export
|
||||||
$this->array_export_code[$i]=$module->export_code[$r];
|
$this->array_export_code[$i]=$module->export_code[$r];
|
||||||
// Libell<EFBFBD> du dataset export
|
// Libelle du dataset export
|
||||||
$this->array_export_label[$i]=$module->getDatasetLabel($r);
|
$this->array_export_label[$i]=$module->getDatasetLabel($r);
|
||||||
// Tableau des champ <EFBFBD> exporter (cl<63>=champ, valeur=libell<6C>)
|
// Tableau des champ a exporter (cle=champ, valeur=libelle)
|
||||||
$this->array_export_fields[$i]=$module->export_fields_array[$r];
|
$this->array_export_fields[$i]=$module->export_fields_array[$r];
|
||||||
// Tableau des entites <EFBFBD> exporter (cl<63>=champ, valeur=entite)
|
// Tableau des entites a exporter (cle=champ, valeur=entite)
|
||||||
$this->array_export_entities[$i]=$module->export_entities_array[$r];
|
$this->array_export_entities[$i]=$module->export_entities_array[$r];
|
||||||
// Tableau des alias <EFBFBD> exporter (cl<63>=champ, valeur=alias)
|
// Tableau des alias a exporter (cle=champ, valeur=alias)
|
||||||
$this->array_export_alias[$i]=$module->export_alias_array[$r];
|
$this->array_export_alias[$i]=$module->export_alias_array[$r];
|
||||||
// Tableau des operations speciales sur champ
|
// Tableau des operations speciales sur champ
|
||||||
$this->array_export_special[$i]=$module->export_special_array[$r];
|
$this->array_export_special[$i]=$module->export_special_array[$r];
|
||||||
@ -266,8 +268,8 @@ class Export
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Cr<EFBFBD><EFBFBD> un mod<EFBFBD>le d'export
|
* \brief Create an export model in database
|
||||||
* \param user Objet utilisateur qui cr<EFBFBD>e
|
* \param user Objet utilisateur qui cree
|
||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
@ -281,8 +283,7 @@ class Export
|
|||||||
$sql.= 'label, type, field)';
|
$sql.= 'label, type, field)';
|
||||||
$sql.= " VALUES ('".$this->model_name."', '".$this->datatoexport."', '".$this->hexa."')";
|
$sql.= " VALUES ('".$this->model_name."', '".$this->datatoexport."', '".$this->hexa."')";
|
||||||
|
|
||||||
dolibarr_syslog("Export.class.php::create sql=".$sql);
|
dolibarr_syslog("Export::create sql=".$sql, LOG_DEBUG);
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -291,15 +292,17 @@ class Export
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error()." sql=".$sql;
|
$this->error=$this->db->lasterror();
|
||||||
|
$this->errno=$this->db->lasterrno();
|
||||||
|
dolibarr_syslog("Export::create error ".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Recup<EFBFBD>re de la base les caract<EFBFBD>ristiques d'un modele d'export
|
* \brief Load an export profil from database
|
||||||
* \param rowid id du mod<EFBFBD>le <EFBFBD> r<EFBFBD>cup<EFBFBD>rer
|
* \param rowid id of profil to load
|
||||||
*/
|
*/
|
||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
@ -307,8 +310,7 @@ class Export
|
|||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'export_model as em';
|
||||||
$sql.= ' WHERE em.rowid = '.$id;
|
$sql.= ' WHERE em.rowid = '.$id;
|
||||||
|
|
||||||
dolibarr_syslog("Export::fetch sql=$sql");
|
dolibarr_syslog("Export::fetch sql=".$sql, LOG_DEBUG);
|
||||||
|
|
||||||
$result = $this->db->query($sql) ;
|
$result = $this->db->query($sql) ;
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
@ -335,6 +337,61 @@ class Export
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Delete object in database
|
||||||
|
* \param user User that delete
|
||||||
|
* \param notrigger 0=launch triggers after, 1=disable triggers
|
||||||
|
* \return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function delete($user, $notrigger=0)
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
$error=0;
|
||||||
|
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."export_model";
|
||||||
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
dolibarr_syslog(get_class($this)."::delete sql=".$sql);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
|
// want this action call a trigger.
|
||||||
|
|
||||||
|
//// Call triggers
|
||||||
|
//include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||||
|
//$interface=new Interfaces($this->db);
|
||||||
|
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||||
|
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
|
//// End call triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
|
foreach($this->errors as $errmsg)
|
||||||
|
{
|
||||||
|
dolibarr_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||||
|
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||||
|
}
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1*$error;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -170,6 +170,15 @@ if ($action == 'builddoc')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'deleteprof')
|
||||||
|
{
|
||||||
|
if ($_GET["id"])
|
||||||
|
{
|
||||||
|
$objexport->fetch($_GET["id"]);
|
||||||
|
$result=$objexport->delete($user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == 'add_export_model')
|
if ($action == 'add_export_model')
|
||||||
{
|
{
|
||||||
if ($export_name)
|
if ($export_name)
|
||||||
@ -195,7 +204,12 @@ if ($action == 'add_export_model')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$objexport->error.'</div>';
|
$langs->load("errors");
|
||||||
|
if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans("ErrorExportDuplicateProfil").'</div>';
|
||||||
|
}
|
||||||
|
else $mesg='<div class="error">'.$objexport->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -269,10 +283,10 @@ if ($step == 1 || ! $datatoexport)
|
|||||||
{
|
{
|
||||||
$val=!$val;
|
$val=!$val;
|
||||||
print '<tr '.$bc[$val].'><td nospan="nospan">';
|
print '<tr '.$bc[$val].'><td nospan="nospan">';
|
||||||
print img_object($objexport->array_export_module[$key]->getName(),$objexport->array_export_module[$key]->picto).' ';
|
|
||||||
print $objexport->array_export_module[$key]->getName();
|
print $objexport->array_export_module[$key]->getName();
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
//print $value;
|
//print $value;
|
||||||
|
print img_object($objexport->array_export_module[$key]->getName(),$objexport->array_export_icon[$key]).' ';
|
||||||
print $objexport->array_export_label[$key];
|
print $objexport->array_export_label[$key];
|
||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"),'filenew').'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&datatoexport='.$objexport->array_export_code[$key].'">'.img_picto($langs->trans("NewExport"),'filenew').'</a>';
|
||||||
@ -319,13 +333,16 @@ if ($step == 2 && $datatoexport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
|
//print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
|
||||||
print $objexport->array_export_module[0]->getName();
|
print $objexport->array_export_module[0]->getName();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a exporter
|
// Lot de donnees a exporter
|
||||||
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
||||||
print '<td>'.$objexport->array_export_label[0].'</td></tr>';
|
print '<td>';
|
||||||
|
print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_icon[0]).' ';
|
||||||
|
print $objexport->array_export_label[0];
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -459,13 +476,16 @@ if ($step == 3 && $datatoexport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
|
//print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
|
||||||
print $objexport->array_export_module[0]->getName();
|
print $objexport->array_export_module[0]->getName();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donn<6E>es <20> exporter
|
// Lot de donn<6E>es <20> exporter
|
||||||
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
||||||
print '<td>'.$objexport->array_export_label[0].'</td></tr>';
|
print '<td>';
|
||||||
|
print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_icon[0]).' ';
|
||||||
|
print $objexport->array_export_label[0];
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Nbre champs export<72>s
|
// Nbre champs export<72>s
|
||||||
print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
|
||||||
@ -521,32 +541,6 @@ if ($step == 3 && $datatoexport)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
// Bouton exports profils
|
|
||||||
if (sizeof($array_selected))
|
|
||||||
{
|
|
||||||
print '<br>';
|
|
||||||
print $langs->trans("SaveExportModel");
|
|
||||||
|
|
||||||
print '<form class="nocellnopadd" action="export.php" method="post">';
|
|
||||||
print '<input type="hidden" name="action" value="add_export_model">';
|
|
||||||
print '<input type="hidden" name="step" value="'.$step.'">';
|
|
||||||
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
|
|
||||||
print '<input type="hidden" name="hexa" value="'.$hexa.'">';
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print '<td>'.$langs->trans("ExportModelName").'</td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '</tr>';
|
|
||||||
$var=false;
|
|
||||||
print '<tr '.$bc[$var].'>';
|
|
||||||
print '<td><input name="export_name" size="32" value=""></td><td>';
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
print '</table>';
|
|
||||||
print '</form>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@ -565,6 +559,63 @@ if ($step == 3 && $datatoexport)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
// Area for profils export
|
||||||
|
if (sizeof($array_selected))
|
||||||
|
{
|
||||||
|
print '<br>';
|
||||||
|
print $langs->trans("SaveExportModel");
|
||||||
|
|
||||||
|
print '<form class="nocellnopadd" action="export.php" method="post">';
|
||||||
|
print '<input type="hidden" name="action" value="add_export_model">';
|
||||||
|
print '<input type="hidden" name="step" value="'.$step.'">';
|
||||||
|
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
|
||||||
|
print '<input type="hidden" name="hexa" value="'.$hexa.'">';
|
||||||
|
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("ExportModelName").'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
$var=false;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td><input name="export_name" size="32" value=""></td><td align="right">';
|
||||||
|
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// List of existing export profils
|
||||||
|
$sql = "SELECT rowid, label";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||||
|
$sql.= " WHERE type = '".$datatoexport."'";
|
||||||
|
$sql.= " ORDER BY rowid";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
$var=false;
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
print '<tr '.$bc[$var].'><td>';
|
||||||
|
print $obj->label;
|
||||||
|
print '</td><td align="right">';
|
||||||
|
print '<a href="'.$_SERVER["PHP_SELF"].'?step='.$step.'&datatoexport='.$datatoexport.'&action=deleteprof&id='.$obj->rowid.'">';
|
||||||
|
print img_delete();
|
||||||
|
print '</a>';
|
||||||
|
print '</tr>';
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($step == 4 && $datatoexport)
|
if ($step == 4 && $datatoexport)
|
||||||
@ -602,13 +653,16 @@ if ($step == 4 && $datatoexport)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("Module").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
|
//print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' ';
|
||||||
print $objexport->array_export_module[0]->getName();
|
print $objexport->array_export_module[0]->getName();
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Lot de donnees a exporter
|
// Lot de donnees a exporter
|
||||||
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
||||||
print '<td>'.$objexport->array_export_label[0].'</td></tr>';
|
print '<td>';
|
||||||
|
print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_icon[0]).' ';
|
||||||
|
print $objexport->array_export_label[0];
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Nbre champs exportes
|
// Nbre champs exportes
|
||||||
print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
|
print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
|
||||||
|
|||||||
@ -218,6 +218,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r]='Factures fournisseurs et lignes de facture';
|
$this->export_label[$r]='Factures fournisseurs et lignes de facture';
|
||||||
|
$this->export_icon[$r]='bill';
|
||||||
$this->export_permission[$r]=array(array("fournisseur","facture","export"));
|
$this->export_permission[$r]=array(array("fournisseur","facture","export"));
|
||||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePayed",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_taux'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineHT",'fd.total_ttc'=>"LineTTC",'fd.tva'=>"LineVAT");
|
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePayed",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_taux'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineHT",'fd.total_ttc'=>"LineTTC",'fd.tva'=>"LineVAT");
|
||||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_taux'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line");
|
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_taux'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line");
|
||||||
@ -229,6 +230,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r]='Factures fournisseurs et reglements';
|
$this->export_label[$r]='Factures fournisseurs et reglements';
|
||||||
|
$this->export_icon[$r]='bill';
|
||||||
$this->export_permission[$r]=array(array("fournisseur","facture","export"));
|
$this->export_permission[$r]=array(array("fournisseur","facture","export"));
|
||||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePayed",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
|
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePayed",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
|
||||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
|
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
|
||||||
|
|||||||
@ -199,6 +199,7 @@ class modSociete extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r]='ExportDataset_company_2';
|
$this->export_label[$r]='ExportDataset_company_2';
|
||||||
|
$this->export_icon[$r]='contact';
|
||||||
$this->export_permission[$r]=array(array("societe","contact","export"));
|
$this->export_permission[$r]=array(array("societe","contact","export"));
|
||||||
$this->export_fields_array[$r]=array('c.civilite'=>"CivilityCode",'c.name'=>'Lastname','c.firstname'=>'Firstname','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.cp'=>"Zip",'c.ville'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
|
$this->export_fields_array[$r]=array('c.civilite'=>"CivilityCode",'c.name'=>'Lastname','c.firstname'=>'Firstname','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.cp'=>"Zip",'c.ville'=>"Town",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.email'=>"EMail",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode");
|
||||||
$this->export_entities_array[$r]=array('c.civilite'=>"contact",'c.name'=>'contact','c.firstname'=>'contact','c.datec'=>"contact",'c.tms'=>"contact",'c.priv'=>"contact",'c.address'=>"contact",'c.cp'=>"contact",'c.ville'=>"contact",'c.phone'=>"contact",'c.fax'=>"contact",'c.email'=>"contact",'p.libelle'=>"contact",'p.code'=>"contact",'s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company");
|
$this->export_entities_array[$r]=array('c.civilite'=>"contact",'c.name'=>'contact','c.firstname'=>'contact','c.datec'=>"contact",'c.tms'=>"contact",'c.priv'=>"contact",'c.address'=>"contact",'c.cp'=>"contact",'c.ville'=>"contact",'c.phone'=>"contact",'c.fax'=>"contact",'c.email'=>"contact",'p.libelle'=>"contact",'p.code'=>"contact",'s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company");
|
||||||
|
|||||||
@ -18,25 +18,24 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\defgroup stock Module stock
|
* \defgroup stock Module stock
|
||||||
\brief Module pour gerer la tenue de stocks produits
|
* \brief Module pour gerer la tenue de stocks produits
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/includes/modules/modStock.class.php
|
* \file htdocs/includes/modules/modStock.class.php
|
||||||
\ingroup stock
|
* \ingroup stock
|
||||||
\brief Fichier de description et activation du module Stock
|
* \brief Fichier de description et activation du module Stock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
|
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\class modStock
|
* \class modStock
|
||||||
\brief Classe de description et activation du module Stock
|
* \brief Classe de description et activation du module Stock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class modStock extends DolibarrModules
|
class modStock extends DolibarrModules
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -122,11 +121,11 @@ class modStock extends DolibarrModules
|
|||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r]="Stocks"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
$this->export_label[$r]="WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||||
$this->export_permission[$r]=array(array("stock","lire"));
|
$this->export_permission[$r]=array(array("stock","lire"));
|
||||||
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'RealStock','e.rowid'=>'IdWarehouse','e.label'=>'LabelWareHouse','e.label'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.cp'=>'Zip','e.ville'=>'Town');
|
$this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LabelWareHouse','e.label'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.cp'=>'Zip','e.ville'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'Stock');
|
||||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'stock','e.rowid'=>'warehouse','e.label'=>'warehouse','e.label'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.cp'=>'warehouse','e.ville'=>'warehouse');
|
$this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.label'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.cp'=>'warehouse','e.ville'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'stock');
|
||||||
$this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.fk_product_type'=>"type",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.price'=>"price",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification','ps.reel'=>'quantity','e.rowid'=>'idwarehouse','e.label'=>'labelwarehouse','e.label'=>'descwarehouse','e.lieu'=>'lieuwarehouse','e.address'=>'addresswarehouse','e.cp'=>'zipwarehouse','e.ville'=>'townwarehouse');
|
$this->export_alias_array[$r]=array('e.rowid'=>'idwarehouse','e.label'=>'labelwarehouse','e.label'=>'descwarehouse','e.lieu'=>'lieuwarehouse','e.address'=>'addresswarehouse','e.cp'=>'zipwarehouse','e.ville'=>'townwarehouse','p.rowid'=>"id",'p.ref'=>"ref",'p.fk_product_type'=>"type",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.price'=>"price",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification','ps.reel'=>'quantity');
|
||||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e';
|
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e';
|
||||||
$this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid';
|
$this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid';
|
||||||
|
|||||||
@ -35,4 +35,5 @@ WarningAllowUrlFopenMustBeOn=Parameter <b>allow_url_fopen</b> must be set to <b>
|
|||||||
WarningBuildScriptNotRunned=Script <b>%s</b> was not yet ran to build graphics, or there is no data to show.
|
WarningBuildScriptNotRunned=Script <b>%s</b> was not yet ran to build graphics, or there is no data to show.
|
||||||
WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists.
|
WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists.
|
||||||
WarningPassIsEmpty=Warning, database password is empty. This is a security hole. You should add a password to your database and change your conf.php file to reflect this.
|
WarningPassIsEmpty=Warning, database password is empty. This is a security hole. You should add a password to your database and change your conf.php file to reflect this.
|
||||||
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
||||||
|
ErrorExportDuplicateProfil=This profil name already exists for this export set.
|
||||||
@ -58,4 +58,5 @@ MininumStockShort=Stock min
|
|||||||
StockUpShort=Stock up
|
StockUpShort=Stock up
|
||||||
IdWarehouse=Id warehouse
|
IdWarehouse=Id warehouse
|
||||||
DescWareHouse=Description warehouse
|
DescWareHouse=Description warehouse
|
||||||
LieuWareHouse=Localisation warehouse
|
LieuWareHouse=Localisation warehouse
|
||||||
|
WarehousesAndProducts=Warehouses and products
|
||||||
@ -35,4 +35,5 @@ WarningAllowUrlFopenMustBeOn=Attention, le param
|
|||||||
WarningBuildScriptNotRunned=Le script <b>%s</b> n'a pas encore été lancé pour générer les graphiques ou il n'y a aucune donnée à afficher.
|
WarningBuildScriptNotRunned=Le script <b>%s</b> n'a pas encore été lancé pour générer les graphiques ou il n'y a aucune donnée à afficher.
|
||||||
WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (URL) existe déjà.
|
WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (URL) existe déjà.
|
||||||
WarningPassIsEmpty=Attention, le mot de passe de la base de donnée Dolibarr est vide. Cela représente une faille de sécurité. Il est recommandé d'ajouter manuellement un mot de passe à la base et de modifier le fichier conf.php pour refléter ce changement.
|
WarningPassIsEmpty=Attention, le mot de passe de la base de donnée Dolibarr est vide. Cela représente une faille de sécurité. Il est recommandé d'ajouter manuellement un mot de passe à la base et de modifier le fichier conf.php pour refléter ce changement.
|
||||||
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
||||||
|
ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export.
|
||||||
|
|||||||
@ -59,3 +59,4 @@ StockUpShort=Stock max
|
|||||||
IdWarehouse=Id entrepôt
|
IdWarehouse=Id entrepôt
|
||||||
DescWareHouse=Description entrepôt
|
DescWareHouse=Description entrepôt
|
||||||
LieuWareHouse=Lieu entrepôt
|
LieuWareHouse=Lieu entrepôt
|
||||||
|
WarehousesAndProducts=Entrepôts et produits
|
||||||
@ -76,6 +76,9 @@ alter table llx_don add note_public text;
|
|||||||
alter table llx_don add model_pdf varchar(50);
|
alter table llx_don add model_pdf varchar(50);
|
||||||
alter table llx_don add import_key varchar(14);
|
alter table llx_don add import_key varchar(14);
|
||||||
|
|
||||||
|
ALTER TABLE llx_export_model DROP INDEX uk_export_model;
|
||||||
|
ALTER TABLE llx_export_model ADD UNIQUE uk_export_model (label,type);
|
||||||
|
|
||||||
-- Reverse option
|
-- Reverse option
|
||||||
update llx_const set visible = 1, name = 'FACTURE_ENABLE_RECUR', value='1' where name = 'FACTURE_DISABLE_RECUR' and value = '0';
|
update llx_const set visible = 1, name = 'FACTURE_ENABLE_RECUR', value='1' where name = 'FACTURE_DISABLE_RECUR' and value = '0';
|
||||||
delete from llx_const where name = 'FACTURE_DISABLE_RECUR' and value = '1';
|
delete from llx_const where name = 'FACTURE_DISABLE_RECUR' and value = '1';
|
||||||
@ -83,3 +86,4 @@ delete from llx_const where name = 'FACTURE_DISABLE_RECUR' and value = '1';
|
|||||||
|
|
||||||
update llx_bank_account set ref = label where ref is null or ref = '';
|
update llx_bank_account set ref = label where ref is null or ref = '';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
-- Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
-- Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
-- Copyright (C) 2007 Regis Houssin <regis@dolibarr.fr>
|
-- Copyright (C) 2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
@ -20,4 +20,4 @@
|
|||||||
-- ===================================================================
|
-- ===================================================================
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE llx_export_model ADD UNIQUE uk_export_model (label);
|
ALTER TABLE llx_export_model ADD UNIQUE uk_export_model (label,type);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user