dolibarr/htdocs/exports/index.php

152 lines
4.9 KiB
PHP
Raw Normal View History

2005-09-12 00:42:51 +02:00
<?php
2015-05-13 07:46:12 +02:00
/* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
2005-09-12 00:42:51 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2005-09-12 00:42:51 +02:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:45:11 +02:00
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2005-09-12 00:42:51 +02:00
*/
/**
2009-05-19 02:33:57 +02:00
* \file htdocs/exports/index.php
2009-11-04 21:58:56 +01:00
* \ingroup export
* \brief Home page of export wizard
2009-05-19 02:33:57 +02:00
*/
require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php';
2005-09-12 00:42:51 +02:00
2018-05-26 20:51:17 +02:00
// Load translation files required by the page
2005-11-19 23:09:12 +01:00
$langs->load("exports");
2005-09-12 00:42:51 +02:00
2013-01-10 08:27:12 +01:00
// Security check
$result=restrictedArea($user,'export');
2005-09-12 00:42:51 +02:00
2005-11-19 23:09:12 +01:00
$export=new Export($db);
$export->load_arrays($user);
2005-09-12 00:42:51 +02:00
2008-07-08 21:56:06 +02:00
/*
* View
*/
$form=new Form($db);
2009-09-28 22:06:15 +02:00
2009-08-12 14:59:14 +02:00
llxHeader('',$langs->trans("ExportsArea"),'EN:Module_Exports_En|FR:Module_Exports|ES:M&oacute;dulo_Exportaciones');
2005-09-12 00:42:51 +02:00
print load_fiche_titre($langs->trans("ExportsArea"));
2005-09-12 00:42:51 +02:00
print $langs->trans("FormatedExportDesc1").'<br>';
2018-01-03 14:46:18 +01:00
//print $langs->trans("FormatedExportDesc2").' ';
//print $langs->trans("FormatedExportDesc3").'<br>';
print '<br>';
2005-09-12 00:42:51 +02:00
2018-01-03 14:46:18 +01:00
//print '<div class="fichecenter"><div class="fichehalfleft">';
2012-09-09 16:32:03 +02:00
// List export set
2018-01-03 14:46:18 +01:00
/*
2012-09-09 16:32:03 +02:00
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Module").'</td>';
print '<td>'.$langs->trans("ExportableDatas").'</td>';
//print '<td>&nbsp;</td>';
print '</tr>';
if (count($export->array_export_code))
{
foreach ($export->array_export_code as $key => $value)
{
2018-01-03 14:46:18 +01:00
print '<tr class="oddeven"><td>';
2012-09-09 16:32:03 +02:00
//print img_object($export->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' ';
print $export->array_export_module[$key]->getName();
print '</td><td>';
print img_object($export->array_export_module[$key]->getName(),$export->array_export_icon[$key]).' ';
$string=$langs->trans($export->array_export_label[$key]);
print ($string!=$export->array_export_label[$key]?$string:$export->array_export_label[$key]);
print '</td>';
// print '<td width="24">';
// 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>';
// print '</td>';
print '</tr>';
}
}
else
{
print '<tr><td '.$bc[false].' colspan="2">'.$langs->trans("NoExportableData").'</td></tr>';
}
print '</table>';
print '<br>';
2018-01-03 14:46:18 +01:00
*/
2012-09-09 16:32:03 +02:00
2014-11-25 20:13:43 +01:00
print '<div class="center">';
2012-09-09 16:32:03 +02:00
if (count($export->array_export_code))
{
if ($user->rights->export->creer)
{
2018-06-23 14:23:07 +02:00
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>';
2012-09-09 16:32:03 +02:00
}
else
{
2018-06-23 14:23:07 +02:00
print '<a class="butActionNewRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("NewExport").'<span class="fa fa-plus-circle valignmiddle"></span></a>';
2012-09-09 16:32:03 +02:00
}
/*
2014-11-25 20:40:00 +01:00
print '<form action="'.DOL_URL_ROOT.'/exports/export.php?leftmenu=export"><input type="submit" class="button" value="'.$langs->trans("NewExport").'"';
print ($user->rights->export->creer?'':' disabled');
2014-11-25 20:40:00 +01:00
print '><div class="center"></div></form>';
2012-09-09 16:32:03 +02:00
*/
}
2014-11-25 20:13:43 +01:00
print '</div>';
2013-06-05 16:24:32 +02:00
print '<br>';
2005-09-12 00:42:51 +02:00
2018-01-03 14:46:18 +01:00
//print '</div><div class="fichehalfright"><div class="ficheaddleft">';
2012-09-09 16:32:03 +02:00
2018-06-18 10:12:19 +02:00
// List of available export formats
2012-09-09 16:32:03 +02:00
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
print '<td>'.$langs->trans("LibraryShort").'</td>';
print '<td align="right">'.$langs->trans("LibraryVersion").'</td>';
print '</tr>';
include_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php';
$model=new ModeleExports($db);
2012-09-09 16:32:03 +02:00
$liste=$model->liste_modeles($db); // This is not a static method for exports because method load non static properties
foreach($liste as $key => $val)
{
if (preg_match('/__\(Disabled\)__/',$liste[$key]))
{
$liste[$key]=preg_replace('/__\(Disabled\)__/','('.$langs->transnoentitiesnoconv("Disabled").')',$liste[$key]);
}
print '<tr class="oddeven">';
print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
$text=$model->getDriverDescForKey($key);
$label=$liste[$key];
print '<td>'.$form->textwithpicto($label,$text).'</td>';
print '<td>'.$model->getLibLabelForKey($key).'</td>';
print '<td class="nowrap" align="right">'.$model->getLibVersionForKey($key).'</td>';
2012-09-09 16:32:03 +02:00
print '</tr>';
}
print '</table>';
2009-07-29 21:47:15 +02:00
2018-01-03 14:46:18 +01:00
//print '</div></div></div>';
2005-09-12 00:42:51 +02:00
llxFooter();
$db->close();