-- phpMyAdmin SQL Dump
-- version 2.7.0-pl1
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Feb 01, 2006 at 02:32 AM
-- Server version: 4.1.14
-- PHP Version: 4.4.0-pl1-gentoo
-- 
-- Database: `helpdeskdb`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Default_Preferences`
-- 

CREATE TABLE `tbl_Default_Preferences` (
  `identifier` varchar(20) NOT NULL default '',
  `value` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`identifier`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_Default_Preferences`
-- 

INSERT INTO `tbl_Default_Preferences` (`identifier`, `value`) VALUES ('verify-email', 'true'),
('pub-hide-su', 'true'),
('pub-hide-remarks', 'true'),
('language', 'en_UK'),
('email-remark', 'false'),
('email-resolve', 'false'),
('newissue-email', ''),
('wrk-timer', 'true');

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Domain_Preferences`
-- 

CREATE TABLE `tbl_Domain_Preferences` (
  `identifier` varchar(20) NOT NULL default '',
  `domain` int(4) NOT NULL default '0',
  `value` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`identifier`,`domain`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_Domain_Preferences`
-- 

INSERT INTO `tbl_Domain_Preferences` (`identifier`, `domain`, `value`) VALUES ('pub-hide-remarks', 1, 'true'),
('pub-hide-su', 1, 'true');

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Domains`
-- 

CREATE TABLE `tbl_Domains` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `domain` varchar(200) NOT NULL default '',
  `active` int(4) NOT NULL default '1',
  `css` varchar(100) NOT NULL default '',
  `notice` varchar(255) NOT NULL default '',
  `defaultdomain` int(4) NOT NULL default '0',
  `defaultpriority` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- 
-- Dumping data for table `tbl_Domains`
-- 

INSERT INTO `tbl_Domains` (`id`, `domain`, `active`, `css`, `notice`, `defaultdomain`, `defaultpriority`) VALUES (1, 'System', 0, '', '', 0, 0),
(2, 'Demo', 1, '', '', 0, 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_EmailConfirmation`
-- 

