Merge pull request #23690 from Hystepik/develop#2

New : Export for module ticket
This commit is contained in:
Laurent Destailleur 2023-01-25 23:44:48 +01:00 committed by GitHub
commit 57f700d674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -208,6 +208,13 @@ class modTicket extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'manage';
$r++;
$this->rights[$r][0] = 56006; // id de la permission
$this->rights[$r][1] = "Export ticket"; // libelle de la permission
//$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export';
/* Seems not used and in conflict with societe->client->voir (see all thirdparties)
$r++;
$this->rights[$r][0] = 56005; // id de la permission
@ -318,6 +325,27 @@ class modTicket extends DolibarrModules
'target' => '',
'user' => 0);
$r++;
// Exports
//--------
$r = 1;
// Export list of tickets and attributes
$langs->load("ticket");
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ExportDataset_ticket_1'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r] = array(array("ticket", "export"));
$this->export_icon[$r]='ticket';
$keyforclass = 'Ticket';$keyforclassfile='/ticket/class/ticket.class.php';$keyforelement='ticket';
include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
$keyforselect='ticket'; $keyforaliasextra='extra'; $keyforelement='ticket';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'ticket as t';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'ticket_extrafields as extra on (t.rowid = extra.fk_object)';
$this->export_sql_end[$r] .=' WHERE 1 = 1';
$this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('ticket').')';
$r++;
}
/**

View File

@ -26,6 +26,7 @@ Permission56002=Modify tickets
Permission56003=Delete tickets
Permission56004=Manage tickets
Permission56005=See tickets of all third parties (not effective for external users, always be limited to the third party they depend on)
Permission56006=Export tickets
Tickets=Tickets
TicketDictType=Ticket - Types
@ -61,6 +62,8 @@ TypeContact_ticket_external_CONTRIBUTOR=External contributor
OriginEmail=Reporter Email
Notify_TICKET_SENTBYMAIL=Send ticket message by email
ExportDataset_ticket_1=Tickets
# Status
Read=Read
Assigned=Assigned