2
0
forked from Wavyzz/dolibarr

FIX Missing extrafields into export of agenda record

This commit is contained in:
Laurent Destailleur
2021-04-16 10:26:35 +02:00
parent 460d6a0589
commit 38f54d0582
2 changed files with 8 additions and 0 deletions

View File

@@ -1,5 +1,9 @@
<?php
// $keyforselect = name of main table
// keyforelement = name of picto
// $keyforaliasextra = a key to avoid conflict with extrafields of other objects
if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra))
{
//print $keyforselet.' - '.$keyforelement.' - '.$keyforaliasextra;

View File

@@ -454,8 +454,12 @@ class modAgenda extends DolibarrModules
'p.ref' => 'project',
);
$keyforselect = 'actioncomm'; $keyforelement = 'action'; $keyforaliasextra = 'extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'actioncomm as ac';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_extrafields as extra ON ac.id = extra.fk_object';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id';
if (!empty($user) && empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid';