New: For admin users, show the SQL request in export build.

This commit is contained in:
Laurent Destailleur 2009-03-03 00:42:40 +00:00
parent d0d9e8252f
commit 32faa96ab6
6 changed files with 118 additions and 97 deletions

View File

@ -37,6 +37,7 @@ For users:
- New: Changements to support the external BitTorrent module. - New: Changements to support the external BitTorrent module.
- New: Can filter on social contribution type in list. - New: Can filter on social contribution type in list.
- New: Upload of joined files need create/modify permissions to work. - New: Upload of joined files need create/modify permissions to work.
- New: For admin users, show the SQL request in export build.
- Fix: Partial payment on social contributions not shown on main page. - Fix: Partial payment on social contributions not shown on main page.
- Fix: Handle correctly the comment in status changing of supplier orders. - Fix: Handle correctly the comment in status changing of supplier orders.
- Fix: Author, title and topic are correctly encoded in PDF. - Fix: Author, title and topic are correctly encoded in PDF.

View File

@ -47,6 +47,8 @@ class Export
var $datatoexport; var $datatoexport;
var $model_name; var $model_name;
var $sqlusedforexport;
/** /**
* \brief Constructeur de la classe * \brief Constructeur de la classe
@ -204,6 +206,7 @@ class Export
$sql.=$this->array_export_sql_end[$indice]; $sql.=$this->array_export_sql_end[$indice];
// Run the sql // Run the sql
$this->sqlusedforexport=$sql;
dol_syslog("Export::build_file sql=".$sql); dol_syslog("Export::build_file sql=".$sql);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -78,6 +78,7 @@ $objmodelexport=new ModeleExports();
$html = new Form($db); $html = new Form($db);
$htmlother = new FormOther($db); $htmlother = new FormOther($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$sqlusedforexport='';
/* /*
@ -169,6 +170,7 @@ if ($action == 'builddoc')
else else
{ {
$mesg='<div class="ok">'.$langs->trans("FileSuccessfullyBuilt").'</div>'; $mesg='<div class="ok">'.$langs->trans("FileSuccessfullyBuilt").'</div>';
$sqlusedforexport=$objexport->sqlusedforexport;
} }
} }
@ -708,7 +710,20 @@ if ($step == 4 && $datatoexport)
print '</div>'; print '</div>';
if ($mesg) print $mesg; print '<table width="100%">';
if ($mesg)
{
print '<tr><td colspan="2">';
print $mesg;
print '</td></tr>';
}
if ($sqlusedforexport && $user->admin)
{
print '<tr><td>';
print info_admin($langs->trans("SQLUsedForExport").':<br> '.$sqlusedforexport);
print '</td></tr>';
}
print '</table>';
print '<table width="100%"><tr><td width="50%">'; print '<table width="100%"><tr><td width="50%">';

View File

@ -34,3 +34,4 @@ FormatedExportDesc3=When data to export are selected, you can define output file
Sheet=Sheet Sheet=Sheet
NoImportableData=No importable data (no module with definitions to allow data imports) NoImportableData=No importable data (no module with definitions to allow data imports)
FileSuccessfullyBuilt=Export file generated FileSuccessfullyBuilt=Export file generated
SQLUsedForExport=SQL Request used to build export file

View File

@ -34,3 +34,4 @@ FormatedExportDesc3=Une fois les données sélectionnées, il est possible de ch
Sheet=Feuille Sheet=Feuille
NoImportableData=Pas de type de données importable (aucun module contenant des définitions de données importable n'est actif) NoImportableData=Pas de type de données importable (aucun module contenant des définitions de données importable n'est actif)
FileSuccessfullyBuilt=Fichier export généré FileSuccessfullyBuilt=Fichier export généré
SQLUsedForExport=Requête SQL utilisée pour construire le fichier export

View File

@ -1291,9 +1291,9 @@ function img_mime($file,$alt='')
/** /**
* \brief Affiche info admin * \brief Show information for admin users
* \param text Text info * \param text Text info
* \param infoonimgalt Info is shown on alt of star picto * \param infoonimgalt Info is shown on alt of star picto, otherwise it is show on output
* \return string String with info text * \return string String with info text
*/ */
function info_admin($texte,$infoonimgalt=0) function info_admin($texte,$infoonimgalt=0)