Example #1
0
This file does no action in itself.
If it is accessed directly it will give a summary of the module parameters.
*/
// MODULE CONFIGURATION DEFINITION
$config = array();
$config['mod_name'] = 'TimeCard';
$config['mod_version'] = '2.1';
$config['mod_directory'] = 'timecard';
$config['mod_setup_class'] = 'CSetupTimeCard';
$config['mod_type'] = 'user';
$config['mod_ui_name'] = 'Time Card';
$config['mod_ui_icon'] = 'TimeCard.png';
$config['mod_description'] = 'Time Card allows easy access to a weekly timecard based on existing task logs.';
$config['mod_config'] = true;
if (@$a == 'setup') {
    echo dPshowModuleConfig($config);
}
require_once dPgetConfig('root_dir') . '/modules/system/syskeys/syskeys.class.php';
/*
// MODULE SETUP CLASS
	This class must contain the following methods:
	install - creates the required db tables
	remove - drop the appropriate db tables
	upgrade - upgrades tables from previous versions
*/
class CSetupTimeCard
{
    /*
    	Install routine
    */
    function install()
Example #2
0
$config = array();
$config['mod_name'] = 'HelpDesk';
$config['mod_version'] = '0.4';
$config['mod_directory'] = 'helpdesk';
$config['mod_setup_class'] = 'CSetupHelpDesk';
$config['mod_type'] = 'user';
$config['mod_config'] = true;
$config['mod_ui_name'] = 'Help Desk';
$config['mod_ui_icon'] = 'helpdesk.png';
$config['mod_description'] = 'Help Desk is a bug, feature request, ' . 'complaint and suggestion tracking centre';
//This will allow permissions to be applied to this module based on the following database criteria
$config['permissions_item_table'] = 'companies';
$config['permissions_item_label'] = 'company_name';
$config['permissions_item_field'] = 'company_id';
if (@$a == 'setup') {
    print dPshowModuleConfig($config);
}
require_once $dPconfig['root_dir'] . '/modules/system/syskeys/syskeys.class.php';
class CSetupHelpDesk
{
    function install()
    {
        $success = 1;
        $bulk_sql[] = "\n\t\t\tCREATE TABLE helpdesk_items (\n\t\t\t  `item_id` int(11) unsigned NOT NULL auto_increment,\n\t\t\t  `item_title` varchar(64) NOT NULL default '',\n\t\t\t  `item_summary` text,\n\t\t\t  `item_calltype` int(3) unsigned NOT NULL default '0',\n\t\t\t  `item_source` int(3) unsigned NOT NULL default '0',\n\t\t\t  `item_os` varchar(48) NOT NULL default '',\n\t\t\t  `item_application` varchar(48) NOT NULL default '',\n\t\t\t  `item_priority` int(3) unsigned NOT NULL default '0',\n\t\t\t  `item_severity` int(3) unsigned NOT NULL default '0',\n\t\t\t  `item_status` int(3) unsigned NOT NULL default '0',\n\t\t\t  `item_assigned_to` int(11) NOT NULL default '0',\n\t\t\t  `item_created_by` int(11) NOT NULL default '0',\n\t\t\t  `item_notify` int(1) DEFAULT '1' NOT NULL ,\n\t\t\t  `item_requestor` varchar(48) NOT NULL default '',\n\t\t\t  `item_requestor_id` int(11) NOT NULL default '0',\n\t\t\t  `item_requestor_email` varchar(128) NOT NULL default '',\n\t\t\t  `item_requestor_phone` varchar(30) NOT NULL default '',\n\t\t\t  `item_requestor_type` tinyint NOT NULL default '0',\n\t\t\t  `item_created` datetime default NULL,\n\t\t\t  `item_modified` datetime default NULL,\n\t\t\t  `item_parent` int(10) unsigned NOT NULL default '0',\n\t\t\t  `item_project_id` int(11) NOT NULL default '0',\n\t\t\t  `item_company_id` int(11) NOT NULL default '0',\n\t\t\t  `item_updated` datetime default NULL,\n\t\t\t  PRIMARY KEY (item_id)\n\t\t\t) TYPE=MyISAM";
        $bulk_sql[] = "\n      ALTER TABLE `task_log`\n      ADD `task_log_help_desk_id` int(11) NOT NULL default '0' AFTER `task_log_task`\n    ";
        $bulk_sql[] = "\n      ALTER TABLE `files`\n      ADD `file_helpdesk_item` int(11) NOT NULL default '0' AFTER `file_task`\n    ";
        $bulk_sql[] = "\n\t\t  CREATE TABLE `helpdesk_item_status` (\n\t\t    `status_id` INT NOT NULL AUTO_INCREMENT,\n\t\t    `status_item_id` INT NOT NULL,\n\t\t    `status_code` TINYINT NOT NULL,\n\t\t    `status_date` TIMESTAMP NOT NULL,\n\t\t    `status_modified_by` INT NOT NULL,\n\t\t    `status_comment` TEXT DEFAULT '',\n\t\t    PRIMARY KEY (`status_id`)\n\t\t  )";
        $bulk_sql[] = "\n\t\tCREATE TABLE helpdesk_item_watchers (\n\t\t  `item_id` int(11) NOT NULL default '0',\n\t\t  `user_id` int(11) NOT NULL default '0',\n\t\t  `notify` char(1) NOT NULL default ''\n\t\t) TYPE=MyISAM";
        foreach ($bulk_sql as $s) {
            db_exec($s);
            if (db_error()) {