diff options
author | Jehan-Guillaume (ioguix) de Rorthais | 2012-08-17 23:58:33 +0000 |
---|---|---|
committer | Jehan-Guillaume (ioguix) de Rorthais | 2012-08-22 10:39:41 +0000 |
commit | 3b4ec98a01e98fd3209c03a8d21452d0bd8af55f (patch) | |
tree | 9846676cdf90f65af1d2059980d1f64fd45caa5c | |
parent | e1a5b9c54f3ea112a0ce5b2f0f3a0ace9583a354 (diff) |
Add plugin Report
This plugin is the old Report feature from PPA <5.1 moved as a plugin in
the new plugin architecture.
38 files changed, 1668 insertions, 0 deletions
diff --git a/plugins/Report/INSTALL b/plugins/Report/INSTALL new file mode 100644 index 00000000..263f308b --- /dev/null +++ b/plugins/Report/INSTALL @@ -0,0 +1,13 @@ +phpPgAdmin Report Plugin Installation Guide +------------------------------------------- +1. Report Plugin activation + + Open conf/config.inc.php and add the 'Report' value in the $conf['plugins'] array: + + $conf['plugins'] = array('Report'); + +2. Set up the reports database. + + If you want to enable reports (which are a useful feature) then go to + the 'sql' subdirectory and view the SQL script for your database. It + will contain instructions on how to set up the reports database. diff --git a/plugins/Report/classes/Reports.php b/plugins/Report/classes/Reports.php new file mode 100644 index 00000000..a0303a99 --- /dev/null +++ b/plugins/Report/classes/Reports.php @@ -0,0 +1,128 @@ +<?php + /** + * Class to manage reports. Note how this class is designed to use + * the functions provided by the database driver exclusively, and hence + * will work with any database without modification. + * + * $Id: Reports.php,v 1.18 2007/04/16 11:02:35 mr-russ Exp $ + */ + + class Reports { + + // A database driver + var $driver; + var $conf; + + /* Constructor */ + function __construct(&$conf, &$status) { + global $misc, $data; + + $this->conf = $conf; + + // Check to see if the reports database exists + $rs = $data->getDatabase($this->conf['reports_db']); + if ($rs->recordCount() != 1) $status = -1; + else { + // Create a new database access object. + $this->driver = $misc->getDatabaseAccessor($this->conf['reports_db']); + // Reports database should have been created in public schema + $this->driver->setSchema($this->conf['reports_schema']); + $status = 0; + } + } + + /** + * Finds all reports + * @return A recordset + */ + function getReports() { + global $misc; + // Filter for owned reports if necessary + if ($this->conf['owned_reports_only']) { + $server_info = $misc->getServerInfo(); + $filter['created_by'] = $server_info['username']; + $ops = array('created_by' => '='); + } + else $filter = $ops = array(); + + $sql = $this->driver->getSelectSQL($this->conf['reports_table'], + array('report_id', 'report_name', 'db_name', 'date_created', 'created_by', 'descr', 'report_sql', 'paginate'), + $filter, $ops, array('db_name' => 'asc', 'report_name' => 'asc')); + + return $this->driver->selectSet($sql); + } + + /** + * Finds a particular report + * @param $report_id The ID of the report to find + * @return A recordset + */ + function getReport($report_id) { + $sql = $this->driver->getSelectSQL($this->conf['reports_table'], + array('report_id', 'report_name', 'db_name', 'date_created', 'created_by', 'descr', 'report_sql', 'paginate'), + array('report_id' => $report_id), array('report_id' => '='), array()); + + return $this->driver->selectSet($sql); + } + + /** + * Creates a report + * @param $report_name The name of the report + * @param $db_name The name of the database + * @param $descr The comment on the report + * @param $report_sql The SQL for the report + * @param $paginate The report should be paginated + * @return 0 success + */ + function createReport($report_name, $db_name, $descr, $report_sql, $paginate) { + global $misc; + $server_info = $misc->getServerInfo(); + $temp = array( + 'report_name' => $report_name, + 'db_name' => $db_name, + 'created_by' => $server_info['username'], + 'report_sql' => $report_sql, + 'paginate' => $paginate ? 'true' : 'false', + ); + if ($descr != '') $temp['descr'] = $descr; + + return $this->driver->insert($this->conf['reports_table'], $temp); + } + + /** + * Alters a report + * @param $report_id The ID of the report + * @param $report_name The name of the report + * @param $db_name The name of the database + * @param $descr The comment on the report + * @param $report_sql The SQL for the report + * @param $paginate The report should be paginated + * @return 0 success + */ + function alterReport($report_id, $report_name, $db_name, $descr, $report_sql, $paginate) { + global $misc; + $server_info = $misc->getServerInfo(); + $temp = array( + 'report_name' => $report_name, + 'db_name' => $db_name, + 'created_by' => $server_info['username'], + 'report_sql' => $report_sql, + 'paginate' => $paginate ? 'true' : 'false', + 'descr' => $descr + ); + + return $this->driver->update($this->conf['reports_table'], $temp, + array('report_id' => $report_id)); + } + + /** + * Drops a report + * @param $report_id The ID of the report to drop + * @return 0 success + */ + function dropReport($report_id) { + return $this->driver->delete($this->conf['reports_table'], array('report_id' => $report_id)); + } + + } +?> diff --git a/plugins/Report/conf/config.inc.php b/plugins/Report/conf/config.inc.php new file mode 100644 index 00000000..c036544e --- /dev/null +++ b/plugins/Report/conf/config.inc.php @@ -0,0 +1,12 @@ +<?php + /* Database and table for reports */ + $plugin_conf['reports_db'] = 'phppgadmin'; + $plugin_conf['reports_schema'] = 'public'; + $plugin_conf['reports_table'] = 'ppa_reports'; + + /* Only show owned reports? + * Note: This does not prevent people from accessing other reports by + * other means. + */ + $plugin_conf['owned_reports_only'] = false; +?> diff --git a/plugins/Report/images/Report.png b/plugins/Report/images/Report.png Binary files differnew file mode 100644 index 00000000..f9158b9a --- /dev/null +++ b/plugins/Report/images/Report.png diff --git a/plugins/Report/images/Reports.png b/plugins/Report/images/Reports.png Binary files differnew file mode 100644 index 00000000..4a403e07 --- /dev/null +++ b/plugins/Report/images/Reports.png diff --git a/plugins/Report/lang/afrikaans.php b/plugins/Report/lang/afrikaans.php new file mode 100644 index 00000000..fa2e30ff --- /dev/null +++ b/plugins/Report/lang/afrikaans.php @@ -0,0 +1,23 @@ +<?php + /** + * Afrikaans Language file. + */ + + // Basic strings + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Jy het nie die verslae-databasis geskep nie. Lees asb. die INSTALL-lêer vir instruksies.'; + + // Reports + $plugin_lang['strreport'] = 'Verslag'; + $plugin_lang['strreports'] = 'Verslae'; + $plugin_lang['strshowallreports'] = 'Wys alle verslae'; + $plugin_lang['strnoreports'] = 'Geen verslae gevind.'; + $plugin_lang['strcreatereport'] = 'Skep verslag'; + $plugin_lang['strreportdropped'] = 'Verslag is verwyder.'; + $plugin_lang['strreportdroppedbad'] = 'Verwydering van verslag het misluk.'; + $plugin_lang['strconfdropreport'] = 'Is jy seker dat jy die verslag "%s" wil verwyder?'; + $plugin_lang['strreportneedsname'] = 'Jy moet \'n naam gee vir die verslag.'; + $plugin_lang['strreportneedsdef'] = 'Jy moet SQL-kode skryf vir die verslag.'; + $plugin_lang['strreportcreated'] = 'Verslag is geskep.'; + $plugin_lang['strreportcreatedbad'] = 'Die verslag kon nie geskep word nie.'; +?> diff --git a/plugins/Report/lang/arabic.php b/plugins/Report/lang/arabic.php new file mode 100644 index 00000000..32a34c31 --- /dev/null +++ b/plugins/Report/lang/arabic.php @@ -0,0 +1,23 @@ +<?php + /** + * Arabic language file. + */ + + // Basic strings + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'لم تقم بإنشاء قاعدة بيانات التقارير reports database. إقرأ التعليمات في المف INSTALL.'; + + // Reports + $plugin_lang['strreport'] = 'تقرير Report'; + $plugin_lang['strreports'] = 'تقارير Reports'; + $plugin_lang['strshowallreports'] = 'عرض جميع التقارير'; + $plugin_lang['strnoreports'] = 'لم توجد تقارير.'; + $plugin_lang['strcreatereport'] = 'إنشاء تقرير جديد'; + $plugin_lang['strreportdropped'] = 'تم حذف التقرير.'; + $plugin_lang['strreportdroppedbad'] = 'فشلت عملية حذف التقرير.'; + $plugin_lang['strconfdropreport'] = 'هل أنت متأكد تريد حذف التقرير "%s"؟'; + $plugin_lang['strreportneedsname'] = 'يجب إعطاء اسم للتقرير.'; + $plugin_lang['strreportneedsdef'] = 'يجب كتابة عبارة SQL للتقرير.'; + $plugin_lang['strreportcreated'] = 'تم حفظ التقرير.'; + $plugin_lang['strreportcreatedbad'] = 'لم يتم حفظ التقرير، لقد فشلت عملية الحفظ.'; +?> diff --git a/plugins/Report/lang/catalan.php b/plugins/Report/lang/catalan.php new file mode 100644 index 00000000..0f5c82c3 --- /dev/null +++ b/plugins/Report/lang/catalan.php @@ -0,0 +1,23 @@ +<?php + /** + * Catalan language file. + */ + + // Basic strings + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'La base de dades dels reports no està creada. Llegeixi el fitxer INSTALL per fer-ho.'; + + // Reports + $plugin_lang['strreport'] = 'Report'; + $plugin_lang['strreports'] = 'Reports'; + $plugin_lang['strshowallreports'] = 'Mostra tots els reports'; + $plugin_lang['strnoreports'] = 'No s\'han trobat reports'; + $plugin_lang['strcreatereport'] = 'Crea un report'; + $plugin_lang['strreportdropped'] = 'Report eliminat.'; + $plugin_lang['strreportdroppedbad'] = 'No s\'ha pogut eliminar el report.'; + $plugin_lang['strconfdropreport'] = 'Està segur de voler eliminar el report "%s"?'; + $plugin_lang['strreportneedsname'] = 'Ha de donar un nom al report.'; + $plugin_lang['strreportneedsdef'] = 'Ha de donar un SQL al report.'; + $plugin_lang['strreportcreated'] = 'Report desat.'; + $plugin_lang['strreportcreatedbad'] = 'No s\'ha pogut desar el report.'; +?> diff --git a/plugins/Report/lang/chinese-sim.php b/plugins/Report/lang/chinese-sim.php new file mode 100644 index 00000000..aedf4d13 --- /dev/null +++ b/plugins/Report/lang/chinese-sim.php @@ -0,0 +1,22 @@ +<?php + + /** + * @maintainer He Wei Ping [[email protected]] + */ + + // Basic strings + $plugin_lang['strplugindescription'] = 'Report plugin'; + + //Reports + $plugin_lang['strreport'] = '报表'; + $plugin_lang['strreports'] = '报表'; + $plugin_lang['strshowallreports'] = '显示所有报表'; + $plugin_lang['strnoreports'] = '查无此报表'; + $plugin_lang['strcreatereport'] = '创建报表'; + $plugin_lang['strreportdropped'] = '创建报表完成.'; + $plugin_lang['strreportdroppedbad'] = '删除报表失败'; + $plugin_lang['strconfdropreport'] = '您确定要删除报表"%s"么?'; + $plugin_lang['strreportneedsname'] = '你必须给您的报表命名'; + $plugin_lang['strreportcreated'] = '储存报表完成'; + $plugin_lang['strreportcreatedbad'] = '储存报表失败'; +?> diff --git a/plugins/Report/lang/chinese-tr.php b/plugins/Report/lang/chinese-tr.php new file mode 100644 index 00000000..d5bfbc14 --- /dev/null +++ b/plugins/Report/lang/chinese-tr.php @@ -0,0 +1,23 @@ +<?php + /** + * Chinese language file. + */ + + // Basic strings + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = '您尚未建新報表資料庫,請參閱INSTALL檔說明。'; + + // Reports + $plugin_lang['strreport'] = '報表'; + $plugin_lang['strreports'] = '報表'; + $plugin_lang['strshowallreports'] = '顯示所有的報表'; + $plugin_lang['strnoreports'] = '找不到此報表。'; + $plugin_lang['strcreatereport'] = '建立新報表'; + $plugin_lang['strreportdropped'] = '成功刪除報表。'; + $plugin_lang['strreportdroppedbad'] = '刪除報表作業失敗。'; + $plugin_lang['strconfdropreport'] = '您確定要刪除報表 "%s"?'; + $plugin_lang['strreportneedsname'] = '您需為您的報表命名。'; + $plugin_lang['strreportneedsdef'] = '您需給您的報表 SQL。'; + $plugin_lang['strreportcreated'] = '成功儲存報表。'; + $plugin_lang['strreportcreatedbad'] = '無法儲存報表。'; +?> diff --git a/plugins/Report/lang/chinese-utf8-zh_CN.php b/plugins/Report/lang/chinese-utf8-zh_CN.php new file mode 100644 index 00000000..834a93b8 --- /dev/null +++ b/plugins/Report/lang/chinese-utf8-zh_CN.php @@ -0,0 +1,23 @@ +<?php
+ /**
+ * Chinese language file.
+ */
+
+ //Basic
+ $plugin_lang['strplugindescription'] = 'Report plugin';
+ $plugin_lang['strnoreportsdb'] = '你不能创建报告数据库。 请参阅INSTALL文件。';
+
+ // Reports
+ $plugin_lang['strreport'] = '报表';
+ $plugin_lang['strreports'] = '报表';
+ $plugin_lang['strshowallreports'] = '显示所有报表';
+ $plugin_lang['strnoreports'] = '查无报表。';
+ $plugin_lang['strcreatereport'] = '创建报表';
+ $plugin_lang['strreportdropped'] = '报表已删除。';
+ $plugin_lang['strreportdroppedbad'] = '报表删除失败。';
+ $plugin_lang['strconfdropreport'] = '确定要删除报表"%s"吗?';
+ $plugin_lang['strreportneedsname'] = '必须指定报表名称。';
+ $plugin_lang['strreportneedsdef'] = '必须给报表指定SQL。';
+ $plugin_lang['strreportcreated'] = '报表已保存。';
+ $plugin_lang['strreportcreatedbad'] = '报表保存失败。';
+?>
diff --git a/plugins/Report/lang/chinese-utf8-zh_TW.php b/plugins/Report/lang/chinese-utf8-zh_TW.php new file mode 100644 index 00000000..907b2342 --- /dev/null +++ b/plugins/Report/lang/chinese-utf8-zh_TW.php @@ -0,0 +1,23 @@ +<?php + /** + * Chinese zh_TW translation file for phpPgAdmin. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = '您尚未建立報表資料庫。請參閱指導 INSTALL 檔說明。'; + + // Reports + $plugin_lang['strreport'] = '報表'; + $plugin_lang['strreports'] = '報表'; + $plugin_lang['strshowallreports'] = '顯示全部報表'; + $plugin_lang['strnoreports'] = '找不到任何報表。'; + $plugin_lang['strcreatereport'] = '建立報表'; + $plugin_lang['strreportdropped'] = '報表已移除。'; + $plugin_lang['strreportdroppedbad'] = '報表移除已失敗。'; + $plugin_lang['strconfdropreport'] = '您確定您要移除這個報表 "%s" 嗎?'; + $plugin_lang['strreportneedsname'] = '您必需為您的報表給一個名稱。'; + $plugin_lang['strreportneedsdef'] = '您必需為您的報表給 SQL。'; + $plugin_lang['strreportcreated'] = '報表已儲存。'; + $plugin_lang['strreportcreatedbad'] = '報表儲存已失敗。'; +?> diff --git a/plugins/Report/lang/czech.php b/plugins/Report/lang/czech.php new file mode 100644 index 00000000..ff6f539c --- /dev/null +++ b/plugins/Report/lang/czech.php @@ -0,0 +1,23 @@ +<?php + /** + * Czech language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Nemáte vytvořenou databázi výstupních sestav. Přečtěte si soubor INSTALL s instrukcemi.'; + + // Reports + $plugin_lang['strreport'] = 'Výstupní sestava'; + $plugin_lang['strreports'] = 'Výstupní sestavy'; + $plugin_lang['strshowallreports'] = 'Zobrazit všechny výstupní sestavy'; + $plugin_lang['strnoreports'] = 'Nebyly nalezeny žádné výstupní sestava.'; + $plugin_lang['strcreatereport'] = 'Vytvořit výstupní sestavu'; + $plugin_lang['strreportdropped'] = 'Výstupní sestava byla odstraněna.'; + $plugin_lang['strreportdroppedbad'] = 'Nezdařilo se odstranit výstupní sestavu.'; + $plugin_lang['strconfdropreport'] = 'Opravdu chcete odstranit výstupní sestavu „%s“?'; + $plugin_lang['strreportneedsname'] = 'Musíte zadat název pro výstupní sestavu.'; + $plugin_lang['strreportneedsdef'] = 'Musíte zadat dotaz SQL pro výstupní sestavu.'; + $plugin_lang['strreportcreated'] = 'Výstupní sestava byla uložena.'; + $plugin_lang['strreportcreatedbad'] = 'Nezdařilo se uložit výstupní sestavu.'; +?> diff --git a/plugins/Report/lang/danish.php b/plugins/Report/lang/danish.php new file mode 100644 index 00000000..7d5df866 --- /dev/null +++ b/plugins/Report/lang/danish.php @@ -0,0 +1,25 @@ +<?php + /** + * Danish language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Du har ikke oprettet nogen rapportdatabase. For instruktioner læs filen INSTALL.'; + + // Reports + $plugin_lang['strreport'] = 'Rapport'; + $plugin_lang['strreports'] = 'Rapporter'; + $plugin_lang['strshowallreports'] = 'Vis alle rapporter'; + $plugin_lang['strtopbar'] = '%s kører på %s:%s -- Du er logged ind som bruger "%s"'; + $plugin_lang['strtimefmt'] = 'jS M, Y g:iA'; + $plugin_lang['strnoreports'] = 'Ingen rapporter fundet.'; + $plugin_lang['strcreatereport'] = 'Opret rapport'; + $plugin_lang['strreportdropped'] = 'Rapport fjernet.'; + $plugin_lang['strreportcreated'] = 'Rapport oprettet.'; + $plugin_lang['strreportneedsname'] = 'Rapport skal have et navn.'; + $plugin_lang['strreportcreatedbad'] = 'Det lykkedes ikke at oprette rapport.'; + $plugin_lang['strreportdroppedbad'] = 'Det lykkedes ikke at fjerne rapport.'; + $plugin_lang['strconfdropreport'] = 'Er du sikker på, at du vil fjerne rapporten "%s"?'; + $plugin_lang['strreportneedsdef'] = 'Du skal angive en SQL-forespørgsel.'; +?> diff --git a/plugins/Report/lang/dutch.php b/plugins/Report/lang/dutch.php new file mode 100644 index 00000000..aa541fbc --- /dev/null +++ b/plugins/Report/lang/dutch.php @@ -0,0 +1,21 @@ +<?php + /** + * Dutch Language file. + */ + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + + //Reports + $plugin_lang['strreport'] = 'Rapport'; + $plugin_lang['strreports'] = 'Rapporten'; + $plugin_lang['strshowallreports'] = 'Toon alle rapporten'; + $plugin_lang['strnoreports'] = 'Geen rapporten gevonden.'; + $plugin_lang['strcreatereport'] = 'Maak rapport aan'; + $plugin_lang['strreportdropped'] = 'Rapport verwijderd.'; + $plugin_lang['strreportdroppedbad'] = 'Verwijdering van rapport mislukt.'; + $plugin_lang['strconfdropreport'] = 'Weet u zeker dat u het rapport "%s" wilt verwijderen?'; + $plugin_lang['strreportneedsname'] = 'U dient een naam op te geven voor het rapport.'; + $plugin_lang['strreportneedsdef'] = 'U dient SQL op te geven voor het rapport.'; + $plugin_lang['strreportcreated'] = 'Rapport bewaard.'; + $plugin_lang['strreportcreatedbad'] = 'Bewaren van het rapport mislukt.'; +?> diff --git a/plugins/Report/lang/english.php b/plugins/Report/lang/english.php new file mode 100644 index 00000000..2ceee1e2 --- /dev/null +++ b/plugins/Report/lang/english.php @@ -0,0 +1,23 @@ +<?php + /** + * English language file for phpPgAdmin. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'You have not created the reports database. Read the INSTALL file for directions.'; + + // Reports + $plugin_lang['strreport'] = 'Report'; + $plugin_lang['strreports'] = 'Reports'; + $plugin_lang['strshowallreports'] = 'Show all reports'; + $plugin_lang['strnoreports'] = 'No reports found.'; + $plugin_lang['strcreatereport'] = 'Create report'; + $plugin_lang['strreportdropped'] = 'Report dropped.'; + $plugin_lang['strreportdroppedbad'] = 'Report drop failed.'; + $plugin_lang['strconfdropreport'] = 'Are you sure you want to drop the report "%s"?'; + $plugin_lang['strreportneedsname'] = 'You must give a name for your report.'; + $plugin_lang['strreportneedsdef'] = 'You must give SQL for your report.'; + $plugin_lang['strreportcreated'] = 'Report saved.'; + $plugin_lang['strreportcreatedbad'] = 'Failed to save report.'; +?> diff --git a/plugins/Report/lang/french.php b/plugins/Report/lang/french.php new file mode 100644 index 00000000..13db41dc --- /dev/null +++ b/plugins/Report/lang/french.php @@ -0,0 +1,23 @@ +<?php + /** + * French Language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Vous n\'avez pas créé la base de données reports. Lisez le fichier INSTALL pour en savoir plus.'; + + // Reports + $plugin_lang['strreport'] = 'Rapport'; + $plugin_lang['strreports'] = 'Rapports'; + $plugin_lang['strshowallreports'] = 'Voir tous les rapports'; + $plugin_lang['strnoreports'] = 'Aucun rapport trouvé.'; + $plugin_lang['strcreatereport'] = 'Créer un rapport'; + $plugin_lang['strreportdropped'] = 'Rapport supprimé.'; + $plugin_lang['strreportdroppedbad'] = 'Échec lors de la suppression du rapport.'; + $plugin_lang['strconfdropreport'] = 'Êtes-vous sûr de vouloir supprimer le rapport « %s » ?'; + $plugin_lang['strreportneedsname'] = 'Vous devez indiquer un nom pour votre rapport.'; + $plugin_lang['strreportneedsdef'] = 'Vous devez fournir une requête SQL pour votre rapport.'; + $plugin_lang['strreportcreated'] = 'Rapport sauvegardé.'; + $plugin_lang['strreportcreatedbad'] = 'Échec lors de la sauvegarde du rapport.'; +?> diff --git a/plugins/Report/lang/galician.php b/plugins/Report/lang/galician.php new file mode 100644 index 00000000..87da669b --- /dev/null +++ b/plugins/Report/lang/galician.php @@ -0,0 +1,23 @@ +<?php + /** + * Galician language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Non creou a base de datos de informes. Lea o ficheiro »INSTALL» (en inglés) para máis información.'; + + // Reports + $plugin_lang['strreport'] = 'Informe'; + $plugin_lang['strreports'] = 'Informes'; + $plugin_lang['strshowallreports'] = 'Listar todos os informes'; + $plugin_lang['strnoreports'] = 'Non se atopou informe algún.'; + $plugin_lang['strcreatereport'] = 'Crear un informe'; + $plugin_lang['strreportdropped'] = 'Eliminouse o informe.'; + $plugin_lang['strreportdroppedbad'] = 'Non se conseguiu eliminar o informe.'; + $plugin_lang['strconfdropreport'] = 'Está seguro de que quere eliminar o informe «%s»?'; + $plugin_lang['strreportneedsname'] = 'Debe fornecer un nome para o informe.'; + $plugin_lang['strreportneedsdef'] = 'Debe fornecer un código SQL para o informe.'; + $plugin_lang['strreportcreated'] = 'Gardouse o informe.'; + $plugin_lang['strreportcreatedbad'] = 'Non se conseguiu gardar o informe.'; +?> diff --git a/plugins/Report/lang/german.php b/plugins/Report/lang/german.php new file mode 100644 index 00000000..5f5cec5a --- /dev/null +++ b/plugins/Report/lang/german.php @@ -0,0 +1,23 @@ +<?php + /** + * German language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Sie haben die Berichtsdatenbank nicht angelegt. In der Datei INSTALL finden Sie Anweisungen dafür.'; + + // Reports + $plugin_lang['strreport'] = 'Bericht'; + $plugin_lang['strreports'] = 'Berichte'; + $plugin_lang['strshowallreports'] = 'Alle Berichte anzeigen'; + $plugin_lang['strnoreports'] = 'Keine Berichte gefunden.'; + $plugin_lang['strcreatereport'] = 'Bericht erstellen.'; + $plugin_lang['strreportdropped'] = 'Bericht gelöscht.'; + $plugin_lang['strreportdroppedbad'] = 'Löschen des Berichtes fehlgeschlagen.'; + $plugin_lang['strconfdropreport'] = 'Sind Sie sicher, dass Sie den Bericht "%s" löschen wollen?'; + $plugin_lang['strreportneedsname'] = 'Sie müssen für den Bericht einen Namen angeben.'; + $plugin_lang['strreportneedsdef'] = 'Sie müssen eine SQL-Abfrage für den Bericht eingeben.'; + $plugin_lang['strreportcreated'] = 'Bericht gespeichert.'; + $plugin_lang['strreportcreatedbad'] = 'Speichern des Berichtes fehlgeschlagen.'; +?> diff --git a/plugins/Report/lang/greek.php b/plugins/Report/lang/greek.php new file mode 100644 index 00000000..78bde375 --- /dev/null +++ b/plugins/Report/lang/greek.php @@ -0,0 +1,24 @@ +<?php + /** + * Greek language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Η βάση αναφορών δεν έχει δημιουργηθεί. Διαβάστε το αρχείο INSTALL για οδηγίες.'; + + // Reports + $plugin_lang['strreport'] = 'Αναφορά'; + $plugin_lang['strreports'] = 'Αναφορές'; + $plugin_lang['strshowallreports'] = 'Εμφάνιση όλων των αναφορών'; + $plugin_lang['strnoreports'] = 'Δε βρέθηκαν αναφορές.'; + $plugin_lang['strcreatereport'] = 'Δημιουργία αναφοράς'; + $plugin_lang['strreportdropped'] = 'Η αναφορά διαγράφηκε.'; + $plugin_lang['strreportdroppedbad'] = 'Η διαγραφή της αναφοράς απέτυχε.'; + $plugin_lang['strconfdropreport'] = 'Να διαγραφεί η αναφορά "%s"?'; + $plugin_lang['strreportneedsname'] = 'Πρέπει να δώσετε όνομα στην αναφορά.'; + $plugin_lang['strreportneedsdef'] = 'Πρέπει να δώσετε SQL για την αναφορά.'; + $plugin_lang['strreportcreated'] = 'Η αναφορά αποθηκεύτηκε.'; + $plugin_lang['strreportcreatedbad'] = 'Η αποθήκευση της αναφοράς απέτυχε.'; + +?> diff --git a/plugins/Report/lang/hebrew.php b/plugins/Report/lang/hebrew.php new file mode 100644 index 00000000..d369f066 --- /dev/null +++ b/plugins/Report/lang/hebrew.php @@ -0,0 +1,23 @@ +<?php + /** + * Hebrew language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'לא יצרתה בסיס נתונים בישביל הדוחות. אנא קרא את קובץ ה INSTALL בישביל הדרכה.'; + + // Reports + $plugin_lang['strreport'] = 'דוח'; + $plugin_lang['strreports'] = 'דוחות'; + $plugin_lang['strshowallreports'] = 'הראה את כל הדוחות'; + $plugin_lang['strnoreports'] = 'לא נמצאו דוחות.'; + $plugin_lang['strcreatereport'] = 'צור דוח'; + $plugin_lang['strreportdropped'] = 'דוח נמחק.'; + $plugin_lang['strreportdroppedbad'] = 'מחיקת דוח נכשלה'; + $plugin_lang['strconfdropreport'] = 'האם אתה בטוח שברצונך למחוק את הדוח "%s"l?'; + $plugin_lang['strreportneedsname'] = 'אתה חייב לציין שם לדוח.'; + $plugin_lang['strreportneedsdef'] = 'אתה חייב לתת SQL לדוח.'; + $plugin_lang['strreportcreated'] = 'דוח נשמר.'; + $plugin_lang['strreportcreatedbad'] = 'שמירת דוח נכשלה.'; +?> diff --git a/plugins/Report/lang/hungarian.php b/plugins/Report/lang/hungarian.php new file mode 100644 index 00000000..bb94af95 --- /dev/null +++ b/plugins/Report/lang/hungarian.php @@ -0,0 +1,23 @@ +<?php + /** + * Hungarian language file for phpPgAdmin. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Ön még nem teremtette meg a jelentések adatbázisát. Olvassa el az INSTALL fájlt további útmutatásért!'; + + // Reports + $plugin_lang['strreport'] = 'Jelentés'; + $plugin_lang['strreports'] = 'Jelentések'; + $plugin_lang['strshowallreports'] = 'Minden jelentést megjelenít'; + $plugin_lang['strnoreports'] = 'Nincsenek jelentések.'; + $plugin_lang['strcreatereport'] = 'Jelentést teremt'; + $plugin_lang['strreportdropped'] = 'A jelentés törölve.'; + $plugin_lang['strreportdroppedbad'] = 'Nem sikerült törölni a jelentést.'; + $plugin_lang['strconfdropreport'] = 'Biztosan törölni kívánja „%s” jelentést?'; + $plugin_lang['strreportneedsname'] = 'Meg kell adni a jelentésnevet.'; + $plugin_lang['strreportneedsdef'] = 'SQL kifejezést kell hozzáadni a jelentéshez.'; + $plugin_lang['strreportcreated'] = 'A jelentés megteremtve.'; + $plugin_lang['strreportcreatedbad'] = 'Nem sikerült megteremteni a jelentést.'; +?> diff --git a/plugins/Report/lang/italian.php b/plugins/Report/lang/italian.php new file mode 100644 index 00000000..17716eaa --- /dev/null +++ b/plugins/Report/lang/italian.php @@ -0,0 +1,23 @@ +<?php + /** + * Italian language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Non è stato creato il database dei report. Leggere il file INSTALL per istruzioni.'; + + // Reports - Rapporti + $plugin_lang['strreport'] = 'Rapporto'; + $plugin_lang['strreports'] = 'Rapporti'; + $plugin_lang['strshowallreports'] = 'Mostra tutti i rapporti'; + $plugin_lang['strnoreports'] = 'Nessun rapporto trovato.'; + $plugin_lang['strcreatereport'] = 'Crea rapporto'; + $plugin_lang['strreportdropped'] = 'Rapporto eliminato.'; + $plugin_lang['strreportdroppedbad'] = 'Eliminazione del rapporto fallita.'; + $plugin_lang['strconfdropreport'] = 'Eliminare il rapporto "%s"?'; + $plugin_lang['strreportneedsname'] = 'È necessario specificare un nome per il rapporto.'; + $plugin_lang['strreportneedsdef'] = 'È necessario inserire il codice SQL per il rapporto.'; + $plugin_lang['strreportcreated'] = 'Rapporto salvato'; + $plugin_lang['strreportcreatedbad'] = 'Salvataggio del rapporto fallito.'; +?> diff --git a/plugins/Report/lang/japanese.php b/plugins/Report/lang/japanese.php new file mode 100644 index 00000000..ec0dad25 --- /dev/null +++ b/plugins/Report/lang/japanese.php @@ -0,0 +1,23 @@ +<?php + /** + * Japanese language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'レポートデータベースが作成されていません。ディレクトリにある INSTALL ファイルを読んでください。'; + + // Reports + $plugin_lang['strreport'] = 'レポート'; + $plugin_lang['strreports'] = 'レポート'; + $plugin_lang['strshowallreports'] = 'すべてのレポートを表示する'; + $plugin_lang['strnoreports'] = 'レポートが見つかりません。'; + $plugin_lang['strcreatereport'] = 'レポートを作成する'; + $plugin_lang['strreportdropped'] = 'レポートを破棄しました。'; + $plugin_lang['strreportdroppedbad'] = 'レポートの破棄に失敗しました。'; + $plugin_lang['strconfdropreport'] = '本当にレポート「%s」を破棄しますか?'; + $plugin_lang['strreportneedsname'] = 'レポート名を指定する必要があります。'; + $plugin_lang['strreportneedsdef'] = 'レポート用のSQLを指定する必要があります。'; + $plugin_lang['strreportcreated'] = 'レポートの保存をしました。'; + $plugin_lang['strreportcreatedbad'] = 'レポートの保存に失敗しました。'; +?> diff --git a/plugins/Report/lang/lithuanian.php b/plugins/Report/lang/lithuanian.php new file mode 100644 index 00000000..2f4ddd5e --- /dev/null +++ b/plugins/Report/lang/lithuanian.php @@ -0,0 +1,23 @@ +<?php + /** + * Lithuanian language file. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Jūs nesate sukūrę ataskaitų duomenų bazės. Instrukcijas skaitykite INSTALL faile.'; + + // Reports + $plugin_lang['strreport'] = 'Ataskaita'; + $plugin_lang['strreports'] = 'Ataskaitos'; + $plugin_lang['strshowallreports'] = 'Rodyti visas ataskaitas'; + $plugin_lang['strnoreports'] = 'Ataskaitų nerasta.'; + $plugin_lang['strcreatereport'] = 'Kurti ataskaitą'; + $plugin_lang['strreportdropped'] = 'Ataskaita pašalinta.'; + $plugin_lang['strreportdroppedbad'] = 'Nepavyko pašalinti ataskaitos.'; + $plugin_lang['strconfdropreport'] = 'Ar tikrai norite šalinti ataskaitą "%s"?'; + $plugin_lang['strreportneedsname'] = 'Turite suteikti ataskaitai pavadinimą.'; + $plugin_lang['strreportneedsdef'] = 'Turite pateikti ataskaitos SQL apibrėžtį.'; + $plugin_lang['strreportcreated'] = 'Ataskaita įrašyta.'; + $plugin_lang['strreportcreatedbad'] = 'Nepavyko įrašyti ataskaitos.'; +?> diff --git a/plugins/Report/lang/mongol.php b/plugins/Report/lang/mongol.php new file mode 100644 index 00000000..0b171dcd --- /dev/null +++ b/plugins/Report/lang/mongol.php @@ -0,0 +1,22 @@ +<?php + /** + * Mongolian language filen. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + + // Reports + $plugin_lang['strreport'] = 'ядоХд'; + $plugin_lang['strreports'] = 'ядоХдй'; + $plugin_lang['strshowallreports'] = '№ЯЫСкСди згХ ЯдоХдй'; + $plugin_lang['strnoreports'] = 'ядоХдЯз ЮХд.'; + $plugin_lang['strcreatereport'] = 'ѓЯкФСди ЯдоХд'; + $plugin_lang['strreportdropped'] = 'ядоХд еЮЩодЯжХЮ.'; + $plugin_lang['strreportdroppedbad'] = 'ѕЮЩодЯжХЮЩХ ЯдоХдС авХвзСЮЯ.'; + $plugin_lang['strconfdropreport'] = 'їй езХвХЮй, одЯ ШЯдЩдХ еЮЩодЯжЩди ЯдоХд "%s"?'; + $plugin_lang['strreportneedsname'] = 'їСЭ ЮХЯТШЯФЩЭЯ еЫСкСди ЩЭб ЯдоХдС.'; + $plugin_lang['strreportneedsdef'] = 'їСЭ ЮХЯТШЯФЩЭЯ еЫСкСди SQL-кСавЯг ФЬб їСлХЧЯ ЯдоХдС.'; + $plugin_lang['strreportcreated'] = 'ядоХд гЯШвСЮХЮ.'; + $plugin_lang['strreportcreatedbad'] = 'ѓЯШвСЮХЮЩХ ЯдоХдС авХвзСЮЯ.'; +?> diff --git a/plugins/Report/lang/polish.php b/plugins/Report/lang/polish.php new file mode 100644 index 00000000..ed5e0475 --- /dev/null +++ b/plugins/Report/lang/polish.php @@ -0,0 +1,23 @@ +<?php + /** + * Polish language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Nie utworzyłeś bazy raportów. Instrukcję znajdziesz w pliku INSTALL.'; + + // Reports + $plugin_lang['strreport'] = 'Raport'; + $plugin_lang['strreports'] = 'Raporty'; + $plugin_lang['strshowallreports'] = 'Pokaż wszystkie raporty'; + $plugin_lang['strnoreports'] = 'Nie znaleziono raportów.'; + $plugin_lang['strcreatereport'] = 'Utwórz raport'; + $plugin_lang['strreportdropped'] = 'Raport został usunięty.'; + $plugin_lang['strreportdroppedbad'] = 'Próba usunięcia raportu się nie powiodła.'; + $plugin_lang['strconfdropreport'] = 'Czy na pewno chcesz usunąć raport "%s"?'; + $plugin_lang['strreportneedsname'] = 'Musisz nazwać raport.'; + $plugin_lang['strreportneedsdef'] = 'Musisz podać zapytanie SQL definiujące raport.'; + $plugin_lang['strreportcreated'] = 'Raport został utworzony.'; + $plugin_lang['strreportcreatedbad'] = 'Próba utworzenia raportu się nie powiodła.'; +?> diff --git a/plugins/Report/lang/portuguese-br.php b/plugins/Report/lang/portuguese-br.php new file mode 100644 index 00000000..d686d23e --- /dev/null +++ b/plugins/Report/lang/portuguese-br.php @@ -0,0 +1,23 @@ +<?php + /** + * Brazilian Portuguese language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Plugin de relatório'; + $plugin_lang['strnoreportsdb'] = 'Você não criou a base de dados para relatórios. Leia o arquivo INSTALL para resolução.'; + + // Reports + $plugin_lang['strreport'] = 'Relatório'; + $plugin_lang['strreports'] = 'Relatórios'; + $plugin_lang['strshowallreports'] = 'Exibir todos os relatórios'; + $plugin_lang['strnoreports'] = 'Nenhum relatório encontrado.'; + $plugin_lang['strcreatereport'] = 'Criar relatório'; + $plugin_lang['strreportdropped'] = 'Relatório deletado.'; + $plugin_lang['strreportdroppedbad'] = 'Falha ao deletar o relatório.'; + $plugin_lang['strconfdropreport'] = 'Você têm certeza que deseja deletar o relatório "%s"?'; + $plugin_lang['strreportneedsname'] = 'Você deve informar um nome para o seu relatório.'; + $plugin_lang['strreportneedsdef'] = 'Você deve informar o SQL para o seu relatório.'; + $plugin_lang['strreportcreated'] = 'Relatório salvo.'; + $plugin_lang['strreportcreatedbad'] = 'Falha ao salvar o relatório.'; +?> diff --git a/plugins/Report/lang/portuguese-pt.php b/plugins/Report/lang/portuguese-pt.php new file mode 100644 index 00000000..769a2c0a --- /dev/null +++ b/plugins/Report/lang/portuguese-pt.php @@ -0,0 +1,23 @@ +<?php +/** +* Portuguese language file. +*/ + + // Basic strings + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Não criou uma base de dados de relatório. Leia o ficheiro INSTALL para mais informações.'; + + // Reports + $plugin_lang['strreport'] = 'Relatório'; + $plugin_lang['strreports'] = 'Relatórios'; + $plugin_lang['strshowallreports'] = 'Exibir todos os relatórios'; + $plugin_lang['strnoreports'] = 'Relatório não encontrado.'; + $plugin_lang['strcreatereport'] = 'Criar relatório'; + $plugin_lang['strreportdropped'] = 'Relatório eliminado.'; + $plugin_lang['strreportdroppedbad'] = 'Falha ao eliminar o relatório.'; + $plugin_lang['strconfdropreport'] = 'Tem certeza que quer eliminar o relatório "%s"?'; + $plugin_lang['strreportneedsname'] = 'Dê um nome ao seu relatório.'; + $plugin_lang['strreportneedsdef'] = 'Adicione a instrução SQL ao seu relatório.'; + $plugin_lang['strreportcreated'] = 'Relatório salvo.'; + $plugin_lang['strreportcreatedbad'] = 'Falha ao salvar o relatório.'; +?> diff --git a/plugins/Report/lang/romanian.php b/plugins/Report/lang/romanian.php new file mode 100644 index 00000000..c4ad1599 --- /dev/null +++ b/plugins/Report/lang/romanian.php @@ -0,0 +1,23 @@ +<?php + /** + * Romanian language file. + */ + + //Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Nu aţi creat baza de date pentru rapoarte. Citiţi fişierul INSTALL pentru instrucţiuni.'; + + // Reports + $plugin_lang['strreport'] = 'Raport'; + $plugin_lang['strreports'] = 'Rapoarte'; + $plugin_lang['strshowallreports'] = 'Afişare toate rapoartele'; + $plugin_lang['strnoreports'] = 'Nici un raport găsit.'; + $plugin_lang['strcreatereport'] = 'Creare raport'; + $plugin_lang['strreportdropped'] = 'Report dropped.'; + $plugin_lang['strreportdroppedbad'] = 'Ştergere raport eşuată.'; + $plugin_lang['strconfdropreport'] = 'Sigur ştergeţi raportul "%s"?'; + $plugin_lang['strreportneedsname'] = 'Specificaţi un nume pentru raport.'; + $plugin_lang['strreportneedsdef'] = 'Specificaţi o instrucţiune SQL pentru raport.'; + $plugin_lang['strreportcreated'] = 'Raport salvat.'; + $plugin_lang['strreportcreatedbad'] = 'Salvare raport eşuată.'; +?> diff --git a/plugins/Report/lang/russian.php b/plugins/Report/lang/russian.php new file mode 100644 index 00000000..2082be2a --- /dev/null +++ b/plugins/Report/lang/russian.php @@ -0,0 +1,23 @@ +<?php + /** + * Russian UTF-8 language file. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Вы не создали базу данных отчетов. Читайте разъяснения в файле INSTALL.'; + + // Reports + $plugin_lang['strreport'] = 'Отчет'; + $plugin_lang['strreports'] = 'Отчеты'; + $plugin_lang['strshowallreports'] = 'Показать все отчеты'; + $plugin_lang['strnoreports'] = 'Отчетов нет.'; + $plugin_lang['strcreatereport'] = 'Создать отчет'; + $plugin_lang['strreportdropped'] = 'Отчет уничтожен.'; + $plugin_lang['strreportdroppedbad'] = 'Уничтожение отчета прервано.'; + $plugin_lang['strconfdropreport'] = 'Вы уверены, что хотите уничтожить отчет "%s"?'; + $plugin_lang['strreportneedsname'] = 'Вам необходимо указать имя отчета.'; + $plugin_lang['strreportneedsdef'] = 'Вам необходимо указать SQL-запрос для Вашего отчета.'; + $plugin_lang['strreportcreated'] = 'Отчет сохранен.'; + $plugin_lang['strreportcreatedbad'] = 'Сохранение отчета прервано.'; +?> diff --git a/plugins/Report/lang/slovak.php b/plugins/Report/lang/slovak.php new file mode 100644 index 00000000..fa55a36b --- /dev/null +++ b/plugins/Report/lang/slovak.php @@ -0,0 +1,23 @@ +<?php + /** + * Slovenska lokalizacia phpPgAdmin-u. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Nebola vytvorené report databáza. Prečítaj si INSTALL súbor s pokynmi.'; + + // Reports + $plugin_lang['strreport'] = 'Report'; + $plugin_lang['strreports'] = 'Reporty'; + $plugin_lang['strshowallreports'] = 'Zobraziť Všetky Reporty'; + $plugin_lang['strnoreports'] = 'Nenájdené žiadne reporty.'; + $plugin_lang['strcreatereport'] = 'Vytvoriť Report'; + $plugin_lang['strreportdropped'] = 'Report zmazaný.'; + $plugin_lang['strreportdroppedbad'] = 'Report nebol zmazaný.'; + $plugin_lang['strconfdropreport'] = 'Naozaj chceš zmazať report "%s"?'; + $plugin_lang['strreportneedsname'] = 'Musíš zadať názov pre tvoj report.'; + $plugin_lang['strreportneedsdef'] = 'Musíš zadať SQL dotaz pre tvoj report.'; + $plugin_lang['strreportcreated'] = 'Report uložený.'; + $plugin_lang['strreportcreatedbad'] = 'Report nebol uložený.'; +?> diff --git a/plugins/Report/lang/spanish.php b/plugins/Report/lang/spanish.php new file mode 100644 index 00000000..7499d2f0 --- /dev/null +++ b/plugins/Report/lang/spanish.php @@ -0,0 +1,23 @@ +<?php + /** + * Spanish language file. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Aún no se ha creado la base de datos para los reportes. Lea las instrucciones del archivo INSTALL.'; + + // Reports + $plugin_lang['strreport'] = 'Reporte'; + $plugin_lang['strreports'] = 'Reportes'; + $plugin_lang['strshowallreports'] = 'Mostrar todos los reportes'; + $plugin_lang['strnoreports'] = 'No se encontró el reporte.'; + $plugin_lang['strcreatereport'] = 'Crear Reporte'; + $plugin_lang['strreportdropped'] = 'Reporte eliminado.'; + $plugin_lang['strreportdroppedbad'] = 'Falló al eliminar el Reporte.'; + $plugin_lang['strconfdropreport'] = '¿Estás seguro que quiere eliminar el reporte "%s"?'; + $plugin_lang['strreportneedsname'] = 'Debe especificar un nombre para el reporte.'; + $plugin_lang['strreportneedsdef'] = 'Debe especificar un SQL para el reporte.'; + $plugin_lang['strreportcreated'] = 'Reporte guardado.'; + $plugin_lang['strreportcreatedbad'] = 'Falló al guardar el reporte.'; +?> diff --git a/plugins/Report/lang/swedish.php b/plugins/Report/lang/swedish.php new file mode 100644 index 00000000..8936ea6c --- /dev/null +++ b/plugins/Report/lang/swedish.php @@ -0,0 +1,25 @@ +<?php + /** + * Swedish language file. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Du har inte skapat någon rapportdatabas. Läs filen INSTALL för instruktioner.'; + + // Reports + $plugin_lang['strreport'] = 'Rapport'; + $plugin_lang['strreports'] = 'Rapporter'; + $plugin_lang['strshowallreports'] = 'Visa alla rapporter'; + $plugin_lang['strtopbar'] = '%s körs på %s:%s -- Du är inloggad som användare "%s"'; + $plugin_lang['strtimefmt'] = 'jS M, Y g:iA'; + $plugin_lang['strnoreports'] = 'Hittade inga rapporter.'; + $plugin_lang['strcreatereport'] = 'Skapa rapport'; + $plugin_lang['strreportdropped'] = 'Rapport skapad.'; + $plugin_lang['strreportcreated'] = 'Rapport sparad.'; + $plugin_lang['strreportneedsname'] = 'Du måste namnge din rapport.'; + $plugin_lang['strreportcreatedbad'] = 'Misslyckades att spara rapport.'; + $plugin_lang['strreportdroppedbad'] = 'Misslyckades att skapa rapport.'; + $plugin_lang['strconfdropreport'] = 'Är du säker på att du vill radera rapporten "%s"?'; + $plugin_lang['strreportneedsdef'] = 'Du måste ange din SQL-fråga.'; +?> diff --git a/plugins/Report/lang/turkish.php b/plugins/Report/lang/turkish.php new file mode 100644 index 00000000..278bd9fa --- /dev/null +++ b/plugins/Report/lang/turkish.php @@ -0,0 +1,23 @@ +<?php + /** + * Turkish language file. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'reports veritabanı yaratışmamış. Yönergeler için lütfen INSTALL dosyasını okuyunuz.'; + + // Reports + $plugin_lang['strreport'] = 'Rapor'; + $plugin_lang['strreports'] = 'Raporlar'; + $plugin_lang['strshowallreports'] = 'Tüm raporları göster'; + $plugin_lang['strnoreports'] = 'Hiçbir rapor bulunamadı'; + $plugin_lang['strcreatereport'] = 'Rapor yaratıldı.'; + $plugin_lang['strreportdropped'] = 'Rapor silindi'; + $plugin_lang['strreportdroppedbad'] = 'Rapor silme işi başarısız oldu.'; + $plugin_lang['strconfdropreport'] = '"%s" raporunu silmek istediğinize emin misiniz?'; + $plugin_lang['strreportneedsname'] = 'Raporunuza bir ad vermelisiniz.'; + $plugin_lang['strreportneedsdef'] = 'Raporunuz için SQL sorguları yazmalısınız.'; + $plugin_lang['strreportcreated'] = 'Rapor kaydedildi.'; + $plugin_lang['strreportcreatedbad'] = 'Rapor kaydetme başarısız oldu.'; +?> diff --git a/plugins/Report/lang/ukrainian.php b/plugins/Report/lang/ukrainian.php new file mode 100644 index 00000000..16060472 --- /dev/null +++ b/plugins/Report/lang/ukrainian.php @@ -0,0 +1,23 @@ +<?php + /** + * Ukrainian KOI8-U language file. + */ + + // Basic + $plugin_lang['strplugindescription'] = 'Report plugin'; + $plugin_lang['strnoreportsdb'] = 'Ви не створили базу даних зв╕т╕в. Читайте пояснення в файл╕ INSTALL.'; + + // Reports + $plugin_lang['strreport'] = 'Зв╕т'; + $plugin_lang['strreports'] = 'Зв╕ти'; + $plugin_lang['strshowallreports'] = 'Показати вс╕ зв╕ти'; + $plugin_lang['strnoreports'] = 'Зв╕т╕в нема╓.'; + $plugin_lang['strcreatereport'] = 'Створити зв╕т'; + $plugin_lang['strreportdropped'] = 'Зв╕т видалено.'; + $plugin_lang['strreportdroppedbad'] = 'Видалення зв╕та перервано.'; + $plugin_lang['strconfdropreport'] = 'Ви впевнен╕, що бажа╓тее видалити зв╕т "%s"?'; + $plugin_lang['strreportneedsname'] = 'Вам необх╕дно вказати ╕м"я зв╕ту.'; + $plugin_lang['strreportneedsdef'] = 'Вам необх╕дно вказати SQL-запит для Вашого зв╕ту.'; + $plugin_lang['strreportcreated'] = 'Зв╕т збережено.'; + $plugin_lang['strreportcreatedbad'] = 'Збереження зв╕ту перервано.'; +?> diff --git a/plugins/Report/plugin.php b/plugins/Report/plugin.php new file mode 100644 index 00000000..8af27c05 --- /dev/null +++ b/plugins/Report/plugin.php @@ -0,0 +1,774 @@ +<?php +require_once('./classes/Plugin.php'); +require_once('./plugins/Report/classes/Reports.php'); + +class Report extends Plugin { + + /** + * Attributes + */ + protected $name = 'Report'; + protected $lang; + protected $conf = array(); + protected $_reportsdb = null; + + /** + * Constructor + * Call parent constructor, passing the language that will be used. + * @param $language Current phpPgAdmin language. If it was not found in the plugin, English will be used. + */ + function __construct($language) { + global $data; + + /* loads $this->lang and $this->conf */ + parent::__construct($language); + + /* default values */ + if (! isset($this->conf['reports_db'])) { + $this->conf['reports_db'] = 'phppgadmin'; + } + if (! isset($this->conf['reports_schema'])) { + $this->conf['reports_schema'] = 'public'; + } + if (! isset($this->conf['reports_table'])) { + $this->conf['reports_table'] = 'ppa_reports'; + } + if (! isset($this->conf['owned_reports_only'])) { + $this->conf['owned_reports_only'] = false; + } + } + + function get_reportsdb() { + if ($this->_reportsdb === null) { + $status = 0; + $this->_reportsdb = new Reports($this->conf, $status); + + if ($status !== 0) { + global $misc, $lang; + $misc->printHeader($lang['strreports']); + $misc->printBody(); + $misc->printTrail('server'); + $misc->printTabs('server','reports'); + $misc->printMsg($lang['strnoreportsdb']); + $misc->printFooter(); + exit; + } + } + + return $this->_reportsdb; + } + + /** + * This method returns the functions that will hook in the phpPgAdmin core. + * To do include a function just put in the $hooks array the follwing code: + * 'hook' => array('function1', 'function2'). + * + * Example: + * $hooks = array( + * 'toplinks' => array('add_plugin_toplinks'), + * 'tabs' => array('add_tab_entry'), + * 'action_buttons' => array('add_more_an_entry') + * ); + * + * @return $hooks + */ + function get_hooks() { + $hooks = array( + 'tabs' => array('add_plugin_tabs'), + 'trail' => array('add_plugin_trail'), + 'navlinks' => array('add_plugin_navlinks') + ); + return $hooks; + } + + /** + * This method returns the functions that will be used as actions. + * To do include a function that will be used as action, just put in the $actions array the follwing code: + * + * $actions = array( + * 'show_page', + * 'show_error', + * ); + * + * @return $actions + */ + function get_actions() { + $actions = array( + 'save_edit', + 'edit', + 'properties', + 'save_create', + 'create', + 'drop', + 'confirm_drop', + 'execute', + 'default_action' + ); + return $actions; + } + + /** + * Add plugin in the tabs + * @param $plugin_functions_parameters + */ + function add_plugin_tabs(&$plugin_functions_parameters) { + global $misc; + + $tabs = &$plugin_functions_parameters['tabs']; + + if ($plugin_functions_parameters['section'] == 'server') { + $tabs['report_plugin'] = array ( + 'title' => $this->lang['strplugindescription'], + 'url' => 'plugin.php', + 'urlvars' => array( + 'subject' => 'server', + 'action' => 'default_action', + 'plugin' => $this->name + ), + 'hide' => false, + 'icon' => $this->icon('Report') + ); + } + + if ($plugin_functions_parameters['section'] == 'report') { + $tabs['report_plugin'] = array ( + 'title' => $this->lang['strplugindescription'], + 'url' => 'plugin.php', + 'urlvars' => array( + 'subject' => 'server', + 'action' => 'default_action', + 'plugin' => $this->name + ), + 'hide' => false, + 'icon' => $this->icon('Report') + ); + } + } + + /** + * Add plugin in the trail + * @param $plugin_functions_parameters + */ + function add_plugin_trail(&$plugin_functions_parameters) { + global $misc, $lang; + $trail = &$plugin_functions_parameters['trail']; + $done = false; + $subject = ''; + if (isset($_REQUEST['subject'])) { + $subject = $_REQUEST['subject']; + } + + $action = ''; + if (isset($_REQUEST['action'])) { + $action = $_REQUEST['action']; + } + + if (isset($_REQUEST['plugin']) and $_REQUEST['plugin'] == 'Report') { + $url = array ( + 'url' => 'plugin.php', + 'urlvars' => array ( + 'plugin' => $this->name, + 'action' => 'default_action' + ) + ); + $trail['report_plugin'] = array ( + 'title' => $this->lang['strreport'], + 'text' => $this->lang['strreport'], + 'url' => $misc->getActionUrl($url, $_REQUEST, null, false), + 'icon' => $this->icon('Reports') + ); + } + + if (isset($_REQUEST['plugin']) + and $_REQUEST['plugin'] == 'Report' + and $action != 'default_action' + and in_array($action, $this->get_actions()) + ) { + + $url = array ( + 'url' => 'plugin.php', + 'urlvars' => array ( + 'plugin' => $this->name, + 'action' => 'properties', + 'report_id' => field('report_id'), + ) + ); + + if (isset($_REQUEST['report'])) + $url['urlvars']['report'] = field('report'); + + $trail['report_plugin_name'] = array ( + 'title' => $this->lang['strreport'], + 'text' => $this->lang['strreport'], + 'url' => $misc->getActionUrl($url, $_REQUEST, null, false), + 'icon' => $this->icon('Report') + ); + + if (isset($_REQUEST['report'])) + $trail['report_plugin_name']['text'] = $_REQUEST['report']; + + } + } + + /** + * Add plugin in the navlinks + * @param $plugin_functions_parameters + */ + function add_plugin_navlinks(&$params) { + global $misc, $lang; + + if ( + ($params['place'] == 'sql-form' or $params['place'] == 'display-browse') + and (isset($_SESSION['sqlquery']) && isset($params['env']['rs']) && is_object($params['env']['rs']) && $params['env']['rs']->recordCount() > 0) + ) { + switch ($params['place']) { + case 'sql-form': + case 'display-browse': + if ( ! (isset($_REQUEST['plugin']) && $_REQUEST['plugin'] == $this->name) ) + $params['navlinks'][] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array ( + 'plugin' => $this->name, + 'action' => 'create', + 'server' => field('server'), + 'database' => field('database'), + 'schema' => field('schema'), + 'report_sql' => $_SESSION['sqlquery'] + ) + ) + ), + 'content' => $this->lang['strcreatereport'] + ); + else + $params['navlinks'][] = array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array ( + 'plugin' => $this->name, + 'action' => 'edit', + 'server' => field('server'), + 'database' => field('database'), + // 'schema' => field('schema'), + 'report_id' => field('report_id') + ) + ) + ), + 'content' => $lang['stredit'] + ); + break; + // case 'display-browse': + // if ( ! (isset($_REQUEST['plugin']) && $_REQUEST['plugin'] == $this->name) ) + // $params['navlinks'][] = array ( + // 'attr'=> array ( + // 'href' => array ( + // 'url' => 'plugin.php', + // 'urlvars' => array ( + // 'plugin' => $this->name, + // 'action' => 'create', + // 'server' => field('server'), + // 'database' => field('database'), + // 'schema' => field('schema'), + // 'report_sql' => field('query'), + // 'paginate' => (isset($_REQUEST['paginate']) ? $_REQUEST['paginate'] : 'f') + // ) + // ) + // ), + // 'content' => $this->lang['strcreatereport'] + // ); + // else + // $params['navlinks'][] = array ( + // 'attr'=> array ( + // 'href' => array ( + // 'url' => 'plugin.php', + // 'urlvars' => array ( + // 'plugin' => $this->name, + // 'action' => 'edit', + // 'server' => field('server'), + // 'database' => field('database'), + // // 'schema' => field('schema'), + // 'report_id' => field('report_id') + // ) + // ) + // ), + // 'content' => $lang['stredit'] + // ); + break; + } + } + } + + function get_subject_params() { + $vars = array(); + + if (! isset($_REQUEST['action'])) + return $vars; + + $action = $_REQUEST['action']; + + switch ($action) { + case 'execute': + $vars = array( + 'report_id' => $_REQUEST['report_id'], + 'report' => $_REQUEST['report'], + 'action' => 'properties' /*defaults to properties*/ + ); + if (isset($_REQUEST['back'])) + $vars['action'] = $_REQUEST['back']; + break; + } + + return $vars; + } + + function edit($msg = '') { + global $data, $misc, $lang; + + $reportsdb = $this->get_reportsdb(); + + $misc->printHeader($this->lang['strreports']); + $misc->printBody(); + $misc->printTrail('server'); + $misc->printTabs('server', 'report_plugin'); + $misc->printMsg($msg); + + // If it's a first, load then get the data from the database + $report = $reportsdb->getReport($_REQUEST['report_id']); + + if ($_REQUEST['action'] == 'edit') { + $_POST['report_name'] = $report->fields['report_name']; + $_POST['db_name'] = $report->fields['db_name']; + $_POST['descr'] = $report->fields['descr']; + $_POST['report_sql'] = $report->fields['report_sql']; + if ($report->fields['paginate'] == 't') { + $_POST['paginate'] = true; + } + } + + // Get a list of available databases + $databases = $data->getDatabases(); + + $_REQUEST['report'] = $report->fields['report_name']; + + echo "<form action=\"plugin.php?plugin={$this->name}\" method=\"post\">\n"; + echo $misc->form; + echo "<table style=\"width: 100%\">\n"; + echo "<tr><th class=\"data left required\">{$lang['strname']}</th>\n"; + echo "<td class=\"data1\"><input name=\"report_name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", + htmlspecialchars($_POST['report_name']), "\" /></td></tr>\n"; + echo "<tr><th class=\"data left required\">{$lang['strdatabase']}</th>\n"; + echo "<td class=\"data1\"><select name=\"db_name\">\n"; + while (!$databases->EOF) { + $dbname = $databases->fields['datname']; + echo "<option value=\"", htmlspecialchars($dbname), "\"", + ($dbname == $_POST['db_name']) ? ' selected="selected"' : '', ">", + htmlspecialchars($dbname), "</option>\n"; + $databases->moveNext(); + } + echo "</select></td></tr>\n"; + echo "<tr><th class=\"data left\">{$lang['strcomment']}</th>\n"; + echo "<td class=\"data1\"><textarea style=\"width:100%;\" rows=\"5\" cols=\"50\" name=\"descr\">", + htmlspecialchars($_POST['descr']), "</textarea></td></tr>\n"; + echo "<tr><th class=\"data left required\">{$lang['strsql']}</th>\n"; + echo "<td class=\"data1\"><textarea style=\"width:100%;\" rows=\"15\" cols=\"50\" name=\"report_sql\">", + htmlspecialchars($_POST['report_sql']), "</textarea></td></tr>\n"; + echo "</table>\n"; + echo "<label for=\"paginate\"><input type=\"checkbox\" id=\"paginate\" name=\"paginate\"", (isset($_POST['paginate']) ? ' checked="checked"' : ''), " /> {$lang['strpaginate']}</label>\n"; + echo "<p><input type=\"hidden\" name=\"action\" value=\"save_edit\" />\n"; + echo "<input type=\"submit\" value=\"{$lang['strsave']}\" />\n"; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n"; + echo "<input type=\"hidden\" name=\"report_id\" value=\"{$report->fields['report_id']}\" />\n"; + echo "</form>\n"; + $misc->printFooter(); + } + + /** + * Saves changes to a report + */ + function save_edit() { + global $lang; + + $reportsdb = $this->get_reportsdb(); + + if (isset($_REQUEST['cancel'])) { + $this->default_action(); + exit; + } + + if (!isset($_POST['report_name'])) $_POST['report_name'] = ''; + if (!isset($_POST['db_name'])) $_POST['db_name'] = ''; + if (!isset($_POST['descr'])) $_POST['descr'] = ''; + if (!isset($_POST['report_sql'])) $_POST['report_sql'] = ''; + + // Check that they've given a name and a definition + if ($_POST['report_name'] == '') { + $this->edit($this->lang['strreportneedsname']); + } elseif ($_POST['report_sql'] == '') { + $this->edit($this->lang['strreportneedsdef']); + } else { + $status = $reportsdb->alterReport($_POST['report_id'], $_POST['report_name'], $_POST['db_name'], + $_POST['descr'], $_POST['report_sql'], isset($_POST['paginate'])); + if ($status == 0) + $this->default_action($this->lang['strreportcreated']); + else + $this->edit($this->lang['strreportcreatedbad']); + } + } + + /** + * Display read-only properties of a report + */ + function properties($msg = '') { + global $data, $reportsdb, $misc; + global $lang; + + $reportsdb = $this->get_reportsdb(); + + $misc->printHeader($this->lang['strreports']); + $misc->printBody(); + $misc->printTrail('server'); + $misc->printTabs('server', 'report_plugin'); + $misc->printMsg($msg); + + $report = $reportsdb->getReport($_REQUEST['report_id']); + + $_REQUEST['report'] = $report->fields['report_name']; + + if ($report->recordCount() == 1) { + echo "<table>\n"; + echo "<tr><th class=\"data left\">{$lang['strname']}</th>\n"; + echo "<td class=\"data1\">", $misc->printVal($report->fields['report_name']), "</td></tr>\n"; + echo "<tr><th class=\"data left\">{$lang['strdatabase']}</th>\n"; + echo "<td class=\"data1\">", $misc->printVal($report->fields['db_name']), "</td></tr>\n"; + echo "<tr><th class=\"data left\">{$lang['strcomment']}</th>\n"; + echo "<td class=\"data1\">", $misc->printVal($report->fields['descr']), "</td></tr>\n"; + echo "<tr><th class=\"data left\">{$lang['strpaginate']}</th>\n"; + echo "<td class=\"data1\">", $misc->printVal($report->fields['paginate'], 'yesno', array('align' => 'left')), "</td></tr>\n"; + echo "<tr><th class=\"data left\">{$lang['strsql']}</th>\n"; + echo "<td class=\"data1\">", $misc->printVal($report->fields['report_sql']), "</td></tr>\n"; + echo "</table>\n"; + } + else echo "<p>{$lang['strinvalidparam']}</p>\n"; + + $urlvars = array ( + 'plugin' => $this->name, + 'server' => $_REQUEST['server'] + ); + if (isset($_REQUEST['schema'])) $urlvars['schema'] = $_REQUEST['schema']; + if (isset($_REQUEST['schema'])) $urlvars['database'] = $_REQUEST['schema']; + + $navlinks = array ( + 'showall' => array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array_merge($urlvars, array('action' => 'default_action')) + ) + ), + 'content' => $this->lang['strshowallreports'] + ), + 'edit' => array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array_merge($urlvars, array( + 'action' => 'edit', + 'report_id' => $report->fields['report_id']) + ) + ) + ), + 'content' => $lang['stredit'] + ), + 'execute' => array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array_merge($urlvars, array( + 'action' => 'execute', + 'report' => $report->fields['report_name'], + 'database' => $report->fields['db_name'], + 'report_id' => $report->fields['report_id'], + 'paginate' => $report->fields['paginate'], + 'nohistory' => 't', + 'return' => 'plugin', + 'back' => 'properties' + )) + ) + ), + 'content' => $lang['strexecute'] + ) + ); + $misc->printNavLinks($navlinks, 'reports-properties'); + } + + /** + * Displays a screen where they can enter a new report + */ + function create($msg = '') { + global $data, $reportsdb, $misc; + global $lang; + + $misc->printHeader($this->lang['strreports']); + $misc->printBody(); + $misc->printTrail('server'); + $misc->printTabs('server', 'report_plugin'); + $misc->printMsg($msg); + + if (!isset($_REQUEST['report_name'])) $_REQUEST['report_name'] = ''; + if (!isset($_REQUEST['db_name'])) $_REQUEST['db_name'] = ''; + if (!isset($_REQUEST['descr'])) $_REQUEST['descr'] = ''; + if (!isset($_REQUEST['report_sql'])) $_REQUEST['report_sql'] = ''; + + if (isset($_REQUEST['database'])) { + $_REQUEST['db_name'] = $_REQUEST['database']; + unset($_REQUEST['database']); + $misc->setForm(); + } + + $databases = $data->getDatabases(); + + echo "<form action=\"plugin.php?plugin={$this->name}\" method=\"post\">\n"; + echo $misc->form; + echo "<table style=\"width: 100%\">\n"; + echo "<tr><th class=\"data left required\">{$lang['strname']}</th>\n"; + echo "<td class=\"data1\"><input name=\"report_name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", + htmlspecialchars($_REQUEST['report_name']), "\" /></td></tr>\n"; + echo "<tr><th class=\"data left required\">{$lang['strdatabase']}</th>\n"; + echo "<td class=\"data1\"><select name=\"db_name\">\n"; + while (!$databases->EOF) { + $dbname = $databases->fields['datname']; + echo "<option value=\"", htmlspecialchars($dbname), "\"", + ($dbname == $_REQUEST['db_name']) ? ' selected="selected"' : '', ">", + htmlspecialchars($dbname), "</option>\n"; + $databases->moveNext(); + } + echo "</select></td></tr>\n"; + echo "<tr><th class=\"data left\">{$lang['strcomment']}</th>\n"; + echo "<td class=\"data1\"><textarea style=\"width:100%;\" rows=\"5\" cols=\"50\" name=\"descr\">", + htmlspecialchars($_REQUEST['descr']), "</textarea></td></tr>\n"; + echo "<tr><th class=\"data left required\">{$lang['strsql']}</th>\n"; + echo "<td class=\"data1\"><textarea style=\"width:100%;\" rows=\"15\" cols=\"50\" name=\"report_sql\">", + htmlspecialchars($_REQUEST['report_sql']), "</textarea></td></tr>\n"; + echo "</table>\n"; + echo "<label for=\"paginate\"><input type=\"checkbox\" id=\"paginate\" name=\"paginate\"", (isset($_REQUEST['paginate']) ? ' checked="checked"' : ''), " /> {$lang['strpaginate']}</label>\n"; + echo "<p><input type=\"hidden\" name=\"action\" value=\"save_create\" />\n"; + echo "<input type=\"submit\" value=\"{$lang['strsave']}\" />\n"; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n"; + echo "</form>\n"; + $misc->printFooter(); + } + + /** + * Actually creates the new report in the database + */ + function save_create() { + global $lang; + + if (isset($_REQUEST['cancel'])) { + $this->default_action(); + exit; + } + + $reportsdb = $this->get_reportsdb(); + + if (!isset($_POST['report_name'])) $_POST['report_name'] = ''; + if (!isset($_POST['db_name'])) $_POST['db_name'] = ''; + if (!isset($_POST['descr'])) $_POST['descr'] = ''; + if (!isset($_POST['report_sql'])) $_POST['report_sql'] = ''; + + // Check that they've given a name and a definition + if ($_POST['report_name'] == '') $this->create($this->lang['strreportneedsname']); + elseif ($_POST['report_sql'] == '') $this->create($this->lang['strreportneedsdef']); + else { + $status = $reportsdb->createReport($_POST['report_name'], $_POST['db_name'], + $_POST['descr'], $_POST['report_sql'], isset($_POST['paginate'])); + if ($status == 0) + $this->default_action($this->lang['strreportcreated']); + else + $this->create($this->lang['strreportcreatedbad']); + } + } + + /** + * Show confirmation of drop and perform actual drop + */ + function drop() { + global $reportsdb, $misc; + global $lang; + + $confirm = false; + if (isset($_REQUEST['confirm'])) $confirm = true; + + $reportsdb = $this->get_reportsdb(); + + $misc->printHeader($this->lang['strreports']); + $misc->printBody(); + + if (isset($_REQUEST['cancel'])) { + $this->default_action(); + exit; + } + + if ($confirm) { + // Fetch report from the database + $report = $reportsdb->getReport($_REQUEST['report_id']); + + $_REQUEST['report'] = $report->fields['report_name']; + $misc->printTrail('report'); + $misc->printTitle($lang['strdrop']); + + echo "<p>", sprintf($this->lang['strconfdropreport'], $misc->printVal($report->fields['report_name'])), "</p>\n"; + + echo "<form action=\"plugin.php?plugin={$this->name}\" method=\"post\">\n"; + echo $misc->form; + echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n"; + echo "<input type=\"hidden\" name=\"report_id\" value=\"", htmlspecialchars($_REQUEST['report_id']), "\" />\n"; + echo "<input type=\"submit\" name=\"drop\" value=\"{$lang['strdrop']}\" />\n"; + echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n"; + echo "</form>\n"; + } else { + $status = $reportsdb->dropReport($_POST['report_id']); + if ($status == 0) + $this->default_action($this->lang['strreportdropped']); + else + $this->default_action($this->lang['strreportdroppedbad']); + } + + $misc->printFooter(); + } + + function execute() { + global $misc, $lang, $data; + + $reportsdb = $this->get_reportsdb(); + + $report = $reportsdb->getReport($_REQUEST['report_id']); + + $_POST['query'] = $report->fields['report_sql']; + + include('./sql.php'); + } + + /** + * Show default list of reports in the database + */ + function default_action($msg = '') { + global $data, $misc, $lang; + + $reportsdb = $this->get_reportsdb(); + + $misc->printHeader($this->lang['strreports']); + $misc->printBody(); + $misc->printTrail('server'); + $misc->printTabs('server', 'report_plugin'); + $misc->printMsg($msg); + + $reports = $reportsdb->getReports(); + + $columns = array( + 'report' => array( + 'title' => $this->lang['strreport'], + 'field' => field('report_name'), + 'url' => "plugin.php?plugin={$this->name}&action=properties&{$misc->href}&", + 'vars' => array( + 'report_id' => 'report_id', + 'report' => 'report_name' + ), + ), + 'database' => array( + 'title' => $lang['strdatabase'], + 'field' => field('db_name'), + ), + 'created' => array( + 'title' => $lang['strcreated'], + 'field' => field('date_created'), + ), + 'paginate' => array( + 'title' => $lang['strpaginate'], + 'field' => field('paginate'), + 'type' => 'yesno', + ), + 'actions' => array( + 'title' => $lang['stractions'], + ), + 'comment' => array( + 'title' => $lang['strcomment'], + 'field' => field('descr'), + ), + ); + + //$return_url = urlencode("plugin.php?plugin={$this->name}&{$misc->href}"); + $urlvars = $misc->getRequestVars(); + + $actions = array( + 'run' => array ( + 'content' => $lang['strexecute'], + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array_merge($urlvars, array ( + 'plugin' => $this->name, + 'action' => 'execute', + 'report' => field('report_name'), + 'database' => field('db_name'), + 'report_id' => field('report_id'), + 'paginate' => field('paginate'), + 'nohistory' => 't', + 'return' => 'plugin', + 'back' => 'default_action' + )) + ) + ) + ), + 'edit' => array ( + 'content' => $lang['stredit'], + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array_merge($urlvars, array ( + 'plugin' => $this->name, + 'action' => 'edit', + 'report_id' => field('report_id'), + )) + ) + ) + ), + 'drop' => array( + 'content' => $lang['strdrop'], + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array_merge($urlvars, array ( + 'plugin' => $this->name, + 'action' => 'drop', + 'confirm' => 'true', + 'report_id' => field('report_id'), + )) + ) + ) + ), + ); + + $misc->printTable($reports, $columns, $actions, 'reports-reports', $this->lang['strnoreports']); + + $navlinks = array ( + array ( + 'attr'=> array ( + 'href' => array ( + 'url' => 'plugin.php', + 'urlvars' => array ( + 'plugin' => $this->name, + 'server' => field('server'), + 'action' => 'create') + ) + ), + 'content' => $this->lang['strcreatereport'] + ) + ); + $misc->printNavLinks($navlinks, 'reports-reports'); + $misc->printFooter(); + } +} +?> diff --git a/plugins/Report/sql/reports-pgsql.sql b/plugins/Report/sql/reports-pgsql.sql new file mode 100644 index 00000000..1272a762 --- /dev/null +++ b/plugins/Report/sql/reports-pgsql.sql @@ -0,0 +1,27 @@ +-- SQL script to create reports database for PostgreSQL +-- +-- To run, type: psql template1 < reports-pgsql.sql +-- +-- $Id: reports-pgsql.sql,v 1.4 2007/04/16 11:02:36 mr-russ Exp $ + +CREATE DATABASE phppgadmin; + +\connect phppgadmin + +CREATE TABLE ppa_reports ( + report_id SERIAL, + report_name varchar(255) NOT NULL, + db_name varchar(255) NOT NULL, + date_created date DEFAULT NOW() NOT NULL, + created_by varchar(255) NOT NULL, + descr text, + report_sql text NOT NULL, + paginate boolean NOT NULL, + PRIMARY KEY (report_id) +); + +-- Allow everyone to do everything with reports. This may +-- or may not be what you want. +GRANT SELECT,INSERT,UPDATE,DELETE ON ppa_reports TO PUBLIC; +GRANT SELECT,UPDATE ON ppa_reports_report_id_seq TO PUBLIC; + |