This commit is contained in:
biosvos
2026-08-07 17:38:18 +09:00
commit 873193a243
9613 changed files with 2755992 additions and 0 deletions
@@ -0,0 +1,484 @@
<?php
$plugin_conf = array(
/**
* Top Links
**/
'top_links' => array (
// 'sql' => true,
// 'history' => true,
// 'find' => true,
// 'logout' => true,
),
/**
* Tabs Links
**/
'tab_links' => array (
'root' => array (
// 'intro' => true,
// 'servers' => true,
),
'server' => array (
// 'databases' => true,
// 'roles' => true, /* postgresql 8.1+ */
// 'users' => true, /* postgresql <8.1 */
// 'groups' => true,
// 'account' => true,
// 'tablespaces' => true,
// 'export' => true,
// 'reports' => true,
),
'database' => array (
// 'schemas' => true,
// 'sql' => true,
// 'find' => true,
// 'variables' => true,
// 'processes' => true,
// 'locks' => true,
// 'admin' => true,
// 'privileges' => true,
// 'languages' => true,
// 'casts' => true,
// 'export' => true,
),
'schema' => array(
// 'tables' => true,
// 'views' => true,
// 'sequences' => true,
// 'functions' => true,
// 'fulltext' => true,
// 'domains' => true,
// 'aggregates' => true,
// 'types' => true,
// 'operators' => true,
// 'opclasses' => true,
// 'conversions' => true,
// 'privileges' => true,
// 'export' => true,
),
'table' => array(
// 'columns' => true,
// 'indexes' => true,
// 'constraints' => true,
// 'triggers' => true,
// 'rules' => true,
// 'admin' => true,
// 'info' => true,
// 'privileges' => true,
// 'import' => true,
// 'export' => true,
),
'view' => array (
// 'columns' => true,
// 'definition' => true,
// 'rules' => true,
// 'privileges' => true,
// 'export' => true,
),
'function' => array(
// 'definition' => true,
// 'privileges' => true,
),
'aggregate' => array(
// 'definition' => true,
),
'role' => array(
// 'definition' => true,
),
'popup' => array(
// 'sql' => true,
// 'find' => true,
),
'column' => array(
// 'properties' => true,
// 'privileges' => true,
),
'fulltext' => array(
// 'ftsconfigs' => true,
// 'ftsdicts' => true,
// 'ftsparsers' => true,
),
),
/**
* Trail Links
**/
// 'trail_links' => true, /* enable/disable the whole trail */
/**
* Navigation Links
**/
'navlinks' => array(
'aggregates-properties' => array(
// 'showall' => true,
// 'alter' => true,
// 'drop' => true,
),
'aggregates-aggregates' => array(
// 'create' => true,
),
'all_db-databases' => array(
// 'create' => true,
),
'colproperties-colproperties' => array(
// 'browse' => true,
// 'alter' => true,
// 'drop' => true,
),
'constraints-constraints' => array(
// 'addcheck' => true,
// 'adduniq' => true,
// 'addpk' => true,
// 'addfk' => true,
),
'display-browse' => array(
// 'back' => true,
// 'edit' => true,
// 'collapse' => true,
// 'createreport' => true,
// 'createview' => true,
// 'download' => true,
// 'insert' => true,
// 'refresh' => true,
),
'domains-properties' => array(
// 'drop' => true,
// 'addcheck' => true,
// 'alter' => true,
),
'domains-domains' => array(
// 'create' => true,
),
'fulltext-fulltext' => array(
// 'createconf' => true,
),
'fulltext-viewdicts' => array(
// 'createdict' => true,
),
'fulltext-viewconfig' => array(
// 'addmapping' => true,
),
'functions-properties' => array(
// 'showall' => true,
// 'alter' => true,
// 'drop' => true,
),
'functions-functions' => array(
// 'createpl' => true,
// 'createinternal' => true,
// 'createc' => true,
),
'groups-groups' => array(
// 'create' => true,
),
'groups-properties' => array(
// 'showall' => true,
),
'history-history' => array(
// 'refresh' => true,
// 'download' => true,
// 'clear' => true,
),
'indexes-indexes' => array(
// 'create' => true,
),
'operators-properties' => array(
// 'showall' => true,
),
'privileges-privileges' => array(
// 'grant' => true,
// 'revoke' => true,
// 'showalltables' => true,
// 'showallcolumns' => true,
// 'showallviews' => true,
// 'showalldatabases' => true,
// 'showallschemas' => true,
// 'showallfunctions' => true,
// 'showallsequences' => true,
// 'showalltablespaces' => true,
),
'reports-properties' => array(
// 'showall' => true,
// 'alter' => true,
// 'exec' => true,
),
'reports-reports' => array(
// 'create' => true,
),
'roles-account' => array(
// 'changepassword' => true,
),
'roles-properties' => array(
// 'showall' => true,
// 'alter' => true,
// 'drop' => true,
),
'roles-roles' => array(
// 'create' => true,
),
'rules-rules' => array(
// 'create' => true,
),
'schemas-schemas' => array(
// 'create' => true,
),
'sequences-properties' => array(
// 'alter' => true,
// 'nextval' => true,
// 'restart' => true,
// 'reset' => true,
),
'sequences-sequences' => array(
// 'create' => true,
),
'servers-servers' => array(
// 'showall' => true,
/*we cannot filter the group names in navlinks presently*/
),
'sql-form' => array(
// 'back' => true,
// 'alter' => true,
// 'createreport' => true,
// 'createview' => true,
// 'download' => true,
),
'tables-tables' => array(
// 'create' => true,
// 'createlike' => true,
),
'tablespaces-tablespaces' => array(
// 'create' => true,
),
'tblproperties-tblproperties' => array(
// 'browse' => true,
// 'select' => true,
// 'insert' => true,
'empty' => true,
// 'drop' => true,
// 'addcolumn' => true,
// 'alter' => true,
),
'triggers-triggers' => array(
// 'create' => true,
),
'types-properties' => array(
// 'showall' => true,
),
'types-types' => array(
// 'create' => true,
// 'createcomp' => true,
// 'createenum' => true,
),
'users-account' => array(
// 'changepassword' => true,
),
'users-users' => array(
// 'create' => true,
),
'viewproperties-definition' => array(
// 'alter' => true,
),
'viewproperties-viewproperties' => array(
// 'browse' => true,
// 'select' => true,
// 'drop' => true,
// 'alter' => true,
),
'views-views' => array(
// 'create' => true,
// 'createwiz' => true,
),
),
/**
* action links
**/
'actionbuttons' => array(
'admin-admin' => array(
// 'edit' => true,
// 'delete' => true,
),
'aggregates-aggregates' => array(
// 'alter' => true,
// 'drop' => true,
),
'all_db-databases' => array(
// 'drop' => true,
// 'privileges' => true,
// 'alter' => true,
),
'casts-casts' => array(
// none
),
'colproperties-colproperties' => array(
// none
),
'constraints-constraints' => array(
// 'drop' => true,
),
'conversions-conversions' => array(
// none
),
'database-variables' => array(
// none
),
'database-processes-preparedxacts' => array(
// none
),
'database-processes' => array(
// 'cancel' => true,
// 'kill' => true,
),
'database-locks' => array(
// none
),
'display-browse' => array(
// TODO
// 'edit' => true,
// 'delete' => true,
),
'domains-properties' => array(
// 'drop' => true,
),
'domains-domains' => array(
// 'alter' => true,
// 'drop' => true,
),
'fulltext-fulltext' => array(
// 'drop' => true,
// 'alter' => true,
),
'fulltext-viewparsers' => array(
// none
),
'fulltext-viewdicts' => array(
// 'drop' => true,
// 'alter' => true,
),
'fulltext-viewconfig' => array(
// 'multiactions' => true,
// 'drop' => true,
// 'alter' => true,
),
'functions-functions' => array(
// 'multiactions' => true,
// 'alter' => true,
// 'drop' => true,
// 'privileges' => true,
),
'groups-members' => array(
// 'drop' => true,
),
'groups-properties' => array(
// 'drop' => true,
),
'history-history' => array(
// 'run' => true,
// 'remove' => true,
),
'indexes-indexes' => array(
// 'cluster' => true,
// 'reindex' => true,
// 'drop' => true,
),
'info-referrers' => array(
// 'properties' => true,
),
'info-parents' => array(
// 'properties' => true,
),
'info-children' => array(
// 'properties' => true,
),
'languages-languages' => array(
// none
),
'opclasses-opclasses' => array(
// none
),
'operators-operators' => array(
// 'drop' => true,
),
'reports-reports' => array(
// 'run' => true,
// 'edit' => true,
// 'drop' => true,
),
'roles-roles' => array(
// 'alter' => true,
// 'drop' => true,
),
'rules-rules' => array(
// 'drop' => true,
),
'schemas-schemas' => array(
// 'multiactions' => true,
// 'drop' => true,
// 'privileges' => true,
// 'alter' => true,
),
'sequences-sequences' => array(
// 'multiactions' => true,
// 'drop' => true,
// 'privileges' => true,
// 'alter' => true,
),
'servers-servers' => array(
// 'logout' => true,
),
'tables-tables' => array(
// 'multiactions' => true,
// 'browse' => true,
// 'select' => true,
// 'insert' => true,
// 'empty' => true,
// 'alter' => true,
// 'drop' => true,
// 'vacuum' => true,
// 'analyze' => true,
// 'reindex' => true,
),
'tablespaces-tablespaces' => array(
// 'drop' => true,
// 'privileges' => true,
// 'alter' => true,
),
'tblproperties-tblproperties' => array(
// 'browse' => true,
// 'alter' => true,
// 'privileges' => true,
// 'drop' => true,
),
'triggers-triggers' => array(
// 'alter' => true,
// 'drop' => true,
// 'enable' => true,
// 'disable' => true,
),
'types-properties' => array(
// none
),
'types-types' => array(
// 'drop' => true,
),
'users-users' => array(
// 'alter' => true,
// 'drop' => true,
),
'viewproperties-viewproperties' => array(
// 'alter' => true,
),
'views-views' => array(
//'multiactions' => true,
// 'browse' => true,
// 'select' => true,
//'alter' => true,
//'drop' => true,
),
),
);
?>
@@ -0,0 +1,145 @@
<?php
require_once('classes/Plugin.php');
class GuiControl extends Plugin {
/**
* Attributes
*/
protected $name = 'GuiControl';
protected $lang;
protected $conf;
/**
* 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) {
parent::__construct($language);
}
/**
* 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(
'toplinks' => array('filer_toplinks'),
'tabs' => array('filter_tabs'),
'trail' => array('filter_trail'),
'navlinks' => array('filter_navlinks'),
'actionbuttons' => array('filter_actionbuttons'),
'tree' => array('filter_tree')
);
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(
'filer_toplinks',
'filter_tabs',
'filter_trail',
'filter_navlinks',
'filter_actionbuttons',
'filter_tree',
);
return $actions;
}
function filer_toplinks(&$f_params) {
if (!isset($this->conf['top_links']))
return;
$top_links = &$f_params['toplinks'];
foreach ($this->conf['top_links'] as $link => $enabled)
if (isset ($top_links[$link])
&& ($enabled === false)
)
unset($top_links[$link]);
return;
}
function filter_tabs(&$f_params) {
$section = $f_params['section'];
$tabs = &$f_params['tabs'];
if (!isset($this->conf['tab_links'][$section]))
return;
foreach ($this->conf['tab_links'][$section] as $link => $enabled)
if (isset ($tabs[$link])
&& ($enabled === false)
)
unset($tabs[$link]);
return;
}
function filter_trail(&$f_params) {
if (!isset($this->conf['trail_links']))
return;
if ($this->conf['trail_links'] === false)
$f_params['trail'] = array();
return;
}
function filter_navlinks(&$f_params) {
$place = $f_params['place'];
$navlinks = &$f_params['navlinks'];
if (! isset($this->conf['navlinks'][$place]))
return;
foreach ($this->conf['navlinks'][$place] as $link => $enabled)
if (isset ($navlinks[$link])
&& ($enabled === false)
)
unset($navlinks[$link]);
return;
}
function filter_actionbuttons(&$f_params) {
$place = $f_params['place'];
$actions = &$f_params['actionbuttons'];
if (! isset($this->conf['actionbuttons'][$place]))
return;
foreach ($this->conf['actionbuttons'][$place] as $link => $enabled)
if (isset ($actions[$link])
&& ($enabled === false)
)
unset($actions[$link]);
return;
}
function filter_tree() {
return;
}
}
?>
@@ -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.
@@ -0,0 +1,24 @@
About the phpPgAdmin Report Plugin
----------------------------------
The Report plugin is the old report feature of phpPgAdmins removed in
version 5.1 and refactored as a plugin.
It enables you to create and save ad-hoc SQL queries as reports which
can be easily be executed from within phpPgAdmin.
To save reports, this plugin requires the creation of a dedicated
database containing a single table; see the INSTALL file and the
sql/reports.sql file for details.
Following installation, an icon for the Report plugin will appear
on the main overview page for each connected server. This provides
an overview of all reports saved for the entire server, and enables
executionm, editing and deletion of reports, as well as creation of
new reports from scratch.
New reports can also be created while browsing table and view data,
a "create report" link is provided at the bottom of each data page
which pre-populates the report with the SQL used to generate the
data.
@@ -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));
}
}
?>
@@ -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;
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

@@ -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.';
?>
@@ -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'] = 'لم يتم حفظ التقرير، لقد فشلت عملية الحفظ.';
?>
@@ -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.';
?>
@@ -0,0 +1,22 @@
<?php
/**
* @maintainer He Wei Ping [laser@zhengmai.com.cn]
*/
// 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'] = '储存报表失败';
?>
@@ -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'] = '無法儲存報表。';
?>
@@ -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'] = '报表保存失败。';
?>
@@ -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'] = '報表儲存已失敗。';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -0,0 +1,24 @@
<?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['streditreport'] = 'Edit 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.';
?>
@@ -0,0 +1,24 @@
<?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['streditreport'] = 'Éditer 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.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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'] = 'Η αποθήκευση της αναφοράς απέτυχε.';
?>
@@ -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'] = 'האם אתה בטוח שברצונך למחוק את הדוח &quot;%s&quotl?';
$plugin_lang['strreportneedsname'] = 'אתה חייב לציין שם לדוח.';
$plugin_lang['strreportneedsdef'] = 'אתה חייב לתת SQL לדוח.';
$plugin_lang['strreportcreated'] = 'דוח נשמר.';
$plugin_lang['strreportcreatedbad'] = 'שמירת דוח נכשלה.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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'] = 'レポートの保存に失敗しました。';
?>
@@ -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.';
?>
@@ -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'] = 'ѓЯШвСЮХЮЩХ ЯдоХдС авХвзСЮЯ.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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ă.';
?>
@@ -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'] = 'Сохранение отчета прервано.';
?>
@@ -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ý.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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.';
?>
@@ -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'] = 'Збереження зв╕ту перервано.';
?>
@@ -0,0 +1,801 @@
<?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) {
/* 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;
$misc->printHeader($this->lang['strreports']);
$misc->printBody();
$misc->printTrail('server');
$misc->printTabs('server','reports');
$misc->printMsg($this->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('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;
$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 plugin_navlinks(&$params) {
global $misc, $lang;
if (
($params['place'] == 'sql-form'
or $params['place'] == 'display-browse')
and ( isset($params['env']['rs'])
and is_object($params['env']['rs'])
and $params['env']['rs']->recordCount() > 0))
{
if ( ! (isset($_REQUEST['plugin'])
and $_REQUEST['plugin'] == $this->name)
) {
/* ResultSet doesn't come from a plugin:
* show a create report link. */
$params['navlinks']['report_link'] = array (
'attr'=> array (
'href' => array (
'url' => 'plugin.php',
'urlvars' => array (
'plugin' => $this->name,
'action' => 'create',
'server' => $_REQUEST['server'],
'database' => $_REQUEST['database'],
)
)
),
'content' => $this->lang['strcreatereport']
);
if (isset($_REQUEST['paginate']))
$params['navlinks']['report_link']['attr']['href']['urlvars']['paginate']
= $_REQUEST['paginate'];
if (!empty($_SESSION['sqlquery'])) {
$params['navlinks']['report_link']['attr']['href']['urlvars']['report_sql']
= $_SESSION['sqlquery'];
}
else {
if (isset($_REQUEST['subject'])
and isset($_REQUEST[$_REQUEST['subject']]))
{
$params['navlinks']['report_link']['attr']['href']['urlvars']['subject']
= $_REQUEST['subject'];
$params['navlinks']['report_link']['attr']['href']['urlvars'][$_REQUEST['subject']]
= $_REQUEST[$_REQUEST['subject']];
$params['navlinks']['report_link']['attr']['href']['urlvars']['sortkey']
= isset($_REQUEST['sortkey']) ? $_REQUEST['sortkey'] : '';
$params['navlinks']['report_link']['attr']['href']['urlvars']['sortdir']
= isset($_REQUEST['sortdir']) ? $_REQUEST['sortdir'] : '';
}
else {
unset($params['navlinks']['report_link']);
}
}
}
else {
/* ResultSet comes from a plugin:
* show a edit report link. */
$params['navlinks']['report_link'] = array (
'attr'=> array (
'href' => array (
'url' => 'plugin.php',
'urlvars' => array (
'plugin' => $this->name,
'action' => 'edit',
'server' => $_REQUEST['server'],
'database' => $_REQUEST['database'],
'report_id' => $_REQUEST['report_id']
)
)
),
'content' => $this->lang['streditreport']
);
/* edit collapse link to add report related vars */
$params['navlinks']['collapse']['attr']['href']['urlvars']
['plugin'] = $this->name;
$params['navlinks']['collapse']['attr']['href']['urlvars']
['report_id'] = $_REQUEST['report_id'];
$params['navlinks']['collapse']['attr']['href']['urlvars']
['report'] = $_REQUEST['report'];
/* edit refresh link to add report related vars */
$params['navlinks']['refresh']['attr']['href']['urlvars']
['plugin'] = $this->name;
$params['navlinks']['refresh']['attr']['href']['urlvars']
['report_id'] = $_REQUEST['report_id'];
$params['navlinks']['refresh']['attr']['href']['urlvars']
['report'] = $_REQUEST['report'];
if (isset($_REQUEST['action'])) {
$params['navlinks']['collapse']['attr']['href']['urlvars']
['action'] = $_REQUEST['action'];
$params['navlinks']['refresh']['attr']['href']['urlvars']
['action'] = $_REQUEST['action'];
}
}
if (isset($_REQUEST['schema']))
$params['navlinks']['report_link']['attr']['href']['urlvars']['schema']
= $_REQUEST['schema'];
}
}
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"' : ''), " />&nbsp;{$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() {
$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['sortkey'] = isset($_REQUEST['sortkey']) ? $_REQUEST['sortkey'] : '';
if (preg_match('/^[0-9]+$/', $_REQUEST['sortkey']) && $_REQUEST['sortkey'] > 0) $orderby = array($_REQUEST['sortkey'] => $_REQUEST['sortdir']);
else $orderby = array();
$subject = isset($_REQUEST['subject']) && isset($_REQUEST[$_REQUEST['subject']])
? $_REQUEST[$_REQUEST['subject']]
: '';
$_REQUEST['report_sql'] = $data->getSelectSQL($subject, array(), array(), array(), $orderby);
}
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"' : ''), " />&nbsp;{$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() {
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, $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}&amp;action=properties&amp;{$misc->href}&amp;",
'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}&amp;{$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();
}
}
?>
@@ -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;