");
- $("#copyProjects > div[data-id != '']").remove();
- $(".model-body").remove();
- var data = JSON.parse(data);
- if(copyExecutionID != 0)
- {
- $('#copyProjects').append("
");
- }
- $.each(data, function(id, execution)
- {
- var type = execution.type == 'stage' ? 'waterfall' : execution.type;
- var active = copyExecutionID == id ? ' active' : '';
- $('#copyProjects').append("
");
- });
- }
- else if(data == '[]' && copyExecutionID == 0)
- {
- $('#copyProjects').replaceWith("
" + copyNoExecution + "
");
- }
- else if(data == '[]' && copyExecutionID != 0)
- {
- $("#copyProjects > div[data-id != '']").remove();
- $('#copyProjects').append("
");
- }
- });
-}
diff --git a/module/execution/js/dynamic.js b/module/execution/js/dynamic.js
deleted file mode 100755
index 2c5ed5a53e..0000000000
--- a/module/execution/js/dynamic.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function changeUser(account, projectID)
-{
- if(account == '')
- {
- link = createLink('project', 'dynamic', 'projectID=' + projectID + '&type=all');
- }
- else
- {
- link = createLink('project', 'dynamic', 'projectID=' + projectID + '&type=account¶m=' + account);
- }
- location.href = link;
-}
diff --git a/module/execution/js/edit.js b/module/execution/js/edit.js
deleted file mode 100644
index ba9a203b05..0000000000
--- a/module/execution/js/edit.js
+++ /dev/null
@@ -1,142 +0,0 @@
-$().ready(function()
-{
- $('#submit').click(function()
- {
- $('#products0').removeAttr("disabled");
- $('#branch0').removeAttr("disabled");
- var products = new Array();
- var existedBranch = false;
-
- /* Determine whether the products of the same branch are linked. */
- $("#productsBox select[name^='products']").each(function()
- {
- var productID = $(this).val();
- if(typeof(products[productID]) == 'undefined') products[productID] = new Array();
- if(multiBranchProducts[productID])
- {
- var branchID = $(this).closest('.input-group').find("select[id^=branch]").val();
- if(products[productID][branchID])
- {
- existedBranch = true;
- }
- else
- {
- products[productID][branchID] = branchID;
- }
- if(existedBranch) return false;
- }
- });
-
- if(existedBranch)
- {
- bootbox.alert(errorSameBranches);
- return false;
- }
- });
-});
-
-$(function()
-{
- $(document).on('change', '[name*=products]', function()
- {
- var current = $(this).val();
- var last = $(this).attr('data-last');
- var lastBranch = $(this).attr('data-lastBranch') !== undefined ? $(this).attr('data-lastBranch') : 0;
-
- $(this).attr('data-last', current);
-
- var $branch = $(this).closest('.has-branch').find("[name^='branch']");
- if($branch.length)
- {
- var branchID = $branch.val();
- $(this).attr('data-lastBranch', branchID);
- }
- else
- {
- $(this).removeAttr('data-lastBranch');
- }
-
- if(current != last && $.inArray(last, unmodifiableProducts) != -1)
- {
- if(lastBranch != 0)
- {
- if($.inArray(lastBranch, unmodifiableBranches) != -1)
- {
- if(linkedStoryIDList[last][lastBranch]) bootbox.alert(unLinkProductTip.replace("%s", allProducts[last] + branchGroups[last][lastBranch]));
- }
- }
- else
- {
- bootbox.alert(unLinkProductTip.replace("%s", allProducts[last]));
- }
- }
- });
-
- $(document).on('change', '[name*=branch]', function()
- {
- var current = $(this).val();
- var last = $(this).attr('data-last');
- $(this).attr('data-last', current);
-
- var $product = $(this).closest('.has-branch').find("[name^='products']");
- $product.attr('data-lastBranch', current);
-
- if($.inArray(last, unmodifiableBranches) != -1)
- {
- var productID = $product.val();
- if($.inArray(productID, unmodifiableProducts) != -1 && linkedStoryIDList[productID][last])
- {
- bootbox.alert(tip.replace('%s', linkedStoryIDList[productID][last]));
- }
- }
- });
-
- /* Init. */
- $("select[id^=branch]").each(disableSelectedBranch);
- disableSelectedProduct();
-
- /* Check the all products and branches control when uncheck the product. */
- $(document).on('change', "select[id^='products']", function()
- {
- if($(this).val() == 0)
- {
- $("select[id^='branch']").each(disableSelectedBranch);
-
- disableSelectedProduct();
- }
- });
-
- $(document).on('change', "select[id^='branch']", disableSelectedBranch);
-
- if($('.disabledBranch').length > 0)
- {
- $('.disabledBranch div[id^="branch"]').addClass('chosen-disabled');
- }
-
- $('[data-toggle="popover"]').popover();
-
- if(isWaterfall)
- {
- hidePlanBox(executionAttr);
- }
-})
-var lastProjectID = $("#project").val();
-
-function changeProject(projectID)
-{
- if($('#submit').closest('td').find('#syncStories').length == 0)
- {
- $('#submit').after("
");
- }
-
- var confirmVal = confirm(confirmSync);
- $("#syncStories").val(confirmVal ? 'yes' : 'no');
-
- if(!confirmVal)
- {
- $('#project').val(lastProjectID).trigger("chosen:updated");
- return false;
- }
-
- lastProjectID = projectID;
-};
diff --git a/module/execution/js/executionkanban.js b/module/execution/js/executionkanban.js
deleted file mode 100644
index bc544a2c35..0000000000
--- a/module/execution/js/executionkanban.js
+++ /dev/null
@@ -1,184 +0,0 @@
-/**
- * Process kanban data
- * @returns {Object} kanban data
- */
-function processKanbanData()
-{
- /* Generate columns */
- var columns = [{id: 'project', type: 'project', name: window.langDoingProject, cardType: 'span'}];
- $.each(kanbanColumns, function(type, name)
- {
- columns.push({id: type, type: type, name: name, cardType: 'execution'});
- });
-
- /* Format lanes data */
- var lanes = [];
- $.each(kanbanGroup, function(projectID, statusMap)
- {
- var projectName = +projectID ? projectNames[projectID] : langMyExecutions;
- var cards = {project: [{id: projectID, name: projectName}]};
-
- $.each(kanbanColumns, function(type)
- {
- var cardList = [];
- var executions = statusMap[type];
-
- if(!executions) return;
-
- $.each(executions, function(index, execution)
- {
- var executionCard = $.extend({}, execution, {id: projectID + '-' + execution.id, _id: execution.id});
- cardList.push(executionCard);
- });
- cards[type] = cardList;
- });
-
- lanes.push({id: projectID, name: projectName, cards: cards});
- });
-
- return {id: 'executions', columns: columns, lanes: lanes};
-}
-
-/* Define drag and drop rules */
-if(!window.kanbanDropRules)
-{
- window.kanbanDropRules =
- {
- wait: ['doing', 'suspended', 'closed'],
- doing: ['suspended', 'closed'],
- suspended: ['doing', 'closed'],
- closed: ['doing']
- }
-}
-
-/*
-* Find drop columns
-* @param {JQuery} $element Drag element
-* @param {JQuery} $root Dnd root element
-*/
-function findDropColumns($element, $root)
-{
- var $col = $element.closest('.kanban-col');
- var col = $col.data();
- var lane = $col.closest('.kanban-lane').data();
- var kanbanID = $root.data('id');
- var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules : null;
-
- if(!kanbanRules) return $root.find('.kanban-lane[data-id="' + lane.id + '"] .kanban-lane-col:not([data-type="project"],[data-type="' + col.type + '"])');
-
- var colRules = kanbanRules[col.type];
- var lane = $col.closest('.kanban-lane').data('lane');
- return $root.find('.kanban-lane-col').filter(function()
- {
- if(!colRules) return false;
- if(colRules === true) return true;
-
- var $newCol = $(this);
- var newCol = $newCol.data();
- if(newCol.id === col.id) return false;
-
- var $newLane = $newCol.closest('.kanban-lane');
- var newLane = $newLane.data('lane');
- return colRules.indexOf(newCol.type) > -1 && newLane.id === lane.id;
- });
-}
-
-/**
- * Change column type for a card
-
- * @param {Object} card Card object
- * @param {String} fromColType The column type before change
- * @param {String} toColType The column type after change
- * @param {String} kanbanID Kanban ID
- */
-function changeCardColType(card, fromColType, toColType, kanbanID)
-{
- if(typeof card == 'undefined') return false;
- var cardID = card.id;
- var executionID = cardID.substr(cardID.indexOf("-") + 1);;
- var showIframe = false;
-
- if(toColType == 'doing')
- {
- if(fromColType == 'wait' && priv.canStart)
- {
- var link = createLink('execution', 'start', 'executionID=' + executionID, '', true);
- showIframe = true;
- }
- if((fromColType == 'suspended' || fromColType == 'closed') && priv.canActivate)
- {
- var link = createLink('execution', 'activate', 'executionID=' + executionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'suspended')
- {
- if((fromColType == 'wait' || fromColType == 'doing') && priv.canSuspend)
- {
- var link = createLink('execution', 'suspend', 'executionID=' + executionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'closed')
- {
- if(priv.canClose)
- {
- var link = createLink('execution', 'close', 'executionID=' + executionID, '', true);
- showIframe = true;
- }
- }
-
- if(showIframe)
- {
- var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%', url: link});
- modalTrigger.show();
- }
-
- /*
- // TODO: The server must return a updated kanban data 服务器返回更新后的看板数据
-
- // 调用 updateKanban 更新看板数据
- updateKanban(kanbanID, newKanbanData);
- */
-}
-
-/**
- * Handle finish drop task
- * @param {Object} event Event object
- * @returns {void}
- */
-function handleFinishDrop(event)
-{
- var $card = $(event.element); // The drag card
- var $dragCol = $card.closest('.kanban-lane-col');
- var $dropCol = $(event.target);
-
- /* Get d-n-d(drag and drop) infos 获取拖放操作相关信息 */
- var card = $card.data('item');
- var fromColType = $dragCol.data('type');
- var toColType = $dropCol.data('type');
- var kanbanID = $card.closest('.kanban').data('id');
-
- changeCardColType(card, fromColType, toColType, kanbanID);
-}
-
-$(function()
-{
- var kanbanGroup = window.kanbanGroup;
- if(!kanbanGroup) return;
-
- $('#kanban').kanban(
- {
- data: processKanbanData(),
- laneNameWidth: 5,
- virtualize: true,
- virtualCardList: true,
- droppable:
- {
- selector: '.kanban-item:not(.kanban-item-span)',
- target: findDropColumns,
- finish: handleFinishDrop,
- mouseButton: 'left'
- }
- });
-});
diff --git a/module/execution/js/grouptask.js b/module/execution/js/grouptask.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/execution/js/importbug.js b/module/execution/js/importbug.js
deleted file mode 100644
index 9464587e8b..0000000000
--- a/module/execution/js/importbug.js
+++ /dev/null
@@ -1,31 +0,0 @@
-$(function()
-{
- $(".preview").modalTrigger({width:1000, type:'iframe'});
- $('#' + browseType + 'Tab').addClass('active');
-
- if(isonlybody == true) parent.$('#triggerModal .modal-content .modal-header .close').hide();
-});
-
-/**
- * Go back.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function goback(executionID)
-{
- var link = createLink('execution', 'ajaxGetExecutionKanban', "executionID=" + executionID);
- $.get(link, function(data)
- {
- if(data)
- {
- kanbanData = $.parseJSON(data);
- parent.updateKanban(kanbanData);
- }
- else
- {
- parent.location.reload();
- }
- });
-}
diff --git a/module/execution/js/importtask.js b/module/execution/js/importtask.js
deleted file mode 100644
index f3626b5617..0000000000
--- a/module/execution/js/importtask.js
+++ /dev/null
@@ -1,23 +0,0 @@
-function reload(toProject, fromProject)
-{
- link = createLink('execution','importtask','toProject='+toProject + '&fromProject='+fromProject);
- location.href = link;
-}
-
-$(function()
-{
- $(".preview").modalTrigger({width:1000, type:'iframe'});
-
- if(isonlybody == true) parent.$('#triggerModal .modal-content .modal-header .close').hide();
-});
-
-/**
- * Go back.
- *
- * @access public
- * @return void
- */
-function goback()
-{
- parent.location.reload();
-}
diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js
deleted file mode 100644
index 0b0cc2fdda..0000000000
--- a/module/execution/js/kanban.js
+++ /dev/null
@@ -1,1878 +0,0 @@
-$(function()
-{
- $('#products').change(function()
- {
- var selectProductID = $('#products').val();
- var attr = createLink('story', 'batchCreate', 'productID=' + selectProductID + '&branch=0' + '&moduleID=0&story=0&execution=' + executionID, '', true);
- $('#batchCreateStoryButton').attr('href',attr);
- });
-})
-
-/**
- * When execution status change.
- *
- * @param stirng executionStatus
- * @access public
- * @return void
- */
-function changeStatus(executionStatus)
-{
- if(executionStatus == 'wait')
- {
- $('.startButton').removeClass('hidden');
- $('.putoffButton').removeClass('hidden');
- $('.suspendButton').removeClass('hidden');
- $('.closeButton').removeClass('hidden');
- $('.activateButton').addClass('hidden');
- }
- else if(executionStatus == 'doing')
- {
- $('.startButton').addClass('hidden');
- $('.putoffButton').removeClass('hidden');
- $('.suspendButton').removeClass('hidden');
- $('.closeButton').removeClass('hidden');
- $('.activateButton').addClass('hidden');
- }
- else if(executionStatus == 'suspended')
- {
- $('.startButton').addClass('hidden');
- $('.putoffButton').addClass('hidden');
- $('.suspendButton').addClass('hidden');
- $('.closeButton').removeClass('hidden');
- $('.activateButton').removeClass('hidden');
- }
- else if(executionStatus == 'closed')
- {
- $('.startButton').addClass('hidden');
- $('.putoffButton').addClass('hidden');
- $('.suspendButton').addClass('hidden');
- $('.closeButton').addClass('hidden');
- $('.activateButton').removeClass('hidden');
- }
-}
-
-/**
- * Hide all action.
- *
- * @access public
- * @return void
- */
-function hideAction()
-{
- $('.actions').hide();
- $('.action').hide();
- $('.avatar').removeAttr('data-toggle');
- $('.kanban-group-header').hide();
- $(".title").attr("disabled", true).css("pointer-events", "none");
- $(".avatar").attr("disabled", true).css("pointer-events", "none");
- window.sortableDisabled = true;
-}
-
-/**
- * Display the kanban in full screen.
- *
- * @access public
- * @return void
- */
-function fullScreen()
-{
- var element = document.getElementById('kanbanContainer');
- var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
-
- if(requestMethod)
- {
- var afterEnterFullscreen = function()
- {
- $('#kanbanContainer').addClass('fullscreen')
- .on('scroll', tryUpdateKanbanAffix);
-
- hideAction();
- $.cookie('isFullScreen', 1);
- };
-
- var whenFailEnterFullscreen = function(error)
- {
- exitFullScreen();
- };
-
- try
- {
- var result = requestMethod.call(element);
- if(result && (typeof result.then === 'function' || result instanceof window.Promise))
- {
- result.then(afterEnterFullscreen).catch(whenFailEnterFullscreen);
- }
- else
- {
- afterEnterFullscreen();
- }
- }
- catch (error)
- {
- whenFailEnterFullscreen(error);
- }
- }
-}
-
-/**
- * Exit full screen.
- *
- * @access public
- * @return void
- */
-function exitFullScreen()
-{
- $('#kanbanContainer').removeClass('fullscreen')
- .off('scroll', tryUpdateKanbanAffix);
- $('.actions').show();
- $('.action').show();
- $('.avatar').attr('data-toggle', 'modal');
- $('.kanban-group-header').show();
- $(".title").attr("disabled", false).css("pointer-events", "auto");
- $(".avatar").attr("disabled", false).css("pointer-events", "auto");
- window.sortableDisabled = false;
- $.cookie('isFullScreen', 0);
-}
-
-document.addEventListener('fullscreenchange', function (e)
-{
- if(!document.fullscreenElement) exitFullScreen();
-});
-
-document.addEventListener('webkitfullscreenchange', function (e)
-{
- if(!document.webkitFullscreenElement) exitFullScreen();
-});
-
-document.addEventListener('mozfullscreenchange', function (e)
-{
- if(!document.mozFullScreenElement) exitFullScreen();
-});
-
-document.addEventListener('msfullscreenChange', function (e)
-{
- if(!document.msfullscreenElement) exitFullScreen();
-});
-
-/** Change kanban scale size */
-function changeKanbanScaleSize(newScaleSize)
-{
- var newScaleSize = Math.max(1, Math.min(4, newScaleSize));
- if(newScaleSize === window.kanbanScaleSize) return;
-
- window.kanbanScaleSize = newScaleSize;
- $.zui.store.set('executionKanbanScaleSize', newScaleSize);
- $('#kanbanScaleSize').text(newScaleSize);
- $('#kanbanScaleControl .btn[data-type="+"]').attr('disabled', newScaleSize >= 4 ? 'disabled' : null);
- $('#kanbanScaleControl .btn[data-type="-"]').attr('disabled', newScaleSize <= 1 ? 'disabled' : null);
-
- if(groupBy == 'default')
- {
- $('#kanban').children('.region').children("div[id^='kanban']").each(function()
- {
- var kanban = $(this).data('zui.kanban');
- if(!kanban) return;
- kanban.setOptions({cardsPerRow: newScaleSize, cardHeight: getCardHeight()});
- });
- }
- else
- {
- var kanban = $('#kanban' + executionID).data('zui.kanban');
- if(!kanban) return;
- kanban.setOptions({cardsPerRow: newScaleSize, cardHeight: getCardHeight()});
- }
-
- if(laneCount == 1) resetRegionHeight('open');
-
- return newScaleSize;
-}
-
-/** Get card height */
-function getCardHeight()
-{
- return [60, 60, 62, 62, 47][window.kanbanScaleSize];
-}
-
-$('#type').change(function()
-{
- var type = $('#type').val();
- if(type != 'all')
- {
- $('.c-group').show();
- $.get(createLink('execution', 'ajaxGetGroup', 'type=' + type), function(data)
- {
- $('#group_chosen').remove();
- $('#group').replaceWith(data);
- $('#group').chosen();
- })
- }
-
- var link = createLink('execution', 'kanban', "executionID=" + executionID + '&browseType=' + type);
- location.href = link;
-});
-
-$('.c-group').change(function()
-{
- $('.c-group').show();
-
- var type = $('#type').val() ? $('#type').val() : browseType;
- var group = $('#group').val();
- var link = createLink('execution', 'kanban', 'executionID=' + executionID + '&type=' + type + '&orderBy=id_asc' + '&groupBy=' + group);
- location.href = link;
-});
-
-/**
- * Create lane menu.
- *
- * @param object $options
- * @access public
- * @return void
- */
-function createLaneMenu(options)
-{
- var lane = options.$trigger.closest('.kanban-lane').data('lane');
-
- var privs = lane.actions;
- if(!privs.length) return [];
-
- var items = [];
- var regionID = lane.$kanbanData.region;
- var kanbanID = lane.$kanbanData.kanban;
- if(privs.includes('editLaneName')) items.push({label: kanbanLang.editLaneName, icon: 'edit', url: createLink('kanban', 'editLaneName', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '635px'}});
- if(privs.includes('editLaneColor')) items.push({label: kanbanLang.editLaneColor, icon: 'color', url: createLink('kanban', 'editLaneColor', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '635px'}});
- if(privs.includes('deleteLane')) items.push({label: kanbanLang.deleteLane, icon: 'trash', url: createLink('kanban', 'deleteLane', 'regionID=' + regionID + '&kanbanID=' + kanbanID + '&lane=' + lane.id), attrs: {'target': 'hiddenwin'}});
-
- var bounds = options.$trigger[0].getBoundingClientRect();
- items.$options = {x: bounds.right, y: bounds.top};
- return items;
-}
-
-function createColumnMenu(options)
-{
- var column = options.$trigger.closest('.kanban-col').data('col');
- var privs = column.actions;
- if(!privs.length) return [];
-
- var items = [];
- if(privs.includes('setColumn')) items.push({label: kanbanLang.editColumn, icon: 'edit', url: createLink('kanban', 'setColumn', 'columnID=' + column.id + '&executionID=' + executionID + '&from=RDKanban', '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- if(privs.includes('setWIP')) items.push({label: kanbanLang.setWIP, icon: 'alert', url: createLink('kanban', 'setWIP', 'columnID=' + column.id + '&executionID=' + executionID + '&from=RDKanban', '' ,'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width' : '500px'}});
-
- var bounds = options.$trigger[0].getBoundingClientRect();
- items.$options = {x: bounds.right, y: bounds.top};
- return items;
-}
-
-/**
- * Create column create button menu
- * @returns {Object[]}
- */
-function createColumnCreateMenu(options)
-{
- var $col = options.$trigger.closest('.kanban-col');
- var col = $col.data('col');
- var items = [];
- var laneID = col.$kanbanData.lanes[0].id ? col.$kanbanData.lanes[0].id : 0;
- var regionID = col.$kanbanData.region == undefined ? 0 : col.$kanbanData.region;
-
- if(col.type == 'backlog')
- {
- if(priv.canCreateStory) items.push({label: storyLang.create, url: $.createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&objectID=' + executionID + '&bugID=0&planID=0&todoID=0&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canBatchCreateStory) items.push({label: executionLang.batchCreateStory, url: productCount > 1 ? '#batchCreateStory' : $.createLink('story', 'batchcreate', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&executionID=' + executionID + '&plan=0&type=story&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe',attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
- if(priv.canLinkStory) items.push({label: executionLang.linkStory, url: $.createLink('execution', 'linkStory', 'executionID=' + executionID + '&browseType=¶m=0&recPerPage=50,&pageID=1&extra=laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
- if(priv.canLinkStoryByPlan) items.push({label: executionLang.linkStoryByPlan, url: '#linkStoryByPlan', 'attrs' : {'data-toggle': 'modal', 'data-target': '#linkStoryByPlan','data-col' : col.id, 'data-lane' : laneID, 'class' : 'linkStoryByPlanButton'}});
- }
- else if(col.type == 'unconfirmed')
- {
- if(priv.canCreateBug) items.push({label: bugLang.create, url: $.createLink('bug', 'create', 'productID=' + productID + '&moduleID=0&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id + ',executionID=' + executionID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canBatchCreateBug)
- {
- if(productNum > 1) items.push({label: bugLang.batchCreate, url: '#batchCreateBug', 'attrs' : {'data-toggle': 'modal'}});
- else items.push({label: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=&executionID=' + executionID + '&module=0&extra=regionID=' + regionID + ',laneID=' + laneID + ',columnID=' + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
- }
- }
- else if(col.type == 'wait')
- {
- if(priv.canCreateTask) items.push({label: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID + "&storyID=0&moduleID=0&taskID=0&todoID=0&extra=regionID=" + regionID + ",laneID=" + laneID + ",columnID=" + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canBatchCreateTask) items.push({label: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID + "&storyID=0&moduleID=0&taskID=0&iframe=0&extra=regionID=" + regionID + ",laneID=" + laneID + ",columnID=" + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
- if(priv.canImportBug && vision == 'rnd') items.push({label: executionLang.importBug, url: $.createLink('execution', 'importBug', 'executionID=' + executionID + "&storyID=0&moduleID=0&taskID=0&todoID=0&extra=laneID=" + laneID + ",columnID=" + col.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '90%'}});
- }
- return items;
-}
-
-/**
- * Update region name.
- *
- * @param int $regionID
- * @param string $name
- * @access public
- * @return void
- */
-function updateRegionName(regionID, name)
-{
- $('.region[data-id="' + regionID + '"] > .region-header > strong:first').text(name);
-}
-
-/**
- * Update lane name.
- *
- * @param int $laneID
- * @param string $name
- * @access public
- * @return void
- */
-function updateLaneName(laneID, name)
-{
- $('.kanban-lane[data-id="' + laneID + '"] > .kanban-lane-name > span').text(name).attr('title', name);
-}
-
-/**
- * Update lane color.
- *
- * @param int $laneID
- * @param string $color
- * @access public
- * @return void
- */
-function updateLaneColor(laneID, color)
-{
- $('.kanban-lane[data-id="' + laneID + '"] > .kanban-lane-name').css('background-color', color);
-}
-
-/**
- * Update column name.
- *
- * @param int $columnID
- * @param string $name
- * @param string $color
- * @access public
- * @return void
- */
-function updateColumnName(columnID, name, color)
-{
- $('.kanban-col[data-id="' + columnID + '"] > div.title > span:first').text(name).attr('title', name).css('color', color);
-}
-
-/**
- * Hide kanban action
- */
-function hideKanbanAction()
-{
- $('.kanban').attr('data-action-enabled', null);
- $('.contextmenu').removeClass('contextmenu-show');
- $('.contextmenu .contextmenu-menu').removeClass('open').removeClass('in');
- $('#moreTasks, #moreColumns').animate({right: -400}, 500);
- $('.storyColumn').parent().removeClass('open');
-}
-
-/**
- * Handle finish drop task
- */
-function handleFinishDrop()
-{
- $('.kanban').find('.can-drop-here').removeClass('can-drop-here');
-}
-
-/* Define drag and drop rules */
-if(!window.kanbanDropRules)
-{
- window.kanbanDropRules =
- {
- story:
- {
- backlog: ['ready', 'backlog'],
- ready: ['backlog', 'ready'],
- tested: ['verified'],
- verified: ['tested', 'released'],
- released: ['verified', 'closed'],
- closed: ['released'],
- },
- bug:
- {
- 'unconfirmed': ['unconfirmed', 'confirmed', 'fixing', 'fixed'],
- 'confirmed': ['confirmed', 'fixing', 'fixed'],
- 'fixing': ['fixing', 'fixed'],
- 'fixed': ['fixed', 'testing', 'tested', 'fixing'],
- 'testing': ['testing', 'tested', 'closed', 'fixing'],
- 'tested': ['tested', 'closed', 'fixing'],
- 'closed': ['closed', 'fixing'],
- },
- task:
- {
- 'wait': ['wait', 'developing', 'developed', 'canceled'],
- 'developing': ['developing', 'developed', 'pause', 'canceled'],
- 'developed': ['developed', 'developing', 'closed'],
- 'pause': ['pause', 'developing', 'canceled'],
- 'canceled': ['canceled', 'developing', 'closed'],
- 'closed': ['closed', 'developing'],
- }
- }
-}
-
-/*
- * Find drop columns
- * @param {JQuery} $element Drag element
- * @param {JQuery} $root Dnd root element
- */
-function findDropColumns($element, $root)
-{
- var $col = $element.closest('.kanban-col');
- var col = $col.data();
- var laneType = $element.closest('.kanban-lane').data().lane.type;
- var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules[laneType] : null;
-
- hideKanbanAction();
-
- if(!kanbanRules) return $root.find('.kanban-lane-col:not([data-type="' + col.type + '"])');
-
- var colRules = kanbanRules[col.type];
- var groupID = $col.closest('.kanban-board').data().id;
- var oldLaneID = $col.closest('.kanban-lane').data().id;
- return $root.find('.kanban-lane-col').filter(function()
- {
- if(!colRules) return false;
- if(colRules === true) return true;
- if($.cookie('isFullScreen') == 1) return false;
-
- var $newCol = $(this);
- var newCol = $newCol.data();
- var newGroupID = $newCol.closest('.kanban-board').data().id;
- var newLaneID = $newCol.closest('.kanban-lane').data().id;
-
- var canDropHere = colRules.indexOf(newCol.type) > -1 && newGroupID === groupID;
- if(groupBy && groupBy != 'default' && canDropHere) canDropHere = oldLaneID === newLaneID;
- if(canDropHere) $newCol.addClass('can-drop-here');
- return canDropHere;
- });
-}
-
-/**
- * Render user avatar
- *
- * @param array $user
- * @param string $objectType
- * @param int $objectID
- * @param int $size
- * @param string $objectStatus
- * @access public
- * @return void
- */
-function renderUserAvatar(user, objectType, objectID, size, objectStatus)
-{
- var avatarSizeClass = 'avatar-' + (size || 'sm');
- var $noPrivAndNoAssigned = $('
');
- if(objectType == 'task')
- {
- if(!priv.canAssignTask && !user) return $noPrivAndNoAssigned;
- var link = createLink('task', 'assignto', 'executionID=' + executionID + '&id=' + objectID + '&kanbanGroup=' + groupBy, '', true);
- }
- if(objectType == 'story')
- {
- if(!priv.canAssignStory && !user) return $noPrivAndNoAssigned;
- var link = createLink('story', 'assignto', 'id=' + objectID + '&kanbanGroup=' + groupBy, '', true);
- }
- if(objectType == 'bug')
- {
- if(!priv.canAssignBug && !user) return $noPrivAndNoAssigned;
- var link = createLink('bug', 'assignto', 'id=' + objectID + '&kanbanGroup=' + groupBy, '', true);
- }
-
- if(!user) return objectStatus == 'closed' ? '' : $('
');
-
- if(typeof user === 'string') user = {account: user};
- if(!user.avatar && window.userList && window.userList[user.account]) user = {avatar: userList[user.account].avatar, account: user.account, realname: userList[user.account].realname};
-
- var $noPrivAvatar = $('
').avatar({user: user});
- if(objectType == 'task' && !priv.canAssignTask) return $noPrivAvatar;
- if(objectType == 'story' && !priv.canAssignStory) return $noPrivAvatar;
- if(objectType == 'bug' && !priv.canAssignBug) return $noPrivAvatar;
-
- var realname = user.realname ? user.realname : user.account;
- return objectStatus == 'closed' ? '' : $('
').avatar({user: user}).attr('data-toggle', 'modal').attr('data-width', '80%');
-}
-
-/**
- * Render deadline
- * @param {String|Date} deadline Deadline
- * @param {string} status
- * @returns {JQuery}
- */
-function renderDeadline(deadline, status)
-{
- if(deadline == '0000-00-00') return;
-
- var date = $.zui.createDate(deadline);
- var now = new Date();
- now.setHours(0);
- now.setMinutes(0);
- now.setSeconds(0);
- now.setMilliseconds(0);
- var isEarlyThanToday = date.getTime() < now.getTime();
- var deadlineDate = $.zui.formatDate(date, 'MM-dd');
- var statusList = ['doing','pause'];
- var textColor = isEarlyThanToday && typeof(status) != 'undefined' && statusList.indexOf(status) != -1 ? 'text-red' : 'text-muted';
-
- return $('
').text(deadlineLang + ' ' + deadlineDate).addClass(textColor);
-}
-
-/**
- * Render estStarted
- *
- * @param {String|Date} estStarted EstStarted
- * @param {string} status
- * @access public
- * @return void
- */
-function renderEstStarted(estStarted, status)
-{
- if(estStarted == '0000-00-00') return;
-
- var date = $.zui.createDate(estStarted);
- var now = new Date();
- now.setHours(0);
- now.setMinutes(0);
- now.setSeconds(0);
- now.setMilliseconds(0);
- var isEarlyThanToday = date.getTime() < now.getTime();
- var estStartedDate = $.zui.formatDate(date, 'MM-dd');
- var textColor = isEarlyThanToday && typeof(status) != 'undefined' && status == 'wait' ? 'text-red' : 'text-muted';
-
- return $('
').text(estStartedLang + ' ' + estStartedDate).addClass(textColor);
-}
-
-/**
- * Render story item
- * @param {Object} item Story item object
- * @param {JQuery} $item Kanban item element
- * @param {Object} col Column object
- * @returns {JQuery} $item Kanban item element
- */
-function renderStoryItem(item, $item, col)
-{
- if(groupBy == 'story' && item.id == '0')
- {
- $('.storyCell').css('width', '100%');
- $parentItem = $item[0] == undefined ? $('.storyCell') : $item.parent();
- $parentItem.addClass('text-center storyCell');
- $parentItem.css('line-height', ($parentItem.parent().height() - 20) + 'px');
- $item.replaceWith('
' + item.title + '');
- return;
- }
- var scaleSize = window.kanbanScaleSize;
- if(+$item.attr('data-scale-size') !== scaleSize) $item.empty().attr('data-scale-size', scaleSize);
-
- if(scaleSize <= 3)
- {
- var $title = $item.find('.title');
- if(!$title.length)
- {
- $title = $('
' + (scaleSize <= 1 ? ' ' : '') + '');
- if(priv.canViewStory) $title = $title.attr('href', $.createLink('execution', 'storyView', 'storyID=' + item.id + '&executionID=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%');
- $title.appendTo($item);
- }
- var title = rdSearchValue != '' ? "
" + item.title.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "
" + item.title + "";
- $title.attr('title', item.title).find('.text').replaceWith(title);
- }
-
- if(scaleSize <= 2)
- {
- var idHtml = scaleSize <= 1 ? ('
#' + item.id + '') : '';
- var priHtml = '
' + item.pri + '';
- var hoursHtml = (item.estimate && scaleSize <= 1) ? ('
' + item.estimate + hourUnit + '') : '';
- var avatarHtml = renderUserAvatar(item.assignedTo, 'story', item.id, '', col.type);
- var $infos = $item.find('.infos');
- if(!$infos.length) $infos = $('
');
- $infos.html([idHtml, priHtml, hoursHtml].join(''));
-
- $infos[scaleSize <= 1 ? 'append' : 'prepend'](avatarHtml);
- if(scaleSize <= 1) $infos.appendTo($item);
- else if(scaleSize === 2) $infos.prependTo($item);
- else $infos.prependTo($item.find('.title'));
- }
- else if(scaleSize === 4)
- {
- $item.html(renderUserAvatar(item.assignedTo, 'story', item.id, 'md'));
- }
-
- if(scaleSize <= 1)
- {
- var $actions = $item.find('.actions');
- if(!$actions.length && (priv.canEditStory || priv.canActivateStory || priv.canChangeStory || priv.canCreateTask || priv.canBatchCreate || priv.canUnlinkStory))
- {
- $actions = $([
- '
'
- ].join('')).appendTo($item);
- }
- }
-
- if($.cookie('isFullScreen') == 1) hideAction();
-
- return $item.attr('data-type', 'story').addClass('kanban-item-story');
-}
-
-/**
- * Render bug item
- * @param {Object} item Bug item object
- * @param {JQuery} $item Kanban item element
- * @param {Object} col Column object
- * @returns {JQuery} $item Kanban item element
- */
-function renderBugItem(item, $item, col)
-{
- var scaleSize = window.kanbanScaleSize;
- if(+$item.attr('data-scale-size') !== scaleSize) $item.empty().attr('data-scale-size', scaleSize);
-
- if(scaleSize <= 3)
- {
- var $title = $item.find('.title');
- if(!$title.length)
- {
- $title = $('
' + (scaleSize <= 1 ? ' ' : '') + '');
- if(priv.canViewBug) $title =$title.attr('href', $.createLink('bug', 'view', 'bugID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%');
- $title.appendTo($item);
- }
- var title = rdSearchValue != '' ? "
" + item.title.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "
" + item.title + "";
- $title.attr('title', item.title).find('.text').replaceWith(title);
- }
-
- if(scaleSize <= 2)
- {
- var idHtml = scaleSize <= 1 ? ('
#' + item.id + '') : '';
- var severityHtml = scaleSize <= 1 ? ('
') : '';
- var priHtml = '
' + item.pri + '';
- var avatarHtml = renderUserAvatar(item.assignedTo, 'bug', item.id, '', col.type);
-
- var $infos = $item.find('.infos');
- if(!$infos.length) $infos = $('
');
- $infos.html([idHtml, severityHtml, priHtml].join(''));
- if(item.deadline && scaleSize <= 1) $infos.append(renderDeadline(item.deadline));
- $infos[scaleSize <= 1 ? 'append' : 'prepend'](avatarHtml);
-
- if(scaleSize <= 1) $infos.appendTo($item);
- else if(scaleSize === 2) $infos.prependTo($item);
- else $infos.prependTo($item.find('.title'));
- }
- else if(scaleSize === 4)
- {
- $item.html(renderUserAvatar(item.assignedTo, 'bug', item.id, 'md'));
- }
-
- if(scaleSize <= 1)
- {
- var $actions = $item.find('.actions');
- if(!$actions.length && (priv.canEditBug || priv.canResolveBug || priv.canConfirmBug || priv.canCopyBug || priv.canToStoryBug || priv.canDeleteBug))
- {
- $actions = $([
- '
'
- ].join('')).appendTo($item);
- }
- }
-
- if($.cookie('isFullScreen') == 1) hideAction();
-
- return $item.attr('data-type', 'bug').addClass('kanban-item-bug');
-}
-
-/**
- * Render task item
- * @param {Object} item Task item object
- * @param {JQuery} $item Kanban item element
- * @param {Object} col Column object
- * @returns {JQuery} $item Kanban item element
- */
-function renderTaskItem(item, $item, col)
-{
- var scaleSize = window.kanbanScaleSize;
- if(+$item.attr('data-scale-size') !== scaleSize) $item.empty().attr('data-scale-size', scaleSize);
-
- if(scaleSize <= 3)
- {
- var $title = $item.find('.title');
- if(!$title.length)
- {
- $title = $('
' + (scaleSize <= 1 ? ' ' : '') + '');
- if(priv.canViewTask) $title = $title.attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%');
- $title.appendTo($item);
- }
- var name = rdSearchValue != '' ? "
" + item.name.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "
" + item.name + "";
- $title.attr('title', item.name).find('.text').replaceWith(name);
- }
-
- if(scaleSize <= 2)
- {
- var priHtml = '
' + item.pri + '';
- var hoursHtml = scaleSize <= 1 && item.status != 'wait' ? ('
' + taskLang.leftAB + ' ' + item.left + 'h') : ('
' + taskLang.estimateAB + ' ' + item.estimate + 'h');
- var avatarHtml = renderUserAvatar(item.assignedTo, 'task', item.id, '', col.type);
-
- var $infos = $item.find('.infos');
- if(!$infos.length) $infos = $('
');
- $infos.html([priHtml, hoursHtml].join(''));
- if(item.deadline && scaleSize <= 1 && (item.status == 'doing' || item.status == 'pause')) $infos.append(renderDeadline(item.deadline, item.status));
- if(item.estStarted && scaleSize <= 1 && item.status == 'wait') $infos.append(renderEstStarted(item.estStarted, item.status));
- $infos[scaleSize <= 1 ? 'append' : 'prepend'](avatarHtml);
-
- if(scaleSize <= 1) $infos.appendTo($item);
- else if(scaleSize === 2) $infos.prependTo($item);
- else $infos.prependTo($item.find('.title'));
- }
- else if(scaleSize === 4)
- {
- $item.html(renderUserAvatar(item.assignedTo, 'task', item.id, 'md'));
- }
-
- if(scaleSize <= 1)
- {
- var $actions = $item.find('.actions');
- if(!$actions.length && (priv.canEditTask || priv.canRecordWorkhourTask || priv.canCreateTask || priv.canCancelTask))
- {
- $actions = $([
- '
'
- ].join('')).appendTo($item);
- }
- }
-
- $item.attr('data-type', 'task').addClass('kanban-item-task');
-
- if($.cookie('isFullScreen') == 1) hideAction();
-
- return $item;
-}
-
-/* Add column renderer */
-addColumnRenderer('story', renderStoryItem);
-addColumnRenderer('bug', renderBugItem);
-addColumnRenderer('task', renderTaskItem);
-
-/**
- * Render items count of a column.
- */
-function renderCount($count, count, column)
-{
- if(groupBy == 'story' && column.type == 'story')
- {
- var orderButton = '
'
- + ""
- + ''
- + '';
-
- $count.parent().next().html(orderButton);
- $count.parent().next().addClass('createButton');
- $count.remove();
- return;
- }
-
- /* Render WIP. */
- var limit = !column.limit || column.limit == '-1' ? '
' : column.limit;
- if($count.parent().find('.limit').length)
- {
- $count.parent().find('.limit').html(limit);
- }
- else
- {
- $count.parent().find('.count').before("
(");
- $count.parent().find('.count').after("
/" + limit + ")");
- }
-
- if(column.limit != -1 && column.limit < count)
- {
- $count.parents('.title').parent('.kanban-header-col').css('background-color', '#F6A1A1');
- $count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 200);
- $count.css('color', '#E33030');
- if(!$count.parent().find('.error').length) $count.parent().find('.include-last').after("
");
- }
- else
- {
- $count.parents('.title').parent('.kanban-header-col').css('background-color', 'transparent');
- $count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 120);
- $count.css('color', '#8B91A2');
- $count.parent().find('.error').remove();
- }
-}
-
-/**
- * Alert to link product.
- *
- * @access public
- * @return void
- */
-function tips()
-{
- bootbox.alert(needLinkProducts);
-}
-
-/**
- * Render header of a column.
- */
-function renderHeaderCol($column, column, $header, kanbanData)
-{
- if(groupBy == 'story' && column.type == 'story') return;
- /* Render group header. */
- var privs = kanbanData.actions;
- var columnPrivs = kanbanData.columns[0].actions;
- var $actions = $column.children('.actions');
-
- if(column.parent == -1)
- {
- $column.append('
');
- $actions = $column.children('.actions');
- }
-
- if(groupBy == 'default' && privs.includes('sortGroup'))
- {
- var groups = regions[column.region].groups;
- if($header.closest('.kanban').data('zui.kanban'))
- {
- groups = $header.closest('.kanban').data('zui.kanban').data;
- }
- if(groups.length > 1)
- {
- $column.closest('.kanban-board').addClass('sort');
- $column.closest('.kanban-header').find('.kanban-group-header').remove();
- $column.closest('.kanban-header').prepend('');
- }
- }
-
- var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP'));
-
- /* Render more menu. */
- if((column.type == 'backlog' || column.type == 'wait' || column.type == 'unconfirmed') && $actions.children('.text-primary').length == 0)
- {
- var tips = productID ? '' : 'onclick="tips()"';
- $actions.append([
- '
',
- '',
- ''
- ].join(''));
- }
- if(printMoreBtn && $actions.children('.btn').length == 0)
- {
- $actions.append('
');
- }
-}
-
-/**
- * Render lane name.
- *
- * @param object $lane
- * @param int lane
- * @param object $kanban
- * @param array columns
- * @param object $kanban
- * @access public
- * @return void
- */
-function renderLaneName($lane, lane, $kanban, columns, kanban)
-{
- if(groupBy == 'story')
- {
- $lane.hide();
- return;
- }
- if(groupBy != 'default') return;
- var canEditLaneColor = lane.actions.includes('editLaneColor');
- var canEditLaneName = lane.actions.includes('editLaneName');
- var canSort = lane.actions.includes('sortLane') && kanban.lanes.length > 1;
- var canDelete = lane.actions.includes('deleteLane');
-
- $lane.parent().toggleClass('sort', canSort);
-
- if(!$lane.children('.actions').length && (canEditLaneColor || canEditLaneName || canDelete))
- {
- $([
- '
'
- ].join('')).appendTo($lane);
- }
-}
-
-/**
- * Update a region.
- *
- * @param int regionID
- * @param array regionData
- * @access public
- * @return boolean
- */
-function updateRegion(regionID, regionData = [])
-{
- if(groupBy != 'default') regionID = executionID;
-
- if(!regionID) return false;
-
- var $region = $('#kanban'+ regionID).kanban();
-
- if(!$region.length) return false;
- if(!regionData) regionData = regions[regionID];
-
- var data = groupBy == 'default' ? regionData.groups : regionData;
- if((data == null || data.length == 0) && rdSearchValue != '')
- {
- if(groupBy == 'default') $("div[data-id^=" + regionID + "].region").hide();
- if(groupBy != 'default') $("div[data-id^=" + regionID + "].kanban").hide();
- return false;
- }
- else
- {
- if(groupBy == 'default') $("div[data-id^=" + regionID + "].region").show();
- if(groupBy != 'default') $("div[data-id^=" + regionID + "].kanban").show();
- }
- $region.data('zui.kanban').render(data);
- resetRegionHeight('open');
- return true;
-}
-
-/**
- * Handle drop task.
- *
- * @param object $element
- * @param object $event
- * @param object $kanban
- * @access public
- * @return void
- */
-function handleDropTask($element, event, kanban)
-{
- if(!event.target || !event.isNew) return;
-
- var $card = $element;
- var $oldCol = $card.closest('.kanban-col');
- var $newCol = $(event.target).closest('.kanban-col');
- var oldCol = $oldCol.data();
- var newCol = $newCol.data();
- var oldLane = $oldCol.closest('.kanban-lane').data('lane');
- var newLane = $newCol.closest('.kanban-lane').data('lane');
- var cardType = $card.find('.kanban-card').data('type');
-
- if(!oldCol || !newCol || !newLane || !oldLane) return false;
- if(oldCol.id === newCol.id && newLane.id === oldLane.id) return false;
-
- var cardID = $card.data().id;
- var fromColType = $oldCol.data('type');
- var toColType = $newCol.data('type');
- var regionID = $card.closest('.region').data().id;
-
- changeCardColType(cardID, oldCol.id, newCol.id, oldLane.id, newLane.id, cardType, fromColType, toColType, regionID);
-}
-
-var kanbanActionHandlers =
-{
- dropItem: handleDropTask
-};
-
-/**
- * Handle kanban action
- */
-function handleKanbanAction(action, $element, event, kanban)
-{
- $('.kanban').attr('data-action-enabled', action);
- var handler = kanbanActionHandlers[action];
- if(handler) handler($element, event, kanban);
-}
-
-/**
- * changeCardColType
- *
- * @param int cardID
- * @param int fromColID
- * @param int toColID
- * @param int fromLaneID
- * @param int toLaneID
- * @param string cardType
- * @param string fromColType
- * @param string toColType
- * @param int regionID
- * @access public
- * @return void
- */
-function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, cardType, fromColType, toColType, regionID = 0)
-{
- var objectID = cardID;
- var showIframe = false;
- var moveCard = false;
-
- regionID = regionID ? regionID : 0;
-
- /* Task lane. */
- if(cardType == 'task')
- {
- if(toColType == 'developed')
- {
- if((fromColType == 'developing' || fromColType == 'wait') && priv.canFinishTask)
- {
- var link = createLink('task', 'finish', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'pause')
- {
- if(fromColType == 'developing' && priv.canPauseTask)
- {
- var link = createLink('task', 'pause', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'developing')
- {
- if((fromColType == 'canceled' || fromColType == 'closed' || fromColType == 'developed') && priv.canActivateTask)
- {
- var link = createLink('task', 'activate', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- if(fromColType == 'pause' && priv.canActivateTask)
- {
- var link = createLink('task', 'restart', 'taskID=' + objectID, '', true);
- showIframe = true;
- }
- if(fromColType == 'wait' && priv.canStartTask)
- {
- var link = createLink('task', 'start', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'canceled')
- {
- if((fromColType == 'developing' || fromColType == 'wait' || fromColType == 'pause') && priv.canCancelTask)
- {
- var link = createLink('task', 'cancel', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'closed')
- {
- if((fromColType == 'developed' || fromColType == 'canceled') && priv.canCloseTask)
- {
- var link = createLink('task', 'close', 'taskID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
-
- if(fromLaneID != toLaneID && fromColID == toColID) shiftCard(objectID, fromColID, toColID, fromLaneID, toLaneID, regionID);
- }
-
- /* Bug lane. */
- if(cardType == 'bug')
- {
- if(toColType == 'confirmed')
- {
- if(fromColType == 'unconfirmed' && priv.canConfirmBug)
- {
- var link = createLink('bug', 'confirm', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'fixing')
- {
- if(fromColType == 'confirmed' || fromColType == 'unconfirmed') moveCard = true;
- if((fromColType == 'closed' || fromColType == 'fixed' || fromColType == 'testing' || fromColType == 'tested') && priv.canActivateBug)
- {
- var link = createLink('bug', 'activate', 'bugID=' + objectID + '&kanbanInfo=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'fixed')
- {
- if(fromColType == 'fixing' || fromColType == 'confirmed' || fromColType == 'unconfirmed')
- {
- var link = createLink('bug', 'resolve', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'testing')
- {
- if(fromColType == 'fixed') moveCard = true;
- }
- else if(toColType == 'tested')
- {
- if(fromColType == 'fixed' || fromColType == 'testing') moveCard = true;
- }
- else if(toColType == 'closed')
- {
- if(fromColType == 'testing' || fromColType == 'tested')
- {
- var link = createLink('bug', 'close', 'bugID=' + objectID + '&extra=fromColID=' + fromColID + ',toColID=' + toColID + ',fromLaneID=' + fromLaneID + ',toLaneID=' + toLaneID + ',regionID=' + regionID, '', true);
- showIframe = true;
- }
- }
-
- if(moveCard || (fromLaneID != toLaneID && fromColID == toColID)) shiftCard(objectID, fromColID, toColID, fromLaneID, toLaneID, regionID);
- }
-
- /* Story lane. */
- if(cardType == 'story')
- {
- if(toColType == 'closed' && priv.canCloseStory)
- {
- var link = createLink('story', 'close', 'storyID=' + objectID, '', true);
- showIframe = true;
- }
- else
- {
- if(toColType == 'ready')
- {
- $.get(createLink('story', 'ajaxGetInfo', "storyID=" + cardID), function(data)
- {
- if(data)
- {
- data = $.parseJSON(data);
- if(data.status == 'draft' || data.status == 'changing' || data.status == 'reviewing')
- {
- bootbox.alert(executionLang.storyDragError);
- }
- else
- {
- ajaxMoveCard(objectID, fromColID, toColID, fromLaneID, toLaneID, regionID);
- }
- }
- });
- }
- else
- {
- ajaxMoveCard(objectID, fromColID, toColID, fromLaneID, toLaneID, regionID);
- }
-
- }
- }
-
- if(showIframe)
- {
- var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%', url: link});
- modalTrigger.show();
- }
-}
-
-/**
- * AJAX: move card.
- *
- * @param int $objectID
- * @param int $fromColID
- * @param int $toColID
- * @param int $fromLaneID
- * @param int $toLaneID
- * @param int $regionID
- * @access public
- * @return void
- */
-function ajaxMoveCard(objectID, fromColID, toColID, fromLaneID, toLaneID, regionID)
-{
- var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy + '®ionID=' + regionID+ '&orderBy=' + orderBy );
- $.ajax(
- {
- method: 'post',
- dataType: 'json',
- url: link,
- success: function(data)
- {
- data = groupBy == 'default' ? data[regionID] : data[groupBy];
- updateRegion(regionID, data);
- },
- error: function(xhr, status, error)
- {
- showErrorMessager(error || lang.timeout);
- }
- });
-}
-
-/**
- * Delete a card.
- *
- * @param string objectType
- * @param int objectID
- * @param int regionID
- * @access public
- * @return void
- */
-function deleteCard(objectType, objectID, regionID)
-{
- $.zui.ContextMenu.hide();
-
- regionID = regionID ? regionID : 0;
- setTimeout(function()
- {
- var objectLang = objectType + 'Lang';
- var result = confirm(window[objectLang].confirmDelete);
-
- if(!result || !objectID) return false;
-
- var url = createLink('kanban', 'deleteObjectCard', 'objectType=' + objectType + '&objectID=' + objectID + '®ionID=' + regionID);
- return $.ajax(
- {
- method: 'post',
- dataType: 'json',
- url: url,
- success: function(data)
- {
- data = groupBy == 'default' ? data[regionID] : data[groupBy];
- updateRegion(regionID, data);
- }
- });
- }, 200)
-}
-
-/**
- * Close modal and update kanban data.
- *
- * @param string kanbanData
- * @param int regionID
- * @access public
- * @return void
- */
-function updateKanban(kanbanData, regionID)
-{
- if(typeof(regionID) == 'undefined') regionID = 0;
- setTimeout(function()
- {
- $.zui.closeModal();
- if(regionID && groupBy == 'default')
- {
- updateRegion(regionID, kanbanData[regionID]);
- }
- else
- {
- $('#kanban').children('.region').children("div[id^='kanban']").each(function()
- {
- var regionID = $(this).attr('data-id');
- var data = groupBy == 'default' ? kanbanData[regionID] : kanbanData[groupBy]
- updateRegion(regionID, data);
- });
- }
- }, 200);
- resetRegionHeight('open');
-}
-
-/**
- * Shift card.
- *
- * @param int objectID
- * @param int fromColID
- * @param int toColID
- * @param int fromLaneID
- * @param int toLaneID
- * @param int regionID
- * @access public
- * @return void
- */
-function shiftCard(objectID, fromColID, toColID, fromLaneID, toLaneID, regionID)
-{
- var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy + '®ionID=' + regionID + '&orderBy=' + orderBy );
- $.ajax(
- {
- method: 'post',
- dataType: 'json',
- url: link,
- success: function(data)
- {
- data = groupBy == 'default' ? data[regionID] : data[groupBy];
- updateRegion(regionID, data);
- },
- error: function(xhr, status, error)
- {
- showErrorMessager(error || lang.timeout);
- }
- });
-}
-
-/**
- * Process minus button.
- *
- * @access public
- * @return void
- */
-function processMinusBtn()
-{
- var columnCount = $('#splitTable .child-column').size();
- if(columnCount > 2 && columnCount < 10)
- {
- $('#splitTable .btn-plus').show();
- $('#splitTable .btn-close').show();
- }
- else if(columnCount <= 2)
- {
- $('#splitTable .btn-close').hide();
- }
- else if(columnCount >= 10)
- {
- $('#splitTable .btn-plus').hide();
- }
-}
-
- /**
- * Create story menu
- * @returns {Object[]}
- */
-function createStoryMenu(options)
-{
- var $card = options.$trigger.closest('.kanban-item');
- var story = $card.data('item');
-
- var items = [];
- var showAction = story.$col.type == 'backlog' || story.$col.type == 'ready' || story.$col.type == 'developing' || story.$col.type == 'developed' || story.$col.type == 'testing' || story.$col.type == 'tested' || story.$col.type == 'verified' || story.$col.type == 'released';
-
- if(priv.canEditStory) items.push({label: storyLang.edit, icon: 'edit', url: createLink('story', 'edit', 'storyID=' + story.id + '&kanbanGroup=' + groupBy, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '95%'}});
- if(priv.canChangeStory && showAction && story.status == 'active') items.push({label: storyLang.change, icon: 'change', url: createLink('story', 'change', 'storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canCreateTask && showAction && story.status == 'active') items.push({label: executionLang.wbs, icon: 'plus', url: createLink('task', 'create', 'executionID=' + execution.id + '&storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canBatchCreateTask && showAction && story.status == 'active') items.push({label: executionLang.batchWBS, icon: 'pluses', url: createLink('task', 'batchCreate', 'executionID=' + execution.id + '&storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canActivateStory && story.$col.type == 'closed') items.push({label: executionLang.activate, icon: 'magic', url: createLink('story', 'activate', 'storyID=' + story.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canUnlinkStory) items.push({label: executionLang.unlinkStory, icon: 'unlink', url: createLink('execution', 'unlinkStory', 'executionID=' + execution.id + '&storyID=' + story.id + '&confirm=no&from=' + '&laneID=' + story.lane + '&columnID=' + story.column, '', 'false'), attrs: {target: 'hiddenwin'}});
- if(priv.canDeleteStory) items.push({label: storyLang.delete, icon: 'trash', onClick: function(){deleteCard('story', story.id, story.$lane.region)}});
- return items;
-}
-
- /**
- * Create task menu
- * @returns {Object[]}
- */
-function createTaskMenu(options)
-{
- var $card = options.$trigger.closest('.kanban-item');
- var task = $card.data('item');
- var items = [];
- if(priv.canEditTask) items.push({label: taskLang.edit, icon: 'edit', url: createLink('task', 'edit', 'taskID=' + task.id + '&comment=&kanbanGroup=' + groupBy, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '95%'}});
- if(priv.canRestartTask && task.$col.type == 'pause') items.push({label: taskLang.restart, icon: 'play', url: createLink('task', 'restart', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canPauseTask && task.$col.type == 'developing') items.push({label: taskLang.pause, icon: 'pause', url: createLink('task', 'pause', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canRecordWorkhourTask) items.push({label: executionLang.effort, icon: 'time', url: createLink('task', 'recordWorkhour', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canActivateTask && (task.$col.type == 'developed' || task.$col.type == 'canceled' || task.$col.type == 'closed')) items.push({label: executionLang.activate, icon: 'magic', url: createLink('task', 'activate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canCreateTask) items.push({label: taskLang.copy, icon: 'copy', url: createLink('task', 'create', 'executionID=' + executionID + '&storyID=' + '0' + '&moduleID=' + '0' + '&taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canCancelTask && (task.$col.type == 'wait' || task.$col.type == 'developing' || task.$col.type == 'pause')) items.push({label: taskLang.cancel, icon: 'cancel', url: createLink('task', 'cancel', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canDeleteTask) items.push({label: taskLang.delete, icon: 'trash', onClick: function(){deleteCard('task', task.id, task.$lane.region)}});
- return items;
-}
-
- /**
- * Create bug menu
- * @returns {Object[]}
- */
-function createBugMenu(options)
-{
- var $card = options.$trigger.closest('.kanban-item');
- var bug = $card.data('item');
- var items = [];
- if(priv.canEditBug) items.push({label: bugLang.edit, icon: 'edit', url: createLink('bug', 'edit', 'bugID=' + bug.id + '&comment=&kanbanGroup=' + groupBy, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '95%'}});
- if(priv.canResolveBug && (bug.$col.type == 'unconfirmed' || bug.$col.type == 'confirmed' || bug.$col.type == 'fixing')) items.push({label: bugLang.resolve, icon: 'checked', url: createLink('bug', 'resolve', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canConfirmBug && (bug.$col.type == 'fixed' || bug.$col.type == 'testing' || bug.$col.type == 'tested')) items.push({label: bugLang.close, icon: 'off', url: createLink('bug', 'close', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canConfirmBug && bug.$col.type == 'unconfirmed') items.push({label: bugLang.confirm, icon: 'ok', url: createLink('bug', 'confirm', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canCopyBug) items.push({label: bugLang.copy, icon: 'copy', url: createLink('bug', 'create', 'productID=' + productID + '&branch=&extras=bugID=' + bug.id + ',regionID=' + bug.$lane.region + ',laneID=' + bug.lane + ',columnID=' + bug.column + ',executionID=' + executionID, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canToStoryBug && (bug.$col.type != 'closed')) items.push({label: bugLang.toStory, icon: 'lightbulb', url: createLink('story', 'create', 'product=' + productID + '&branch=' + '0' + '&module=' + '0' + '&story=' + '0' + '&execution=' + '0' + '&bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canActivateBug && (bug.$col.type == 'fixed') || bug.$col.type == 'testing' || bug.$col.type == 'tested' || bug.$col.type == 'closed') items.push({label: bugLang.activate, icon: 'magic', url: createLink('bug', 'activate', 'bugID=' + bug.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(priv.canDeleteBug) items.push({label: bugLang.delete, icon: 'trash', onClick: function(){deleteCard('bug', bug.id, bug.$lane.region)}});
- return items;
-}
-
-/**
- * Handle sort cards.
- *
- * @param object event
-* @access public
- * @return void
- */
-function handleSortCards(event)
-{
- if(window.sortableDisabled || groupBy != 'default' || rdSearchValue != '') return;
- var newLaneID = event.element.closest('.kanban-lane').data('id');
- var newColID = event.element.closest('.kanban-col').data('id');
- var cards = event.element.closest('.kanban-lane-items').data('cards');
- var orders = cards.map(function(card){return card.id});
- var fromID = String(event.element.data('id'));
- var toID = String(event.target.data('id'));
-
- orders.splice(orders.indexOf(fromID), 1);
- orders.splice(orders.indexOf(toID) + (event.insert === 'before' ? 0 : 1), 0, fromID);
-
- var url = createLink('kanban', 'sortCard', 'kanbanID=' + executionID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(','));
- $.getJSON(url, function(response)
- {
- if(response.result === 'fail')
- {
- if(typeof response.message === 'string' && response.message.length)
- {
- bootbox.alert(response.message);
- }
- setTimeout(function(){return location.reload()}, 3000);
- }
- else
- {
- $.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=0&browseType=" + browseType + "&groupBy=" + groupBy + '&from=RD' + '&serachValue=' + rdSearchValue + '&orderBy=' + orderBy), function(data)
- {
- if(data && lastUpdateData !== data)
- {
- lastUpdateData = data;
- kanbanData = $.parseJSON(data);
- for(var region in kanbanData)
- {
- updateRegion(region, kanbanData[region]);
- }
- }
- });
- }
- });
-}
-
-/* Define menu creators */
-window.menuCreators =
-{
- lane: createLaneMenu,
- column: createColumnMenu,
- columnCreate: createColumnCreateMenu,
- task: createTaskMenu,
- story: createStoryMenu,
- bug: createBugMenu,
-};
-
-/**
- * Init kanban.
- *
- * @param object $kanban
- * @access public
- * @return void
- */
-function initKanban($kanban)
-{
- var id = $kanban.data('id');
- var region = regions[id];
-
- $kanban.kanban(
- {
- data: groupBy == 'default' ? region.groups : kanbanData[groupBy],
- maxColHeight: 'auto',
- calcColHeight: calcColHeight,
- minColWidth: typeof window.minColWidth === 'number' ? window.minColWidth : defaultMinColWidth,
- maxColWidth: typeof window.maxColWidth === 'number' ? window.maxColWidth : defaultMaxColWidth,
- cardHeight: getCardHeight(),
- fluidBoardWidth: fluidBoard,
- displayCards: typeof window.displayCards === 'number' ? window.displayCards : 2,
- createColumnText: kanbanLang.createColumn,
- addItemText: '',
- cardsPerRow: window.kanbanScaleSize,
- onAction: handleKanbanAction,
- onRenderLaneName: renderLaneName,
- onRenderHeaderCol: renderHeaderCol,
- onRenderCount: renderCount,
- droppable: {target: findDropColumns, finish:handleFinishDrop},
- sortable: handleSortCards,
- virtualize: true,
- virtualCardList: true,
- virtualRenderOptions: {container: $(window).add($('#kanbanContainer'))}
- });
-
- $kanban.on('click', '.action-cancel', hideKanbanAction);
- $kanban.on('scroll', function()
- {
- $.zui.ContextMenu.hide();
- });
- var kanbanMinColWidth = typeof window.minColWidth === 'number' ? window.minColWidth : defaultMinColWidth;
- if(kanbanMinColWidth < 190)
- {
- var miniColWidth = kanbanMinColWidth * 0.2;
- $('.kanban-header-col>.title>span:not(.text)').hide();
- $('.kanban-header-col>.title > span.text').css('max-width', miniColWidth + 'px');
- }
-}
-
-/**
- * Init when page ready
- */
-$(function()
-{
- changeStatus(execution.status);
-
- if($.cookie('isFullScreen') == 1) $.cookie('isFullScreen', 0);
-
- changeOrder = false;
-
- window.kanbanScaleSize = +$.zui.store.get('executionKanbanScaleSize', 1);
- $('#kanbanScaleSize').text(window.kanbanScaleSize);
- $('#kanbanScaleControl .btn[data-type="+"]').attr('disabled', window.kanbanScaleSize >= 4 ? 'disabled' : null);
- $('#kanbanScaleControl .btn[data-type="-"]').attr('disabled', window.kanbanScaleSize <= 1 ? 'disabled' : null);
-
- /* Make kanbanScaleControl works */
- $('#kanbanScaleControl').on('click', '.btn', function()
- {
- changeKanbanScaleSize(window.kanbanScaleSize + ($(this).data('type') === '+' ? 1 : -1));
- });
-
- /* Init first kanban */
- $('.kanban').each(function()
- {
- initKanban($(this));
- });
-
- $('.icon-chevron-double-up,.icon-chevron-double-down').on('click', function()
- {
- $(this).toggleClass('icon-chevron-double-up icon-chevron-double-down');
- $(this).parents('.region').find('.kanban').toggle();
- hideKanbanAction();
- resetRegionHeight($(this).hasClass('icon-chevron-double-up') ? 'open' : 'close');
- });
-
- $('.region-header').on('click', '.action', hideKanbanAction);
- $('#TRAction').on('click', '.btn', hideKanbanAction);
-
- /* Hide action box when user click document */
- $(document).on('click', function(e)
- {
- $('.kanban').each(function()
- {
- var currentAction = $(this).kanban().attr('data-action-enabled');
- var canHideAction = (currentAction === 'headerMore' || currentAction === 'editLaneName')
- && !$(e.target).closest('.action,.action-box').length;
- if(canHideAction) hideKanbanAction();
- });
- });
-
- /* Init contextmenu */
- $('#kanban').on('click', '[data-contextmenu]', function(event)
- {
- var $trigger = $(this);
- var menuType = $trigger.data('contextmenu');
- var menuCreator = window.menuCreators[menuType];
- if(!menuCreator) return;
-
- var options = $.extend({event: event, $trigger: $trigger}, $trigger.data());
- var items = menuCreator(options);
- if(!items || !items.length) return;
-
- $.zui.ContextMenu.show(items, items.$options || {event: event});
- });
-
- /* Hide contextmenu when page scroll */
- $(window).on('scroll', function()
- {
- $.zui.ContextMenu.hide();
- });
-
- $('#toStoryButton').on('click', function()
- {
- var planID = $('#plan').val();
- if(planID)
- {
- var vars = $('.linkStoryByPlanButton').data('lane') != null ? '&extra=laneID='+ $('.linkStoryByPlanButton').data('lane') + ',columnID=' + $('.linkStoryByPlanButton').data('col') : '';
- var param = "¶m=executionID=" + executionID + ",browseType=" + browseType + ",orderBy=id_asc,groupBy=" + groupBy;
- location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID + '&productID=0' + vars + param);
- $.closeModal();
- }
- });
-
- $('#product').change(function()
- {
- var product = $('#product').val();
- if(product)
- {
- var link = createLink('bug', 'batchCreate', 'productID=' + product + '&branch=&executionID=' + executionID, '', true);
- $('#batchCreateBugButton').attr('href', link);
- }
- });
-
- $(document).on('click', '#splitTable .btn-plus', function()
- {
- var tr = $(this).closest('tr');
- tr.after($('#childTpl').html().replace(/key/g, key));
- tr.next().find('input[name^=color]').colorPicker();
- key++;
- processMinusBtn();
- return false;
- });
-
- /* Remove a trade detail item. */
- $(document).on('click', '#splitTable .btn-close', function()
- {
- $(this).closest('tr').remove();
- processMinusBtn();
- return false;
- });
-
- /* Modify color's border color. */
- $(document).on('mouseout', '.color0', function()
- {
- $('.color0 .cardcolor').css('border', '1px solid #b0b0b0');
- });
-
- /* Modify default color's border color. */
- $(document).on('mouseover', '.color0', function()
- {
- $('.color0 .cardcolor').css('border', '1px solid #fff');
- });
-
- document.addEventListener('scroll', function()
- {
- hideKanbanAction();
- }, true);
-
- /* Init sortable */
- var sortType = '';
- var $cards = null;
- $('#kanban').sortable(
- {
- selector: '.region, .kanban-board, .kanban-lane',
- trigger: '.region.sort > .region-header, .kanban-board.sort > .kanban-header > .kanban-group-header, .kanban-lane.sort > .kanban-lane-name',
- dropOnMouseleave: true,
- container: function($ele)
- {
- return $ele.parent();
- },
- targetSelector: function($ele)
- {
- /* Sort regions */
- if($ele.hasClass('region'))
- {
- sortType = 'region';
- return $ele.parent().children('.region');
- }
-
- /* Sort boards */
- if($ele.hasClass('kanban-board'))
- {
- sortType = 'board';
- return $ele.parent().children('.kanban-board');
- }
-
- /* Sort lanes */
- if($ele.hasClass('kanban-lane'))
- {
- sortType = 'lane';
- $cards = $ele.find('.kanban-item');
-
- return $ele.parent().children('.kanban-lane');
- }
- },
- before: function()
- {
- return !window.sortableDisabled;
- },
- start: function(e)
- {
- if(sortType == 'region')
- {
- showRegionIdList = '';
- $('.icon-chevron-double-up').each(function()
- {
- showRegionIdList += $(this).attr('data-id') + ',';
- $(this).attr('class', 'icon-chevron-double-down');
- });
-
- $('.region').find('.kanban').hide();
- hideKanbanAction();
- }
- },
- finish: function(e)
- {
- if(!e.changed) return;
-
- var url = '';
- var orders = [];
-
- if(sortType == 'region')
- {
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('region') && data.item.hasClass('sort')) orders.push(data.item.data('id'));
- });
-
- $('.region').each(function()
- {
- if(showRegionIdList.includes($(this).attr('data-id')))
- {
- $(this).find('.icon-chevron-double-down').attr('class', 'icon-chevron-double-up');
- $(this).find('.kanban').show();
- }
- })
-
- url = createLink('kanban', 'sortRegion', 'regions=' + orders.join(','));
- }
- if(sortType == 'board')
- {
- var regionID = e.element.closest('.region').data('id');
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('kanban-board') && data.item.hasClass('sort') && regionID == data.item.parent().data().id) orders.push(data.item.data('id'));
- });
-
- url = createLink('kanban', 'sortGroup', 'region=' + regionID + '&groups=' + orders.join(','));
- }
- if(sortType == 'lane')
- {
- var groupID = e.element.closest('.kanban-board').data('id');
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('kanban-lane') && data.item.hasClass('sort') && groupID == data.item.data().lane.group) orders.push(data.item.data('id'));
- });
-
- var regionID = e.element.closest('.region').data('id');
- url = createLink('kanban', 'sortLane', 'region=' + regionID + '&lanes=' + orders.join(','));
- }
-
- if(!url) return true;
-
- $.getJSON(url, function(response)
- {
- if(response.result == 'fail' && response.message.length)
- {
- bootbox.alert(response.message);
- setTimeout(function(){return location.reload()}, 3000);
- }
- });
- },
- always: function(e)
- {
- if(sortType == 'lane') $cards.show();
- }
- });
-
- /* Ajax update kanban. */
- if(groupBy == 'default')
- {
- setInterval(function()
- {
- if(rdSearchValue == '')
- {
- $.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=" + entertime + "&browseType=" + browseType + "&groupBy=" + groupBy + '&from=RD&searchValue=' + rdSearchValue + '&orderBy=' + orderBy), function(data)
- {
- if(lastUpdateData == '') lastUpdateData = data;
- if(data && lastUpdateData !== data)
- {
- lastUpdateData = data;
- kanbanData = $.parseJSON(data);
- for(var region in kanbanData)
- {
- updateRegion(region, kanbanData[region]);
- }
- }
- });
- }
- }, 10000);
- }
-
- if(groupBy != 'default')
- {
- $('.region').css('padding-bottom', '10px');
- $('.region').css('border', '0px');
- }
-
- resetRegionHeight('open');
-});
-
-/** Calculate column height */
-function calcColHeight(col, lane, colCards, colHeight, kanban)
-{
- var options = kanban.options;
- if(!options.displayCards) return colHeight;
-
- var displayCards = +(options.displayCards || 2);
-
- if (typeof displayCards !== 'number' || displayCards < 2) displayCards = 2;
- return (displayCards * (options.cardHeight + options.cardSpace) + options.cardSpace);
-}
-
-/**
- * Reset region height according to window height.
- *
- * @param string fold
- * @access public
- * @return void
- */
-function resetRegionHeight(fold)
-{
- var laneCount = $('.kanban-lane').length;
-
- if(laneCount > 1 || $('.region').length > 0) return;
-
- var regionHeaderHeight = $('.region-header').outerHeight();
- if(fold == 'open')
- {
- var windowHeight = $(window).height();
- var headerHeight = $('#mainHeader').outerHeight();
- var mainPadding = $('#main').css('padding-top');
- var menuHeight = $('#mainMenu').height();
- var panelBorder = $('.panel').css('border-top-width');
- var bodyPadding = $('.panel-body').css('padding-top');
- var regionBorder = $('.region').css('border-top-width');
- var regionPadding = $('.kanban').css('padding-bottom');
- var columnHeight = $('.kanban-header').outerHeight();
- var height = windowHeight - (parseInt(mainPadding) * 2) - menuHeight - (parseInt(bodyPadding) * 2) - headerHeight - (parseInt(panelBorder) * 2) - (parseInt(regionBorder) * 2);
-
- if(groupBy == 'default') $('.region').css('height', height);
- $('.kanban-lane').css('height', height - regionHeaderHeight - parseInt(regionPadding) - columnHeight);
- }
- else
- {
- $('.region').css('height', regionHeaderHeight);
- }
-}
-
-/**
- * Toggle RDSearchBox.
- *
- * @access public
- * @return void
- */
-function toggleRDSearchBox()
-{
- $('#rdSearchBox').toggle();
-
- if($('#rdSearchBox').css('display') == 'block')
- {
- $(".querybox-toggle").css("color", "#0c64eb");
- }
- else
- {
- $(".querybox-toggle").css("color", "#3c495c");
- $('#rdKanbanSearchInput').attr('value', '');
- searchCards('');
- }
-}
-
-/**
- * Search all cards.
- *
- * @param string $value
- * @param string order
- *
- * @access public
- * @return void
- */
-function searchCards(value, order = '')
-{
- rdSearchValue = value;
- orderBy = order == '' ? orderBy : order;
- if(order != '') changeOrder = true;
- $.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=0&browseType=" + browseType + "&groupBy=" + groupBy + '&from=RD&searchValue=' + rdSearchValue + '&orderBy=' + orderBy), function(data)
- {
- lastUpdateData = data;
- kanbanData = $.parseJSON(data);
- var hideAll = true;
- $('#kanban').children('.region').children("div[id^='kanban']").each(function()
- {
- var regionID = $(this).attr('data-id');
- if(kanbanData != null) data = groupBy == 'default' ? kanbanData[regionID] : kanbanData[groupBy];
-
- if(rdSearchValue != '' && groupBy == 'default' && data.laneCount != 0) $(this).parent().show();
- if(rdSearchValue != '' && groupBy == 'default' && data.laneCount == 0) $(this).parent().hide();
-
- $(this).empty();
- hideAll = !updateRegion(regionID, data) && hideAll;
- });
-
- if(hideAll && rdSearchValue != '')
- {
- if($('.table-empty-tip').length == 0) $('#kanban').append('
' + kanbancardLang.empty + '
');
- }
- else
- {
- $('.table-empty-tip').remove();
- }
- });
-}
diff --git a/module/execution/js/managemembers.js b/module/execution/js/managemembers.js
deleted file mode 100644
index fd9ff37373..0000000000
--- a/module/execution/js/managemembers.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Update other picker on change */
-$.zui.Picker.DEFAULTS.onChange = function(event)
-{
- var picker = event.picker;
- if(!picker.$formItem.is('[name^=accounts]')) return;
-
- var select = picker.$formItem[0];
- var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false});
-
- $('.picker-select[name^=accounts]').each(function()
- {
- if(this === select) return;
-
- var $select = $(this);
- var selectPicker = $select.data('zui.picker');
-
- if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]);
- });
-}
-
-$(function()
-{
- $('#execution_chosen, #execution + .picker').click(function()
- {
- $('#execution_chosen ul li, #pickerDropMenu-pk_execution div a').each(function(index)
- {
- if(index == 0)
- {
- var projectName = subString($(this).text(), 56);
- $(this).text(projectName);
- $(this).append('
');
- }
- else
- {
- $(this).prepend(' ');
- }
- })
- });
-})
-
-/**
- * Set role when select an account.
- *
- * @param string $account
- * @param int $roleID
- * @access public
- * @return void
- */
-function setRole(account, roleID)
-{
- role = roles[account]; // get role according the account.
- roleOBJ = $('#role' + roleID); // get role object.
- roleOBJ.val(role) // set the role.
-}
-
-/**
- * Add item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, itemIndex);
- $('
' + item + '
').insertAfter($(obj).closest('tr'));
- var $accounts = $('#hours' + itemIndex).closest('tr').find('select:first')
-
- if($accounts.attr('data-pickertype') != 'remote')
- {
- $accounts.addClass('picker-select').picker({chosenMode: true});
- }
- else
- {
- $accounts.parent().find('.picker.picker-ready').remove();
- var pickerremote = $accounts.attr('data-pickerremote');
- $accounts.addClass('picker-select').picker({chosenMode: true, remote: pickerremote});
- }
- itemIndex ++;
-
- var disabledItems = [];
- $('.picker-select[name^=accounts]').each(function()
- {
- if(this === $accounts[0]) return;
- var $select = $(this);
- var picker = $select.data('zui.picker');
- if(!picker) return;
- var selectItem = picker.getListItem(picker.getValue());
- if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true}));
- });
- if(disabledItems.length) $accounts.data('zui.picker').updateOptionList(disabledItems);
-}
-
-/**
- * Delete item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#teamForm .table tbody').children().length < 2) return false;
-
- $(obj).closest('tr').find('.picker .picker-selection-remove').click();
- $(obj).closest('tr').remove();
-}
-
-/**
- * Set dept users.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function setDeptUsers(obj)
-{
- dept = $(obj).val(); // Get dept ID.
- link = createLink('execution', 'manageMembers', 'executionID=' + executionID + '&team2Import=' + team2Import + '&dept=' + dept); // Create manageMembers link.
- location.href=link;
-}
-
-/**
- * Chose team to copy.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function choseTeam2Copy(obj)
-{
- team = $(obj).val();
- dept = $('#dept').val();
- link = createLink('execution', 'manageMembers', 'executionID=' + executionID + '&team2Import=' + team + '&dept=' + dept);
- location.href=link;
-}
-
-/**
- * Cut a string of letters and characters with the same length.
- *
- * @param string $title
- * @param int $stringLength
- * @access public
- * @return string
- */
-function subString(title, stringLength)
-{
- if(title.replace(/[\u4e00-\u9fa5]/g, "**").length > stringLength)
- {
- var length = 0;
- for(var i = 0; i < title.length; i ++)
- {
- length += title.charCodeAt(i) > 255 ? 2 : 1;
- if(length > stringLength)
- {
- title = title.substring(0, i) + '...';
- break;
- }
- }
- }
-
- return title;
-}
diff --git a/module/execution/js/manageproducts.js b/module/execution/js/manageproducts.js
deleted file mode 100644
index 5ed5d3fb60..0000000000
--- a/module/execution/js/manageproducts.js
+++ /dev/null
@@ -1,45 +0,0 @@
-$(function()
-{
- $('#productsBox input:checkbox').each(function()
- {
- var $cb = $(this);
- if($cb.prop('checked')) $cb.closest('.product').addClass('checked');
- });
-
- $('#productsBox input:checkbox').change(function()
- {
- var $cb = $(this);
- $cb.closest('.product').toggleClass('checked', $cb.prop('checked'));
-
- if($cb.prop('checked')) return true;
-
- var productID = String($cb.val());
- if($.inArray(productID, unmodifiableProducts) != -1)
- {
- var $branch = $cb.closest('.product').find('[name^=branch]');
- if($branch.length)
- {
- var branchID = String($branch.val());
-
- if($.inArray(branchID, unmodifiableBranches) != -1 && linkedStoryIDList[productID][branchID])
- {
- bootbox.alert(unLinkProductTip.replace("%s", allProducts[productID] + branchGroups[productID][branchID]));
- }
- }
- else
- {
- bootbox.alert(unLinkProductTip.replace("%s", allProducts[productID]));
- }
- }
- });
-
- $("select[id^=branch]").change(function()
- {
- var checked = $(this).closest('div').hasClass('checked');
- if(!checked)
- {
- $(this).closest('div').addClass('checked');
- $(this).closest('div').find("input[id^=products]").prop('checked', true);
- }
- });
-});
diff --git a/module/execution/js/setkanban.js b/module/execution/js/setkanban.js
deleted file mode 100644
index b6cec9aa53..0000000000
--- a/module/execution/js/setkanban.js
+++ /dev/null
@@ -1,6 +0,0 @@
-$(function()
-{
- var heightType = $("[name='heightType']:checked").val();
- setCardCount(heightType);
- handleKanbanWidthAttr();
-});
diff --git a/module/execution/js/story.js b/module/execution/js/story.js
deleted file mode 100644
index 1b3a50a524..0000000000
--- a/module/execution/js/story.js
+++ /dev/null
@@ -1,170 +0,0 @@
-$(function()
-{
- if($('#storyList thead th.c-title').width() < 150) $('#storyList thead th.c-title').width(150);
-
- if(isDropMenu)
- {
- $('#navbar .nav li').removeClass('active');
- $("#navbar .nav li[data-id=" + storyType + ']').addClass('active');
-
- $('#navbar .nav>li[data-id=story]').addClass('active');
- $('#navbar .nav>li[data-id=story]>a').html($('.active [data-id=' + storyType + ']').text() + '
');
- }
-
- $('#storyList td.has-child .story-toggle').each(function()
- {
- var $td = $(this).closest('td');
- var labelWidth = 0;
- if($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
- $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
- });
-
- $(document).on('click', '.story-toggle', function(e)
- {
- var $toggle = $(this);
- var id = $(this).data('id');
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
-
- e.stopPropagation();
- e.preventDefault();
- });
-
- $('#storyList').on('sort.sortable', function(e, data)
- {
- var list = '';
- for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
- $.post(createLink('execution', 'storySort', 'executionID=' + executionID), {'storyList' : list, 'orderBy' : orderBy}, function()
- {
- var $target = $(data.element[0]);
- $target.hide();
- $target.fadeIn(1000);
- order = 'order_desc'
- history.pushState({}, 0, createLink('execution', 'story', "executionID=" + executionID + '&orderBy=' + order));
- });
- });
-
- $('#module' + moduleID).parent().addClass('active');
- $('#product' + productID).addClass('active');
- $('#branch' + branchID).addClass('active');
- $(document).on('click', "#storyList tbody tr, .table-footer .check-all, #storyList thead .check-all", function(){showCheckedSummary();});
- $(document).on('change', "#storyList :checkbox", function(){showCheckedSummary();});
-
- $('#toTaskButton').on('click', function()
- {
- var planID = $('#plan').val();
- if(planID)
- {
- location.href = createLink('execution', 'importPlanStories', 'executionID=' + executionID + '&planID=' + planID);
- }
- })
-
- /* Get checked stories. */
- $(document).on('click', '#batchToTaskButton', function()
- {
- storyIdList = '';
- linedTaskIdList = '';
- unlinkTaskIdList = '';
- $("input[name^='storyIdList']:checked").each(function()
- {
- if(linkedTaskStories[$(this).val()])
- {
- linedTaskIdList += '[' + $(this).val() +']';
- }
- else
- {
- unlinkTaskIdList += $(this).val() + ',';
- }
- storyIdList += $(this).val() + ',';
- });
-
- $('#type').val('').trigger("chosen:updated");
- $('#hourPointValue').val('');
- $('input[name^=fields]').prop('checked', true);
- });
-
- $('#submit').click(function()
- {
- var taskType = $('#type').val();
- var hourPoint = $('#hourPointValue').val();
- if(taskType.length == 0)
- {
- alert(typeNotEmpty);
- return false;
- }
-
- if(hourPoint == 0)
- {
- alert(hourPointNotEmpty);
- return false;
- }
- else if(typeof(hourPoint) != 'undefined' && (isNaN(hourPoint) || hourPoint < 0))
- {
- alert(hourPointNotError);
- return false;
- }
- hourPoint = typeof(hourPoint) == 'undefined' ? 0 : hourPoint;
-
- if(linedTaskIdList)
- {
- confirmStoryToTask = confirmStoryToTask.replace('%s', linedTaskIdList);
- if(confirm(confirmStoryToTask))
- {
- $('#storyIdList').val(storyIdList);
- }
- else
- {
- if(!unlinkTaskIdList) return false;
-
- $('#storyIdList').val(unlinkTaskIdList);
- }
- }
- else
- {
- $('#storyIdList').val(storyIdList);
- }
- });
-
- $('.sorter-false a').unwrap();
-
- /* The display of the adjusting sidebarHeader is synchronized with the sidebar. */
- $(".sidebar-toggle").click(function()
- {
- $("#sidebarHeader").toggle("fast");
- });
- if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
-});
-
-/**
- * Show checked summary.
- *
- * @access public
- * @return void
- */
-function showCheckedSummary()
-{
- var $summary = $('#main #mainContent form.main-table .table-header .table-statistic');
-
- var checkedTotal = 0;
- var checkedEstimate = 0;
- var checkedCase = 0;
- $('[name^="storyIdList"]').each(function()
- {
- if($(this).prop('checked'))
- {
- checkedTotal += 1;
- var taskID = $(this).val();
- $tr = $("#storyList tbody tr[data-id='" + taskID + "']");
- checkedEstimate += Number($tr.data('estimate'));
- if(Number($tr.data('cases')) > 0) checkedCase += 1;
- }
- });
- if(checkedTotal > 0)
- {
- rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%';
- summary = checkedSummary.replace('%total%', checkedTotal)
- .replace('%estimate%', checkedEstimate)
- .replace('%rate%', rate)
- $summary.html(summary);
- }
-}
diff --git a/module/execution/js/storyestimate.js b/module/execution/js/storyestimate.js
deleted file mode 100644
index 98b0e4c576..0000000000
--- a/module/execution/js/storyestimate.js
+++ /dev/null
@@ -1,48 +0,0 @@
-$('.new-estimate input').keyup(function()
-{
- computeAverage();
-})
-
-$(function()
-{
- $('#round_chosen').click(function()
- {
- var maxHeight = $(window).height() - 150;
- $('.chosen-container .chosen-results').attr('style', 'max-height: ' + maxHeight + 'px !important;');
- })
-})
-
-function computeAverage()
-{
- var summary = 0;
- var count = 0;
- var average = 0;
- $('.new-estimate').each(function()
- {
- var value = $(this).find('input').val();
- if(value)
- {
- value = parseFloat(value);
- if(isNaN(value)) value = 0;
- summary += value;
- count += 1;
- }
- })
-
- if(count) average = summary / count;
- $('#average').val(average.toFixed(2));
- $('#showAverage').html(average.toFixed(2));
-}
-
-function showNewEstimate()
-{
- $('.th-new-estimate').removeClass('hide');
- $('.new-estimate').removeClass('hide');
- $('.form-actions').removeClass('hide');
- $('.empty-th').addClass('hide');
-}
-
-function selectRound(round)
-{
- location.href = createLink('execution', 'storyEstimate', 'executionID=' + executionID + '&storyID=' + storyID + '&round=' + round);
-}
diff --git a/module/execution/js/storykanban.js b/module/execution/js/storykanban.js
deleted file mode 100644
index e7d1fc7045..0000000000
--- a/module/execution/js/storykanban.js
+++ /dev/null
@@ -1,129 +0,0 @@
-$(function()
-{
- var isFirefox = $.zui.browser.firefox;
- $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot});
- var $kanban = $('#kanban');
-
- var stageMap = new Object();
- if(canBeChanged)
- {
- stageMap =
- {
- story:
- {
- projected : {verified: 'batchChangeStage'},
- developing : {verified: 'batchChangeStage'},
- developed : {verified: 'batchChangeStage'},
- testing : {verified: 'batchChangeStage'},
- tested : {verified: 'batchChangeStage'},
- }
- };
- }
-
- var fixBoardWidth = function()
- {
- var $table = $kanban.find('.table');
- var kanbanWidth = $table.width();
- var $cBoards = $table.find('thead>tr>th.c-board:not(.c-side)');
- var boardCount = $cBoards.length;
- if (boardCount <= 1) {
- return;
- }
- var $cSide = $table.find('thead>tr>th.c-board.c-side');
- var totalWidth = kanbanWidth;
- if ($cSide.length) totalWidth = totalWidth - ($cSide.outerWidth() + 5);
- var cBoardWidth = Math.floor(totalWidth/boardCount);
-
- $cBoards.not(':last').css('width', cBoardWidth);
- $cBoards.last().css('width', totalWidth - cBoardWidth * (boardCount - 1));
- var $boards = $kanban.find('.boards > .board');
- $boards.not(':last').css('width', cBoardWidth);
- $boards.last().css('width', totalWidth - cBoardWidth * (boardCount - 1));
- };
- fixBoardWidth();
- $(window).on('resize', fixBoardWidth);
-
- var refresh = function()
- {
- var selfClose = $.cookie('selfClose');
- $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot});
- if(selfClose == 1) $kanban.load(location.href + ' #kanban', fixBoardWidth);
- };
-
- var dropTo = function(id, from, to, type)
- {
- if(stageMap[type][from] && stageMap[type][from][to])
- {
- $.post(createLink(type, stageMap[type][from][to], 'stage=' + to), {'storyIdList[]':[id]}, function()
- {
- refresh();
- location.reload();
- });
- return true;
- }
- return false;
- };
-
- $kanban.droppable(
- {
- selector: '.board-item:not(.disabled)',
- target: function($ele)
- {
- var itemType = $ele.data('type');
- var $board = $ele.closest('.board');
- var type = $board.data('type');
- return $board.siblings('.board').filter(function()
- {
- var typeMap = stageMap[itemType];
- var actionMap = typeMap && typeMap[type];
- return !!actionMap && actionMap[$(this).data('type')];
- });
- },
- start: function(e)
- {
- $kanban.addClass('dragging');
- e.targets.addClass('can-drop-in');
- var $item = $(e.element).addClass('dragging');
- $item.closest('.boards').addClass('dragging');
- },
- drag: function(e)
- {
- var $item = $(e.element);
- var $target = $(e.target);
- var $holder = $target.find('.board-drag-holder');
- if (!$holder.length) $holder = $('
').appendTo($target);
- $kanban.find('.c-board.dragging').removeClass('dragging');
- $kanban.find('.c-board.s-' + $target.data('type')).addClass('dragging');
- $holder.height($item.outerHeight());
- },
- drop: function(e)
- {
- var result = dropTo(e.element.data('id'), e.element.closest('.board').data('type'), e.target.data('type'), e.element.data('type'));
- if(result !== false)
- {
- e.element.insertBefore(e.target.find('.board-drag-holder'));
- }
- },
- finish: function()
- {
- $kanban.removeClass('dragging').find('.can-drop-in').removeClass('can-drop-in');
- $kanban.find('.dragging').removeClass('dragging');
- }
- });
-
- $kanban.on('click', '.kanbaniframe', function(e)
- {
- var $link = $(this);
- new $.zui.ModalTrigger($.extend(
- {
- type: 'iframe',
- url: $link.attr('href'),
- width: '80%',
- }, $link.data())).show(
- {
- shown: function(){$('.modal-iframe').data('cancel-reload', true)},
- hidden: refresh
- });
- return false;
- });
-});
diff --git a/module/execution/js/task.js b/module/execution/js/task.js
deleted file mode 100644
index 8a8d1f948f..0000000000
--- a/module/execution/js/task.js
+++ /dev/null
@@ -1,69 +0,0 @@
-$(function()
-{
- if($('#taskList thead th.c-name').width() < 150) $('#taskList thead th.c-name').width(150);
- $('#taskList td.has-child .task-toggle').each(function()
- {
- var $td = $(this).closest('td');
- var labelWidth = 0;
- if($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
- $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
- });
-
- toggleFold('#executionTaskForm', unfoldTasks, executionID, 'execution');
-
- adjustTableFooter();
- $('body').on('click', '#toggleFold', adjustTableFooter);
- $('body').on('click', '.icon.icon-angle-right', adjustTableFooter);
-
- /* The display of the adjusting sidebarHeader is synchronized with the sidebar. */
- $(".sidebar-toggle").click(function()
- {
- $("#sidebarHeader").toggle("fast");
- });
- if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
-});
-
-$('#module' + moduleID).closest('li').addClass('active');
-$('#product' + productID).closest('li').addClass('active');
-
-/**
- * Adjust the table footer style.
- *
- * @access public
- * @return void
- */
-function adjustTableFooter()
-{
- if($('.main-col').height() < $(window).height())
- {
- $('.table.with-footer-fixed').css('margin-bottom', '0');
- $('.table-footer').removeClass('fixed-footer');
- $('.table-footer').css({'left': 0, 'bottom': 0, 'width': 'unset'});
- }
-}
-
-/**
- * Ajax refresh.
- *
- * @access public
- * @return void
- */
-function ajaxRefresh()
-{
- var $table = $('#executionTaskForm').closest('[data-ride="table"]');
- if($table.length)
- {
- var table = $table.data('zui.table');
- if(table)
- {
- table.options.replaceId = 'executionTaskForm';
- table.reload();
- }
- }
- $.get(location.href, function(data)
- {
- var $data = $(data);
- $('#mainMenu > div.btn-toolbar.pull-left').html($data.find('#mainMenu > div.btn-toolbar.pull-left').html());
- if($data.find('#mainContent .main-col .table-empty-tip').length) $('#mainContent .main-col').html($data.find('#mainContent .main-col'));
- });
-}
diff --git a/module/execution/js/team.js b/module/execution/js/team.js
deleted file mode 100644
index 31f06eeaaa..0000000000
--- a/module/execution/js/team.js
+++ /dev/null
@@ -1,38 +0,0 @@
-function checkUserDept(userID)
-{
- alert(noAccess);
-}
-
-/**
- * Delete memeber of project team.
- *
- * @param int $executionID
- * @param int $userID
- * @access public
- * @return void
- */
-function deleteMember(executionID, userID)
-{
- bootbox.confirm(confirmUnlinkMember, function(result)
- {
- if(!result) return true;
- var unlinkURL = createLink('execution', 'unlinkMember', 'executionID=' + executionID + '&userID=' + userID + '&confirm=yes');
- unlinkMember(unlinkURL);
- });
-}
-
-/**
- * Unlink member from project.
- *
- * @param unlinkURL $unlinkURL
- * @access public
- * @return void
- */
-function unlinkMember(unlinkURL)
-{
- $.get(unlinkURL, function(data)
- {
- data = JSON.parse(data);
- if(data.result == 'success') window.location.reload();
- });
-}
diff --git a/module/execution/js/testcase.js b/module/execution/js/testcase.js
deleted file mode 100644
index 07d0894912..0000000000
--- a/module/execution/js/testcase.js
+++ /dev/null
@@ -1,14 +0,0 @@
-var runCase = false;
-/**
- * Define triggerModal hidden event.
- *
- * @access public
- * @return void
- */
-function triggerHidden()
-{
- $('#triggerModal').on('hidden.zui.modal', function()
- {
- if(runCase == true) window.location.reload();
- });
-}
diff --git a/module/execution/js/testtask.js b/module/execution/js/testtask.js
deleted file mode 100644
index 7b904e5b23..0000000000
--- a/module/execution/js/testtask.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(function()
-{
- $('#testtaskForm').table(
- {
- replaceId: 'taskIdList',
- statisticCreator: function(table)
- {
- var $table = table.getTable();
- var $checkedRows = $table.find('tbody>tr.checked');
- var checkedTotal = $checkedRows.length;
- var checkedWait = $checkedRows.filter("[data-status=wait]").length;
- var checkedTesting = $checkedRows.filter("[data-status=doing]").length;
- var checkedBlocked = $checkedRows.filter("[data-status=blocked]").length;
- var checkedDone = $checkedRows.filter("[data-status=done]").length;
- var checkedStatistics = checkedAllSummary.replace('%total%', checkedTotal)
- .replace('%wait%', checkedWait)
- .replace('%testing%', checkedTesting)
- .replace('%blocked%', checkedBlocked)
- .replace('%done%', checkedDone);
-
- return checkedTotal ? checkedStatistics : pageSummary;
- }
- });
-});
diff --git a/module/execution/js/tree.js b/module/execution/js/tree.js
deleted file mode 100644
index 5503634ad1..0000000000
--- a/module/execution/js/tree.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/**
- * Expand or collapse text.
- *
- * @access public
- * @return void
- */
-function limitText()
-{
- var fullText;
- var limitText;
- var $text = $(this);
- var options = $.extend({limitSize: 40, suffix: '…'}, $text.data());
- var text = $text.text();
- if(text.length > options.limitSize)
- {
- fullText = $text.html();
- limitText = text.substring(0, options.limitSize) + options.suffix;
- $text.text(limitText).addClass('limit-text-on');
-
- var $toggleBtn = options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle');
- $toggleBtn.text($toggleBtn.data('textExpand'));
- $toggleBtn.on('click', function()
- {
- var isLimitOn = $text.toggleClass('limit-text-on').hasClass('limit-text-on');
- if(isLimitOn) $text.text(limitText);
- else $text.html(fullText);
- $toggleBtn.text($toggleBtn.data(isLimitOn ? 'textExpand' : 'textCollapse'));
- });
- }
- else
- {
- (options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle')).hide();
- }
- $text.removeClass('hidden');
-};
-$.fn.textLimit = function(){return this.each(limitText);};
-
-$(function()
-{
- var $taskTree = $('#taskTree').tree(
- {
- name: 'taskTree',
- initialState: 'preserve'
- });
-
- var taskTree = $taskTree.data('zui.tree');
- if(!taskTree) return;
-
- var sortItems = function($items)
- {
- var items = $items.toArray();
- for(i = 0; i < items.length; i++)
- {
- for(j = 0; j < items.length - 1 - i; j++)
- {
- if($(items[j + 1]).data('id').toString() > $(items[j]).data('id').toString())
- {
- var tmp = items[j + 1];
- items[j + 1] = items[j];
- items[j] = tmp;
- }
- }
- }
- return items;
- }
-
- /* Expand the tree list according to the list config.*/
- var showTreeLevel = function(level)
- {
- if(level === 'task' || level === 'story') $('.btn-tree-view').removeClass('btn-active-text');
- $('#taskTree li.item-product').removeClass('hidden');
- $('#taskTree li.item-module').removeClass('hidden');
- $('#taskTree li.item-story').removeClass('hidden');
- $('#taskTree li.item-task').removeClass('hidden');
-
- if((level === 'root' && collapse == false) || (level === 'task' && collapse == true) || (level === 'story' && collapse == true))
- {
- taskTree.collapse();
- collapse = true;
- if(level === 'task') type = 'task';
- if(level === 'story') type = 'story';
- $('[data-type=' + type + ']').addClass('btn-active-text');
- }
- else if((level === 'all' && type === 'task') || level === 'task')
- {
- type = 'task';
- collapse = false;
- $('[data-type=task]').addClass('btn-active-text');
- taskTree.collapse();
- taskTree.expand($taskTree.find('li.has-list'), true);
- }
- else if((level === 'all' && type === 'story') || level === 'story')
- {
- type = 'story';
- collapse = false;
- $('[data-type=story]').addClass('btn-active-text');
- taskTree.collapse();
- taskTree.show($taskTree.find('li.item-story').parent().parent(), true);
-
- $('#taskTree li.item-task').addClass('hidden');
- var $moduleItems = $('#taskTree li.item-module');
- moduleItems = sortItems($moduleItems);
- for(i = 0; i < moduleItems.length; i++)
- {
- var items = $(moduleItems[i]).find('ul li:not(.hidden)').length;
- if(items == 0) $(moduleItems[i]).addClass('hidden');
- }
- var $productItems = $('#taskTree li.item-product');
- $productItems.each(function()
- {
- var items = $(this).find('ul li:not(.hidden)').length;
- if(items == 0) $(this).addClass('hidden');
- });
- }
- $('#main').toggleClass('tree-show-root', collapse);
- };
-
- $(document).on('click', '.btn-tree-view', function()
- {
- showTreeLevel($(this).data('type'));
- return false;
- });
-
- /* Expand the all nodes of tree when first visit.*/
- showTreeLevel(type);
-
- /* Show the content of story or task on right area.*/
- var $itemContent = $('#itemContent');
- var $mainContent = $('#mainContent');
- var isItemLoading = false, lastAjaxRequest;
- var adjustSidePosition = function()
- {
- if($mainContent.hasClass('hide-side')) return;
- var scrollTop = $(document).scrollTop();
- var $cell = $itemContent.closest('.cell');
- var bounding = $cell.parent()[0].getBoundingClientRect();
- $cell.css(
- {
- left: bounding.left + 20,
- top: Math.max(20, 150 - scrollTop),
- bottom: 60,
- });
- };
- var showItem = function(url, loadingText)
- {
- $.zui.messager.hide();
- $mainContent.toggleClass('hide-side', !url);
- if (!url)
- {
- $taskTree.find('li.selected').removeClass('selected');
- isItemLoading = false;
- $.zui.store.set('project/tree/showItem', false);
- return;
- }
- adjustSidePosition();
- if (lastAjaxRequest) lastAjaxRequest.abort();
- $itemContent.empty().addClass('loading').attr('data-loading', loadingText || '');
- isItemLoading = true;
- lastAjaxRequest = $.ajax(
- {
- url: url,
- success: function(data)
- {
- if (!isItemLoading) return;
- $itemContent.html(data).removeClass('loading');
- lastAjaxRequest = null;
- isItemLoading = false;
- $itemContent.find('.text-limit').textLimit();
- $itemContent.find('.histories').histories();
- $itemContent.find('.iframe').modalTrigger();
- $.zui.store.set('project/tree/showItem', url);
- adjustSidePosition();
- setTimeout(adjustSidePosition, 300);
- },
- error: function()
- {
- $mainContent.addClass('hide-side');
- isItemLoading = false;
- $.zui.messager.danger(window.lang.timeout);
- }
- });
- };
-
- var stopPropagation = function(e) {e.stopPropagation();};
- $taskTree.on('click', '.tree-link', function(e)
- {
- var $link = $(this);
- $.zui.store.set('project/tree/parentLi', $link.closest('li').attr('data-id').length > 0 ? $link.closest('li').attr('data-id') : '')
- showItem($link.attr('href'), $link.find('.title').text());
- $taskTree.find('li.selected').removeClass('selected');
- $link.closest('li').addClass('selected');
- e.preventDefault();
- stopPropagation(e);
- });
-
- $itemContent.on('click', function(event)
- {
- if(!$(event.target).closest('a[data-app]').length || $(event.target).closest('a').hasClass('iframe')) event.stopPropagation();
- });
- $taskTree.on('click', stopPropagation);
- $(window).on('resize scroll', adjustSidePosition);
-
- $(document).on('click', function()
- {
- showItem(false);
- }).on('ready', function()
- {
- var lastUrl = $.zui.store.get('project/tree/showItem');
- var lastLi = $.zui.store.get('project/tree/parentLi');
- if(lastUrl)
- {
- showItem(lastUrl);
- $taskTree.find('li[data-id="' + lastLi + '"]').find('.tree-link[href="' + lastUrl + '"]').closest('li').addClass('selected');
- }
- });
-});
diff --git a/module/execution/js/view.js b/module/execution/js/view.js
deleted file mode 100644
index 92fe169bf3..0000000000
--- a/module/execution/js/view.js
+++ /dev/null
@@ -1,35 +0,0 @@
-(function()
-{
- /* Expand or collapse text */
- function limitText()
- {
- var fullText;
- var limitText;
- var $text = $(this);
- var options = $.extend({limitSize: 40, suffix: '…'}, $text.data());
- var text = $text.text();
- if(text.length > options.limitSize)
- {
- fullText = $text.html();
- limitText = text.substring(0, options.limitSize) + options.suffix;
- $text.text(limitText).addClass('limit-text-on');
-
- var $toggleBtn = options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle');
- $toggleBtn.text($toggleBtn.data('textExpand'));
- $toggleBtn.on('click', function()
- {
- var isLimitOn = $text.toggleClass('limit-text-on').hasClass('limit-text-on');
- if(isLimitOn) $text.text(limitText);
- else $text.html(fullText);
- $toggleBtn.text($toggleBtn.data(isLimitOn ? 'textExpand' : 'textCollapse'));
- });
- }
- else
- {
- (options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle')).hide();
- }
- $text.removeClass('hidden');
- };
- $.fn.textLimit = function(){return this.each(limitText);};
- $(function(){$('.text-limit').textLimit();});
-})();
diff --git a/module/extension/css/obtain.css b/module/extension/css/obtain.css
deleted file mode 100644
index 5ee32db932..0000000000
--- a/module/extension/css/obtain.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.pager {margin-top: 0;}
-.tree li>a:hover {color: #fff; background-color: #0c64eb;}
-.tree li>a.active {color: #fff; background-color: #0c64eb;}
-.side-col {width: 210px;}
-#sidebar .cell {width: 190px;}
diff --git a/module/extension/css/upload.css b/module/extension/css/upload.css
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/gitea/css/browse.css b/module/gitea/css/browse.css
deleted file mode 100644
index cb15b6808d..0000000000
--- a/module/gitea/css/browse.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-id {width: 60px;}
-.c-name {width: 200px;}
diff --git a/module/gitea/css/create.css b/module/gitea/css/create.css
deleted file mode 100644
index 807e1a132b..0000000000
--- a/module/gitea/css/create.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.main-content>.center-block {max-width: 800px;}
-#giteaForm table {width: 600px;}
diff --git a/module/gitea/js/binduser.js b/module/gitea/js/binduser.js
deleted file mode 100644
index 014d06eeb1..0000000000
--- a/module/gitea/js/binduser.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(document).ready(function()
-{
- $('.gitlab-user-bind').change(function()
- {
- var user = zentaoUsers[$(this).val()];
- if(user !== undefined)
- {
- $(this).parent().parent().find('.email').text(user.email)
- }
- });
-
- $(document).on('click', '.zentao-users .chosen-container', function()
- {
- var $obj = $(this).prev('select');
- var value = $obj.val();
- if($obj.hasClass('filled')) return false;
-
- $obj.empty();
- $obj.append($('#userList').html());
- $obj.val(value);
- $obj.addClass('filled');
- $obj.trigger("chosen:updated");
- })
-});
diff --git a/module/gitlab/css/browse.css b/module/gitlab/css/browse.css
deleted file mode 100644
index cb15b6808d..0000000000
--- a/module/gitlab/css/browse.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-id {width: 60px;}
-.c-name {width: 200px;}
diff --git a/module/gitlab/css/browsegroup.css b/module/gitlab/css/browsegroup.css
deleted file mode 100644
index de56d7deb6..0000000000
--- a/module/gitlab/css/browsegroup.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.text-c-name > .avatar {vertical-align: middle;display: inline-block;margin-right: 5px;}
-.text-c-name > span {vertical-align: middle;}
\ No newline at end of file
diff --git a/module/gitlab/css/browseproject.css b/module/gitlab/css/browseproject.css
deleted file mode 100644
index d86ca85e6a..0000000000
--- a/module/gitlab/css/browseproject.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.text-c-counts > span {margin-left: 5px;}
-#mainMenu .pull-left {margin-right: 15px;}
diff --git a/module/gitlab/css/browsetag.css b/module/gitlab/css/browsetag.css
deleted file mode 100644
index 671f36d275..0000000000
--- a/module/gitlab/css/browsetag.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.text-c-counts > span {margin-left: 5px;}
-#mainMenu .pull-left {margin-right: 15px;}
-.c-actions-1 {width: 60px;}
-
-#gitlabTagList .text-c-name .has-prefix{position: relative; display: flex; align-items: center;}
-#gitlabTagList .text-c-name .label {flex: none;}
-#gitlabTagList .text-c-name .tag-name {display: inline-block; max-width: calc(100% - 50px); padding-right: 10px;}
diff --git a/module/gitlab/css/create.css b/module/gitlab/css/create.css
deleted file mode 100644
index 09df31008b..0000000000
--- a/module/gitlab/css/create.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.main-content>.center-block {max-width: 800px;}
-#gitlabForm table {width: 600px;}
diff --git a/module/gitlab/css/creategroup.css b/module/gitlab/css/creategroup.css
deleted file mode 100644
index 601910c77f..0000000000
--- a/module/gitlab/css/creategroup.css
+++ /dev/null
@@ -1 +0,0 @@
-.table-form>tbody>tr>th {width: 110px;}
diff --git a/module/gitlab/css/createtag.css b/module/gitlab/css/createtag.css
deleted file mode 100644
index 025aeb5e7f..0000000000
--- a/module/gitlab/css/createtag.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.table-form>tbody>tr>th {width: 110px;}
-.table-form {width: 50%;}
diff --git a/module/gitlab/css/createuser.css b/module/gitlab/css/createuser.css
deleted file mode 100644
index 2d047c2e0a..0000000000
--- a/module/gitlab/css/createuser.css
+++ /dev/null
@@ -1,4 +0,0 @@
-#avatarUpload {display: inline-block; width: 50px; height: 50px; position: relative;}
-#avatarUploadBtn {display: block; position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
-#avatarUploadBtn {opacity: 0; color: #fff; border-radius: 50%; line-height: 50px;}
-#avatarUploadBtn:hover {opacity: 1; background-color: rgba(0,0,0,.5);}
\ No newline at end of file
diff --git a/module/gitlab/css/editgroup.css b/module/gitlab/css/editgroup.css
deleted file mode 100644
index 601910c77f..0000000000
--- a/module/gitlab/css/editgroup.css
+++ /dev/null
@@ -1 +0,0 @@
-.table-form>tbody>tr>th {width: 110px;}
diff --git a/module/gitlab/css/edituser.css b/module/gitlab/css/edituser.css
deleted file mode 100644
index 2d047c2e0a..0000000000
--- a/module/gitlab/css/edituser.css
+++ /dev/null
@@ -1,4 +0,0 @@
-#avatarUpload {display: inline-block; width: 50px; height: 50px; position: relative;}
-#avatarUploadBtn {display: block; position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
-#avatarUploadBtn {opacity: 0; color: #fff; border-radius: 50%; line-height: 50px;}
-#avatarUploadBtn:hover {opacity: 1; background-color: rgba(0,0,0,.5);}
\ No newline at end of file
diff --git a/module/gitlab/css/importissue.css b/module/gitlab/css/importissue.css
deleted file mode 100644
index 7a0cc8fb4f..0000000000
--- a/module/gitlab/css/importissue.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-issue {width: 60px;}
-.c-type, .c-product, .c-execution {width: 30px;}
diff --git a/module/gitlab/css/managegroupmembers.css b/module/gitlab/css/managegroupmembers.css
deleted file mode 100644
index 16c089036c..0000000000
--- a/module/gitlab/css/managegroupmembers.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.table-form {min-width: 700px;}
-.c-levels {width: 150px;}
-.c-names {width: 300px;}
diff --git a/module/gitlab/css/manageprojectmembers.css b/module/gitlab/css/manageprojectmembers.css
deleted file mode 100644
index 16c089036c..0000000000
--- a/module/gitlab/css/manageprojectmembers.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.table-form {min-width: 700px;}
-.c-levels {width: 150px;}
-.c-names {width: 300px;}
diff --git a/module/gitlab/js/binduser.js b/module/gitlab/js/binduser.js
deleted file mode 100644
index 014d06eeb1..0000000000
--- a/module/gitlab/js/binduser.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(document).ready(function()
-{
- $('.gitlab-user-bind').change(function()
- {
- var user = zentaoUsers[$(this).val()];
- if(user !== undefined)
- {
- $(this).parent().parent().find('.email').text(user.email)
- }
- });
-
- $(document).on('click', '.zentao-users .chosen-container', function()
- {
- var $obj = $(this).prev('select');
- var value = $obj.val();
- if($obj.hasClass('filled')) return false;
-
- $obj.empty();
- $obj.append($('#userList').html());
- $obj.val(value);
- $obj.addClass('filled');
- $obj.trigger("chosen:updated");
- })
-});
diff --git a/module/gitlab/js/browsetag.js b/module/gitlab/js/browsetag.js
deleted file mode 100644
index 68a15f6a9f..0000000000
--- a/module/gitlab/js/browsetag.js
+++ /dev/null
@@ -1,17 +0,0 @@
-$(document).ready(function()
-{
- $('#tagSearch').click(function()
- {
- triggerSearch();
- });
- $('#keyword').keypress(function(event)
- {
- if(event.which == 13) triggerSearch();
- })
-
-});
-
-function triggerSearch()
-{
- $("#tagForm").submit();
-}
diff --git a/module/gitlab/js/creategroup.js b/module/gitlab/js/creategroup.js
deleted file mode 100644
index f25ff5dff0..0000000000
--- a/module/gitlab/js/creategroup.js
+++ /dev/null
@@ -1,11 +0,0 @@
-$(function()
-{
- $("input[type='radio'][value='public']").parent().parent().css("margin-bottom", "0px");
-
- $('input:radio[name="visibility"]').change(function()
- {
- var visibility = $('input:radio[name="visibility"]:checked').val();
- if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
- if(visibility != 'public') $('#publicTip').remove();
- })
-})
diff --git a/module/gitlab/js/createproject.js b/module/gitlab/js/createproject.js
deleted file mode 100644
index 59d5bc0212..0000000000
--- a/module/gitlab/js/createproject.js
+++ /dev/null
@@ -1,14 +0,0 @@
-$(function()
-{
- $("#name").bind("input propertychange", function(event)
- {
- $("#path").val($(this).val().toLowerCase());
- });
-
- $('input:radio[name="visibility"]').change(function()
- {
- var visibility = $('input:radio[name="visibility"]:checked').val();
- if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
- if(visibility != 'public') $('#publicTip').remove();
- })
-})
diff --git a/module/gitlab/js/createuser.js b/module/gitlab/js/createuser.js
deleted file mode 100644
index 6ca0c4809d..0000000000
--- a/module/gitlab/js/createuser.js
+++ /dev/null
@@ -1,20 +0,0 @@
-$(document).ready(function()
-{
- setAvatar();
- $('#account').change(function()
- {
- var account = $(this).val();
- var user = users[account];
- var name = '';
- var email = '';
- if(account && user)
- {
- name = user.realname;
- account = user.account;
- email = user.email;
- }
- $('#name').val(name);
- $('#username').val(account);
- $('#email').val(email);
- })
-});
diff --git a/module/gitlab/js/editgroup.js b/module/gitlab/js/editgroup.js
deleted file mode 100644
index a5ce831981..0000000000
--- a/module/gitlab/js/editgroup.js
+++ /dev/null
@@ -1,13 +0,0 @@
-$(function()
-{
- if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
-
- $("input[type='radio'][value='public']").parent().parent().css("margin-bottom", "0px");
-
- $('input:radio[name="visibility"]').change(function()
- {
- var visibility = $('input:radio[name="visibility"]:checked').val();
- if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
- if(visibility != 'public') $('#publicTip').remove();
- })
-})
diff --git a/module/gitlab/js/editproject.js b/module/gitlab/js/editproject.js
deleted file mode 100644
index eb299a8bd7..0000000000
--- a/module/gitlab/js/editproject.js
+++ /dev/null
@@ -1,11 +0,0 @@
-$(function()
-{
- if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
-
- $('input:radio[name="visibility"]').change(function()
- {
- var visibility = $('input:radio[name="visibility"]:checked').val();
- if(visibility == 'public') $("#visibilitypublic").parent().append(publicTip);
- if(visibility != 'public') $('#publicTip').remove();
- })
-})
diff --git a/module/gitlab/js/edituser.js b/module/gitlab/js/edituser.js
deleted file mode 100644
index b7407093da..0000000000
--- a/module/gitlab/js/edituser.js
+++ /dev/null
@@ -1,4 +0,0 @@
-$(document).ready(function()
-{
- setAvatar();
-});
\ No newline at end of file
diff --git a/module/gitlab/js/importissue.js b/module/gitlab/js/importissue.js
deleted file mode 100644
index d48d5a6028..0000000000
--- a/module/gitlab/js/importissue.js
+++ /dev/null
@@ -1,18 +0,0 @@
-$(document).ready(function()
-{
- $('[name^=productList').change(function()
- {
- var execution = $(this);
- host = execution.val();
- if(host == '') return false;
- executions = '';
- url = createLink('gitlab', 'ajaxGetExecutionsByProduct', "host=" + host);
-
- $.get(url, function(response)
- {
- execution = execution.parent().next().find('select');
- execution.html('').append(response);
- execution.chosen().trigger("chosen:updated");
- });
- });
-});
diff --git a/module/gitlab/js/managebranchpriv.js b/module/gitlab/js/managebranchpriv.js
deleted file mode 100644
index 5a7931c5e8..0000000000
--- a/module/gitlab/js/managebranchpriv.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Update other picker on change */
-$.zui.Picker.DEFAULTS.onChange = function(event)
-{
- var picker = event.picker;
- if(!picker.$formItem.is('[name^=branches]')) return;
-
- var select = picker.$formItem[0];
- var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false});
-
- $('.user-picker[name^=branches]').each(function()
- {
- if(this === select) return;
-
- var $select = $(this);
- var selectPicker = $select.data('zui.picker');
-
- if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]);
- });
-}
-
-/**
- * Save branch priv.
- *
- * @access public
- * @return void
- */
-function savePriv()
-{
- $('#saveBtn').addClass('hidden');
- $('#submit').removeClass('hidden');
- $('#submit').click();
-}
-
-/**
- * Add item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, itemIndex);
- var $tr = $('
' + item + '
').insertAfter($(obj).closest('tr'));
- var $branches = $tr.find('select').addClass('user-picker').trigger('list:updated').picker({type: 'user'});
- itemIndex++;
-
- var disabledItems = [];
- $('.user-picker[name^=branches]').each(function()
- {
- if(this === $branches[0]) return;
- var $select = $(this);
- var picker = $select.data('zui.picker');
- if(!picker) return;
- var selectItem = picker.getListItem(picker.getValue());
- if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true}));
- });
- if(disabledItems.length) $branches.data('zui.picker').updateOptionList(disabledItems);
-}
-
-/**
- * Delete item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#privForm .table tbody').children().length < 2) return false;
-
- $(obj).closest('tr').find('.picker .picker-selection-remove').click();
- $(obj).closest('tr').remove();
-}
diff --git a/module/gitlab/js/managegroupmembers.js b/module/gitlab/js/managegroupmembers.js
deleted file mode 100644
index 48aaa55e1b..0000000000
--- a/module/gitlab/js/managegroupmembers.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Save team members.
- *
- * @access public
- * @return void
- */
-function saveMembers()
-{
- $('#saveBtn').addClass('hidden');
- $('#submit').removeClass('hidden');
- $('#submit').click();
-}
-
-/**
- * Add item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, i);
- $(obj).closest('tr').after('
' + item + '
');
- var selects = $(obj).closest('tr').next('tr').find('select');
- selects.each(function()
- {
- $(this).trigger('liszt:updated');
- $(this).chosen();
- });
- $(obj).closest('tr').next('tr').find('.form-date').datetimepicker();
- i ++;
-}
-
-/**
- * Delete item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($(obj).hasClass('disabled')) return false;
- if($('#teamForm .table-form tbody').children().length < 2) return false;
- $(obj).closest('tr').remove();
-}
-
-$(document).on('change', '[id^="levels"]', function()
-{
- $tr = $(this).closest('tr');
- $next = $(this).closest('td').next()
- var ownerLevel = 50;
- if($(this).val() == ownerLevel)
- {
- $next.prepend('
');
- $next.find('[id^="expires"]').addClass('hidden');
- $tr.find('a[onclick^="deleteItem"]').addClass('disabled');
- }
- else
- {
- $next.find('[id^="expires"]').removeClass('hidden');
- $next.find('input.disabled').remove();
- $tr.find('a[onclick^="deleteItem"]').removeClass('disabled');
- }
-})
diff --git a/module/gitlab/js/manageprojectmembers.js b/module/gitlab/js/manageprojectmembers.js
deleted file mode 100644
index f67e13d81e..0000000000
--- a/module/gitlab/js/manageprojectmembers.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Save team members.
- *
- * @access public
- * @return void
- */
-function saveMembers()
-{
- $('#saveBtn').addClass('hidden');
- $('#submit').removeClass('hidden');
- $('#submit').click();
-}
-
-/**
- * Add item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, i);
- $(obj).closest('tr').after('
' + item + '
');
- var selects = $(obj).closest('tr').next('tr').find('select');
- selects.each(function()
- {
- $(this).trigger('liszt:updated');
- $(this).chosen();
- });
- $(obj).closest('tr').next('tr').find('.form-date').datetimepicker();
- i ++;
-}
-
-/**
- * Delete item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#teamForm .table-form tbody').children().length < 2) return false;
- $(obj).closest('tr').remove();
-}
diff --git a/module/gitlab/js/managetagpriv.js b/module/gitlab/js/managetagpriv.js
deleted file mode 100644
index c431f79906..0000000000
--- a/module/gitlab/js/managetagpriv.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Update other picker on change */
-$.zui.Picker.DEFAULTS.onChange = function(event)
-{
- var picker = event.picker;
- if(!picker.$formItem.is('[name^=tags]')) return;
-
- var select = picker.$formItem[0];
- var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false});
-
- $('.user-picker[name^=tags]').each(function()
- {
- if(this === select) return;
-
- var $select = $(this);
- var selectPicker = $select.data('zui.picker');
-
- if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]);
- });
-}
-
-/**
- * Save tag priv.
- *
- * @access public
- * @return void
- */
-function savePriv()
-{
- $('#saveBtn').addClass('hidden');
- $('#submit').removeClass('hidden');
- $('#submit').click();
-}
-
-/**
- * Add item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, itemIndex);
- var $tr = $('
' + item + '
').insertAfter($(obj).closest('tr'));
- var $tags = $tr.find('select').addClass('user-picker').trigger('list:updated').picker({type: 'user'});
- itemIndex++;
-
- var disabledItems = [];
- $('.user-picker[name^=tags]').each(function()
- {
- if(this === $tags[0]) return;
- var $select = $(this);
- var picker = $select.data('zui.picker');
- if(!picker) return;
- var selectItem = picker.getListItem(picker.getValue());
- if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true}));
- });
- if(disabledItems.length) $tags.data('zui.picker').updateOptionList(disabledItems);
-}
-
-/**
- * Delete item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#privForm .table tbody').children().length < 2) return false;
-
- $(obj).closest('tr').find('.picker .picker-selection-remove').click();
- $(obj).closest('tr').remove();
-}
diff --git a/module/gogs/css/browse.css b/module/gogs/css/browse.css
deleted file mode 100644
index cb15b6808d..0000000000
--- a/module/gogs/css/browse.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-id {width: 60px;}
-.c-name {width: 200px;}
diff --git a/module/gogs/css/create.css b/module/gogs/css/create.css
deleted file mode 100644
index eca6cd5850..0000000000
--- a/module/gogs/css/create.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.main-content>.center-block {max-width: 800px;}
-#gogsForm table {width: 600px;}
diff --git a/module/gogs/js/binduser.js b/module/gogs/js/binduser.js
deleted file mode 100644
index 014d06eeb1..0000000000
--- a/module/gogs/js/binduser.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(document).ready(function()
-{
- $('.gitlab-user-bind').change(function()
- {
- var user = zentaoUsers[$(this).val()];
- if(user !== undefined)
- {
- $(this).parent().parent().find('.email').text(user.email)
- }
- });
-
- $(document).on('click', '.zentao-users .chosen-container', function()
- {
- var $obj = $(this).prev('select');
- var value = $obj.val();
- if($obj.hasClass('filled')) return false;
-
- $obj.empty();
- $obj.append($('#userList').html());
- $obj.val(value);
- $obj.addClass('filled');
- $obj.trigger("chosen:updated");
- })
-});
diff --git a/module/group/css/browse.css b/module/group/css/browse.css
deleted file mode 100644
index b5b8a32691..0000000000
--- a/module/group/css/browse.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.user {display: block; width: 80px; float: left; overflow: hidden;}
-.c-name {width: 130px;}
-.c-desc {width: 300px;}
-.btn-admin {margin-left: 0px !important}
-
-#groupList tbody tr.even td {word-wrap: break-word;}
diff --git a/module/group/css/copy.css b/module/group/css/copy.css
deleted file mode 100644
index 79fdcfe687..0000000000
--- a/module/group/css/copy.css
+++ /dev/null
@@ -1 +0,0 @@
-.checkbox-inline {display: inline-block !important; padding-left: 0px;}
diff --git a/module/group/css/managemember.css b/module/group/css/managemember.css
deleted file mode 100644
index 8d6249cdba..0000000000
--- a/module/group/css/managemember.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.group-item {display: block; width: 100px; float: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;}
-.group-item .checkbox-primary {margin-left: 2px;}
-.group-item .checkbox-primary > input {cursor: pointer;}
-.group-item .checkbox-primary > label {width: 100px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
-.table th {vertical-align: top;}
-.main-table tbody > tr > td {border-bottom: 0px;}
diff --git a/module/group/css/managepriv.css b/module/group/css/managepriv.css
deleted file mode 100644
index 27e561a224..0000000000
--- a/module/group/css/managepriv.css
+++ /dev/null
@@ -1,87 +0,0 @@
-.flex-center {display: flex; justify-content: center; align-items: center;}
-#mainContainer {display: flex; gap: 16px; height: calc(100vh - 165px);}
-#mainContainer > .main {flex: 1 1 75%; overflow-y: auto; padding: 0px; border: 1px solid #FFF; box-sizing: content-box;}
-#mainContainer > .side {flex: 1 1 25%;}
-#mainContainer .main .btn-group {position: absolute; visibility: hidden; top: 2px; display: inline-block; z-index: 2;}
-.priv-panel {background: #fff; padding: 10px 16px; box-shadow: 0 1px 1px rgb(0 0 0 / 5%), 0 2px 6px 0 rgb(0 0 0 / 5%);}
-.priv-panel {height: 40%;}
-.priv-panel .table-empty-tip {padding: calc(15% - 10px) 10px;}
-.priv-panel + .priv-panel .table-empty-tip {padding: calc(30% - 20px) 10px;}
-.priv-panel + .priv-panel {margin-top: 16px; height: calc(60% - 16px);}
-.priv-panel > .panel-content {height: calc(100% - 25px); overflow-y: auto; padding-left: 4px; margin-top: 10px;}
-.priv-panel > .panel-bottom {padding-top: 20px;}
-.priv-panel > .panel-title {position: relative;}
-.priv-panel > .panel-title > .icon-help {position: absolute; top: 3px; margin-left: 8px;}
-.icon-help + .popover {font-weight: 400;}
-.menuTree li.has-list:not(:first-child) {margin-top: 20px;}
-
-/* tree */
-.tree ul > li {display: inline-block; width: 50%;}
-.menuTree li > ul {margin-bottom: 0px;}
-.menuTree > li.has-list.open:before {top: 25px;}
-.priv-item > .icon {padding-left: 5px;}
-.empty-tip {height: 100%;}
-.menuTree > li {padding-left: 2px;}
-.menuTree > li.has-list.open:before {left: 9px;}
-.menuTree ul > li {padding-left: 20px; padding-top: 10px;}
-
-.table-bymodule select.form-control {height: 250px;}
-.group-item {display: block; width: 170px; float: left; font-size: 13px;}
-.group-item .checkbox-inline label {padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
-#privList .package label, #privList .module label {overflow: visible;}
-.table.table-form tbody > tr:last-child td {border-top: 1px solid #ddd;}
-@-moz-document url-prefix() {.table.table-form tbody > tr:last-child td, .table.table-form tbody > tr:last-child th {border-bottom: 1px solid #ddd;};}
-
-#mainMenu #groupName {line-height: 33px; float: left;}
-.checkbox-right {padding-left: 0px !important;}
-
-#privList td.menus {border-right: 0; padding-right: 0; width: 170px !important;}
-#privList td.menus + td {border-left: 0; padding-left: 0px; padding}
-#privList .menus .checkbox-primary {float: left; width: 160px;}
-#privList .menus .checkbox-primary:first-child {float: left; width: auto;}
-#privList .menus a {margin-left: 10px;}
-
-#privList {margin-bottom: 0px;}
-#privList tr:hover>td {background-color: #FFF;}
-#privList th.module {width: 142px; min-width: 142px; background-color: #EDEEF28C; font-weight: 600;}
-#privList th.package {width: 142px; min-width: 142px; background-color: #F4F5F78C; font-weight: 600;}
-#privList th .checkbox-inline input {margin-left: 0px;}
-#privList .check-all {display: inline-block;}
-#privList .check-all > label {padding-left: 0; font-weight: 600;}
-#privList .text-middle.text-left {padding-left: 24px;}
-#privList tbody > tr > td {padding: 4px 20px 20px 20px;}
-#privList .group-item {margin-top: 16px;}
-#privList .group-item .checkbox-inline label {padding-left: 3px;}
-.table-bordered td, .table-bordered th {border-top-style: dashed; border-bottom-style: dashed; border-color: #FFF;}
-.table-bordered td, .table-bordered thead th:last-child {border-color: #F5F6F8;}
-.check-all>label.checkbox-indeterminate-block:before {content: ' '; opacity: 1; transform: scale(1);}
-.priv-footer {padding: 14px; z-index: 11; box-shadow: inset 0 0px 0px rgb(0 0 0 / 10%), 0 0 5px rgb(0 0 0 / 10%); position: relative; min-height: 40px; background: #fff; border-radius: 0 0 4px 4px;}
-.priv-footer .btn {margin 0px; padding-top: 7px;}
-.priv-footer .check-all {display: inline-block;}
-.priv-footer .check-all label {padding-left: 0px; margin-bottom: 0px; font-weight: 400;}
-.priv-footer #submit {margin: 0px 20px;}
-main#main {padding-bottom: 0px;}
-.side .priv-panel {padding: 16px;}
-
-#privPackageList th.module {width: 142px; min-width: 142px; max-width: 142px; background-color: #EDEEF28C; font-weight: 600; padding-left: 20px; border-color: #FFF;}
-#privPackageList .module label {padding-left: 0; overflow: visible;}
-#privPackageList td.package-column {padding: 20px 16px; background-color: #FFF;}
-#privPackageList div.package {display: inline-block; width: calc(25% - 5px); padding: 10px 0;}
-#privPackageList .package + .package {padding: 0;}
-#privPackageList .package .check-all {display: inline-block; height: 20px;}
-#privPackageList .package input {margin-top: 0px; margin-left: 0px; left: 0px; height: 20px;}
-#privPackageList .package label {padding-left: 0; display: inline-block;}
-#privPackageList .privs, #privPackageList .menus-privs {padding: 20px 20px 0 20px; margin: 10px 0px;border: 1px solid #D9DBE1; background-color: #F9FAFB; position: relative; display: block; max-width: unset; box-shadow: unset; z-index: 1;}
-#privPackageList .menus-privs {margin-top: 35px; border-style: dashed;}
-#privPackageList .popover .popover-content {display: inline-block; padding: 0;}
-#privPackageList .popover .arrow {border-bottom-color: #D9DBE1; top: -10px;}
-#privPackageList .popover .arrow:after {border-bottom-color: #F9FAFB;}
-#privPackageList .group-item .checkbox-inline label {padding-left: 0}
-#privPackageList .group-item {display: inline-block; width: 158px; margin-bottom: 15px;}
-#privPackageList .group-item > .checkbox-primary {display: inline-block;}
-#privPackageList .priv-toggle.icon {width: 12px; height: 12px; position: relative; display: inline-block; color: #9EA3B0; margin-left: 4px; line-height: 12px;}
-#privPackageList .priv-toggle.icon:before {content: "\e925"; font-size: 12px; min-width: unset; transform: scale(0.5); font-weight: 900;}
-#privPackageList .priv-toggle.icon:after {position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; display: inline-block; content: ""; border: 1px solid; border-radius: 10%;}
-#privPackageList .priv-toggle.icon.open:before {content: "\e926";}
-
-.table-bymodule select option:hover {color: #fff;}
diff --git a/module/group/css/manageprojectadmin.css b/module/group/css/manageprojectadmin.css
deleted file mode 100644
index 02ae152621..0000000000
--- a/module/group/css/manageprojectadmin.css
+++ /dev/null
@@ -1 +0,0 @@
-#sidebar .cell {margin-top: 40px;}
diff --git a/module/group/css/manageview.css b/module/group/css/manageview.css
deleted file mode 100644
index 72dcb7ae30..0000000000
--- a/module/group/css/manageview.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.group-item {display: block; width: 93px; float: left; margin-top: 5px;}
-.action-item {display: block; width: 200px; float: left; margin-top: 5px;}
-
-.checkbox-primary>label {padding-left: 20px;}
-.pl-0px {padding-left: 0px !important;}
-.pt-0px {padding-top: 0px !important;}
-
-#manageViewForm {margin-bottom: 200px;}
diff --git a/module/group/js/managemember.js b/module/group/js/managemember.js
deleted file mode 100644
index 256d67edf1..0000000000
--- a/module/group/js/managemember.js
+++ /dev/null
@@ -1,34 +0,0 @@
-$(function()
-{
- $('.check-all input[type=checkbox]').change(function()
- {
- var checked = $(this).prop('checked');
- $(this).parents('tr').find('input[type=checkbox]').prop('checked', checked);
- });
-
- $('.table-members table tr').selectable(
- {
- selector: 'input',
- listenClick: false,
- select: function(e)
- {
- $('[data-id=' + e.id + ']').prop('checked', true);
-
- var checked = true;
- var memberNum = $('[data-id=' + e.id + ']').closest('td').find('input').length;
- var checkedMemberNum = $('[data-id=' + e.id + ']').closest('td').find('input:checked').length;
- if(memberNum > checkedMemberNum) checked = false;
- $('[data-id=' + e.id + ']').closest('tr').find('.check-all input').prop('checked', checked);
- },
- unselect: function(e)
- {
- $('[data-id=' + e.id + ']').prop('checked', false);
-
- var checked = true;
- var memberNum = $('[data-id=' + e.id + ']').closest('td').find('input').length;
- var checkedMemberNum = $('[data-id=' + e.id + ']').closest('td').find('input:checked').length;
- if(memberNum > checkedMemberNum) checked = false;
- $('[data-id=' + e.id + ']').closest('tr').find('.check-all input').prop('checked', checked);
- }
- });
-});
diff --git a/module/group/js/managepriv.js b/module/group/js/managepriv.js
deleted file mode 100644
index a68b434178..0000000000
--- a/module/group/js/managepriv.js
+++ /dev/null
@@ -1,566 +0,0 @@
-function showPriv(value)
-{
- location.href = createLink('group', 'managePriv', "type=" + type + "¶m="+ groupID + "&menu=&version=" + value);
-}
-
-/**
- * Control the packages select control for a module.
- *
- * @param string $module
- * @access public
- * @return void
- */
-function setModulePackages(module)
-{
- $('#packageBox select').addClass('hidden'); // Hide all select first.
- $('#packageBox select').val(''); // Unselect all select.
- $("select[data-module='" + module + "']").removeClass('hidden'); // Show the action control for current module.
-
- updatePrivList('module', module);
-}
-
-/**
- * Control the actions select control for a package.
- *
- * @access public
- * @return void
- */
-function setActions()
-{
- $('#actionBox select').val('');
-
- var hasSelectedPackage = ',' + $('#packageBox select').not('.hidden').val().join(',') + ',';
-
- updatePrivList('package', hasSelectedPackage);
-
-}
-
-function setNoChecked()
-{
- var noCheckValue = '';
- $('tbody .group-item > div > div > input').each(function()
- {
- if(!$(this).prop('checked') && $(this).attr('data-id') != undefined) noCheckValue = noCheckValue + ',' + $(this).attr('data-id');
- });
- $('#noChecked').val(noCheckValue);
-}
-
-/**
- * Update the action box when module or package selected.
- *
- * @param string parentType module|package
- * @param string parentList
- * @access public
- * @return void
- */
-function updatePrivList(parentType, parentList)
-{
- var selectedModule = $('#module').val();
- $.get(createLink('group', 'ajaxGetPrivByParents', 'module=' + selectedModule + '&parentType=' + parentType + '&parentList=' + parentList), function(data)
- {
- $('#actions').replaceWith(data);
- })
-}
-
-/**
- * Change parent item checked.
- *
- * @access public
- * @return void
- */
-function changeParentChecked($item, moduleName, packageID)
-{
- var moduleAllPrivs = $item.closest('tbody').find('.group-item[data-module=' + moduleName +']:not(.menus-browse)').length;
- var moduleSelectPrivs = $item.closest('tbody').find('.group-item[data-module=' + moduleName +']:not(.menus-browse)').find('[checked=checked]').length;
- var $moduleItem = $item.closest('tbody').find('.module[data-module=' + moduleName +']');
- if($item.closest('tbody').find('.menus.' + moduleName).length > 0)
- {
- moduleAllPrivs += $item.closest('tbody').find('.menus.' + moduleName + ' input[name^=actions]:not(input[value=browse])').length;
- moduleSelectPrivs += $item.closest('tbody').find('.menus.' + moduleName + ' input[name^=actions][checked=checked]:not(input[value=browse])').length;
- }
- if(moduleSelectPrivs == 0)
- {
- $moduleItem.find('input[type=checkbox]').removeAttr('checked');
- $moduleItem.find('label').removeClass('checkbox-indeterminate-block');
- }
- else if(moduleAllPrivs == moduleSelectPrivs)
- {
- $moduleItem.find('input[type=checkbox]').attr('checked', 'checked');
- $moduleItem.find('label').removeClass('checkbox-indeterminate-block');
- }
- else
- {
- $moduleItem.find('input[type=checkbox]').removeAttr('checked');
- $moduleItem.find('label').addClass('checkbox-indeterminate-block');
- }
-
- if(packageID == '') return;
-
- var packageAllPrivs = $item.closest('tbody').find('.group-item[data-module=' + moduleName +'][data-package=' + packageID +']:not(.menus-browse)').length;
- var packageSelectPrivs = $item.closest('tbody').find('.group-item[data-module=' + moduleName +'][data-package=' + packageID +']:not(.menus-browse)').find('[checked=checked]').length;
- var $packageItem = $item.closest('tbody').find('.package[data-module=' + moduleName +'][data-package=' + packageID +']');
- if($item.closest('tbody').find('.menus.' + moduleName).length > 0)
- {
- packageAllPrivs += $item.closest('tbody').find('.menus.' + moduleName + ' input[name^=actions]:not(input[value=browse])').length;
- packageSelectPrivs += $item.closest('tbody').find('.menus.' + moduleName + ' input[name^=actions][checked=checked]:not(input[value=browse])').length;
- }
- if(packageSelectPrivs == 0)
- {
- $packageItem.find('input[type=checkbox]').removeAttr('checked');
- $packageItem.find('label').removeClass('checkbox-indeterminate-block');
- }
- else if(packageAllPrivs == packageSelectPrivs)
- {
- $packageItem.find('input[type=checkbox]').attr('checked', 'checked');
- $packageItem.find('label').removeClass('checkbox-indeterminate-block');
- }
- else
- {
- $packageItem.find('input[type=checkbox]').removeAttr('checked');
- $packageItem.find('label').addClass('checkbox-indeterminate-block');
- }
-}
-
-/**
- * Init comp recomend-tree.
- *
- * @param array data
- * @access public
- * @return void
- */
-function initRecomendTree(data)
-{
- $(".menuTree.recommend").tree(
- {
- data: data,
- initialState: 'expand',
- itemCreator: function($li, item)
- {
- var index = item.relationPriv ? recommedSelect.indexOf(item.relationPriv.toString()) : -1;
- if(item.relationPriv === undefined) item.relationPriv = '';
- $li.append('
= 0 ? 'checked="checked"' : '') + 'data-has-children="' + (item.children ? !!item.children.length : false) + '"' + (item.children ? '' : 'data-type="recommend" data-privid="' + item.privID + '" data-relationpriv="' + item.relationPriv + '"') + 'type="checkbox" name="recommendPrivs[]" value="' + item.relationPriv + '" title="' + item.title + '" id="recommendPrivs[' + item.module + ']' + item.method + '" data-module="' + item.module + '" data-method="' + item.method + '">
');
- }
- });
- $('.menuTree.recommend i.list-toggle').remove();
-}
-
-/**
- * Init comp depend-tree.
- *
- * @param array data
- * @access public
- * @return void
- */
-function initDependTree(data)
-{
- $(".menuTree.depend").tree(
- {
- data: data,
- initialState: 'expand',
- itemCreator: function($li, item)
- {
- $li.append('
');
- }
- });
- $('.menuTree.depend i.list-toggle').remove();
-}
-
-/**
- * update comp tree after click checkbox-label.
- *
- * @param obj objTree
- * @access public
- * @return void
- */
-function updatePrivTree(privList)
-{
- if(privList == null)
- {
- privList = new Array();
- $('tbody .group-item input:checked').each(function()
- {
- var privID = $(this).closest('.group-item').attr('data-id');
- if($(this).closest('popover-content').length == 0 && privList.indexOf(privID) < 0) privList.push(privID);
- });
- selectedPrivIdList = privList;
- }
-
- $.ajax(
- {
- url: createLink('group', 'ajaxGetRelatedPrivs'),
- dataType: 'json',
- method: 'post',
- data: {"privList" : privList.toString(), "recommedSelect": recommedSelect.toString(), "excludeIdList": Object.values(excludeIdList).toString()},
- success: function(data)
- {
- if(data.depend == undefined || data.depend.length == 0)
- {
- $('.side .menuTree.depend').empty();
- $('.side .menuTree.depend').closest('.priv-panel').find('.table-empty-tip').removeClass('hidden');
- }
- else
- {
- $(".menuTree.depend").data('zui.tree').reload(data.depend);
- $('.side .menuTree.depend').closest('.priv-panel').find('.table-empty-tip').addClass('hidden');
- }
-
- if(data.recommend == undefined || data.recommend.length == 0)
- {
- $('.side .menuTree.recommend').empty();
- $('.side .menuTree.recommend').closest('.priv-panel').find('.table-empty-tip').removeClass('hidden');
- }
- else
- {
- $(".menuTree.recommend").data('zui.tree').reload(data.recommend);
- $('.side .menuTree.recommend').closest('.priv-panel').find('.table-empty-tip').addClass('hidden');
- $('.menuTree.recommend > li').each(function(){
- var allItemLength = $(this).find('ul input[type=checkbox]').length;
- var checkedItemLength = $(this).find('ul input[type=checkbox][checked=checked]').length;
- if(checkedItemLength > 0 && allItemLength == checkedItemLength)
- {
- $(this).find('.check-all input').attr('checked', 'checked');
- }
- else if(checkedItemLength > 0)
- {
- $(this).find('.check-all label').addClass('checkbox-indeterminate-block');
- }
- });
- }
-
- $('.menuTree i.list-toggle').remove();
- $('.menuTree li.has-list').addClass('open');
- }
- });
-}
-
-/**
- * When check all change.
- *
- * @access public
- * @return void
- */
-function checkAllChange()
-{
- var id = $(this).find('input[type=checkbox]').attr('id');
- var checked = $(this).find('input[type=checkbox]').prop('checked');
-
- if(id == 'allChecker')
- {
- $('input[type=checkbox]').prop('checked', checked);
-
- if(checked) $('input[type=checkbox]').attr('checked', checked);
- if(!checked) $('input[type=checkbox]').removeAttr('checked');
- $('tbody .checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
- }
- else if($(this).closest('#privList').length > 0)
- {
- var moduleName = $(this).closest('th').attr('data-module');
- var packageID = $(this).closest('th').hasClass('package') ? $(this).closest('th').attr('data-package') : '';
- var $children = $(this).closest('th').hasClass('package') ? $(this).closest('tbody').find('[data-module=' + moduleName +'][data-package=' + packageID +']') : $(this).closest('tbody').find('[data-module=' + moduleName +']');
-
- $children.find('input[type=checkbox]').prop('checked', checked);
- $children.find('.checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
-
- if(checked) $children.find('input[type=checkbox]').attr('checked', checked);
- if(!checked) $children.find('input[type=checkbox]').removeAttr('checked');
-
- changeParentChecked($(this), moduleName, packageID);
- }
- else if($(this).closest('#privPackageList').length > 0)
- {
- var moduleName = $(this).parent().attr('data-module');
- var packageID = $(this).parent().hasClass('package') ? $(this).parent().attr('data-package') : '';
- var $children = $(this).parent().hasClass('package') ? $(this).closest('td').find('[data-module=' + moduleName +'][data-package=' + packageID +']') : $(this).closest('tbody').find('[data-module=' + moduleName +']');
-
- $children.find('input[type=checkbox]').prop('checked', checked);
- $children.find('.checkbox-indeterminate-block').removeClass('checkbox-indeterminate-block');
-
- if(checked) $children.find('input[type=checkbox]').attr('checked', checked);
- if(!checked) $children.find('input[type=checkbox]').removeAttr('checked');
-
- changeParentChecked($(this), moduleName, packageID);
- }
- updatePrivTree(null);
-}
-
-/**
- * Whrn group item change.
- *
- * @param object $item
- * @access public
- * @return void
- */
-function groupItemChange()
-{
- var checked = $(this).prop('checked');
- if(checked)
- {
- $(this).attr('checked', 'checked');
- }
- else
- {
- $(this).removeAttr('checked');
- }
- if($('#privPackageList').length > 0)
- {
- var dataid = $(this).attr('data-id');
- var $priv = $('#privPackageList').find('.group-item input[data-id="' + dataid + '"]');
- if(checked)
- {
- $priv.attr('checked', 'checked');
- }
- else
- {
- $priv.removeAttr('checked');
- }
- }
- var moduleName = $(this).closest('.group-item').attr('data-module');
- var packageID = $(this).closest('.group-item').attr('data-package');
- changeParentChecked($(this), moduleName, packageID);
-
- var privID = $(this).closest('.group-item').attr('data-id');
- if(privID != 0)
- {
- var index = selectedPrivIdList.indexOf(privID);
-
- if(privID > 0 && index < 0 && checked) selectedPrivIdList.push(privID);
- if(privID > 0 && index > -1 && !checked) selectedPrivIdList.splice(index, 1);
-
- updatePrivTree(selectedPrivIdList);
- }
-}
-
-/**
- * When recommend privs change.
- *
- * @param object $item
- * @param bool $checked
- * @access public
- * @return void
- */
-function recommendChange($item, checked)
-{
- var privModule = $item.attr('data-module');
- var privMethod = $item.attr('data-method');
- var $actionItem = $('#privList').length > 0 ? $('#privList input[data-id="' + privModule + '-' + privMethod + '"]') : $('#privPackageList input[data-id="' + privModule + '-' + privMethod + '"]');
- $actionItem.prop('checked', checked);
- if(checked)
- {
- $item.attr('checked', 'checked');
- $actionItem.attr('checked', 'checked');
- }
- else
- {
- $item.removeAttr('checked');
- $actionItem.removeAttr('checked');
- }
- var moduleName = $actionItem.closest('tr').find('.package').attr('data-module');
- var packageID = $('#privList').length > 0 ? $actionItem.closest('tr').find('.package').attr('data-package') : $actionItem.closest('.privs').attr('data-package');
- changeParentChecked($actionItem, moduleName, packageID);
-
- var $parentItem = $item.closest('ul').closest('li').find('input[data-has-children="true"]');
- var allItemLength = $item.closest('ul').find('input[type=checkbox]').length;
- var checkedItemLength = $item.closest('ul').find('input[type=checkbox][checked=checked]').length;
- if(checkedItemLength == 0)
- {
- $parentItem.removeAttr('checked');
- $parentItem.closest('.checkbox-primary').find('label').removeClass('checkbox-indeterminate-block');
- }
- else if(allItemLength == checkedItemLength)
- {
- $parentItem.attr('checked', 'checked');
- $parentItem.closest('.checkbox-primary').find('label').removeClass('checkbox-indeterminate-block');
- }
- else
- {
- $parentItem.removeAttr('checked');
- $parentItem.closest('.checkbox-primary').find('label').addClass('checkbox-indeterminate-block');
- }
-
- var privID = $item.attr('data-relationpriv');
- if(privID != 0)
- {
- var index = selectedPrivIdList.indexOf(privID);
-
- if(privID > 0 && index < 0 && checked) selectedPrivIdList.push(privID);
- if(privID > 0 && index > -1 && !checked) selectedPrivIdList.splice(index, 1);
-
- index = recommedSelect.indexOf(privID);
-
- if(privID > 0 && index < 0 && checked) recommedSelect.push(privID);
- if(privID > 0 && index > -1 && !checked) recommedSelect.splice(index, 1);
- }
-}
-
-/**
- * Change btn position.
- *
- * @access public
- * @return void
- */
-function positionBtn()
-{
- var btnLeft = $('.main.main-content > table').width() - 63;
- $('.main.main-content > .btn-group').css('left', btnLeft).css('visibility', 'unset');
-}
-
-$(function()
-{
- if($(".side .icon-help").length > 0) $(".side .icon-help").popover();
-
- positionBtn();
- $('.main.main-content').resize(positionBtn);
-
- selectedPrivIdList = Object.values(selectedPrivIdList);
-
- recommedSelect = new Array();
-
- relatedPrivData = $.parseJSON(relatedPrivData);
- initDependTree(relatedPrivData.depend);
- if(relatedPrivData.depend == undefined || relatedPrivData.depend == 0) $(".menuTree.depend").closest('.priv-panel').find('.table-empty-tip').removeClass('hidden');
- initRecomendTree(relatedPrivData.recommend);
- if(relatedPrivData.recommend == undefined || relatedPrivData.recommend == 0) $(".menuTree.recommend").closest('.priv-panel').find('.table-empty-tip').removeClass('hidden');
-
- $('#privList > tbody > tr > th .check-all').change(checkAllChange);
- $('#privPackageList > tbody > tr .check-all').change(checkAllChange);
- $('.priv-footer .check-all').change(checkAllChange);
-
- $('#privList tbody > tr .group-item input[type=checkbox]').change(groupItemChange);
- $('#privPackageList .package-column').on('click', '.privs.popover input[type=checkbox]', groupItemChange);
-
- $('.side').on('click', '.recommend input[type=checkbox]', (function()
- {
- var checked = $(this).prop('checked');
- if($(this).attr('data-has-children') == 'true')
- {
- $(this).closest('li').find('ul > li input[type=checkbox]').each(function(){
- recommendChange($(this), checked);
- });
- }
- else
- {
- recommendChange($(this), checked);
- }
- updatePrivTree(selectedPrivIdList);
- }));
-
- $('#privPackageList .package > .priv-toggle.icon').click(function()
- {
- var opened = $(this).hasClass('open');
-
- $('#privPackageList .package > .priv-toggle.icon').removeClass('open');
- $('.privs.popover').remove();
-
- if(!opened)
- {
- $(this).addClass('open');
- var moduleName = $(this).closest('.package').attr('data-module');
- var packageID = $(this).closest('.package').attr('data-package');
-
- /* The privs should be inserted after which permission package. */
- var perRowPackages = Math.floor($(this).closest('td').width() / $(this).closest('td').find('.package').width());
- var packageIndex = $(this).closest('.package').index() / 2 ;
- var appendIndex = (Math.floor(packageIndex / perRowPackages) + 1) * perRowPackages - 1;
-
- var $privs = $(".privs.hidden[data-module='" + moduleName + "'][data-package='" + packageID + "']")
- var $showPrivs = $('
'
- + $privs.html().replace(/actions/g, 'showPrivs')
- + '
');
-
- /* Calculate the triangle position of privs popover. */
- var position = $(this).closest('td').find('.package').width() * (packageIndex % perRowPackages) + 30;
-
- $showPrivs.find('.arrow').css('left', position + 'px');
-
- if($(this).closest('td').find('.package').eq(appendIndex).length == 0)
- {
- $(this).closest('td').find('.package').eq(-1).after($showPrivs);
- $showPrivs.css('margin-bottom', '0');
- }
- else
- {
- $(this).closest('td').find('.package').eq(appendIndex).after($showPrivs);
- }
- }
- });
-
- $('#privPackageList .package-column').on('click', '.privs .priv-toggle.icon', (function()
- {
- var opened = $(this).hasClass('open');
-
- $('#privPackageList .group-item > .priv-toggle.icon').removeClass('open');
- $('.menus-privs.popover').remove();
-
- if(!opened)
- {
- $(this).addClass('open');
- var moduleName = $(this).closest('.privs').attr('data-module');
- var packageID = $(this).closest('.privs').attr('data-package');
-
- /* The menus privs should be inserted after which priv. */
- var perRowPrivs = Math.floor($(this).closest('.popover-content').width() / $(this).closest('.popover-content').find('.group-item').width());
- var privIndex = $(this).closest('.group-item').index();
- var appendIndex = (Math.floor(privIndex / perRowPrivs) + 1) * perRowPrivs - 1;
-
- var $menusPrivs = $(this).closest('.group-item').find('.menus-privs')
- var $showPrivs = $('');
-
- /* Calculate the triangle position of privs popover. */
- var position = $(this).closest('.popover-content').width() * (privIndex % perRowPrivs) + 30;
-
- $showPrivs.find('.arrow').css('left', position + 'px');
-
- if($(this).closest('.popover-content').find('.group-item:not(.menus-item)').eq(appendIndex).length == 0)
- {
- $showPrivs.css('margin-bottom', '0');
- $(this).closest('.popover-content').find('.group-item:not(.menus-item)').eq(-1).after($showPrivs);
- }
- else
- {
- $(this).closest('.popover-content').find('.group-item:not(.menus-item)').eq(appendIndex).after($showPrivs);
- }
- }
- }));
-
- $('#privPackageList .package-column').on('click', '.menus-privs input[type=checkbox]', (function()
- {
- var $menusPrivs = $(this).closest('.popover-content').find('.menus-item');
- var $parentPrivs = $(this).closest('.privs').find('.checkbox-primary.check-all');
- var allPrivs = $menusPrivs.length;
- var selectPrivs = $menusPrivs.find('input[checked=checked]').length;
-
- if(allPrivs > 0 && allPrivs == selectPrivs)
- {
- $parentPrivs.find('input').attr('checked', 'checked');
- $parentPrivs.find('label').removeClass('checkbox-indeterminate-block');
- }
- else if(selectPrivs == 0)
- {
- $parentPrivs.find('input').removeAttr('checked');
- $parentPrivs.find('label').removeClass('checkbox-indeterminate-block');
- }
- else
- {
- $parentPrivs.find('input').removeAttr('checked');
- $parentPrivs.find('label').addClass('checkbox-indeterminate-block');
- }
- groupItemChange();
- }));
-
- $('#privPackageList .package-column').on('click', '.privs .check-all', (function()
- {
- var checked = $(this).find('input[type=checkbox]').prop('checked');
- var $children = $(this).closest('.package-column').find('.menus-privs .menus-item');
- if(checked)
- {
- $children.find('input').attr('checked', 'checked');
- }
- else
- {
- $children.find('input').removeAttr('checked');
- }
- $children.find('label').removeClass('checkbox-indeterminate-block');
- $(this).find('label').removeClass('checkbox-indeterminate-block');
- changeParentChecked($(this), $(this).closest('.group-item').attr('data-module'), $(this).closest('.group-item').attr('data-package'));
- }));
-});
diff --git a/module/group/js/manageprojectadmin.js b/module/group/js/manageprojectadmin.js
deleted file mode 100644
index 27e87c725c..0000000000
--- a/module/group/js/manageprojectadmin.js
+++ /dev/null
@@ -1,90 +0,0 @@
-function addItem(obj)
-{
- var maxNum = 0;
- $(obj).closest('table').find("tr[class^='line']").each(function()
- {
- var trname = $(this).attr('class');
- var index = trname.match(/\d+/g);
-
- index = parseInt(index);
- maxNum = index > maxNum ? index : maxNum;
- })
-
- maxNum = parseInt(maxNum);
- maxNum += 1;
-
- var className = $(obj).closest('tr').attr('class');
- var lastTr = $('table tr.' + className).last();
- $($('table tr.' + className).get().reverse()).each(function()
- {
- var $newRow = $(this).clone();
- $newRow.attr('class', className.replace(/\d+/g, maxNum));
- $newRow.addClass('highlight');
- $newRow.find('select').each(function()
- {
- var name = $(this).attr('name');
- var id = $(this).attr('id');
- $(this).attr('name', name.replace(/\d+/g, maxNum));
- $(this).attr('id', id.replace(/\d+/g, maxNum));
- })
-
- $newRow.find("input[type='checkbox']").each(function()
- {
- var name = $(this).attr('name');
- var id = $(this).attr('id');
- $(this).attr('name', name.replace(/\d+/g, maxNum));
- $(this).attr('id', id.replace(/\d+/g, maxNum));
- $(this).attr('checked', false);
- })
-
- $(lastTr).after($newRow);
- $newRow.find('div.picker').remove();
- $newRow.find('.picker-select').val('').picker({chosenMode: true});
-
- var $picker = $newRow.find('.picker-select').data('zui.picker');
- $picker.setDisabled(false);
- setTimeout(function()
- {
- $newRow.removeClass('highlight');
- }, 1600);
- })
-
- if($("table tr").size() > 6)
- {
- $('.btn-delete').removeClass('hidden');
- }
-}
-
-function deleteItem(obj)
-{
- var currentClass = $(obj).closest('tr').attr('class');
- $(obj).closest('table').find('tr.' + currentClass).remove();
-
- if($("table tr").size() <= 6)
- {
- $('.btn-delete').addClass('hidden');
- return false;
- }
-}
-
-function resetProgramName(obj)
-{
- var programSelect = $(obj).closest('tr').find('select[name^="program"]');
- var newName = 'program[' + $(obj).val() + '][]';
- programSelect.attr('name', newName);
-}
-
-function toggleDisabled(obj)
-{
- var checked = $(obj).is(':checked');
- var $picker = $(obj).closest('tr').find('.input-group select').data('zui.picker');
-
- if(checked)
- {
- $picker.setDisabled(true);
- }
- else
- {
- $picker.setDisabled(false);
- }
-}
diff --git a/module/group/js/manageview.js b/module/group/js/manageview.js
deleted file mode 100644
index a02bbccc8f..0000000000
--- a/module/group/js/manageview.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Toggle program.
- *
- * @access public
- * @return void
- */
-function toggleProgram()
-{
- $('#programBox').toggle($('#program').prop("checked"));
-}
-
-/**
- * Toggle product.
- *
- * @access public
- * @return void
- */
-function toggleProduct()
-{
- $('#productBox').toggle($('#product').prop("checked"));
-}
-
-/**
- * Toggle project.
- *
- * @access public
- * @return void
- */
-function toggleProject()
-{
- $('#projectBox').toggle($('#project').prop("checked"));
-}
-
-/**
- * Toggle execution.
- *
- * @access public
- * @return void
- */
-function toggleExecution()
-{
- $('#executionBox').toggle($('#execution').prop("checked"));
-}
-
-/**
- * Select all.
- *
- * @param obj $obj
- * @access public
- * @return void
- */
-function selectAll(obj)
-{
- $(obj).closest('tr').find(':checkbox').prop('checked', $(obj).prop('checked'));
-}
-
-$('input:checkbox[name^="allchecker"]').change(function()
-{
- $('.group-item :checkbox[name^="actions"]').change();
-});
-
-$(function()
-{
- $('.group-item :checkbox[name^="actions"]').change(function()
- {
- var allChecked = true;
- $('.group-item :checkbox[name^="actions"]').each(function()
- {
- if(!$(this).prop('checked')) allChecked = false;
- })
- $('.group-item input:checkbox[name^="allchecker"]').prop('checked', allChecked);
-
- var id = $(this).attr('id');
- if(id == 'program') toggleProgram();
- if(id == 'product') toggleProduct();
- if(id == 'project') toggleProject();
- if(id == 'execution') toggleExecution();
- if($('#' + id + 'ActionBox').length == 1) $('#' + id + 'ActionBox').toggle($(this).prop("checked"));
- })
- $('.group-item :checkbox[name^="actions"]').change();
- $("tr[id$='ActionBox']").each(function()
- {
- var allChecked = true;
- $(this).find('td:last :checkbox').each(function()
- {
- if(!$(this).prop('checked'))
- {
- allChecked = false;
- return true;
- }
- });
- if(allChecked) $(this).find('th :checkbox').prop('checked', true);
- });
-});
diff --git a/module/holiday/css/browse.css b/module/holiday/css/browse.css
deleted file mode 100644
index 9ee7e73529..0000000000
--- a/module/holiday/css/browse.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.tree .active{font-weight: bold;}
-.with-side .side {position: absolute; width: 130px;}
-.with-side .main {padding-left: 145px; float: left;}
-.panel-sm .panel-body {padding: 10px;}
-#mainMenu .input-control {display: flex; width: 200px;}
-#mainMenu .input-control .form-name {margin: 8px 10px; white-space: pre;}
-.table-import {padding: 6px 5px 5px 5px; }
-.shadow-sm {box-shadow: 0 1px 1px rgb(0 0 0 / 5%), 0 2px 6px 0 rgb(0 0 0 / 25%)}
-.flex-center {display: flex; align-items: center; justify-content: center;}
-.c-desc {width: 280px;}
-p.c-desc {white-space: nowrap; margin-bottom: 0; text-overflow: clip; overflow: hidden;}
diff --git a/module/holiday/js/browse.js b/module/holiday/js/browse.js
deleted file mode 100644
index 0cfe06705a..0000000000
--- a/module/holiday/js/browse.js
+++ /dev/null
@@ -1,7 +0,0 @@
-$(function()
-{
- $(document).on('change', '#year', function()
- {
- window.location.href = createLink('holiday', 'browse', 'year=' + $(this).val()) + '?_single=1';
- });
-});
diff --git a/module/host/css/browseimage.css b/module/host/css/browseimage.css
deleted file mode 100644
index ef7500cb63..0000000000
--- a/module/host/css/browseimage.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.c-name,.c-status,.c-progress,.c-osName{width: 130px;}
-.main-header-image{border:none;margin-left: 0!important;padding-left:0;}
-.body-modal #mainContent{padding-top: 85px; padding-bottom: 50px;}
-.dropdown-menu>li>a {margin: 1px 0;}
diff --git a/module/host/css/create.css b/module/host/css/create.css
deleted file mode 100644
index 00c8e21f88..0000000000
--- a/module/host/css/create.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#unit {padding: 0px !important; width:0px; border-left: 0px;}
-.input-group-addon {border: 0px;}
-#unit_chosen a {border-left: 0px; border-radius: 0 2px;}
diff --git a/module/host/css/edit.css b/module/host/css/edit.css
deleted file mode 100644
index 2d2de85465..0000000000
--- a/module/host/css/edit.css
+++ /dev/null
@@ -1,2 +0,0 @@
-span#unit {padding: 0px !important; width: 0px;}
-#unit {border-left: 0px;}
diff --git a/module/host/css/treemap.css b/module/host/css/treemap.css
deleted file mode 100644
index 6c0510dcab..0000000000
--- a/module/host/css/treemap.css
+++ /dev/null
@@ -1,2 +0,0 @@
-#hostsTreemap {white-space: nowrap;}
-#mainMenu {padding-bottom: .75rem; padding-top: .75rem;}
\ No newline at end of file
diff --git a/module/host/css/view.css b/module/host/css/view.css
deleted file mode 100644
index 4ca9101427..0000000000
--- a/module/host/css/view.css
+++ /dev/null
@@ -1 +0,0 @@
-.outer .main .table tr > th:first-child, .outer .main .table tr > td:first-child { padding-left: 10px; }
diff --git a/module/host/js/browseimage.js b/module/host/js/browseimage.js
deleted file mode 100644
index aa7117f964..0000000000
--- a/module/host/js/browseimage.js
+++ /dev/null
@@ -1,60 +0,0 @@
-var interval;
-
-$(function () {
- updateProgressInterval();
-});
-
-function updateProgressInterval() {
- updateProgress();
- interval = setInterval(function ()
- {
- updateProgress();
- }, 3000);
-}
-
-function updateProgress() {
- $.get(createLink('zahost', 'ajaxImageDownloadProgress', 'hostID=' + hostID)).done(function (response)
- {
- var result = JSON.parse(response);
- var statusList = result.data;
-
- var hasInprogress = false;
- for (var imageID in statusList) {
- if (statusList[imageID].statusCode) {
- if (statusList[imageID].statusCode == 'inprogress' || statusList[imageID].statusCode == 'created' || statusList[imageID].statusCode == 'pending')
- {
- hasInprogress = true;
- $('.image-download-' + imageID).addClass('disabled');
- $('.image-cancel-' + imageID).removeClass('disabled');
- }
- else if (statusList[imageID].statusCode == 'completed')
- {
- $('.image-path-' + imageID).text(statusList[imageID].path);
- $('.image-path-' + imageID).attr('title', statusList[imageID].path);
- $('.image-download-' + imageID).addClass('disabled');
- $('.image-cancel-' + imageID).addClass('disabled');
- $('.image-cancel-' + imageID).attr('href', '#');
- $('.image-progress-' + imageID).text("100%");
- }
- else
- {
- var link = createLink('zahost', 'downloadImage', "hostID="+hostID+"&imageID="+imageID);
- $('.image-download-' + imageID).removeClass('disabled');
- $('.image-download-' + imageID).attr('href', link);
- $('.image-cancel-' + imageID).addClass('disabled');
- $('.image-cancel-' + imageID).attr('href', '#');
- $('.image-progress-' + imageID).text('');
- }
- $('.image-status-' + imageID).text(statusList[imageID].status);
- if(statusList[imageID].progress != '' && statusList[imageID].statusCode != 'completed')
- {
- $('.image-progress-' + imageID).text(statusList[imageID].progress);
- }
- }
- }
- if (!hasInprogress)
- {
- clearInterval(interval)
- }
- });
-}
diff --git a/module/host/js/create.js b/module/host/js/create.js
deleted file mode 100644
index 7bdbb6d2ae..0000000000
--- a/module/host/js/create.js
+++ /dev/null
@@ -1,11 +0,0 @@
-$(document).ready(function(){
- $('#osName').change(function(){
- var selectVal = $('#osName').val();
- $.get(createLink('host', 'ajaxGetOSVersion', 'field=' + selectVal), function(data)
- {
- $('select#osVersion').replaceWith(data);
- $('#osVersion_chosen').remove();
- $("select#osVersion").chosen();
- });
- });
-});
diff --git a/module/host/js/edit.js b/module/host/js/edit.js
deleted file mode 100644
index 51bf58b516..0000000000
--- a/module/host/js/edit.js
+++ /dev/null
@@ -1,20 +0,0 @@
-$(document).ready(function(){
- /* Change the operating system. */
- $('#osName').change(function(){
- var selectVal = $('#osName').val();
- $.get(createLink('host', 'ajaxGetOSVersion', 'field=' + selectVal), function(data)
- {
- $('select#osVersion').replaceWith(data);
- $('#osVersion_chosen').remove();
- $("select#osVersion").chosen();
- });
- });
-
- var width = $("[name='unit']").css('width');
- width = parseInt(width);
- if(width < 74)
- {
- $("[name='unit']").css({'width': '74px'});
- }
-});
-
diff --git a/module/index/css/changelog.css b/module/index/css/changelog.css
deleted file mode 100644
index b1b7c5e884..0000000000
--- a/module/index/css/changelog.css
+++ /dev/null
@@ -1,14 +0,0 @@
-#versionContent {min-height: 240px;}
-#featureList {padding: 0 10px;}
-#featureList > .item {padding: 0 0 10px 0;}
-#featureList > .item > h3 {color: #114f8e; font-size: 16px; margin: 0; padding: 10px 0;}
-#featureList > .item > .desc {color: #666; padding-left: 18px;}
-#featureList > .item > .more-link {color: #666; padding-left: 18px;}
-#featureList > .item > .more {display: none;}
-#featureList + #details {padding: 0;}
-#details .details-list {display: none; padding: 10px; background: #f1f1f1; border-radius: 4px;}
-#details.show-details .details-list {display: block;}
-#details > .btn > .icon-angle-right {transition: transform .2s; display: inline-block;}
-#details.show-details > .btn > .icon-angle-right {transform: rotate(90deg);}
-#details.show-details > .btn:focus {border-radius: 4px 4px 0 0;}
-#details.show-details > .btn:focus + .details-list {border-radius: 0 0 4px 4px;}
diff --git a/module/index/css/index.css b/module/index/css/index.css
deleted file mode 100644
index bd165d5ace..0000000000
--- a/module/index/css/index.css
+++ /dev/null
@@ -1,124 +0,0 @@
-body {padding-left: 96px;}
-#menu {position: fixed; left: 0; top: 0; bottom: 0; width: 96px; z-index: 1015;}
-.menu-show .menu-tip {display: none!important;}
-#menuNav {position: absolute; top: 5px; bottom: 40px; width: 100%;}
-#menu .nav > li {float: none; padding: 2px 8px;}
-#menu .nav > li > a {color: #fff; line-height: 24px; padding: 6px; border-radius: 2px; white-space: nowrap; height: 36px;}
-#menu .nav > li > a > .icon {display: inline-block; font-size: 16px; position: relative; top: -1px}
-#menu .nav > li > a > .icon + .text {margin-left: 4px; position: relative; top: -1px}
-#menu .nav > li.active > a, #menu .nav > li > a:hover, #menu .nav > li > a:focus {background-color: #3785ff;}
-#menu .nav > li.divider {margin: 8px; background-color: #fff; opacity: 0.24; height: 1px; padding: 0 !important;}
-#menuFooter {position: absolute; bottom: 0; left: 0; right: 0;}
-#menu .nav > li.has-avatar {padding: 1px 6px;}
-#menu .nav > li.has-avatar > a {padding: 4px 0; text-align: center;}
-body.menu-hide {padding-left: 0;}
-.menu-hide #menu {width: 40px;}
-.menu-hide .menu-toggle .icon:before {content: '\e9f1';}
-.menu-toggle .is-unfold, .menu-hide .menu-toggle .is-collapse {display: none;}
-.menu-hide .menu-toggle .is-unfold {display: inline;}
-#menuToggleItem,
-.menu-hide #menuToggleItem {display: list-item;}
-.menu-hide #menu .nav > li {padding: 2px 4px;}
-.menu-hide #menu .nav > li > a {padding: 6px 4px; text-align: center;}
-.menu-hide #menu .nav > li > a > .icon {top: 1px}
-.menu-hide #menu .nav > li > a > .text {display: none;}
-.menu-hide #menu .nav > li.has-avatar > a {padding: 2px 0;}
-#menuMoreNav {display: none;}
-.show-more-nav #menuMoreNav {display: block;}
-#menuMoreList {left: 100%; margin-left: -2px; top: 0; background-color: #3c495c;}
-#menuMoreList > li {padding: 2px 6px;}
-#menuMoreList > li > a {color: #fff; padding: 4px 6px 4px 12px; border-radius: 2px; margin: 0;}
-#menuMoreList > li > a > .icon {opacity: 1; font-size: 16px;}
-#menuMoreList > li.divider {opacity: .2; margin: 6px; padding: 0;}
-#menu .dropdown-hover:hover > a, #menu .dropdown.open > a {background-color: rgba(0,0,0,.3);}
-
-#moreExecution {display: none; max-height: 520px; min-height: 520px; max-width: 360px; min-width: 150px; position: fixed; bottom: 40px; z-index: 999; background: white; padding: 20px 10px; border: 1px solid #efefef;}
-.more-execution-show {left: 96px;}
-.more-execution-hide {left: 40px;}
-#moreExecution .icon-search {opacity: 0.5;}
-#executionList {max-height: 450px; min-height: 450px; max-width: 360px; min-width: 150px; margin-top: 5px;}
-
-@media screen and (max-height: 768px)
-{
- #moreExecution {max-height: 340px; min-height: 340px;}
- #executionList {max-height: 270px; min-height: 270px;}
-}
-
-#apps {position: fixed; left: 96px; bottom: 0; right: 0; top: 0;}
-.app-container {position: absolute; left: 0; bottom: 40px; right: 0; top: 0; background-color: #efefef;}
-.menu-hide #apps {left: 40px;}
-.app-container.loading:before {background-color: rgba(0,0,0,.1);}
-.app-container.loading:before, .app-container.loading::after {transition-delay: 3s;}
-.app-container.loading.open-from-hidden {transition-delay: 0s;}
-.app-container.loading.open-from-hidden > iframe {opacity: 0;}
-.app-container.loading.no-delay:before, .app-container.loading.no-delay::after {transition-delay: 0s !important;}
-
-#appsBar {position: fixed; left: 96px; bottom: 0; right: 0; height: 40px; z-index: 1012; background: #fff; border-top: 1px solid #eff1f7;}
-.menu-hide #appsBar {left: 40px;}
-#bars {position: absolute; left: 0; top: 0; bottom: 0; padding: 0 5px;}
-#bars > li {padding: 8px 2px;}
-#bars > li > a {height: 24px; color: #000; padding: 2px 8px; line-height: 20px; border-radius: 2px;}
-#bars > li.active > a {background: #fff!important;}
-#bars > li > a:hover, #bars > li > a:active, #bars > li > a:focus {background: #16a8f8!important; color: #fff;}
-#bars > li.active > a > span, #bars > li.active > a:active > span, #bars > li.active > a:focus > span {padding-bottom: 2px; font-weight: 600; border-bottom: 2px solid #16a8f8;}
-#bars > li.active:after {content: ' '; display: block; position: absolute; height: 3px; left: 5px; right: 5px; bottom: 0; border-radius: 2px;}
-#bars > li.divider{margin-right: 5px; margin-top: 10px; height: 20px; border-right: 1px solid #d9d9d9;}
-
-#flodNav {float: none; margin: 0;}
-#flodNav>li {text-align: center;}
-#flodNav>li>.dropdown-menu {left: 100%; bottom: 0; top: auto; width: 140px; text-align: left; background: #3c495c;}
-#flodNav>li>.dropdown-menu a {color: #fff;}
-#flodNav>li>.dropdown-menu .dropdown-menu {left: 100%; text-align: left; background: #3c495c;}
-#flodNav>li .top .dropdown-menu {top: -60px;}
-#flodNav .dropdown-menu>li>a>.icon {position: relative; top: 0; display: inline;}
-#flodNav li.open>a {background: #0c64eb;}
-#flodNav li.divider {opacity: .24; border-top: 1px solid; height: 2px;}
-#flodNav .dropdown-submenu:focus > a, #flodNav .dropdown-submenu:hover > a {background-color: rgba(0,0,0,.2);}
-#poweredBy {width: 40%; position: absolute; top: 4px; right: 0; padding: 0;}
-
-#globalSearchDiv {width: 200px; float: right; margin-right: 4px;}
-#globalSearchDiv .input-group {width: 194px; float: right; margin-top: 2px;}
-#searchbox .dropdown-menu.show-quick-go.with-active {min-width: 270px;}
-#searchbox .dropdown-menu.show-quick-go > li {padding: 0 5px;}
-#searchbox .dropdown-menu {min-width: 150px;}
-
-#globalSearchInput {height: 28px; padding-left: 10px; border-right: 0px;}
-#globalSearchButton {height: 28px;}
-#globalSearchButton > i {position: relative; top: -2px}
-
-#globalBarLogo {width: 100%; float: right;}
-#globalBarLogo a:first-child {margin-right: 10px;}
-#globalBarLogo a {float: right; margin: 0px 2px;}
-#globalBarLogo a .icon {font-size: 24px; color: #16a8f8;}
-#globalBarLogo a .version {font-size: 13px; position: relative; bottom: 3px;}
-
-#searchbox a {float: left; width: 100%;}
-#searchbox a:hover {color: white;}
-#searchbox {width: 100%;}
-#searchbox .dropdown-menu {margin-top: 0px; left: 1px; position: absolute; top: -50px;}
-#searchbox .dropdown-menu > li > a {padding: 5px 0px 5px 2px;}
-#searchbox .dropdown-menu > li {display: none;}
-#searchbox .dropdown-menu > li.search-type-all {width: 100%; display: block;}
-#searchbox .dropdown-menu > li:hover {position: relative;}
-#searchbox .dropdown-menu.show-quick-go.with-active {position: absolute; top: initial; bottom: 4px; min-height: 318px; padding-top: 30px;}
-#searchbox .dropdown-menu.show-quick-go > li {display: block;}
-#searchbox .dropdown-menu.show-quick-go > li.active {width: 100%; position: absolute; top: 0; left: 0; right: 0;}
-#searchbox .dropdown-menu>li.active>a, #searchbox .dropdown-menu>li.selected>a {position: relative; color: #fff; background-color: #16a8f8;}
-#searchbox .dropdown-menu>li.selected>a:after {position: absolute; top: 2px; right: 4px; display: block; font-family: ZentaoIcon; font-size: 18px; font-size: 14px; font-style: normal; font-weight: 400; font-variant: normal; line-height: 1; line-height: 20px; text-transform: none; content: "\e5ca"; speak: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}
-
-#upgradeContent {display: none; position: absolute; top: -330px; right: 10px; width: 65%; height: 322px; background-color: #fff; padding: 5px 0; border: 1px solid rgba(0,0,0,.15); border-color: rgba(0,0,0,.1); opacity: 1; border-radius: 4px; box-shadow: 0 6px 12px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.1);}
-#latestVersionList {height: 270px; overflow: auto;}
-
-.version-upgrade {width: 14px; height: 16px; float: left; background-repeat: no-repeat; background-position: center ; background-size: cover; display: block;}
-.version-content {padding: 10px 15px;}
-.version-footer {padding-top: 5px;}
-.version-detail {color: #8a8a8a;}
-.upgrade-now {float: right;}
-.color-primary {color: #3280fc;}
-
-@media screen and (max-height: 768px)
-{
- #upgradeContent{width: 85%;}
-}
-#searchbox .dropdown-menu > li.search-type-all{max-width: 250px}
-#searchbox .dropdown-menu > li.search-type-all a{width: 100%; overflow: hidden; text-overflow: ellipsis;}
diff --git a/module/index/js/index.js b/module/index/js/index.js
deleted file mode 100644
index b4d155cd38..0000000000
--- a/module/index/js/index.js
+++ /dev/null
@@ -1,935 +0,0 @@
-(function()
-{
- /* Init variables */
- var openedApps = {}; // Key-value to save appCode-app pairs
- var appsMap = {}; // Key-value to save opened appCode-app pairs
- var openedAppZIndex = 10; // Last opened app z-index
- var defaultApp; // Default app code
- var lastOpenedApp; // Last opened app code
-
- /**
- * Init apps menu list
- */
- function initAppsMenu()
- {
- var $helpLink = $('#helpLink');
- appsMap.help =
- {
- code: 'help',
- icon: 'icon-help',
- url: manualUrl || $helpLink.attr('href'),
- external: true,
- text: manualText || $helpLink.text(),
- appUrl: config.webRoot + '#app=help'
- };
- var $menuMainNav = $('#menuMainNav').empty();
- window.appsMenuItems.forEach(function(item)
- {
- if(item === 'divider') return $menuMainNav.append('
');
-
- /* Append tid param to app url */
- if($.tabSession && item.url)
- {
- item.url = $.tabSession.convertUrlWithTid(item.url);
- }
-
- var $link= $('
')
- .attr('data-app', item.code)
- .attr('data-toggle', 'tooltip')
- .attr('class', 'show-in-app')
- .html(item.title);
-
- item.icon = ($link.find('.icon').attr('class') || '').replace('icon ', '');
- item.text = $link.text().trim();
- $link.html('
' + item.text + '');
- if(item.code === 'devops') $link.find('.text').addClass('num');
- appsMap[item.code] = item;
-
- $('
').attr('data-app', item.code)
- .append($link)
- .appendTo($menuMainNav);
-
- $link.tooltip({title: item.text, container: 'body', placement: 'right', tipClass: 'menu-tip'});
-
- if(!defaultApp) defaultApp = item.code;
- });
-
- appsMap['search'] =
- {
- opened: false,
- code: 'search',
- group: 'search',
- icon: 'icon-search',
- methodName: 'index',
- moduleName: 'search',
- text: searchCommon,
- title: '
' + searchCommon,
- url: '/index.php?m=search&f=index',
- vars: ''
- };
- }
-
- /**
- * Get app code from url
- * @param {String} urlOrModuleName Url string
- * @return {String}
- */
- function getAppCodeFromUrl(urlOrModuleName)
- {
- var code = window.navGroup[urlOrModuleName];
- if(code) return code;
-
- var link = $.parseLink(urlOrModuleName);
- if(!link.moduleName || link.isOnlyBody || (link.moduleName === 'index' && link.methodName === 'index')) return '';
-
- if(link.hash && link.hash.indexOf('app=') === 0) return link.hash.substr(4);
-
- /* Handling special situations */
- var moduleName = link.moduleName;
- var methodName = link.methodName;
- if (moduleName === 'index' && methodName === 'index') return 'my';
-
- var methodLowerCase = methodName.toLowerCase();
- if(moduleName === 'doc')
- {
- if(link.prj) return 'project';
-
- if((link.params.from || link.params.$3) == 'product')
- {
- if(['showfiles', 'browse', 'view', 'edit', 'delete', 'create'].includes(methodLowerCase)) return 'product';
- }
- return 'doc';
- }
- if(['caselib', 'testreport', 'testsuite', 'testtask', 'testcase', 'bug', 'qa'].includes(moduleName))
- {
- return link.prj ? 'project' : 'qa';
- }
- if(moduleName === 'report')
- {
- if(['usereport', 'editreport', 'deletereport', 'custom'].includes(methodLowerCase) && link.params.from)
- {
- return 'system';
- }
- else
- {
- return link.prj ? 'project' : 'report';
- }
- }
- if(moduleName === 'story' && vision === 'lite') return 'project'
- if(moduleName === 'testcase' && methodLowerCase === 'zerocase')
- {
- return link.params.from == 'project' ? 'project' : 'qa';
- }
- if(moduleName === 'execution' && methodLowerCase === 'all')
- {
- return (link.params.from || link.params.$3) == 'project' ? 'project' : 'execution';
- }
- if(moduleName === 'issue' || moduleName === 'risk' || moduleName === 'opportunity' || moduleName === 'pssp' || moduleName === 'auditplan' || moduleName === 'meeting' || moduleName === 'nc')
- {
- if(link.params.$2 == 'my' || link.params.from == 'my') return 'my';
- if(link.params.$2 == 'project' || link.params.from == 'project') return 'project';
- if(link.params.$2 == 'execution' || link.params.from == 'execution') return 'execution';
- }
- if(moduleName === 'product')
- {
- if(methodLowerCase === 'create' && (link.params.programID || link.params.$1)) return 'program';
- if(methodLowerCase === 'edit' && (link.params.programID || link.params.$4)) return 'program';
- if(methodLowerCase === 'batchedit') return 'program';
- var moduleGroup = link.params.moduleGroup ? link.params.moduleGroup : link.params.$2;
- if(methodLowerCase === 'showerrornone' && link.params.$1 == 'project') return 'project';
- if(methodLowerCase === 'showerrornone' && (moduleGroup || moduleGroup)) return moduleGroup;
- }
- if(moduleName === 'stakeholder')
- {
- if(methodLowerCase === 'create' && (link.params.programID || link.params.$1)) return 'program';
- }
- if(moduleName === 'user')
- {
- if(['todo', 'todocalendar', 'effortcalendar', 'effort', 'task', 'todo', 'story', 'bug', 'testtask', 'testcase', 'execution', 'dynamic', 'profile', 'view', 'issue', 'risk'].includes(methodLowerCase)) return 'system';
- }
- if(moduleName === 'my')
- {
- if(['team'].includes(methodLowerCase)) return 'system';
- }
- if(moduleName === 'company') if(methodLowerCase == 'browse') return 'admin';
- if(moduleName === 'opportunity' || moduleName === 'risk' || moduleName == 'trainplan') if(methodLowerCase == 'view') return 'project';
- if(moduleName === 'tree')
- {
- if(methodLowerCase === 'browse')
- {
- var viewType = link.params.view || link.params.$2;
- if(['bug', 'case', 'caselib'].includes(viewType)) return link.params.$5 === 'project' ? 'project' : 'qa';
-
- if(viewType === 'doc' && (link.params.from === 'product' || link.params.$5 == 'product')) return 'product';
- if(viewType === 'doc' && (link.params.from === 'project' || link.params.$5 == 'project')) return 'project';
- if(viewType === 'doc') return 'doc';
- if(viewType === 'story') return 'product';
- }
- else if(methodLowerCase === 'browsetask')
- {
- return 'project';
- }
- }
- if(moduleName === 'search' && methodLowerCase === 'buildindex') return 'admin';
-
- code = window.navGroup[moduleName] || moduleName || urlOrModuleName;
- return appsMap[code] ? code : '';
- }
-
- /**
- * Open tab of app
- * @param {string} [url] Url to open
- * @param {string} [appCode] The code of target app to open
- * @return {void}
- */
- function openTab(url, appCode, forceReload)
- {
- /* Check params */
- if(!appCode)
- {
- if(appsMap[url])
- {
- appCode = url;
- url = '';
- }
- else
- {
- appCode = getAppCodeFromUrl(url);
- if(!appCode) return openTab('my');
- }
- }
-
- /* Create pate app object and store it */
- var app = openedApps[appCode];
- if(app)
- {
- if(app.$iframe && app.$iframe.length)
- {
- var iframe = app.$iframe[0];
- if(iframe && iframe.contentDocument && iframe.contentWindow && iframe.contentWindow.$)
- {
- var result = iframe.contentWindow.$(iframe.contentDocument).triggerHandler('openapp.apps', [app, url]);
- if (result === false) {
- return 'cancel';
- }
- }
- }
- }
- else
- {
- var $iframe = $(
- [
- '
'
- ].join(' '));
- var $app = $('
')
- .append($iframe)
- .appendTo('#apps');
-
- app = $.extend({$iframe: $iframe, $app: $app, code: appCode, opened: true}, appsMap[appCode]);
- openedApps[appCode] = app;
-
- /* If first show without url, then use the default url */
- if(!url) url = appsMap[appCode].url;
-
- var iframe = $iframe.get(0);
- iframe.onload = iframe.onreadystatechange = function(e)
- {
- $app.removeClass('loading').trigger('loadapp', app);
- };
- }
-
- /* Set tab cookie */
- $.cookie('tab', appCode, {expires: config.cookieLife, path: config.webRoot});
-
- /* Highlight at main menu */
- var $menuMainNav = $('#menuMainNav,#menuMoreNav');
- var $lastActiveNav = $menuMainNav.find('li.active');
- if($lastActiveNav.data('app') !== appCode)
- {
- $lastActiveNav.removeClass('active');
- $menuMainNav.find('li[data-app="' + appCode + '"]').addClass('active');
- }
-
- /* Show page app and update iframe source */
- var iframe = app.$iframe[0];
- var isSameUrl = iframe && url && iframe.contentWindow.location.href.endsWith(url);
- if (url && (!isSameUrl || forceReload !== false))
- {
- app.$app.toggleClass('open-from-hidden', app.zIndex < openedAppZIndex)
- reloadApp(appCode, url, true);
- }
- app.zIndex = ++openedAppZIndex;
- app.$app.show().css('z-index', app.zIndex);
-
- /* Update task bar */
- var $bars = $('#bars');
- var $bar = $('#appBar-' + appCode);
- if(!$bar.length)
- {
- if (typeof(app.text) == 'undefined') return false;
- var $link= $('
')
- .attr('data-app', appCode)
- .attr('class', 'show-in-app')
- .html('
' + app.text + '');
- var barCount = $('#bars li').length;
-
- if(barCount) $bar = $('
').appendTo($bars);
- $bar = $('
').attr('data-app', appCode)
- .attr('id', 'appBar-' + appCode)
- .append($link)
- .appendTo($bars);
- }
- var $lastActiveBar = $bars.find('li.active');
- if($lastActiveBar.data('app') !== appCode)
- {
- $lastActiveBar.removeClass('active');
- $bars.find('li[data-app="' + appCode + '"]').addClass('active');
- }
- app.$bar = $bar;
-
- /* Update others app state */
- for(var theCode in openedApps)
- {
- if(theCode !== appCode) openedApps[theCode].show = false;
- }
-
- /* Update current app state */
- app.show = true;
- if(lastOpenedApp !== appCode)
- {
- lastOpenedApp = appCode;
- updateAppUrl(appCode, null, null, true);
- }
-
- app.$app.trigger('showapp', app);
-
- return true;
- }
-
- /**
- * Get last opened app
- * @param {boolean} [onlyShowed] If set to true then only get last app from apps are showed
- * @returns {object} The opened app info object
- */
- function getLastApp(onlyShowed)
- {
- var lastShowIndex = 0;
- var lastApp = null;
- for(var appCode in openedApps)
- {
- var app = openedApps[appCode];
- if((!onlyShowed || app.show) && lastShowIndex < app.zIndex && !app.closed)
- {
- lastShowIndex = app.zIndex;
- lastApp = app;
- }
- }
- return lastApp;
- }
-
- /**
- * Hide app
- * @param {string} appCode The app code of target app to hide
- * @return {void}
- */
- function hideTab(appCode)
- {
- var app = openedApps[appCode];
- if(!app) return;
- app.$app.trigger('hideapp', app);
- if(!app.show) return;
-
- app.$app.hide();
- app.show = false;
- lastOpenedApp = null;
-
-
- /* Active last app */
- var lastApp = getLastApp(true) || getLastApp();
- showTab(lastApp ? lastApp.code : defaultApp);
- }
-
- /**
- * Show tab of app
- * @param {string} appCode The app code of target app to show
- * @return {void}
- */
- function showTab(appCode)
- {
- return openTab('', appCode);
- }
-
- /**
- * Toggle app
- * @param {string} appCode The app code of target app to toggle
- * @return {void}
- */
- function toggleApp(appCode)
- {
- var app = openedApps[appCode];
- if(!app || app.code !== lastOpenedApp) showTab(appCode);
- else hideTab(appCode);
- }
-
- /**
- * Close app
- * @param {string} appCode The app code of target app to close
- */
- function closeApp(appCode)
- {
- appCode = appCode || lastOpenedApp;
- var app = openedApps[appCode];
- if(!app) return;
-
- if(app.$iframe && app.$iframe.length)
- {
- var iframe = app.$iframe[0];
- if(iframe && iframe.contentDocument && iframe.contentWindow && iframe.contentWindow.$)
- {
- var result = iframe.contentWindow.$(iframe.contentDocument).triggerHandler('closeapp.apps', [app]);
- if (result === false) {
- return 'cancel';
- }
- }
- }
-
- var appKeys = Object.keys(openedApps)
- if(appKeys[0] == appCode)
- {
- $("#bars li.divider:first").remove();
- }
- else
- {
- $("#appBar-" + appCode).prev().remove();
- }
-
- app.closed = true;
- hideTab(appCode);
- app.$app.remove();
- app.$bar.remove();
- delete openedApps[appCode];
-
- var firstClass = $("#bars li:first").attr('class');
- if(firstClass == 'divider') $("#bars li.divider:first").remove();
-
- app.$app.trigger('closeapp', app);
- }
-
- /**
- * Reload app
- * @param {string} appCode The app code of target app to reload
- * @param {string|boolean} [url] The new url to load, it's optional
- * @param {boolean} [notTriggerEvent] Skip trigger event
- * @return {void}
- */
- function reloadApp(appCode, url, notTriggerEvent)
- {
- var app = openedApps[appCode];
- if(!app) return;
-
- if(url === true) url = app.url;
- else if($.tabSession) url = $.tabSession.convertUrlWithTid(url);
-
- var iframe = app.$iframe[0];
- var isSameUrl = iframe && url && iframe.contentWindow.location.href.endsWith(url);
-
- app.$app.trigger('beforereloadapp');
-
- /* Add hook to page before reload it */
- if (iframe && iframe.contentWindow.beforeAppReload)
- {
- iframe.contentWindow.beforeAppReload({app: app, url: url});
- }
-
- try
- {
- if(url && !isSameUrl) iframe.contentWindow.location.assign(url);
- else iframe.contentWindow.location.reload(true);
- }
- catch(_)
- {
- iframe.src = url || app.url || iframe.src;
- }
-
- if(!notTriggerEvent) app.$app.trigger('reloadapp', app);
-
- if(!isSameUrl || app.zIndex < openedAppZIndex) app.$app.addClass('loading');
- if(app._loadTimer) clearTimeout(app._loadTimer);
- app._loadTimer = setTimeout(function()
- {
- app.$app.removeClass('loading');
- app._loadTimer = null;
- }, 15000);
- }
-
- /**
- * Update browser url and title for the given app
- * @param {string} appCode The app code of target app to update url
- * @param {string|boolean} [url] The new url of the app
- * @param {string|boolean} [title] The new title of the app
- * @param {boolean} [push] Use push instead of replace
- * @return {void}
- */
- function updateAppUrl(appCode, url, title, push)
- {
- // if(window.TUTORIAL) return;
- var app = openedApps[appCode];
- if(!app || lastOpenedApp !== appCode) return;
-
- if(url) app.appUrl = url;
- else url = app.appUrl || app.url;
- if(title) app.appTitle = title;
- else title = app.appTitle || app.text;
-
- if(url && url.indexOf('#') < 0 && getAppCodeFromUrl(url) !== appCode) url = url + '#app=' + appCode;
- if(location.href !== url)
- {
- history[push ? 'pushState' : 'replaceState']({app: appCode}, title, url);
- }
- document.title = title;
- }
-
- /* Bind helper methods to global object "$.apps" */
- $.apps = window.apps =
- {
- show: showTab,
- open: openTab,
- hide: hideTab,
- toggle: toggleApp,
- close: closeApp,
- reload: reloadApp,
- updateUrl: updateAppUrl,
- getAppCode: getAppCodeFromUrl,
- getLastApp: getLastApp,
- openedApps: openedApps,
- appsMap: appsMap
- };
-
- /**
- * Refresh more menu in #menuNav
- * @return {void}
- */
- function refreshMoreMenu()
- {
- var $mainNav = $('#menuMainNav');
- var $list = $('#menuMoreList');
- var $menuNav = $('#menuNav');
- var $menuItems = $mainNav.children('li');
- var itemHeight = $menuItems.first().outerHeight();
- var maxHeight = $menuNav.height() - 10;
- var showMoreMenu = false;
- var currentHeight = itemHeight;
- var moreMenuHeight = 12;
-
- $menuItems.each(function()
- {
- var $item = $(this);
- var isDivider = $item.hasClass('divider');
- var height = isDivider ? 17 : itemHeight;
- currentHeight += height;
-
- if(currentHeight > maxHeight)
- {
- $item.addClass('hidden');
- if(!showMoreMenu)
- {
- showMoreMenu = true;
- $list.empty();
-
- var $prevItem = $item.prev();
- if($prevItem.hasClass('divider')) $prevItem.addClass('hidden');
-
- if(isDivider) return;
- }
- moreMenuHeight += isDivider ? 13 : 32;
- $list.append($item.clone().removeClass('hidden'));
- }
- else
- {
- $item.removeClass('hidden');
- }
- });
-
- /* The magic number "111" is the space between dropdown trigger
- btn and the bottom of screen */
- var listStyle = {maxHeight: 'initial', top: moreMenuHeight > 111 ? 111 - moreMenuHeight : ''};
- if($list[0] && $list[0].getBoundingClientRect)
- {
- var btnBounding = $list.prev('a')[0].getBoundingClientRect();
- if(btnBounding.height)
- {
- var winHeight = $(window).height();
- if(winHeight < moreMenuHeight)
- {
- listStyle.maxHeight = winHeight;
- listStyle.overflow = 'auto';
- listStyle.top = 5 - btnBounding.top;
- }
- else if(moreMenuHeight > (winHeight - btnBounding.top))
- {
- listStyle.top = winHeight - btnBounding.top - moreMenuHeight + 5;
- }
- }
- }
- $list.css(listStyle);
- $menuNav.toggleClass('show-more-nav', showMoreMenu);
-
- if(showMoreMenu && !$list.data('listened-click'))
- {
- $list.data('listened-click', true).on('click', function()
- {
- $list.addClass('hidden');
- setTimeout(function(){$list.removeClass('hidden')}, 200);
- });
- }
- }
-
- /* Init after current page load */
- $(function()
- {
- initAppsMenu();
-
- /* Bind events */
- $(document).on('click', '.open-in-app,.show-in-app', function(e)
- {
- var $link = $(this);
- if($link.is('[data-modal],[data-toggle][data-toggle!="tooltip"],.iframe,.not-in-app')) return;
- var url = $link.hasClass('show-in-app') ? '' : ($link.attr('href') || $link.data('url'));
- if(url && url.indexOf('onlybody=yes') > 0) return;
- if(openTab(url, $link.data('app')))
- {
- e.preventDefault();
- if($link.closest('#userNav').length)
- {
- var $menu = $('#userNav .dropdown-menu').addClass('hidden');
- setTimeout(function(){$menu.removeClass('hidden')}, 200);
- }
- }
- }).on('contextmenu', '.open-in-app,.show-in-app', function(event)
- {
- var $btn = $(this);
- var appCode = $btn.data('app');
- if(!appCode) return;
-
- var lang = window.appsLang;
- var app = openedApps[appCode];
- var items = [{label: lang.open, disabled: app && lastOpenedApp === appCode, onClick: function(){showTab(appCode)}}];
- if(app)
- {
- items.push({label: lang.reload, onClick: function(){reloadApp(appCode)}});
- if(appCode !== 'my') items.push({label: lang.close, onClick: function(){closeApp(appCode)}});
- }
-
- var options = {event: event, onClickItem: function(_item, _$item, e){e.preventDefault();}};
- var pos = $btn.data('pos');
- if(pos)
- {
- var bounding = $btn.closest('li')[0].getBoundingClientRect();
- if(pos === 'bar')
- {
- options.x = bounding.left;
- options.y = bounding.top - (appCode === 'my' ? 65 : 92);
- }
- else
- {
- options.x = bounding.right - 10;
- options.y = bounding.top;
- }
- }
- var $dropdown = $btn.closest('.dropdown');
- if($dropdown.length)
- {
- $dropdown.addClass('open');
- options.onHide = function(){$dropdown.removeClass('open');}
- }
-
- $.zui.ContextMenu.show(items, options);
- event.preventDefault();
- });
-
- window.addEventListener('popstate', function(event)
- {
- if(event.state && lastOpenedApp !== event.state.app) openTab(event.state.app);
- });
-
- /* Redirect or open default app after document load */
- var defaultOpenUrl = window.defaultOpen;
- var codeApp = '';
- if(location.hash.indexOf('#app=') === 0)
- {
- var hashParams = new URLSearchParams(location.hash.substring(1));
- codeApp = hashParams.get('app');
- if(hashParams.has('url')) defaultOpenUrl = hashParams.get('url');
- if(!defaultOpenUrl)
- {
- defaultOpenUrl = codeApp;
- codeApp = '';
- }
- }
-
- openTab(defaultOpenUrl || defaultApp, codeApp);
-
- /* Refresh more menu on window resize */
- $(window).on('resize', refreshMoreMenu);
- refreshMoreMenu();
- setTimeout(refreshMoreMenu, 500);
-
- /* Fix bug #21331. */
- var vibibleState = '';
- var visibleChange = '';
- if(typeof document.visibilityState != 'undefined')
- {
- visibleChange = 'visibilitychange';
- vibibleState = 'visibilityState';
- }
- else if(typeof document.webkitVisibilityState != 'undefined')
- {
- visibleChange = 'webkitvisibilitychange';
- vibibleState = 'webkitVisibilityState';
- }
- if(visibleChange)
- {
- document.addEventListener(visibleChange, function()
- {
- if(document[vibibleState] == 'visible') showTab($('#bars>li.active').data('app'));
- });
- }
- });
-}());
-
-(function()
-{
- $.toggleMenu = function(toggle)
- {
- var $body = $('body');
- if (toggle === undefined) toggle = $body.hasClass('menu-hide');
- $body.toggleClass('menu-hide', !toggle).toggleClass('menu-show', !!toggle);
- $.cookie('hideMenu', String(!toggle), {expires: config.cookieLife, path: config.webRoot});
- };
-
- $(function()
- {
- /* Click to show more. */
- $(document).on('click', '.menu-toggle', function()
- {
- $.toggleMenu();
- var $menu = $('#userNav .dropdown-menu').addClass('hidden');
- setTimeout(function(){$menu.removeClass('hidden')}, 200);
- });
-
- $('.menu-toggle').each(function()
- {
- $(this).attr('data-toggle', 'tooltip').tooltip({container: 'body', placement: 'right', tipClass: 'menu-tip', title: function()
- {
- return $(this).data($('body').hasClass('menu-hide') ? 'unfoldText' : 'collapseText');
- }});
- });
- });
-}());
-
-$.extend(
-{
- gotoObject:function()
- {
- objectType = $('#searchType').attr('value');
- objectValue = $('#globalSearchInput').attr('value');
-
- if(objectType && objectValue)
- {
- var reg = /[^0-9]/;
- if(reg.test(objectValue) || objectType == 'all')
- {
- var searchLink = createLink('search', 'index');
- searchLink += (searchLink.indexOf('?') >= 0 ? '&' : '?') + 'words=' + objectValue;
- $.apps.open(searchLink);
- }
- else
- {
- var types = objectType.split('-');
- var searchModule = types[0];
- var searchMethod = typeof(types[1]) == 'undefined' ? 'view' : types[1];
- var searchLink = createLink(searchModule, searchMethod, "id=" + objectValue);
- var assetType = ',story,issue,risk,opportunity,doc,';
- if(vision == 'or' && searchModule == 'story') searchLink = createLink(searchModule, searchMethod, "id=" + objectValue + '&version=0¶m=0&storyType=requirement');
- if(assetType.indexOf(',' + searchModule + ',') > -1)
- {
- var link = createLink('index', 'ajaxGetViewMethod' , 'objectID=' + objectValue + '&objectType=' + searchModule);
- $.get(link, function(data)
- {
- if(data)
- {
- searchModule = 'assetlib';
- searchMethod = data;
- searchLink = createLink(searchModule, searchMethod, "id=" + objectValue);
- }
- $.apps.open(searchLink);
- });
- }
- else
- {
- $.apps.open(searchLink);
- }
- }
-
- $.post(createLink('index', 'ajaxClearObjectSession'), {objectType: objectType});
- $('#globalSearchInput').click();
- }
- }
-});
-
-/* Initialize global search. */
-$(function()
-{
- var reg = /[^0-9]/;
- var $searchbox = $('#searchbox');
- var $typeSelector = $searchbox.find('.input-group-btn');
- var $dropmenu = $typeSelector.children('.dropdown-menu');
- var $searchQuery = $('#globalSearchInput');
-
- var toggleMenu = function(show)
- {
- $searchbox.toggleClass('open', show);
- $dropmenu.toggleClass('show', show).toggleClass('in', show);
- if(show) $dropmenu.show();
- else $dropmenu.hide();
- };
-
- var hideMenu = function(){toggleMenu(false);};
-
- var refreshMenu = function()
- {
- var val = $searchQuery.val();
- var searchType = changeSearchObject();
- if(val)
- {
- var isQuickGo = !reg.test(val);
- $dropmenu.toggleClass('show-quick-go', isQuickGo);
- var $typeAll = $dropmenu.find('li.search-type-all > a');
- $typeAll.text(searchAB + ' ' + val);
- if(isQuickGo)
- {
- $typeAll.closest('li').removeClass('active');
- $dropmenu.removeClass('with-active').find('li:not(.search-type-all) > a').each(function()
- {
- var $this = $(this);
- var isActiveType = $this.data('value') === searchType && searchType !== 'all';
- $this.closest('li').toggleClass('selected active', isActiveType);
- $this.text($this.data('name') + ' #' + (val.length > 7 ? (val.substr(0, 7) + '...') : val));
- if(isActiveType) $dropmenu.addClass('with-active');
- });
- }
- else
- {
- $dropmenu.find('li.active').removeClass('active');
- $typeAll.closest('li').addClass('active');
- }
- toggleMenu(true);
- }
- else
- {
- hideMenu();
- }
- };
-
- $dropmenu = $dropmenu.appendTo($searchbox);
- $dropmenu.on('click', 'a', function(e)
- {
- $('#searchType').val($(this).data('value'));
- $.gotoObject();
- e.stopPropagation();
- }).find('li > a').each(function()
- {
- var $this = $(this);
- $this.attr('data-name', $this.text());
- });
-
- var $allItem = $dropmenu.find('li > a[data-value="all"]');
- if($allItem.length)
- {
- $allItem.closest('li').addClass('search-type-all').prependTo($dropmenu);
- }
-
- $searchQuery.on('change keyup paste input propertychange', refreshMenu).on('focus', function()
- {
- setTimeout(refreshMenu, 300);
- });
-
- $(document).on('click', hideMenu);
-
- $(document).on('click', function()
- {
- $("#upgradeContent").hide();
- });
-
- $("#upgradeContent").click(function(event)
- {
- event.stopPropagation();
- });
-
- $("#bizLink").click(function(event)
- {
- var $upgradeContent = $('#upgradeContent').toggle();
- if(!$upgradeContent.is(':hidden'))
- {
- getLatestVersion();
- event.stopPropagation();
- }
- });
-
- $('.has-avatar').hover(function(event)
- {
- $('.contextmenu').attr('class', 'contextmenu');
- $('.contextmenu-menu').attr('class', 'contextmenu-menu fade');
- });
-
- $('#bars').mousedown(function()
- {
- $('#globalSearchInput').click();
- });
-
- /* Update patch, plugin, news, publicclass from zetao.net. */
- if(isAdminUser && !isIntranet) $.get(createLink('admin', 'ajaxSetZentaoData'));
-});
-
-/* Change the search object according to the module and method. */
-function changeSearchObject()
-{
- var appInfo = $.apps.getLastApp();
- var appPageModuleName = appInfo.$iframe[0].contentWindow.config.currentModule;
- var appPageMethodName = appInfo.$iframe[0].contentWindow.config.currentMethod;
-
- var searchType = appPageModuleName;
- if(appPageModuleName == 'product' && appPageMethodName == 'browse') var searchType = 'story';
-
- var projectMethod = 'task|story|bug|build';
- if(appPageModuleName == 'project' && projectMethod.indexOf(appPageMethodName) != -1) var searchType = appPageMethodName;
-
- if(appPageModuleName == 'my' || appPageModuleName == 'user') var searchType = appPageMethodName;
-
- if(searchObjectList.indexOf(',' + searchType + ',') == -1) var searchType = 'bug';
-
- if(vision == 'lite') var searchType = 'story';
- if(vision == 'or') var searchType = 'demand';
-
- if(searchType == 'program') var searchType = 'program-product';
- if(searchType == 'deploystep') var searchType = 'deploy-viewstep';
-
- $("#searchType").val(searchType);
- $('#searchTypeMenu li:first').attr('class', 'search-type-all');
-
- return searchType;
-}
-
-function getLatestVersion()
-{
- $('#globalSearchInput').click();
- $('#upgradeContent').toggle();
-}
diff --git a/module/install/css/index.css b/module/install/css/index.css
deleted file mode 100644
index 975c586da7..0000000000
--- a/module/install/css/index.css
+++ /dev/null
@@ -1,26 +0,0 @@
-h3 {font-size: 16px; margin-bottom: 20px;}
-blockquote {padding: 0; border-left: 0;}
-li {line-height: 2em;}
-.modal-dialog {position: relative; line-height: 20px;}
-.modal-header {position: absolute; right: 15px; top: 10px; border: none; z-index: 999;}
-.modal-body {padding: 20px 50px;}
-
-.dropdown-menu {min-width: 120px; margin-top: 0;}
-
-.col-md-4 {width: 20%;}
-.card {position: relative; display: block; padding: 0; overflow: hidden; border: 1px solid #ddd; border-radius: 0; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.075); box-shadow: 0 1px 2px rgba(0,0,0,.075); -webkit-transition: all .5s cubic-bezier(.175,.885,.32,1); -o-transition: all .5s cubic-bezier(.175,.885,.32,1); transition: all .5s cubic-bezier(.175,.885,.32,1);}
-
-.card .card-heading {display: block; padding: 10px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-
-.card .card-content {padding: 0 10px 10px 10px; overflow: hidden; text-overflow: ellipsis;}
-
-.card > .card-reveal {position: absolute; top: 100%; left: 0; width: 100%; height: 100%; background-color: #f1f1f1; -webkit-transition: all .8s cubic-bezier(.175,.885,.32,1); -o-transition: all .8s cubic-bezier(.175,.885,.32,1); transition: all .8s cubic-bezier(.175,.885,.32,1);}
-
-.card>.card-reveal>.card-heading {padding: 20px 10px;}
-.card:hover>.card-reveal {top: 0;}
-
-.card.ad > .img-wrapper {height: 110px; line-height: 110px; text-align: center; font-size: 25px; width: 100%;}
-.card.ad > .card-heading {text-align: center;}
-.card.ad > .card-reveal > .card-heading {padding: 12px 10px 10px 15px;}
-.card.ad > .card-reveal {color: #333;}
-.card.ad > .card-reveal li {line-height: 1.5; font-size: 12px;}
diff --git a/module/install/css/step4.css b/module/install/css/step4.css
deleted file mode 100644
index d9f2770656..0000000000
--- a/module/install/css/step4.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.panel {width: 1200px; margin: auto; padding: 0px 40px 40px 40px;}
-.panel h1 {margin-top: 20px; margin-bottom: 20px;}
-.panel .icon {font-size: 20px;}
-
-#mainContent tr td .icon-close {font-weight: bold; color: #ea644a;}
-#mainContent tr td .icon-check {font-weight: bold; color: #329d38;}
-
-#mainContent tr th {background-color: rgb(241, 241, 241);}
-#mainContent tr td {background-color: rgb(255, 255, 255); border-bottom: 1px solid rgb(238, 238, 238); border-right: 1px solid rgb(238, 238, 238);}
-
-.btn-wide {padding: 6px 85px;}
-#useLight:hover, #useALM:hover{color: #fff; background-color: #2e7fff; border-color: transparent;}
-
-#mainContent .datatable {cursor: default;}
-.container {padding-top: 20px;}
diff --git a/module/install/css/step5.css b/module/install/css/step5.css
deleted file mode 100644
index a9270b2176..0000000000
--- a/module/install/css/step5.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-company {width: 85px !important;}
-.c-company-value {width: 300px !important;}
diff --git a/module/install/js/license.js b/module/install/js/license.js
deleted file mode 100644
index a6f1c1055b..0000000000
--- a/module/install/js/license.js
+++ /dev/null
@@ -1,8 +0,0 @@
-$(document).ready(function()
-{
- $('#agree').change(function()
- {
- $('.btn-install').attr('disabled', !$(this).prop('checked'));
- $('.btn-install').css('pointer-events', $(this).prop('checked') ? 'auto' : 'none');
- });
-});
diff --git a/module/install/js/step2.js b/module/install/js/step2.js
deleted file mode 100644
index f88019d583..0000000000
--- a/module/install/js/step2.js
+++ /dev/null
@@ -1,7 +0,0 @@
-$(document).ready(function()
-{
- $.get("pathinfo.php", function(result)
- {
- $('#requestType').val('PATH_INFO');
- });
-});
diff --git a/module/install/js/step4.js b/module/install/js/step4.js
deleted file mode 100644
index 03ccc7472b..0000000000
--- a/module/install/js/step4.js
+++ /dev/null
@@ -1,14 +0,0 @@
-$(function()
-{
- $("#useLight").click(function()
- {
- $('#mode').val('light');
- $('form').submit();
- })
-
- $("#useALM").click(function()
- {
- $('#mode').val('ALM');
- $('form').submit();
- })
-});
diff --git a/module/install/js/step5.js b/module/install/js/step5.js
deleted file mode 100644
index 66eaff6a09..0000000000
--- a/module/install/js/step5.js
+++ /dev/null
@@ -1,21 +0,0 @@
-$(function()
-{
- $('#submit').click(function()
- {
- if($('#company').val().length == 0)
- {
- alert(errorEmpty.company);
- return false;
- }
- else if($('#account').val().length == 0)
- {
- alert(errorEmpty.account);
- return false;
- }
- else if($('#password').val().length == 0)
- {
- alert(errorEmpty.password);
- return false;
- }
- })
-})
diff --git a/module/instance/css/upgrade.css b/module/instance/css/upgrade.css
deleted file mode 100644
index dc896b7a03..0000000000
--- a/module/instance/css/upgrade.css
+++ /dev/null
@@ -1 +0,0 @@
-.modal-message {font-weight: bold; padding: 20px;}
diff --git a/module/instance/css/view.css b/module/instance/css/view.css
deleted file mode 100644
index 693f0a86bf..0000000000
--- a/module/instance/css/view.css
+++ /dev/null
@@ -1,32 +0,0 @@
-#mainContent .nav-tabs li>a::before {height: 0;}
-.instance-name h3 {display: inline-block; padding-left: 10px;}
-.instance-name > span {font-size: 14px; font-weight: bolder; padding: 3px 3px; margin: 0 5px;}
-.instance-panel .btn-group .btn {width: 60px;}
-.instance-panel .btn-group i {font-size: 24px;}
-.instance-status span {display: inline-block; margin-right: 10px; padding-bottom: 1px;}
-.instance-status i {font-size: 18px;}
-.instance-source span {display: inline-block; margin-right: 10px; width: 100px;}
-#senior-app-desc a {color: #61be68}
-a#serialDiff {color: #ff9800;}
-#seniorAppPanel span.text-info:hover {color: #2196f3;}
-.instance-log .panel-body {padding-bottom: 8px; padding-left: 10px;}
-.instance-log .panel-body table {margin-bottom: 0;}
-.usage-box {border-radius: 3px;}
-.c-title {text-align: center; padding-top: 10px; font-size: 15px}
-.progress-pie {margin: 10px auto;}
-.instance-panel > div > a:last-child { margin-left: 8px;}
-.solution-link {display: inline-block; margin-left: 20px;}
-
-#backup .panel {padding: 10px;}
-#backup .panel .btn-toolbar{padding: 0 0 10px 0;}
-#backup .panel .panel-heading {height: 50px;}
-#backup table.table {margin-bottom: 20px; width: auto;}
-#backup table th.actions {padding-left: 15px;}
-#backup table td>.btn {padding-left: 5px; padding-right: 5px;}
-#backup .btn.btn-info[disabled] {color: rgba(255,255,255,.7); background-color: #61be68;}
-
-#advance .panel-title span {padding-left: 10px;}
-#advance hr {margin: 5px 20px;}
-#advance .scalable-input{height: 26px;}
-#advance .center{text-align: center;}
-#advance .hide{display: none}
diff --git a/module/instance/js/upgrade.js b/module/instance/js/upgrade.js
deleted file mode 100644
index ee3d82b731..0000000000
--- a/module/instance/js/upgrade.js
+++ /dev/null
@@ -1,30 +0,0 @@
-$(function()
-{
- $('#upgradeForm').on('submit', function(event)
- {
- event.preventDefault();
-
- var loadingDialog = bootbox.dialog(
- {
- message: '
' + instanceNotices.upgrading + '
',
- });
-
- $.post($('#upgradeForm').attr('action'), $('#upgradeForm').serializeArray()).done(function(response)
- {
- loadingDialog.modal('hide');
- window.parent.$('#triggerModal').modal('hide');
-
- let res = JSON.parse(response);
- if(res.result == 'success')
- {
- config.onlybody = 'no';
- window.parent.$.apps.reload('space', createLink('space', 'browse'), 'space');
- window.parent.location.reload();
- }
- else
- {
- alert(res.message);
- }
- });
- });
-});
diff --git a/module/job/css/browse.css b/module/job/css/browse.css
deleted file mode 100644
index 4ccf112cf1..0000000000
--- a/module/job/css/browse.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.c-id {width: 60px !important;}
-.c-repo {width: 150px;}
-.c-engine {width: 100px;}
-.c-frame {width: 80px;}
-.c-server {width: 250px;}
-.c-exec {width: 130px;}
diff --git a/module/job/css/create.css b/module/job/css/create.css
deleted file mode 100644
index ab92639f76..0000000000
--- a/module/job/css/create.css
+++ /dev/null
@@ -1,22 +0,0 @@
-.row.text-with-input .col {line-height: 32px;}
-.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;}
-.checkbox-primary.checkbox-inline {display: inline-block !important;}
-.checkbox-primary.checkbox-inline label {padding-left: 5px !important;}
-.jktask-label {width: 326px; border-radius: 0px 4px 4px 0px;}
-.search-list {max-width: 500px;}
-.input-group-addon {border-radius: 2px 0px 0px 2px !important;}
-button.text-right {min-width: 100px; text-align: right;}
-#server_chosen .chosen-single {border-right: 0px;}
-#pipelineBox {width: 385px;}
-#svnDirBox .input-group {width: unset !important;}
-#jenkinsServerTR .input-group-addon {border-left-width: 0 !important;}
-#jenkinsServerTR .dropdown {position: relative;}
-#jenkinsServerTR .table-col:first-child {width: 375px;}
-
-.chosen-container .chosen-drop{z-index: 1100;} /* from c20b7e7a5 */
-
-#dropMenuTasks>.table-row {width: unset;}
-
-#paramName {width: 324px;}
-#paramValue {width: 181px;}
-#paramDiv .table-row {table-layout: unset;}
diff --git a/module/job/css/edit.css b/module/job/css/edit.css
deleted file mode 100644
index 93aa7f302b..0000000000
--- a/module/job/css/edit.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.row.text-with-input .col {line-height: 32px;}
-.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;}
-.checkbox-primary.checkbox-inline {display: inline-block !important;}
-.checkbox-primary.checkbox-inline label {padding-left: 5px !important;}
-#server_chosen .chosen-single {border-right: 0px;}
-#pipelineBox {width: 385px;}
-#svnDirBox .input-group {width: unset !important;}
-#jenkinsServerTR .input-group-addon {border-left-width: 0 !important;}
-#jenkinsServerTR .dropdown {position: relative;}
-#jenkinsServerTR .table-col:first-child {width: 375px;}
-
-#paramName {width: 324px;}
-#paramValue {width: 181px;}
-#paramDiv .table-row {table-layout: unset;}
-.jktask-label {width: 326px; border-radius: 0px 4px 4px 0px;}
-.search-list {max-width: 500px;}
diff --git a/module/job/css/view.css b/module/job/css/view.css
deleted file mode 100644
index 2c887b7bc6..0000000000
--- a/module/job/css/view.css
+++ /dev/null
@@ -1,5 +0,0 @@
-#mainContent {padding: 0px; padding-top: 5px;}
-th.c-side {width: 260px;}
-td.pass {color: green;}
-td.fail {color: red;}
-#pageNav .btn-group.open ul.dropdown-menu {max-height: 350px; overflow-y: auto;}
diff --git a/module/job/js/browse.js b/module/job/js/browse.js
deleted file mode 100644
index b801c52f3b..0000000000
--- a/module/job/js/browse.js
+++ /dev/null
@@ -1,16 +0,0 @@
-$(document).ready(function()
-{
- $('.icon-job-exec').parent().click(function()
- {
- link = $(this).attr('href');
- $.getJSON(link, function(response)
- {
- if(response.result == 'success') bootbox.alert(response.message);
- if(response.result != 'success') bootbox.alert(response.message, function()
- {
- if(typeof(response.locate) == 'string') location.href = response.locate;
- });
- });
- return false;
- });
-});
diff --git a/module/job/js/create.js b/module/job/js/create.js
deleted file mode 100644
index 48a4cb6b16..0000000000
--- a/module/job/js/create.js
+++ /dev/null
@@ -1,264 +0,0 @@
-$(document).ready(function()
-{
- /*
- * Get frame select.
- * param string engine eg. jenkins|gitlab
- */
- function getFrameSelect(engine)
- {
- $('#frameBox .input-group').empty();
- $('#frameBox .input-group').append("
");
- var html = "
';
-
- $('#frameBox .loading').remove();
- $('#frameBox .input-group').append(html);
- $('#frameBox #frame').chosen();
-
- $('#frame').change();
- }
- getFrameSelect('');
-
- /*
- * Check sonarqube linked.
- */
- function checkSonarquebLink()
- {
- var repoID = $('#repo').val();
- var frame = $('#frame').val();
-
- if(frame != 'sonarqube' || repoID == 0) return false;
-
- $.getJSON(createLink('job', 'ajaxCheckSonarqubeLink', 'repoID=' + repoID), function(result)
- {
- if(result.result != 'success')
- {
- alert(result.message);
- $('#repo').val(0).trigger('chosen:updated');
- $('#reference').val('').trigger('chosen:updated');
- $('.reference').hide();
- return false;
- }
- })
- }
-
- $(document).on('change', '#repo', function()
- {
- var repoID = $(this).val();
- if(repoID <= 0) return;
-
- var link = createLink('repo', 'ajaxLoadProducts', 'repoID=' + repoID);
- $.get(link, function(data)
- {
- if(data)
- {
- $('#product').replaceWith(data);
- $('#product_chosen').remove();
- $('#product').chosen();
- }
- });
-
- /* Add new way get repo type. */
- var link = createLink('job', 'ajaxGetRepoType', 'repoID=' + repoID);
- $.getJSON(link, function(data)
- {
- if(data.result == 'success')
- {
- if(data.type.indexOf('git') != -1)
- {
- $('.reference').show();
- $('.svn-fields').addClass('hidden');
- $('#reference option').remove();
-
- $.getJSON(createLink('job', 'ajaxGetRefList', "repoID=" + repoID), function(response)
- {
- if(response.result == 'success')
- {
- $.each(response.refList, function(reference, name)
- {
- $('#reference').append("
");
- });
- }
- $('#reference').trigger('chosen:updated');
- });
- }
- else
- {
- if($('#triggerType').val() == 'tag') $('.svn-fields').removeClass('hidden');
-
- $('#svnDirBox .input-group').empty();
- $('#svnDirBox .input-group').append("
");
- $.getJSON(createLink('repo', 'ajaxGetSVNDirs', 'repoID=' + repoID), function(tags)
- {
- html = "
';
- $('#svnDirBox .loading').remove();
- $('#svnDirBox .input-group').append(html);
- $('#svnDirBox #svnDir').chosen();
- })
- }
- $('#triggerggerType option[value=tag]').html(data.type == 'gitlab' ? buildTag : dirChange).trigger('chosen:updated');
- }
- });
-
- /* Check exists sonarqube data. */
- checkSonarquebLink();
- });
-
- $(document).on('change', '[name^=svnDir]', function()
- {
- var repoID = $('#repo').val();
- var selectedTag = $(this).val();
- var encodePath = $(this).find("option:selected").attr('data-encodePath');
- $(this).next('[id$=_chosen]').nextAll('[id^=svnDir]').remove();
- $(this).next('[id$=_chosen]').nextAll('[id$=_chosen]').remove();
- if(selectedTag == '/') return true;
-
- $('#svnDirBox .input-group').append("
");
- $.getJSON(createLink('repo', 'ajaxGetSVNDirs', 'repoID=' + repoID + '&path=' + encodePath), function(tags)
- {
- html = '';
- length = $('#svnDirBox .input-group [name^=svnDir]').length;
- length++;
-
- if(tags.length != 0)
- {
- html = "
';
- }
-
- $('#svnDirBox .loading').remove();
- $('#svnDirBox .input-group').append(html);
- $('#svnDirBox #svnDir' + length).chosen();
- $('#svnDir' + length + '_chosen .chosen-single').css('border-left', '0px');
- })
- })
-
- $('#triggerType').change(function()
- {
- var type = $(this).val();
- $('.svn-fields').addClass('hidden');
- $('.comment-fields').addClass('hidden');
- $('.custom-fields').addClass('hidden');
- if(type == 'commit') $('.comment-fields').removeClass('hidden');
- if(type == 'schedule') $('.custom-fields').removeClass('hidden');
- if(type == 'tag')
- {
- var repoID = $('#repo').val();
- var type = 'Git';
- if(typeof(repoTypes[repoID]) != 'undefined') type = repoTypes[repoID];
- if(type == 'Subversion') $('.svn-fields').removeClass('hidden');
- }
- });
-
- $('#jkServer').change(function()
- {
- var jenkinsID = $(this).val();
- $('#jenkinsServerTR .dropdown,#jenkinsServerTR .input-group-addon').hide();
- $('#jenkinsServerTR .input-group').append("
");
- setJenkinsJob('', '');
-
- $.get(createLink('jenkins', 'ajaxGetJenkinsTasks', 'jenkinsID=' + jenkinsID), function(tasks)
- {
- $('#jenkinsServerTR .loading').remove();
- $('#dropMenuTasks').html(tasks);
- $('#jenkinsServerTR .dropdown,.input-group-addon').show();
- });
-
- /* There has been a problem with handling the prompt label. */
- $('#jkTaskLabel').remove();
- $('.jktask-label').addClass('text-right');
- })
-
- $(document).on('change', '#frame', function()
- {
- var frame = $(this).val();
- if(frame == 'sonarqube')
- {
- $('tr.sonarqube').removeClass('hide');
-
- /* Check exists sonarqube data. */
- checkSonarquebLink();
- }
- else
- {
- $('tr.sonarqube').addClass('hide');
- }
- })
-
- $(document).on('change', '#sonarqubeServer', function()
- {
- var sonarqubeID = $(this).val();
- $('#sonarProject #projectKey').remove();
- $('#sonarProject #projectKey_chosen').remove();
- $('#sonarProject .input-group').append("
");
- $.get(createLink('sonarqube', 'ajaxGetProjectList', 'sonarqubeID=' + sonarqubeID), function(html)
- {
- $('#sonarProject .loading').remove();
- $('#sonarProject .input-group').append(html);
- $('#sonarProject #projectKey').chosen({drop_direction: 'auto'});
- })
-
- /* There has been a problem with handling the prompt label. */
- $('#projectKeyLabel').remove();
- })
-
- var scheduleOption = "
";
- $('#engine').change(function()
- {
- var engine = $(this).val();
- $('.reference').hide();
- loadRepoList(engine);
- $('#jenkinsServerTR').toggle(engine == 'jenkins');
- $('#gitlabServerTR').toggle(engine == 'gitlab');
-
- if(engine == 'gitlab')
- {
- $('tr.gitlabRepo').show();
- $('tr.commonRepo').hide();
- }
- //else if($('#triggerType').find('[value=schedule]').size() == 0)
- else
- {
- $('tr.gitlabRepo').hide();
- $('tr.commonRepo').show();
- }
-
- getFrameSelect(engine);
- });
-
- $('#engine').change();
- $('#triggerType').change();
-});
-
-/**
- * Set jenkins job.
- *
- * @param string $name
- * @param string $task
- * @access public
- * @return void
- */
-function setJenkinsJob(name, task)
-{
- if(name) $('.jktask-label').removeClass('text-right');
- $('#jkTask').val(task);
- $('.jktask-label .text').html(name);
-}
diff --git a/module/job/js/edit.js b/module/job/js/edit.js
deleted file mode 100644
index cf6f3884ce..0000000000
--- a/module/job/js/edit.js
+++ /dev/null
@@ -1,278 +0,0 @@
-$(document).ready(function()
-{
- /*
- * Get frame select.
- * param string engine eg. jenkins|gitlab
- */
- function getFrameSelect()
- {
- $('#frameBox .input-group').empty();
- $('#frameBox .input-group').append("
");
- var html = "
';
-
- $('#frameBox .loading').remove();
- $('#frameBox .input-group').append(html);
- $('#frameBox #frame').chosen();
- }
- getFrameSelect();
-
- /* Check sonarqube linked. */
- function checkSonarquebLink()
- {
- var repoID = $('#repo').val();
- var frame = $('#frame').val();
-
- if(frame != 'sonarqube' || repoID == 0) return false;
-
- $.getJSON(createLink('job', 'ajaxCheckSonarqubeLink', 'repoID=' + repoID + '&jobID=' + job.id), function(result)
- {
- if(result.result != 'success')
- {
- alert(result.message);
- $('#repo').val(0).trigger('chosen:updated');
- $('#reference').val('').trigger('chosen:updated');
- $('.reference').hide();
- return false;
- }
- })
- }
-
- $('#gitlabRepo').change(function()
- {
- $('#repo').val($(this).val()).change();
- })
-
- $('#repo').change(function()
- {
- var repoID = $(this).val();
- var link = createLink('repo', 'ajaxLoadProducts', 'repoID=' + repoID);
- $.get(link, function(data)
- {
- if(data)
- {
- $('#product').replaceWith(data);
- $('#product_chosen').remove();
- $('#product').chosen();
- }
- });
-
- var type = 'Git';
- if(typeof(repoTypes[repoID]) != 'undefined') type = repoTypes[repoID];
-
- $('.svn-fields').addClass('hidden');
- if(type == 'Subversion' && $('#triggerType').val() == 'tag') $('.svn-fields').removeClass('hidden');
-
- $('#repoType').val(type);
- $('#triggerType option[value=tag]').html(type == 'Subversion' ? dirChange : buildTag).trigger('chosen:updated');
- if(type == 'Subversion')
- {
- $('#svnDirBox .input-group').empty();
- $('#svnDirBox .input-group').append("
");
- $.getJSON(createLink('repo', 'ajaxGetSVNDirs', 'repoID=' + repoID), function(tags)
- {
- html = "
';
- $('#svnDirBox .loading').remove();
- $('#svnDirBox .input-group').append(html);
- $('#svnDirBox #svnDir').chosen();
- })
- }
-
- /* Check exists sonarqube data. */
- checkSonarquebLink();
- })
-
- $(document).on('change', '[name^=svnDir]', function()
- {
- var repoID = $('#repo').val();
- var selectedTag = $(this).val();
- var encodePath = $(this).find("option:selected").attr('data-encodePath');
- $(this).next('[id$=_chosen]').nextAll('[id^=svnDir]').remove();
- $(this).next('[id$=_chosen]').nextAll('[id$=_chosen]').remove();
- if(selectedTag == '/') return true;
-
- $('#svnDirBox .input-group').append("
");
- $.getJSON(createLink('repo', 'ajaxGetSVNDirs', 'repoID=' + repoID + '&path=' + encodePath), function(tags)
- {
- html = '';
- length = $('#svnDirBox .input-group [name^=svnDir]').length;
- length += 1;
- if(tags.length != 0)
- {
- html = "
';
- }
- $('#svnDirBox .loading').remove();
- $('#svnDirBox .input-group').append(html);
- $('#svnDirBox #svnDir' + length).chosen();
- $('#svnDirBox #svnDir' + length + '_chosen .chosen-single').css('border-left', '0px');
- })
- })
-
- $('#triggerType').change(function()
- {
- var type = $(this).val();
- $('.svn-fields').addClass('hidden');
- $('.comment-fields').addClass('hidden');
- $('.custom-fields').addClass('hidden');
- if(type == 'commit') $('.comment-fields').removeClass('hidden');
- if(type == 'schedule') $('.custom-fields').removeClass('hidden');
- if(type == 'tag')
- {
- var repoID = $('#repo').val();
- var type = 'Git';
- if(typeof(repoTypes[repoID]) != 'undefined') type = repoTypes[repoID];
- if(type == 'Subversion')
- {
- $('.svn-fields').removeClass('hidden');
- if($('.svn-fields td .input-group select').length == 0) $('#repo').change();
- }
- }
- });
-
- $('#jkServer').change(function()
- {
- var jenkinsID = $(this).val();
- $('#jenkinsServerTR .dropdown,#jenkinsServerTR .input-group-addon').hide();
- $('#jenkinsServerTR .input-group').append("
");
- setJenkinsJob('', '');
-
- $.get(createLink('jenkins', 'ajaxGetJenkinsTasks', 'jenkinsID=' + jenkinsID), function(tasks)
- {
- $('#jenkinsServerTR .loading').remove();
- $('#dropMenuTasks').html(tasks);
- $('#jenkinsServerTR .dropdown,.input-group-addon').show();
-
- if(jenkinsPipeline)
- {
- if(jenkinsPipeline.substr(0, 5) != '/job/') jenkinsPipeline = '/job/' + jenkinsPipeline + '/';
- document.getElementById(jenkinsPipeline).click();
- jenkinsPipeline = '';
- }
- });
-
- /* There has been a problem with handling the prompt label. */
- $('#jkTaskLabel').remove();
- $('.jktask-label').addClass('text-right');
- })
-
- $(document).on('change', '#frame', function()
- {
- var frame = $(this).val();
- if(frame == 'sonarqube')
- {
- $('tr.sonarqube').removeClass('hide');
-
- /* Check exists sonarqube data. */
- checkSonarquebLink();
- }
- else
- {
- $('tr.sonarqube').addClass('hide');
- }
- })
-
- $(document).on('change', '#sonarqubeServer', function()
- {
- var sonarqubeID = $(this).val();
- var projectKey = sonarqubeID == job.sonarqubeServer ? job.projectKey.replace(/-/g, '*') : '';
- $('#sonarProject #projectKey').remove();
- $('#sonarProject #projectKey_chosen').remove();
- $('#sonarProject .input-group').append("
");
- $.get(createLink('sonarqube', 'ajaxGetProjectList', 'sonarqubeID=' + sonarqubeID + '&projectKey=' + projectKey), function(html)
- {
- $('#sonarProject .loading').remove();
- $('#sonarProject .input-group').append(html);
- $('#sonarProject #projectKey').chosen({drop_direction: 'auto'});
- })
-
- /* There has been a problem with handling the prompt label. */
- $('#projectKeyLabel').remove();
- })
-
- var scheduleOption = "
";
- $('#engine').change(function()
- {
- $('#jenkinsServerTR').toggle($('#engine').val() == 'jenkins');
- $('#gitlabServerTR').toggle($('#engine').val() == 'gitlab');
-
- if($(this).val() == 'gitlab')
- {
- $('#triggerType').find('[value=schedule]').remove();
- $('tr.gitlabRepo').show();
- $('tr.commonRepo').hide();
- }
- else if($('#triggerType').find('[value=schedule]').size() == 0 )
- {
- $('#triggerType').append(scheduleOption);
- $('tr.gitlabRepo').hide();
- $('tr.commonRepo').show();
- }
- });
-
- $('#gitlabRepo').change(function()
- {
- $('#reference option').remove();
-
- var repoID = $(this).val();
- if(repoID > 0)
- {
- $.getJSON(createLink('job', 'ajaxGetRefList', "repoID=" + repoID), function(response)
- {
- if(response.result == 'success')
- {
- $.each(response.refList, function(reference, name)
- {
- $('#reference').append("
");
- });
- }
- $('#reference').trigger('chosen:updated');
- });
- }
- });
-
- $('#engine').change();
- $('#jkServer').change();
- $('#frame').change();
- $('#sonarqubeServer').change();
- $('#triggerType').change();
-});
-
-/**
- * Set jenkins job.
- *
- * @param string $name
- * @param string $task
- * @access public
- * @return void
- */
-function setJenkinsJob(name, task)
-{
- if(name) $('.jktask-label').removeClass('text-right');
- $('#jkTask').val(task);
- $('.jktask-label .text').html(name);
-}
diff --git a/module/job/js/view.js b/module/job/js/view.js
deleted file mode 100644
index cc574e257f..0000000000
--- a/module/job/js/view.js
+++ /dev/null
@@ -1,50 +0,0 @@
-$(function()
-{
- $('td.group-toggle').click(function()
- {
- var dataid = $(this).closest('tr').attr('data-id');
- var $tbody = $(this).closest('tbody');
- $tbody.find('tr[data-id=' + dataid + ']').addClass('hidden');
- $tbody.find('tr.group-summary[data-id=' + dataid + ']').removeClass('hidden');
-
- $('.group-collapse-all').show();
- $('.group-expand-all').hide();
- if($tbody.find('tr:not(.group-summary):not(.hidden)').length == 0)
- {
- $('.group-collapse-all').hide();
- $('.group-expand-all').show();
- }
- });
- $('tr.group-summary.group-toggle').click(function()
- {
- dataid = $(this).attr('data-id');
- $(this).closest('tbody').find('tr[data-id=' + dataid + ']').removeClass('hidden');
- $(this).addClass('hidden');
-
- $('.group-collapse-all').show();
- $('.group-expand-all').hide();
- });
- $('.group-collapse-all').click(function()
- {
- $(this).closest('table').find('tbody tr').addClass('hidden');
- $(this).closest('table').find('tbody tr.group-summary').removeClass('hidden');
- $('.group-expand-all').show();
- $(this).hide();
- });
- $('.group-expand-all').click(function()
- {
- $(this).closest('table').find('tbody tr').removeClass('hidden');
- $(this).closest('table').find('tbody tr.group-summary').addClass('hidden');
- $('.group-collapse-all').show();
- $(this).hide();
- });
-
- $('#tabsNav .nav-tabs').on('shown.zui.tab', function(e)
- {
- setTimeout(function()
- {
- var modalHeight = $('body').height();
- parent.$('#triggerModal .modal-body').height(modalHeight);
- }, 300);
- });
-})
diff --git a/module/kanban/css/batchcreatecard.css b/module/kanban/css/batchcreatecard.css
deleted file mode 100644
index 0e518209d7..0000000000
--- a/module/kanban/css/batchcreatecard.css
+++ /dev/null
@@ -1 +0,0 @@
-.c-date {width:150px;}
diff --git a/module/kanban/css/closespace.css b/module/kanban/css/closespace.css
deleted file mode 100644
index 9235410476..0000000000
--- a/module/kanban/css/closespace.css
+++ /dev/null
@@ -1 +0,0 @@
-#mainContent .c-comment {width: 50px}
diff --git a/module/kanban/css/create.css b/module/kanban/css/create.css
deleted file mode 100644
index a60ee0ac5a..0000000000
--- a/module/kanban/css/create.css
+++ /dev/null
@@ -1,31 +0,0 @@
-#mainContent .table-form>tbody>tr>th {width: 105px;}
-#mainContent {padding-left: 0px;}
-#mainContent .importBox .radio-inline+.radio-inline {padding-left: 20px;}
-#mainContent .objectBox {padding-top: 2px;}
-#mainContent .objectBox .checkbox-primary {display: inline-block;}
-#mainContent .objectBox .checkbox-primary:not(:first-child) {margin-left: 10px;}
-#mainContent .objectBox .checkbox-primary>label:not(:first-child) {padding-left: 20px;}
-#mainContent .objectBox .checkbox-primary>label:before {top: 2px; left: 0px;}
-#mainContent .objectBox .checkbox-primary>label:after {width: 14px; height: 14px;}
-[lang^='en'] .columnWidth {width: 120px;}
-[lang^='zh-cn'] .columnWidth {width: 80px;}
-
-#copyKanbanModal {padding: 0;}
-#copyKanbanModal {padding: 0 2px;}
-#copyKanbanModal > div {position: relative;}
-#copyKanbanModal a {display: block; min-height: 30px; line-height: 30px; padding: 5px 15px; border: 1px solid #e5e5e5; color: #333; margin: 5px 0; border-radius: 3px;}
-#copyKanbanModal a > i {display: inline-block; margin-right: 5px;}
-#copyKanbanModal a:hover {border: 1px solid #00a9fc; background-color: #E9F2FB; text-decoration: none;}
-#copyKanbanModal a.active {border-color: #00da88; color: #00da88; background-color: #E5FFE6;}
-#copyKanbanModal a.active:after {position: absolute; content: '\e92f'; font-family: ZentaoIcon; font-size: 20px; right: 25px;}
-#copyKanbanModal a.cancel {color: #ff5d5d;}
-#copyKanbanModal .copyContentBox {display: inline-block;}
-#copyKanbanModal .copyContentBox > .checkbox-primary {display: inline-block; margin-left: 10px; margin-top: -1px;}
-#copyKanbanModal .copyContentBox > .checkbox-primary:first-child {margin-left: 20px;}
-#copyContentbasicInfo {cursor: not-allowed;}
-#team ~ #contactListMenu_chosen {vertical-align: top;}
-#whitelist ~ #contactListMenu_chosen {vertical-align: bottom;}
-#team ~ #contactListMenu_chosen > .chosen-drop {top: 32px;}
-#whitelist ~ #contactListMenu_chosen > .chosen-drop {bottom: 32px;}
-#colWidth + .fixedTip, #maxColWidth + .autoTip {margin-left: 35px; color: #2667E3; padding-top: 1px;}
-[lang^=en] #colWidth + .fixedTip, [lang^=en] #maxColWidth + .autoTip, [lang^=de] #colWidth + .fixedTip, [lang^=de] #maxColWidth + .autoTip, [lang^=fr] #colWidth + .fixedTip, [lang^=fr] #maxColWidth + .autoTip {margin-left: 50px;}
diff --git a/module/kanban/css/createcard.css b/module/kanban/css/createcard.css
deleted file mode 100644
index d78782f62a..0000000000
--- a/module/kanban/css/createcard.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.pri-selector .br-0 {padding-bottom: 5px;}
-.required:after {left: 213px; z-index: 2;}
-#estimate, .pri-selector {z-index: 3;}
-.input-group > #name {padding-right: 16px;}
diff --git a/module/kanban/css/createlane.css b/module/kanban/css/createlane.css
deleted file mode 100644
index aebe98433b..0000000000
--- a/module/kanban/css/createlane.css
+++ /dev/null
@@ -1 +0,0 @@
-.table-form>tbody>tr>th {width: 160px;}
diff --git a/module/kanban/css/createregion.css b/module/kanban/css/createregion.css
deleted file mode 100644
index 2cb3cd8608..0000000000
--- a/module/kanban/css/createregion.css
+++ /dev/null
@@ -1 +0,0 @@
-#region_chosen.chosen-container .chosen-results {max-height: 115px;}
diff --git a/module/kanban/css/createspace.css b/module/kanban/css/createspace.css
deleted file mode 100644
index f5ad743eb1..0000000000
--- a/module/kanban/css/createspace.css
+++ /dev/null
@@ -1 +0,0 @@
-#mainContent {padding-left: 0px; height: 500px;}
diff --git a/module/kanban/css/edit.css b/module/kanban/css/edit.css
deleted file mode 100644
index bef119443d..0000000000
--- a/module/kanban/css/edit.css
+++ /dev/null
@@ -1,9 +0,0 @@
-#mainContent .table-form>tbody>tr>th {width: 105px;}
-#mainContent {padding-left: 0px;}
-#mainContent .laneHeightBox .radio-inline+.radio-inline, #mainContent .importBox .radio-inline+.radio-inline {margin-left: 20px;}
-[lang^='en'] .columnWidth {width: 120px;}
-[lang^='zh-cn'] .columnWidth {width: 80px;}
-#team ~ #contactListMenu_chosen {vertical-align: top;}
-#whitelist ~ #contactListMenu_chosen {vertical-align: bottom;}
-#team ~ #contactListMenu_chosen > .chosen-drop {top: 32px;}
-#whitelist ~ #contactListMenu_chosen > .chosen-drop {bottom: 32px;}
diff --git a/module/kanban/css/editcard.css b/module/kanban/css/editcard.css
deleted file mode 100644
index 7eb7038e96..0000000000
--- a/module/kanban/css/editcard.css
+++ /dev/null
@@ -1 +0,0 @@
-.table-form>tbody>tr>th {width: 70px;}
diff --git a/module/kanban/css/editlanecolor.css b/module/kanban/css/editlanecolor.css
deleted file mode 100644
index 1ae9a01187..0000000000
--- a/module/kanban/css/editlanecolor.css
+++ /dev/null
@@ -1,4 +0,0 @@
-td>ul {padding-left: 0;}
-li {display: block; float: left; padding: 5px; width: 28px; height: 28px;}
-li>a { position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; font-family: ZentaoIcon; font-size: 14px; font-style: normal; font-weight: 400; font-variant: normal; line-height: 1; text-align: center; text-transform: none; border: 1px solid transparent; border-radius: 50%; speak: none; -webkit-font-smoothing: antialiased; }
-li>a.active:before {font-size: 14px; content: "\e5ca"}
diff --git a/module/kanban/css/editspace.css b/module/kanban/css/editspace.css
deleted file mode 100644
index 6496806503..0000000000
--- a/module/kanban/css/editspace.css
+++ /dev/null
@@ -1,4 +0,0 @@
-#mainContent {padding-left: 0px; height: 500px;}
-#contactListMenu_chosen {vertical-align: unset;}
-#teamBox .input-group .input-group-btn {vertical-align: top;}
-.chosen-container .chosen-results {max-height: 200px;}
diff --git a/module/kanban/css/importrelease.css b/module/kanban/css/importrelease.css
deleted file mode 100644
index d0ac33b985..0000000000
--- a/module/kanban/css/importrelease.css
+++ /dev/null
@@ -1,2 +0,0 @@
-#releaseList > tbody > tr:hover{background-color: unset!important;}
-#product_chosen {width: 45% !important}
diff --git a/module/kanban/css/setcolumn.css b/module/kanban/css/setcolumn.css
deleted file mode 100644
index 38087ed055..0000000000
--- a/module/kanban/css/setcolumn.css
+++ /dev/null
@@ -1,5 +0,0 @@
-td>ul {padding-left: 0;}
-li {display: block; float: left; padding: 5px; width: 28px; height: 28px;}
-li>a { position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; font-family: ZentaoIcon; font-size: 14px; font-style: normal; font-weight: 400; font-variant: normal; line-height: 1; text-align: center; text-transform: none; border: 1px solid transparent; border-radius: 50%; speak: none; -webkit-font-smoothing: antialiased; }
-li>a.active:before {font-size: 14px; content: "\e5ca"}
-
diff --git a/module/kanban/css/setlane.css b/module/kanban/css/setlane.css
deleted file mode 100644
index 1ae9a01187..0000000000
--- a/module/kanban/css/setlane.css
+++ /dev/null
@@ -1,4 +0,0 @@
-td>ul {padding-left: 0;}
-li {display: block; float: left; padding: 5px; width: 28px; height: 28px;}
-li>a { position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; font-family: ZentaoIcon; font-size: 14px; font-style: normal; font-weight: 400; font-variant: normal; line-height: 1; text-align: center; text-transform: none; border: 1px solid transparent; border-radius: 50%; speak: none; -webkit-font-smoothing: antialiased; }
-li>a.active:before {font-size: 14px; content: "\e5ca"}
diff --git a/module/kanban/css/setting.css b/module/kanban/css/setting.css
deleted file mode 100644
index 77b8bbc587..0000000000
--- a/module/kanban/css/setting.css
+++ /dev/null
@@ -1,13 +0,0 @@
-#mainContent {padding-left: 0px;}
-#mainContent .objectBox {padding-top: 2px;}
-#mainContent .objectBox .checkbox-primary {display: inline-block;}
-#mainContent .objectBox .checkbox-primary:not(:first-child) {margin-left: 10px;}
-#mainContent .objectBox .checkbox-primary>label:not(:first-child) {padding-left: 20px;}
-#mainContent .laneHeightBox .tip {color: #999;}
-#mainContent .objectBox .checkbox-primary>label:before {top: 2px; left: 0px;}
-#mainContent .objectBox .checkbox-primary>label:after {width: 14px; height: 14px;}
-#mainContent table > tbody th {width: 110px !important;}
-[lang^=en] .laneHeightBox > label, [lang^=de] .laneHeightBox > label, [lang^=fr] .laneHeightBox > label, [lang^=en] .importBox > label, [lang^=de] .importBox > label, [lang^=fr] .importBox > label {margin-left: 0px;}
-#dataform tr > th {vertical-align: top;}
-#colWidth + .fixedTip, #maxColWidth + .autoTip {margin-left: 35px; color: #2667E3; padding-top: 1px;}
-[lang^=en] #colWidth + .fixedTip, [lang^=en] #maxColWidth + .autoTip, [lang^=de] #colWidth + .fixedTip, [lang^=de] #maxColWidth + .autoTip, [lang^=fr] #colWidth + .fixedTip, [lang^=fr] #maxColWidth + .autoTip {margin-left: 50px;}
diff --git a/module/kanban/css/space.css b/module/kanban/css/space.css
deleted file mode 100644
index 66ebfd7f95..0000000000
--- a/module/kanban/css/space.css
+++ /dev/null
@@ -1,48 +0,0 @@
-#spaceList {margin: 0 0; margin-bottom: 15px;}
-#spaceList .spaceTitle {margin-bottom: 15px;}
-#spaceList .spaceTitle > div {display: inline-block;}
-#spaceList .spaceTitle .label-closed {background: #AAA !important; color: #FFF;}
-#spaceList .spaceTitle .icon-zone {color: #838a9d; margin-top:100px;}
-#spaceList .spaceActions {margin-top: -4px;}
-#spaceList .spaceActions > a{margin-left: 10px;}
-.space .menu {margin-left: 5px; margin-right:5px;}
-.space .table-empty-tip {padding: 40px 10px;}
-.space .spaceTitle.pull-left {overflow: hidden; white-space: nowrap; max-width: calc(100% - 220px)}
-.spaceName {font-size: 16px; font-weight: bold;}
-.spaceTitle .icon-cube {font-size: 16px;}
-.spaceDesc {font-size: 13px; color: #838A9D; margin: -5px 0 5px 0;}
-#setting .setting {margin-left: -25px; min-width: 80px}
-
-.kanbans > .col {width: 25% !important;}
-@media screen and (max-width: 1500px) {.kanbans > .col {width: 25%;}}
-.kanbans .panel {margin: 0 0; border: 1px solid #DCDCDC; border-radius: 4px; box-shadow: none; cursor: pointer; height: 160px; margin-bottom: 5px;}
-.kanbans .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
-.kanbans .panel-heading {padding: 4px 2px 10px 16px;}
-.kanbans .kanban-name {overflow: hidden; white-space:nowrap; width: 90%; float: left; padding-top: 8px;}
-.kanbans .panel .label-closed {background: #AAA !important; color: #FFF; margin-top:-1px !important;}
-.kanbans .kanban-actions {float: right; visibility: hidden;}
-.kanbans .kanban-actions .dropdown-menu.pull-right {top:31px; right: -84px; left: auto;}
-.kanbans .kanban-actions .dropdown-menu.pull-left {top:31px; right:-1px; left: auto;}
-.kanbans .panel .label-closed {background: #AAA !important; color: #FFF; margin-top:-6px;}
-.kanbans .panel-body {padding: 0 16px 16px;}
-.kanbans .kanban-desc {color: #838a9d; word-break:break-all; height: 70px; overflow: hidden; float:left;}
-.kanbans .kanban-desc > * {float: left;}
-.kanbans .kanban-footer {position: absolute; bottom: 10px; right: 10px; left: 15px;}
-.kanbans .kanban-members {float: left; height: 24px; line-height: 24px;}
-.kanbans .kanban-members > div {display: inline-block; height: 24px;}
-.kanbans .kanban-members > div + div {margin-left: -5px;}
-.kanbans .kanban-members > div > .avatar {display: inline-block; margin-right: 1px;}
-.kanbans .kanban-members > span {display: inline-block; color: transparent; width: 2px; height: 2px; background-color: #8990a2; position: relative; border-radius: 50%; top: 3px; margin: 0 3px;}
-.kanbans .kanban-members > span:before,
-.kanbans .kanban-members > span:after {content: ''; display: block; position: absolute; width: 2px; height: 2px; background-color: #8990a2; top: 0; border-radius: 50%}
-.kanbans .kanban-members > span:before {left: -4px;}
-.kanbans .kanban-members > span:after {right: -4px;}
-.kanbans .kanban-members-total {display: inline-block; margin-left: 6px; position: relative; top: 3px}
-.kanbans .kanbanAcl {position: absolute; right: 0px; bottom: 2px; color: #838a9d;}
-.kanbans .kanban-label {margin: 8px 6px 0px 0px; padding: 2.5px 4px; float: left; color: #ff8a53; border: 0.8px solid #ff8a53; background: none;}
-@media screen and (max-width: 1366px){.kanbans .kanban-name {width: 66%;}}
-
-a.disabled {pointer-events: none;}
-
-.noBorder {border: 0px;}
-.position {padding-right: 5px;}
diff --git a/module/kanban/css/splitcolumn.css b/module/kanban/css/splitcolumn.css
deleted file mode 100644
index 63fba87063..0000000000
--- a/module/kanban/css/splitcolumn.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.c-nameTitle {width: 66px;}
-.c-WIPTitle {width: 80px; padding-left: 15px !important; padding-right: 0px !important;}
-.c-color {width: 320px;}
-.c-WIPCount {width: 240px;}
-.c-WIPTitle {width: 85px;}
-td.required:after {right: -1px;}
-.c-action {width: 80px;}
-.c-action > a {padding-top: 10px;}
diff --git a/module/kanban/css/view.css b/module/kanban/css/view.css
deleted file mode 100644
index b89cff1e11..0000000000
--- a/module/kanban/css/view.css
+++ /dev/null
@@ -1,190 +0,0 @@
-#TRAction .icon {padding: 0px 6px; font-size: 14px}
-
-.has-error .form-control {border-color: #ff4268!important;}
-.has-error .form-control:focus {box-shadow: inset 0 1px 1px rgb(0 0 0 / 8%), 0 0 6px #f5b2a5!important;}
-.has-error .form-control::placeholder {color: #ff4268!important;}
-
-.label.text-red {background: #ff4268 !important; color: #ffffff;}
-
-.dropdown-menu > li {padding: 0 10px;}
-.dropdown-menu > li > a > .icon {position: relative; left: -5px;}
-
-#kanbanContainer {padding-bottom: 0; margin-bottom: 0; border: unset;}
-#kanbanContainer.fullscreen {overflow: auto;}
-
-.region {border: 0px solid #dcdcdc; background-color: #fff;}
-.region + .region {margin-top: 10px;}
-.region .region-header {padding: 10px;}
-.region .region-header strong {font-size: 14px; color: #3C4353; float: left;}
-.region .region-header label {color: #999; background: transparent; border: 1px solid #ddd; margin-left: 10px; margin-right: 10px}
-.region .region-header .action {float: right}
-.region .region-actions {float: right; position: relative; top: -6px; right: -6px;}
-.region .region-header .icon-double-angle-up,.icon-double-angle-down {cursor: pointer;}
-.region .kanban-header-sub-cols {margin-left: -2px;}
-.region .kanban-header-sub-cols .kanban-header-col > .title {max-width: 100% !important;min-width:200px;}
-.region .sort .region-header {cursor: move;}
-.region .kanban.kanban-dragging {overflow: hidden;}
-
-.region .kanban {padding: 0px 0px 10px 0px; min-height: unset; overflow:auto; width: 100%}
-.region .kanban .form-actions {margin: 0;}
-.region .kanban .form-actions .btn {margin-right: 10px; min-width: 50px;}
-
-.region .kanban-board + .kanban-board {margin-top: 20px;}
-.region .kanban-board > .kanban-header > .kanban-group-header {padding: 7px 0; width: 20px; text-align: center;}
-.region .kanban-board > .kanban-header > .kanban-group-header:hover {cursor: move;}
-.region .kanban-board.sort > .kanban-header {padding-left: 0;}
-
-.region .kanban-header {border-bottom: none!important; min-width: max-content; min-width: -moz-max-content;}
-.region .kanban-header-col > .title {max-width: 80% !important;}
-.region .kanban-header-col > .title {margin: 0}
-.region .kanban-header-col > .title > span {display: inline-block; overflow: hidden; padding-right:2px; position: initial; vertical-align: middle;}
-.region .kanban-header-col > .title > .text-grey {opacity: .5; font-weight: bold; color: #8b91a2;}
-.region .kanban-header-col > .title > .count {opacity: .5; font-weight: bold; color: #8b91a2;}
-.region .kanban-header-col > .title > .error {color: #333333; padding-left: 2px; font-size: 10px; padding-top: 1px; padding-right: 2px;}
-.region .kanban-header-col > .actions {z-index: 999; top: inherit;}
-.kanban-affixed .kanban-header-col > .title > .text {color: #fff!important}
-.region .kanban-header-parent-col > .actions {position: absolute; right: 0px; top: 0px !important;}
-.region .kanban-header-sub-cols .actions {position: absolute; right: 0px; top: 0px !important;}
-
-.kanban-affixed .kanban-header-col > .title > .count {opacity:1; color: #fff!important;}
-.kanban-affixed .kanban-header-col > .title > .text-grey {opacity:1; color: #fff!important;}
-.kanban-affixed .kanban-header-col > .actions > .btn > .icon {opacity:1; color: #fff!important;}
-
-.region .kanban-lane {position: relative; border-bottom: none!important; min-height: 200px !important}
-
-.region .kanban-lane > .kanban-lane-name > .text {margin: auto 0;}
-.region .kanban-lane > .kanban-lane-name > .actions {position: absolute; top: 0; left: 0; right: 0; opacity: 0;}
-.region .kanban-lane > .kanban-lane-name > .actions > a {display: block; width: 20px; height: 20px; line-height: 20px; text-align: center; opacity: .7; color: #fff;}
-.region .kanban-lane > .kanban-lane-name > .actions > a:hover {background-color: rgba(0,0,0,.2); opacity: 1;}
-.region .kanban-lane > .kanban-lane-name:hover > .actions {opacity: 1;}
-.region .kanban-lane.sort > .kanban-lane-name {cursor: move;}
-
-.region .kanban-lane-col {max-height: unset !important; overflow: auto; position: relative;}
-.region .kanban-lane-col.has-scrollbar > .kanban-lane-actions {position: absolute; background-color: inherit; bottom: 0; left: 0; right: 0;}
-
-.kanban-item {position: relative}
-.kanban-item > .kanban-card > .title {display: block; line-height: 18px;}
-.kanban-item > .kanban-card > .title:hover {color: #2272eb}
-.kanban-item > .kanban-card > .info {margin-top: 4px; position: relative;}
-.kanban-item > .kanban-card > .info > .pri {height: 14px; border-width: 1px; font-size: 12px; line-height: 12px; min-width: 14px; padding: 0 1px;}
-.kanban-item > .kanban-card > .info > .estimate{margin-left: 4px; color: #999; background-color: rgb(255, 255, 255); padding: 3px 0px}
-.kanban-item > .kanban-card > .info > .time {margin-left: 4px; font-size: 12px; background: rgb(242, 242, 242)}
-.kanban-item > .kanban-card > .info > .user {position: absolute; right: 0; top: -2px}
-.kanban-item > .kanban-card > .info > .user > .avatar {display: inline-block; width: 24px; height: 24px; line-height: 24px; margin-right: 0px; margin-left: 2px}
-.kanban-item > .kanban-card > .info > .user > span {display: inline-block; color: transparent; width: 2px; height: 2px; background-color: #8990a2; position: sticky; border-radius: 50%; top: 3px; margin: 0 7px;}
-.kanban-item > .kanban-card > .info > .user > span:before,
-.kanban-item > .kanban-card > .info > .user > span:after {content: ''; display: block; position: absolute; width: 2px; height: 2px; background-color: #8990a2; top: 0; border-radius: 50%}
-.kanban-item > .kanban-card > .info > .user > span:before {left: -4px;}
-.kanban-item > .kanban-card > .info > .user > span:after {right: -4px;}
-.kanban-item > .kanban-card > .actions > a {display: block; float: left; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; opacity: .7;}
-.kanban-item > .kanban-card > .actions > a:hover {background-color: rgba(0,0,0,.075); opacity: 1;}
-.kanban-item:hover > .actions {opacity: 1;}
-.kanban-item .has-color .title,
-.kanban-item .has-color .actions .icon-more-v,
-.kanban-item .has-color .info > .label-pri,
-.kanban-item .has-color .info > .estimate,
-.kanban-item .has-color .info > .user .label-teamSumCount,
-.kanban-item .has-color .info > .label-light {color: #FFFFFF;}
-.kanban-item .has-color .info > .label-pri {border-color: #FFFFFF;}
-.kanban-item .has-color .progress-box > .progress-number {color: #FFFFFF;}
-.kanban-item .item-more {position: absolute; right: 6px; top: 0px;}
-
-.kanban-card {height: auto !important; padding: 8px 14px !important; min-height: 60px;}
-.kanban-card > .title, .kanban-card > .productplanTitle, .kanban-card > .releaseTitle, .kanban-card > .buildTitle {word-break: break-all;}
-.kanban-card > .info {position: relative; margin-top: 5px}
-.kanban-card > .info > .info + .info {margin-left: 8px}
-.kanban-card:hover > .actions {opacity: 1;}
-.kanban-card > .actions {position: absolute; top: 4px; right: 4px; opacity: 0;}
-.kanban-card > .actions > a {display: block; float: left; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; opacity: .7;}
-.kanban-card > .actions > a:hover {background-color: rgba(0,0,0,.075); opacity: 1;}
-.kanban-card .productplanDesc, .kanban-card .buildDesc {color: #838a9d; overflow: hidden; white-space:nowrap; text-overflow: clip;}
-
-.cardcolor {width:40px; height: 14px; float: left; margin-left: 5px; margin-right: 5px; margin-top: 2px; border-radius: 2px;}
-#cardcolormenu {padding:2px 2px; width: 100px;}
-
-.region-header {margin-top: -6px;}
-.region-header > .icon{padding: 6px; margin-left:2px;}
-.kanban-col[data-type=ADD] {display: none;}
-.kanban-col[data-type=EMPTY] {display: none;}
-.kanban-col {padding: 0px !important;}
-.kanban-col.drag-shadow {background-color: #ededed !important; border-color: #ededed!important; box-shadow: 0 4px 10px 0 rgb(0,0,0, 0.05), 0 4px 20px 0 rgb(0,0,0, .3); min-height: 30px!important;}
-.kanban-col.drag-shadow .kanban-header-col {min-height: 30px!important;}
-.kanban-header-has-parent .kanban-header-cols > .kanban-col.drag-shadow,
-.kanban-col.kanban-header-parent-col.drag-shadow {min-height: 64px!important;}
-.kanban-col.drag-shadow > .actions {visibility: hidden!important;}
-.kanban-item .title {padding-right: 10px;}
-.gray .actions {display:none;}
-.kanban-cols-sorting .kanban-item {visibility: hidden!important;}
-
-.kanban-card .header .executionName {display: flex; width: 100%; float: left;}
-.kanban-card .header .executionName .title {padding-right: 0px; margin-right: 5px; overflow: hidden; white-space: nowrap;}
-.kanban-card .header .executionName > span {flex: none;}
-.execInfo, .releaseInfo, .productplanInfo {margin-top: 22px;}
-.label-wait {background: #EFEFEF !important; color: #838A9D;}
-.label-doing {background: #f8d2d2 !important; color: #e64b4c;}
-.label-suspended {background: #fff3d9 !important; color: #ff9800;}
-.label-future {background: #EFEFEF !important; color: #838A9D; border-radius: 9px}
-.label-done {background: #dfe9d8 !important; color: #429b16;}
-.label-closed, .label-terminate {background: #e5e5e5 !important; color: #b8b8b8;}
-.label-deleted {background: #ff5d5d !important; color: #fff;}
-.label-normal {background: #e1e8d9 !important; color: #9abe76;}
-.kanban-item > .kanban-card > .execInfo > .user, .kanban-item > .kanban-card > .releaseInfo > .user, .kanban-item > .kanban-card > .productplanInfo > .user {float:right}
-.kanban-item > .kanban-card > .execInfo > .user > .avatar, .kanban-item > .kanban-card > .releaseInfo > .user > .avatar, .kanban-item > .kanban-card > .productplanInfo > .user > .avatar {display: inline-block; width: 24px; height: 24px; line-height: 24px; margin-right: 0px; margin-left: 2px}
-.kanban-card .releaseTitle .icon, .kanban-card .title .icon, .kanban-card .productplanTitle .icon, .kanban-card .title .icon, .kanban-card .buildTitle .icon{padding-right: 5px;}
-.kanban-card .label-finish {margin-right: 7px; margin-top: -1px; padding: 3px 5px; float: left; background-color:#2a5f29;}
-.kanban-card .releaseTitle, .kanban-card .productplanTitle {width: 100%; float: left;}
-.kanban-card .productplanDesc {min-width: 100%;}
-
-.progress-box {width:100%; display: flex; flex-direction: row; margin-top: 10px;}
-.progress {flex: auto; margin: 5px auto 5px;}
-.progress-number {padding-left: 5px;}
-.region .region-header .action {float: left;}
-
-@-moz-document url-prefix(){ .region .kanban-lane-items{scrollbar-width:thin; padding:5px 0px 5px 5px !important;} .region .kanban-card .info .user{right: -6px !important;}}
-#archivedCards .table-empty-tip {border-style: hidden;}
-#archivedColumns .table-empty-tip {border-style: hidden;}
-
-#main > .container {padding: 0px; margin-top: -5px; margin-right: auto; margin-left: auto;}
-@media screen and (max-width: 1366px){#main > .container {padding: 0px; margin: -10px 0px 0px 0px;}}
-.panel-body {padding: 0px;}
-#kanbanContainer {background: #efefef; box-shadow: none;}
-
-.region .kanban-board .kanban-header-col.left {padding-left: 5px;}
-.region .kanban-board .kanban-header-col.left > .title, .region .kanban-board .kanban-header-parent-col > .kanban-header-col.left {justify-content: flex-start;}
-.region .kanban-board .kanban-header-col > .title > span {max-width: calc(100% - 100px) !important;}
-.region .kanban-board .kanban-header-parent-col > .kanban-header-col > .title {max-width: 100% !important;}
-.region .kanban-board .kanban-header-sub-cols .kanban-header-col > .title > span {max-width: calc(100% - 165px) !important;}
-.region .kanban-board .kanban-header-sub-cols .kanban-header-col.left > .title > span {max-width: calc(100% - 120px) !important;}
-.executionName .delayed {margin-right: 10px;}
-.region .kanban-board .kanban-header-sub-cols .kanban-header-col > .title > .text {max-width: calc(100% - 172px) !important;}
-
-#kanbanBox {position: relative;}
-#regionTabs {background-color: #efefef; z-index: 100; display: flex; align-items: center; gap: 1.5rem; justify-content: space-between;}
-#regionTabs .leftBtn.disabled i, #regionTabs .rightBtn.disabled i{color: #c2c2c2;}
-#regionTabs .leftBtn i, #regionTabs .rightBtn i{vertical-align: 1px;}
-#regionTabs .icon-angle-left, #regionTabs .icon-angle-right {font-size: 20px; vertical-align: -webkit-baseline-middle;}
-#regionNavTabs {display: inline-flex; overflow: hidden;}
-.leftBtn.hidden + #regionNavTabs {padding-left: 10px;}
-#regionNavTabs > ul {display: inline-flex; border-bottom: none; margin-bottom: -3px;}
-#regionNavTabs > ul > li {padding: 0; text-align: center;}
-#regionNavTabs > ul > li > a {min-width: 134px; overflow: hidden; white-space: nowrap; z-index: 0; position: relative; padding: 1.7rem; margin-left: -20px; background: none; outline: 0; cursor: pointer !important;}
-#regionNavTabs > ul > li:first-child > a {margin-left: 0;}
-#regionNavTabs > ul > li.active > a {z-index: 1;}
-#regionNavTabs > ul > li.active > a::before {background-color: #fff;}
-#regionNavTabs > ul > li > a:before {content: ""; position: absolute; top: -1rem; left: 0; background: #f8f8f8; height: 100%; width: 100%; z-index: -1; border-top-left-radius: 1rem; border-top-right-radius: 1rem; transform: perspective(0.5rem) rotateX(2deg); transform-origin: bottom;}
-#regionNavTabs > ul > li > a > span {vertical-align: bottom; overflow: hidden; max-width: 6em; white-space: nowrap; display: inline-block;}
-#regionNavTabs > ul > li.active > a > span {color: #2b80ff!important;}
-#regionTabs.affixed {margin-bottom: 5px; position: fixed; top: 0px;}
-#regionTabs.affixed + #kanbanContainer .kanban-board.kanban-affixed > .kanban-header {margin-top: 43px;}
-#regionTabs.affixed + #kanbanContainer .kanban-board.kanban-affixed > .kanban-header + .kanban-lane {margin-top: 38px;}
-#regionTabs.affixed ul {margin-bottom: -10px;}
-#regionTabs.affixed ul > li {margin-bottom: 0px !important;}
-#regionTabs .region-actions .dropdown-menu {top: 25px;}
-#region-tab-actions {display: none;}
-#region-tab-actions.active {display: flex;}
-.region {display: none;}
-.region.active {display: block;}
-.region.active.notAll {margin-top: -5px;}
-.region.active.notAll .region-header {display: none;}
-.region.active.notAll .kanban, .region.active.notAll .kanban .kanban-header {background-color: #efefef;}
-.kanban-card a[disabled] {color: #313c52;}
diff --git a/module/kanban/css/viewcard.css b/module/kanban/css/viewcard.css
deleted file mode 100644
index 5644fd1cf9..0000000000
--- a/module/kanban/css/viewcard.css
+++ /dev/null
@@ -1,2 +0,0 @@
-[lang^='en'] .table-data tbody>tr>th {width: 100px;}
-.pull-left div {float: left !important;}
diff --git a/module/kanban/js/batchcreatecard.js b/module/kanban/js/batchcreatecard.js
deleted file mode 100644
index 76e90547b8..0000000000
--- a/module/kanban/js/batchcreatecard.js
+++ /dev/null
@@ -1,27 +0,0 @@
-$(document).on('change', "[name^='begin'], [name^='end']", function()
-{
- toggleCheck($(this));
-})
-/**
- * Toggle checkbox.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function toggleCheck(obj)
-{
- var $this = $(obj);
- var date = $this.val();
- var $ditto = $this.closest('div').find("input[type='checkBox']");
- if(date == '')
- {
- $ditto.attr('checked', true);
- $ditto.closest('.input-group-addon').show();
- }
- else
- {
- $ditto.removeAttr('checked');
- $ditto.closest('.input-group-addon').hide();
- }
-}
diff --git a/module/kanban/js/create.js b/module/kanban/js/create.js
deleted file mode 100644
index abd57b36b6..0000000000
--- a/module/kanban/js/create.js
+++ /dev/null
@@ -1,101 +0,0 @@
-$(function()
-{
- if(enableImport == 'off')
- {
- $("input[name^='importObjectList']").attr('disabled', 'disabled');
- $('td.objectBox').hide();
- }
- $("input[id='copyContentbasicInfo']").click(function(){return false;})
-
- copyRegion = $("input[id='copyContentregion']").prop('checked');
- $("input[id='copyContentregion']").click(function()
- {
- copyRegion = $(this).prop('checked');
- $('#copyRegion').val(copyRegion);
- });
-
- $("input[name='import']").change(function()
- {
- if($(this).val() == 'off')
- {
- $("input[name^='importObjectList']").attr('disabled', 'disabled');
- $('td.objectBox').hide();
- }
- else
- {
- $("input[name^='importObjectList']").removeAttr('disabled');
- $('td.objectBox').show();
- }
- })
-
- $("input[name^='importObjectList']").change(function()
- {
- if($("input:checked[name^=importObjectList]").length != 0 && !$('#emptyTip').is('.hidden')) $('#emptyTip').addClass('hidden');
- })
-
- $('#submit').click(function()
- {
- var enableImport = $("input:checked[name='import']").val();
- var objectListLength = $("input:checked[name^=importObjectList]").length;
-
- if(enableImport == 'on' && objectListLength == 0 && vision != 'lite')
- {
- $('#emptyTip').removeClass('hidden');
- return false;
- }
- })
-
- $(document).on('click', '#copyKanbans a', function()
- {
- setCopyKanban($(this).data('id')); $('#copyKanbanModal').modal('hide');
- });
- handleKanbanWidthAttr();
-})
-
-/**
- * Set copy kanban.
- *
- * @param int $kanbanID
- * @access public
- * @return void
- */
-function setCopyKanban(kanbanID)
-{
- var extra = copyRegion ? '&extra=copyRegion=' + copyRegion : '';
- location.href = createLink('kanban', 'create', 'spaceID=' + spaceID + '&type=' + spaceType + '©KanbanID=' + kanbanID + extra);
-}
-
-/**
- * When space type change.
- *
- * @oaram int spaceID
- * @param string type
- * @access public
- * @return void
- */
-function changeValue(spaceID, type)
-{
- if(typeof type === 'undefined') type = spaceType;
- location.href = createLink('kanban', 'create', 'spaceID=' + spaceID + '&type=' + type);
-}
-
-/**
- * The team or whitelist member that loads kanban.
- *
- * @oaram int spaceID
- * @access public
- * @return void
- */
-function loadUsers(spaceID)
-{
- var field = spaceType == 'private' ? 'whitelist' : 'team';
- var link = createLink('kanban', 'ajaxLoadUsers', 'spaceID='+ spaceID + '&field=' + field + '&selectedUser=' + $('#' + field).val());
- $.get(link, function(data)
- {
- $('#' + field).replaceWith(data);
- $('#' + field).next('.picker').remove();
- $('#' + field).picker();
- });
-
- if(spaceType != 'private') loadOwners(spaceID);
-}
diff --git a/module/kanban/js/createcolumn.js b/module/kanban/js/createcolumn.js
deleted file mode 100644
index 1752625ded..0000000000
--- a/module/kanban/js/createcolumn.js
+++ /dev/null
@@ -1,24 +0,0 @@
-$(function()
-{
- initColorPicker();
- $('#noLimit').click(function()
- {
- if($(this).attr('checked') == 'checked')
- {
- $('#WIPCount').val('');
- $('#WIPCount').attr('disabled', true);
- }
- else
- {
- $('#WIPCount').removeAttr('disabled');
- }
- })
-})
-
-function setWIPLimit()
-{
- var count = $('#WIPCount').val();
- if($('#noLimit').attr('checked') == 'checked') count = -1;
-
- $('#limit').val(count);
-}
diff --git a/module/kanban/js/createlane.js b/module/kanban/js/createlane.js
deleted file mode 100644
index c963df8dad..0000000000
--- a/module/kanban/js/createlane.js
+++ /dev/null
@@ -1,9 +0,0 @@
-$(document).ready(function()
-{
- initColorPicker();
-
- $('input[name=mode]').change(function()
- {
- $('#otherLane').parents('tr').toggle($(this).val() == 'sameAsOther');
- });
-})
diff --git a/module/kanban/js/editlanecolor.js b/module/kanban/js/editlanecolor.js
deleted file mode 100644
index a01570f547..0000000000
--- a/module/kanban/js/editlanecolor.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * Set lane color.
- *
- * @param string $color
- * @access public
- * @return void
- */
-function setColor(color)
-{
- $('.cp-tile').removeClass('active');
- $('.cp-tile[data-color="' + color + '"]').addClass('active');
- $('#color').val(color);
-}
diff --git a/module/kanban/js/setcolumn.js b/module/kanban/js/setcolumn.js
deleted file mode 100644
index a01570f547..0000000000
--- a/module/kanban/js/setcolumn.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * Set lane color.
- *
- * @param string $color
- * @access public
- * @return void
- */
-function setColor(color)
-{
- $('.cp-tile').removeClass('active');
- $('.cp-tile[data-color="' + color + '"]').addClass('active');
- $('#color').val(color);
-}
diff --git a/module/kanban/js/setlane.js b/module/kanban/js/setlane.js
deleted file mode 100644
index a01570f547..0000000000
--- a/module/kanban/js/setlane.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * Set lane color.
- *
- * @param string $color
- * @access public
- * @return void
- */
-function setColor(color)
-{
- $('.cp-tile').removeClass('active');
- $('.cp-tile[data-color="' + color + '"]').addClass('active');
- $('#color').val(color);
-}
diff --git a/module/kanban/js/setting.js b/module/kanban/js/setting.js
deleted file mode 100644
index c3b33282c5..0000000000
--- a/module/kanban/js/setting.js
+++ /dev/null
@@ -1,55 +0,0 @@
-$(function()
-{
- var heightType = $("[name='heightType']:checked").val();
- setCardCount(heightType);
-
- if(enableImport == 'off')
- {
- $("input[name^='importObjectList']").attr('disabled', 'disabled');
- $('td.objectBox').hide();
- }
-
- $("input[name='import']").change(function()
- {
- if($(this).val() == 'off')
- {
- $("input[name^='importObjectList']").attr('disabled', 'disabled');
- $('td.objectBox').hide();
- }
- else
- {
- $("input[name^='importObjectList']").removeAttr('disabled');
- $('td.objectBox').show();
- }
- })
-
- $("input[name^='importObjectList']").change(function()
- {
- if($("input:checked[name^=importObjectList]").length != 0 && !$('#emptyTip').is('.hidden')) $('#emptyTip').addClass('hidden');
- })
-
- $('#submit').click(function()
- {
- var enableImport = $("input:checked[name='import']").val();
- var objectListLength = $("input:checked[name^=importObjectList]").length;
-
- if(enableImport == 'on' && objectListLength == 0 && vision != 'lite')
- {
- $('#emptyTip').removeClass('hidden');
- return false;
- }
- })
- handleKanbanWidthAttr();
-})
-
-/**
- * Set card count.
- *
- * @param string $heightType
- * @access public
- * @return void
- */
-function setCardCount(heightType)
-{
- heightType != 'custom' ? $('#cardBox').addClass('hidden') : $('#cardBox').removeClass('hidden');
-}
diff --git a/module/kanban/js/setwip.js b/module/kanban/js/setwip.js
deleted file mode 100644
index a5671f0ab5..0000000000
--- a/module/kanban/js/setwip.js
+++ /dev/null
@@ -1,29 +0,0 @@
-$(function()
-{
- $('#noLimit').click(function()
- {
- if($(this).attr('checked') == 'checked')
- {
- $('#WIPCount').val('');
- $('#WIPCount').attr('disabled', true);
- }
- else
- {
- $('#WIPCount').removeAttr('disabled');
- }
- })
-})
-
-/**
- * Set WIP count.
- *
- * @access public
- * @return void
- */
-function setWIPLimit()
-{
- var count = $('#WIPCount').val();
- if($('#noLimit').attr('checked') == 'checked') count = -1;
-
- $('#limit').val(count);
-}
diff --git a/module/kanban/js/space.js b/module/kanban/js/space.js
deleted file mode 100644
index 4f39482177..0000000000
--- a/module/kanban/js/space.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Make cards clickable. */
-var $kanbans = $('.kanbans');
-$kanbans.on('click', '.panel', function(e)
-{
- if(!$(e.target).closest('.kanban-actions').length)
- {
- window.location.href = $(this).data('url');
- }
-});
-
-/* Display drop-down menu.*/
-$('.panel').mouseenter(function(e)
-{
- $('.kanban-actions' + e.currentTarget.parentElement.dataset.id).css('visibility','visible');
-});
-
-/* Hide drop-down menu. */
-$('.panel').mouseleave(function(e)
-{
- $('.kanban-actions').css('visibility','hidden');
- $('.dropdown').removeClass('open');
-});
-
-$(function()
-{
- $('input[name^="showClosed"]').click(function()
- {
- var showClosed = $(this).is(':checked') ? 1 : 0;
- $.cookie('showClosed', showClosed, {expires:config.cookieLife, path:config.webRoot});
- window.location.reload();
- });
-});
-
-(function()
-{
- /* Expand or collapse text */
- function limitText()
- {
- var fullText;
- var limitText;
- var $text = $(this);
- var options = $.extend({limitSize: 40, suffix: '…'}, $text.data());
- var text = $text.text();
- if(text.length > options.limitSize)
- {
- fullText = $text.html();
- limitText = text.substring(0, options.limitSize) + options.suffix;
- $text.text(limitText).addClass('limit-text-on');
-
- var $toggleBtn = options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle');
- $toggleBtn.text($toggleBtn.data('textExpand'));
- $toggleBtn.on('click', function()
- {
- var isLimitOn = $text.toggleClass('limit-text-on').hasClass('limit-text-on');
- if(isLimitOn) $text.text(limitText);
- else $text.html(fullText);
- $toggleBtn.text($toggleBtn.data(isLimitOn ? 'textExpand' : 'textCollapse'));
- });
- }
- else
- {
- (options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle')).hide();
- }
- $text.removeClass('hidden');
- };
- $.fn.textLimit = function(){return this.each(limitText);};
- $(function(){$('.text-limit').textLimit();});
-})();
diff --git a/module/kanban/js/splitcolumn.js b/module/kanban/js/splitcolumn.js
deleted file mode 100644
index a8fcd46ad2..0000000000
--- a/module/kanban/js/splitcolumn.js
+++ /dev/null
@@ -1,28 +0,0 @@
-$(document).on('click', "[id^='noLimit']", function()
-{
- var index = $(this).attr('id').slice(7);
- if($(this).attr('checked') == 'checked')
- {
- $('#WIPCount' + index).val('');
- $('#WIPCount' + index).attr('disabled', true);
- }
- else
- {
- $('#WIPCount' + index).removeAttr('disabled');
- }
-});
-
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, i);
- $(obj).closest('tr').after('
' + item + '
');
- $('.colorpicker #color' + i).colorPicker();
-
- i ++;
-}
-
-function deleteItem(obj)
-{
- if($('#columnForm .table tbody').children('tr').length < 4) return false;
- $(obj).closest('tr').remove();
-}
diff --git a/module/kanban/js/view.js b/module/kanban/js/view.js
deleted file mode 100644
index 41e2398cbe..0000000000
--- a/module/kanban/js/view.js
+++ /dev/null
@@ -1,2099 +0,0 @@
-/**
- * Load more.
- *
- * @param string $type
- * @param int $regionID
- * @access public
- * @return void
- */
-function loadMore(type, regionID)
-{
- var method = 'viewArchived' + type;
- var selector = '#archived' + type + 's';
- var link = createLink('kanban', method, 'regionID=' + regionID);
- $(selector).load(link, function()
- {
- var windowHeight = $(window).height();
- var affixedHeight = $('#regionTabs.affixed').height() + $('#kanbanContainer .kanban-affixed .kanban-cols').height();
- $(selector + ' .panel-body').css('height', windowHeight - affixedHeight);
- $(selector).css('top', affixedHeight);
- $(selector).animate({right: 0}, 500);
- });
-}
-
-/**
- * Hide kanban actions.
- *
- * @access public
- * @return void
- */
-function hideAllAction()
-{
- $('.actions').hide();
- $('.action').hide();
- $('.kanban-group-header').hide();
- $(".title").attr("disabled", true).css("pointer-events", "none");
- $('.kanban-col.kanban-header-col').css('padding', '0px 0px 0px 0px');
- window.sortableDisabled = true;
-}
-
-/**
- * Display the kanban in full screen.
- *
- * @access public
- * @return void
- */
-function fullScreen()
-{
- var element = document.getElementById('kanbanContainer');
- var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
-
- if(requestMethod)
- {
- var afterEnterFullscreen = function()
- {
- $('#kanbanContainer').addClass('fullscreen')
- .on('scroll', tryUpdateKanbanAffix);
- hideAllAction();
- $.cookie('isFullScreen', 1);
- };
-
- var whenFailEnterFullscreen = function(error)
- {
- exitFullScreen();
- };
-
- try
- {
- var result = requestMethod.call(element);
- if(result && (typeof result.then === 'function' || result instanceof window.Promise))
- {
- result.then(afterEnterFullscreen).catch(whenFailEnterFullscreen);
- }
- else
- {
- afterEnterFullscreen();
- }
- }
- catch (error)
- {
- whenFailEnterFullscreen(error);
- }
- }
-}
-
-/**
- * Exit full screen.
- *
- * @access public
- * @return void
- */
-function exitFullScreen()
-{
- $('.region-actions > div > .action').show();
- $(".title").attr("disabled", false).css("pointer-events", "auto");
- if(!CRKanban && kanban.status == 'closed') return;
- $('#kanbanContainer').removeClass('fullscreen')
- .off('scroll', tryUpdateKanbanAffix);
- $('.actions').show();
- $('.action').show();
- $('.kanban-group-header').show();
- $('.kanban-col.kanban-header-col').css('padding', '0px 30px');
- window.sortableDisabled = false;
- $.cookie('isFullScreen', 0);
-}
-
-document.addEventListener('fullscreenchange', function (e)
-{
- if(!document.fullscreenElement) exitFullScreen();
-});
-
-document.addEventListener('webkitfullscreenchange', function (e)
-{
- if(!document.webkitFullscreenElement) exitFullScreen();
-});
-
-document.addEventListener('mozfullscreenchange', function (e)
-{
- if(!document.mozFullScreenElement) exitFullScreen();
-});
-
-document.addEventListener('msfullscreenChange', function (e)
-{
- if(!document.msfullscreenElement) exitFullScreen();
-});
-
-/**
- * Render header of a column.
- */
-function renderHeaderCol($column, column, $header, kanbanData)
-{
- /* Render group header. */
- var privs = kanbanData.actions;
- var columnPrivs = $column.data().col.actions;
-
- if(privs.includes('sortGroup'))
- {
- var groups = regions[column.region].groups;
- if($header.closest('.kanban').data('zui.kanban'))
- {
- groups = $header.closest('.kanban').data('zui.kanban').data;
- }
- if(groups.length > 1)
- {
- $column.closest('.kanban-board').addClass('sort');
- $column.closest('.kanban-header').find('.kanban-group-header').remove();
- $column.closest('.kanban-header').prepend('');
- }
- }
-
- var laneID = column.$kanbanData.lanes[0].id ? column.$kanbanData.lanes[0].id : 0;
- var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP') || columnPrivs.includes('createColumn') || columnPrivs.includes('copyColumn') || columnPrivs.includes('archiveColumn') || columnPrivs.includes('deleteColumn') || columnPrivs.includes('splitColumn'));
-
- /* Render more menu. */
- if(columnPrivs.includes('createCard') || printMoreBtn)
- {
- var addItemBtn = '';
- var moreAction = '';
-
- if(!$column.children('.actions').length) $column.append('
');
- var $actions = $column.children('.actions');
- if(column.parent != -1)
- {
- addItemBtn = ['
'].join('');
- }
-
- var moreAction = '
';
- if(CRKanban || kanban.status != 'closed') $actions.html(addItemBtn + moreAction);
-
- }
- if(columnPrivs.includes('sortColumn'))
- {
- if($column.hasClass('kanban-header-parent-col'))
- {
- $column.children('.kanban-header-col').addClass('sort');
- }
- else
- {
- $column.addClass('sort');
- }
- }
-
- if(alignment == 'left')
- {
- if($column.hasClass('kanban-header-parent-col'))
- {
- $column.children('.kanban-header-col').addClass('left');
- }
- else
- {
- $column.addClass('left');
- }
- }
-}
-
-/**
- * Render items count of a column.
- */
-function renderCount($count, count, column)
-{
- /* Render WIP. */
- var limit = !column.limit || column.limit == '-1' ? '
' : column.limit;
- if($count.parent().find('.limit').length)
- {
- $count.parent().find('.limit').html(limit);
- }
- else
- {
- $count.parent().find('.count').before("
(");
- $count.parent().find('.count').after("
/" + limit + ")");
- }
-
- if(column.limit != -1 && column.limit < count)
- {
- $count.parents('.title').parent('.kanban-header-col').css('background-color', 'transparent');
- $count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 200);
- $count.css({'color': '#FF5D5D', 'opacity': '1'});
- if(!$count.parent().find('.error').length) $count.parent().find('.include-last').after("
");
- $count.parents('.title').find('.text-grey').css({'color': '#FF5D5D', 'opacity': '1'});
- }
- else
- {
- $count.parents('.title').parent('.kanban-header-col').css('background-color', 'transparent');
- $count.parents('.title').find('.text').css('max-width', $count.parents('.title').width() - 120);
- $count.css({'color': '#8b91a2', 'opacity': '0.5'});
- $count.parent().find('.error').remove();
- $count.parents('.title').find('.text-grey').css({'color': '#8b91a2', 'opacity': '0.5'});
- }
-}
-
-/**
- * Render lane name.
- *
- * @param object $lane
- * @param object lane
- * @param object $kanban
- * @param object columns
- * @param object kanban
- * @access public
- * @return void
- */
-function renderLaneName($lane, lane, $kanban, columns, kanban)
-{
- var canEditLaneColor = lane.actions.includes('editLaneColor');
- var canEditLaneName = lane.actions.includes('editLaneName');
- var canSort = lane.actions.includes('sortLane') && kanban.lanes.length > 1;
- var canDelete = lane.actions.includes('deleteLane');
-
- $lane.parent().toggleClass('sort', canSort);
-
- if(!$lane.children('.actions').length && (canEditLaneColor || canEditLaneName || canDelete) && (CRKanban || kanbanInfo.status != 'closed'))
- {
- $([
- '
'
- ].join('')).appendTo($lane);
- }
- if($.cookie('isFullScreen') == 1) hideAllAction();
-}
-
-/**
- * Render avatars of user.
- * @param {String|{account: string, avatar: string}} user User account or user object
- * @returns {string}
- */
-function renderUsersAvatar(users, itemID, size)
-{
- var avatarSizeClass = 'avatar-' + (size || 'md');
-
- if(users.length == 0 || (users.length == 1 && users[0] == ''))
- {
- return $('
');
- }
-
- var assignees = [];
- for(var user of users)
- {
- var $noPrivAndNoAssigned = $('
');
- if(!priv.canAssignCard && !user)
- {
- assignees.push($noPrivAndNoAssigned);
- continue;
- }
-
- if(!user)
- {
- assignees.push($('
'));
- continue;
- }
-
- if(typeof user === 'string') user = {account: user};
- if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account];
- if(!user.name && window.users && window.users[user.account]) user.name = window.users[user.account];
-
- assignees.push($('
').avatar({user: user}));
- }
-
- if(assignees.length > 3) assignees.splice(3, assignees.length - 3, '
...');
-
- return assignees;
-}
-
-
-/**
- * The function for rendering kanban item
- */
-function renderKanbanItem(item, $item)
-{
- var whiteStyle = null;
- if(item.color == '#2a5f29' || item.color == '#b10b0b' || item.color == '#cfa227') whiteStyle = 'style="color:#FFFFFF"';
-
- var privs = item.actions;
- var printMoreBtn = (privs.includes('editCard') || privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor'));
- var $actions = $item.children('.actions');
- var $title = $item.children('.title');
- if(printMoreBtn && !$actions.length && (CRKanban || kanban.status != 'closed'))
- {
- $(
- [
- '
'
- ].join('')).appendTo($item);
- }
-
- if(item.fromType == 'execution')
- {
- renderExecutionItem(item, $item);
- }
- else if(item.fromType == 'release')
- {
- renderReleaseItem(item, $item);
- }
- else if(item.fromType == 'build')
- {
- renderBuildItem(item, $item);
- }
- else if(item.fromType == 'productplan')
- {
- renderProductplanItem(item, $item);
- }
- else if(item.fromType == 'ticket')
- {
- renderTicketItem(item, $item);
- }
- else
- {
- if(!$title.length)
- {
- if(privs.includes('viewCard')) $title = $('
').appendTo($item).attr('href', createLink('kanban', 'viewCard', 'cardID=' + item.id, '', true));
- if(!privs.includes('viewCard')) $title = $('
').appendTo($item);
- }
- $title.text(item.name).attr('title', item.name);
-
- var $info = $item.children('.info');
- if(!$info.length) $info = $(
- [
- '
',
- '
',
- '
',
- '
',
- '
',
- '
'
- ].join('')).appendTo($item);
-
- $item.data('card', item);
-
- $info.children('.estimate').text(item.estimate + kanbancardLang.lblHour);
- item.estimate > 0 ? $info.children('.estimate').show() : $info.children('.estimate').hide();
-
- $info.children('.pri')
- .attr('class', 'pri' + (item.pri ? ' label-pri label-pri-' + item.pri : ''))
- .text(item.pri);
-
- var $time = $info.children('.time');
- if(item.end == '0000-00-00' && item.begin == '0000-00-00')
- {
- $time.hide();
- }
- else
- {
- var today = new Date();
- var begin = $.zui.createDate(item.begin);
- var end = $.zui.createDate(item.end);
- var needRemind = (begin.toLocaleDateString() == today.toLocaleDateString() || end.toLocaleDateString() == today.toLocaleDateString());
- if(item.end == '0000-00-00' && item.begin != '0000-00-00')
- {
- $time.text($.zui.formatDate(begin, 'MM/dd') + ' ' + kanbancardLang.beginAB).attr('title', $.zui.formatDate(begin, 'yyyy/MM/dd') + ' ' +kanbancardLang.beginAB).show();
- }
- else if(item.begin == '0000-00-00' && item.end != '0000-00-00')
- {
- $time.text($.zui.formatDate(end, 'MM/dd') + ' ' + kanbancardLang.deadlineAB).attr('title', $.zui.formatDate(end, 'yyyy/MM/dd') + ' ' + kanbancardLang.deadlineAB).show();
- }
- else if(item.begin != '0000-00-00' && item.end != '0000-00-00')
- {
- $time.text($.zui.formatDate(begin, 'MM/dd') + ' ' + kanbancardLang.to + ' ' + $.zui.formatDate(end, 'MM/dd')).attr('title', $.zui.formatDate(begin, 'yyyy/MM/dd') + kanbancardLang.to + $.zui.formatDate(end, 'yyyy/MM/dd')).show();
- }
-
- if(!$item.hasClass('has-color') && needRemind) $time.css('background-color', 'rgba(210, 50, 61, 0.3)');
- if($item.hasClass('has-color') && needRemind) $time.css('background-color', 'rgba(255, 255, 255, 0.3)');
- if(!needRemind) $time.css('background-color', 'rgba(0, 0, 0, 0.15)');
- }
-
- /* Display avatars of assignedTo. */
- var assignedTo = item.assignedTo.split(',');
- var $user = $info.children('.user');
- var title = [];
- for(i = 0; i < assignedTo.length; i++) title.push(users[assignedTo[i]]);
- $user.html(renderUsersAvatar(assignedTo, item.id)).attr('title', title);
- }
-
- if(kanban.performable == 1 && (item.fromType == '' || item.fromType == 'execution'))
- {
- var $progress = $item.children('.progress-box');
- if(!$progress.length) $progress = $('
').appendTo($item);
- $progress.find('.progress-bar').css('width', item.progress + '%');
- $progress.find('.progress-number').html(item.progress + '%');
- }
- $item.css('background-color', item.color);
- $item.toggleClass('has-color', item.color != '#fff' && item.color != '');
- $item.find('.info > .label-light').css('background-color', item.color);
-
- $title = item.fromType == 'execution' ? $item.children('.header').children('.executionName').children('.title') : $item.children('.title');
- if(!$title.children('.label-finish').length) $title.prepend('
' + kanbanLang.finished + '
');
- var name = item.title ? item.title : item.name;
- if(kanban.performable == 1 && item.status == 'done' )
- {
- var finishColor = '#2a5f29';
- if(item.color == '#2a5f29') finishColor = '#FFFFFF';
- $title.css('color', finishColor);
- $title.children('.label-finish').show();
- if(item.color == '#2a5f29')
- {
- $item.children('.label-finish').css({'background-color':'#FFFFFF','color':'#2a5f29'});
- }
- else
- {
- $item.children('.label-finish').css({'background-color':'','color':'#FFFFFF'});
- }
- }
- else
- {
- $title.css('color', '');
- $title.children('.label-finish').hide();
- }
- if($.cookie('isFullScreen') == 1) hideAllAction();
-}
-
-/**
- * Render execution item.
- *
- * @param object item
- * @param object $item
- * @access public
- * @return void
- */
-function renderExecutionItem(item, $item)
-{
- /* Output header information. */
- var privs = item.actions;
- if(privs.includes('sortCard')) $item.parent().addClass('sort');
-
- var $header = $item.children('.header');
- if(!$header.length) $header = $(
- [
- ''
- ].join('')).appendTo($item);
-
- var $titleBox = $header.children('.executionName');
- if(!$titleBox.length) $titleBox = $(
- [
- '
',
- '
'
- ].join('')).appendTo($header);
-
- /* Print execution name. */
- var $title = $titleBox.children('.title');
- var name = item.name ? item.name : item.title;
- var title = item.title ? item.title : name;
- if(!$title.length)
- {
- var icon = mode == 'ALM' ? 'run' : 'project';
- var viewMethod = item.execType == 'kanban' ? 'kanban' : 'view';
- if(privs.includes('viewExecution') && item.deleted == '0' && item.children == '0') $title = $('
' + name + '').appendTo($titleBox).attr('href', createLink('execution', viewMethod, 'executionID=' + item.fromID));
- if(!privs.includes('viewExecution') || item.deleted == '1' || item.children != '0') $title = $('
' + name + '
').appendTo($titleBox);
- }
- if(!$title.children('i').length)
- {
- $title.append('
' + item.title);
- }
- $title.attr('title', title);
-
- if(item.delay)
- {
- $delayed = $titleBox.children('.delayed');
- if(!$delayed.length)
- {
- $('
' + executionLang.delayed + '').appendTo($titleBox);
- }
- }
-
- $item.data('card', item);
-
- var $info = $item.children('.execInfo');
- if(!$info.length) $info = $(
- [
- '
',
- '
'
- ].join('')).appendTo($item);
-
- var $statusBox = $info.children('.execStatus');
- if(!$statusBox.length)
- {
- if(item.deleted == '0')
- {
- $statusBox = $('
' + executionLang.statusList[item.objectStatus] + '').appendTo($info);
- }
- else
- {
- $statusBox = $('
' + executionLang.deleted + '').appendTo($info);
- }
- }
-
- /* Display deadline of execution. */
- var $date = $info.children('.date');
- var end = $.zui.createDate(item.end);
- var today = new Date();
- var labelType = end.toLocaleDateString() == today.toLocaleDateString() ? 'danger' : 'wait';
- if(!$date.length) $date = $('
').appendTo($info);
-
- $date.text($.zui.formatDate(end, 'MM-dd') + ' ' + kanbancardLang.deadlineAB).attr('title', $.zui.formatDate(end, 'yyyy-MM-dd') + ' ' + kanbancardLang.deadlineAB).show();
-
- /* Display avatars of PM. */
- var $user = $info.children('.user');
- var user = [item.PM];
- if(users[item.PM])
- {
- if(!$user.length) $user = $('
').appendTo($info);
- $user.html(renderUsersAvatar(user, item.id)).attr('title', users[item.PM]);
- }
-}
-
-/**
- * Render plan item.
- *
- * @param object item
- * @param object $item
- * @access public
- * @return void
- */
-function renderReleaseItem(item, $item)
-{
- var privs = item.actions;
- if(privs.includes('sortCard')) $item.parent().addClass('sort');
-
- /* Print name. */
- var $title = $item.children('.releaseTitle');
- var name = item.title ? item.title : item.name;
- if(!$title.length)
- {
- if(privs.includes('viewRelease') && item.deleted == '0') $title = $('
' + name + '').appendTo($item).attr('href', createLink('release', 'view', 'releaseID=' + item.fromID));
- if(!privs.includes('viewRelease') || item.deleted == '1') $title = $('
' + name + '
').appendTo($item);
- }
- if(!$title.children('i').length)
- {
- $title.prepend('
');
- }
- $title.attr('title', name);
-
- var $info = $item.children('.releaseInfo');
- if(!$info.length) $info = $(
- [
- '
',
- '
'
- ].join('')).appendTo($item);
-
- var $statusBox = $info.children('.releaseStatus');
- if(!$statusBox.length)
- {
- if(item.deleted == '0')
- {
- $statusBox = $('
' + releaseLang.statusList[item.objectStatus] + '').appendTo($info);
- }
- else
- {
- $statusBox = $('
' + releaseLang.deleted + '').appendTo($info);
- }
- }
-
- /* Display release date. */
- var $date = $info.children('.date');
- var releaseDate = $.zui.createDate(item.date);
- if(!$date.length) $date = $('
').appendTo($info);
-
- $date.text($.zui.formatDate(releaseDate, 'yyyy-MM-dd')).attr('title', $.zui.formatDate(releaseDate, 'yyyy-MM-dd')).show();
-
- /* Display avatars of creator. */
- var $user = $info.children('.user');
- var user = [item.createdBy];
- if(users[item.createdBy])
- {
- if(!$user.length) $user = $('
').appendTo($info);
- $user.html(renderUsersAvatar(user, item.id)).attr('title', users[item.createdBy]);
- }
-}
-
-/**
- * Render product plan item.
- *
- * @param object item
- * @param object $item
- * @access public
- * @return void
- */
-function renderProductplanItem(item, $item)
-{
- var privs = item.actions;
- if(privs.includes('sortCard')) $item.parent().addClass('sort');
-
- /* Print name. */
- var $title = $item.children('.productplanTitle');
- var name = item.title ? item.title : item.name;
- if(!$title.length)
- {
- if(privs.includes('viewPlan') && item.deleted == '0') $title = $('
' + name + '').appendTo($item).attr('href', createLink('productplan', 'view', 'productplanID=' + item.fromID));
- if(!privs.includes('viewPlan') || item.deleted == '1') $title = $('
' + name + '
').appendTo($item);
- }
- if(!$title.children('i').length)
- {
- $title.append('
' + name);
- }
- $title.attr('title', item.title);
-
- var $info = $item.children('.productplanInfo');
- if(!$info.length) $info = $(
- [
- '
',
- '
'
- ].join('')).appendTo($item);
-
- var $descBox = $info.children('.productplanDesc');
- if(!$descBox.length)
- {
- $descBox = $('
' + item.desc + '
').appendTo($info);
- }
-
- var $statusBox = $info.children('.productplanStatus');
- if(!$statusBox.length)
- {
- if(item.deleted == '0')
- {
- $statusBox = $('
' + productplanLang.statusList[item.objectStatus] + '').appendTo($info);
- }
- else
- {
- $statusBox = $('
' + productplanLang.deleted + '').appendTo($info);
- }
- }
-
- /* Display date of product plan. */
- var $date = $info.children('.date');
- var begin = $.zui.createDate(item.begin);
- var end = $.zui.createDate(item.end);
- var today = new Date();
- var labelType = (item.begin <= $.zui.formatDate(today, 'yyyy-MM-dd') && item.end >= $.zui.formatDate(today, 'yyyy-MM-dd')) ? 'danger' : 'wait';
- var labelTitle = $.zui.formatDate(begin, 'MM-dd') + ' ' + productplanLang.to + ' ' + $.zui.formatDate(end, 'MM-dd');
-
- if((item.begin == '2030-01-01' || item.end == '2030-01-01'))
- {
- labelType = 'future';
- labelTitle = productplanLang.future;
- }
- if(!$date.length) $date = $('
').appendTo($info);
- $date.text(labelTitle).attr('title', labelTitle).show();
-
- /* Display avatars of creator. */
- var $user = $info.children('.user');
- var user = [item.createdBy];
- if(users[item.createdBy])
- {
- if(!$user.length) $user = $('
').appendTo($info);
- $user.html(renderUsersAvatar(user, item.id)).attr('title', users[item.createdBy]);
- }
-}
-
-/**
- * Render build item.
- *
- * @param object item
- * @param object $item
- * @access public
- * @return void
- */
-function renderBuildItem(item, $item)
-{
- var privs = item.actions;
- if(privs.includes('sortCard')) $item.parent().addClass('sort');
-
- /* Print name. */
- var $title = $item.children('.buildTitle');
- var name = item.title ? item.title : item.name;
- if(!$title.length)
- {
- if(privs.includes('viewBuild') && item.deleted == '0') $title = $('
' + name + '').appendTo($item).attr('href', createLink('build', 'view', 'buildID=' + item.fromID));
- if(!privs.includes('viewBuild') || item.deleted == '1') $title = $('
' + name + '
').appendTo($item);
- }
- if(!$title.children('i').length)
- {
- $title.append('
' + item.title);
- }
- $title.attr('title', name);
-
- var $descBox = $item.children('.buildDesc');
- if(!$descBox.length)
- {
- $descBox = $('
' + item.desc + '
').appendTo($item);
- }
-
- var $info = $item.children('.info');
- if(!$info.length) $info = $(
- [
- '
',
- '
'
- ].join('')).appendTo($item);
-
- var $statusBox = $info.children('.buildStatus');
- if(!$statusBox.length && item.deleted == '1')
- {
- $statusBox = $('
' + productplanLang.deleted + '').appendTo($info);
- }
-
- /* Display build date. */
- var $date = $info.children('.date');
- var buildDate = $.zui.createDate(item.date);
- if(!$date.length) $date = $('
').appendTo($info);
-
- $date.text($.zui.formatDate(buildDate, 'yyyy-MM-dd')).attr('title', $.zui.formatDate(buildDate, 'yyyy-MM-dd')).show();
-
- /* Display avatars of creator. */
- var $user = $info.children('.user');
- var user = [item.builder];
- if(users[item.builder])
- {
- if(!$user.length) $user = $('
').appendTo($info);
- $user.html(renderUsersAvatar(user, item.id)).attr('title', users[item.builder]);
- }
-}
-
-/**
- * Render execution item.
- *
- * @param object item
- * @param object $item
- * @access public
- * @return void
- */
-function renderTicketItem(item, $item)
-{
- /* Output header information. */
- var privs = item.actions;
- if(privs.includes('sortCard')) $item.parent().addClass('sort');
-
- var $header = $item.children('.header');
- if(!$header.length) $header = $(
- [
- ''
- ].join('')).appendTo($item);
-
- var $titleBox = $header.children('.ticketTitle');
- if(!$titleBox.length) $titleBox = $(
- [
- '
',
- '
'
- ].join('')).appendTo($header);
-
- /* Print ticket name. */
- var $title = $titleBox.children('.title');
- var name = item.title ? item.title : item.name;
- if(!$title.length)
- {
- var icon = 'ticket';
- if(privs.includes('viewTicket') && item.deleted == '0') $title = $('
' + name + '').appendTo($titleBox).attr('href', createLink('ticket', 'view', 'ticketID=' + item.fromID));
- if(!privs.includes('viewTicket') || item.deleted == '1') $title = $('
' + name + '
').appendTo($titleBox);
- }
- $title.attr('title', name);
- $item.data('card', item);
-
- var $info = $item.children('.info');
- if(!$info.length) $info = $(
- [
- '
',
- '
'
- ].join('')).appendTo($item);
-
- var $statusBox = $info.children('.execStatus');
- if(!$statusBox.length)
- {
- if(item.deleted == '0')
- {
- $statusBox = $('
' + ticketLang.statusList[item.objectStatus] + '').appendTo($info);
- }
- else
- {
- $statusBox = $('
' + ticketLang.deleted + '').appendTo($info);
- }
- }
-
- /* Display deadline of execution. */
- if(item.deadline != '0000-00-00')
- {
- var $date = $info.children('.date');
- var deadline = $.zui.createDate(item.deadline);
- var today = new Date();
- var labelType = deadline.toLocaleDateString() == today.toLocaleDateString() ? 'danger' : 'wait';
- if(!$date.length) $date = $('
').appendTo($info);
-
- $date.text($.zui.formatDate(deadline, 'MM-dd') + ' ' + kanbancardLang.deadlineAB).attr('title', $.zui.formatDate(deadline, 'yyyy-MM-dd') + ' ' + kanbancardLang.deadlineAB).show();
- }
-
- /* Display avatars of ticket assignedTo. */
- var $user = $info.children('.user');
- var user = [item.assignedTo];
- if(users[item.assignedTo])
- {
- if(!$user.length) $user = $('
').appendTo($info);
- $user.html(renderUsersAvatar(user, item.id)).attr('title', users[item.assignedTo]);
- }
-}
-
-/**
- * Show error message
- * @param {string|object} message Message
- */
-function showErrorMessager(message)
-{
- var html = false;
- if(message instanceof Error)
- {
- message = message.message;
- }
- else if(typeof message === 'object')
- {
- html = [];
- $.each(message, function(key, msg)
- {
- html.push($.isArray(msg) ? msg.join('') : String(msg));
- });
- message = html.join('
');
- }
- else
- {
- message = String(message);
- }
-
- if(typeof message === 'string' && message.length)
- {
- $.zui.messager.danger(message, {html: !!html});
- }
-}
-
-/**
- * Move a card.
- *
- * @param int $cardID
- * @param int $fromColID
- * @param int $toColID
- * @param int $fromLaneID
- * @param int $toLaneID
- * @param int $kanbanID
- * @param int $regionID
- * @access public
- * @return string
- */
-function moveCard(cardID, fromColID, toColID, fromLaneID, toLaneID, kanbanID, regionID)
-{
- if(!cardID) return false;
- var url = createLink('kanban', 'moveCard', 'cardID=' + cardID + '&fromColID='+ fromColID + '&toColID=' + toColID + '&fromLaneID='+ fromLaneID + '&toLaneID=' + toLaneID + '&kanbanID=' + kanbanID);
- return $.ajax(
- {
- method: 'post',
- dataType: 'json',
- url: url,
- async: false,
- success: function(data)
- {
- regions = data;
- updateRegion(regionID, data[regionID]);
-
- /* Disable related operations in full screen mode. */
- if($.cookie('isFullScreen') == 1)
- {
- $('.actions').hide();
- $('.action').hide();
- $('.kanban-group-header').hide();
- $(".title").attr("disabled", true).css("pointer-events", "none");
- }
- setToolTip();
- },
- error: function(xhr, status, error)
- {
- showErrorMessager(error || lang.timeout);
- }
- });
-}
-
-/**
- * Set a card's color.
- *
- * @param int $cardID
- * @param string $color
- * @param int $kanbanID
- * @param int $regionID
- * @access public
- * @return string
- */
-function setCardColor(cardID, color, kanbanID, regionID)
-{
- if(!cardID) return false;
- color = color.replace('#', '');
- var url = createLink('kanban', 'setCardColor', 'cardID=' + cardID + '&color=' + color + '&kanbanID=' + kanbanID);
- return $.ajax(
- {
- method: 'post',
- dataType: 'json',
- url: url,
- success: function(data)
- {
- updateRegion(regionID, data[regionID]);
- },
- error: function(xhr, status, error)
- {
- showErrorMessager(error || lang.timeout);
- }
- });
-}
-
-/**
- * Finish a card.
- *
- * @param int $cardID
- * @param int $kanbanID
- * @param int $regionID
- * @access public
- * @return void
- */
-function finishCard(cardID, kanbanID, regionID)
-{
- if(!cardID) return false;
- var url = createLink('kanban', 'finishCard', 'cardID=' + cardID + '&kanbanID=' + kanbanID);
- return $.ajax(
- {
- method: 'post',
- dataType: 'json',
- url: url,
- success: function(data)
- {
- updateRegion(regionID, data[regionID]);
- }
- });
-}
-
-/**
- * Update a region.
- *
- * @param int regionID
- * @param array regionData
- * @access public
- * @return boolean
- */
-function updateRegion(regionID, regionData)
-{
- if(typeof(regionData) == 'undefined') regionData = [];
- if(!regionID) return false;
-
- var $region = $('#kanban'+ regionID).kanban();
-
- if(!$region.length) return false;
- regions[regionID] = regionData ? regionData : regions[regionID];
-
- $region.data('zui.kanban').render(regions[regionID].groups);
- resetRegionHeight('open');
- return true;
-}
-
-/**
- * Update region name.
- *
- * @param int $regionID
- * @param string $name
- * @access public
- * @return void
- */
-function updateRegionName(regionID, name)
-{
- $('.region[data-id="' + regionID + '"] > .region-header > strong:first').text(name);
- $('#regionNavTabs li[data-id="' + regionID + '"]').attr('title', name);
- $('#regionNavTabs li[data-id="' + regionID + '"]').find('a > span').text(name);
- initRegionTabs();
-}
-
-/**
- * Update lane name.
- *
- * @param int $laneID
- * @param string $name
- * @access public
- * @return void
- */
-function updateLaneName(laneID, name)
-{
- $('.kanban-lane[data-id="' + laneID + '"] > .kanban-lane-name > span').text(name).attr('title', name);
-}
-
-/**
- * Update lane color.
- *
- * @param int $laneID
- * @param string $color
- * @access public
- * @return void
- */
-function updateLaneColor(laneID, color)
-{
- $('.kanban-lane[data-id="' + laneID + '"] > .kanban-lane-name').css('background-color', color);
-}
-
-/**
- * Update column name.
- *
- * @param int $columnID
- * @param string $name
- * @param string $color
- * @access public
- * @return void
- */
-function updateColumnName(columnID, name, color)
-{
- $('.kanban-col[data-id="' + columnID + '"] > div.title > span:first').text(name).attr('title', name).css('color', color);
-}
-
-/**
- * Hide kanban action
- */
-function hideKanbanAction()
-{
- $('.kanban').attr('data-action-enabled', null);
- $('.contextmenu').removeClass('contextmenu-show');
- $('.contextmenu .contextmenu-menu').removeClass('open').removeClass('in');
- $('#moreTasks, #moreColumns').animate({right: -400}, 500);
-}
-
-/**
- * Open form for adding task
- * @param {JQuery} $element Trigger element
- */
-function openAddTaskForm($element)
-{
- var regionID = $element.closest('.kanban').data('id');
- var groupID = $element.closest('.kanban-board').data('id');
- var laneID = $element.closest('.kanban-lane').data('id');
- var columnID = $element.closest('.kanban-col').data('id');
- var status = $element.closest('.kanban-col').data('type');
- var modalUrl = createLink('kanban', 'createCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&columnID=' + columnID);
- $.zui.modalTrigger.show(
- {
- url: modalUrl,
- width: '1000px'
- });
- hideKanbanAction();
-}
-
-/**
- * Reset lane height according to window height.
- */
-function resetLaneHeight()
-{
- var maxHeight = '500px';
- if(laneCount < 2)
- {
- var windowHeight = $(window).height();
- var marginTop = $('#main').css('margin-top');
- var headerHeight = $('.kanban > .kanban-board:first > .kanban-header').outerHeight();
- var actionHeight = $('.kanban > .kanban-board:first > .kanban-lane > .kanban-col:first > .kanban-lane-actions').outerHeight();
-
- maxHeight = windowHeight - parseInt(marginTop) - headerHeight - actionHeight;
- }
- $('.kanban-lane-items').css('max-height', maxHeight);
-}
-
-/**
- * Close modal and update kanban data.
- */
-function closeModalAndUpdateKanban(regionID)
-{
- setTimeout(function()
- {
- $.zui.closeModal();
- updateRegion(regionID);
- }, 1200);
-}
-
-/**
- * Status change map
- */
-var statusChangeMap =
-{
- wait: ['doing', 'done', 'cancel'],
- doing: ['done', 'cancel'],
- done: ['doing', 'closed'],
- cancel: ['doing', 'closed'],
- closed: ['doing']
-};
-
-/**
- * Find drop columns
- * @param {JQuery} $element Drag element
- * @param {JQuery} $root Dnd root element
- */
-function findDropColumns($element, $root)
-{
- var $task = $element;
- var task = $task.data('task');
- //var status = task.status;
- var $col = $task.closest('.kanban-col');
- var col = $col.data();
- var lane = $col.closest('.kanban-lane').data('lane');
- var allStatusCanChange = statusChangeMap[status];
-
- hideKanbanAction();
-
- return $root.find('.kanban-lane-col:not([data-type="EMPTY"],[data-type=""])').filter(function()
- {
- if($.cookie('isFullScreen') == 1 || (!CRKanban && kanbanInfo.status == 'closed')) return false;
- var $newCol = $(this);
- var newCol = $newCol.data();
- var $newLane = $newCol.closest('.kanban-lane');
- var newLane = $newLane.data('lane');
-
- $newCol.addClass('can-drop-here');
- return true;
- });
-}
-
-/**
- * Handle drop card
- * @param {Object} event Drop event object
- */
-function handleDropTask($element, event, kanban)
-{
- if(!event.target || !event.isNew) return;
-
- var $card = $element;
- var $oldCol = $card.closest('.kanban-col');
- var $newCol = $(event.target).closest('.kanban-col');
- var oldCol = $oldCol.data();
- var newCol = $newCol.data();
- var oldLane = $oldCol.closest('.kanban-lane').data('lane');
- var newLane = $newCol.closest('.kanban-lane').data('lane');
- var regionID = $card.closest('.region').data('id');
- var kanbanID = $card.closest('#kanban').data('id');
-
- if(!oldCol || !newCol || !newLane || !oldLane) return false;
- if(oldCol.id === newCol.id && newLane.id === oldLane.id) return false;
-
- var cardID = $card.data().id;
- moveCard(cardID, oldCol.id, newCol.id, oldLane.id, newLane.id, kanbanID, regionID);
-}
-
-/**
- * Handle finish drop task
- */
-function handleFinishDrop()
-{
- $('.kanban').find('.can-drop-here').removeClass('can-drop-here');
-}
-
-/**
- * Adjust add button postion in column
- */
-function adjustAddBtnPosition($kanban)
-{
- if(!$kanban)
- {
- $('.kanban').children('.kanban-board').each(function()
- {
- adjustAddBtnPosition($(this));
- });
- return;
- }
-
- $kanban.find('.kanban-lane-col:not([data-type="EMPTY"])').each(function()
- {
- var $col = $(this);
- var items = $col.children('.kanban-lane-items')[0];
- $col.toggleClass('has-scrollbar', items.scrollHeight > items.clientHeight);
- });
-}
-
-/**
- * Kanban action handlers
- */
-var kanbanActionHandlers =
-{
- addItem: openAddTaskForm,
- dropItem: handleDropTask
-};
-
-/**
- * Handle kanban action
- */
-function handleKanbanAction(action, $element, event, kanban)
-{
- $('.kanban').attr('data-action-enabled', action);
- var handler = kanbanActionHandlers[action];
- if(handler) handler($element, event, kanban);
-}
-
-function processMinusBtn()
-{
- var $table = $('#splitTable');
- var columnCount = $table.find('.child-column').length;
- if(columnCount > 2 && columnCount < 10)
- {
- $table.find('.btn-plus').show();
- $table.find('.btn-close').show();
- }
- else if(columnCount <= 2)
- {
- $table.find('.btn-close').hide();
- }
- else if(columnCount >= 10)
- {
- $table.find('.btn-plus').hide();
- }
-}
-
-/**
- * Create lane menu.
- *
- * @param object $options
- * @access public
- * @return void
- */
-function createLaneMenu(options)
-{
- var lane = options.$trigger.closest('.kanban-lane').data('lane');
- var privs = lane.actions;
- if(!privs.length) return [];
-
- var items = [];
- var regionID = lane.$kanbanData.region;
- var kanbanID = lane.$kanbanData.kanban;
- if(privs.includes('editLaneName')) items.push({label: kanbanLang.editLaneName, icon: 'edit', url: createLink('kanban', 'editLaneName', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '635px'}});
- if(privs.includes('editLaneColor')) items.push({label: kanbanLang.editLaneColor, icon: 'color', url: createLink('kanban', 'editLaneColor', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '635px'}});
- if(privs.includes('deleteLane')) items.push({label: kanbanLang.deleteLane, icon: 'trash', url: createLink('kanban', 'deleteLane', 'regionID=' + regionID + '&kanbanID=' + kanbanID + '&lane=' + lane.id), attrs: {'target': 'hiddenwin'}});
-
- var bounds = options.$trigger[0].getBoundingClientRect();
- items.$options = {x: bounds.right, y: bounds.top};
- return items;
-}
-
-/**
- * Create card menu.
- *
- * @param object $options
- * @access public
- * @return array
- */
-function createCardMenu(options)
-{
- var card = options.$trigger.closest('.kanban-item').data('item');
- var privs = card.actions;
- if(!privs.length) return [];
-
- var items = [];
- if(privs.includes('editCard') && card.fromType == '') items.push({label: kanbanLang.editCard, icon: 'edit', url: createLink('kanban', 'editCard', 'cardID=' + card.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- if(privs.includes('deleteCard')) items.push({label: card.fromType == '' ? kanbanLang.deleteCard : kanbanLang.removeCard, icon: card.fromType == '' ? 'trash' : 'unlink', url: createLink('kanban', 'deleteCard', 'cardID=' + card.id), attrs: {'target': 'hiddenwin'}});
- if(kanban.performable == 1 && card.fromType == '')
- {
- if(card.status == 'done')
- {
- items.push({label: kanbanLang.activateCard, icon: 'magic', url: createLink('kanban', 'activateCard', 'cardID=' + card.id + '&kanbanID=' + card.kanban, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
- }
- else
- {
- items.push({label: kanbanLang.finishCard, icon: 'checked', onClick: function(){finishCard(card.id, card.kanban, card.region);}});
- }
- }
- if(privs.includes('archiveCard') && kanban.archived == '1') items.push({label: kanbanLang.archiveCard, icon: 'card-archive', url: createLink('kanban', 'archiveCard', 'cardID=' + card.id), attrs: {'target': 'hiddenwin'}, onClick:function(){$('#archivedCards').replaceWith("
");}});
-
- var editCardAction = (privs.includes('editCard') && card.fromType == '') ? true : false;
- var deleteCardAction = privs.includes('deleteCard');
- var archiveCardAction = (privs.includes('archiveCard') && kanban.archived == '1') ? true : false;
-
- var performable = kanban.performable == 1 ? true : false;
-
- var moveCardAction = privs.includes('moveCard');
- var setCardColorAction = privs.includes('setCardColor');
-
- var basicActions = (editCardAction || deleteCardAction || archiveCardAction) ? true : false;
- var otherActions = (moveCardAction || setCardColorAction) ? true : false;
-
- if((performable || basicActions) && otherActions)
- {
- items.push({type: 'divider'});
- }
-
- if(privs.includes('moveCard'))
- {
- var moveCardItems = [];
- var moveColumns = [];
- var parentColumns = [];
- var regionGroups = regions[options.$trigger.closest('.region').data('id')].groups;
- for(let i = 0; i < regionGroups.length ; i ++ )
- {
- if(regionGroups[i].id == options.$trigger.closest('.kanban-board').data('id'))
- {
- moveColumns = regionGroups[i].columns;
- break;
- }
- }
- for(let i = moveColumns.length-1 ; i >= 0 ; i -- )
- {
- if(moveColumns[i].parent > 0) parentColumns.push(moveColumns[i].parent);
- if(moveColumns[i].id == card.column || $.inArray(moveColumns[i].id, parentColumns) >= 0) continue;
- moveCardItems.push({label: moveColumns[i].name, onClick: function(){moveCard(card.id, card.column, moveColumns[i].id, card.lane, card.lane, card.kanban, card.region);}});
- }
- moveCardItems = moveCardItems.reverse();
- items.push({label: kanbanLang.moveCard, icon: 'move', items: moveCardItems});
- }
-
- if(privs.includes('setCardColor'))
- {
- var cardColoritems = [];
- if(!card.color) card.color = "#fff";
- for(let i = 0 ; i < colorList.length ; i ++ )
- {
- var attr = card.color == colorList[i] ? '
' : '';
- var border = i == 0 ? 'border:1px solid #b0b0b0;' : '';
- cardColoritems.push({label: "
" + colorListLang[colorList[i]] + attr ,
- onClick: function(){setCardColor(card.id, colorList[i], card.kanban, card.region);}, html: true, attrs: {id: 'cardcolormenu'}, className: 'color' + i});
- };
- items.push({label: kanbanLang.cardColor, icon: 'color', items: cardColoritems});
- }
-
- var bounds = options.$trigger[0].getBoundingClientRect();
- items.$options = {x: bounds.right, y: bounds.top};
- return items;
-}
-
-function createColumnMenu(options)
-{
- var column = options.$trigger.closest('.kanban-col').data('col');
- var privs = column.actions;
- if(!privs.length) return [];
-
- var items = [];
- if(privs.includes('setColumn')) items.push({label: kanbanLang.editColumn, icon: 'edit', url: createLink('kanban', 'setColumn', 'columnID=' + column.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- if(privs.includes('setWIP')) items.push({label: kanbanLang.setWIP, icon: 'alert', url: createLink('kanban', 'setWIP', 'columnID=' + column.id), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width' : '500px'}});
-
- var basicActions = (privs.includes('setColumn') || privs.includes('setWIP')) ? true : false;
- var columnActions = (privs.includes('splitColumn') || privs.includes('createColumn') || privs.includes('copyColumn')) ? true : false;
-
- if(basicActions && columnActions)
- {
- items.push({type: 'divider'});
- }
-
- if(privs.includes('splitColumn')) items.push({label: kanbanLang.splitColumn, icon: 'col-split', url: createLink('kanban', 'splitColumn', 'columnID=' + column.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- if(privs.includes('createColumn'))
- {
- items.push({label: kanbanLang.createColumnOnLeft, icon: 'col-add-left', url: createLink('kanban', 'createColumn', 'columnID=' + column.id + '&position=left'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- items.push({label: kanbanLang.createColumnOnRight, icon: 'col-add-right', url: createLink('kanban', 'createColumn', 'columnID=' + column.id + '&position=right'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- }
- if(privs.includes('copyColumn')) items.push({label: kanbanLang.copyColumn, icon: 'copy', url: createLink('kanban', 'copyColumn', 'columnID=' + column.id), className: 'iframe', attrs: {'data-toggle': 'modal'}});
-
- var otherActions = ((privs.includes('archiveColumn') && kanban.archived == '1') || privs.includes('deleteColumn')) ? true : false;
- if(columnActions && otherActions) items.push({type: 'divider'});
-
- if(privs.includes('archiveColumn') && kanban.archived == '1') items.push({label: kanbanLang.archiveColumn, icon: 'card-archive', url: createLink('kanban', 'archiveColumn', 'columnID=' + column.id), attrs: {'target': 'hiddenwin'}, onClick:function(){$('#archivedColumns').replaceWith("
");}});
- if(privs.includes('deleteColumn')) items.push({label: kanbanLang.deleteColumn, icon: 'trash', url: createLink('kanban', 'deleteColumn', 'columnID=' + column.id), attrs: {'target': 'hiddenwin'}});
-
- var bounds = options.$trigger[0].getBoundingClientRect();
- items.$options = {x: bounds.right, y: bounds.top};
- return items;
-}
-
-/**
- * Create create menu for column.
- *
- * @param object $options
- * @access public
- * @return object
- */
-function createColumnCreateMenu(options)
-{
- var col = options.$trigger.closest('.kanban-col').data('col');
- var privs = col.actions;
- var items = [];
- var regionID = col.region;
- var groupID = col.group;
- var laneID = col.$kanbanData.lanes[0].id ? col.$kanbanData.lanes[0].id : 0;
- var columnID = col.id;
-
- if(privs.includes('createCard')) items.push({label: kanbanLang.createCard, url: $.createLink('kanban', 'createCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&columnID=' + columnID, '', true), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- if(privs.includes('batchCreateCard')) items.push({label: kanbanLang.batchCreateCard, url: $.createLink('kanban', 'batchCreateCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&laneID=' + laneID + '&columnID=' + columnID), attrs: {'data-width': '80%'}});
- if(kanban.object.indexOf('cards') != -1) items.push({label: kanbanLang.importCard, url: $.createLink('kanban', 'importCard', 'kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&columnID=' + columnID), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- if(kanban.object && kanban.object != 'cards' && vision != 'lite') items.push({className: 'parentDivider'});
- if(kanban.object && kanban.object != 'cards' && vision != 'lite') items.push({label: kanbanLang.importAB, className: 'import'});
-
- return items;
-}
-
-/** Calculate column height */
-function calcColHeight(col, lane, colCards, colHeight, kanban)
-{
- if(!isMultiLanes) return 0;
-
- var options = kanban.options;
-
- var fontSize = 13;
- var moreLabelHeight = 20;
- var laneNameHeight = lane.name.length * fontSize;
-
- if(!options.displayCards) return laneNameHeight > colHeight ? laneNameHeight + 2 * moreLabelHeight : colHeight;
- var displayCards = +(options.displayCards || 2);
-
- if (typeof displayCards !== 'number' || displayCards < 2) displayCards = 2;
- return (displayCards * (options.cardHeight + options.cardSpace) + options.cardSpace);
-}
-
-/** Handle sort cards */
-function handleSortCards(event)
-{
- var newLaneID = event.element.closest('.kanban-lane').data('id');
- var newColID = event.element.closest('.kanban-col').data('id');
- var cards = event.element.closest('.kanban-lane-items').data('cards');
- var orders = cards.map(function(card){return card.id});
- var fromID = String(event.element.data('id'));
- var toID = String(event.target.data('id'));
-
- orders.splice(orders.indexOf(fromID), 1);
- orders.splice(orders.indexOf(toID) + (event.insert === 'before' ? 0 : 1), 0, fromID);
-
- var url = createLink('kanban', 'sortCard', 'kanbanID=' + kanbanID + '&laneID=' + newLaneID + '&columnID=' + newColID + '&cards=' + orders.join(','));
- $.getJSON(url, function(response)
- {
- if(response.result === 'fail')
- {
- if(typeof response.message === 'string' && response.message.length)
- {
- bootbox.alert(response.message);
- }
- setTimeout(function(){return location.reload()}, 3000);
- }
- });
-}
-
-/* Define menu creators */
-window.menuCreators =
-{
- card: createCardMenu,
- lane: createLaneMenu,
- column: createColumnMenu,
- columnCreate: createColumnCreateMenu
-};
-
-/**
- * init Kanban
- */
-function initKanban($kanban)
-{
- var id = $kanban.data('id');
- var region = regions[id];
- var cardHeight = kanbanInfo.performable == 1 ? 87 : 60;
-
- $kanban.kanban(
- {
- data: region.groups,
- maxColHeight: 510,
- calcColHeight: calcColHeight,
- fluidBoardWidth: fluidBoard,
- minColWidth: typeof window.minColWidth === 'number' ? window.minColWidth : defaultMinColWidth,
- maxColWidth: typeof window.maxColWidth === 'number' ? window.maxColWidth : defaultMaxColWidth,
- cardHeight: cardHeight,
- displayCards: typeof window.displayCards === 'number' ? window.displayCards : 2,
- createColumnText: kanbanLang.createColumn,
- addItemText: '',
- itemRender: renderKanbanItem,
- onAction: handleKanbanAction,
- onRenderKanban: adjustAddBtnPosition,
- onRenderLaneName: renderLaneName,
- onRenderHeaderCol: renderHeaderCol,
- onRenderCount: renderCount,
- showCount: kanban.showWIP == '1' ? true : false,
- sortable: handleSortCards,
- virtualize: true,
- virtualRenderOptions: {container: $(window).add($('#kanbanContainer'))},
- virtualCardList: true,
- droppable:
- {
- target: findDropColumns,
- finish: handleFinishDrop
- },
- });
-
- $kanban.on('click', '.action-cancel', hideKanbanAction);
- $kanban.on('scroll', function()
- {
- $.zui.ContextMenu.hide();
- });
- var kanbanMinColWidth = typeof window.minColWidth === 'number' ? window.minColWidth : defaultMinColWidth;
- if(kanbanMinColWidth < 190)
- {
- var miniColWidth = kanbanMinColWidth * 0.2;
- $('.kanban-header-col>.title>span:not(.text)').hide();
- $('.kanban-header-col>.title > span.text').css('max-width', miniColWidth + 'px');
- }
-}
-
-/**
- * Init when page ready
- */
-$(function()
-{
- $(document).find('main#main').css('padding-top', '16px');
-
- window.isMultiLanes = laneCount > 1;
-
- $.cookie('isFullScreen', 0);
-
- /* Init first kanban */
- $('.kanban').each(function()
- {
- initKanban($(this));
- });
-
- if(navigator.userAgent.toLowerCase().indexOf("qqbrowser") > -1) $('.region .kanban-header-col > .actions').css('top', '30%');
-
- $('.icon-angle-top,.icon-angle-down').on('click', function()
- {
- $(this).toggleClass('icon-angle-top icon-angle-down');
- $(this).parents('.region').find('.kanban').toggle();
- hideKanbanAction();
- resetRegionHeight($(this).hasClass('icon-angle-top') ? 'open' : 'close');
- });
-
- $('#regionTabs, .region-header').on('click', '.action', hideKanbanAction);
- $('#TRAction').on('click', '.btn', hideKanbanAction);
-
- /* Hide action box when user click document */
- $(document).on('click', function(e)
- {
- $('.kanban').each(function()
- {
- var currentAction = $(this).kanban().attr('data-action-enabled');
- var canHideAction = (currentAction === 'headerMore' || currentAction === 'editLaneName')
- && !$(e.target).closest('.action,.action-box').length;
- if(canHideAction) hideKanbanAction();
- });
- });
-
- /* Init contextmenu */
- $('#kanban').on('click', '[data-contextmenu]', function(event)
- {
- var $trigger = $(this);
- var menuType = $trigger.data('contextmenu');
- var menuCreator = window.menuCreators[menuType];
- if(!menuCreator) return;
-
- var options = $.extend({event: event, $trigger: $trigger}, $trigger.data());
- var items = menuCreator(options);
- if(!items || !items.length) return;
-
- $.zui.ContextMenu.show(items, items.$options || {event: event});
-
- $('.parentDivider').parent().addClass('divider');
- $('.import').parent().addClass('dropdown-submenu top');
-
- var regionID = $(this).closest('.kanban').data('id');
- var groupID = $(this).closest('.kanban-board').data('id');
- var columnID = $(this).closest('.kanban-col').data('id');
-
- /* The submenu of import. */
- var importPlanLink = kanban.object.indexOf('plans') != -1 ? "
" + kanbanLang.importPlan + '' : '';
- var importReleaseLink = kanban.object.indexOf('releases') != -1 ? "
" + kanbanLang.importRelease + '' : '';
- var importExecutionLink = kanban.object.indexOf('executions') != -1 ? "
" + kanbanLang.importExecution + '' : '';
- var importBuildLink = kanban.object.indexOf('builds') != -1 ? "
" + kanbanLang.importBuild + '' : '';
- var importTicketLink = kanban.object.indexOf('tickets') != -1 ? "
" + kanbanLang.importTicket + '' : '';
- var importSubmenu = '';
- $('.import').parent().append(importSubmenu);
-
- });
-
- /* Adjust the add button position on window resize */
- $(window).on('resize', function(a)
- {
- adjustAddBtnPosition();
- initRegionTabs();
- });
-
- resetLaneHeight();
-
- /* Hide contextmenu when page scroll */
- $(window).on('scroll', function()
- {
- $.zui.ContextMenu.hide();
- if($('#regionTabs').length > 0) updateRegionTabAffixState();
- });
-
- $(document).on('click', '#splitTable .btn-plus', function()
- {
- var tr = $(this).closest('tr');
- tr.after($('#childTpl').html().replace(/key/g, key));
- tr.next().find('input[name^=color]').colorPicker();
- key++;
- processMinusBtn();
- return false;
- });
-
- /* Remove a trade detail item. */
- $(document).on('click', '#splitTable .btn-close', function()
- {
- $(this).closest('tr').remove();
- processMinusBtn();
- return false;
- });
-
- /* Modify default color's border color. */
- $(document).on('mouseout', '.color0', function()
- {
- $('.color0 .cardcolor').css('border', '1px solid #b0b0b0');
- });
-
- /* Modify default color's border color. */
- $(document).on('mouseover', '.color0', function()
- {
- $('.color0 .cardcolor').css('border', '1px solid #fff');
- });
-
- /* Init sortable */
- initSortable();
-
- resetRegionHeight('open');
- if(!CRKanban && kanbanInfo.status == 'closed') $('.kanban-col.kanban-header-col').css('padding', '0px 0px 0px 0px');
-
- setToolTip();
-
- distance = 0;
- radiusWidth = 10;
- initRegionTabs();
-
- $('.leftBtn').click(function()
- {
- if($(this).hasClass('disabled')) return;
- swipeRegionNavTabs($('#regionNavTabs').find('ul'), 'left');
- });
-
- $('.rightBtn').click(function()
- {
- if($(this).hasClass('disabled')) return;
- swipeRegionNavTabs($('#regionNavTabs').find('ul'), 'right');
- });
-
- if(Object.values(regions).length <= 1) $('#kanbanBox').removeClass('hidden');
-});
-
-/**
- * Init sortable.
- *
- * @access public
- * @return void
- */
-function initSortable()
-{
- var sortType = '';
- var $cards = null;
- if(!CRKanban && kanbanInfo.status == 'closed') return;
- $('#kanban').sortable(
- {
- selector: '.region, .kanban-board, .kanban-lane, .kanban-col',
- trigger: '.region.sort > .region-header, .kanban-board.sort > .kanban-header > .kanban-group-header, .kanban-lane.sort > .kanban-lane-name, .kanban-header-col.sort',
- dropOnMouseleave: true,
- container: function($ele)
- {
- return $ele.parent();
- },
- targetSelector: function($ele)
- {
- var $parent = $ele.parent();
- /* Sort regions. */
- if($ele.hasClass('region'))
- {
- sortType = 'region';
- return $parent.children('.region');
- }
-
- /* Sort boards. */
- if($ele.hasClass('kanban-board'))
- {
- sortType = 'board';
- return $parent.children('.kanban-board');
- }
-
- /* Sort lanes. */
- if($ele.hasClass('kanban-lane'))
- {
- sortType = 'lane';
- $cards = $ele.find('.kanban-item');
-
- return $parent.children('.kanban-lane');
- }
-
- /* Sort columns. */
- if($ele.hasClass('kanban-col'))
- {
- sortType = 'column';
- return $parent.children('.kanban-col');
- }
- },
- before: function() {
- return !window.sortableDisabled;
- },
- start: function(e)
- {
- if(sortType == 'region')
- {
- showRegionIdList = '';
- $('.icon-angle-top').each(function()
- {
- showRegionIdList += $(this).attr('data-id') + ',';
- $(this).attr('class', 'icon-angle-down');
- });
-
- $('.region').find('.kanban').hide();
- hideKanbanAction();
- }
- else if(sortType === 'column')
- {
- e.element.closest('.kanban-board').addClass('kanban-cols-sorting');
- }
- $('#kanban').attr('data-sort-by', sortType);
- },
- finish: function(e)
- {
- if(!e.changed) return;
-
- var url = '';
- var orders = [];
- var regionID = '';
-
- if(sortType == 'region')
- {
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('region') && data.item.hasClass('sort')) orders.push(data.item.data('id'));
- });
-
- $('.region').each(function()
- {
- if(showRegionIdList.includes($(this).attr('data-id')))
- {
- $(this).find('.icon-angle-down').attr('class', 'icon-angle-top');
- $(this).find('.kanban').show();
- }
- })
-
- url = createLink('kanban', 'sortRegion', 'regions=' + orders.join(','));
- }
- else if(sortType == 'board')
- {
- regionID = e.element.closest('.region').data('id');
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('kanban-board') && data.item.hasClass('sort') && regionID == data.item.parent().data().id) orders.push(data.item.data('id'));
- });
-
- url = createLink('kanban', 'sortGroup', 'region=' + regionID + '&groups=' + orders.join(','));
- }
- else if(sortType == 'lane')
- {
- var groupID = e.element.closest('.kanban-board').data('id');
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('kanban-lane') && data.item.hasClass('sort') && groupID == data.item.data().lane.group) orders.push(data.item.data('id'));
- });
-
- regionID = e.element.closest('.region').data('id');
- url = createLink('kanban', 'sortLane', 'region=' + regionID + '&lanes=' + orders.join(','));
- }
- else if(sortType == 'column')
- {
- var groupID = e.element.closest('.kanban-board').data('id');
- e.list.each(function(index, data)
- {
- if(data.item.hasClass('kanban-col') && (data.item.hasClass('sort') || data.item.children().hasClass('sort')) && groupID == data.item.data().col.group) orders.push(data.item.data('id'));
- });
-
- regionID = e.element.closest('.region').data('id');
- url = createLink('kanban', 'sortColumn', 'region=' + regionID + '&kanbanID=' + kanban.id + '&columns=' + orders.join(','));
- }
- if(!url) return true;
-
- $.getJSON(url, function(response)
- {
- if(response.result == 'fail')
- {
- if(typeof response.message === 'string' && response.message.length)
- {
- bootbox.alert(response.message);
- }
- setTimeout(function(){return location.reload()}, 3000);
- }
- else if (sortType == 'column')
- {
- updateRegion(regionID, response[regionID]);
- }
- });
- },
- always: function(e)
- {
- if(sortType == 'lane') $cards.show();
- $('#kanban').find('.kanban-cols-sorting').removeClass('kanban-cols-sorting');
- }
- });
-}
-
-/**
- * Reset region height according to window height.
- *
- * @param string fold
- * @access public
- * @return void
- */
-function resetRegionHeight(fold)
-{
- var regionCount = 0;
- if($.isEmptyObject(regions)) return false;
- for(var i in regions)
- {
- regionCount += 1;
- if(regionCount > 1) return false;
- }
-
- var regionID = Object.keys(regions)[0];
- var region = regions[regionID].groups;
- var groupCount = 0;
-
- if($.isEmptyObject(region)) return false;
- for(var j in region)
- {
- groupCount += 1;
- if(groupCount > 1) return false;
- }
-
- var group = region[0];
- var laneCount = 0;
-
- if($.isEmptyObject(group.lanes)) return false;
- for(var h in group.lanes)
- {
- laneCount += 1;
- if(laneCount > 1) return false;
- }
-
- var regionHeaderHeight = $('.region-header').outerHeight();
- if(fold == 'open')
- {
- var windowHeight = $(window).height();
- var headerHeight = $('#mainHeader').outerHeight();
- var mainPadding = $('#main').css('padding-top');
- var panelBorder = $('.panel').css('border-top-width');
- var bodyPadding = $('.panel-body').css('padding-top');
- var height = windowHeight - (parseInt(mainPadding) * 2) - (parseInt(bodyPadding) * 2) - headerHeight - (parseInt(panelBorder) * 2);
- var regionPadding = $('.kanban').css('padding-bottom');
- var columnHeight = $('.kanban-header').outerHeight();
-
- $('.region').css('min-height', height);
- $('.kanban-lane').css('height', height - regionHeaderHeight - parseInt(regionPadding) - columnHeight);
- }
- else
- {
- $('.region').css('height', regionHeaderHeight);
- }
-}
-
-$(document).on('click', '.dropdown-menu', function()
-{
- $.zui.ContextMenu.hide();
-});
-
-/**
- * Alerts for exceeding the limit.
- *
- * @access public
- * @return void
- */
-function setToolTip()
-{
- $('[data-toggle="tooltip"]').tooltip({container: 'body'});
-}
-
-/**
- * Update kanban affix state for all boards in page.
- *
- * @access public
- * @return void
- */
-function updateRegionTabAffixState()
-{
- var $kanbanContainer = $('#kanbanContainer');
- var kanbanContainer = $kanbanContainer[0].getBoundingClientRect();
- var $regionTabs = $('#regionTabs');
- var regionTabs = $regionTabs[0].getBoundingClientRect();
- if(regionTabs.top <= 0 && !$regionTabs.hasClass('affixed'))
- {
- $regionTabs.addClass('affixed');
- if( kanbanContainer.top > 0) $regionTabs.find('#region-tab-actions').addClass('hidden');
- }
- else if($regionTabs.hasClass('affixed') && kanbanContainer.top > 44)
- {
- $regionTabs.removeClass('affixed');
- $regionTabs.find('#region-tab-actions').removeClass('hidden');
- }
-
- initRegionTabs();
-}
-
-/**
- * Swipe region navigation tabs.
- *
- * @param object $object
- * @param string $direction
- * @access public
- * @return bool
- */
-function swipeRegionNavTabs($object, direction)
-{
- var $regionNavTabs = $('#regionNavTabs');
- var offsetWidth = $regionNavTabs[0].offsetWidth;
- var objectWidth = $object[0].offsetWidth;
-
- $object.find('li').each(function()
- {
- /* Get the offset of the item. */
- var $item = $(this);
- var itemLeft = $item[0].offsetLeft;
- var itemWidth = $item[0].offsetWidth;
- var itemOffset = itemLeft + itemWidth;
- var radius = $item.hasClass('active') ? radiusWidth : 0;
-
- /* Calculate the offset after sliding. */
- if(direction == 'left' && (itemOffset + distance + radius) >= -5)
- {
- /* If you swipe left, the distance is equal to the item's left. */
- distance = - itemLeft + radius - ($item.prev().hasClass('active') ? radiusWidth : 0);
- /* tab overlap width */
- distance += 20;
- if($item.prev().length == 0)
- {
- distance = 0;
- $('.leftBtn').addClass('disabled');
- }
- $object[0].style.transform = 'translateX(' + distance + 'px)';
-
- /* If the width of regionNavTabs plus offsetWidth is less than the width of object, change rightBtn to clickable. */
- if(offsetWidth - distance < objectWidth) $('.rightBtn').removeClass('disabled');
- return false;
- }
-
- var nextRadius = $item.next().hasClass('active') ? radiusWidth : 0;
- if(direction == 'right' && itemOffset > (offsetWidth - distance + nextRadius + radiusWidth * 2))
- {
- /* If you swipe right, the distance is equal to the left distance of item plus the width of item minus the width of the regionNavTabs. */
- distance = offsetWidth - itemOffset - radius + nextRadius - radiusWidth * 2;
- distance += 20;
- if($item.next().length == 0)
- {
- distance = - objectWidth + offsetWidth - radiusWidth * 2;
- $('.rightBtn').addClass('disabled');
- }
- $object[0].style.transform = 'translateX(' + distance + 'px)';
-
- /* If distance is less than 0, change leftBtn to clickable. */
- if(distance < 0) $('.leftBtn').removeClass('disabled');
- return false;
- }
- });
-}
-
-/**
- * Init region tabs.
- *
- * @access public
- * @return void
- */
-function initRegionTabs()
-{
- var $regionNavTabs = $('#regionNavTabs');
- if($regionNavTabs.length == 0) return;
-
- /* Set the width of regionTab. */
- $('#regionTabs').width($('#kanban').outerWidth());
-
- var regionTabsWidth = $regionNavTabs[0].offsetWidth;
- var regionTabULWidth = $regionNavTabs.find('ul')[0].offsetWidth;
- var $acitiveItem = $('#regionNavTabs > ul > li.active');
- var acitiveItemWidth = $acitiveItem[0].offsetWidth;
- var acitiveItemLeft = $acitiveItem[0].offsetLeft;
-
- /* Print left and right button. */
- if(regionTabULWidth > regionTabsWidth) $('.leftBtn, .rightBtn').removeClass('hidden');
-
- if(acitiveItemLeft + distance < 0)
- {
- distance = - acitiveItemLeft;
- distance += 20;
- if($acitiveItem.prev().length == 0)
- {
- distance = 0;
- $('.leftBtn').addClass('disabled');
- }
- $('#regionNavTabs > ul')[0].style.transform = 'translateX(' + distance + 'px)';
- }
- else if(acitiveItemWidth + acitiveItemLeft + distance + radiusWidth * 2 > regionTabsWidth && acitiveItemLeft != 0 && acitiveItemWidth != 0)
- {
- distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft + (distance != 0 ? - radiusWidth * 2 : radiusWidth);
- distance += 20;
- if($acitiveItem.next().length == 0)
- {
- distance = regionTabsWidth - acitiveItemWidth - acitiveItemLeft - radiusWidth * 2;
- $('.rightBtn').addClass('disabled');
- }
- $('#regionNavTabs > ul')[0].style.transform = 'translateX(' + distance + 'px)';
- }
-
- if(distance < 0) $('#regionTabs').find('.leftBtn').removeClass('disabled');
- if($acitiveItem.next().length != 0 && regionTabULWidth > regionTabsWidth) $('#regionTabs').find('.rightBtn').removeClass('disabled');
- $('#kanbanBox').removeClass('hidden');
-}
-
-$('[data-tab]').on('shown.zui.tab', function(e)
-{
- /* Init vars. */
- var $current = $(e.target);
- var $prev = $(e.relatedTarget);
- var $regionActions = $('#region-tab-actions');
- var $regions = $('.region');
- var contentID = $current.attr('href');
- var regionID = $current.parent().attr('data-id');
- var hasActions = $regionActions.hasClass('active');
-
- /* Highlight the currently selected tab. */
- $current.addClass('btn-active-text');
- $current.parent().addClass('active');
- $prev.removeClass('btn-active-text');
- $prev.parent().removeClass('active');
-
- /* Dynamic display and hidden of regions. */
- if(contentID == 'all')
- {
- $regions.addClass('active').removeClass('notAll');
- if(hasActions) $regionActions.removeClass('active');
- $regions.each(function()
- {
- var isFold = $(this).find('.region-header i').hasClass('icon-angle-down');
- if(isFold) $(this).find('.kanban').css('display', 'none');
- });
- }
- else
- {
- var $currentRegion = $(contentID);
- $regions.removeClass('active');
- $currentRegion.addClass('active notAll');
- $currentRegion.find('.kanban').css('display', 'block');
- if(!hasActions) $regionActions.addClass('active');
-
- /* Replace the link of the region actions button with the ID of the current region. */
- $regionActions.find('li').each(function()
- {
- if($(this).hasClass('editRegion')) $(this).find('a').attr('href', createLink('kanban', 'editRegion', 'regionID=' + regionID, '', true));
- if($(this).hasClass('createLane')) $(this).find('a').attr('href', createLink('kanban', 'createLane', 'kanbanID=' + kanbanID + '®ionID=' + regionID, '', true));
- if($(this).hasClass('deleteRegion')) $(this).find('a').attr('href', createLink('kanban', 'deleteRegion', 'regionID=' + regionID));
- if($(this).hasClass('archivedCard')) $(this).find('a').attr('href', "javascript:loadMore(\"Card\", " + regionID + ')');
- if($(this).hasClass('archivedColumn')) $(this).find('a').attr('href', "javascript:loadMore(\"Column\", " + regionID + ')');
- });
- }
- window.scrollTo(0, 0);
-
- /* To manually refresh stay under the current tab, save the ID of the current region. */
- var url = createLink('kanban', 'ajaxSaveRegionID', 'regionID=' + regionID);
- $.get(url);
-});
diff --git a/module/mail/css/test.css b/module/mail/css/test.css
deleted file mode 100644
index 0641311ed1..0000000000
--- a/module/mail/css/test.css
+++ /dev/null
@@ -1,2 +0,0 @@
-#resultWin {width: 100%; height: 230px; border: none;}
-div .f-right {font-weight: normal; color: red; padding-left: 5px;}
diff --git a/module/mail/js/detect.js b/module/mail/js/detect.js
deleted file mode 100644
index 06cfea9964..0000000000
--- a/module/mail/js/detect.js
+++ /dev/null
@@ -1,4 +0,0 @@
-$(document).ready()
-{
- $('#fromAddress').focus();
-}
diff --git a/module/mail/js/edit.js b/module/mail/js/edit.js
deleted file mode 100644
index 5d6d8bd632..0000000000
--- a/module/mail/js/edit.js
+++ /dev/null
@@ -1,5 +0,0 @@
-$(document).ready()
-{
- $('#fromAddress').focus();
- if($('#fromAddress').val() != '')$('#password').focus();
-}
diff --git a/module/message/css/setting.css b/module/message/css/setting.css
deleted file mode 100644
index 86c0394948..0000000000
--- a/module/message/css/setting.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.checkbox-primary + .checkbox-primary {margin: 0px;}
-.checkbox-primary {margin: 0px; width: 120px; float: left;}
-.checkbox-primary label {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
-div.chosen-container + select + div.chosen-container > .chosen-choices {border-top: 0px;}
diff --git a/module/message/js/setting.js b/module/message/js/setting.js
deleted file mode 100644
index 25772dcf17..0000000000
--- a/module/message/js/setting.js
+++ /dev/null
@@ -1,33 +0,0 @@
-$(function()
-{
- $('.objectType').click(function()
- {
- if($(this).prop('checked'))
- {
- $(this).closest('tr').find(':checkbox').prop('checked', true);
- }
- else
- {
- $(this).closest('tr').find(':checkbox').prop('checked', false);
- }
- });
-
- $('.messageType').click(function()
- {
- var index = $(this).closest('th').index();
- if($(this).prop('checked'))
- {
- $(this).closest('table').find('tbody').find('tr').each(function()
- {
- $(this).find('td').eq(index).find(':checkbox').prop('checked', true);
- })
- }
- else
- {
- $(this).closest('table').find('tbody').find('tr').each(function()
- {
- $(this).find('td').eq(index).find(':checkbox').prop('checked', false);
- })
- }
- });
-});
diff --git a/module/misc/css/about.css b/module/misc/css/about.css
deleted file mode 100644
index 2c7989384f..0000000000
--- a/module/misc/css/about.css
+++ /dev/null
@@ -1,7 +0,0 @@
-#mainContent {padding-top: 50px !important;}
-#mainContent .main-header {display: none;}
-#mainContent .copyright {line-height: 20px;}
-#mainContent .copyright a {vertical-align: baseline;}
-#zentaoLinks .panel .panel-heading {padding: 6px 10px;}
-
-.zt-logo {width: 145px;}
diff --git a/module/misc/css/changelog.css b/module/misc/css/changelog.css
deleted file mode 100644
index 74d386df71..0000000000
--- a/module/misc/css/changelog.css
+++ /dev/null
@@ -1,17 +0,0 @@
-#versionMenu {margin-left: 20px;}
-#versionMenu .dropdown-menu {min-width: 130px; max-height: 180px; overflow-y: auto;}
-
-#mainContent {min-height: 240px;}
-#featureList {padding: 0 10px;}
-#featureList > .item {padding: 0 0 10px 0;}
-#featureList > .item > h3 {color: #114f8e; font-size: 16px; margin: 0; padding: 10px 0;}
-#featureList > .item > .desc {color: #666; padding-left: 18px;}
-#featureList > .item > .more-link {color: #666; padding-left: 18px;}
-#featureList > .item > .more {display: none;}
-#featureList + #details {padding: 0;}
-#details .details-list {display: none; padding: 10px; background: #f1f1f1; border-radius: 4px;}
-#details.show-details .details-list {display: block;}
-#details > .btn > .icon-angle-right {transition: transform .2s; display: inline-block;}
-#details.show-details > .btn > .icon-angle-right {transform: rotate(90deg);}
-#details.show-details > .btn:focus {border-radius: 4px 4px 0 0;}
-#details.show-details > .btn:focus + .details-list {border-radius: 0 0 4px 4px;}
diff --git a/module/mr/css/browse.css b/module/mr/css/browse.css
deleted file mode 100644
index edb89a5bf2..0000000000
--- a/module/mr/css/browse.css
+++ /dev/null
@@ -1,21 +0,0 @@
-#repoList .tree li {padding: 0 0 0 10px;}
-#repoList .hide-in-search .hidden {display: block !important; visibility: inherit !important;}
-#dropMenuRepo > div.table-row > div > div > ul > li > div {padding-left: 20px;}
-#repoList li > a.selected {color: #3123ae !important; background: #f2eafc !important; line-height: 20px; border-radius: 5px;}
-#repoList .tree li.has-list.open:before {border-left: 0px;}
-#repoList ul.tree-angles {margin-bottom: 0;}
-#repoList {margin: 0;}
-#repoList .tree > li {padding: 2px;}
-#repoList a:focus, #repoList a:hover {color: #0c64eb; text-decoration: none;}
-#repoList > ul > li > ul > li > a:hover {color: white; background-color: #0c64eb; text-decoration: none;}
-#repoList .tree li > a {max-width: 100%;}
-#repoList .hide-in-search .hidden {display: block !important; visibility: inherit !important;}
-#repoList .tree li > a {line-height: 20px; border-radius: 2px;}
-
-.c-id {width: 60px;}
-.c-title {width: 150px;}
-.c-branch {width: 200px;}
-.c-status {width: 120px;}
-.c-author {width: 80px;}
-.c-date {width: 100px;}
-[lang^='zh-'] .c-status {width: 100px;}
diff --git a/module/mr/css/create.css b/module/mr/css/create.css
deleted file mode 100644
index 4760929b38..0000000000
--- a/module/mr/css/create.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#mrForm table tbody th {width: 145px;}
-.branch-btn {width: 105px; height: 32px; line-height: 22px; float: right; text-align: left;}
-[lang^='zh-'] .branch-btn {width: 70px;}
diff --git a/module/mr/css/diff.css b/module/mr/css/diff.css
deleted file mode 100644
index 392d2b93b6..0000000000
--- a/module/mr/css/diff.css
+++ /dev/null
@@ -1,73 +0,0 @@
-body {padding-bottom: 0px;}
-.w-code {width: 48%; word-break: break-all;}
-td.code {color: #484848; padding: 0px 3px; white-space: pre-wrap;}
-.none {background: #EAF2F5;}
-table.diff {margin-bottom: 0px;}
-.diff caption {border: 1px solid #e4e4e4; background: #edf3fe; margin: 0; padding: 6px 2px 6px 10px; text-align: left; font-weight: bold; font-size: 13px;}
-.diff th, .diff td {border: none;}
-.diff th {padding-top: 2px; padding-bottom: 2px;}
-.diff .line-new, .diff .line-new {background: #CFC;}
-.diff .line-old, .diff .line-old {background: #FCC;}
-.diff .line-all, .diff .line-all {background: #FFF;}
-.diff .w-num {width: 25px; border-right: 1px solid #E4E4E4; background: #fafafa; border-left: 1px solid #E4E4E4; color: #999; font-weight: normal;}
-
-.repoCode .diff tr .comment-btn .icon-wrapper {left: -30px;}
-.repoCode .diff tr.over td.line-all, .repoCode .diff tr.over td.line-all {background: #f8eec7;}
-.repoCode .diff tr.over td.line-new, .repoCode .diff tr.over td.line-new {background: #8eff8e;}
-.repoCode .diff tr.over td.line-old, .repoCode .diff tr.over td.line-old {background: #f6b2b2;}
-
-.repoCode form > .btn {margin-right: 10px;}
-.label-exchange {background-color: #566F7C; cursor: pointer;}
-.label-exchange i {padding: 0;}
-.btn-download {border-right: none;}
-.body-modal #back {display: none;}
-
-.repoCode td.code {white-space: inherit;}
-.repoCode .content, .repoCode .btn {background-color: #F4F5F7; border: none;}
-.repoCode .nav-tabs > li.active > a:before {background: none; height: 0;}
-
-#fileTabs .tab-pane {display: none;}
-#fileTabs .tab-pane.active {display: block;}
-#fileTabs .tab-nav-item {max-width: none !important;}
-#fileTabs > .tabs-navbar {overflow: hidden; padding-bottom: 10px; position: relative; height: 35px;}
-#fileTabs > .tabs-navbar > .nav-tabs {position: absolute; display: flex;}
-#filesTree #modules {margin-top: 5px;}
-#filesTree {overflow-y: auto;}
-
-#fileTree li {padding: 0 0 0 8px;}
-#fileTree li.has-list {padding-left: 20px;}
-#fileTree li > a {display: block; padding: 6px 0; border-radius: 2px; padding-left: 6px; height: 30px; text-decoration: none;}
-#fileTree li > a > span {display: inline-block;}
-#fileTree li > a > span + span {margin-left: 8px;}
-#fileTree li.selected > a {background-color: #E8F3FC;}
-#fileTree li.selected > a > span.title {color: #006AF1;}
-#fileTree .label-id {border-color: #cbd0db; color: #7d8599}
-#fileTree .label.label-type {background: #fff; border: 1px solid #7d8599; color:#7d8599}
-
-#fileTree li > a > span.title {color: #3C4353; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
-#fileTree li > a > span.user {color: #838a9d;}
-#fileTree li > a > span.user > .icon-person {font-size: 14px; position: relative; top: -1px; color: #a6aab8}
-#fileTree li > a:first-child {padding-left: 18px;}
-#fileTree li a.selected {color: #e9f2fb; background-color: #0c64eb;}
-
-#fileTree li > .list-toggle {transform: rotate(0deg); width: 16px; height: 16px; border: 4px solid #a6aab8; border-radius: 2px; top: 7px;}
-#fileTree li > .list-toggle:before {content: ' '; display: block; position: absolute; border: 1px solid #a6aab8; top: 2px; left: -3px; right: -3px; bottom: 2px; min-width: 0; transition: all .2s;}
-#fileTree li > .list-toggle:hover:before, #fileTree li > .list-toggle:hover {border-color: #006AF1;}
-#fileTree li.open > .list-toggle {width: 12px; height: 12px; top: 9px; background-color: #a6aab8; border-width: 3px; left: 3px;}
-#fileTree li.open > .list-toggle:before {border: none; height: 2px; width: 6px; left: 0; top: 2px; background: #fff;}
-#fileTree li.open > .list-toggle:hover {background: #006AF1;}
-
-#fileTree ul > li:after {display: block; position: absolute; content: ' '; border-top: 1px dashed #cbd0db; top: 14px; left: -12px; z-index: 1; width: 10px;}
-#fileTree ul > li:before, #fileTree ul > li.has-list:before {background: none; content: ' '; display: block; position: absolute; width: auto; height: auto; border: none; border-left: 1px dashed #cbd0db; top: -13px; bottom: 12px; left: -12px;}
-#fileTree ul > li:last-child:before {bottom: auto; height: 29px;}
-#fileTree ul > li:first-child:before {top: -9px;}
-#fileTree ul > li.has-list:first-child:before {top: -13px;}
-#fileTree ul > li.tree-single-item:before {height: 23px;}
-#fileTree ul > li.has-list:after {width: 14px;}
-
-#modules li {padding: 5px 0 0 15px;}
-.file-tree #modules .icon {color: #9EA3B0;}
-.file-tree #modules .icon-folder {padding-left: 5px;}
-li.selected .doc-title .icon, li.selected .doc-title a {color: #438EFF !important;}
-
-.btn-left, .btn-right {display: none;}
diff --git a/module/mr/css/edit.css b/module/mr/css/edit.css
deleted file mode 100644
index 7176c78083..0000000000
--- a/module/mr/css/edit.css
+++ /dev/null
@@ -1 +0,0 @@
-#mrForm table tbody th {width: 145px;}
diff --git a/module/mr/css/link.css b/module/mr/css/link.css
deleted file mode 100644
index 5cded22bcf..0000000000
--- a/module/mr/css/link.css
+++ /dev/null
@@ -1,26 +0,0 @@
-#storyList th {border: none;}
-#bugList th {border: none;}
-#taskList th {border: none;}
-.hide-side .col-main {width: 100%;}
-.hide-side .col-side .main-side {width: 0; display: none;}
-
-.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
-.dropdown-menu > .menu-search .input-group {width: 100%;}
-.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666;}
-.dropdown-menu > .menu-search .form-control {border: none !important; box-shadow: none !important; border-top: 1px solid #ddd !important;}
-.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
-.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
-.dropdown-list > li > a:hover,
-.dropdown-list > li > a:focus {color: #1a4f85; text-decoration: none; background-color: #ddd;}
-
-.checkbox.btn {margin-top: 0px;}
-
-.linkBox #queryBox .search-form .form-actions {padding-bottom: 5px;}
-.linkBox .table-header {padding: 8px 15px; border-bottom: 1px solid #cbd0db;}
-#unlinkStoryList, #unlinkBugList, #unlinkTaskList{border-top: 1px solid #cbd0db;}
-.fixed-footer .text {color: #fff;}
-ol, ul {padding-left: 20px;}
-#tabsNav .tab-pane>.main-table {border-radius: 0;}
-.body-modal #mainMenu>.btn-toolbar {width: auto;}
-.body-modal #mainContent {min-height: 240px;}
-.body-modal #mainMenu>.btn-toolbar .page-title>.text {overflow: visible}
\ No newline at end of file
diff --git a/module/mr/css/view.css b/module/mr/css/view.css
deleted file mode 100644
index 3e38664325..0000000000
--- a/module/mr/css/view.css
+++ /dev/null
@@ -1,13 +0,0 @@
-#legendStories ul li, #legendBugs ul li, #legendTasks ul li {padding: 10px 0 0 12px; line-height: 20px;}
-.side-col .cell {padding: 0px;}
-.table-content tbody tr th{padding-left: 0; font-weight: 400; color: #838a9d; text-align: right; vertical-align: middle; border:none;}
-.table-content tbody tr td{border:none;}
-.table-content thead tr th{text-align: left; vertical-align: middle; border:none;}
-.detail-content{margin-top:0;}
-.main-row .cell {
- border: 1px solid #efefef;
- -webkit-box-shadow: 0 1px 1px rgba(0,0,0,.05),0 2px 6px 0 rgba(0,0,0,.045);
- box-shadow: 0 1px 1px rgba(0,0,0,.05),0 2px 6px 0 rgba(0,0,0,.045)
-}
-.side-col{padding-top:5px;}
-.detail-content .btn-active-text {padding-top: 5px;}
diff --git a/module/mr/js/create.js b/module/mr/js/create.js
deleted file mode 100644
index 1d7300720a..0000000000
--- a/module/mr/js/create.js
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Urlencode param.
- *
- * @param param $param
- * @access public
- * @return string
- */
-function urlencode(param)
-{
- var hostID = $('#hostID').val();
- if(hosts[hostID].type != 'gitlab') return Base64.encode(encodeURIComponent(param));
-
- return param;
-}
-
-/**
- * Get branch priv.
- *
- * @param int|string $project
- * @access public
- * @return void
- */
-function getBranchPriv(project)
-{
- var hostID = $('#hostID').val();
- var branchUrl = createLink('mr', 'ajaxGetBranchPrivs', "hostID=" + hostID + "&project=" + project);
- $.get(branchUrl, function(response)
- {
- branchPrivs = eval('(' + response + ')');
- });
-}
-
-$(function()
-{
- $('#sourceProject,#targetProject').change(function()
- {
- var hostID = $('#hostID').val();
- var sourceProject = urlencode($(this).val());
- if(!sourceProject) return false;
-
- var branchSelect = $(this).parents('td').find('select[name*=Branch]');
- var branchUrl = createLink(hosts[hostID].type, 'ajaxGetProjectBranches', hosts[hostID].type + "ID=" + hostID + "&projectID=" + sourceProject);
- $.get(branchUrl, function(response)
- {
- branchSelect.html('').append(response);
- branchSelect.chosen().trigger("chosen:updated");;
- });
-
- });
-
- $('#sourceProject').change(function()
- {
- $('#sourceBranch,#targetProject,#targetBranch').empty();
- $('#sourceBranch,#targetProject,#targetBranch').chosen().trigger("chosen:updated");;
-
- var hostID = $('#hostID').val();
- var sourceProject = urlencode($(this).val());
- if(!sourceProject) return false;
-
- var projectUrl = createLink('mr', 'ajaxGetMRTargetProjects', "hostID=" + hostID + "&projectID=" + sourceProject + "&scm=" + hosts[hostID].type);
- $.get(projectUrl, function(response)
- {
- $('#targetProject').html('').append(response);
- $('#targetProject').chosen().trigger("chosen:updated");;
- });
-
- var repoUrl = createLink('mr', 'ajaxGetRepoList', "hostID=" + hostID + "&projectID=" + sourceProject);
- $.get(repoUrl, function(response)
- {
- $('#repoID').html('').append(response);
- $('#repoID').val(repo.id);
- $('#repoID').chosen().trigger("chosen:updated");
- $('#repoID').change();
- });
-
- if(sourceProject) getBranchPriv(sourceProject);
- });
-
- $('#sourceBranch,#targetBranch').change(function()
- {
- $('#removeSourceBranch').removeAttr('disabled');
-
- var sourceProject = $('#sourceProject').val();
- var sourceBranch = $('#sourceBranch').val();
- var targetProject = $('#targetProject').val();
- var targetBranch = $('#targetBranch').val();
- if(branchPrivs[sourceBranch])
- {
- $('#removeSourceBranch').attr('disabled', 'true');
- $('#removeSourceBranch').attr("checked",false);
- }
- if(!sourceProject || !sourceBranch || !targetProject || !targetBranch) return false;
-
- var $this = $(this);
- var hostID = $('#hostID').val();
- var repoUrl = createLink('mr', 'ajaxCheckSameOpened', "hostID=" + hostID);
- $.post(repoUrl, {"sourceProject": sourceProject, "sourceBranch": sourceBranch, "targetProject": targetProject, "targetBranch": targetBranch}, function(response)
- {
- response = $.parseJSON(response);
- if(response.result == 'fail')
- {
- alert(response.message);
- $this.val('').trigger('chosen:updated');
- if($this.attr('id') == 'sourceBranch') $('#removeSourceBranch').removeAttr('disabled');
- return false;
- }
- });
- });
-
- $('#repoID').change(function()
- {
- var repoID = $(this).val();
- var jobUrl = createLink('mr', 'ajaxGetJobList', "repoID=" + repoID);
- $.get(jobUrl, function(response)
- {
- $('#jobID').html('').append(response);
- $('#jobID').chosen().trigger("chosen:updated");;
- });
- });
-
- $('#jobID').change(function()
- {
- var jobID = $(this).val();
- var compileUrl = createLink('mr', 'ajaxGetCompileList', "job=" + jobID);
- $.get(compileUrl, function(response)
- {
- $('#compile').html('').append(response);
- $('#compile').chosen().trigger("chosen:updated");;
- });
- });
-
- $("#needCI").change(function()
- {
- if(this.checked == false)
- {
- $("#jobID").prop("disabled", true);
- $('#jobID').chosen().trigger("chosen:updated");;
- $("#jobID").parent().parent().addClass('hidden');
- }
- if(this.checked == true)
- {
- $("#jobID").prop("disabled", false);
- $('#jobID').chosen().trigger("chosen:updated");;
- $("#jobID").parent().parent().removeClass('hidden');
- }
- });
-
- $('#hostID').change(function()
- {
- $('#sourceProject,#sourceBranch,#targetProject,#targetBranch').empty();
- $('#sourceProject,#sourceBranch,#targetProject,#targetBranch').chosen().trigger("chosen:updated");;
-
- var hostID = $('#hostID').val();
- if(hostID == '') return false;
-
- if(hosts[hostID].type == 'gitlab')
- {
- var url = createLink('repo', 'ajaxGetGitlabProjects', "gitlabID=" + hostID + "&projectIdList=&filter=IS_DEVELOPER");
- }
- else if(hosts[hostID].type == 'gitea')
- {
- var url = createLink('repo', 'ajaxGetGiteaProjects', "giteaID=" + hostID);
- }
- else if(hosts[hostID].type == 'gogs')
- {
- var url = createLink('repo', 'ajaxGetGogsProjects', "gogsID=" + hostID);
- }
- $.get(url, function(response)
- {
- if(response == "
" && confirm(mrLang.addForApp) == true) window.open(hosts[hostID].url);
-
- $('#sourceProject').html('').append(response);
- if(repo.project)
- {
- $('#sourceProject').val(repo.project);
- $('#sourceProject').change();
- }
- $('#sourceProject').chosen().trigger("chosen:updated");;
- });
- });
-
- if(repo.gitService) $('#hostID').change();
-});
diff --git a/module/mr/js/diff.js b/module/mr/js/diff.js
deleted file mode 100644
index 16e4768f9a..0000000000
--- a/module/mr/js/diff.js
+++ /dev/null
@@ -1,554 +0,0 @@
-$(document).ready(function()
-{
- if(!browser || browser == 'ie')
- {
- $("#inline").click(function(){$('#arrange').val('inline');this.form.submit();});
- $("#appose").click(function(){$('#arrange').val('appose');this.form.submit();});
- }
- $(".label-exchange").click(function(){ $('#exchange').submit();});
-});
-
-var distance = 0;
-
-/**
- * Aarrow tabs area.
- *
- * @param string domID
- * @param number shift 1|-1
- * @param bool hideRightBtn
- * @access public
- * @return void
- */
-function arrowTabs(domID, shift, hideRightBtn)
-{
- if($('#' + domID).html() == '') return;
-
- $('.btn-right, .btn-left').show();
- if(hideRightBtn) $('.btn-right').hide();
-
- var tabItemWidth = $('#' + domID + ' > .tabs-navbar > .nav-tabs')[0].clientWidth;
- var tabsWidth = $('#' + domID + '')[0].clientWidth;
- if(tabItemWidth < tabsWidth)
- {
- $('.btn-right, .btn-left').hide();
- return;
- }
-
- distance += tabsWidth * shift * 0.2;
- if(distance > 0) distance = 0;
- if(distance == 0)
- {
- $('.btn-left').hide();
- }
-
- if((tabItemWidth + distance) < tabsWidth * 0.75)
- {
- $('.btn-right').hide();
- return arrowTabs(domID, 1, true);
- }
-
- $('#' + domID + ' > .tabs-navbar > .tabs-nav')[0].style.transform = 'translateX('+ distance +'px)';
-}
-
-/**
- * Change encoding.
- *
- * @param string $encoding
- * @access public
- * @return void
- */
-function changeEncoding(encoding)
-{
- $('#encoding').val(encoding);
- $('#encoding').parents('form').submit();
-}
-
-/**
- * Html code decode.
- *
- * @param string str
- * @access public
- * @return string
- */
-function htmlspecialchars_decode(str)
-{
- str = str.replace(/&/g, '&');
- str = str.replace(/</g, '<');
- str = str.replace(/>/g, '>');
- str = str.replace(/"/g, '"');
- str = str.replace(/'/g, "'");
- return str;
-}
-
-/**
- * Get diffs by file name.
- *
- * @param string fileName
- * @access public
- * @return object
- */
-function getDiffs(fileName)
-{
- if(fileName.indexOf('./') === 0) fileName = fileName.substring(2);
-
- var result = {
- 'code': {'new': '', 'old': ''},
- 'line': {'new': [], 'old': []}
- };
- $.each(diffs, function(i, diff)
- {
- if(diff.fileName == fileName)
- {
- $.each(diff.contents, function(c, content)
- {
- if(typeof content.lines != 'object') return result;
-
- var lines = content.lines;
- $.each(lines, function(l, code)
- {
- var subIndex = code.type == 'all' ? 1 : 2;
- var lineCode = htmlspecialchars_decode(code.line.substring(subIndex)) + "\n";
-
- if(code.type == 'new')
- {
- result.code.new += lineCode;
- result.line.new.push(code.newlc);
- }
- else if(code.type == 'old')
- {
- result.code.old += lineCode;
- result.line.old.push(code.oldlc);
- }
- else
- {
- result.code.new += lineCode;
- result.code.old += lineCode;
- result.line.new.push(code.newlc);
- result.line.old.push(code.oldlc);
- }
- });
- });
- return result;
- }
- });
- return result;
-}
-
-/**
- * Create file tab.
- *
- * @param string filename
- * @param string filepath
- * @access public
- * @return object
- */
-function createTab(filename, filepath)
-{
- $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected');
- var tabID = Base64.encode(filepath).replace(/=/g, '-');
- return {
- title: filename,
- id: tabID,
- type: 'iframe',
- url: createLink('repo', 'ajaxGetDiffEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath))))
- };
-}
-
-/**
- * Load link object page.
- *
- * @param string $link
- * @access public
- * @return void
- */
-function loadLinkPage(link)
-{
- $('#linkObject').attr('href', link);
- $('#linkObject').click()
-}
-
-$(document).ready(function()
-{
- if(browser != 'ie')
- {
- var diffAppose = false;
- $('.dropdown #inline').hide();
-
- if(!browser || browser == 'ie')
- {
- $("#inline").click(function(){$('#arrange').val('inline');this.form.submit();});
- $("#appose").click(function(){$('#arrange').val('appose');this.form.submit();});
- }
- $(".label-exchange").click(function(){ $('#exchange').submit();});
-
- $('.btn-left').click(function() {arrowTabs('fileTabs', 1);});
- $('.btn-right').click(function() {arrowTabs('fileTabs', -2);});
- if(file) $('#fileTabs').tabs({tabs: [createTab(file['basename'], entry)]});
-
- /**
- * Set pane height.
- *
- * @access public
- * @return void
- */
- function setHeight()
- {
- var paneHeight = $(window).height() - 120;
- $('#fileTabs .tab-pane').css('height', paneHeight + 'px')
- $('#filesTree').css('height', paneHeight + 45)
- }
- setHeight();
-
- $(document).on('click', '.repoFileName', function()
- {
- var path = $(this).data('path');
- var name = $(this).text();
- var $tabs = $('#fileTabs').data('zui.tabs');
-
- $tabs.open(createTab(name, path));
- setHeight();
- arrowTabs('fileTabs', -2);
- });
-
- /* Remove file path for opened files. */
- $('#fileTabs').on('onClose', function(event, tab) {
- var filepath = decodeURIComponent(Base64.decode(tab.id.replace(/-/g, '=')));
- var index = openedFiles.indexOf(filepath);
- if(index > -1)
- {
- openedFiles.splice(index, 1)
- $('[data-path="' + filepath + '"]').closest('li').removeClass('selected');
- }
-
- if(index == openedFiles.length) arrowTabs('fileTabs', -2);
- });
-
- /* Append file path into the title. */
- $('#fileTabs').on('onLoad', function(event, tab) {
- var filepath = decodeURIComponent(Base64.decode(tab.id.replace(/-/g, '=')));
- $('#tab-nav-item-' + tab.id).attr('title', filepath);
- document.getElementById('tab-iframe-' + tab.id).contentWindow.updateEditorInline(diffAppose);
-
- if(openedFiles.indexOf(filepath) == -1) openedFiles.push(filepath);
- });
-
- $('#fileTabs').on('onOpen', function(event, tab) {
- var filepath = decodeURIComponent(Base64.decode(tab.id.replace(/-/g, '=')));
- var index = openedFiles.indexOf(filepath);
- if(index > -1) document.getElementById('tab-iframe-' + tab.id).contentWindow.updateEditorInline(diffAppose);
- });
-
- $('.inline-appose').on('click', function()
- {
- $('.inline-appose').hide();
- diffAppose = !diffAppose;
- if(diffAppose)
- {
- $('.dropdown #inline').show();
- }
- else
- {
- $('.dropdown #appose').show();
- }
- var type = $(this).attr('id');
- var tabID = $('.tab-nav-item.active').data('id');
- document.getElementById('tab-iframe-' + tabID).contentWindow.updateEditorInline(diffAppose);
- return;
- });
- }
- else
- {
- var $diffCode = $('.diff');
- var $rows = $diffCode.find('tr');
- var rowTip = $('#rowTip').html();
- var lastLine;
- $rows.each(function()
- {
- var $row = $(this);
- if(!$row.hasClass('empty'))
- {
- $row.children('th').first().prepend("");
- $row.children('td').first().append(rowTip);
- }
-
- if(lastLine && !$row.data('line'))
- {
- $row.attr('data-line', lastLine);
- }
- else
- {
- lastLine = $row.data('line');
- }
- }).hover(function()
- {
- var $this = $(this);
- if($this.hasClass('empty')) return;
- $this.addClass("over");
- },
- function()
- {
- $(this).removeClass("over");
- });
-
- var isInline = $.cookie('arrange') == 'inline';
- var $reviewFormRow = $('
| ' + (isInline ? ' | | ' : ' | ') + '
|---|
');
- var $reviewForm = $('#reviewForm');
- var $reviewPanel = $('#reviewPanel');
- $reviewFormRow.find('td').append($reviewForm.removeClass('hide'));
-
- var highlight = function($e)
- {
- $('.highlight').removeClass('highlight');
- $e.addClass('highlight');
- };
-
- var createReview = function(review, line, show)
- {
- var $review = $reviewPanel.clone().removeClass('hide').attr('id', review.objectType + '-' + review.id);
- $review.find('.realname').text(review.realname);
- $review.find('.openedDate').text(review.openedDate);
- $review.find('.title').text(review.title);
- $review.find('.content').toggle(review.content != '').html(review.content);
- $review.find('.code-lines').text(review.lines);
- $review.find('input[name="objectID"]').val(review.id);
- $review.data(review);
-
- id = review.objectType == 'bug' ? 'Bug' : 'Task';
- id += '#' + review.id;
- if(review.view) id = "
" + id + "";
- $review.find('.title').closest('.panel-heading').find('.panel-actions').prepend(id);
- if(!review.delete) $review.find('.title').closest('.panel-heading').find('.panel-actions .reviewDelete').hide();
-
- $review.toggleClass('show', show > 1);
- if(show > 2) highlight($review);
-
- if(!line && review.line) line = review.line;
- if(line)
- {
- var $row = $rows.filter('[data-line="' + line + '"]').last();
- if(review.entry) $row = $('#diff[data-entry="' + review.entry + '"]').find('tr').filter('[data-line="' + line + '"]');
- if($row.length == 0) return false;
-
- $commentRow = $row.next('tr');
- if($row.hasClass('commented')) $commentRow = $row.nextAll('tr.comment-row').first();
- if(!$commentRow.hasClass('comment-row'))
- {
- $commentRow = $('');
- $row.addClass('commented').after($commentRow);
- }
-
- $commentRow.find('.comment-list').append($review);
-
- if(show && $commentRow.hasClass('comment-row')) $commentRow.addClass('show');
- }
-
- return $review;
- };
-
- var toggleComment = function($row, show)
- {
- var $commentRow;
- if($row.hasClass('comment-row'))
- {
- $commentRow = $row;
- $row = $commentRow.prev('tr');
- if($row.hasClass('action-row'))
- {
- $row = $row.prev('tr');
- }
- }
- else
- {
- $commentRow = $row.next('tr');
- if($commentRow.hasClass('action-row'))
- {
- $commentRow = $commentRow.next('tr');
- }
- }
- if(show === undefined)
- {
- show = !$row.hasClass('open');
- }
- if($row.hasClass('commented') && $commentRow.hasClass('comment-row'))
- {
- $commentRow.toggleClass('show', show);
- $row.toggleClass('open', show);
- }
- };
-
- $diffCode.on('click', '.comment-btn', function(e)
- {
- $rows.removeClass('selected');
- var $row = $(this).closest('tr');
- if($diffCode.hasClass('with-action-row') && $row.hasClass('with-action-row'))
- {
- $diffCode.removeClass('with-action-row');
- }
- else
- {
- $diffCode.addClass('with-action-row');
- var line = $row.attr('data-line');
- if(!$row.hasClass('with-action-row'))
- {
- $rows.removeClass('with-action-row')
- $row.addClass('with-action-row');
-
- $reviewForm.find('input[name="begin"]').val(line);
- $reviewForm.find('input[name="end"]').attr('min', line).val(line);
- $reviewForm.find('select#assignedTo').trigger("chosen:updated");
- $reviewForm.find('input#entry').val($row.closest('table#diff').data('entry'));
-
- $row.after($reviewFormRow);
-
- KindEditor.remove('#commentText');
- $('#commentText').kindeditor();
- }
- highlight($reviewForm);
- $reviewForm.find('input[name="title"]').focus();
- $row.addClass('selected');
- }
- e.stopPropagation();
- }).on('click', '.reviewDelete', function(e)
- {
- var $review = $(this).closest('.panel-review');
- if(!$review.length) return;
-
- if(confirm(confirmDelete))
- {
- var link = createLink($review.data('objectType'), 'delete', 'id=' + $review.data('id') + '&confirm=yes');
- $.get(link, function(data)
- {
- var $commentRow = $review.closest('.comment-row');
- if($commentRow.find('.panel-review').length === 1)
- {
- $commentRow.removeClass('show').prev('tr').removeClass('commented');
- }
- $review.remove();
- });
- }
- e.stopPropagation();
- return false;
- }).on('click', 'tr.commented', function()
- {
- toggleComment($(this));
- }).on('click', '.panel-review > .panel-heading', function()
- {
- $(this).closest('.panel-review').toggleClass('show');
- });
-
- $reviewForm.submit(function()
- {
- $(this).ajaxSubmit(
- {
- success:function(json)
- {
- json = $.parseJSON(json);
- if(json.result == 'fail')
- {
- var message = '';
- if(typeof(json.message) != 'string')
- {
- for(i in json.message)
- {
- if(typeof(json.message[i]) == 'string')
- {
- message += json.message[i] + '\n';
- }
- else
- {
- for(j in json.message[i])
- {
- message += json.message[i][j] + '\n';
- }
- }
- }
- }
- else
- {
- message += json.message + '\n';
- }
- alert(message);
- return false;
- }
-
- createReview(json, json.line, 3);
- $diffCode.removeClass('with-action-row');
- $diffCode.find('tr.with-action-row.selected').removeClass('selected');
- $reviewForm.find('#title').val('');
- KindEditor.html('#commentText', '');
- },
- beforeSubmit:function(formData, jqForm)
- {
- var form = jqForm[0];
- if(!form.product.value)
- {
- alert(productError);
- return false;
- }
- if(!form.title.value)
- {
- alert(titleError);
- $reviewForm.find('input[name="title"]').focus();
- return false;
- }
- }
- });
- return false;
- }).on('change', 'input[name="begin"]', function()
- {
- var begin = $(this).val();
- var $end = $reviewForm.find('input[name="end"]').attr('min', begin);
- if(parseInt($end.val()) < parseInt(begin))
- {
- $end.val(begin);
- }
- });
-
- if(reviews)
- {
- var lineReviews;
- for(var line in reviews)
- {
- if(line)
- {
- lineReviews = reviews[line];
- for(var i in lineReviews) createReview(lineReviews[i], line);
- }
- }
- }
-
- setTimeout(anchor, 200);
-
- $(document).on('click', function()
- {
- $('.highlight').removeClass('highlight');
- });
-
- /**
- * Anchor
- *
- * @access public
- * @return void
- */
- function anchor()
- {
- var hash = window.location.hash;
- if(!hash) return false;
-
- var line = hash.substr(1).replace('L', '');
- var $row = $('.diff tr[data-line="' + line +'"]').first();
- if($row.length) return false;
-
- var anchor = $row.offset().top;
- $('body,html').animate({scrollTop:anchor - 50}, 500);
-
- $row.addClass('highlight');
- if($row.hasClass('commented'))
- {
- toggleComment($row, true);
- var $commentRow = $row.next('tr');
- if($commentRow.hasClass('comment-row')) $commentRow.addClass('highlight');
- }
- }
- }
-});
diff --git a/module/mr/js/edit.js b/module/mr/js/edit.js
deleted file mode 100644
index 332f0425bc..0000000000
--- a/module/mr/js/edit.js
+++ /dev/null
@@ -1,31 +0,0 @@
-$(function ()
-{
- $('#repoID').change(function ()
- {
- repoID = $(this).val();
- jobUrl = createLink('mr', 'ajaxGetJobList', "repoID=" + repoID);
- $.get(jobUrl, function (response)
- {
- $('#jobID').html('').append(response);
- $('#jobID').chosen().trigger("chosen:updated");;
- });
- });
-
- $('#jobID').change(function ()
- {
- jobID = $(this).val();
- compileUrl = createLink('mr', 'ajaxGetCompileList', "job=" + jobID);
- $.get(compileUrl, function (response)
- {
- $('#compile').html('').append(response);
- $('#compile').chosen().trigger("chosen:updated");;
- });
- });
-
- $("#needCI").change(function()
- {
- if(this.checked == false) $("#jobID").parent().parent().addClass('hidden');
- if(this.checked == true) $("#jobID").parent().parent().removeClass('hidden');
- });
- $("#needCI").trigger('change');
-});
diff --git a/module/mr/js/link.js b/module/mr/js/link.js
deleted file mode 100644
index 343413fbf9..0000000000
--- a/module/mr/js/link.js
+++ /dev/null
@@ -1,86 +0,0 @@
-function showLink(productID, type, orderBy, param)
-{
- if(type == 'story') method = 'linkStory';
- else if(type == 'bug') method = 'linkBug';
- else if(type == 'task') method = 'linkTask';
-
- loadURL(createLink('mr', method, 'MRID=' + MRID + '&productID=' + productID + (typeof(param) == 'undefined' ? '' : param) + (typeof(orderBy) == 'undefined' ? '' : "&orderBy=" + orderBy)), type);
-
- $('.actions').find("a[href*='" + type + "']").addClass('hidden');
-}
-
-/**
- * Load URL.
- *
- * @param string $url
- * @param string $type
- * @access public
- * @return void
- */
-function loadURL(url, type)
-{
- $.get(url, function(data)
- {
- var $pane = $(type == 'story' ? '#stories' : (type == 'bug' ? '#bugs' : '#tasks'));
- $pane.find('.main-table').hide();
- var $linkBox = $pane.find('.linkBox').html(data).removeClass('hidden');
- $linkBox.html(data).removeClass('hidden');
- $linkBox.find('[data-ride="table"]').table();
- $linkBox.find('[data-ride="pager"]').pager();
- $linkBox.find('[data-ride="pager"] li a.pager-item').click(function()
- {
- loadURL($(this).attr('href'), type);
- return false;
- });
- $linkBox.find('[data-ride="pager"] .pager-size-menu a[data-size]').off('click');
- $linkBox.find('[data-ride="pager"] .pager-size-menu a[data-size]').click(function()
- {
- line = $linkBox.find('[data-ride="pager"]').attr('data-link-creator');
- line = line.replace('{recPerPage}', $(this).attr('data-size')).replace('{page}', $linkBox.find('[data-ride="pager"]').attr('data-page'));
- $.cookie($linkBox.find('[data-ride="pager"]').attr('data-page-cookie'), $(this).attr('data-size'), {expires:config.cookieLife, path:config.webRoot});
- loadURL(line, type);
- return false;
- });
- $.toggleQueryBox(true, $linkBox.find('#queryBox'));
- });
-}
-
-$(function()
-{
- if(link == 'true') showLink(productID, type, orderBy, param);
- var infoShowed = false;
- $('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e)
- {
- var href = $(e.target).attr('href');
- var tabPane = $(href + '.tab-pane');
- if(tabPane.size() == 0) return;
- var formID = tabPane.find('.linkBox').find('form:last');
- if(formID.size() == 0) formID = tabPane.find('form:last');
- if(href == '#planInfo' && !infoShowed)
- {
- $('#planInfo img').each(function()
- {
- var $tr = $('#planInfo .detail-content .table-data tbody tr:first');
- width = $tr.width() - $tr.find('th').width();
- if($(this).parent().prop('tagName').toLowerCase() == 'a') $(this).unwrap();
- setImageSize($(this), width, 0);
- });
-
- infoShowed = true;
- }
- });
-
- $('#storyList').on('sort.sortable', function(e, data)
- {
- var list = '';
- for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
- $.post(createLink('productplan', 'ajaxStorySort', 'productID=' + productID), {'stories' : list, 'orderBy' : orderBy, 'pageID' : storyPageID, 'recPerPage' : storyRecPerPage, 'recTotal' : storyRecTotal}, function()
- {
- var $target = $(data.element[0]);
- $target.hide();
- $target.fadeIn(1000);
- order = 'order_asc';
- history.pushState({}, 0, createLink('productplan', 'view', "productID=" + productID + '&type=story&orderBy=' + order));
- });
- });
-});
diff --git a/module/mr/js/view.js b/module/mr/js/view.js
deleted file mode 100644
index dd3ea725bd..0000000000
--- a/module/mr/js/view.js
+++ /dev/null
@@ -1,17 +0,0 @@
-$(document).ready(function()
-{
- $('#mergeButton,.mergeButton').click(function()
- {
- link = $(this).attr('href');
- $.getJSON(link, function(response)
- {
- if(response.result == 'success')
- {
- $.zui.messager.success(response.message);
- setTimeout(function(){ location.href=response.locate }, 2500);
- }
- if(response.result == 'fail') $.zui.messager.danger(response.message);
- });
- return false;
- });
-});
diff --git a/module/my/css/bug.css b/module/my/css/bug.css
deleted file mode 100644
index 72b2a302fb..0000000000
--- a/module/my/css/bug.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-confirm {width:60px;}
-[lang^=en] .c-assignedTo {width: 105px !important;}
diff --git a/module/my/css/changepassword.css b/module/my/css/changepassword.css
deleted file mode 100644
index ecc87d05bb..0000000000
--- a/module/my/css/changepassword.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#mainContent table > tbody > tr > td > div.text-danger.help-text {word-break: break-all;}
-[lang^=fr] #mainContent table > tbody > tr {white-space: nowrap;}
-.panel-heading {padding-top: 1rem !important;}
diff --git a/module/my/css/doc.css b/module/my/css/doc.css
deleted file mode 100644
index 845339aa41..0000000000
--- a/module/my/css/doc.css
+++ /dev/null
@@ -1,15 +0,0 @@
-body {margin-bottom: 25px;}
-.fullscreen-close {top: 8px !important;}
-#docList.table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px;}
-#docList th.c-id {width: 72px;}
-#docList th.c-user {width: 80px;}
-#docList th.c-actions {width: 84px; padding-left: 15px;}
-#docList .c-object {width: 180px; overflow: hidden; white-space: nowrap; text-overflow: clip;}
-#docList.table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 40px); overflow: hidden; background: transparent; padding-right:0px;}
-#docList.table .c-name[data-status=draft] > .doc-title {max-width: calc(100% - 80px);}
-#docList.table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;}
-#docList.table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
-#docList .btn {padding: 0 2px;}
-#docList .ajaxCollect {width: 30px; padding: 0 6px;}
-.btn.ajaxCollect > img {width: 20px;}
-#queryBox .btn-save-form, #queryBox #toggle-queries{display: none;}
diff --git a/module/my/css/dynamic.css b/module/my/css/dynamic.css
deleted file mode 100644
index e95b8699ac..0000000000
--- a/module/my/css/dynamic.css
+++ /dev/null
@@ -1,34 +0,0 @@
-#dynamics {padding: 10px 0;}
-.dynamic {position: relative; padding-left: 170px;}
-.dynamic-date {position: absolute; left: 0; top: 0; width: 150px; border: 2px solid #eee; border-radius: 4px; padding: 14px 20px; height: 58px;}
-.dynamic-date:before {content: ' '; display: block; position: absolute; right: -22px; top: 26px; height: 2px; width: 20px; background-color: #eee;}
-.dynamic-date > .date-label,
-.dynamic-date > .date-text {font-size: 18px; display: block;}
-.dynamic-date > .date-label + .date-text {font-size: 14px; line-height: 14px;}
-.dynamic-date > .date-label {margin-top: -8px;}
-.dynamic-date > .btn {position: absolute; right: 10px; top: 15px;}
-.dynamic .timeline {border: 2px solid #eee; border-radius: 4px; margin-bottom: 20px; padding: 10px 20px 10px 100px; transition: max-height .2s; overflow: hidden;}
-.dynamic .timeline-tag {left: -75px; font-size: 14px; color: #838A9D;}
-.dynamic .timeline-text {color: #3C4353;}
-.dynamic .text-muted {color: #838A9D;}
-.dynamic .label-id {top: -1px; border: 1px solid rgba(131,138,157,0.25); color: #838A9D;}
-.dynamic.active .timeline,
-.dynamic.active .dynamic-date {border-color: #00a9fc;}
-.dynamic.active .dynamic-date:before {background-color: #00a9fc;}
-.dynamic.collapsed .timeline {max-height: 58px;}
-.dynamic.collapsed .timeline > li + li {display: none;}
-.dynamic.collapsed .dynamic-btn > .icon:before {content: '\f0d8';}
-
-.timeline > li:before {left: -26px;}
-.timeline > li + li:after {left: -23px;}
-.timeline-text {margin-left: -18px;}
-.label-action {padding: 0 4px;}
-.label-id {margin-left: 4px;}
-.timeline > li.active:before {left: -30px;}
-.timeline > li.collected:before, .timeline > li.releaseddoc:before {background-color: #FFF;}
-.timeline > li.collected > div:after {background-color: #FFAF65;}
-.timeline > li.releaseddoc > div:after {background-color: #66A2FF;}
-.timeline > li > div:after {left: -27px;}
-.timeline .timeline-text {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-.timeline > li > div > .timeline-tag, .timeline > li > div > .timeline-text > .label-action {color: #838A9D;}
-.timeline > li > div > .timeline-text > a {color: #313C52;}
diff --git a/module/my/css/editprofile.css b/module/my/css/editprofile.css
deleted file mode 100644
index cbedc86e4e..0000000000
--- a/module/my/css/editprofile.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.body-modal .outer > .container > form {padding: 5px 0 10px;}
-.w-verifyPassword {width: 120px !important;}
diff --git a/module/my/css/execution.css b/module/my/css/execution.css
deleted file mode 100644
index 1e329cc330..0000000000
--- a/module/my/css/execution.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.c-hours, .c-progress {width: 80px !important;}
-.c-status, .c-date {padding-right: 8px !important; text-align: center;}
-.align-right {text-align: right; padding-right: 8px !important;}
diff --git a/module/my/css/managecontacts.css b/module/my/css/managecontacts.css
deleted file mode 100644
index ba5a1455e6..0000000000
--- a/module/my/css/managecontacts.css
+++ /dev/null
@@ -1,6 +0,0 @@
-body.body-modal {padding-bottom: 20px; min-height: 400px;}
-.side-col {padding-right: 40px;}
-.btn-block {display: block; width: 100%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
-.contactListTitle {margin-left: 45px !important;}
-.createBtn {width: 100%; margin-bottom: 5px;}
-.main-col .main-header .title {margin-left: 17px !important;}
diff --git a/module/my/css/preference.css b/module/my/css/preference.css
deleted file mode 100644
index edcebaff0e..0000000000
--- a/module/my/css/preference.css
+++ /dev/null
@@ -1,26 +0,0 @@
-.preference .table-form > tbody > tr > th {font-weight: 400; color: #0B0F18;}
-.preference .chosen-container-single .chosen-single > span {color: #313C52;}
-.tip {margin-top: 10px;}
-
-.preference > .preference-border {display: flex; padding: 5px 16px; border: 1px solid #EDEEF2;}
-.preference-border > .preference-img {flex: 0 0 80px;}
-.preference.picker-option-active > .preference-border {box-shadow: 0px 0px 1px 1px #2E7FFF;}
-.preference.picker-option-active {background: unset !important;}
-.preference.picker-option-active > .preference-border {background: rgba(230,240,255, 0.4) !important;}
-.picker-option.picker-option-selected.preference {background: unset !important;}
-.picker-option.picker-option-selected.preference > .preference-border {background: rgba(230,240,255, 0.4) !important;}
-.preference-text {display: flex; flex-direction: column; justify-content: space-around; padding-left: 5px;}
-.preference-text > .title {color: #0B0F18; font-size: 13px;}
-.preference-text > .context {color: #838A9D; font-size: 12px; overflow: hidden; white-space: normal;}
-
-.picker-option.picker-option-active,
-.picker-single .picker-option.picker-option-selected.picker-option-active.option-ursr,
-.picker-option.picker-option-selected.option-ursr {background: unset !important; color: unset;}
-.picker-option.picker-option-active > .border,
-.picker-single .picker-option.picker-option-selected.picker-option-active.option-ursr > .border,
-.picker-single .picker-option.picker-option-selected.picker-option-active.option-ursr > .border {background: rgba(230,240,255, 0.4) !important;}
-#pickerDropMenu-pk_URSR > .picker-option-list {display: flex; flex-wrap: wrap;}
-.option-ursr {flex: 1 1 50%;}
-.option-ursr > .border {height: 46px; display: flex; padding: 5px 16px; border: 1px solid #EDEEF2; align-items: center;}
-.option-ursr > .border > .value {margin-right: 20px; width: 20px; height: 20px; border-radius: 100%; background: rgba(230,240,255, 0.4);}
-.option-ursr > .border > .value > p {line-height: 20px; text-align: center;}
diff --git a/module/my/css/profile.css b/module/my/css/profile.css
deleted file mode 100644
index 2f157a6dbc..0000000000
--- a/module/my/css/profile.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.body-modal .main-header {padding: 20px 0px 24px 0; border-bottom: unset;}
-.row table {width: 100%; margin-top: 5px; margin-left: 20px;}
-table+table {border-top: 1px solid #eee;}
-.row th {width: 17%; line-height: 30px; padding-right: 20px; text-align: right; font-weight: unset;}
-.row td {width: 33%; text-align: left; font-weight: 700;}
-.main-actions {margin: 5px 0 10px 0; text-align: center;}
-.user-title {margin: 10px 10px -10px 10px; font-size: 14px; font-weight: bold; padding-left: 10px;}
-.user-name {font-weight: bold;}
-.user-role {color: #5B606E;}
-.user-name, .user-role {font-size: 14px; vertical-align: top; display: table; padding-left: 310px;}
-
-#avatarUpload {display: inline-block; width: 40px; height: 40px; position: absolute; left: 265px}
-#avatarForm {position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
-#avatarUploadBtn {display: block; position: absolute; top: 0; left: 0; right: 0; bottom: 0;}
-#avatarUploadBtn {opacity: 0; color: #fff; border-radius: 50%; line-height: 50px;}
-#avatarUploadBtn:hover {opacity: 1; background-color: rgba(0,0,0,.5);}
diff --git a/module/my/css/project.css b/module/my/css/project.css
deleted file mode 100644
index 3c6300af47..0000000000
--- a/module/my/css/project.css
+++ /dev/null
@@ -1,16 +0,0 @@
-#projectTableList > tr.drop-not-allowed {opacity: 0.1 !important;}
-#projectList .c-actions {overflow: visible;}
-#projectTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;}
-#projectList .c-budget {width: 100px; padding-right: 20px;}
-#projectTableList .c-budget {width: 100px; padding-right: 20px;}
-
-.c-date {width: 80px;}
-.label-warning, .label-info {width: 60px !important;}
-.project-type-label.label-outline {width: 50px; min-width: 50px;}
-.c-date {width: 120px;}
-
-#projectList td.c-name {padding-right: 0px;}
-#projectList td.c-name .project-name {display: flex; align-items: center;}
-#projectList td.c-name .project-name > span {flex: none; margin-left: 5px;}
-#projectList td.c-name .project-name > a {overflow: hidden; display: inline-block; max-width: calc(100% - 50px);}
-#projectList td.c-name .project-name.has-suffix > a {padding-right: 5px;}
diff --git a/module/my/css/requirement.css b/module/my/css/requirement.css
deleted file mode 100644
index de64b42228..0000000000
--- a/module/my/css/requirement.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
-.table td.has-child > a:not(.story-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: clip; white-space: nowrap;}
-.table td.has-child > .story-toggle {color: #838a9d; position: relative; top: 1px; left: 2px;}
-.table td.has-child > .story-toggle:hover {color: #006af1; cursor: pointer;}
-.table td.has-child > .story-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -o-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
-.table td.has-child > .story-toggle > .icon:before {text-align: left;}
-.table td.has-child > .story-toggle.collapsed > .icon {-ms-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg);}
-.table td.c-hours {padding-right: 12px;}
-.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
-@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};}
-.c-span {margin-left: 22px;}
-[lang^=de] .c-hours{width: 105px;}
diff --git a/module/my/css/score.css b/module/my/css/score.css
deleted file mode 100644
index f8ae27d3d9..0000000000
--- a/module/my/css/score.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.c-time {width: 200px;}
-.c-module, .c-method {width: 150px;}
-.c-before, .c-score, .c-after {width: 100px;}
diff --git a/module/my/css/story.css b/module/my/css/story.css
deleted file mode 100644
index 89781c2847..0000000000
--- a/module/my/css/story.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
-.table td.has-child > a:not(.story-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: clip; white-space: nowrap;}
-.table td.has-child > .story-toggle {color: #838a9d; position: relative; top: 1px; left: 2px;}
-.table td.has-child > .story-toggle:hover {color: #006af1; cursor: pointer;}
-.table td.has-child > .story-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -o-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
-.table td.has-child > .story-toggle > .icon:before {text-align: left;}
-.table td.has-child > .story-toggle.collapsed > .icon {-ms-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg);}
-.table td.c-hours {padding-right: 12px;}
-.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
-@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};}
-.c-actions-6 {width: 185px;}
-[lang^=de] .c-hours {width: 105px;}
diff --git a/module/my/css/task.css b/module/my/css/task.css
deleted file mode 100644
index 742b4ff517..0000000000
--- a/module/my/css/task.css
+++ /dev/null
@@ -1,37 +0,0 @@
-.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
-.table td.has-child > a:not(.task-toggle) {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; white-space: nowrap;}
-.table td.has-child > .task-toggle {color: #838a9d; position: relative; top: 1px; line-height: 16px;}
-.table td.has-child > .task-toggle:hover {color: #006af1; cursor: pointer;}
-.table td.has-child > .task-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -o-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
-.table td.has-child > .task-toggle > .icon:before {text-align: left;}
-.table td.has-child > .task-toggle.collapsed {top: 0;}
-.table td.has-child > .task-toggle.collapsed > .icon {-ms-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg);}
-.table td.c-hours {padding-right: 12px;}
-.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
-@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};}
-
-.c-hours {width: 50px;}
-.c-status, .c-date, .c-user-short {width: 70px;}
-.c-project {width: 130px;}
-#taskTable .assigned-title{width: 110px; padding-left: 29px;}
-
-html[lang="en"] .c-date {width: 80px;}
-html[lang="en"] .c-user-short {width: 88px;}
-[lang^=en] #taskTable .c-project {width: 100px}
-[lang^=en] #taskTable .assigned-title {width: 120px !important;}
-[lang^=de] #taskTable .c-name {width: 100px;}
-[lang^=de] #taskTable .c-project {width: 80px;}
-[lang^=de] #taskTable .c-date {width: 78px;}
-[lang^=de] #taskTable .assigned-title {width: 123px !important;}
-[lang^=de] #taskTable .c-user {width: 118px;}
-[lang^=de] #taskTable .estimate, [lang^=de] #taskTable .consumed {width: 86px;}
-[lang^=de] #taskTable .c-user-short {width: 75px;}
-[lang^=fr] #taskTable .c-name {width: 120px;}
-[lang^=fr] #taskTable .c-project {width: 100px;}
-[lang^=fr] #taskTable .c-date {width: 91px;}
-[lang^=fr] #taskTable .assigned-title {width: 130px !important;}
-[lang^=fr] #taskTable .c-user-short {width: 75px;}
-[lang^=fr] #taskTable .c-status {width: 71px;}
-#myTaskForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #F4F5F7; margin: 0 4px 0 0;}
diff --git a/module/my/css/team.css b/module/my/css/team.css
deleted file mode 100644
index f576f4cc76..0000000000
--- a/module/my/css/team.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.c-gender {width: 80px;}
-.c-skype, .c-visits {width: 100px;}
-.c-phone {width: 128px;}
-.c-email {width: 128px;}
-.c-role {width: 96px;}
diff --git a/module/my/css/testcase.css b/module/my/css/testcase.css
deleted file mode 100644
index 80b0d560ff..0000000000
--- a/module/my/css/testcase.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-status, .c-type {width: 70px;}
-.c-user {width: 80px;}
diff --git a/module/my/css/testtask.css b/module/my/css/testtask.css
deleted file mode 100644
index 4c9d612635..0000000000
--- a/module/my/css/testtask.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.c-execution {width: 200px}
-.c-build {width: 120px;}
-.c-id {width: 60px;}
-.c-status {width: 80px;}
diff --git a/module/my/css/todo.css b/module/my/css/todo.css
deleted file mode 100644
index 6ee004343a..0000000000
--- a/module/my/css/todo.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.datepicker-wrapper {width: 110px !important;}
-.datepicker-wrapper .form-control {max-width: 110px; line-height: 25px; height: 26px !important;}
-.btn-group button.dropdown-toggle.btn-primary {padding: 6px;}
-.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
-.btn-toolbar .space {min-height: 1px; margin: 0 -3px 0 10px;}
-.iconCenter {top: -2px !important;}
-
-#switchButton {background: #fff !important;}
-.panel-actions {position: relative; padding: 0;}
-.panel-actions .btn-icon {padding-left: 7px;}
-[lang^=de] .c-pri {width: 69px;}
-[lang^=fr] .c-pri {width: 82px;}
-[lang^=en] .c-user, [lang^=fr] .c-user {width: 100px !important;}
diff --git a/module/my/js/changepassword.js b/module/my/js/changepassword.js
deleted file mode 100644
index 25f455269e..0000000000
--- a/module/my/js/changepassword.js
+++ /dev/null
@@ -1,36 +0,0 @@
-$(document).ready(function()
-{
- var originalEncrypted = false;
- $('#originalPassword').change(function(){originalEncrypted = false});
-
- var password1Encrypted = false
- var password2Encrypted = false
- $('#password1').change(function(){password1Encrypted = false});
- $('#password2').change(function(){password2Encrypted = false});
-
- var passwordStrength = 0;
- $('#submit').click(function()
- {
- var password = $('input#originalPassword').val().trim();
- var password1 = $('input#password1').val().trim();
- var rand = $('input#verifyRand').val();
- if(!password1Encrypted)
- {
- passwordStrength = computePasswordStrength(password1);
- $("#passwordLength").val(password1.length);
- }
-
- if($("form input[name=passwordStrength]").length == 0) $('#submit').after("
");
- $("form input[name=passwordStrength]").val(passwordStrength);
-
- if(!originalEncrypted && password) $('input#originalPassword').val(md5(md5(password) + rand));
- originalEncrypted = true;
-
- var password1 = $('#password1').val().trim();
- var password2 = $('#password2').val().trim();
- if(password1 && !password1Encrypted) $('#password1').val(md5(password1) + rand);
- if(password2 && !password2Encrypted) $('#password2').val(md5(password2) + rand);
- password1Encrypted = true;
- password2Encrypted = true;
- });
-});
diff --git a/module/my/js/doc.js b/module/my/js/doc.js
deleted file mode 100644
index 7d99c02b41..0000000000
--- a/module/my/js/doc.js
+++ /dev/null
@@ -1,16 +0,0 @@
-$('.ajaxCollect').click(function (event) {
- var obj = $(this);
- var url = obj.data('url');
- $.get(url, function(response)
- {
- if(response.status == 'yes')
- {
- obj.children('img').attr('src', 'static/svg/star.svg');
- }
- else
- {
- obj.children('img').attr('src', 'static/svg/star-empty.svg');
- }
- }, 'json');
- return false;
-});
diff --git a/module/my/js/editprofile.js b/module/my/js/editprofile.js
deleted file mode 100644
index 3d91b9161c..0000000000
--- a/module/my/js/editprofile.js
+++ /dev/null
@@ -1,36 +0,0 @@
-$(document).ready(function()
-{
- var verifyEncrypted = false;
- $('#verifyPassword').change(function(){verifyEncrypted = false});
-
- var password1Encrypted = false
- var password2Encrypted = false
- $('#password1').change(function(){password1Encrypted = false});
- $('#password2').change(function(){password2Encrypted = false});
-
- var passwordStrength = 0;
- $('#submit').click(function()
- {
- var password = $('input#verifyPassword').val();
- var password1 = $('input#password1').val();
- if(!password1Encrypted)
- {
- passwordStrength = computePasswordStrength(password1);
- $("#passwordLength").val(password1.length);
- }
-
- if($("form input[name=passwordStrength]").length == 0) $('#submit').after("
");
- $("form input[name=passwordStrength]").val(passwordStrength);
-
- var rand = $('input#verifyRand').val();
- if(!verifyEncrypted && password) $('input#verifyPassword').val(md5(md5(password) + rand));
- verifyEncrypted = true;
-
- var password1 = $('#password1').val();
- var password2 = $('#password2').val();
- if(password1 && !password1Encrypted) $('#password1').val(md5(password1) + rand);
- if(password2 && !password2Encrypted) $('#password2').val(md5(password2) + rand);
- password1Encrypted = true;
- password2Encrypted = true;
- });
-});
diff --git a/module/my/js/managecontacts.js b/module/my/js/managecontacts.js
deleted file mode 100644
index 62cb273801..0000000000
--- a/module/my/js/managecontacts.js
+++ /dev/null
@@ -1 +0,0 @@
-$('#users').picker();
diff --git a/module/my/js/preference.js b/module/my/js/preference.js
deleted file mode 100644
index 0a1f7c52ca..0000000000
--- a/module/my/js/preference.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * Init preference for picker.
- *
- * @access public
- * @return void
- */
-function initPreference() {
- var objPngSrc = {
- 'program-browse': 'list',
- 'program-project': 'list-recent',
- 'program-kanban': 'kanban',
-
- 'product-index': 'panel-recent-browse',
- 'product-all': 'list',
- 'product-dashboard': 'panel',
- 'product-browse': 'list-recent',
- 'product-kanban': 'kanban',
-
- 'project-browse': 'list',
- 'project-execution': 'list-recent',
- 'project-index': 'panel-recent-browse',
- 'project-kanban': 'kanban',
-
- 'execution-all': 'list',
- 'execution-task': 'list-recent',
- 'execution-executionkanban': 'kanban',
- }
-
- /**
- * Render program option.
- *
- * @param object $option
- * @param object $b
- * @access public
- * @return void
- */
- function optionRenderProgram($option, b)
- {
- /* transform , to , then split to fit lang */
- var textArr = b.text.split('/');
- if (!$option.hasClass('preference'))
- {
- $option.empty();
- $option.addClass('preference');
- $option.attr("title", textArr[0]);
- $option.prepend('
' + textArr[0] + '
' + textArr[1] + '
');
- }
- return $option;
- }
-
- /**
- * Render program text.
- *
- * @param object $option
- * @param object $b
- * @access public
- * @return void
- */
- function textRenderProgram($text, b)
- {
- $text.empty();
- $text.addClass('preference-selection');
- $text.prepend('
' + b.split('/')[0] + '')
- return $text;
- }
-
- /**
- * Render URSR option.
- *
- * @param object $option
- * @param object $b
- * @access public
- * @return void
- */
- function optionRenderURSR($option, b)
- {
- if (!$option.hasClass('option-ursr'))
- {
- $option.addClass('option-ursr');
- $option.parent().addClass('list-ursr');
- $option.empty();
- $option.prepend('
');
- }
- return $option;
- }
-
- $('.programLink').picker({
- optionRender: optionRenderProgram,
- selectionTextRender: textRenderProgram
- });
-
- $('.productLink').picker({
- optionRender: optionRenderProgram,
- selectionTextRender: textRenderProgram
- });
-
- $('.projectLink').picker({
- optionRender: optionRenderProgram,
- selectionTextRender: textRenderProgram
- });
-
- $('.executionLink').picker({
- optionRender: optionRenderProgram,
- selectionTextRender: textRenderProgram
- });
-
- $('.URSR').picker({
- optionRender: optionRenderURSR
- });
-
- $(document).on('mousemove', 'a.picker-option', function()
- {
- $('.picker-option.text-primary').removeClass('text-primary');
- $(this).addClass('text-primary');
- });
-
-}
-
-$(function()
-{
- initPreference();
-})
diff --git a/module/my/js/profile.js b/module/my/js/profile.js
deleted file mode 100644
index e5cd75e0b4..0000000000
--- a/module/my/js/profile.js
+++ /dev/null
@@ -1,26 +0,0 @@
-$(document).ready(function()
-{
- $('#files').change(function()
- {
- $('#avatarForm').submit();
- });
-
- $('#avatarUploadBtn').on('click', function()
- {
- $('#files').click();
- });
-
- if(avatar)
- {
- window.parent.$('#userNav .avatar, #menu-avatar').html('

');
- window.parent.$('#mainContent>.cell>.main-header>.avatar').html('

');
- window.parent.$('#mainContent .avatar-' + userID).html('

');
- }
-
- $('#avatarUploadBtn').tooltip();
-});
-
-function uploadAvatar()
-{
- $('#avatarUploadBtn').trigger('click');
-}
diff --git a/module/my/js/requirement.js b/module/my/js/requirement.js
deleted file mode 100644
index 7ce09255ea..0000000000
--- a/module/my/js/requirement.js
+++ /dev/null
@@ -1,21 +0,0 @@
-$(function()
-{
- $('#storyList td.has-child .story-toggle').each(function()
- {
- var $td = $(this).closest('td');
- var labelWidth = 0;
- if($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
- $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
- });
- toggleFold('#myStoryForm', [], 0, 'requirement');
-
- $(document).on('click', '.story-toggle', function(e)
- {
- var $toggle = $(this);
- var id = $(this).data('id');
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
- e.stopPropagation();
- e.preventDefault();
- });
-})
diff --git a/module/my/js/story.js b/module/my/js/story.js
deleted file mode 100644
index d61d1c927a..0000000000
--- a/module/my/js/story.js
+++ /dev/null
@@ -1,20 +0,0 @@
-$(function()
-{
- $('#storyList td.has-child .story-toggle').each(function()
- {
- var $td = $(this).closest('td');
- var labelWidth = 0;
- if($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
- $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
- });
- toggleFold('#myStoryForm', [], 0, 'story');
- $(document).on('click', '.story-toggle', function(e)
- {
- var $toggle = $(this);
- var id = $(this).data('id');
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
- e.stopPropagation();
- e.preventDefault();
- });
-})
diff --git a/module/my/js/task.js b/module/my/js/task.js
deleted file mode 100644
index 1a619e9755..0000000000
--- a/module/my/js/task.js
+++ /dev/null
@@ -1,21 +0,0 @@
-$(function()
-{
- $(document).on('click', '.task-toggle', function(e)
- {
- var $toggle = $(this);
- var id = $(this).data('id');
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
-
- e.stopPropagation();
- e.preventDefault();
- });
- toggleFold('#myTaskForm', [], 0, 'my');
- $('#taskTable td.has-child .task-toggle').each(function()
- {
- var $td = $(this).closest('td');
- var labelWidth = 0;
- if($td.find('.label').length > 0) labelWidth = $td.find('.label').width();
- $td.find('a').eq(0).css('max-width', $td.width() - labelWidth - 60);
- });
-});
diff --git a/module/my/js/testcase.js b/module/my/js/testcase.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/my/js/todo.js b/module/my/js/todo.js
deleted file mode 100644
index 63544fc788..0000000000
--- a/module/my/js/todo.js
+++ /dev/null
@@ -1,42 +0,0 @@
-function changeDate(date)
-{
- date = date.replace(/\-/g, '');
- link = createLink('my', 'todo', 'type=' + date);
- location.href=link;
-}
-
-
-$(function()
-{
- // Support hash start with todo-1
- var hash = window.location.hash.toLowerCase();
- if(hash.indexOf('#todo-') === 0)
- {
- var todoId = hash.substr(6);
- var url = createLink('todo', 'view', 'id=' + todoId + '&from=my', '', 'yes');
- var $a = $('
');
- $a.attr({href: url}).modalTrigger(
- {
- 'data-toggle': 'modal',
- type: 'iframe'
- }).trigger('click');
- }
-
- $('#todoForm').table(
- {
- replaceId: 'todoIDList',
- statisticCreator: function(table)
- {
- var $table = table.getTable();
- var $checkedRows = $table.find('tbody>tr.checked');
- var checkedTotal = $checkedRows.length;
- var checkedWait = $checkedRows.filter("[data-status=wait]").length;
- var checkedDoing = $checkedRows.filter("[data-status=doing]").length;
- var checkedStatistics = checkedSummary.replace('%total%', checkedTotal)
- .replace('%wait%', checkedWait)
- .replace('%doing%', checkedDoing);
-
- return checkedTotal ? checkedStatistics : pageSummary;
- }
- });
-});
diff --git a/module/personnel/css/accessible.css b/module/personnel/css/accessible.css
deleted file mode 100644
index b3e2a08c1d..0000000000
--- a/module/personnel/css/accessible.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.c-id {width: 40px;}
-.c-department {width: 120px;}
-.c-user, .c-job {width: 80px;}
-.c-genders {width: 60px;}
diff --git a/module/personnel/css/addwhitelist.css b/module/personnel/css/addwhitelist.css
deleted file mode 100644
index c0f46f805e..0000000000
--- a/module/personnel/css/addwhitelist.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#object_chosen .chosen-single {width: 260px;}
-#dept_chosen .chosen-single {width: 220px;}
-#object_chosen .chosen-drop ul li .label {margin-top: 2px; background: #fff; color: #838a9d; border: 1px solid #d8d8d8;}
diff --git a/module/personnel/css/invest.css b/module/personnel/css/invest.css
deleted file mode 100644
index b975887bf1..0000000000
--- a/module/personnel/css/invest.css
+++ /dev/null
@@ -1 +0,0 @@
-.c-story {width: 150px;}
diff --git a/module/personnel/css/whitelist.css b/module/personnel/css/whitelist.css
deleted file mode 100644
index 1ce06e6c17..0000000000
--- a/module/personnel/css/whitelist.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.c-dept, .c-role {overflow:hidden; text-overflow: ellipsis; white-space: nowrap;}
-.c-phone {width: 120px;}
-.c-email {width: 200px;}
-.c-role {width: 105px;}
-#userList td{overflow:hidden}
diff --git a/module/personnel/js/accessible.js b/module/personnel/js/accessible.js
deleted file mode 100644
index d49d16d017..0000000000
--- a/module/personnel/js/accessible.js
+++ /dev/null
@@ -1,2 +0,0 @@
-$('#dept' + deptID).addClass('active');
-$(".tree .active").parent('li').addClass('active');
diff --git a/module/personnel/js/addwhitelist.js b/module/personnel/js/addwhitelist.js
deleted file mode 100644
index 2414f0c3d2..0000000000
--- a/module/personnel/js/addwhitelist.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Users by dept,execution,project,product or program.
- *
- * @param object $object
- * @access public
- * @return void
- */
-function setObjectUsers()
-{
- var copyID = $('#object').val();
- var deptID = $('#dept').val();
- var link = createLink(module, moduleMethod, 'objectID=' + objectID + '&deptID=' + deptID + '©ID=' + copyID + '&objectType=' + objectType + '&module=' + module);
- if(module == 'program') link = createLink(module, moduleMethod, 'objectID=' + objectID + '&deptID=' + deptID + '©ID=' + copyID + '&programID=' + programID + '&from=' + from);
-
- location.href = link;
-}
-
-/**
- * Add an item.
- *
- * @param object obj
- * @return void
- */
-function addItem(obj)
-{
- var dataID = $(obj).parent().parent().attr("data-id");
- var item = $("#addItem").html();
- index = Number(index) + 1;
- $("#whitelist" + dataID).after("
" + item + "
");
- $("#whitelist" + index).find("select").chosen();
-}
-
-/**
- * Delete an item.
- *
- * @param object obj
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#whitelistForm .table tbody').children().length < 2) return false;
-
- var $tr = $(obj).parent().parent();
- var val = $tr.find('input[name^="realnames"]').val();
- showItem(val);
-
- $tr.remove();
-}
-
-/**
- * Show the removed item.
- *
- * @param string val
- * @return void
- */
-function showItem(val)
-{
- $("#whitelistForm tr td select[name^='accounts']").each(function()
- {
- var select = this;
- $(this).children('option').each(function()
- {
- if($(this).html() == val)
- {
- $(this).css('display', '');
- }
- });
- });
-}
-
-/**
- * Hide the clicked item.
- *
- * @param object select
- * @param string val
- * @return void
- */
-function hideItem(select, val)
-{
- $(select).children('option').each(function()
- {
- if($(this).html() == val)
- {
- $(this).css("display", "none");
- }
- });
-}
-
-/**
- * Change user list.
- *
- * @return void
- */
-function changeUsers()
-{
- var select = {};
-
- $('#whitelistForm').on("chosen:showing_dropdown", "tr td select[name^='accounts']", function()
- {
- select = this;
-
- /* Render the item of the value which is selected before the page loads. */
- $("input[name='realnames[]']").each(function()
- {
- hideItem(select, this.value);
- });
-
- /* Render the item of the value which is selected after the page loads. */
- $("a[class^='chosen-single chosen-single-with-deselect']").each(function()
- {
- var id = $(select).parent().parent().attr('data-id');
- userList[id - 1] = $(this).children('span').html();
- hideItem(select, $(this).children('span').html());
- });
-
- $(select).trigger("chosen:updated");
- });
-}
-
-$(function()
-{
- if(window.config.currentModule == 'personnel' && window.config.currentMethod == 'addwhitelist') $("li[data-id='set']").addClass('active');
-
- userList = {};
-
- changeUsers();
-
- /* Listen the change of the select value. */
- $('#whitelistForm').on('change', "tr td select[name^='accounts']", function(e, data)
- {
- var select = this;
- $("#whitelistForm tr td select[name^='accounts']").each(function()
- {
- var id = $(select).parent().parent().attr('data-id');
- var val = typeof(data.deselected == 'undefined') ? userList[id] : data.deselected;
- showItem(val);
- });
- });
-
- $('#object_chosen').click(function()
- {
- if(objectType == 'sprint') $('#object_chosen ul li:first').append('
')
- })
-})
diff --git a/module/personnel/js/whitelist.js b/module/personnel/js/whitelist.js
deleted file mode 100644
index 8b07ec79c4..0000000000
--- a/module/personnel/js/whitelist.js
+++ /dev/null
@@ -1,4 +0,0 @@
-$(function()
-{
- if(window.config.currentModule == 'personnel' && window.config.currentMethod == 'whitelist') $("li[data-id='set']").addClass('active');
-});
diff --git a/module/pivot/css/bugcreate.css b/module/pivot/css/bugcreate.css
deleted file mode 100644
index 46f45e44f6..0000000000
--- a/module/pivot/css/bugcreate.css
+++ /dev/null
@@ -1,5 +0,0 @@
-#begin {min-width: 85px;}
-#end {min-width: 85px;}
-#bug th {font-size: 12px;}
-#bug th:nth-child(7) {width: 87px;}
-#bug th:nth-child(10) {width: 100px;}
diff --git a/module/pivot/css/preview.css b/module/pivot/css/preview.css
deleted file mode 100644
index f03f615606..0000000000
--- a/module/pivot/css/preview.css
+++ /dev/null
@@ -1,17 +0,0 @@
-#mainContent > .side-col.col-lg {width: 240px;}
-.main-col .btn-toolbar {margin-bottom: 10px;}
-.main-position {position: relative;}
-.child-position {position: absolute; right: 0;}
-.parent-position {padding-right: 160px;}
-.datagrid {overflow: auto;}
-.heading-padding, .datagrid-padding {padding-left: 6px; padding-right: 6px;}
-
-.filter-items > .table-row{display: table!important;}
-.filter-items .filter-item:first-child {padding-left: 0!important;}
-.filterBox {display: flex; margin-bottom: 20px; margin-left: 6px; margin-right: 6px;}
-.filter-items {display: flex; flex: 1; flex-wrap: wrap;}
-.filter-item {padding: 0 16px 5px 0;}
-.filter-item-grow {flex-grow: 1;}
-.queryBtn {display: flex; align-items: center; padding-bottom: 5px; flex-basis: 60px;}
-.filter-item .picker-selections {width: 128px; overflow: hidden; text-overflow: clip; white-space: nowrap;}
-#filterItems .picker-selections {overflow: hidden; text-overflow: clip; white-space: nowrap;}
diff --git a/module/pivot/css/productsummary.css b/module/pivot/css/productsummary.css
deleted file mode 100644
index d3aeb68419..0000000000
--- a/module/pivot/css/productsummary.css
+++ /dev/null
@@ -1,5 +0,0 @@
-td.child {padding-left: 15px;}
-.c-name {width: 200px;}
-.c-count {width: 70px;}
-#conditions {display: flex;}
-#conditions .condition-options {margin-left: 16px;}
diff --git a/module/pivot/css/projectdeviation.css b/module/pivot/css/projectdeviation.css
deleted file mode 100644
index 5ee6104e66..0000000000
--- a/module/pivot/css/projectdeviation.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-hours, .c-deviation, .c-deviation-rate {width: 100px;}
-.c-id {width: 70px;}
diff --git a/module/pivot/css/workload.css b/module/pivot/css/workload.css
deleted file mode 100644
index 04afc3d79f..0000000000
--- a/module/pivot/css/workload.css
+++ /dev/null
@@ -1 +0,0 @@
-.c-hours, .c-count, .c-workload {width: 100px;}
diff --git a/module/pivot/js/bugassign.js b/module/pivot/js/bugassign.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/pivot/js/bugcreate.js b/module/pivot/js/bugcreate.js
deleted file mode 100644
index b6f828a140..0000000000
--- a/module/pivot/js/bugcreate.js
+++ /dev/null
@@ -1,23 +0,0 @@
-function changeParams(obj)
-{
- var begin = $('#conditions').find('#begin').val();
- var end = $('#conditions').find('#end').val();
- var product = $('#conditions').find('#product').val();
- var execution = $('#conditions').find('#execution').val();
- if(begin.indexOf('-') != -1)
- {
- var beginarray = begin.split("-");
- var begin = '';
- for(i=0 ; i < beginarray.length ; i++) begin = begin + beginarray[i];
- }
- if(end.indexOf('-') != -1)
- {
- var endarray = end.split("-");
- var end = '';
- for(i=0 ; i < endarray.length ; i++) end = end + endarray[i];
- }
-
- var params = window.btoa('begin=' + begin + '&end=' + end + '&product=' + product + '&execution=' + execution);
- var link = createLink('pivot', 'preview', 'dimension=' + dimension + '&group=' + groupID + '&module=pivot&method=bugcreate¶ms=' + params);
- location.href = link;
-}
diff --git a/module/pivot/js/preview.js b/module/pivot/js/preview.js
deleted file mode 100644
index 3ba0b4e01f..0000000000
--- a/module/pivot/js/preview.js
+++ /dev/null
@@ -1,298 +0,0 @@
-$(function()
-{
- if(typeof pivotID == 'undefined' || !pivotID) return;
-
- expandTree();
- renderFilters(pivot);
- initQueryBtn();
-
- $('body').resize(() => {calcPreviewGrowFilter();});
-
- $('[data-toggle="tooltip"]').tooltip();
-});
-
-function expandTree()
-{
- $('.pivot-' + groupID + '-' + pivotID).addClass('active');
-
- var $tree = $('#pivotGroups').tree({name:'tree-group'});
- var tree = $tree.data('zui.tree');
- tree.expand($('.pivot-' + pivotID).parents('li'));
-}
-
-/*$('.btn-export').click(function()
-{
- if(typeof pivotID == 'undefined' || !pivotID) return;
- pivot = getQueryInfo();
-});
-*/
-
-function getQueryInfo()
-{
- var pivotInfo = pivot;
- pivotInfo.searchFilters = JSON.parse(JSON.stringify(pivotInfo.filters));
-
- if(isQueryFilter(pivotInfo.filters))
- {
- pivotInfo.filters.forEach(function(filter, index)
- {
- var find = $('#filterItems .filter-items').find('.filter-item-' + index + ' .form-' + filter.type);
- if(find.length != 0) pivotInfo.searchFilters[index].default = find.val();
- });
- }
- else
- {
- pivotInfo.filters.forEach(function(filter, index)
- {
- var filterItem = $('#filterItems .filter-items').find('.filter-item-' + index);
- var type = filter.type;
- if(type == 'input')
- {
- var find = filterItem.find(' .form-' + type);
- if(find.length != 0) pivotInfo.searchFilters[index].default = find.val();
- }
- else if(type == 'select')
- {
- var find = filterItem.find(' .form-' + type);
- if(find.length != 0) pivotInfo.searchFilters[index].default = find.data('zui.picker').getValue();
- }
- else if(type == 'date' || type == 'datetime')
- {
- var begin = filterItem.find('.form-' + type + '.begin');
- var end = filterItem.find('.form-' + type + '.end');
-
- pivotInfo.searchFilters[index].default =
- {
- "begin": begin.length != 0 ? begin.val() : filter.default.begin,
- "end": end.length != 0 ? end.val() : filter.default.end
- };
- }
- });
- }
-
- pivotInfo.step = 4;
- return pivotInfo;
-}
-
-/**
- * Init query button.
- *
- * @access public
- * @return void
- */
-function initQueryBtn()
-{
- $('.btn-query').click(function()
- {
- pivotInfo = getQueryInfo();
- $.post(createLink('pivot', 'ajaxGetPivot'), pivotInfo,function(resp)
- {
- var myDatagrid = $('#datagirdInfo');
- myDatagrid.find('.reportData').remove();
- myDatagrid.append(resp);
- });
-
- });
-}
-
-function calcPreviewGrowFilter()
-{
- if(pivot.filters.length <= 0) return;
- var $filterItems = $('#filterItems .filter-items');
- /* When refreshing this page, ZenTao load this page twice, when the first load isn't complete, jump back to index and load the second time,
- the first load can't calc filter width, can't get the element using jQuery at first load. */
- var hasInit = true;
- pivot.filters.forEach(function(filter, index)
- {
- var nowItem = '.filter-item-' + index;
- var $titleSpan = $filterItems.find(nowItem).find('.input-group-addon').first();
- if(!$titleSpan.length) hasInit = false;
- });
- if(!hasInit) return;
-
- var domWidth = $filterItems[0].getBoundingClientRect().width;
- var nowWidth = domWidth;
- var lineWrap = false;
- var nowCount = 0;
- var canGrowTotal = 0;
-
- $('.query-inside').addClass('hidden');
- $('.query-outside').addClass('visibility-hidden');
- pivot.filters.forEach(function(filter, index)
- {
- var nowItem = '.filter-item-' + index;
- var $nowDom = $filterItems.find(nowItem);
- var leftPadding = parseInt($nowDom.css('padding-left'));
- var rightPadding = parseInt($nowDom.css('padding-right'));
- var spanWidth = $nowDom.find('.input-group-addon').first()[0].getBoundingClientRect().width;
- var filterWidth = ((filter.type == 'input' || filter.type == 'select') ? WIDTH_INPUT : WIDTH_DATE) + (spanWidth + leftPadding + rightPadding);
-
- /* Clear the flex-basis and set flex-basic again. */
- $nowDom.css('flex-basis', '');
- $nowDom.css('flex-basis', filterWidth);
- if(nowWidth - filterWidth >= 0)
- {
- nowWidth -= filterWidth;
- nowCount ++;
- }
- else
- {
- canGrowTotal += nowCount;
- nowWidth = domWidth - filterWidth;
- nowCount = 1;
- lineWrap = true;
- }
- });
-
- /* Clear all filter filter-item-grow and add class to support grow element. */
- $filterItems.children().removeClass('filter-item-grow');
- pivot.filters.forEach(function(filter, index)
- {
- var $nowDom = $filterItems.find('.filter-item-' + index);
- if(canGrowTotal >= index + 1) $nowDom.addClass('filter-item-grow');
- if(filter.type == 'select' && $nowDom.find('.picker').length) $nowDom.find('.picker').find('.picker-selections').css('width', WIDTH_INPUT);
- });
-
- if(!lineWrap && nowWidth >= 60) $('.query-inside').removeClass('hidden');
- else $('.query-outside').removeClass('visibility-hidden');
-
- /* Set picker-selection width, default 128px. */
- waitForRepaint(function()
- {
- pivot.filters.forEach(function(filter, index)
- {
- var $nowDom = $filterItems.find('.filter-item-' + index);
- if(filter.type == 'select' && $nowDom.find('.picker').length)
- {
- var pickerWidth = $nowDom.hasClass('filter-item-grow') ? $nowDom.find('.picker')[0].getBoundingClientRect().width : WIDTH_INPUT;
- $nowDom.find('.picker').find('.picker-selections').css('width', pickerWidth);
- }
- });
- });
-
-}
-
-function renderFilters(pivot)
-{
- if(pivot.filters.length == 0) return;
- renderFilterItem(pivot.filters);
- calcPreviewGrowFilter();
-}
-
-function renderFilterItem(filters)
-{
- $('#filterItems .filter-items').empty();
- var tpl = isQueryFilter(filters) ? $('#queryFilterItemTpl').html() : $('#resultFilterItemTpl').html();
-
- filters.forEach(function(filter, index)
- {
- var data =
- {
- index: index,
- name: filter.name,
- defaultValue: filter.default
- };
- var html = $($.zui.formatString(tpl, data))
- $('#filterItems .filter-items').append(html);
-
- isQueryFilter(filters) ? initQueryControl(html, filter) : initResultControl(html, filter);
- });
- $('#filterItems .filter-items').append(queryDom);
-}
-
-function initQueryControl(container, filter, object, field)
-{
- var type = filter.type;
- var options = filter.typeOption;
- var value = filter.default;
-
- container.find('.default-block').addClass('hidden');
- container.find('.default-block input[name="default"]').val('');
-
- var control = container.find('.form-' + type);
- control.val(filter.default);
- control.parent('.default-block').removeClass('hidden');
-
- if(type == 'date') setDateField('.form-date');
- if(type == 'datetime') setDateField('.form-datetime');
- if(type == 'select')
- {
- var picker = control.data('zui.picker');
- if(picker) picker.destroy();
-
- $.post(createLink('pivot', 'ajaxGetSysOptions', 'type=' + options + '&object=' + object + '&field=' + field), function(resp)
- {
- control.html($(resp).html());
- control.picker();
- control.data('zui.picker').setValue(value);
- });
- }
-}
-
-function initResultControl(container, filter, object, field)
-{
- var type = filter.type;
- var value = filter.default;
-
- container.find('.default-block').addClass('hidden');
- container.find('.default-block input[name^="default"]').val('');
-
- var control = container.find('.form-' + type);
- if(type == 'date' || type == 'datetime')
- {
- container.find('.form-' + type + '.begin').val(filter.default.begin);
- container.find('.form-' + type + '.end').val(filter.default.end);
- }
- else
- {
- control.val(filter.default);
- }
- control.parents('.default-block').removeClass('hidden');
-
- if(type == 'date') control.datepicker();
- if(type == 'datetime') control.datetimepicker();
- if(type == 'select')
- {
- var picker = control.data('zui.picker');
- if(picker) picker.destroy();
-
- var fieldSetting = pivot.fieldSettings[filter.field];
- var options = fieldSetting.type;
- var object = fieldSetting.object;
- var field = fieldSetting.field;
-
- var pickerOptions =
- {
- multi: true,
- maxDropHeight: pickerHeight,
- onReady: function()
- {
- if(!control.parent().find('.picker')) return;
- if(window.getComputedStyle(control.parent().find('.picker').find('.picker-selections')[0]).getPropertyValue('width') !== 'auto')
- {
- var pickerWidth = control.parent().find('.picker')[0].getBoundingClientRect().width;
- control.parent().find('.picker').find('.picker-selections').css('width', pickerWidth);
- }
- }
- };
- if(value !== '') pickerOptions.defaultValue = value;
-
- var pivotParams = {sql: pivot.sql, filters: getQueryFilters(pivot)};
- $.post(createLink('pivot', 'ajaxGetSysOptions', 'type=' + options + '&object=' + object + '&field=' + field), pivotParams, function(resp)
- {
- control.html($(resp).html());
- control.picker(pickerOptions);
- });
- }
-}
-
-function exportData()
-{
- const $domObj = $(".table-condensed")[0];
- exportFile($domObj);
-}
-
-function isQueryFilter(filters)
-{
- return filters.length > 0 && filters[0].from == 'query';
-}
diff --git a/module/pivot/js/productsummary.js b/module/pivot/js/productsummary.js
deleted file mode 100644
index db3e923c06..0000000000
--- a/module/pivot/js/productsummary.js
+++ /dev/null
@@ -1,13 +0,0 @@
-$('#conditions input:checkbox').change(function()
-{
- var conditions = '';
- $('#conditions input:checkbox').each(function(i)
- {
- if($(this).prop('checked')) conditions += $(this).val() + ',';
- })
- conditions = conditions.substring(0, conditions.length - 1);
-
- var params = window.btoa('conditions=' + conditions);
- var link = createLink('pivot', 'preview', 'dimension=' + dimension + '&group=' + groupID + '&module=pivot&method=productSummary¶ms=' + params);
- location.href = link;
-})
diff --git a/module/pivot/js/projectdeviation.js b/module/pivot/js/projectdeviation.js
deleted file mode 100644
index b4ad884ff1..0000000000
--- a/module/pivot/js/projectdeviation.js
+++ /dev/null
@@ -1,36 +0,0 @@
-$(document).ready(function()
-{
- initChart();
-
- $('.icon-exclamation-sign').hover(function(){
- $('#desc').removeClass('hidden');
- }, function(){
- $('#desc').addClass('hidden');
- });
-});
-
-function changeDate(begin, end)
-{
- if(begin.indexOf('-') != -1)
- {
- var beginarray = begin.split("-");
- var begin = '';
- for(i=0 ; i < beginarray.length ; i++)
- {
- begin = begin + beginarray[i];
- }
- }
- if(end.indexOf('-') != -1)
- {
- var endarray = end.split("-");
- var end = '';
- for(i=0 ; i < endarray.length ; i++)
- {
- end = end + endarray[i];
- }
- }
-
- var params = window.btoa('begin=' + begin + '&end=' + end);
- var link = createLink('pivot', 'preview', 'dimension=' + dimension + '&group=' + groupID + '&module=pivot&method=projectdeviation¶ms=' + params);
- location.href = link;
-}
diff --git a/module/pivot/js/workload.js b/module/pivot/js/workload.js
deleted file mode 100644
index fb0fb71a2e..0000000000
--- a/module/pivot/js/workload.js
+++ /dev/null
@@ -1,85 +0,0 @@
-function changeParams(obj)
-{
- var begin = $('#conditions').find('#begin').val();
- var end = $('#conditions').find('#end').val();
- var workday = $('#conditions').find('#workday').val();
- var dept = $('#conditions').find('#dept').val();
- var assign = $('#conditions').find('#assign').val();
- var days = diffDate(begin, end);
-
- $('#days').val(days);
-
- if(begin.indexOf('-') != -1)
- {
- var beginarray = begin.split("-");
- var begin = '';
- for(i = 0; i < beginarray.length; i++) begin = begin + beginarray[i];
- }
- if(end.indexOf('-') != -1)
- {
- var endarray = end.split("-");
- var end = '';
- for(i = 0 ; i < endarray.length ; i++) end = end + endarray[i];
- }
-
- var params = window.btoa('begin=' + begin + '&end=' + end + '&days=' + days + '&workday=' + workday + '&dept=' + dept + '&assign=' + assign);
- var link = createLink('pivot', 'preview', 'dimension=' + dimension + '&group=' + groupID + '&module=pivot&method=workload¶ms=' + params);
- location.href = link;
-}
-
-/**
- * Convert a date string to date object in js.
- *
- * @param string $date
- * @access public
- * @return date
- */
-function convertStringToDate(dateString)
-{
- dateString = dateString.split('-');
- return new Date(dateString[0], dateString[1] - 1, dateString[2]);
-}
-
-/**
- * Compute the diff days of two date.
- *
- * @param string $date1
- * @param string $date1
- * @access public
- * @return int
- */
-function diffDate(date1, date2)
-{
- date1 = convertStringToDate(date1);
- date2 = convertStringToDate(date2);
- delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1;
-
- weekEnds = 0;
- for(i = 0; i < delta; i++)
- {
- if((weekend == 2 && date1.getDay() == 6) || date1.getDay() == 0) weekEnds ++;
- date1 = date1.valueOf();
- date1 += 1000 * 60 * 60 * 24;
- date1 = new Date(date1);
- }
- return delta - weekEnds;
-}
-
-$(function()
-{
- var options =
- {
- language: config.clientLang,
- weekStart: 1,
- todayBtn: 1,
- autoclose: 1,
- todayHighlight: 1,
- startView: 2,
- forceParse: 0,
- showMeridian: 1,
- minView: 2,
- format: 'yyyy-mm-dd',
- startDate: new Date()
- };
- $('input#begin,input#end').fixedDate().datetimepicker(options);
-});
diff --git a/module/product/css/all.css b/module/product/css/all.css
deleted file mode 100644
index 630c6a6e36..0000000000
--- a/module/product/css/all.css
+++ /dev/null
@@ -1,104 +0,0 @@
-@media screen and (min-width: 2048px) {.container {max-width: 2000px!important;}}
-@media screen and (min-width: 2560px) {.container {max-width: 2380px!important;}}
-
-.side-col .detail-content {padding-left: 10px; margin-top: 0px;}
-.tree li.has-list.open:before {border-left: none;}
-#programTree li {padding: 0 0 0 8px;}
-#programTree li.has-list {padding-left: 20px;}
-#programTree li > a {display: block; padding: 5px 0; border-radius: 2px; padding-left: 6px; height: 30px;}
-#programTree li > a > span {display: inline-block;}
-#programTree li > a > span + span {margin-left: 8px;}
-#programTree li.selected > a {background-color: #E8F3FC;}
-#programTree li.selected > a > span.title {color: #006AF1;}
-#programTree .label-id {border-color: #cbd0db; color: #7d8599;}
-#programTree .label.label-type {background: #fff; border: 1px solid #7d8599; color: #7d8599;}
-
-#programTree li > a > span.title {color: #3C4353; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
-#programTree li > a > span.user {color: #838a9d;}
-#programTree li > a > span.user > .icon-person {font-size: 14px; position: relative; top: -1px; color: #a6aab8;}
-
-#programTree li > .list-toggle {transform: rotate(0deg); width: 16px; height: 16px; border: 4px solid #a6aab8; border-radius: 2px; top: 7px;}
-#programTree li > .list-toggle:before {content: ' '; display: block; position: absolute; border: 1px solid #a6aab8; top: 2px; left: -3px; right: -3px; bottom: 2px; min-width: 0; transition: all .2s;}
-#programTree li > .list-toggle:hover:before,
-#programTree li > .list-toggle:hover {border-color: #006AF1;}
-#programTree li.open > .list-toggle {width: 12px; height: 12px; top: 9px; background-color: #a6aab8; border-width: 3px; left: 3px;}
-#programTree li.open > .list-toggle:before {border: none; height: 2px; width: 6px; left: 0; top: 2px; background: #fff;}
-#programTree li.open > .list-toggle:hover {background: #006AF1;}
-
-#programTree ul > li:after {display: block; position: absolute; content: ' '; border-top: 2px solid #cbd0db; top: 14px; left: -12px; z-index: 1; width: 10px;}
-#programTree ul > li:before,
-#programTree ul > li.has-list:before {background: none; content: ' '; display: block; position: absolute; width: auto; height: auto; border: none; border-left: 2px solid #cbd0db; top: -13px; bottom: 12px; left: -12px;}
-#programTree ul > li:last-child:before {bottom: auto; height: 29px;}
-#programTree ul > li:first-child:before {top: -9px;}
-#programTree ul > li.has-list:first-child:before {top: -13px;}
-#programTree ul > li.tree-single-item:before {height: 23px;}
-#programTree ul > li.has-list:after {width: 14px;}
-#programTree ul > li.item-meas a.selected {color: #0c64eb;}
-.side-col {padding-right: 20px; width: 18%;}
-#sidebar > .cell {width: 100%;}
-
-th.c-name {width: 400px;}
-th.c-PO {width: 100px;}
-th.c-story {width: 290px;}
-th.c-bug {width: 150px;}
-th.c-plan {width: 45px;}
-th.c-release {width: 50px;}
-th.c-actions {width: 50px;}
-.c-name {border-left: none !important;}
-.icon-cards-view {color: #888fa1;}
-[lang='en'] .en-wrap-text {white-space: normal; height: 24px; line-height: 1; font-size: 12px;}
-
-#productListForm thead > tr > th,
-#productListForm tbody > tr > td {text-align: center; text-overflow: unset!important}
-#productListForm thead > tr > th {padding: 0; line-height: 24px;}
-#productListForm thead > tr:first-child > th {border-left: 1px solid #ddd;}
-#productListForm thead > tr > th.c-checkbox {border-left: none; padding-left: 15px; width: 30px;}
-#productListForm tbody > tr > td {padding: 2px 4px;}
-#productListForm tbody > tr > td:first-child {text-align: left; padding-left: 15px;}
-#productListForm tbody > tr > td.table-nest-title {padding-left: 16px; display: flex; align-items: center;}
-#productListForm th.table-nest-title .nest-has-checkbox {margin-top: 7px; margin-left: 35px;}
-#productListForm th.table-nest-title .nest-none-checkbox {margin-top: 8px; margin-left: 5px;}
-#productListForm th.table-nest-title .header {margin-left: 5px;}
-#productListForm th.table-nest-title .sort-up {padding-left: 5px;}
-#productListForm th.table-nest-title .sort-down {padding-left: 5px;}
-#productListForm th.table-nest-title .table-nest-toggle {top: 14px; left: auto; right: 10px; opacity: .6;}
-#productListForm th.table-nest-title .table-nest-toggle::before {position: absolute; top: 0 !important; right: 0; bottom: 0; left: 0;}
-#productListForm th.table-nest-title .table-nest-toggle:hover {opacity: 1;}
-#productListForm .table.has-sort-head thead > tr > th > a:after,
-#productListForm .table.has-sort-head thead > tr > th > a:before {top: -3px;}
-#productListForm .icon-product:before {content: '\e98f'; width: 22px; height: 22px; background: none; color: rgb(166, 170, 184); top: 0; line-height: 22px; margin-right: 2px; font-size: 14px;}
-#productTableList td.table-nest-title > span.icon.table-nest-toggle {vertical-align: middle;}
-#productTableList > tr[data-nest-parent] {background: #f8f8f8;}
-#productList > thead th.table-nest-title.c-name {position: relative; padding-left: 16px !important;}
-
-@media screen and (max-width: 1460px)
-{
- th.c-name {width: auto;}
- [lang^='zh-'] th.c-requirement {width: 260px;}
- [lang^='zh-'] th.c-story {width: 260px;}
-}
-@media screen and (max-width: 1300px)
-{
- [lang^='zh-'] th.c-requirement {width: 240px;}
- [lang^='zh-'] th.c-story {width: 240px;}
-}
-
-@media screen and (max-width: 1250px)
-{
- #productListForm thead > tr > th {font-size: 12px;}
- th.c-requirement {width: 265px;}
- th.c-story {width: 265px;}
- [lang^='zh-'] th.c-requirement {width: 220px;}
- [lang^='zh-'] th.c-story {width: 220px;}
-}
-
-#productTableList .c-name > span.table-nest-icon {width: 0; visibility: hidden;}
-#productTableList > tr.row-line.is-nest-child > td.text-left.table-nest-title > span.table-nest-icon.icon:before{content: '\e6f2'; background-color: white; display: inline;}
-#productTableList > tr.row-line.no-nest > td.text-left.table-nest-title > span.table-nest-icon.icon:before{content: '\e6f2'; background-color: white; display: inline;}
-.statistic {margin-left: 10px; color: #838a9d; float: left; position: relative; line-height: 28px;}
-.table-footer.fixed-footer .statistic {color: #fff;}
-#productTableList .c-manager {padding-left: 14px;}
-#productTableList .c-manager a {top: 7px; left: 22px;}
-.checkbox-primary {margin-right: 10px;}
-.table-nest-title > a, .table-nest-title > span {padding-left: 2px;}
-.table-nest-icon {font-size: 14px; top: 50%;}
diff --git a/module/product/css/batchedit.css b/module/product/css/batchedit.css
deleted file mode 100644
index e030abd28d..0000000000
--- a/module/product/css/batchedit.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.picker-single .picker-selection-remove {z-index: 999 !important;}
-
-.c-id {width: 60px;}
-.c-program, .c-line {width: 150px;}
-.c-desc {width: 200px;}
-.c-acl {width: 120px;}
diff --git a/module/product/css/browse.css b/module/product/css/browse.css
deleted file mode 100644
index 75f034788f..0000000000
--- a/module/product/css/browse.css
+++ /dev/null
@@ -1,44 +0,0 @@
-#createActionMenu .dropdown-menu {width: 100%;}
-#productStoryForm table tbody tr td {overflow: hidden; white-space: nowrap;}
-
-.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
-.dropdown-menu > .menu-search .input-group {width: 100%;}
-.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666;}
-.dropdown-menu > .menu-search .form-control {border: none !important; box-shadow: none !important; border-top: 1px solid #ddd !important;}
-.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
-.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
-.dropdown-list > li > a:hover,
-.dropdown-list > li > a:focus {color: #1a4f85; text-decoration: none; background-color: #ddd;}
-#productStoryForm .setting {height: 25px;}
-
-.pl-5px {padding-left: 5px;}
-.popoverStage {position: relative;}
-.popoverStage .icon-caret-down {position: absolute;}
-a.removeModule {color: #ddd;}
-a.removeModule:hover {color: red;}
-
-.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
-.table td.has-child > a:not(.story-toggle) {max-width: 90%; max-width: calc(100% - 50px); display: inline-block; overflow: hidden; text-overflow: clip; white-space: nowrap;}
-.table td.has-child > .story-toggle {color: #838a9d; position: relative; top: 1px; left: 2px;}
-.table td.has-child > .story-toggle:hover {color: #006af1; cursor: pointer;}
-.table td.has-child > .story-toggle > .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -o-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
-.table td.has-child > .story-toggle > .icon:before {text-align: left;}
-.table td.has-child > .story-toggle.collapsed > .icon {-ms-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg);}
-.table td.c-estimate {padding-right: 12px;}
-.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
-.table-footer {z-index: 1;}
-@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};}
-
-#batchUnlinkStoryTip .modal-body {padding-top: 10px; max-height: 400px; overflow: auto;}
-#batchUnlinkStoryTip .table thead {position: fixed;}
-#batchUnlinkStoryTip .table tbody {position: relative; top: 33px; display:block; overflow-y: scroll; max-height: 260px;}
-#batchUnlinkStoryTip .table tfoot {position: relative; bottom: -30px;}
-#batchUnlinkStoryTip .table td {border-bottom: 0px;}
-#batchUnlinkStoryTip .table th:first-child {width: 460px;}
-#mainMenu .dropdown-menu>li>a>.icon {top: 4px;}
-#productStoryForm tbody tr td .label {max-width: 100px; text-overflow: unset;}
-.c-span {margin-left: 19px;}
-.btn-toolbar #query span.text{overflow: hidden; width: 52px; vertical-align: middle; margin-right: 1px;}
-#linkStoryByPlan .modal-header {padding: 20px 0 10px 0; border-bottom: 0px}
\ No newline at end of file
diff --git a/module/product/css/dynamic.css b/module/product/css/dynamic.css
deleted file mode 100644
index 8ef4ebd3a6..0000000000
--- a/module/product/css/dynamic.css
+++ /dev/null
@@ -1,35 +0,0 @@
-#mainMenu .btn-group ul.dropdown-menu {max-height: 300px; overflow: auto;}
-#dynamics {padding: 10px 0;}
-.dynamic {position: relative; padding-left: 170px;}
-.dynamic-date {position: absolute; left: 0; top: 0; width: 150px; border: 2px solid #eee; border-radius: 4px; padding: 14px 20px; height: 58px;}
-.dynamic-date:before {content: ' '; display: block; position: absolute; right: -22px; top: 26px; height: 2px; width: 20px; background-color: #eee;}
-.dynamic-date > .date-label,
-.dynamic-date > .date-text {font-size: 18px; display: block;}
-.dynamic-date > .date-label + .date-text {font-size: 14px; line-height: 14px;}
-.dynamic-date > .date-label {margin-top: -8px;}
-.dynamic-date > .btn {position: absolute; right: 10px; top: 15px;}
-.dynamic .timeline {border: 2px solid #eee; border-radius: 4px; margin-bottom: 20px; padding: 10px 20px 10px 100px; transition: max-height .2s; overflow: hidden;}
-.dynamic .timeline-tag {left: -75px; font-size: 14px; color: #838A9D;}
-.dynamic .timeline-text {color: #3C4353;}
-.dynamic .text-muted {color: #838A9D;}
-.dynamic .label-id {top: -1px; border: 1px solid rgba(131,138,157,0.25); color: #838A9D;}
-.dynamic.active .timeline,
-.dynamic.active .dynamic-date {border-color: #00a9fc;}
-.dynamic.active .dynamic-date:before {background-color: #00a9fc;}
-.dynamic.collapsed .timeline {max-height: 58px;}
-.dynamic.collapsed .timeline > li + li {display: none;}
-.dynamic.collapsed .dynamic-btn > .icon:before {content: '\f0d8';}
-
-.timeline > li:before {left: -26px;}
-.timeline > li + li:after {left: -23px;}
-.timeline-text {margin-left: -18px;}
-.label-action {padding: 0 4px;}
-.label-id {margin-left: 4px;}
-.timeline > li.active:before {left: -30px;}
-.timeline > li.collected:before, .timeline > li.releaseddoc:before {background-color: #FFF;}
-.timeline > li.collected > div:after {background-color: #FFAF65;}
-.timeline > li.releaseddoc > div:after {background-color: #66A2FF;}
-.timeline > li > div:after {left: -27px;}
-.timeline .timeline-text {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-.timeline > li > div > .timeline-tag, .timeline > li > div > .timeline-text > .label-action {color: #838A9D;}
-.timeline > li > div > .timeline-text > a {color: #313C52;}
diff --git a/module/product/css/index.css b/module/product/css/index.css
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/product/css/kanban.css b/module/product/css/kanban.css
deleted file mode 100644
index 14266095ad..0000000000
--- a/module/product/css/kanban.css
+++ /dev/null
@@ -1,2 +0,0 @@
-#showSettingsBox {text-align:right; margin-top:-15px; margin-right:4px;}
-#showSettingsBox .checkbox-primary {display:inline-block;}
diff --git a/module/product/css/manageline.css b/module/product/css/manageline.css
deleted file mode 100644
index edb03f21a7..0000000000
--- a/module/product/css/manageline.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.row-module {max-width: 600px; min-width: 400px;}
-.row-module + .row-module {margin-top: 5px;}
-.col-module {min-width: 200px;}
-.col-module .form-control {border-radius: 2px 0 0 2px;}
-.col-module select.form-control {border-radius: 0 2px 2px 0; border-left-width: 0;}
-.col-module select.form-control:focus {margin-left: -1px; border-left-width: 1px;}
-.col-module {padding-right: 10px;}
-.col-programs .form-control {border-radius: 0 2px 2px 0; border-left-width: 0;}
-.col-programs .form-control:focus {margin-left: -1px; border-left-width: 1px;}
-.col-actions {width: 80px; padding-left: 5px;}
-
-#modulesTree li {padding-left: 20px;}
-#modulesTree li > .list-toggle {top: 0;}
-
-#lineForm table tr > td.text-middle span {display: block; float: left;}
-.tree li> .module-name {display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
diff --git a/module/product/css/project.css b/module/product/css/project.css
deleted file mode 100644
index edf6f9fe5c..0000000000
--- a/module/product/css/project.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.checkbox-primary {margin-top: 6px;}
-.tip {display: inline-block; vertical-align: middle; margin-top: 6px;}
-#mainMenu .icon.icon-help {margin-left: 5px;}
-td.padding-right {padding-right: 20px !important}
-
-.c-program {width: 150px;}
-.c-progress {width: 70px;}
-[lang^=zh].c-progress {width: 60px;}
diff --git a/module/product/css/roadmap.css b/module/product/css/roadmap.css
deleted file mode 100644
index a3746e142b..0000000000
--- a/module/product/css/roadmap.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.branch-nav {margin: -10px 0 25px;}
-.release-paths {position: relative;}
-.release-path {margin-left: 160px; position: relative; overflow: visible;}
-.release-head {position: absolute; left: -150px; bottom: 105px; width: 120px; border: 2px solid #EEEEEE; border-radius: 4px; font-size: 20px; padding: 5px 10px; text-align: center;}
-.release-head .subtitle {font-size: 12px; color: #7B8599;}
-.release-line {margin: 0; padding-bottom: 40px;}
-.release-line > li > a:before {border-color: #00da88;}
-.release-line > li:nth-child(even) > a {padding-bottom: 38px;}
-.release-link-line {pointer-events: none; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+YAAADiCAMAAAD0xy2eAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABOUExURUdwTOXl5eXl5ebm5ufn5+rq6u7u7unp6eXl5f///+Xl5eXl5efn5+Xl5eXl5eXl5ebm5uXl5eXl5ebm5ubm5ubm5uXl5ebm5uXl5eXl5Uh6G7kAAAAZdFJOUwDuuVQtFQwg1gXH+Dpzoq1CmIV7aEuOX+MTWsN0AAAGrUlEQVQYGe3ACbaYOHRF0SuQkETfw5v/RPNdLpMZZKWez5buVQBcu8zmJACO1WOwcAqAZ7kx66MAeNa+ZncnAI51t1kvAK7F/hEAAAAAAACA/xP93gmAZ6tZOKsAODb2ZuUSAM/aYtZEAXCsTsFs7gTAse4eigD4lqMAAAAAAMD/D09/CYBrvVl/CYBjdXrN+lUAHOumYNavAuBYNwWzTQA866ZwCYBvnQAAAAD8V7RHEgDParHhzgLg2NqYDXMUAMfiPJg1qwA4lu/BbBMAz7rjvQTAtyoAAOBG1wmAb1O4swB4NptZcwmAY3EbzN4pCYBfaSpmwywAnl2NNQLgW44CAABuZAHwLQ1lSgLg2BjMhuUSAL9q25jZu2cB8CsfxcweAfBsnYcsAL51AgAAboxL2wmAZ5vZMF9VANxKZ29mYRsFwK98FDN7swA4Fvc3VAHwLQsAALgxlSMKgGeNmZU9CoBb9dqCmb33KABu1XV7zSwJgGfjPQsAALixHlEAXJvN3u3qBMCtdXvNbGjOLABuxaO3H1EAHEvPUgQAANwYlycLgGe7mZX76gTAq3wuwcyGZsoC4FUd997MLgHwLLVbJwB/j7UTANeyDf2+dgLgVuwHMxv6fa0C4FR37b39WATAse66+0kA/h45CYBvjZX5yQLg1xLsR1imsQqATzVOy2s/kgA4lp+tEYC/R9rOsRMAx1r7UebjygLgU57mMtgvswC4VeNzN++hT0oC4FDVZ7ehLPe55ioAPu3BfhseAXCqi+2xNa9d+rTnFTsB8KLqH7Xq09iPoTTzngXApXNrSrBfRn1i7ATAlS5e5570KWbD2y/b8XQC4NJSgv2W9RljrgLgR5fH9tznqk8ws1D6ZTs6AXCp6d/B/lH1Oc52jakKgBcpj+156FPtt1B6AXCp27elKcHMgj5d6Zdtn55rzALgRcpRn2x/vPrUMaYqAP9hVZ8a1/Y87rnpG32y/Qhv38y7ALiU+xIG+6Xok5r5Ps52jbkTABe6PF5Pq89ofxR9upg7AXAiXc+0b0tT3kaf0cyGtzTLdgqAS2N5B/tHo09ctn162jGmKgAedDmu7Xnp09ofjT5dTFUAnEjtedzz0pd30+cxs/D2zXy3AuBSW4L9tumzzvdxtmvMnQC40OXxes5Vn8n+2PTpkgC4EZ9p35amvMOuz2QWSr/M9zQKgEtTsH/t+qzH2a4xVQFwoaY4Xs+0r/rs9lsopwC4tO7b0pcwmJ367KVftn16rjEJgBddTvrM9sejT46pCoATKY7tedxz06/6zGYWSr9sexQAl+4S7LdLn3Z6rpirAHiR4tieR9ansX+E0o8C4NJzz015BzMb9bmX7TjbMXcC4EaXx06fYv8aogC4NLbnvi19CZb06Usz38dzjVkA/Kj6X8H+SPpUAfAjxfWZ9rnp36pPCKWZ7+m5ogC4VAf7o+rTCYAjKa7PdM9Nr0+1UJr5ntoxC4BLebB/BQFwKsX1me6lb/RJ89HGKgB+jfZLae5zFACX0nk3xX5pBMCvGttjnvRJWQB8myw0e5sFwK0p2C+h2aMAOJXbvQlm1gqAZ/k6sgD8PfpmXzsB8KuzX8rWZgFwKrV3P9iPIgB+1fFoQi8AziV9qgA4d4bljALg2GY/3vnJAuBVfubXfryrAPgVzyVYFgDfogD8Per8JAHwbDWzfh+rAHiVpmYws7CcWQC8qtddzOwWAM/yuawCAABu9HPbCYBj2cyG5swC4FacevtR9lEA3ErPEswWAfCsrncrAADgxraPAuBZN5i921oFwK31fs0szG0nAG7FvZhZLwCe5ak/BAAA3FizAPj2WjmyAPjVzcHMyhEFwK16zcHMyiQAftVrCzYLgGt1jQIAAG7MRxYAz7KZ9VMWALfqNQcz66ckAG7VdhnM7BYAx2q7DKcA+NZ1AgAAXtSyjQLg2WVm7x4FwK94v2ZWpiwAfo1bMLNJAByr1zyMAuBbJwAA4EYsUxYAzw4za55OANyq1zKYDctVBcCt7mnMLIwC4Fg+ytAJgG9ZAADAjWuPAuBaY9afSQD8GrdgNixXFQC3atuYWbirAPiVpmJFAHyLqwAAgBtjEgDX6jssVxUAv9IymIU7CoBfaSpm1p9JAPwat2A2C4BntW1WAQAAAPiPyGVKAuDZYTYslwD4VdvGzN49C4Bf6Shm1kQBcGydhyEJgGvdJQAA4EZOAuDbMiyrAHi2mNl7ZAHwKx2vmTVXFQC/1mUw6wXAszSVQwCcqwIAAG4cSQBcW4ckAK7lU/8D/a9fSZZlwxkAAAAASUVORK5CYII="); height: 196px; position: absolute; left: 10px; right: 100px; top: 97px; background-size: 100% 100%; background-repeat: no-repeat;}
-.release-line li .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-.branch-nav .nav li { max-width: 200px; white-space: nowrap; overflow: hidden; }
diff --git a/module/product/css/track.css b/module/product/css/track.css
deleted file mode 100644
index 6073a2d327..0000000000
--- a/module/product/css/track.css
+++ /dev/null
@@ -1 +0,0 @@
-.table td {text-align: left; padding: 2px 8px !important;}
diff --git a/module/product/css/view.css b/module/product/css/view.css
deleted file mode 100644
index 71d10b732b..0000000000
--- a/module/product/css/view.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.branch-list {padding-left: 0; margin: 0;}
-.branch-list > li {float: left; list-style: none; width: 50%; margin: 5px 0;}
-.table-data tbody > tr > th {width: 110px;}
-.col-12 .cell table td {word-wrap: break-word; word-break: normal;}
-td.normal {color: #00da88;}
-td.acl {white-space: nowrap;}
-.row > .col-sm-12:first-child {padding-bottom: 20px;}
-.c-product ,.c-release ,.c-code {width: 100px !important;}
-.c-openedBy ,.c-acl ,.c-prs ,.c-common {width:110px !important;}
-.c-bugs ,.c-type {width:120px !important;}
-.c-release {padding-right: 20px !important;}
diff --git a/module/product/js/all.js b/module/product/js/all.js
deleted file mode 100644
index f437fc574a..0000000000
--- a/module/product/js/all.js
+++ /dev/null
@@ -1,216 +0,0 @@
-$("#" + browseType + "Tab").addClass('btn-active-text');
-
-/**
- * Set batch edit checkbox.
- *
- * @access public
- * @return void
- */
-function setCheckbox()
-{
- $('#productListForm .c-checkbox, #productListForm .check-all').hide();
- $('.c-name').css('border-left', 'none');
- $(":checkbox[name^='productIDList']").prop('checked', false);
- $('.check-all, .program-checkbox, .row-product').removeClass('checked');
- if($.cookie('showProductBatchEdit') == 1)
- {
- $('#productListForm .c-checkbox, #productListForm .check-all').show();
- $('.c-name').css('border-left', '1px solid #ddd');
- }
- else
- {
- $('.table-actions').hide();
- $('#productsCount').show();
- }
-}
-
-/**
- * Update prarent checkbox.
- *
- * @param object $parent
- * @access public
- * @return void
- */
-function updatePrarentCheckbox($parent)
-{
- var $row = $parent.closest('tr');
- var $checkbox = $row.find('.program-checkbox');
- var rowID = $row.data('id');
- var $subRows = $('#productTableList').children('.row-product[data-nest-path^="' + rowID + ',"],.row-product[data-nest-path*=",' + rowID + ',"]');
- var allCount = $subRows.length;
- var selectedCount = $subRows.find('input:checkbox:checked').length;
- var isAllChecked = allCount > 0 && allCount === selectedCount;
- $checkbox.toggleClass('checked', isAllChecked)
- .toggleClass('indeterminate', selectedCount > 0 && selectedCount < allCount);
- $row.toggleClass('checked', isAllChecked);
-}
-
-/**
- * Update all checkbox.
- *
- * @access public
- * @return void
- */
-function updateCheckboxes()
-{
- $('#productTableList').children('.row-program,.row-line').each(function()
- {
- updatePrarentCheckbox($(this))
- });
-}
-
-/**
- * Add a statistics prompt statement after the Edit button.
- *
- * @access public
- * @return void
- */
-function addStatistic()
-{
- var checkedLength = $(":checkbox[name^='productIDList']:checked").length;
- if(checkedLength > 0)
- {
- var summary = checkedProducts.replace('%s', checkedLength);
- if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('products', 'product');
-
- var statistic = "
" + summary + "
";
- $('#productsCount').hide();
- $('#productsSummary').remove();
- $('#editBtn').after(statistic);
- $('.table-actions').show();
- }
- else
- {
- $('.table-actions').hide();
- $('#productsCount').show();
- $('#productsSummary').addClass('hidden');
- }
-}
-
-/**
- * Anti shake operation for jquery.
- *
- * @param fn $fn
- * @param delay $delay
- * @access public
- * @return void
- */
-function debounce(fn, delay)
-{
- var timer = null;
- return function()
- {
- if(timer) clearTimeout(timer);
- timer = setTimeout(fn, delay)
- }
-}
-
-/**
- * Update statistics.
- *
- * @access public
- * @return void
- */
-function updateStatistic()
-{
- debounce(addStatistic(), 200)
-}
-
-$(function()
-{
- $('input[name^="showEdit"]').click(function()
- {
- $.cookie('showProductBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
- setCheckbox();
- });
- setCheckbox();
-
- /* Init table sort. */
- $('#productTableList').addClass('sortable').sortable(
- {
- /* Init vars. */
- reverse: orderBy === 'order_desc',
- selector: 'tr',
- dragCssClass: 'drag-row',
- trigger: '.sort-handler',
-
- /* Set movable conditions. */
- canMoveHere: function($ele, $target)
- {
- var canMove = true;
- if($ele.hasClass('no-nest')) canMove = $target.hasClass('no-nest') ? true : false;
- return $ele.data('parent') === $target.data('parent') && canMove;
- },
- start: function(e)
- {
- e.targets.filter('[data-parent!="' + e.element.attr('data-parent') + '"]').addClass('drop-not-allowed');
- },
-
- /* Update order sort. */
- finish: function(e)
- {
- var products = '';
- e.list.each(function()
- {
- products += $(this.item).data('id') + ',' ;
- });
- $.post(createLink('product', 'updateOrder'), {'products' : products, 'orderBy' : orderBy});
-
- $('#productListForm').table('initNestedList');
- }
- });
-
- $('.main-table').on('click', 'tr', function(e)
- {
- if($.cookie('showProductBatchEdit') == 1) updateStatistic();
- });
-
- $('#productTableList').on('click', 'tr', function(e)
- {
- if($.cookie('showProductBatchEdit') != 1) e.stopPropagation();
- });
-
- $('#productTableList').on('click', '.row-program,.row-line', function(e)
- {
- if($.cookie('showProductBatchEdit') != 1) return;
- if($(e.target).closest('.table-nest-toggle,a').length) return;
-
- var $row = $(this);
- var $checkbox = $row.find('.program-checkbox').toggleClass('checked').removeClass('indeterminate');
- var isChecked = $checkbox.hasClass('checked');
- var rowID = $row.data('id');
- var $subRows = $('#productTableList').children('tr[data-nest-path^="' + rowID + ',"],tr[data-nest-path*=",' + rowID + ',"]');
- $row.toggleClass('checked', isChecked);
- $subRows.toggleClass('checked', isChecked);
- $subRows.find('input:checkbox').prop('checked', isChecked);
- $subRows.find('.program-checkbox').toggleClass('checked', isChecked).removeClass('indeterminate');
-
- var parentID = $row.attr('data-parent');
- if(parentID && parentID !== '0')
- {
- updatePrarentCheckbox($('#productTableList>tr[data-id="' + parentID + '"]'));
- }
- updateStatistic()
- });
-
- $('#productListForm').on('checkChange', updateCheckboxes);
- updateCheckboxes();
-
- $(":checkbox[name^='productIDList']").on('click', function()
- {
- updateStatistic()
- });
-
- $(".check-all").on('click', function()
- {
- if($(":checkbox[name^='productIDList']:not(:checked)").length == 0)
- {
- $(":checkbox[name^='productIDList']").prop('checked', false);
- }
- else
- {
- $(":checkbox[name^='productIDList']").prop('checked', true);
- }
- updateStatistic()
- });
-});
diff --git a/module/product/js/batchedit.js b/module/product/js/batchedit.js
deleted file mode 100644
index 7349ccdd1a..0000000000
--- a/module/product/js/batchedit.js
+++ /dev/null
@@ -1,29 +0,0 @@
-$(function()
-{
- $("input[type='radio'][value='open']").parent().each(function()
- {
- this.title = openTip;
- });
-
- $("input[type='radio'][value='private']").parent().each(function()
- {
- this.title = privateTip;
- });
-})
-
-/**
- * Load product lines by program.
- *
- * @param int $programID
- * @param int $productID
- * @access public
- * @return void
- */
-function loadProductLines(programID, productID)
-{
- var link = createLink('product', 'ajaxGetLine', 'programID=' + programID + '&productID=' + productID);
- $('#line_' + productID).load(link, function()
- {
- $('#lines' + productID).picker();
- });
-}
diff --git a/module/product/js/browse.js b/module/product/js/browse.js
deleted file mode 100644
index cc02275ff8..0000000000
--- a/module/product/js/browse.js
+++ /dev/null
@@ -1,194 +0,0 @@
-$(function()
-{
- if(typeof(rawModule) == 'undefined') rawModule = 'product';
-
- $('#navbar .nav li').removeClass('active');
- $("#navbar .nav li[data-id=" + storyType + ']').addClass('active');
-
- if(vision != 'lite' && rawModule == 'projectstory' && !projectHasProduct && URAndSR)
- {
- $('#navbar .nav>li[data-id=story]').addClass('active');
- $('#navbar .nav>li[data-id=story]>a').html($('.active [data-id=' + storyType + ']').text() + '
');
- }
-
- $(document).ready(function(){
- var $title = $('#storyList thead th.c-title');
- var headerWidth = $('#storyList thead th.c-title a').innerWidth();
- var buttonWidth = $('#storyList thead th.c-title button').innerWidth();
- if($title.width() < headerWidth + buttonWidth + 16) $title.width(headerWidth + buttonWidth + 30);
- });
-
- $('#toTaskButton').on('click', function()
- {
- var planID = $('#plan').val();
- if(planID)
- {
- parent.location.href = createLink('projectstory', 'importPlanStories', 'projectID=' + projectID + '&planID=' + planID + '&productID=' + productID);
- }
- })
-
- $(document).on('click', '.story-toggle', function(e)
- {
- var $toggle = $(this);
- var id = $(this).data('id');
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
-
- e.stopPropagation();
- e.preventDefault();
- });
-
- // Fix state dropdown menu position
- $('.c-stage > .dropdown').each(function()
- {
- var $this = $(this);
- var menuHeight = $(this).find('.dropdown-menu').outerHeight();
- var $tr = $this.closest('tr');
- var height = 0;
- while(height < menuHeight)
- {
- var $next = $tr.next('tr');
- if(!$next.length) break;
- height += $next.outerHeight;
- }
- if(height < menuHeight)
- {
- $this.addClass('dropup');
- }
- });
-
- toggleFold('#productStoryForm', unfoldStories, productID, 'product');
-
- adjustTableFooter();
- $('body').on('click', '#toggleFold', adjustTableFooter);
- $('body').on('click', '.icon.icon-angle-double-right', adjustTableFooter);
-
- /* Get checked stories. */
- $('#importToLib').on('click', function()
- {
- var storyIdList = '';
- $("input[name^='storyIdList']:checked").each(function()
- {
- storyIdList += $(this).val() + ',';
- $('#storyIdList').val(storyIdList);
- });
- });
-
- $('#reviewItem ~ ul > li').on('click', function()
- {
- var storyIDList = new Array();
- var storyString = '';
- var reviewStoryTips = '';
- $("input[name^='storyIdList']:checked").each(function()
- {
- storyIDList.push($(this).val());
- });
-
- $.each(storyIDList, function(storyKey, storyValue)
- {
- var getStoryReview = createLink('product', 'ajaxGetReviewers', "productID=" + productID + "&storyID=" + storyValue);
-
- $.ajaxSettings.async = false;
- $.get(getStoryReview, function(data)
- {
- var reviewer = new Array();
- $(data).find('option:selected').each(function()
- {
- reviewer.push($(this).val());
- });
-
- if($.inArray(account, reviewer) == -1) storyString += ' #' + storyValue;
- });
- $.ajaxSettings.async = true;
- });
-
- reviewStoryTips = reviewStory.replace("%s", storyString);
- if(storyString !== '') alert(reviewStoryTips);
- });
-
- $('#batchUnlinkStory').click(function()
- {
- var storyIdList = '';
- $("input[name^='storyIdList']:checked").each(function()
- {
- storyIdList += $(this).val() + ',';
- });
-
- $.get(createLink('projectstory', 'batchUnlinkStory', 'projectID=' + projectID + '&storyIdList=' + storyIdList), function(data)
- {
- if(data)
- {
- $('#batchUnlinkStoryTip tbody').html(data);
- $('#batchUnlinkStoryTip').modal({show: true});
- }
- else
- {
- window.location.reload();
- }
- });
- });
-
- $('#batchUnlinkStoryTip .close, #confirmBtn').click(function()
- {
- window.location.reload();
- })
-
- /* The display of the adjusting sidebarHeader is synchronized with the sidebar. */
- $(".sidebar-toggle").click(function()
- {
- $("#sidebarHeader").toggle("fast");
- });
- if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
-
- /* Shift key selection. */
- var isClickStoryToggle = false;
- var lastStorySelected = '';
- $(".story-toggle").click(function()
- {
- isClickStoryToggle = true;
- });
- $("#storyList tbody").on("click","tr",function(e)
- {
- var nowCheckbox = $(this)['context'].cells[0].childNodes[0].childNodes[0];
- if(e.shiftKey)
- {
- nowStorySelected = nowCheckbox.value;
- if(lastStorySelected != '' && nowStorySelected != '' && lastStorySelected != nowStorySelected)
- {
- var isStartStorySelected = false;
- var isEndStorySelected = false;
- $("input[name^='storyIdList']").each(function()
- {
- isEndStorySelected = ((nowStorySelected == $(this).val() || lastStorySelected == $(this).val()) && isStartStorySelected ) || isEndStorySelected ? true : false;
-
- $(this)['context'].checked = $(this)['context'].checked || (isStartStorySelected && !isEndStorySelected) ? true : false;
-
- isStartStorySelected = nowStorySelected == $(this).val() || lastStorySelected == $(this).val() || isStartStorySelected ? true : false;
-
- if(isEndStorySelected) return;
- });
- }
- }
- else if(!isClickStoryToggle)
- {
- lastStorySelected = nowCheckbox.value;
- }
- isClickStoryToggle = false;
- });
-});
-
-/**
- * Adjust the table footer style.
- *
- * @access public
- * @return void
- */
-function adjustTableFooter()
-{
- if($('.main-col').height() < $(window).height())
- {
- $('.table.with-footer-fixed').css('margin-bottom', '0');
- $('.table-footer').removeClass('fixed-footer');
- $('.table-footer').css({"left":"0", "bottom":"0", "width":"unset"});
- }
-}
diff --git a/module/product/js/create.js b/module/product/js/create.js
deleted file mode 100644
index 548053f0ae..0000000000
--- a/module/product/js/create.js
+++ /dev/null
@@ -1,77 +0,0 @@
-$(function()
-{
- $('#lineName').css('border-left-color', '');
- $('[name=newLine]').change();
-
- if(programID == 0) $("#line").closest('tr').addClass('hidden');
-})
-/**
- * Load product Lines.
- *
- * @param $rootID
- * @access public
- * @return void
- */
-function loadProductLines(rootID)
-{
- link = createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + rootID + '&viewtype=line' + '&branch=0' + '&rootModuleID=0&returnType=html&fieldID=&needManage=true');
- $('#lineIdBox').load(link, function()
- {
- $(this).find('select').chosen()
- });
-}
-
-/**
- * Set parent program.
- *
- * @param $parentProgram
- * @access public
- * @return void
- */
-function setParentProgram(parentProgram)
-{
- location.href = createLink('product', 'create', 'programID=' + parentProgram);
-}
-
-$('#program').change(function()
-{
- var programID = $(this).val();
- if(programID > 0) $("#line").closest('tr').removeClass('hidden');
-
- $.get(createLink('product', 'ajaxGetLine', 'programID=' + programID), function(data)
- {
- $('#line').replaceWith(data);
- $('#line').siblings('.picker').remove();
- $('#line').picker();
- })
-})
-
-/**
- * Toggle line.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function toggleLine(obj)
-{
- var $obj = $(obj);
- if($obj.length == 0) return false;
-
- var $line = $obj.closest('table').find('#line');
-
- if($obj.prop('checked'))
- {
- $('form .line-no-exist').removeClass('hidden');
- $('form .line-exist').addClass('hidden');
- $('#line_chosen').addClass('hidden');
- $line.attr('disabled', 'disabled');
- }
- else
- {
- $('#line').removeClass('hidden');
- $('form .line-no-exist').addClass('hidden');
- $('#line_chosen').removeClass('hidden');
- $line.removeAttr('disabled');
- }
-}
diff --git a/module/product/js/edit.js b/module/product/js/edit.js
deleted file mode 100644
index 78c8f46ed5..0000000000
--- a/module/product/js/edit.js
+++ /dev/null
@@ -1,17 +0,0 @@
-$(function()
-{
- if(programID == 0) $("#line").closest('tr').addClass('hidden');
-});
-
-$('#program').change(function()
-{
- var programID = $(this).val();
- programID > 0 ? $("#line").closest('tr').removeClass('hidden') : $("#line").closest('tr').addClass('hidden');
-
- $.get(createLink('product', 'ajaxGetLine', 'programID=' + programID), function(data)
- {
- $('#line').replaceWith(data);
- $('#line').siblings('.picker').remove();
- $('#line').picker();
- })
-});
diff --git a/module/product/js/index.js b/module/product/js/index.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/product/js/kanban.js b/module/product/js/kanban.js
deleted file mode 100644
index 4798d26c96..0000000000
--- a/module/product/js/kanban.js
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Process kanban data
- * @param {string} key Kanban key, used as kanban id
- * @param {Object} programsData Programs data
- * @returns {Object} kanban data
- */
-function processKanbanData(key, programsData)
-{
- var kanbanId = key;
-
- /* Generate columns */
- var columns = [];
- var hasDoingProject = false;
- var executionsCol;
- $.each(kanbanColumns, function(_, column)
- {
- var colType = column.type;
- if(colType === 'doingProject') hasDoingProject = true;
- column = $.extend({}, column,
- {
- kanban: kanbanId,
- id: kanbanId + '-' + colType,
- parentType: (hasDoingProject && (colType === 'doingProject' || colType === 'doingExecution')) ? 'doing' : false,
- });
-
- if(colType === 'doingProject')
- {
- columns.push(
- {
- kanban: kanbanId,
- id: kanbanId + '-doing',
- type: 'doing',
- asParent: true,
- name: doingText,
- count: ''
- });
- }
- else if(colType === 'doingExecution')
- {
- executionsCol = column;
- executionsCol.count = 0;
- }
- columns.push(column);
- });
-
- /* Format lanes data */
- var lanes = [];
- $.each(programsData, function(programId, programProducts)
- {
- var subLanes = [];
- programProducts.forEach(function(productID)
- {
- var product = productList[productID];
- var items = {};
-
- /* unclosed products */
- var productItem = {id: 'product-' + productID, _id: productID, name: product.name};
- items.unclosedProduct = [productItem];
-
- /* plans */
- items.unexpiredPlan = [];
- var plans = planList[productID];
- if(plans)
- {
- $.each(plans, function(planID, plan)
- {
- items.unexpiredPlan.push($.extend({}, plan, {id: 'plan-' + planID, _id: planID}));
- });
- }
-
- /* doing projects */
- if(hasDoingProject)
- {
- items.doingProject = [];
- var productProjects = projectProduct[productID];
- if(productProjects)
- {
- $.each(productProjects, function(projectID)
- {
- var project = projectList[projectID];
- if(!project || !project.id) return;
- var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID});
- items.doingProject.push(projectItem);
-
- var execution = latestExecutions[projectID];
- if(!execution || !execution.id) return;
-
- executionsCol.count++;
- projectItem.execution = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
- });
- }
- }
- else
- {
- /* doing execution */
- items.doingExecution = [];
- var productExecutions = classicExecution[productID];
- if(productExecutions)
- {
- $.each(productExecutions, function(_, execution)
- {
- if(!execution || !execution.id) return;
- var executionID = execution.id;
- var executionItem = $.extend({}, execution, {id: 'execution-' + executionID, _id: executionID});
- items.doingExecution.push(executionItem);
- });
- }
- }
-
-
- /* normal release */
- items.normalRelease = [];
- var releases = releaseList[productID];
- if(releases)
- {
- $.each(releases, function(releaseID, release)
- {
- if(!release || !release.id) return;
- var releaseItem = $.extend({}, release, {id: 'release-' + releaseID, _id: releaseID});
- items.normalRelease.push(releaseItem);
- });
- }
-
- subLanes.push({id: kanbanId + '-' + programId + '-' + productID, items: items});
- });
-
- var programName = programList[programId];
- if(programName === undefined) programName = '(' + programId + ')';
- lanes.push({id: programId, kanban: kanbanId, name: programName, subLanes: subLanes});
- });
-
- return {id: kanbanId, columns: columns, lanes: lanes};
-}
-
-/** Calculate column height */
-function calcColHeight(col, lane, colCards, colHeight)
-{
- if (col.type !== 'doingProject') return colHeight;
- return colCards.length * 62;
-}
-
-/**
- * Init kanban.
- *
- * @access public
- * @return void
- */
-function initKanban()
-{
- $.each(kanbanList, function(key, programsData)
- {
- var $kanban = $('#kanban-' + key);
- if(!$kanban.length) return;
- var data = processKanbanData(key, programsData);
- $kanban.kanban(
- {
- data: data,
- noLaneName: isLightMode,
- virtualize: true,
- virtualCardList: true,
- calcColHeight: calcColHeight
- });
- });
-}
-
-$(function()
-{
- /* Init all kanbans */
- initKanban();
-
- $('#showAllProjects').click(function()
- {
- var showAllProjects = $(this).prop('checked') ? 1 : 0;
- $.post(createLink('product', 'ajaxSetShowSetting'), {"showAllProjects": showAllProjects}, function()
- {
- $.get(createLink('product', 'kanban'), function(data)
- {
- $('#kanbanList').html($(data).find('#kanbanList').html());
- initKanban();
- });
- })
- })
-});
diff --git a/module/product/js/manageline.js b/module/product/js/manageline.js
deleted file mode 100644
index cd1748a993..0000000000
--- a/module/product/js/manageline.js
+++ /dev/null
@@ -1,24 +0,0 @@
-function addItem(obj)
-{
- var $inputRow = $(obj).closest('.row-module');
- var $newRow = $('#insertItemBox').children('.row-module').clone().insertAfter($inputRow).addClass('highlight');
- $newRow.find("input[type!='hidden']").val('');
- $newRow.find("select[name^='programs']").chosen();
- $newRow.find('div[class="table-col col-programs"]').addClass('required');
- setTimeout(function()
- {
- $newRow.removeClass('highlight');
- }, 1600);
-}
-
-function deleteItem(obj)
-{
- var $inputRow = $(obj).closest('.row-module');
- if ($inputRow.siblings('.row-module.row-module-new').find('.btn-delete').length > 0)
- {
- $inputRow.addClass('highlight').fadeOut(500, function()
- {
- $inputRow.remove();
- });
- }
-}
diff --git a/module/product/js/project.js b/module/product/js/project.js
deleted file mode 100644
index e150fb18e3..0000000000
--- a/module/product/js/project.js
+++ /dev/null
@@ -1,41 +0,0 @@
-$(function()
-{
- $('#mainMenu input[name^="involved"]').click(function()
- {
- var involved = $(this).is(':checked') ? 1 : 0;
- $.cookie('involved', involved, {expires:config.cookieLife, path:config.webRoot});
- window.location.reload();
- });
-
- $('#saveButton').on('click', function()
- {
- var selectProjectID = $('#project').val();
- var currentProductID = $('#product').val();
- var currentBranchID = $('#branch').val();
-
- $.get(createLink('project', 'ajaxGetLinkedProducts', 'projectID=' + selectProjectID), function(product)
- {
- var products = [];
- var branches = [];
-
- var linkedProducts = JSON.parse(product);
- for(var productID in linkedProducts)
- {
- for(var branchID in linkedProducts[productID])
- {
- products.push(productID);
- branches.push(branchID);
- }
- }
-
- products.push(currentProductID);
- branches.push(currentBranchID);
-
- $.post(createLink('project', 'manageProducts', 'projectID=' + selectProjectID), {'products' : products, 'branch' : branches}, function()
- {
- $('#link2Project').modal('hide');
- window.location.reload();
- });
- });
- });
-});
diff --git a/module/product/js/roadmap.js b/module/product/js/roadmap.js
deleted file mode 100644
index 77cdd176c5..0000000000
--- a/module/product/js/roadmap.js
+++ /dev/null
@@ -1,33 +0,0 @@
-$(function()
-{
- // 修复连接曲线位置
- var fixReleasePathLine = function()
- {
- $('.release-paths.active').each(function()
- {
- var $lines = $(this).find('.release-line');
- var linesCount = $lines.length;
- if (linesCount < 2) return;
- $lines.each(function(idx)
- {
- if (idx >= (linesCount - 1)) return;
- var $prev = $(this);
- var $next = $lines.eq(idx + 1);
- var $line = $prev.next('.release-link-line');
- if(!$line.length)
- {
- $line = $('
').insertAfter($prev);
- }
- $line.css(
- {
- top: $prev.position().top + 90,
- right: $next.find('li:last-child').width() - 4,
- height: $prev.outerHeight() - 10
- });
- });
- });
- };
-
- fixReleasePathLine();
- $(window).on('resize shown.zui.tab', fixReleasePathLine);
-});
diff --git a/module/product/js/track.js b/module/product/js/track.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/productplan/css/batchedit.css b/module/productplan/css/batchedit.css
deleted file mode 100644
index 3c3a0047d7..0000000000
--- a/module/productplan/css/batchedit.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.form-input-hidden {display: none;}
-.form-input-show {display: block;}
-.c-id {width: 60px;}
-.c-future {width: 100px;}
diff --git a/module/productplan/css/browse.css b/module/productplan/css/browse.css
deleted file mode 100644
index 9b583dbeaa..0000000000
--- a/module/productplan/css/browse.css
+++ /dev/null
@@ -1,68 +0,0 @@
-.table td.content div {height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; float: left; max-width: calc(100% - 20px);}
-.table td.content .more {position: absolute; right: 16px;}
-.table td.content .more .icon {color: #838a9d;}
-td.c-branch {overflow: hidden; text-align: left !important; white-space: nowrap;}
-
-.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-top {border-top: 2px solid #cbd0db;}
-.table tbody > tr.table-children.table-child-bottom {border-bottom: 2px solid #cbd0db;}
-.table td.has-child > a {max-width: 90%; max-width: calc(100% - 30px); display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-.table td.has-child > .plan-name > .task-toggle {color: #838a9d; position: relative; top: 1px; line-height: 16px;}
-.table td.has-child > .plan-name > .task-toggle:hover {color: #006af1; cursor: pointer;}
-.table td.has-child > .plan-name > .task-toggle > .icon, .table td.content .more .icon {font-size: 16px; display: inline-block; transition: transform .2s; -ms-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -o-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); transform: rotate(-90deg);}
-.table td.has-child > .plan-name > .task-toggle > .icon:before {text-align: left;}
-.table td.has-child > .plan-name > .task-toggle.collapsed {top: 0;}
-.table td.has-child > .plan-name > .task-toggle.collapsed > .icon, .table td.content .more .icon.rotate-down {-ms-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg); -webkit-transform: rotate(90deg); transform: rotate(90deg);}
-.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
-@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};}
-
-.c-title {width: 160px;}
-.c-branch {width: 130px;}
-.c-story, .c-status {width: 80px;}
-.c-execution {width: 60px !important;}
-.c-bug, .c-hour {width: 60px;}
-.c-desc {width: 140px;}
-.c-date {width: 90px;}
-
-.plan-name {position: relative; display: flex; align-items: center;}
-.plan-name > span {flex: none;}
-
-[lang^='zh-'] #productplanList .c-title.has-child > .plan-name.expired > a {overflow:hidden; max-width: calc(100% - 62px);}
-[lang^='en'] #productplanList .c-title.has-child > .plan-name.expired > a {overflow:hidden; max-width: calc(100% - 67px);}
-#productplanList .c-title.has-child > .plan-name > a {overflow:hidden; max-width: calc(100% - 16px);}
-#productplanList .c-title > .plan-name.expired > a {overflow:hidden; max-width: calc(100% - 46px);}
-#productplanList .plan-name.expired > .label.label-danger {margin-left:3px; }
-#productplanList .plan-name > .label.label-light {margin-right:3px; }
-
-.switchButton {background: #fff !important;}
-.panel-actions {position: relative; padding: 0 0; padding-top: 1px;}
-#kanbanContainer {background: #efefef; box-shadow: none;}
-#kanbanContainer {padding-bottom: 0; margin-bottom: 0; border: unset;}
-#kanbanContainer.fullscreen {overflow: auto;}
-.icon-list {padding-left: 7px;}
-.titleBox .icon-delay {padding-right: 8px;}
-
-.kanban-card .productplanInfo .user {float: right;display: block;}
-.kanban-card a[disabled] {color: #313c52;}
-.kanban-card .header .actions {position: absolute;top: 4px;right: 4px;opacity: 0;}
-.kanban-card .productplanDesc {min-width: 100%;color: #838a9d;overflow: hidden;white-space: nowrap;text-overflow: clip;}
-.kanban-card {height: auto !important;padding: 8px 14px !important;min-height: 60px;}
-.icon-kanban {padding-left: 7px; font-size: 16px;}
-.label-wait {background: #EFEFEF !important;color: #838A9D;}
-.label-future {background: #EFEFEF !important;color: #838A9D;border-radius: 9px;}
-.label-doing {background: #f8d2d2 !important;color: #e64b4c;}
-.label-done {background: #dfe9d8 !important;color: #429b16;}
-.label-closed, .label-terminate {background: #e5e5e5 !important;color: #b8b8b8;}
-
-#productplanList thead th.c-title {width: 100%;}
-#productplanList .c-actions {width: 265px;}
-#productplanList .c-actions .btn+.btn {margin-left: -1px;}
-#productplanList .c-actions .btn {display: block; float: left;}
-#productplanList td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #F4F5F7; margin: 6px 0 0 0; float: left;}
-
-.popover.right {left: 40px; top: -5px; white-space: nowrap;}
-.popover.right .popover-content {padding: 5px 20px 0px 0px;}
-.execution-tip {list-style: none;}
-.popover.right .arrow {margin-top: -30px;}
-.execution-tip li {overflow: hidden; text-overflow: unset; white-space: nowrap;}
-td.execution-links {overflow: visible;}
diff --git a/module/productplan/css/linkbug.css b/module/productplan/css/linkbug.css
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/module/productplan/css/linkstory.css b/module/productplan/css/linkstory.css
deleted file mode 100644
index 2f9c6522b8..0000000000
--- a/module/productplan/css/linkstory.css
+++ /dev/null
@@ -1 +0,0 @@
-.c-plan, .c-module {width: 150px;}
diff --git a/module/productplan/css/view.css b/module/productplan/css/view.css
deleted file mode 100644
index b924713e90..0000000000
--- a/module/productplan/css/view.css
+++ /dev/null
@@ -1,38 +0,0 @@
-#storyList th {border: none;}
-#bugList th {border: none;}
-.hide-side .col-main {width: 100%;}
-.hide-side .col-side .main-side {width: 0; display: none;}
-
-.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
-.dropdown-menu > .menu-search .input-group {width: 100%;}
-.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666;}
-.dropdown-menu > .menu-search .form-control {border: none !important; box-shadow: none !important; border-top: 1px solid #ddd !important;}
-.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
-.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
-.dropdown-list > li > a:hover,
-.dropdown-list > li > a:focus {color: #1a4f85; text-decoration: none; background-color: #ddd;}
-
-.checkbox.btn {margin-top: 0px;}
-
-#planInfo > div {padding-top: 15px;}
-
-.linkBox #queryBox .search-form .form-actions {padding-bottom: 5px;}
-.linkBox .table-header {padding: 8px 15px; border-bottom: 1px solid #cbd0db;}
-#unlinkStoryList, #unlinkBugList {border-top: 1px solid #cbd0db;}
-.fixed-footer .text {color: #fff;}
-ol, ul {padding-left: 20px;}
-#tabsNav .tab-pane>.main-table {border-radius: 0;}
-.body-modal #mainMenu>.btn-toolbar {width: auto;}
-.body-modal #mainContent {min-height: 240px;}
-
-#mainMenu .btn-link.disabled {color: #9e54ae; background: transparent; border-color:transparent;}
-#mainMenu .icon-checked, #mainMenu .icon-off, #mainMenu .icon-play, #mainMenu .icon-magic {margin-right: 3px;}
-
-#mainMenu .page-title {display: flex;}
-#mainMenu .btn-toolbar .page-title .label {top: 9px; margin-right: 10px; height: 16px;}
-#mainMenu .btn-toolbar .page-title .text {max-width: 434px; overflow: hidden; white-space:nowrap; margin-right: 6px;}
-#actionsBox a:last-of-type + .divider {display: none;}
-#actionsBox div.divider:first-child {display: none;}
-
-#bugs th.c-pri, #bugs th.c-actions {width:70px !important;}
-#bugs th.c-status, #bugs th.c-user {width:120px !important;}
diff --git a/module/productplan/js/batchedit.js b/module/productplan/js/batchedit.js
deleted file mode 100644
index 9384b7631a..0000000000
--- a/module/productplan/js/batchedit.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Handle the product plan pending status. Fix bug #2937.
- *
- * @param int planID
- * @access public
- * @return date
- */
-function changeDate(planID)
-{
- if($("#future" + planID).prop('checked'))
- {
- $("input[name='begin[" + planID + "]']").attr('disabled', 'disabled');
- $("input[name='end[" + planID + "]']").attr('disabled', 'disabled');
- }
- else
- {
- $("input[name='begin[" + planID + "]']").removeAttr('disabled', 'disabled');
- $("input[name='end[" + planID + "]']").removeAttr('disabled', 'disabled');
- $('.form-date').datetimepicker('update');
- }
-};
-
-/**
- * Get conflict stories.
- *
- * @param int $planID
- * @access public
- * @return void
- */
-function getConflictStories(planID)
-{
- var newBranch = $('#branch' + planID).val() ? $('#branch' + planID).val().toString() : '';
- $.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories)
- {
- if(conflictStories != '' && !confirm(conflictStories))
- {
- $('#branch' + planID).val(oldBranch[planID].split(','));
- $('#branch' + planID).trigger("chosen:updated");
- }
- });
-}
diff --git a/module/productplan/js/browse.js b/module/productplan/js/browse.js
deleted file mode 100644
index cd95f5132c..0000000000
--- a/module/productplan/js/browse.js
+++ /dev/null
@@ -1,540 +0,0 @@
-$(document).on('click', '.task-toggle', function(e)
-{
- var $toggle = $(this);
- var id = $(this).data('id');
- var isCollapsed = $toggle.toggleClass('collapsed').hasClass('collapsed');
- $toggle.closest('[data-ride="table"]').find('tr.parent-' + id).toggle(!isCollapsed);
-
- e.stopPropagation();
- e.preventDefault();
-});
-
-$(function()
-{
- if(viewType != 'kanban') toggleFold('#productplanForm', unfoldPlans, productID, 'productplan');
- $('#productplanList tbody tr').each(function()
- {
- var $content = $(this).find('td.content');
- var content = $content.find('div').html();
- if(content.indexOf('
= 0 || content.indexOf('
![]()
= 0)
- {
- $content.append("
");
- }
- });
-
- $('#createExecutionButton').on('click', function()
- {
- var projectID = $('#project').val();
- var planID = $('#planID').val();
- if(!projectID)
- {
- alert(projectNotEmpty);
- return false;
- }
- else
- {
- $.apps.open(createLink('execution', 'create', 'projectID=' + projectID + '&executionID=©ExecutionID=&planID=' + planID + '&confirm=&productID=' + productID), 'execution')
- }
- $('#projects').modal('hide');
- });
-
- $('.switchButton').click(function()
- {
- var viewType = $(this).attr('data-type');
- var branchID = $(this).val();
- $.cookie('viewType', viewType, {expires:config.cookieLife, path:config.webRoot});
- var link = createLink('productplan', 'browse', "productID=" + productID + '&branch=' + branchID);
- location.href = link;
- });
-
- $('#branch').change(function()
- {
- var branchID = $(this).val();
- var link = createLink(rawModule, 'browse', "productID=" + productID + '&branch=' + branchID);
- location.href = link;
- });
-
- if(viewType == 'kanban')
- {
- $('#branch_chosen .chosen-single span').prepend('
');
- $('#kanban').kanban(
- {
- data: kanbanData,
- minColWidth: typeof window.minColWidth === 'number' ? window.minColWidth: defaultMinColWidth,
- maxColWidth: typeof window.maxColWidth === 'number' ? window.maxColWidth: defaultMaxColWidth,
- maxColHeight: 460,
- minColHeight: 190,
- cardHeight: 80,
- itemRender: renderKanbanItem,
- virtualize: true,
- droppable:
- {
- target: findDropColumns,
- finish: handleFinishDrop
- }
- });
-
- resetLaneHeight();
-
- $('#kanban').on('scroll', function()
- {
- $.zui.ContextMenu.hide();
- });
-
- /* Init contextmenu. */
- $('#kanban').on('click', '[data-contextmenu]', function(event)
- {
- var $trigger = $(this);
- var menuType = $trigger.data('contextmenu');
- var menuCreator = window.menuCreators[menuType];
- if(!menuCreator) return;
-
- var options = $.extend({event: event, $trigger: $trigger}, $trigger.data());
- var items = menuCreator(options);
- if(!items || !items.length) return;
-
- $.zui.ContextMenu.show(items, items.$options || {event: event});
- });
- }
-
- /* Hide contextmenu when page scroll. */
- $(window).on('scroll', function()
- {
- $.zui.ContextMenu.hide();
- });
-
- $('.execution-popover').on('click', function(e)
- {
- e.stopPropagation();
- var showPopover = $(this).next().css('display') == 'block';
- $('.popover.right').hide();
- if(!showPopover) $(this).next().show();
- });
-
- $('.execution-link').on('click', function()
- {
- $('.popover.right').hide();
- });
-
- /* Hide popover tip. */
- $(document).on('mousedown', function(e)
- {
- var $target = $(e.target);
- var $toggle = $target.closest('.popover, .execution-popover');
- if(!$toggle.length) $('.popover.right').hide();
- });
-});
-
-/* Define menu creators. */
-window.menuCreators = {card: createCardMenu};
-
-/**
- * Create card menu.
- *
- * @param object options
- * @access public
- * @return array
- */
-function createCardMenu(options)
-{
- var card = options.$trigger.closest('.kanban-item').data('item');
- var privs = card.actions;
- if(!privs.length) return [];
-
- var items = [];
- if(privs.includes('createExecution'))
- {
- var className = '';
- var today = new Date();
- var end = $.zui.createDate(card.end);
- if(end.getTime() < today.getTime())
- {
- className = 'disabled';
- }
- else if(card.status == 'done' || card.status == 'closed')
- {
- className = 'disabled';
- }
- else if(product.type != 'normal')
- {
- var branchStatus = branchStatusList[card.branch];
- if(branchStatus == 'closed') className = 'disabled';
- }
-
- items.push({label: productplanLang.createExecution, icon: 'plus', url: '#projects', className: className, attrs: {'data-toggle': 'modal', 'onclick': 'getPlanID(this,' + card.branch + ')', 'data-id': card.id}});
- }
-
- if(privs.includes('linkStory')) items.push({label: productplanLang.linkStory, icon: 'link', url: createLink(rawModule, 'view', "planID=" + card.id + "&type=story&orderBy=id_desc&link=true")});
- if(privs.includes('linkBug')) items.push({label: productplanLang.linkBug, icon: 'bug', url: createLink(rawModule, 'view', "planID=" + card.id + "&type=bug&orderBy=id_desc&link=true")});
- if(privs.includes('edit')) items.push({label: productplanLang.edit, icon: 'edit', url: createLink(rawModule, 'edit', "planID=" + card.id)});
- if(privs.includes('start')) items.push({label: productplanLang.start, icon: 'start', url: createLink('productplan', 'start', "planID=" + card.id), attrs: {'target': 'hiddenwin'}});
- if(privs.includes('finish')) items.push({label: productplanLang.finish, icon: 'checked', url: createLink('productplan', 'finish', "planID=" + card.id), attrs: {'target': 'hiddenwin'}});
- if(privs.includes('close')) items.push({label: productplanLang.close, icon: 'off', url: createLink('productplan', 'close', "planID=" + card.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal'}});
- if(privs.includes('activate')) items.push({label: productplanLang.activate, icon: 'magic', url: createLink('productplan', 'activate', "planID=" + card.id), attrs: {'target': 'hiddenwin'}});
- if(privs.includes('delete')) items.push({label: productplanLang.delete, icon: 'trash', url: createLink('productplan', 'delete', "planID=" + card.id), attrs: {'target': 'hiddenwin'}});
-
- var bounds = options.$trigger[0].getBoundingClientRect();
- items.$options = {x: bounds.right, y: bounds.top};
- return items;
-}
-
-$(document).on('click', 'td.content .more', function(e)
-{
- var $toggle = $(this);
- if($toggle.hasClass('open'))
- {
- $toggle.removeClass('open');
- $toggle.closest('.content').find('div').css('height', '25px');
- $toggle.css('padding-top', 0);
- $toggle.find('i').addClass('rotate-down');
- }
- else
- {
- $toggle.addClass('open');
- $toggle.closest('.content').find('div').css('height', 'auto');
- $toggle.css('padding-top', ($toggle.closest('.content').find('div').height() - $toggle.height()) / 2);
- $toggle.find('i').removeClass('rotate-down');
- }
-});
-
-/**
- * Find drop columns.
- *
- * @param object $element Drag element
- * @param object $root Dnd root element
- * @access public
- * @return object|bool
- */
-function findDropColumns($element, $root)
-{
- var $col = $element.closest('.kanban-col');
- var col = $col.data();
- var lane = $col.closest('.kanban-lane').data();
- var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules : null;
-
- if(!kanbanRules) return $root.find('.kanban-lane[data-id="' + lane.id + '"] .kanban-lane-col:not([data-type="project"],[data-type="' + col.type + '"])');
-
- var colRules = kanbanRules[col.type];
- var lane = $col.closest('.kanban-lane').data('lane');
- return $root.find('.kanban-lane-col').filter(function()
- {
- if(!colRules) return false;
- if(colRules === true) return true;
-
- var $newCol = $(this);
- var newCol = $newCol.data();
- if(newCol.id === col.id) return false;
-
- var $newLane = $newCol.closest('.kanban-lane');
- var newLane = $newLane.data('lane');
- return colRules.indexOf(newCol.type) > -1 && newLane.id === lane.id;
- });
-}
-
-/**
- * Reset lane height according to window height.
- */
-function resetLaneHeight()
-{
- if(product.type == 'normal')
- {
- var windowHeight = $(window).height();
- var mainHeader = $('#mainHeader').outerHeight();
- var marginMenu = $('#mainMenu').outerHeight();
- var headerHeight = $('#kanban > .kanban-board > .kanban-header').outerHeight();
-
- maxHeight = windowHeight - headerHeight - mainHeader - marginMenu - 80;
- $('.kanban-lane').css('height', maxHeight);
- }
-}
-
-
-/**
- * Handle finish drop card.
- *
- * @param object event
- * @access public
- * @return void
- */
-function handleFinishDrop(event)
-{
- var $card = $(event.element); // The drag card.
- var $dragCol = $card.closest('.kanban-lane-col');
- var $dropCol = $(event.target);
-
- /* Get d-n-d(drag and drop) infos. */
- var card = $card.data('item');
- var fromColType = $dragCol.data('type');
- var toColType = $dropCol.data('type');
- var kanbanID = $card.closest('.kanban').data('id');
-
- changeCardColType(card, fromColType, toColType, kanbanID);
-}
-
-/**
- * Change column type for a card.
- *
- * @param object card
- * @param string fromColType The column type before change
- * @param string toColType The column type after change
- * @param int kanbanID
- * @access public
- * @return void
- */
-function changeCardColType(card, fromColType, toColType, kanbanID)
-{
- if(typeof card == 'undefined') return false;
- var objectID = card.id;
- var privs = card.actions;
- var showIframe = false;
- var link = '';
-
- if(toColType == 'doing')
- {
- if(fromColType == 'wait' && privs.includes('start'))
- {
- link = createLink('productplan', 'start', 'planID=' + objectID);
- showIframe = false;
- }
- else if((fromColType == 'done' || fromColType == 'closed') && privs.includes('activate'))
- {
- link = createLink('productplan', 'activate', 'planID=' + objectID);
- showIframe = false;
- }
- }
- else if(toColType == 'done')
- {
- if(fromColType == 'doing')
- {
- link = createLink('productplan', 'finish', 'planID=' + objectID);
- showIframe = false;
- }
- }
- else if(toColType == 'closed')
- {
- if(fromColType != 'closed')
- {
- link = createLink('productplan', 'close', 'planID=' + objectID, '', true);
- showIframe = true;
- }
- }
-
- if(showIframe)
- {
- var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '70%', url: link});
- modalTrigger.show();
- }
- else if(!showIframe && link)
- {
- hiddenwin.location.href = link;
- }
-}
-
-/**
- * The function for rendering kanban item.
- *
- * @param object item
- * @param object $item
- * @access public
- * @return void
- */
-function renderKanbanItem(item, $item)
-{
- var privs = item.actions;
- var printMoreBtn = (privs.includes('createExecution') || privs.includes('linkStory') || privs.includes('linkBug') || privs.includes('edit') || privs.includes('start') || privs.includes('finish') || privs.includes('close') || privs.includes('activate') || privs.includes('delete'));
-
- /* Output header information. */
- var $header = $item.children('.header');
- if(!$header.length) $header = $(
- [
- ''
- ].join('')).appendTo($item);
-
- var $titleBox = $item.children('.titleBox');
- if(!$titleBox.length) $titleBox = $(
- [
- '
',
- '
'
- ].join('')).appendTo($header);
-
- /* Print plan name. */
- var $title = $titleBox.children('.title');
- if(!$title.length)
- {
- if(privs.includes('view')) $title = $('
').appendTo($titleBox).attr('href', createLink(rawModule, 'view', 'cardID=' + item.id));
- if(!privs.includes('view')) $title = $('
').appendTo($titleBox);
- }
- if(!$title.children('i').length)
- {
- $(function() {$title.prepend('
');})
- }
- $title.text(item.title).attr('title', item.title);
-
- var $info = $item.children('.productplanInfo');
- if(!$info.length) $info = $(
- [
- '
',
- '
'
- ].join('')).appendTo($item);
-
- /* Output plan desc information. */
- var $descBox = $item.children('.productplanDesc');
- if(!$descBox.length)
- {
- $descBox = $('
' + item.desc + '
').appendTo($info);
- }
-
- var $statusBox = $item.children('.productplanStatus');
- if(!$statusBox.length)
- {
- if(item.deleted == '0')
- {
- $statusBox = $('
' + productplanLang.statusList[item.status] + '').appendTo($info);
- }
- else
- {
- $statusBox = $('
' + productplanLang.deleted + '').appendTo($info);
- }
- }
-
- /* Determine whether to print an expired label. */
- var today = new Date();
- var begin = $.zui.createDate(item.begin);
- var end = $.zui.createDate(item.end);
- if(item.delay && (item.status == 'wait' || item.status == 'doing'))
- {
- $expired = $titleBox.children('.expired');
- if(!$expired.length)
- {
- $('
' + productplanLang.expired + '').appendTo($titleBox);
- }
- }
-
- if(printMoreBtn)
- {
- $(
- [
- '
'
- ].join('')).appendTo($header);
- }
-
- /* Display date of product plan. */
- var $date = $info.children('.date');
- var begin = $.zui.createDate(item.begin);
- var end = $.zui.createDate(item.end);
- var today = new Date();
- var labelType = (item.begin <= $.zui.formatDate(today, 'yyyy-MM-dd') && item.end >= $.zui.formatDate(today, 'yyyy-MM-dd')) ? 'danger' : 'wait';
- var labelTitle = $.zui.formatDate(begin, 'MM-dd') + ' ' + productplanLang.to + ' ' + $.zui.formatDate(end, 'MM-dd');
-
- if((item.begin == '2030-01-01' || item.end == '2030-01-01'))
- {
- labelType = 'future';
- labelTitle = productplanLang.future;
- }
- if(!$date.length) $date = $('
').appendTo($info);
- $date.text(labelTitle).attr('title', labelTitle).show();
-
- /* Display avatars of creator. */
- var $user = $info.children('.user');
- var user = [item.createdBy];
- if(users[item.createdBy])
- {
- if(!$user.length) $user = $('
').appendTo($info);
- $user.html(renderUsersAvatar(user, item.id)).attr('title', users[item.createdBy]);
- }
-}
-
-/**
-* Render avatars of user.
-* @param {String|{account: string, avatar: string}} user User account or user object
-* @returns {string}
-*/
-function renderUsersAvatar(users, itemID, size)
-{
- var avatarSizeClass = 'avatar-' + (size || 'md');
-
- if(users.length == 0 || (users.length == 1 && users[0] == ''))
- {
- return $('
');
- }
-
- var assignees = [];
- for(var user of users)
- {
- var $noPrivAndNoAssigned = $('
');
- if(!priv.canAssignCard && !user)
- {
- assignees.push($noPrivAndNoAssigned);
- continue;
- }
- if(!user)
- {
- assignees.push($('
'));
- continue;
- }
-
- if(typeof user === 'string') user = {account: user};
- if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account];
- if(!user.name && window.users && window.users[user.account]) user.name = window.users[user.account];
-
- assignees.push($('
').avatar({user: user}));
- }
-
- if(assignees.length > 3) assignees.splice(3, assignees.length - 3, '
...');
-
- return assignees;
-}
-
-/**
- * Get planID.
- *
- * @param object obj
- * @param int branch
- * @access public
- * @return void
- */
-function getPlanID(obj, branch)
-{
- var planID = $(obj).attr("data-id");
- $('#planID').val(planID);
-
- link = createLink('productplan', 'ajaxGetProjects', 'productID=' + productID + '&branch=' + branch);
- $.get(link, function(projects)
- {
- $('#project').replaceWith(projects);
- $("#project_chosen").remove();
- $("#project").chosen();
-
- var projectList = $("#project").val();
- if(!projectList)
- {
- $("#project").attr('disabled', true);
- $("#project").trigger('chosen:updated');
- $(".tips").removeClass('hidden');
-
- var locateLink = createLink('product', 'project', 'status=all&productID=' + productID + '&branch=' + branch);
- var locateButton = "
" + enterProjectList + "";
- $("#projects .btn-primary").replaceWith(locateButton);
- }
- else
- {
- $(".tips").addClass('hidden');
- }
- });
-}
-
-if(!window.kanbanDropRules)
-{
- window.kanbanDropRules =
- {
- wait: ['doing', 'closed'],
- doing: ['done', 'closed'],
- done: ['doing', 'closed'],
- closed: ['doing']
- }
-}
diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js
deleted file mode 100644
index b7c4c8ae53..0000000000
--- a/module/productplan/js/create.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Convert a date string like 2011-11-11 to date object in js.
- *
- * @param string $date
- * @access public
- * @return date
- */
-function convertStringToDate(dateString)
-{
- dateString = dateString.split('-');
- dateString = dateString[1] + '/' + dateString[2] + '/' + dateString[0];
-
- return Date.parse(dateString);
-}
-
-/**
- * Compute the end date for productplan.
- *
- * @param int $delta
- * @access public
- * @return void
- */
-function computeEndDate(delta)
-{
- var beginDate = $('#begin').val();
- if(!beginDate) return;
-
- var delta = parseInt(delta);
- beginDate = convertStringToDate(beginDate);
- if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
- {
- delta = (weekend == 2) ? (delta - 2) : (delta - 1);
- }
-
- var currentBeginDate = $.zui.formatDate(beginDate, 'yyyy-MM-dd');
- var endDate = $.zui.formatDate(beginDate.addDays(delta - 1), 'yyyy-MM-dd');
-
- $('#begin').val(currentBeginDate);
- $('#end').val(endDate).datetimepicker('update');
-}
-
-$('#begin').on('change', function()
-{
- $("input:radio[name='delta']").attr("checked",false);
-});
-
-$('#end').on('change', function()
-{
- $("input:radio[name='delta']").attr("checked", false);
-});
-
-$('#future').on('change', function()
-{
- if($(this).prop('checked'))
- {
- $('#begin').attr('disabled', 'disabled');
- $('#end').attr('disabled', 'disabled').parents('tr').hide();
- }
- else
- {
- $('#begin').removeAttr('disabled');
- $('#end').removeAttr('disabled').parents('tr').show();
- }
-});
-
-$('#parent').change(function()
-{
- var parentID = $(this).val();
- var currentBranches = $('#branch').val() ? $('#branch').val().toString() : '';
- $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID + "¤tBranches=" + currentBranches), function(data)
- {
- $('#branch').replaceWith(data);
- $('#branch_chosen').remove();
- $('#branch').chosen();
- $('#branch').change();
- })
-})
-
-$('#dataform').on('change', '#branch', function()
-{
- if(parentPlanID) return;
-
- var branchIdList = $(this).val();
- if(!branchIdList) return;
-
- var branchIdList = branchIdList.toString();
- var lastPlanLink = createLink('productplan', 'ajaxGetLast', "productID=" + productID + "&branch=" + branchIdList);
- $.post(lastPlanLink, function(data)
- {
- data = JSON.parse(data);
- var planTitle = data ? '(' + lastLang + ': ' + data.title + ')' : '';
- $('#title').parent().next('td').html(planTitle);
- })
-});
-
-$('#submit').click(function()
-{
- var parentPlan = $('#parent').val();
- var branches = $('#branch').val();
- if(parentPlan > 0 && branches)
- {
- link = createLink('productplan', 'ajaxGetDiffBranchesTip', "produtID=" + productID + "&parentID=" + parentPlan + "&branches=" + branches.toString());
- $.post(link, function(diffBranchesTip)
- {
- if((diffBranchesTip != '' && confirm(diffBranchesTip)) || !diffBranchesTip) $('form#dataform').submit();
- });
- return false;
- }
-});
diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js
deleted file mode 100644
index 4d4a4db832..0000000000
--- a/module/productplan/js/edit.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Convert a date string like 2011-11-11 to date object in js.
- *
- * @param string $date
- * @access public
- * @return date
- */
-function convertStringToDate(dateString)
-{
- dateString = dateString.split('-');
- dateString = dateString[1] + '/' + dateString[2] + '/' + dateString[0];
-
- return Date.parse(dateString);
-}
-
-$('#dataform').on('change', '#branch', function()
-{
- var newBranch = $('#branch').val() ? $('#branch').val().toString() : '';
- $.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories)
- {
- if(conflictStories != '')
- {
- var result = confirm(conflictStories) ? true : false;
- if(!result)
- {
- $('#branch').val(oldBranch[planID].split(','));
- $('#branch').trigger("chosen:updated");
- }
- }
- });
-});
-
-/**
- * Compute the end date for productplan.
- *
- * @param int $delta
- * @access public
- * @return void
- */
-function computeEndDate(delta)
-{
- beginDate = $('#begin').val();
- if(!beginDate) return;
-
- delta = parseInt(delta);
- beginDate = convertStringToDate(beginDate);
- if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
- {
- delta = (weekend == 2) ? (delta - 2) : (delta - 1);
- }
-
- currentBeginDate = $.zui.formatDate(beginDate, 'yyyy-MM-dd');
- endDate = $.zui.formatDate(beginDate.addDays(delta - 1), 'yyyy-MM-dd');
-
- $('#begin').val(currentBeginDate);
- $('#end').val(endDate).datetimepicker('update');
-}
-
-$('#parent').change(function()
-{
- var parentID = $(this).val();
- var currentBranches = $('#branch').val() ? $('#branch').val().toString() : '';
- $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID + "¤tBranches=" + currentBranches), function(data)
- {
- $('#branch').replaceWith(data);
- $('#branch_chosen').remove();
- $('#branch').chosen();
- })
-})
-
-$('#future').on('change', function()
-{
- if($(this).prop('checked'))
- {
- $('#begin').attr('disabled', 'disabled');
- $('#end').parents('tr').hide();
- }
- else
- {
- $('#begin').removeAttr('disabled');
- $('#end').parents('tr').show();
- }
-});
-
-$('#future').change();
-
-$('#submit').click(function()
-{
- var parentPlan = $('#parent').val();
- var branches = $('#branch').val();
- if(parentPlan > 0 && branches)
- {
- link = createLink('productplan', 'ajaxGetDiffBranchesTip', "produtID=" + productID + "&parentID=" + parentPlan + "&branches=" + branches.toString());
- $.post(link, function(diffBranchesTip)
- {
- if((diffBranchesTip != '' && confirm(diffBranchesTip)) || !diffBranchesTip) $('form#dataform').submit();
- });
- return false;
- }
-});
diff --git a/module/productplan/js/view.js b/module/productplan/js/view.js
deleted file mode 100644
index 1658a7a071..0000000000
--- a/module/productplan/js/view.js
+++ /dev/null
@@ -1,129 +0,0 @@
-function showLink(planID, type, orderBy, param)
-{
- var method = type == 'story' ? 'linkStory' : 'linkBug';
- loadURL(createLink('productplan', method, 'planID=' + planID + (typeof(param) == 'undefined' ? '' : param) + (typeof(orderBy) == 'undefined' ? '' : "&orderBy=" + orderBy)), type)
-
- $('.actions').find("a[href*='" + type + "']").addClass('hidden');
-}
-
-/**
- * Load URL.
- *
- * @param string $url
- * @param string $type
- * @access public
- * @return void
- */
-function loadURL(url, type)
-{
- $.get(url, function(data)
- {
- var $pane = $(type == 'story' ? '#stories' : '#bugs');
- $pane.find('.main-table').hide();
- var $linkBox = $pane.find('.linkBox').html(data).removeClass('hidden');
- $linkBox.html(data).removeClass('hidden');
- $linkBox.find('[data-ride="table"]').table();
- $linkBox.find('[data-ride="pager"]').pager();
- $linkBox.find('[data-ride="pager"] li a.pager-item').click(function()
- {
- loadURL($(this).attr('href'), type);
- return false;
- });
- $linkBox.find('[data-ride="pager"] .pager-size-menu a[data-size]').off('click');
- $linkBox.find('[data-ride="pager"] .pager-size-menu a[data-size]').click(function()
- {
- line = $linkBox.find('[data-ride="pager"]').attr('data-link-creator');
- line = line.replace('{recPerPage}', $(this).attr('data-size')).replace('{page}', $linkBox.find('[data-ride="pager"]').attr('data-page'));
- $.cookie($linkBox.find('[data-ride="pager"]').attr('data-page-cookie'), $(this).attr('data-size'), {expires:config.cookieLife, path:config.webRoot});
- loadURL(line, type);
- return false;
- });
- $.toggleQueryBox(true, $linkBox.find('#queryBox'));
- });
-}
-
-$(function()
-{
- /* Recalculate the maximum width of the title. */
- var maxWidth = $('#mainMenu').width() - $('#actionsBox').width() - $('#mainMenu .btn-toolbar .page-title .label-info').width() - 177;
- $('#mainMenu .btn-toolbar .page-title .text').css('max-width', maxWidth.toString() + 'px');
-
- if(link == 'true') showLink(planID, type, orderBy, param);
- var infoShowed = false;
- $('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e)
- {
- var href = $(e.target).attr('href');
- var tabPane = $(href + '.tab-pane');
- if(tabPane.size() == 0) return;
- var formID = tabPane.find('.linkBox').find('form:last');
- if(formID.size() == 0) formID = tabPane.find('form:last');
- if(href == '#planInfo' && !infoShowed)
- {
- $('#planInfo img').each(function()
- {
- var $tr = $('#planInfo .detail-content .table-data tbody tr:first');
- width = $tr.width() - $tr.find('th').width();
- if($(this).parent().prop('tagName').toLowerCase() == 'a') $(this).unwrap();
- setImageSize($(this), width, 0);
- });
-
- infoShowed = true;
- }
- });
-
- $('#storyList').on('sort.sortable', function(e, data)
- {
- var list = '';
- for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
- $.post(createLink('productplan', 'ajaxStorySort', 'planID=' + planID), {'stories' : list, 'orderBy' : orderBy, 'pageID' : storyPageID, 'recPerPage' : storyRecPerPage, 'recTotal' : storyRecTotal}, function()
- {
- var $target = $(data.element[0]);
- $target.hide();
- $target.fadeIn(1000);
- order = 'order_desc';
- history.pushState({}, 0, createLink('productplan', 'view', "planID=" + planID + '&type=story&orderBy=' + order));
- });
- });
-
- $('.table-story').table(
- {
- statisticCreator: function(table)
- {
- var $checkedRows = table.getTable().find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
- var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
- var checkedTotal = $checkedRows.length;
- if(!checkedTotal) return;
-
- var checkedEstimate = 0;
- var checkedCase = 0;
- var rateCount = checkedTotal;
- $checkedRows.each(function()
- {
- var $row = $(this);
- if($originTable)
- {
- $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
- }
- var data = $row.data();
- checkedEstimate += data.estimate;
-
- if(data.cases > 0)
- {
- checkedCase += 1;
- }
- else if(data.children != undefined && data.children > 0)
- {
- rateCount -= 1;
- }
- });
-
- var rate = '0%';
- if(rateCount) rate = Math.round(checkedCase / rateCount * 100) + '%';
-
- if(checkedTotal == 0) return storySummary;
- return checkedSummary.replace('%total%', checkedTotal)
- .replace('%estimate%', checkedEstimate.toFixed(1))
- .replace('%rate%', rate);
- }
- });
-});
diff --git a/module/program/css/browse.css b/module/program/css/browse.css
deleted file mode 100755
index 644a36ea15..0000000000
--- a/module/program/css/browse.css
+++ /dev/null
@@ -1,23 +0,0 @@
-#mainMenu .pull-left .checkbox-primary {display: inline-block; margin-left: 10px;}
-#projectsSummary {padding-left: 10px;}
-.main-table tbody>tr>td:first-child, .main-table thead>tr>th:first-child {padding-left: 8px;}
-.table tbody>tr>td .dropdown {display: inline-block; line-height: 1;}
-tbody.sortable > tr > td.sort-handler .table-nest-toggle:before {cursor: pointer !important;}
-.table .avatar {display: inline-block; top: 6px;}
-
-label[for^="projectIdList"]:after {width: 14px; height:14px;}
-tbody.sortable > tr > td.sort-handler {color: #3c4353 !important;}
-
-.has-prefix {position: relative; display: flex; align-items: center;}
-.has-prefix > span {flex: none;}
-.has-prefix > .icon-cards-view {padding-right: 4px;}
-
-.has-suffix > a {max-width: calc(100% - 100px); padding-right: 5px; color: #0c60e1; display: inline-block;}
-
-tr[data-type="project"].no-nest .c-name {padding-left: 12px;}
-div.checkbox-primary + span.table-nest-icon {margin-left: 0px !important;}
-
-#checkAll + label.hover:after {border-width: 0px;}
-.c-budget {width:100px; text-align: right; padding-right:16px !important;}
-.c-status {width: 65px !important;}
-.icon-scrum.table-nest-toggle:after, .icon-waterfall.table-nest-toggle:after, .icon-kanban.table-nest-toggle:after, .icon-waterfallplus.table-nest-toggle:after, .icon-aglieplus.table-nest-toggle:after, .icon-ipd.table-nest-toggle:after {content: ''; border: 0;}
diff --git a/module/program/css/create.css b/module/program/css/create.css
deleted file mode 100644
index a83e205d06..0000000000
--- a/module/program/css/create.css
+++ /dev/null
@@ -1,7 +0,0 @@
-#budget {border-right: 0px;}
-#budget:focus {border-right: 1px solid #0c64eb;}
-#budgetUnit {border-left: 0px;}
-#budgetUnit:focus {border-left: 1px solid #0c64eb;}
-#dateRange, .futureBox {vertical-align: top !important; padding-top: 13px !important;}
-#endList {vertical-align: top; padding-top: 13px;}
-[lang^=en] #endList {padding-top: 20px;}
diff --git a/module/program/css/edit.css b/module/program/css/edit.css
deleted file mode 100644
index 870be72a62..0000000000
--- a/module/program/css/edit.css
+++ /dev/null
@@ -1,4 +0,0 @@
-#budget {border-right: 0px;}
-#budgetUnit {border-left: 0px;}
-#dateRange, .futureBox {vertical-align: top !important; padding-top: 13px !important;}
-#endList {vertical-align: top; padding-top: 13px;}
diff --git a/module/program/css/kanban.css b/module/program/css/kanban.css
deleted file mode 100644
index af40ccb920..0000000000
--- a/module/program/css/kanban.css
+++ /dev/null
@@ -1,31 +0,0 @@
-.main-table .table {cursor: default;}
-.main-table .table td {background: #f5f5f5;}
-.main-table tbody>tr>td:first-child {padding: 0px 8px}
-
-.lane-name {overflow: hidden; text-overflow: ellipsis; writing-mode: vertical-lr;}
-
-.board-item {border: 1px solid #EBEBEB; padding: 5px 10px; cursor: default; border-radius: 2px; background-color: #fff;}
-.board-item:hover {border-color: #ccc;}
-.board-item {margin-top: 10px;}
-.board-item:last-child {margin-bottom: 10px;}
-
-#kanban {overflow-y: auto;}
-#kanban tbody > tr > td {line-height: 24px;}
-#kanban tbody > tr > td{border-right: 3px solid #fff; border-bottom: 2px solid #fff;}
-#kanban thead > tr:first-child > th:not(:first-child) {border-right: 2px solid #fff; border-bottom: 2px solid #fff;}
-#kanban thead > tr:last-child > th {border: 2px solid #fff;}
-
-.doing-td, .wait-project, .normal-plan, .normal-release {vertical-align: top !important;}
-
-.doing-td .board:first-child{padding-top: 0; border-top: unset;}
-
-.project-line {width: 100%; height: 2px; background: #fff}
-
-.doing-td .table-row .table-col:last-child, .c-progress {width: 30px;}
-.doing-td .table-row .table-col:first-child {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-
-.scroll {overflow-x: hidden; overflow-y: auto;}
-.fix-table-copy-wrapper thead > tr > th:first-child {background: none!important;}
-
-#showSettingsBox {text-align:right; margin-top:-15px; margin-right:4px;}
-#showSettingsBox .checkbox-primary {display:inline-block;}
diff --git a/module/program/css/product.css b/module/program/css/product.css
deleted file mode 100644
index e3d0d20ffd..0000000000
--- a/module/program/css/product.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.main-table thead>tr:first-of-type>th {border-left: 1px solid #ddd;}
-.main-table thead>tr>th {padding: 0px 8px; line-height: 24px;}
-tbody.sortable > tr > td > span.sort-handler {color: #999;}
-.icon-move {color: #16a8f8;}
-.table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -4px;}
-.c-PO {width: 100px;}
-.c-story {width: 300px;}
-.c-bug {width: 150px;}
-.c-plan, .c-release {width: 80px;}
-.c-actions {width: 70px;}
-#productList .c-manager {padding-left: 20px;}
-#productList .c-manager a {top: 7px; left: 26px;}
-.statistic {margin-left: 10px; color: #838a9d; float: left; position: relative; line-height: 28px;}
diff --git a/module/program/css/project.css b/module/program/css/project.css
deleted file mode 100644
index bf7345384d..0000000000
--- a/module/program/css/project.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.project-type-label.label-outline {width: 50px; min-width: 50px;}
-.project-type-label.label {overflow: unset !important; text-overflow: unset !important; white-space: unset !important;}
-[lang^='en'] .project-name > .label-warning {width: 55px !important;}
-
-.has-prefix {position: relative; display: flex; align-items: center;}
-.has-prefix > span {flex: none;}
-.has-prefix > a {padding-left: 5px;}
-
-.has-suffix > a {max-width: calc(100% - 100px); padding-right: 5px; color: #0c60e1; display: inline-block; max-width: calc(100% - 50px);}
-.c-budget {width:100px; text-align: right; padding-right:16px !important;}
-.c-manager {white-space: nowrap; overflow: hidden;}
-.c-manager a {top: 8px;}
diff --git a/module/program/js/browse.js b/module/program/js/browse.js
deleted file mode 100644
index f98e8c5ced..0000000000
--- a/module/program/js/browse.js
+++ /dev/null
@@ -1,141 +0,0 @@
-$(function()
-{
- var orderList = orderBy.split('_');
- var orderField = orderList[0];
- var orderType = orderList[1];
- setTimeout(function()
- {
- $(document).find('.dtable-header div[data-col="' + orderField + '"] > a').addClass(orderType == 'asc' ? 'sort-up' : 'sort-down');
- }, 100);
-
- $('input#editProject1').click(function()
- {
- var editProject = $(this).is(':checked') ? 1 : 0;
- $.cookie('editProject', editProject, {expires:config.cookieLife, path:config.webRoot});
- dtableWithZentao.render({checkable: editProject});
- });
-
- if($.cookie('editProject') == 1) $('input#editProject1').prop('checked', 'true');
- var isEditMode = $('input#editProject1').is(':checked');
- var projectIdList = [];
- dtableWithZentao.render({
- checkable: isEditMode,
- canRowCheckable(id)
- {
- const rowInfo = this.getRowInfo(id);
- return rowInfo.data?.type === 'project';
- },
- footToolbar: {
- items: [
- {size: 'sm', text: editLang, btnType: 'primary', className: 'edit-btn'},
- ],
- },
- footPager: {
- items: [
- {type: 'info', text: pagerLang.totalCountAB},
- {type: 'size-menu', text: pagerLang.pageSizeAB},
- {type: 'link', page: 'first', icon: 'icon-first-page', hint: pagerLang.firstPage},
- {type: 'link', page: 'prev', icon: 'icon-angle-left', hint: pagerLang.previousPage},
- {type: 'info', text: '{page}/{pageTotal}'},
- {type: 'link', page: 'next', icon: 'icon-angle-right', hint: pagerLang.nextPage},
- {type: 'link', page: 'last', icon: 'icon-last-page', hint: pagerLang.lastPage},
- ],
- page: pageID,
- recTotal: recTotal,
- recPerPage: recPerPage,
- linkCreator: pagerLink,
- },
- footer() {
- const statistic = () => {
- const checkedCount = this.getChecks().length;
- const text = isEditMode && checkedCount ? checkedProjects.replace('%s', checkedCount) : programSummary;
-
- projectIdList = this.getChecks();
- return [{children: text, className: 'text-dark'}];
- };
- if (isEditMode) {
- return [
- 'checkbox',
- 'toolbar',
- statistic,
- 'flex',
- 'pager',
- ];
- }
- return [
- statistic,
- 'flex',
- 'pager',
- ];
- },
- });
-
- $(document).on('click', ".dtable-footer .edit-btn.toolbar-item", function()
- {
- var batchEditLink = createLink('project', 'batchEdit');
- var tempform = document.createElement("form");
- tempform.action = batchEditLink;
- tempform.method = "post";
- tempform.style.display = "none";
-
- var opt = document.createElement("input");
- opt.name = 'projectIdList';
- opt.value = projectIdList;
-
- tempform.appendChild(opt);
- document.body.appendChild(tempform);
- tempform.submit();
- });
-
- if(status == 'bySearch') $('.dtable-footer').hide();
-
- /* Solve the problem that clicking the browser back button causes the checkbox to be selected by default. */
- setTimeout(function()
- {
- $(":checkbox[name^='projectIdList']").each(function()
- {
- $(this).prop('checked', false);
- });
- $('.table-footer #checkAll').prop('checked', false);
- }, 10);
-});
-
-function showEditCheckbox(show)
-{
- $('.icon-project,.icon-waterfall,.icon-scrum,.icon-kanban,.icon-agileplus,.icon-waterfallplus').each(function()
- {
- $this = $(this);
- $tr = $(this).closest('tr');
- projectID = $tr.attr('data-id');
- if(show)
- {
- var marginLeft = $tr.find('td:first').find('span.table-nest-icon').css('margin-left');
-
- $tr.find('td:first').prepend("
");
- $tr.find('td:first').find('.checkbox-primary').css('margin-left', marginLeft).css('width', '14');
- $tr.find('td:first').find('span.table-nest-icon').css('margin-left', '0');
- }
- else
- {
- var marginLeft = $tr.find('td:first').find('.checkbox-primary').css('margin-left');
- $tr.find('td:first').find('span.table-nest-icon').css('margin-left', marginLeft);
- $tr.find('td:first').find('[name^="projectIdList"]').parent().remove();
- }
- });
- if(show && hasProject)
- {
- var tableFooter = "
";
- $('#programForm').attr('action', createLink('project', 'batchEdit', 'from=program'));
- $('.table-footer').prepend(tableFooter).show();
- $('body').scroll();
- }
- else
- {
- $('#programForm').removeClass('has-row-checked');
- $('#projectsSummary').addClass('hidden');
- $('#programSummary').removeClass('hidden');
- $('#programForm').find('.editCheckbox').remove();
- if($('#programForm .pager').length == 0) $('.table-footer').hide();
- $('#programForm').removeAttr('action');
- }
-}
diff --git a/module/program/js/create.js b/module/program/js/create.js
deleted file mode 100644
index 0a1d45c1fa..0000000000
--- a/module/program/js/create.js
+++ /dev/null
@@ -1,43 +0,0 @@
-$(function()
-{
- $('#isCat').change(function()
- {
- if($(this).prop('checked'))
- {
- $('#longTimeBox').removeClass('hidden');
- }
- else
- {
- $('#longTimeBox').addClass('hidden');
- $('#longTimeBox').find('#longTime').prop('checked', false).change();
- }
- });
-
- $('#longTime').change(function()
- {
- if($(this).prop('checked'))
- {
- $('#end').val('').attr('disabled', 'disabled');
- }
- else
- {
- $('#end').removeAttr('disabled');
- }
- });
-
- $('#end').change(function()
- {
- var beginDate = $('#begin').val();
- var endDate = $('#end').val();
- var begin = new Date(beginDate.replace(/-/g,"/"));
- var end = new Date(endDate.replace(/-/g,"/"));
- var time = end.getTime() - begin.getTime();
- var days = parseInt(time / (1000 * 60 * 60 * 24)) + 1;
- if(days != $("input:radio[name='delta']:checked").val()) $("input:radio[name='delta']:checked").attr('checked',false);
- })
-});
-
-function setCopyProject(copiedProgramID)
-{
- location.href = createLink('program', 'create', 'template=' + template + '&programID=' + parentProgramID + '©ProgramID=' + copiedProgramID);
-}
diff --git a/module/program/js/edit.js b/module/program/js/edit.js
deleted file mode 100644
index 285a5ab56a..0000000000
--- a/module/program/js/edit.js
+++ /dev/null
@@ -1,87 +0,0 @@
-$(function()
-{
- var endDate = $('#end').val();
- $('#isCat').change(function()
- {
- if($(this).prop('checked'))
- {
- $('#longTimeBox').removeClass('hidden');
- $('#longTime').change();
- }
- else
- {
- $('#longTimeBox').addClass('hidden');
- $('#longTimeBox').find('#longTime').prop('checked', false).change();
- }
- });
-
- $('#longTime').change(function()
- {
- if($(this).prop('checked'))
- {
- $('#end').val('').attr('disabled', 'disabled');
- }
- else
- {
- $('#end').val(endDate).removeAttr('disabled');
- }
- });
-
- $('#end').change(function()
- {
- var beginDate = $('#begin').val();
- var endDate = $('#end').val();
- var begin = new Date(beginDate.replace(/-/g,"/"));
- var end = new Date(endDate.replace(/-/g,"/"));
- var time = end.getTime() - begin.getTime();
- var days = parseInt(time / (1000 * 60 * 60 * 24)) + 1;
- if(days != $("input:radio[name='delta']:checked").val()) $("input:radio[name='delta']:checked").attr('checked',false);
- })
-
- $('#isCat').change();
-
- $('#budgetUnit').change(function()
- {
- if($(this).val() != oldBudgetUnit)
- {
- $('#currentUnit').text(budgetUnitList[$(this).val()]);
- $('#changeUnitTip').modal({show: true});
- }
- })
-
- $('#cancelBTN').click(function()
- {
- $('#syncPRJUnit').val('false');
- $('#exchangeRate').val('');
- })
-
- $('#confirmBTN').click(function()
- {
- var exchangeRate = $('#rate').val();
- if(!exchangeRate)
- {
- bootbox.alert(exRateNotEmpty);
- return false;
- }
- else if(isNaN(exchangeRate))
- {
- bootbox.alert(exRateNum);
- return false;
- }
- else if(exchangeRate < 0)
- {
- bootbox.alert(exRateNotNegative);
- return false;
- }
-
- $('#syncPRJUnit').val('true');
- $('#exchangeRate').val(exchangeRate);
- $('#changeUnitTip').modal('hide');
- })
-
- /* If end is longtime, set the default date to today */
- var today = $.zui.formatDate(new Date(), 'yyyy-MM-dd');
- if($('#end').val() == longTime) $('#end').val(today).datetimepicker('update').val(longTime);
-
- $('#realBegan').datetimepicker('setEndDate', today);
-});
diff --git a/module/program/js/kanban.js b/module/program/js/kanban.js
deleted file mode 100644
index 39d1042978..0000000000
--- a/module/program/js/kanban.js
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * Process kanban data
- * @param {string} key Kanban key, used as kanban id
- * @param {Object} programsData Programs data
- * @returns {Object} kanban data
- */
-function processKanbanData(key, programsData)
-{
- var kanbanId = key;
-
- /* Generate columns */
- var columns = [];
- var executionsCol;
- $.each(kanbanColumns, function(_, column)
- {
- var colType = column.type;
- column = $.extend({}, column,
- {
- kanban: kanbanId,
- id: kanbanId + '-' + column.type,
- parentType: (colType === 'doingProject' || colType === 'doingExecution') ? 'doing' : false,
- });
-
- if(colType === 'doingProject')
- {
- columns.push(
- {
- kanban: kanbanId,
- id: kanbanId + '-doing',
- type: 'doing',
- asParent: true,
- name: doingText,
- count: ''
- });
- }
- else if(colType === 'doingExecution')
- {
- executionsCol = column;
- executionsCol.count = 0;
- }
- columns.push(column);
- });
-
- /* Format lanes data */
- var lanes = [];
- $.each(programsData, function(programId, program)
- {
- var subLanes = [];
-
- $.each(program.products, function(_, product)
- {
- var items = {};
-
- /* unclosed products */
- var productID = product.id;
- var productItem = {id: 'product-' + productID, _id: productID, name: product.name, shadow: product.shadow};
- items.unclosedProduct = [productItem];
-
- /* plans */
- items.unexpiredPlan = [];
- var plans = product.plans;
- if(plans)
- {
- $.each(plans, function(_, plan)
- {
- var planID = plan.id;
- items.unexpiredPlan.push($.extend({}, plan, {id: 'plan-' + planID, _id: planID}));
- });
- }
-
- /* wait projects */
- items.waitProject = [];
- var waitProjects = product.projects && product.projects.wait;
- if(waitProjects)
- {
- $.each(waitProjects, function(_, project)
- {
- var projectID = project.id;
- var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID});
- items.waitProject.push(projectItem);
- });
- }
-
- /* doing projects and executions */
- items.doingProject = [];
- var doingProjects = product.projects && product.projects.doing;
- if(doingProjects)
- {
- $.each(doingProjects, function(_, project)
- {
- var projectID = project.id;
- var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID, execution: null});
- items.doingProject.push(projectItem);
-
- var execution = project.execution;
- if(!execution || !execution.id) return;
-
- executionsCol.count++;
- projectItem.execution = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
- });
- }
-
- /* normal release */
- items.normalRelease = [];
- var releases = product.releases;
- if(releases)
- {
- $.each(releases, function(_, release)
- {
- if(!release || !release.id) return;
- var releaseID = release.id;
- var releaseItem = $.extend({}, release, {id: 'release-' + releaseID, _id: releaseID});
- items.normalRelease.push(releaseItem);
- });
- }
-
- subLanes.push({id: kanbanId + '-' + programId + '-' + productID, items: items});
- });
-
- var programItem = $.extend({}, program, {id: programId, kanban: kanbanId, subLanes: subLanes});
- lanes.push(programItem);
- });
-
- return {id: kanbanId, columns: columns, lanes: lanes};
-}
-
-/** Calculate column height */
-function calcColHeight(col, lane, colCards, colHeight)
-{
- if (col.type !== 'doingProject') return colHeight;
- return colCards.length * 62;
-}
-
-/**
- * Init kanban.
- *
- * @access public
- * @return void
- */
-function initKanban()
-{
- $.each(kanbanGroup, function(key, programsData)
- {
- var $kanban = $('#kanban-' + key);
- if(!$kanban.length) return;
- $kanban.kanban(
- {
- data: processKanbanData(key, programsData),
- virtualize: true,
- virtualCardList: true,
- calcColHeight: calcColHeight
- });
- });
-}
-
-$(function()
-{
- /* Init all kanbans */
- initKanban();
-
- $('#showAllProjects').click(function()
- {
- var showAllProjects = $(this).prop('checked') ? 1 : 0;
- $.post(createLink('program', 'ajaxSetShowSetting'), {"showAllProjects": showAllProjects}, function()
- {
- $.get(createLink('program', 'kanban'), function(data)
- {
- $('#kanbanList').html($(data).find('#kanbanList').html());
- initKanban();
- });
- })
- })
-});
diff --git a/module/program/js/product.js b/module/program/js/product.js
deleted file mode 100644
index 25d0aeebc9..0000000000
--- a/module/program/js/product.js
+++ /dev/null
@@ -1,114 +0,0 @@
-$(function()
-{
- $('input[name^="showEdit"]').click(function()
- {
- $.cookie('showProductBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
- setCheckbox();
- });
- setCheckbox();
-
- $(":checkbox[name^='productIDList']").on('click', function()
- {
- updateStatistic();
- });
-
- $(".check-all").on('click', function()
- {
- if($(":checkbox[name^='productIDList']:not(:checked)").length == 0)
- {
- $(":checkbox[name^='productIDList']").prop('checked', false);
- }
- else
- {
- $(":checkbox[name^='productIDList']").prop('checked', true);
- }
- updateStatistic();
- });
-
- $('.main-table').on('click', 'tr', function(e)
- {
- if($.cookie('showProductBatchEdit') == 1) updateStatistic();
- });
-});
-
-
-/**
- * Set batch edit checkbox.
- *
- * @access public
- * @return void
- */
-function setCheckbox()
-{
- $('#productListForm .checkbox-primary, #productListForm .check-all').hide();
- $('#productListForm .product-id').addClass('hidden');
- $(":checkbox[name^='productIDList']").prop('checked', false);
- $('.check-all, .sortable tr').removeClass('checked');
- if($.cookie('showProductBatchEdit') == 1)
- {
- $('#productListForm .checkbox-primary, #productListForm .check-all').show();
- }
- else
- {
- $('.table-actions').hide();
- $('#productListForm .product-id').removeClass('hidden');
- }
- updateStatistic();
-}
-
-/**
- * Add a statistics prompt statement after the Edit button.
- *
- * @access public
- * @return void
- */
-function addStatistic()
-{
- var checkedLength = $(":checkbox[name^='productIDList']:checked").length;
- if(checkedLength > 0)
- {
- var summary = checkedProducts.replace('%s', checkedLength);
- if(cilentLang == "en" && checkedLength < 2) summary = summary.replace('products', 'product');
-
- var statistic = "
" + summary + "
";
- $('#productsCount').hide();
- $('#productsSummary').remove();
- $('#editBtn').after(statistic);
- $('.table-actions').show();
- }
- else
- {
- $('.table-actions').hide();
- $('#productsCount').show();
- $('#productsSummary').addClass('hidden');
- }
-}
-
-/**
- * Anti shake operation for jquery.
- *
- * @param fn $fn
- * @param delay $delay
- * @access public
- * @return void
- */
-function debounce(fn, delay)
-{
- var timer = null;
- return function()
- {
- if(timer) clearTimeout(timer);
- timer = setTimeout(fn, delay)
- }
-}
-
-/**
- * Update statistics.
- *
- * @access public
- * @return void
- */
-function updateStatistic()
-{
- debounce(addStatistic(), 200)
-}
diff --git a/module/program/js/project.js b/module/program/js/project.js
deleted file mode 100644
index 6bdfd10139..0000000000
--- a/module/program/js/project.js
+++ /dev/null
@@ -1,131 +0,0 @@
-$(function()
-{
- $('#projectsForm').table(
- {
- replaceId: 'projectIdList',
- statisticCreator: function(table)
- {
- var $table = table.getTable();
- var $checkedRows = $table.find('tbody>tr.checked');
- var checkedTotal = $checkedRows.length;
- var statistics = summary;
- var checkedStatistics = checkedSummary.replace('%total%', checkedTotal);
-
- if(browseType == 'all')
- {
- var checkedWait = $checkedRows.filter("[data-status=wait]").length;
- var checkedDoing = $checkedRows.filter("[data-status=doing]").length;
- var checkedSuspended = $checkedRows.filter("[data-status=suspended]").length;
- var checkedClosed = $checkedRows.filter("[data-status=closed]").length;
-
- statistics = allSummary;
- checkedStatistics = checkedAllSummary.replace('%total%', checkedTotal)
- .replace('%wait%', checkedWait)
- .replace('%doing%', checkedDoing)
- .replace('%suspended%', checkedSuspended)
- .replace('%closed%', checkedClosed);
- }
-
- return checkedTotal ? checkedStatistics : statistics;
- }
- });
-
- $('input[name^="showEdit"]').click(function()
- {
- $.cookie('showProjectBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
- setCheckbox();
- });
- setCheckbox();
-
- $(":checkbox[name^='projectIdList']").on('click', function()
- {
- updateStatistic()
- });
-
- $(".check-all").on('click', function()
- {
- if($(":checkbox[name^='projectIdList']:not(:checked)").length == 0)
- {
- $(":checkbox[name^='projectIdList']").prop('checked', false);
- }
- else
- {
- $(":checkbox[name^='projectIdList']").prop('checked', true);
- }
- updateStatistic()
- });
-
- $('.main-table').on('click', 'tr', function(e)
- {
- if($.cookie('showProjectBatchEdit') == 1) updateStatistic();
- })
-});
-
-/**
- * Set batch edit checkbox.
- *
- * @access public
- * @return void
- */
-function setCheckbox()
-{
- $('#projectsForm .checkbox-primary').hide();
- $(":checkbox[name^='projectIdList']").prop('checked', false);
- $('.check-all, .sortable tr').removeClass('checked');
- if($.cookie('showProjectBatchEdit') == 1)
- {
- $('#projectsForm .checkbox-primary').show();
- }
- else
- {
- $('.table-actions').hide();
- }
-}
-
-/**
- * Add a statistics prompt statement after the Edit button.
- *
- * @access public
- * @return void
- */
-function addStatistic()
-{
- var checkedLength = $(":checkbox[name^='projectIdList']:checked").length;
- if(checkedLength > 0)
- {
- $('.table-actions').show();
- }
- else
- {
- $('.table-actions').hide();
- }
-}
-
-/**
- * Anti shake operation for jquery.
- *
- * @param fn $fn
- * @param delay $delay
- * @access public
- * @return void
- */
-function debounce(fn, delay)
-{
- var timer = null;
- return function()
- {
- if(timer) clearTimeout(timer);
- timer = setTimeout(fn, delay)
- }
-}
-
-/**
- * Update statistics.
- *
- * @access public
- * @return void
- */
-function updateStatistic()
-{
- debounce(addStatistic(), 200)
-}
diff --git a/module/programplan/css/create.css b/module/programplan/css/create.css
deleted file mode 100644
index c43afc7a47..0000000000
--- a/module/programplan/css/create.css
+++ /dev/null
@@ -1,4 +0,0 @@
-#planForm tr td {vertical-align: top;}
-#mainContent .methodTitle, #mainContent .methodTip {display: inline-block; vertical-align: middle;}
-.type-list-radio {display: inline-block; padding: 10px 5px;}
-#planForm .c-attribute {width: 110px;}
diff --git a/module/programplan/js/browse.js b/module/programplan/js/browse.js
deleted file mode 100644
index 480420dc76..0000000000
--- a/module/programplan/js/browse.js
+++ /dev/null
@@ -1,34 +0,0 @@
-$(function()
-{
- setTimeout(function()
- {
- fixScroll();
- }, 500);
-})
-
-function fixScroll()
-{
- var $scrollwrapper = $('div.datatable').first().find('.scroll-wrapper:first');
- if($scrollwrapper.size() == 0)return;
-
- var $tfoot = $('div.datatable').first().find('table tfoot:last');
- var scrollOffset = $scrollwrapper.offset().top + $scrollwrapper.find('.scroll-slide').height();
- if($tfoot.size() > 0) scrollOffset += $tfoot.height();
- if($('div.datatable.head-fixed').size() == 0) scrollOffset -= '29';
- var windowH = $(window).height();
- if(scrollOffset > windowH + $(window).scrollTop()) $scrollwrapper.css({'position': 'fixed', 'bottom': 50 + 'px'});
- $(window).scroll(function()
- {
- newBottom = $tfoot.hasClass('fixedTfootAction') ? 50 + $tfoot.height() : 50;
- if(typeof(ssoRedirect) != "undefined") newBottom = 50;
- if(scrollOffset <= windowH + $(window).scrollTop())
- {
- $scrollwrapper.css({'position':'relative', 'bottom': '0px'});
- }
- else if($scrollwrapper.css('position') != 'fixed')
- {
- $scrollwrapper.css({'position': 'fixed', 'bottom': newBottom + 'px'});
- bottom = newBottom;
- }
- });
-}
diff --git a/module/programplan/js/create.js b/module/programplan/js/create.js
deleted file mode 100644
index 13f91ece2d..0000000000
--- a/module/programplan/js/create.js
+++ /dev/null
@@ -1,83 +0,0 @@
-$(function()
-{
- $('input').on('change', function()
- {
- $(this).removeClass('has-error');
- $(this).closest('td').find('.text-danger.help-text').remove();
- });
-
- $('[data-toggle="popover"]').popover();
-});
-/**
- * Add item to create view of programplan.
- *
- * @param obj obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, itemIndex);
- $(obj).closest('tr').after('
' + item + '
');
- var newItem = $('#names' + itemIndex).closest('tr');
- newItem.find('.form-date').datepicker();
- $("#output" + itemIndex).picker();
- $("#PM" + itemIndex).picker();
- $("#type" + itemIndex).chosen();
- $("#type_i__chosen").remove();
- itemIndex ++;
-}
-
-/**
- * Delete item.
- *
- * @param obj obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#planForm .table tbody').children().length < 2) return false;
- $(obj).closest('tr').remove();
-}
-
-/**
- * Add row errors.
- *
- * @param array $rowErrors
- * @access public
- * @return void
- */
-function addRowErrors(rowErrors)
-{
- var errorFieldID, errorTip, errorHTML;
- $('.text-danger.help-text').remove();
- $('input').removeClass('has-error');
- var index = 0;
- var alterError = '';
- $('input[name^=names]').each(function()
- {
- if($(this).val() == '') return true;
-
- if(typeof rowErrors[index] == 'object')
- {
- for(var errorField in rowErrors[index])
- {
- $errorTD = $(this).closest('tr').find('input[name^=' + errorField + ']').closest('td');
- errorTip = rowErrors[index][errorField];
- errorHTML = '
' + errorTip + '
';
- $errorTD.append(errorHTML);
- $errorTD.find('input').addClass('has-error');
- }
- }
- if(typeof rowErrors['percent'] == 'string')
- {
- errorFieldID = $(this).closest('tr').find('input[name^=percent]').attr('id');
- errorHTML = '
' + rowErrors['percent'] + '
';
- $('#' + errorFieldID).closest('td').append(errorHTML);
- $('#' + errorFieldID).closest('td').find('input').addClass('has-error');
- }
-
- index ++;
- });
-}
diff --git a/module/programplan/js/edit.js b/module/programplan/js/edit.js
deleted file mode 100644
index c2a243fa1f..0000000000
--- a/module/programplan/js/edit.js
+++ /dev/null
@@ -1,62 +0,0 @@
-function changeParentStage(stageID)
-{
- $.get(createLink('programplan', 'ajaxGetAttribute', 'stageID=' + stageID + '&attribute=' + plan.attribute), function(attribute)
- {
- $('#attributeType td:first').html(attribute);
- $("#attribute" + "_chosen").remove();
- $("#attribute").next('.picker').remove();
- $("#attribute").chosen();
- })
-}
-
-$(function()
-{
- $("#parent").change(function()
- {
- var parent = $(this).children("option:selected").val();
-
- if(parent == 0)
- {
- $("#acl").attr('disabled', false);
- }
- else
- {
- $("#acl").attr('disabled', true);
- }
-
- changeParentStage(parent);
- });
-
- $('#submit').click(function()
- {
- if(plan.parent != $('#parent').val() && $('#parent').val() != 0)
- {
- var result = true;
-
- $.ajaxSettings.async = false;
- $.get(createLink('programplan', 'ajaxGetStageAttr', 'stageID=' + $('#parent').val()), function(attribute)
- {
- if(attribute != 'mix' && plan.attribute != attribute)
- {
- result = confirm(changeAttrLang.replace('%s', stageTypeList[attribute]));
- }
- })
- $.ajaxSettings.async = true;
-
- if(!result) return false;
- }
-
- var currentAttribute = $('#attribute').val();
- var currentParent = $('#parent').val();
- var hasChangedAttribute = (currentAttribute && currentAttribute != 'mix' && plan.attribute != currentAttribute);
- var hasChangedParent = ((isTopStage && $('#parent').val() != 0) || (!isTopStage && plan.parent != $('#parent').val()));
- if(hasChangedAttribute && !hasChangedParent && !isLeafStage)
- {
- var result = confirm(changeAttrLang.replace('%s', stageTypeList[currentAttribute]));
-
- if(!result) return false;
- }
- })
-
- $('[data-toggle="popover"]').popover();
-})
diff --git a/module/project/css/batchedit.css b/module/project/css/batchedit.css
deleted file mode 100644
index 583cc42539..0000000000
--- a/module/project/css/batchedit.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.c-id {width: 40px;}
-.c-date {width: 120px;}
-.c-parent {width: 180px;}
-.c-name {width: 180px;}
-.c-code {width: 160px;}
-.c-acl {width: 125px;}
-#dateTip {padding: 0 7px;}
diff --git a/module/project/css/browse.css b/module/project/css/browse.css
deleted file mode 100644
index 7f51feabce..0000000000
--- a/module/project/css/browse.css
+++ /dev/null
@@ -1,25 +0,0 @@
-body {margin-bottom: 25px;}
-.side-col .detail-content {padding-left: 10px; margin-top: 0px;}
-.side-col {padding-right: 20px; width: 18%;}
-#sidebar>.cell {width: 100%;}
-
-.c-budget {text-align: right; padding-right:16px !important;}
-td.c-actions {overflow: visible;}
-td.c-PM {white-space: nowrap; overflow: hidden;}
-.c-actions .btn {overflow: visible;}
-#programBox {float: left; margin-right: 10px; width: 170px !important;}
-#switchButton {background: #fff !important;}
-.icon-cards-view {padding-left: 7px; font-size: 16px;}
-.icon-list {padding-left: 7px;}
-.panel-actions {position: relative; padding: 0 0;}
-th.c-name {min-width: 240px;}
-@media screen and (min-width: 1460px)
-{
- th.c-name {width: auto;}
-}
-[lang^='en'] .project-name > .label-warning {width: 55px !important;}
-
-.table-responsive {overflow: auto !important;}
-.checkbox-primary {margin-right: 10px;}
-#sidebar {padding: 0px; width: 200px;}
-#sidebar .cell {width: 180px;}
diff --git a/module/project/css/build.css b/module/project/css/build.css
deleted file mode 100644
index c7d1e2cf90..0000000000
--- a/module/project/css/build.css
+++ /dev/null
@@ -1 +0,0 @@
-#buildList .icon-code-fork:before {transform: rotate(180deg) rotateY(179deg);}
diff --git a/module/project/css/create.css b/module/project/css/create.css
deleted file mode 100755
index 53e8efe5e9..0000000000
--- a/module/project/css/create.css
+++ /dev/null
@@ -1,28 +0,0 @@
-.popover-sm .popover-content {padding: 8px 10px; max-width: 228px;}
-
-#dateRange {vertical-align: top; padding-top: 13px;}
-#endList {vertical-align: top; padding-top: 13px;}
-#copyProjectModal {padding: 0;}
-#copyProjectModal {padding: 0 2px;}
-#copyProjectModal > div {position: relative;}
-#copyProjectModal a {display: block; min-height: 30px; line-height: 30px; padding: 5px 15px; border: 1px solid #e5e5e5; color: #333; margin: 5px 0; border-radius: 3px;}
-#copyProjectModal a > i {display: inline-block; margin-right: 5px;}
-#copyProjectModal a:hover {border: 1px solid #00a9fc; background-color: #E9F2FB; text-decoration: none;}
-#copyProjectModal a.active {border-color: #00da88; color: #00da88; background-color: #E5FFE6;}
-#copyProjectModal a.active:after {position: absolute; content: '\e92f'; font-family: ZentaoIcon; font-size: 20px; right: 25px;}
-#copyProjectModal a.cancel {color: #ff5d5d;}
-#mainContent td.required:after {right: -4px;}
-#budget {border-right: 0px;}
-#budgetUnit {border-left: 0px;}
-#projectName {display: inline-block; width: 32%;}
-.productsBox a {border-radius: 2px !important;}
-.productsBox .required:after {right: -12px !important; top: 7px !important;}
-.productsBox .addProduct {padding-left: 0px !important;}
-.productsBox .addProduct.required:after {right: -1px !important;}
-.productsBox .input-group-addon > div {display: inline-block !important;}
-.productsBox .required + .text-danger.help-text {position: relative; left: 10px;}
-.productsBox > #productNameLabel {padding-top: 8px;}
-.futureBox {vertical-align: top !important; padding-top: 13px !important;}
-#projectType {padding-top: 7px !important;}
-.stageBy .icon-help {margin-left: 15px}
-.has-info {border-color: #0c64eb!important;}
diff --git a/module/project/css/dynamic.css b/module/project/css/dynamic.css
deleted file mode 100644
index 8ef4ebd3a6..0000000000
--- a/module/project/css/dynamic.css
+++ /dev/null
@@ -1,35 +0,0 @@
-#mainMenu .btn-group ul.dropdown-menu {max-height: 300px; overflow: auto;}
-#dynamics {padding: 10px 0;}
-.dynamic {position: relative; padding-left: 170px;}
-.dynamic-date {position: absolute; left: 0; top: 0; width: 150px; border: 2px solid #eee; border-radius: 4px; padding: 14px 20px; height: 58px;}
-.dynamic-date:before {content: ' '; display: block; position: absolute; right: -22px; top: 26px; height: 2px; width: 20px; background-color: #eee;}
-.dynamic-date > .date-label,
-.dynamic-date > .date-text {font-size: 18px; display: block;}
-.dynamic-date > .date-label + .date-text {font-size: 14px; line-height: 14px;}
-.dynamic-date > .date-label {margin-top: -8px;}
-.dynamic-date > .btn {position: absolute; right: 10px; top: 15px;}
-.dynamic .timeline {border: 2px solid #eee; border-radius: 4px; margin-bottom: 20px; padding: 10px 20px 10px 100px; transition: max-height .2s; overflow: hidden;}
-.dynamic .timeline-tag {left: -75px; font-size: 14px; color: #838A9D;}
-.dynamic .timeline-text {color: #3C4353;}
-.dynamic .text-muted {color: #838A9D;}
-.dynamic .label-id {top: -1px; border: 1px solid rgba(131,138,157,0.25); color: #838A9D;}
-.dynamic.active .timeline,
-.dynamic.active .dynamic-date {border-color: #00a9fc;}
-.dynamic.active .dynamic-date:before {background-color: #00a9fc;}
-.dynamic.collapsed .timeline {max-height: 58px;}
-.dynamic.collapsed .timeline > li + li {display: none;}
-.dynamic.collapsed .dynamic-btn > .icon:before {content: '\f0d8';}
-
-.timeline > li:before {left: -26px;}
-.timeline > li + li:after {left: -23px;}
-.timeline-text {margin-left: -18px;}
-.label-action {padding: 0 4px;}
-.label-id {margin-left: 4px;}
-.timeline > li.active:before {left: -30px;}
-.timeline > li.collected:before, .timeline > li.releaseddoc:before {background-color: #FFF;}
-.timeline > li.collected > div:after {background-color: #FFAF65;}
-.timeline > li.releaseddoc > div:after {background-color: #66A2FF;}
-.timeline > li > div:after {left: -27px;}
-.timeline .timeline-text {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-.timeline > li > div > .timeline-tag, .timeline > li > div > .timeline-text > .label-action {color: #838A9D;}
-.timeline > li > div > .timeline-text > a {color: #313C52;}
diff --git a/module/project/css/edit.css b/module/project/css/edit.css
deleted file mode 100644
index 12113d5d32..0000000000
--- a/module/project/css/edit.css
+++ /dev/null
@@ -1,8 +0,0 @@
-#budget {border-right: 0px;}
-#budgetUnit {border-left: 0px;}
-#plansBox .row {display: inline-table; width: 102%;}
-#plansBox .col-sm-4 {float: none; display: inline-block;}
-#dateRange, .futureBox {vertical-align: top !important; padding-top: 13px !important;}
-#endList {vertical-align: top; padding-top: 13px;}
-#linkPlan {padding-top: 25px !important;}
-#projectType {padding-top: 7px !important;}
diff --git a/module/project/css/execution.css b/module/project/css/execution.css
deleted file mode 100644
index afd49abd35..0000000000
--- a/module/project/css/execution.css
+++ /dev/null
@@ -1,24 +0,0 @@
-#executionList > thead > tr > th .table-nest-toggle-global {position: static!important;}
-#executionList > thead > tr > th .table-nest-toggle-global:before {color: #a6aab8; position: static!important;}
-#executionsSummary {padding-left: 10px;}
-#mainMenu .pull-left .checkbox-primary {margin-top: 5px;}
-.main-table tbody>tr>td:first-child, .main-table thead>tr>th:first-child { padding-left: 8px; }
-
-th.table-nest-title-edit {padding-left: 50px !important;}
-th.table-nest-title-edit .table-nest-toggle {left: 28px;}
-th.table-nest-title .check-all {position: absolute; left: 15px; top: 7px;}
-.c-date {text-align: center;}
-#executionTableList > tr.has-nest-child .table-nest-toggle {vertical-align: middle;}
-#executionTableList > tr:not(.has-nest-child) .table-nest-toggle {display: none;}
-#executionTableList > tr.is-top-level:not(.has-nest-child) .project-type-label {margin-left: 22px;}
-.table-statistic {padding-left: 10px;}
-td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center; margin-bottom: 0px;}
-td.c-name > .project-type-label {flex: 0 0 36px; padding-right: 2px;}
-.c-name > a, .table-children .text-left > a, .c-name > span.text-ellipsis { padding-left: 5px; text-overflow: clip;}
-span.table-nest-icon.table-nest-toggle {min-width: 22px; max-width: 22px;}
-span.table-nest-icon {padding-left: 22px;}
-#projectForm .c-name, #executionTableList .c-name, #programTableList .c-name {padding-right:47px;}
-#mainMenu .pull-left > .btn-group > a > .text{overflow: hidden;display: block;}
-#mainMenu .pull-right .icon-list{padding-left: 7px;}
-#mainMenu .btn-group.dropdown > .create-execution-btn {border-right: 1px solid rgba(255,255,255,0.2);}
-#mainMenu .btn-group.dropdown > button.btn-primary {padding: 6px;}
diff --git a/module/project/css/group.css b/module/project/css/group.css
deleted file mode 100644
index 238fd83cb1..0000000000
--- a/module/project/css/group.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.c-id {width: 60px;}
-.c-name {width: 300px;}
-.c-desc {width: 300px;}
diff --git a/module/project/css/kanban.css b/module/project/css/kanban.css
deleted file mode 100644
index f83fa33f6f..0000000000
--- a/module/project/css/kanban.css
+++ /dev/null
@@ -1,26 +0,0 @@
-.main-table .table {cursor: default;}
-.main-table .table td {background: #efefef;}
-
-.board-item {border: 1px solid #EBEBEB; padding: 5px 10px; cursor: default; border-radius: 2px; background-color: #fff;}
-.board-item:hover {border-color: #ccc;}
-.board-project .board-item + .board-item {margin-top: 10px;}
-
-.board-project {padding: 0 10px 10px 10px;}
-.board-project .board-item:first-child {margin-top: 10px;}
-
-.board-doing, .board-wait, .board-closed {padding: 0px !important; vertical-align: top !important;}
-.board-doing .board-doing-project,.board-doing .board-doing-execution {padding: 10px;}
-.board-doing .board-doing-project:not(:last-child),
-.board-doing .board-doing-execution:not(:last-child) {border-bottom: 2px solid #fff;}
-
-.board-doing-project .table-row .table-col:last-child,
-.board-doing-execution .table-row .table-col:last-child, .c-progress {width: 30px; padding-top: 2px; padding-left: 3px;}
-.table-row .table-col:first-child, .board-project .board-item {overflow: hidden; white-space: nowrap;}
-
-table th, td {border: 2px solid #fff !important;}
-
-.kanban-col[data-type='closedProject'] .count {display: none}
-.kanban-item > a {cursor: move;}
-.kanban-item.execution-item > a {cursor: pointer;}
-
-.kanban.kanban-dragging {overflow: hidden!important;}
diff --git a/module/project/css/managemembers.css b/module/project/css/managemembers.css
deleted file mode 100644
index b8a08354e8..0000000000
--- a/module/project/css/managemembers.css
+++ /dev/null
@@ -1,10 +0,0 @@
-#dept_chosen .chosen-single {width: 220px;}
-#dept + .picker {width: 220px;}
-#project_chosen .chosen-single {width: 220px;}
-#project + .picker {width: 220px;}
-#mainMenu .picker-has-value {float: left;}
-.c-days {width: 100px;}
-.c-hours {width: 90px;}
-.c-limited {width: 110px;}
-.picker-drop-menu[id^="pickerDropMenu-pk_"] .picker-option-list > .picker-user-option,
-.picker-drop-menu[id*=" pickerDropMenu-pk_"] .picker-option-list > .picker-user-option {display: flex; align-items: center;}
diff --git a/module/project/css/manageproducts.css b/module/project/css/manageproducts.css
deleted file mode 100644
index d2c6b619b1..0000000000
--- a/module/project/css/manageproducts.css
+++ /dev/null
@@ -1,10 +0,0 @@
-#productsBox .product {border: 1px solid #ddd; margin-bottom: 5px; position: relative; height: 40px; border-radius: 4px;}
-#productsBox .product:hover {background: #f1f1f1;}
-#productsBox .product.checked,
-#productsBox .product.checked:hover {background: #E5FFE6; border: 1px solid #229F24;}
-#productsBox .product .checkbox-primary {padding: 9px; cursor: pointer;}
-#productsBox .product.has-branch {padding-right: 40%;}
-#productsBox .product.has-branch > .chosen-container {position: absolute; width: 40% !important; right: 3px; top: 3px;}
-#productsBox .product.has-branch > .chosen-container > .chosen-single {background: rgba(0,0,0,.05);}
-#productsBox .product.has-branch > .chosen-container > .chosen-single:hover {background: #fff;}
-#productsBox .chosen-container .chosen-results{max-height: 180px;}
diff --git a/module/project/css/team.css b/module/project/css/team.css
deleted file mode 100644
index 562ac5d95c..0000000000
--- a/module/project/css/team.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.c-limited {width: 100px;}
-[lang^=de] .c-limited {width: 175px !important;}
-.c-actions-1 {width: 80px;}
diff --git a/module/project/css/testtask.css b/module/project/css/testtask.css
deleted file mode 100644
index 36c6fbf838..0000000000
--- a/module/project/css/testtask.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.table-group-btns {width: 200px;}
-.table-footer,
-.table-grouped {box-shadow: none !important;}
-.table-footer {margin-top: 10px;}
-.table-grouped > thead>tr>th.c-id,
-.table-grouped > tbody>tr>td.c-id {padding-left: 15px;}
-.table-grouped > tbody>tr>td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
diff --git a/module/project/css/view.css b/module/project/css/view.css
deleted file mode 100644
index 7781b29fe5..0000000000
--- a/module/project/css/view.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.block-dynamic .panel-body {height: 230px; overflow: auto; position: relative;}
-.block-team div.col-xs-6 {white-space: nowrap; overflow: hidden;}
-.cell .detail .row-grid {display: block;}
-
-.timeline > li:before {left: -26px;}
-.timeline > li + li:after {left: -23px;}
-.timeline-text {margin-left: -18px;}
-.block-dynamic .label-action {padding: 0 6px;}
-.block-dynamic .label-action + a {padding-left: 6px;}
-.timeline >li.active:before {left: -30px;}
-.timeline >li > div:after {left: -27px;}
-.timeline .timeline-text {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-.timeline > li > div > .timeline-tag, .timeline > li > div > .timeline-text > .label-action {color: #838A9D;}
-.timeline > li > div > .timeline-text > a {color: #313C52;}
-
-.table-data.data-basic tbody > tr > td {overflow: hidden;}
diff --git a/module/project/js/batchedit.js b/module/project/js/batchedit.js
deleted file mode 100644
index 0ee2ec95cc..0000000000
--- a/module/project/js/batchedit.js
+++ /dev/null
@@ -1,53 +0,0 @@
-$(function()
-{
- $("select[name^='parents']").change(function()
- {
- var $this = $(this);
- var programID = $this.val();
- var projectID = $this.attr("data-id");
- var oldParent = $this.attr("data-parent");
- var title = changeProgram.replace('%s', $this.attr("data-name"));
-
- /* Determine whether the project can change the program set. */
- link = createLink('project', 'ajaxCheckProduct', 'programID=' + programID + '&projectID=' + projectID);
- $.getJSON(link, function(data)
- {
- var changed = true;
-
- if(data && data.result)
- {
- changed = confirm(data.message);
- }
-
- if(data && !data.result)
- {
- $('#promptTable tbody tr').remove();
- $('.modal-title').text(title);
- for(var i in data.message)
- {
- var product = data.message[i];
- $('#promptTable').append("
| " + product +" " + linkedProjectsTip +" |
");
- for(var j in data.multiLinkedProjects)
- {
- if(i == j)
- {
- html = ''
- for(k in data.multiLinkedProjects[j])
- {
- var project = data.multiLinkedProjects[j][k];
- html += "
" + project +"
";
- }
- $('#promptTable').append("
| " + html + " |
");
- }
- }
- }
-
- changed = false;
- $('#promptBox').modal({show: true});
- }
-
- if(!changed) $this.val(oldParent).trigger("chosen:updated");
- $this.attr('data-parent', $this.val());
- });
- });
-});
diff --git a/module/project/js/browse.js b/module/project/js/browse.js
deleted file mode 100644
index 170bb80fa7..0000000000
--- a/module/project/js/browse.js
+++ /dev/null
@@ -1,148 +0,0 @@
-$(function()
-{
- $('input[name^="involved"]').click(function()
- {
- var involved = $(this).is(':checked') ? 1 : 0;
- $.cookie('involved', involved, {expires: config.cookieLife, path: config.webRoot});
- location.href = location.href;
- });
-
- $('[id="switchButton"]').click(function()
- {
- var projectType = $(this).attr('data-type');
- $.cookie('projectType', projectType, {expires: config.cookieLife, path: config.webRoot});
- location.href = location.href;
- });
-
- $('input[name^="showEdit"]').click(function()
- {
- $.cookie('showProjectBatchEdit', $(this).is(':checked') ? 1 : 0, {expires: config.cookieLife, path: config.webRoot});
- setCheckbox();
- });
- setCheckbox();
-
- if(!useDatatable) resetNameWidth();
-
- $(":checkbox[name^='projectIdList']").on('click', function()
- {
- updateStatistic();
- });
-
- $(".check-all").on('click', function()
- {
- if($(":checkbox[name^='projectIdList']:not(:checked)").length == 0)
- {
- $(":checkbox[name^='projectIdList']").prop('checked', false);
- }
- else
- {
- $(":checkbox[name^='projectIdList']").prop('checked', true);
- }
- updateStatistic();
- });
-
- $('.main-table').on('click', 'tr', function(e)
- {
- if($.cookie('showProjectBatchEdit') == 1) updateStatistic();
- });
-
- $('#tableCustomBtn').on('click', function()
- {
- $('.contextmenu-show').removeClass('contextmenu-show').find('.contextmenu-menu').removeClass('open');
- });
-});
-
-/**
- * Set batch edit checkbox.
- *
- * @access public
- * @return void
- */
-function setCheckbox()
-{
- $('#projectForm .checkbox-primary').hide();
- $('.check-all, .sortable tr').removeClass('checked');
- $(":checkbox[name^='projectIdList']").prop('checked', false);
- if($.cookie('showProjectBatchEdit') == 1)
- {
- $('#projectForm .checkbox-primary').show();
- }
- else
- {
- $('.table-actions').hide();
- }
-}
-
-function resetNameWidth()
-{
- $name = $('#projectForm thead th.c-name');
- if($name.width() < 350) $name.width(350);
-}
-
-$('#mainContent .sidebar-toggle').click(function()
-{
- if(!useDatatable) setTimeout("resetNameWidth()", 100);
-})
-
-/**
- * Change program.
- *
- * @param int $programID
- * @access public
- * @return void
- */
-function changeProgram(programID)
-{
- link = createLink('project', 'browse', 'programID=' + programID + '&browseType=' + browseType + '¶m=' + param + '&orderBy=order_asc&recTotal=' + recTotal + '&recPerPage=' + recPerPage + '&pageID=' + pageID);
- location.href = link;
-}
-
-$(".tree #program" + programID).parent('li').addClass('active');
-
-/**
- * Add a statistics prompt statement after the Edit button.
- *
- * @access public
- * @return void
- */
-function addStatistic()
-{
- var checkedLength = $(":checkbox[name^='projectIdList']:checked").length;
- if(checkedLength > 0)
- {
- $('.table-actions').show();
- }
- else
- {
- $('.table-actions').hide();
- }
-}
-
-/**
- * Anti shake operation for jquery.
- *
- * @param fn $fn
- * @param delay $delay
- * @access public
- * @return void
- */
-function debounce(fn, delay)
-{
- var timer = null;
- return function()
- {
- if(timer) clearTimeout(timer);
- timer = setTimeout(fn, delay)
- }
-}
-
-/**
- * Update statistics.
- *
- * @access public
- * @return void
- */
-function updateStatistic()
-{
- debounce(addStatistic(), 200)
-}
diff --git a/module/project/js/bug.js b/module/project/js/bug.js
deleted file mode 100644
index ce07804c40..0000000000
--- a/module/project/js/bug.js
+++ /dev/null
@@ -1,5 +0,0 @@
-$(function()
-{
- if(browseType != 'bysearch') $('#module' + param).closest('li').addClass('active');
- if($('#bugList thead th.c-title').width() < 150) $('#bugList thead th.c-title').width(150);
-});
diff --git a/module/project/js/build.js b/module/project/js/build.js
deleted file mode 100644
index 0c6f514ae7..0000000000
--- a/module/project/js/build.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Change product.
- *
- * @param int $productID
- * @access public
- * @return void
- */
-function changeProduct(productID)
-{
- link = createLink(fromModule, fromMethod, 'projectID=' + projectID + '&type=product¶m=' + productID);
- location.href = link;
-}
-
-$(function()
-{
- $('td .execution .label-danger').each(function()
- {
- $execution = $(this).closest('.execution');
- $td = $(this).closest('td');
- if($td.width() < $execution.width())
- {
- $execution.find('.executionName').css('display', 'inline-block').css('width', $td.width() - $(this).width()).css('overflow', 'hidden').css('float', 'left');
- }
- })
-
- $('td.c-name .build .icon-code-fork').each(function()
- {
- $build = $(this).closest('.build');
- $td = $(this).closest('td');
- if($td.width() < $build.width())
- {
- $build.find('.buildName').css('display', 'inline-block').css('width', $td.width() - $(this).width()).css('overflow', 'hidden').css('float', 'left');
- }
- })
-})
diff --git a/module/project/js/createguide.js b/module/project/js/createguide.js
deleted file mode 100644
index dbbdf4314d..0000000000
--- a/module/project/js/createguide.js
+++ /dev/null
@@ -1,8 +0,0 @@
-$(function()
-{
- if(!isAjaxRequest)
- {
- $(".modal-body .close").remove();
- $("#subHeader").remove();
- }
-});
\ No newline at end of file
diff --git a/module/project/js/execution.js b/module/project/js/execution.js
deleted file mode 100644
index db9efd1f82..0000000000
--- a/module/project/js/execution.js
+++ /dev/null
@@ -1,262 +0,0 @@
-$(function()
-{
- $("#" + status + "Tab").addClass('btn-active-text');
-
- $('input[name^="showTask"]').click(function()
- {
- var show = $(this).is(':checked') ? 1 : 0;
- $.cookie('showTask', show, {expires:config.cookieLife, path:config.webRoot});
- $('input#editExecution1').prop('disabled', show).attr('title', show == 1 ? disabledExecutionTip : defaultExecutionTip);
- window.location.reload();
- });
- if($.cookie('showTask') == 1) $('input#editExecution1').prop('disabled', true).attr('title', disabledExecutionTip);
-
- $('input#editExecution1').click(function()
- {
- var editExecution = $(this).is(':checked') ? 1 : 0;
- $.cookie('editExecution', editExecution, {expires:config.cookieLife, path:config.webRoot});
- $('input[name^="showTask"]').prop('disabled', editExecution).attr('title', editExecution == 1 ? disabledTaskTip : defaultTaskTip);
-
- showEditCheckbox(editExecution);
- });
- if($.cookie('editExecution') == 1)
- {
- $('input#editExecution1').prop('checked', 'true');
- showEditCheckbox(true);
- $('input[name^="showTask"]').prop('disabled', true).attr('title', disabledTaskTip);
- }
-
- $(document).on('click', ":checkbox[name^='executionIDList']", function()
- {
- var notCheckedLength = $(":checkbox[name^='executionIDList']:not(:checked)").length;
- var checkedLength = $(":checkbox[name^='executionIDList']:checked").length;
-
- if(checkedLength > 0) $('#executionForm').addClass('has-row-checked');
- if(notCheckedLength == 0) $('#executionForm .checkAll').prop('checked', true);
- if(checkedLength == 0)
- {
- $('#executionForm .checkAll').prop('checked', false);
- $('#executionForm').removeClass('has-row-checked');
- }
- if(notCheckedLength > 0) $('#executionForm .checkAll').prop('checked', false);
-
- if(checkedLength > 0)
- {
- $('#executionSummary').addClass('hidden');
- $('#executionsSummary').remove();
- }
- else
- {
- $('#executionSummary').removeClass('hidden');
- $('#executionsSummary').addClass('hidden');
- }
-
- });
-
- $(document).on('click', "#executionForm .checkAll", function()
- {
- if($(this).prop('checked'))
- {
- $(":checkbox[name^='executionIDList']").prop('checked', true);
- $("#executionForm .checkAll").prop('checked', true);
- $('#executionForm').addClass('has-row-checked');
- var checkedLength = $(":checkbox[name^='executionIDList']:checked").length;
- $('#executionSummary').addClass('hidden');
- $('#executionsSummary').remove();
- $(this).next('label').addClass('hover');
- }
- else
- {
- $(":checkbox[name^='executionIDList']").prop('checked', false);
- $("#executionForm .checkAll").prop('checked', false);
- $('#executionForm').removeClass('has-row-checked');
- $('#executionSummary').removeClass('hidden');
- $('#executionsSummary').addClass('hidden');
- $(this).next('label').removeClass('hover');
- }
- });
-
- /* Solve the problem that clicking the browser back button causes the checkbox to be selected by default. */
- setTimeout(function()
- {
- $(":checkbox[name^='executionIDList']").each(function()
- {
- $(this).prop('checked', false);
- });
- $('#executionsForm .checkAll').prop('checked', false);
- }, 10);
-
- /* Update table summary text. */
- $('#executionForm').table(
- {
- statisticCreator: function(table)
- {
- var $table = table.getTable();
- var $checkedRows = $table.find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
- var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
- var checkedTotal = $checkedRows.length;
- var $rows = checkedTotal ? $checkedRows : $table.find(table.isDataTable ? '.datatable-rows .datatable-row-left' : 'tbody>tr');
-
- var checkedWait = 0;
- var checkedDoing = 0;
- var executionIDList = [];
- $rows.each(function()
- {
- var $row = $(this);
- if($originTable) $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
-
- var data = $row.data();
- executionIDList.push(data.id);
-
- if(data.status === 'wait') checkedWait++;
- if(data.status === 'doing') checkedDoing++;
- });
-
- if(status != 'all') return (checkedTotal ? checkedExecutions : executionSummary).replace('%s', $rows.length);
- return (checkedTotal ? checkedSummary : pageSummary).replace('%total%', $rows.length).replace('%wait%', checkedWait).replace('%doing%', checkedDoing);
- }
- })
-
- if((project.stageBy == 'product') && project.hasProduct && $('#executionList thead th.table-nest-title').width() < 240)
- {
- $('#executionList thead th.table-nest-title').width(240)
- }
-})
-
-window.addEventListener('scroll', this.handleScroll)
-function handleScroll(e)
-{
- var relative = 200; // 相对距离
- $('tr.showmore').each(function()
- {
- var $showmore = $(this);
- var offsetTop = $showmore[0].offsetTop;
- if(offsetTop == 0) return true;
-
- if(getScrollTop() + getWindowHeight() >= offsetTop - relative)
- {
- throttle(loadData($showmore), 150)
- }
- })
-}
-
-function loadData($showmore)
-{
- $showmore.removeClass('showmore');
-
- var executionID = $showmore.attr('data-parent');
- var maxTaskID = $showmore.attr('data-id');
- var maxTaskID = maxTaskID.replace('t', '');
- var link = createLink('task', 'ajaxGetTasks', 'executionID=' + executionID + '&maxTaskID=' + maxTaskID);
- $.get(link, function(data)
- {
- $showmore.after(data);
- $(".iframe").modalTrigger({type:'iframe'});
-
- $('#executionForm').table('initNestedList');
- })
-}
-
-function throttle(fn, threshhold)
-{
- var last;
- var timer;
- threshhold || (threshhold = 250);
-
- return function()
- {
- var context = this;
- var args = arguments;
-
- var now = +new Date()
-
- if (last && now < last + threshhold)
- {
- clearTimeout(timer);
- timer = setTimeout(function ()
- {
- last = now
- fn.apply(context, args)
- }, threshhold)
- }
- else
- {
- last = now
- fn.apply(context, args)
- }
- }
-}
-
-function getScrollTop()
-{
- return scrollTop = document.body.scrollTop + document.documentElement.scrollTop
-}
-
-function getWindowHeight()
-{
- return document.compatMode == "CSS1Compat" ? windowHeight = document.documentElement.clientHeight : windowHeight = document.body.clientHeight
-}
-
-/**
- * Show edit executions checkbox.
- *
- * @param int $show
- * @access public
- * @return void
- */
-function showEditCheckbox(show)
-{
- $('.project-type-label').each(function()
- {
- $this = $(this);
- $tr = $(this).closest('tr');
- executionID = $tr.attr('data-id');
- if(show)
- {
- var marginLeft = '7px';
-
- $tr.find('td:first').prepend("
");
- $tr.find('td:first').find('.checkbox-primary').css('margin-left', marginLeft).css('width', '14');
- }
- else
- {
- $tr.find('td:first').find('[name^="executionIDList"]').parent().remove();
- }
- });
- if(show)
- {
- $('.table-nest-title').prepend("
").addClass('table-nest-title-edit');
- var tableFooter = "
";
- $('#executionForm').attr('action', createLink('execution', 'batchEdit'));
- $('.table-footer').prepend(tableFooter).show();
- $('body').scroll();
- }
- else
- {
- $('.table-nest-title').removeClass('table-nest-title-edit').find('.check-all').remove();
- $('#executionForm').find('.editCheckbox').remove();
- if($('#executionForm .pager').length == 0) $('.table-footer').hide();
- $('#executionForm').removeAttr('action');
- }
-}
-
-/**
- * Set the color of the badge to white.
- *
- * @param object obj
- * @param bool isShow
- * @access public
- * @return void
- */
-function setBadgeStyle(obj, isShow)
-{
- var $label = $(obj);
- if(isShow == true)
- {
- $label.find('.label-badge').css({"color":"#fff", "border-color":"#fff"});
- }
- else
- {
- $label.find('.label-badge').css({"color":"#838a9d", "border-color":"#838a9d"});
- }
-}
diff --git a/module/project/js/kanban.js b/module/project/js/kanban.js
deleted file mode 100644
index de45097436..0000000000
--- a/module/project/js/kanban.js
+++ /dev/null
@@ -1,216 +0,0 @@
-/**
- * Process kanban data
- * @param {string} key Kanban key, used as kanban id
- * @param {Object} programGroup Group data
- * @returns {Object} kanban data
- */
-function processKanbanData(key, programGroup)
-{
- var kanbanId = key;
-
- /* Generate columns */
- var columns = [];
- var executionsCol;
- $.each(kanbanColumns, function(_, column)
- {
- var colType = column.type;
- column = $.extend({}, column,
- {
- kanban: kanbanId,
- id: kanbanId + '-' + column.type,
- parentType: (colType === 'doingProject' || colType === 'doingExecution') ? 'doing' : false,
- });
-
- if(colType === 'doingProject')
- {
- columns.push(
- {
- kanban: kanbanId,
- id: kanbanId + '-doing',
- type: 'doing',
- asParent: true,
- name: doingText,
- count: ''
- });
- }
- else if(colType === 'doingExecution')
- {
- executionsCol = column;
- executionsCol.count = 0;
- }
-
- columns.push(column);
- });
- /* Format lanes data */
- var lanes = [];
- $.each(programGroup, function(programId, statusMap)
- {
- var programName = programPairs[programId];
- var items = {doingExecution: []};
-
- /* Projects and executions */
- ['wait', 'doing', 'closed'].forEach(function(status)
- {
- var itemsList = [];
- var statusProjects = statusMap[status];
- if(statusProjects)
- {
- $.each(statusProjects, function(_, project)
- {
- var projectID = project.id;
- var projectItem = $.extend({}, project, {id: 'project-' + projectID, _id: projectID});
- itemsList.push(projectItem);
-
- if(status === 'doing')
- {
- var execution = latestExecutions[projectID];
- if(execution && execution.id)
- {
- if(typeof(executionsCol) == 'object') executionsCol.count++;
- projectItem.execution = $.extend({}, execution, {id: 'execution-' + execution.id, _id: execution.id});
- }
- }
- });
- }
- items[status + 'Project'] = itemsList;
- });
-
- lanes.push({id: programId, kanban: kanbanId, name: programName, items: items});
- });
-
- return {id: kanbanId, columns: columns, lanes: lanes};
-}
-
-/** Define kanban d-n-d rules */
-var projectDropRules =
-{
- waitProject: ['doingProject', 'closedProject'],
- doingProject: ['closedProject'],
- closedProject: ['doingProject'],
-};
-window.kanbanDropRules = {my: projectDropRules, other: projectDropRules};
-
-/*
- * Find drop columns
- * @param {JQuery} $element Drag element
- * @param {JQuery} $root Dnd root element
- */
-function findDropColumns($element, $root)
-{
- var $col = $element.closest('.kanban-col');
- var col = $col.data();
- var lane = $col.closest('.kanban-lane').data();
- var kanbanID = $root.data('id');
- var kanbanRules = window.kanbanDropRules ? window.kanbanDropRules[kanbanID] : null;
-
- if(!kanbanRules) return $root.find('.kanban-lane[data-id="' + lane.id + '"] .kanban-lane-col:not([data-type="doingExecution"],[data-type="' + col.type + '"])');
-
- var colRules = kanbanRules[col.type];
- var lane = $col.closest('.kanban-lane').data('lane');
- return $root.find('.kanban-lane-col').filter(function()
- {
- if(!colRules) return false;
- if(colRules === true) return true;
-
- var $newCol = $(this);
- var newCol = $newCol.data();
- if(newCol.id === col.id) return false;
-
- var $newLane = $newCol.closest('.kanban-lane');
- var newLane = $newLane.data('lane');
- return colRules.indexOf(newCol.type) > -1 && newLane.id === lane.id;
- });
-}
-
-/**
- * Change column type for a card
- * @param {Object} card Card object
- * @param {String} fromColType The column type before change
- * @param {String} toColType The column type after change
- * @param {String} kanbanID Kanban ID
- */
-function changeCardColType(card, fromColType, toColType, kanbanID)
-{
- if(typeof card == 'undefined') return false;
- var cardID = card.id;
- var projectID = cardID.substr(cardID.indexOf("-") + 1);;
- var showIframe = false;
-
- if(toColType == 'doingProject')
- {
- if(fromColType == 'waitProject' && priv.canStart)
- {
- var link = createLink('project', 'start', 'project=' + projectID, '', true);
- showIframe = true;
- }
- if(fromColType == 'closedProject' && priv.canActivate)
- {
- var link = createLink('project', 'activate', 'projectID=' + projectID, '', true);
- showIframe = true;
- }
- }
- else if(toColType == 'closedProject')
- {
- if(priv.canClose)
- {
- var link = createLink('project', 'close', 'projectID=' + projectID, '', true);
- showIframe = true;
- }
- }
-
- if(showIframe)
- {
- var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '80%', url: link});
- modalTrigger.show();
- }
-}
-
-/**
- * Handle finish drop task
- * @param {Object} event Event object
- * @returns {void}
- */
-function handleFinishDrop(event)
-{
- var $card = $(event.element).closest('.kanban-item'); // The drag card
- var $dragCol = $card.closest('.kanban-lane-col');
- var $dropCol = $(event.target);
-
- /* Get d-n-d(drag and drop) infos. */
- var card = $card.data('item');
- var fromColType = $dragCol.data('type');
- var toColType = $dropCol.data('type');
- var kanbanID = $card.closest('.kanban').data('id');
-
- changeCardColType(card, fromColType, toColType, kanbanID);
-}
-
-/** Calculate column height */
-function calcColHeight(col, lane, colCards, colHeight)
-{
- if (col.type !== 'doingProject') return colHeight;
- return colCards.length * 62;
-}
-
-$(function()
-{
- /* Init all kanbans */
- $.each(kanbanGroup, function(key, programGroup)
- {
- var $kanban = $('#kanban-' + key);
- if(!$kanban.length) return;
- $kanban.kanban(
- {
- data: processKanbanData(key, programGroup),
- calcColHeight: calcColHeight,
- virtualize: true,
- virtualCardList: true,
- droppable:
- {
- selector: '.kanban-card:not(.execution-item)',
- target: findDropColumns,
- finish: handleFinishDrop
- },
- });
- });
-});
diff --git a/module/project/js/managemembers.js b/module/project/js/managemembers.js
deleted file mode 100644
index e5ff4d1967..0000000000
--- a/module/project/js/managemembers.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Update other picker on change */
-$.zui.Picker.DEFAULTS.onChange = function(event)
-{
- var picker = event.picker;
- if(!picker.$formItem.is('[name^=accounts]')) return;
-
- var select = picker.$formItem[0];
- var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false});
-
- $('.user-picker[name^=accounts]').each(function()
- {
- if(this === select) return;
-
- var $select = $(this);
- var selectPicker = $select.data('zui.picker');
-
- if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]);
- });
-}
-
-
-/**
- * Save team members.
- *
- * @access public
- * @return void
- */
-function saveMembers()
-{
- var isDeleted = false;
- var accountList = [];
- $("[name^='accounts']").each(function()
- {
- if($(this).val()) accountList.push($(this).val());
- })
-
- oldAccountList.forEach(function(account)
- {
- if(accountList.indexOf(account) < 0)
- {
- isDeleted = true;
- return false;
- }
- })
-
- if(!isDeleted)
- {
- $('#saveBtn').addClass('hidden');
- $('#submit').removeClass('hidden');
- $('#submit').click();
- }
- else
- {
- bootbox.confirm(unlinkExecutionMembers, function(result)
- {
- $('#saveBtn').addClass('hidden');
- $('#submit').removeClass('hidden');
- if(result) $('#removeExecution').val('yes');
- $('#submit').click();
- });
- }
-}
-
-/**
- * Set role when select an account.
- *
- * @param string $account
- * @param int $roleID
- * @access public
- * @return void
- */
-function setRole(account, roleID)
-{
- $('#roles\\[' + roleID + '\\]').val(roles[account]);
-}
-
-/**
- * Add item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var item = $('#addItem').html().replace(/%i%/g, itemIndex);
- var $tr = $('
' + item + '
').insertAfter($(obj).closest('tr'));
- var $accounts = $tr.find('select:first').addClass('user-picker').trigger('list:updated').picker({type: 'user'});
- itemIndex++;
-
- var disabledItems = [];
- $('.user-picker[name^=accounts]').each(function()
- {
- if(this === $accounts[0]) return;
- var $select = $(this);
- var picker = $select.data('zui.picker');
- if(!picker) return;
- var selectItem = picker.getListItem(picker.getValue());
- if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true}));
- });
- if(disabledItems.length) $accounts.data('zui.picker').updateOptionList(disabledItems);
-}
-
-/**
- * Delete item.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteItem(obj)
-{
- if($('#teamForm .table tbody').children().length < 2) return false;
-
- $(obj).closest('tr').find('.picker .picker-selection-remove').click();
- $(obj).closest('tr').remove();
-}
-
-/**
- * Set selected Department.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function setDeptUsers(obj)
-{
- dept = $(obj).val();
- link = createLink('project', 'manageMembers', 'projectID=' + projectID + '&dept=' + dept + '©ProjectID=' + copyProjectID);
- location.href = link;
-}
-
-/**
- * Chose team to copy.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function choseTeam2Copy(obj)
-{
- copyProjectID = $(obj).val();
- locateLink = createLink('project', 'manageMembers', 'projectID=' + projectID + '&dept=' + deptID + '©ProjectID=' + copyProjectID);
- location.href = locateLink;
-}
diff --git a/module/project/js/manageproducts.js b/module/project/js/manageproducts.js
deleted file mode 100644
index 1716ac3f05..0000000000
--- a/module/project/js/manageproducts.js
+++ /dev/null
@@ -1,136 +0,0 @@
-$(function()
-{
- $('#productsBox input:checkbox').each(function()
- {
- var $cb = $(this);
- if($cb.prop('checked')) $cb.closest('.product').addClass('checked');
- });
-
- $('#productsBox input:checkbox').change(function()
- {
- var $cb = $(this);
- $cb.closest('.product').toggleClass('checked', $cb.prop('checked'));
-
- if($cb.prop('checked')) return true;
-
- var productID = String($cb.val());
- if($.inArray(productID, unmodifiableProducts) != -1)
- {
- var $branch = $cb.closest('.product').find('[name^=branch]');
- if($branch.length)
- {
- var branchID = String($branch.val());
-
- if((branchID == BRANCH_MAIN && unmodifiableMainBranches[productID]) || (branchID != BRANCH_MAIN && $.inArray(branchID, unmodifiableBranches) != -1))
- {
- bootbox.alert(unLinkProductTip.replace("%s", branchGroups[productID][branchID]));
- }
- }
- else
- {
- bootbox.alert(unLinkProductTip.replace("%s", allProducts[productID]));
- }
- }
- });
-
- $("select[id^=branch]").change(function()
- {
- var checked = $(this).closest('div').hasClass('checked');
- if(!checked)
- {
- $(this).closest('div').addClass('checked');
- $(this).closest('div').find("input[id^=products]").prop('checked', true);
- }
- });
-
- $('.saveOtherProduct').click(function()
- {
- $('#productsBox').ajaxForm(
- {
- finish:function(response)
- {
- if(response.result == 'success')
- {
- $('#productsBox #submit').popover('destroy');
-
- $('.saveOtherProduct').popover(
- {
- trigger: 'manual',
- content: response.message,
- tipClass: 'popover-success popover-form-result',
- placement: 'right'
- }).popover('show');
-
- setTimeout(function(){$('.saveOtherProduct').popover('destroy')}, 2000);
-
- var reloadUrl = response.locate == 'reload' ? location.href : response.locate;
- setTimeout(function(){location.href = reloadUrl;}, 1200);
- }
- }
- });
-
- var checkedProducts = [];
- var otherProducts = $('#otherProducts').val();
- for(key in otherProducts)
- {
- var productBranch = otherProducts[key].split('_');
- var selectProduct = productBranch[0];
- if(checkedProducts.indexOf(selectProduct) == -1) checkedProducts.push(selectProduct);
- }
-
- $('input[name^="products"]:checked').each(function()
- {
- var value = $(this).val();
- if(checkedProducts.indexOf(value) == -1) checkedProducts.push(value);
- })
-
- if(noticeSwitch && checkedProducts.length > 1)
- {
- notice();
- }
- else
- {
- $('form#productsBox').submit();
- }
- });
-
- $('#submit').click(function()
- {
- var checkedProducts = [];
- $('input[name^="products"]:checked').each(function()
- {
- var value = $(this).val();
- if(checkedProducts.indexOf(value) == -1) checkedProducts.push(value);
- })
-
- if(noticeSwitch && checkedProducts.length > 1)
- {
- notice();
- return false;
- }
- })
-});
-
-function notice()
-{
- bootbox.confirm(
- {
- 'message' : noticeDivsion,
- 'buttons':{
- confirm:{
- label: stageBySwitchList['1'],
- className: 'btn'
- },
- cancel:{
- label: stageBySwitchList['0'],
- className: 'btn-primary'
- },
- },
- callback: function(result)
- {
- if(result) $('#submit').after("
");
- $('form#productsBox').submit();
- }
- }
- );
-}
diff --git a/module/project/js/team.js b/module/project/js/team.js
deleted file mode 100644
index deaae4148b..0000000000
--- a/module/project/js/team.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Delete memeber of project team.
- *
- * @param projectID $projectID
- * @param account $account
- * @param userID $userID
- * @access public
- * @return void
- */
-function deleteMemeber(projectID, account, userID)
-{
- bootbox.confirm(confirmUnlinkMember, function(result)
- {
- if(!result) return true;
-
- var removeConfirm = '';
- var tipsLink = createLink('project', 'ajaxGetRemoveMemberTips', 'projectID=' + projectID + '&account=' + account);
- $.get(tipsLink, function(tips)
- {
- var unlinkURL = createLink('project', 'unlinkMember', 'projectID=' + projectID + '&userID=' + userID + '&confirm=yes');
-
- if(!tips) unlinkMember(unlinkURL);
- if(tips)
- {
- bootbox.confirm(tips, function(result)
- {
- if(result) unlinkURL = createLink('project', 'unlinkMember', 'projectID=' + projectID + '&userID=' + userID + '&confirm=yes&removeExecution=yes');
- unlinkMember(unlinkURL);
- })
- }
-
- })
- })
-}
-
-/**
- * Unlink member from project.
- *
- * @param unlinkURL $unlinkURL
- * @access public
- * @return void
- */
-function unlinkMember(unlinkURL)
-{
- $.get(unlinkURL, function(data)
- {
- data = JSON.parse(data);
- if(data.result == 'success') window.location.reload();
- });
-}
diff --git a/module/project/js/view.js b/module/project/js/view.js
deleted file mode 100644
index 92fe169bf3..0000000000
--- a/module/project/js/view.js
+++ /dev/null
@@ -1,35 +0,0 @@
-(function()
-{
- /* Expand or collapse text */
- function limitText()
- {
- var fullText;
- var limitText;
- var $text = $(this);
- var options = $.extend({limitSize: 40, suffix: '…'}, $text.data());
- var text = $text.text();
- if(text.length > options.limitSize)
- {
- fullText = $text.html();
- limitText = text.substring(0, options.limitSize) + options.suffix;
- $text.text(limitText).addClass('limit-text-on');
-
- var $toggleBtn = options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle');
- $toggleBtn.text($toggleBtn.data('textExpand'));
- $toggleBtn.on('click', function()
- {
- var isLimitOn = $text.toggleClass('limit-text-on').hasClass('limit-text-on');
- if(isLimitOn) $text.text(limitText);
- else $text.html(fullText);
- $toggleBtn.text($toggleBtn.data(isLimitOn ? 'textExpand' : 'textCollapse'));
- });
- }
- else
- {
- (options.toggleBtn ? $(options.toggleBtn) : $text.next('.text-limit-toggle')).hide();
- }
- $text.removeClass('hidden');
- };
- $.fn.textLimit = function(){return this.each(limitText);};
- $(function(){$('.text-limit').textLimit();});
-})();
diff --git a/module/projectrelease/css/browse.css b/module/projectrelease/css/browse.css
deleted file mode 100644
index a8711505bd..0000000000
--- a/module/projectrelease/css/browse.css
+++ /dev/null
@@ -1,10 +0,0 @@
-#releaseList {font-size: 13px;}
-#releaseList tr:hover {background-color:unset;}
-td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-
-#releaseList .c-id{width:60px;}
-#releaseList .c-build,#releaseList .c-product{width:180px;}
-#releaseList .c-branch {width: 120px;}
-#releaseList .c-date {width: 120px;}
-#releaseList td.c-build {padding-left:8px !important;}
-#releaseList .c-execution {width: 120px;}
diff --git a/module/projectrelease/js/browse.js b/module/projectrelease/js/browse.js
deleted file mode 100644
index 8b8ddb4f34..0000000000
--- a/module/projectrelease/js/browse.js
+++ /dev/null
@@ -1,30 +0,0 @@
-$(function()
-{
- /* Update table summary text. */
- var $rows = $('#releaseList').find('tbody>tr');
-
- var total = 0;
- var normal = 0;
- var terminate = 0;
- $rows.each(function()
- {
- var $row = $(this);
- if($row.find('.c-id').length == 0) return;
-
- var data = $row.data();
- if(data.type === 'normal') normal++;
- if(data.type === 'terminate') terminate++;
- total++;
- });
-
- var summary = '';
- if(type != 'all')
- {
- summary = pageSummary.replace('%s', total);
- }
- else
- {
- summary = pageAllSummary.replace('%total%', total).replace('%normal%', normal).replace('%terminate%', terminate);
- }
- $('.table-statistic').html(summary);
-});
diff --git a/module/release/css/browse.css b/module/release/css/browse.css
deleted file mode 100644
index 19a47c17a4..0000000000
--- a/module/release/css/browse.css
+++ /dev/null
@@ -1,10 +0,0 @@
-#releaseList {font-size: 13px;}
-td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-#releaseList tbody>tr:hover{background-color: unset!important;}
-.main-table tbody>tr>td:first-child{padding: 2px 8px!important;}
-
-#releaseList th, #releaseList td{padding-left:16px !important;padding-right:16px !important;}
-#releaseList .c-id {width: 60px}
-#releaseList .c-branch {width: 100px}
-#releaseList .c-date {width: 160px}
-#releaseList .c-project, #releaseList .c-build {width: 180px;}
diff --git a/module/release/css/create.css b/module/release/css/create.css
deleted file mode 100644
index 6e4b556593..0000000000
--- a/module/release/css/create.css
+++ /dev/null
@@ -1 +0,0 @@
-#markerBox {display: inline-block; margin-left: 10px;}
diff --git a/module/release/css/edit.css b/module/release/css/edit.css
deleted file mode 100644
index b34d337d21..0000000000
--- a/module/release/css/edit.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.table-form > tbody > tr > td > .row > [class*="col-"] .panel-heading {line-height: 16px;}
-.contentDiv {height: 190px; overflow-y: auto; margin-bottom: 10px !important;}
-.contentDiv .panel-heading {line-height: 14px;}
-#markerBox {display: inline-block; margin-left: 10px;}
diff --git a/module/release/css/view.css b/module/release/css/view.css
deleted file mode 100644
index 0495dac43c..0000000000
--- a/module/release/css/view.css
+++ /dev/null
@@ -1,26 +0,0 @@
-.checkbox.btn {margin-top: 0px;}
-#releaseInfo > div {padding-top: 15px;}
-
-.linkBox #queryBox .search-form .form-actions {padding-bottom: 5px;}
-.linkBox .table-header {padding: 8px 15px; border-bottom: 1px solid #cbd0db;}
-#unlinkStoryList, #unlinkBugList, #unlinkLeftBugList {border-top: 1px solid #cbd0db;}
-
-#tabsNav .nav-tabs > li.pull-right {margin-right: 120px; margin-top: -5px;}
-#tabsNav .nav-tabs > li.active + li.pull-right {margin-right: 0;}
-ol, ul {padding-left: 20px;}
-.body-modal #mainContent {min-height: 240px;}
-.c-id {width: 110px;}
-td.c-build{white-space: nowrap; overflow:hidden;}
-th.c-user,td.c-user{text-align:left}
-
-#stories th, #stories td{padding-left:16px;padding-right:16px;}
-#stories .c-build{width:160px; text-align:left;}
-#stories .c-status{width:120px;}
-#stories .c-stage{width:112px; text-align:left;}
-#stories .c-estimate{width:90px; text-align:right;}
-#bugs .c-build{width:160px; text-align:left;}
-#bugs .c-user{width:120px;}
-#bugs .c-date{width:130px;}
-#leftBugs .c-id{width:90px;}
-#leftBugs .c-build{width:160px; text-align:left;}
-#leftBugs .c-user{width:120px;}
diff --git a/module/release/js/browse.js b/module/release/js/browse.js
deleted file mode 100644
index 3f5f28fce4..0000000000
--- a/module/release/js/browse.js
+++ /dev/null
@@ -1,30 +0,0 @@
-$(function()
-{
- /* Update table summary text. */
- var $rows = $('#releaseList').find('tbody>tr');
-
- var total = 0;
- var normal = 0;
- var terminate = 0;
- $rows.each(function()
- {
- var $row = $(this);
- if($row.find('td.c-id').length == 0) return;
-
- var data = $row.data();
- if(data.type === 'normal') normal++;
- if(data.type === 'terminate') terminate++;
- total++;
- });
-
- var summary = '';
- if(type != 'all')
- {
- summary = pageSummary.replace('%s', total);
- }
- else
- {
- summary = pageAllSummary.replace('%total%', total).replace('%normal%', normal).replace('%terminate%', terminate);
- }
- $('.table-statistic').html(summary);
-});
diff --git a/module/release/js/view.js b/module/release/js/view.js
deleted file mode 100644
index 3c0d2f8020..0000000000
--- a/module/release/js/view.js
+++ /dev/null
@@ -1,114 +0,0 @@
-function showLink(releaseID, type, param)
-{
- var method = type == 'story' ? 'linkStory' : 'linkBug';
- if(typeof(param) == 'undefined') param = '&browseType=' + type + '¶m=0';
- if(type == 'leftBug') param += '&type=leftBug';
- loadURL(createLink('release', method, 'releaseID=' + releaseID + param), type);
-
- $('.actions').find("a[href*='" + type + "']").addClass('hidden');
-}
-
-/**
- * Load URL.
- *
- * @param string $url
- * @param string$type
- * @access public
- * @return void
- */
-function loadURL(url, type)
-{
- $.get(url, function(data)
- {
- var $pane = $(type == 'story' ? '#stories' : (type == 'leftBug' ? '#leftBugs' : '#bugs'));
- $pane.find('.main-table').hide();
- var $linkBox = $pane.find('.linkBox');
- $linkBox.html(data).removeClass('hidden');
- $linkBox.find('[data-ride="table"]').table();
- $linkBox.find('[data-ride="pager"]').pager();
- $linkBox.find('[data-ride="pager"] li a.pager-item').click(function()
- {
- loadURL($(this).attr('href'), type);
- return false;
- });
- $linkBox.find('[data-ride="pager"] .pager-size-menu a[data-size]').off('click');
- $linkBox.find('[data-ride="pager"] .pager-size-menu a[data-size]').click(function()
- {
- line = $linkBox.find('[data-ride="pager"]').attr('data-link-creator');
- line = line.replace('{recPerPage}', $(this).attr('data-size')).replace('{page}', $linkBox.find('[data-ride="pager"]').attr('data-page'));
- $.cookie($linkBox.find('[data-ride="pager"]').attr('data-page-cookie'), $(this).attr('data-size'), {expires:config.cookieLife, path:config.webRoot});
- loadURL(line, type);
- return false;
- });
- $.toggleQueryBox(true, $linkBox.find('#queryBox'));
- });
-}
-
-$(function()
-{
- if(link == 'true') showLink(releaseID, type, param);
- var infoShowed = false;
- $('.nav.nav-tabs a[data-toggle="tab"]').on('shown.zui.tab', function(e)
- {
- var href = $(e.target).attr('href');
- var tabPane = $(href + '.tab-pane');
- if(tabPane.size() == 0) return;
- var formID = tabPane.find('.linkBox').find('form:last');
- if(formID.size() == 0) formID = tabPane.find('form:last');
-
- if(href == '#releaseInfo' && !infoShowed)
- {
- var $tr = $('#releaseInfo .detail-content .table-data tbody tr:first');
- width = $tr.width() - $tr.find('th').width();
- $('#releaseInfo img').each(function()
- {
- if($(this).parent().prop('tagName').toLowerCase() == 'a') $(this).unwrap();
- setImageSize($(this), width, 0);
- });
-
- infoShowed = true;
- }
- });
-
- $('.table-story').table(
- {
- statisticCreator: function(table)
- {
- var $checkedRows = table.getTable().find(table.isDataTable ? '.datatable-row-left.checked' : 'tbody>tr.checked');
- var $originTable = table.isDataTable ? table.$.find('.datatable-origin') : null;
- var checkedTotal = $checkedRows.length;
- if(!checkedTotal) return;
-
- var checkedEstimate = 0;
- var checkedCase = 0;
- var rateCount = checkedTotal;
- $checkedRows.each(function()
- {
- var $row = $(this);
- if($originTable)
- {
- $row = $originTable.find('tbody>tr[data-id="' + $row.data('id') + '"]');
- }
- var data = $row.data();
- checkedEstimate += data.estimate;
-
- if(data.cases > 0)
- {
- checkedCase += 1;
- }
- else if(data.children != undefined && data.children > 0)
- {
- rateCount -= 1;
- }
- });
-
- var rate = '0%';
- if(rateCount) rate = Math.round(checkedCase / rateCount * 100) + '%';
-
- if(checkedTotal == 0) return storySummary;
- return checkedSummary.replace('%total%', checkedTotal)
- .replace('%estimate%', checkedEstimate.toFixed(1))
- .replace('%rate%', rate);
- }
- });
-})
diff --git a/module/repo/css/blame.css b/module/repo/css/blame.css
deleted file mode 100644
index f3d9b6eacb..0000000000
--- a/module/repo/css/blame.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.panel.code > .content {border: 1px solid #ccc;}
-.blame {font-size: 13px;}
-.blame thead {font-weight:bold; background: #ddd;}
-.blame td {border-left: 1px solid #ccc;}
-.blame tr.topLine > td:first-child {border-left: none;}
-.blame .info {background-color: #f7f7f7; vertical-align: top; padding: 0px 4px;}
-.topLine {border-top: 1px solid #ccc;}
-.topLine td.info {padding: 8px 4px;}
-pre {margin-bottom: 0px; display: block; white-space: pre-wrap; padding: 0px 3px; border: 0px; background: none;}
-.line {font-weight: bold; border: 1px solid #E4E4E4; background-color: #fafafa; color: #999; text-align: center;}
-.panel-actions.pull-right {margin-top: -5px;}
-.action-onlybody {right: 30px;}
diff --git a/module/repo/css/browse.css b/module/repo/css/browse.css
deleted file mode 100644
index 6cdbbf2e4d..0000000000
--- a/module/repo/css/browse.css
+++ /dev/null
@@ -1,43 +0,0 @@
-#mainMenu > .btn-toolbar {height: 35px; line-height: 35px;}
-#mainMenu > .pull-right {padding-right: 1%;}
-#sidebar>.sidebar-toggle>.icon {right: -2px; left: auto;}
-.main-row {width: 99%;}
-.btn-toolbar > .last-sync-time {display: inline-block; float: left; margin-right: 10px;}
-.btn-toolbar .page-title {line-height: 32px;}
-.dropdown-menu > li.selected > a:after {content: '';}
-.pull-left li > a.selected {color: #e9f2fb; background-color: #16a8f8;}
-.pull-left li > a {line-height: 20px; border-radius: 5px;}
-.tree li.has-list.open:before {border-left: 0px;}
-#mainMenu > div.btn-toolbar.pull-left > div.btn-group.open {line-height: 20px;}
-#dropMenuRepo > div.table-row > div > div > ul > li {padding: 0}
-#dropMenuRepo > div.table-row > div > div > ul > li > div {padding-left: 20px;}
-#dropMenuRepo > div.table-row > div > div > ul > li > ul {padding-left: 10px;}
-#repoList .hide-in-search .hidden {display: block !important; visibility: inherit !important;}
-#mainMenu .btn-limit {max-width: unset !important;}
-
-#branchList {line-height: 25px;}
-#branchList .hide-in-search, #branchList .tree ul {padding-left: 20px;}
-.tree li.has-list.open:before {border-left: none;}
-#branchList .tree li {padding: 0;}
-.branch-or-tag {border-radius: 4px;}
-
-.c-name {min-width: 150px;}
-.c-checkbox {width: 40px;}
-.c-version {width: 80px;}
-.c-commit {width: 70px;}
-.c-committer {width: 100px;}
-.c-icon {width: 30px;}
-
-/* Fix bug #21893. */
-.in #sidebar>.sidebar-toggle>.icon-angle-left:before {content: "\e315";}
-.hide-sidebar #sidebar>.sidebar-toggle>.icon-angle-left:before {content: "\e314";}
-
-.download-popover {width: 400px; max-width: none;}
-.popover-content {padding: 0;}
-.download-popover .table {margin-bottom: 0;}
-.download-popover .table td {padding-right: 0;}
-.download-popover .popover-title {padding: 8px;}
-
-#mainMenu #swapper {padding: 0;}
-#mainMenu #swapper #currentItem {color: #313c52;}
-#mainMenu #swapper #currentItem:hover {color: #0b0f18; background-color: rgba(0, 0, 0, 0.075);}
diff --git a/module/repo/css/diff.css b/module/repo/css/diff.css
deleted file mode 100644
index dc24fcc92a..0000000000
--- a/module/repo/css/diff.css
+++ /dev/null
@@ -1,40 +0,0 @@
-body {padding-bottom: 0px;}
-.w-code {width: 48%; word-break: break-all;}
-td.code {color: #484848; padding: 0px 3px; white-space: pre-wrap;}
-.none {background: #EAF2F5;}
-table.diff {margin-bottom: 0px;}
-.diff caption {border: 1px solid #e4e4e4; background: #edf3fe; margin: 0; padding: 6px 2px 6px 10px; text-align: left; font-weight: bold; font-size: 13px;}
-.diff th, .diff td {border: none;}
-.diff th {padding-top: 2px; padding-bottom: 2px;}
-.diff .line-new, .diff .line-new {background: #CFC;}
-.diff .line-old, .diff .line-old {background: #FCC;}
-.diff .line-all, .diff .line-all {background: #FFF;}
-.diff .w-num {width: 25px; border-right: 1px solid #E4E4E4; background: #fafafa; border-left: 1px solid #E4E4E4; color: #999; font-weight: normal;}
-
-.repoCode .diff tr .comment-btn .icon-wrapper {left: -30px;}
-.repoCode .diff tr.over td.line-all, .repoCode .diff tr.over td.line-all {background: #f8eec7;}
-.repoCode .diff tr.over td.line-new, .repoCode .diff tr.over td.line-new {background: #8eff8e;}
-.repoCode .diff tr.over td.line-old, .repoCode .diff tr.over td.line-old {background: #f6b2b2;}
-
-.repoCode {min-height: 500px;}
-.repoCode form > .btn {margin-right: 10px;}
-.label-exchange {background-color: #566F7C; cursor: pointer;}
-.label-exchange i {padding: 0;}
-.btn-download {border-right: none;}
-.body-modal .repo-diff {display: none;}
-.body-modal #mainMenu {padding-bottom: 40px;}
-
-.repoCode td.code {white-space: inherit;}
-.repoCode .nav-tabs > li.active > a:before {background: none; height: 0;}
-
-#fileTabs .tab-pane {display: none;}
-#fileTabs .tab-pane.active {display: block;}
-#fileTabs .tab-nav-item {max-width: none !important; white-space: nowrap;}
-#fileTabs .tab-nav-item > .tab-nav-link > .close {float: none; position: inherit; right: -1px; top: 2px;}
-#filesTree #modules {margin-top: 5px;}
-#filesTree {overflow-y: auto;}
-
-.file-tree {padding: 0;}
-#sidebar > .sidebar-toggle {left: auto; right: 3px;}
-#sidebar > .sidebar-toggle > .icon {left : -1px;}
-.hide-sidebar #sidebar {width: 0 !important;}
diff --git a/module/repo/css/import.css b/module/repo/css/import.css
deleted file mode 100644
index 3b68af13d0..0000000000
--- a/module/repo/css/import.css
+++ /dev/null
@@ -1,8 +0,0 @@
-#repoList td.form-actions {padding: 7px;}
-#repoList td.form-actions a {line-height: 18px;}
-
-.main-table .table {cursor: default;}
-.main-table thead>tr {border-bottom: none; height: 45px;}
-.main-table tbody>tr {border-bottom: none; height: 42px;}
-.icon-close {cursor: pointer;}
-a.btn-active-text {line-height: 19px;}
diff --git a/module/repo/css/log.css b/module/repo/css/log.css
deleted file mode 100644
index dce12717c7..0000000000
--- a/module/repo/css/log.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.m-repo-log .btn-back {margin-right: 0; padding-top: 8px;}
-#repoPageSize {right: 30px;}
diff --git a/module/repo/css/maintain.css b/module/repo/css/maintain.css
deleted file mode 100644
index 1c92809333..0000000000
--- a/module/repo/css/maintain.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.c-id {width: 60px;}
-.c-name {width: 200px;}
-.c-product {width: 400px;}
-.c-actions-7 {width: 210px;}
diff --git a/module/repo/css/monaco.css b/module/repo/css/monaco.css
deleted file mode 100644
index 5b85a630da..0000000000
--- a/module/repo/css/monaco.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.m-repo-monaco {overflow: hidden;}
-.repoCode .nav > li > a {padding: 8px 10px;}
-.repoCode .nav-tabs > li > a > span {margin-right: 5px;}
-.repoCode {min-height: 500px;}
-#sidebar.side-col {padding-right: 0;}
-#sidebar .sidebar-toggle {left: auto; right: -3px; z-index: 10; height: 98%;}
-#sidebar .file-tree {padding: 0;}
-#sidebar > .sidebar-toggle > .icon-angle-left {right: auto; left: -1px;}
-.hide-sidebar #sidebar {width: 0 !important;}
-
-#fileTabs .tab-pane {display: none;}
-#fileTabs .tab-pane.active {display: block;}
-#fileTabs .tab-nav-item {max-width: none !important;}
-.repoCode .content {margin-left: 5px;}
-.repoCode .nav > li > a {display: flex; white-space: pre;}
-#sourceSwapper {border: 1px solid #D8DBDE; border-radius: 2px; width: 100%;}
-#sourceSwapper .repo-select {width: 100%;}
-#sourceSwapper .repo-select .caret {margin-top: 6px;}
-#sourceSwapper .hide-in-search {padding-left: 5px;}
-#sourceSwapper .tree li > a {max-width: 100%;}
-.version-name {max-width: 90%}
-#filesTree #modules {margin-top: 5px;}
-#filesTree {overflow-y: auto;}
-.repoCode .nav-tabs > li.active > a:before {background: none; height: 0;}
diff --git a/module/repo/js/browse.js b/module/repo/js/browse.js
deleted file mode 100644
index eaac010f19..0000000000
--- a/module/repo/js/browse.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Get download.
- *
- * @access public
- * @return void
- */
-function getDownload()
-{
- var content = "
";
- content += "
";
- content += "
";
- if(cloneUrl.svn) content += getCloneHtml(lang.cloneUrl, cloneUrl.svn);
- if(cloneUrl.ssh) content += getCloneHtml(lang.sshClone, cloneUrl.ssh);
- if(cloneUrl.http) content += getCloneHtml(lang.httpClone, cloneUrl.http);
-
- content += "";
- content += " | ";
- content += "";
- content += " | ";
- content += "
";
- content += "
";
- content += "
";
- content += "
";
- return content;
-}
-
-/**
- * Get html of clone button.
- *
- * @param cloneLang $cloneLang
- * @param url $url
- * @access public
- * @return void
- */
-function getCloneHtml(cloneLang, url)
-{
- var content = '';
- content += "
";
- content += "| " + cloneLang + " | ";
- content += "
";
- content += "
";
- content += " | ";
- content += " | ";
- content += "
";
- return content;
-}
-
-$(function()
-{
- /* Hide popover tip. */
- $(document).on('mousedown', function(e)
- {
- var $target = $(e.target);
- var $toggle = $target.closest('.popover, #downloadCode');
- if(!$toggle.length) $('#downloadCode').popover('hide');
- });
-
- /* Init popover. */
- var options = {
- container: 'body',
- content: getDownload(),
- html: true,
- placement: 'bottom',
- template: '
',
- tipClass: 'download-popover',
- trigger: 'manual'
- };
- $('#downloadCode').popover(options);
-
- $('#downloadCode').click(function()
- {
- if($('.download-popover').css('display') == 'block')
- {
- $('#downloadCode').popover('hide');
- }
- else
- {
- $('#downloadCode').popover('show');
-
- $('.copy-btn').tooltip({
- trigger: 'click',
- placement: 'bottom',
- title: lang.copied,
- tipClass: 'tooltip-success'
- });
-
- /* Set popover area. */
- var left = parseFloat($('.download-popover').css('left')) - 155;
- $('.download-popover').css('left', left + 'px');
- }
- })
-
- $('.copy-btn').live('click', function()
- {
- var copyText = $(this).parent().parent().find('input');
- copyText .select();
- document.execCommand("Copy");
-
- $(this).tooltip('show');
- var that = this;
- setTimeout(function()
- {
- $(that).tooltip('hide')
- }, 2000)
- })
-
- $('.download-btn').live('click', function()
- {
- var link = createLink('repo', 'downloadCode', 'repoID=' + repoID + '&branch=' + branch);
- window.open(link);
- })
-
- /* Sync rename record. */
- if(!syncedRF)
- {
- var link = createLink('repo', 'ajaxSyncRenameRecord', 'repoID=' + repoID);
- $.get(link);
- }
-})
diff --git a/module/repo/js/create.js b/module/repo/js/create.js
deleted file mode 100644
index 41211ee581..0000000000
--- a/module/repo/js/create.js
+++ /dev/null
@@ -1,108 +0,0 @@
-$(function()
-{
- scmChanged('Gitlab');
- $('#submit').mousedown(function()
- {
- $form = $(this).closest('form');
- $form.css('min-height', $form.height());
- });
-
- $('#repoForm').bind('DOMNodeInserted', function(e)
- {
- if($("#clientLabel").length > 0)
- {
- if($("#client").val() !== '' && $("#client").val().indexOf(" ") == -1)
- {
- $("#clientLabel").css('color', '#0c64eb');
- $("#client").attr('style', 'border-color: #0c64eb !important;box-shadow: 0 0 6px #0c64eb !important;');
- }
- else
- {
- $("#client").removeAttr("style");
- }
- }
- });
-
- $('#product').change(function()
- {
- var projects = $('#projects').val();
- var products = $('#product').val();
- $.post(createLink('repo', 'ajaxProjectsOfProducts'), {products, projects}, function(response)
- {
- $('#projectContainer').html('').append(response);
- $('#projects').chosen().trigger("chosen:updated");
- });
- });
-
- $('#serviceHost').change(function()
- {
- var host = $('#serviceHost').val();
- var url = createLink('repo', 'ajaxGetProjects', "host=" + host);
- if(host == '') return false;
-
- $.get(url, function(response)
- {
- $('#serviceProject').html('').append(response);
- $('#serviceProject').chosen().trigger("chosen:updated");;
- });
- });
-
- $('#serviceProject').change(function()
- {
- $option = $(this).find('option:selected');
- $('#name').val($option.data('name'));
- });
-
- $('#serviceHost').change();
-});
-
-/**
- * Changed SCM.
- *
- * @param string $scm
- * @access public
- * @return void
- */
-function scmChanged(scm)
-{
- if(scm == 'Git' || scm == 'Gitea' || scm == 'Gogs')
- {
- $('.account-fields').addClass('hidden');
- $('.tips-git').removeClass('hidden');
- $('.tips-svn').addClass('hidden');
- }
- else
- {
- $('.account-fields').removeClass('hidden');
- $('.tips-git').addClass('hidden');
- $('.tips-svn').removeClass('hidden');
- }
-
- if(scm == 'Git' || scm == 'Subversion')
- {
- $('tr.service').toggle(false);
- $('tr.hide-service').toggle(true);
- }
- else
- {
- $('.tips').addClass('hidden');
- $('tr.service').toggle(true);
- if(scm == 'Gitea' || scm == 'Gogs')
- {
- $('tr.hide-service:not(".hide-git")').toggle(true);
- $('tr.hide-git').toggle(false);
- }
- else
- {
- $('tr.hide-service').toggle(false);
- }
-
- var url = createLink('repo', 'ajaxGetHosts', "scm=" + scm);
- $.get(url, function(response)
- {
- $('#serviceHost').html(response);
- $('#serviceHost').chosen().trigger("chosen:updated");;
- $('#serviceHost').change();
- });
- }
-}
diff --git a/module/repo/js/diff.js b/module/repo/js/diff.js
deleted file mode 100644
index dce31d6709..0000000000
--- a/module/repo/js/diff.js
+++ /dev/null
@@ -1,200 +0,0 @@
-/**
- * Change code encoding.
- *
- * @param string encoding
- * @access public
- * @return void
- */
-function changeEncoding(encoding)
-{
- $('#encoding').val(encoding);
- $('#encoding').parents('form').submit();
-}
-
-/**
- * Html code decode.
- *
- * @param string str
- * @access public
- * @return string
- */
-function htmlspecialchars_decode(str){
- str = str.replace(/&/g, '&');
- str = str.replace(/</g, '<');
- str = str.replace(/>/g, '>');
- str = str.replace(/"/g, "''");
- str = str.replace(/'/g, "'");
- return str;
-}
-
-/**
- * Get diffs by file name.
- *
- * @param string fileName
- * @access public
- * @return object
- */
-function getDiffs(fileName)
-{
- if(fileName.indexOf('./') === 0) fileName = fileName.substring(2);
-
- var result = {
- 'code': {'new': '', 'old': ''},
- 'line': {'new': [], 'old': []}
- };
- $.each(diffs, function(i, diff)
- {
- if(diff.fileName == fileName)
- {
- if(!diff.contents || typeof diff.contents[0].lines != 'object') return result;
-
- $.each(diff.contents, function(k, content)
- {
- var lines = content.lines;
- $.each(lines, function(l, code)
- {
- if(code.type == 'all' || code.type == 'new')
- {
- result.code.new += htmlspecialchars_decode(code.line.substring(1)) + "\n";
- result.line.new.push(parseInt(code.newlc));
- }
-
- if(code.type == 'all' || code.type == 'old')
- {
- result.code.old += htmlspecialchars_decode(code.line.substring(1)) + "\n";
- result.line.old.push(parseInt(code.oldlc));
- }
- })
- })
- return result;
- }
- });
-
- return result;
-}
-
-/**
- * Create file tab.
- *
- * @param string filename
- * @param string filepath
- * @access public
- * @return object
- */
-function createTab(filename, filepath)
-{
- $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected');
- var tabID = Base64.encode(filepath).replace(/=/g, '-');
- return {
- id: tabID,
- url: createLink('repo', 'ajaxGetDiffEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))),
- type: 'iframe',
- title: filename,
- forbidClose: isonlybody
- };
-}
-
-$(document).ready(function()
-{
- var diffAppose = false;
- $('.dropdown #inline').hide();
-
- if(!browser || browser == 'ie')
- {
- $("#inline").click(function(){$('#arrange').val('inline');this.form.submit();});
- $("#appose").click(function(){$('#arrange').val('appose');this.form.submit();});
- }
- $(".label-exchange").click(function(){ $('#exchange').submit();});
-
- $('.btn-left').click(function() {arrowTabs('fileTabs', 1);});
- $('.btn-right').click(function() {arrowTabs('fileTabs', -2);});
- if(file) $('#fileTabs').tabs({tabs: [createTab(file['basename'], entry)]});
- if(isonlybody) $('#fileTabs .tab-nav-item .tab-nav-close').hide();
-
- /**
- * Set pane height.
- *
- * @access public
- * @return void
- */
- function setHeight()
- {
- var paneHeight = $(window).height() - 120;
- if(edition != 'open') paneHeight -= 80;
- if(isonlybody) paneHeight = 500;
- $('#fileTabs .tab-pane').css('height', paneHeight + 'px')
- $('#filesTree').css('height', paneHeight + 35)
- }
- setHeight();
- $(window).resize(setHeight);
-
- $(document).on('click', '.repoFileName', function()
- {
- var path = $(this).data('path');
- var name = $(this).text();
- var $tabs = $('#fileTabs').data('zui.tabs');
-
- $tabs.open(createTab(name, path));
- setHeight();
- arrowTabs('fileTabs', -2);
- });
-
- /* Remove file path for opened files. */
- $('#fileTabs').on('onClose', function(event, tab) {
- var filepath = decodeURIComponent(Base64.decode(tab.id.replace(/-/g, '=')));
- var index = openedFiles.indexOf(filepath);
- if(index > -1)
- {
- openedFiles.splice(index, 1)
- $('[data-path="' + filepath + '"]').closest('li').removeClass('selected');
- }
-
- if(index == openedFiles.length) arrowTabs('fileTabs', -2);
- });
-
- /* Append file path into the title. */
- $('#fileTabs').on('onLoad', function(event, tab) {
- var filepath = decodeURIComponent(Base64.decode(tab.id.replace(/-/g, '=')));
- $('#tab-nav-item-' + tab.id).attr('title', filepath);
- document.getElementById('tab-iframe-' + tab.id).contentWindow.updateEditorInline(diffAppose);
-
- if(openedFiles.indexOf(filepath) == -1) openedFiles.push(filepath);
- });
-
- $('#fileTabs').on('onOpen', function(event, tab) {
- var filepath = decodeURIComponent(Base64.decode(tab.id.replace(/-/g, '=')));
- var index = openedFiles.indexOf(filepath);
- if(index > -1) document.getElementById('tab-iframe-' + tab.id).contentWindow.updateEditorInline(diffAppose);
- });
-
- $('.inline-appose').on('click', function()
- {
- $('.inline-appose').hide();
- diffAppose = !diffAppose;
- if(diffAppose)
- {
- $('.dropdown #inline').show();
- }
- else
- {
- $('.dropdown #appose').show();
- }
- var type = $(this).attr('id');
- var tabID = $('.tab-nav-item.active').data('id');
- document.getElementById('tab-iframe-' + tabID).contentWindow.updateEditorInline(diffAppose);
- return;
- });
-});
-
-/**
- * Load link object page.
- *
- * @param string $link
- * @access public
- * @return void
- */
-function loadLinkPage(link)
-{
- $('#linkObject').attr('href', link);
- $('#linkObject').click()
-}
diff --git a/module/repo/js/edit.js b/module/repo/js/edit.js
deleted file mode 100644
index 19ff865cfb..0000000000
--- a/module/repo/js/edit.js
+++ /dev/null
@@ -1,132 +0,0 @@
-$(function()
-{
- scmChanged(repoSCM, true);
- $('#submit').mousedown(function()
- {
- $form = $(this).closest('form');
- $form.css('min-height', $form.height());
- });
-
- /**
- * Handle product changed event.
- *
- * @access public
- * @return void
- */
- function productChanged()
- {
- var projects = $('#projects').val();
- var products = $('#product').val();
- $.post(createLink('repo', 'ajaxProjectsOfProducts'), {products, projects}, function(response)
- {
- $('#projectContainer').html('').append(response);
- $('#projects').change(projectsChanged);
- $('#projects').chosen().trigger("chosen:updated");
- });
- }
-
- /**
- * Handle projects changed event.
- *
- * @param object $event
- * @param object $data
- * @access public
- * @return void
- */
- function projectsChanged(event, data)
- {
- if(!data.deselected) return;
-
- var products = $('#product').val();
- var projects = $('#projects').val();
-
- $.post(createLink('repo', 'ajaxFilterShadowProducts'), {products, projectID: data.deselected, objectID}, function(response)
- {
- $('#productContainer').html('').append(response);
- $('#product').change(productChanged);
- $('#product').chosen().trigger("chosen:updated");
- });
- }
-
- $('#product').change(productChanged);
-
- $('#projects').change(projectsChanged);
-
- $('#serviceHost').change(function()
- {
- host = $('#serviceHost').val();
- if(host == '') return false;
- url = createLink('repo', 'ajaxGetProjects', "host=" + host);
-
- $.get(url, function(response)
- {
- $('#serviceProject').html('').append(response);
- $('#serviceProject').chosen().trigger("chosen:updated");;
- });
- });
-
- $('#serviceProject').change(function()
- {
- $option = $(this).find('option:selected');
- if(!$option.data('name')) return false;
- $('#name').val($option.data('name'));
- $(this).chosen().trigger("chosen:updated");
- });
-});
-
-/**
- * Changed SCM.
- *
- * @param string $scm
- * @access public
- * @return void
- */
-function scmChanged(scm, isFirstRequest = false)
-{
- if(scm == 'Git' || scm == 'Gitea' || scm == 'Gogs')
- {
- $('.account-fields').addClass('hidden');
- if(['Git', 'Gitea', 'Gogs'].indexOf(repoSCM) === -1) $('#client').val('');
-
- $('.tips-git').removeClass('hidden');
- $('.tips-svn').addClass('hidden');
- }
- else
- {
- $('.account-fields').removeClass('hidden');
-
- $('.tips-git').addClass('hidden');
- $('.tips-svn').removeClass('hidden');
- }
-
- if(scm == 'Git' || scm == 'Subversion')
- {
- $('tr.service').toggle(false);
- $('tr.hide-service').toggle(true);
- }
- else
- {
- $('.tips').addClass('hidden');
- $('tr.service').toggle(true);
- if(scm == 'Gitea' || scm == 'Gogs')
- {
- $('tr.hide-service:not(".hide-git")').toggle(true);
- $('tr.hide-git').toggle(false);
- }
- else
- {
- $('tr.hide-service').toggle(false);
- }
-
- if(!isFirstRequest)
- {
- var url = createLink('repo', 'ajaxGetHosts', "scm=" + scm);
- $.get(url, function(response)
- {
- $('#serviceHost').html(response);
- $('#serviceHost').chosen().trigger("chosen:updated");;
- $('#serviceHost').change();
- });
- }
- }
-}
diff --git a/module/repo/js/import.js b/module/repo/js/import.js
deleted file mode 100644
index cb3fa9e895..0000000000
--- a/module/repo/js/import.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Delete the project.
- *
- * @param object $icon
- * @access public
- * @return void
- */
-function delItem(icon)
-{
- $(icon).closest('tr').remove();
- checkItem();
-}
-
-/**
- * Check the project.
- *
- * @access public
- * @return void
- */
-function checkItem()
-{
- if(!$("#repoList tbody tr").length) $("#submit").prop('disabled', true);
-}
-
-$(function()
-{
- checkItem();
-
- $(document).on('change', '[id^=product]', function()
- {
- var i = $(this).attr('id').replace(/[^0-9]/ig, '');
- var projects = $('#projects' + i).val();
- var products = $(this).val();
- $.post(createLink('repo', 'ajaxProjectsOfProducts'), {products, projects, 'number':i}, function(response)
- {
- $('#projectContainer' + i).html('').append(response);
- $('#projects' + i).chosen().trigger("chosen:updated");
- });
- });
-
-});
-
-/**
- * Change server.
- *
- * @access public
- * @return void
- */
-function selectServer()
-{
- var server = $('#servers').val();
- window.location.href = createLink('repo', 'import', 'server=' + server);
-}
diff --git a/module/repo/js/log.js b/module/repo/js/log.js
deleted file mode 100644
index e403a9a9d5..0000000000
--- a/module/repo/js/log.js
+++ /dev/null
@@ -1,23 +0,0 @@
-$(document).ready(function()
-{
- processCheckbox();
-});
-
-function processCheckbox()
-{
- $("input:checkbox[name='revision[]']").each(function()
- {
- $(this).click(function()
- {
- var checkNum = $("input:checkbox[name='revision[]']:checked").length;
- if (checkNum >= 2)
- {
- $("input:checkbox[name='revision[]']").each(function(){if($(this).attr('checked') == false) $(this).attr("disabled","disabled")});
- }
- else
- {
- $("input:checkbox[name='revision[]']").each(function(){if($(this).attr('checked') == false) $(this).attr("enabled","enabled")});
- }
- });
- });
-}
diff --git a/module/repo/js/monaco.js b/module/repo/js/monaco.js
deleted file mode 100644
index 9f0a7971f9..0000000000
--- a/module/repo/js/monaco.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Create file tab.
- *
- * @param string filename
- * @param string filepath
- * @access public
- * @return object
- */
-function createTab(filename, filepath)
-{
- $('[data-path="' + decodeURIComponent(filepath) + '"]').closest('li').addClass('selected');
- /* encode twice for resolving chinese character. */
- var tabID = Base64.encode(Base64.encode(filepath).replace(/=/g, '-')).replace(/=/g, '-');
- return {
- id: tabID,
- url: createLink('repo', 'ajaxGetEditorContent', urlParams.replace('%s', Base64.encode(encodeURIComponent(filepath)))),
- type: 'iframe',
- title: filename,
- forbidClose: isonlybody
- };
-}
-
-$(function()
-{
- $('.btn-left').click(function() {arrowTabs('fileTabs', 1);});
- $('.btn-right').click(function() {arrowTabs('fileTabs', -2);});
- $('#fileTabs').tabs({tabs: [createTab(file['basename'], entry)]});
- if(isonlybody) $('#fileTabs .tab-nav-item .tab-nav-close').hide();
-
- /**
- * Set pane height.
- *
- * @access public
- * @return void
- */
- function setHeight()
- {
- var paneHeight = $(window).height() - 120;
- if(isonlybody) paneHeight = 500;
- $('#fileTabs .tab-pane').css('height', paneHeight + 'px')
- $('#filesTree').css('height', paneHeight + 35)
- }
- setHeight();
- $(window).resize(setHeight);
-
- $(document).on('click', '.repoFileName', function()
- {
- var path = $(this).data('path');
- var name = $(this).text();
- var $tabs = $('#fileTabs').data('zui.tabs');
- if(openedFiles.indexOf(path) == -1) openedFiles.push(path);
-
- $tabs.open(createTab(name, path));
- setHeight();
- arrowTabs('fileTabs', -1);
- });
-
- /* Remove file path for opened files. */
- $('#fileTabs').on('onClose', function(event, tab) {
- /* encode twice for resolving chinese character. */
- var filepath = decodeURIComponent(Base64.decode(Base64.decode(tab.id.replace(/-/g, '=')).replace(/-/g, '=')));
- var index = openedFiles.indexOf(filepath);
- if(index > -1)
- {
- openedFiles.splice(index, 1)
- $('[data-path="' + filepath + '"]').closest('li').removeClass('selected');
- }
-
- if(index == openedFiles.length) arrowTabs('fileTabs', -2);
- });
-
- /* Append file path into the title. */
- $('#fileTabs').on('onLoad', function(event, tab) {
- var filepath = Base64.decode(tab.id.replace(/-/g, '='));
- $('#tab-nav-item-' + tab.id).attr('title', decodeURIComponent(filepath));
- });
-
- if(['Git', 'Gitlab', 'Gogs', 'Gitea'].indexOf(repo.SCM) != -1)
- {
- var link = createLink('repo', 'ajaxGetBranchesAndTags', 'repoID=' + repoID + '&oldRevision=' + branchID);
- $.get(link, function(data)
- {
- var result = $.parseJSON(data);
- $('#branchList').empty();
- $('#branchList').append(result.sourceHtml);
- $('#branchList #branchesAndTags').tree({initialState: 'expand'});
- });
- }
- else
- {
- $('#sourceSwapper').hide();
- }
-
- /**
- * Refresh files tree.
- *
- * @param string branchOrTag
- * @access public
- * @return void
- */
- function refreshFiles(branchOrTag)
- {
- var link = createLink('repo', 'ajaxGetFileTree', 'repoID=' + repoID + '&branch=' + Base64.encode(branchOrTag));
- $.get(link, function(data)
- {
- $('#modules').remove();
- $('#filesTree').append(data);
- $('#modules').tree();
- $('#filesTree').removeClass('loading');
- });
- }
-
- $(document).on('click', '.branch-or-tag', function()
- {
- var branchOrTag = $(this).text();
- if(branchOrTag != $.cookie('repoBranch'))
- {
- $('#filesTree').addClass('loading');
- $.cookie('repoBranch', branchOrTag);
-
- $('#fileTabs').data('zui.tabs').closeAll();
- refreshFiles(branchOrTag);
-
- $('.branch-or-tag').removeClass('selected');
- $(this).addClass('selected');
- $('.repo-select').attr('title', branchOrTag);
- $('.repo-select .version-name').text(branchOrTag);
- }
- })
-});
-
-/**
- * Load link object page.
- *
- * @param string $link
- * @access public
- * @return void
- */
-function loadLinkPage(link)
-{
- $('#linkObject').attr('href', link);
- $('#linkObject').click()
-}
diff --git a/module/repo/js/setrules.js b/module/repo/js/setrules.js
deleted file mode 100644
index e6a5d0e713..0000000000
--- a/module/repo/js/setrules.js
+++ /dev/null
@@ -1,185 +0,0 @@
-$(function()
-{
- replaceExample();
- $('input').keyup(function(){replaceExample()});
-})
-
-function replaceExample()
-{
- var html = '';
- var startTask = $('[id*=start]').val().split(';');
- var taskModule = $('[id*=module][id*=task]').val().split(';');
- var idMark = $('[id*=id][id*=mark]').val().split(';');
- var idSplit = $('[id*=id][id*=split]').val().split(';');
- var costs = $('[id*=task][id*=consumed]').val().split(';');
- var consumedmark = $('[id*=mark][id*=consumed]').val().split(';');
- var lefts = $('[id*=task][id*=left]').val().split(';');
- var leftMarks = $('[id*=mark][id*=left]').val().split(';');
- var cunits = $('[id*=unit][id*=consumed]').val().split(';');
- var lunits = $('[id*=unit][id*=left]').val().split(';');
-
- for(i in startTask)
- {
- start = startTask[i];
- for(j in taskModule)
- {
- task = taskModule[j];
- for(k in idMark)
- {
- id = idMark[k];
- for(l in idSplit)
- {
- split = idSplit[l];
- for(m in costs)
- {
- cost = costs[m];
- for(n in consumedmark)
- {
- consumed = consumedmark[n];
- for(o in lefts)
- {
- left = lefts[o];
- for(p in leftMarks)
- {
- leftMark = leftMarks[p];
- for(q in cunits)
- {
- cunit = cunits[q];
- for(r in lunits)
- {
- lunit = lunits[r];
- html += '
' + rulesExample['task']['start'].replace('%start%', start)
- .replace('%task%', task)
- .replace('%id%', id)
- .replace('%split%', split)
- .replace('%cost%', cost)
- .replace('%consumedmark%', consumed)
- .replace('%left%', left)
- .replace('%leftmark%', leftMark)
- .replace('%cunit%', cunit)
- .replace('%lunit%', lunit);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- var finishTask = $('[id*=finish]').val().split(';');
- for(i in finishTask)
- {
- finish = finishTask[i];
- for(j in taskModule)
- {
- task = taskModule[j];
- for(k in idMark)
- {
- id = idMark[k];
- for(l in idSplit)
- {
- split = idSplit[l];
- for(m in costs)
- {
- cost = costs[m];
- for(n in consumedmark)
- {
- consumed = consumedmark[n];
- for(o in cunits)
- {
- cunit = cunits[o];
- html += '
' + rulesExample['task']['finish'].replace('%finish%', finish)
- .replace('%task%', task)
- .replace('%id%', id)
- .replace('%split%', split)
- .replace('%cost%', cost)
- .replace('%consumedmark%', consumed)
- .replace('%cunit%', cunit);
- }
- }
- }
- }
- }
- }
- }
-
- var effortTask = $('[id*=logEfforts]').val().split(';');
- for(i in effortTask)
- {
- effort = effortTask[i];
- for(j in taskModule)
- {
- task = taskModule[j];
- for(k in idMark)
- {
- id = idMark[k];
- for(l in idSplit)
- {
- split = idSplit[l];
- for(m in costs)
- {
- cost = costs[m];
- for(n in consumedmark)
- {
- consumed = consumedmark[n];
- for(o in lefts)
- {
- left = lefts[o];
- for(p in leftMarks)
- {
- leftMark = leftMarks[p];
- for(q in cunits)
- {
- cunit = cunits[q];
- for(r in lunits)
- {
- lunit = lunits[r];
- html += '
' + rulesExample['task']['effort'].replace('%effort%', effort)
- .replace('%task%', task)
- .replace('%id%', id)
- .replace('%split%', split)
- .replace('%cost%', cost)
- .replace('%consumedmark%', consumed)
- .replace('%left%', left)
- .replace('%leftmark%', leftMark)
- .replace('%cunit%', cunit)
- .replace('%lunit%', lunit);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-
- var resolveBug = $('[id*=bug][id*="resolve"]').val().split(';');
- var bugModule = $('[id*=module][id*=bug]').val().split(';');
- for(i in resolveBug)
- {
- resolve = resolveBug[i];
- for(j in bugModule)
- {
- bug = bugModule[j];
- for(k in idMark)
- {
- id = idMark[k];
- for(l in idSplit)
- {
- split = idSplit[l];
- html += '
' + rulesExample['bug']['resolve'].replace('%resolve%', resolve)
- .replace('%bug%', bug)
- .replace('%id%', id)
- .replace('%split%', split);
- }
- }
- }
- }
-
- $('#example').html(html.substr(6));
-}
diff --git a/module/screen/css/browse.css b/module/screen/css/browse.css
deleted file mode 100644
index c759167330..0000000000
--- a/module/screen/css/browse.css
+++ /dev/null
@@ -1,48 +0,0 @@
-.cell {overflow:auto !important}
-.table-footer .pager:before,
-.table-footer .pager,
-.table-footer {background: none;}
-
-.row a:hover {color: #3c4353;}
-
-.screen {border-radius: 4px; border: solid 1px #ddd; position: relative;}
-.screen .top {text-align: center; min-height:182px; position:relative;}
-.screen .top.img {height: 182px; text-align: center;}
-.screen .top.img img {height:100%; overflow: hidden; object-fit: cover; object-position: top;}
-.screen .top.img.image_draft img {object-position: center;}
-.screen .top .image {height:100%; display:flex; align-items:center; justify-content:center;}
-.screen .top .image i {font-size:100px;}
-.screen .top .image i:before {content: '\f1c5';}
-
-.screen .bottom {padding: 12px 16px; height: 70px;}
-.screen .bottom .screen-title{font-size: 14px; color: #0B0F18;overflow:hidden; white-space: nowrap;}
-.screen .bottom .screen-title a{color: white;}
-.screen .bottom div.screen-desc{margin: 0;font-size:12px; color: #838A9D; overflow: hidden;height:34px;}
-
-.row a.btn-collect-screen {color: white; position: absolute; right: 10px; top: 117px; z-index: 1;}
-
-.bg1 {background:#1183fb;}
-.bg2 {background:#ea644a;}
-.bg3 {background:#f1a325;}
-.bg4 {background:#0bd6c0;}
-.bg5 {background:#0997bb;}
-.bg6 {background:#0abbad;}
-
-.main-col {background-color: white;}
-.main-col .row {margin:10px 0px; padding: 12px;}
-.main-col .row .col-md-3 {padding: 8px;}
-.main-col .row .col-md-3 a {min-width: 297px;}
-
-#mainContent {background-color: white;}
-#mainContent .row {margin:10px 0px; padding: 12px;}
-#mainContent .row .col-md-3 {padding: 8px;}
-
-#firstGuide .modal-dialog {width: 800px !important;}
-#firstGuide .modal-body {padding: 0 !important; max-height: 465px !important;}
-#firstGuide .background-img {height: 460px !important;}
-#firstGuide .modal-footer {text-align: center !important; border-top: none !important; padding: 24px 0px !important;}
-#firstGuide .btn-wide {min-width: 90px !important;}
-#firstGuide .clickable-area {position: absolute; width: 50px; height: 20px; top: 235px; right: 117px;}
-
-#main .bizGuide {width: 100%;}
-#main .bizGuide > a {float: right;}
diff --git a/module/screen/js/browse.js b/module/screen/js/browse.js
deleted file mode 100644
index 771e500b8a..0000000000
--- a/module/screen/js/browse.js
+++ /dev/null
@@ -1,5 +0,0 @@
-$(function()
-{
- if(showGuide) $('#firstGuide').modal();
-});
-
diff --git a/module/serverroom/css/browse.css b/module/serverroom/css/browse.css
deleted file mode 100644
index 2825f42c9d..0000000000
--- a/module/serverroom/css/browse.css
+++ /dev/null
@@ -1 +0,0 @@
-/* #serverRoomList td{white-space: nowrap; text-overflow: ellipsis; overflow: hidden;} */
diff --git a/module/sonarqube/css/browseissue.css b/module/sonarqube/css/browseissue.css
deleted file mode 100644
index 7fe0c53251..0000000000
--- a/module/sonarqube/css/browseissue.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.text-c-counts > span {margin-left: 5px;}
-#mainMenu .pull-left {margin-right: 15px;}
-.c-message {width: 300px;}
-.c-file {width: 270px;}
-.c-effort {width: 155px;}
-.c-date {width: 130px;}
-.c-severity {width: 80px;}
-#keyword {width: 240px;}
diff --git a/module/sonarqube/css/browseproject.css b/module/sonarqube/css/browseproject.css
deleted file mode 100644
index d86ca85e6a..0000000000
--- a/module/sonarqube/css/browseproject.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.text-c-counts > span {margin-left: 5px;}
-#mainMenu .pull-left {margin-right: 15px;}
diff --git a/module/sonarqube/css/create.css b/module/sonarqube/css/create.css
deleted file mode 100644
index bf9498be54..0000000000
--- a/module/sonarqube/css/create.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.table-form .c-name {width: 130px;}
-.table-form .c-input {width: 650px;}
-.main-content>.center-block {max-width: 900px;}
-#sonarqubeForm table {width: 700px;}
diff --git a/module/sonarqube/css/edit.css b/module/sonarqube/css/edit.css
deleted file mode 100644
index 22cf991723..0000000000
--- a/module/sonarqube/css/edit.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.table-form .c-name {width: 130px;}
-.table-form .c-input {width: 650px;}
diff --git a/module/sonarqube/css/reportview.css b/module/sonarqube/css/reportview.css
deleted file mode 100644
index 4733da1852..0000000000
--- a/module/sonarqube/css/reportview.css
+++ /dev/null
@@ -1 +0,0 @@
-.table-report .table-nest-icon {color: #000; font-weight: 700; height: 16px;}
diff --git a/module/sonarqube/js/browseissue.js b/module/sonarqube/js/browseissue.js
deleted file mode 100644
index 5ead6cd3dd..0000000000
--- a/module/sonarqube/js/browseissue.js
+++ /dev/null
@@ -1,29 +0,0 @@
-$(document).ready(function()
-{
- $('#issueSearch').click(function()
- {
- triggerSearch();
- });
-
- $('#keyword').keypress(function(event)
- {
- if(event.which == 13) triggerSearch();
- });
-
- $('.c-actions>a').click(function()
- {
- issueTitle = $(this).parent().parent().children(':first').attr('title');
- $.cookie('sonarqubeIssue', issueTitle);
- });
-});
-
-/**
- * Trigger filtering function.
- *
- * @access public
- * @return void
- */
-function triggerSearch()
-{
- $("#sonarqubeIssueForm").submit();
-}
diff --git a/module/sonarqube/js/browseproject.js b/module/sonarqube/js/browseproject.js
deleted file mode 100644
index edf62386c8..0000000000
--- a/module/sonarqube/js/browseproject.js
+++ /dev/null
@@ -1,22 +0,0 @@
-$(document).ready(function()
-{
- $('#projectSearch').click(function()
- {
- triggerSearch();
- });
- $('#keyword').keypress(function(event)
- {
- if(event.which == 13) triggerSearch();
- })
-});
-
-/**
- * Trigger filtering function.
- *
- * @access public
- * @return void
- */
-function triggerSearch()
-{
- $("#sonarqubeProjectForm").submit();
-}
diff --git a/module/space/css/browse.css b/module/space/css/browse.css
deleted file mode 100644
index fee40be048..0000000000
--- a/module/space/css/browse.css
+++ /dev/null
@@ -1,20 +0,0 @@
-#dropMenu .col-left {padding-bottom: 0;}
-input.search-input#search {padding:5px;}
-.q-card-title {padding-left: 15px; margin-left: -15px; line-height: 18px; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
-#cardsContainer .row {min-height: calc(100vh - 160px);}
-#cardsContainer .panel{border-radius: 2px;}
-#cardsContainer .panel-heading {padding: 14px 14px 20px 14px;}
-#cardsContainer .panel-body {padding: 0 14px;}
-#cardsContainer .panel-footer .count-down{display: inline-block; margin: 0 10px;}
-#cardsContainer .instance-detail {height: 44px; margin-bottom: 6px;}
-#cardsContainer .instance-logo {float: left;}
-#cardsContainer .instance-logo img {width: 44px; height: 44px;}
-#cardsContainer .instance-intro {float: left; padding-left: 20px; margin-bottom: 0; line-height: 22px; width: calc(100% - 44px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
-#cardsContainer .instance-actions {padding: 14px 0 0 0;}
-#cardsContainer .instance-footer {height: 50px; padding: 14px; font-size: 13px; font-weight: 600;}
-#cardsContainer .instance-footer span {display: inline-block;}
-.input-group-btn {float: left;}
-#spaceSearchForm > div.btn-toolbar.pull-left > a {padding: 3px;}
-#spaceSearchForm button[type=submit] {height: 32px;}
-#spaceSearchForm a.btn {margin-top: 3px;}
-.solution-link {line-height: 18px; text-align: center; max-width: 140px; display: inline-block; float: right;}
diff --git a/module/space/js/browse.js b/module/space/js/browse.js
deleted file mode 100644
index 6863ba967c..0000000000
--- a/module/space/js/browse.js
+++ /dev/null
@@ -1,133 +0,0 @@
-$(function()
-{
- $(".switchButton").on('click', function()
- {
- var spaceType = $(this).attr('data-type');
- $.cookie('spaceType', spaceType, {expires:config.cookieLife, path:config.webRoot});
- });
- $('.btn-uninstall').on('click', function(event)
- {
- bootbox.confirm(instanceNotices.confirmUninstall, function(result)
- {
- if(!result) return;
-
- var loadingDialog = bootbox.dialog(
- {
- message: '
' + instanceNotices.uninstalling + '
',
- });
-
- let id = $(event.target).closest('button').attr('instance-id');
- let url = createLink('instance', 'ajaxUninstall', 'id=' + id, 'json');
- $.post(url).done(function(response)
- {
- loadingDialog.modal('hide');
-
- let res = JSON.parse(response);
- if(res.result == 'success')
- {
- window.location.reload();
- }
- else
- {
- bootbox.alert(
- {
- title: instanceNotices.fail,
- message: res.message,
- });
- }
- });
- });
- });
-
- $('.btn-start').on('click', function(event)
- {
- bootbox.confirm(instanceNotices.confirmStart, function(result)
- {
- if(!result) return;
-
- var loadingDialog = bootbox.dialog(
- {
- message: '
' + instanceNotices.starting + '
',
- });
-
- let id = $(event.target).closest('button').attr('instance-id');
- let url = createLink('instance', 'ajaxStart', 'id=' + id, 'json');
- $.post(url).done(function(response)
- {
- loadingDialog.modal('hide');
-
- let res = JSON.parse(response);
- if(res.result == 'success')
- {
- window.location.reload();
- }
- else
- {
- bootbox.alert(
- {
- title: instanceNotices.fail,
- message: res.message,
- });
- }
- });
- });
- });
-
- $('.btn-stop').on('click', function(event)
- {
- bootbox.confirm(instanceNotices.confirmStop, function(result)
- {
- if(!result) return;
-
- var loadingDialog = bootbox.dialog(
- {
- message: '
' + instanceNotices.stopping + '
',
- });
-
- let id = $(event.target).closest('button').attr('instance-id');
- let url = createLink('instance', 'ajaxStop', 'id=' + id, 'json');
- $.post(url).done(function(response)
- {
- loadingDialog.modal('hide');
-
- let res = JSON.parse(response);
- if(res.result == 'success')
- {
- window.location.reload();
- }
- else
- {
- bootbox.alert(
- {
- title: instanceNotices.fail,
- message: res.message,
- });
- } });
- });
- });
-
- var enableTimer = true;
- window.parent.$(window.parent.document).on('showapp', function(event, app)
- {
- enableTimer = app.code == 'space';
- });
-
- setInterval(function()
- {
- if(!enableTimer) return;
-
- var statusURL = createLink('instance', 'ajaxStatus');
- $.post(statusURL, {idList: instanceIdList}).done(function(response)
- {
- let res = JSON.parse(response);
- if(res.result == 'success' && res.data instanceof Array)
- {
- res.data.forEach(function(instance)
- {
- if($(".instance-status[instance-id=" + instance.id + "]").data('status') != instance.status) window.location.reload();
- });
- }
- if(res.locate) window.parent.location.href = res.locate;
- });
- }, 1000 * 5);
-})
diff --git a/module/stakeholder/css/browse.css b/module/stakeholder/css/browse.css
deleted file mode 100644
index 95ae5a4c7a..0000000000
--- a/module/stakeholder/css/browse.css
+++ /dev/null
@@ -1,7 +0,0 @@
-table td, table th {overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
-.c-phone {width: 120px;}
-.c-email {width: 200px;}
-.btn-group a i.icon-plus {font-size: 16px;}
-.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
-.btn-group button.dropdown-toggle.btn-primary {padding:6px;}
-.c-name {width: 120px;}
diff --git a/module/stakeholder/css/create.css b/module/stakeholder/css/create.css
deleted file mode 100644
index cd9f072d79..0000000000
--- a/module/stakeholder/css/create.css
+++ /dev/null
@@ -1,2 +0,0 @@
-#dataform .c-from {width: 120px;}
-[lang^=en] #dataform .c-from {width: 130px;}
diff --git a/module/stakeholder/js/batchcreate.js b/module/stakeholder/js/batchcreate.js
deleted file mode 100644
index ed64c8c3e7..0000000000
--- a/module/stakeholder/js/batchcreate.js
+++ /dev/null
@@ -1,20 +0,0 @@
-function setDeptUsers(obj)
-{
- dept = $(obj).val();//Get dept ID.
- link = createLink('stakeholder', 'batchCreate', 'projectID=' + projectID + '&dept=' + dept);
- location.href=link;
-}
-
-function addItem(obj)
-{
- var item = $('#addItem').html();
- $(obj).closest('tr').after('
' + item + '
');
- var $accounts = $(obj).closest('tr').next().find('select[name*=accounts]');
- $accounts.chosen();
-}
-
-function deleteItem(obj)
-{
- if($('#teamForm .table tbody').children().length < 2) return false;
- $(obj).closest('tr').remove();
-}
diff --git a/module/stakeholder/js/create.js b/module/stakeholder/js/create.js
deleted file mode 100644
index bb9d4e8632..0000000000
--- a/module/stakeholder/js/create.js
+++ /dev/null
@@ -1,91 +0,0 @@
-$(function()
-{
- $('input[name*=from]').change(function()
- {
- $('#userLabel').remove();
-
- if($(this).val() == 'team')
- {
- $('.user-info').addClass('hidden');
- $('#user').closest('tr').find('.input-group-addon').addClass('hidden');
- var link = createLink('stakeholder', 'ajaxGetMembers', 'user=&program=' + programID + '&projectID=' + projectID);
- $.post(link, function(data)
- {
- $('#user').replaceWith(data);
- $('#user_chosen').remove();
- $('#user').chosen();
- })
- }
-
- if($(this).val() == 'company')
- {
- $('.user-info').addClass('hidden');
- $('#user').closest('tr').find('.input-group-addon').addClass('hidden');
- var link = createLink('stakeholder', 'ajaxGetCompanyUser', 'user=&programID=' + programID + '&projectID=' + projectID);
- $.post(link, function(data)
- {
- $('#user').replaceWith(data);
- $('#user_chosen').remove();
- $('#user').chosen();
- })
- }
-
- if($(this).val() == 'outside')
- {
- $('#user').closest('tr').find('.input-group-addon').removeClass('hidden');
- if($('input[name*=newUser]').prop('checked')) $('.user-info').removeClass('hidden');
- var objectID = programID ? programID : projectID;
- var link = createLink('stakeholder', 'ajaxGetOutsideUser', 'objectID=' + objectID);
- $.post(link, function(data)
- {
- $('#user').replaceWith(data);
- $('#user_chosen').remove();
- $('#user').chosen();
- })
- }
- })
-
- $("input[name='new[]']").change(function()
- {
- if($(this).prop('checked'))
- {
- $('#company').replaceWith("
");
- $('#company_chosen').remove();
- }
- else
- {
- var link = createLink('company', 'ajaxGetOutsideCompany');
- $.post(link, function(data)
- {
- $('#company').replaceWith(data);
- $('#company').chosen();
- })
- }
- })
-
- $('input[name*=newUser]').change(function()
- {
- if($(this).prop('checked'))
- {
- $('#user').attr('disabled', true).trigger("chosen:updated");
- $('.user-info').removeClass('hidden');
- }
- else
- {
- $('#user').attr('disabled', false).trigger("chosen:updated");
- $('.user-info').addClass('hidden');
- }
- })
-})
-
-function changeUser(value)
-{
- if(value)
- {
- $('.user-info').addClass('hidden');
- }
- else
- {
- $('.user-info').removeClass('hidden');
- }
-}
diff --git a/module/stakeholder/js/edit.js b/module/stakeholder/js/edit.js
deleted file mode 100644
index 7f42ae1ba9..0000000000
--- a/module/stakeholder/js/edit.js
+++ /dev/null
@@ -1,58 +0,0 @@
-$(function()
-{
- $('input[name*=from]').change(function()
- {
- var value = $('input[name*=from]:checked').val();
- if(value == 'team')
- {
- $('.user-info').addClass('hidden');
- var link = createLink('stakeholder', 'ajaxGetMembers', 'user=' + user);
- $.post(link, function(data)
- {
- $('#user').replaceWith(data);
- $('#user_chosen').remove();
- $('#user').chosen();
- })
- }
-
- if(value == 'company')
- {
- $('.user-info').addClass('hidden');
- var link = createLink('stakeholder', 'ajaxGetCompanyUser', 'user=' + user);
- $.post(link, function(data)
- {
- $('#user').replaceWith(data);
- $('#user_chosen').remove();
- $('#user').chosen();
- })
- }
-
- if(value == 'outside')
- {
- $('.user-info').removeClass('hidden');
- var link = createLink('stakeholder', 'ajaxGetOutsideUser');
- $.post(link, function(data)
- {
- $('#user').replaceWith(data);
- $('#user').val(user);
- $('#user_chosen').remove();
- $('#user').trigger('chosen:updated');
- $('#user').chosen();
- })
- }
- })
-
- $('input[name*=from]').change();
-})
-
-function changeUser(value)
-{
- if(value)
- {
- $('.user-info').addClass('hidden');
- }
- else
- {
- $('.user-info').removeClass('hidden');
- }
-}
diff --git a/module/store/css/appview.css b/module/store/css/appview.css
deleted file mode 100644
index 100ea476d8..0000000000
--- a/module/store/css/appview.css
+++ /dev/null
@@ -1,19 +0,0 @@
-.app-logo div {text-align: right; padding-right: 8px;}
-.app-logo img {width: 48px; height: 48px;}
-table tr td.app-desc {vertical-align: top;}
-table tr td.app-action {vertical-align: top; text-align: center;}
-#mainContent .cell{padding: 20px;}
-#mainContent .app-logo img {width: 50px; height: 50px; display: inline-block; margin-right: 20px;}
-#mainContent hr {margin: 10px 0 0 0;}
-#appInfoHeader {height: 60px;}
-#appInfoHeader button .icon{color: #70c0fb;}
-#appInfoHeader .btn {display: inline-block; margin: 0 10px;}
-#appInfoHeader .icon:before {padding-right: 5px; font-size: 18px;}
-#appInfoHeader .icon-docker:before {color: #2196f3;}
-#appInfoHeader .icon-forum:before {color: #ff9800;}
-#appInfoHeader .dropdown .icon {padding-right: 5px;}
-#appInfoBody h3 {margin-top: 40px;}
-.dynamicContainer {padding: 10px; border: solid 1px #ddd;}
-.dynamicContainer table {margin-bottom: 0;}
-.screenshotsContainer .errorBox{padding: 20px; border: solid 1px #ddd;}
-.screenshotsContainer img{width: 100%; height: auto; border: solid 1px #ddd; border-radius: 3px; padding: 5px;}
diff --git a/module/store/css/browse.css b/module/store/css/browse.css
deleted file mode 100644
index 145a1a7ade..0000000000
--- a/module/store/css/browse.css
+++ /dev/null
@@ -1,17 +0,0 @@
-#appSearchForm input[type=text] {padding: 5px 10px;}
-#appSearchForm button[type=submit] {height: 32px;}
-#appContainer .row {min-height: calc(100vh - 130px);}
-#appContainer .card a:hover {color: #0b89b2;}
-#appContainer .card.panel {border-radius: 2px;}
-#appContainer .panel-heading {padding-right: 20px;}
-#appContainer .app-name {font-size: 18px; font-weight: 700; display: inline-block;padding: 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;}
-#appContainer .app-detail {height: 80px;}
-#appContainer .app-logo {float: left;}
-#appContainer .app-logo img {width: 80px; height: 80px;}
-#appContainer .app-desc {float: left; padding-left: 20px; width: calc(100% - 80px);}
-#appContainer .app-desc {display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
-#appContainer .app-footer {height: 50px; padding: 10px 20px; font-size: 14px; font-weight: bold;}
-#appContainer .app-footer span {display: inline-block; margin: 0 10px;}
-#appContainer .pagination ul {float: right;}
-#appContainer .btn-toolbar {height: 40px;}
-.sort {padding: 0 10px;}
diff --git a/module/store/js/browse.js b/module/store/js/browse.js
deleted file mode 100644
index b496914f29..0000000000
--- a/module/store/js/browse.js
+++ /dev/null
@@ -1,6 +0,0 @@
-$(function()
-{
- $('#appSearchForm #submit').attr('id', '');
-
- $("input[name='categories[]']").on('change', function(){$('#appSearchForm').submit();});
-});
diff --git a/module/story/css/affected.css b/module/story/css/affected.css
deleted file mode 100644
index 95b64370eb..0000000000
--- a/module/story/css/affected.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.c-consumed {width :100px;}
-.c-left {width :90px;}
diff --git a/module/story/css/batchclose.css b/module/story/css/batchclose.css
deleted file mode 100644
index 576dfc65bd..0000000000
--- a/module/story/css/batchclose.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.c-id {width: 50px;}
-.c-reason {width: 210px;}
-td[id^="duplicateStoryBox"].required:after {top: 6px; right: 2px;}
-td[id^="duplicateStoryBox"] {overflow: visible;}
-td.reasons-td {overflow: visible;}
diff --git a/module/story/css/batchcreate.css b/module/story/css/batchcreate.css
deleted file mode 100644
index fad4522720..0000000000
--- a/module/story/css/batchcreate.css
+++ /dev/null
@@ -1,15 +0,0 @@
-#importLinesModal .modal-dialog {width: 80%;}
-
-#batchCreateForm .c-id {width: 50px; text-align: center; color: #838A9D;}
-#batchCreateForm .c-module,
-#batchCreateForm .c-plan {width: 180px;}
-#batchCreateForm .c-name {width: 180px;}
-#batchCreateForm .c-pri {width: 100px;}
-#batchCreateForm .c-review {width: 95px;}
-#batchCreateForm .c-estimate {width: 90px;}
-#batchCreateForm .c-verify {width: 140px;}
-#batchCreateForm .c-keywords {width: 140px;}
-.body-modal .main-header > h2 {max-width: 80%;}
-#batchCreateForm .reviewBox{width: 200px !important;}
-
-.table tbody>tr>td {vertical-align: top;}
diff --git a/module/story/css/batchedit.css b/module/story/css/batchedit.css
deleted file mode 100644
index 281cb83544..0000000000
--- a/module/story/css/batchedit.css
+++ /dev/null
@@ -1,12 +0,0 @@
-#suhosinInfo {margin-bottom: 0;}
-.c-id {width: 40px;}
-.c-estimate {width: 50px;}
-.c-branch, .c-module {width: 120px;}
-.c-title {width: 150px;}
-.c-plan {width: 170px;}
-.c-category {width: 90px;}
-.c-pri {width: 70px;}
-.c-source {width: 130px;}
-.c-note, .c-stage, .c-reason {width: 100px;}
-.c-keywords {width: 80px;}
-.c-user {width: 115px;}
diff --git a/module/story/css/batchtotask.css b/module/story/css/batchtotask.css
deleted file mode 100644
index 9bfb386eff..0000000000
--- a/module/story/css/batchtotask.css
+++ /dev/null
@@ -1,25 +0,0 @@
-.chosen-container[id^="story"] {width: 200px; max-width: 150px;}
-select[id^="story"] + .picker-single {width: 130px; max-width: 130px;}
-#mainContent .main-header h2 {max-width: 300px;}
-
-#batchToTaskForm .input-group,
-#batchToTaskForm .input-group .form-control {position: static;}
-#batchToTaskForm .input-group .colorpicker {z-index: 2;}
-#batchToTaskForm .input-group .colorpicker.open {z-index: 5;}
-.main-header .pull-left {max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-
-.chosen-results > li.has-task,
-.chosen-results > li.has-new-task {position: relative; color: #388E3C;}
-.chosen-results > li.has-task.highlighted,
-.chosen-results > li.has-new-task.highlighted {color: #fff;}
-
-#batchToTaskForm .c-id {width: 30px;}
-#batchToTaskForm .c-name, #batchToTaskForm .c-desc {width: 150px;}
-#batchToTaskForm .c-story {width: 200px;}
-#batchToTaskForm .c-assigned {width: 125px;}
-#batchToTaskForm .c-date {width: 105px;}
-#batchToTaskForm .c-pri {width: 65px;}
-#batchToTaskForm .c-actions, #batchToTaskForm .c-estimate {width: 60px;}
-#batchToTaskForm .input-group-addon {padding: 5px 6px;}
-[lang^=de] #batchToTaskForm .c-date {width: 120px;}
-[lang^=de] #batchToTaskForm .c-estimate {width: 65px;}
diff --git a/module/story/css/bugs.css b/module/story/css/bugs.css
deleted file mode 100644
index 32fcae10c7..0000000000
--- a/module/story/css/bugs.css
+++ /dev/null
@@ -1,4 +0,0 @@
-body {background: white;}
-.bugsList {padding: 10px;}
-.bugsList .table {border: 1px solid #ddd;}
-.c-id {width: 40px}
diff --git a/module/story/css/cases.css b/module/story/css/cases.css
deleted file mode 100644
index f4783dc8df..0000000000
--- a/module/story/css/cases.css
+++ /dev/null
@@ -1,4 +0,0 @@
-body {background: white;}
-.casesList {padding: 10px;}
-.casesList .table {border: 1px solid #ddd;}
-.c-id, .c-result {width: 50px;}
diff --git a/module/story/css/change.css b/module/story/css/change.css
deleted file mode 100644
index c82effceff..0000000000
--- a/module/story/css/change.css
+++ /dev/null
@@ -1,10 +0,0 @@
-.input-group .chosen-container-single .chosen-single {border-radius: 2px 0 0 2px;}
-#affectedProjects .table + h6 {border-top: 1px solid #ddd;}
-.nav-tabs>li>a {height: 36px;}
-.table-form>tbody>tr>th {width: 100px !important;}
-.colorpicker {right: -1px; top: 7px; opacity: 1;}
-#twinsList td, #twinsTitle td {padding-left: 65px;}
-#twinsTitle td {font-weight: 700;}
-
-.title-group.required:after {display: none;}
-.title-group.required > .required:after {display: block; right: 32px; top: 5px;}
diff --git a/module/story/css/create.css b/module/story/css/create.css
deleted file mode 100644
index 90c5b0f43a..0000000000
--- a/module/story/css/create.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.input-control.required:after {display: block; right: 29px; top: 5px;}
-#pri + .chosen-container > .chosen-single {border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;}
-
-.pri-selector > .btn {padding: 5px 8px !important; width: 100%;}
-.pri-selector > .dropdown-menu {padding: 10px;}
-
-#source_chosen {min-width: 50px !important;}
-#feedbackBox > .input-group + #notifyEmailLabel {position: relative; width: 50%; left: 48%}
-#product + .picker{min-width: 400px}
-#dataform .priBox, #dataform .estimateBox {width: 120px;}
-#dataform .categoryBox {width: 150px;}
-.needNotReviewBox {width: 130px; display: inline-block; padding: 7px;}
-.input-group-addon.assignedTo {min-width: 77px;}
-.input-group .source {display: flex; width: 50%;}
-.input-group .sourceNote {display: flex; width: 50%;}
-.source .input-group-addon, .sourceNote .input-group-addon {padding-top: 9px;}
-#sourceNoteBox {width: 80px;}
-#moduleIdBox .input-group-addon {min-width: 77px;}
-
-.btn.btn-action, .c-actions .btn {color: grey}
-#storyNoticeBranch {font-size: 13px; color: #5e626d;}
-#storyNoticeBranch i {font-size: 14px; color: #0075ff; margin-right: 3px;}
-
-.moduleBox .required:after {right: 25px;}
\ No newline at end of file
diff --git a/module/story/css/edit.css b/module/story/css/edit.css
deleted file mode 100644
index 995b2c80e0..0000000000
--- a/module/story/css/edit.css
+++ /dev/null
@@ -1,8 +0,0 @@
-#product_chosen .chosen-single {border-right-width: 1px}
-.linkStoryTitle {white-space: nowrap; text-overflow: ellipsis;}
-.linkStoryTd > ul {margin-top: -10px;}
-.titleBox {margin: 0px 10px 10px 10px;}
-.needNotReviewBox {width: 130px;}
-.needNotReviewBox span.input-group-addon {border: 1px solid #dcdcdc; border-left-width: 0px; width:130px;}
-#moduleIdBox .chosen-container, #planIdBox .chosen-container {min-width: unset;}
-#legendTwins .form-group {margin-top: 10px;}
diff --git a/module/story/css/linkstory.css b/module/story/css/linkstory.css
deleted file mode 100644
index 17e2033b52..0000000000
--- a/module/story/css/linkstory.css
+++ /dev/null
@@ -1 +0,0 @@
-#linkStoryForm {min-height: 300px;}
diff --git a/module/story/css/report.css b/module/story/css/report.css
deleted file mode 100644
index 3f6d52bed1..0000000000
--- a/module/story/css/report.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.table-bordered caption {border: 1px solid #ddd;}
-.table-bordered tr > th:first-child, .table-bordered tr > td:first-child {border-left: 1px solid #ddd !important;}
-.table-bordered tr > th:last-child, .table-bordered tr > td:last-child {border-right: 1px solid #ddd !important;}
-
-.panel-heading > strong > span {float: right; color: #29a8cd;}
-
-.checkboxes {margin-bottom: 10px;}
-.checkboxes .checkbox-primary {margin-bottom: 5px;}
diff --git a/module/story/css/submitreview.css b/module/story/css/submitreview.css
deleted file mode 100644
index b9ff94d49c..0000000000
--- a/module/story/css/submitreview.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.needNotReviewBox {width: 130px;}
-.needNotReviewBox span.input-group-addon {border: 1px solid #dcdcdc; border-left-width: 0px;}
-.table > tbody > tr > th {vertical-align: top; padding-top: 13px;}
diff --git a/module/story/css/tasks.css b/module/story/css/tasks.css
deleted file mode 100644
index 254f5276ee..0000000000
--- a/module/story/css/tasks.css
+++ /dev/null
@@ -1,4 +0,0 @@
-body {background: white;}
-.tasksList {padding: 10px;}
-.tasksList .table {border: 1px solid #ddd;}
-.c-id, .c-estiamte, .c-consumed, .c-left, .c-progress {width: 40px;}
diff --git a/module/story/css/view.css b/module/story/css/view.css
deleted file mode 100644
index ed538b7734..0000000000
--- a/module/story/css/view.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.side-col .cell {padding: 0px;}
-.side-col #legendProjectAndTask .list-unstyled {padding: 10px; border-top: 0px; margin: 0px;}
-#legendStories ul li {padding: 0px 0 0 12px; line-height: 20px; display: flex;}
-#legendStories ul li:last-child {display: block;}
-.main-actions .btn-toolbar .btn {padding-right: 6px; padding-left: 6px;}
-.btn-edit-comment {z-index: 100;}
-#legendRelated .table-data tbody>tr>th {width: 100px;}
-#legendStories .list-unstyled li a {padding: 6px;}
-#legendStories .list-unstyled li a:not(.removeButton) {overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
-[lang^='zh'] #legendStories .list-unstyled li:last-child {padding: 6px 12px;}
-.linkStoryTitle {white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
-.linkStoryTr > th {width: 90px;}
-.linkStoryTr > td {padding-left: 0px !important;}
-.resolution {white-space: nowrap; overflow: hidden;}
-.link-commit {overflow: hidden; white-space: nowrap; margin-right: 5px;}
diff --git a/module/story/js/batchclose.js b/module/story/js/batchclose.js
deleted file mode 100755
index 1eab4e0caa..0000000000
--- a/module/story/js/batchclose.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * Set duplicate field.
- *
- * @param string $resolution
- * @param int $storyID
- * @access public
- * @return void
- */
-function setDuplicateAndChild(resolution, storyID)
-{
- if(resolution == 'duplicate')
- {
- $('#childStoryBox' + storyID).hide();
- $('#duplicateStoryBox' + storyID).show();
- }
- else if(resolution == 'subdivided')
- {
- $('#duplicateStoryBox' + storyID).hide();
- $('#childStoryBox' + storyID).show();
- }
- else
- {
- $('#duplicateStoryBox' + storyID).hide();
- $('#childStoryBox' + storyID).hide();
- }
-}
-
-$(function()
-{
- $('td[id^="duplicateStoryBox"]').on('mouseenter', 'select[id^="duplicateStoryIDList"]', function()
- {
- var options = $(this).find('option').length;
- if(options <= 1)
- {
- var id = $(this).attr('id');
- var storyID = id.replace('duplicateStoryIDList', '');
- var link = createLink('story', 'ajaxGetDuplicatedStory', 'storyID=' + storyID);
- var that = $(this);
-
- $.get(link, function(data)
- {
- that.replaceWith(data);
- $("#duplicateStoryIDList" + storyID).picker(
- {
- disableEmptySearch : true,
- dropWidth : 'auto',
- onReady: function(event)
- {
- $(event.picker.$container).addClass('required');
- }
-
- });
- })
- }
- })
-});
diff --git a/module/story/js/batchcreate.js b/module/story/js/batchcreate.js
deleted file mode 100644
index 66e70dfda8..0000000000
--- a/module/story/js/batchcreate.js
+++ /dev/null
@@ -1,167 +0,0 @@
-$(function()
-{
- $name = $('#batchCreateForm table thead tr th.col-name');
- if($name.width() < 200) $name.width(200);
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-
- /* Implement a custom form without feeling refresh. */
- $('#formSettingForm .btn-primary').click(function()
- {
- saveCustomFields('batchCreateFields', 8, $name, 200);
- return false;
- });
-
- $('#saveButton').on('click', function()
- {
- $('#saveButton').attr('disabled', true);
- $('#saveDraftButton').attr('disabled', true);
- $('#batchCreateForm').submit();
- });
-
- $('#saveDraftButton').on('click', function()
- {
- $('#saveButton').attr('disabled', true);
- $('#saveDraftButton').attr('disabled', true);
- $('
').attr('type', 'hidden').attr('name', 'status').attr('value', 'draft').appendTo('#batchCreateForm');
- $('#batchCreateForm').submit();
- });
-});
-
-$(document).on('click', '.chosen-with-drop', function()
-{
- var select = $(this).prev('select');
- if($(select).val() == 'ditto')
- {
- var index = $(select).closest('td').index();
- var row = $(select).closest('tr').index();
- var table = $(select).closest('tr').parent();
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
- $(select).val(value);
- $(select).trigger("chosen:updated");
- }
-});
-$(document).on('mousedown', 'select', function()
-{
- if($(this).val() == 'ditto')
- {
- var index = $(this).closest('td').index();
- var row = $(this).closest('tr').index();
- var table = $(this).closest('tr').parent();
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
- $(this).val(value);
- }
-});
-
-/**
- * Set modules and plans.
- *
- * @param int $branchID
- * @param int $productID
- * @param int $num
- * @access public
- * @return void
- */
-function setModuleAndPlan(branchID, productID, num)
-{
- moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=story&branch=' + branchID + '&num=' + num);
- $.get(moduleLink, function(modules)
- {
- if(!modules) modules = '
';
- $('#module' + num).replaceWith(modules);
- $("#module" + num + "_chosen").remove();
- $("#module" + num).next('.picker').remove();
- $("#module" + num).chosen();
- });
-
- planLink = createLink('productPlan', 'ajaxGetProductPlans', 'productID=' + productID + '&branch=' + branchID + '&num=' + num + '&expired=unexpired');
- $.get(planLink, function(plans)
- {
- if(!plans) plans = '
';
- $('#plan' + num).replaceWith(plans);
- $("#plan" + num + "_chosen").remove();
- $("#plan" + num).next('.picker').remove();
- $("#plan" + num).chosen();
- });
-
- /* If the branch of the current row is inconsistent with the one below, clear the module and plan of the nex row. */
- var nextBranchID = $('#branch' + (num + 1)).val();
- if(nextBranchID != branchID)
- {
- $('#module' + (num + 1)).find("option[value='ditto']").remove();
- $('#module' + (num + 1)).trigger("chosen:updated");
-
- $('#plan' + (num + 1)).find("option[value='ditto']").remove();
- $('#plan' + (num + 1)).trigger("chosen:updated");
- }
-}
-
-/* Copy story title as story spec. */
-function copyTitle(num)
-{
- var title = $('#title\\[' + num + '\\]').val();
- $('#spec\\[' + num + '\\]').val(title);
-}
-
-$(document).on('change', "[name*='reviewer']", function()
-{
- toggleCheck($(this));
-})
-
-/**
- * Toggle checkbox.
- *
- * @param obj $obj
- * @access public
- * @return void
- */
-function toggleCheck(obj)
-{
- var $this = $(obj);
- var data = $this.val();
- var $ditto = $this.closest('div').find("input[name*='reviewDitto']");
- if(data == '')
- {
- $ditto.attr('checked', true);
- $ditto.closest('.input-group-addon').show();
- }
- else
- {
- $ditto.removeAttr('checked');
- $ditto.closest('.input-group-addon').hide();
- }
-}
-
-/**
- * Set lane.
- *
- * @param int $regionID
- * @param int $num
- * @access public
- * @return void
- */
-function setLane(regionID, num)
-{
- laneLink = createLink('kanban', 'ajaxGetLanes', 'regionID=' + regionID + '&type=story&field=lanes&i=' + num);
- $.get(laneLink, function(lanes)
- {
- if(!lanes) lanes = '
';
- $('#lanes' + num).replaceWith(lanes);
- $("#lanes" + num + "_chosen").remove();
- $("#lanes" + num).next('.picker').remove();
- $("#lanes" + num).chosen();
- });
-}
diff --git a/module/story/js/batchedit.js b/module/story/js/batchedit.js
deleted file mode 100644
index 7a16ff6e67..0000000000
--- a/module/story/js/batchedit.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * Set duplicate field.
- *
- * @param string $resolution
- * @param int $storyID
- * @access public
- * @return void
- */
-function setDuplicateAndChild(resolution, storyID)
-{
- if(resolution == 'duplicate')
- {
- $('#childStoryBox' + storyID).hide();
- $('#duplicateStoryBox' + storyID).show();
- }
- else if(resolution == 'subdivided')
- {
- $('#duplicateStoryBox' + storyID).hide();
- $('#childStoryBox' + storyID).show();
- }
- else
- {
- $('#duplicateStoryBox' + storyID).hide();
- $('#childStoryBox' + storyID).hide();
- }
-}
-
-function loadBranches(product, branch, storyID)
-{
- if(typeof(branch) == 'undefined') branch = 0;
- if(!branch) branch = 0;
-
- var currentModuleID = $('#modules' + storyID).val();
- moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + storyID + '&needManage=false&extra=nodeleted¤tModuleID=' + currentModuleID);
- $('#modules' + storyID).parent('td').load(moduleLink, function(){$('#modules' + storyID).chosen();});
-
- planID = $('#plans' + storyID).val();
- planLink = createLink('product', 'ajaxGetPlans', 'productID=' + product + '&branch=' + branch + '&planID=' + planID + '&fieldID=' + storyID + '&needCreate=false&expired=¶m=skipParent');
- $('#plans' + storyID).parent('td').load(planLink, function(){$('#plans' + storyID).chosen();});
-}
-
-$(function()
-{
- //Remove 'ditto' in first row.
- removeDitto();
-
- // Init bactch action form
- $('#batchEditForm').batchActionForm();
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-
- $('select[id^="duplicateStoryIDList"]').picker(
- {
- disableEmptySearch : true,
- dropWidth : 'auto'
- });
-});
-
-$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value.
-
-/* Set ditto value. */
-$(document).on('change', 'select', function()
-{
- if($(this).val() == 'ditto')
- {
- var index = $(this).closest('td').index();
- var row = $(this).closest('tr').index();
- var tbody = $(this).closest('tr').parent();
-
- if($(this).attr('name').indexOf('closedReasons') != -1)
- {
- index = $(this).closest('tr').closest('td').index();
- row = $(this).closest('tr').closest('td').parent().index();
- tbody = $(this).closest('tr').closest('td').parent().parent();
- }
-
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = tbody.children('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
-
- isModules = $(this).attr('name').indexOf('modules') != -1;
- isPlans = $(this).attr('name').indexOf('plans') != -1;
-
- if(isModules || isPlans)
- {
-
- var valueStr = ',' + $(this).find('option').map(function(){return $(this).val();}).get().join(',') + ',';
- if(valueStr.indexOf(',' + value + ',') != -1)
- {
- $(this).val(value);
- }
- else
- {
- alert(dittoNotice);
- $(this).val(oldValue);
- }
- }
- else
- {
- $(this).val(value);
- }
-
- $(this).trigger("chosen:updated");
- $(this).trigger("change");
- }
-});
diff --git a/module/story/js/batchtotask.js b/module/story/js/batchtotask.js
deleted file mode 100755
index d997c16b14..0000000000
--- a/module/story/js/batchtotask.js
+++ /dev/null
@@ -1,305 +0,0 @@
-$(document).on('change', "[name^='estStarted'], [name^='deadline']", function()
-{
- toggleCheck($(this));
-});
-
-/**
- * Set story related.
- *
- * @param int $num
- * @access public
- * @return void
- */
-function setStoryRelated(num)
-{
- setPreview(num);
-}
-
-/**
- * Toggle checkbox.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function toggleCheck(obj)
-{
- var $this = $(obj);
- var date = $this.val();
- var $ditto = $this.closest('div').find("input[type='checkBox']");
- if(date == '')
- {
- $ditto.attr('checked', true);
- $ditto.closest('.input-group-addon').show();
- }
- else
- {
- $ditto.removeAttr('checked');
- $ditto.closest('.input-group-addon').hide();
- }
-}
-
-/**
- * Set stories.
- *
- * @param int $moduleID
- * @param int $executionID
- * @param int $num
- * @access public
- * @return void
- */
-function setStories(moduleID, executionID, num)
-{
- var link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=all&moduleID=' + moduleID + '&storyID=0&num=' + num + '&type=short');
- $.get(link, function(stories)
- {
- var storyID = $('#story' + num).val();
- if(!stories) stories = '
';
- $('#story' + num).replaceWith(stories);
- if(num != 0 && (moduleID == 0 || moduleID == 'ditto')) $('#story' + num).append("
");
- $('#story' + num).val(storyID);
-
- var chosenWidth = $("#story" + num + "_chosen").css('max-width');
- $("#story" + num + "_chosen").remove();
- $("#story" + num).next('.picker').remove();
- $("#story" + num).chosen();
- $("#story" + num + "_chosen").width(chosenWidth).css('max-width', chosenWidth);
- });
-}
-
-/**
- * Copy story title.
- *
- * @param int $num
- * @access public
- * @return void
- */
-function copyStoryTitle(num)
-{
- var $story = $('#story' + num);
- var storyTitle = $story.find('option:selected').text();
- var storyValue = $story.find('option:selected').val();
- var begin = parseInt($story.closest('tr').children('.c-id').text()) - 2;
-
- if(storyValue === 'ditto')
- {
- for(var i = begin; i >= 0; i--)
- {
- var selectedValue = $('#tableBody tbody > tr').eq(i).find('select[name^="story"]').val();
- var selectedTitle = $('#tableBody tbody > tr').eq(i).find('select[name^="story"]').find('option:selected').text();
- if(selectedValue !== 'ditto')
- {
- storyTitle = selectedTitle;
- break;
- }
- }
- }
-
- var startPosition = storyTitle.indexOf(':') + 1;
- var endPosition = storyTitle.lastIndexOf('[');
- storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
-
- $('#name\\[' + num + '\\]').val(storyTitle);
-}
-
-/**
- * Set preview.
- *
- * @param int $num
- * @access public
- * @return void
- */
-function setPreview(num)
-{
- var storyID = $('#story' + num).val();
- if(storyID != 0 && storyID != 'ditto')
- {
- storyLink = createLink('story', 'view', "storyID=" + storyID, '', true);
- $('#preview' + num).removeAttr('disabled');
- $('#preview' + num).modalTrigger({type:'iframe'});
- $('#preview' + num).css('pointer-events', 'auto');
- $('#preview' + num).attr('href', storyLink);
- }
- else
- {
- storyLink = '#';
- $('#preview' + num).attr('disabled', true);
- $('#preview' + num).css('pointer-events', 'none');
- $('#preview' + num).attr('href', storyLink);
- }
-}
-
-/**
- * Mark story task.
- *
- * @access public
- * @return void
- */
-function markStoryTask()
-{
- $('select[name^="story"]').each(function()
- {
- var $select = $(this);
- $select.find('option').each(function()
- {
- var $option = $(this);
- var value = $option.attr('value');
- var tasksCount = storyTasks[value];
- $option.attr('data-data', value).toggleClass('has-task', !!(tasksCount && tasksCount !== '0'));
- });
- $select.trigger("chosen:updated");
- });
-
- var getStoriesHasTask = function()
- {
- var storiesHasTask = {};
- $('#tableBody tbody>tr').each(function()
- {
- var $tr = $(this);
- if ($tr.find('input[name^="name"]').val())
- {
- storiesHasTask[$tr.find('select[name^="story"]').val()] = true;
- }
- });
- return storiesHasTask;
- };
-
- $('#batchToTaskForm').on('chosen:showing_dropdown', 'select[name^="story"],.chosen-with-drop', function()
- {
- var storiesHasTask = getStoriesHasTask();
- var $container = $(this).closest('td').find('.chosen-container');
- setTimeout(function()
- {
- $container.find('.chosen-results>li').each(function()
- {
- var $li = $(this);
- $li.toggleClass('has-new-task', !!storiesHasTask[$li.data('data')]);
- });
- }, 100);
- });
-}
-
-$(document).on('chosen:showing_dropdown', 'select[name^="story"],.chosen-with-drop', function()
-{
- var select = $(this).closest('td').find('select');
- if($(select).val() == 'ditto')
- {
- var index = $(select).closest('td').index();
- var row = $(select).closest('tr').index();
- var table = $(select).closest('tr').parent();
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
- $(select).val(value);
- $(select).trigger("chosen:updated");
- $(select).trigger("change");
- }
-})
-
-$(document).on('mousedown', 'select', function()
-{
- if($(this).val() == 'ditto')
- {
- var index = $(this).closest('td').index();
- var row = $(this).closest('tr').index();
- var table = $(this).closest('tr').parent();
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
- $(this).val(value);
- }
-})
-
-$(function()
-{
- $('.chosen-container[id^=module]').width(chosenWidth);
- $('.chosen-container[id^=module]').css('max-width', chosenWidth);
-
- var chosenWidth = $('#story1_chosen').width();
- $('.chosen-container[id^=story]').width(chosenWidth);
- $('.chosen-container[id^=story]').css('max-width', chosenWidth);
-
- markStoryTask();
-
- $(document).keydown(function(event)
- {
- if(event.ctrlKey && event.keyCode == 38)
- {
- event.stopPropagation();
- event.preventDefault();
- selectFocusJump('up');
- }
- else if(event.ctrlKey && event.keyCode == 40)
- {
- event.stopPropagation();
- event.preventDefault();
- selectFocusJump('down');
- }
- else if(event.keyCode == 38)
- {
- inputFocusJump('up');
- }
- else if(event.keyCode == 40)
- {
- inputFocusJump('down');
- }
- });
-});
-
-/**
- * Add row.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addRow(obj)
-{
- var row = $('#addRow').html().replace(/%i%/g, rowIndex + 1);
- $('
' + row + '
').insertAfter($(obj).closest('tr'));
-
- var $beginRow = $row = $(obj).closest('tr').next();
-
- $row.find(".form-date").datepicker();
- $row.find("input[name^=color]").colorPicker();
- $row.find('div[id$=_chosen]').remove();
- $row.find('.picker').remove();
- $row.find('.chosen').chosen();
- $row.find('.picker-select').picker();
-
- var begin = parseInt($(obj).parent().siblings('.c-id').text()) + 1;
- var count = $('#tableBody tbody > tr').length;
- for(var i = begin; i <= count; i++)
- {
- $beginRow.children('.c-id').text(i);
- $beginRow = $beginRow.next();
- }
- rowIndex ++;
-}
-
-/**
- * Delete row.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function deleteRow(obj)
-{
- var $beginRow = $(obj).closest('tr').next();
- var begin = parseInt($(obj).parent().siblings('.c-id').text());
- var count = $('#tableBody tbody > tr').length;
- for(var i = begin; i <= count; i++)
- {
- $beginRow.children('.c-id').text(i);
- $beginRow = $beginRow.next();
- }
-
- $(obj).closest('tr').remove();
-}
diff --git a/module/story/js/change.js b/module/story/js/change.js
deleted file mode 100644
index dd48d70c1f..0000000000
--- a/module/story/js/change.js
+++ /dev/null
@@ -1,19 +0,0 @@
-$(function()
-{
- $('[data-toggle="tooltip"]').tooltip();
- $('#needNotReview').on('change', function()
- {
- $('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
- if($(this).is(':checked'))
- {
- $('.input-group-addon').removeClass('required');
- }
- else
- {
- $('.input-group-addon').addClass('required');
- }
- });
- if(!$('#reviewer').val()) $('#needNotReview').change();
-
- if($('.tabs .tab-content .tab-pane.active').children().length == 0) $('.tabs .nav-tabs li.active').css('border-bottom', '1px solid #ccc');
-});
diff --git a/module/story/js/close.js b/module/story/js/close.js
deleted file mode 100644
index b14bff76a6..0000000000
--- a/module/story/js/close.js
+++ /dev/null
@@ -1,29 +0,0 @@
-function setStory(reason)
-{
- if(reason == 'duplicate')
- {
- $('#duplicateStoryBox').show();
- $('#childStoriesBox').hide();
- }
- else if(reason == 'subdivided')
- {
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').show();
- }
- else
- {
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').hide();
- }
-}
-
-$(function()
-{
- $('#duplicateStory').picker(
- {
- disableEmptySearch : true,
- dropWidth : 'auto'
- });
-
- $('[data-toggle="popover"]').popover();
-});
diff --git a/module/story/js/create.js b/module/story/js/create.js
deleted file mode 100644
index 939934970a..0000000000
--- a/module/story/js/create.js
+++ /dev/null
@@ -1,348 +0,0 @@
-$(function()
-{
- $('#needNotReview').on('change', function()
- {
- $('#reviewer').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
-
- if($(this).is(':checked'))
- {
- $('#reviewerBox').closest('tr').addClass('hidden');
- $('#reviewerBox').removeClass('required');
- $('#dataform #needNotReview').val(1);
- }
- else
- {
- $('#reviewerBox').closest('tr').removeClass('hidden');
- $('#reviewerBox').addClass('required');
- $('#dataform #needNotReview').val(0);
- }
-
- getStatus('create', "product=" + $('#product').val() + ",execution=" + executionID + ",needNotReview=" + ($(this).prop('checked') ? 1 : 0));
- });
- $('#needNotReview').change();
-
- // init pri selector
- $('#pri').on('change', function()
- {
- var $select = $(this);
- var $selector = $select.closest('.pri-selector');
- var value = $select.val();
- $selector.find('.pri-text').html('
' + value + '');
- });
-
- $('#source').on('change', function()
- {
- if(storyType == 'requirement') return false;
-
- var source = $(this).val();
- if($.inArray(source, feedbackSource) != -1)
- {
- $('#feedbackBox').removeClass('hidden');
- $('#source, #sourceNoteBox').closest('td').attr('colspan', 1);
- }
- else
- {
- $('#feedbackBox').addClass('hidden');
- $('#source, #sourceNoteBox').closest('td').attr('colspan', 2);
- }
- });
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-
- /* Implement a custom form without feeling refresh. */
- $('#formSettingForm .btn-primary').click(function()
- {
- saveCustomFields('createFields');
- return false;
- });
-
- $('#product').on('change', function(){
- var productID = $('#product').val();
- var viewLink = createLink('story', 'create', 'productID=' + productID + '&branch=all');
- self.location.href = viewLink;
- });
-
- $('#module').on('change', function(){
- loadURS();
- });
-
- if($(".table-form select[id^='branches']").length == $('.switchBranch #branchBox option').length)
- {
- $('.table-col .icon-plus').parent().css('pointer-events', 'none')
- $('.table-col .icon-plus').parent().addClass('disabled')
- }
-
- $.get(createLink('product', 'ajaxGetProductById', "productID=" + $('#product').val()), function(data)
- {
- $.cookie('branchSourceName', data.branchSourceName)
- $.cookie('branchName', data.branchName)
- }, 'json')
-});
-
-/**
- * Load assignedTo.
- *
- * @access public
- * @return void
- */
-function loadAssignedTo()
-{
- var assignees = $('#reviewer').val();
- var link = createLink('story', 'ajaxGetAssignedTo', 'type=create&storyID=0&assignees=' + assignees);
- $.post(link, function(data)
- {
- $('#assignedTo').replaceWith(data);
- $('#assignedToBox .picker').remove();
- $('#assignedTo').picker();
- });
-}
-
-function refreshPlan()
-{
- loadProductPlans($('#product').val(), $('#branch').val());
-}
-
-/**
- * Set lane.
- *
- * @param int $regionID
- * @access public
- * @return void
- */
-function setLane(regionID)
-{
- laneLink = createLink('kanban', 'ajaxGetLanes', 'regionID=' + regionID + '&type=story&field=lane');
- $.get(laneLink, function(lane)
- {
- if(!lane) lane = "
";
- $('#lane').replaceWith(lane);
- $('#lane' + "_chosen").remove();
- $('#lane').next('.picker').remove();
- $('#lane').chosen();
- });
-}
-
-$(window).unload(function(){
- if(blockID) window.parent.refreshBlock($('#block' + blockID));
-});
-
-/**
- * Add branch box.
- *
- * @param obj $obj
- * @access public
- * @return void
- */
- function addBranchesBox(obj)
- {
- $('#storyNoticeBranch').closest('tr').removeClass('hidden');
- if($(".table-form select[id^='branches']").length == $('.switchBranch #branchBox option').length) return false;
-
- var selectedVal = [];
- $(".table-form select[id^='branches']").each(function()
- {
- var selectedProduct = $(this).val();
- if($.inArray(selectedProduct, selectedVal) < 0) selectedVal.push(selectedProduct);
- });
-
- var branch = 0;
- $('.table-form #branches0 option').each(function(){
- if($.inArray($(this).val(), selectedVal) < 0)
- {
- branch = $(this).val();
- return false;
- }
- });
-
- var item = $('#addBranchesBox').html().replace(/%i%/g, itemIndex);
- $(obj).closest('tr').after('
' + item + '
');
- $('#branches_i__chosen').remove();
- $('#branches' + itemIndex).chosen();
- $('#modules_i__chosen').remove();
- $('#modules' + itemIndex).chosen();
- $('#plans_i__chosen').remove();
- $('#plans' + itemIndex).chosen();
- $('.addBranchesBox' + itemIndex + ' #planIdBox').css('flex', '0 0 ' + gap + 'px');
-
- $.ajaxSettings.async = false;
- loadBranchForTwins($('#product').val(), branch, itemIndex)
- loadModuleForTwins($('#product').val(), branch, itemIndex)
- loadPlanForTwins($('#product').val(), branch, itemIndex)
- $.ajaxSettings.async = true;
- $('.addBranchesBox' + itemIndex + ' #branchBox .input-group .input-group-addon').html($.cookie('branchSourceName'))
-
- disableSelectedBranches();
-
- if($(".table-form select[id^='branches']").length == $('.switchBranch #branchBox option').length)
- {
- $('.table-col .icon-plus').parent().css('pointer-events', 'none')
- $('.table-col .icon-plus').parent().addClass('disabled')
- }
-
- if(requiredFields.indexOf('module') > 0) $('#modules' + itemIndex + '_chosen').addClass('required')
-
- itemIndex ++;
- }
-
- /**
- * Delete branch box.
- *
- * @param obj $obj
- * @access public
- * @return void
- */
- function deleteBranchesBox(obj)
- {
- $(obj).closest('tr').remove();
-
- disableSelectedBranches();
-
- $('.icon-plus').parent().css('pointer-events', 'auto')
- $('.icon-plus').parent().removeClass('disabled')
- if($('select[name^="branches"]').length == 2) $('#storyNoticeBranch').closest('tr').addClass('hidden');
- }
-
- /**
- * Make the selected branch non clickable.
- *
- * @return void
- */
-function disableSelectedBranches()
-{
- $(".table-form select[id^='branches'] option[disabled='disabled']").removeAttr('disabled');
-
- var selectedVal = [];
- $(".table-form select[id^='branches']").each(function()
- {
- var selectedBranch = $(this).val();
- if($.inArray(selectedBranch, selectedVal) < 0) selectedVal.push(selectedBranch);
- })
-
- $(".table-form select[id^='branches']").each(function()
- {
- var selectedBranch = $(this).val();
- $(this).find('option').each(function()
- {
- var optionVal = $(this).attr('value');
- if(optionVal != selectedBranch && $.inArray(optionVal, selectedVal) >= 0) $(this).attr('disabled', 'disabled');
- })
- })
-
- $(".table-form select[id^=branches]").trigger('chosen:updated');
-}
-
- /**
- * Load branch for multi branch or multi platform.
- *
- * @param int $branch
- * @param int $branchIndex
- * @access public
- * @return void
- */
-function loadBranchRelation(branch, branchIndex)
-{
- var productID = $('#product').val();
- if(typeof(branch) == 'undefined') branch = 0;
-
- $.ajaxSettings.async = false;
- loadModuleForTwins(productID, branch, branchIndex)
- loadPlanForTwins(productID, branch, branchIndex)
- $.ajaxSettings.async = true;
-
- disableSelectedBranches()
-}
-
-/**
- * Load branch for twins.
- *
- * @paran int $procutID
- * @param int $branch
- * @param int $branchIndex
- * @access public
- * @return void
- */
-function loadBranchForTwins(productID, branch, branchIndex)
-{
- var isTwins = storyType == 'story' ? 'yes' : 'no';
- $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID + "&oldBranch=" + branch + "¶m=active&projectID=" + executionID + "&withMainBranch=1&isTwins=" + isTwins + "&fieldID=" + branchIndex), function(data)
- {
- if(data)
- {
- /* reload branch */
- $('#branches' + branchIndex).replaceWith(data);
- $('#branches' + branchIndex + "_chosen").remove();
- $('#branches' + branchIndex).next('.picker').remove();
- $('#branches' + branchIndex).chosen();
- }
- })
-}
-
-/**
- * Load module for twins.
- *
- * @paran int $procutID
- * @param int $branch
- * @param int $branchIndex
- * @access public
- * @return void
- */
-function loadModuleForTwins(productID, branch, branchIndex)
-{
- /* Load module */
- var currentModule = 0;
- var moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + branchIndex + '&needManage=false&extra=nodeleted¤tModuleID=' + currentModule);
- if(branchIndex > 0)
- {
- var $moduleIDBox = $('.addBranchesBox'+ branchIndex +' #moduleIdBox');
- }
- else
- {
- var $moduleIDBox = $('.switchBranch #moduleIdBox');
- }
- $moduleIDBox.load(moduleLink, function()
- {
- $moduleIDBox.find('#modules' + branchIndex).chosen();
- if(branchIndex == 0)
- {
- $('.switchBranch #moduleIdBox > span:first-child').remove()
- }
- $moduleIDBox.prepend("
" + storyModule + "" );
-
- $moduleIDBox.fixInputGroup();
- });
-
- if(requiredFields.indexOf('module') > 0) $('#moduleIdBox #modules' + branchIndex + '_chosen').addClass('required')
-}
-
-/**
- * Load plan for twins.
- *
- * @paran int $procutID
- * @param int $branch
- * @param int $branchIndex
- * @access public
- * @return void
- */
-function loadPlanForTwins(productID, branch, branchIndex)
-{
- /* Load plan */
- if(branch == '0') branch = '';
- planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=0&fieldID=' + branchIndex + '&needCreate=false&expired=unexpired¶m=skipParent,forStory,' + config.currentMethod);
- if(branchIndex > 0)
- {
- var $planIdBox = $('.addBranchesBox'+ branchIndex +' #planIdBox');
- }
- else
- {
- var $planIdBox = $('#planIdBox');
- }
- $planIdBox.load(planLink, function()
- {
- $planIdBox.find('#plans' + branchIndex).chosen();
- $planIdBox.prepend("
" + storyPlan + "");
- $planIdBox.fixInputGroup();
- });
-}
diff --git a/module/story/js/edit.js b/module/story/js/edit.js
deleted file mode 100644
index a5f7462886..0000000000
--- a/module/story/js/edit.js
+++ /dev/null
@@ -1,103 +0,0 @@
-$(function()
-{
- $('[data-toggle="tooltip"]').tooltip();
- $('.main-side #branch').closest('td').find('#product_chosen .chosen-single').css('width', '153px');
-
- if(storyStatus == 'reviewing')
- {
- $('#reviewer').next().find('.picker-selection').each(function()
- {
- if(reviewedReviewer.indexOf($(this).find('span').text()) != -1) $(this).css('pointer-events', 'none');
- });
-
- $('#reviewer').change(function()
- {
- if($('#reviewer').next().find('.picker-selection').length === 0)
- {
- alert(reviewerNotEmpty);
- $('#reviewer').val(reviewers);
- $('#reviewer').trigger('chosen:updated');
- }
- else
- {
- reviewers = $('#reviewer').val();
- }
- });
- }
- else
- {
- $('#reviewer').change(function()
- {
- if(!$('#reviewer').val()) $('#needNotReview').attr('checked', true).change();
- });
- }
-
- $('#needNotReview').on('change', function()
- {
- $('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
- if($(this).is(':checked'))
- {
- $('#reviewerBox').removeClass('required');
- }
- else
- {
- $('#reviewerBox').addClass('required');
- }
- });
- if(!$('#reviewer').val()) $('#needNotReview').change();
-
- $('#source').on('change', function()
- {
- var source = $(this).val();
- if($.inArray(source, feedbackSource) != -1)
- {
- $('.feedbackBox').removeClass('hidden');
- }
- else
- {
- $('.feedbackBox').addClass('hidden');
- }
- });
-
- $('#linkStoriesLink').click(function()
- {
- var storyIdList = '';
- $('#linkStoriesBox input').each(function()
- {
- storyIdList += $(this).val() + ',';
- });
-
- var link = '';
- if(storyType == 'story')
- {
- link = createLink('story', 'linkStories', 'storyID=' + storyID + '&browseType=&excludeStories=' + storyIdList, '', true);
- }
- else
- {
- link = createLink('story', 'linkRequirements', 'storyID=' + storyID + '&browseType=&excludeStories=' + storyIdList, '', true);
- }
-
- var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '95%', url: link});
- modalTrigger.show();
- });
-
- if($('#duplicateStory').length > 0)
- {
- $('#duplicateStory').picker(
- {
- disableEmptySearch : true,
- dropWidth : 'auto',
- maxAutoDropWidth : document.body.scrollWidth + document.getElementById('duplicateStory').offsetWidth - document.getElementById('duplicateStoryBox').getBoundingClientRect().right
- });
- }
-
- $('#planIdBox').click(function()
- {
- $('#planIdBox .chosen-container').find('div').css('width', $('#planIdBox').width())
- });
-
- $('#parent_chosen').click(function()
- {
- $('#parent_chosen').find('div').css('width', $('#parent_chosen').width())
- });
-})
diff --git a/module/story/js/report.js b/module/story/js/report.js
deleted file mode 100644
index 5e8eff033b..0000000000
--- a/module/story/js/report.js
+++ /dev/null
@@ -1,19 +0,0 @@
-$(function()
-{
- var resizeChartTable = function()
- {
- $('.table-wrapper').each(function()
- {
- var $this = $(this);
- $this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight());
- });
- };
- resizeChartTable();
- $(window).resize(resizeChartTable);
-});
-
-function changeChartType(type)
-{
- $('form').attr('action', createLink('story', 'report', 'productID=' + productID + '&branchID=' + branchID + '&storyType=' + storyType + '&browseType=' + browseType + '&moduleID=' + moduleID + '&chartType=' + type + '&projectID=' + projectID));
- $('form').find('#submit').click();
-}
diff --git a/module/story/js/review.js b/module/story/js/review.js
deleted file mode 100644
index 6bd75b9034..0000000000
--- a/module/story/js/review.js
+++ /dev/null
@@ -1,83 +0,0 @@
-function switchShow(result)
-{
- $('#priBox').hide();
- $('#estimateBox').hide();
- if(result == 'reject')
- {
- $('#rejectedReasonBox').show();
- $('#preVersionBox').hide();
- $('#assignedToBox').hide();
- }
- else if(result == 'revert')
- {
- $('#preVersionBox').show();
- $('#rejectedReasonBox').hide();
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').hide();
- if(isLastOne) $('#assignedToBox').show();
- }
- else if(result == 'clarify')
- {
- $('#preVersionBox').hide();
- $('#rejectedReasonBox').hide();
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').hide();
- $('#rejectedReasonBox').hide();
- if(isLastOne) $('#assignedToBox').show();
- }
- else
- {
- $('#preVersionBox').hide();
- $('#rejectedReasonBox').hide();
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').hide();
- $('#rejectedReasonBox').hide();
- if(isLastOne) $('#assignedToBox').show();
- if(result == 'pass')
- {
- $('#priBox').show();
- $('#estimateBox').show();
- }
- }
-}
-
-function setStory(reason)
-{
- if(reason == 'duplicate')
- {
- $('#duplicateStoryBox').show();
- $('#childStoriesBox').hide();
- }
- else if(reason == 'subdivided')
- {
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').show();
- }
- else
- {
- $('#duplicateStoryBox').hide();
- $('#childStoriesBox').hide();
- }
-}
-
-/**
- * Load assignedTo.
- *
- * @access public
- * @return void
- */
-function loadAssignedTo()
-{
- var link = createLink('story', 'ajaxGetAssignedTo', 'type=review&storyID=' + storyID);
- $.post(link, function(data)
- {
- $('#assignedTo').replaceWith(data);
- $('#assignedToBox .picker').remove();
- $('#assignedTo').picker();
- });
-}
-
-$(function()
-{
- if($('.tabs .tab-content .tab-pane.active').children().length == 0) $('.tabs .nav-tabs li.active').css('border-bottom', '1px solid #ccc');
-})
diff --git a/module/story/js/submitreview.js b/module/story/js/submitreview.js
deleted file mode 100644
index ec36e4121d..0000000000
--- a/module/story/js/submitreview.js
+++ /dev/null
@@ -1,16 +0,0 @@
-$(function()
-{
- $('#needNotReview').on('change', function()
- {
- $('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
- if($(this).is(':checked'))
- {
- $('#reviewerBox').removeClass('required');
- }
- else
- {
- $('#reviewerBox').addClass('required');
- }
- });
- if(!$('#reviewer').val()) $('#needNotReview').change();
-});
diff --git a/module/story/js/view.js b/module/story/js/view.js
deleted file mode 100644
index 96aff26267..0000000000
--- a/module/story/js/view.js
+++ /dev/null
@@ -1,27 +0,0 @@
-$(function()
-{
- if(canCreate)
- {
- var createStoryLink = createLink('story', 'create', 'productID=' + productID + "&branch=" + branch + '&moduleID=' + moduleID);
- $('#modulemenu ul.nav li.right:first').before("
" + createStory + "");
- }
-
- /* Add for task #5385. */
- if(config.onlybody == 'yes') $('.main-actions').css('width', '100%')
-
- $('.legendStories').mouseover(function()
- {
- $(this).parent('ul').find('a.removeButton').addClass('hide');
- $(this).find('.removeButton').removeClass('hide');
- });
-
- $('.legendStories').mouseout(function()
- {
- $(this).find('.removeButton').addClass('hide');
- });
-
- $('#legendStories').find('.removeButton').click(function()
- {
- $(this).closest('li').remove();
- })
-});
diff --git a/module/system/css/dblist.css b/module/system/css/dblist.css
deleted file mode 100644
index f6f3b660e3..0000000000
--- a/module/system/css/dblist.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#mainContent .table {margin: auto;width: 60%; min-width:400px; max-width: 800px;}
-#mainContent .main-header {margin-bottom: 20px;}
-#mainContent .main-header h2{font-size: 18px;}
diff --git a/module/system/css/editdomain.css b/module/system/css/editdomain.css
deleted file mode 100644
index 1f7c85f630..0000000000
--- a/module/system/css/editdomain.css
+++ /dev/null
@@ -1 +0,0 @@
-table tr th.new-domain-label{vertical-align: top; padding-top: 14px;}
diff --git a/module/system/css/index.css b/module/system/css/index.css
deleted file mode 100644
index bb3b7523c8..0000000000
--- a/module/system/css/index.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.plug-container > div{margin-bottom: 20px;}
-.plug-container a {display: inline-block; width: 150px;}
-.plug-container a:hover { text-decoration: none; box-shadow: 0 1px 5px rgb(0 0 0 / 18%);}
-.logo { display: inline-block; padding: 10px;}
-.logo .icon {font-size: 100px; color: #70c0fb;}
-.logo img {width: 100px; height:100px;}
-.plug-title {display: inline-block; padding-top: 10px; text-align: center; font-size: 16px; font-weight: 500;}
diff --git a/module/system/css/ossview.css b/module/system/css/ossview.css
deleted file mode 100644
index 5c80d0a5d5..0000000000
--- a/module/system/css/ossview.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.btn.label-lg.label-outline {background-color: #ffffff!important;}
-.btn.label-lg.label-outline:hover, .btn-visit.btn:focus {background-color: #e5fbf3!important;}
-input#ossPassword {border:none;}
-input#ossSK{border:none;}
-
diff --git a/module/system/js/dblist.js b/module/system/js/dblist.js
deleted file mode 100644
index 3b5f658b31..0000000000
--- a/module/system/js/dblist.js
+++ /dev/null
@@ -1,22 +0,0 @@
-$(function()
-{
- $('button.db-login').on('click', function(event)
- {
- var dbName = $(event.target).data('db-name');
- var dbType = $(event.target).data('db-type');
- var namespace = $(event.target).data('namespace');
-
- $.post(createLink('system', 'ajaxDBAuthUrl'), {dbName, namespace, dbType}).done(function(res)
- {
- var response = JSON.parse(res);
- if(response.result == 'success')
- {
- window.parent.open(response.data.url, 'Adminer');
- }
- else
- {
- bootbox.alert(response.message);
- }
- });
- });
-});
diff --git a/module/system/js/editdomain.js b/module/system/js/editdomain.js
deleted file mode 100644
index 39651e41bc..0000000000
--- a/module/system/js/editdomain.js
+++ /dev/null
@@ -1,143 +0,0 @@
-$(function()
-{
- /**
- * Fresh submitBtn status.
- *
- * @access public
- * @return void
- */
- function freshSubmitBtn()
- {
- if($('#httpstrue:checked').length == 0)
- {
- $('#submitBtn').attr('disabled', false);
- return;
- }
- var pass = $('#validateCertBtn').attr('pass') == 'true';
- if(pass)
- {
- $('#submitBtn').attr('disabled', false);
- }
- else
- {
- $('#submitBtn').attr('disabled', true);
- }
- }
-
- freshSubmitBtn();
-
- /**
- * Toggle certificate textarea.
- *
- * @access public
- * @return void
- */
- function toggleCertBox()
- {
- $showCert = $("#httpstrue[type=checkbox]:checked").length > 0;
- if($showCert)
- {
- $('#cert-box').show();
- }
- else
- {
- $('#cert-box').hide();
- }
-
- freshSubmitBtn();
- }
-
- toggleCertBox();
-
- $("#httpstrue[type=checkbox]").on('change', function()
- {
- toggleCertBox();
- });
-
- $('#validateCertBtn').on('click', function()
- {
- var certData = {};
- certData.customDomain = $('#customDomain').val();
- certData.certPem = $('#certPem').val();
- certData.certKey = $('#certKey').val();
- $.post(createLink('system', 'ajaxValidateCert'), certData).done(function(response)
- {
- var res = JSON.parse(response);
- if(res.result == 'success')
- {
- $('#validateCertBtn').attr('pass', 'true');
- $('#validateMsg').removeClass('text-red').addClass('text-green');
- $('#validateMsg').html(res.message);
- }
- else
- {
- $('#validateCertBtn').attr('pass', 'false');
- $('#validateMsg').removeClass('text-green').addClass('text-red');
- var errMessage = res.message;
- if(res.message instanceof Array) errMessage = res.message.join(' ');
- if(res.message instanceof Object) errMessage = Object.values(res.message).join(' ');
-
- $('#validateMsg').html(errMessage);
- }
- freshSubmitBtn();
- });
- });
-
- var timerID = 0;
-
- /**
- * Show progress modal and fresh progress of updating domain by ajax.
- *
- * @access public
- * @return void
- */
- function showProgressModal()
- {
- $('#waiting').modal('show');
- timerID = setInterval(function()
- {
- $.get(createLink('system', 'ajaxUpdatingDomainProgress'), function(data)
- {
- $('#waiting #message').html(data);
- });
- }, 1000);
- };
-
- $('#submitBtn').on('click', function()
- {
- bootbox.confirm(notices.confirmUpdateDomain, function(result)
- {
- if(!result) return;
-
- showProgressModal();
- $('#submitBtn').attr('disabled', true);
-
- var domainData = $('#domainForm').serializeArray();
- $.post(createLink('system', 'editDomain'), domainData).done(function(response)
- {
- $('#submitBtn').attr('disabled', false);
-
- var res = JSON.parse(response);
- if(res.result == 'success')
- {
- parent.window.location.href = res.locate;
- }
- else
- {
- $('#waiting').modal('hide');
- clearInterval(timerID);
-
- var errMessage = res.message;
- if(res.message instanceof Array) errMessage = res.message.join('
');
- if(res.message instanceof Object) errMessage = Object.values(res.message).join('
');
-
- bootbox.alert(
- {
- title: notices.fail,
- message: errMessage,
- });
- }
- });
- });
- });
-});
diff --git a/module/system/js/ossview.js b/module/system/js/ossview.js
deleted file mode 100644
index 66c388bc8c..0000000000
--- a/module/system/js/ossview.js
+++ /dev/null
@@ -1,33 +0,0 @@
-$(function()
-{
- $('#ossManage').on('click', function(event)
- {
- $.get(createLink('system', 'ajaxOssInfo'), function(response)
- {
- let res = JSON.parse(response);
- if(res.result == 'success')
- {
- $('#ossAdmin').text(res.data.account.username);
- $('#ossPassword').val(res.data.account.password);
- $('#ossVisitUrl').attr('href', res.data.url);
- $('#ossAccountModal').modal('show');
- }
- });
- });
-
- $('#copySKBtn').on('click', function(event)
- {
- $('#ossSK').removeClass('hidden').select();
- document.execCommand('copy');
- $('#ossSK').addClass('hidden');
- bootbox.alert(copySuccess);
- });
-
- $('#copyPassBtn').on('click', function(event)
- {
- $('#ossPassword').removeClass('hidden').select();
- document.execCommand('copy');
- $('#ossPassword').addClass('hidden');
- bootbox.alert(copySuccess);
- });
-});
diff --git a/module/task/css/activate.css b/module/task/css/activate.css
deleted file mode 100644
index 625732b820..0000000000
--- a/module/task/css/activate.css
+++ /dev/null
@@ -1 +0,0 @@
-#taskTeamEditor tr .input-control {display: inline-block; width: 130px;}
diff --git a/module/task/css/batchcreate.css b/module/task/css/batchcreate.css
deleted file mode 100644
index b6946f5a72..0000000000
--- a/module/task/css/batchcreate.css
+++ /dev/null
@@ -1,34 +0,0 @@
-.chosen-container[id^="story"] {width: 200px; max-width: 150px;}
-select[id^="story"] + .picker-single {width: 130px; max-width: 130px;}
-[id^=name] {min-width: 165px;}
-#mainContent .main-header h2 {max-width: 300px;}
-
-#batchCreateForm .input-group,
-#batchCreateForm .input-group .form-control {position: static;}
-#batchCreateForm .input-group .colorpicker {z-index: 2;}
-#batchCreateForm .input-group .colorpicker.open {z-index: 5;}
-
-.main-header .pull-left {max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-
-#zeroTaskStory {margin: 0 0 0 20px; height: 32px; padding: 5px 5px 5px 5px; border-radius: 3px; border: 2px solid transparent;}
-[lang^='en'] #zeroTaskStory {max-width: 210px !important;}
-[lang^='de'] #zeroTaskStory {max-width: 225px !important;}
-[lang^='fr'] #zeroTaskStory {max-width: 265px !important;}
-#zeroTaskStory > label:before {top: 7px; left: 5px;}
-#zeroTaskStory > label:after {top: 7px; left: 5px;}
-#zeroTaskStory.checked {border-color: #00a9fc; background: #E9F2FB;}
-
-.chosen-results > li.has-task,
-.chosen-results > li.has-new-task {position: relative; color: #388E3C;}
-.chosen-results > li.has-task.highlighted,
-.chosen-results > li.has-new-task.highlighted {color: #fff;}
-
-#importLinesModal .modal-dialog {width: 80%;}
-
-.c-id {width: 30px;}
-.c-name, .c-desc {width: 150px;}
-.c-story {width: 200px;}
-.c-assigned {width: 130px;}
-.c-date {width: 120px;}
-.c-pri {width: 80px;}
-.c-actions {width: 60px;}
diff --git a/module/task/css/batchedit.css b/module/task/css/batchedit.css
deleted file mode 100644
index 10b92da7ed..0000000000
--- a/module/task/css/batchedit.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.c-id {width: 50px;}
-.c-pri, .c-record, .c-left {width: 70px;}
-.c-reason {width: 100px;}
-.c-module, .c-assigned, .c-name {width: 150px;}
diff --git a/module/task/css/create.css b/module/task/css/create.css
deleted file mode 100644
index 6a3495d46d..0000000000
--- a/module/task/css/create.css
+++ /dev/null
@@ -1,33 +0,0 @@
-#copyButton {width: 80px; background-color: #f1f1f1; opacity: 1;} /* Adjust for task #4151; */
-
-.title-group.required:after {display: none;}
-.title-group.required > .required:after {display: block; right: 29px; top: 5px;}
-#copyStory-input:after {display: block; right: 110px; top: 5px;}
-#pri + .chosen-container > .chosen-single {border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;}
-
-.pri-selector > .btn {padding: 5px 8px !important; width: 100%;}
-.pri-selector > .dropdown-menu {padding: 10px;}
-
-#testStoryBox table tr td {padding: 0px;}
-#testStoryBox table tr td .chosen-container .chosen-single {border: 0px;}
-#testStoryBox table tr td .chosen-compact.chosen-container-single .chosen-single>.chosen-search {top: 0; right: 0; left: 0;}
-#testStoryBox table tr td input {border: 0px;}
-#testStoryBox table tr td .input-group .input-group-addon {border-left: 1px solid #dcdcdc; border-right: 1px solid #dcdcdc;}
-#testStoryBox table button.btn {border: 0px;}
-#testStoryBox .c-name {width: 120px;}
-#testStoryBox .c-pri, #testStoryBox .c-estimate, #testStoryBox .c-actions {width: 70px;}
-#testStoryBox .c-date {width: 140px;}
-#testStoryBox .c-assignedTo {width: 100px; padding: 7px;}
-
-.chosen-results > li.has-test,
-.chosen-results > li.has-new-test {position: relative; color: #388E3C;}
-.chosen-results > li.has-test.highlighted,
-.chosen-results > li.has-new-test.highlighted {color: #fff;}
-
-.c-modulel {width: 110px;}
-
-.keep-row-height {height: 32px;}
-#modalTeam .modal-dialog {min-height: 120px; width: 570px; color: #3c4353;}
-#taskTeamEditor .hourBox {padding-bottom: 7px; width: 135px;}
-#taskTeamEditor .estimateBox {width: 120px;}
-#modalTeam .modal-content {padding: 0;}
diff --git a/module/task/css/edit.css b/module/task/css/edit.css
deleted file mode 100644
index 5492e1306d..0000000000
--- a/module/task/css/edit.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.pl-10px {padding-left: 10px;}
-#showAllModuleBox{width:60px;}
-#showAllModuleBox .no-margin {padding-left:22px;}
-#taskTeamEditor .sortable .input-group .input-group-addon.required:after {top: 10px; right: 2px; z-index: 3;}
-#storyIdBox .chosen-container .chosen-drop.chosen-no-wrap>.chosen-results>li {text-overflow: unset;}
-
-#modalTeam .modal-content {padding: 20px 13px 0; height: 340px;max-height: 296px!important; overflow-y: scroll!important;}
-#taskTeamEditor tr .input-control {display: inline-block; width: 130px;}
-#taskTeamEditor h2 {margin-top:0;}
diff --git a/module/task/css/recordworkhour.css b/module/task/css/recordworkhour.css
deleted file mode 100644
index 25471e66cf..0000000000
--- a/module/task/css/recordworkhour.css
+++ /dev/null
@@ -1,27 +0,0 @@
-#mainContent {min-height: 500px;}
-.table-recorded thead{background: rgb(245 245 245);}
-.form-condensed .table-form {margin-bottom: 20px;}
-.hours {display: flex; float: left; transform: translate(0, 50%); margin: 0;}
-.estimateTotally, .consumedTotally {border-radius: 9px; padding: 3px 7px; margin: 0 5px 0 5px; min-width: 18px;}
-.estimateTotally {background: #FFEFEF; color: #FF6262;}
-.nav > li.divider {margin: 0 10px 0 5px; background-color: #000; opacity: 0.06; width: 1px ; height: 15px; padding: 0 !important;}
-.table-bordered td, .table-bordered th { border: 1px solid #EEEEEE; }
-.table-recorded thead { background: #F5F6F8}
-.table>thead>tr>th{border-bottom: 1px solid #EEEEEE; font-weight: 400;}
-#linearefforts .nav li.active a{color: #0c64eb !important}
-.input-group-addon {background: #fff}
-.icon-calendar {color: rgb(22, 168, 248)}
-#recordForm .table > thead > tr > th {border: none; font-weight: 400;}
-.main-header {border-bottom: none !important}
-.main-header ul.hours:before{content:"("}
-.main-header ul.hours:after{content:")"}
-.body-modal .main-header>h2 { max-width: 70% !important; margin-right:0px;}
-.table-record .form-date {border-right: none;}
-
-.table.has-sort-head thead>tr>th>a:after, .table.has-sort-head thead>tr>th>a:before {top: -7px;}
-.table.has-sort-head thead>tr>th>a:hover, .table.has-sort-head thead>tr>th>a:hover:after, .table.has-sort-head thead>tr>th>a:hover:before {color: #000;}
-
-.taskEffort thead > tr > th {padding-right: 10px !important;}
-#toggleFoldIcon:hover {cursor: pointer;}
-#toggleFoldIcon .icon-border {width: 20px; height: 20px; border-radius: 8px;}
-#toggleFoldIcon {margin-bottom: 10px;}
diff --git a/module/task/css/report.css b/module/task/css/report.css
deleted file mode 100644
index 5646eef825..0000000000
--- a/module/task/css/report.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.table-bordered caption {border: 1px solid #ddd;}
-.table-bordered tr > th:first-child, .table-bordered tr > td:first-child {border-left: 1px solid #ddd !important;}
-.table-bordered tr > th:last-child, .table-bordered tr > td:last-child {border-right: 1px solid #ddd !important;}
-.side-col.col-lg {width: 270px;}
-
-.panel-heading > strong > span {float: right; color: #29a8cd;}
-
-.checkboxes {margin-bottom: 10px;}
-.checkboxes .checkbox-primary {margin-bottom: 5px;}
diff --git a/module/task/css/view.css b/module/task/css/view.css
deleted file mode 100644
index 7b3a3f1e87..0000000000
--- a/module/task/css/view.css
+++ /dev/null
@@ -1,25 +0,0 @@
-.side-col .cell {padding: 0px;}
-.side-col #legendProjectAndTask .list-unstyled {padding: 10px; border: 1px solid #ddd; border-top: 0px; margin: 0px;}
-.tab-pane table {border: 1px solid #ddd; border-top: none;}
-.MRThWidth {width: 100px !important;}
-.btn-edit-comment {z-index: 100;}
-.link-commit {overflow: hidden; white-space: nowrap; margin-right: 5px;}
-
-#assignedTo a {border-color: transparent;}
-#assignedTo a:hover {border-color: rgba(0,0,0,.2);}
-
-.c-id {width: 50px;}
-.c-pri {width: 40px;}
-.c-deadline {width: 100px;}
-.c-assignedTo {width: 120px;}
-.c-status {width: 80px;}
-.c-consumedAB {width: 60px;}
-.c-leftAB {width: 60px;}
-.c-actions {width: 175px;}
-
-[lang^='de'] #mainContent .main-actions .btn-toolbar .btn {padding-left: 3px; padding-right: 3px;}
-
-#childrenTable .c-id {width: 60px;}
-#childrenTable .c-lblPri {width: 50px;}
-
-#legendTeam .c-hours {width: 72px;}
diff --git a/module/task/js/activate.js b/module/task/js/activate.js
deleted file mode 100644
index 06cb075947..0000000000
--- a/module/task/js/activate.js
+++ /dev/null
@@ -1,196 +0,0 @@
-$(function()
-{
- $('#confirmButton').click(function()
- {
- var memberCount = '';
- var totalEstimate = 0;
- var totalConsumed = oldConsumed;
- var totalLeft = 0;
- var error = false;
- $('select[name^=team]').each(function()
- {
- if($(this).val() == '') return;
-
- memberCount++;
-
- var $tr = $(this).closest('tr');
- var account = $(this).find('option:selected').text();
-
- var estimate = parseFloat($tr.find('[name^=teamEstimate]').val());
- if(!isNaN(estimate)) totalEstimate += estimate;
- if($tr.hasClass('member-wait') && (isNaN(estimate) || estimate <= 0))
- {
- bootbox.alert(account + ' ' + estimateNotEmpty);
- error = true;
- return false;
- }
-
- var consumed = parseFloat($tr.find('[name^=teamConsumed]').val());
- if(!isNaN(consumed)) totalConsumed += consumed;
-
- var $left = $tr.find('[name^=teamLeft]');
- var left = parseFloat($left.val());
- if(!isNaN(left)) totalLeft += left;
- if(!$left.prop('readonly') && $tr.hasClass('member-wait') && (isNaN(left) || left <= 0))
- {
- bootbox.alert(account + ' ' + leftNotEmpty);
- error = true;
- return false;
- }
- })
-
- if(error) return false;
-
- if(memberCount < 2)
- {
- bootbox.alert(teamMemberError);
- return false;
- }
-
- $('#left').val(totalLeft);
- updateAssignedTo();
-
- $('.close').click();
- });
-
- $('#multiple').on('click', function()
- {
- var showTeam = $(this).is(":checked");
- $('#assignedTo').val('');
- $('#left').val('');
- $('#dataPlanGroup').removeClass('required');
- $('.multi-append').empty();
- $('.teamTemplate select, .teamTemplate input').val('');
- $('.teamTemplate input[name^=teamConsumed]').val('0');
- $('.teamTemplate select').trigger('chosen:updated');
-
- /* Reset team modal. */
- var oldTeamCount = $('#taskTeamEditor select:disabled').length;
- var removeCount = oldTeamCount > 6 ? 1 : (5 - oldTeamCount);
- $('#taskTeamEditor tr.teamTemplate').filter(':gt(' + removeCount + ')').remove();
- $('.member-done').find('input[name^=teamLeft]').val(0);
-
- /* Reset assignedTo select.*/
- $('#assignedTo_chosen').remove();
- $('#assignedTo').replaceWith(assignedToHtml);
-
- if(showTeam)
- {
- $('#assignedTo').attr('disabled', true);
- $('#left').attr('readonly', true);
- $('.team-group').removeClass('hidden');
- }
- else
- {
- $('.team-group').addClass('hidden');
- $('#assignedTo').removeAttr('disabled');
- $('#left').removeAttr('readonly');
- $('#dataPlanGroup').addClass('required');
- }
- $('#assignedTo').chosen();
- $('#assignedTo').trigger('chosen:updated');
- });
-
- $('#assignedTo').on('change', setTeamUser);
- $('#left').on('input', setTeamUser);
-
- $('#submit').on('click', function()
- {
- if(isMultiple)
- {
- var multiple = $('#multiple').is(":checked");
- if(!multiple)
- {
- var assignedTo = $('#assignedTo').val();
- if(!assignedTo)
- {
- bootbox.alert(teamNotEmpty);
- return false;
- }
- }
-
- var estimate = parseInt($('#left').val());
- if(isNaN(estimate) || estimate <= 0)
- {
- bootbox.alert(multiple ? teamLeftEmpty : leftNotEmpty);
- return false;
- }
-
- $('#assignedTo').val('');
- }
- });
-});
-
-/**
- * Set team user form.
- *
- * @access public
- * @return void
- */
-function setTeamUser()
-{
- $('.multi-append').empty();
-
- var assignedTo = $('#assignedTo').val();
- var estimate = parseInt($('#left').val());
- if(!assignedTo || !estimate) return;
-
- if(taskMode == 'multi')
- {
- $('.member-done').each(function()
- {
- if($(this).find('select').val() == assignedTo) $(this).find('input[name^=teamLeft]').val(estimate);
- });
- }
- else
- {
- var teamLine = '
';
- teamLine += '
';
- teamLine += '
';
- teamLine += '
';
- teamLine += '
';
- $('.multi-append').html(teamLine);
- }
-}
-
-/**
- * Update assignedTo.
- *
- * @access public
- * @return void
- */
-function updateAssignedTo()
-{
- var html = '';
- var multiple = $('#multiple').prop('checked');
- var assignedTo = $('#assignedTo').val();
- if(multiple)
- {
- var isTeamMember = false;
- var mode = $('#mode').val();
- $('select[name^=team]').each(function()
- {
- if($(this).find('option:selected').text() == '') return;
- if($(this).val() == currentUser) isTeamMember = true;
-
- var account = $(this).find('option:selected').val();
- var realName = $(this).find('option:selected').text();
- var selected = account == assignedTo ? 'selected' : '';
-
- html += "
";
- });
- $('[name=assignedTo]').attr('disabled', 'disabled').trigger('chosen:updated');
- }
- else
- {
- for(key in members)
- {
- var selected = key == assignedTo ? 'selected' : '';
- html += "
";
- }
- }
-
- $('#assignedTo').html(html);
- if(multiple && mode == 'linear' && $('#modalTeam tr.member-doing').length == 0 && $('#modalTeam tr.member-wait').length >= 1) $('[name=assignedTo]').val($('#modalTeam tr.member-wait:first').find('select[name^=team]:first').val());
- $('#assignedTo').trigger('chosen:updated');
-}
diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js
deleted file mode 100755
index d240765fed..0000000000
--- a/module/task/js/batchcreate.js
+++ /dev/null
@@ -1,331 +0,0 @@
-/* Remove 'ditto' in first row and control task name width and tips for tasks that consume. */
-$(function()
-{
- removeDitto();
- $name = $('th.c-name');
- if($name.width() < 165) $name.width(165);
- if(taskConsumed > 0) bootbox.alert(addChildTask);
- $('#customField').on('click', function(){$('#tableBody .chosen-with-drop').removeClass('chosen-with-drop chosen-container-active')});
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-
- /* Implement a custom form without feeling refresh. */
- $('#formSettingForm .btn-primary').click(function()
- {
- saveCustomFields('batchCreateFields', 9, $name, 165);
- return false;
- });
-});
-
-$(document).on('change', "[name^='estStarted'], [name^='deadline']", function()
-{
- toggleCheck($(this));
-})
-
-/**
- * Toggle checkbox.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function toggleCheck(obj)
-{
- var $this = $(obj);
- var date = $this.val();
- var $ditto = $this.closest('div').find("input[type='checkBox']");
- if(date == '')
- {
- $ditto.attr('checked', true);
- $ditto.closest('.input-group-addon').show();
- }
- else
- {
- $ditto.removeAttr('checked');
- $ditto.closest('.input-group-addon').hide();
- }
-}
-
-/* Get select of stories.*/
-function setStories(moduleID, executionID, num)
-{
- link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=all&moduleID=' + moduleID + '&storyID=0&num=' + num + '&type=short');
- $.get(link, function(stories)
- {
- var storyID = $('#story' + num).val();
- if(!stories) stories = '
';
- $('#story' + num).replaceWith(stories);
- if(num != 0 && (moduleID == 0 || moduleID == 'ditto')) $('#story' + num).append("
");
- $('#story' + num).val(storyID);
- if($('#zeroTaskStory').hasClass('checked'))
- {
- $('#story' + num).find('option').each(function()
- {
- value = $(this).attr('value');
- if(value != 'ditto' && storyTasks[value] > 0)
- {
- $(this).hide();
- if(storyID == value) $('#story' + num).val('');
- }
- })
- }
- var chosenWidth = $("#story" + num + "_chosen").css('max-width');
- $("#story" + num + "_chosen").remove();
- $("#story" + num).next('.picker').remove();
- $("#story" + num).chosen();
- $("#story" + num + "_chosen").width(chosenWidth).css('max-width', chosenWidth);
- });
-}
-
-/* Copy story title as task title. */
-function copyStoryTitle(num)
-{
- var storyTitle = $('#story' + num).find('option:selected').text();
- var storyValue = $('#story' + num).find('option:selected').val();
-
- if(storyValue === 'ditto')
- {
- for(var i = num; i <= num && i >= 1; i--)
- {
- var selectedValue = $('select[id="story' + i +'"]').val();
- var selectedTitle = $('select[id="story' + i +'"]').find('option:selected').text();
- if(selectedValue !== 'ditto')
- {
- storyTitle = selectedTitle;
- break;
- }
- }
- }
-
- startPosition = storyTitle.indexOf(':') + 1;
- endPosition = storyTitle.lastIndexOf('[');
- storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
-
- $('#name' + num).val(storyTitle);
- $('#estimate' + num).val($('#storyEstimate' + num).val());
- $('#desc' + num).val(($('#storyDesc' + num).val()).replace(/<[^>]+>/g,'').replace(/(\n)+\n/g, "\n").replace(/^\n/g, '').replace(/\t/g, ''));
-
- var storyPri = $('#storyPri' + num).val();
- if(storyPri == 0) $('#pri' + num ).val('3');
- if(storyPri != 0) $('#pri' + num ).val(storyPri);
-}
-
-/* Set the story module. */
-function setStoryRelated(num)
-{
- setPreview(num);
-}
-
-/**
- * Set preview.
- *
- * @param int $num
- * @access public
- * @return void
- */
-function setPreview(num)
-{
- var storyID = $('#story' + num).val();
- var storyLink = '#';
- if(storyID != 0 && storyID != 'ditto')
- {
- var link = createLink('story', 'ajaxGetInfo', 'storyID=' + storyID);
- $.getJSON(link, function(storyInfo)
- {
- $('#module' + num).val(parseInt(storyInfo.moduleID));
- $('#module' + num).trigger("chosen:updated");
-
- $('#storyEstimate' + num).val(storyInfo.estimate);
- $('#storyPri' + num).val(storyInfo.pri);
- $('#storyDesc' + num).val(storyInfo.spec);
- });
-
- storyLink = createLink('story', 'view', "storyID=" + storyID);
- if(!isonlybody)
- {
- var concat = storyLink.indexOf('?') >= 0 ? '&' : '?';
- storyLink = storyLink + concat + 'onlybody=yes';
- }
-
- $('#preview' + num).removeAttr('disabled');
- $('#preview' + num).modalTrigger({type:'iframe'});
- $('#preview' + num).css('pointer-events', 'auto');
- $('#preview' + num).attr('href', storyLink);
- }
- else
- {
- $('#preview' + num).attr('disabled', true);
- $('#preview' + num).css('pointer-events', 'none');
- $('#preview' + num).attr('href', storyLink);
- }
-}
-
-/* Toggle zero task story. */
-function toggleZeroTaskStory()
-{
- var $toggle = $('#zeroTaskStory').toggleClass('checked');
- var zeroTask = $toggle.hasClass('checked');
- $.cookie('zeroTask', zeroTask, {expires:config.cookieLife, path:config.webRoot});
- $('select[name^="story"]').each(function()
- {
- var $select = $(this);
- var selectVal = $select.val();
- $select.find('option').each(function()
- {
- var $option = $(this);
- var value = $option.attr('value');
- $option.show();
- if(value != 'ditto' && storyTasks[value] > 0 && zeroTask)
- {
- $option.hide();
- if(selectVal == value) selectVal = '';
- }
- })
- $select.val(selectVal).trigger("chosen:updated");
- });
-}
-
-// see http://pms.zentao.net/task-view-5086.html
-function markStoryTask()
-{
- $('select[name^="story"]').each(function()
- {
- var $select = $(this);
- $select.find('option').each(function()
- {
- var $option = $(this);
- var value = $option.attr('value');
- var tasksCount = storyTasks[value];
- $option.attr('data-data', value).toggleClass('has-task', !!(tasksCount && tasksCount !== '0'));
- });
- $select.trigger("chosen:updated");
- });
-
- var getStoriesHasTask = function()
- {
- var storiesHasTask = {};
- $('#tableBody tbody>tr').each(function()
- {
- var $tr = $(this);
- if ($tr.find('input[name^="name"]').val())
- {
- storiesHasTask[$tr.find('select[name^="story"]').val()] = true;
- }
- });
- return storiesHasTask;
- };
-
- $('#batchCreateForm').on('chosen:showing_dropdown', 'select[name^="story"],.chosen-with-drop', function()
- {
- var storiesHasTask = getStoriesHasTask();
- var $container = $(this).closest('td').find('.chosen-container');
- setTimeout(function()
- {
- $container.find('.chosen-results>li').each(function()
- {
- var $li = $(this);
- $li.toggleClass('has-new-task', !!storiesHasTask[$li.data('data')]);
- });
- }, 100);
- });
-}
-
-/**
- * Set lane.
- *
- * @param int $regionID
- * @param int $num
- * @access public
- * @return void
- */
-function setLane(regionID, num)
-{
- laneLink = createLink('kanban', 'ajaxGetLanes', 'regionID=' + regionID + '&type=task&field=lanes&i=' + num);
- $.get(laneLink, function(lanes)
- {
- if(!lanes) lanes = '
';
- $('#lanes' + num).replaceWith(lanes);
- $("#lanes" + num + "_chosen").remove();
- $("#lanes" + num).next('.picker').remove();
- $("#lanes" + num).chosen();
- });
-}
-
-$(document).on('chosen:showing_dropdown', 'select[name^="story"],.chosen-with-drop', function()
-{
- var select = $(this).closest('td').find('select');
- if($(select).val() == 'ditto')
- {
- var index = $(select).closest('td').index();
- var row = $(select).closest('tr').index();
- var table = $(select).closest('tr').parent();
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
- $(select).val(value);
- $(select).trigger("chosen:updated");
- $(select).trigger("change");
- }
-})
-
-$(document).on('mousedown', 'select', function()
-{
- if($(this).val() == 'ditto')
- {
- var index = $(this).closest('td').index();
- var row = $(this).closest('tr').index();
- var table = $(this).closest('tr').parent();
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = $(table).find('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
- $(this).val(value);
- }
-})
-
-$(function()
-{
- $('.chosen-container[id^=module]').width(chosenWidth);
- $('.chosen-container[id^=module]').css('max-width', chosenWidth);
-
- var chosenWidth = $('#story1_chosen').width();
- $('.chosen-container[id^=story]').width(chosenWidth);
- $('.chosen-container[id^=story]').css('max-width', chosenWidth);
-
- if($.cookie('zeroTask') == 'true') toggleZeroTaskStory();
- markStoryTask();
-
- if(storyID != 0) setStoryRelated($('#batchCreateForm table tbody tr:first [id^=story]:first').attr('id').replace('story', ''));
-
- $(document).keydown(function(event)
- {
- if(event.ctrlKey && event.keyCode == 38)
- {
- event.stopPropagation();
- event.preventDefault();
- selectFocusJump('up');
- }
- else if(event.ctrlKey && event.keyCode == 40)
- {
- event.stopPropagation();
- event.preventDefault();
- selectFocusJump('down');
- }
- else if(event.keyCode == 38)
- {
- inputFocusJump('up');
- }
- else if(event.keyCode == 40)
- {
- inputFocusJump('down');
- }
- });
-});
diff --git a/module/task/js/batchedit.js b/module/task/js/batchedit.js
deleted file mode 100644
index 73af9a1c12..0000000000
--- a/module/task/js/batchedit.js
+++ /dev/null
@@ -1,57 +0,0 @@
-$(document).ready(removeDitto());//Remove 'ditto' in first row.
-
-$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value.
-
-/* Set ditto value. */
-$(document).on('change', 'select', function()
-{
- if($(this).val() == 'ditto')
- {
- var index = $(this).closest('td').index();
- var row = $(this).closest('tr').index();
- var tbody = $(this).closest('tr').parent();
-
- var value = '';
- for(var i = row - 1; i >= 0; i--)
- {
- value = tbody.children('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
-
- isModules = $(this).attr('name').indexOf('modules') != -1;
- isAssignedTos = $(this).attr('name').indexOf('assignedTos') != -1;
- isFinishedBys = $(this).attr('name').indexOf('finishedBys') != -1;
- isClosedBys = $(this).attr('name').indexOf('closedBys') != -1;
-
- if(isModules || isAssignedTos || isFinishedBys || isClosedBys)
- {
- var valueStr = ',' + $(this).find('option').map(function(){return $(this).val();}).get().join(',') + ',';
- if(valueStr.indexOf(',' + value + ',') != -1)
- {
- $(this).val(value);
- }
- else
- {
- alert(dittoNotice);
- $(this).val(oldValue);
- }
- }
- else
- {
- $(this).val(value);
- }
-
- $(this).trigger("chosen:updated");
- $(this).trigger("change");
- }
-});
-
-$(function()
-{
- $('#subNavbar li[data-id="task"]').addClass('active');
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-});
diff --git a/module/task/js/create.js b/module/task/js/create.js
deleted file mode 100644
index 3b659d92f8..0000000000
--- a/module/task/js/create.js
+++ /dev/null
@@ -1,688 +0,0 @@
-$(function()
-{
- if(attribute == 'request' || attribute == 'review')
- {
- $('#story').closest('tr').hide();
- $("input[name='after'][value='toStoryList']").parent().hide();
- $("input[name='after'][value='continueAdding']").parent().hide();
- $("input[name='after'][value='toTaskList']").prop('checked', true);
- $("input[name='after'][value='toTaskList']").parent().css('margin-left', '0px');
- }
-
- execAttribute = attribute;
- $('#execution').change(function()
- {
- link = createLink('execution', 'ajaxGetAttribute', "executionID=" + $('#execution').val());
- $.get(link, function(attribute)
- {
- execAttribute = attribute;
- if(attribute == 'request' || attribute == 'review')
- {
- $('#story').closest('tr').hide();
- $("input[name='after'][value='toStoryList']").parent().hide();
- $("input[name='after'][value='continueAdding']").parent().hide();
- $("input[name='after'][value='toTaskList']").prop('checked', true);
- $("input[name='after'][value='toTaskList']").parent().css('margin-left', '0px');
- }
- else
- {
- $('#story').closest('tr').show();
- $("input[name='after'][value='toStoryList']").parent().show();
- $("input[name='after'][value='continueAdding']").parent().show();
- $("input[name='after'][value='continueAdding']").prop('checked', true);
- $("input[name='after'][value='toTaskList']").parent().css('margin-left', '10px');
- }
- });
- })
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
-
- var fieldList = showFields + ',';
- var requiredList = ',' + requiredFields + ',';
- if(lifetime == 'ops' || (typeof execAttribute != 'undefined' && (execAttribute == 'request' || execAttribute == 'review')))
- {
- $('#fieldsstory').parent('div').addClass('hidden');
- }
- else if(fieldList.indexOf('story') >= 0 && requiredList.indexOf('story') < 0)
- {
- $('#fieldsstory').parent('div').removeClass('hidden');
- }
- });
-
- /* Implement a custom form without feeling refresh. */
- $('#formSettingForm .btn-primary').click(function()
- {
- saveCustomFields('createFields');
- return false;
- });
-
- if(executionType != 'kanban') executionID = $('#execution').val();
- loadStories(executionID);
-})
-
-/**
- * Show team menu.
- *
- * @access public
- * @return void
- */
-function showTeamMenu()
-{
- if($('[name^=multiple]').prop('checked'))
- {
- $('#assignedTo, #assignedTo_chosen').addClass('hidden');
- $('#assignedTo').next('.picker').addClass('hidden');
- $('.team-group').removeClass('hidden');
- $('.modeBox').removeClass('hidden');
- $('#estimate').attr('readonly', true);
- }
- else
- {
- $('#assignedTo, #assignedTo_chosen').removeClass('hidden');
- $('#assignedTo').next('.picker').removeClass('hidden');
- $('.team-group').addClass('hidden');
- $('.modeBox').addClass('hidden');
- $('#estimate').attr('readonly', false);
- }
- $('#dataPlanGroup').fixInputGroup();
-}
-/**
- * Load module, stories and members.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadAll(executionID)
-{
- lifetime = lifetimeList[executionID];
- attribute = attributeList[executionID];
- var fieldList = showFields + ',';
- if(lifetime == 'ops' || attribute == 'request' || attribute == 'review')
- {
- $('.storyBox,#selectTestStoryBox,#testStoryBox').addClass('hidden');
- }
- else if(fieldList.indexOf('story') >= 0)
- {
- $('.storyBox,#selectTestStoryBox').removeClass('hidden');
- if($('#selectTestStory').prop('checked')) $('#testStoryBox').removeClass('hidden');
- }
-
- loadModuleMenu(executionID);
- loadExecutionStories(executionID);
- loadExecutionMembers(executionID);
-}
-
-/**
- * Load team members of the execution.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadExecutionMembers(executionID)
-{
- $("#multipleBox").removeAttr("checked");
- $('.team-group').addClass('hidden');
- $(".modeBox").addClass("hidden");
- $.get(createLink('execution', 'ajaxGetMembers', 'executionID=' + executionID + '&assignedTo=' + $('#assignedTo').val()), function(data)
- {
- $('#assignedTo_chosen').remove();
- $('#assignedTo').next('.picker').remove();
- $('#assignedTo').replaceWith(data);
- $('#assignedTo').attr('name', 'assignedTo[]').chosen();
-
- $('.modal-dialog #taskTeamEditor tr').each(function()
- {
- $(this).find('#team_chosen').remove();
- $(this).find('#team').next('.picker').remove();
- $(this).find('#team').replaceWith(data);
- $(this).find('#assignedTo').attr('id', 'team').attr('name', 'team[]').chosen();
- });
-
- $('#testStoryBox table tbody tr').each(function(i)
- {
- $td = $(this).find('#testAssignedTo').closest('td');
- $td.html(data);
- $td.find('#assignedTo').val('').attr('id', 'testAssignedTo').attr('name', 'testAssignedTo[]').chosen();
- });
- });
-}
-
-/**
- * Load stories of the execution.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadExecutionStories(executionID)
-{
- $.get(createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=0&moduleID=0&storyID=' + $('#story').val() + '&number=&type=full&status=active'), function(data)
- {
- $('#story_chosen').remove();
- $('#story').next('.picker').remove();
- $('#story').replaceWith(data);
- $('#story').addClass('filled').chosen();
-
- /* If there is no story option, select will be hidden and text will be displayed; otherwise, the opposite is true */
- if($('#story option').length > 1)
- {
- $('#story').parent().removeClass('hidden');
- $('#storyBox').addClass('hidden');
- }
- else
- {
- $('#storyBox').removeClass('hidden');
- $('#storyBox > a:first').attr('href', createLink('execution', 'linkStory', 'executionID=' + executionID));
- $('#storyBox > a:nth-child(2)').attr('href', "javascript:loadStories(" + executionID + ")");
- $('#story').parent().addClass('hidden');
- }
-
- if($('#testStoryBox table tbody tr').length == 0)
- {
- var trHtml = $('#testStoryTemplate tr').prop("outerHTML");
- $('#testStoryBox table tbody').append(trHtml);
-
- $td = $('#testStoryBox table tbody tr:first').find('#testStory').closest('td');
- $td.html(data);
- $td.find('#story').val($td.find('#story option').eq(i).val()).attr('id', 'testStory').attr('name', 'testStory[]').addClass('filled').chosen();
-
- $td = $('#testStoryBox table tbody tr:first').find('#testPri_chosen').closest('td');
- $td.find('#testPri_chosen').remove();
- $td.find('#testPri').chosen();
- }
- else
- {
- $('#testStoryBox table tbody tr').each(function(i)
- {
- $td = $(this).find('#testStory').closest('td');
- $td.html(data);
- $td.find('#story').val($td.find('#story option').eq(i).val()).attr('id', 'testStory').attr('name', 'testStory[]').addClass('filled').chosen();
- });
- }
- });
-}
-
-/**
- * Load module of the execution.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadModuleMenu(executionID)
-{
- var extra = $('#showAllModule').prop('checked') ? 'allModule' : '';
- var link = createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + executionID + '&viewtype=task&branch=0&rootModuleID=0&returnType=html&fieldID=&needManage=0&extra=' + extra);
- $('#moduleIdBox').load(link, function(){$('#module').chosen();});
-}
-
-/* Copy story title as task title. */
-function copyStoryTitle()
-{
- var storyTitle = $('#story option:selected').text();
- var startPosition = storyTitle.indexOf(':') + 1;
- if (startPosition > 0) {
- var endPosition = storyTitle.lastIndexOf('(');
- storyTitle = storyTitle.substr(startPosition, endPosition - startPosition);
- }
-
- $('#name').attr('value', storyTitle);
- $('#estimate').val($('#storyEstimate').val());
- $('#desc').val($('#storyDesc').val());
-
- $('.pri-text span:first').removeClass().addClass('pri' + $('#storyPri').val()).text($('#storyPri').val());
- $('select#pri').val($('#storyPri').val());
-
- $('#desc').closest('td').find('.ke-container .ke-edit .kindeditor-ph').toggle($('#storyDesc').val() == '');
- window.editor.desc.html($('#storyDesc').val());
-}
-
-/* Set the assignedTos field. */
-function setOwners(result)
-{
- if(result == 'affair')
- {
- $("#multipleBox").removeAttr("checked");
- $('.team-group').addClass('hidden');
- $('.modeBox').addClass('hidden');
- $('#assignedTo, #assignedTo_chosen').removeClass('hidden');
- $('#assignedTo').next('.picker').removeClass('hidden');
-
- $('#assignedTo').attr('multiple', 'multiple');
- $('#assignedTo').chosen('destroy');
- $('#assignedTo').chosen();
- $('.affair').hide();
- $('.team-group').addClass('hidden');
- $('.modeBox').addClass('hidden');
- $('#selectAllUser').removeClass('hidden');
- }
- else if($('#assignedTo').attr('multiple') == 'multiple')
- {
- $('#assignedTo').removeAttr('multiple');
- $('#assignedTo').chosen('destroy');
- $('#assignedTo').chosen();
- $('.affair').show();
- $('#selectAllUser').addClass('hidden');
- }
-}
-
-/* Set preview and module of story. */
-function setStoryRelated()
-{
- setPreview();
- setStoryModule();
-}
-
-/* Set the story priview link. */
-function setPreview()
-{
- if(!Number($('#story').val()))
- {
- $('#preview').addClass('hidden');
- $('#copyButton').addClass('hidden');
- $('div.colorpicker').css('right', '1px');//Adjust for task #4151;
- $('.title-group.required > div').removeAttr('id', 'copyStory-input').addClass('.required');
- }
- else
- {
- storyLink = createLink('execution', 'storyView', "storyID=" + $('#story').val());
- var concat = storyLink.indexOf('?') < 0 ? '?' : '&';
-
- if(storyLink.indexOf("onlybody=yes") < 0) storyLink = storyLink + concat + 'onlybody=yes';
-
- $('#preview').removeClass('hidden');
- $('#preview a').attr('href', storyLink);
- $('#copyButton').removeClass('hidden');
- $('.title-group.required > div').attr('id', 'copyStory-input').removeClass('.required');
- $('div.colorpicker').css('right', '80px');//Adjust for task #4151;
- $('#copyButton').css('width', '80px');
- }
-
- setAfter();
-}
-
-/**
- * Set after locate.
- *
- * @access public
- * @return void
- */
-function setAfter()
-{
- if($("#story").length == 0 || $("#story").select().val() == '')
- {
- if($('input[value="continueAdding"]').attr('checked') == 'checked')
- {
- $('input[value="toTaskList"]').attr('checked', 'checked');
- }
- $('input[value="continueAdding"]').attr('disabled', 'disabled');
- $('input[value="toStoryList"]').attr('disabled', 'disabled');
- }
- else
- {
- if(!toTaskList) $('input[value="continueAdding"]').attr('checked', 'checked');
- $('input[value="continueAdding"]').attr('disabled', false);
- $('input[value="toStoryList"]').attr('disabled', false);
- }
-}
-
-/**
- * Load stories.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadStories(executionID)
-{
- moduleID = $('#module').val();
- setStories(moduleID, executionID);
-}
-
-/**
- * Set lane.
- *
- * @param int $regionID
- * @access public
- * @return void
- */
-function setLane(regionID)
-{
- laneLink = createLink('kanban', 'ajaxGetLanes', 'regionID=' + regionID + '&type=task&field=lane');
- $.get(laneLink, function(lane)
- {
- if(!lane) lane = "
";
- $('#lane').replaceWith(lane);
- $("#lane" + "_chosen").remove();
- $("#lane").next('.picker').remove();
- $("#lane").chosen();
- });
-}
-
-/* Get select of stories.*/
-function setStories(moduleID, executionID)
-{
- link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=all&moduleID=' + moduleID + '&storyID=0&number=&type=full&status=active');
- $.get(link, function(stories)
- {
- var storyID = $('#story').val();
- if(!stories) stories = '
';
- $('#story').replaceWith(stories);
- if($('#story').length == 0 && $('#storyBox').length != 0) $('#storyBox').html(stories);
-
- $('#story').val(storyID);
- setPreview();
- $('#story_chosen').remove();
- $('#story').next('.picker').remove();
- $("#story").addClass('filled').chosen();
-
- /* If there is no story option, select will be hidden and text will be displayed; otherwise, the opposite is true */
- if($('#story option').length > 1 || parseInt(hasProduct) == 0)
- {
- $('#story').parent().removeClass('hidden');
- $('#storyBox').addClass('hidden');
- }
- else
- {
- $('#storyBox').removeClass('hidden');
- $('#story').parent().addClass('hidden');
-
- /* change link when lite */
- if(vision == 'lite')
- {
- config.onlybody = 'no';
- $('#storyBox > a:first').attr('href', createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=' + moduleID + '&storyID=0&projectID=' + projectID + '&bugID=0&planID=0&todoID=0&extra=&type=story') + '#_single');
- }
- }
- });
-}
-
-function toggleSelectTestStory()
-{
- if(!$('#selectTestStoryBox').hasClass('hidden') && $('#selectTestStory').prop('checked'))
- {
- $('#module').closest('tr').addClass('hidden');
- $('#multipleBox').closest('td').addClass('hidden');
- $('#story').closest('tr').addClass('hidden');
- $('#estStarted').closest('tr').addClass('hidden');
- $('#estimate').closest('.table-col').addClass('hidden');
- $('#testStoryBox').removeClass('hidden');
- $('#copyButton').addClass('hidden');
- $('.colorpicker').css('right', '0');
- $('#dataform .table-form>tbody>tr>th').css('width', '130px');
- $('[lang^="zh-"] #dataform .table-form>tbody>tr>th').css('width', '120px');
-
- $('[name^=multiple]').attr('checked', false);
- showTeamMenu();
- }
- else
- {
- $('#module').closest('tr').removeClass('hidden');
- $('#multipleBox').closest('td').removeClass('hidden');
- if(showFields.indexOf('story') != -1) $('#story').closest('tr').removeClass('hidden');
- $('#estStarted').closest('tr').removeClass('hidden');
- $('#estimate').closest('.table-col').removeClass('hidden');
- $('#testStoryBox').addClass('hidden');
- $('#dataform .table-form>tbody>tr>th').css('width', '100px');
- }
-}
-
-/**
- * Add Ditto checkBox.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function addItem(obj)
-{
- var $tr = $(obj).closest('tr');
- $tr.after($tr.clone());
- var $nextTr = $tr.next();
- $nextTr.find('#testAssignedTo').val('ditto');
- $nextTr.find('#testStory').closest('td').find('.chosen-container').remove();
- $nextTr.find('#testStory').closest('td').find('select').val('').chosen();
- $nextTr.find('#testPri').closest('td').find('.chosen-container').remove();
- $nextTr.find('#testPri').closest('td').find('select').chosen();
- $nextTr.find('#testAssignedTo').closest('td').find('.chosen-container').remove();
- $nextTr.find('#testAssignedTo').closest('td').find('select').chosen();
- $nextTr.find('.form-date').val('').datepicker();
-
- if($nextTr.find('#testAssignedTo option:selected').val() == '')
- {
- $nextTr.find('#testAssignedTo').append("
");
- $nextTr.find('#testAssignedTo').val('ditto').chosen().trigger('chosen:updated');
- }
- if($nextTr.find('.deadlineBox').length == 0)
- {
- $nextTr.find('.deadlineInput').after('
' + ditto + '');
- }
- if($nextTr.find('.estStartedBox').length == 0)
- {
- $nextTr.find('.startInput').after('
' + ditto + '');
- }
-
- if($nextTr.find('.deadlineBox').is(':hidden'))
- {
- $nextTr.find('.deadlineBox').show();
- $nextTr.find(".deadlineBox input[type='checkBox']").attr('checked', true);
- }
- if($nextTr.find('.estStartedBox').is(':hidden'))
- {
- $nextTr.find('.estStartedBox').show();
- $nextTr.find(".estStartedBox input[type='checkBox']").attr('checked', true);
- }
- index ++;
-}
-
-/**
- * remove Ditto checkBox.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function removeItem(obj)
-{
- if($(obj).closest('table').find('tbody tr').size() > 1) $(obj).closest('tr').remove();
- $('.resarch').find('tr:first').find('.estStartedBox').remove();
- $('.resarch').find('tr:first').find('.deadlineBox').remove();
- $('.resarch').find('tr:first').find('#testAssignedTo option[value="ditto"]').remove();
- $('.resarch').find('tr:first').find('#testAssignedTo').val('').chosen().trigger('chosen:updated');
-}
-
-function markTestStory()
-{
- $('#testStoryBox select[name^="testStory"]').each(function()
- {
- var $select = $(this);
- $select.find('option').each(function()
- {
- var $option = $(this);
- var value = $option.attr('value');
- var tests = testStoryIdList[value];
- $option.attr('data-data', value).toggleClass('has-test', !!(tests && tests !== '0'));
- });
- $select.trigger("chosen:updated");
- });
-
- var getStoriesHasTest = function()
- {
- var storiesHasTest = {};
- $('#testStoryBox table tbody>tr').each(function()
- {
- var $tr = $(this);
- storiesHasTest[$tr.find('select[name^="testStory"]').val()] = true;
- });
- return storiesHasTest;
- };
-
- $('#testStoryBox').on('chosen:showing_dropdown', 'select[name^="testStory"],.chosen-with-drop', function()
- {
- var storiesHasTest = getStoriesHasTest();
- var $container = $(this).closest('td').find('.chosen-container');
- setTimeout(function()
- {
- $container.find('.chosen-results>li').each(function()
- {
- var $li = $(this);
- $li.toggleClass('has-new-test', !!storiesHasTest[$li.data('data')]);
- });
- }, 100);
- });
-}
-
-$(document).ready(function()
-{
- $('#pri').on('change', function()
- {
- var $select = $(this);
- var $selector = $select.closest('.pri-selector');
- var value = $select.val();
- $selector.find('.pri-text').html('
' + value + '');
- });
-
- $('#type').change(function()
- {
- if(lifetime != 'ops' && attribute != 'request' && attribute != 'review')
- {
- $('#selectTestStoryBox').toggleClass('hidden', $(this).val() != 'test');
- toggleSelectTestStory();
- }
- });
-
- setStoryRelated();
- markTestStory();
-
- $('#selectAllUser').on('click', function()
- {
- var $assignedTo = $('#assignedTo');
- if($assignedTo.attr('multiple'))
- {
- $assignedTo.children('option').attr('selected', 'selected');
- $assignedTo.trigger('chosen:updated');
- }
- });
-
- var preAssign = '';
- $('#assignedTo').change(function()
- {
- var assign = $(this).val();
- $('#testStoryBox').find('select[name^="testAssignedTo"]').each(function()
- {
- if($(this).val() == '' || $(this).val() == preAssign) $(this).val(assign).trigger('chosen:updated');
- });
- preAssign = assign;
- });
-
- $('[data-toggle=tooltip]').tooltip();
-
- $(window).resize();
-
- /* Show team menu. */
- $('[name^=multiple]').change(function()
- {
- showTeamMenu();
- });
-
- $('#showAllModule').change(function()
- {
- var moduleID = $('#moduleIdBox #module').val();
- var extra = $(this).prop('checked') ? 'allModule' : '';
- $('#moduleIdBox').load(createLink('tree', 'ajaxGetOptionMenu', "rootID=" + executionID + '&viewType=task&branch=0&rootModuleID=0&returnType=html&fieldID=&needManage=0&extra=' + extra), function()
- {
- $('#module').val(moduleID).chosen();
- });
- });
-});
-
-$(document).on('click', '#testStory_chosen', function()
-{
- var $obj = $(this).prev('select');
- var value = $obj.val();
- if($obj.hasClass('filled')) return false;
-
- $obj.empty();
- for(storyID in stories)
- {
- pinyin = (typeof(storyPinYin) == 'undefined') ? '' : storyPinYin[storyID];
- html = "
";
- $obj.append(html);
- }
- $obj.val(value);
- $obj.addClass('filled');
- $obj.trigger("chosen:updated");
-})
-
-$('#modalTeam tfoot .btn').click(function()
-{
- var team = [];
- var time = 0;
- var error = false;
- var mode = $('[name="mode"]').val();
-
- $('select[name^=team]').each(function()
- {
- if($(this).val() == '') return;
-
- var tr = $(this).closest('tr');
- var account = $(this).find('option:selected').text();
- if(!team.includes(account)) team.push(account);
-
- estimate = parseFloat($(this).parents('td').next('td').find('[name^=teamEstimate]').val());
- if(!isNaN(estimate) && estimate > 0) time += estimate;
- if(account != '' && (isNaN(estimate) || estimate <= 0))
- {
- bootbox.alert(account + ' ' + estimateNotEmpty);
- error = true;
- return false;
- }
- });
-
- if(error) return false;
- if(team.length < 2)
- {
- bootbox.alert(teamMemberError);
- return false;
- }
- else
- {
- $('#teamMember').val(team);
- $('#estimate').val(time);
-
- if($('#modalTeam:hidden').length > 0) return ;
- $('#modalTeam .close').click();
- }
-});
-
-$(window).unload(function(){
- if(blockID) window.parent.refreshBlock($('#block' + blockID));
-});
-
-/**
- * Toggle checkBox Ditto Whether to hide.
- *
- * @param object $obj
- * @access public
- * @return void
- */
-function hiddenDitto(obj)
-{
- var $this = $(obj);
- var date = $this.val();
- var $ditto = $this.closest('div').find("input[type='checkBox']");
- if(date == '')
- {
- $ditto.attr('checked', true);
- $ditto.closest('.input-group-addon').show();
- }
- else
- {
- $ditto.removeAttr('checked');
- $ditto.closest('.input-group-addon').hide();
- }
-}
diff --git a/module/task/js/edit.js b/module/task/js/edit.js
deleted file mode 100644
index f869ce5228..0000000000
--- a/module/task/js/edit.js
+++ /dev/null
@@ -1,233 +0,0 @@
-$(function()
-{
- $('.record-estimate-toggle').modalTrigger({width:900, type:'iframe', afterHide: function(){parent.location.href=parent.location.href;}});
- if(!newRowCount) $('#taskTeamEditor tr.member').last().addClass('member-last');
-
- if($('#consumedSpan').parent().find('button').hasClass('disabled'))
- {
- $('#consumedSpan').parent().find('button').attr('disabled','disabled')
- }
-
- $('#mode').change(function()
- {
- var mode = $(this).val();
- if(mode != 'single')
- {
- if(mode != 'multi')
- {
- $('#assignedTo').attr('disabled', 'disabled').trigger('chosen:updated')
- }
- else
- {
- $('#assignedTo').removeAttr('disabled').trigger('chosen:updated')
- }
-
- $('.team-group').removeClass('hidden');
- $('#estimate').attr('readonly', 'readonly');
- $('#left').attr('readonly', 'readonly');
- }
- else
- {
- $('#assignedTo').removeAttr('disabled').trigger('chosen:updated')
- $('.team-group').addClass('hidden');
- $('#estimate').removeAttr('readonly');
- $('#left').removeAttr('readonly');
- }
- })
-})
-
-/**
- * Load module, stories and members.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadAll(executionID)
-{
- if(confirm(confirmChangeExecution))
- {
- loadModuleMenu(executionID);
- loadExecutionStories(executionID);
- loadExecutionMembers(executionID);
- }
- else
- {
- $('#execution').val(oldExecutionID);
- $("#execution").trigger("chosen:updated");
- }
-}
-
-/**
- * Load module of the execution.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadModuleMenu(executionID)
-{
- var link = createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + executionID + '&viewtype=task');
- $('#moduleIdBox').load(link, function(){$('#module').chosen();});
-}
-
-/**
- * Load stories of the execution.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadExecutionStories(executionID, moduleID)
-{
- if(typeof(moduleID) == 'undefined') moduleID = 0;
- var link = createLink('story', 'ajaxGetExecutionStories', 'executionID=' + executionID + '&productID=0&branch=0&moduleID=' + moduleID + '&storyID=' + oldStoryID);
- $('#storyIdBox').load(link, function(){$('#story').chosen();});
-}
-
-/**
- * Load team members of the execution.
- *
- * @param int $executionID
- * @access public
- * @return void
- */
-function loadExecutionMembers(executionID)
-{
- var link = createLink('execution', 'ajaxGetMembers', 'executionID=' + executionID + '&assignedTo=' + oldAssignedTo);
- $('#assignedToIdBox').load(link, function(){$('#assignedToIdBox').find('select').chosen()});
-}
-
-/* empty function. */
-function setPreview(){}
-
-$(document).ready(function()
-{
- $('#showAllModule').change(function()
- {
- var moduleID = $('#moduleIdBox #module').val();
- var extra = $(this).prop('checked') ? 'allModule' : '';
- $('#moduleIdBox').load(createLink('tree', 'ajaxGetOptionMenu', "rootID=" + executionID + '&viewType=task&branch=0&rootModuleID=0&returnType=html&fieldID=&needManage=0&extra=' + extra), function()
- {
- $('#moduleIdBox #module').val(moduleID).chosen();
- });
- });
-});
-
-$('#confirmButton').click(function()
-{
- var memberCount = '';
- var totalEstimate = 0;
- var totalConsumed = oldConsumed;
- var totalLeft = 0;
- var error = false;
- $('select[name^=team]').each(function()
- {
- if($(this).val() == '') return;
-
- memberCount++;
-
- var $tr = $(this).closest('tr');
- var account = $(this).find('option:selected').text();
-
- var estimate = parseFloat($tr.find('[name^=teamEstimate]').val());
- if(!isNaN(estimate)) totalEstimate += estimate;
- if(isNaN(estimate) || estimate <= 0)
- {
- bootbox.alert(account + ' ' + estimateNotEmpty);
- error = true;
- return false;
- }
-
- var consumed = parseFloat($tr.find('[name^=teamConsumed]').val());
- if(!isNaN(consumed)) totalConsumed += consumed;
-
- var $left = $tr.find('[name^=teamLeft]');
- var left = parseFloat($left.val());
- if(!isNaN(left)) totalLeft += left;
- if(!$left.prop('readonly') && (isNaN(left) || left <= 0) && team.length > 0)
- {
- bootbox.alert(account + ' ' + leftNotEmpty);
- error = true;
- return false;
- }
-
- if(estimate == 0 || isNaN(estimate))
- {
- $(this).val('').trigger("chosen:updated");
- bootbox.alert(estimateNotEmpty);
- error = true;
- return false;
- }
- })
-
- if(error) return false;
-
- if(memberCount < 2)
- {
- bootbox.alert(teamMemberError);
- return false;
- }
-
- if(totalLeft == 0 && (taskStatus == 'doing' || taskStatus == 'pause'))
- {
- bootbox.alert(totalLeftError);
- return false;
- }
-
- $('#estimate').val(totalEstimate);
- $('#consumedSpan').html(totalConsumed);
- $('#left').val(totalLeft);
- updateAssignedTo();
-
- $('.close').click();
-});
-
-/**
- * Update assignedTo.
- *
- * @access public
- * @return void
- */
-function updateAssignedTo()
-{
- var html = '';
- var mode = $('#mode').val();
- var assignedTo = $('#assignedTo').val();
- if(mode != 'single')
- {
- var isTeamMember = false;
- $('select[name^=team]').each(function()
- {
- if($(this).find('option:selected').text() == '') return;
- if($(this).val() == currentUser) isTeamMember = true;
-
- var account = $(this).find('option:selected').val();
- var realName = $(this).find('option:selected').text();
- var selected = account == assignedTo ? 'selected' : '';
-
- html += "
";
- });
-
- if(mode == 'multi' && isTeamMember && mode != 'linear')
- {
- $('[name=assignedTo]').removeAttr('disabled').trigger('chosen:updated');
- }
- else
- {
- $('[name=assignedTo]').attr('disabled', 'disabled').trigger('chosen:updated');
- }
- }
- else
- {
- for(key in members)
- {
- var selected = key == assignedTo ? 'selected' : '';
- html += "
";
- }
- }
-
- $('#assignedTo').html(html);
- if(mode != 'single' && mode == 'linear' && $('#modalTeam tr.member-doing').length == 0 && $('#modalTeam tr.member-wait').length >= 1) $('[name=assignedTo]').val($('#modalTeam tr.member-wait:first').find('select[name^=team]:first').val());
- $('#assignedTo').trigger('chosen:updated');
-}
diff --git a/module/task/js/editeffort.js b/module/task/js/editeffort.js
deleted file mode 100644
index 0cdda10b66..0000000000
--- a/module/task/js/editeffort.js
+++ /dev/null
@@ -1,19 +0,0 @@
-$(function()
-{
- $("#submit").click(function(e, confirmed)
- {
- if(confirmed) return true;
-
- var $this = $(this);
- var $left = $('#left');
- var left = $.trim($left.val());
- if(!$left.prop('readonly') && left == 0)
- {
- e.preventDefault();
- bootbox.confirm(confirmRecord, function(result)
- {
- if(result) $this.trigger('click', true);
- });
- }
- });
-})
diff --git a/module/task/js/finish.js b/module/task/js/finish.js
deleted file mode 100644
index 06a90a0e5b..0000000000
--- a/module/task/js/finish.js
+++ /dev/null
@@ -1,17 +0,0 @@
-$(function()
-{
- $('#currentConsumed').keyup(function()
- {
- var currentConsumed = $(this).val();
- if(!parseFloat(currentConsumed)) currentConsumed = 0;
- var totalConsumed = parseFloat(currentConsumed) + parseFloat(consumed);
- totalConsumed = Math.round(totalConsumed * 1000) / 1000;
- $('#totalConsumed').html(totalConsumed);
- $('#consumed').val(totalConsumed);
- })
-
- $('#submit').click(function()
- {
- if(task.consumed != 0 && $('#currentConsumed').val() == 0 && $('#currentConsumed').val() != '') return confirm(consumedEmpty);
- })
-})
diff --git a/module/task/js/recordworkhour.js b/module/task/js/recordworkhour.js
deleted file mode 100644
index b75e73c94a..0000000000
--- a/module/task/js/recordworkhour.js
+++ /dev/null
@@ -1,106 +0,0 @@
-$(function()
-{
- /* Set default tab. */
- if($.cookie('recordWorkhourType') == 'all')
- {
- $('#recordForm').addClass('hidden');
- $('.my-effort, #legendMyEffort').removeClass('active');
- $('.all-effort, #legendAllEffort').addClass('active');
- }
- else
- {
- $('.my-effort, #legendMyEffort').addClass('active');
- $('#recordForm').removeClass('hidden');
- }
- $.cookie('recordWorkhourType', null);
-
- $('.order-btn').on('click', function()
- {
- $.cookie('recordWorkhourType', 'all');
- });
-
- /* Hide creation logs when displaying team logs. */
- $('#linearefforts .tabs ul > li').click(function()
- {
- var tab = $(this).find('a').attr('href');
- $('#recordForm').toggleClass('hidden', tab == '#legendAllEffort');
- });
-
- $('.form-date').datetimepicker('setEndDate', today);
-
- $("#recordForm #submit").click(function(e, confirmed)
- {
- if(confirmed) return true;
-
- var $this = $(this);
- $('#recordForm .left').each(function()
- {
- if($(this).val() !== '' && !$(this).prop('readonly')) left = $(this).val();
- });
-
- if(typeof(left) != 'undefined' && left == '0')
- {
- e.preventDefault();
- bootbox.confirm(confirmRecord, function(result)
- {
- if(!result) $('#submit').attr("disabled", false);
- if(result) $this.trigger('click', true);
- });
- }
- });
-
- $('#recordForm .showinonlybody').each(function()
- {
- $(this).click(function()
- {
- var hasRecord = false;
- $('#recordForm').find('input[name^="consumed"], input[name^="left"], textarea[name^="work"]').each(function()
- {
- if($(this).val() !== '')
- {
- hasRecord = true;
- return false;
- }
- });
- if(hasRecord)
- {
- alert(noticeSaveRecord);
- return false;
- }
- });
- });
-
- $('#recordForm .date-group .input-group-addon').on('click', function()
- {
- $(this).prev().datetimepicker('show');
- });
-
- $('#toggleFoldIcon').click(function()
- {
- var fold = $(this).find('.icon-angle-down').length > 0;
- var $icon = $(this).find('.icon-border > i');
- var $text = $(this).find('.text');
-
- $.cookie('taskEffortFold', fold ? 0 : 1);
-
- if(fold)
- {
- /* Update icon and text. */
- $icon.removeClass('icon-angle-down')
- .addClass('icon-angle-top');
- $text.text(foldEffort);
-
- /* Show all efforts. */
- $('.taskEffort > tbody > tr').removeClass('hidden');
- }
- else
- {
- $icon.removeClass('icon-angle-top')
- .addClass('icon-angle-down');
- $text.text(unfoldEffort);
-
- /* Efforts whose number is greater than 3 are hidden. */
- $('.taskEffort > tbody > tr').filter(':gt(2)').addClass('hidden');
- }
- });
-})
diff --git a/module/task/js/report.js b/module/task/js/report.js
deleted file mode 100644
index db319175bf..0000000000
--- a/module/task/js/report.js
+++ /dev/null
@@ -1,19 +0,0 @@
-$(function()
-{
- var resizeChartTable = function()
- {
- $('.table-wrapper').each(function()
- {
- var $this = $(this);
- $this.css('max-height', $this.closest('.table').find('.chart-wrapper').outerHeight());
- });
- };
- resizeChartTable();
- $(window).resize(resizeChartTable);
-});
-
-function changeChartType(type)
-{
- $('form').attr('action', createLink('task', 'report', 'executionID=' + executionID + '&browseType=' + browseType + '&chartType=' + type));
- $('form').find('#submit').click();
-}
diff --git a/module/task/js/start.js b/module/task/js/start.js
deleted file mode 100644
index 034f6c87a7..0000000000
--- a/module/task/js/start.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* If left = 0, warning. */
-function checkLeft()
-{
- var left = parseFloat($("#left").val());
- var consumed = parseFloat($("#consumed").val());
- if(!left)
- {
- var result;
- if(!consumed)
- {
- alert(noticeTaskStart);
- result = false;
- }
- else
- {
- result = confirm(confirmFinish);
- }
- if(!result) setTimeout(function() {$.enableForm()}, 50);
- return result;
- }
-}
diff --git a/module/task/js/view.js b/module/task/js/view.js
deleted file mode 100644
index 4dc0953f1a..0000000000
--- a/module/task/js/view.js
+++ /dev/null
@@ -1,31 +0,0 @@
-$(function()
-{
- if(config.onlybody == 'yes') $('.main-actions').css('width', '100%');
- limitIframeLevel();
-});
-
-function assign(taskID, assignedTo)
-{
- $('.assign').width(150);
- $('.assign').height(40);
- $('.assign').load(createLink('user', 'ajaxGetUser', 'taskID=' + taskID + '&assignedTo=' + assignedTo));
-}
-
-/**
- * Ajax refresh
- *
- * @access public
- * @return void
- */
-function ajaxRefresh()
-{
- $.get(location.href, function(data)
- {
- $data = $(data);
- $('#actionbox ol.histories-list').html($data.find('#actionbox ol.histories-list').html());
- $('#actionbox ol.histories-list form.comment-edit-form').ajaxForm();
- $('.side-col').html($data.find('.side-col').html());
-
- if($('#actionbox ol.histories-list #lastComment').length > 0) $('#actionbox ol.histories-list #lastComment').kindeditor();
- });
-}
diff --git a/module/testcase/css/automation.css b/module/testcase/css/automation.css
deleted file mode 100644
index dc2b387672..0000000000
--- a/module/testcase/css/automation.css
+++ /dev/null
@@ -1 +0,0 @@
-table a.refresh {border-color: white;}
diff --git a/module/testcase/css/batchcreate.css b/module/testcase/css/batchcreate.css
deleted file mode 100644
index e1d1f5b20c..0000000000
--- a/module/testcase/css/batchcreate.css
+++ /dev/null
@@ -1,18 +0,0 @@
-.w-300px {width: 300px;}
-.w-180px {width: 180px;}
-.half-left {text-align: right;}
-.half-right {text-align: left;}
-
-#batchCreateForm .input-group,
-#batchCreateForm .input-group .form-control {position: static;}
-#batchCreateForm .input-group .colorpicker {z-index: 2;}
-#batchCreateForm .input-group .colorpicker.open {z-index: 5;}
-
-.c-id {width: 50px;}
-.c-pri, .c-keywords {width: 100px;}
-.c-branch, .c-type, .c-scene {width: 120px;}
-.c-stage {width: 140px;}
-.c-precondition {width: 150px;}
-.c-story {width: 180px;}
-.c-review{width: 105px;}
-.c-actions {width: 60px;}
diff --git a/module/testcase/css/batchedit.css b/module/testcase/css/batchedit.css
deleted file mode 100644
index f7ee826255..0000000000
--- a/module/testcase/css/batchedit.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.w-340px {width: 340px;}
-.chosen {z-index: 99;}
-
-#batchEditForm .input-group,
-#batchEditForm .input-group .form-control {position: static;}
-#batchEditForm .input-group .colorpicker {z-index: 2;}
-#batchEditForm .input-group .colorpicker.open {z-index: 5;}
-
-.c-id {width: 50px;}
-.c-pri, .c-keywords, .c-review {width: 100px;}
-.c-branch, .c-type, .c-scene {width: 120px;}
-.c-stage {width: 140px;}
-.c-precondition {width: 150px;}
-.c-story {width: 180px;}
diff --git a/module/testcase/css/browse.css b/module/testcase/css/browse.css
deleted file mode 100644
index 9be97aa3b6..0000000000
--- a/module/testcase/css/browse.css
+++ /dev/null
@@ -1,48 +0,0 @@
-body {margin-bottom: 25px;}
-.w-220px {width: 220px;}
-.w-170px {width: 170px;}
-
-#createActionMenu .dropdown-menu {width: 100%;}
-#caseForm table tbody tr td {overflow: hidden; white-space: nowrap;}
-#caseForm .setting {height: 25px;}
-#caseForm table tbody .c-name {overflow: hidden; padding-right: 65px;}
-#caseForm table tbody .c-name a:first-child {overflow: hidden; display: inline-block; max-width: 100%;}
-
-.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
-.dropdown-menu > .menu-search .input-group {width: 100%;}
-.dropdown-menu > .menu-search .input-group-addon {position: absolute; right: 10px; top: 0; z-index: 10; background: none; border: none; color: #666;}
-.dropdown-menu > .menu-search .form-control {border: none !important; box-shadow: none !important; border-top: 1px solid #ddd !important;}
-.dropdown-list {display: block; padding: 0; max-height: 270px; overflow-y: auto;}
-.dropdown-list > li > a {display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.53846154; color: #141414; white-space: nowrap;}
-.dropdown-list > li > a:hover,
-.dropdown-list > li > a:focus {color: #1a4f85; text-decoration: none; background-color: #ddd;}
-
-.pl-5px {padding-left: 5px;}
-
-tbody > tr > td > .btn-icon {margin-right: 3px;}
-tbody > tr > td .icon-share {font-size: 9px;}
-
-.table td.c-title > a:first-child {display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
-
-#importToLib .select-lib {width: 100px; text-align: right;}
-#subHeader #currentBranch + #dropMenu .col-left {padding-bottom: 30px;}
-.status-blocked {left: -5px;}
-
-#mainMenu .pull-left .dividing-line {margin: 7px 5px 0 0;}
-.btn-toolbar>.btn, .btn-toolbar>.btn-group, .btn-toolbar>.dropdown {margin-right: 5px;}
-
-#mainMenu > .btn-toolbar > .checkbox-primary{float: left;}
-
-.table-nest-icon { cursor: pointer; }
-
-.tr-moving { opacity: 0.3; }
-
-.tr-acceptable { border: 2px solid rgba(255,0,0,0.5); }
-
-.none-select { -webkit-user-select: none; -moz-user-select: none; -moz-user-select: none; user-select: none; }
-
-.table-nest-toggle { vertical-align: middle; }
-
-.table-nest-title .icon-test { pointer-events: none; }
-
-.icon-test:after { border: 0px solid!important; }
diff --git a/module/testcase/css/bugs.css b/module/testcase/css/bugs.css
deleted file mode 100644
index 08a8efda8a..0000000000
--- a/module/testcase/css/bugs.css
+++ /dev/null
@@ -1,5 +0,0 @@
-body {background: white;}
-.bugsList {padding: 10px;}
-.bugsList .table {border: 1px solid #ddd;}
-.c-id {width: 50px;}
-.c-user {width: 70px;}
diff --git a/module/testcase/css/create.css b/module/testcase/css/create.css
deleted file mode 100644
index e33773049c..0000000000
--- a/module/testcase/css/create.css
+++ /dev/null
@@ -1,48 +0,0 @@
-#searchStories .searchInput {position: relative;}
-#searchStories .searchInput .icon {position: absolute; display: block; left: 9px; top: 9px; z-index: 5; color: #808080;}
-#storySearchInput {padding-left: 30px;}
-
-#searchStories .modal-body {height: 300px; overflow-y: auto !important; padding: 0;}
-#searchResult {padding-left: 0; list-style: none; width: 100%;}
-#searchResult > li {display: block;}
-#searchResult > li.tip {padding: 6px 15px; color: #808080;}
-#searchResult > li.loading {text-align: center; padding: 50px;}
-#searchResult > li.loading > .icon-spinner:before {font-size: 28px;}
-#searchResult > li > a {display: block; padding: 6px 15px; color: #333; border-bottom: 1px solid #e5e5e5;}
-#searchResult > li > a:hover, #searchResult > li > a.selected {color: #1a4f85; background-color: #ddd;}
-
-#story_chosen .chosen-results > li.no-results {cursor: pointer;}
-#story_chosen .chosen-results > li.no-results:hover {color: #1a4f85; background-color: #ddd;}
-#story_chosen .chosen-results > li.no-results > span {font-weight: bold;}
-#type_chosen {display: table-cell;}
-
-.row .col-sm-10 {width: 89%;}
-.row .col-sm-2 {padding-left: 0px; width: 11%;}
-
-#module + .chosen-container-single .chosen-single,
-#stage + .chosen-container-multi .chosen-choices {border-top-left-radius: 0; border-bottom-left-radius: 0;}
-#module + .chosen-container-single .chosen-single {border-top-right-radius: 0; border-bottom-right-radius: 0;}
-
-.dropdown-pris > .btn {background-color: #fff; text-shadow: none;}
-
-#moduleIdBox .input-group-btn > .btn:first-child {border-left: none;}
-
-.chosen-container {max-width: 1000px;}
-
-.minw-80px {min-width: 80px;}
-
-.colorpicker.input-group-btn > .btn {border-right: none;}
-
-#branch {border-left-width: 0px;}
-
-.input-group-addon.w-80px {min-width: 80px;}
-
-.title-group.required:after {display: none;}
-.title-group.required > .required:after {display: block; right: 29px; top: 5px;}
-#titleBox.required:after{display: block; right: 29px; top: 5px;}
-#priRequiredBox.required:after{display: block; right: -12px; top: 10px;}
-.pri-selector > .btn {padding: 5px 8px !important; width: 100%;}
-.pri-selector > .dropdown-menu {padding: 10px;}
-.stageBox {padding-left: 15px !important;}
-
-#refresh {margin-left: 7px;}
diff --git a/module/testcase/css/createbug.css b/module/testcase/css/createbug.css
deleted file mode 100644
index a26e339dd1..0000000000
--- a/module/testcase/css/createbug.css
+++ /dev/null
@@ -1,21 +0,0 @@
-body {padding: 15px;}
-.table {margin-bottom: 5px;}
-.table > thead > tr > th {border-top: 1px solid #ddd;}
-.table > thead > tr > th:first-child,
-.table > tbody > tr > td:first-child {border-left: 1px solid #ddd;}
-.table > thead > tr > th:last-child,
-.table > tbody > tr > td:last-child {border-right: 1px solid #ddd;}
-.table tfoot td {border-bottom: none;}
-.table-actions {float: none; padding: 10px 0 0 0;}
-.table-actions .checkbox.btn {padding: 6px 11px;}
-
-.resultSteps .step-id {text-align: right;}
-.resultSteps .step-item-id {background-color: transparent; border: none; display: none; width: 30px; padding-left: 0; padding-right: 0; text-align: right; padding-right: 8px;}
-.resultSteps .checkbox-inline input[type="checkbox"] {top: -2px;}
-.resultSteps .btn-group .btn {padding-left: 0; padding-right: 0; min-width: 30px;}
-.resultSteps .step-actions {width: 98px;}
-.resultSteps .active td {transition: background-color .5s;}
-.resultSteps .step-group .step-steps {resize: none; max-height: 30px;}
-.resultSteps .step-group .step-expects {display: none;}
-.resultSteps .step-item .step-item-id {display: table-cell;}
-.resultSteps .step-item .step-id {color: transparent;}
diff --git a/module/testcase/css/edit.css b/module/testcase/css/edit.css
deleted file mode 100644
index e0eeacd744..0000000000
--- a/module/testcase/css/edit.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.col-side .chosen-container .chosen-drop {width: 216px !important;}
-.col-side .chosen-container {width: 218px !important;}
-.table-form > tbody > tr > td .btn.addbutton {display: block; margin: 1px 0px; width: 40px; padding: 1px 6px;}
-.table-form > tbody > tr > td .btn.delbutton {display: block; margin: 1px 0px; width: 40px; padding: 1px 6px;}
-#branch {width: 95px!important;}
-.detail > table > tbody th {width: 100px !important;}
-[lang^=en] .detail > table > tbody th, [lang^=fr] .detail > table > tbody th {width: 100px !important;}
-[lang^=de] .detail > table > tbody th {width: 125px !important;}
-.linkCaseTitle, .linkBugTitle {white-space: nowrap;}
-#type_chosen{display: table-cell;}
-.autoScript .file-input .file-title{max-width: 70px;}
-
-@media screen and (max-width: 1366px) {
- #module_chosen{min-width: 60px;}
-}
-
diff --git a/module/testcase/css/groupcase.css b/module/testcase/css/groupcase.css
deleted file mode 100644
index 43d054bbf6..0000000000
--- a/module/testcase/css/groupcase.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.title {white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
-.group-header > a {line-height: 20px; display: block; max-height: 40px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}
-.c-result {width: 80px;}
-.c-bugs, .c-results, .c-steps {width: 30px;}
-
-#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
-#subHeader #dropMenu .col-left {padding-bottom: 0px;}
-#currentBranch + #dropMenu .col-left {padding-bottom: 30px;}
diff --git a/module/testcase/css/importfromlib.css b/module/testcase/css/importfromlib.css
deleted file mode 100644
index 6bcfd96cdc..0000000000
--- a/module/testcase/css/importfromlib.css
+++ /dev/null
@@ -1 +0,0 @@
-#mainMenu .chosen-container .chosen-drop {width: 300px;}
diff --git a/module/testcase/css/importtolib.css b/module/testcase/css/importtolib.css
deleted file mode 100644
index 5dfb109355..0000000000
--- a/module/testcase/css/importtolib.css
+++ /dev/null
@@ -1,4 +0,0 @@
-#libs {height: 180px; padding-top: 20px;}
-#libs .select-lib {width: 100px; text-align: right;}
-#libs .chosen-results {max-height: 110px;}
-#libs tr > td.text-center {padding-top: 15px;}
diff --git a/module/testcase/css/linkbugs.css b/module/testcase/css/linkbugs.css
deleted file mode 100644
index d0b4b319fe..0000000000
--- a/module/testcase/css/linkbugs.css
+++ /dev/null
@@ -1 +0,0 @@
-#mainContent {min-height: 400px;}
diff --git a/module/testcase/css/linkcases.css b/module/testcase/css/linkcases.css
deleted file mode 100644
index b5a0ad4517..0000000000
--- a/module/testcase/css/linkcases.css
+++ /dev/null
@@ -1,2 +0,0 @@
-#mainContent {min-height: 400px;}
-.table-actions {padding-left: 0;}
diff --git a/module/testcase/css/showimport.css b/module/testcase/css/showimport.css
deleted file mode 100644
index 7eab9034f6..0000000000
--- a/module/testcase/css/showimport.css
+++ /dev/null
@@ -1,13 +0,0 @@
-.table table td,.outer .table table tbody > tr:last-child td {padding: 2px 0 2px 5px !important; border: none !important;}
-.c-name{width: 120px;}
-.c-branch {width: 120px;}
-.c-line-number {width: 50px;}
-.c-id {width: 40px;}
-.c-story, .c-module, .c-type {width: 120px;}
-.c-stage {width: 160px;}
-.c-condition {width: 80px;}
-.c-keywords {width: 70px;}
-.c-step {width: 300px;}
-.form-actions .btn {margin-right: 20px;}
-.table td textarea {height: 32px;}
-sub {vertical-align: baseline !important;}
diff --git a/module/testcase/css/showscript.css b/module/testcase/css/showscript.css
deleted file mode 100644
index 3d4f16e6b9..0000000000
--- a/module/testcase/css/showscript.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.repoCode pre {margin: 0; padding: 0; background: white; border: none;}
-.repoCode pre > table > tbody > tr > th, .repoCode pre > table > tbody > tr > td {padding: 1px 3px;}
-.repoCode pre > table > tbody > tr > th {border-right: 1px solid #E4E4E4; background: #fafafa; color: #999; width: 40px; text-align: right; vertical-align: top;}
diff --git a/module/testcase/css/showxmindimport.css b/module/testcase/css/showxmindimport.css
deleted file mode 100644
index c1849f53cd..0000000000
--- a/module/testcase/css/showxmindimport.css
+++ /dev/null
@@ -1,110 +0,0 @@
-.mindmap-container
-{
- border: none !important;
-}
-
-.mindmap-node
-{
- display: flex;
- align-items: center;
-}
-
-.pri-level,.testcase-pri-root a
-{
- border-width: 2px;
- border-style: solid;
- border-radius: 50%;
- width: 20px;
- height: 20px;
- text-align:center;
- line-height:16px;
- display: block;
-}
-
-.pri-1
-{
- color: #d50000;
- border-color: #d50000;
-}
-
-.pri-2
-{
- color: #ff9800;
- border-color: #ff9800;
-}
-
-.pri-3
-{
- color: #2098ee;
- border-color: #2098ee;
-}
-
-.pri-4
-{
- color: #009688;
- border-color: #009688;
-}
-
-.pri-empty
-{
- background-color: lightgray;
-}
-
-.testcase-pri-root a
-{
- margin: 8px;
-}
-
-.testcase-pri-root
-{
- display: flex;
- position: absolute;
- padding-left: 10px;
- padding-right: 10px;
- z-index: 20;
-}
-
-.effect
-{
- z-index: 15;
- box-shadow:0px 1px 4px rgba(0,0,0,0.8),0px 0px 40px rgba(0,0,0,0.1) inset;
- background-color: white;
-}
-
-.effect a
-{
- width: 24px;
- height: 24px;
- line-height: 20px;
-}
-
-.effect:before,.effect:after
-{
- content:"";
- border-radius:100px/10px;
- box-shadow:0 0px 20px rgba(0,0,0,0.8);
-}
-
-.scene-indicator
-{
- margin-left: 5px;
- color: lightgray;
-}
-
-.scene-indicator-yes
-{
- color: darkgreen;
-}
-
-.suffix
-{
- color: darkred;
- display: none;
-}
-
-#productName
-{
- height: 32px;
- width: 100%;
- padding-left: 10px;
-}
diff --git a/module/testcase/css/view.css b/module/testcase/css/view.css
deleted file mode 100644
index 99c8213415..0000000000
--- a/module/testcase/css/view.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.table-fixed td {white-space: unset;}
-#tabsNav .tab-pane>.cell + .cell {border-top: 1px solid #cbd0db; border-radius: 4px;}
-
-.case-fullscreen .main-row > .side-col {width: 0; position: relative; overflow: hidden;}
-.case-fullscreen .fullscreen-btn > .icon-fullscreen:before {content: '\e972';}
-.linkCaseTitles, .linkBugTitles {overflow: hidden; white-space: nowrap;}
diff --git a/module/testcase/css/zerocase.css b/module/testcase/css/zerocase.css
deleted file mode 100644
index 52b81c0521..0000000000
--- a/module/testcase/css/zerocase.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
-#subHeader #dropMenu .col-left {padding-bottom: 0px;}
-#currentBranch + #dropMenu .col-left {padding-bottom: 30px;}
diff --git a/module/testcase/js/automation.js b/module/testcase/js/automation.js
deleted file mode 100644
index 29a66f56fc..0000000000
--- a/module/testcase/js/automation.js
+++ /dev/null
@@ -1,8 +0,0 @@
-function loadNodes()
-{
- var nodeLink = createLink('zanode', 'ajaxGetNodes');
- $('#nodeIdBox').load(nodeLink, function()
- {
- $('#nodeIdBox').find('#node').picker();
- });
-}
diff --git a/module/testcase/js/batchcreate.js b/module/testcase/js/batchcreate.js
deleted file mode 100644
index 8e0e217daf..0000000000
--- a/module/testcase/js/batchcreate.js
+++ /dev/null
@@ -1,131 +0,0 @@
-$(document).ready(function()
-{
- removeDitto();//Remove 'ditto' in first row.
- var $title = $('#batchCreateForm table thead tr th.c-title');
- if($title.width() < 170) $title.width('170');
-
- $(document).keydown(function(event)
- {
- if(event.ctrlKey && event.keyCode == 38)
- {
- event.stopPropagation();
- event.preventDefault();
- selectFocusJump('up');
- }
- else if(event.ctrlKey && event.keyCode == 40)
- {
- event.stopPropagation();
- event.preventDefault();
- selectFocusJump('down');
- }
- else if(event.keyCode == 38)
- {
- inputFocusJump('up');
- }
- else if(event.keyCode == 40)
- {
- inputFocusJump('down');
- }
- });
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-
- /* Implement a custom form without feeling refresh. */
- $('#formSettingForm .btn-primary').click(function()
- {
- saveCustomFields('batchCreateFields', 8, $title, 170);
- return false;
- });
-});
-
-function findRealRowIndex(num)
-{
- var $sel = $('#module' + num);
- var $tr = $sel.closest("tr");
- return $tr.get(0).rowIndex-1;
-}
-
-function findModuleID(moduleID, num)
-{
- if(moduleID != "ditto")
- return moduleID;
-
- var rIndex = findRealRowIndex(num);
-
- var trList = $("#tableBody").find("tbody").find("tr");
- for(var i=rIndex-1; i>=0; i--)
- {
- var currentID = $(trList[i]).find("td:eq(2)").find("select").val();
- if(currentID != "ditto")
- {
- moduleID = currentID;
- break;
- }
- }
-
- return moduleID;
-}
-
-function canSceneDitto(num)
-{
- var rIndex = findRealRowIndex(num);
- if(rIndex == 0) return false;
-
- var trList = $("#tableBody").find("tbody").find("tr");
-
- var rawModule = $(trList[rIndex]).find("td:eq(2)").find("select").val();
- var preModule = $(trList[rIndex-1]).find("td:eq(2)").find("select").val();
-
- return rawModule == "ditto" || rawModule == preModule;
-}
-
-function onModuleChanged(productID, moduleID, num)
-{
- loadStories(productID, moduleID, num);
- loadScenes(productID, moduleID, num);
-}
-
-function loadScenes(productID, moduleID, num)
-{
- moduleID = findModuleID(moduleID, num);
-
- var branchIDName = (config.currentMethod == 'batchcreate' || config.currentMethod == 'showimport') ? '#branch' : '#branches';
- var branchID = $(branchIDName + num).val();
- var sceneLink = createLink('testcase', 'ajaxGetScenesForBC', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&stype=2&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&number=' + num);
- $.get(sceneLink, function(scenes)
- {
- if(!scenes) scenes = '
';
- if(config.currentMethod == 'batchcreate')
- {
- for(var i = num; i <= rowIndex ; i ++)
- {
- //if(i != num && $('#scene' + i).val() != 'ditto') break;
-
- var nowScenes = scenes.replaceAll('scene' + num, 'scene' + i);
- $('#scene' + i).replaceWith(nowScenes);
- if(canSceneDitto(i) == false) $('#scene' + i).find("option:last").remove();
- $('#scene' + i + "_chosen").remove();
- $('#scene' + i).next('.picker').remove();
- $('#scene' + i).attr('name', 'scene[' + i + ']');
- $('#scene' + i).picker();
-
- if (i != num)
- {
- var myPicker = $('#scene' + i).data('zui.picker');
- myPicker && myPicker.setValue("ditto");
- }
- }
- }
- else
- {
- $('#scene' + num).replaceWith(scenes);
- $('#scene' + num + "_chosen").remove();
- $('#scene' + num).next('.picker').remove();
- $('#scene' + num).attr('name', 'scene[' + num + ']');
- $('#scene' + num).picker();
- }
- });
-}
diff --git a/module/testcase/js/batchedit.js b/module/testcase/js/batchedit.js
deleted file mode 100644
index 7a37699ddf..0000000000
--- a/module/testcase/js/batchedit.js
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Set duplicate field.
- *
- * @param string $resolution
- * @param int $storyID
- * @access public
- * @return void
- */
-function setDuplicateAndChild(resolution, storyID)
-{
- if(resolution == 'duplicate')
- {
- $('#childStoryBox' + storyID).hide();
- $('#duplicateStoryBox' + storyID).show();
- }
- else if(resolution == 'subdivided')
- {
- $('#duplicateStoryBox' + storyID).hide();
- $('#childStoryBox' + storyID).show();
- }
- else
- {
- $('#duplicateStoryBox' + storyID).hide();
- $('#childStoryBox' + storyID).hide();
- }
-}
-
-/**
- * Load branches.
- *
- * @param int product
- * @param int branch
- * @param int caseID
- * @param int oldBranch
- * @access public
- * @return void
- */
-function loadBranches(product, branch, caseID, oldBranch)
-{
- if(typeof(branch) == 'undefined') branch = 0;
- if(!branch) branch = 0;
-
- var result = true;
- if(branch)
- {
- var endLoop = false;
- for(index in testtasks)
- {
- if(endLoop) break;
- if(index == caseID)
- {
- endLoop = true;
- for(taskID in testtasks[index])
- {
- if(branch != oldBranch && testtasks[index][taskID]['branch'] != branch)
- {
- var tip = confirmUnlinkTesttask.replace("%s", caseID);
- result = confirm(tip);
- if(!result) $('#branches' + caseID).val(oldBranch).trigger("chosen:updated");
- break;
- }
- }
- }
- }
- }
-
- if(result)
- {
- var currentModuleID = $('#modules' + caseID).val();
- moduleLink = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + product + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&fieldID=' + caseID + '&needManage=false&extra=nodeleted¤tModuleID=' + currentModuleID);
- $('#modules' + caseID).parent('td').load(moduleLink, function()
- {
- $("#modules" + caseID).attr('onchange', "loadStories("+ product + ", this.value, " + caseID + ")").chosen();
- });
-
- loadStories(product, 0, caseID);
- }
-}
-
-$(document).ready(function()
-{
- /* Set secondary menu highlighting. */
- if(isLibCase)
- {
- $('#navbar li[data-id=caselib]').addClass('active');
- $('#navbar li[data-id=testcase]').removeClass('active');
- }
-})
-
-$(function()
-{
- removeDitto(); //Remove 'ditto' in first row.
- if($('th.c-title').width() < 150) $('th.c-title').width(150);
- $('#subNavbar li[data-id="testcase"]').addClass('active');
- if(hasStory)
- {
- $("[name^='story']").each(function()
- {
- var id = $(this).attr('id');
- var num = id.substring(5);
- var moduleID = $('#modules' + num).val();
- var branchID = typeof($('#branches' + num).val()) == 'undefined' ? 0 : $('#branches' + num).val();
- var storyID = $("#story" + num).val();
- var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=' + storyID +'&onlyOption=false&status=noclosed&limit=0&type=full&hasParent=1&executionID=0&number=' + num);
- $.get(storyLink, function(stories)
- {
- if(!stories) stories = '
';
- $('#story' + num).replaceWith(stories);
- $('#story' + num + "_chosen").remove();
- $('#story' + num).next('.picker').remove();
- $('#story' + num).attr('name', 'story[' + num + ']').picker();
- });
- });
- }
-
- $('#customField').click(function()
- {
- hiddenRequireFields();
- });
-});
-
-$(document).on('click', '.chosen-with-drop', function(){oldValue = $(this).prev('select').val();})//Save old value.
-
-/* Set ditto value. */
-$(document).on('change', 'select', function()
-{
- if($(this).val() == 'ditto')
- {
- var index = $(this).closest('td').index();
- var row = $(this).closest('tr').index();
- var tbody = $(this).closest('tr').parent();
-
- var value = '';
- for(i = row - 1; i >= 0; i--)
- {
- value = tbody.children('tr').eq(i).find('td').eq(index).find('select').val();
- if(value != 'ditto') break;
- }
-
- if($(this).attr('name').indexOf('modules') != -1)
- {
- var valueStr = ',' + $(this).find('option').map(function(){return $(this).val();}).get().join(',') + ',';
- if(valueStr.indexOf(',' + value + ',') != -1)
- {
- $(this).val(value);
- }
- else
- {
- alert(dittoNotice);
- $(this).val(oldValue);
- }
- }
- else
- {
- $(this).val(value);
- }
-
- $(this).trigger("chosen:updated");
- $(this).trigger("change");
- }
-});
-
-function loadStories2(productID, moduleID, num)
-{
- var branchIDName = (config.currentMethod == 'batchcreate' || config.currentMethod == 'showimport') ? '#branch' : '#branches';
- var branchID = $(branchIDName + num).val();
- var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
- $.get(storyLink, function(stories)
- {
- if(!stories) stories = '
';
- if(config.currentMethod == 'batchcreate')
- {
- for(var i = num; i < 10 ; i ++)
- {
- if(i != num && $('#module' + i).val() != 'ditto') break;
- var nowStories = stories.replaceAll('story' + num, 'story' + i);
- $('#story' + i).replaceWith(nowStories);
- $('#story' + i + "_chosen").remove();
- $('#story' + i).next('.picker').remove();
- $('#story' + i).attr('name', 'story[' + i + ']');
- $('#story' + i).chosen();
- }
- }
- else
- {
- $('#story' + num).replaceWith(stories);
- $('#story' + num + "_chosen").remove();
- $('#story' + num).next('.picker').remove();
- $('#story' + num).attr('name', 'story[' + num + ']');
- $('#story' + num).chosen();
- }
- });
-
- branch = 0;
- link = createLink('testcase', 'ajaxGetModuleScenes', 'productID=' + productID + '&branch=' + branch + '&moduleID=' + moduleID + '&stype=2&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&number=' + num);
- $.get(link, function(scenes){
- if(!scenes) scenes = '
';
- if(config.currentMethod == 'batchcreate')
- {
- for(var i = num; i < 10 ; i ++)
- {
- if(i != num && $('#module' + i).val() != 'ditto') break;
- var nowScenes = scenes.replaceAll('scene' + num, 'scene' + i);
- $('#scene' + i).replaceWith(nowScenes);
- $('#scene' + i + "_chosen").remove();
- $('#scene' + i).next('.picker').remove();
- $('#scene' + i).attr('name', 'scene[' + i + ']');
- $('#scene' + i).chosen();
- }
- }
- else
- {
- $('#scene' + num).replaceWith(scenes);
- $('#scene' + num + "_chosen").remove();
- $('#scene' + num).next('.picker').remove();
- $('#scene' + num).attr('name', 'scene[' + num + ']');
- $('#scene' + num).chosen();
- }
- });
-}
diff --git a/module/testcase/js/browse.js b/module/testcase/js/browse.js
deleted file mode 100644
index 84aa8406b6..0000000000
--- a/module/testcase/js/browse.js
+++ /dev/null
@@ -1,652 +0,0 @@
-/**
- * Confirm batch delete cases.
- *
- * @param string $actionLink
- * @access public
- * @return void
- */
-function confirmBatchDelete(actionLink)
-{
- if(confirm(batchDelete)) setFormAction(actionLink);
- return false;
-}
-
-$(function()
-{
- if($('#caseList thead th.c-title').width() < 150) $('#caseList thead th.c-title').width(150);
-
- /* The display of the adjusting sidebarHeader is synchronized with the sidebar. */
- $(".sidebar-toggle").click(function()
- {
- $("#sidebarHeader").toggle("fast");
- });
- if($("main").is(".hide-sidebar")) $("#sidebarHeader").hide();
-
- $('#importToLib').on('click', function()
- {
- var storyIdList = '';
- $("input[name^='caseIDList']:checked").each(function()
- {
- storyIdList += $(this).val() + ',';
- $('#caseIdList').val(storyIdList);
- });
- });
-
- $('input[name^="showAutoCase"]').click(function()
- {
- var showAutoCase = $(this).is(':checked') ? 1 : 0;
- $.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
- window.location.reload();
- });
-});
-
-var runCase = false;
-/**
- * Define triggerModal hidden event.
- *
- * @access public
- * @return void
- */
-function triggerHidden()
-{
- $('#triggerModal').on('hidden.zui.modal', function()
- {
- if(runCase == true) window.location.reload();
- });
-}
-
-//sort js
-var DtSort = {};
-
-DtSort.defaultConfig = {
- idAttrName: 'data-id',
- parentAttrName: 'data-parent',
- dataNestedAttrName: 'data-nested',
- nestPathAttrName: 'data-nest-path',
- dataTypeAttrName: 'data-itype',
- moveBuffer: 2,
- canAccept: function(source, target,sameLevel, sourceMgr, targetMgr){return target.dataNested == "true";},
- canMove: function(source, sourceMgr){return source.dataNested != "true";},
- finish: function(source, target, sameLevel , sourceMgr, targetMgr){},
- movingClass: 'tr-moving',
- acceptableClass: 'tr-acceptable',
- indicatorYOffset: 0.5
-};
-
-DtSort.Table = function(options)
-{
- this.options = $.extend({},DtSort.defaultConfig, options);
-
- this.indicator = undefined;
-
- this.sourceRow = undefined;
- this.targetRow = undefined;
-
- this.mousePress = false;
-
- if(this.options.container == undefined)
- return;
-
- this.$container = $(this.options.container);
-
- this.overRow = undefined;
- this.downPosition = undefined;
- this.rowList = [];
-
- this.init();
-
- var that = this;
- //解决表格展开折叠按钮单击导致checkbox自动选中功能,临时先放在这里
- this.$container.find("tr").on("click",'.table-nest-toggle', function(e)
- {
- e.stopPropagation();
- var table = $('#caseForm').data('zui.table');
- var $row = $(e.currentTarget).closest("tr");
- var dataId = $row.attr("data-id");
- table.toggleNestedRows(dataId,undefined,true);
- that.measure();
- })
-}
-
-DtSort.Table.prototype.init = function()
-{
- var that = this;
-
- $(document).on("mousedown", this.options.container, function(e){
- that.mousePress = true;
- that.mouseDown(DtSort.tools.mousePos(e));
- });
-
- $(document).on("mousemove", this.options.container, function(e){
- that.mouseMove(DtSort.tools.mousePos(e));
- });
-
- $(document).on("mouseup", function(e){
- that.mouseUp(DtSort.tools.mousePos(e));
- that.mousePress = false;
- });
-
- $(window).resize(function(){
- that.measure();
- })
-
- that.measure();
-}
-
-DtSort.Table.prototype.measure = function()
-{
- this.rowList = [];
-
- var $rows = this.$container.find("tr");
- for(var i=0;i<$rows.length;i++)
- {
- $row = $($rows[i]);
-
- var rowIndex = i;
- var id = $row.attr(this.options.idAttrName);
- var parent = $row.attr(this.options.parentAttrName);
- var dataNested = $row.attr(this.options.dataNestedAttrName);
- var nestPath = $row.attr(this.options.nestPathAttrName);
- var dataType = $row.attr(this.options.dataTypeAttrName);
-
- var pos = DtSort.tools.elementPos($rows[i]);
- var size = DtSort.tools.elementSize($rows[i]);
-
- if($row.hasClass("table-nest-hide") && i>0)
- {
- size = {w:this.rowList[0].boundary.w, h:this.rowList[0].boundary.h};
- }
-
- if(dataNested == "true" && nestPath == undefined)
- nestPath = "," + id + ",";
-
- this.rowList.push({
- id: id,
- index: i,
- parent: parent,
- dataNested: dataNested,
- nestPath: nestPath,
- dateType: dataType,
- boundary: {x:pos.x, y:pos.y, w:size.w, h:size.h},
- $dom: $row
- });
- }
-}
-
-DtSort.Table.prototype.getNextEle = function(currentIndex)
-{
- if(currentIndex+1 >= this.rowList.length) return -1;
- for(var i=currentIndex+1; i
0) return i;
- }
-}
-
-DtSort.Table.prototype.pick = function(pos)
-{
- if(pos == undefined) return;
- if(this.rowList.length == 0) return undefined;
-
- var hitIndex = -1;
-
- var x = this.rowList[0].boundary.x;
- var y = this.rowList[0].boundary.y;
-
- for(var i=0; i");
- $root.height(row.boundary.h);
- $root.width(row.boundary.w);
- $root.append($table);
- $root.css("opacity",0.75);
- $root.css("z-index",99999);
-
- $cloneRow.css({"background":"#FFFFFF"});
- $root.addClass("none-select");
- $table.css("cursor","move");
-
- //var yOffset = this.options.indicatorYOffset * row.boundary.h;
- //$root.css({position: "absolute", top: rowPos.y + yOffset + "px", left: rowPos.x + "px"});
-
- this.indicator = {$dom:$root};
-
- $("body").append($root);
-}
-
-DtSort.Table.prototype.removeSourceIndicator = function()
-{
- this.indicator && this.indicator.$dom.remove();
- this.indicator = undefined;
-}
-
-DtSort.RowBase = function(table){ this.table = table;}
-
-DtSort.RowBase.prototype.setCanMoveIndicator = function(){ this.table.$container.css("cursor","move");}
-
-DtSort.RowBase.prototype.removeCanMoveIndicator = function(){ this.table.$container.css("cursor","pointer");}
-
-DtSort.NestRow = function(table, rows)
-{
- DtSort.RowBase.call(this,table);
- this.rows = rows;
-};
-
-DtSort.NestRow.prototype = Object.create(DtSort.RowBase.prototype);
-
-DtSort.NestRow.prototype.getIndex = function(){ return this.rows[0].index;}
-
-DtSort.NestRow.prototype.getRow = function(){ return this.rows[0];}
-
-DtSort.NestRow.prototype.include = function(row)
-{
- for(var one of this.rows)
- {
- if(one.id == row.id) return true;
- }
-
- return false;
-}
-
-DtSort.NestRow.prototype.setMovingCss = function()
-{
- for(var one of this.rows)
- {
- one.$dom.addClass(this.table.options.movingClass);
- }
-}
-
-DtSort.NestRow.prototype.removeMovingCss = function()
-{
- for(var one of this.rows)
- {
- one.$dom.removeClass(this.table.options.movingClass);
- }
-}
-
-DtSort.NestRow.prototype.setAcceptCss = function(){ this.rows[0].$dom.addClass(this.table.options.acceptableClass);}
-
-DtSort.NestRow.prototype.removeAcceptCss = function(){ this.rows[0].$dom.removeClass(this.table.options.acceptableClass);}
-
-DtSort.NestRow.prototype.toString = function(){ return langRowIndex + ' ' + this.getIndex() + ' [' + langNestTotal + ': '+ this.rows.length +']'}
-
-DtSort.NormalRow = function(table, row)
-{
- DtSort.RowBase.call(this,table);
- this.row = row;
-};
-
-DtSort.NormalRow.prototype = Object.create(DtSort.RowBase.prototype);
-
-DtSort.NormalRow.prototype.getIndex = function()
-{
- return this.row.index;
-}
-
-DtSort.NormalRow.prototype.getRow = function(){ return this.row;}
-DtSort.NormalRow.prototype.include = function(row){ return this.row.id == row.id;}
-DtSort.NormalRow.prototype.setMovingCss = function(){ this.row.$dom.addClass(this.table.options.movingClass);}
-DtSort.NormalRow.prototype.removeMovingCss = function(){ this.row.$dom.removeClass(this.table.options.movingClass);}
-DtSort.NormalRow.prototype.setAcceptCss = function(){ this.row.$dom.addClass(this.table.options.acceptableClass);}
-DtSort.NormalRow.prototype.removeAcceptCss = function(){ this.row.$dom.removeClass(this.table.options.acceptableClass);}
-DtSort.NormalRow.prototype.toString = function(){ return langRowIndex + ' ' + this.getIndex() + ' [' + langNormal + ']';}
-
-DtSort.tools = {
- elementSize: function(el)
- {
- let w = el.clientWidth || el.offsetWidth;
- let h = el.clientHeight || el.offsetHeight;
-
- return { w: w, h: h }
- },
- elementPos: function(el)
- {
- if (el.parentNode === null || el.style.display == 'none')
- {
- return false;
- }
- var parent = null;
- var pos = [];
- var box;
- if (el.getBoundingClientRect)
- {
- // IE
- box = el.getBoundingClientRect();
- var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
- var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
- return {
- x: box.left + scrollLeft,
- y: box.top + scrollTop
- };
- }
- else if (document.getBoxObjectFor)
- {
- box = document.getBoxObjectFor(el);
- var borderLeft = (el.style.borderLeftWidth) ? parseInt(el.style.borderLeftWidth) : 0;
- var borderTop = (el.style.borderTopWidth) ? parseInt(el.style.borderTopWidth) : 0;
- pos = [box.x - borderLeft, box.y - borderTop];
- }
- else
- {
- // safari & opera
- pos = [el.offsetLeft, el.offsetTop];
- parent = el.offsetParent;
- if (parent != el)
- {
- while (parent)
- {
- pos[0] += parent.offsetLeft;
- pos[1] += parent.offsetTop;
- parent = parent.offsetParent;
- }
- }
- if (ua.indexOf('opera') != -1 || (ua.indexOf('safari') != -1 && el.style.position == 'absolute'))
- {
- pos[0] -= document.body.offsetLeft;
- pos[1] -= document.body.offsetTop;
- }
- }
- if (el.parentNode)
- {
- parent = el.parentNode;
- } else {
- parent = null;
- }
- while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML')
- {
- // account for any scrolled ancestors
- pos[0] -= parent.scrollLeft;
- pos[1] -= parent.scrollTop;
- if (parent.parentNode)
- {
- parent = parent.parentNode;
- }
- else
- {
- parent = null;
- }
- }
- return {
- x: pos[0],
- y: pos[1]
- };
- },
- mousePos: function(event)
- {
- var e = event || window.event;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- var x = e.pageX || e.clientX + scrollX;
- var y = e.pageY || e.clientY + scrollY;
-
- return { x: x, y: y };
- },
- distance(p1, p2)
- {
- var dx = p1.x - p2.x;
- var dy = p1.y - p2.y;
-
- return Math.pow((dx * dx + dy * dy), 0.5);
- }
-};
-
-DtSort.sort = function(options)
-{
- var dtSort = new DtSort.Table(options);
- return dtSort;
-};
-
-
-//tree js
-$(function()
-{
- $('#caseTableList').on('click', '.c-id a,.c-name a,.c-actions a', function(e)
- {
- e.stopPropagation();
- });
-
- $('#caseTableList').on('click', '.row-case', function(e)
- {
- var $row = $(this);
- $row.toggleClass('checked');
-
- updateChildrenCheckboxes($row);
- updatePrarentCheckbox($row);
- });
-
- function updateChildrenCheckboxes($row)
- {
- var rowID = $row.data('id');
- var isChecked = $row.hasClass('checked');
-
- if ($row.hasClass('has-nest-child'))
- {
- $('#caseTableList tr[data-nest-parent="'+rowID+'"]').each(function(){
- $(this).toggleClass('checked', isChecked);
- $(this).find('input:checkbox').prop('checked', isChecked);
-
- updateChildrenCheckboxes($(this));
- });
- }
- }
-
- /* Update parent checkbox */
- function updatePrarentCheckbox($row)
- {
- var rowID = $row.data('id');
- var parentID = $row.attr('data-nest-parent');
- var $parent = $('#caseTableList>tr[data-id="' + parentID + '"]');
- if(parentID && parentID !== '0')
- {
- var isAllChecked = true;
- $('#caseTableList tr[data-nest-parent="'+parentID+'"]').each(function(){
- if (!$(this).hasClass('checked'))
- {
- isAllChecked = false;
- }
- });
- $parent.toggleClass('checked', isAllChecked);
- $parent.find('input:checkbox').prop('checked', isAllChecked);
- updatePrarentCheckbox($parent);
- }
- }
-
- //only scene
- $('input[name^="onlyScene"]').click(function(){
- var onlyScene = $(this).is(':checked') ? 1 : 0;
- $.cookie('onlyScene', onlyScene, {expires:config.cookieLife, path:config.webRoot});
- window.location.reload();
- });
-
- $("input[name^=caseIDList]").change(function(){
- var trList = $("#caseTableList").find("tr");
- var selectedCaseNum = 0;
- for(var i=0; i