dolibarr  7.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  *
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 $langs->load("exports");
28 
29 
30 // Security check
31 $result=restrictedArea($user,'export');
32 
33 
34 
35 $export=new Export($db);
36 $export->load_arrays($user);
37 
38 
39 /*
40  * View
41  */
42 
43 $form=new Form($db);
44 
45 llxHeader('',$langs->trans("ExportsArea"),'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
46 
47 print load_fiche_titre($langs->trans("ExportsArea"));
48 
49 print $langs->trans("FormatedExportDesc1").'<br>';
50 //print $langs->trans("FormatedExportDesc2").' ';
51 //print $langs->trans("FormatedExportDesc3").'<br>';
52 print '<br>';
53 
54 
55 //print '<div class="fichecenter"><div class="fichehalfleft">';
56 
57 
58 // List export set
59 /*
60 print '<table class="noborder" width="100%">';
61 print '<tr class="liste_titre">';
62 print '<td>'.$langs->trans("Module").'</td>';
63 print '<td>'.$langs->trans("ExportableDatas").'</td>';
64 //print '<td>&nbsp;</td>';
65 print '</tr>';
66 $var=true;
67 if (count($export->array_export_code))
68 {
69  foreach ($export->array_export_code as $key => $value)
70  {
71 
72  print '<tr class="oddeven"><td>';
73  //print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' ';
74  print $export->array_export_module[$key]->getName();
75  print '</td><td>';
76  print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' ';
77  $string=$langs->trans($export->array_export_label[$key]);
78  print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]);
79  print '</td>';
80  // print '<td width="24">';
81  // 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>';
82  // print '</td>';
83  print '</tr>';
84 
85  }
86 }
87 else
88 {
89  print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoExportableData").'</td></tr>';
90 }
91 print '</table>';
92 print '<br>';
93 */
94 
95 print '<div class="center">';
96 if (count($export->array_export_code))
97 {
98  if ($user->rights->export->creer)
99  {
100  print '<a class="butAction" href="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export">'.$langs->trans("NewExport").'</a>';
101  }
102  else
103  {
104  print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("NewExport").'</a>';
105  }
106  /*
107  print '<form action="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export"><input type="submit" class="button" value="'.$langs->trans("NewExport").'"';
108  print ($user->rights->export->creer?'':' disabled');
109  print '><div class="center"></div></form>';
110  */
111 }
112 print '</div>';
113 print '<br>';
114 
115 //print '</div><div class="fichehalfright"><div class="ficheaddleft">';
116 
117 
118 // List of available export format
119 $var=true;
120 print '<table class="noborder" width="100%">';
121 print '<tr class="liste_titre">';
122 print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
123 print '<td>'.$langs->trans("LibraryShort").'</td>';
124 print '<td align="right">'.$langs->trans("LibraryVersion").'</td>';
125 print '</tr>';
126 
127 include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
128 $model=new ModeleExports($db);
129 $liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties
130 
131 $var=true;
132 foreach($liste as $key => $val)
133 {
134  if (preg_match('/__\(Disabled\)__/',$liste[$key]))
135  {
136  $liste[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$liste[$key]);
137  }
138 
139 
140  print '<tr class="oddeven">';
141  print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
142  $text=$model->getDriverDescForKey($key);
143  $label=$liste[$key];
144  print '<td>'.$form->textwithpicto($label,$text).'</td>';
145  print '<td>'.$model->getLibLabelForKey($key).'</td>';
146  print '<td class="nowrap" align="right">'.$model->getLibVersionForKey($key).'</td>';
147  print '</tr>';
148 }
149 
150 print '</table>';
151 
152 
153 //print '</div></div></div>';
154 
155 
156 llxFooter();
157 
158 $db->close();
llxFooter()
Footer empty.
Definition: index.php:43
Parent class for export modules.
Class to manage exports.
if(empty($reshook)) $form
View.
Definition: perms.php:103
Class to manage generation of HTML components Only common components must be here.
llxHeader()
Header empty.
Definition: index.php:37
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
print
Draft customers invoices.
Definition: index.php:91
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
Check permissions of a user to show a page and an object.