dolibarr  9.0.0
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
24 require_once '../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php';
26 
27 // Load translation files required by the page
28 $langs->load("exports");
29 
30 // Security check
31 $result=restrictedArea($user,'export');
32 
33 $export=new Export($db);
34 $export->load_arrays($user);
35 
36 /*
37  * View
38  */
39 
40 $form=new Form($db);
41 
42 llxHeader('',$langs->trans("ExportsArea"),'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
43 
44 print load_fiche_titre($langs->trans("ExportsArea"));
45 
46 print $langs->trans("FormatedExportDesc1").'<br>';
47 //print $langs->trans("FormatedExportDesc2").' ';
48 //print $langs->trans("FormatedExportDesc3").'<br>';
49 print '<br>';
50 
51 
52 //print '<div class="fichecenter"><div class="fichehalfleft">';
53 
54 
55 // List export set
56 /*
57 print '<table class="noborder" width="100%">';
58 print '<tr class="liste_titre">';
59 print '<td>'.$langs->trans("Module").'</td>';
60 print '<td>'.$langs->trans("ExportableDatas").'</td>';
61 //print '<td>&nbsp;</td>';
62 print '</tr>';
63 if (count($export->array_export_code))
64 {
65  foreach ($export->array_export_code as $key => $value)
66  {
67 
68  print '<tr class="oddeven"><td>';
69  //print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' ';
70  print $export->array_export_module[$key]->getName();
71  print '</td><td>';
72  print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' ';
73  $string=$langs->trans($export->array_export_label[$key]);
74  print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]);
75  print '</td>';
76  // print '<td width="24">';
77  // print '<a href="'.DOL_URL_ROOT.'/exports/export.php?step=2&amp;datatoexport='.$export->array_export_code[$key].'&amp;action=cleanselect">'.img_picto($langs->trans("NewExport"),'filenew').'</a>';
78  // print '</td>';
79  print '</tr>';
80 
81  }
82 }
83 else
84 {
85  print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoExportableData").'</td></tr>';
86 }
87 print '</table>';
88 print '<br>';
89 */
90 
91 print '<div class="center">';
92 if (count($export->array_export_code))
93 {
94  if ($user->rights->export->creer)
95  {
96  print '<a class="butActionNew" href="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export">'.$langs->trans("NewExport").'<span class="fa fa-plus-circle valignmiddle"></span></a>';
97  }
98  else
99  {
100  print '<a class="butActionNewRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("NewExport").'<span class="fa fa-plus-circle valignmiddle"></span></a>';
101  }
102  /*
103  print '<form action="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export"><input type="submit" class="button" value="'.$langs->trans("NewExport").'"';
104  print ($user->rights->export->creer?'':' disabled');
105  print '><div class="center"></div></form>';
106  */
107 }
108 print '</div>';
109 print '<br>';
110 
111 //print '</div><div class="fichehalfright"><div class="ficheaddleft">';
112 
113 
114 // List of available export formats
115 print '<table class="noborder" width="100%">';
116 print '<tr class="liste_titre">';
117 print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
118 print '<td>'.$langs->trans("LibraryShort").'</td>';
119 print '<td align="right">'.$langs->trans("LibraryVersion").'</td>';
120 print '</tr>';
121 
122 include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
123 $model=new ModeleExports($db);
124 $liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties
125 
126 foreach($liste as $key => $val)
127 {
128  if (preg_match('/__\(Disabled\)__/',$liste[$key]))
129  {
130  $liste[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$liste[$key]);
131  }
132 
133  print '<tr class="oddeven">';
134  print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
135  $text=$model->getDriverDescForKey($key);
136  $label=$liste[$key];
137  print '<td>'.$form->textwithpicto($label,$text).'</td>';
138  print '<td>'.$model->getLibLabelForKey($key).'</td>';
139  print '<td class="nowrap" align="right">'.$model->getLibVersionForKey($key).'</td>';
140  print '</tr>';
141 }
142 
143 print '</table>';
144 
145 
146 //print '</div></div></div>';
147 
148 // End of page
149 llxFooter();
150 $db->close();
llxFooter()
Footer empty.
Definition: index.php:44
Parent class for export modules.
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
print
Draft customers invoices.
Definition: index.php:91
Class to manage exports.
Class to manage generation of HTML components Only common components must be here.
llxHeader()
Header empty.
Definition: index.php:36
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0)
Check permissions of a user to show a page and an object.