diff --git a/db/update16.5.sql b/db/update16.5.sql index bb437efddd..aea256e55c 100644 --- a/db/update16.5.sql +++ b/db/update16.5.sql @@ -89,3 +89,169 @@ REPLACE INTO `zt_zoutput` (`id`, `activity`, `name`, `content`, `optional`, `sta DELETE FROM `zt_config` WHERE `section` = 'customMenu'; UPDATE `zt_story` SET `plan` = '' WHERE `plan` = 0; + +DELETE FROM `zt_workflowfield` WHERE `module`='execution' AND `field`='stage'; +DELETE FROM `zt_workflowfield` WHERE `module`='program' AND `field`='stage'; +DELETE FROM `zt_workflowfield` WHERE `module`='project' AND `field`='stage'; +DELETE FROM `zt_workflowfield` WHERE `module`='bug' AND `field`='feedback'; +DELETE FROM `zt_workflowfield` WHERE `module`='task' AND `field`='feedback'; +INSERT INTO `zt_workflowdatasource` (`type`, `name`, `code`, `buildin`, `datasource`, `view`, `keyField`, `valueField`) VALUES('lang', '项目模型', 'projectModel', '1', 'projectModel', '', '', ''); +REPLACE INTO `zt_workflowfield` (`module`, `field`, `type`, `length`, `name`, `control`, `expression`, `options`, `default`, `rules`, `placeholder`, `order`, `searchOrder`, `exportOrder`, `canExport`, `canSearch`, `isValue`, `readonly`, `buildin`, `desc`, `createdBy`, `createdDate`, `editedBy`, `editedDate`) VALUES +('execution', 'type', 'char', '30', '迭代类型', 'select', '', '16', 'sprint', '', '', 3, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'begin', 'date', '', '计划开始', 'date', '', '', '', '', '', 14, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'end', 'date', '', '计划完成', 'date', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'days', 'smallint', '5', '可用工作日', 'integer', '', '', '', '', '', 18, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'pri', 'enum', '', '优先级', 'select', '', '[1,2,3,4]', '1', '', '', 20, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'desc', 'text', '', '迭代描述', 'richtext', '', '', '', '', '', 21, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'openedDate', 'datetime', '', '创建日期', 'datetime', '', '', '', '', '', 27, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'closedDate', 'datetime', '', '关闭日期', 'datetime', '', '', '', '', '', 32, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'canceledDate', 'datetime', '', '取消日期', 'datetime', '', '', '', '', '', 34, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'acl', 'char', '30', '访问控制', 'select', '', '18', 'open', '', '', 41, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'whitelist', 'text', '', '白名单', 'multi-select', '', 'user', '', '', '', 42, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'deleted', 'enum', '', '已删除', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 47, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'type', 'char', '30', '类型', 'select', '', '16', 'sprint', '', '', 2, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'begin', 'date', '', '计划开始', 'date', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'end', 'date', '', '计划完成', 'date', '', '', '', '', '', 16, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'days', 'smallint', '5', '可用工作日', 'integer', '', '', '', '', '', 19, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'pri', 'enum', '', '优先级', 'select', '', '[1,2,3,4]', '1', '', '', 21, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'desc', 'text', '', '项目集描述', 'richtext', '', '', '', '', '', 22, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'openedDate', 'datetime', '', '创建日期', 'datetime', '', '', '', '', '', 28, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'closedDate', 'datetime', '', '关闭日期', 'datetime', '', '', '', '', '', 33, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'canceledDate', 'datetime', '', '取消日期', 'datetime', '', '', '', '', '', 35, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'whitelist', 'text', '', '白名单', 'multi-select', '', 'user', '', '', '', 43, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'deleted', 'enum', '', '已删除', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 48, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'type', 'char', '30', '项目类型', 'select', '', '16', 'sprint', '', '', 3, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'model', 'char', '30', '项目管理方式', 'input', '', '45', '', '', '', 2, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'name', 'varchar', '90', '项目名称', 'input', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'begin', 'date', '', '计划开始', 'date', '', '', '', '', '', 16, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'end', 'date', '', '计划完成', 'date', '', '', '', '', '', 17, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'days', 'smallint', '5', '可用工作日', 'integer', '', '', '', '', '', 20, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'pri', 'enum', '', '优先级', 'select', '', '[1,2,3,4]', '1', '', '', 22, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'desc', 'text', '', '项目描述', 'richtext', '', '', '', '', '', 23, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'openedDate', 'datetime', '', '创建日期', 'datetime', '', '', '', '', '', 29, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'closedDate', 'datetime', '', '关闭日期', 'datetime', '', '', '', '', '', 34, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'canceledDate', 'datetime', '', '取消日期', 'datetime', '', '', '', '', '', 36, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'acl', 'char', '30', '访问控制', 'select', '', '18', 'open', '', '', 43, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'whitelist', 'text', '', '项目白名单', 'multi-select', '', 'user', '', '', '', 44, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'deleted', 'enum', '', '已删除', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 49, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('build', 'project', 'mediumint', '8', '所属项目', 'select', '', '2', '0', '', '', 4, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('build', 'date', 'date', '', '打包日期', 'date', '', '', '', '', '', 9, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('build', 'desc', 'text', '', '描述', 'richtext', '', '', '', '', '', 13, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('build', 'deleted', 'enum', '', '已删除', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 14, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'project', 'mediumint', '8', '所属项目', 'select', '', '2', '0', '', '', 2, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'storyVersion', 'smallint', '6', '研发需求版本', 'integer', '', '', '1', '', '', 9, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'toTask', 'mediumint', '8', '转任务', 'select', '', '5', '0', '', '', 11, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'toStory', 'mediumint', '8', '转研发需求', 'select', '', '4', '0', '', '', 12, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'steps', 'mediumtext', '', '重现步骤', 'richtext', '', '', '', '', '', 22, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'activatedDate', 'datetime', '', '激活日期', 'datetime', '', '', '', '', '', 27, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'openedDate', 'datetime', '', '创建日期', 'datetime', '', '', '', '', '', 32, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'openedBuild', 'varchar', '255', '影响版本', 'multi-select', '', '10', '', '', '', 33, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'assignedDate', 'datetime', '', '指派日期', 'datetime', '', '', '', '', '', 35, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'deadline', 'date', '', '截止日期', 'date', '', '', '', '', '', 36, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'resolvedDate', 'datetime', '30', '解决日期', 'datetime', '', '', '', '', '', 40, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'closedDate', 'datetime', '', '关闭日期', 'datetime', '', '', '', '', '', 42, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'case', 'mediumint', '8', '相关用例', 'select', '', '41', '', '', '', 45, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'caseVersion', 'smallint', '6', '用例版本', 'integer', '', '', '', '', '', 46, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'lastEditedDate', 'datetime', '30', '修改日期', 'datetime', '', '', '', '', '', 58, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'deleted', 'enum', '', '已删除', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 59, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'project', 'mediumint', '8', '所属项目', 'select', '', '2', '0', '', '', 2, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'storyVersion', 'smallint', '6', '研发需求版本', 'integer', '', '', '1', '', '', 7, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'estimate', 'float ', '', '最初预计', 'decimal', '', '', '', '', '', 13, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'consumed', 'float ', '', '总计消耗', 'decimal', '', '', '', '', '', 14, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'left', 'float ', '', '预计剩余', 'decimal', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'deadline', 'date', '', '截止日期', 'date', '', '', '', '', '', 16, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'desc', 'text', '', '任务描述', 'richtext', '', '', '', '', '', 20, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'openedDate', 'datetime', '', '创建日期', 'datetime', '', '', '', '', '', 23, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'assignedDate', 'datetime', '30', '指派日期', 'datetime', '', '', '', '', '', 25, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'estStarted', 'date', '', '预计开始', 'date', '', '', '', '', '', 26, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'realStarted', 'date', '', '实际开始', 'date', '', '', '', '', '', 27, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'finishedDate', 'datetime', '', '实际完成', 'datetime', '', '', '', '', '', 29, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'canceledDate', 'datetime', '', '取消时间', 'datetime', '', '', '', '', '', 32, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'closedDate', 'datetime', '', '关闭时间', 'datetime', '', '', '', '', '', 34, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'lastEditedDate', 'datetime', '', '最后修改日期', 'datetime', '', '', '', '', '', 39, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'deleted', 'enum', '', '已删除', 'select', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 48, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'lifetime', 'char', '30', 'lifetime', 'input', '', '', '', '', '', 4, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'lifetime', 'char', '30', 'lifetime', 'input', '', '', '', '', '', 3, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'designVersion', 'smallint', '6', '设计版本', 'integer', '', '', '', '', '', 8, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'attribute', 'varchar', '30', 'attribute', 'input', '', '', '0', '', '', 5, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'percent', 'float', '', 'percent', 'input', '', '', '0', '', '', 6, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'milestone', 'enum', '', 'milestone', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 7, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'output', 'text', '', 'output', 'textarea', '', '', '', '', '', 8, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'auth', 'char', '30', 'auth', 'input', '', '', '', '', '', 9, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'path', 'varchar', '255', 'path', 'input', '', '', '0', '', '', 10, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'grade', 'tinyint', '3', 'grade', 'integer', '', '', '0', '', '', 11, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'realBegan', 'date', '', '实际开始日期', 'date', '', '', '', '', '', 16, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'realEnd', 'date', '', '实际完成日期', 'date', '', '', '', '', '', 17, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'version', 'smallint', '6', 'version', 'integer', '', '', '', '', '', 22, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'parentVersion', 'smallint', '6', 'parentVersion', 'integer', '', '', '', '', '', 23, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'planDuration', 'int', '11', 'planDuration', 'integer', '', '', '', '', '', 24, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'realDuration', 'int', '11', 'realDuration', 'integer', '', '', '', '', '', 25, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'openedVersion', 'varchar', '20', 'openedVersion', 'input', '', '', '', '', '', 28, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'lastEditedBy', 'varchar', '30', 'lastEditedBy', 'select', '', 'user', '', '', '', 29, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'lastEditedDate', 'datetime', '', 'lastEditedDate', 'datetime', '', '', '', '', '', 30, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'suspendedDate', 'date', '', 'suspendedDate', 'date', '', '', '', '', '', 35, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'vision', 'varchar', '10', 'vision', 'input', '', '', 'rnd', '', '', 44, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'displayCards', 'enum', '', 'displayCards', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 45, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('execution', 'fluidBoard', 'enum', '', 'fluidBoard', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 46, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'output', 'text', '', 'output', 'textarea', '', '', '', '', '', 9, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'auth', 'char', '30', 'auth', 'input', '', '', '', '', '', 10, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'path', 'varchar', '255', 'path', 'input', '', '', '0', '', '', 12, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'grade', 'tinyint', '3', 'grade', 'integer', '', '', '0', '', '', 13, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'realBegan', 'date', '', 'realBegan', 'date', '', '', '', '', '', 17, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'realEnd', 'date', '', 'realEnd', 'date', '', '', '', '', '', 18, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'version', 'smallint', '6', 'version', 'integer', '', '', '', '', '', 23, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'parentVersion', 'smallint', '6', 'parentVersion', 'integer', '', '', '', '', '', 24, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'planDuration', 'int', '11', 'planDuration', 'integer', '', '', '', '', '', 25, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'realDuration', 'int', '11', 'realDuration', 'integer', '', '', '', '', '', 26, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'openedVersion', 'varchar', '20', 'openedVersion', 'input', '', '', '', '', '', 29, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'lastEditedBy', 'varchar', '30', 'lastEditedBy', 'select', '', 'user', '', '', '', 30, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'lastEditedDate', 'datetime', '', 'lastEditedDate', 'datetime', '', '', '', '', '', 31, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'suspendedDate', 'date', '', 'suspendedDate', 'date', '', '', '', '', '', 36, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'vision', 'varchar', '10', 'vision', 'input', '', '', 'rnd', '', '', 45, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'displayCards', 'enum', '', 'displayCards', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 46, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('program', 'fluidBoard', 'enum', '', 'fluidBoard', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 47, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'lifetime', 'char', '30', '项目周期', 'input', '', '', '', '', '', 4, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'attribute', 'varchar', '30', '阶段类型', 'input', '', '', '0', '', '', 7, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'percent', 'float', '', '工作量占比', 'input', '', '', '0', '', '', 8, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'milestone', 'enum', '', '里程碑', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 9, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'output', 'text', '', '输出', 'textarea', '', '', '', '', '', 10, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'auth', 'char', '30', '权限控制', 'input', '', '', '', '', '', 11, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'path', 'varchar', '255', '路径', 'input', '', '', '0', '', '', 13, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'grade', 'tinyint', '3', '层级', 'integer', '', '', '0', '', '', 14, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'realBegan', 'date', '', '实际开始日期', 'date', '', '', '', '', '', 18, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'realEnd', 'date', '', '实际完成日期', 'date', '', '', '', '', '', 19, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'version', 'smallint', '6', '版本', 'integer', '', '', '', '', '', 24, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'parentVersion', 'smallint', '6', '父版本', 'integer', '', '', '', '', '', 25, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'planDuration', 'int', '11', '计划周期天数', 'integer', '', '', '', '', '', 26, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'realDuration', 'int', '11', '实际周期天数', 'integer', '', '', '', '', '', 27, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'openedVersion', 'varchar', '20', '创建版本', 'input', '', '', '', '', '', 30, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'lastEditedBy', 'varchar', '30', '最后编辑人', 'select', '', 'user', '', '', '', 31, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'lastEditedDate', 'datetime', '', '最后编辑日期', 'datetime', '', '', '', '', '', 32, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'suspendedDate', 'date', '', 'suspendedDate', 'date', '', '', '', '', '', 37, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'vision', 'varchar', '10', 'vision', 'input', '', '', 'rnd', '', '', 46, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'displayCards', 'enum', '', 'displayCards', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 47, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('project', 'fluidBoard', 'enum', '', 'fluidBoard', 'radio', '', '[\"\\u672a\\u5220\\u9664\",\"\\u5df2\\u5220\\u9664\"]', '0', '', '', 48, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'hardware', 'varchar', '30', '硬件', 'input', '', '', '', '', '', 20, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'feedbackBy', 'varchar', '100', '反馈者', 'input', '', '', '', '', '', 28, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'notifyEmail', 'varchar', '100', '通知邮箱', 'input', '', '', '', '', '', 29, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'result', 'mediumint', '8', '结果', 'input', '', '', '', '', '', 47, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'repo', 'mediumint', '8', '所属版本库', 'input', '', '', '', '', '', 48, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'mr', 'mediumint', '8', 'mr', 'input', '', '', '', '', '', 49, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'entry', 'text', '', 'entry', 'input', '', '', '', '', '', 50, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'lines', 'varchar', '10', '代码行', 'input', '', '', '', '', '', 51, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'v1', 'varchar', '40', '版本1', 'input', '', '', '', '', '', 52, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'v2', 'varchar', '40', '版本2', 'input', '', '', '', '', '', 53, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'repoType', 'varchar', '30', '版本库类型', 'input', '', '', '', '', '', 54, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('bug', 'issueKey', 'varchar', '50', 'issueKey', 'input', '', '', '', '', '', 55, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'version', 'smallint', '6', '版本', 'integer', '', '', '', '', '', 21, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'planDuration', 'int', '11', '计划持续天数', 'integer', '', '', '', '', '', 35, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'realDuration', 'int', '11', '实际持续天数', 'integer', '', '', '', '', '', 36, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'activatedDate', 'datetime', '', '激活日期', 'datetime', '', '', '', '', '', 40, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'repo', 'mediumint', '8', 'repo', 'input', '', '', '', '', '', 41, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'mr', 'mediumint', '8', 'mr', 'input', '', '', '', '', '', 42, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'entry', 'text', '', 'entry', 'input', '', '', '', '', '', 43, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'lines', 'varchar', '10', 'lines', 'input', '', '', '', '', '', 44, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'v1', 'varchar', '40', 'v1', 'input', '', '', '', '', '', 45, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'v2', 'varchar', '40', 'v2', 'input', '', '', '', '', '', 46, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'), +('task', 'vision', 'varchar', '10', 'vision', 'input', '', '', 'rnd', '', '', 47, 0, 0, '0', '0', '0', '1', 1, '', '', '0000-00-00 00:00:00', '', '0000-00-00 00:00:00'); +UPDATE `zt_workflowfield` SET `options`=(SELECT id FROM `zt_workflowdatasource` WHERE `code`='projectModel' LIMIT 1) WHERE `module`='project' AND `field`='model'; diff --git a/framework/base/control.class.php b/framework/base/control.class.php index c4d051fadb..1576843b29 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -416,7 +416,7 @@ class baseControl $moduleName = basename(dirname(dirname(realpath($viewFile)))); $extPath = $this->app->getModuleExtPath('', $moduleName, 'view'); - $checkedOrder = array('site', 'custom', 'vision', 'xuan', 'common'); + $checkedOrder = array('site', 'saas', 'custom', 'vision', 'xuan', 'common'); $fileName = basename($viewFile); foreach($checkedOrder as $checkedType) { @@ -805,6 +805,12 @@ class baseControl $commonActionExtFile = $actionExtPath['custom'] . strtolower($methodName) . '.php'; if(file_exists($commonActionExtFile)) $file2Included = $commonActionExtFile; + if(!empty($actionExtPath['saas'])) + { + $commonActionExtFile = $actionExtPath['saas'] . strtolower($methodName) . '.php'; + if(file_exists($commonActionExtFile)) $file2Included = $commonActionExtFile; + } + if(!empty($actionExtPath['site'])) { /** diff --git a/framework/base/model.class.php b/framework/base/model.class.php index 0dbb3372be..519def4741 100644 --- a/framework/base/model.class.php +++ b/framework/base/model.class.php @@ -260,6 +260,7 @@ class baseModel $moduleExtPath = $this->app->getModuleExtPath($this->appName, $moduleName, 'model'); if(!empty($moduleExtPath['site'])) $extensionFile = $moduleExtPath['site'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['custom'] . 'class/' . $extensionName . '.class.php'; + if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['saas'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['vision'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['xuan'] . 'class/' . $extensionName . '.class.php'; if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['common'] . 'class/' . $extensionName . '.class.php'; diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 1216e2f4a6..1a44b0585d 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1390,6 +1390,9 @@ class baseRouter if($this->checkModuleName($moduleName)) { + $modulePath = $this->getExtensionRoot() . 'saas' . DS . $moduleName . DS; + if(is_dir($modulePath) and (file_exists($modulePath . 'control.php') or file_exists($modulePath . 'model.php'))) return $modulePath; + /* 1. 最后尝试在定制开发中寻找。 Finally, try to find the module in the custom dir. */ $modulePath = $this->getExtensionRoot() . 'custom' . DS . $moduleName . DS; if(is_dir($modulePath) and (file_exists($modulePath . 'control.php') or file_exists($modulePath . 'model.php'))) return $modulePath; @@ -1432,8 +1435,10 @@ class baseRouter */ public function getModuleExtPath($appName, $moduleName, $ext) { + $saasExtPath = $this->getExtensionRoot() . 'saas' . DS . $moduleName . DS . 'ext' . DS . $ext . DS; + /* 检查失败或者extensionLevel为0,直接返回空。If check failed or extensionLevel == 0, return empty array. */ - if(!$this->checkModuleName($moduleName) or $this->config->framework->extensionLevel == 0) return array(); + if(!$this->checkModuleName($moduleName) or $this->config->framework->extensionLevel == 0) return array('saas' => $saasExtPath); $paths = array(); @@ -1442,10 +1447,16 @@ class baseRouter $paths['xuan'] = $this->getExtensionRoot() . 'xuan' . DS . $moduleName . DS . 'ext' . DS . $ext . DS; $paths['vision'] = $this->config->vision == 'rnd' ? '' : $this->basePath . 'extension' . DS . $this->config->vision . DS . $moduleName . DS . 'ext' . DS . $ext . DS; $paths['custom'] = $this->getExtensionRoot() . 'custom' . DS . $moduleName . DS . 'ext' . DS . $ext . DS; - if($this->config->framework->extensionLevel == 1) return $paths; + if($this->config->framework->extensionLevel == 1) + { + $paths['saas'] = $saasExtPath; + return $paths; + } /* When extensionLevel == 2. */ $paths['site'] = empty($this->siteCode) ? '' : $this->getExtensionRoot() . $this->config->edition . DS . $moduleName . DS . 'ext' . DS . '_' . $this->siteCode . DS . $ext . DS; + $paths['saas'] = $saasExtPath; + return $paths; } @@ -1494,6 +1505,12 @@ class baseRouter /* 如果扩展目录为空,不包含任何扩展文件。If there's no ext paths return false.*/ if(empty($moduleExtPaths)) return false; + if(!empty( $moduleExtPaths['saas'])) + { + $this->extActionFile = $moduleExtPaths['saas'] . $this->methodName . '.php'; + if(file_exists($this->extActionFile)) return true; + } + /* 1. 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。 If extensionLevel == 2 and site extensionFile exists, return it. */ if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site'])) { @@ -2322,6 +2339,7 @@ class baseRouter if(!empty($extConfigPath['common'])) $commonExtConfigFiles = helper::ls($extConfigPath['common'], '.php'); if(!empty($extConfigPath['xuan'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['xuan'], '.php')); if(!empty($extConfigPath['vision'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['vision'], '.php')); + if(!empty($extConfigPath['saas'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['saas'], '.php')); if(!empty($extConfigPath['custom'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['custom'], '.php')); } if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php'); @@ -2427,6 +2445,9 @@ class baseRouter { $path = $moduleName . DS . 'lang' . DS . $this->clientLang . '.php'; + $modulePath = $this->getExtensionRoot() . 'saas' . DS; + if(file_exists($modulePath . $path)) return $modulePath . $path; + /* 1. 如果通用版本里有此模块,优先使用。 If module is in the open edition, use it. */ $modulePath = $this->getModuleRoot($appName); if(file_exists($modulePath . $path)) return $modulePath . $path; @@ -2489,6 +2510,7 @@ class baseRouter if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php')); if(!empty($extLangPath['vision'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['vision'] . $this->clientLang, '.php')); if(!empty($extLangPath['custom'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['custom'] . $this->clientLang, '.php')); + if(!empty($extLangPath['saas'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['saas'] . $this->clientLang, '.php')); } if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php'); $extLangFiles = array_merge($commonExtLangFiles, $siteExtLangFiles); diff --git a/framework/control.class.php b/framework/control.class.php index 926fab0f05..3677e1e7dc 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -86,7 +86,7 @@ class control extends baseControl /** * Det default priv by workflow. - * + * * @access public * @return bool */ @@ -197,6 +197,7 @@ class control extends baseControl $commonExtViewFile = $viewExtPath['common'] . $this->devicePrefix . $methodName . ".{$viewType}.php"; $xuanExtViewFile = $viewExtPath['xuan'] . $this->devicePrefix . $methodName . ".{$viewType}.php"; $visionExtViewFile = $viewExtPath['vision'] . $this->devicePrefix . $methodName . ".{$viewType}.php"; + $saasExtViewFile = $viewExtPath['saas'] . $this->devicePrefix . $methodName . ".{$viewType}.php"; $customExtViewFile = $viewExtPath['custom'] . $this->devicePrefix . $methodName . ".{$viewType}.php"; $siteExtViewFile = empty($viewExtPath['site']) ? '' : $viewExtPath['site'] . $this->devicePrefix . $methodName . ".{$viewType}.php"; @@ -217,6 +218,10 @@ class control extends baseControl { $viewFile = $xuanExtViewFile; } + else if(file_exists($saasExtViewFile)) + { + $viewFile = $saasExtViewFile; + } else if(file_exists($commonExtViewFile)) { $viewFile = $commonExtViewFile; @@ -235,10 +240,11 @@ class control extends baseControl $commonExtHookFiles = glob($viewExtPath['vision'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php"); } $xuanExtHookFiles = glob($viewExtPath['xuan'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php"); + $saasExtHookFiles = glob($viewExtPath['saas'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php"); $customExtHookFiles = glob($viewExtPath['custom'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php"); $siteExtHookFiles = empty($viewExtPath['site']) ? '' : glob($viewExtPath['site'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php"); - $extHookFiles = array_merge((array)$commonExtHookFiles, (array)$xuanExtHookFiles, (array)$customExtHookFiles, (array)$siteExtHookFiles); + $extHookFiles = array_merge((array)$commonExtHookFiles, (array)$xuanExtHookFiles, (array)$saasExtHookFiles, (array)$customExtHookFiles, (array)$siteExtHookFiles); } if(!empty($extHookFiles)) return array('viewFile' => $viewFile, 'hookFiles' => $extHookFiles); @@ -342,9 +348,9 @@ class control extends baseControl } /** - * Set workflow export fields - * - * @param array $fields + * Set workflow export fields + * + * @param array $fields * @access public * @return array */ diff --git a/framework/router.class.php b/framework/router.class.php index 500761517b..3fb5136cfa 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -327,6 +327,7 @@ class router extends baseRouter if(!empty($extConfigPath['common'])) $commonExtConfigFiles = helper::ls($extConfigPath['common'], '.php'); if(!empty($extConfigPath['xuan'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['xuan'], '.php')); if(!empty($extConfigPath['vision'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['vision'], '.php')); + if(!empty($extConfigPath['saas'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['saas'], '.php')); if(!empty($extConfigPath['custom'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['custom'], '.php')); } if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php'); diff --git a/module/caselib/model.php b/module/caselib/model.php index 1be4157617..bbdd5e2ee2 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -103,6 +103,7 @@ class caselibModel extends model $this->dao->update(TABLE_TESTSUITE)->data($lib) ->autoCheck() ->batchcheck($this->config->caselib->edit->requiredFields, 'notempty') + ->checkFlow() ->where('id')->eq($libID) ->checkFlow() ->exec(); diff --git a/module/execution/control.php b/module/execution/control.php index 25f8e63cb8..be01e4169e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3148,7 +3148,16 @@ class execution extends control } $projectExecutions = array(); - foreach($orderedExecutions as $execution) $projectExecutions[$execution->project][] = $execution; + $parentIdList = array(); + foreach($orderedExecutions as $execution) + { + $projectExecutions[$execution->project][] = $execution; + if($execution->type != 'stage') continue; + if($execution->grade == 2 and $execution->project != $execution->parent) $parentIdList[$execution->parent] = $execution->parent; + } + + $parents = array(); + if($parentIdList) $parents = $this->execution->getByIdList($parentIdList); $this->view->link = $this->execution->getLink($module, $method, $extra); $this->view->module = $module; @@ -3157,6 +3166,7 @@ class execution extends control $this->view->extra = $extra; $this->view->projects = $projectPairs; $this->view->executions = $projectExecutions; + $this->view->parents = $parents; $this->display(); } diff --git a/module/execution/model.php b/module/execution/model.php index 9cc2b97457..507ddfe98a 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -516,6 +516,7 @@ class executionModel extends model ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) ->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $executionProject") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')") + ->checkFlow() ->where('id')->eq($executionID) ->checkFlow() ->limit(1) @@ -673,13 +674,6 @@ class executionModel extends model if(is_array($executions[$executionID]->{$extendField->field})) $executions[$executionID]->{$extendField->field} = join(',', $executions[$executionID]->{$extendField->field}); $executions[$executionID]->{$extendField->field} = htmlSpecialString($executions[$executionID]->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $executions[$executionID]->{$extendField->field}); - - if($message) - { - dao::$errors['message'][] = $message; - return false; - } } } @@ -709,6 +703,7 @@ class executionModel extends model ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) ->checkIF((!empty($execution->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $executionID and type in ('sprint','stage') and `project` = $projectID") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage')") + ->checkFlow() ->where('id')->eq($executionID) ->limit(1) ->exec(); @@ -772,6 +767,7 @@ class executionModel extends model ->autoCheck() ->check($this->config->execution->start->requiredFields, 'notempty') ->checkIF($execution->realBegan != '', 'realBegan', 'le', helper::today()) + ->checkFlow() ->where('id')->eq((int)$executionID) ->exec(); @@ -805,6 +801,7 @@ class executionModel extends model $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$executionID) ->exec(); @@ -832,6 +829,7 @@ class executionModel extends model $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$executionID) ->exec(); @@ -867,6 +865,7 @@ class executionModel extends model $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$executionID) ->exec(); @@ -937,6 +936,7 @@ class executionModel extends model ->check($this->config->execution->close->requiredFields,'notempty') ->checkIF($execution->realEnd != '', 'realEnd', 'le', helper::today()) ->checkIF($execution->realEnd != '', 'realEnd', 'ge', $oldExecution->realBegan) + ->checkFlow() ->where('id')->eq((int)$executionID) ->exec(); @@ -2819,8 +2819,9 @@ class executionModel extends model ->where('execution')->in(array_keys($executions)) ->andWhere('deleted')->eq('0') ->andWhere('parent')->ge('0') - ->andWhere('status')->eq('done') + ->andWhere('status', true)->eq('done') ->orWhere('status')->eq('closed') + ->markRight(1) ->groupBy('execution') ->fetchAll('execution'); $storyPoints = $this->dao->select('t1.project, sum(t2.estimate) AS `storyPoint`')->from(TABLE_PROJECTSTORY)->alias('t1') diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 5d014e6ce1..f5c2d77aa6 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -46,7 +46,12 @@ foreach($executions as $projectID => $projectExecutions) if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account]))) $executionCounts[$projectID]['myExecution'] ++; if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account])) $executionCounts[$projectID]['others'] ++; if($execution->status == 'done' or $execution->status == 'closed') $executionCounts[$projectID]['closed'] ++; - $executionNames[] = $execution->name; + $onlyChildStage = $execution->grade == 2 and $execution->project != $execution->parent; + $executionNames[$execution->id] = $execution->name; + if($onlyChildStage and isset($parents[$execution->parent])) + { + $executionNames[$execution->id] = $parents[$execution->parent]->name . '/' . $execution->name; + } } } $executionsPinYin = common::convert2Pinyin($executionNames); @@ -77,7 +82,7 @@ foreach($executions as $projectID => $projectExecutions) $selected = $execution->id == $executionID ? 'selected' : ''; if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account]))) { - $myExecutionsHtml .= '
  • ' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected clickable' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
  • '; + $myExecutionsHtml .= '
  • ' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
  • '; if($selected == 'selected') $tabActive = 'myExecution'; @@ -85,7 +90,7 @@ foreach($executions as $projectID => $projectExecutions) } else if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account])) { - $normalExecutionsHtml .= '
  • ' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected clickable' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
  • '; + $normalExecutionsHtml .= '
  • ' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
  • '; if($selected == 'selected') $tabActive = 'other'; @@ -93,7 +98,7 @@ foreach($executions as $projectID => $projectExecutions) } else if($execution->status == 'done' or $execution->status == 'closed') { - $closedExecutionsHtml .= '
  • ' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected clickable' title='$execution->name' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
  • '; + $closedExecutionsHtml .= '
  • ' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='$execution->name' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
  • '; if($selected == 'selected') $tabActive = 'closed'; } @@ -171,7 +176,7 @@ $(function() $('li.has-list div.hide-in-search').removeClass('hidden'); $('.nav-tabs li.active').find('span').show(); } - + if($('.form-control.search-input').val().length > 0) { $('#closed').attr("hidden", false); @@ -191,7 +196,7 @@ $(function() $('#closed').attr("hidden", true); $('#gray-line').attr("hidden", true); } - + var listItem = $(this).find('.has-list'); listItem.each(function () { diff --git a/module/product/model.php b/module/product/model.php index 4de525f5e5..aa01af3093 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -609,6 +609,7 @@ class productModel extends model ->batchCheck($this->config->product->create->requiredFields, 'notempty') ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "`program` = $programID") ->checkIF(!empty($product->code), 'code', 'unique') + ->checkFlow() ->exec(); if(!dao::isError()) @@ -718,6 +719,7 @@ class productModel extends model ->batchCheck($this->config->product->edit->requiredFields, 'notempty') ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID") ->checkIF(!empty($product->code), 'code', 'unique', "id != $productID") + ->checkFlow() ->where('id')->eq($productID) ->exec(); @@ -773,8 +775,6 @@ class productModel extends model if(is_array($products[$productID]->{$extendField->field})) $products[$productID]->{$extendField->field} = join(',', $products[$productID]->{$extendField->field}); $products[$productID]->{$extendField->field} = htmlSpecialString($products[$productID]->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $products[$productID]->{$extendField->field}); - if($message) return print(js::alert($message)); } } if(dao::isError()) return print(js::error(dao::getError())); @@ -791,6 +791,7 @@ class productModel extends model ->autoCheck() ->batchCheck($this->config->product->edit->requiredFields , 'notempty') ->checkIF((!empty($product->name) and $this->config->systemMode == 'new'), 'name', 'unique', "id != $productID and `program` = $programID") + ->checkFlow() ->where('id')->eq($productID) ->exec(); if(dao::isError()) return print(js::error('product#' . $productID . dao::getError(true))); @@ -828,6 +829,7 @@ class productModel extends model $this->dao->update(TABLE_PRODUCT)->data($product) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$productID) ->exec(); @@ -2020,6 +2022,37 @@ class productModel extends model return true; } + /** + * Build operate menu. + * + * @param object $product + * @param string $type + * @access public + * @return string + */ + public function buildOperateMenu($product, $type = 'view') + { + $menu = ''; + $params = "product=$product->id"; + + if($type == 'view') + { + $menu .= "
    "; + $menu .= $this->buildFlowMenu('product', $product, $type, 'direct'); + $menu .= "
    "; + + $menu .= $this->buildMenu('product', 'close', $params, $product, $type, '', '', '', '', "data-app='product'"); + $menu .= "
    "; + } + + $menu .= $this->buildMenu('product', 'edit', $params, $product, $type); + + if($type == 'view') $menu .= $this->buildMenu('product', 'delete', $params, $product, $type, 'trash', 'hiddenwin'); + if($type == 'browse' && common::hasPriv('product', 'updateOrder')) $menu .= ""; + + return $menu; + } + /** * Create the link from module,method,extra,branch. * diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index 1365dd5449..25b5453e0b 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -32,10 +32,7 @@
    ' data-preserve-nested='false' data-expand-nest-child='true'> - + @@ -215,12 +212,7 @@ " . $this->loadModel('flow')->getFieldValue($extendField, $product) . "";?> - + diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index e05d64fdba..9dff1daa07 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -158,24 +158,10 @@
    id"; $browseLink = $this->session->productList ? $this->session->productList : inlink('browse', "productID=$product->id"); common::printBack($browseLink); - if(!$product->deleted) - { - echo $this->buildOperateMenu($product, 'view'); - echo "
    "; - - if($product->status != 'closed') - { - common::printIcon('product', 'close', $params, $product, 'button', '', '', 'iframe', true); - echo "
    "; - } - - common::printIcon('product', 'edit', $params, $product); - common::printIcon('product', 'delete', $params, $product, 'button', 'trash', 'hiddenwin'); - } + if(!$product->deleted) echo $this->buildOperateMenu($product, 'view'); ?>
    diff --git a/module/productplan/model.php b/module/productplan/model.php index 7eefd49a79..ad2d763bec 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -432,6 +432,7 @@ class productplanModel extends model ->autoCheck() ->batchCheck($this->config->productplan->create->requiredFields, 'notempty') ->checkIF(!$this->post->future && !empty($_POST['begin']) && !empty($_POST['end']), 'end', 'ge', $plan->begin) + ->checkFlow() ->exec(); if(!dao::isError()) { @@ -513,6 +514,7 @@ class productplanModel extends model ->autoCheck() ->batchCheck($this->config->productplan->edit->requiredFields, 'notempty') ->checkIF(!$this->post->future && !empty($_POST['begin']) && !empty($_POST['end']), 'end', 'ge', $plan->begin) + ->checkFlow() ->where('id')->eq((int)$planID) ->exec(); if(dao::isError()) return false; @@ -653,8 +655,6 @@ class productplanModel extends model if(is_array($plan->{$extendField->field})) $plan->{$extendField->field} = join(',', $plan->{$extendField->field}); $plan->{$extendField->field} = htmlSpecialString($plan->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $plan->{$extendField->field}); - if($message) return print(js::alert($message)); } $plans[$planID] = $plan; @@ -697,7 +697,7 @@ class productplanModel extends model if($change) { if($parentID > 0 and !isset($parents[$parentID])) $parents[$parentID] = $parentID; - $this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->where('id')->eq($planID)->exec(); + $this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->checkFlow()->where('id')->eq($planID)->exec(); if(dao::isError()) return print(js::error(dao::getError())); $changes[$planID] = $change; } diff --git a/module/program/model.php b/module/program/model.php index f1868c9348..f5bd3cdb18 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -657,6 +657,7 @@ class programModel extends model ->checkIF($program->end != '', 'end', 'date') ->checkIF($program->end != '', 'end', 'gt', $program->begin) ->checkIF(!empty($program->name), 'name', 'unique', "`type`='program' and `parent` = $program->parent") + ->checkFlow() ->exec(); if(!dao::isError()) @@ -756,6 +757,7 @@ class programModel extends model ->checkIF($program->end != '', 'end', 'date') ->checkIF($program->end != '', 'end', 'gt', $program->begin) ->checkIF(!empty($program->name), 'name', 'unique', "id!=$programID and `type`='program' and `parent` = $program->parent") + ->checkFlow() ->where('id')->eq($programID) ->limit(1) ->exec(); diff --git a/module/project/model.php b/module/project/model.php index a17ae091f7..04a76c89f2 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -913,6 +913,7 @@ class projectModel extends model ->checkIF(!empty($project->name), 'name', 'unique', "`type`='project' and `parent` = $project->parent and `model` = '{$project->model}'") ->checkIF(!empty($project->code), 'code', 'unique', "`type`='project' and `model` = '{$project->model}'") ->checkIF($project->end != '', 'end', 'gt', $project->begin) + ->checkFlow() ->exec(); /* Add the creater to the team. */ @@ -1146,6 +1147,7 @@ class projectModel extends model ->checkIF($project->end != '', 'end', 'gt', $project->begin) ->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type` = 'project' and `parent` = $project->parent and `model` = '{$project->model}'") ->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type` = 'project' and `model` = '{$project->model}'") + ->checkFlow() ->where('id')->eq($projectID) ->exec(); @@ -1269,8 +1271,6 @@ class projectModel extends model if(is_array($projects[$projectID]->{$extendField->field})) $projects[$projectID]->{$extendField->field} = join(',', $projects[$projectID]->{$extendField->field}); $projects[$projectID]->{$extendField->field} = htmlSpecialString($projects[$projectID]->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $projects[$projectID]->{$extendField->field}); - if($message) hepler::end(js::alert($message)); } } if(dao::isError()) return print(js::error(dao::getError())); @@ -1288,6 +1288,7 @@ class projectModel extends model ->checkIF($project->end != '', 'end', 'gt', $project->begin) ->checkIF(!empty($project->name), 'name', 'unique', "id != $projectID and `type`='project' and `parent` = $parentID and `model` = '{$project->model}'") ->checkIF(!empty($project->code), 'code', 'unique', "id != $projectID and `type`='project' and `model` = '{$project->model}'") + ->checkFlow() ->where('id')->eq($projectID) ->exec(); @@ -1331,6 +1332,7 @@ class projectModel extends model ->autoCheck() ->check($this->config->project->start->requiredFields, 'notempty') ->checkIF($project->realBegan != '', 'realBegan', 'le', helper::today()) + ->checkFlow() ->where('id')->eq((int)$projectID) ->exec(); @@ -1361,6 +1363,7 @@ class projectModel extends model $this->dao->update(TABLE_PROJECT)->data($project) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$projectID) ->exec(); @@ -1387,6 +1390,7 @@ class projectModel extends model $this->dao->update(TABLE_PROJECT)->data($project) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$projectID) ->exec(); @@ -1423,6 +1427,7 @@ class projectModel extends model $this->dao->update(TABLE_PROJECT)->data($project) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$projectID) ->exec(); @@ -1493,6 +1498,7 @@ class projectModel extends model ->check($this->config->project->close->requiredFields, 'notempty') ->checkIF($project->realEnd != '', 'realEnd', 'le', helper::today()) ->checkIF($project->realEnd != '', 'realEnd', 'ge', $oldProject->realBegan) + ->checkFlow() ->where('id')->eq((int)$projectID) ->exec(); diff --git a/module/release/control.php b/module/release/control.php index 2c76a1f05a..4f167c7fa7 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -41,15 +41,18 @@ class release extends control * @access public * @return void */ - public function browse($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc') + public function browse($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $this->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); $this->commonAction($productID, $branch); $this->session->set('releaseList', $this->app->getURI(true), 'product'); $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->browse; $this->view->position[] = $this->lang->release->browse; - $this->view->releases = $this->release->getList($productID, $branch, $type, $orderBy); + $this->view->releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager); $this->view->type = $type; + $this->view->pager = $pager; $this->display(); } diff --git a/module/release/model.php b/module/release/model.php index 89c64ab08c..28cc033b6f 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -121,9 +121,6 @@ class releaseModel extends model /* Check build if build is required. */ if(strpos($this->config->release->create->requiredFields, 'build') !== false and $this->post->build == false) return dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->release->build); - /* Check date must be not more than today. */ - if($this->post->date > date('Y-m-d')) return dao::$errors[] = $this->lang->release->errorDate; - $release = fixer::input('post') ->add('product', (int)$productID) ->add('branch', (int)$branch) diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index f980074b89..3eea2f090a 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -105,5 +105,8 @@
    plans;?> releases;?> - id", $product, 'list', 'edit');?> - - - - buildOperateMenu($product, 'browse');?>
    +
    diff --git a/module/release/view/create.html.php b/module/release/view/create.html.php index 8767c42c7a..70466f980c 100644 --- a/module/release/view/create.html.php +++ b/module/release/view/create.html.php @@ -75,10 +75,4 @@ - diff --git a/module/story/model.php b/module/story/model.php index 4181c473a1..eb728e444e 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -247,6 +247,7 @@ class storyModel extends model ->autoCheck() ->checkIF($story->notifyEmail, 'notifyEmail', 'email') ->batchCheck($requiredFields, 'notempty') + ->checkFlow() ->exec(); if(!dao::isError()) @@ -514,8 +515,6 @@ class storyModel extends model if(is_array($story->{$extendField->field})) $story->{$extendField->field} = join(',', $story->{$extendField->field}); $story->{$extendField->field} = htmlSpecialString($story->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $story->{$extendField->field}); - if($message) return print(js::alert($message)); } foreach(explode(',', $this->config->story->create->requiredFields) as $field) @@ -538,7 +537,7 @@ class storyModel extends model foreach($data as $i => $story) { - $this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->exec(); + $this->dao->insert(TABLE_STORY)->data($story)->autoCheck()->checkFlow()->exec(); if(dao::isError()) { echo js::error(dao::getError()); @@ -694,6 +693,7 @@ class storyModel extends model $this->dao->update(TABLE_STORY)->data($story, 'spec,verify') ->autoCheck() ->batchCheck($this->config->story->change->requiredFields, 'notempty') + ->checkFlow() ->where('id')->eq((int)$storyID)->exec(); if(!dao::isError()) @@ -866,6 +866,7 @@ class storyModel extends model ->checkIF(isset($story->closedReason) and $story->closedReason == 'done', 'stage', 'notempty') ->checkIF(isset($story->closedReason) and $story->closedReason == 'duplicate', 'duplicateStory', 'notempty') ->checkIF($story->notifyEmail, 'notifyEmail', 'email') + ->checkFlow() ->where('id')->eq((int)$storyID)->exec(); if(!dao::isError()) @@ -1248,8 +1249,6 @@ class storyModel extends model if(is_array($story->{$extendField->field})) $story->{$extendField->field} = join(',', $story->{$extendField->field}); $story->{$extendField->field} = htmlSpecialString($story->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $story->{$extendField->field}); - if($message) return print(js::alert($message)); } $stories[$storyID] = $story; @@ -1264,6 +1263,7 @@ class storyModel extends model ->checkIF($story->closedBy, 'closedReason', 'notempty') ->checkIF($story->closedReason == 'done', 'stage', 'notempty') ->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty') + ->checkFlow() ->where('id')->eq((int)$storyID) ->exec(); if($story->title != $oldStory->title) @@ -1357,6 +1357,7 @@ class storyModel extends model ->batchCheck($this->config->story->review->requiredFields, 'notempty') ->checkIF($this->post->result == 'reject', 'closedReason', 'notempty') ->checkIF($this->post->result == 'reject' and $this->post->closedReason == 'duplicate', 'duplicateStory', 'notempty') + ->checkFlow() ->where('id')->eq($storyID)->exec(); if($this->post->result == 'revert') { @@ -1581,6 +1582,7 @@ class storyModel extends model ->autoCheck() ->batchCheck($this->config->story->close->requiredFields, 'notempty') ->checkIF($story->closedReason == 'duplicate', 'duplicateStory', 'notempty') + ->checkFlow() ->where('id')->eq($storyID)->exec(); /* Update parent story status and stage. */ @@ -1980,12 +1982,6 @@ class storyModel extends model $assignedTo = $this->post->assignedTo; if($assignedTo == $oldStory->assignedTo) return array(); - $story = new stdclass(); - $story->lastEditedBy = $this->app->user->account; - $story->lastEditedDate = $now; - $story->assignedTo = $assignedTo; - $story->assignedDate = $now; - $story = fixer::input('post') ->add('id', $storyID) ->add('lastEditedBy', $this->app->user->account) @@ -1993,7 +1989,7 @@ class storyModel extends model ->add('assignedDate', $now) ->get(); - $this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq((int)$storyID)->exec(); + $this->dao->update(TABLE_STORY)->data($story)->autoCheck()->checkFlow()->where('id')->eq((int)$storyID)->exec(); if(!dao::isError()) return common::createChanges($oldStory, $story); return false; } @@ -2055,7 +2051,7 @@ class storyModel extends model ->setDefault('activatedDate', $now) ->remove('comment') ->get(); - $this->dao->update(TABLE_STORY)->data($story)->autoCheck()->where('id')->eq($storyID)->exec(); + $this->dao->update(TABLE_STORY)->data($story)->autoCheck()->checkFlow()->where('id')->eq($storyID)->exec(); if($this->post->status == 'active') $this->dao->delete()->from(TABLE_STORYREVIEW)->where('story')->eq($storyID)->exec(); diff --git a/module/task/model.php b/module/task/model.php index 687c2cde4e..fca1b01bf0 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -138,6 +138,7 @@ class taskModel extends model ->batchCheck($requiredFields, 'notempty') ->checkIF($task->estimate != '', 'estimate', 'float') ->checkIF(!helper::isZeroDate($task->deadline), 'deadline', 'ge', $task->estStarted) + ->checkFlow() ->exec(); if(dao::isError()) return false; @@ -363,12 +364,6 @@ class taskModel extends model if(is_array($data[$i]->{$extendField->field})) $data[$i]->{$extendField->field} = join(',', $data[$i]->{$extendField->field}); $data[$i]->{$extendField->field} = htmlSpecialString($data[$i]->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $data[$i]->{$extendField->field}); - if($message) - { - dao::$errors['message'][] = sprintf($message); - return false; - } } } @@ -423,6 +418,7 @@ class taskModel extends model $this->dao->insert(TABLE_TASK)->data($task) ->autoCheck() ->checkIF($task->estimate != '', 'estimate', 'float') + ->checkFlow() ->exec(); if(dao::isError()) return false; @@ -1049,6 +1045,7 @@ class taskModel extends model ->batchCheckIF($task->status == 'done', 'canceledBy, canceledDate', 'empty') ->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty') + ->checkFlow() ->where('id')->eq((int)$taskID)->exec(); if(!dao::isError()) @@ -1219,8 +1216,6 @@ class taskModel extends model if(is_array($task->{$extendField->field})) $task->{$extendField->field} = join(',', $task->{$extendField->field}); $task->{$extendField->field} = htmlSpecialString($task->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $task->{$extendField->field}); - if($message) return print(js::alert($message)); } if(isset($data->consumeds[$taskID])) @@ -1355,6 +1350,7 @@ class taskModel extends model ->batchCheckIF($task->status == 'done', 'canceledBy, canceledDate', 'empty') ->batchCheckIF($task->closedReason == 'cancel', 'finishedBy, finishedDate', 'empty') + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); if(dao::isError()) @@ -1472,6 +1468,7 @@ class taskModel extends model ->data($task) ->autoCheck() ->check('left', 'float') + ->checkFlow() ->where('id')->eq($taskID) ->exec(); @@ -1559,6 +1556,7 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($task) ->autoCheck() ->check('consumed,left', 'float') + ->checkFlow() ->where('id')->eq((int)$taskID)->exec(); if($oldTask->parent > 0) @@ -1830,6 +1828,7 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($task) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); @@ -1869,7 +1868,7 @@ class taskModel extends model ->remove('comment') ->get(); - $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); + $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->checkFlow()->where('id')->eq((int)$taskID)->exec(); if($oldTask->parent > 0) $this->updateParentStatus($taskID); @@ -1908,7 +1907,7 @@ class taskModel extends model ->remove('comment') ->get(); - $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); + $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->checkFlow()->where('id')->eq((int)$taskID)->exec(); if(!dao::isError()) { @@ -1953,7 +1952,7 @@ class taskModel extends model ->remove('comment') ->get(); - $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec(); + $this->dao->update(TABLE_TASK)->data($task)->autoCheck()->checkFlow()->where('id')->eq((int)$taskID)->exec(); if($oldTask->fromBug) $this->dao->update(TABLE_BUG)->set('toTask')->eq(0)->where('id')->eq($oldTask->fromBug)->exec(); if($oldTask->parent > 0) $this->updateParentStatus($taskID); if($oldTask->parent == '-1') @@ -2036,6 +2035,7 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->data($task) ->autoCheck() ->batchCheck($this->config->task->activate->requiredFields, 'notempty') + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); diff --git a/module/testcase/model.php b/module/testcase/model.php index 6316e0a981..c77e6dd6ca 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -64,7 +64,7 @@ class testcaseModel extends model /* Value of story may be showmore. */ $case->story = (int)$case->story; - $this->dao->insert(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->create->requiredFields, 'notempty')->exec(); + $this->dao->insert(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->create->requiredFields, 'notempty')->checkFlow()->exec(); if(!$this->dao->isError()) { $caseID = $this->dao->lastInsertID(); @@ -174,8 +174,6 @@ class testcaseModel extends model if(is_array($data[$i]->{$extendField->field})) $data[$i]->{$extendField->field} = join(',', $data[$i]->{$extendField->field}); $data[$i]->{$extendField->field} = htmlSpecialString($data[$i]->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $data[$i]->{$extendField->field}); - if($message) return print(js::alert($message)); } foreach(explode(',', $this->config->testcase->create->requiredFields) as $field) @@ -191,6 +189,7 @@ class testcaseModel extends model $this->dao->insert(TABLE_CASE)->data($case) ->autoCheck() ->batchCheck($this->config->testcase->create->requiredFields, 'notempty') + ->checkFlow() ->exec(); if(dao::isError()) @@ -738,7 +737,7 @@ class testcaseModel extends model array_splice($requiredFieldsArr, $fieldIndex, 1); $requiredFields = implode(',', $requiredFieldsArr); } - $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($requiredFields, 'notempty')->where('id')->eq((int)$caseID)->exec(); + $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->batchCheck($requiredFields, 'notempty')->checkFlow()->where('id')->eq((int)$caseID)->exec(); if(!$this->dao->isError()) { $isLibCase = ($oldCase->lib and empty($oldCase->product)); @@ -845,7 +844,7 @@ class testcaseModel extends model ->join('reviewedBy', ',') ->get(); - $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->where('id')->eq($caseID)->exec(); + $this->dao->update(TABLE_CASE)->data($case)->autoCheck()->checkFlow()->where('id')->eq($caseID)->exec(); if(dao::isError()) return false; @@ -970,8 +969,6 @@ class testcaseModel extends model if(is_array($case->{$extendField->field})) $case->{$extendField->field} = join(',', $case->{$extendField->field}); $case->{$extendField->field} = htmlSpecialString($case->{$extendField->field}); - $message = $this->checkFlowRule($extendField, $case->{$extendField->field}); - if($message) return print(js::alert($message)); } $cases[$caseID] = $case; @@ -986,6 +983,7 @@ class testcaseModel extends model $this->dao->update(TABLE_CASE)->data($case) ->autoCheck() ->batchCheck($this->config->testcase->edit->requiredFields, 'notempty') + ->checkFlow() ->where('id')->eq($caseID) ->exec(); diff --git a/module/testsuite/model.php b/module/testsuite/model.php index 9ddaf7a619..d3d60f92aa 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -71,6 +71,7 @@ class testsuiteModel extends model $suite = $this->loadModel('file')->processImgURL($suite, $this->config->testsuite->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_TESTSUITE)->data($suite) ->batchcheck($this->config->testsuite->create->requiredFields, 'notempty') + ->checkFlow() ->exec(); if(!dao::isError()) { @@ -158,6 +159,7 @@ class testsuiteModel extends model $this->dao->update(TABLE_TESTSUITE)->data($suite) ->autoCheck() ->batchcheck($this->config->testsuite->edit->requiredFields, 'notempty') + ->checkFlow() ->where('id')->eq($suiteID) ->exec(); if(!dao::isError()) diff --git a/module/testtask/model.php b/module/testtask/model.php index 8caf00e163..a216209699 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -44,6 +44,7 @@ class testtaskModel extends model ->checkIF($task->begin != '', 'begin', 'date') ->checkIF($task->end != '', 'end', 'date') ->checkIF($task->end != '', 'end', 'ge', $task->begin) + ->checkFlow() ->exec(); if(!dao::isError()) @@ -746,6 +747,7 @@ class testtaskModel extends model ->autoCheck() ->batchcheck($this->config->testtask->edit->requiredFields, 'notempty') ->checkIF($task->end != '', 'end', 'ge', $task->begin) + ->checkFlow() ->where('id')->eq($taskID) ->exec(); @@ -774,6 +776,7 @@ class testtaskModel extends model $this->dao->update(TABLE_TESTTASK)->data($testtask) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); @@ -811,6 +814,7 @@ class testtaskModel extends model $testtask = $this->loadModel('file')->processImgURL($testtask, $this->config->testtask->editor->close['id'], $this->post->uid); $this->dao->update(TABLE_TESTTASK)->data($testtask) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); @@ -838,6 +842,7 @@ class testtaskModel extends model $this->dao->update(TABLE_TESTTASK)->data($testtask) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); @@ -860,6 +865,7 @@ class testtaskModel extends model $this->dao->update(TABLE_TESTTASK)->data($testtask) ->autoCheck() + ->checkFlow() ->where('id')->eq((int)$taskID) ->exec(); diff --git a/test/class/block.class.php b/test/class/block.class.php index 361ec9ed9f..4e60bab388 100644 --- a/test/class/block.class.php +++ b/test/class/block.class.php @@ -254,7 +254,27 @@ class blockTest if(dao::isError()) return dao::getError(); - return $objects; + + $objects = json_decode($objects); + $return = ''; + foreach($objects as $type => $params) + { + $return .= "$type:{"; + foreach($params as $param => $paramValue) + { + if(is_object($paramValue)) + { + foreach($paramValue as $key => $value) $return .= "$key=>$value,"; + } + else + { + $return .= "$param:$paramValue,"; + } + } + $return = trim($return, ','); + $return .= '};'; + } + return $return; } /** diff --git a/test/class/mail.class.php b/test/class/mail.class.php new file mode 100644 index 0000000000..8b31b2cd3b --- /dev/null +++ b/test/class/mail.class.php @@ -0,0 +1,299 @@ +dao = $dao; + $this->tester = $tester; + $this->objectModel = $tester->loadModel('mail'); + } + + /** + * AutoDetect. + * + * @param int $email + * @access public + * @return object + */ + public function autoDetectTest($email) + { + $objects = $this->objectModel->autoDetect($email); + + if(dao::isError()) return dao::getError(); + if(!$objects->host) return '没有检测到相关信息'; + + return $objects; + } + + /** + * Get config from provider. + * + * @param int $domain + * @param int $username + * @access public + * @return object + */ + public function getConfigFromProviderTest($domain, $username) + { + $object = $this->objectModel->getConfigFromProvider($domain, $username); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Get config by MXRR. + * + * @param int $domain + * @param int $username + * @access public + * @return object + */ + public function getConfigByMXRRTest($domain, $username) + { + $object = $this->objectModel->getConfigByMXRR($domain, $username); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Get config by detecting SMTP. + * + * @param int $domain + * @param int $username + * @param int $port + * @access public + * @return object + */ + public function getConfigByDetectingSMTPTest($domain, $username, $port) + { + $object = $this->objectModel->getConfigByDetectingSMTP($domain, $username, $port); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Set MTA. + * + * @access public + * @return object + */ + public function setMTATest() + { + $object = $this->objectModel->setMTA(); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Set sendmail. + * + * @access public + * @return object + */ + public function setSendMailTest() + { + $object = $this->objectModel->setSendMail(); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + + /** + * Send. + * + * @param int $toList + * @param int $subject + * @param string $body + * @param string $ccList + * @param int $includeMe + * @param array $emails + * @access public + * @return object + */ + public function sendTest($toList, $subject, $body = '', $ccList = '', $includeMe = false, $emails = array()) + { + $object = $this->objectModel->send($toList, $subject, $body, $ccList, $includeMe, $emails); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Set CC. + * + * @param int $ccList + * @param int $emails + * @access public + * @return object + */ + public function setCCTest($ccList, $emails) + { + $this->objectModel->setCC($ccList, $emails); + + return $this->setMTATest(); + } + + /** + * Set subject. + * + * @param int $subject + * @access public + * @return object + */ + public function setSubjectTest($subject) + { + $this->objectModel->setSubject($subject); + + return $this->setMTATest(); + } + + /** + * Set body. + * + * @param int $body + * @access public + * @return object + */ + public function setBodyTest($body) + { + $this->objectModel->setBody($body); + + return $this->setMTATest(); + } + + /** + * Mail exist. + * + * @access public + * @return object + */ + public function mailExistTest() + { + $object = $this->objectModel->mailExist(); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Add queue. + * + * @param int $toList + * @param int $subject + * @param string $body + * @param string $ccList + * @param int $includeMe + * @access public + * @return object + */ + public function addQueueTest($toList, $subject, $body = '', $ccList = '', $includeMe = false) + { + $this->objectModel->addQueue($toList, $subject, $body, $ccList, $includeMe); + + if($toList and $subject) + { + $id = $this->dao->lastInsertID(); + $object = $this->dao->select('*')->from(TABLE_NOTIFY)->where('id')->eq($id)->fetch(); + } + + if(!$object) return '没有数据提交'; + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Get queue. + * + * @param string $status + * @param string $orderBy + * @param int $pager + * @access public + * @return object + */ + public function getQueueTest($status = '', $orderBy = 'id_desc', $pager = null) + { + $objects = $this->objectModel->getQueue($status = '', $orderBy = 'id_desc', $pager = null); + + if(dao::isError()) return dao::getError(); + + return $objects; + } + + /** + * Get queue by id. + * + * @param int $queueID + * @access public + * @return object + */ + public function getQueueByIdTest($queueID) + { + $object = $this->objectModel->getQueueById($queueID); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Merge mails. + * + * @param int $user + * @access public + * @return object + */ + public function mergeMailsTest($user) + { + $mails = $this->dao->select('*')->from(TABLE_NOTIFY) + ->where('objectType')->eq('mail') + ->andWhere('toList')->eq($user) + ->fetchAll(); + + $object = $this->objectModel->mergeMails($mails); + + if(dao::isError()) return dao::getError(); + + return $object; + } + + /** + * Get subject. + * + * @param int $objectType + * @param int $object + * @param int $title + * @param int $actionType + * @access public + * @return object + */ + public function getSubjectTest($objectType, $object, $title, $actionType) + { + $object = $this->tester->loadModel($objectType)->getByID($object); + $object = $this->objectModel->getSubject($objectType, $object, $title, $actionType); + + if(dao::isError()) return dao::getError(); + + return $object; + } +} diff --git a/test/data/user.yaml b/test/data/user.yaml index 16e537f0bd..f1f96e460b 100644 --- a/test/data/user.yaml +++ b/test/data/user.yaml @@ -80,9 +80,9 @@ fields: note: "邮箱" fields: - field: email1 - range: 100-999:R + range: 1000-9999:2 - field: email2 - range: 100-999:R + range: 1000-9999:2 - field: email3 range: [@qq.com,@163.com,@gmail.com] - field: skype diff --git a/test/model/block/getprojectparams.php b/test/model/block/getprojectparams.php index 473a3b6208..89088ad4ab 100755 --- a/test/model/block/getprojectparams.php +++ b/test/model/block/getprojectparams.php @@ -10,10 +10,10 @@ title=测试 blockModel->getProjectParams(); cid=1 pid=1 - +获取计划参数 >> {"type":{"name":"\u7c7b\u578b","options":{"all":"\u6240\u6709","doing":"\u8fdb\u884c\u4e2d","wait":"\u672a\u5f00\u59cb","suspended":"\u5df2\u6302\u8d77","closed":"\u5df2\u5173\u95ed"},"control":"select"},"orderBy":{"name":"\u6392\u5e8f","options":{"id_asc":"ID \u9012\u589e","id_desc":"ID \u9012\u51cf","status_asc":"\u72b6\u6001\u6b63\u5e8f","status_desc":"\u72b6\u6001\u5012\u5e8f"},"control":"select"},"count":{"name":"\u6570\u91cf","default":20,"control":"input"}} */ $block = new blockTest(); -r($block->getProjectParamsTest()) && p() && e(); \ No newline at end of file +r($block->getProjectParamsTest()) && p() && e('{"type":{"name":"\u7c7b\u578b","options":{"all":"\u6240\u6709","doing":"\u8fdb\u884c\u4e2d","wait":"\u672a\u5f00\u59cb","suspended":"\u5df2\u6302\u8d77","closed":"\u5df2\u5173\u95ed"},"control":"select"},"orderBy":{"name":"\u6392\u5e8f","options":{"id_asc":"ID \u9012\u589e","id_desc":"ID \u9012\u51cf","status_asc":"\u72b6\u6001\u6b63\u5e8f","status_desc":"\u72b6\u6001\u5012\u5e8f"},"control":"select"},"count":{"name":"\u6570\u91cf","default":20,"control":"input"}}'); //获取计划参数 \ No newline at end of file diff --git a/test/model/block/getprojectteamparams.php b/test/model/block/getprojectteamparams.php index 056ec1c387..ef5c0e3349 100755 --- a/test/model/block/getprojectteamparams.php +++ b/test/model/block/getprojectteamparams.php @@ -10,10 +10,10 @@ title=测试 blockModel->getProjectTeamParams(); cid=1 pid=1 - +测试获取项目团队 >> type:{name:类型,all=>所有,doing=>进行中,wait=>未开始,suspended=>已挂起,closed=>已关闭,control:select};orderBy:{name:排序,id_asc=>ID 递增,id_desc=>ID 递减,status_asc=>状态正序,status_desc=>状态倒序,control:select};count:{name:数量,default:20,control:input}; */ $block = new blockTest(); -r($block->getProjectTeamParamsTest()) && p() && e(); \ No newline at end of file +r($block->getProjectTeamParamsTest()) && p() && e('type:{name:类型,all=>所有,doing=>进行中,wait=>未开始,suspended=>已挂起,closed=>已关闭,control:select};orderBy:{name:排序,id_asc=>ID 递增,id_desc=>ID 递减,status_asc=>状态正序,status_desc=>状态倒序,control:select};count:{name:数量,default:20,control:input};'); // 测试获取项目团队 diff --git a/test/model/mail/addqueue.php b/test/model/mail/addqueue.php new file mode 100644 index 0000000000..f374cf31cd --- /dev/null +++ b/test/model/mail/addqueue.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +addQueue(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$result1 = $mail->addQueueTest('',''); +$result2 = $mail->addQueueTest('user3', '测试提交队列', '测试发信内容'); +$result3 = $mail->addQueueTest('user3,admin', '测试提交队列', '测试发信内容'); +$result4 = $mail->addQueueTest('user3,admin', '测试提交队列', '测试发信内容', '', true); + +r($result1) && p() && e('没有数据提交'); //提交数据为空时 +r($result2) && p('subject') && e('测试提交队列'); //获取添加的邮件主题 +r($result3) && p('toList') && e('user3'); //获取收件人列表不包含自己 +r($result4) && p('toList') && e('user3,admin'); //获取收件人列表包含自己 diff --git a/test/model/mail/autodetect.php b/test/model/mail/autodetect.php new file mode 100644 index 0000000000..df019977f5 --- /dev/null +++ b/test/model/mail/autodetect.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +autoDetect(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$data = array('test@qq.com', 'test@163.com', 'test@sohu.com', 'test@vip.sohu.com', 'testm'); + +r($mail->autoDetectTest($data[0])) && p('host') && e('smtp.qq.com'); //检测qq邮箱信息 +r($mail->autoDetectTest($data[1])) && p('host') && e('smtp.163.com'); //检测163邮箱信息 +r($mail->autoDetectTest($data[2])) && p('host') && e('smtp.sohu.com'); //检测搜狐邮箱信息 +r($mail->autoDetectTest($data[3])) && p('host') && e('smtp.vip.sohu.com'); //检测搜狐vip邮箱信息 +r($mail->autoDetectTest($data[4])) && p() && e('没有检测到相关信息'); //检测不存在的邮箱服务商信息 diff --git a/test/model/mail/getconfigbydetectingsmtp.php b/test/model/mail/getconfigbydetectingsmtp.php new file mode 100644 index 0000000000..9240d80afa --- /dev/null +++ b/test/model/mail/getconfigbydetectingsmtp.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getConfigByDetectingSMTP(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$result1 = $mail->getConfigByDetectingSMTPTest('qq.com','122@qq.com',465); +$result2 = $mail->getConfigByDetectingSMTPTest('qq.com','122@qq.com',465); +$result3 = $mail->getConfigByDetectingSMTPTest('qq.com','122@qq.com',22); +$result4 = $mail->getConfigByDetectingSMTPTest('testqq.com','122@qq.com',22); + +r($result1) && p('host') && e('smtp.qq.com'); //根据域名获取smtp +r($result2) && p('secure') && e('ssl'); //根据域名获取secure +r($result3) && p('secure') && e('0'); //当端口号不为465时获取secure +r($result4) && p() && e('0'); //当域名不存在时 diff --git a/test/model/mail/getconfigbymxrr.php b/test/model/mail/getconfigbymxrr.php new file mode 100644 index 0000000000..4954701b39 --- /dev/null +++ b/test/model/mail/getconfigbymxrr.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getConfigByMXRR(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$result1 = $mail->getConfigByMXRRTest('qq.com','test'); +$result2 = $mail->getConfigByMXRRTest('sohu.com','test'); + +r($result1) && p('host') && e('smtp.qq.com'); //获取qq相关信息 +r($result2) && p('host') && e('smtp.sohu.com'); //获取sohu相关信息 diff --git a/test/model/mail/getconfigfromprovider.php b/test/model/mail/getconfigfromprovider.php new file mode 100644 index 0000000000..bf51755547 --- /dev/null +++ b/test/model/mail/getconfigfromprovider.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getConfigFromProvider(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$result1 = $mail->getConfigFromProviderTest('qq.com','123'); +$result2 = $mail->getConfigFromProviderTest('sohu.com','123'); + +r($result1) && p('host') && e('smtp.qq.com'); //获取qq相关信息 +r($result2) && p('host') && e('smtp.sohu.com'); //获取sohu相关信息 diff --git a/test/model/mail/getqueue.php b/test/model/mail/getqueue.php new file mode 100644 index 0000000000..e8dde37f52 --- /dev/null +++ b/test/model/mail/getqueue.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getQueue(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$result1 = count($mail->getQueueTest()); +$result2 = count($mail->getQueueTest('fail')); +$result3 = count($mail->getQueueTest('wait')); +$result4 = $mail->getQueueTest('wait'); + +r($result1) && p() && e('7'); //按照收件人分组获取邮件列表个数 +r($result2) && p() && e('7'); //按照收件人分组获取发送失败的邮件数量 +r($result3) && p() && e('7'); //按照收件人分组获取待发送的邮件数量 +r($result4) && p('0:data') && e('测试发信内容'); //按照收件人分组获取第一条待发送的邮件内容 diff --git a/test/model/mail/getqueuebyid.php b/test/model/mail/getqueuebyid.php new file mode 100644 index 0000000000..cf6ef9ac90 --- /dev/null +++ b/test/model/mail/getqueuebyid.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +getQueueById(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$queueID = array(1,10,0); + +r($mail->getQueueByIdTest($queueID[0])) && p('subject') && e('主题1'); //获取id为1的邮件主题 +r($mail->getQueueByIdTest($queueID[1])) && p('toList') && e('top10'); //获取id为10的收件人 +r($mail->getQueueByIdTest($queueID[2])) && p() && e('0'); //获取id不存在的邮件信息 diff --git a/test/model/mail/getsubject.php b/test/model/mail/getsubject.php new file mode 100644 index 0000000000..b6279cdba7 --- /dev/null +++ b/test/model/mail/getsubject.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +getSubject(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +$result1 = $mail->getSubjectTest('testtask', 1, '123', 'closed'); +$result2 = $mail->getSubjectTest('doc', 1, 'test', 'created'); +$result3 = $mail->getSubjectTest('story', 1, 'test', 'created'); +$result4 = $mail->getSubjectTest('task', 1, 'test', 'created'); +$result5 = $mail->getSubjectTest('bug', 1, 'test', 'created'); + +r($result1) && p() && e('admin关闭了测试单 #1:测试单1'); //获取关闭测试单时邮件主题 +r($result2) && p() && e('admin创建了文档 #1:文档标题901'); //获取创建文档时的邮件主题 +r($result3) && p() && e('STORY #1 test - 正常产品1'); //获取操作需求时的邮件主题 +r($result4) && p() && e('TASK #1 test - 迭代1'); //获取操作任务时的邮件主题 +r($result5) && p() && e('BUG #1 test - 正常产品1'); //获取操作BUG时的邮件主题 diff --git a/test/model/mail/mailexist.php b/test/model/mail/mailexist.php new file mode 100644 index 0000000000..58b0075cd8 --- /dev/null +++ b/test/model/mail/mailexist.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +mailExist(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +r($mail->mailExistTest()) && p('email') && e('10001000@qq.com'); //检查系统是否至少存在邮件 diff --git a/test/model/mail/mergemails.php b/test/model/mail/mergemails.php new file mode 100644 index 0000000000..d48ae69688 --- /dev/null +++ b/test/model/mail/mergemails.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +mergeMails(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +r($mail->mergeMailsTest('admin')) && p('id') && e('6,1'); //获取邮件合并后的id +r($mail->mergeMailsTest('admin')) && p('subject') && e('主题6|主题1'); //获取邮件合并后的主题 diff --git a/test/model/mail/send.php b/test/model/mail/send.php new file mode 100644 index 0000000000..679584cc87 --- /dev/null +++ b/test/model/mail/send.php @@ -0,0 +1,41 @@ +#!/usr/bin/env php +send(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +/* If you don't set SMTP Please input you SMTP setting. */ +$mailConfig = new stdclass(); +$mailConfig->smtp = new stdclass(); + +$mailConfig->turnon = 1; +$mailConfig->mta = 'smtp'; +$mailConfig->async = 0; +$mailConfig->fromAddress = ''; +$mailConfig->fromName = ''; +$mailConfig->domain = ''; +$mailConfig->smtp->host = ''; +$mailConfig->smtp->port = ''; +$mailConfig->smtp->auth = '1'; +$mailConfig->smtp->username = ''; +$mailConfig->smtp->password = ''; +$mailConfig->smtp->secure = ''; +$mailConfig->smtp->debug = 1; +$mailConfig->smtp->charset = 'utf-8'; + +global $tester; +if(!isset($tester->config->mail->turnon)) $tester->loadModel('setting')->setItems('system.mail', $mailConfig); + +$result1 = $mail->sendTest('admin','test','test','',true); + +r($result1) && p() && e('0'); diff --git a/test/model/mail/sendmail.php b/test/model/mail/sendmail.php new file mode 100644 index 0000000000..fcc4fca854 --- /dev/null +++ b/test/model/mail/sendmail.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +sendmail(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +r($mail->sendmailTest(48,48)) && p() && e('0'); //测试为dev4用户发送邮件通知 diff --git a/test/model/mail/setbody.php b/test/model/mail/setbody.php new file mode 100644 index 0000000000..6a7e73e688 --- /dev/null +++ b/test/model/mail/setbody.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +setCC(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +r($mail->setBodyTest('test body')) && p('Body') && e('test body'); //测试设置内容 diff --git a/test/model/mail/setmta.php b/test/model/mail/setmta.php new file mode 100644 index 0000000000..3fe819cb15 --- /dev/null +++ b/test/model/mail/setmta.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +setCC(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +r($mail->setMTATest()) && p('Host') && e('localhost'); //获取MTA主机 +r($mail->setMTATest()) && p('SMTPDebug') && e('0'); //获取MTAdebug设置 diff --git a/test/model/mail/setsubject.php b/test/model/mail/setsubject.php new file mode 100644 index 0000000000..41be42134c --- /dev/null +++ b/test/model/mail/setsubject.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +setCC(); +cid=1 +pid=1 + +*/ + +$mail = new mailTest(); + +r($mail->setSubjectTest('test subject')) && p('Subject') && e('test subject'); //测试设置主题 diff --git a/test/ztest b/test/ztest index 7eb3023bb7..2770206cc8 100755 --- a/test/ztest +++ b/test/ztest @@ -153,6 +153,9 @@ switch($argv[1]) case 'tutorial': ztfRun('model/tutorial'); break; + case 'mail': + ztfRun('model/mail'); + break; case 'tree': ztfRun('model/tree'); break;