CREATE TABLE `tbl_EmailConfirmation` (
  `hash` varchar(100) NOT NULL default '',
  `user_id` int(4) NOT NULL default '0',
  `email` varchar(200) NOT NULL default '',
  `date` int(11) NOT NULL default '0',
  PRIMARY KEY  (`hash`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_EmailConfirmation`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Issues`
-- 

CREATE TABLE `tbl_Issues` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `reportedby` int(4) NOT NULL default '0',
  `createdby` int(4) NOT NULL default '0',
  `closedby` int(4) NOT NULL default '0',
  `assignedto` int(4) NOT NULL default '0',
  `status` int(4) NOT NULL default '0',
  `level` int(4) NOT NULL default '0',
  `priority` int(4) NOT NULL default '0',
  `site` int(4) NOT NULL default '0',
  `detail` int(4) NOT NULL default '0',
  `category` int(4) NOT NULL default '0',
  `location` varchar(200) NOT NULL default '',
  `contact` varchar(100) NOT NULL default '',
  `createdon` int(8) NOT NULL default '0',
  `closedon` int(8) NOT NULL default '0',
  `summary` text NOT NULL,
  `description` text NOT NULL,
  `solution` text NOT NULL,
  `published` int(2) NOT NULL default '0',
  `publishedby` int(4) NOT NULL default '0',
  `publishedon` int(8) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `recalled` int(2) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- 
-- Dumping data for table `tbl_Issues`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Levels`
-- 

CREATE TABLE `tbl_Levels` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `level` varchar(100) NOT NULL default '',
  `sortorder` int(4) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `active` int(4) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `tbl_Levels`
-- 

INSERT INTO `tbl_Levels` (`id`, `level`, `sortorder`, `domain`, `active`) VALUES (1, 'Easy', 0, 2, 1),
(2, 'Medium', 1, 2, 1),
(3, 'Difficult', 2, 2, 1);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Link_Categories`
-- 

CREATE TABLE `tbl_Link_Categories` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `name` varchar(100) NOT NULL default '',
  `sortorder` int(4) NOT NULL default '0',
  `lang` varchar(5) NOT NULL default 'en_UK',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- 
-- Dumping data for table `tbl_Link_Categories`
-- 

INSERT INTO `tbl_Link_Categories` (`id`, `name`, `sortorder`, `lang`) VALUES (1, 'Helpdesk Issue Manager', 0, 'en_UK'),
(2, 'Sponsors', 1, 'en_UK');

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Links`
-- 

CREATE TABLE `tbl_Links` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `text` varchar(100) NOT NULL default '',
  `link` varchar(200) NOT NULL default '',
  `category` int(4) NOT NULL default '0',
  `sortorder` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

-- 
-- Dumping data for table `tbl_Links`
-- 

INSERT INTO `tbl_Links` (`id`, `text`, `link`, `category`, `sortorder`) VALUES (1, 'Home', 'index.php', 1, 0),
(2, 'About', 'about.php', 1, 1),
(3, 'News', 'news.php', 1, 2),
(4, 'Documentation', 'docs/index.html', 1, 3);
(5, 'F.A.Q.', 'faq.php', 1, 4),
(6, 'Download', 'download.php', 1, 5);
(7, 'Features', 'features.php', 1, 6),
(8, 'Change Log', 'changelog.php', 1, 7),
(9, 'Central Mcr. CLC', 'http://helpdesk.centralmanclc.com/', 2, 0),
(10, 'Oxford Archeology', 'http://www.thehumanjourney.net/', 2, 1);
(11, 'European Electronique', 'http://www.euroele.co.uk/', 2, 2);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Logs`
-- 

CREATE TABLE `tbl_Logs` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `userid` int(4) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `timestamp` int(8) default '0',
  `code` varchar(50) NOT NULL default '',
  `log` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- 
-- Dumping data for table `tbl_Logs`
-- 

INSERT INTO `tbl_Logs` (`id`, `userid`, `domain`, `timestamp`, `code`, `log`) VALUES (1, 2, 2, 1138757551, 'LOGIN', 'Project Admin has successfully logged in.');

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_News`
-- 

CREATE TABLE `tbl_News` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `date` date NOT NULL default '0000-00-00',
  `content` text NOT NULL,
  `frontpagepara` int(4) NOT NULL default '0',
  `lang` varchar(5) NOT NULL default 'en_UK',
  `domain_id` int(4) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

-- 
-- Dumping data for table `tbl_News`
-- 

INSERT INTO `tbl_News` (`id`, `date`, `content`, `frontpagepara`, `lang`, `domain_id`) VALUES (1, '2005-03-05', '    <h2 style="text-align:right;">[ PHP / Pear::DB ]</h2>\r\n    <p>The Helpdesk Issue Manager is a robust and generic helpdesk management system for all kinds of helpdesks.</p>\r\n\r\n<p>Look on the <a href="about.php">about the system</a> page to find out more.</p>\r\n', 1, 'en_UK', NULL),
(2, '2005-03-19', '<h2>This is in development - beta testing!</h2>\r\n\r\n    <h3>If you would like to contribute to the development of this, please email me: helpdesk@<em>handyandy.org.uk</em></h3>\r\n<p>Enjoy!</p>', 2, 'en_UK', NULL),
(3, '2005-04-02', '</p><h2>Move over to MySQL almost comlete!</h2>\r\n<p>Welcome to this site. Things have been moving very fast, and I am glad to say that the move over to mySQL is complete.', 0, 'en_UK', NULL),
(4, '0000-00-00', '', 3, 'en_UK', 1),
(5, '0000-00-00', '', 3, 'en_UK', 2);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Preference_Descriptions`
-- 

CREATE TABLE `tbl_Preference_Descriptions` (
  `identifier` varchar(20) NOT NULL default '',
  `type` varchar(20) NOT NULL default '',
  `description` varchar(100) NOT NULL default '',
  `overridable` int(2) NOT NULL default '0',
  PRIMARY KEY  (`identifier`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_Preference_Descriptions`
-- 

INSERT INTO `tbl_Preference_Descriptions` (`identifier`, `type`, `description`, `overridable`) VALUES ('verify-email', 'boolean', 'Turn on email verification', 0),
('pub-hide-su', 'boolean', 'Hide site and user names in published issues', 0),
('pub-hide-remarks', 'boolean', 'Hide all remarks in published issues', 0),
('language', 'langlist', 'The language in which to display all text', 1),
('email-remark', 'boolean', 'Email notification of issue changes/remarks.', 1),
('email-resolve', 'boolean', 'Email notification of issue resolutions.', 1),
('newissue-email', 'text', 'Email address to receive new unassigned issues (or leave blank)', 0),
('wrk-timer', 'boolean', 'Turn on usage of Timer', 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Priorities`
-- 

CREATE TABLE `tbl_Priorities` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `priority` varchar(100) NOT NULL default '',
  `class` int(4) NOT NULL default '0',
  `sortorder` int(4) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `active` int(4) NOT NULL default '1',
  `notify` int(2) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `tbl_Priorities`
-- 

INSERT INTO `tbl_Priorities` (`id`, `priority`, `class`, `sortorder`, `domain`, `active`, `notify`) VALUES (1, 'Low', 0, 0, 2, 1, 0),
(2, 'Medium', 1, 1, 2, 1, 0),
(3, 'High', 2, 2, 2, 1, 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_ProblemCategories`
-- 

CREATE TABLE `tbl_ProblemCategories` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `description` varchar(100) NOT NULL default '',
  `active` int(2) NOT NULL default '1',
  `domain` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `tbl_ProblemCategories`
-- 

INSERT INTO `tbl_ProblemCategories` (`id`, `description`, `active`, `domain`) VALUES (1, 'Software', 1, 2),
(2, 'Hardware', 1, 2),
(3, 'Website', 1, 2);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_ProblemDetails`
-- 

CREATE TABLE `tbl_ProblemDetails` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `category` int(4) NOT NULL default '0',
  `description` varchar(100) NOT NULL default '',
  `active` int(2) NOT NULL default '1',
  `domain` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;

-- 
-- Dumping data for table `tbl_ProblemDetails`
-- 

INSERT INTO `tbl_ProblemDetails` (`id`, `category`, `description`, `active`, `domain`) VALUES (1, 1, 'Not installed properly', 1, 2),
(2, 1, 'Crashing', 1, 2),
(3, 1, 'Will not load', 1, 2),
(4, 2, 'Printer', 1, 2),
(5, 2, 'Scanner', 1, 2),
(6, 2, 'Monitor', 1, 2),
(7, 2, 'Base Unit', 1, 2),
(8, 3, 'Updating', 1, 2),
(9, 3, 'Error messages', 1, 2),
(10, 3, 'Gone offline', 1, 2);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Remarks`
-- 

CREATE TABLE `tbl_Remarks` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `issue` int(4) NOT NULL default '0',
  `reportedby` int(4) default '0',
  `reportedon` int(8) default '0',
  `remark` text NOT NULL,
  `confidential` int(4) NOT NULL default '1',
  `time` time default '00:00:00',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- 
-- Dumping data for table `tbl_Remarks`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Sites`
-- 

CREATE TABLE `tbl_Sites` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `site` varchar(100) NOT NULL default '',
  `domain` int(4) NOT NULL default '0',
  `active` int(4) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- 
-- Dumping data for table `tbl_Sites`
-- 

INSERT INTO `tbl_Sites` (`id`, `site`, `domain`, `active`) VALUES (1, 'Test Site', 2, 1);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Statuses`
-- 

CREATE TABLE `tbl_Statuses` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `status` varchar(100) NOT NULL default '',
  `sortorder` int(4) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `active` int(4) NOT NULL default '1',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `tbl_Statuses`
-- 

INSERT INTO `tbl_Statuses` (`id`, `status`, `sortorder`, `domain`, `active`) VALUES (1, 'New', 0, 2, 1),
(2, 'Open', 1, 2, 1),
(3, 'Closed', 2, 2, 1);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_System_Preferences`
-- 

CREATE TABLE `tbl_System_Preferences` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `identifier` varchar(20) NOT NULL default '',
  `value` varchar(100) NOT NULL default '',
  `comment` varchar(100) NOT NULL default '',
  `system` int(2) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

-- 
-- Dumping data for table `tbl_System_Preferences`
-- 

INSERT INTO `tbl_System_Preferences` (`id`, `identifier`, `value`, `comment`, `system`) VALUES (1, 'version', '0.9.3', 'This is the current version number for the system', 1),
(2, 'pagesize', '30', 'Page size for paging of issues', 0),
(3, 'closedpagesize', '10', 'Page size for restriction of closed issues', 0),
(4, 'maxupload', '2000', 'Maximum file upload size in bytes', 0),
(5, 'excessivehours', '10', 'Number of hours spent on a problem that is considered excessive and should be confirmed', 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Thesaurus`
-- 

CREATE TABLE `tbl_Thesaurus` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `term` varchar(40) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

-- 
-- Dumping data for table `tbl_Thesaurus`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Thesaurus_Mappings`
-- 

CREATE TABLE `tbl_Thesaurus_Mappings` (
  `term` int(4) NOT NULL default '0',
  `issue` int(4) NOT NULL default '0',
  PRIMARY KEY  (`term`,`issue`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_Thesaurus_Mappings`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Times`
-- 

CREATE TABLE `tbl_Times` (
  `issue` int(4) NOT NULL default '0',
  `userid` int(4) NOT NULL default '0',
  `time` int(14) NOT NULL default '0',
  PRIMARY KEY  (`issue`,`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_Times`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_UserDomains`
-- 

CREATE TABLE `tbl_UserDomains` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `userid` int(4) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `defaultflag` int(2) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

-- 
-- Dumping data for table `tbl_UserDomains`
-- 

INSERT INTO `tbl_UserDomains` (`id`, `userid`, `domain`, `defaultflag`) VALUES (1, 1, 1, 1);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_UserSites`
-- 

CREATE TABLE `tbl_UserSites` (
  `userid` int(4) NOT NULL default '0',
  `site` int(4) NOT NULL default '0',
  `usertype` int(4) NOT NULL default '0',
  `defaultflag` int(2) NOT NULL default '1',
  PRIMARY KEY  (`userid`,`site`,`usertype`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_UserSites`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_UserTypes`
-- 

CREATE TABLE `tbl_UserTypes` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `type` varchar(100) NOT NULL default '',
  `sortorder` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

-- 
-- Dumping data for table `tbl_UserTypes`
-- 

INSERT INTO `tbl_UserTypes` (`id`, `type`, `sortorder`) VALUES (1, 'Client', 0),
(2, 'Site Contact', 1),
(3, 'Support Agent', 2),
(4, 'Administrator', 3),
(5, 'Domain Administrator', 4),
(6, 'Root', 999);

-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_User_Preferences`
-- 

CREATE TABLE `tbl_User_Preferences` (
  `identifier` varchar(20) NOT NULL default '',
  `userid` int(4) NOT NULL default '0',
  `domain` int(4) NOT NULL default '0',
  `value` varchar(100) NOT NULL default '',
  PRIMARY KEY  (`identifier`,`userid`,`domain`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `tbl_User_Preferences`
-- 


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Users`
-- 

CREATE TABLE `tbl_Users` (
  `id` int(4) unsigned NOT NULL auto_increment,
  `username` varchar(20) NOT NULL default '',
  `pass` varchar(50) NOT NULL default '',
  `name` varchar(100) NOT NULL default '',
  `email` varchar(100) NOT NULL default '',
  `available` int(2) NOT NULL default '0',
  `active` int(2) NOT NULL default '1',
  `root` int(2) NOT NULL default '0',
  `restricted` int(2) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

-- 
-- Dumping data for table `tbl_Users`
-- 

INSERT INTO `tbl_Users` (`id`, `username`, `pass`, `name`, `email`, `available`, `active`, `root`, `restricted`) VALUES (1, '', '', '* unassigned *', '* unassigned *', 0, 0, 0, 1),
(2, 'root', '63a9f0ea7bb98050796b649e85481845', 'Project Admin', '', 1, 1, 1, 0);


-- --------------------------------------------------------

-- 
-- Table structure for table `tbl_Wkrtimer`
-- 

CREATE TABLE tbl_Wrktimer (
    issue int4 DEFAULT '0' NOT NULL,
    userid int4 DEFAULT '0' NOT NULL,
    running ENUM('f','t') DEFAULT 'f' NOT NULL,
    `begin` DATETIME DEFAULT 'now()' NOT NULL,
    `end` DATETIME DEFAULT 'now()' NOT NULL,
    primary key (issue,userid)
);
            
