From 190a83bc94e3a8927209e1546f4e77ac4854c91d Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 21 Aug 2019 16:34:52 +0800 Subject: [PATCH] * Adjust codes to display subStatus in kanban. --- module/project/js/kanban.js | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/module/project/js/kanban.js b/module/project/js/kanban.js index 7d28779596..0bf778475b 100644 --- a/module/project/js/kanban.js +++ b/module/project/js/kanban.js @@ -107,14 +107,32 @@ $(function() { if(statusMap[type][from] && statusMap[type][from][to]) { - kanbanModalTrigger.show( + var method = statusMap[type][from][to]; + if(method == 'changeSubStatus') { - url: $.createLink(type, statusMap[type][from][to], 'id=' + id) + onlybody, - shown: function(){$('.modal-iframe').addClass('with-titlebar').data('cancel-reload', true)}, - hidden: refresh - }); + $.getJSON($.createLink(type, method, 'id=' + id + '&subStatus=' + to), function(response) + { + if(response.result == 'fail' && response.message) + { + bootAlert(response.message); + setTimeout(function(){location.reload();}, 1000); + } + }); + } + else + { + kanbanModalTrigger.show( + { + url: $.createLink(type, method, 'id=' + id) + onlybody, + shown: function(){$('.modal-iframe').addClass('with-titlebar').data('cancel-reload', true)}, + width: 900, + hidden: refresh + }); + } } - return false; + + /* Keep the draged element stay in the new place. */ + return true; }; $kanban.droppable(