phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] old/anthill/etc 0.2.3-0.3.0.0-a.sql, 1.1 anthill-emai


From: skwashd
Subject: [Phpgroupware-cvs] old/anthill/etc 0.2.3-0.3.0.0-a.sql, 1.1 anthill-emailuserscron.php, 1.1 0.2.2-0.2.3.sql, 1.1 0.2.0rc2-0.2.0rc3.sql, 1.1 0.2.0pre2-0.2.0pre3.sql, 1.1 mysql.dump, 1.1 pgsql.dump, 1.1 upgradepw.php, 1.1 upgrade-0.2.3-0.3.0-mysql.php, 1.1 testreportengine.php, 1.1 0.2.0pre1-0.2.0pre2.sql, 1.1 0.2.0-0.2.0.1.sql, 1.1 0.1.5-0.1.6.sql, 1.1 0.1.6-0.2.0.sql, 1.1 0.1.4-0.1.5.sql, 1.1
Date: Thu, 5 May 2005 02:34:00 +0200

Update of old/anthill/etc

Added Files:
     Branch: MAIN
            0.2.3-0.3.0.0-a.sql 
            anthill-emailuserscron.php 
            0.2.2-0.2.3.sql 
            0.2.0rc2-0.2.0rc3.sql 
            0.2.0pre2-0.2.0pre3.sql 
            mysql.dump 
            pgsql.dump 
            upgradepw.php 
            upgrade-0.2.3-0.3.0-mysql.php 
            testreportengine.php 
            0.2.0pre1-0.2.0pre2.sql 
            0.2.0-0.2.0.1.sql 
            0.1.5-0.1.6.sql 
            0.1.6-0.2.0.sql 
            0.1.4-0.1.5.sql 

Log Message:
retiring app

====================================================
Index: 0.2.3-0.3.0.0-a.sql
# SQL upgrade script for Anthill 0.2.2.3 -> 0.3.0alpha
#
# Add fixedver
#

# Alter Config Table
ALTER TABLE config RENAME anthill_config;
ALTER TABLE anthill_config DROP PRIMARY KEY;
ALTER TABLE anthill_config DROP id;
ALTER TABLE anthill_config ADD PRIMARY KEY('name');
INSERT INTO anthill_config('def_severity', 2);
INSERT INTO anthill_config('def_priority', 2);

# Create New Sessions Table
DROP TABLE sessions;
CREATE TABLE anthill_sessions (
  session_id varchar(255) NOT NULL default '',
  session_lid varchar(255) default NULL,
  session_ip varchar(255) default NULL,
  session_logintime int(11) default NULL,
  session_la int(11) default NULL,
  session_action varchar(255) default NULL,
  PRIMARY KEY (session_id)
);

# Alter User Table
ALTER TABLE users RENAME anthill_users;
ALTER TABLE anthill_users CHANGE epref email_updates INT(1) DEFAULT '1';
ALTER TABLE anthill_users MODIFY laston INT(11);
ALTER TABLE anthill_users MODIFY thison INT(11);

#Alter severity Table
ALTER TABLE severity_d RENAME anthill_severity_d;
ALTER TABLE anthill_severity_d DROP s_def;

#Alter priority Table
ALTER TABLE severity_d RENAME anthill_priority_d;
ALTER TABLE anthill_priority_d DROP s_def;

# Rename Remaining Tables
ALTER TABLE bugs RENAME anthill_bugs;
ALTER TABLE bugdesc RENAME anthill_bugdesc;
ALTER TABLE products RENAME anthill_products;
ALTER TABLE components RENAME anthill_components;
ALTER TABLE status_d RENAME anthill_status_d;
ALTER TABLE priority_d RENAME anthill_priority_d;
ALTER TABLE resolve_d RENAME anthill_resolve_d;
ALTER TABLE bugactivity RENAME anthill_bugactivity;
ALTER TABLE attachidx RENAME anthill_attachidx;

====================================================
Index: anthill-emailuserscron.php
#!/usr/bin/php -q
<?php
  // Anthill
  // $Id: anthill-emailuserscron.php,v 1.1 2005/05/05 00:34:03 skwashd Exp $

  // This file should be placed in your crontab to execute at any time you
  // like.  It can be executed from anywhere and should not be accessible
  // via the web (ie. install this to /etc/cron.weekly or something similar)

  include ("/home/vdanen/public_html/0.2.0/include.php");

  d_mailUser("NEW");
  d_mailUser("UNRESOLVED");
?>

====================================================
Index: 0.2.2-0.2.3.sql
# SQL upgrade script for Anthill 0.2.2 -> 0.2.3
#
# Add status types TOVALIDATE and NEEDSWORK
INSERT INTO status_d (id, name, s_def) VALUES (7,'TOVALIDATE','0');
INSERT INTO status_d (id, name, s_def) VALUES (8,'NEEDSWORK','0');

