From 950809de72d0cc16042600033943c7e7fd4c165e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 30 May 2001 22:00:51 +0000 Subject: [PATCH] changed db-name to phpgw_infolog, setup-files --- infolog/edit.php | 2 +- infolog/inc/class.infolog.inc.php | 8 +++---- infolog/index.php | 6 ++--- infolog/setup/setup.inc.php | 9 +++++++ infolog/setup/setup_info.inc.php | 3 --- infolog/setup/tables_current.inc.php | 36 ++++++++++++++++++++++++++++ infolog/version.inc.php | 14 +++++++++++ 7 files changed, 67 insertions(+), 11 deletions(-) create mode 100755 infolog/setup/setup.inc.php delete mode 100644 infolog/setup/setup_info.inc.php create mode 100644 infolog/setup/tables_current.inc.php create mode 100644 infolog/version.inc.php diff --git a/infolog/edit.php b/infolog/edit.php index ec95abd17f..d645e23e79 100644 --- a/infolog/edit.php +++ b/infolog/edit.php @@ -144,7 +144,7 @@ $phpgw->common->phpgw_header(); echo parse_navbar(); - $phpgw->db->query("select * FROM infolog where info_id='$info_id'"); + $phpgw->db->query("select * FROM phpgw_infolog where info_id='$info_id'"); $phpgw->db->next_record(); $pri_selected[$phpgw->infolog->data['info_pri']] = ' selected'; diff --git a/infolog/inc/class.infolog.inc.php b/infolog/inc/class.infolog.inc.php index 1286bcf175..6ab30c11d8 100644 --- a/infolog/inc/class.infolog.inc.php +++ b/infolog/inc/class.infolog.inc.php @@ -289,7 +289,7 @@ function read($info_id) { // did _not_ ensure ACL, has to be done by the calling code if ($info_id <= 0 || $info_id != $this->data['info_id'] && - (!$this->db->query("select * FROM infolog where info_id='$info_id'") || !$this->db->next_record())) + (!$this->db->query("select * FROM phpgw_infolog where info_id='$info_id'") || !$this->db->next_record())) { $this->init( ); return False; @@ -316,7 +316,7 @@ function delete($info_id) { // did _not_ ensure ACL, has to be done by the calling code global $phpgw_info; - $this->db->query("delete FROM infolog where info_id='$info_id' or info_id_parent='" + $this->db->query("delete FROM phpgw_infolog where info_id='$info_id' or info_id_parent='" . "$info_id' AND ((info_access='public' and info_owner != '" . $phpgw_info['user']['account_id'] . "') or (info_owner='" . $phpgw_info['user']['account_id'] . "'))" ,__LINE__,__FILE__); @@ -355,9 +355,9 @@ } } if ($values['info_id']) { - $query = 'update infolog set '.$query.' where info_id=\'' . $values['info_id'] .'\''; + $query = 'update phpgw_infolog set '.$query.' where info_id=\'' . $values['info_id'] .'\''; } else { - $query = 'insert INTO infolog set '.$query; + $query = 'insert INTO phpgw_infolog set '.$query; /* * need to set $this->data['info_id'] with assigned autoincrement id */ diff --git a/infolog/index.php b/infolog/index.php index 7b80013b6a..0f2a0beea9 100644 --- a/infolog/index.php +++ b/infolog/index.php @@ -101,7 +101,7 @@ if ($phpgw->infolog->listChilds && $action != 'sp') $pid = ''; - $db->query("SELECT COUNT(*) FROM infolog WHERE $filtermethod $pid $sql_query",__LINE__,__FILE__); + $db->query("SELECT COUNT(*) FROM phpgw_infolog WHERE $filtermethod $pid $sql_query",__LINE__,__FILE__); $db->next_record(); $total = $db->f(0); @@ -145,13 +145,13 @@ $limit = $db->limit($start); - $db->query($q="SELECT * FROM infolog WHERE $filtermethod $pid $sql_query $ordermethod $limit",__LINE__,__FILE__); + $db->query($q="SELECT * FROM phpgw_infolog WHERE $filtermethod $pid $sql_query $ordermethod $limit",__LINE__,__FILE__); while ($db->next_record()) { // ======================================== // check if actual project has subprojects // ======================================== - $db2->query("select count(*) as cnt FROM infolog where info_id_parent=" .$db->f('info_id'),__LINE__,__FILE__); + $db2->query("select count(*) as cnt FROM phpgw_infolog where info_id_parent=" .$db->f('info_id'),__LINE__,__FILE__); $db2->next_record(); if ($db2->f('cnt') > 0) { $subproact = 1; diff --git a/infolog/setup/setup.inc.php b/infolog/setup/setup.inc.php new file mode 100755 index 0000000000..d0c21a0db2 --- /dev/null +++ b/infolog/setup/setup.inc.php @@ -0,0 +1,9 @@ + diff --git a/infolog/setup/setup_info.inc.php b/infolog/setup/setup_info.inc.php deleted file mode 100644 index d1d40daad7..0000000000 --- a/infolog/setup/setup_info.inc.php +++ /dev/null @@ -1,3 +0,0 @@ - 'InfoLog', 'app_order' => 1, 'version' => '0.1'); -?> diff --git a/infolog/setup/tables_current.inc.php b/infolog/setup/tables_current.inc.php new file mode 100644 index 0000000000..1540cfad40 --- /dev/null +++ b/infolog/setup/tables_current.inc.php @@ -0,0 +1,36 @@ + array( + 'fd' => array( + 'info_id' => array('type' => 'auto', 'nullable' => false), + 'info_type' => array('type' => 'enum', + 'info_id_parent' => array('type' => 'int', 'precision' => 4, 'nullable' => false), + 'info_owner' => array('type' => 'varchar', 'precision' => 25), + 'info_access' => array('type' => 'varchar', 'precision' => 10), + 'info_cat' => array('type' => 'int', 'precision' => 4), + 'info_des' => array('type' => 'text'), + 'info_pri' => array('type' => 'int', 'precision' => 4), + 'info_status' => array('type' => 'int', 'precision' => 4), + 'info_datecreated' => array('type' => 'int', 'precision' => 4), + 'info_startdate' => array('type' => 'int', 'precision' => 4), + 'info_enddata' => array('type' => 'int', 'precision' => 4) + ), + 'pk' => array('info_id'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + ), + ); +?> diff --git a/infolog/version.inc.php b/infolog/version.inc.php new file mode 100644 index 0000000000..487af1de45 --- /dev/null +++ b/infolog/version.inc.php @@ -0,0 +1,14 @@ +