diff --git a/db/update16.5.sql b/db/update16.5.sql index 37934ad6c2..cc8ec8e1e1 100644 --- a/db/update16.5.sql +++ b/db/update16.5.sql @@ -103,3 +103,169 @@ UPDATE `zt_workflowfield` SET `control` = 'datetime' WHERE `module` = 'story' an UPDATE `zt_workflowfield` SET `control` = 'date' WHERE `module` = 'story' and `field` = 'reviewedDate'; UPDATE `zt_workflowfield` SET `control` = 'datetime' WHERE `module` = 'story' and `field` = 'closedDate'; UPDATE `zt_workflowfield` SET `control` = 'radio' WHERE `module` = 'story' and `field` = 'deleted'; + +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'; \ No newline at end of file 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 c7666ca0db..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); @@ -320,7 +326,7 @@ class control extends baseControl if(!isset($this->config->bizVersion)) return false; $moduleName = $this->moduleName; - if($moduleName == 'bug' || $moduleName == 'feedback') return $this->$moduleName->buildOperateMenu($object, $type); + if(strpos(',bug,feedback,caselib,testsuite,testtask,testcase,product,', ",{$moduleName},") !== false) return $this->$moduleName->buildOperateMenu($object, $type); $flow = $this->loadModel('workflow')->getByModule($moduleName); return $this->loadModel('flow')->buildOperateMenu($flow, $object, $type); @@ -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/model.class.php b/framework/model.class.php index 267fbc1edf..be9480d01f 100644 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -83,7 +83,15 @@ class model extends baseModel if(isset($this->config->bizVersion)) { static $actions; - if(empty($actions)) $actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)->where('module')->eq($moduleName)->andWhere('buildin')->eq('1')->andWhere('status')->eq('enable')->fetchAll('action'); + if(empty($actions)) + { + $actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION) + ->where('module')->eq($moduleName) + ->andWhere('buildin')->eq('1') + ->andWhere('status')->eq('enable') + ->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi() + ->fetchAll('action'); + } } $enabled = true; @@ -133,7 +141,16 @@ class model extends baseModel if(strpos($module, '.') !== false) list($appName, $moduleName) = explode('.', $module); static $actions; - if(empty($actions)) $actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)->where('module')->eq($moduleName)->andWhere('buildin')->eq('0')->andWhere('status')->eq('enable')->orderBy('order_asc')->fetchAll(); + if(empty($actions)) + { + $actions = $this->dao->select('*')->from(TABLE_WORKFLOWACTION) + ->where('module')->eq($moduleName) + ->andWhere('buildin')->eq('0') + ->andWhere('status')->eq('enable') + ->beginIF(!empty($this->config->vision))->andWhere('vision')->eq($this->config->vision)->fi() + ->orderBy('order_asc') + ->fetchAll(); + } $menu = ''; if($show) 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 12470e3b52..bbdd5e2ee2 100644 --- a/module/caselib/model.php +++ b/module/caselib/model.php @@ -595,4 +595,65 @@ class caselibModel extends model } } } + + /** + * Build case lib menu. + * + * @param object $object + * @param string $type + * @access public + * @return string + */ + public function buildOperateMenu($object, $type = 'view') + { + $function = 'buildOperate' . ucfirst($type) . 'Menu'; + return $this->$function($object); + } + + /** + * Build case lib view menu. + * + * @param object $lib + * @access public + * @return string + */ + public function buildOperateViewMenu($lib) + { + if($lib->deleted) return ''; + + $menu = ''; + $params = "libID=$lib->id"; + $menu .= $this->buildFlowMenu('caselib', $lib, 'view', 'direct'); + $menu .= "
"; + $menu .= $this->buildMenu('caselib', 'edit', $params, $lib, 'view'); + $menu .= $this->buildMenu('caselib', 'delete', $params, $lib, 'view', 'trash', 'hiddenwin'); + + return $menu; + } + + /** + * Build case lib browse menu. + * + * @param object $case + * @access public + * @return string + */ + public function buildOperateBrowseMenu($case) + { + $menu = ''; + $params = "caseID=$case->id"; + + if($this->config->testcase->needReview || !empty($this->config->testcase->forceReview)) + { + $menu .= $this->buildMenu('testcase', 'review', $params, $case, 'browse', 'glasses', '', 'iframe'); + } + $menu .= $this->buildMenu('testcase', 'edit', $params, $case, 'browse'); + if(common::hasPriv('testcase', 'delete')) + { + $deleteURL = helper::createLink('testcase', 'delete', "$params&confirm=yes"); + $menu .= html::a("javascript:ajaxDelete(\"$deleteURL\", \"caseList\", confirmDelete)", '', '', "title='{$this->lang->testcase->delete}' class='btn'"); + } + + return $menu; + } } diff --git a/module/caselib/view/browse.html.php b/module/caselib/view/browse.html.php index 5fc8f8174d..35101bfe14 100644 --- a/module/caselib/view/browse.html.php +++ b/module/caselib/view/browse.html.php @@ -157,15 +157,7 @@ js::set('flow', $config->global->flow); processStatus('testcase', $case);?> " . $this->loadModel('flow')->getFieldValue($extendField, $case) . "";?> - testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'glasses', '', 'iframe'); - common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); - if(common::hasPriv('testcase', 'delete')) - { - $deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"caseList\", confirmDelete)", '', '', "title='{$lang->testcase->delete}' class='btn'"); - } - ?> + buildOperateMenu($case, 'browse');?> diff --git a/module/caselib/view/view.html.php b/module/caselib/view/view.html.php index 1d3b1dc160..868c67dccc 100644 --- a/module/caselib/view/view.html.php +++ b/module/caselib/view/view.html.php @@ -37,15 +37,9 @@
- deleted) - { - echo "
"; - common::printIcon('caselib', 'edit', "libID=$lib->id"); - common::printIcon('caselib', 'delete', "libID=$lib->id", '', 'button', 'trash', 'hiddenwin'); - } - ?> + +
";?> + buildOperateMenu($lib, 'view');?>
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 4d2e28feba..507ddfe98a 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -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 2f1239d04d..aa01af3093 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -2022,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/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/testcase/model.php b/module/testcase/model.php index b8bc0a7575..c77e6dd6ca 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1713,22 +1713,8 @@ class testcaseModel extends model echo $case->stepNumber; break; case 'actions': - if($canBeChanged) - { - if($case->needconfirm or $browseType == 'needconfirm') - { - common::printIcon('testcase', 'confirmstorychange', "caseID=$case->id", $case, 'list', 'confirm', 'hiddenwin', '', '', '', $this->lang->confirm); - break; - } - - common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', '', '', 'iframe', true, "data-width='95%'"); - common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); - common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); - if($this->config->testcase->needReview or !empty($this->config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'glasses', '', 'iframe'); - common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe', '', "data-width='90%'"); - common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); - } - + $case->browseType = $browseType; + echo $this->buildOperateMenu($case, 'browse'); break; } echo ''; @@ -2014,4 +2000,116 @@ class testcaseModel extends model return ''; } + + /** + * Build test case menu. + * + * @param object $case + * @param string $type + * @access public + * @return string + */ + public function buildOperateMenu($case, $type = 'view') + { + $function = 'buildOperate' . ucfirst($type) . 'Menu'; + return $this->$function($case); + } + + /** + * Build test case view menu. + * + * @param object $case + * @access public + * @return string + */ + public function buildOperateViewMenu($case) + { + if($case->deleted) return ''; + + $menu = ''; + $params = "caseID=$case->id"; + $extraParams = "runID=$case->runID&$params"; + if(!$case->needconfirm) + { + if(!$case->isLibCase) + { + if($this->app->getViewType() == 'xhtml') + { + $menu .= $this->buildMenu('testtask', 'runCase', "$extraParams&version=$case->currentVersion", $case, 'view', 'play', '', 'showinonlybody', false, "data-width='95%'"); + $menu .= $this->buildMenu('testtask', 'results', "$extraParams&version=$case->version", $case, 'view', '', '', 'showinonlybody', false, "data-width='95%'"); + } + else + { + $menu .= $this->buildMenu('testtask', 'runCase', "$extraParams&version=$case->currentVersion", $case, 'view', 'play', '', 'showinonlybody iframe', false, "data-width='95%'"); + $menu .= $this->buildMenu('testtask', 'results', "$extraParams&version=$case->version", $case, 'view', '', '', 'showinonlybody iframe', false, "data-width='95%'"); + } + if($case->caseFails > 0) + { + $menu .= $this->buildMenu('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=$params,version=$case->version,runID=$case->runID", $case, 'view', 'bug', '', 'iframe', '', "data-width='90%'"); + } + } + if($this->config->testcase->needReview || !empty($this->config->testcase->forceReview)) + { + $menu .= $this->buildMenu('testcase', 'review', $params, $case, 'view', '', '', 'iframe', '', '', $this->lang->testcase->reviewAB); + } + } + else + { + $menu .= $this->buildMenu('testcase', 'confirmstorychange', $params, $case, 'view', 'confirm', 'hiddenwin', '', '', '', $this->lang->confirm); + } + + $menu .= "
    "; + $menu .= $this->buildFlowMenu('testcase', $case, 'view', 'direct'); + $menu .= "
    "; + + if(!$case->needconfirm) + { + if(!isonlybody()) $menu .= $this->buildMenu('testcase', 'edit', $params, $case, 'view', '', '', 'showinonlybody'); + if(!$case->isLibCase && $case->auto != 'unit') + { + $menu .= $this->buildMenu('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'view', 'copy'); + } + if($case->isLibCase && common::hasPriv('caselib', 'createCase')) + { + echo html::a(helper::createLink('caselib', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id"), "", '', "class='btn' title='{$this->lang->testcase->copy}'"); + } + + $menu .= $this->buildMenu('testcase', 'delete', $params, $case, 'view', 'trash', 'hiddenwin', ''); + } + + return $menu; + } + + /** + * Build test case browse menu. + * + * @param object $case + * @access public + * @return string + */ + public function buildOperateBrowseMenu($case) + { + $canBeChanged = common::canBeChanged('case', $case); + if(!$canBeChanged) return ''; + + $menu = ''; + $params = "caseID=$case->id"; + + if($case->needconfirm || $case->browseType == 'needconfirm') + { + return $this->buildMenu('testcase', 'confirmstorychange', $params, $case, 'browse', 'confirm', 'hiddenwin', '', '', '', $this->lang->confirm); + } + + $menu .= $this->buildMenu('testtask', 'results', "runID=0&$params", $case, 'browse', '', '', 'iframe', true, "data-width='95%'"); + $menu .= $this->buildMenu('testtask', 'runCase', "runID=0&$params&version=$case->version", $case, 'browse', 'play', '', 'runCase iframe', false, "data-width='95%'"); + $menu .= $this->buildMenu('testcase', 'edit', "caseID=$case->id", $case, 'browse'); + if($this->config->testcase->needReview || !empty($this->config->testcase->forceReview)) + { + common::printIcon('testcase', 'review', $params, $case, 'browse', 'glasses', '', 'iframe'); + } + $menu .= $this->buildMenu('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'browse', 'bug', '', 'iframe', '', "data-width='90%'"); + $menu .= $this->buildMenu('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'browse', 'copy'); + + return $menu; + } } diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 37a3ad7e13..28a613dd52 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -112,41 +112,11 @@
    - deleted):?>
    ";?> - needconfirm):?> -
    "; - if($this->app->getViewType() == 'xhtml') - { - common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", $case, 'button', 'play', '', 'showinonlybody', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'showinonlybody', false, "data-width='95%'"); - } - else - { - common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", $case, 'button', 'play', '', 'showinonlybody iframe', false, "data-width='95%'"); - common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'showinonlybody iframe', false, "data-width='95%'"); - } - - if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", $case, 'button', 'bug', '', 'iframe', '', "data-width='90%'"); - } - if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', '', '', 'iframe', '', '', $lang->testcase->reviewAB); - ?> - + isLibCase = $isLibCase;?> + caseFails = $caseFails;?> + runID = $runID;?> buildOperateMenu($case, 'view');?> - - id", $case, 'button', '', '', 'showinonlybody'); - if(!$isLibCase and $case->auto != 'unit') common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'button', 'copy'); - if($isLibCase and common::hasPriv('caselib', 'createCase')) echo html::a($this->createLink('caselib', 'createCase', "libID=$case->lib&moduleID=$case->module¶m=$case->id"), "", '', "class='btn' title='{$lang->testcase->copy}'"); - common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', 'trash', 'hiddenwin', ''); - ?> - needconfirm):?> - id", $case, 'list', 'confirm', 'hiddenwin', '', '', '', $this->lang->confirm);?> - - diff --git a/module/testsuite/model.php b/module/testsuite/model.php index b0a9708dca..d3d60f92aa 100644 --- a/module/testsuite/model.php +++ b/module/testsuite/model.php @@ -327,4 +327,27 @@ class testsuiteModel extends model ->page($pager) ->fetchAll('id'); } + + + /** + * Build testsuite menu. + * + * @param object $suite + * @param string $type + * @access public + * @return string + */ + public function buildOperateMenu($suite, $type = 'view') + { + $menu = ''; + $params = "suiteID=$suite->id"; + + if($type == 'view') $menu .= $this->buildFlowMenu('testsuite', $suite, $type, 'direct'); + + $menu .= $this->buildMenu('testsuite', 'linkCase', $params, $suite, $type, 'link', '', '', '', '', $this->lang->testsuite->linkCase); + $menu .= $this->buildMenu('testsuite', 'edit', $params, $suite, $type); + $menu .= $this->buildMenu('testsuite', 'delete', $params, $suite, $type, 'trash', 'hiddenwin'); + + return $menu; + } } diff --git a/module/testsuite/view/browse.html.php b/module/testsuite/view/browse.html.php index a4d24ca90e..70fd6b4070 100644 --- a/module/testsuite/view/browse.html.php +++ b/module/testsuite/view/browse.html.php @@ -70,11 +70,7 @@ addedDate;?> " . $this->loadModel('flow')->getFieldValue($extendField, $suite) . "";?> - id", $suite, 'list', 'link'); - common::printIcon('testsuite', 'edit', "suiteID=$suite->id", $suite, 'list'); - common::printIcon('testsuite', 'delete', "suiteID=$suite->id", $suite, 'list', 'trash', 'hiddenwin'); - ?> + buildOperateMenu($suite, 'browse');?> diff --git a/module/testsuite/view/view.html.php b/module/testsuite/view/view.html.php index b3e3faf113..6a44d631bc 100644 --- a/module/testsuite/view/view.html.php +++ b/module/testsuite/view/view.html.php @@ -32,10 +32,6 @@ if(!$suite->deleted and $canBeChanged) { echo $this->buildOperateMenu($suite, 'view'); - - common::printLink('testsuite', 'linkCase', "suiteID=$suite->id", " " . '', '', "class='btn btn-link' title='{$lang->testsuite->linkCase}'"); - common::printIcon('testsuite', 'edit', "suiteID=$suite->id"); - common::printIcon('testsuite', 'delete', "suiteID=$suite->id", '', 'button', 'trash', 'hiddenwin'); } ?> diff --git a/module/testtask/model.php b/module/testtask/model.php index b573fc2f85..a216209699 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -2166,4 +2166,76 @@ class testtaskModel extends model return array('suites' => $suites, 'cases' => $cases, 'results' => $results, 'suiteNames' => $suiteNames, 'caseTitles' => $caseTitles); } + + /** + * Build test task menu. + * + * @param object $task + * @param string $type + * @access public + * @return string + */ + public function buildOperateMenu($task, $type = 'view') + { + $function = 'buildOperate' . ucfirst($type) . 'Menu'; + return $this->$function($task); + } + + /** + * Build test task view menu. + * + * @param object $task + * @access public + * @return string + */ + public function buildOperateViewMenu($task) + { + if($task->deleted) return ''; + + $menu = ''; + $params = "taskID=$task->id"; + + $menu .= $this->buildMenu('testtask', 'start', $params, $task, 'view', '', '', 'iframe showinonlybody', true); + $menu .= $this->buildMenu('testtask', 'close', $params, $task, 'view', '', '', 'iframe showinonlybody', true); + $menu .= $this->buildMenu('testtask', 'block', $params, $task, 'view', 'pause', '', 'iframe showinonlybody', true); + $menu .= $this->buildMenu('testtask', 'activate', $params, $task, 'view', 'magic', '', 'iframe showinonlybody', true); + $menu .= $this->buildMenu('testtask', 'cases', $params, $task, 'view', 'sitemap'); + $menu .= $this->buildMenu('testtask', 'linkCase', $params, $task, 'view', 'link'); + + $menu .= "
    "; + $menu .= $this->buildFlowMenu('testtask', $task, 'view', 'direct'); + $menu .= "
    "; + + $menu .= $this->buildMenu('testtask', 'edit', $params, $task, 'view'); + $menu .= $this->buildMenu('testtask', 'delete', $params, $task, 'view', 'trash', 'hiddenwin'); + + return $menu; + } + + /** + * Build test task browse menu. + * + * @param object $task + * @access public + * @return string + */ + public function buildOperateBrowseMenu($task) + { + $menu = ''; + $params = "taskID=$task->id"; + + $menu .= '
    '; + $menu .= $this->buildMenu('testtask', 'cases', $params, $task, 'browse', 'sitemap'); + $menu .= $this->buildMenu('testtask', 'linkCase', "$params&type=all¶m=myQueryID", $task, 'browse', 'link'); + $menu .= $this->buildMenu('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'browse', 'flag'); + $menu .= '
    '; + $menu .= $this->buildMenu('testtask', 'view', $params, $task, 'browse', 'list-alt', '', 'iframe', true, "data-width='90%'"); + $menu .= $this->buildMenu('testtask', 'edit', $params, $task, 'browse'); + if(common::hasPriv('testtask', 'delete', $task)) + { + $deleteURL = helper::createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); + $menu .= html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "title='{$this->lang->testtask->delete}' class='btn'"); + } + return $menu; + } } diff --git a/module/testtask/view/browse.html.php b/module/testtask/view/browse.html.php index 74b54c4461..e417cb11f6 100644 --- a/module/testtask/view/browse.html.php +++ b/module/testtask/view/browse.html.php @@ -102,20 +102,7 @@ $status = $this->session->testTaskVersionStatus; " . $this->loadModel('flow')->getFieldValue($extendField, $task) . "";?> - '; - common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'list', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id&type=all¶m=myQueryID", $task, 'list', 'link'); - common::printIcon('testreport', 'browse', "objectID=$task->product&objectType=product&extra=$task->id", $task, 'list', 'flag'); - echo ''; - common::printIcon('testtask', 'view', "taskID=$task->id", '', 'list', 'list-alt', '', 'iframe', true, "data-width='90%'"); - common::printIcon('testtask', 'edit', "taskID=$task->id", $task, 'list'); - if(common::hasPriv('testtask', 'delete', $task)) - { - $deleteURL = $this->createLink('testtask', 'delete', "taskID=$task->id&confirm=yes"); - echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"taskList\",confirmDelete)", '', '', "title='{$lang->testtask->delete}' class='btn'"); - } - ?> + buildOperateMenu($task, 'browse');?> diff --git a/module/testtask/view/view.html.php b/module/testtask/view/view.html.php index 14fa49a23d..7324b9d56e 100644 --- a/module/testtask/view/view.html.php +++ b/module/testtask/view/view.html.php @@ -50,25 +50,8 @@
    ' . $lang->goback, '', 'btn btn-secondary');?> - deleted):?>
    - id", $task, 'button', '', '', 'iframe showinonlybody', true); - common::printIcon('testtask', 'close', "taskID=$task->id", $task, 'button', '', '', 'iframe showinonlybody', true); - common::printIcon('testtask', 'block', "taskID=$task->id", $task, 'button', 'pause', '', 'iframe showinonlybody', true); - common::printIcon('testtask', 'activate', "taskID=$task->id", $task, 'button', 'magic', '', 'iframe showinonlybody', true); - common::printIcon('testtask', 'cases', "taskID=$task->id", $task, 'button', 'sitemap'); - common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'button', 'link'); - ?> - buildOperateMenu($task, 'view');?> - -
    - id", $task); - common::printIcon('testtask', 'delete', "taskID=$task->id", $task, 'button', 'trash', 'hiddenwin'); - ?> -
    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/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;