====================================================
Index: 0.2.0rc2-0.2.0rc3.sql
# SQL upgrade script for Anthill 0.2.0RC2 0.2.0RC3
#
# Add fixedver
#
ALTER TABLE bugs ADD fixedver varchar(8) DEFAULT NULL;

====================================================
Index: 0.2.0pre2-0.2.0pre3.sql
# SQL upgrade script for Anthill 0.2.0pre2 to 0.2.0pre3
#
# Add autocc for components
#
ALTER TABLE components ADD autocc varchar(100);
#
# Add system for bugdesc
#
ALTER TABLE bugdesc ADD system int(1) DEFAULT '0';
#
# Add deleted column for users
#
ALTER TABLE users ADD deleted int(1) DEFAULT '0';
#
# Add deleted column for products
#
ALTER TABLE products ADD deleted int(1) DEFAULT '0';
#
# Add deleted column for versions
#
ALTER TABLE versions ADD deleted int(1) DEFAULT '0';
#
# Add deleted column for components
#
ALTER TABLE components ADD deleted int(1) DEFAULT '0';
#
# add mdaemonreplyto to config
#
INSERT INTO config (id, name, value) VALUES (22,'mdaemonreplyto','');

====================================================
Index: mysql.dump
# Anthill MySQL dump
# $Id: mysql.dump,v 1.1 2005/05/05 00:34:03 skwashd Exp $

#
# Table structure for table 'anthill_config'
#

#
# Table structure for table 'anthill_bugs'
#

CREATE TABLE anthill_bugs (
  bid int(11) NOT NULL auto_increment,
  assigned int(11),
  severity int(1),
  status int(1),
  creation int(11),
  modified int(11),
  shortdesc text,
  priority int(1),
  product int(11),
  reporter int(11),
  version int(5),
  component int(11),
  resolution int(1) DEFAULT '',
  cc text,
  private int(1) DEFAULT '0',
  url varchar(128),
  fixedver varchar(8) DEFAULT NULL,
  PRIMARY KEY (bid)
);

#
# Table structure for table 'anthill_bugdesc'
#

CREATE TABLE anthill_bugdesc (
  did int(11) NOT NULL auto_increment,
  bid int(11),
  user int(11),
  date int(11),
  system int(1) DEFAULT '0',
  description text,
  PRIMARY KEY (did)
);

#
# Table structure for table 'anthill_products'
#

CREATE TABLE anthill_products (
  pid int(11) NOT NULL auto_increment,
  name varchar(64),
  deleted int(1) DEFAULT '0',
  description text,
  PRIMARY KEY (pid)
);

#
# Table structure for table 'anthill_versions'
#

CREATE TABLE anthill_versions (
  vid int(5) NOT NULL auto_increment,
  name varchar(64),
  product int(11),
  deleted int(1) DEFAULT '0',
  PRIMARY KEY (vid)
);

#
# Table structure for table 'components'
#

CREATE TABLE anthill_components (
  cid int(11) NOT NULL auto_increment,
  name varchar(64),
  product int(11),
  owner int(11),
  description text,
  autocc varchar(100),
  deleted int(1) DEFAULT '0',
  PRIMARY KEY (cid)
);

#
# Table structure for table 'anthill_status_d'
#

