This file is used to track current working tasks - just ignore it!
-better detection for when reports database hasn't been installed.
fix getIndexes() and getConstraints() for < 7.3 to know about index type
(eg. constraints can only be btree indexes)
re-enable help system
Need to fix:
* Variables and processes views for < 7.3
+* Viewing database properties is broken...
Bugs
* Object browser fixed for databases with no schemas
+* Properly detect that reports database is missing
Translations
* Spanish from Martin Marques
* the functions provided by the database driver exclusively, and hence
* will work with any database without modification.
*
- * $Id: Reports.php,v 1.9 2003/12/10 16:03:30 chriskl Exp $
+ * $Id: Reports.php,v 1.10 2003/12/15 08:30:54 chriskl Exp $
*/
class Reports {
// A database driver
var $driver;
+ var $reports_db = 'phppgadmin';
/* Constructor */
- function Reports() {
- global $misc;
-
- // Create a new database access object.
- // @@ IF THE phppgadmin DATABASE DOES NOT EXIST THEN
- // @@ LOGIN FAILURE OCCURS
- $this->driver = &$misc->getDatabaseAccessor('phppgadmin');
+ function Reports(&$status) {
+ global $misc, $data;
+
+ // Check to see if the reports database exists
+ $rs = $data->getDatabase($this->reports_db);
+ if ($rs->recordCount() != 1) $status = -1;
+ else {
+ // Create a new database access object.
+ $this->driver = &$misc->getDatabaseAccessor($this->reports_db);
+ $status = 0;
+ }
}
/**
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.166 2003/12/13 09:28:46 chriskl Exp $
+ * $Id: Postgres.php,v 1.167 2003/12/15 08:30:54 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
function &getDatabase($database) {
$this->clean($database);
$sql = "SELECT * FROM pg_database WHERE datname='{$database}'";
- return $this->selectRow($sql);
+ return $this->selectSet($sql);
}
/**
-#!/bin/awk -f
+#!/usr/bin/awk -f
#
# Script contains all needed conversions of recoded text
#
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.121 2003/12/13 09:28:46 chriskl Exp $
+ * $Id: english.php,v 1.122 2003/12/15 08:30:54 chriskl Exp $
*/
// Language and character set
$lang['strnodata'] = 'No rows found.';
$lang['strnoobjects'] = 'No objects found.';
$lang['strrownotunique'] = 'No unique identifier for this row.';
+ $lang['strnoreportsdb'] = 'You have not created the reports database. Read the INSTALL file for directions.';
// Tables
$lang['strtable'] = 'Table';
* English language file for phpPgAdmin. Use this as a basis
* for new translations.
*
- * $Id: english.php,v 1.73 2003/12/13 09:28:46 chriskl Exp $
+ * $Id: english.php,v 1.74 2003/12/15 08:30:54 chriskl Exp $
*/
// Language and character set
$lang['strnodata'] = 'No rows found.';
$lang['strnoobjects'] = 'No objects found.';
$lang['strrownotunique'] = 'No unique identifier for this row.';
+ $lang['strnoreportsdb'] = 'You have not created the reports database. Read the INSTALL file for directions.';
// Tables
$lang['strtable'] = 'Table';
/**
* List reports in a database
*
- * $Id: reports.php,v 1.14 2003/09/09 06:23:12 chriskl Exp $
+ * $Id: reports.php,v 1.15 2003/12/15 08:30:54 chriskl Exp $
*/
// Include application functions
$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
$PHP_SELF = $_SERVER['PHP_SELF'];
- // Create a database accessor for the reports database
- include_once('classes/Reports.php');
- $reportsdb = new Reports();
-
/**
* Displays a screen where they can edit a report
*/
$misc->printHeader($lang['strreports']);
$misc->printBody();
- switch ($action) {
- case 'save_edit':
- if (isset($_POST['cancel'])) doDefault();
- else doSaveEdit();
- break;
- case 'edit':
- doEdit();
- break;
- case 'properties':
- doProperties();
- break;
- case 'save_create':
- if (isset($_POST['cancel'])) doDefault();
- else doSaveCreate();
- break;
- case 'create':
- doCreate();
- break;
- case 'drop':
- if (isset($_POST['drop'])) doDrop(false);
- else doDefault();
- break;
- case 'confirm_drop':
- doDrop(true);
- break;
- default:
- doDefault();
- break;
- }
+ // Create a database accessor for the reports database
+ include_once('classes/Reports.php');
+ $reportsdb = new Reports($status);
+ if ($status != 0) {
+ echo "<p>{$lang['strnoreportsdb']}</p>\n";
+ }
+ else {
+ switch ($action) {
+ case 'save_edit':
+ if (isset($_POST['cancel'])) doDefault();
+ else doSaveEdit();
+ break;
+ case 'edit':
+ doEdit();
+ break;
+ case 'properties':
+ doProperties();
+ break;
+ case 'save_create':
+ if (isset($_POST['cancel'])) doDefault();
+ else doSaveCreate();
+ break;
+ case 'create':
+ doCreate();
+ break;
+ case 'drop':
+ if (isset($_POST['drop'])) doDrop(false);
+ else doDefault();
+ break;
+ case 'confirm_drop':
+ doDrop(true);
+ break;
+ default:
+ doDefault();
+ break;
+ }
+ }
$misc->printFooter();