diff --git a/app/classes/IssueFilterLogic.php b/app/classes/IssueFilterLogic.php
index 3423e7374..14560ea91 100644
--- a/app/classes/IssueFilterLogic.php
+++ b/app/classes/IssueFilterLogic.php
@@ -287,7 +287,7 @@ public function getList($page = 1, $pageSize = 50)
$followIssueIdArr[] = $issueFollow['issue_id'];
}
$followIssueIdArr = array_unique($followIssueIdArr);
- if(!empty($followIssueIdArr)){
+ if (!empty($followIssueIdArr)) {
$issueIdStr = implode(',', $followIssueIdArr);
$sql .= " AND id in ({$issueIdStr})";
}
@@ -412,6 +412,175 @@ public function getList($page = 1, $pageSize = 50)
}
}
+ /**
+ * 高级查询
+ * @param int $page
+ * @param int $pageSize
+ * @return array
+ * @throws \Exception
+ */
+ public function getAdvQueryList($page = 1, $pageSize = 50)
+ {
+ // sys_filter=1&fav_filter=2&project=2&reporter=2&title=fdsfdsfsd&assignee=2&created_start=232131&update_start=43432&sort_by=&32323&mod=123&reporter=12&priority=2&status=23&resolution=2
+ $params = [];
+ $sql = " WHERE 1";
+
+ // 项目筛选
+ $projectId = null;
+ if (isset($_GET['project']) && !empty($_GET['project'])) {
+ $projectId = (int)$_GET['project'];
+ $sql .= " AND project_id=:project";
+ $params['project'] = $projectId;
+ } else {
+ // 如果没有指定某一项目,则获取用户参与的项目
+ $userJoinProjectIdArr = PermissionLogic::getUserRelationProjectIdArr(UserAuth::getId());
+ if (!empty($userJoinProjectIdArr)) {
+ $projectIdStr = implode(',', $userJoinProjectIdArr);
+ $sql .= " AND project_id IN ({$projectIdStr}) ";
+ }
+ }
+
+ $queryJson = null;
+ $queryArr = [];
+ if (isset($_GET['adv_query_json'])) {
+ $queryJson = $_GET['adv_query_json'];
+ $queryArr = json_decode($queryJson, true);
+ }
+
+ if (!$queryArr) {
+ return [false, '查询条件格式错误', 0];
+ }
+ // 先获取Mysql版本号
+ $versionSql = 'select version() as vv';
+ $issueModel = new IssueModel();
+ $versionStr = $issueModel->db->getOne($versionSql);
+ $versionNum = floatval($versionStr);
+ if (strpos($versionStr, 'MariaDB') !== false) {
+ $versionNum = 0;
+ }
+ $startBracesNum = 0;
+ $endBracesNum = 0;
+ $sql .= 'AND ( ';
+ $i = 0;
+ foreach ($queryArr as $item) {
+ $i++;
+ $logic = strtoupper($item['logic']);
+ if ($i == 1) {
+ $logic = '';
+ }
+ $startBraces = trimStr($item['start_braces']);
+ if ($startBraces == '(') {
+ $startBracesNum++;
+ }
+ $endBraces = trimStr($item['end_braces']);
+ if ($endBraces == ')') {
+ $endBracesNum++;
+ }
+ $field = trimStr($item['field']);
+ $opt = urldecode($item['opt']);
+ $value = $item['value'] ;
+
+ if ($field == 'updated' || $field == 'created') {
+ $value = strtotime($value);
+ }
+
+ $sql .= " {$logic} {$startBraces} ";
+
+ switch ($opt) {
+ case '=':
+ case '!=':
+ case '>':
+ case '>=':
+ case '<=':
+ case '<':
+ $sql .= " $field {$opt}:$field ";
+ $params[$field] = $value;
+ break;
+ case 'in':
+ case 'not in':
+ $sql .= " $field {$opt} ( :$field ) ";
+ $params[$field] = $value;
+ break;
+ case 'like':
+ $sql .= " $field {$opt} ':$field' ";
+ $params[$field] = $value;
+ break;
+ case 'like %...%':
+ if ($versionNum < 5.70) {
+ $sql .= " LOCATE(:$field,$field)>0 ";
+ $params[$field] = $value;
+ } else {
+ // 使用全文索引
+ $sql .= " MATCH ($field) AGAINST (:$field IN NATURAL LANGUAGE MODE) ";
+ $params[$field] = $value;
+ }
+ break;
+ case 'is null':
+ case 'is not null':
+ $sql .= " $field {$opt} ";
+ $params[$field] = $value;
+ break;
+ case 'between':
+ case 'not between':
+ $sql .= " $field {$opt} :$field";
+ $params[$field] = $value;
+ break;
+ case 'regexp':
+ $value = urldecode($value);
+ $sql .= " $field {$opt} '$value' ";
+ break;
+ case 'regexp ^...$':
+ $sql .= " $field {$opt} '^{$value}$' ";
+ break;
+ default:
+ $sql .= " $field {$opt} :$field ";
+ $params[$field] = $value;
+ }
+ $sql .= " {$endBraces} ";
+ }
+ $sql .= ' ) ';
+ if ($startBracesNum != $endBracesNum) {
+ return [false, '查询条件的括号 ( ) 条件错误', 0];
+ }
+
+ $orderBy = 'id';
+ if (isset($_GET['sort_field'])) {
+ $orderBy = $_GET['sort_field'];
+ }
+ $sortBy = 'DESC';
+ if (isset($_GET['sort_by']) && !empty($_GET['sort_by'])) {
+ $sortBy = $_GET['sort_by'];
+ }
+
+ $start = $pageSize * ($page - 1);
+ $limit = " limit $start, " . $pageSize;
+ $order = empty($orderBy) ? '' : " Order By $orderBy $sortBy";
+
+ $model = new IssueModel();
+ $table = $model->getTable();
+
+ try {
+
+ // 获取总数
+ $sqlCount = "SELECT count(*) as cc FROM {$table} " . $sql;
+ //echo $sqlCount;
+ //print_r($params);
+ $count = $model->db->getOne($sqlCount, $params);
+ $fields = '*';
+ $sql = "SELECT {$fields} FROM {$table} " . $sql;
+
+ $sql .= ' ' . $order . $limit;
+ //print_r($params);
+ //echo $sql;die;
+
+ $arr = $model->db->getRows($sql, $params);
+ // var_dump( $arr, $count);
+ return [true, $arr, $count];
+ } catch (\PDOException $e) {
+ return [false, $e->getMessage(), 0];
+ }
+ }
+
/**
* @param int $userId
* @param int $page
diff --git a/app/ctrl/issue/Main.php b/app/ctrl/issue/Main.php
index 81bc24b6b..061f29c31 100644
--- a/app/ctrl/issue/Main.php
+++ b/app/ctrl/issue/Main.php
@@ -408,7 +408,6 @@ public function pageQrMobileUpload()
*/
public function mobileUpload()
{
-
$tmpIssueId = '';
if (isset($_GET['tmp_issue_id'])) {
$tmpIssueId = $_GET['tmp_issue_id'];
@@ -561,6 +560,39 @@ public function filter()
}
}
+ /**
+ * 高级查询
+ * @throws \Exception
+ */
+ public function advFilter()
+ {
+ $issueFilterLogic = new IssueFilterLogic();
+
+ $pageSize = 20;
+ $page = isset($_GET['page']) ? (int)$_GET['page'] : 1;
+ $page = max(1, $page);
+ if (isset($_GET['page'])) {
+ $page = max(1, intval($_GET['page']));
+ }
+
+ list($ret, $data['issues'], $total) = $issueFilterLogic->getAdvQueryList($page, $pageSize);
+ if ($ret) {
+ foreach ($data['issues'] as &$issue) {
+ IssueFilterLogic::formatIssue($issue);
+ }
+ $data['total'] = (int)$total;
+ $data['pages'] = ceil($total / $pageSize);
+ $data['page_size'] = $pageSize;
+ $data['page'] = $page;
+ $_SESSION['filter_current_page'] = $page;
+ $_SESSION['filter_pages'] = $data['pages'];
+ $_SESSION['filter_page_size'] = $pageSize;
+ $this->ajaxSuccess('success', $data);
+ } else {
+ $this->ajaxFailed('failed', $data['issues']);
+ }
+ }
+
/**
* 获取保存过的过滤器列表
* @throws \Exception
diff --git a/app/public/dev/js/issue/main.js b/app/public/dev/js/issue/main.js
index 3226f607a..54017f235 100644
--- a/app/public/dev/js/issue/main.js
+++ b/app/public/dev/js/issue/main.js
@@ -322,279 +322,317 @@ var IssueMain = (function () {
url: _options.filter_url,
data: _options.query_param_obj,
success: function (resp) {
- auth_check(resp);
- _issues_list = resp.data.issues;
+ IssueMain.prototype.handleRenderIssues(resp, success);
+ },
+ error: function (res) {
+ notify_error("请求数据错误" + res);
+ }
+ });
+ };
+
+ IssueMain.prototype.fetchIssuesByAdvQueryIssue = function (success) {
+
+ let query_json = [
+ {"logic":"and", "start_braces":"(", "field":"assignee", "opt":"=", "value":"1", "end_braces":""},
+ {"logic":"and", "start_braces":"", "field":"updated", "opt":">=", "value":"2019-11-12 22:00", "end_braces":""},
+ {"logic":"or", "start_braces":"", "field":"issue_type", "opt":"in", "value":"1,2,3", "end_braces":")"},
+ {"logic":"or", "start_braces":"(", "field":"priority", "opt":"not in", "value":"1,2,3", "end_braces":""},
+ {"logic":"and", "start_braces":"", "field":"summary", "opt":"regexp", "value":"^xxx", "end_braces":")"}
+ ];
+ let query_json2 = [
+ {"logic":"and", "start_braces":"(", "field":"assignee", "opt":">=", "value":"1", "end_braces":""},
+ {"logic":"and", "start_braces":"", "field":"updated", "opt":"<=", "value":"2019-11-12 22:00", "end_braces":")"},
+ {"logic":"and", "start_braces":"", "field":"summary", "opt":"regexp", "value":encodeURIComponent("^标题[^>]+\\d+"), "end_braces":""}
+ ];
+ let btn_adv_sumit = $('#btn-adv_submit');
+ btn_adv_sumit.addClass('disabled');
+ $.ajax({
+ type: 'get',
+ dataType: "json",
+ url: "/issue/main/adv_filter",
+ data: {project_id:window.cur_project_id, adv_query_json:JSON.stringify(query_json2)},
+ success: function (resp) {
+ btn_adv_sumit.removeClass('disabled');
+ $('#modal-adv_query').modal('hide');
+ IssueMain.prototype.handleRenderIssues(resp, success);
+ },
+ error: function (res) {
+ notify_error("请求数据错误" + res);
+ btn_adv_sumit.removeClass('disabled');
+ }
+ });
+ };
+ IssueMain.prototype.handleRenderIssues = function (resp, success) {
+
+ auth_check(resp);
+ let _issues_list = resp.data.issues;
+ let _issue_length = 0;
+ if(!is_empty(_issues_list)){
_issue_length = _issues_list.length;
- _issue_cur_page = resp.data.page;
- _issue_total_pages = resp.data.total;
+ }
+ _issue_cur_page = resp.data.page;
+ _issue_total_pages = resp.data.total;
- $("#issue_total").text(_issue_total_pages);
+ $("#issue_total").text(_issue_total_pages);
- if (resp.ret != '200') {
- notify_error(resp.msg, resp.data);
- loading.hide('#' + _options.list_render_id);
- return;
- }
- if (_issue_length) {
- loading.show('#' + _options.list_render_id);
- var source = $('#' + _options.list_tpl_id).html();
- var template = Handlebars.compile(source);
-
- for (let i in resp.data.issues) {
- if (resp.data.issues[i].start_date == '' || resp.data.issues[i].due_date == '') {
- resp.data.issues[i].show_date_range = '';
- } else {
- resp.data.issues[i].show_date_range = resp.data.issues[i].start_date + ' - ' + resp.data.issues[i].due_date;
- }
+ if (resp.ret !== '200') {
+ notify_error(resp.msg, resp.data);
+ loading.hide('#' + _options.list_render_id);
+ return;
+ }
+ if (_issue_length>0) {
+ loading.show('#' + _options.list_render_id);
+ var source = $('#' + _options.list_tpl_id).html();
+ var template = Handlebars.compile(source);
+
+ for (let i in resp.data.issues) {
+ if (resp.data.issues[i].start_date == '' || resp.data.issues[i].due_date == '') {
+ resp.data.issues[i].show_date_range = '';
+ } else {
+ resp.data.issues[i].show_date_range = resp.data.issues[i].start_date + ' - ' + resp.data.issues[i].due_date;
}
- resp.data.display_fields = window.display_fields;
- resp.data.uiDisplayFields = window.uiDisplayFields;
- var result = template(resp.data);
- let table_footer_operation_tpl = $('#table_footer_operation_tpl').html();
- if (table_footer_operation_tpl != null && table_footer_operation_tpl != undefined)
- result += $('#table_footer_operation_tpl').html();
- $('#' + _options.list_render_id).html(result);
-
- $('#issue_count').html(resp.data.total);
- $('#page_size').html(resp.data.page_size);
-
- $('#filtered-search-issue').attr("autocomplete", 'off');
-
- $('.created_text').each(function (el) {
- var time = $(this).text().trim();
- if (time) {
- $(this).html(moment(time).fromNow())
- }
- });
+ }
+ resp.data.display_fields = window.display_fields;
+ resp.data.uiDisplayFields = window.uiDisplayFields;
+ var result = template(resp.data);
+ let table_footer_operation_tpl = $('#table_footer_operation_tpl').html();
+ if (table_footer_operation_tpl != null && table_footer_operation_tpl != undefined)
+ result += $('#table_footer_operation_tpl').html();
+ $('#' + _options.list_render_id).html(result);
- $('.updated_text').each(function (el) {
- var time = $(this).text().trim()
- if (time) {
- $(this).html(moment(time).fromNow())
- }
- });
+ $('#issue_count').html(resp.data.total);
+ $('#page_size').html(resp.data.page_size);
- var options = {
- currentPage: resp.data.page,
- totalPages: resp.data.pages,
- onPageClicked: function (e, originalEvent, type, page) {
- IssueMain.prototype.skipPager(page);
- }
- };
- $('#ampagination-bootstrap').bootstrapPaginator(options);
- console.log(success);
- if (typeof (success) != 'undefined' && typeof (success) === "function") {
- success(resp.data);
+ $('#filtered-search-issue').attr("autocomplete", 'off');
+
+ $('.created_text').each(function (el) {
+ var time = $(this).text().trim();
+ if (time) {
+ $(this).html(moment(time).fromNow())
}
+ });
- $(".issue_edit_href").bind("click", function () {
- IssueMain.prototype.fetchEditUiConfig($(this).data('issue_id'), 'update');
- });
+ $('.updated_text').each(function (el) {
+ var time = $(this).text().trim()
+ if (time) {
+ $(this).html(moment(time).fromNow())
+ }
+ });
- $(".issue_copy_href").bind("click", function () {
- IssueMain.prototype.fetchEditUiConfig($(this).data('issue_id'), 'copy');
- });
- $(".issue_create_child").bind("click", function () {
- $("#btn-create-issue").click();
- $('#master_issue_id').val($(this).data('issue_id'));
- });
+ var options = {
+ currentPage: resp.data.page,
+ totalPages: resp.data.pages,
+ onPageClicked: function (e, originalEvent, type, page) {
+ IssueMain.prototype.skipPager(page);
+ }
+ };
+ $('#ampagination-bootstrap').bootstrapPaginator(options);
+ console.log(success);
+ if (typeof (success) != 'undefined' && typeof (success) === "function") {
+ success(resp.data);
+ }
+ $(".issue_edit_href").bind("click", function () {
+ IssueMain.prototype.fetchEditUiConfig($(this).data('issue_id'), 'update');
+ });
- $(".issue_convert_child_href").bind("click", function () {
- IssueMain.prototype.displayConvertChild($(this).data('issue_id'));
- });
+ $(".issue_copy_href").bind("click", function () {
+ IssueMain.prototype.fetchEditUiConfig($(this).data('issue_id'), 'copy');
+ });
+ $(".issue_create_child").bind("click", function () {
+ $("#btn-create-issue").click();
+ $('#master_issue_id').val($(this).data('issue_id'));
+ });
- $(".issue_backlog_href").bind("click", function () {
- IssueMain.prototype.joinBacklog($(this).data('issue_id'));
- });
- $(".issue_sprint_href").bind("click", function () {
- IssueMain.prototype.displayJoinSprint($(this).data('issue_id'));
- });
+ $(".issue_convert_child_href").bind("click", function () {
+ IssueMain.prototype.displayConvertChild($(this).data('issue_id'));
+ });
- $(".issue_delete_href").bind("click", function () {
- IssueMain.prototype.delete($(this).data('issue_id'));
- });
- $("time").each(function (i, el) {
- var t = moment(moment.unix(Number($(el).attr('datetime'))).format('YYYY-MM-DD HH:mm:ss')).fromNow()
- $(el).html(t)
- });
+ $(".issue_backlog_href").bind("click", function () {
+ IssueMain.prototype.joinBacklog($(this).data('issue_id'));
+ });
- $(".resolve-select").bind("dblclick", function () {
- let $self = $(this);
- let issue_id = $self.data('issue_id');
- let list_box = $self.children(".resolve-list");
+ $(".issue_sprint_href").bind("click", function () {
+ IssueMain.prototype.displayJoinSprint($(this).data('issue_id'));
+ });
- if (list_box.is(":visible")) {
- return false;
- }
- list_box.slideDown(100);
+ $(".issue_delete_href").bind("click", function () {
+ IssueMain.prototype.delete($(this).data('issue_id'));
+ });
+ $("time").each(function (i, el) {
+ var t = moment(moment.unix(Number($(el).attr('datetime'))).format('YYYY-MM-DD HH:mm:ss')).fromNow()
+ $(el).html(t)
+ });
- let resolve_list = _issueConfig.issue_resolve;
- let html = "";
- for (let i in resolve_list) {
- //console.log(resolve_list[i]);
- html += `
${resolve_list[i].name} `;
- }
- list_box.html(html);
+ $(".resolve-select").bind("dblclick", function () {
+ let $self = $(this);
+ let issue_id = $self.data('issue_id');
+ let list_box = $self.children(".resolve-list");
- $(".resolve-list li").on("click", function () {
- let id = $(this).data("value");
- IssueDetail.prototype.updateIssueResolve(issue_id, id);
- });
+ if (list_box.is(":visible")) {
+ return false;
+ }
+ list_box.slideDown(100);
- $(document).on("click", function () {
- list_box.slideUp(100);
- })
+ let resolve_list = _issueConfig.issue_resolve;
+ let html = "";
+ for (let i in resolve_list) {
+ //console.log(resolve_list[i]);
+ html += `${resolve_list[i].name} `;
+ }
+ list_box.html(html);
+ $(".resolve-list li").on("click", function () {
+ let id = $(this).data("value");
+ IssueDetail.prototype.updateIssueResolve(issue_id, id);
});
- $(".status-select .label").bind("dblclick", function () {
- let $self = $(this);
- let issue_id = $self.parent().data('issue_id');
- let list_box = $self.siblings(".status-list");
-
- if (list_box.is(":visible")) {
- return false;
- }
- list_box.slideDown(100);
- loading.show(`#status-list-${issue_id}`);
-
- $.ajax({
- type: 'get',
- dataType: "json",
- async: true,
- url: root_url + "issue/main/fetch_issue_edit",
- data: { issue_id: issue_id },
- success: function (resp) {
- auth_check(resp);
- loading.hide(`#status-list-${issue_id}`);
- if (resp.ret != '200') {
- notify_error('获取状态失败:' + resp.msg);
- return;
- }
- let status_list = resp.data.issue.allow_update_status;
- let html = "";
-
- for (var status of status_list) {
- html += `${status.name} `;
- }
- list_box.html(html);
+ $(document).on("click", function () {
+ list_box.slideUp(100);
+ })
- $(".status-list li").on("click", function () {
- let id = $(this).data("value");
+ });
- IssueDetail.prototype.updateIssueStatus(issue_id, id);
- });
+ $(".status-select .label").bind("dblclick", function () {
+ let $self = $(this);
+ let issue_id = $self.parent().data('issue_id');
+ let list_box = $self.siblings(".status-list");
- $(document).on("click", function () {
- list_box.slideUp(100);
- })
+ if (list_box.is(":visible")) {
+ return false;
+ }
+ list_box.slideDown(100);
+ loading.show(`#status-list-${issue_id}`);
- },
- error: function (res) {
- notify_error("请求数据错误" + res);
+ $.ajax({
+ type: 'get',
+ dataType: "json",
+ async: true,
+ url: root_url + "issue/main/fetch_issue_edit",
+ data: { issue_id: issue_id },
+ success: function (resp) {
+ auth_check(resp);
+ loading.hide(`#status-list-${issue_id}`);
+ if (resp.ret != '200') {
+ notify_error('获取状态失败:' + resp.msg);
+ return;
}
- });
- });
-
+ let status_list = resp.data.issue.allow_update_status;
+ let html = "";
- $(".date-select-edit").bind("click", function () {
- let $self = $(this);
- let issue_id = $self.data('issue_id');
- let myDate = new Date();
- laydate.render({
- elem: this
- , trigger: 'click'
- , range: true
- , done: function (value, date, endDate) {
- $.ajax({
- type: 'post',
- dataType: "json",
- async: true,
- url: root_url + "issue/main/update",
- data: { issue_id: issue_id, params: { start_date: date.year + '-' + date.month + '-' + date.date, due_date: endDate.year + '-' + endDate.month + '-' + endDate.date } },
- success: function (resp) {
- auth_check(resp);
- if (resp.ret != '200') {
- notify_error('操作失败:' + resp.msg);
- return;
- }
- notify_success('操作成功');
- //window.location.reload();
- },
- error: function (res) {
- notify_error("请求数据错误" + res);
- }
- });
+ for (var status of status_list) {
+ html += `${status.name} `;
}
- //,value: myDate.getFullYear() + '-' + myDate.getMonth() + '-' + myDate.getDate() + ' - ' + myDate.getFullYear() + '-' + myDate.getMonth() + '-' + myDate.getDate()
- });
- });
+ list_box.html(html);
+ $(".status-list li").on("click", function () {
+ let id = $(this).data("value");
- $(".have_children").bind("click", function () {
- var issue_id = $(this).data('issue_id');
- $('#tr_subtask_' + issue_id).toggleClass('hide');
- IssueMain.prototype.fetchChildren(issue_id, 'ul_subtask_' + issue_id);
- });
+ IssueDetail.prototype.updateIssueStatus(issue_id, id);
+ });
- $("#btn-join_sprint").bind("click", function () {
- console.log("保存")
- var sprint_id = $("input[name='join_sprint']:checked").val();
- var issue_id = $('#join_sprint_issue_id').val();
- if (sprint_id) {
- IssueMain.prototype.joinSprint(sprint_id, issue_id);
- } else {
- notify_error('请选择Sprint');
- }
- });
+ $(document).on("click", function () {
+ list_box.slideUp(100);
+ })
- $("#btn-modal_delete").bind("click", function () {
- var issue_id = $('#children_list_issue_id').val();
- if (issue_id) {
- IssueMain.prototype.delete(issue_id);
- } else {
- notify_error('请选择Sprint');
+ },
+ error: function (res) {
+ notify_error("请求数据错误" + res);
}
});
+ });
- $("#btn-convertChild").bind("click", function () {
- var issue_id = $('#current_issue_id').val();
- if (issue_id) {
- IssueMain.prototype.convertChild(issue_id);
- } else {
- notify_error('事项id传递错误');
+
+ $(".date-select-edit").bind("click", function () {
+ let $self = $(this);
+ let issue_id = $self.data('issue_id');
+ let myDate = new Date();
+ laydate.render({
+ elem: this
+ , trigger: 'click'
+ , range: true
+ , done: function (value, date, endDate) {
+ $.ajax({
+ type: 'post',
+ dataType: "json",
+ async: true,
+ url: root_url + "issue/main/update",
+ data: { issue_id: issue_id, params: { start_date: date.year + '-' + date.month + '-' + date.date, due_date: endDate.year + '-' + endDate.month + '-' + endDate.date } },
+ success: function (resp) {
+ auth_check(resp);
+ if (resp.ret != '200') {
+ notify_error('操作失败:' + resp.msg);
+ return;
+ }
+ notify_success('操作成功');
+ //window.location.reload();
+ },
+ error: function (res) {
+ notify_error("请求数据错误" + res);
+ }
+ });
}
+ //,value: myDate.getFullYear() + '-' + myDate.getMonth() + '-' + myDate.getDate() + ' - ' + myDate.getFullYear() + '-' + myDate.getMonth() + '-' + myDate.getDate()
});
+ });
- } else {
- loading.hide('#' + _options.list_render_id)
- var additionHtml = '';
- if (window._permCreateIssue) {
- var additionHtml = '创建事项 ';
+
+ $(".have_children").bind("click", function () {
+ var issue_id = $(this).data('issue_id');
+ $('#tr_subtask_' + issue_id).toggleClass('hide');
+ IssueMain.prototype.fetchChildren(issue_id, 'ul_subtask_' + issue_id);
+ });
+
+ $("#btn-join_sprint").bind("click", function () {
+ console.log("保存")
+ var sprint_id = $("input[name='join_sprint']:checked").val();
+ var issue_id = $('#join_sprint_issue_id').val();
+ if (sprint_id) {
+ IssueMain.prototype.joinSprint(sprint_id, issue_id);
+ } else {
+ notify_error('请选择Sprint');
}
+ });
- var emptyHtml = defineStatusHtml({
- message: '没有事项数据',
- name: 'issue',
- handleHtml: additionHtml
- })
- $('#list_render_id').append($(' '))
- $('#list_render_id_wrap').append(emptyHtml.html)
+ $("#btn-modal_delete").bind("click", function () {
+ var issue_id = $('#children_list_issue_id').val();
+ if (issue_id) {
+ IssueMain.prototype.delete(issue_id);
+ } else {
+ notify_error('请选择Sprint');
+ }
+ });
- $(".js-create-issue").bind('click', function () {
- $("#btn-create-issue").trigger("click");
- })
+ $("#btn-convertChild").bind("click", function () {
+ var issue_id = $('#current_issue_id').val();
+ if (issue_id) {
+ IssueMain.prototype.convertChild(issue_id);
+ } else {
+ notify_error('事项id传递错误');
+ }
+ });
+
+ } else {
+ loading.hide('#' + _options.list_render_id)
+ var additionHtml = '';
+ if (window._permCreateIssue) {
+ var additionHtml = '创建事项 ';
}
- },
- error: function (res) {
- notify_error("请求数据错误" + res);
+ var emptyHtml = defineStatusHtml({
+ message: '没有事项数据',
+ name: 'issue',
+ handleHtml: additionHtml
+ })
+ $('#list_render_id').html($(' '))
+ $('#list_render_id_wrap').append(emptyHtml.html)
+
+ $(".js-create-issue").bind('click', function () {
+ $("#btn-create-issue").trigger("click");
+ })
}
- });
};
-
IssueMain.prototype.displayConvertChild = function (issue_id) {
$('#current_issue_id').val(issue_id);
diff --git a/app/view/gitlab.zip b/app/view/gitlab.zip
new file mode 100644
index 000000000..126997b35
Binary files /dev/null and b/app/view/gitlab.zip differ
diff --git a/app/view/gitlab/admin/common-page-nav-admin.php b/app/view/gitlab/admin/common-page-nav-admin.php
deleted file mode 100644
index efd2ecd1f..000000000
--- a/app/view/gitlab/admin/common-page-nav-admin.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
diff --git a/app/view/gitlab/admin/common-system-nav-links-sub-nav.php b/app/view/gitlab/admin/common-system-nav-links-sub-nav.php
deleted file mode 100644
index 73216a1b0..000000000
--- a/app/view/gitlab/admin/common-system-nav-links-sub-nav.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
diff --git a/app/view/gitlab/admin/common-user-nav-links-sub-nav.php b/app/view/gitlab/admin/common-user-nav-links-sub-nav.php
deleted file mode 100644
index 2c367a0bd..000000000
--- a/app/view/gitlab/admin/common-user-nav-links-sub-nav.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
diff --git a/app/view/gitlab/admin/common_issue_left_nav.php b/app/view/gitlab/admin/common_issue_left_nav.php
deleted file mode 100644
index 9bceee810..000000000
--- a/app/view/gitlab/admin/common_issue_left_nav.php
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/common_project_left_nav.php b/app/view/gitlab/admin/common_project_left_nav.php
deleted file mode 100644
index 1e070687b..000000000
--- a/app/view/gitlab/admin/common_project_left_nav.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/common_system_email_top.php b/app/view/gitlab/admin/common_system_email_top.php
deleted file mode 100644
index 943f96684..000000000
--- a/app/view/gitlab/admin/common_system_email_top.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/common_system_left_nav.php b/app/view/gitlab/admin/common_system_left_nav.php
deleted file mode 100644
index 9efddd284..000000000
--- a/app/view/gitlab/admin/common_system_left_nav.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/common_system_security_top.php b/app/view/gitlab/admin/common_system_security_top.php
deleted file mode 100644
index 26d3d98cb..000000000
--- a/app/view/gitlab/admin/common_system_security_top.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/common_system_ui_top.php b/app/view/gitlab/admin/common_system_ui_top.php
deleted file mode 100644
index 82bcc125e..000000000
--- a/app/view/gitlab/admin/common_system_ui_top.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/common_user_left_nav.php b/app/view/gitlab/admin/common_user_left_nav.php
deleted file mode 100644
index bd095defe..000000000
--- a/app/view/gitlab/admin/common_user_left_nav.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/default_role.php b/app/view/gitlab/admin/default_role.php
deleted file mode 100644
index 42f4ae470..000000000
--- a/app/view/gitlab/admin/default_role.php
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/header/include.php'; ?>
-
-
-
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/body/script.php'; ?>
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/field.php b/app/view/gitlab/admin/field.php
deleted file mode 100644
index e7678843e..000000000
--- a/app/view/gitlab/admin/field.php
+++ /dev/null
@@ -1,349 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/group_edit_users.php b/app/view/gitlab/admin/group_edit_users.php
deleted file mode 100644
index d407e6884..000000000
--- a/app/view/gitlab/admin/group_edit_users.php
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/groups.php b/app/view/gitlab/admin/groups.php
deleted file mode 100644
index 037307839..000000000
--- a/app/view/gitlab/admin/groups.php
+++ /dev/null
@@ -1,288 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_desc_tpl.php b/app/view/gitlab/admin/issue_desc_tpl.php
deleted file mode 100644
index fb4c06860..000000000
--- a/app/view/gitlab/admin/issue_desc_tpl.php
+++ /dev/null
@@ -1,351 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_priority.php b/app/view/gitlab/admin/issue_priority.php
deleted file mode 100644
index 99e23cc85..000000000
--- a/app/view/gitlab/admin/issue_priority.php
+++ /dev/null
@@ -1,301 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_resolve.php b/app/view/gitlab/admin/issue_resolve.php
deleted file mode 100644
index 8af4ae965..000000000
--- a/app/view/gitlab/admin/issue_resolve.php
+++ /dev/null
@@ -1,326 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_status.php b/app/view/gitlab/admin/issue_status.php
deleted file mode 100644
index 400a9695b..000000000
--- a/app/view/gitlab/admin/issue_status.php
+++ /dev/null
@@ -1,331 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_type.php b/app/view/gitlab/admin/issue_type.php
deleted file mode 100644
index 40e98b912..000000000
--- a/app/view/gitlab/admin/issue_type.php
+++ /dev/null
@@ -1,325 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_type_scheme.php b/app/view/gitlab/admin/issue_type_scheme.php
deleted file mode 100644
index 8d4f20c48..000000000
--- a/app/view/gitlab/admin/issue_type_scheme.php
+++ /dev/null
@@ -1,321 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/issue_ui.php b/app/view/gitlab/admin/issue_ui.php
deleted file mode 100644
index cdcd713b5..000000000
--- a/app/view/gitlab/admin/issue_ui.php
+++ /dev/null
@@ -1,434 +0,0 @@
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/log_base_list.php b/app/view/gitlab/admin/log_base_list.php
deleted file mode 100644
index a61c427ef..000000000
--- a/app/view/gitlab/admin/log_base_list.php
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/header/include.php'; ?>
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/body/script.php'; ?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/log_operating_list.php b/app/view/gitlab/admin/log_operating_list.php
deleted file mode 100644
index 41490a61c..000000000
--- a/app/view/gitlab/admin/log_operating_list.php
+++ /dev/null
@@ -1,227 +0,0 @@
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/header/include.php'; ?>
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/body/script.php'; ?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/log_slow_sql_list.php b/app/view/gitlab/admin/log_slow_sql_list.php
deleted file mode 100644
index 432f20854..000000000
--- a/app/view/gitlab/admin/log_slow_sql_list.php
+++ /dev/null
@@ -1,139 +0,0 @@
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/header/include.php'; ?>
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/body/script.php'; ?>
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/project_list.php b/app/view/gitlab/admin/project_list.php
deleted file mode 100644
index 3020a6a27..000000000
--- a/app/view/gitlab/admin/project_list.php
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_announcement.php b/app/view/gitlab/admin/system_announcement.php
deleted file mode 100644
index 11c10cbc0..000000000
--- a/app/view/gitlab/admin/system_announcement.php
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_attachment_setting.php b/app/view/gitlab/admin/system_attachment_setting.php
deleted file mode 100644
index 351ee21b6..000000000
--- a/app/view/gitlab/admin/system_attachment_setting.php
+++ /dev/null
@@ -1,162 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_backup_data.php b/app/view/gitlab/admin/system_backup_data.php
deleted file mode 100644
index fe0dd2d4f..000000000
--- a/app/view/gitlab/admin/system_backup_data.php
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_basic_setting.php b/app/view/gitlab/admin/system_basic_setting.php
deleted file mode 100644
index 89dbe8c8c..000000000
--- a/app/view/gitlab/admin/system_basic_setting.php
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_basic_setting_form.php b/app/view/gitlab/admin/system_basic_setting_form.php
deleted file mode 100644
index 5a4c5c3bc..000000000
--- a/app/view/gitlab/admin/system_basic_setting_form.php
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_cache.php b/app/view/gitlab/admin/system_cache.php
deleted file mode 100644
index 09ad11b33..000000000
--- a/app/view/gitlab/admin/system_cache.php
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/header/include.php'; ?>
-
-
- require_once VIEW_PATH . 'gitlab/common/body/script.php'; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_datetime_setting.php b/app/view/gitlab/admin/system_datetime_setting.php
deleted file mode 100644
index 31bc45d35..000000000
--- a/app/view/gitlab/admin/system_datetime_setting.php
+++ /dev/null
@@ -1,154 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_email_notify_setting.php b/app/view/gitlab/admin/system_email_notify_setting.php
deleted file mode 100644
index b0652d1df..000000000
--- a/app/view/gitlab/admin/system_email_notify_setting.php
+++ /dev/null
@@ -1,210 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_email_queue.php b/app/view/gitlab/admin/system_email_queue.php
deleted file mode 100644
index cf51fe4bc..000000000
--- a/app/view/gitlab/admin/system_email_queue.php
+++ /dev/null
@@ -1,260 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_global_permission.php b/app/view/gitlab/admin/system_global_permission.php
deleted file mode 100644
index 5f9ff75f4..000000000
--- a/app/view/gitlab/admin/system_global_permission.php
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_password_strategy.php b/app/view/gitlab/admin/system_password_strategy.php
deleted file mode 100644
index 620576eef..000000000
--- a/app/view/gitlab/admin/system_password_strategy.php
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_password_strategy2.php b/app/view/gitlab/admin/system_password_strategy2.php
deleted file mode 100644
index 95c3bb55c..000000000
--- a/app/view/gitlab/admin/system_password_strategy2.php
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_permission_role.php b/app/view/gitlab/admin/system_permission_role.php
deleted file mode 100644
index 933d28c76..000000000
--- a/app/view/gitlab/admin/system_permission_role.php
+++ /dev/null
@@ -1,208 +0,0 @@
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/header/include.php'; ?>
-
-
-
-
-
-
- require_once VIEW_PATH . 'gitlab/common/body/script.php'; ?>
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_project_role.php b/app/view/gitlab/admin/system_project_role.php
deleted file mode 100644
index d1d0f365c..000000000
--- a/app/view/gitlab/admin/system_project_role.php
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/view/gitlab/admin/system_restore_data.php b/app/view/gitlab/admin/system_restore_data.php
deleted file mode 100644
index 79b14bd20..000000000
--- a/app/view/gitlab/admin/system_restore_data.php
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/view/gitlab/admin/system_send_mail.php b/app/view/gitlab/admin/system_send_mail.php
deleted file mode 100644
index bb6c8ba4d..000000000
--- a/app/view/gitlab/admin/system_send_mail.php
+++ /dev/null
@@ -1,231 +0,0 @@
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/header/include.php';?>
-
-
-
-
-
-
-
-
- require_once VIEW_PATH.'gitlab/common/body/script.php';?>
-
-