CREATE TABLE anthill_status_d (
  id int(2) NOT NULL,
  name varchar(16) NOT NULL,
  s_def int(1) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

#
# Populate table 'anthill_status_d'
#

INSERT INTO anthill_status_d (id, name, s_def) VALUES (0,'UNCONFIRMED','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (1,'NEW','1');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (2,'ASSIGNED','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (3,'REOPENED','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (4,'RESOLVED','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (5,'VERIFIED','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (6,'CLOSED','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (7,'TOVALIDATE','0');
INSERT INTO anthill_status_d (id, name, s_def) VALUES (8,'NEEDSWORK','0');
#
# Table structure for table 'anthill_severity_d'
#

CREATE TABLE anthill_severity_d (
  id int(2) NOT NULL,
  name varchar(16) NOT NULL,
  PRIMARY KEY (id)
);

#
# Populate table 'anthill_severity_d'
#

INSERT INTO anthill_severity_d (id, name) VALUES (0,'Critical');
INSERT INTO anthill_severity_d (id, name) VALUES (1,'Major');
INSERT INTO anthill_severity_d (id, name) VALUES (2,'Normal');
INSERT INTO anthill_severity_d (id, name) VALUES (3,'Minor');
INSERT INTO anthill_severity_d (id, name) VALUES (4,'Trivial');
INSERT INTO anthill_severity_d (id, name) VALUES (5,'Enhancement');

#
# Table structure for table 'anthill_priority_d'
#

CREATE TABLE anthill_priority_d (
  id int(2) NOT NULL,
  name varchar(16) NOT NULL,
  PRIMARY KEY (id)
);

#
# Populate table 'anthill_priority_d'
#

INSERT INTO anthill_priority_d (id, name) VALUES (0,'Critical');
INSERT INTO anthill_priority_d (id, name) VALUES (1,'High');
INSERT INTO anthill_priority_d (id, name) VALUES (2,'Normal');
INSERT INTO anthill_priority_d (id, name) VALUES (3,'Low');

#
# Table structure for table 'anthill_resolve_d'
#

CREATE TABLE anthill_resolve_d (
  id int(2) NOT NULL,
  name varchar(16) NOT NULL,
  PRIMARY KEY (id)
);

#
# Populate table 'anthill_resolve_d'
#

INSERT INTO anthill_resolve_d (id, name) VALUES (0,'FIXED');
INSERT INTO anthill_resolve_d (id, name) VALUES (1,'INVALID');
INSERT INTO anthill_resolve_d (id, name) VALUES (2,'WONTFIX');
INSERT INTO anthill_resolve_d (id, name) VALUES (3,'DUPLICATE');

#
# Table structure for table 'bugactivity'
#

CREATE TABLE anthill_bugactivity (
  aid int(11) NOT NULL auto_increment,
  bid int(11),
  user int(11),
  date int(11),
  what int(1),
  oldval varchar(60),
  newval varchar(60),
  dupeid int(11),
  PRIMARY KEY (aid)
);

#
# Table structure for table 'anthill_attachidx'
#

CREATE TABLE anthill_attachidx (
  atid int(11) NOT NULL,
  bid int(11) NOT NULL,
  date int(11),
  mimetype varchar(30),
  filename varchar(64),
  user int(11),
  PRIMARY KEY (atid)
);

====================================================
Index: pgsql.dump
-- Anthill PGSQL dump
-- $Id: pgsql.dump,v 1.1 2005/05/05 00:34:03 skwashd Exp $
--
-- Submitted by Phil Kenoyer

--
-- Table structure for table 'config'
--

CREATE TABLE "config" (
  name varchar(16) NOT NULL,
  value text NOT NULL,
  PRIMARY KEY (id)
);

--
-- Populate table 'config'
--

INSERT INTO config (name, value) VALUES ('antgfx','1');
INSERT INTO config (name, value) VALUES ('textcol','#000000');
INSERT INTO config (name, value) VALUES ('linkcol','#c00000');
INSERT INTO config (name, value) VALUES ('bgcol','#ffffff');
INSERT INTO config (name, value) VALUES ('theme','default');
INSERT INTO config (name, value) VALUES ('sitename','Anthill');
INSERT INTO config (name, value) VALUES ('newusers','1');
INSERT INTO config (name, value) VALUES ('siteblurb','<p>Anthill is a bug 
tracking system written entirely in PHP and is intended to be a replacement for 
<a href=\"http://www.bugzilla.org/\";>bugzilla</a>.  Anthill is in it\'s infancy 
and has many more features to include than what you see now.  
Enjoy!</p><center><img src=\"images/Anthill.png\" alt=\"Anthill 
logo\"></center>');
INSERT INTO config (name, value) VALUES (9,'newublurb','<p>Welcome to the new 
user registration process.</p>  <p>If you only want to view public bugs as 
read-only, you do not need to register.  If you wish to submit a bug, or add 
comments to existing bugs, you must first create a new user on the system.  
Please select a good password.</p>');
INSERT INTO config (name, value) VALUES (10,'prefblurb','<p>This is where you 
can change some of your user preferences.  You can choose a new password, 
change your email address, your username, and your real name.  Please be 
courteous enough to provide real information.  Thanks.</p>');
INSERT INTO config (name, value) VALUES ('adminemail','address@hidden');
INSERT INTO config (name, value) VALUES ('mdaemon','anthill-daemon');
INSERT INTO config (name, value) VALUES ('memail','address@hidden');
INSERT INTO config (name, value) VALUES ('adminac','20');
INSERT INTO config (name, value) VALUES ('barcol1','#8b95a8');
INSERT INTO config (name, value) VALUES ('barcol2','#cc0000');
INSERT INTO config (name, value) VALUES ('autocc','');
INSERT INTO config (name, value) VALUES ('defpriv','0');
INSERT INTO config (name, value) VALUES ('maxfsize','2000000');
INSERT INTO config (name, value) VALUES ('devac','10');
INSERT INTO config (name, value) VALUES ('defaultac','1');
INSERT INTO config (name, value) VALUES ('mdaemonreplyto','');

--
-- Table structure for table 'users'
--

CREATE TABLE users (
  uid serial NOT NULL,
  name varchar(60) DEFAULT '' NOT NULL,
  uname varchar(25) DEFAULT '' NOT NULL,
  email varchar(60) DEFAULT '' NOT NULL,
  passwd varchar(40) NOT NULL,
  access int2 DEFAULT '1' NOT NULL,
  laston varchar(20),
  thison varchar(20),
  gpg varchar(64),
  cookietimeout int8 DEFAULT '3600',
  deleted int2 DEFAULT '0',
  PRIMARY KEY (uid)
);

--
-- Populate table 'users'
--

INSERT INTO users (uid, name, uname, email, passwd, access, laston, thison, 
gpg) VALUES 
(1,'Administrator','admin','address@hidden','cc03e747a6afbbcbf8be7668acfebee5',20,NULL,NULL,NULL);

--
-- Table structure for table 'bugs'
--

CREATE TABLE bugs (
  bid serial NOT NULL,
  assigned int8,
  severity int2,
  status int2,
  creation varchar(14),
  modified timestamp,
  shortdesc text,
  priority int2,
  product int8,
  reporter int8,
  version int8,
  component int8,
  resolution int2 DEFAULT '',
  cc text,
  private int2 DEFAULT '0',
  url varchar(128),
  PRIMARY KEY (bid)
);

--
-- Table structure for table 'bugdesc'
--

CREATE TABLE bugdesc (
  did serial NOT NULL,
  bid int8,
  "user" int8,
  "date" timestamp,
  description text,
  PRIMARY KEY (did)
);

--
-- Table structure for table 'products'
--

CREATE TABLE products (
  pid serial NOT NULL,
  name varchar(64),
  deleted int2 DEFAULT '0',
  description text,
  PRIMARY KEY (pid)
);

--
-- Table structure for table 'versions'
--

CREATE TABLE versions (
  vid serial NOT NULL,
  name varchar(64),
  product int8,
  deleted int2 DEFAULT '0',
  PRIMARY KEY (vid)
);

--
-- Table structure for table 'components'
--

CREATE TABLE components (
  cid serial NOT NULL,
  name varchar(64),
  product int8,
  owner int8,
  description text,
  autocc varchar(100),
  deleted int2 DEFAULT '0',
  PRIMARY KEY (cid)
);

--
-- Table structure for table 'status_d'
--

CREATE TABLE status_d (
  id int2 NOT NULL,
  name varchar(16) NOT NULL,
  s_def int2 DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

--
-- Populate table 'status_d'
--

INSERT INTO status_d (id, name, s_def) VALUES (0,'UNCONFIRMED','0');
INSERT INTO status_d (id, name, s_def) VALUES (1,'NEW','1');
INSERT INTO status_d (id, name, s_def) VALUES (2,'ASSIGNED','0');
INSERT INTO status_d (id, name, s_def) VALUES (3,'REOPENED','0');
INSERT INTO status_d (id, name, s_def) VALUES (4,'RESOLVED','0');
INSERT INTO status_d (id, name, s_def) VALUES (5,'VERIFIED','0');
INSERT INTO status_d (id, name, s_def) VALUES (6,'CLOSED','0');

--
-- Table structure for table 'severity_d'
--

CREATE TABLE severity_d (
  id int2 NOT NULL,
  name varchar(16) NOT NULL,
  s_def int2 DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

--
-- Populate table 'severity_d'
--

INSERT INTO severity_d (id, name, s_def) VALUES (0,'Critical','0');
INSERT INTO severity_d (id, name, s_def) VALUES (1,'Major','0');
INSERT INTO severity_d (id, name, s_def) VALUES (2,'Normal','1');
INSERT INTO severity_d (id, name, s_def) VALUES (3,'Minor','0');
INSERT INTO severity_d (id, name, s_def) VALUES (4,'Trivial','0');
INSERT INTO severity_d (id, name, s_def) VALUES (5,'Enhancement','0');

--
-- Table structure for table 'priority_d'
--

CREATE TABLE priority_d (
  id int2 NOT NULL,
  name varchar(16) NOT NULL,
  s_def int2 DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

--
-- Populate table 'priority_d'
--

INSERT INTO priority_d (id, name, s_def) VALUES (0,'Critical','0');
INSERT INTO priority_d (id, name, s_def) VALUES (1,'High','0');
INSERT INTO priority_d (id, name, s_def) VALUES (2,'Normal','1');
INSERT INTO priority_d (id, name, s_def) VALUES (3,'Low','0');

--
-- Table structure for table 'resolve_d'
--

CREATE TABLE resolve_d (
  id int2 NOT NULL,
  name varchar(16) NOT NULL,
  PRIMARY KEY (id)
);

--
-- Populate table 'resolve_d'
--

INSERT INTO resolve_d (id, name) VALUES (0,'FIXED');
INSERT INTO resolve_d (id, name) VALUES (1,'INVALID');
INSERT INTO resolve_d (id, name) VALUES (2,'WONTFIX');
INSERT INTO resolve_d (id, name) VALUES (3,'DUPLICATE');

--
-- Table structure for table 'bugactivity'
--

CREATE TABLE bugactivity (
  aid serial NOT NULL,
  bid int8,
  "user" int8,
  "date" timestamp,
  what int2,
  oldval varchar(60),
  newval varchar(60),
  dupeid int8,
  PRIMARY KEY (aid)
);

--
-- Table structure for table 'attachidx'
--

CREATE TABLE attachidx (
  atid int8 NOT NULL,
  bid int8 NOT NULL,
  "date" varchar(14),
  mimetype varchar(30),
  filename varchar(64),
  "user" int8,
  PRIMARY KEY (atid)
);

--
-- Table structure for table 'sessions'
--
-- NOTE: this isn't complete as pgsql doesn't seem to support KEYs like
-- mysql does, so I'm not sure how efficient this is

CREATE TABLE sessions (
  sess_id int8 DEFAULT '0' NOT NULL,
  start_time int8 DEFAULT '0' NOT NULL,
  remote_ip varchar(15) NOT NULL,
  uid int8 NOT NULL,
  PRIMARY KEY (sess_id)
--  KEY sess_id (sess_id),
--  KEY start_time (start_time),
--  KEY remote_ip (remote_ip)
);

====================================================
Index: upgradepw.php
<?
  // Anthill
  // $Id: upgradepw.php,v 1.1 2005/05/05 00:34:03 skwashd Exp $
  include("../include.php");
  d_StartPage(gettext("Upgrade Anthill Passwords"));

  d_DrawHeader(gettext("Anthill User Password Upgrade"));

  $db2         = new db_Sql();
  $db2->host   = $_CONF['db_host'];
  $db2->dbase  = $_CONF['db_name'];
  $db2->user   = $_CONF['db_user'];
  $db2->passwd = $_CONF['db_pw'];
  $db2->connect();

  print("<p><b>Upgrading users to use new md5 passwords...</b></p>");

  $db->query("SELECT * FROM users");
  while($db->next_record()) {
    $newpass = do_newPass($db->record['uname']);
    $cpass   = md5($newpass);
    $db2->query("UPDATE users SET passwd = '$cpass' WHERE (uid=" . 
$db->record['uid'] . ") ");
    $db2->free();
    // get the maximum string length to format the email nicely
    $msg[0]   = gettext("Login name");
    $msg[1]   = gettext("Password");
    $limit    = count($msg);
    $size     = 0;
    for($i=0; $i < $limit; $i++) {
      if (strlen($msg[$i]) > $size) {
        $size = strlen($msg[$i]);
      }
    }
    for($i=0; $i < $limit; $i++) {
      $buff = $size - strlen($msg[$i]);
      if ($buff > 0) {
        $msg[$i] = $msg[$i] . str_repeat(" ", $buff);
      }
    }

    $message  = "Anthill, located at:\n\n" . $_CONF['webroot'] . "\n\n";
    $message .= "has just upgraded their install, and as a result your password 
has been ";
    $message .= "reset due to some internal\nchanges.  We apologize for the 
inconvenience.\n\n";
    $message .= gettext("In order to use Anthill, you must use the following to 
log in") . ":\n\n";
    $message .= $msg[0] . ": " . $db->record['uname'] . "\n";
    $message .= $msg[1] . ": " . $newpass . "\n\n";
    $message .= gettext("To change your password, log in and go to 
\"Preferences\".") . "\n";
    $message .= "\n--\n" . $_CONF['webroot'] . "\n";
    $retval   = @mail($db->record['name'] . " <" . $db->record['email'] . ">",
                gettext("Your Anthill password") , $message,
                "From: " . $config['mdaemon'] . " <" . $config['memail'] . 
">\nReturn-Path: <" . $config['memail'] . ">\nX-Mailer: " . _NAME . " " . 
_VERSION);
    print("<p>" . sprintf(gettext("A new password has been emailed to %s."), 
$db->record['email']) . "</p>");
  }
  $db->free();

  print("<p><a href=\"" . $_CONF['webroot'] . "\">Return home</a></p>");
  d_DrawFooter();
?>

====================================================
Index: upgrade-0.2.3-0.3.0-mysql.php
<?php
  /****************************************************************************
   * Anthill 2.3 -> phpGroupWare Anthill Upgrade Script                       *
   * http://phpgroupware.org                                                  *
   *                                                                          *
   * Written by Dave Hall [skwashd AT phpgroupware.org]                       *
   * Copyright 2003 Free Software Founation                                   *
   * ------------------------------------------------------------------------ *
   * This program is free software; you can redistribute it and/or modify it  *
   * under the terms of the GNU General Public License as published by the    *
   * Free Software Foundation; either version 2 of the License, or (at your   *
   * option) any later version.                                               *
   * ------------------------------------------------------------------------ *
   ****************************************************************************/
   // $Id: upgrade-0.2.3-0.3.0-mysql.php,v 1.1 2005/05/05 00:34:03 skwashd Exp $

   //SQL upgrade script for Anthill 0.2.3 -> 0.3.0alpha

   $GLOBALS['update'] = intval($_GET['update']);

   //Fix config table
   $sql[] = 'ALTER TABLE config RENAME anthill_config';
   $sql[] = 'ALTER TABLE anthill_config DROP PRIMARY KEY';
   $sql[] = 'ALTER TABLE anthill_config DROP id';
   $sql[] = "ALTER TABLE anthill_config ADD PRIMARY KEY('name')";
   $sql[] = "INSERT INTO anthill_config('def_severity', 2)";
   $sql[] = "INSERT INTO anthill_config('def_priority', 2)";

   //Create New Sessions Table
   $sql[] = 'DROP TABLE sessions';

   // Alter User Table
   $sql[] = 'ALTER TABLE users RENAME anthill_users';
   $sql[] = "ALTER TABLE anthill_users CHANGE epref email_updates INT(1) 
DEFAULT '1'";
   $sql[] = 'ALTER TABLE anthill_users MODIFY laston INT(11)';
   $sql[] = 'ALTER TABLE anthill_users MODIFY thison INT(11)';

   // Alter severity Table
   $sql[]= 'ALTER TABLE severity_d RENAME anthill_severity_d';
   $sql[]= 'ALTER TABLE anthill_severity_d DROP s_def';

   // Alter priority Table
   $sql[] = 'ALTER TABLE severity_d RENAME anthill_priority_d';
   $sql[] = 'ALTER TABLE anthill_priority_d DROP s_def';

   // Rename Remaining Tables
   $sql[] = 'ALTER TABLE bugs RENAME anthill_bugs';
   $sql[] = 'ALTER TABLE bugdesc RENAME anthill_bugdesc';
   $sql[] = 'ALTER TABLE products RENAME anthill_products';
   $sql[] = 'ALTER TABLE components RENAME anthill_components';
   $sql[] = 'ALTER TABLE status_d RENAME anthill_status_d';
   $sql[] = 'ALTER TABLE priority_d RENAME anthill_priority_d';
   $sql[] = 'ALTER TABLE resolve_d RENAME anthill_resolve_d';
   $sql[] = 'ALTER TABLE bugactivity RENAME anthill_bugactivity';
   $sql[] = 'ALTER TABLE attachidx RENAME anthill_attachidx';

   // get the basic changes out the way
   foreach($sql as $query)
   {
     if($GLOBALS['update'])
     {
      $db->query($query);
     }
     else
     {
      echo "SQL: $query <br>\n";
     }
   }
   // free up some memory :)
   unset($sql);

   $changes[] = array('tbl' => 'anthill_bugs',
                      'col' => 'modified',
                      'pk'  => 'bid'
                     );

   $changes[] = array('tbl' => 'anthill_bugs',
                      'col' => 'creation',
                      'pk'  => 'bid'
                     );

   $changes[] = array('tbl' => 'anthill_bugdesc',
                      'col' => 'date',
                      'pk'  => 'did'
                     );

   $changes[] = array('tbl' => 'anthill_bugactivity',
                      'col' => 'modified',
                      'pk'  => 'aid'
                     );

   $changes[] = array('tbl' => 'anthill_attachidx',
                      'col' => 'modified',
                      'pk'  => 'atid'
                     );

   function convert_timestamp_cols($changes)
   {
     foreach($changes as $change)
     {
       // rename the old modified col
       $sql = 'ALTER TABLE ' . $change['tbl'] . ' CHANGE ' . $change['col'] . ' 
' . $change['col'] . '_ts TIMESTAMP(14)';
       if($GLOBALS['update'])
       {
        $db->query($query);
       }
       else
       {
        echo "SQL: $sql <br>\n";
       }

       // add the new timestamp col
       $sql = 'ALTER TABLE ' . $change['tbl'] . 'ADD ' . $change['col'] . ' 
INT(11)';
       if($GLOBALS['update'])
       {
        $db->query($query);
       }
       else
       {
        echo "SQL: $sql <br>\n";
       }


       // get all the old values from modified
       $sql = 'SELECT ' . $change['pk'] . ', UNIX_TIMESTAMP(' . $change['col'] 
. '_ts) as epoch_ts FROM '. $change['tbl'];
       $db->query($sql);
       while($db->next_record())
       {
         $new_vals[$db->f($change['pk'])] = $db->f('epoch_ts');
       }

       foreach($news_vals as $new_val)
       {
         $sql = 'UPDATE ' . $change['tbl'] . ' '
              . 'SET modified=' . $new_val['epoch_ts'] . ' '
              . 'WHERE bid=' . $new_val[$change['pk']];

         if($GLOBALS['update'])
         {
          $db->query($query);
         }
         else
         {
          echo "SQL: $sql <br>\n";
         }
       }
       $sql = 'ALTER TABLE ' . $change['tbl'] . ' DROP ' . $change['col'] . 
'_ts';
       if($GLOBALS['update'])
       {
        $db->query($query);
       }
       else
       {
        echo "SQL: $sql <br>\n";
       }
     }
   }

   echo '</p>please check the above output<br></p>';
   echo '<p>If all appears to be correct <a href="' . $_SERVER['PHP_SELF'] . 
'?update=1">run it in update mode</a></p>';

?>

====================================================
Index: testreportengine.php
#!/usr/bin/php
<?
   // Report Engine Function Tests
   // $Id: testreportengine.php,v 1.1 2005/05/05 00:34:03 skwashd Exp $
   //
   // (C) 2002 by John Gatewood Ham
   //
   // This program is free software; you can redistribute it and/or modify
   // it under the terms of the GNU General Public License as published by
   // the Free Software Foundation; either version 2 of the License, or
   // (at your option) any later version.
   //
   // This program is distributed in the hope that it will be useful,
   // but WITHOUT ANY WARRANTY; without even the implied warranty of
   // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   // GNU General Public License for more details.
   //
   // You should have received a copy of the GNU General Public License
   // along with this program; if not, write to the Free Software
   // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   //
  $blitz = "Once upon a time there was a young green dragon named Blitz who 
lived in Bavaria.  He was healthy and had learned to get along with the humans 
in his area by collecting a tax in return for ariel support in battles.  He 
used the tax to buy livestock for food, so he never had to steal anything.  His 
life was almost perfect.  However, one thing was lacking, namely a Mrs. Blitz.  
Since the women dragons from his region were all so familiar, Blitz decided to 
travel abroad to find the right mate. (C) 2002 by John Gatewood Ham";
  include("include/reportengine.php");

// Test 1
// Test primitive line breaking
  report_init(10, 80, 0);
  for ($j = 0; $j < 13; $j += 1) {
     report_que_line("Hi there $j");
  }
  for ($j = 0; $j < 18; $j += 1) {
     report_que_line("Hi there $j, I am a very long line and will cause some 
page break action if I'm lukcy, but I'm not really sure what will happen or 
whatever.");
  }
  for ($j = 0; $j < 18; $j += 1) {
     report_flowtext("Hi there $j, I am a very long line and will cause some 
page break action if I'm lukcy, but I'm not really sure what will happen or 
whatever.",$j);
  }
  report_finish();

// Test 2
// Test flow text line breaking, keeps with 5 column margins
  report_init(10, 80, 0, 0, "Testing 2", 5, 5);
  for ($j = 0; $j < 9; $j += 1) {
     report_que_line("This is line $j");
  }
  report_start_keep();
  for ($j = 9; $j < 14; $j += 1) {
     report_que_line("This is kept line $j");
  }
  report_end_keep();
  report_flowtext("This is a pagebreak wrapping line 14, and it is a very long 
line indeed, in fact it is more than the 80 byte width (minus 10 margin 
bytes)");
  for ($j = 15; $j < 18; $j += 1) {
     report_que_line("This is unkept line $j");
  }
  report_que_line("This is a pagebreak wrapping line $j, and it is a very long 
line indeed, in fact it is more than the 80 byte width (minus 10 margin 
bytes)");
  report_que_line("This is line 20");
  report_start_keep();
  report_flowtext($blitz);
  report_end_keep();
  report_finish();

// Test 3
// Test flow text line breaking, keeps with 0 column margins,
// use formfeeds, do ms-dos newlines
  report_init(10, 80, 1, 1, "Testing 3", 0, 0);
  for ($j = 0; $j < 9; $j += 1) {
     report_que_line("This is line $j");
  }
  report_start_keep();
  for ($j = 9; $j < 14; $j += 1) {
     report_que_line("This is kept line $j");
  }
  report_end_keep();
  report_flowtext("This is a pagebreak wrapping line 14, and it is a very long 
line indeed, in fact it is more than the 80 byte width (minus 0 margin bytes) 
which aren't very crticial anyway as you have surmised by now");
  for ($j = 15; $j < 18; $j += 1) {
     report_que_line("This is unkept line $j");
  }
  report_que_line("This is a pagebreak wrapping line $j, and it is a very long 
line indeed, in fact it is more than the 80 byte width (minus 10 margin 
bytes)");
  report_que_line("This is line 20");
  report_start_keep();
  report_flowtext($blitz);
  report_end_keep();
  report_finish();
?>

====================================================
Index: 0.2.0pre1-0.2.0pre2.sql
# SQL upgrade script for Anthill 0.2.0pre1 to 0.2.0pre2
#
# Add cookietimeout
#
ALTER TABLE users ADD cookietimeout int(8) DEFAULT '0';
#
# Add developer access level
#
INSERT INTO config (id, name, value) VALUES (20,'devac','10');
#
# Add default user access level
#
INSERT INTO config (id, name, value) VALUES (21,'defaultac','1');

====================================================
Index: 0.2.0-0.2.0.1.sql
# SQL upgrade script for Anthill 0.2.0 -> 0.2.0.1
#
# Add fixedver
#
ALTER TABLE users ADD epref int(1) DEFAULT '1';

====================================================
Index: 0.1.5-0.1.6.sql
# SQL upgrade script for Anthill 0.1.5 to 0.1.6
#
# Fix bugs.creation (shouldn't be timestamp)
#
ALTER TABLE bugs CHANGE creation creation VARCHAR(14);

====================================================
Index: 0.1.6-0.2.0.sql
# SQL upgrade script for Anthill 0.1.6 to 0.2.0 (includes all pre-release
# and rc updates)
#
# Remove password salt since we use md5 passwords now
#
DELETE FROM config WHERE id = '19';
#
# Add maximum attachment file size
#
INSERT INTO config (id, name, value) VALUES (19,'maxfsize','2000000');
#
# Add developer access level
#
INSERT INTO config (id, name, value) VALUES (20,'devac','10');
#
# Add default user access level
#
INSERT INTO config (id, name, value) VALUES (21,'defaultac','1');
#
# Remove session column from users table (no longer used)
#
ALTER TABLE users DROP session;
#
# Add cookietimeout
#
ALTER TABLE users ADD cookietimeout int(8) DEFAULT '0';
#
# Add autocc for components
#
ALTER TABLE components ADD autocc varchar(100);
#
# Add system for bugdesc
#
ALTER TABLE bugdesc ADD system int(1) DEFAULT '0';
#
# Add deleted column for users
#
ALTER TABLE users ADD deleted int(1) DEFAULT '0';
#
# Add deleted column for products
#
ALTER TABLE products ADD deleted int(1) DEFAULT '0';
#
# Add deleted column for versions
#
ALTER TABLE versions ADD deleted int(1) DEFAULT '0';
#
# Add deleted column for components
#
ALTER TABLE components ADD deleted int(1) DEFAULT '0';
#
# add mdaemonreplyto to config
#
INSERT INTO config (id, name, value) VALUES (22,'mdaemonreplyto','');
#
# Add fixedver
#
ALTER TABLE bugs ADD fixedver varchar(8) DEFAULT NULL;

#
# Table structure for table 'attachidx'
#

CREATE TABLE attachidx (
  atid int(11) NOT NULL,
  bid int(11) NOT NULL,
  date varchar(14),
  mimetype varchar(30),
  filename varchar(64),
  user int(11),
  PRIMARY KEY (atid)
);

#
# Table structure for table 'sessions'
#

CREATE TABLE sessions (
  sess_id int(10) UNSIGNED DEFAULT '0' NOT NULL,
  start_time int(10) UNSIGNED DEFAULT '0' NOT NULL,
  remote_ip varchar(15) NOT NULL,
  uid int(11) NOT NULL,
  PRIMARY KEY (sess_id),
  KEY sess_id (sess_id),
  KEY start_time (start_time),
  KEY remote_ip (remote_ip)
);

====================================================
Index: 0.1.4-0.1.5.sql
#
# Table structure for table 'bugactivity'
#

CREATE TABLE bugactivity (
  aid int(11) NOT NULL auto_increment,
  bid int(11),
  user int(11),
  date timestamp(14),
  what int(1),
  oldval varchar(60),
  newval varchar(60),
  dupeid int(11),
  PRIMARY KEY (aid)
);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]