dolibarr 21.0.0-beta
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25require_once '../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php';
27
36// Load translation files required by the page
37$langs->load("exports");
38
39$export = new Export($db);
40$export->load_arrays($user);
41
42// Security check
43$result = restrictedArea($user, 'export');
44
45
46/*
47 * View
48 */
49
50$form = new Form($db);
51
52
53$help_url = 'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones|DE:Modul_DatenExporte';
54
55llxHeader('', $langs->trans("ExportsArea"), $help_url, '', 0, 0, '', '', '', 'mod-exports page-index');
56
57print load_fiche_titre($langs->trans("ExportsArea"));
58
59print $langs->trans("FormatedExportDesc1").'<br>';
60print '<br>';
61
62
63print '<div class="center">';
64if (count($export->array_export_code)) {
65 print dolGetButtonTitle($langs->trans('NewExport'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/exports/export.php?leftmenu=export', '', $user->hasRight('export', 'lire'));
66}
67print '</div>';
68print '<br>';
69
70
71
72// List of available export formats
73
74print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
75print '<table class="noborder centpercent">';
76print '<tr class="liste_titre">';
77print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
78print '<td>'.$langs->trans("LibraryShort").'</td>';
79print '<td class="right">'.$langs->trans("LibraryVersion").'</td>';
80print '</tr>';
81
82include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
83$model = new ModeleExports($db);
84$liste = $model->listOfAvailableExportFormat($db); // This is not a static method for exports because method load non static properties
85
86foreach ($liste as $key => $val) {
87 if (preg_match('/__\‍(Disabled\‍)__/', $liste[$key])) {
88 $liste[$key] = preg_replace('/__\‍(Disabled\‍)__/', '('.$langs->transnoentitiesnoconv("Disabled").')', $liste[$key]);
89 }
90
91 print '<tr class="oddeven">';
92 print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key), $model->getPictoForKey($key)).'</td>';
93 $text = $model->getDriverDescForKey($key);
94 $label = $liste[$key];
95 // @phan-suppress-next-line PhanPluginSuspiciousParamPosition
96 print '<td>'.$form->textwithpicto($label, $text).'</td>';
97 print '<td>'.$model->getLibLabelForKey($key).'</td>';
98 print '<td class="nowrap right">'.$model->getLibVersionForKey($key).'</td>';
99 print '</tr>';
100}
101
102print '</table>';
103print '</div>';
104
105// End of page
106llxFooter();
107$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
Class to manage exports.
Class to manage generation of HTML components Only common components must be here.
Parent class for export modules.
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.