コード例 #1
0
ファイル: setup.php プロジェクト: slawekmikula/dotproject
 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()) {
             $success = 0;
         }
     }
     $sk = new CSysKey('HelpDeskList', 'Enter values for list', '0', "\n", '|');
     $sk->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskPriority', "0|Not Specified\n1|Low\n2|Medium\n3|High");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskSeverity', "0|Not Specified\n1|No Impact\n2|Low\n3|Medium\n4|High\n5|Critical");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskCallType', "0|Not Specified\n1|Bug\n2|Feature Request\n3|Complaint\n4|Suggestion");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskSource', "0|Not Specified\n1|E-Mail\n2|Phone\n3|Fax\n4|In Person\n5|E-Lodged\n6|WWW");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskOS', "Not Applicable\nLinux\nUnix\nSolaris 8\nSolaris 9\nRed Hat 6\nRed Hat 7\nRed Hat 8\nWindows 95\nWindow 98\nWindows 2000\nWindow 2000 Server\nWindows XP");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskApplic', "Not Applicable\nWord\nExcel");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskStatus', "0|Unassigned\n1|Open\n2|Closed\n3|On Hold\n4|Testing");
     $sv->store();
     $sv = new CSysVal($sk->syskey_id, 'HelpDeskAuditTrail', "0|Created\n1|Title\n2|Requestor Name\n3|Requestor E-mail\n4|Requestor Phone\n5|Assigned To\n6|Notify by e-mail\n7|Company\n8|Project\n9|Call Type\n10|Call Source\n11|Status\n12|Priority\n13|Severity\n14|Operating System\n15|Application\n16|Summary\n17|Deleted");
     $sv->store();
     return $success;
 }
コード例 #2
0
<?php

/* $Id: do_syskey_aed.php 1022 2010-04-24 03:53:00Z caseydk $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/tags/version2.4/modules/system/syskeys/do_syskey_aed.php $ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
// check permissions
$perms =& $AppUI->acl();
if (!canEdit('system')) {
    $AppUI->redirect('m=public&a=access_denied');
}
$del = (int) w2PgetParam($_POST, 'del', 0);
$obj = new CSysKey();
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
$AppUI->setMsg('System Lookup Keys', UI_MSG_ALERT);
if ($del) {
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $AppUI->setMsg('deleted', UI_MSG_ALERT, true);
    }
} else {
    if ($msg = $obj->store()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $AppUI->setMsg($_POST['syskey_id'] ? 'updated' : 'inserted', UI_MSG_OK, true);
    }
}