From c29fefc36f04728bc038510f3a484fc75db02807 Mon Sep 17 00:00:00 2001 From: Catouse Date: Fri, 30 Oct 2020 23:35:35 +0800 Subject: [PATCH 001/187] * update zui.js to fix $.zui.uuid method not work as expect in ie11. --- www/js/zui/min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/zui/min.js b/www/js/zui/min.js index d09edcee5f..6e7c6ab1a1 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,10 +1,10 @@ /*! - * ZUI: ZUI for Zentao - v1.9.2 - 2020-09-25 + * ZUI: ZUI for Zentao - v1.9.2 - 2020-10-30 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2020 cnezsoft.com; Licensed MIT */ -!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var n={all:-1,left:0,middle:1,right:2},o=0;t.zui({uuid:function(t){var e=1e8*(Date.now()-1580890015292)+1e3*Math.floor(1e5*Math.random())+o++%1e3;return t?e:e.toString(36)},callEvent:function(e,n,o){if(t.isFunction(e)){o!==i&&(e=t.proxy(e,o));var a=e(n);return n&&(n.result=a),!(a!==i&&!a)}return 1},strCode:function(t){var e=0;if("string"!=typeof t&&(t=String(t)),t&&t.length)for(var i=0;i=e.innerWidth)return 0;if(!t.zui._scrollbarWidth){var i=document.createElement("div");i.className="scrollbar-measure",document.body.appendChild(i),t.zui._scrollbarWidth=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return t.zui._scrollbarWidth},fixBodyScrollbar:function(){if(t.zui.checkBodyScrollbar()){var e=t("body"),i=parseInt(e.css("padding-right")||0,10);return t.zui._scrollbarWidth&&e.css({paddingRight:i+t.zui._scrollbarWidth,overflowY:"hidden"}),!0}},resetBodyScrollbar:function(){t("body").css({paddingRight:"",overflowY:""})}}),t.fn.callEvent=function(e,n,o){var a=t(this),s=e.indexOf(".zui."),r=s<0?e:e.substring(0,s),l=t.Event(r,n);if(o===i&&s>0&&(o=a.data(e.substring(s+1))),o&&o.options){var h=o.options[r];t.isFunction(h)&&(l.result=t.zui.callEvent(h,l,o))}return a.trigger(l),l},t.fn.callComEvent=function(e,n,o){o===i||t.isArray(o)||(o=[o]);var a,s=this;s.trigger(n,o);var r=e.options[n];return r&&(a=r.apply(e,o)),a}}(jQuery,window,void 0),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",n=function(i){t(i).on("click",e,this.close)};n.prototype.close=function(e){function n(){s.trigger("closed."+i).remove()}var o=t(this),a=o.attr("data-target");a||(a=o.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var s=t(a);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,n).emulateTransitionEnd(150):n())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),a=o.data(i);a||o.data(i,a=new n(this)),"string"==typeof e&&a[e].call(o)})},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click."+i+".data-api",e,n.prototype.close)}(window.jQuery),function(t,e){"use strict";var i="zui.pager",n={page:1,recTotal:0,recPerPage:10},o={zh_cn:{pageOfText:"第 {0} 页",prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 {page} 页",totalPage:"共 {totalPage} 页",totalCount:"共 {recTotal} 项",pageSize:"每页 {recPerPage} 项",itemsRange:"第 {start} ~ {end} 项",pageOfTotal:"第 {page}/{totalPage} 页"},zh_tw:{pageOfText:"第 {0} 頁",prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 {page} 頁",totalPage:"共 {totalPage} 頁",totalCount:"共 {recTotal} 項",pageSize:"每頁 {recPerPage} 項",itemsRange:"第 {start} ~ {end} 項",pageOfTotal:"第 {page}/{totalPage} 頁"},en:{pageOfText:"Page {0}",prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"From {start} to {end}",pageOfTotal:"Page {page} of {totalPage}"}},a=function(e,n){var s=this;s.name=i,s.$=t(e),n=s.options=t.extend({},a.DEFAULTS,this.$.data(),n),s.langName=n.lang||t.zui.clientLang(),s.lang=t.zui.getLangData(i,s.langName,o),s.state={},s.set(n.page,n.recTotal,n.recPerPage,!0),s.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&s.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&s.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&s.set(-1,-1,e)})};a.prototype.set=function(e,i,o,a){var s=this;"object"==typeof e&&null!==e&&(o=e.recPerPage,i=e.recTotal,e=e.page);var r=s.state;r||(r=t.extend({},n));var l=t.extend({},r);return"number"==typeof o&&o>0&&(r.recPerPage=o),"number"==typeof i&&i>=0&&(r.recTotal=i),"number"==typeof e&&e>=0&&(r.page=e),r.totalPage=r.recTotal&&r.recPerPage?Math.ceil(r.recTotal/r.recPerPage):1,r.page=Math.max(0,Math.min(r.page,r.totalPage)),r.pageRecCount=r.recTotal,r.page&&r.recTotal&&(r.page1&&(r.pageRecCount=r.recTotal-r.recPerPage*(r.page-1))),r.skip=r.page>1?(r.page-1)*r.recPerPage:0,r.start=r.skip+1,r.end=r.skip+r.pageRecCount,r.prev=r.page>1?r.page-1:0,r.next=r.page').attr("href",i?a.createLink(i,a.state):"###").html(n);return o||(s=t("
  • ").append(s).toggleClass("active",i===a.state.page).toggleClass("disabled",!i||i===a.state.page)),s},a.prototype.createNavItems=function(t){var i=this,n=i.$,o=i.state,a=o.totalPage,s=o.page,r=function(t,o){if(t===!1)return void n.append(i.createLinkItem(0,o||i.options.navEllipsisItem));o===e&&(o=t);for(var a=t;a<=o;++a)n.append(i.createLinkItem(a))};t===e&&(t=i.options.maxNavCount||10),r(1),a>1&&(a<=t?r(2,a):sa-t+2?(r(!1),r(a-t+2,a)):(r(!1),r(s-Math.ceil((t-4)/2),s+Math.floor((t-4)/2)),r(!1),r(a)))},a.prototype.createGoto=function(){var e=this,i=this.state,n=t('
    ");return n},a.prototype.createSizeMenu=function(){var e=this,i=this.state,n=t(''),o=e.options.pageSizeOptions;"string"==typeof o&&(o=o.split(","));for(var a=0;a'+s+"
  • ").toggleClass("active",s===i.recPerPage);n.append(r)}return t('
    ').addClass(e.options.menuDirection).append(n)},a.prototype.createElement=function(e,i,n){var o=this,a=t.proxy(o.createLinkItem,o),s=o.lang;switch(e){case"prev":return a(n.prev,s.prev);case"prev_icon":return a(n.prev,'');case"next":return a(n.next,s.next);case"next_icon":return a(n.next,'');case"first":return a(1,s.first);case"first_icon":return a(1,'');case"last":return a(n.totalPage,s.last);case"last_icon":return a(n.totalPage,'');case"space":case"|":return t('
  • ');case"nav":case"pages":return void o.createNavItems();case"total_text":return t(('
    '+s.totalCount+"
    ").format(n));case"page_text":return t(('
    '+s.pageOf+"
    ").format(n));case"total_page_text":return t(('
    '+s.totalPage+"
    ").format(n));case"page_of_total_text":return t(('
    '+s.pageOfTotal+"
    ").format(n));case"page_size_text":return t(('
    '+s.pageSize+"
    ").format(n));case"items_range_text":return t(('
    '+s.itemsRange+"
    ").format(n));case"goto":return o.createGoto();case"size_menu":return o.createSizeMenu();default:return t("
  • ").html(e.format(n))}},a.prototype.createLink=function(i,n){i===e&&(i=this.state.page),n===e&&(n=this.state);var o=this.options.linkCreator;return"string"==typeof o?o.format(t.extend({},n,{page:i})):t.isFunction(o)?o(i,n):"#page="+i},a.prototype.render=function(e){var i=this,n=i.state,o=i.options.elementCreator||i.createElement,a=t.isPlainObject(o);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var s=0;s").append(h)),i.$.append(h))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),c&&c.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[n]),i},a.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},n),t.fn.pager=function(e){return this.each(function(){var n=t(this),o=n.data(i),s="object"==typeof e&&e;o||n.data(i,o=new a(this,s)),"string"==typeof e&&o[e]()})},a.NAME=i,a.LANG=o,t.fn.pager.Constructor=a,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,n=i.closest("ul:not(.dropdown-menu)"),o=i.attr("data-target")||i.attr("data-tab");if(o||(o=i.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=n.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:a});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(o);this.activate(i.parent("li"),n),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,n){function o(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var a=i.find("> .active"),s=n&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,o).emulateTransitionEnd(150):o(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=function(n){return this.each(function(){var o=t(this),a=o.data(e);a||o.data(e,a=new i(this)),"string"==typeof n&&a[n]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.$parent&&this.$parent.find(".in");if(n&&n.length){var o=n.data(e);if(o&&o.transitioning)return;n.collapse("hide"),o||n.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,t.proxy(s,this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one(t.support.transition.end,t.proxy(o,this)).emulateTransitionEnd(350):o.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=t.fn.collapse;t.fn.collapse=function(n){return this.each(function(){var o=t(this),a=o.data(e),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof n&&n);a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var n,o=t(this),a=o.attr("data-target")||i.preventDefault()||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),s=t(a),r=s.data(e),l=r?"toggle":o.data(),h=o.attr("data-parent"),c=h&&t(h);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+h+'"]').not(o).addClass("collapsed"),o[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,n=992,o=768,a=e(t),s=function(){var t=a.width();e("html").toggleClass("screen-desktop",t>=n&&t=i).toggleClass("screen-tablet",t>=o&&t=n)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),a.resize(s),s()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var n=t("#browseHappyTip");n.length||(n=t('
    '),n.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),n.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t){"use strict";const e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},n=function(t){return i(t).getTime()},o=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e},a=function(t,e){return t.setTime(t.getTime()+e),t},s=function(t,i){return a(t,i*e)},r=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},h=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},c=function(t){return h(t.getFullYear(),t.getMonth())},d=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,c(t))),t},p=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=s(i,-1);return d(i)},f=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=p(t),n=s(r(i),7);return e>=i&&e1){var i;if(2==arguments.length&&"object"==typeof e)for(var n in e)void 0!==e[n]&&(i=new RegExp("({"+n+"})","g"),t=t.replace(i,e[n]));else for(var o=1;othis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*! +!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var n={all:-1,left:0,middle:1,right:2},o=0;t.zui({uuid:function(t){var e=1e5*(Date.now()-1580890015292)+10*Math.floor(1e4*Math.random())+o++%10;return t?e:e.toString(36)},callEvent:function(e,n,o){if(t.isFunction(e)){o!==i&&(e=t.proxy(e,o));var a=e(n);return n&&(n.result=a),!(a!==i&&!a)}return 1},strCode:function(t){var e=0;if("string"!=typeof t&&(t=String(t)),t&&t.length)for(var i=0;i=e.innerWidth)return 0;if(!t.zui._scrollbarWidth){var i=document.createElement("div");i.className="scrollbar-measure",document.body.appendChild(i),t.zui._scrollbarWidth=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return t.zui._scrollbarWidth},fixBodyScrollbar:function(){if(t.zui.checkBodyScrollbar()){var e=t("body"),i=parseInt(e.css("padding-right")||0,10);return t.zui._scrollbarWidth&&e.css({paddingRight:i+t.zui._scrollbarWidth,overflowY:"hidden"}),!0}},resetBodyScrollbar:function(){t("body").css({paddingRight:"",overflowY:""})}}),t.fn.callEvent=function(e,n,o){var a=t(this),s=e.indexOf(".zui."),r=s<0?e:e.substring(0,s),l=t.Event(r,n);if(o===i&&s>0&&(o=a.data(e.substring(s+1))),o&&o.options){var h=o.options[r];t.isFunction(h)&&(l.result=t.zui.callEvent(h,l,o))}return a.trigger(l),l},t.fn.callComEvent=function(e,n,o){o===i||t.isArray(o)||(o=[o]);var a,s=this;s.trigger(n,o);var r=e.options[n];return r&&(a=r.apply(e,o)),a}}(jQuery,window,void 0),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",n=function(i){t(i).on("click",e,this.close)};n.prototype.close=function(e){function n(){s.trigger("closed."+i).remove()}var o=t(this),a=o.attr("data-target");a||(a=o.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var s=t(a);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,n).emulateTransitionEnd(150):n())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),a=o.data(i);a||o.data(i,a=new n(this)),"string"==typeof e&&a[e].call(o)})},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click."+i+".data-api",e,n.prototype.close)}(window.jQuery),function(t,e){"use strict";var i="zui.pager",n={page:1,recTotal:0,recPerPage:10},o={zh_cn:{pageOfText:"第 {0} 页",prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 {page} 页",totalPage:"共 {totalPage} 页",totalCount:"共 {recTotal} 项",pageSize:"每页 {recPerPage} 项",itemsRange:"第 {start} ~ {end} 项",pageOfTotal:"第 {page}/{totalPage} 页"},zh_tw:{pageOfText:"第 {0} 頁",prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 {page} 頁",totalPage:"共 {totalPage} 頁",totalCount:"共 {recTotal} 項",pageSize:"每頁 {recPerPage} 項",itemsRange:"第 {start} ~ {end} 項",pageOfTotal:"第 {page}/{totalPage} 頁"},en:{pageOfText:"Page {0}",prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"From {start} to {end}",pageOfTotal:"Page {page} of {totalPage}"}},a=function(e,n){var s=this;s.name=i,s.$=t(e),n=s.options=t.extend({},a.DEFAULTS,this.$.data(),n),s.langName=n.lang||t.zui.clientLang(),s.lang=t.zui.getLangData(i,s.langName,o),s.state={},s.set(n.page,n.recTotal,n.recPerPage,!0),s.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&s.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&s.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&s.set(-1,-1,e)})};a.prototype.set=function(e,i,o,a){var s=this;"object"==typeof e&&null!==e&&(o=e.recPerPage,i=e.recTotal,e=e.page);var r=s.state;r||(r=t.extend({},n));var l=t.extend({},r);return"number"==typeof o&&o>0&&(r.recPerPage=o),"number"==typeof i&&i>=0&&(r.recTotal=i),"number"==typeof e&&e>=0&&(r.page=e),r.totalPage=r.recTotal&&r.recPerPage?Math.ceil(r.recTotal/r.recPerPage):1,r.page=Math.max(0,Math.min(r.page,r.totalPage)),r.pageRecCount=r.recTotal,r.page&&r.recTotal&&(r.page1&&(r.pageRecCount=r.recTotal-r.recPerPage*(r.page-1))),r.skip=r.page>1?(r.page-1)*r.recPerPage:0,r.start=r.skip+1,r.end=r.skip+r.pageRecCount,r.prev=r.page>1?r.page-1:0,r.next=r.page').attr("href",i?a.createLink(i,a.state):"###").html(n);return o||(s=t("
  • ").append(s).toggleClass("active",i===a.state.page).toggleClass("disabled",!i||i===a.state.page)),s},a.prototype.createNavItems=function(t){var i=this,n=i.$,o=i.state,a=o.totalPage,s=o.page,r=function(t,o){if(t===!1)return void n.append(i.createLinkItem(0,o||i.options.navEllipsisItem));o===e&&(o=t);for(var a=t;a<=o;++a)n.append(i.createLinkItem(a))};t===e&&(t=i.options.maxNavCount||10),r(1),a>1&&(a<=t?r(2,a):sa-t+2?(r(!1),r(a-t+2,a)):(r(!1),r(s-Math.ceil((t-4)/2),s+Math.floor((t-4)/2)),r(!1),r(a)))},a.prototype.createGoto=function(){var e=this,i=this.state,n=t('
    ");return n},a.prototype.createSizeMenu=function(){var e=this,i=this.state,n=t(''),o=e.options.pageSizeOptions;"string"==typeof o&&(o=o.split(","));for(var a=0;a'+s+"
  • ").toggleClass("active",s===i.recPerPage);n.append(r)}return t('
    ').addClass(e.options.menuDirection).append(n)},a.prototype.createElement=function(e,i,n){var o=this,a=t.proxy(o.createLinkItem,o),s=o.lang;switch(e){case"prev":return a(n.prev,s.prev);case"prev_icon":return a(n.prev,'');case"next":return a(n.next,s.next);case"next_icon":return a(n.next,'');case"first":return a(1,s.first);case"first_icon":return a(1,'');case"last":return a(n.totalPage,s.last);case"last_icon":return a(n.totalPage,'');case"space":case"|":return t('
  • ');case"nav":case"pages":return void o.createNavItems();case"total_text":return t(('
    '+s.totalCount+"
    ").format(n));case"page_text":return t(('
    '+s.pageOf+"
    ").format(n));case"total_page_text":return t(('
    '+s.totalPage+"
    ").format(n));case"page_of_total_text":return t(('
    '+s.pageOfTotal+"
    ").format(n));case"page_size_text":return t(('
    '+s.pageSize+"
    ").format(n));case"items_range_text":return t(('
    '+s.itemsRange+"
    ").format(n));case"goto":return o.createGoto();case"size_menu":return o.createSizeMenu();default:return t("
  • ").html(e.format(n))}},a.prototype.createLink=function(i,n){i===e&&(i=this.state.page),n===e&&(n=this.state);var o=this.options.linkCreator;return"string"==typeof o?o.format(t.extend({},n,{page:i})):t.isFunction(o)?o(i,n):"#page="+i},a.prototype.render=function(e){var i=this,n=i.state,o=i.options.elementCreator||i.createElement,a=t.isPlainObject(o);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var s=0;s").append(h)),i.$.append(h))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),c&&c.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[n]),i},a.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},n),t.fn.pager=function(e){return this.each(function(){var n=t(this),o=n.data(i),s="object"==typeof e&&e;o||n.data(i,o=new a(this,s)),"string"==typeof e&&o[e]()})},a.NAME=i,a.LANG=o,t.fn.pager.Constructor=a,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,n=i.closest("ul:not(.dropdown-menu)"),o=i.attr("data-target")||i.attr("data-tab");if(o||(o=i.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=n.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:a});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(o);this.activate(i.parent("li"),n),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,n){function o(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var a=i.find("> .active"),s=n&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,o).emulateTransitionEnd(150):o(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=function(n){return this.each(function(){var o=t(this),a=o.data(e);a||o.data(e,a=new i(this)),"string"==typeof n&&a[n]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.$parent&&this.$parent.find(".in");if(n&&n.length){var o=n.data(e);if(o&&o.transitioning)return;n.collapse("hide"),o||n.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,t.proxy(s,this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one(t.support.transition.end,t.proxy(o,this)).emulateTransitionEnd(350):o.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=t.fn.collapse;t.fn.collapse=function(n){return this.each(function(){var o=t(this),a=o.data(e),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof n&&n);a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var n,o=t(this),a=o.attr("data-target")||i.preventDefault()||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),s=t(a),r=s.data(e),l=r?"toggle":o.data(),h=o.attr("data-parent"),c=h&&t(h);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+h+'"]').not(o).addClass("collapsed"),o[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,n=992,o=768,a=e(t),s=function(){var t=a.width();e("html").toggleClass("screen-desktop",t>=n&&t=i).toggleClass("screen-tablet",t>=o&&t=n)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),a.resize(s),s()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var n=t("#browseHappyTip");n.length||(n=t('
    '),n.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),n.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t){"use strict";const e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},n=function(t){return i(t).getTime()},o=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e},a=function(t,e){return t.setTime(t.getTime()+e),t},s=function(t,i){return a(t,i*e)},r=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},h=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},c=function(t){return h(t.getFullYear(),t.getMonth())},d=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,c(t))),t},p=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=s(i,-1);return d(i)},f=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=p(t),n=s(r(i),7);return e>=i&&e1){var i;if(2==arguments.length&&"object"==typeof e)for(var n in e)void 0!==e[n]&&(i=new RegExp("({"+n+"})","g"),t=t.replace(i,e[n]));else for(var o=1;othis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*! * jQuery resize event - v1.1 * http://benalman.com/projects/jquery-resize-plugin/ * Copyright (c) 2010 "Cowboy" Ben Alman From 2c36700bc170a16df748c6da5564a111c1547c80 Mon Sep 17 00:00:00 2001 From: z Date: Sun, 1 Nov 2020 09:02:38 +0800 Subject: [PATCH 002/187] * adjust for install. --- module/install/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/install/model.php b/module/install/model.php index 94dbcebbcf..ce1e4aa9ec 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -445,6 +445,8 @@ class installModel extends model */ public function createTable($version) { + $this->dbh->exec("USE {$this->config->db->name}"); + $dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql'; $tables = explode(';', file_get_contents($dbFile)); foreach($tables as $table) From 37c672a2ed3bd8671e21e9788ea72945be371798 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 2 Nov 2020 10:08:23 +0800 Subject: [PATCH 003/187] * Fix bug #2490. --- module/bug/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index fd59c40942..6b0352bcfa 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -898,7 +898,7 @@ class bug extends control $this->view->title = $this->products[$bug->product] . $this->lang->colon . $this->lang->bug->assignedTo; $this->view->position[] = $this->lang->bug->assignedTo; - $this->view->users = $this->user->getPairs('nodeleted', $bug->assignedTo); + $this->view->users = $this->user->getPairs('nodeleted|nofeedback', $bug->assignedTo); $this->view->bug = $bug; $this->view->bugID = $bugID; $this->view->actions = $this->action->getList('bug', $bugID); From b29244195c8483076bf5dd9f476c27edfea27e56 Mon Sep 17 00:00:00 2001 From: guanxiying Date: Mon, 2 Nov 2020 16:30:38 +0800 Subject: [PATCH 004/187] * Add login function. --- module/user/model.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/module/user/model.php b/module/user/model.php index 362c69306c..1d63c13729 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -866,6 +866,35 @@ class userModel extends model return array('rights' => $rights, 'acls' => $acls); } + /** + * login function. + * + * @param object $user + * @access public + * @return void + */ + public function login($user) + { + if(!$user) return false; + + $this->cleanLocked($user->account); + + /* Authorize him and save to session. */ + $user->rights = $this->authorize($user->account); + $user->groups = $this->getGroups($user->account); + $user->view = $this->grantUserView($user->account, $user->rights['acls']); + + $this->session->set('user', $user); + $this->app->user = $this->session->user; + $this->loadModel('action')->create('user', $user->id, 'login'); + $this->loadModel('score')->create('user', 'login'); + + /* Keep login. */ + if($this->post->keepLogin) $this->keepLogin($user); + + return $user; + } + /** * Keep the user in login state. * From 7f1029c349825872f3e152b4dadeaac199bce2e1 Mon Sep 17 00:00:00 2001 From: guanxiying Date: Mon, 2 Nov 2020 16:31:10 +0800 Subject: [PATCH 005/187] * Add usermodel::login function --- module/user/control.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index a05d0f7485..fe108126b1 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -731,17 +731,8 @@ class user extends control if($user) { - $this->user->cleanLocked($user->account); - /* Authorize him and save to session. */ - $user->rights = $this->user->authorize($user->account); - $user->groups = $this->user->getGroups($user->account); - $user->view = $this->user->grantUserView($user->account, $user->rights['acls']); - $this->session->set('user', $user); - $this->app->user = $this->session->user; - $this->loadModel('action')->create('user', $user->id, 'login'); - $this->loadModel('score')->create('user', 'login'); - /* Keep login. */ - if($this->post->keepLogin) $this->user->keepLogin($user); + /* Set user group, rights, view and aword login score. */ + $user = $this->user->login($user); /* Go to the referer. */ if($this->post->referer and strpos($this->post->referer, $loginLink) === false and strpos($this->post->referer, $denyLink) === false and strpos($this->post->referer, 'block') === false) @@ -1117,4 +1108,5 @@ class user extends control die(json_encode($newUsers)); } + } From 7bcea2038075ee8489cd6968422143a565452c53 Mon Sep 17 00:00:00 2001 From: guanxiying Date: Mon, 2 Nov 2020 16:33:22 +0800 Subject: [PATCH 006/187] * Add bind and oauth register function. --- module/user/lang/zh-cn.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index ea0c152b89..bb917b0164 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -63,6 +63,8 @@ $lang->user->unlock = "解锁用户"; $lang->user->delete = "删除用户"; $lang->user->unbind = "解除ZDOO绑定"; $lang->user->login = "用户登录"; +$lang->user->bind = "绑定已有账户"; +$lang->user->oauthRegister = "注册新账号"; $lang->user->mobileLogin = "手机访问"; $lang->user->editProfile = "修改档案"; $lang->user->deny = "访问受限"; @@ -196,6 +198,7 @@ $lang->user->contacts->common = '联系人'; $lang->user->contacts->listName = '列表名称'; $lang->user->contacts->userList = '用户列表'; + $lang->user->contacts->manage = '维护列表'; $lang->user->contacts->contactsList = '已有列表'; $lang->user->contacts->selectedUsers = '选择用户'; From 8be947a1e8652ee376d518c16eb987414dae1cb7 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 3 Nov 2020 10:50:54 +0800 Subject: [PATCH 007/187] * Finish task #8195. --- module/testtask/css/cases.css | 1 + module/testtask/model.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/testtask/css/cases.css b/module/testtask/css/cases.css index f6203f70ba..cfefe76e94 100644 --- a/module/testtask/css/cases.css +++ b/module/testtask/css/cases.css @@ -1,5 +1,6 @@ tbody > tr > td > .btn-icon {margin-right: 3px;} tbody > tr > td .icon-bug {margin-left: -8px;} +tbody > tr > td .icon-share{font-size: 9px;} .table-footer .table-actions .input-group {float: left;} .table-footer .table-actions #assignedTo_chosen a.chosen-default{height:28px;line-height:15px} diff --git a/module/testtask/model.php b/module/testtask/model.php index 31c5bff47f..0955466370 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1450,6 +1450,7 @@ class testtaskModel extends model $account = $this->app->user->account; $id = $col->id; $caseChanged = $run->version < $run->caseVersion; + $fromCaseID = $run->fromCaseID; if($col->show) { $class = "c-$id "; @@ -1481,7 +1482,7 @@ class testtaskModel extends model break; case 'title': if($run->branch) echo "{$branches[$run->branch]}"; - echo $canView ? html::a($caseLink, $run->title, null, "style='color: $run->color'") : $run->title; + echo $canView ? ($fromCaseID ? html::a($caseLink, $run->title, null, "style='color: $run->color'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[#$fromCaseID]") : html::a($caseLink, $run->title, null, "style='color: $run->color'")) : "$run->title"; break; case 'branch': echo $branches[$run->branch]; From 0669bbab5ae2cc87005aacb948f04dabb2849f80 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 3 Nov 2020 11:30:54 +0800 Subject: [PATCH 008/187] * Fix bug#3410: the display of the doc title. --- module/doc/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 16f0bda852..5d97f8c762 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -158,7 +158,7 @@ var browseType = ''; collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?> collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?> - id"), "  " . $doc->title);?> + id"), "  " . $doc->title, "", "title=$doc->title");?> fileSize ? $doc->fileSize : '-';?> addedBy);?> addedDate, 'y-m-d');?> From c9e05720eb9f3b8e38b0cb8029d46e8d8f445260 Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 3 Nov 2020 13:38:05 +0800 Subject: [PATCH 009/187] * update zui.js. --- www/js/zui/min.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/www/js/zui/min.js b/www/js/zui/min.js index 6e7c6ab1a1..331f532b26 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,5 +1,5 @@ /*! - * ZUI: ZUI for Zentao - v1.9.2 - 2020-10-30 + * ZUI: ZUI for Zentao - v1.9.2 - 2020-11-03 * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2020 cnezsoft.com; Licensed MIT @@ -16,7 +16,7 @@ function(t,e,i){"$:nomunge";function n(){o=e[r](function(){a.each(function(){var * Copyright 2006, 2014 Klaus Hartl * Released under the MIT license */ -function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){function e(t){return r.raw?t:encodeURIComponent(t)}function i(t){return r.raw?t:decodeURIComponent(t)}function n(t){return e(r.json?JSON.stringify(t):String(t))}function o(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(s," ")),r.json?JSON.parse(t):t}catch(e){}}function a(e,i){var n=r.raw?e:o(e);return t.isFunction(i)?i(n):n}var s=/\+/g,r=t.cookie=function(o,s,l){if(void 0!==s&&!t.isFunction(s)){if(l=t.extend({},r.defaults,l),"number"==typeof l.expires){var h=l.expires,c=l.expires=new Date;c.setTime(+c+864e5*h)}return document.cookie=[e(o),"=",n(s),l.expires?"; expires="+l.expires.toUTCString():"",l.path?"; path="+l.path:"",l.domain?"; domain="+l.domain:"",l.secure?"; secure":""].join("")}for(var d=o?void 0:{},u=document.cookie?document.cookie.split("; "):[],p=0,f=u.length;p=0;t--)delete this.page[i[t]];this.set(a,this.page)}},s.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},s.prototype.pageClear=function(){this.page={},this.pageSave()},s.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},s.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},s.prototype.check=function(){if(!this.enable&&!this.silence)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},s.prototype.length=function(){return this.check()?i.getLength?i.getLength():i.length:0},s.prototype.removeItem=function(t){return i.removeItem(t),this},s.prototype.remove=function(t){return this.removeItem(t)},s.prototype.getItem=function(t){return i.getItem(t)},s.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},s.prototype.key=function(t){return i.key(t)},s.prototype.setItem=function(t,e){return i.setItem(t,e),this},s.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},s.prototype.clear=function(){return i.clear(),this},s.prototype.forEach=function(t){for(var e=this.length(),n=e-1;n>=0;n--){var o=i.key(n);t(o,this.get(o))}return this},s.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},s.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},s.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new s})}(window,jQuery),function(t){"use strict";var e="zui.searchBox",i=function(e,n){var o=this;o.name=name,o.$=t(e),o.options=n=t.extend({},i.DEFAULTS,o.$.data(),n);var a=o.$.is(n.inputSelector)?o.$:o.$.find(n.inputSelector);if(a.length){var s=function(){o.changeTimer&&(clearTimeout(o.changeTimer),o.changeTimer=null)},r=function(){s();var t=o.getSearch();if(t!==o.lastValue){var e=""===t;a.toggleClass("empty",e),o.$.callComEvent(o,"onSearchChange",[t,e]),o.lastValue=t}};o.$input=a=a.first(),a.on(n.listenEvent,function(t){o.changeTimer=setTimeout(function(){r()},n.changeDelay)}).on("focus",function(t){a.addClass("focus"),o.$.callComEvent(o,"onFocus",[t])}).on("blur",function(t){a.removeClass("focus"),o.$.callComEvent(o,"onBlur",[t])}).on("keydown",function(t){var e=0,i=t.which;27===i&&n.escToClear?(this.setSearch("",!0),r(),e=1):13===i&&n.onPressEnter&&(r(),o.$.callComEvent(o,"onPressEnter",[t]));var a=o.$.callComEvent(o,"onKeyDown",[t]);a===!1&&(e=1),e&&t.preventDefault()}),o.$.on("click",".search-clear-btn",function(t){o.setSearch("",!0),r(),o.focus(),t.preventDefault()}),r()}else console.error("ZUI: search box init error, cannot find search box input element.")};i.DEFAULTS={inputSelector:'input[type="search"],input[type="text"]',listenEvent:"change input paste",changeDelay:500},i.prototype.getSearch=function(){return this.$input&&t.trim(this.$input.val())},i.prototype.setSearch=function(t,e){var i=this.$input;i&&(i.val(t),e||i.trigger("change"))},i.prototype.focus=function(){this.$input&&this.$input.focus()},t.fn.searchBox=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.searchBox.Constructor=i}(jQuery),function(t,e){"use strict";var i="zui.draggable",n={container:"body",move:!0},o=0,a=function(e,i){var a=this;a.$=t(e),a.id=o++,a.options=t.extend({},n,a.$.data(),i),a.init()};a.DEFAULTS=n,a.NAME=i,a.prototype.init=function(){var n,o,a,s,r,l=this,h=l.$,c="before",d="drag",u="finish",p="."+i+"."+l.id,f="mousedown"+p,g="mouseup"+p,m="mousemove"+p,v=l.options,y=v.selector,b=v.handle,w=h,x=t.isFunction(v.move),C=function(t){var e=t.pageX,i=t.pageY;r=!0;var o={left:e-a.x,top:i-a.y};w.removeClass("drag-ready").addClass("dragging"),v.move&&(x?v.move(o,w):w.css(o)),v[d]&&v[d]({event:t,element:w,startOffset:a,pos:o,offset:{x:e-n.x,y:i-n.y},smallOffset:{x:e-s.x,y:i-s.y}}),s.x=e,s.y=i,v.stopPropagation&&t.stopPropagation()},_=function(i){if(t(e).off(p),!r)return void w.removeClass("drag-ready");var o={left:i.pageX-a.x,top:i.pageY-a.y};w.removeClass("drag-ready dragging"),v.move&&(x?v.move(o,w):w.css(o)),v[u]&&v[u]({event:i,element:w,startOffset:a,pos:o,offset:{x:i.pageX-n.x,y:i.pageY-n.y},smallOffset:{x:i.pageX-s.x,y:i.pageY-s.y}}),i.preventDefault(),v.stopPropagation&&i.stopPropagation()},k=function(i){var l=t.zui.getMouseButtonCode(v.mouseButton);if(!(l>-1&&i.button!==l)){var h=t(this);if(y&&(w=b?h.closest(y):h),v[c]){var d=v[c]({event:i,element:w});if(d===!1)return}var u=t(v.container),p=w.offset();o=u.offset(),n={x:i.pageX,y:i.pageY},a={x:i.pageX-p.left+o.left,y:i.pageY-p.top+o.top},s=t.extend({},n),r=!1,w.addClass("drag-ready"),i.preventDefault(),v.stopPropagation&&i.stopPropagation(),t(e).on(m,C).on(g,_)}};b?h.on(f,b,k):y?h.on(f,y,k):h.on(f,k)},a.prototype.destroy=function(){var n="."+i+"."+this.id;this.$.off(n),t(e).off(n),this.$.data(i,null)},t.fn.draggable=function(e){return this.each(function(){var n=t(this),o=n.data(i),s="object"==typeof e&&e;o||n.data(i,o=new a(this,s)),"string"==typeof e&&o[e]()})},t.fn.draggable.Constructor=a}(jQuery,document),function(t,e,i){"use strict";var n="zui.droppable",o={target:".droppable-target",deviation:5,sensorOffsetX:0,sensorOffsetY:0,dropToClass:"drop-to"},a=0,s=function(e,i){var n=this;n.id=a++,n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},s.prototype.init=function(){var o,a,s,r,l,h,c,d,u,p,f,g,m,v=this,y=v.$,b=v.options,w=b.deviation,x="."+n+"."+v.id,C="mousedown"+x,_="mouseup"+x,k="mousemove"+x,T=b.selector,S=b.handle,D=b.flex,M=b.container,P=b.canMoveHere,z=b.dropToClass,L=y,F=!1,I=M?t(b.container).first():T?y:t("body"),A=function(e){if(F&&(f={left:e.pageX,top:e.pageY},!(i.abs(f.left-d.left)a&&f.top>s&&f.left-1&&i.button!==n)){var f=t(this);T&&(L=S?f.closest(T):f),L.hasClass("drag-shadow")||b.before&&b.before({event:i,element:L})===!1||(F=!0,o=t.isFunction(b.target)?b.target(L,y):I.find(b.target),a=null,s=null,r=!1,l=!0,h=null,c=L.offset(),u=I.offset(),u.top=u.top-I.scrollTop(),u.left=u.left-I.scrollLeft(),d={left:i.pageX,top:i.pageY},g=t.extend({},d),p={left:d.left-c.left,top:d.top-c.top},L.addClass("drag-from"),t(e).on(k,A).on(_,E),m=setTimeout(function(){t(e).on(C,E)},10),i.preventDefault(),b.stopPropagation&&i.stopPropagation())}};S?y.on(C,S,$):T?y.on(C,T,$):y.on(C,$)},s.prototype.destroy=function(){var i="."+n+"."+this.id;this.$.off(i),t(e).off(i),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},t.fn.droppable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o||i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.droppable.Constructor=s}(jQuery,document,Math),+function(t,e){"use strict";function i(e,i,a){return this.each(function(){var s=t(this),r=s.data(n),l=t.extend({},o.DEFAULTS,s.data(),"object"==typeof e&&e);r||s.data(n,r=new o(this,l)),"string"==typeof e?r[e](i,a):l.show&&r.show(i,a)})}var n="zui.modal",o=function(i,o){var a=this;a.options=o,a.$body=t(document.body),a.$element=t(i),a.$backdrop=a.isShown=null,a.scrollbarWidth=0,o.moveable===e&&(a.options.moveable=a.$element.hasClass("modal-moveable")),o.remote&&a.$element.find(".modal-content").load(o.remote,function(){a.$element.trigger("loaded."+n)}),o.scrollInside&&t(window).on("resize."+n,function(){a.isShown&&a.adjustPosition(e,100)})};o.VERSION="3.2.0",o.TRANSITION_DURATION=300,o.BACKDROP_TRANSITION_DURATION=150,o.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"};var a=function(e,i){var n=t(window);i.left=Math.max(0,Math.min(i.left,n.width()-e.outerWidth())),i.top=Math.max(0,Math.min(i.top,n.height()-e.outerHeight())),e.css(i)};o.prototype.toggle=function(t,e){return this.isShown?this.hide():this.show(t,e)},o.prototype.adjustPosition=function(i,o){var s=this;if(clearTimeout(s.reposTask),o)return void(s.reposTask=setTimeout(s.adjustPosition.bind(s,i,0),o));var r=s.options;if(i===e&&(i=r.position),i!==e&&null!==i){t.isFunction(i)&&(i=i(s));var l=s.$element.find(".modal-dialog"),h=t(window).height(),c={maxHeight:"initial",overflow:"visible"},d=l.find(".modal-body").css(c);if(r.scrollInside&&d.length){var u=r.headerHeight,p=r.footerHeight,f=l.find(".modal-header"),g=l.find(".modal-footer");"number"!=typeof u&&(u=f.length?f.outerHeight():t.isFunction(u)?u(f):0),"number"!=typeof p&&(p=g.length?g.outerHeight():t.isFunction(p)?p(g):0),c.maxHeight=h-u-p,c.overflow=d[0].scrollHeight>c.maxHeight?"auto":"visible",d.css(c)}var m=Math.max(0,(h-l.outerHeight())/2);if("fit"===i?i={top:m>50?Math.floor(2*m/3):m}:"center"===i?i={top:m}:t.isPlainObject(i)||(i={top:i}),l.hasClass("modal-moveable")){var v=null,y=r.rememberPos;y&&(y===!0?v=s.$element.data("modal-pos"):t.zui.store&&(v=t.zui.store.pageGet(n+".rememberPos."+y))),i=t.extend(i,{left:Math.max(0,(t(window).width()-l.outerWidth())/2)},v),"inside"===r.moveable?a(l,i):l.css(i)}else l.css(i)}},o.prototype.setMoveable=function(){t.fn.draggable||console.error("Moveable modal requires draggable.js.");var e=this,i=e.options,o=e.$element.find(".modal-dialog").removeClass("modal-dragged");o.toggleClass("modal-moveable",!!i.moveable),e.$element.data("modal-moveable-setup")||o.draggable({container:e.$element,handle:".modal-header",before:function(){var t=o.css("margin-top");t&&"0px"!==t&&o.css("top",t).css("margin-top","").addClass("modal-dragged")},finish:function(o){var a=i.rememberPos;a&&(e.$element.data("modal-pos",o.pos),t.zui.store&&a!==!0&&t.zui.store.pageSet(n+".rememberPos."+a,o.pos))},move:"inside"!==i.moveable||function(t){a(o,t)}})},o.prototype.show=function(e,i){var a=this,s=t.Event("show."+n,{relatedTarget:e});a.$element.trigger(s),a.$element.toggleClass("modal-scroll-inside",!!a.options.scrollInside),a.isShown||s.isDefaultPrevented()||(a.isShown=!0,a.options.moveable&&a.setMoveable(),a.options.backdrop!==!1&&(a.setScrollbar(),a.$body.addClass("modal-open")),a.escape(),a.$element.on("click.dismiss."+n,'[data-dismiss="modal"]',function(t){a.hide(),t.stopPropagation()}),a.backdrop(function(){var s=t.support.transition&&a.$element.hasClass("fade");a.$element.parent().length||a.$element.appendTo(a.$body),a.$element.show().scrollTop(0),s&&a.$element[0].offsetWidth,a.$element.addClass("in").attr("aria-hidden",!1),a.adjustPosition(i),a.enforceFocus();var r=t.Event("shown."+n,{relatedTarget:e});s?a.$element.find(".modal-dialog").one("bsTransitionEnd",function(){a.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(o.TRANSITION_DURATION):a.$element.trigger("focus").trigger(r)}))},o.prototype.hide=function(e){e&&e.preventDefault&&e.preventDefault();var i=this;e=t.Event("hide."+n),i.$element.trigger(e),i.isShown&&!e.isDefaultPrevented()&&(i.isShown=!1,i.options.backdrop!==!1&&(i.$body.removeClass("modal-open"),i.resetScrollbar()),i.escape(),t(document).off("focusin."+n),i.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss."+n),t.support.transition&&i.$element.hasClass("fade")?i.$element.one("bsTransitionEnd",t.proxy(i.hideModal,i)).emulateTransitionEnd(o.TRANSITION_DURATION):i.hideModal())},o.prototype.enforceFocus=function(){t(document).off("focusin."+n).on("focusin."+n,t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},o.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keydown.dismiss."+n,t.proxy(function(i){if(27==i.which){var o=t.Event("escaping."+n),a=this.$element.triggerHandler(o,"esc");if(a!=e&&!a)return;this.hide()}},this)):this.isShown||t(document).off("keydown.dismiss."+n)},o.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$element.trigger("hidden."+n)})},o.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},o.prototype.backdrop=function(e){var i=this,a=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&a;if(this.$backdrop=t('
  • ").css({width:n.tileSize,height:n.tileSize}).append(o)),n.optional&&this.$menu.find(".cp-tile.empty").parent().detach().appendTo(this.$menu)},o.prototype.updateColors=function(e){var i=this.$menu,n=this.options,e=e||this.colors,o=this,a=0;if(i.children("li:not(.heading)").remove(),t.each(e,function(t,e){o.addColor(e),a++}),n.optional){var s=t('
  • ').css({width:n.tileSize,height:n.tileSize});this.$menu.append(s),a++}i.css("width",Math.min(a,n.lineCount)*n.tileSize+6)},o.prototype.setValue=function(e,i){var n=this,o=n.options,a=n.$btn,s="";n.$menu.find(".cp-tile.active").removeClass("active");var r=o.updateBtn;if("auto"===r){var l=a.find(".color-bar");r=!l.length||function(t){l.css("background",t||"")}}if(e){var h=new t.zui.Color(e);s=h.toCssStr().toLowerCase(),r&&(t.isFunction(r)?r(s,a,n):a.css({background:s,color:h.contrast().toCssStr(),borderColor:h.luma()>.43?"#ccc":s})),n.colors[s]||n.addColor(h),i||n.$.val().toLowerCase()===s||n.$.val(s).trigger("change"),n.$menu.find('.cp-tile[data-color="'+s+'"]').addClass("active"),n.$.tooltip("hide"),n.$.trigger("colorchange",h)}else r&&(t.isFunction(r)?r(null,a,n):a.attr("style",null)),i||""===n.$.val()||n.$.val(s).trigger("change"),o.optional&&n.$.tooltip("hide"),n.$menu.find(".cp-tile.empty").addClass("active"),n.$.trigger("colorchange",null);o.updateBorder&&t(o.updateBorder).css("border-color",s),o.updateBackground&&t(o.updateBackground).css("background-color",s),o.updateColor&&t(o.updateColor).css("color",s),o.updateText&&t(o.updateText).text(s)},o.prototype.getOptions=function(i){var a=t.extend({},o.DEFAULTS,this.$.data(),i);"string"==typeof a.colors&&(a.colors=a.colors.split(","));var s=a.lang||t.zui.clientLang(),r=this.lang=t.zui.getLangData?t.zui.getLangData(e,s,n):n[s]||n.en;a.errorTip||(a.errorTip=r.errorTip),t.fn.tooltip||(a.btnTip=!1),this.options=a},o.DEFAULTS={colors:["#00BCD4","#388E3C","#3280fc","#3F51B5","#9C27B0","#795548","#F57C00","#F44336","#E91E63"],pullMenuRight:!0,wrapper:"btn-wrapper",tileSize:30,lineCount:5,optional:!0,tooltip:"top",icon:"caret-down",updateBtn:"auto"},o.LANG=n,t.fn.colorPicker=function(e){return this.each(function(){var i=t(this),n=i.data(name),a="object"==typeof e&&e;n||i.data(name,n=new o(this,a)),"string"==typeof e&&n[e]()})},t.fn.colorPicker.Constructor=o,t(function(){t('[data-provide="colorpicker"]').colorPicker()})}(jQuery),function(t,e){function i(t){return t===e&&(t=o+=1),a[t%a.length]}function n(e,i){var n=t(e);i=t.extend({percent:0,size:20,backColor:"#eee",color:"#00da88",borderColor:"#ccc",borderSize:1,rotate:-90},n.data(),i);var o=i.percent,a=i.size;"string"==typeof o&&(o=Number.parseFloat(o,10)),"string"==typeof a&&(a=Number.parseFloat(a,10)),a=Math.floor(a);var s=a/2,r=3.14*s,l="http://www.w3.org/2000/svg",h=document.createElementNS(l,"svg"),c=document.createElementNS(l,"circle"),d=document.createElementNS(l,"circle");d.setAttribute("r",s),d.setAttribute("cx",s),d.setAttribute("cy",s),d.setAttribute("fill",i.backColor),d.setAttribute("stroke",i.borderColor),d.setAttribute("stroke-width",i.borderSize),c.setAttribute("r",s/2),c.setAttribute("cx",s),c.setAttribute("cy",s),c.setAttribute("fill","transparent"),c.setAttribute("stroke-dasharray",(o*r/100).toFixed(1)+" "+r),c.setAttribute("stroke-width",s),c.setAttribute("stroke",i.color),c.setAttribute("transform","rotate(-90) translate(-"+a+")"),h.setAttribute("viewBox","0 0 "+a+" "+a),h.setAttribute("width",a),h.setAttribute("height",a),h.setAttribute("transform","rotate(180)"),h.appendChild(d),h.appendChild(c),n[0].appendChild(h);var u={width:a,height:a};"inline"===n.css("display")&&(u.display="inline-block",u.verticalAlign="middle"),n.css(u)}var o=0,a=["#00a9fc","#ff5d5d","#fdc137","#00da88","#7ec5ff","#8666b8","#bd7b46","#ff9100","#ff3d00","#f57f17","#00e5ff","#00b0ff","#2979ff","#3d5afe","#651fff","#d500f9","#f50057","#ff1744"];jQuery.fn.tableChart=function(){t(this).each(function(){var e=t(this),n=e.data(),o=n.chart||"pie",a=t(n.target);if(a.length){var s=null;if("pie"===o){n=t.extend({scaleShowLabels:!0,scaleLabel:"<%=label%>: <%=value%>"},n);var r=[],l=e.find("tbody > tr").each(function(e){var n=t(this),o=i();n.attr("data-id",e).find(".chart-color-dot").css("background",o),r.push({label:n.find(".chart-label").text(),value:parseFloat(n.data("value")||n.find(".chart-value").text()),color:o,id:e})});r.length>1?n.scaleLabelPlacement="outside":1===r.length&&(n.scaleLabelPlacement="inside",r.push({label:"",value:r[0].value/2e3,color:"#fff",showLabel:!1})),s=a.pieChart(r,n),a.on("mousemove",function(t){var e=s.getSegmentsAtEvent(t);l.removeClass("active"),e.length&&l.filter('[data-id="'+e[0].id+'"]').addClass("active")})}else if("bar"===o){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(i.data("value")||parseFloat(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(n.barValueSpacing=5),s=a.barChart(r,n)}else if("line"===o){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(parseInt(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(n.barValueSpacing=5),s=a.lineChart(r,n)}null!==s&&e.data("zui.chart",s)}})},t(".table-chart").tableChart();var s=function(i,n){var o=t(i);if(!o.data("pieChart")){var a=o.is("canvas")?o:o.find("canvas"),s=t.extend({value:0,color:t.getThemeColor("primary")||"#006af1",backColor:t.getThemeColor("pale")||"#E9F2FB",doughnut:!0,doughnutSize:85,width:20,height:20,showTip:!1,name:"",tipTemplate:"<%=value%>%",animation:"auto",realValue:parseFloat(o.find(".progress-value").text())},n,o.data()),r=a.length;r||(a=t("").appendTo(o)),a.attr("width")!==e?s.width=a.attr("width"):a.attr("width",s.width),a.attr("height")!==e?s.height=a.attr("height"):a.attr("height",s.height),r||8!=t.zui.browser.ie||G_vmlCanvasManager.initElement(a[0]),"auto"===s.animation&&(s.animation=s.width>30),s.value=Math.max(0,Math.min(100,s.value)),o.addClass("progress-pie-"+s.width);var l=[{value:s.value,label:s.name,color:s.color,circleBeginEnd:!0},{value:100-s.value,label:"",color:s.backColor}],h=a[s.doughnut?"doughnutChart":"pieChart"](l,t.extend({segmentShowStroke:!1,animation:s.animation,showTooltips:s.showTip,tooltipTemplate:s.tipTemplate,percentageInnerCutout:s.doughnutSize,reverseDrawOrder:!0,animationEasing:"easeInOutQuart",onAnimationProgress:s.realValue?function(t){o.find(".progress-value").text(Math.floor(s.realValue*t))}:e,onAnimationComplete:s.realValue?function(t){o.find(".progress-value").text(s.realValue)}:e},s.chartOptions));o.data("pieChart",h)}};jQuery.fn.progressPie=function(e){t(this).each(function(){var i=t(this);if(!i.closest(".hidden").length){var n=i.closest(".tab-pane");n.length&&!n.hasClass("active")?t('[data-toggle="tab"][data-target="#'+n.attr("id")+'"]').one("shown.zui.tab",function(){s(i,e)}):s(this,e)}})},jQuery.fn.pieIcon=function(e){t(this).each(function(){n(this,e)})},t(function(){t(".table-chart").tableChart();var e=t(".progress-pie");e.length>100?setTimeout(function(){e.progressPie()},1e3):e.progressPie(),t(".pie-icon").pieIcon()})}(jQuery,void 0),function(t){jQuery.fn.sparkline=function(e){t(this).each(function(){var i=t(this),n=t.extend({values:i.attr("values"),width:i.width()-4,height:i.height()-4},i.data(),e),o=n.height,a=[],s=n.width,r=n.values.split(","),l=0;for(var h in r){var c=parseFloat(r[h]);NaN!=c&&(a.push(c),l=Math.max(c,l))}var d=(Math.min(l,30),Math.min(s,Math.max(10,a.length*s/30))),u=i.children("canvas");u.length||(i.append(''),u=i.children("canvas")),u.attr("width",d).attr("height",o);var p={labels:a,datasets:[{fillColor:t.getThemeColor("pale")||"rgba(0,0,255,0.05)",strokeColor:t.getThemeColor("primary")||"#0054EC",pointColor:t.getThemeColor("secondary")||"rgba(255,136,0,1)",pointStrokeColor:"#fff",data:a}]},f={animation:!0,scaleOverride:!0,scaleStepWidth:Math.ceil(l/10),scaleSteps:10,scaleStartValue:0,showScale:!1,showTooltips:!1,pointDot:!1,scaleShowGridLines:!1,datasetStrokeWidth:1},g=t(u).lineChart(p,f);i.data("sparklineChart",g)})},t(function(){t(".sparkline").sparkline()})}(jQuery),function(t){t.fn.fixedDate=function(){return t(this).each(function(){var e=t(this).attr("autocomplete","off");"0000-00-00"==e.val()&&e.focus(function(){"0000-00-00"==e.val()&&e.val("").datetimepicker("update")}).blur(function(){""==e.val()&&e.val("0000-00-00")})})},window.datepickerOptions={language:t("html").attr("lang"),weekStart:1,todayBtn:1,autoclose:1,todayHighlight:1,startView:2,forceParse:0,showMeridian:1,format:"yyyy-mm-dd hh:ii",startDate:"1970-1-1"},t.extend(t.fn.datetimepicker.defaults,window.datepickerOptions),t(function(){var e={minView:2,format:"yyyy-mm-dd"},i={eleClass:"only-pick-time",startView:1,minView:0,maxView:1,format:"hh:ii"},n={minView:3,startView:3,format:"yyyy-mm"};t(".datepicker-wrapper").click(function(){t(this).find(".form-date, .form-datetime, .form-time, .form-month").datetimepicker("show").focus()}),t.fn.datepicker=function(i){return this.datetimepicker(t.extend({},e,i))},t.fn.timepicker=function(e){return this.datetimepicker(t.extend({},i,e))},t.fn.monthpicker=function(e){return this.datetimepicker(t.extend({},n,e))},t.fn.datepickerAll=function(){return this.find(".form-datetime").fixedDate().datetimepicker(),this.find(".form-date").fixedDate().datepicker(),this.find(".form-time").fixedDate().timepicker(),this.find(".form-month").fixedDate().monthpicker(),this},t("body").datepickerAll()})}(jQuery),function(t){var e=function(e,i){i=t.extend({idStart:0,idEnd:9,chosen:!0,datetimepicker:!0,colorPicker:!0,hotkeys:!0},i,e.data());var n=e.find(".template");!n.length&&i.template&&(n=t(i.template));var o=0,a=0,s=function(t){t.is("select.chosen")?t.next(".chosen-container").find("input").focus():t.focus()},r=function(t){var i=e.find("[data-ctrl-index]:focus,.chosen-container-active").first();if(i.length){if(i.is(".chosen-container-active")){if(i.hasClass("chosen-with-drop")&&("down"===t||"up"===t))return;i=i.prev("select.chosen")}var n=i.data("ctrlIndex"),r=i.closest("tr").data("row");"down"===t?r0?r-=1:r=a-1:"left"===t?n>0?n-=1:n=o-1:"right"===t&&(n").html(s);return r.attr("data-row",e).addClass(n.attr("class")).removeClass("template"),i.rowCreator&&i.rowCreator(r,e,i),o?o.after(r):h.append(r),c(r),r};t.extend(l,{createRow:u,template:d});for(var p=i.idStart;p<=i.idEnd;++p)u(p)}else c(e);e.on("click",".btn-copy",function(){var e=t(this),i=t(e.data("copyFrom")).val(),n=t(e.data("copyTo")).val(i).addClass("highlight");setTimeout(function(){n.removeClass("highlight")},2e3)}),i.hotkeys&&t(document).on("keydown",function(t){var e={"Ctrl+#37":"left","Ctrl+#39":"right","#38":"up","#40":"down","Ctrl+#38":"up","Ctrl+#40":"down"},i=[];t.ctrlKey&&i.push("Ctrl"),i.push("#"+t.keyCode);var n=e[i.join("+")];n&&(r(n),t.ctrlKey&&(t.stopPropagation(),t.preventDefault()))}),e.data("zui.batchActionForm",l),setTimeout(t.fixTableResponsive,0)};t.fn.batchActionForm=function(i){return this.each(function(){e(t(this),i)})}}(jQuery),function(t,e){"use strict";var i="zui.table",n={zh_cn:{selectedItems:"已选择 {0} 项",attrTotal:"{0}总计 {1}"},zh_tw:{selectedItems:"已选择 {0} 项",attrTotal:"{0}总计 {1}"},en:{selectedItems:"Seleted {0} items",attrTotal:"{0} total {1}"},de:{selectedItems:"{0} ausgewählt",attrTotal:"{0} insgesamt {1}"},fr:{selectedItems:"{0} sélectionnés",attrTotal:"{0} total {1}"}},o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),a=t.zui.browser.isIE(),s=a?200:100,r=function(e,o){var a=this;a.name=i;var s=a.$=t(e);o=a.options=t.extend({},r.DEFAULTS,this.$.data(),o),a.langName=o.lang||t.zui.clientLang(),a.lang=t.zui.getLangData(i,a.langName,n),s.attr("id")||(s.attr("id","table-"+t.zui.uuid()),a.noID=!0,o.hot&&console.warn("ZUI: table hot replace id not defined, the element id attribute should be set.")),s.attr("data-ride")||s.attr("data-ride","table");var l=a.getTable();if(l.length){l.find("thead>tr>th").each(function(){var e=t(this);if(!e.attr("title")){var i=t.trim(e.find("a:first").text()||e.text()||"");i.length&&e.attr("title",i)}}),o.nested&&a.initNestedList(),o.checkable&&(s.on("click",".check-all",function(){a.checkAll(!t(this).hasClass("checked"))}),o.checkOnClickRow&&s.on("click","tbody>tr",function(e){t(e.target).closest('.btn,a,.not-check,.form-control,input[type="text"],.chosen-container').length||a.checkRow(t(this))}),s.on("click",'tbody input[type="checkbox"],tbody label[for]',function(e){e.stopPropagation();var i=t(this);i.is("label")&&(i=i.closest(".checkbox-primary").find('input[type="checkbox"]')),a.checkRow(i.closest("tr"),i.is(":checked"))}),o.selectable&&s.selectable(t.extend({},{selector:a.isDataTable?".fixed-left tbody>tr":"tbody>tr",selectClass:"",trigger:".c-id",clickBehavior:"multi",listenClick:!1,start:function(){this.syncSelectionsFromClass()},select:function(e){a.checkRow(e.target,!0),t.cookie("ajax_dragSelected")||(t.cookie("ajax_dragSelected","on",{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("dragSelected"))},unselect:function(t){a.checkRow(t.target,!1)},rangeStyle:{border:"1px solid #006af1",backgroundColor:"rgba(50,128,252,0.2)",borderRadius:"2px"}},t.isPlainObject(o.selectable)?o.selectable:null)));var h=a.$form=s.is("form")?s:s.find("form");h.length&&(o.ajaxForm?h.ajaxForm(t.isPlainObject(o.ajaxForm)?o.ajaxForm:null):h.on("click","[data-form-action]",function(){h.attr("action",t(this).data("formAction")).submit()})),(o.fixFooter||o.fixHeader)&&(a.pageFooterHeight=t("#footer").outerHeight(),a.updateFixUI(!0),t(window).on("scroll resize",function(){a.updateFixUI()}).on("sidebar.toggle",function(){setTimeout(function(){a.updateFixUI()},200)})),o.group&&(s.on("click",".group-toggle",function(){a.toggleRowGroup(t(this).closest("tr").data("id"))}),t(document).on("click",".group-collapse-all",function(){a.toggleGroups(!1)}).on("click",".group-expand-all",function(){a.toggleGroups(!0)})),a.defaultStatistic=s.find(".table-statistic").html(),a.updateStatistic(),a.initModals(),a.checkItems={},a.updateCheckUI()}};r.prototype.initNestedList=function(){var e=this,i=e.getTable().addClass("table-nested"),n=i.find("tbody"),o=n.children("tr[data-id]"),a={},s=[];o.each(function(e){var i=t(this),n=i.data();n.realOrder=e,n.$row=i,n.nestPath?(n.nestPathList=n.nestPath.split(","),n.nestPathList[0]||n.nestPathList.shift(),n.nestPathList[n.nestPathList.length-1]||n.nestPathList.pop(),n.nestPathLevel=n.nestPathList.length,i.attr("data-level",n.nestPathLevel)):(n.nestPath=","+n.id+",",n.nestPathList=[n.id],n.nestPathLevel=1),a[n.id]=n,s.push(n)});var r=[];t.each(s,function(t,i){return i.nestParent&&(i.parent=a[i.nestParent],i.parent)?(i.parent.children?i.parent.children.push(i):i.parent.children=[i],void(e.options.expandNestChild||e._initedNestedList||(i.$row.addClass("table-nest-hide"),i.parent.$row.addClass("table-nest-child-hide")))):(i.$row.removeClass("table-nest-hide"),void r.push(i))});var l=function(i){for(var o=0;o').prependTo(s)),r.toggleClass("table-nest-toggle",!!a.children).css("marginLeft",(a.nestPathLevel-1)*e.options.nestLevelIndent),delete a.$row}};l(r),e.nestRowsMap=a,e.$nestBody=n,e._initedNestedList||(n.on("click",".table-nest-toggle",function(){e.toggleNestedRows(t(this).closest("tr").data("id"))}),n.on("mouseenter","tr.has-nest-child",function(){n.find(".table-nest-hover").removeClass("table-nest-hover"),n.find(".table-nest-child-hover").removeClass("table-nest-child-hover");var e=t(this).addClass("table-nest-hover"),i=e.closest("tr").data("id");n.find('[data-nest-path*=",'+i+',"]').addClass("table-nest-child-hover")}).on("mouseleave","tr.table-nest-hover",function(){n.find(".table-nest-hover").removeClass("table-nest-hover"),n.find(".table-nest-child-hover").removeClass("table-nest-child-hover")}),e._initedNestedList=!0)},r.prototype.toggleNestedRows=function(t,i,n,o){var a=this,s=a.nestRowsMap[t],r=a.$nestBody.find('[data-id="'+t+'"]'),l=r.hasClass("table-nest-child-hide");i===e&&(i=l),o===e?(r.toggleClass("table-nest-child-hide",!i),o=i):(r.toggleClass("table-nest-hide",!i||!o),o=!l);var h=s.children;if(h)for(var c=0;c");i.$.addClass("load-indicator loading"),s.load(window.location.href+" #"+o,function(r){if(a===o)i.$.empty().html(s.children().html()),i.$.find('[data-ride="pager"]').pager();else{i.$.find("#"+o).empty().html(s.children().html());try{var l=t(r),h=l.find("#"+o).closest('[data-ride="table"],#'+a);if(h.length){var c=h.find(".table-statistic");c.length&&(i.defaultStatistic=c.html());var d=i.$.find('[data-ride="pager"]').data("zui.pager"),u=h.find('[data-ride="pager"]');d&&u.length&&d.set(u.data())}}catch(p){console.error(p)}}i.$.removeClass("load-indicator loading").trigger("beforeTableReload"),delete i.defaultStatistic,i.updateStatistic(),i.initModals(),i.$.datepickerAll();var f=i.$.find("tbody>tr"),g=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(f.filter('[data-id="'+t+'"]'),!0,!0),g=!0)}),g&&i.updateCheckUI(),i.$.trigger("tableReload");var m=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");if(m.length){var u=i.$.find(".pager[data-rec-total]"),v=u.length?u.attr("data-rec-total"):i.getTable().find("tbody:first>tr:not(.table-children)").length;m.text(v)}e&&e(),n.afterReload&&n.afterReload()})},r.prototype.initModals=function(){var e=this,i=e.options,n=e.$.find(i.iframeModalTrigger);if(n.length){var o={type:"iframe",onHide:i.replaceId?function(){var n=t.cookie("selfClose");(1==n||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};n.modalTrigger(o)}},r.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e=t.find("div.datatable")),e},r.prototype.toggleGroups=function(e){var i=this,n={};i.$.find("tbody>tr").each(function(){var o=t(this).closest("tr").data("id");n[o]||i.toggleRowGroup(o,e)})},r.prototype.toggleRowGroup=function(i,n){var o=this.$.find('tbody>tr[data-id="'+i+'"]'),a=o.filter(".group-summary"),s=n===e?!a.hasClass("hidden"):!!n;o.not(".group-summary").toggleClass("hidden",!s),a.toggleClass("hidden",s),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},r.prototype.updateStatistic=function(){var i=this,n=i.$.find(".table-statistic");if(n.length){if(i.defaultStatistic===e&&(i.defaultStatistic=n.html()),i.options.statisticCreator)return void n.html(i.options.statisticCreator(i)||i.defaultStatistic);var o=i.statisticCols;if(!o&&o!==!1){o={};var a=!1;i.getTable().find("thead th").each(function(e){var i=t(this),n=i.data("statistic");n&&(a=!0,o[e]={format:n,name:i.text()})}),i.statisticCols=!!a&&o}var s=0;o&&t.each(o,function(t){o[t].total=0,o[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var e=t(this),i=e.hasClass("checked"),n=e.children("td");i&&s++,o&&t.each(o,function(t){var e=parseFloat(n.eq(t).text());isNaN(e)&&(e=0),o[t].total+=e,i&&(o[t].checkedTotal+=e)})});var r=[];if(s)r.push(i.lang.selectedItems.format(s));else if(i.defaultStatistic)return void n.html(i.defaultStatistic);o&&t.each(o,function(t){var e=o[t],n=e[s?"checkedTotal":"total"];e.format&&(n=e.format.format(n)),r.push(i.lang.attrTotal.format(e.name,n))}),n.html(r.join(", "))}},r.prototype.updateFixUI=function(e){var i=this,n=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||n-i.lastUpdateTime').append(t('
    ').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),c){var d=h[0].getBoundingClientRect();l.css({left:d.left,width:h.width()}),l.find(".fixed-header-copy").css({left:o.left-d.left,position:"relative",minWidth:i.width()}),a||h.data("fixHeaderScroll")||(h.data("fixHeaderScroll",1),i.width()>h.width()&&h.on("scroll",function(){e.fixHeader()}))}else l.css({left:o.left,width:o.width});var u=l.find("th");n.find("th").each(function(e){u.eq(e).css("width",t(this).outerWidth())})}else l.remove()},r.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var a=n.find("tbody");if(!a.length)return;e=a[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r=t.isFunction(s)?s(e,o):e.bottom>window.innerHeight-50-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r);var l=t("body"),h=l.hasClass("body-modal");if(r){var c=n.parent(),d=c.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:d?c[0].getBoundingClientRect().left:e.left,width:d?c.width():e.width}),h&&l.css("padding-bottom",40)}else o.css({width:"",left:0,bottom:0}),h&&l.css("padding-bottom",0)},r.prototype.checkAll=function(e){var i=this,n=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},r.prototype.checkRow=function(t,i,n){var o=this;o.isDataTable&&!t.is(".datatable-row-left")&&(t=o.getTable().find('.datatable-row-left[data-index="'+t.data("index")+'"]'));var a=t.find('input[type="checkbox"]');a.length&&!a.is(":disabled")&&(i===e&&(i=!a.is(":checked")),o.isDataTable?o.getTable().find('.datatable-row[data-index="'+t.data("index")+'"]').toggleClass("checked",i):t.toggleClass("checked",i),this.checkItems[t.data("id")]=i,a.prop("checked",i).trigger("change"),n||o.updateCheckUI())},r.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").not(".group-summary"),o=!1,a=null,s=0,r=!1,l=n.length;n.each(function(n){var h=t(this),c=h.find('input[type="checkbox"]');r=c.is(":checked");var d=e.isDataTable?i.find('.datatable-row[data-index="'+h.data("index")+'"]'):h;d.toggleClass("checked",r),d.toggleClass("row-check-begin",r&&!o),a&&a.toggleClass("row-check-end",!r&&o),r&&(s+=1),a=d,o=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange()},r.DEFAULTS={checkable:!0,checkOnClickRow:!0,ajaxForm:!1,selectable:!0,fixHeader:!a,fixFooter:!a,iframeWidth:900,replaceId:"self",nestLevelIndent:18,hot:!1,iframeModalTrigger:".iframe"},t.fn.table=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new r(this,a)),"string"==typeof e&&o[e]()})},r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="",a="ja"===t.zui.clientLang()?"":";";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var s=function(e,i,n){"string"==typeof i&&(n=i,i=null),n=n||"show",t.zui.messager?t.zui.messager[n](e,i):alert(e)};t.ajaxForm=function(r,l){var h=t(r);if(h.length>1)return h.each(function(){t.ajaxForm(this,l)});t.isFunction(l)&&(l={complete:l}),l=t.extend({},n,h.data(),l);var c=l.beforeSubmit,d=l.error,u=l.success,p=l.finish;delete l.finish,delete l.success,delete l.onError,delete l.beforeSubmit,l=t.extend({beforeSubmit:function(n,a,s){if(h.enableForm(!1),(c&&c(n,a,s))!==!1){var r={},l=a.find('[type="file"]');r.fileapi=l.length&&l[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")}},success:function(i,n,o){if((u&&u(i,n,o,h))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(r){}if(null===i||"object"!=typeof i)return i?alert(i):s("No response.","danger");var c=l.responser?t(l.responser):h.find(".form-responser");c.length||(c=t("#responser"));var d=i.message,f=function(){var n=i.callback;if(n){var o=n.indexOf("("),a=(o>0?n.substr(0,o):n).split("."),s=e,r=a[0];a.length>1&&(r=a[1],"top"===a[0]?s=e.top:"parent"===a[0]&&(s=e.parent));var l=s[r];if(t.isFunction(l)){var c=[];return o>0&&")"==n[n.length-1]&&(c=t.parseJSON("["+n.substring(o+1,n.length-1)+"]")),c.push(i),l.apply(h,c)}}};if("success"===i.result){var g=l.locate||i.locate;if(h.enableForm(!0,!!g),d){var m=h.find('[type="submit"]').first(),v=!1;m.length&&(m.popover({container:"body",trigger:"manual",content:d,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||l.popoverPlacement||"right"}).popover("show"),setTimeout(function(){m.popover("destroy")},l.popoverTime||2e3),v=!0),c.length&&(c.html(''+d+"").show().delay(3e3).fadeOut(100),v=!0),v||s(d,"success")}if(p)return p(i,!0,h);if((l.closeModal||i.closeModal)&&setTimeout(t.zui.closeModal,l.closeModalTime||2e3),f()===!1)return;if(g)if("loadInModal"==g){var y=t(".modal");setTimeout(function(){y.load(y.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else if("parent"===g||"top"===g)e[g]&&setTimeout(function(){e[g].location.reload()},1200);else{var b="reload"==g?e.location.href:g;setTimeout(function(){e.location.href=b},1200)}var w=l.ajaxReload||i.ajaxReload;if(w){var x=t(w);x.length&&x.load(e.location.href+" "+w,function(){x.find('[data-toggle="modal"]').modalTrigger()})}}else{if(h.enableForm(),"string"==typeof d)c.length?c.html(''+d+"").show().delay(3e3).fadeOut(100):s(d,"danger");else if("object"==typeof d){var C=!1,_=[];t.each(d,function(e,i){var n=t.isArray(i)?i.join(a):i,o=t("#"+e);if(!o.length)return void _.push(n);var s=e+"Label",r=t("#"+s);if(!r.length){var l=o.closest(".input-group").length,h=o.closest("td").length;r=t('
    ').appendTo(h?o.closest("td"):l?o.closest(".input-group").parent():o.parent())}r.empty().append(n),o.addClass("has-error");var c=function(){var e=t("#"+s);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",c);var d=t("#"+e+"_chosen");if(d.length&&d.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){c()===!0&&t(this).removeClass("has-error")}),!C){if(o.hasClass("chosen"))o.trigger("chosen:activate");else if(o.is("textarea")&&o.data("keditor")){var u=o.data("keditor");u.focus(),u.edit.doc.body.focus()}else o.focus();C=!0}}),_.length&&s(_.join(";"),"danger")}if(p)return p(i,!1,h);if(f()===!1)return}}},error:function(t,i,n){if((d&&d(t,i,n,h))!==!1){h.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;s(o,"danger")}}},l),h._ajaxForm(l).data("zui.ajaxform",!0),h.on("click","[data-form-action]",function(){h.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{onFinish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t("#hiddenwin"),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
    ').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
    '+(n.errorText||window.lang&&window.lang.timeout)+"
    "),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=t.trim(e).split(" ");a.each(function(){var e=t(this),n=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active"))},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
    ')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=""===o.value||"0"===o.value,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s&&!o.label?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(h.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(t,e,n,o,a,s){if(o||(o=config.defaultView),a||(a=!1),n)for(n=n.split("&"),i=0;i0?"&":"?")+"pgm="+s),l},t(function(){var e=t("#main,#mainContent,#mainRow,.auto-fade-in");e.length&&e.hasClass("fade")&&setTimeout(function(){e.addClass("in")},e.data("fadeTime")||200)}),t.ajaxSendScore=function(e){t.get(t.createLink("score","ajax","method="+e))};var e=function(t){var e=0;if(t){var i=t.split(":");e+=60*parseInt(i[0]),e+=parseInt(i[1])}return e},n=function(t){t%=1440;var e=Math.floor(t/60),i=t%60;return e<10&&(e="0"+e),i<10&&(i="0"+i),e+":"+i},o=function(t){if("string"==typeof t&&(t=e(t)),"number"==typeof t)if(t<1e5){var i=new Date;i.setHours(Math.floor(t/60)%24),i.setMinutes(t%60),t=i}else t=new Date(t);return t},a=function(t,i){for(var a=i?o(i):new Date,s=a.getHours(),r=10*Math.floor(a.getMinutes()/10)+10,l=0;l<24;++l){var h=(l+s)%24;if(!(h<5))for(var c=0;c<6;++c){var d=n(60*h+10*c+r);t.append('")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),h=s.find('[name="end"],.control-time-end'),c=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);h.find('option[value="'+i+'"]').length&&h.val(i),r.onChange&&r.onChange(h,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");h.find('option[value="'+u+'"]').length&&h.val(u),r.onChange&&r.onChange(h,u)}}else l.on("change",c),a(l,r.begin),a(h,r.end),s.data("timeSpanControlInit",!0);r.end||c()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,""))window.location.href=t.createLink(e,"testsuite"===e?"library":"view","id="+i);else{var n={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||n[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(){location.href=removeAnchor(location.href)},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage()},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage()},t.zui.Picker&&t.zui.Picker.enableChosen(),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+a{page}/{totalPage}',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,h=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(h,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var c=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;h="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(h,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,c=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:40}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()});var d=function(){var e,i,n=t(this),o=t.extend({limitSize:40,suffix:"…"},n.data()),a=n.text();if(a.length>o.limitSize){e=a,i=a.substr(0,o.limitSize)+o.suffix,n.text(i).addClass("limit-text-on");var s=o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle");s.text(s.data("textExpand")),s.on("click",function(){var t=n.toggleClass("limit-text-on").hasClass("limit-text-on");n.text(t?i:e),s.text(s.data(t?"textExpand":"textCollapse"))})}else(o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle")).hide()};t.fn.textLimit=function(){return this.each(d)},t(function(){t(".text-limit").textLimit()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
    ").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var u,p,f,g,m,v=function(){u||(u=t("#subNavbar"),p=t("#pageNav"),f=t("#pageActions"),g=u.children(".nav"),m=g.outerWidth());var e=u.outerWidth(),i=p.outerWidth()||0,n=f.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void g.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,m),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),T()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])});var S=function(){var e,i="en"==config.clientLang?"//www.zentao.pm/book/zentaomanual/8.html?fullScreen=zentao":"ja"==config.clientLang?"//www.zentao.jp/book/zentaomanual/8.html?fullScreen=zentao":"//www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao",n=t("#navbar > .nav").first(),o=1e4,a=function(){clearTimeout(e),t("#helpContent").removeClass("show-error")},s=t.openHelp=function(s){s=s||i,a(),n.children("li.active:not(#helpMenuItem)").removeClass("active").addClass("close-help-tab"),t("#helpMenuItem").addClass("active");var r=t("#helpContent");if(r.length){if(t("body").hasClass("show-help-tab"))return void t("#helpIframe").get(0).contentWindow.location.replace(s)}else{r=t('

    '+lang.timeout+'

    '+s+'

    '),t("#header").after(r);var l=t("#helpIframe").get(0);e=setTimeout(function(){t("#helpContent").addClass("show-error")},o),l.onload=l.onreadystatechange=function(){this.readyState&&"complete"!=this.readyState||a()}}t("body").addClass("show-help-tab")},r=t.closeHelp=function(){t("body").removeClass("show-help-tab"),t("#helpMenuItem").removeClass("active"),n.find("li.close-help-tab").removeClass("close-help-tab").addClass("active").find("a").focus()};t(document).on("click",".open-help-tab",function(e){var i=t(this),o=t("#helpMenuItem");o.length||(o=t('
  • '+i.text()+'
  • '),n.append('
  • ').append(o)),s(i.attr("href")),e.preventDefault()}).on("click",".close-help-tab",function(t){r(),t.stopPropagation(),t.preventDefault()})};t(S),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var D=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(D)},t(function(){t("textarea.autosize").each(D),t(document).on("input paste change","textarea.autosize",D)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var M="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=M,t("html").toggleClass("is-firefox",M).toggleClass("not-firefox",!M),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
    ').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){const r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var t=270,i=e.getBoundingClientRect();i.top<0&&(t=Math.min(270,i.height)+i.top),e.style.maxHeight=Math.min(270,t)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file +function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,h=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var n;return t.isArray(e)&&(n={},t.each(e,function(e,i){t.isPlainObject(i)?n[i.action]=i:n[i]=!0}),e=n),t.isPlainObject(e)&&(n={},t.each(e,function(e,i){i?n[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):n[e]=!1}),e=n),i?t.extend(!0,{},i,e):e}function i(e,i,n){return i=i||e.type,t(n||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var n="zui.tree",o=0,a=function(e,i){this.name=n,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:''},add:{template:''},edit:{template:''},"delete":{template:''}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},a.prototype.add=function(e,i,n,o,a){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t("
      "),r.append(s),this._initList(s,r))):s=r,s){var h=this;t.isArray(i)||(i=[i]),t.each(i,function(e,i){var n=t("
    • ").data(i).appendTo(s);void 0!==i.id&&n.attr("data-id",i.id);var o=l.itemWrapper?t(l.itemWrapper===!0?'
    • ').append(i(h.add,"add",h.add.templateInList)).appendTo(n)}h.sort&&n.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:h.sort,$list:n,target:t.target,item:s})}},h.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}o&&(o.hasClass("open")||s&&s.open)&&o.addClass("open in")},a.prototype._initItem=function(n,o,a,s){if(void 0===o){var r=n.prev("li");o=r.length?r.data("idx")+1:1}if(a=a||n.closest("ul"),n.attr("data-idx",o).removeClass("tree-single-item"),!n.data("id")){var l=o;a.hasClass("tree")||(l=a.parent("li").data("id")+"-"+l),n.attr("data-id",l)}n.hasClass("active")&&a.parent("li").addClass("has-active-item"),s=s||n.data();var h=e(s.actions,this.actions);if(h){var c=n.find(".tree-actions");c.length||(c=t('
      ').appendTo(this.options.itemWrapper?n.find(".tree-item-wrapper"):n),t.each(h,function(t,e){e&&c.append(i(e,t))}))}var d=n.children("ul");d.length&&this._initList(d,n,o,s)},a.prototype._init=function(){var i=this.options,a=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var s=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=n+"::"+(i.name||"")+"#"+(this.$.attr("id")||o++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===s&&(r?this.isPreserve=!0:this.options.initialState=s="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===s?this.expand():"collapse"===s?this.collapse():"active"===s&&this.expandSelect(".active"),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),n=i.parent("li");a.callEvent("hit",{target:n,item:n.data()}),a.toggle(n),i.is("a")&&e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),"sort"!==i.type){var n=e.closest("li:not(.tree-action-item)");a.callEvent("action",{action:i,target:this,$item:n,item:n.data()})}})},a.prototype.preserve=function(e,i,n){if(this.isPreserve)if(e)i=i||e.data("id"),n=void 0===n&&e.hasClass("open"),n?this.store[i]=n:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var o=this;this.store={},this.$.find("li").each(function(){o.preserve(t(this))})}},a.prototype.expandSelect=function(t){this.show(t,!0)},a.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},a.prototype.show=function(e,i,n){var o=this;e instanceof t||(e=o.$.find("li").filter(e)),e.each(function(){var e=t(this);if(o.expand(e,i,n),e)for(var a=e.parent("ul");a&&a.length&&!a.hasClass("tree");){var s=a.parent("li");s.length?(o.expand(s,i,n),a=s.parent("ul")):a=!1}})},a.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),this.callEvent("collapse",t,this)},a.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},a.prototype.getOptions=function(e){this.options=t.extend({},a.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},a.prototype.toData=function(e,i){t.isFunction(e)&&(i=e,e=null),e=e||this.$;var n=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),o=e.data();delete o["zui.droppable"];var a=e.children("ul");return a.length&&(o.children=n.toData(a)),t.isFunction(i)?i(o,e):o}).get()},a.prototype.callEvent=function(e,i){var n;return t.isFunction(this.options[e])&&(n=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),n},t.fn.tree=function(e,i){return this.each(function(){var o=t(this),s=o.data(n),r="object"==typeof e&&e;s||o.data(n,s=new a(this,r)),"string"==typeof e&&s[e](i)})},t.fn.tree.Constructor=a,t(function(){t('[data-ride="tree"]').tree()})}(jQuery),function(t){"use strict";var e="zui.colorPicker",i='
      ',n={zh_cn:{errorTip:"不是有效的颜色值"},zh_tw:{errorTip:"不是有效的顏色值"},en:{errorTip:"Not a valid color value"}},o=function(i,n){this.name=e,this.$=t(i),this.getOptions(n),this.init()};o.prototype.init=function(){var e=this,n=e.options,o=e.$,a=o.parent(),s=!1;a.hasClass("colorpicker")?e.$picker=a:(e.$picker=t(n.template||i),s=!0),e.$picker.addClass(n.wrapper).find(".cp-title").toggle(void 0!==n.title).text(n.title),e.$menu=e.$picker.find(".dropdown-menu").toggleClass("pull-right",n.pullMenuRight),e.$btn=e.$picker.find(".btn.dropdown-toggle"),e.$btn.find(".ic").addClass("icon-"+n.icon),n.btnTip&&e.$picker.attr("data-toggle","tooltip").tooltip({title:n.btnTip,placement:n.tooltip,container:"body"}),o.attr("data-provide",null),s&&o.after(e.$picker),e.colors={},t.each(n.colors,function(i,n){if(t.zui.Color.isColor(n)){var o=new t.zui.Color(n);e.colors[o.toCssStr()]=o}}),e.updateColors(),e.$picker.on("click",".cp-tile",function(){e.setValue(t(this).data("color"))});var r=function(){var i=o.val(),a=t.zui.Color.isColor(i);o.parent().toggleClass("has-error",!(a||n.optional&&""===i)),a?e.setValue(i,!0):n.optional&&""===i?o.tooltip("hide"):o.is(":focus")||o.tooltip("show",n.errorTip)};o.is("input:not([type=hidden])")?(n.tooltip&&o.attr("data-toggle","tooltip").tooltip({trigger:"manual",placement:n.tooltip,tipClass:"tooltip-danger",container:"body"}),o.on("keyup paste input change",r)):o.appendTo(e.$picker),r()},o.prototype.addColor=function(e){e instanceof t.zui.Color||(e=new t.zui.Color(e));var i=e.toCssStr(),n=this.options;this.colors[i]||(this.colors[i]=e);var o=t('
      ',{titile:e}).data("color",e).css({color:e.contrast().toCssStr(),background:i,"border-color":e.luma()>.43?"#ccc":"transparent"}).attr("data-color",i);this.$menu.append(t("
    • ").css({width:n.tileSize,height:n.tileSize}).append(o)),n.optional&&this.$menu.find(".cp-tile.empty").parent().detach().appendTo(this.$menu)},o.prototype.updateColors=function(e){var i=this.$menu,n=this.options,e=e||this.colors,o=this,a=0;if(i.children("li:not(.heading)").remove(),t.each(e,function(t,e){o.addColor(e),a++}),n.optional){var s=t('
    • ').css({width:n.tileSize,height:n.tileSize});this.$menu.append(s),a++}i.css("width",Math.min(a,n.lineCount)*n.tileSize+6)},o.prototype.setValue=function(e,i){var n=this,o=n.options,a=n.$btn,s="";n.$menu.find(".cp-tile.active").removeClass("active");var r=o.updateBtn;if("auto"===r){var l=a.find(".color-bar");r=!l.length||function(t){l.css("background",t||"")}}if(e){var h=new t.zui.Color(e);s=h.toCssStr().toLowerCase(),r&&(t.isFunction(r)?r(s,a,n):a.css({background:s,color:h.contrast().toCssStr(),borderColor:h.luma()>.43?"#ccc":s})),n.colors[s]||n.addColor(h),i||n.$.val().toLowerCase()===s||n.$.val(s).trigger("change"),n.$menu.find('.cp-tile[data-color="'+s+'"]').addClass("active"),n.$.tooltip("hide"),n.$.trigger("colorchange",h)}else r&&(t.isFunction(r)?r(null,a,n):a.attr("style",null)),i||""===n.$.val()||n.$.val(s).trigger("change"),o.optional&&n.$.tooltip("hide"),n.$menu.find(".cp-tile.empty").addClass("active"),n.$.trigger("colorchange",null);o.updateBorder&&t(o.updateBorder).css("border-color",s),o.updateBackground&&t(o.updateBackground).css("background-color",s),o.updateColor&&t(o.updateColor).css("color",s),o.updateText&&t(o.updateText).text(s)},o.prototype.getOptions=function(i){var a=t.extend({},o.DEFAULTS,this.$.data(),i);"string"==typeof a.colors&&(a.colors=a.colors.split(","));var s=a.lang||t.zui.clientLang(),r=this.lang=t.zui.getLangData?t.zui.getLangData(e,s,n):n[s]||n.en;a.errorTip||(a.errorTip=r.errorTip),t.fn.tooltip||(a.btnTip=!1),this.options=a},o.DEFAULTS={colors:["#00BCD4","#388E3C","#3280fc","#3F51B5","#9C27B0","#795548","#F57C00","#F44336","#E91E63"],pullMenuRight:!0,wrapper:"btn-wrapper",tileSize:30,lineCount:5,optional:!0,tooltip:"top",icon:"caret-down",updateBtn:"auto"},o.LANG=n,t.fn.colorPicker=function(e){return this.each(function(){var i=t(this),n=i.data(name),a="object"==typeof e&&e;n||i.data(name,n=new o(this,a)),"string"==typeof e&&n[e]()})},t.fn.colorPicker.Constructor=o,t(function(){t('[data-provide="colorpicker"]').colorPicker()})}(jQuery),function(t,e){function i(t){return t===e&&(t=o+=1),a[t%a.length]}function n(e,i){var n=t(e);i=t.extend({percent:0,size:20,backColor:"#eee",color:"#00da88",borderColor:"#ccc",borderSize:1,rotate:-90},n.data(),i);var o=i.percent,a=i.size;"string"==typeof o&&(o=Number.parseFloat(o,10)),"string"==typeof a&&(a=Number.parseFloat(a,10)),a=Math.floor(a);var s=a/2,r=3.14*s,l="http://www.w3.org/2000/svg",h=document.createElementNS(l,"svg"),c=document.createElementNS(l,"circle"),d=document.createElementNS(l,"circle");d.setAttribute("r",s),d.setAttribute("cx",s),d.setAttribute("cy",s),d.setAttribute("fill",i.backColor),d.setAttribute("stroke",i.borderColor),d.setAttribute("stroke-width",i.borderSize),c.setAttribute("r",s/2),c.setAttribute("cx",s),c.setAttribute("cy",s),c.setAttribute("fill","transparent"),c.setAttribute("stroke-dasharray",(o*r/100).toFixed(1)+" "+r),c.setAttribute("stroke-width",s),c.setAttribute("stroke",i.color),c.setAttribute("transform","rotate(-90) translate(-"+a+")"),h.setAttribute("viewBox","0 0 "+a+" "+a),h.setAttribute("width",a),h.setAttribute("height",a),h.setAttribute("transform","rotate(180)"),h.appendChild(d),h.appendChild(c),n[0].appendChild(h);var u={width:a,height:a};"inline"===n.css("display")&&(u.display="inline-block",u.verticalAlign="middle"),n.css(u)}var o=0,a=["#00a9fc","#ff5d5d","#fdc137","#00da88","#7ec5ff","#8666b8","#bd7b46","#ff9100","#ff3d00","#f57f17","#00e5ff","#00b0ff","#2979ff","#3d5afe","#651fff","#d500f9","#f50057","#ff1744"];jQuery.fn.tableChart=function(){t(this).each(function(){var e=t(this),n=e.data(),o=n.chart||"pie",a=t(n.target);if(a.length){var s=null;if("pie"===o){n=t.extend({scaleShowLabels:!0,scaleLabel:"<%=label%>: <%=value%>"},n);var r=[],l=e.find("tbody > tr").each(function(e){var n=t(this),o=i();n.attr("data-id",e).find(".chart-color-dot").css("background",o),r.push({label:n.find(".chart-label").text(),value:parseFloat(n.data("value")||n.find(".chart-value").text()),color:o,id:e})});r.length>1?n.scaleLabelPlacement="outside":1===r.length&&(n.scaleLabelPlacement="inside",r.push({label:"",value:r[0].value/2e3,color:"#fff",showLabel:!1})),s=a.pieChart(r,n),a.on("mousemove",function(t){var e=s.getSegmentsAtEvent(t);l.removeClass("active"),e.length&&l.filter('[data-id="'+e[0].id+'"]').addClass("active")})}else if("bar"===o){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(i.data("value")||parseFloat(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(n.barValueSpacing=5),s=a.barChart(r,n)}else if("line"===o){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(parseInt(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(n.barValueSpacing=5),s=a.lineChart(r,n)}null!==s&&e.data("zui.chart",s)}})},t(".table-chart").tableChart();var s=function(i,n){var o=t(i);if(!o.data("pieChart")){var a=o.is("canvas")?o:o.find("canvas"),s=t.extend({value:0,color:t.getThemeColor("primary")||"#006af1",backColor:t.getThemeColor("pale")||"#E9F2FB",doughnut:!0,doughnutSize:85,width:20,height:20,showTip:!1,name:"",tipTemplate:"<%=value%>%",animation:"auto",realValue:parseFloat(o.find(".progress-value").text())},n,o.data()),r=a.length;r||(a=t("").appendTo(o)),a.attr("width")!==e?s.width=a.attr("width"):a.attr("width",s.width),a.attr("height")!==e?s.height=a.attr("height"):a.attr("height",s.height),r||8!=t.zui.browser.ie||G_vmlCanvasManager.initElement(a[0]),"auto"===s.animation&&(s.animation=s.width>30),s.value=Math.max(0,Math.min(100,s.value)),o.addClass("progress-pie-"+s.width);var l=[{value:s.value,label:s.name,color:s.color,circleBeginEnd:!0},{value:100-s.value,label:"",color:s.backColor}],h=a[s.doughnut?"doughnutChart":"pieChart"](l,t.extend({segmentShowStroke:!1,animation:s.animation,showTooltips:s.showTip,tooltipTemplate:s.tipTemplate,percentageInnerCutout:s.doughnutSize,reverseDrawOrder:!0,animationEasing:"easeInOutQuart",onAnimationProgress:s.realValue?function(t){o.find(".progress-value").text(Math.floor(s.realValue*t))}:e,onAnimationComplete:s.realValue?function(t){o.find(".progress-value").text(s.realValue)}:e},s.chartOptions));o.data("pieChart",h)}};jQuery.fn.progressPie=function(e){t(this).each(function(){var i=t(this);if(!i.closest(".hidden").length){var n=i.closest(".tab-pane");n.length&&!n.hasClass("active")?t('[data-toggle="tab"][data-target="#'+n.attr("id")+'"]').one("shown.zui.tab",function(){s(i,e)}):s(this,e)}})},jQuery.fn.pieIcon=function(e){t(this).each(function(){n(this,e)})},t(function(){t(".table-chart").tableChart();var e=t(".progress-pie");e.length>100?setTimeout(function(){e.progressPie()},1e3):e.progressPie(),t(".pie-icon").pieIcon()})}(jQuery,void 0),function(t){jQuery.fn.sparkline=function(e){t(this).each(function(){var i=t(this),n=t.extend({values:i.attr("values"),width:i.width()-4,height:i.height()-4},i.data(),e),o=n.height,a=[],s=n.width,r=n.values.split(","),l=0;for(var h in r){var c=parseFloat(r[h]);NaN!=c&&(a.push(c),l=Math.max(c,l))}var d=(Math.min(l,30),Math.min(s,Math.max(10,a.length*s/30))),u=i.children("canvas");u.length||(i.append(''),u=i.children("canvas")),u.attr("width",d).attr("height",o);var p={labels:a,datasets:[{fillColor:t.getThemeColor("pale")||"rgba(0,0,255,0.05)",strokeColor:t.getThemeColor("primary")||"#0054EC",pointColor:t.getThemeColor("secondary")||"rgba(255,136,0,1)",pointStrokeColor:"#fff",data:a}]},f={animation:!0,scaleOverride:!0,scaleStepWidth:Math.ceil(l/10),scaleSteps:10,scaleStartValue:0,showScale:!1,showTooltips:!1,pointDot:!1,scaleShowGridLines:!1,datasetStrokeWidth:1},g=t(u).lineChart(p,f);i.data("sparklineChart",g)})},t(function(){t(".sparkline").sparkline()})}(jQuery),function(t){t.fn.fixedDate=function(){return t(this).each(function(){var e=t(this).attr("autocomplete","off");"0000-00-00"==e.val()&&e.focus(function(){"0000-00-00"==e.val()&&e.val("").datetimepicker("update")}).blur(function(){""==e.val()&&e.val("0000-00-00")})})},window.datepickerOptions={language:t("html").attr("lang"),weekStart:1,todayBtn:1,autoclose:1,todayHighlight:1,startView:2,forceParse:0,showMeridian:1,format:"yyyy-mm-dd hh:ii",startDate:"1970-1-1"},t.extend(t.fn.datetimepicker.defaults,window.datepickerOptions),t(function(){var e={minView:2,format:"yyyy-mm-dd"},i={eleClass:"only-pick-time",startView:1,minView:0,maxView:1,format:"hh:ii"},n={minView:3,startView:3,format:"yyyy-mm"};t(".datepicker-wrapper").click(function(){t(this).find(".form-date, .form-datetime, .form-time, .form-month").datetimepicker("show").focus()}),t.fn.datepicker=function(i){return this.datetimepicker(t.extend({},e,i))},t.fn.timepicker=function(e){return this.datetimepicker(t.extend({},i,e))},t.fn.monthpicker=function(e){return this.datetimepicker(t.extend({},n,e))},t.fn.datepickerAll=function(){return this.find(".form-datetime").fixedDate().datetimepicker(),this.find(".form-date").fixedDate().datepicker(),this.find(".form-time").fixedDate().timepicker(),this.find(".form-month").fixedDate().monthpicker(),this},t("body").datepickerAll()})}(jQuery),function(t){var e=function(e,i){i=t.extend({idStart:0,idEnd:9,chosen:!0,datetimepicker:!0,colorPicker:!0,hotkeys:!0},i,e.data());var n=e.find(".template");!n.length&&i.template&&(n=t(i.template));var o=0,a=0,s=function(t){t.is("select.chosen")?t.next(".chosen-container").find("input").focus():t.focus()},r=function(t){var i=e.find("[data-ctrl-index]:focus,.chosen-container-active").first();if(i.length){if(i.is(".chosen-container-active")){if(i.hasClass("chosen-with-drop")&&("down"===t||"up"===t))return;i=i.prev("select.chosen")}var n=i.data("ctrlIndex"),r=i.closest("tr").data("row");"down"===t?r0?r-=1:r=a-1:"left"===t?n>0?n-=1:n=o-1:"right"===t&&(n").html(s);return r.attr("data-row",e).addClass(n.attr("class")).removeClass("template"),i.rowCreator&&i.rowCreator(r,e,i),o?o.after(r):h.append(r),c(r),r};t.extend(l,{createRow:u,template:d});for(var p=i.idStart;p<=i.idEnd;++p)u(p)}else c(e);e.on("click",".btn-copy",function(){var e=t(this),i=t(e.data("copyFrom")).val(),n=t(e.data("copyTo")).val(i).addClass("highlight");setTimeout(function(){n.removeClass("highlight")},2e3)}),i.hotkeys&&t(document).on("keydown",function(t){var e={"Ctrl+#37":"left","Ctrl+#39":"right","#38":"up","#40":"down","Ctrl+#38":"up","Ctrl+#40":"down"},i=[];t.ctrlKey&&i.push("Ctrl"),i.push("#"+t.keyCode);var n=e[i.join("+")];n&&(r(n),t.ctrlKey&&(t.stopPropagation(),t.preventDefault()))}),e.data("zui.batchActionForm",l),setTimeout(t.fixTableResponsive,0)};t.fn.batchActionForm=function(i){return this.each(function(){e(t(this),i)})}}(jQuery),function(t,e){"use strict";var i="zui.table",n={zh_cn:{selectedItems:"已选择 {0} 项",attrTotal:"{0}总计 {1}"},zh_tw:{selectedItems:"已选择 {0} 项",attrTotal:"{0}总计 {1}"},en:{selectedItems:"Seleted {0} items",attrTotal:"{0} total {1}"},de:{selectedItems:"{0} ausgewählt",attrTotal:"{0} insgesamt {1}"},fr:{selectedItems:"{0} sélectionnés",attrTotal:"{0} total {1}"}},o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),a=t.zui.browser.isIE(),s=a?200:100,r=function(e,o){var a=this;a.name=i;var s=a.$=t(e);o=a.options=t.extend({},r.DEFAULTS,this.$.data(),o),a.langName=o.lang||t.zui.clientLang(),a.lang=t.zui.getLangData(i,a.langName,n),a.id=s.attr("id"),a.id||(a.id=o.id||"table-"+t.zui.uuid(),a.noID=!0,s.attr("id",a.id),o.hot&&console.warn("ZUI: table hot replace id not defined, the element id attribute should be set.")),s.attr("data-ride")||s.attr("data-ride","table");var l=a.getTable();if(l.length){l.find("thead>tr>th").each(function(){var e=t(this);if(!e.attr("title")){var i=t.trim(e.find("a:first").text()||e.text()||"");i.length&&e.attr("title",i)}}),o.nested&&a.initNestedList(),o.checkable&&(s.on("click",".check-all",function(){a.checkAll(!t(this).hasClass("checked"))}),o.checkOnClickRow&&s.on("click","tbody>tr",function(e){t(e.target).closest('.btn,a,.not-check,.form-control,input[type="text"],.chosen-container').length||a.checkRow(t(this))}),s.on("click",'tbody input[type="checkbox"],tbody label[for]',function(e){e.stopPropagation();var i=t(this);i.is("label")&&(i=i.closest(".checkbox-primary").find('input[type="checkbox"]')),a.checkRow(i.closest("tr"),i.is(":checked"))}),o.selectable&&s.selectable(t.extend({},{selector:a.isDataTable?".fixed-left tbody>tr":"tbody>tr",selectClass:"",trigger:".c-id",clickBehavior:"multi",listenClick:!1,start:function(){this.syncSelectionsFromClass()},select:function(e){a.checkRow(e.target,!0),t.cookie("ajax_dragSelected")||(t.cookie("ajax_dragSelected","on",{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("dragSelected"))},unselect:function(t){a.checkRow(t.target,!1)},rangeStyle:{border:"1px solid #006af1",backgroundColor:"rgba(50,128,252,0.2)",borderRadius:"2px"}},t.isPlainObject(o.selectable)?o.selectable:null)));var h=a.$form=s.is("form")?s:s.find("form");h.length&&(o.ajaxForm?h.ajaxForm(t.isPlainObject(o.ajaxForm)?o.ajaxForm:null):h.on("click","[data-form-action]",function(){h.attr("action",t(this).data("formAction")).submit()})),(o.fixFooter||o.fixHeader)&&(a.pageFooterHeight=t("#footer").outerHeight(),a.updateFixUI(!0),t(window).on("scroll resize",function(){a.updateFixUI()}).on("sidebar.toggle",function(){setTimeout(function(){a.updateFixUI()},200)})),o.group&&(s.on("click",".group-toggle",function(){a.toggleRowGroup(t(this).closest("tr").data("id"))}),t(document).on("click",".group-collapse-all",function(){a.toggleGroups(!1)}).on("click",".group-expand-all",function(){a.toggleGroups(!0)})),a.defaultStatistic=s.find(".table-statistic").html(),a.updateStatistic(),a.initModals(),a.checkItems={},a.updateCheckUI()}};r.prototype.initNestedList=function(){var e=this,i=e.getTable().addClass("table-nested"),n=i.find("tbody"),o=n.children("tr[data-id]"),a={},s=[];o.each(function(e){var i=t(this),n=i.data();n.realOrder=e,n.$row=i,n.nestPath?(n.nestPathList=n.nestPath.split(","),n.nestPathList[0]||n.nestPathList.shift(),n.nestPathList[n.nestPathList.length-1]||n.nestPathList.pop(),n.nestPathLevel=n.nestPathList.length,i.attr("data-level",n.nestPathLevel)):(n.nestPath=","+n.id+",",n.nestPathList=[n.id],n.nestPathLevel=1),a[n.id]=n,s.push(n)});var r=[];t.each(s,function(t,i){return i.nestParent&&(i.parent=a[i.nestParent],i.parent)?(i.parent.children?i.parent.children.push(i):i.parent.children=[i],void(e.options.expandNestChild||e._initedNestedList||(i.$row.addClass("table-nest-hide"),i.parent.$row.addClass("table-nest-child-hide")))):(i.$row.removeClass("table-nest-hide"),void r.push(i))});var l=e.options.preserveNested;e.nestRowsMap=a,e.nestConfigStoreName="/"+window.config.currentModule+"/"+window.config.currentMethod+"/table."+e.id+".nestConfig",e.nestConfig=l?t.zui.store.get(e.nestConfigStoreName,{}):{};var h=function(i){for(var o=0;o').prependTo(s)),r.toggleClass("table-nest-toggle",!!a.children).css("marginLeft",(a.nestPathLevel-1)*e.options.nestLevelIndent),l){var c=a.parent?e.nestConfig[a.parent.id]:null,d=e.nestConfig[a.id];c?a.$row.toggleClass("table-nest-hide",!d||!c):a.$row.toggleClass("table-nest-child-hide",!d)}delete a.$row}};h(r),e.$nestBody=n,e._initedNestedList||(n.on("click",".table-nest-toggle",function(){e.toggleNestedRows(t(this).closest("tr").data("id"))}),n.on("mouseenter","tr.has-nest-child",function(){n.find(".table-nest-hover").removeClass("table-nest-hover"),n.find(".table-nest-child-hover").removeClass("table-nest-child-hover");var e=t(this).addClass("table-nest-hover"),i=e.closest("tr").data("id");n.find('[data-nest-path*=",'+i+',"]').addClass("table-nest-child-hover")}).on("mouseleave","tr.table-nest-hover",function(){n.find(".table-nest-hover").removeClass("table-nest-hover"),n.find(".table-nest-child-hover").removeClass("table-nest-child-hover")}),e._initedNestedList=!0)},r.prototype.toggleNestedRows=function(i,n,o,a){var s=this,r=s.nestRowsMap[i],l=s.$nestBody.find('[data-id="'+i+'"]'),h=l.hasClass("table-nest-child-hide");n===e&&(n=h),a===e?(l.toggleClass("table-nest-child-hide",!n),a=n):(l.toggleClass("table-nest-hide",!n||!a),a=!h),s.options.preserveNested&&(n?s.nestConfig[i]=!0:s.nestConfig[i]&&delete s.nestConfig[i],t.zui.store.set(s.nestConfigStoreName,s.nestConfig));var c=r.children;if(c)for(var d=0;d");i.$.addClass("load-indicator loading"),s.load(window.location.href+" #"+o,function(r){if(a===o)i.$.empty().html(s.children().html()),i.$.find('[data-ride="pager"]').pager();else{i.$.find("#"+o).empty().html(s.children().html());try{var l=t(r),h=l.find("#"+o).closest('[data-ride="table"],#'+a);if(h.length){var c=h.find(".table-statistic");c.length&&(i.defaultStatistic=c.html());var d=i.$.find('[data-ride="pager"]').data("zui.pager"),u=h.find('[data-ride="pager"]');d&&u.length&&d.set(u.data())}}catch(p){console.error(p)}}i.$.removeClass("load-indicator loading").trigger("beforeTableReload"),delete i.defaultStatistic,i.updateStatistic(),i.initModals(),i.$.datepickerAll();var f=i.$.find("tbody>tr"),g=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(f.filter('[data-id="'+t+'"]'),!0,!0),g=!0)}),g&&i.updateCheckUI(),i.$.trigger("tableReload");var m=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");if(m.length){var u=i.$.find(".pager[data-rec-total]"),v=u.length?u.attr("data-rec-total"):i.getTable().find("tbody:first>tr:not(.table-children)").length;m.text(v)}e&&e(),n.afterReload&&n.afterReload()})},r.prototype.initModals=function(){var e=this,i=e.options,n=e.$.find(i.iframeModalTrigger);if(n.length){var o={type:"iframe",onHide:i.replaceId?function(){var n=t.cookie("selfClose");(1==n||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};n.modalTrigger(o)}},r.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e=t.find("div.datatable")),e},r.prototype.toggleGroups=function(e){var i=this,n={};i.$.find("tbody>tr").each(function(){var o=t(this).closest("tr").data("id");n[o]||i.toggleRowGroup(o,e)})},r.prototype.toggleRowGroup=function(i,n){var o=this.$.find('tbody>tr[data-id="'+i+'"]'),a=o.filter(".group-summary"),s=n===e?!a.hasClass("hidden"):!!n;o.not(".group-summary").toggleClass("hidden",!s),a.toggleClass("hidden",s),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},r.prototype.updateStatistic=function(){var i=this,n=i.$.find(".table-statistic");if(n.length){if(i.defaultStatistic===e&&(i.defaultStatistic=n.html()),i.options.statisticCreator)return void n.html(i.options.statisticCreator(i)||i.defaultStatistic);var o=i.statisticCols;if(!o&&o!==!1){o={};var a=!1;i.getTable().find("thead th").each(function(e){var i=t(this),n=i.data("statistic");n&&(a=!0,o[e]={format:n,name:i.text()})}),i.statisticCols=!!a&&o}var s=0;o&&t.each(o,function(t){o[t].total=0,o[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var e=t(this),i=e.hasClass("checked"),n=e.children("td");i&&s++,o&&t.each(o,function(t){var e=parseFloat(n.eq(t).text());isNaN(e)&&(e=0),o[t].total+=e,i&&(o[t].checkedTotal+=e)})});var r=[];if(s)r.push(i.lang.selectedItems.format(s));else if(i.defaultStatistic)return void n.html(i.defaultStatistic); +o&&t.each(o,function(t){var e=o[t],n=e[s?"checkedTotal":"total"];e.format&&(n=e.format.format(n)),r.push(i.lang.attrTotal.format(e.name,n))}),n.html(r.join(", "))}},r.prototype.updateFixUI=function(e){var i=this,n=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||n-i.lastUpdateTime').append(t('
      ').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),c){var d=h[0].getBoundingClientRect();l.css({left:d.left,width:h.width()}),l.find(".fixed-header-copy").css({left:o.left-d.left,position:"relative",minWidth:i.width()}),a||h.data("fixHeaderScroll")||(h.data("fixHeaderScroll",1),i.width()>h.width()&&h.on("scroll",function(){e.fixHeader()}))}else l.css({left:o.left,width:o.width});var u=l.find("th");n.find("th").each(function(e){u.eq(e).css("width",t(this).outerWidth())})}else l.remove()},r.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var a=n.find("tbody");if(!a.length)return;e=a[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r=t.isFunction(s)?s(e,o):e.bottom>window.innerHeight-50-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r);var l=t("body"),h=l.hasClass("body-modal");if(r){var c=n.parent(),d=c.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:d?c[0].getBoundingClientRect().left:e.left,width:d?c.width():e.width}),h&&l.css("padding-bottom",40)}else o.css({width:"",left:0,bottom:0}),h&&l.css("padding-bottom",0)},r.prototype.checkAll=function(e){var i=this,n=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},r.prototype.checkRow=function(t,i,n){var o=this;o.isDataTable&&!t.is(".datatable-row-left")&&(t=o.getTable().find('.datatable-row-left[data-index="'+t.data("index")+'"]'));var a=t.find('input[type="checkbox"]');a.length&&!a.is(":disabled")&&(i===e&&(i=!a.is(":checked")),o.isDataTable?o.getTable().find('.datatable-row[data-index="'+t.data("index")+'"]').toggleClass("checked",i):t.toggleClass("checked",i),this.checkItems[t.data("id")]=i,a.prop("checked",i).trigger("change"),n||o.updateCheckUI())},r.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").not(".group-summary"),o=!1,a=null,s=0,r=!1,l=n.length;n.each(function(n){var h=t(this),c=h.find('input[type="checkbox"]');r=c.is(":checked");var d=e.isDataTable?i.find('.datatable-row[data-index="'+h.data("index")+'"]'):h;d.toggleClass("checked",r),d.toggleClass("row-check-begin",r&&!o),a&&a.toggleClass("row-check-end",!r&&o),r&&(s+=1),a=d,o=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange()},r.DEFAULTS={checkable:!0,checkOnClickRow:!0,ajaxForm:!1,selectable:!0,fixHeader:!a,fixFooter:!a,iframeWidth:900,replaceId:"self",nestLevelIndent:18,nested:!1,preserveNested:!0,hot:!1,iframeModalTrigger:".iframe"},t.fn.table=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new r(this,a)),"string"==typeof e&&o[e]()})},r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){"string"==typeof i&&(n=i,i=null),n=n||"show",t.zui.messager?t.zui.messager[n](e,i):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});t.isFunction(r)&&(r={complete:r}),r=t.extend({},n,l.data(),r);var h=r.beforeSubmit,c=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if(l.enableForm(!1),(h&&h(n,a,s))!==!1){var r={},c=a.find('[type="file"]');r.fileapi=c.length&&c[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=a.attr("enctype")==p||a.attr("encoding")==p,g=r.fileapi&&r.formdata,m=u&&!g||f&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")}},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var h=r.responser?t(r.responser):l.find(".form-responser");h.length||(h=t("#responser"));var c=i.message,p=function(){var n=i.callback;if(n){var o=n.indexOf("("),a=(o>0?n.substr(0,o):n).split("."),s=e,r=a[0];a.length>1&&(r=a[1],"top"===a[0]?s=e.top:"parent"===a[0]&&(s=e.parent));var h=s[r];if(t.isFunction(h)){var c=[];return o>0&&")"==n[n.length-1]&&(c=t.parseJSON("["+n.substring(o+1,n.length-1)+"]")),c.push(i),h.apply(l,c)}}};if("success"===i.result){var f=r.locate||i.locate;if(l.enableForm(!0,!!f),c){var g=l.find('[type="submit"]').first(),m=!1;g.length&&(g.popover({container:"body",trigger:"manual",content:c,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){g.popover("destroy")},r.popoverTime||2e3),m=!0),h.length&&(h.html(''+c+"").show().delay(3e3).fadeOut(100),m=!0),m||a(c,"success")}if(u)return u(i,!0,l);if((r.closeModal||i.closeModal)&&setTimeout(t.zui.closeModal,r.closeModalTime||2e3),p()===!1)return;if(f)if("loadInModal"==f){var v=t(".modal");setTimeout(function(){v.load(v.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else if("parent"===f||"top"===f)e[f]&&setTimeout(function(){e[f].location.reload()},1200);else{var y="reload"==f?e.location.href:f;setTimeout(function(){e.location.href=y},1200)}var b=r.ajaxReload||i.ajaxReload;if(b){var w=t(b);w.length&&w.load(e.location.href+" "+b,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof c)h.length?h.html(''+c+"").show().delay(3e3).fadeOut(100):a(c,"danger");else if("object"==typeof c){var x=!1,C=[];t.each(c,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
      ').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var h=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",h);var c=t("#"+e+"_chosen");if(c.length&&c.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){h()===!0&&t(this).removeClass("has-error")}),!x){if(o.hasClass("chosen"))o.trigger("chosen:activate");else if(o.is("textarea")&&o.data("keditor")){var d=o.data("keditor");d.focus(),d.edit.doc.body.focus()}else o.focus();x=!0}}),C.length&&a(C.join(";"),"danger")}if(u)return u(i,!1,l);if(p()===!1)return}}},error:function(t,i,n){if((c&&c(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{onFinish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t("#hiddenwin"),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
      ').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
      '+(n.errorText||window.lang&&window.lang.timeout)+"
      "),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=t.trim(e).split(" ");a.each(function(){var e=t(this),n=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active"))},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
      ')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=""===o.value||"0"===o.value,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s&&!o.label?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(h.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(t,e,n,o,a,s){if(o||(o=config.defaultView),a||(a=!1),n)for(n=n.split("&"),i=0;i0?"&":"?")+"pgm="+s),l},t(function(){var e=t("#main,#mainContent,#mainRow,.auto-fade-in");e.length&&e.hasClass("fade")&&setTimeout(function(){e.addClass("in")},e.data("fadeTime")||200)}),t.ajaxSendScore=function(e){t.get(t.createLink("score","ajax","method="+e))};var e=function(t){var e=0;if(t){var i=t.split(":");e+=60*parseInt(i[0]),e+=parseInt(i[1])}return e},n=function(t){t%=1440;var e=Math.floor(t/60),i=t%60;return e<10&&(e="0"+e),i<10&&(i="0"+i),e+":"+i},o=function(t){if("string"==typeof t&&(t=e(t)),"number"==typeof t)if(t<1e5){var i=new Date;i.setHours(Math.floor(t/60)%24),i.setMinutes(t%60),t=i}else t=new Date(t);return t},a=function(t,i){for(var a=i?o(i):new Date,s=a.getHours(),r=10*Math.floor(a.getMinutes()/10)+10,l=0;l<24;++l){var h=(l+s)%24;if(!(h<5))for(var c=0;c<6;++c){var d=n(60*h+10*c+r);t.append('")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),h=s.find('[name="end"],.control-time-end'),c=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);h.find('option[value="'+i+'"]').length&&h.val(i),r.onChange&&r.onChange(h,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");h.find('option[value="'+u+'"]').length&&h.val(u),r.onChange&&r.onChange(h,u)}}else l.on("change",c),a(l,r.begin),a(h,r.end),s.data("timeSpanControlInit",!0);r.end||c()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,""))window.location.href=t.createLink(e,"testsuite"===e?"library":"view","id="+i);else{var n={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||n[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(){location.href=removeAnchor(location.href)},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage()},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage()},t.zui.Picker&&t.zui.Picker.enableChosen(),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+a{page}/{totalPage}',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,h=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(h,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var c=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;h="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(h,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,c=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:40}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()});var d=function(){var e,i,n=t(this),o=t.extend({limitSize:40,suffix:"…"},n.data()),a=n.text();if(a.length>o.limitSize){e=a,i=a.substr(0,o.limitSize)+o.suffix,n.text(i).addClass("limit-text-on");var s=o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle");s.text(s.data("textExpand")),s.on("click",function(){var t=n.toggleClass("limit-text-on").hasClass("limit-text-on");n.text(t?i:e),s.text(s.data(t?"textExpand":"textCollapse"))})}else(o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle")).hide()};t.fn.textLimit=function(){return this.each(d)},t(function(){t(".text-limit").textLimit()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
      ").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var u,p,f,g,m,v=function(){u||(u=t("#subNavbar"),p=t("#pageNav"),f=t("#pageActions"),g=u.children(".nav"),m=g.outerWidth());var e=u.outerWidth(),i=p.outerWidth()||0,n=f.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void g.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,m),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),T()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])});var S=function(){var e,i="en"==config.clientLang?"//www.zentao.pm/book/zentaomanual/8.html?fullScreen=zentao":"ja"==config.clientLang?"//www.zentao.jp/book/zentaomanual/8.html?fullScreen=zentao":"//www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao",n=t("#navbar > .nav").first(),o=1e4,a=function(){clearTimeout(e),t("#helpContent").removeClass("show-error")},s=t.openHelp=function(s){s=s||i,a(),n.children("li.active:not(#helpMenuItem)").removeClass("active").addClass("close-help-tab"),t("#helpMenuItem").addClass("active");var r=t("#helpContent");if(r.length){if(t("body").hasClass("show-help-tab"))return void t("#helpIframe").get(0).contentWindow.location.replace(s)}else{r=t('

      '+lang.timeout+'

      '+s+'

      '),t("#header").after(r);var l=t("#helpIframe").get(0);e=setTimeout(function(){t("#helpContent").addClass("show-error")},o),l.onload=l.onreadystatechange=function(){this.readyState&&"complete"!=this.readyState||a()}}t("body").addClass("show-help-tab")},r=t.closeHelp=function(){t("body").removeClass("show-help-tab"),t("#helpMenuItem").removeClass("active"),n.find("li.close-help-tab").removeClass("close-help-tab").addClass("active").find("a").focus()};t(document).on("click",".open-help-tab",function(e){var i=t(this),o=t("#helpMenuItem");o.length||(o=t('
    • '+i.text()+'
    • '),n.append('
    • ').append(o)),s(i.attr("href")),e.preventDefault()}).on("click",".close-help-tab",function(t){r(),t.stopPropagation(),t.preventDefault()})};t(S),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var D=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(D)},t(function(){t("textarea.autosize").each(D),t(document).on("input paste change","textarea.autosize",D)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var M="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=M,t("html").toggleClass("is-firefox",M).toggleClass("not-firefox",!M),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
      ').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){const r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var t=270,i=e.getBoundingClientRect();i.top<0&&(t=Math.min(270,i.height)+i.top),e.style.maxHeight=Math.min(270,t)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file From 18db4d974088579de3fb3e49caf00c8431524484 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 3 Nov 2020 13:55:06 +0800 Subject: [PATCH 010/187] * Finish task #8229. --- module/my/view/story.html.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 64494635b8..ad321eea56 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -92,6 +92,40 @@ ?> + children)):?> + children as $child):?> + createLink('story', 'view', "id=$child->id");?> + + + +
      + + +
      + + id);?> + + pri;?>' title='story->priList, $child->pri, $child->pri);?>'>story->priList, $child->pri, $child->pri);?> + productTitle;?> + title, null, "style='color: $child->color'");?> + planTitle;?> + openedBy);?> + estimate;?> + processStatus('story', $child);?> + story->stageList, $child->stage);?> + + id}"; + common::printIcon('story', 'change', $vars, $child, 'list', 'fork'); + common::printIcon('story', 'review', $vars, $child, 'list', 'glasses'); + common::printIcon('story', 'close', $vars, $child, 'list', '', '', 'iframe', true); + common::printIcon('story', 'edit', $vars, $child, 'list'); + if($config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$child->product&branch=$child->branch&module=0&from=¶m=0&$vars", $child, 'list', 'sitemap'); + ?> + + + + From 43089f346beec8cbed419c0a7945d39efccd12dc Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 3 Nov 2020 14:58:17 +0800 Subject: [PATCH 011/187] * Finish task #8235. --- module/testcase/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 901e584c51..ac96c584fb 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -218,7 +218,7 @@ js::set('suiteID', $suiteID); { $searchKey = $withSearch ? ('data-key="' . zget($modulesPinYin, $module, '') . '"') : ''; $actionLink = $this->createLink('testcase', 'batchChangeModule', "moduleID=$moduleId"); - echo html::a('#', $module, '', "$searchKey onclick=\"setFormAction('$actionLink', 'hiddenwin')\""); + echo html::a('#', $module, '', "title=$module $searchKey onclick=\"setFormAction('$actionLink', 'hiddenwin')\""); } ?> From f60cc9d3745fa1a6b857c387caf523ce4beabbbf Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Tue, 3 Nov 2020 15:33:38 +0800 Subject: [PATCH 012/187] * Finish task#8221. --- module/extension/view/safe.html.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/extension/view/safe.html.php b/module/extension/view/safe.html.php index 284d670832..2bdde08739 100644 --- a/module/extension/view/safe.html.php +++ b/module/extension/view/safe.html.php @@ -11,5 +11,8 @@ */ ?> -
      +
      + + extension->refreshPage, 'onclick=location.href=location.href', 'btn btn-primary');?> +
      From 066046658d08bf37892ecd575079c80e8c31d6a5 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Tue, 3 Nov 2020 16:10:02 +0800 Subject: [PATCH 013/187] * Finish task#8240. --- module/task/view/assignto.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/view/assignto.html.php b/module/task/view/assignto.html.php index 4b8783160d..a30a8e5426 100644 --- a/module/task/view/assignto.html.php +++ b/module/task/view/assignto.html.php @@ -37,7 +37,7 @@ team) ? $lang->task->assign : $lang->task->transferTo;?> team) ? $task->assignedTo : $task->nextUser, "class='form-control chosen'");?> - status != 'done' and $task->status != 'closed'):?> + status != 'done' and $task->status != 'closed' and $task->parent >= 0):?> task->left;?>
      left, "class='form-control'");?> task->hour;?>
      From a6e6f7a8a27edb0d4e813c3771cadf3f90656bff Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 3 Nov 2020 16:49:03 +0800 Subject: [PATCH 014/187] * Finish task#8201: Add the assignedTo field for the start task page. --- module/task/control.php | 8 +++++--- module/task/model.php | 1 - module/task/view/start.html.php | 9 ++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index 80bb8e733a..cb18eb20b7 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -702,6 +702,8 @@ class task extends control { $this->commonAction($taskID); + $task = $this->task->getById($taskID); + if(!empty($_POST)) { $this->loadModel('action'); @@ -715,11 +717,9 @@ class task extends control $this->action->logHistory($actionID, $changes); } - /* Remind whether to update status of the bug, if task which from that bug has been finished. */ - $task = $this->task->getById($taskID); - $this->executeHooks($taskID); + /* Remind whether to update status of the bug, if task which from that bug has been finished. */ if($changes and $this->task->needUpdateBugStatus($task)) { foreach($changes as $change) @@ -740,6 +740,8 @@ class task extends control $this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->start; $this->view->position[] = $this->lang->task->start; + + $this->view->members = $this->loadModel('project')->getTeamMemberPairs($task->project, 'nodeleted'); $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->display(); } diff --git a/module/task/model.php b/module/task/model.php index cbdad3791d..1dc1335430 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1261,7 +1261,6 @@ class taskModel extends model $now = helper::now(); $task = fixer::input('post') - ->setDefault('assignedTo', $this->app->user->account) ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) ->setDefault('status', 'doing') diff --git a/module/task/view/start.html.php b/module/task/view/start.html.php index e5113e1237..70fc5c50ce 100644 --- a/module/task/view/start.html.php +++ b/module/task/view/start.html.php @@ -39,11 +39,18 @@
      + + + + + - + + + + + + + + + + + + + + +app->getModuleRoot() . 'common/view/mail.footer.html.php';?> diff --git a/module/message/config.php b/module/message/config.php index ee6124f295..2bb98c694b 100644 --- a/module/message/config.php +++ b/module/message/config.php @@ -9,12 +9,14 @@ $config->message->objectTypes['bug'] = array('opened', 'edited', 'commen $config->message->objectTypes['case'] = array('opened', 'edited', 'commented', 'reviewed', 'confirmed'); $config->message->objectTypes['testtask'] = array('opened', 'edited', 'started', 'blocked', 'closed', 'activated'); $config->message->objectTypes['todo'] = array('opened', 'edited'); +$config->message->objectTypes['doc'] = array('created', 'edited'); $config->message->available = array(); $config->message->available['mail']['story'] = $config->message->objectTypes['story']; $config->message->available['mail']['task'] = $config->message->objectTypes['task']; $config->message->available['mail']['bug'] = $config->message->objectTypes['bug']; $config->message->available['mail']['testtask'] = array('opened', 'edited', 'closed'); +$config->message->available['mail']['doc'] = $config->message->objectTypes['doc']; $config->message->available['webhook'] = $config->message->objectTypes; @@ -23,6 +25,7 @@ $config->message->available['message']['story'] = $config->message->objectTyp $config->message->available['message']['task'] = $config->message->objectTypes['task']; $config->message->available['message']['testtask'] = $config->message->objectTypes['testtask']; $config->message->available['message']['todo'] = $config->message->objectTypes['todo']; +$config->message->available['message']['doc'] = $config->message->objectTypes['doc']; $config->message->typeLink = array(); $config->message->typeLink['mail'] = 'mail|index'; From a13f8cd4c0df9cd0137fe0e31c4f3f65bcce6c04 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 3 Nov 2020 17:26:51 +0800 Subject: [PATCH 016/187] * Adjust the logic of the assigned to. --- module/task/control.php | 9 +++++++-- module/task/view/start.html.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index cb18eb20b7..cb5aa720ac 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -738,11 +738,16 @@ class task extends control die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } + $users = $this->loadModel('user')->getPairs('noletter'); + $members = $this->loadModel('project')->getTeamMemberPairs($task->project, 'nodeleted'); + $assignedTo = in_array(zget($this->app->user->account, $users), $members) === TRUE ? $this->app->user->account : ''; + $this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->start; $this->view->position[] = $this->lang->task->start; - $this->view->members = $this->loadModel('project')->getTeamMemberPairs($task->project, 'nodeleted'); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->users = $users; + $this->view->members = $members; + $this->view->assignedTo = $task->assignedTo == '' ? $assignedTo : $task->assignedTo; $this->display(); } diff --git a/module/task/view/start.html.php b/module/task/view/start.html.php index 70fc5c50ce..8c8520f4a9 100644 --- a/module/task/view/start.html.php +++ b/module/task/view/start.html.php @@ -42,7 +42,7 @@ From fd4876f1d02d1305887223c624677fcfc882a62f Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 3 Nov 2020 17:30:17 +0800 Subject: [PATCH 017/187] * Adjust code style. --- module/doc/control.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 9dbc452a94..43158a3c9a 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -320,8 +320,6 @@ class doc extends control $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->duplicate, $this->lang->doc->common), 'locate' => $this->createLink('doc', 'view', "docID=$docID"))); } - $this->executeHooks($docID); - $fileAction = ''; if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ; $this->action->create('doc', $docID, 'Created', $fileAction); From 7ef58a2d4020b62fe839d094c660ad1190debbf3 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 3 Nov 2020 17:41:31 +0800 Subject: [PATCH 018/187] * Add the title of the doc. --- module/doc/view/index.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/doc/view/index.html.php b/module/doc/view/index.html.php index 5c497bf2cf..6c2c5876c0 100644 --- a/module/doc/view/index.html.php +++ b/module/doc/view/index.html.php @@ -37,7 +37,7 @@ id}");?>"> - + @@ -172,7 +172,7 @@ id}");?>"> - + From 43174e39ec52627b3ba15e6ecae49c6405522f87 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 4 Nov 2020 09:06:41 +0800 Subject: [PATCH 019/187] * Finish task#8200: Add the lib field for search testcase. --- module/testcase/config.php | 2 ++ module/testcase/control.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/module/testcase/config.php b/module/testcase/config.php index 487f67fa13..e100b19c06 100644 --- a/module/testcase/config.php +++ b/module/testcase/config.php @@ -47,6 +47,7 @@ $config->testcase->search['fields']['branch'] = ''; $config->testcase->search['fields']['stage'] = $lang->testcase->stage; $config->testcase->search['fields']['module'] = $lang->testcase->module; $config->testcase->search['fields']['pri'] = $lang->testcase->pri; +$config->testcase->search['fields']['lib'] = $lang->testcase->lib; $config->testcase->search['fields']['lastRunner'] = $lang->testcase->lastRunner; $config->testcase->search['fields']['lastRunResult'] = $lang->testcase->lastRunResult; @@ -66,6 +67,7 @@ $config->testcase->search['params']['status'] = array('operator' => '=', $config->testcase->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->testcase->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->testcase->search['params']['stage'] = array('operator' => 'include', 'control' => 'select', 'values' => $lang->testcase->stageList); +$config->testcase->search['params']['lib'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->testcase->search['params']['lastRunner'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); $config->testcase->search['params']['lastRunResult'] = array('operator' => '=', 'control' => 'select', 'values' => array_diff($lang->testcase->resultList, array('n/a' => $lang->testcase->resultList['n/a']))); diff --git a/module/testcase/control.php b/module/testcase/control.php index 8b7baa26c1..276a653594 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -108,9 +108,12 @@ class testcase extends control /* Build the search form. */ $actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->config->testcase->search['onMenuBar'] = 'yes'; + + $libs = $this->loadModel('caselib')->getLibraries(); + $this->config->testcase->search['params']['lib']['values'] = $libs; $this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL); - $showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : ''; + $showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : ''; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array(); /* Assign. */ @@ -137,6 +140,7 @@ class testcase extends control $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); $this->view->suiteID = $suiteID; $this->view->setModule = true; + $this->view->libs = $libs; $this->display(); } From 0e31686cdcad2e6983085d61409acb49de5ba327 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 4 Nov 2020 09:14:57 +0800 Subject: [PATCH 020/187] * Finish task#8219. --- module/story/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index d06b04fb39..31ee0c403f 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -412,7 +412,7 @@ class story extends control $this->view->type = $type; $this->view->branch = $branch; $this->view->branches = $this->loadModel('branch')->getPairs($productID); - $this->view->needReview = ($this->app->user->account == $product->PO || $this->config->story->needReview == 0) ? 0 : 1; + $this->view->needReview = ($this->app->user->account == $product->PO || $project > 0 || $this->config->story->needReview == 0) ? 0 : 1; $this->display(); } From 47aa8bd9b56608e628cb3199e879728c373309fd Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 4 Nov 2020 09:58:15 +0800 Subject: [PATCH 021/187] * Finish task#8212. --- module/bug/model.php | 3 ++- module/story/control.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 4ec513e36a..31d6731c1f 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1603,11 +1603,12 @@ class bugModel extends model * @access public * @return array */ - public function getStoryBugs($storyID) + public function getStoryBugs($storyID, $projectID = 0) { return $this->dao->select('id, title, pri, type, status, assignedTo, resolvedBy, resolution') ->from(TABLE_BUG) ->where('story')->eq((int)$storyID) + ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->andWhere('deleted')->eq(0) ->fetchAll('id'); } diff --git a/module/story/control.php b/module/story/control.php index 31ee0c403f..705ab7653e 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1219,10 +1219,10 @@ class story extends control * @access public * @return void */ - public function bugs($storyID) + public function bugs($storyID, $projectID = 0) { $this->loadModel('bug'); - $this->view->bugs = $this->bug->getStoryBugs($storyID); + $this->view->bugs = $this->bug->getStoryBugs($storyID, $projectID); $this->view->users = $this->user->getPairs('noletter'); $this->display(); } From 1dd736e9ed03af3239eabab3fde4f001f3c2e6f1 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 4 Nov 2020 10:05:03 +0800 Subject: [PATCH 022/187] * Finish task #8264. --- module/doc/control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/doc/control.php b/module/doc/control.php index 43158a3c9a..1e64aa8f0e 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -445,6 +445,8 @@ class doc extends control { $hyperdown = $this->app->loadClass('hyperdown'); $doc->content = $hyperdown->makeHtml($doc->content); + $doc->content = str_replace(" - + diff --git a/module/task/view/start.html.php b/module/task/view/start.html.php index 70fc5c50ce..a64a46167f 100644 --- a/module/task/view/start.html.php +++ b/module/task/view/start.html.php @@ -48,7 +48,7 @@ - + From d3356b16757480cdb685dc40aaf123fea93be487 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 4 Nov 2020 10:36:36 +0800 Subject: [PATCH 026/187] * Finish task #8228. --- module/extension/control.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/extension/control.php b/module/extension/control.php index 4ca71c2bda..67f038bc94 100644 --- a/module/extension/control.php +++ b/module/extension/control.php @@ -26,6 +26,9 @@ class extension extends control $statusFile = $this->loadModel('common')->checkSafeFile(); if($statusFile) { + $this->view->title = $this->lang->extension->browse; + $this->view->position[] = $this->lang->extension->browse; + $this->view->error = sprintf($this->lang->extension->noticeOkFile, str_replace('\\', '/', $statusFile)); die($this->display('extension', 'safe')); } From f1c5b256bf84f4189d4e78557b4c26d40e3934c1 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 4 Nov 2020 10:42:23 +0800 Subject: [PATCH 027/187] * code for task #8279. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index ac33cf55d5..6cbd8a1d82 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1475,7 +1475,7 @@ class taskModel extends model $task = fixer::input('post') ->setIF(is_numeric($this->post->consumed), 'consumed', (float)$this->post->consumed) - ->setIF($oldTask->realStarted == '0000-00-00', 'realStarted', $today) + ->setIF($oldTask->realStarted == '0000-00-00 00:00:00', 'realStarted', $today) ->setDefault('left', 0) ->setDefault('assignedTo', $oldTask->openedBy) ->setDefault('assignedDate', $now) From b400af6ffcef68eaf08adbb8c039c977f78e0307 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 4 Nov 2020 14:07:15 +0800 Subject: [PATCH 028/187] * Finish task #8262. --- module/bug/model.php | 2 +- module/doc/model.php | 2 +- module/story/model.php | 2 +- module/task/model.php | 2 +- module/testtask/model.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 31d6731c1f..9cb4a4083c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2811,7 +2811,7 @@ class bugModel extends model /* Send it. */ $this->mail->send($toList, $subject, $mailContent, $ccList); - if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + if($this->mail->isError()) error_log(join("\n", $this->mail->getError())); } /** diff --git a/module/doc/model.php b/module/doc/model.php index a928e479f2..243c627180 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1671,7 +1671,7 @@ class docModel extends model /* Send mail. */ $this->mail->send($toList, $subject, $mailContent, $ccList); - if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + if($this->mail->isError()) error_log(join("\n", $this->mail->getError())); } /** diff --git a/module/story/model.php b/module/story/model.php index 0a4613941e..e5c2da472a 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3293,7 +3293,7 @@ class storyModel extends model /* Send it. */ $this->mail->send($toList, $subject, $mailContent, $ccList); - if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + if($this->mail->isError()) error_log(join("\n", $this->mail->getError())); } /** diff --git a/module/task/model.php b/module/task/model.php index 6cbd8a1d82..35b7df4a56 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -3033,7 +3033,7 @@ class taskModel extends model /* Send emails. */ $this->mail->send($toList, $subject, $mailContent, $ccList); - if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + if($this->mail->isError()) error_log(join("\n", $this->mail->getError())); } /** diff --git a/module/testtask/model.php b/module/testtask/model.php index 0955466370..7fda2d6759 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1616,7 +1616,7 @@ class testtaskModel extends model /* Send mail. */ $this->mail->send($toList, $subject, $mailContent, $ccList); - if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + if($this->mail->isError()) error_log(join("\n", $this->mail->getError())); } /** From 7a8e3bec381e82f3976bece456298b404deaba9a Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Wed, 4 Nov 2020 14:30:29 +0800 Subject: [PATCH 029/187] * Finish task#8207. --- module/testtask/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/testtask/model.php b/module/testtask/model.php index 7fda2d6759..e7741b9c3e 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1022,7 +1022,7 @@ class testtaskModel extends model */ public function getRuns($taskID, $moduleID, $orderBy, $pager = null) { - $orderBy = (strpos($orderBy, 'assignedTo') !== false or strpos($orderBy, 'lastRunResult') !== false) ? ('t1.' . $orderBy) : ('t2.' . $orderBy); + $orderBy = (strpos($orderBy, 'assignedTo') !== false or strpos($orderBy, 'status') !== false or strpos($orderBy, 'lastRunResult') !== false or strpos($orderBy, 'lastRunner') !== false or strpos($orderBy, 'lastRunDate') !== false) ? ('t1.' . $orderBy) : ('t2.' . $orderBy); return $this->dao->select('t2.*,t1.*,t2.version as caseVersion,t3.title as storyTitle,t2.status as caseStatus')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id') @@ -1121,7 +1121,7 @@ class testtaskModel extends model ->andWhere('t2.deleted')->eq(0) ->beginIF($queryProductID != 'all')->andWhere('t2.product')->eq($queryProductID)->fi() ->beginIF($task->branch)->andWhere('t2.branch')->in("0,{$task->branch}")->fi() - ->orderBy(strpos($sort, 'assignedTo') !== false ? ('t1.' . $sort) : ('t2.' . $sort)) + ->orderBy((strpos($sort, 'assignedTo') !== false or strpos($sort, 'status') !== false or strpos($sort, 'lastRunResult') !== false or strpos($sort, 'lastRunner') !== false or strpos($sort, 'lastRunDate') !== false) ? ('t1.' . $sort) : ('t2.' . $sort)) ->page($pager) ->fetchAll('id'); } From 1534428895f41ed45cbca1676406ae6e7e02763e Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 5 Nov 2020 09:53:40 +0800 Subject: [PATCH 030/187] * Finish task#8196. --- module/story/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 0d33d38e3a..057d9a977f 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -136,7 +136,7 @@ common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true); - if($config->global->flow != 'onlyStory' and !isonlybody() and $story->parent >= 0 and $story->type != 'requirement' and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate'))) + if($config->global->flow != 'onlyStory' and $story->parent >= 0 and $story->type != 'requirement' and (common::hasPriv('testcase', 'create') or common::hasPriv('testcase', 'batchCreate'))) { $this->app->loadLang('testcase'); echo "
      "; From 1ea321fea5f7b975656818fb391cee6d962f762f Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 5 Nov 2020 11:10:11 +0800 Subject: [PATCH 031/187] * Finish task#8239. --- module/bug/view/create.html.php | 6 + module/story/view/create.html.php | 6 + module/task/view/create.html.php | 6 + module/testcase/view/create.html.php | 442 +++++++++++++------------- module/user/view/batchcreate.html.php | 2 +- 5 files changed, 243 insertions(+), 219 deletions(-) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 121f22921e..bbe2bf8f82 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -32,6 +32,12 @@ js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty);
      + bug->create->requiredFields) as $field) + { + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; + } + ?>
      task->assignedTo;?> + app->user->account, "class='form-control chosen'");?> +
      task->realStarted;?>
      realStarted == '0000-00-00' ? helper::today() : $task->realStarted, "class='form-control form-date' data-picker-position='bottom-right'");?>
      task->consumed;?> From a2a50698ee45d4f3cb3a692c0932f5f115400fb2 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 3 Nov 2020 17:24:07 +0800 Subject: [PATCH 015/187] * Finish task #8199. --- db/update12.4.4.sql | 1 + db/zentao.sql | 1 + module/doc/control.php | 6 +- module/doc/css/create.css | 2 + module/doc/lang/de.php | 7 + module/doc/lang/en.php | 7 + module/doc/lang/fr.php | 7 + module/doc/lang/vi.php | 299 +++++++++++++++--------------- module/doc/lang/zh-cn.php | 7 + module/doc/model.php | 100 ++++++++++ module/doc/view/create.html.php | 11 ++ module/doc/view/edit.html.php | 11 ++ module/doc/view/sendmail.html.php | 35 ++++ module/message/config.php | 3 + 14 files changed, 349 insertions(+), 148 deletions(-) create mode 100644 db/update12.4.4.sql create mode 100644 module/doc/view/sendmail.html.php diff --git a/db/update12.4.4.sql b/db/update12.4.4.sql new file mode 100644 index 0000000000..4e83bbfc11 --- /dev/null +++ b/db/update12.4.4.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`; diff --git a/db/zentao.sql b/db/zentao.sql index 04d63244d0..2a0fbb021d 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -304,6 +304,7 @@ CREATE TABLE IF NOT EXISTS `zt_doc` ( `addedDate` datetime NOT NULL, `editedBy` varchar(30) NOT NULL, `editedDate` datetime NOT NULL, + `mailto` text, `acl` varchar(10) NOT NULL DEFAULT 'open', `groups` varchar(255) NOT NULL, `users` text NOT NULL, diff --git a/module/doc/control.php b/module/doc/control.php index dd5ab8dbf9..9dbc452a94 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -320,6 +320,8 @@ class doc extends control $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->duplicate, $this->lang->doc->common), 'locate' => $this->createLink('doc', 'view', "docID=$docID"))); } + $this->executeHooks($docID); + $fileAction = ''; if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ; $this->action->create('doc', $docID, 'Created', $fileAction); @@ -371,7 +373,7 @@ class doc extends control $this->view->type = $type; $this->view->docType = $docType; $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->user->getPairs('nocode'); + $this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted'); $this->display(); } @@ -424,7 +426,7 @@ class doc extends control $this->view->type = $type; $this->view->libs = $this->doc->getLibs($type = 'all', $extra = 'withObject'); $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->users = $this->user->getPairs('noletter', $doc->users); + $this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted', $doc->users); $this->display(); } diff --git a/module/doc/css/create.css b/module/doc/css/create.css index f31a665884..f9cea96d28 100644 --- a/module/doc/css/create.css +++ b/module/doc/css/create.css @@ -1 +1,3 @@ #whiteListBox .input-group:last-child{margin-top:10px} +#mailtoGroup .input-group-btn > .btn {margin-left: -1px!important;} +#mailtoGroup .chosen-container-single a {border-left-width: 0px;} diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index c971aec9e2..705df7d315 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -47,6 +47,7 @@ $lang->doc->users = 'Benutzer'; $lang->doc->item = ' Einträge'; $lang->doc->num = 'Doks'; $lang->doc->searchResult = 'Suchergebnis'; +$lang->doc->mailto = 'Mailto'; $lang->doc->moduleDoc = 'Nach Modulen'; $lang->doc->searchDoc = 'Suche'; @@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = 'Display Empty Library'; $lang->doc->customShowLibsList['children'] = 'Display Child-category Documents'; $lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon}s Only"; +$lang->doc->mail = new stdclass(); +$lang->doc->mail->create = new stdclass(); +$lang->doc->mail->edit = new stdclass(); +$lang->doc->mail->create->title = "%s created document #%s:%s"; +$lang->doc->mail->edit->title = "%s edited document #%s:%s"; + $lang->doc->confirmDelete = "Möchten Sie dieses Dokument löschen?"; $lang->doc->confirmDeleteLib = "Möchten Sie diese Bibliothek löschen?"; $lang->doc->errorEditSystemDoc = "System Dokumentenbibliothek darf nicht geändert werden."; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 6489696f55..709a8e8b8e 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -47,6 +47,7 @@ $lang->doc->users = 'Users'; $lang->doc->item = ' Items'; $lang->doc->num = 'Documents'; $lang->doc->searchResult = 'Search Result'; +$lang->doc->mailto = 'Mailto'; $lang->doc->moduleDoc = 'By Module'; $lang->doc->searchDoc = 'Search'; @@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = 'Display Empty Library'; $lang->doc->customShowLibsList['children'] = 'Display Child-category Documents'; $lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon}s Only"; +$lang->doc->mail = new stdclass(); +$lang->doc->mail->create = new stdclass(); +$lang->doc->mail->edit = new stdclass(); +$lang->doc->mail->create->title = "%s created document #%s:%s"; +$lang->doc->mail->edit->title = "%s edited document #%s:%s"; + $lang->doc->confirmDelete = "Do you want to delete this document?"; $lang->doc->confirmDeleteLib = "Do you want to delete this document library?"; $lang->doc->errorEditSystemDoc = "You don't have to change system document library."; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index e5a30df8b5..e4f8887a60 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -47,6 +47,7 @@ $lang->doc->users = 'Utilisateurs'; $lang->doc->item = ' Objets'; $lang->doc->num = 'Documents'; $lang->doc->searchResult = 'Résultat de Recherche'; +$lang->doc->mailto = 'Mailto'; $lang->doc->moduleDoc = 'Par Module'; $lang->doc->searchDoc = 'Rechercher'; @@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = 'Montrer Bibliothèques Vides'; $lang->doc->customShowLibsList['children'] = 'Montrer sous-catégorie de Documents'; $lang->doc->customShowLibsList['unclosed'] = "Montrer {$lang->projectCommon}s actifs seulement"; +$lang->doc->mail = new stdclass(); +$lang->doc->mail->create = new stdclass(); +$lang->doc->mail->edit = new stdclass(); +$lang->doc->mail->create->title = "%s created document #%s:%s"; +$lang->doc->mail->edit->title = "%s edited document #%s:%s"; + $lang->doc->confirmDelete = "Voulez-vous supprimer ce document ?"; $lang->doc->confirmDeleteLib = "Voulez-vous supprimer cette Bibliothèque ?"; $lang->doc->errorEditSystemDoc = "Vous n'avez pas besoin de changer de système de Bibliothèque."; diff --git a/module/doc/lang/vi.php b/module/doc/lang/vi.php index d3ea1fd8d5..7e51f6941f 100644 --- a/module/doc/lang/vi.php +++ b/module/doc/lang/vi.php @@ -10,104 +10,105 @@ * @link http://www.zentao.net */ /* Fields. */ -$lang->doc->common = 'Tài liệu'; -$lang->doc->id = 'ID'; -$lang->doc->product = $lang->productCommon; -$lang->doc->project = $lang->projectCommon; -$lang->doc->lib = 'Thư viện'; -$lang->doc->module = 'Danh mục'; -$lang->doc->title = 'Tên'; -$lang->doc->digest = 'Tóm tắt'; -$lang->doc->comment = 'Nhận xét'; -$lang->doc->type = 'Loại'; -$lang->doc->content = 'Text'; -$lang->doc->keywords = 'Tags'; -$lang->doc->url = 'URL'; -$lang->doc->files = 'Files'; -$lang->doc->addedBy = 'Author'; -$lang->doc->addedDate = 'Đã thêm'; -$lang->doc->editedBy = 'UpdatedBy'; -$lang->doc->editedDate = 'UpdatedDate'; -$lang->doc->version = 'Phiên bản'; -$lang->doc->basicInfo = 'Thông tin cơ bản'; -$lang->doc->deleted = 'Đã xóa'; -$lang->doc->fileObject = 'Dependent Item'; -$lang->doc->whiteList = 'Danh sách trắng'; -$lang->doc->contentType = 'Định dạng'; -$lang->doc->separator = ""; -$lang->doc->fileTitle = 'File tên'; -$lang->doc->filePath = 'File Path'; -$lang->doc->extension = 'Extension'; -$lang->doc->size = 'Size'; -$lang->doc->download = 'Tải về'; -$lang->doc->acl = 'Right'; -$lang->doc->fileName = 'Files'; -$lang->doc->groups = 'Nhóm'; -$lang->doc->users = 'Người dùng'; -$lang->doc->item = ' Items'; -$lang->doc->num = 'Documents'; -$lang->doc->searchResult = 'Search kết quả'; +$lang->doc->common = 'Tài liệu'; +$lang->doc->id = 'ID'; +$lang->doc->product = $lang->productCommon; +$lang->doc->project = $lang->projectCommon; +$lang->doc->lib = 'Thư viện'; +$lang->doc->module = 'Danh mục'; +$lang->doc->title = 'Tên'; +$lang->doc->digest = 'Tóm tắt'; +$lang->doc->comment = 'Nhận xét'; +$lang->doc->type = 'Loại'; +$lang->doc->content = 'Text'; +$lang->doc->keywords = 'Tags'; +$lang->doc->url = 'URL'; +$lang->doc->files = 'Files'; +$lang->doc->addedBy = 'Author'; +$lang->doc->addedDate = 'Đã thêm'; +$lang->doc->editedBy = 'UpdatedBy'; +$lang->doc->editedDate = 'UpdatedDate'; +$lang->doc->version = 'Phiên bản'; +$lang->doc->basicInfo = 'Thông tin cơ bản'; +$lang->doc->deleted = 'Đã xóa'; +$lang->doc->fileObject = 'Dependent Item'; +$lang->doc->whiteList = 'Danh sách trắng'; +$lang->doc->contentType = 'Định dạng'; +$lang->doc->separator = ""; +$lang->doc->fileTitle = 'File tên'; +$lang->doc->filePath = 'File Path'; +$lang->doc->extension = 'Extension'; +$lang->doc->size = 'Size'; +$lang->doc->download = 'Tải về'; +$lang->doc->acl = 'Right'; +$lang->doc->fileName = 'Files'; +$lang->doc->groups = 'Nhóm'; +$lang->doc->users = 'Người dùng'; +$lang->doc->item = ' Items'; +$lang->doc->num = 'Documents'; +$lang->doc->searchResult = 'Search kết quả'; +$lang->doc->mailto = 'Mailto'; -$lang->doc->moduleDoc = 'By Module'; -$lang->doc->searchDoc = 'Tìm kiếm'; -$lang->doc->fast = 'Quick Entry'; -$lang->doc->allDoc = 'Tất cả tài liệu'; -$lang->doc->openedByMe = 'Của bạn'; -$lang->doc->orderByOpen = 'Recent Added'; -$lang->doc->orderByEdit = 'Recent Updated'; -$lang->doc->orderByVisit = 'Last Visited'; -$lang->doc->todayEdited = 'Updated Today'; -$lang->doc->pastEdited = 'Tổng Updated'; -$lang->doc->myDoc = 'My tài liệu'; -$lang->doc->myCollection = 'My Favorites'; +$lang->doc->moduleDoc = 'By Module'; +$lang->doc->searchDoc = 'Tìm kiếm'; +$lang->doc->fast = 'Quick Entry'; +$lang->doc->allDoc = 'Tất cả tài liệu'; +$lang->doc->openedByMe = 'Của bạn'; +$lang->doc->orderByOpen = 'Recent Added'; +$lang->doc->orderByEdit = 'Recent Updated'; +$lang->doc->orderByVisit = 'Last Visited'; +$lang->doc->todayEdited = 'Updated Today'; +$lang->doc->pastEdited = 'Tổng Updated'; +$lang->doc->myDoc = 'My tài liệu'; +$lang->doc->myCollection = 'My Favorites'; /* Methods list */ -$lang->doc->index = 'Document Home'; -$lang->doc->create = 'Tạo tài liệu'; -$lang->doc->edit = 'Sửa tài liệu'; -$lang->doc->delete = 'Xóa tài liệu'; -$lang->doc->browse = 'Document danh sách'; -$lang->doc->view = 'Document Detail'; -$lang->doc->diff = 'Diff'; -$lang->doc->diffAction = 'Diff tài liệu'; -$lang->doc->sort = 'Đánh giá tài liệu'; -$lang->doc->manageType = 'Quản lý danh mục'; -$lang->doc->editType = 'Sửa'; -$lang->doc->deleteType = 'Xóa'; -$lang->doc->addType = 'Thêm'; -$lang->doc->childType = 'Categories'; -$lang->doc->collect = 'Thêm Favorite'; -$lang->doc->cancelCollection = 'Remove Favorite'; -$lang->doc->deleteFile = 'Xóa File'; +$lang->doc->index = 'Document Home'; +$lang->doc->create = 'Tạo tài liệu'; +$lang->doc->edit = 'Sửa tài liệu'; +$lang->doc->delete = 'Xóa tài liệu'; +$lang->doc->browse = 'Document danh sách'; +$lang->doc->view = 'Document Detail'; +$lang->doc->diff = 'Diff'; +$lang->doc->diffAction = 'Diff tài liệu'; +$lang->doc->sort = 'Đánh giá tài liệu'; +$lang->doc->manageType = 'Quản lý danh mục'; +$lang->doc->editType = 'Sửa'; +$lang->doc->deleteType = 'Xóa'; +$lang->doc->addType = 'Thêm'; +$lang->doc->childType = 'Categories'; +$lang->doc->collect = 'Thêm Favorite'; +$lang->doc->cancelCollection = 'Remove Favorite'; +$lang->doc->deleteFile = 'Xóa File'; -$lang->doc->libName = 'Thư viện tài liệu'; -$lang->doc->libType = 'Danh mục'; -$lang->doc->custom = 'Tùy biến thư viện tài liệu'; -$lang->doc->customAB = 'Tùy biến Doc Lib'; -$lang->doc->createLib = 'Tạo thư viện tài liệu'; -$lang->doc->allLibs = 'Library danh sách'; -$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->projectCommon} Libraries"; -$lang->doc->showFiles = 'Attachments'; -$lang->doc->editLib = 'Sửa thư viện tài liệu'; -$lang->doc->deleteLib = 'Xóa thư viện tài liệu'; -$lang->doc->fixedMenu = 'Sửa to Menu'; -$lang->doc->removeMenu = 'Remove from Menu'; -$lang->doc->search = 'Tìm kiếm'; +$lang->doc->libName = 'Thư viện tài liệu'; +$lang->doc->libType = 'Danh mục'; +$lang->doc->custom = 'Tùy biến thư viện tài liệu'; +$lang->doc->customAB = 'Tùy biến Doc Lib'; +$lang->doc->createLib = 'Tạo thư viện tài liệu'; +$lang->doc->allLibs = 'Library danh sách'; +$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->projectCommon} Libraries"; +$lang->doc->showFiles = 'Attachments'; +$lang->doc->editLib = 'Sửa thư viện tài liệu'; +$lang->doc->deleteLib = 'Xóa thư viện tài liệu'; +$lang->doc->fixedMenu = 'Sửa to Menu'; +$lang->doc->removeMenu = 'Remove from Menu'; +$lang->doc->search = 'Tìm kiếm'; /* Query condition list. */ -$lang->doc->allProduct = 'All' . $lang->productCommon; -$lang->doc->allProject = 'All' . $lang->projectCommon; +$lang->doc->allProduct = 'All' . $lang->productCommon; +$lang->doc->allProject = 'All' . $lang->projectCommon; -$lang->doc->libTypeList['product'] = $lang->productCommon . ' thư viện'; -$lang->doc->libTypeList['project'] = $lang->projectCommon . ' thư viện'; -$lang->doc->libTypeList['custom'] = 'Tùy biến thư viện'; +$lang->doc->libTypeList['product'] = $lang->productCommon . ' thư viện'; +$lang->doc->libTypeList['project'] = $lang->projectCommon . ' thư viện'; +$lang->doc->libTypeList['custom'] = 'Tùy biến thư viện'; -$lang->doc->libIconList['product'] = 'icon-cube'; -$lang->doc->libIconList['project'] = 'icon-stack'; -$lang->doc->libIconList['custom'] = 'icon-folder-o'; +$lang->doc->libIconList['product'] = 'icon-cube'; +$lang->doc->libIconList['project'] = 'icon-stack'; +$lang->doc->libIconList['custom'] = 'icon-folder-o'; -$lang->doc->systemLibs['product'] = $lang->productCommon; -$lang->doc->systemLibs['project'] = $lang->projectCommon; +$lang->doc->systemLibs['product'] = $lang->productCommon; +$lang->doc->systemLibs['project'] = $lang->projectCommon; global $config; if($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') unset($lang->doc->systemLibs['project']); @@ -115,76 +116,82 @@ if($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') if($config->global->flow == 'onlyTask') unset($lang->doc->systemLibs['product']); if($config->global->flow == 'onlyTask') unset($lang->doc->libTypeList['product']); -$lang->doc->aclList['open'] = 'Công khai'; -$lang->doc->aclList['custom'] = 'Tùy biến'; -$lang->doc->aclList['private'] = 'Riêng tư'; +$lang->doc->aclList['open'] = 'Công khai'; +$lang->doc->aclList['custom'] = 'Tùy biến'; +$lang->doc->aclList['private'] = 'Riêng tư'; -$lang->doc->typeList['html'] = 'Html'; -$lang->doc->typeList['markdown'] = 'Markdown'; -$lang->doc->typeList['url'] = 'URL'; -$lang->doc->typeList['word'] = 'Word'; -$lang->doc->typeList['ppt'] = 'PPT'; -$lang->doc->typeList['excel'] = 'Excel'; +$lang->doc->typeList['html'] = 'Html'; +$lang->doc->typeList['markdown'] = 'Markdown'; +$lang->doc->typeList['url'] = 'URL'; +$lang->doc->typeList['word'] = 'Word'; +$lang->doc->typeList['ppt'] = 'PPT'; +$lang->doc->typeList['excel'] = 'Excel'; -$lang->doc->types['text'] = 'Text'; -$lang->doc->types['url'] = 'URL'; +$lang->doc->types['text'] = 'Text'; +$lang->doc->types['url'] = 'URL'; -$lang->doc->contentTypeList['html'] = 'HTML'; -$lang->doc->contentTypeList['markdown'] = 'MarkDown'; +$lang->doc->contentTypeList['html'] = 'HTML'; +$lang->doc->contentTypeList['markdown'] = 'MarkDown'; -$lang->doc->browseType = 'Danh mục'; -$lang->doc->browseTypeList['list'] = 'Danh sách'; -$lang->doc->browseTypeList['grid'] = 'Card'; +$lang->doc->browseType = 'Danh mục'; +$lang->doc->browseTypeList['list'] = 'Danh sách'; +$lang->doc->browseTypeList['grid'] = 'Card'; -$lang->doc->fastMenuList['byediteddate'] = 'Recent Edited'; -//$lang->doc->fastMenuList['visiteddate'] = 'Recently Visited'; -$lang->doc->fastMenuList['openedbyme'] = 'My tài liệu'; -$lang->doc->fastMenuList['collectedbyme'] = 'My Favorites'; +$lang->doc->fastMenuList['byediteddate'] = 'Recent Edited'; +//$lang->doc->fastMenuList['visiteddate'] = 'Recently Visited'; +$lang->doc->fastMenuList['openedbyme'] = 'My tài liệu'; +$lang->doc->fastMenuList['collectedbyme'] = 'My Favorites'; -$lang->doc->fastMenuIconList['byediteddate'] = 'icon-folder-upload'; -//$lang->doc->fastMenuIconList['visiteddate'] = 'icon-folder-move'; -$lang->doc->fastMenuIconList['openedbyme'] = 'icon-folder-account'; -$lang->doc->fastMenuIconList['collectedbyme'] = 'icon-folder-star'; +$lang->doc->fastMenuIconList['byediteddate'] = 'icon-folder-upload'; +//$lang->doc->fastMenuIconList['visiteddate'] = 'icon-folder-move'; +$lang->doc->fastMenuIconList['openedbyme'] = 'icon-folder-account'; +$lang->doc->fastMenuIconList['collectedbyme'] = 'icon-folder-star'; -$lang->doc->customObjectLibs['files'] = 'Hiện Attachment thư viện'; -$lang->doc->customObjectLibs['customFiles'] = 'Hiện Custom thư viện'; +$lang->doc->customObjectLibs['files'] = 'Hiện Attachment thư viện'; +$lang->doc->customObjectLibs['customFiles'] = 'Hiện Custom thư viện'; -$lang->doc->orderLib = 'Đánh giá Thiết lập'; -$lang->doc->customShowLibs = 'Display Thiết lập'; -$lang->doc->customShowLibsList['zero'] = 'Display Empty thư viện'; -$lang->doc->customShowLibsList['children'] = 'Display Child-category tài liệu'; -$lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon} Only"; +$lang->doc->orderLib = 'Đánh giá Thiết lập'; +$lang->doc->customShowLibs = 'Display Thiết lập'; +$lang->doc->customShowLibsList['zero'] = 'Display Empty thư viện'; +$lang->doc->customShowLibsList['children'] = 'Display Child-category tài liệu'; +$lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon} Only"; -$lang->doc->confirmDelete = "Bạn có muốn xóa this document?"; -$lang->doc->confirmDeleteLib = "Bạn có muốn xóa this document library?"; -$lang->doc->errorEditSystemDoc = "You don't have to change system document library."; -$lang->doc->errorEmptyProduct = "Không có {$lang->productCommon}. It cannot be created."; -$lang->doc->errorEmptyProject = "Không có {$lang->projectCommon}. It cannot be created."; -$lang->doc->errorMainSysLib = "This library không thể xóa."; -$lang->doc->accessDenied = "Access bị từ chối!"; -$lang->doc->versionNotFount = 'Nó does not exist in bản dựng này.'; -$lang->doc->noDoc = 'Không có documents. '; -$lang->doc->cannotCreateOffice = 'Sorry, %s can only be created in ZenTao Enterprise. Contact us at renee@easysoft.ltd to try ZenTao Enterprise.'; +$lang->doc->mail = new stdclass(); +$lang->doc->mail->create = new stdclass(); +$lang->doc->mail->edit = new stdclass(); +$lang->doc->mail->create->title = "%s created document #%s:%s"; +$lang->doc->mail->edit->title = "%s edited document #%s:%s"; + +$lang->doc->confirmDelete = "Bạn có muốn xóa this document?"; +$lang->doc->confirmDeleteLib = "Bạn có muốn xóa this document library?"; +$lang->doc->errorEditSystemDoc = "You don't have to change system document library."; +$lang->doc->errorEmptyProduct = "Không có {$lang->productCommon}. It cannot be created."; +$lang->doc->errorEmptyProject = "Không có {$lang->projectCommon}. It cannot be created."; +$lang->doc->errorMainSysLib = "This library không thể xóa."; +$lang->doc->accessDenied = "Access bị từ chối!"; +$lang->doc->versionNotFount = 'Nó does not exist in bản dựng này.'; +$lang->doc->noDoc = 'Không có documents. '; +$lang->doc->cannotCreateOffice = 'Sorry, %s can only be created in ZenTao Enterprise. Contact us at renee@easysoft.ltd to try ZenTao Enterprise.'; $lang->doc->notSetOffice = "

      To create a %s document, you need to configure office convert.

      "; -$lang->doc->noSearchedDoc = 'Không có documents found.'; -$lang->doc->noEditedDoc = 'Bạn có not edited any documents.'; -$lang->doc->noOpenedDoc = 'Bạn chưa tạo any documents.'; -$lang->doc->noCollectedDoc = 'Bạn có not favorited any documents.'; +$lang->doc->noSearchedDoc = 'Không có documents found.'; +$lang->doc->noEditedDoc = 'Bạn có not edited any documents.'; +$lang->doc->noOpenedDoc = 'Bạn chưa tạo any documents.'; +$lang->doc->noCollectedDoc = 'Bạn có not favorited any documents.'; -$lang->doc->noticeAcl['lib']['product']['default'] = 'Users who can access the selected product có thể truy cập nó.'; -$lang->doc->noticeAcl['lib']['product']['custom'] = 'Users who can access the selected product or users in the whiltelist có thể truy cập nó.'; -$lang->doc->noticeAcl['lib']['project']['default'] = 'Users who can access the selected project có thể truy cập nó.'; -$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users who can access the selected project or users in the whiltelist có thể truy cập nó.'; -$lang->doc->noticeAcl['lib']['custom']['open'] = 'Tất cả users có thể truy cập nó.'; -$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist có thể truy cập nó.'; -$lang->doc->noticeAcl['lib']['custom']['private'] = 'Chỉ the one who created it có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['product']['default'] = 'Users who can access the selected product có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['product']['custom'] = 'Users who can access the selected product or users in the whiltelist có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['project']['default'] = 'Users who can access the selected project có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users who can access the selected project or users in the whiltelist có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['custom']['open'] = 'Tất cả users có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist có thể truy cập nó.'; +$lang->doc->noticeAcl['lib']['custom']['private'] = 'Chỉ the one who created it có thể truy cập nó.'; -$lang->doc->noticeAcl['doc']['open'] = 'Users who can access the document library which the document belongs có thể truy cập nó.'; -$lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist có thể truy cập nó.'; -$lang->doc->noticeAcl['doc']['private'] = 'Chỉ the one who created it có thể truy cập nó.'; +$lang->doc->noticeAcl['doc']['open'] = 'Users who can access the document library which the document belongs có thể truy cập nó.'; +$lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist có thể truy cập nó.'; +$lang->doc->noticeAcl['doc']['private'] = 'Chỉ the one who created it có thể truy cập nó.'; -$lang->doc->placeholder = new stdclass(); -$lang->doc->placeholder->url = 'URL'; +$lang->doc->placeholder = new stdclass(); +$lang->doc->placeholder->url = 'URL'; $lang->doclib = new stdclass(); $lang->doclib->name = 'Tên'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 80bd9b4e93..66fc445b97 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -47,6 +47,7 @@ $lang->doc->users = '用户'; $lang->doc->item = '项'; $lang->doc->num = '文档数量'; $lang->doc->searchResult = '搜索结果'; +$lang->doc->mailto = '抄送给'; $lang->doc->moduleDoc = '按模块浏览'; $lang->doc->searchDoc = '搜索'; @@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = '显示空文档的库'; $lang->doc->customShowLibsList['children'] = '显示子分类的文档'; $lang->doc->customShowLibsList['unclosed'] = '只显示未关闭的项目'; +$lang->doc->mail = new stdclass(); +$lang->doc->mail->create = new stdclass(); +$lang->doc->mail->edit = new stdclass(); +$lang->doc->mail->create->title = "%s创建了文档 #%s:%s"; +$lang->doc->mail->edit->title = "%s编辑了文档 #%s:%s"; + $lang->doc->confirmDelete = "您确定删除该文档吗?"; $lang->doc->confirmDeleteLib = "您确定删除该文档库吗?"; $lang->doc->errorEditSystemDoc = "系统文档库无需修改。"; diff --git a/module/doc/model.php b/module/doc/model.php index 4c14f661d1..a928e479f2 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -618,6 +618,7 @@ class docModel extends model ->cleanInt('product,project,module,lib') ->join('groups', ',') ->join('users', ',') + ->join('mailto', ',') ->remove('files,labels,uid') ->get(); @@ -693,6 +694,7 @@ class docModel extends model ->cleanInt('module') ->join('groups', ',') ->join('users', ',') + ->join('mailto', ',') ->remove('comment,files,labels,uid') ->get(); if($doc->contentType == 'markdown') $doc->content = $this->post->content; @@ -1625,4 +1627,102 @@ class docModel extends model return $actions; } + + /** + * Send mail. + * + * @param int $docID + * @param int $actionID + * @access public + * @return void + */ + public function sendmail($docID, $actionID) + { + $this->loadModel('mail'); + $doc = $this->getById($docID); + $users = $this->loadModel('user')->getPairs('noletter'); + + /* Get action info. */ + $action = $this->loadModel('action')->getById($actionID); + $history = $this->action->getHistory($actionID); + $action->history = isset($history[$actionID]) ? $history[$actionID] : array(); + + /* Get mail content. */ + $modulePath = $this->app->getModulePath($appName = '', 'doc'); + $oldcwd = getcwd(); + $viewFile = $modulePath . 'view/sendmail.html.php'; + chdir($modulePath . 'view'); + if(file_exists($modulePath . 'ext/view/sendmail.html.php')) + { + $viewFile = $modulePath . 'ext/view/sendmail.html.php'; + chdir($modulePath . 'ext/view'); + } + ob_start(); + include $viewFile; + foreach(glob($modulePath . 'ext/view/sendmail.*.html.hook.php') as $hookFile) include $hookFile; + $mailContent = ob_get_contents(); + ob_end_clean(); + chdir($oldcwd); + + $sendUsers = $this->getToAndCcList($doc); + if(!$sendUsers) return; + list($toList, $ccList) = $sendUsers; + $subject = $this->getSubject($doc, $action->action); + + /* Send mail. */ + $this->mail->send($toList, $subject, $mailContent, $ccList); + if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError())); + } + + /** + * Get mail subject. + * + * @param object $doc + * @param string $actionType created|edited + * @access public + * @return string + */ + public function getSubject($doc, $actionType) + { + /* Set email title. */ + if($actionType == 'created') + { + return sprintf($this->lang->doc->mail->create->title, $this->app->user->realname, $doc->id, $doc->title); + } + else + { + return sprintf($this->lang->doc->mail->edit->title, $this->app->user->realname, $doc->id, $doc->title); + } + } + + /** + * Get toList and ccList. + * + * @param object $doc + * @access public + * @return bool|array + */ + public function getToAndCcList($doc) + { + /* Set toList and ccList. */ + $toList = ''; + $ccList = str_replace(' ', '', trim($doc->mailto, ',')); + + if(empty($toList)) + { + if(empty($ccList)) return false; + if(strpos($ccList, ',') === false) + { + $toList = $ccList; + $ccList = ''; + } + else + { + $commaPos = strpos($ccList, ','); + $toList = substr($ccList, 0, $commaPos); + $ccList = substr($ccList, $commaPos + 1); + } + } + return array($toList, $ccList); + } } diff --git a/module/doc/view/create.html.php b/module/doc/view/create.html.php index bd066c5746..d0438e8ff9 100644 --- a/module/doc/view/create.html.php +++ b/module/doc/view/create.html.php @@ -82,6 +82,17 @@

      doc->files;?> fetch('file', 'buildform');?>
      doc->mailto;?> +
      + fetch('my', 'buildContactLists'); + ?> +
      +
      doclib->control;?> diff --git a/module/doc/view/edit.html.php b/module/doc/view/edit.html.php index 5e47a4c99b..62781f1fbd 100644 --- a/module/doc/view/edit.html.php +++ b/module/doc/view/edit.html.php @@ -59,6 +59,17 @@ doc->files;?> fetch('file', 'buildform');?>
      doc->mailto;?> +
      + fetch('my', 'buildContactLists'); + ?> +
      +
      doclib->control;?> diff --git a/module/doc/view/sendmail.html.php b/module/doc/view/sendmail.html.php new file mode 100644 index 0000000000..0eb84c2042 --- /dev/null +++ b/module/doc/view/sendmail.html.php @@ -0,0 +1,35 @@ + + * @package doc + * @version $Id: sendmail.html.php 3717 2020-11-03 15:35:07Z tianshujie@easycorp.ltd $ + * @link https://www.zentao.net + */ +?> +id . ' ' . $doc->title;?> +app->getModuleRoot() . 'common/view/mail.header.html.php';?> +
      + + + + +
      + color) ? '#333' : $doc->color;?> + config->mail, 'domain', common::getSysURL()) . helper::createLink('doc', 'view', "docID=$doc->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?> +
      +
      +
      + lang->doc->content;?> +
      content;?>
      +
      +
      task->assignedTo;?> - app->user->account, "class='form-control chosen'");?> +
      title;?>title;?> fileSize ? $doc->fileSize : '-';?> addedBy);?> editedDate == '0000-00-00 00:00:00' ? formatTime($doc->addedDate, 'Y-m-d') : formatTime($doc->editedDate, 'Y-m-d');?>
      title;?>title;?> addedBy);?> editedDate) ? formatTime($doc->editedDate, 'Y-m-d') : formatTime($doc->addedDate, 'y-m-d');?>
      ", "", $doc->content); + $doc->content = str_replace("", "", $doc->content); $doc->digest = $hyperdown->makeHtml($doc->digest); } From 770309794d98419b44dfbf2397f337c8dc8155d0 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 4 Nov 2020 10:12:49 +0800 Subject: [PATCH 023/187] * Add comment. --- module/doc/control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/doc/control.php b/module/doc/control.php index 1e64aa8f0e..6e71529464 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -432,6 +432,7 @@ class doc extends control * View a doc. * * @param int $docID + * @param int $version * @access public * @return void */ @@ -445,6 +446,7 @@ class doc extends control { $hyperdown = $this->app->loadClass('hyperdown'); $doc->content = $hyperdown->makeHtml($doc->content); + /* Add a newline attribute to the table. */ $doc->content = str_replace("", "", $doc->content); $doc->content = str_replace("", "", $doc->content); $doc->digest = $hyperdown->makeHtml($doc->digest); From 4ebb150e825766ec3bd98aa631a14ec4c3dc71e9 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 4 Nov 2020 10:27:35 +0800 Subject: [PATCH 024/187] * finish task #8232. --- www/tip4japanese.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/tip4japanese.html b/www/tip4japanese.html index ad1b926fad..10153ee69b 100644 --- a/www/tip4japanese.html +++ b/www/tip4japanese.html @@ -32,8 +32,11 @@ From eb53d44b810b77e1d941fe243f8ae2db37a511cc Mon Sep 17 00:00:00 2001 From: z Date: Wed, 4 Nov 2020 10:33:20 +0800 Subject: [PATCH 025/187] * code for task #8279. --- db/update12.4.4.sql | 1 + module/task/model.php | 2 +- module/task/view/finish.html.php | 2 +- module/task/view/start.html.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 db/update12.4.4.sql diff --git a/db/update12.4.4.sql b/db/update12.4.4.sql new file mode 100644 index 0000000000..800a156e2a --- /dev/null +++ b/db/update12.4.4.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_task` CHANGE `realStarted` `realStarted` datetime NOT NULL AFTER `estStarted`; diff --git a/module/task/model.php b/module/task/model.php index 1dc1335430..ac33cf55d5 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1283,7 +1283,7 @@ class taskModel extends model /* Record consumed and left. */ $estimate = new stdclass(); - $estimate->date = zget($task, 'realStarted', date(DT_DATE1)); + $estimate->date = zget($task, 'realStarted', $now); $estimate->task = $taskID; $estimate->consumed = zget($_POST, 'consumed', 0); $estimate->left = zget($_POST, 'left', 0); diff --git a/module/task/view/finish.html.php b/module/task/view/finish.html.php index e756408374..35c9384c25 100644 --- a/module/task/view/finish.html.php +++ b/module/task/view/finish.html.php @@ -67,7 +67,7 @@
      task->finishedDate;?>
      task->status;?>
      task->realStarted;?>
      realStarted == '0000-00-00' ? helper::today() : $task->realStarted, "class='form-control form-date' data-picker-position='bottom-right'");?>
      realStarted == '0000-00-00 00:00:00' ? helper::now() : $task->realStarted, "class='form-control form-datetime' data-picker-position='bottom-right'");?>
      diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 4052b82dd6..87b7fc6a6a 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -24,6 +24,12 @@ + story->create->requiredFields) as $field) + { + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; + } + ?>
      diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index 24ced660c1..374ef65abd 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -24,6 +24,12 @@ + task->create->requiredFields) as $field) + { + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; + } + ?>
      diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 6582b2bc5d..678fcb47e8 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -23,232 +23,238 @@ - -
      - - - - - - - - - testcase->typeList['unit']);?> - - - + testcase->create->requiredFields) as $field) + { + if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field; + } + ?> + +
      testcase->product;?> -
      - - session->currentProductType != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:120px'");?> -
      -
      -
      - testcase->module?> - "; - echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=case¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); - echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'"); - echo ''; - } - ?> -
      -
      testcase->type;?>testcase->typeList, $type, "class='form-control chosen'");?> -
      - testcase->stage?> - testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?> -
      -
      + + + + + + + + + testcase->typeList['unit']);?> + + + + + + global->flow != 'onlyTest'):?> + + + + - - global->flow != 'onlyTest'):?> - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - printExtendFields('', 'table');?> - - - - - - - - - - -
      testcase->product;?> +
      + + session->currentProductType != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:120px'");?> +
      +
      +
      + testcase->module?> + "; + echo html::a($this->createLink('tree', 'browse', "rootID=$productID&view=case¤tModuleID=0&branch=$branch", '', true), $lang->tree->manage, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'"); + echo html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadProductModules($productID)'"); + echo ''; + } + ?> +
      +
      testcase->type;?>testcase->typeList, $type, "class='form-control chosen'");?> +
      + testcase->stage?> + testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?> +
      +
      testcase->lblStory;?> +
      + searchMore . '"');?> + + + + + createLink('story', 'view', "storyID=$storyID", '', true), $lang->preview, '', "class='btn' id='preview'");?> + + +
      +
      testcase->lblStory;?> -
      - searchMore . '"');?> - - - - - createLink('story', 'view', "storyID=$storyID", '', true), $lang->preview, '', "class='btn' id='preview'");?> - - -
      -
      testcase->title;?> -
      -
      - -
      - - - +
      testcase->title;?> +
      +
      + +
      + + + +
      -
      - - testcase->pri;?> - testcase->priList as $priKey => $priValue) - { - if(!empty($priKey) and (string)$priKey != (string)$priValue) - { - $hasCustomPri = true; - break; - } - } - $priList = $lang->testcase->priList; - if(end($priList)) unset($priList[0]); - if(!isset($priList[$pri])) - { - reset($priList); - $pri = key($priList); - } - ?> - - - - -
      - - - - - testcase->forceNotReview()):?> - testcase->forceNotReview, '', "id='forceNotReview0'");?> - -
      -
      testcase->precondition;?>
      testcase->steps;?> - - - - - - - - - - - - - - - - - $step):?> - - - - - - - - -
      testcase->stepID;?>testcase->stepDesc;?>testcase->stepExpect;?>actions;?>
      -
      - - - - -
      - - -
      -
      -
      -
      -
      - - - -
      -
      -
      - - desc, "rows='1' class='form-control autosize step-steps'") ?> - - type)) $step->type = 'step';?> - -
      - type === 'group') echo ' checked' ?>> - -
      -
      -
      -
      expect, "rows='1' class='form-control autosize step-expects'") ?> -
      - - - -
      -
      -
      testcase->keywords;?>
      testcase->status;?>
      testcase->files;?>fetch('file', 'buildform');?>
      - - -
      -
      - -
    -
    +
    todo->every;?> - + todo->cycleDay;?> + +
    + + +
    +
    +
    +
    From 8acfd6867f2efe5a9fdaeb3da0ed745e60ad0172 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 12 Nov 2020 10:49:33 +0800 Subject: [PATCH 083/187] * Finish task#8205. --- config/config.php | 11 ++++---- framework/base/router.class.php | 1 + module/install/control.php | 41 +++++++++++++++++++++++++----- module/install/model.php | 6 ++--- module/install/view/step1.html.php | 15 +++-------- module/install/view/step3.html.php | 1 + 6 files changed, 50 insertions(+), 25 deletions(-) diff --git a/config/config.php b/config/config.php index 110ad31c65..c5a7014a2f 100644 --- a/config/config.php +++ b/config/config.php @@ -16,11 +16,12 @@ if(!class_exists('config')){class config{}} if(!function_exists('getWebRoot')){function getWebRoot(){}} /* 基本设置。Basic settings. */ -$config->version = '12.4.4'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. -$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. -$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. -$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. -$config->webRoot = ''; // URL根目录。 The root path of the url. +$config->version = '12.4.4'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. +$config->cookieLife = time() + 2592000; // Cookie的生存时间。 The cookie life time. +$config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. +$config->webRoot = ''; // URL根目录。 The root path of the url. +$config->customSession = false; // 是否开启自定义session的存储路径。Whether custom the session save path. /* 框架路由相关设置。Routing settings. */ $config->requestType = 'PATH_INFO'; // 请求类型:PATH_INFO|PATHINFO2|GET。 The request type: PATH_INFO|PATH_INFO2|GET. diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 5518f9dfd8..2cdf1f303b 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -830,6 +830,7 @@ class baseRouter { $sessionName = $this->config->sessionVar; session_name($sessionName); + if($this->config->customSession) session_save_path($this->getTmpRoot() . 'session'); session_start(); $this->sessionID = session_id(); diff --git a/module/install/control.php b/module/install/control.php index 20c31c0ddf..8ede07bb17 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -84,8 +84,12 @@ class install extends control $this->view->checkSession = $checkSession; if($checkSession) { - $this->view->sessionResult = $this->install->checkSessionSavePath(); - $this->view->sessionInfo = $this->install->getSessionSavePath(); + $sessionResult = $this->install->checkSessionSavePath(); + $sessionInfo = $this->install->getSessionSavePath(); + if($sessionInfo['path'] == '') $sessionResult = 'ok'; + + $this->view->sessionResult = $sessionResult; + $this->view->sessionInfo = $sessionInfo; } $this->display(); @@ -116,11 +120,36 @@ class install extends control $return = $this->install->checkConfig(); if($return->result == 'ok') { + /* Set the session save path when the session save path is null. */ + $customSession = false; + $checkSession = ini_get('session.save_handler') == 'files'; + if($checkSession) + { + if(!session_save_path()) + { + $tmpRootInfo = $this->install->getTmpRoot(); + $sessionSavePath = $tmpRootInfo['path'] . 'session'; + if(!is_dir($sessionSavePath)) mkdir($sessionSavePath, 0777, true); + + session_save_path($sessionSavePath); + $customSession = true; + + $sessionResult = $this->install->checkSessionSavePath(); + if($sessionResult == 'fail') chmod($sessionSavePath, 0777); + + /* Restart the session because the session save path is null when start the session last time. */ + session_write_close(); + session_start(); + $this->session->set('installing', true); + } + } + $this->view = (object)$_POST; - $this->view->app = $this->app; - $this->view->lang = $this->lang; - $this->view->config = $this->config; - $this->view->title = $this->lang->install->saveConfig; + $this->view->app = $this->app; + $this->view->lang = $this->lang; + $this->view->config = $this->config; + $this->view->title = $this->lang->install->saveConfig; + $this->view->customSession = $customSession; $this->display(); } else diff --git a/module/install/model.php b/module/install/model.php index ce1e4aa9ec..9f52b072ab 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -187,9 +187,9 @@ class installModel extends model */ public function getTmpRoot() { - $result['path'] = $this->app->getTmpRoot(); - $result['exists'] = is_dir($result['path']); - $result['writable']= is_writable($result['path']); + $result['path'] = $this->app->getTmpRoot(); + $result['exists'] = is_dir($result['path']); + $result['writable'] = is_writable($result['path']); return $result; } diff --git a/module/install/view/step1.html.php b/module/install/view/step1.html.php index bfabf7ea89..3d9e55e4cc 100644 --- a/module/install/view/step1.html.php +++ b/module/install/view/step1.html.php @@ -117,7 +117,7 @@ ?> - + install->session;?> @@ -128,16 +128,9 @@ install->$sessionResult;?> - install->sessionFail; - } + diff --git a/module/install/view/step3.html.php b/module/install/view/step3.html.php index 0240036b86..cfd76d0011 100644 --- a/module/install/view/step3.html.php +++ b/module/install/view/step3.html.php @@ -29,6 +29,7 @@ if(!isset($error)) \$config->webRoot = getWebRoot(); \$config->default->lang = '$defaultLang'; EOT; + if($customSession) $configContent .= "\n\$config->customSession = true;"; } ?>
    From e9286e13d8a661ab645fef9bbb6fcf601b2089cf Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 12 Nov 2020 11:04:17 +0800 Subject: [PATCH 084/187] * Finish task #8194. --- module/doc/control.php | 17 ++++++++++++----- module/doc/view/browsebygrid.html.php | 4 +++- module/doc/view/objectlibs.html.php | 2 +- module/doc/view/objectlibsbylist.html.php | 2 +- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 17242bec45..3947ea8fcb 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -853,8 +853,14 @@ class doc extends control setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true); $table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT; - $object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch(); + $object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch(); if(empty($object)) $this->locate($this->createLink($type, 'create')); + + /* Determines whether an object is editable. */ + $changeAllowed = true; + if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $changeAllowed = false; + if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $changeAllowed = false; + if($from == 'product') { $this->lang->doc->menu = $this->lang->product->menu; @@ -891,10 +897,11 @@ class doc extends control $this->view->title = $object->name; $this->view->position[] = $object->name; - $this->view->type = $type; - $this->view->object = $object; - $this->view->from = $from; - $this->view->libs = $this->doc->getLibsByObject($type, $objectID); + $this->view->type = $type; + $this->view->object = $object; + $this->view->from = $from; + $this->view->libs = $this->doc->getLibsByObject($type, $objectID); + $this->view->changeAllowed = $changeAllowed; $this->display(); } } diff --git a/module/doc/view/browsebygrid.html.php b/module/doc/view/browsebygrid.html.php index 950a1bf8a9..698c907977 100644 --- a/module/doc/view/browsebygrid.html.php +++ b/module/doc/view/browsebygrid.html.php @@ -16,7 +16,7 @@ ", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon text-primary'");?> ", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon'");?>
    - + diff --git a/module/doc/view/objectlibs.html.php b/module/doc/view/objectlibs.html.php index 8eb9f68835..b77fad66d9 100644 --- a/module/doc/view/objectlibs.html.php +++ b/module/doc/view/objectlibs.html.php @@ -57,7 +57,7 @@ collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?> collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
    - + " title="" class='btn btn-link ajaxCollect'> diff --git a/module/doc/view/objectlibsbylist.html.php b/module/doc/view/objectlibsbylist.html.php index caa5926713..1e32f50ed2 100644 --- a/module/doc/view/objectlibsbylist.html.php +++ b/module/doc/view/objectlibsbylist.html.php @@ -34,7 +34,7 @@ name);?> allCount . $lang->doc->item;?> - + collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?> collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?> From 728ff92cf628c910c742a6850e523c4f5174fa97 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 12 Nov 2020 11:25:05 +0800 Subject: [PATCH 085/187] * Finish task #8194. --- module/common/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index afc4e7fee6..9f4897a508 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1490,7 +1490,7 @@ EOD; global $app, $lang; /* Check the parent object is closed. */ - if(commonModel::checkObjectChangeAllowed($module, $object)) return true; + if(!commonModel::checkObjectChangeAllowed($module, $object)) return false; /* Check is the super admin or not. */ if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true; From 70335707c8d256c0813daedfafa7b0b19b08ed7b Mon Sep 17 00:00:00 2001 From: z Date: Thu, 12 Nov 2020 11:31:03 +0800 Subject: [PATCH 086/187] * finish task #2669. --- module/testcase/view/create.html.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/testcase/view/create.html.php b/module/testcase/view/create.html.php index 678fcb47e8..ee37262a99 100644 --- a/module/testcase/view/create.html.php +++ b/module/testcase/view/create.html.php @@ -11,6 +11,7 @@ */ ?> + testcase->deleteStep);?> testcase->insertBefore);?> testcase->insertAfter);?> From 4e69741e7013929d51b2bee99f44e232149acdcb Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 12 Nov 2020 14:18:08 +0800 Subject: [PATCH 087/187] * Finish task #8194. --- module/doc/model.php | 9 +++++++- module/project/control.php | 29 +++++++++++++++----------- module/project/view/treestory.html.php | 4 ++-- module/project/view/treetask.html.php | 6 +++--- module/project/view/view.html.php | 4 ++-- module/story/view/view.html.php | 2 +- module/testcase/view/view.html.php | 6 +++--- 7 files changed, 36 insertions(+), 24 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index e08db05a43..a399234707 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -107,8 +107,15 @@ class docModel extends model } } + /* Determines whether the doc lib is editable. */ + $docLib = new stdClass(); + $docLib->product = $productID; + $docLib->project = $projectID; + $changeAllowed = common::checkObjectChangeAllowed('doc', $docLib); + + $lib = isset($lib) ? $lib : new stdClass(); $actions = $this->setFastMenu($fastLib); - $actions .= common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), " " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : ''; + $actions .= ($changeAllowed and common::hasPriv('doc', 'createLib', $lib)) ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), " " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : ''; $this->lang->TRActions = $actions; } diff --git a/module/project/control.php b/module/project/control.php index 5d75a981b0..7672abbd4e 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1576,6 +1576,10 @@ class project extends control $project = $this->project->getById($projectID, true); if(!$project) die(js::error($this->lang->notFound) . js::locate('back')); + /* Determines whether an object is editable. */ + $changeAllowed = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $products = $this->project->getProducts($project->id); $linkedBranches = array(); foreach($products as $product) @@ -1600,18 +1604,19 @@ class project extends control $this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name); $this->view->position[] = $this->view->title; - $this->view->project = $project; - $this->view->products = $products; - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), '', $linkedBranches); - $this->view->planGroups = $this->project->getPlans($products); - $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->actions = $this->loadModel('action')->getList('project', $projectID); - $this->view->dynamics = $this->loadModel('action')->getDynamic('all', 'all', 'date_desc', $pager, 'all', $projectID); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->teamMembers = $this->project->getTeamMembers($projectID); - $this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID); - $this->view->statData = $this->project->statRelatedData($projectID); - $this->view->chartData = $chartData; + $this->view->project = $project; + $this->view->products = $products; + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), '', $linkedBranches); + $this->view->planGroups = $this->project->getPlans($products); + $this->view->groups = $this->loadModel('group')->getPairs(); + $this->view->actions = $this->loadModel('action')->getList('project', $projectID); + $this->view->dynamics = $this->loadModel('action')->getDynamic('all', 'all', 'date_desc', $pager, 'all', $projectID); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->teamMembers = $this->project->getTeamMembers($projectID); + $this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID); + $this->view->statData = $this->project->statRelatedData($projectID); + $this->view->chartData = $chartData; + $this->view->changeAllowed = $changeAllowed; $this->display(); } diff --git a/module/project/view/treestory.html.php b/module/project/view/treestory.html.php index 593fb0ba83..436360f244 100644 --- a/module/project/view/treestory.html.php +++ b/module/project/view/treestory.html.php @@ -32,7 +32,7 @@ verify) ? $story->verify : "
    " . $lang->noData . '
    ';?>
    -fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?> +fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true', 'object' => $story));?>
    story->legendBasicInfo;?> @@ -341,7 +341,7 @@
    -createLink('action', 'comment', "objectType=story&objectID=$story->id");?> +createLink('action', 'comment', "objectType=story&objectID=$story->id");?> +
    todo->dayNames, isset($todo->config->week) ? $todo->config->week : '')?> diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index f9b57cf3a2..edb8be36cf 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -149,7 +149,18 @@ config->type == 'day') { - echo $lang->todo->every . $todo->config->day . $lang->day; + if(isset($todo->config->day)) echo $lang->todo->every . $todo->config->day . $lang->day; + + if(isset($todo->config->appointDate)) + { + $appointNotes = $lang->todo->appoint; + + if(isset($todo->config->cycleYear)) $appointNotes .= $lang->todo->everyYear; + + $appointNotes .= $todo->config->appoint->month . $lang->todo->cycleMonth . $todo->config->appoint->day . $lang->todo->day; + + echo $appointNotes; + } } elseif($todo->config->type == 'week') { From f08eaf98a160cad7ac6a6b320f5ce120a296e56a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 12 Nov 2020 16:48:40 +0800 Subject: [PATCH 090/187] * Finish task #8203. --- module/group/lang/resource.php | 44 +++++++------- module/product/model.php | 3 +- module/project/css/story.css | 1 + module/project/js/story.js | 18 ++++++ module/project/view/story.html.php | 59 +++++++++++++++++-- module/story/control.php | 19 ++++++ module/story/lang/de.php | 95 ++++++++++++++++-------------- module/story/lang/en.php | 95 ++++++++++++++++-------------- module/story/lang/fr.php | 95 ++++++++++++++++-------------- module/story/lang/vi.php | 9 ++- module/story/lang/zh-cn.php | 95 ++++++++++++++++-------------- module/story/model.php | 45 ++++++++++++++ 12 files changed, 369 insertions(+), 209 deletions(-) diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 9f10f7ad25..91c5e619ad 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -187,31 +187,32 @@ $lang->branch->methodOrder[10] = 'delete'; /* Story. */ $lang->resource->story = new stdclass(); -$lang->resource->story->create = 'create'; -$lang->resource->story->batchCreate = 'batchCreate'; -$lang->resource->story->edit = 'edit'; -$lang->resource->story->linkStory = 'linkStory'; -$lang->resource->story->batchEdit = 'batchEdit'; -$lang->resource->story->export = 'exportAction'; -$lang->resource->story->delete = 'deleteAction'; -$lang->resource->story->view = 'view'; -$lang->resource->story->change = 'changeAction'; -$lang->resource->story->review = 'reviewAction'; -$lang->resource->story->batchReview = 'batchReview'; -$lang->resource->story->assignTo = 'assignAction'; -$lang->resource->story->close = 'closeAction'; -$lang->resource->story->batchClose = 'batchClose'; -$lang->resource->story->activate = 'activateAction'; -$lang->resource->story->tasks = 'tasks'; -$lang->resource->story->bugs = 'bugs'; -$lang->resource->story->cases = 'cases'; -$lang->resource->story->zeroCase = 'zeroCase'; -$lang->resource->story->report = 'reportAction'; +$lang->resource->story->create = 'create'; +$lang->resource->story->batchCreate = 'batchCreate'; +$lang->resource->story->edit = 'edit'; +$lang->resource->story->linkStory = 'linkStory'; +$lang->resource->story->batchEdit = 'batchEdit'; +$lang->resource->story->export = 'exportAction'; +$lang->resource->story->delete = 'deleteAction'; +$lang->resource->story->view = 'view'; +$lang->resource->story->change = 'changeAction'; +$lang->resource->story->review = 'reviewAction'; +$lang->resource->story->batchReview = 'batchReview'; +$lang->resource->story->assignTo = 'assignAction'; +$lang->resource->story->close = 'closeAction'; +$lang->resource->story->batchClose = 'batchClose'; +$lang->resource->story->activate = 'activateAction'; +$lang->resource->story->tasks = 'tasks'; +$lang->resource->story->bugs = 'bugs'; +$lang->resource->story->cases = 'cases'; +$lang->resource->story->zeroCase = 'zeroCase'; +$lang->resource->story->report = 'reportAction'; $lang->resource->story->batchChangePlan = 'batchChangePlan'; $lang->resource->story->batchChangeBranch = 'batchChangeBranch'; $lang->resource->story->batchChangeStage = 'batchChangeStage'; $lang->resource->story->batchAssignTo = 'batchAssignTo'; $lang->resource->story->batchChangeModule = 'batchChangeModule'; +$lang->resource->story->batchToTask = 'batchToTask'; $lang->story->methodOrder[5] = 'create'; $lang->story->methodOrder[10] = 'batchCreate'; @@ -237,6 +238,7 @@ $lang->story->methodOrder[105] = 'report'; $lang->story->methodOrder[110] = 'linkStory'; $lang->story->methodOrder[115] = 'batchChangeBranch'; $lang->story->methodOrder[120] = 'batchChangeModule'; +$lang->story->methodOrder[125] = 'batchToTask'; /* Product plan. */ $lang->resource->productplan = new stdclass(); @@ -1477,6 +1479,8 @@ $lang->changelog['12.3'][] = 'testtask-importUnitResult'; $lang->changelog['12.3'][] = 'job-view'; $lang->changelog['12.3'][] = 'ci-commitResult'; +$lang->changelog['12.4.5'][] = 'story-batchToTask'; + global $config; if($config->global->flow != 'full') { diff --git a/module/product/model.php b/module/product/model.php index bc5f56bdfa..af646fad27 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -38,7 +38,8 @@ class productModel extends model /* init currentModule and currentMethod for report and story. */ if($currentModule == 'story') { - if($currentMethod != 'create' and $currentMethod != 'batchcreate') $currentModule = 'product'; + $method = ",create,batchcreate,batchclose,"; + if(strpos($method, "," . $currentMethod . ",") === false) $currentModule = 'product'; if($currentMethod == 'view' || $currentMethod == 'change' || $currentMethod == 'review') $currentMethod = 'browse'; } if($currentMethod == 'report') $currentMethod = 'browse'; diff --git a/module/project/css/story.css b/module/project/css/story.css index c586920266..6a5602d049 100644 --- a/module/project/css/story.css +++ b/module/project/css/story.css @@ -4,3 +4,4 @@ tbody > tr > td > .btn-icon {margin-right: 4px} @media (max-width: 1200px) {#storyList .c-user, #storyList .c-estimate {display: none!important;}} @media (max-width: 1000px) {#storyList .c-status, #storyList .c-pri {display: none!important;}} @media (max-width: 820px) {#storyList .c-sort, #storyList .c-stage {display: none!important;}} +#batchToTask table tbody tr th{width: 110px;} diff --git a/module/project/js/story.js b/module/project/js/story.js index 532de6bbd9..a192075d65 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -28,9 +28,27 @@ $(function() parent.location.href = createLink('project', 'importPlanStories', 'projectID=' + projectID + '&planID=' + planID); } }) + + /* Get checked stories. */ + $('#batchToTaskButton').on('click', function () + { + var storyIdList = ''; + $("input[name^='storyIdList']:checked").each(function() + { + storyIdList += $(this).val() + ','; + $('#storyIdList').val(storyIdList); + }); + }) + $('.sorter-false a').unwrap(); }); +/** + * Show checked summary. + * + * @access public + * @return void + */ function showCheckedSummary() { var $summary = $('#main #mainContent form.main-table .table-header .table-statistic'); diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index f6921b0bf2..40811dea4c 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -117,8 +117,9 @@ $canBatchClose = common::hasPriv('story', 'batchClose'); $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); $canBatchUnlink = common::hasPriv('project', 'batchUnlinkStory'); + $canBatchToTask = common::hasPriv('story', 'batchToTask'); - $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink); + $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask); ?> id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -237,12 +238,21 @@
    +
    + createLink('story', 'batchEdit', "productID=0&projectID=$project->id"); + echo html::commonButton($lang->edit, "data-form-action='$actionLink' $disabled"); + ?> + + +
    createLink('story', 'batchEdit', "productID=0&projectID=$project->id"); - echo html::commonButton($lang->edit, "data-form-action='$actionLink'"); - } if($canBatchClose) { $actionLink = $this->createLink('story', 'batchClose', "productID=0&projectID=$project->id"); @@ -298,6 +308,43 @@
    + + product->checkedSummary);?> id);?> diff --git a/module/story/control.php b/module/story/control.php index 7e1c41a55d..0fb2b240fe 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1062,6 +1062,25 @@ class story extends control die(js::reload('parent')); } + /** + * Batch conversion of stories into tasks. + * + * @param int $projectID + * @access public + * @return void + */ + public function batchToTask($projectID = 0) + { + if(!empty($_POST)) + { + $this->story->batchToTask($projectID); + + if(dao::isError()) die(js::error(dao::getError()) . js::locate('back')); + + if(!dao::isError()) die(js::alert($this->lang->saveSuccess) . js::locate($this->createLink('project', 'story', "projectID=$projectID"), 'parent')); + } + } + /** * Batch change the plan of story. * diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 476e18cde9..4a97b7de79 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -9,57 +9,61 @@ * @version $Id: en.php 5141 2013-07-15 05:57:15Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->story->create = "Story hinzufügen"; -$lang->story->batchCreate = "Mehere hinzufügen"; -$lang->story->change = "Ändern"; -$lang->story->changeAction = "Change Story"; -$lang->story->changed = 'Geändert'; -$lang->story->assignTo = 'Assign'; -$lang->story->assignAction = 'Assign Story'; -$lang->story->review = 'Prüfen'; -$lang->story->reviewAction = 'Review Story'; -$lang->story->needReview = 'Need Review'; -$lang->story->batchReview = 'Mehere prüfen'; -$lang->story->edit = "Bearbeiten"; -$lang->story->batchEdit = "Mehere bearbeiten"; -$lang->story->subdivide = 'Aufteilen'; -$lang->story->subdivideAction = 'Decompose Story'; -$lang->story->splitRequirent = 'Decompose'; -$lang->story->close = 'Schließen'; -$lang->story->closeAction = 'Close Story'; -$lang->story->batchClose = 'Mehere schließen'; -$lang->story->activate = 'Aktivieren'; -$lang->story->activateAction = 'Activate Story'; -$lang->story->delete = "Löschen"; -$lang->story->deleteAction = "Delete Story"; -$lang->story->view = "Storydetails"; -$lang->story->setting = "Einstellungen"; -$lang->story->tasks = "Verknüpfte Aufgaben"; -$lang->story->bugs = "Verknüpfte Bugs"; -$lang->story->cases = "Verknüpfte Fälle"; -$lang->story->taskCount = 'Aufgaben'; -$lang->story->bugCount = 'Bugs'; -$lang->story->caseCount = 'Fälle'; -$lang->story->taskCountAB = 'T'; -$lang->story->bugCountAB = 'B'; -$lang->story->caseCountAB = 'C'; -$lang->story->linkStory = 'Verküpfen'; -$lang->story->unlinkStory = 'Verknüpfung aufheben'; -$lang->story->export = "Daten exportieren"; -$lang->story->exportAction = "Export Story"; -$lang->story->zeroCase = "Storys ohne Fälle"; -$lang->story->zeroTask = "Storys ohne Aufgaben anzeigen"; -$lang->story->reportChart = "Bericht"; -$lang->story->reportAction = "Story Report"; -$lang->story->copyTitle = "Titel kopieren"; +$lang->story->create = "Story hinzufügen"; +$lang->story->batchCreate = "Mehere hinzufügen"; +$lang->story->change = "Ändern"; +$lang->story->changeAction = "Change Story"; +$lang->story->changed = 'Geändert'; +$lang->story->assignTo = 'Assign'; +$lang->story->assignAction = 'Assign Story'; +$lang->story->review = 'Prüfen'; +$lang->story->reviewAction = 'Review Story'; +$lang->story->needReview = 'Need Review'; +$lang->story->batchReview = 'Mehere prüfen'; +$lang->story->edit = "Bearbeiten"; +$lang->story->batchEdit = "Mehere bearbeiten"; +$lang->story->subdivide = 'Aufteilen'; +$lang->story->subdivideAction = 'Decompose Story'; +$lang->story->splitRequirent = 'Decompose'; +$lang->story->close = 'Schließen'; +$lang->story->closeAction = 'Close Story'; +$lang->story->batchClose = 'Mehere schließen'; +$lang->story->activate = 'Aktivieren'; +$lang->story->activateAction = 'Activate Story'; +$lang->story->delete = "Löschen"; +$lang->story->deleteAction = "Delete Story"; +$lang->story->view = "Storydetails"; +$lang->story->setting = "Einstellungen"; +$lang->story->tasks = "Verknüpfte Aufgaben"; +$lang->story->bugs = "Verknüpfte Bugs"; +$lang->story->cases = "Verknüpfte Fälle"; +$lang->story->taskCount = 'Aufgaben'; +$lang->story->bugCount = 'Bugs'; +$lang->story->caseCount = 'Fälle'; +$lang->story->taskCountAB = 'T'; +$lang->story->bugCountAB = 'B'; +$lang->story->caseCountAB = 'C'; +$lang->story->linkStory = 'Verküpfen'; +$lang->story->unlinkStory = 'Verknüpfung aufheben'; +$lang->story->export = "Daten exportieren"; +$lang->story->exportAction = "Export Story"; +$lang->story->zeroCase = "Storys ohne Fälle"; +$lang->story->zeroTask = "Storys ohne Aufgaben anzeigen"; +$lang->story->reportChart = "Bericht"; +$lang->story->reportAction = "Story Report"; +$lang->story->copyTitle = "Titel kopieren"; $lang->story->batchChangePlan = "Mehere Pläne ändern"; $lang->story->batchChangeBranch = "Mehere Branches ändern"; $lang->story->batchChangeStage = "Mehere Phasen ändern"; $lang->story->batchAssignTo = "Mehere zuordnen"; $lang->story->batchChangeModule = "Mehere Module ändern"; $lang->story->viewAll = "Alle"; -$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; -$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->toTask = 'Convert to Task'; +$lang->story->batchToTask = 'Batch Convert to Task'; + +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task."; $lang->story->common = 'Story'; $lang->story->id = 'ID'; @@ -121,6 +125,7 @@ $lang->story->allStories = 'Alle'; $lang->story->unclosed = 'Nicht geschlossen'; $lang->story->deleted = 'Gelöscht'; $lang->story->released = 'Released Linked Stories'; +$lang->story->oneUnit = 'One Unit'; $lang->story->ditto = 'Dito'; $lang->story->dittoNotice = 'Die Story gehört nicht zum Projekt wie die vorherige!'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index feb8d866d7..fded17c3ad 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -9,57 +9,61 @@ * @version $Id: en.php 5141 2013-07-15 05:57:15Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->story->create = "Create Story"; -$lang->story->batchCreate = "Batch Create"; -$lang->story->change = "Change"; -$lang->story->changeAction = "Change Story"; -$lang->story->changed = 'Change'; -$lang->story->assignTo = 'Assign'; -$lang->story->assignAction = 'Assign Story'; -$lang->story->review = 'Review'; -$lang->story->reviewAction = 'Review Story'; -$lang->story->needReview = 'Need Review'; -$lang->story->batchReview = 'Batch Review'; -$lang->story->edit = "Edit Story"; -$lang->story->batchEdit = "Batch Edit"; -$lang->story->subdivide = 'Decompose'; -$lang->story->subdivideAction = 'Decompose Story'; -$lang->story->splitRequirent = 'Decompose'; -$lang->story->close = 'Close'; -$lang->story->closeAction = 'Close Story'; -$lang->story->batchClose = 'Batch Close'; -$lang->story->activate = 'Activate'; -$lang->story->activateAction = 'Activate Story'; -$lang->story->delete = "Delete"; -$lang->story->deleteAction = "Delete Story"; -$lang->story->view = "Story Detail"; -$lang->story->setting = "Settings"; -$lang->story->tasks = "Linked Tasks"; -$lang->story->bugs = "Linked Bugs"; -$lang->story->cases = "Linked Cases"; -$lang->story->taskCount = 'Tasks'; -$lang->story->bugCount = 'Bugs'; -$lang->story->caseCount = 'Cases'; -$lang->story->taskCountAB = 'T'; -$lang->story->bugCountAB = 'B'; -$lang->story->caseCountAB = 'C'; -$lang->story->linkStory = 'Link Story'; -$lang->story->unlinkStory = 'UnLinked'; -$lang->story->export = "Export Data"; -$lang->story->exportAction = "Export Story"; -$lang->story->zeroCase = "Stories without cases"; -$lang->story->zeroTask = "Only list stories without tasks"; -$lang->story->reportChart = "Report"; -$lang->story->reportAction = "Story Report"; -$lang->story->copyTitle = "Copy Title"; +$lang->story->create = "Create Story"; +$lang->story->batchCreate = "Batch Create"; +$lang->story->change = "Change"; +$lang->story->changeAction = "Change Story"; +$lang->story->changed = 'Change'; +$lang->story->assignTo = 'Assign'; +$lang->story->assignAction = 'Assign Story'; +$lang->story->review = 'Review'; +$lang->story->reviewAction = 'Review Story'; +$lang->story->needReview = 'Need Review'; +$lang->story->batchReview = 'Batch Review'; +$lang->story->edit = "Edit Story"; +$lang->story->batchEdit = "Batch Edit"; +$lang->story->subdivide = 'Decompose'; +$lang->story->subdivideAction = 'Decompose Story'; +$lang->story->splitRequirent = 'Decompose'; +$lang->story->close = 'Close'; +$lang->story->closeAction = 'Close Story'; +$lang->story->batchClose = 'Batch Close'; +$lang->story->activate = 'Activate'; +$lang->story->activateAction = 'Activate Story'; +$lang->story->delete = "Delete"; +$lang->story->deleteAction = "Delete Story"; +$lang->story->view = "Story Detail"; +$lang->story->setting = "Settings"; +$lang->story->tasks = "Linked Tasks"; +$lang->story->bugs = "Linked Bugs"; +$lang->story->cases = "Linked Cases"; +$lang->story->taskCount = 'Tasks'; +$lang->story->bugCount = 'Bugs'; +$lang->story->caseCount = 'Cases'; +$lang->story->taskCountAB = 'T'; +$lang->story->bugCountAB = 'B'; +$lang->story->caseCountAB = 'C'; +$lang->story->linkStory = 'Link Story'; +$lang->story->unlinkStory = 'UnLinked'; +$lang->story->export = "Export Data"; +$lang->story->exportAction = "Export Story"; +$lang->story->zeroCase = "Stories without cases"; +$lang->story->zeroTask = "Only list stories without tasks"; +$lang->story->reportChart = "Report"; +$lang->story->reportAction = "Story Report"; +$lang->story->copyTitle = "Copy Title"; $lang->story->batchChangePlan = "Batch Change Plans"; $lang->story->batchChangeBranch = "Batch Change Branches"; $lang->story->batchChangeStage = "Batch Change Phases"; $lang->story->batchAssignTo = "Batch Assign"; $lang->story->batchChangeModule = "Batch Change Modules"; $lang->story->viewAll = "See All"; -$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; -$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->toTask = 'Convert to Task'; +$lang->story->batchToTask = 'Batch Convert to Task'; + +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task."; $lang->story->common = 'Story'; $lang->story->id = 'ID'; @@ -121,6 +125,7 @@ $lang->story->allStories = 'All Stories'; $lang->story->unclosed = 'Unclosed'; $lang->story->deleted = 'Deleted'; $lang->story->released = 'Released Stories'; +$lang->story->oneUnit = 'One Unit'; $lang->story->ditto = 'Ditto'; $lang->story->dittoNotice = 'This story is not linked to the same product as the last one is!'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index c0983e3fa1..93cc8de481 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -9,57 +9,61 @@ * @version $Id: en.php 5141 2013-07-15 05:57:15Z chencongzhi520@gmail.com $ * @link https://www.zentao.pm */ -$lang->story->create = "Créer Story"; -$lang->story->batchCreate = "Créer par Lot"; -$lang->story->change = "Changer"; -$lang->story->changeAction = "Changer Story"; -$lang->story->changed = 'Changée'; -$lang->story->assignTo = 'Affecter'; -$lang->story->assignAction = 'Affecter Story'; -$lang->story->review = 'Valider'; -$lang->story->reviewAction = 'Valider Story'; -$lang->story->needReview = 'Validation requise'; -$lang->story->batchReview = 'Validation par lot'; -$lang->story->edit = "Editer Story"; -$lang->story->batchEdit = "Editer par Lot"; -$lang->story->subdivide = 'Décomposer'; -$lang->story->subdivideAction = 'Décomposer Story'; -$lang->story->splitRequirent = 'Décompose'; -$lang->story->close = 'Fermer'; -$lang->story->closeAction = 'Fermer Story'; -$lang->story->batchClose = 'Fermer par Lot'; -$lang->story->activate = 'Activer'; -$lang->story->activateAction = 'Activer Story'; -$lang->story->delete = "Supprimer"; -$lang->story->deleteAction = "Supprimer Story"; -$lang->story->view = "Détail Story"; -$lang->story->setting = "Paramétrage"; -$lang->story->tasks = "Tâches Associées"; -$lang->story->bugs = "Bugs Associés"; -$lang->story->cases = "CasTest Associés"; -$lang->story->taskCount = 'Tâches'; -$lang->story->bugCount = 'Bugs'; -$lang->story->caseCount = 'CasTests'; -$lang->story->taskCountAB = 'T'; -$lang->story->bugCountAB = 'B'; -$lang->story->caseCountAB = 'C'; -$lang->story->linkStory = 'Lier Story'; -$lang->story->unlinkStory = 'Dissocier'; -$lang->story->export = "Exporter Données"; -$lang->story->exportAction = "Exporter Story"; -$lang->story->zeroCase = "Stories sans CasTests"; -$lang->story->zeroTask = "Seulement liste des stories sans tâches"; -$lang->story->reportChart = "Rapport"; -$lang->story->reportAction = "Rapport de Story"; -$lang->story->copyTitle = "Copier Titre"; +$lang->story->create = "Créer Story"; +$lang->story->batchCreate = "Créer par Lot"; +$lang->story->change = "Changer"; +$lang->story->changeAction = "Changer Story"; +$lang->story->changed = 'Changée'; +$lang->story->assignTo = 'Affecter'; +$lang->story->assignAction = 'Affecter Story'; +$lang->story->review = 'Valider'; +$lang->story->reviewAction = 'Valider Story'; +$lang->story->needReview = 'Validation requise'; +$lang->story->batchReview = 'Validation par lot'; +$lang->story->edit = "Editer Story"; +$lang->story->batchEdit = "Editer par Lot"; +$lang->story->subdivide = 'Décomposer'; +$lang->story->subdivideAction = 'Décomposer Story'; +$lang->story->splitRequirent = 'Décompose'; +$lang->story->close = 'Fermer'; +$lang->story->closeAction = 'Fermer Story'; +$lang->story->batchClose = 'Fermer par Lot'; +$lang->story->activate = 'Activer'; +$lang->story->activateAction = 'Activer Story'; +$lang->story->delete = "Supprimer"; +$lang->story->deleteAction = "Supprimer Story"; +$lang->story->view = "Détail Story"; +$lang->story->setting = "Paramétrage"; +$lang->story->tasks = "Tâches Associées"; +$lang->story->bugs = "Bugs Associés"; +$lang->story->cases = "CasTest Associés"; +$lang->story->taskCount = 'Tâches'; +$lang->story->bugCount = 'Bugs'; +$lang->story->caseCount = 'CasTests'; +$lang->story->taskCountAB = 'T'; +$lang->story->bugCountAB = 'B'; +$lang->story->caseCountAB = 'C'; +$lang->story->linkStory = 'Lier Story'; +$lang->story->unlinkStory = 'Dissocier'; +$lang->story->export = "Exporter Données"; +$lang->story->exportAction = "Exporter Story"; +$lang->story->zeroCase = "Stories sans CasTests"; +$lang->story->zeroTask = "Seulement liste des stories sans tâches"; +$lang->story->reportChart = "Rapport"; +$lang->story->reportAction = "Rapport de Story"; +$lang->story->copyTitle = "Copier Titre"; $lang->story->batchChangePlan = "Changer Plans par lot"; $lang->story->batchChangeBranch = "Changer Branches par lot"; $lang->story->batchChangeStage = "Changer Phases par lot"; $lang->story->batchAssignTo = "Affecter par lot"; $lang->story->batchChangeModule = "Changer Modules par lot"; $lang->story->viewAll = "Voir Tout"; -$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; -$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->toTask = 'Convert to Task'; +$lang->story->batchToTask = 'Batch Convert to Task'; + +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task."; $lang->story->common = 'Story'; $lang->story->id = 'ID'; @@ -121,6 +125,7 @@ $lang->story->allStories = 'Toutes les Stories'; $lang->story->unclosed = 'Non Fermées'; $lang->story->deleted = 'Supprimée'; $lang->story->released = 'Stories Versionnées'; +$lang->story->oneUnit = 'One Unit'; $lang->story->ditto = 'Idem'; $lang->story->dittoNotice = "La story n'est pas associée au même product que la précédente !"; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index a3f3cd2435..b7ec77c79c 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -58,8 +58,12 @@ $lang->story->batchChangeStage = "Thay đổi giai đoạn hàng loạt"; $lang->story->batchAssignTo = "Bàn giao hàng loạt"; $lang->story->batchChangeModule = "Thay đổi Module hàng loạt"; $lang->story->viewAll = "Xem tất cả"; -$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; -$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->toTask = 'Convert to Task'; +$lang->story->batchToTask = 'Batch Convert to Task'; + +$lang->story->skipStory = '%s is a parent story. It cannot be closed.'; +$lang->story->closedStory = 'Story %s is closed and will not be closed.'; +$lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task."; $lang->story->common = 'Câu chuyện'; $lang->story->id = 'ID'; @@ -121,6 +125,7 @@ $lang->story->allStories = 'Tất cả câu chuyện'; $lang->story->unclosed = 'Chưa đóng'; $lang->story->deleted = 'Đã xóa'; $lang->story->released = 'Đã phát hành'; +$lang->story->oneUnit = 'One Unit'; $lang->story->ditto = 'Như trên'; $lang->story->dittoNotice = 'Câu chuyện này chưa liên kết tới cùng sản phẩm bởi bởi vì nó là cuối cùng!'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 3cb5bd631b..6ca2d9ec69 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -9,57 +9,61 @@ * @version $Id: zh-cn.php 5141 2013-07-15 05:57:15Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ -$lang->story->create = "提{$lang->storyCommon}"; -$lang->story->batchCreate = "批量创建"; -$lang->story->change = "变更"; -$lang->story->changeAction = "变更{$lang->storyCommon}"; -$lang->story->changed = "{$lang->storyCommon}变更"; -$lang->story->assignTo = '指派'; -$lang->story->assignAction = "指派{$lang->storyCommon}"; -$lang->story->review = '评审'; -$lang->story->reviewAction = "评审{$lang->storyCommon}"; -$lang->story->needReview = '需要评审'; -$lang->story->batchReview = '批量评审'; -$lang->story->edit = "编辑"; -$lang->story->batchEdit = "批量编辑"; -$lang->story->subdivide = '细分'; -$lang->story->subdivideAction = "细分{$lang->storyCommon}"; -$lang->story->splitRequirent = '拆分'; -$lang->story->close = '关闭'; -$lang->story->closeAction = "关闭{$lang->storyCommon}"; -$lang->story->batchClose = '批量关闭'; -$lang->story->activate = '激活'; -$lang->story->activateAction = "激活{$lang->storyCommon}"; -$lang->story->delete = "删除"; -$lang->story->deleteAction = "删除{$lang->storyCommon}"; -$lang->story->view = "{$lang->storyCommon}详情"; -$lang->story->setting = "设置"; -$lang->story->tasks = "相关任务"; -$lang->story->bugs = "相关Bug"; -$lang->story->cases = "相关用例"; -$lang->story->taskCount = '任务数'; -$lang->story->bugCount = 'Bug数'; -$lang->story->caseCount = '用例数'; -$lang->story->taskCountAB = 'T'; -$lang->story->bugCountAB = 'B'; -$lang->story->caseCountAB = 'C'; -$lang->story->linkStory = "关联{$lang->storyCommon}"; -$lang->story->unlinkStory = "移除相关{$lang->storyCommon}"; -$lang->story->export = "导出数据"; -$lang->story->exportAction = "导出{$lang->storyCommon}"; -$lang->story->zeroCase = "零用例{$lang->storyCommon}"; -$lang->story->zeroTask = "只列零任务{$lang->storyCommon}"; -$lang->story->reportChart = "统计报表"; -$lang->story->reportAction = "统计报表"; -$lang->story->copyTitle = "同{$lang->storyCommon}名称"; +$lang->story->create = "提{$lang->storyCommon}"; +$lang->story->batchCreate = "批量创建"; +$lang->story->change = "变更"; +$lang->story->changeAction = "变更{$lang->storyCommon}"; +$lang->story->changed = "{$lang->storyCommon}变更"; +$lang->story->assignTo = '指派'; +$lang->story->assignAction = "指派{$lang->storyCommon}"; +$lang->story->review = '评审'; +$lang->story->reviewAction = "评审{$lang->storyCommon}"; +$lang->story->needReview = '需要评审'; +$lang->story->batchReview = '批量评审'; +$lang->story->edit = "编辑"; +$lang->story->batchEdit = "批量编辑"; +$lang->story->subdivide = '细分'; +$lang->story->subdivideAction = "细分{$lang->storyCommon}"; +$lang->story->splitRequirent = '拆分'; +$lang->story->close = '关闭'; +$lang->story->closeAction = "关闭{$lang->storyCommon}"; +$lang->story->batchClose = '批量关闭'; +$lang->story->activate = '激活'; +$lang->story->activateAction = "激活{$lang->storyCommon}"; +$lang->story->delete = "删除"; +$lang->story->deleteAction = "删除{$lang->storyCommon}"; +$lang->story->view = "{$lang->storyCommon}详情"; +$lang->story->setting = "设置"; +$lang->story->tasks = "相关任务"; +$lang->story->bugs = "相关Bug"; +$lang->story->cases = "相关用例"; +$lang->story->taskCount = '任务数'; +$lang->story->bugCount = 'Bug数'; +$lang->story->caseCount = '用例数'; +$lang->story->taskCountAB = 'T'; +$lang->story->bugCountAB = 'B'; +$lang->story->caseCountAB = 'C'; +$lang->story->linkStory = "关联{$lang->storyCommon}"; +$lang->story->unlinkStory = "移除相关{$lang->storyCommon}"; +$lang->story->export = "导出数据"; +$lang->story->exportAction = "导出{$lang->storyCommon}"; +$lang->story->zeroCase = "零用例{$lang->storyCommon}"; +$lang->story->zeroTask = "只列零任务{$lang->storyCommon}"; +$lang->story->reportChart = "统计报表"; +$lang->story->reportAction = "统计报表"; +$lang->story->copyTitle = "同{$lang->storyCommon}名称"; $lang->story->batchChangePlan = "批量修改计划"; $lang->story->batchChangeBranch = "批量修改分支"; $lang->story->batchChangeStage = "批量修改阶段"; $lang->story->batchAssignTo = "批量指派"; $lang->story->batchChangeModule = "批量修改模块"; $lang->story->viewAll = '查看全部'; -$lang->story->skipStory = '需求:%s 为父需求,将不会被关闭。'; -$lang->story->closedStory = '需求:%s 已关闭,将不会被关闭。'; +$lang->story->toTask = '转任务'; +$lang->story->batchToTask = '批量转任务'; + +$lang->story->skipStory = '需求:%s 为父需求,将不会被关闭。'; +$lang->story->closedStory = '需求:%s 已关闭,将不会被关闭。'; +$lang->story->batchToTaskTips = "此操作会创建与所选{$lang->storyCommon}同名的任务,并将{$lang->storyCommon}关联到任务中"; $lang->story->common = $lang->storyCommon; $lang->story->id = '编号'; @@ -121,6 +125,7 @@ $lang->story->allStories = "所有{$lang->storyCommon}"; $lang->story->unclosed = '未关闭'; $lang->story->deleted = '已删除'; $lang->story->released = "已发布{$lang->storyCommon}数"; +$lang->story->oneUnit = '一个单位'; $lang->story->ditto = '同上'; $lang->story->dittoNotice = "该{$lang->storyCommon}与上一{$lang->storyCommon}不属于同一产品!"; diff --git a/module/story/model.php b/module/story/model.php index d3095bdb43..6f9f5534f8 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1412,6 +1412,51 @@ class storyModel extends model return $allChanges; } + /** + * Batch to task. + * + * @param int $projectID + * @access public + * @return bool + */ + public function batchToTask($projectID) + { + /* load Module and get the data from the post. */ + $this->loadModel('action'); + $data = fixer::input('post')->get(); + + /* Judge required. */ + $message = ''; + if(empty($data->type)) $message = sprintf($this->lang->error->notempty, $this->lang->task->type); + if(isset($data->hourPointValue) and empty($data->hourPointValue)) $message .= sprintf($this->lang->error->notempty, $this->lang->workingHour); + if($message) die(js::error($message) . js::locate(helper::createLink('project', 'story', "projectID=$projectID"), 'parent')); + + /* Create tasks. */ + $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($data->storyIdList)->fetchAll(); + foreach($stories as $story) + { + $task = new stdclass(); + $task->project = $projectID; + $task->name = $story->title; + $task->module = $story->module; + $task->story = $story->id; + $task->type = $data->type; + $task->pri = $story->pri; + $task->estimate = isset($data->hourPointValue) ? ($story->estimate * $data->hourPointValue) : $story->estimate; + $task->openedBy = $this->app->user->account; + $task->openedDate = helper::now(); + + $this->dao->insert(TABLE_TASK)->data($task) + ->autoCheck() + ->checkIF($task->estimate != '', 'estimate', 'float') + ->exec(); + + if(dao::isError()) return false; + $taskID = $this->dao->lastInsertID(); + $this->action->create('task', $taskID, 'Opened', ''); + } + } + /** * Assign story. * From 7e44e5b761e0b377fdaee3250efe51d335d95788 Mon Sep 17 00:00:00 2001 From: z Date: Thu, 12 Nov 2020 17:20:17 +0800 Subject: [PATCH 091/187] * code for story #8776. --- module/bug/model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/bug/model.php b/module/bug/model.php index 57fee78580..59543f9f1a 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -958,6 +958,7 @@ class bugModel extends model $bug->confirmed = 1; $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); + $this->executeHooks($bugID); } } @@ -1168,6 +1169,7 @@ class bugModel extends model $bug->lastEditedDate = $now; $this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bugID)->exec(); + $this->executeHooks($bugID); $changes[$bugID] = common::createChanges($oldBug, $bug); } From 9c0b8b1d22660973205a1a1a97fb59db6f5ff8aa Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 12 Nov 2020 21:38:08 +0800 Subject: [PATCH 092/187] * Finish task#8198. Fix bug. --- module/todo/model.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/module/todo/model.php b/module/todo/model.php index 230199ba65..37afdb24a5 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -537,7 +537,7 @@ class todoModel extends model $begin = $todo->config->begin; $end = $todo->config->end; $beforeDays = (int)$todo->config->beforeDays; - if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$begin -{$beforeDays} days")); + if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$today -{$beforeDays} days")); if($today < $begin or (!empty($end) && $today > $end)) continue; $newTodo = new stdclass(); @@ -570,8 +570,27 @@ class todoModel extends model $day = (int)$todo->config->day; if($day <= 0) continue; - if(empty($lastCycle)) $date = date('Y-m-d', strtotime("{$today} +" . $day . " days")); - if(!empty($lastCycle->date)) $date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days")); + if(empty($lastCycle)) + { + $todayTime = new DateTime($today); + $beginTime = new DateTime($todo->config->begin); + $interval = $todayTime->diff($beginTime)->days; + + if($interval != $day) continue; + + $date = $today; + } + + if(!empty($lastCycle->date)) + { + $todayTime = new DateTime($today); + $lastCycleTime = new DateTime($lastCycle->date); + $interval = $todayTime->diff($lastCycleTime)->days; + + if($interval != $day) continue; + + $date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days")); + } } if(isset($todo->config->appointDate)) { From 8a20821f92ff6c01a2e1332d9187b2f5a77f64cc Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 12 Nov 2020 17:10:47 +0800 Subject: [PATCH 093/187] * Adjust code style. --- module/story/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 6f9f5534f8..239025abb5 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1432,7 +1432,7 @@ class storyModel extends model if($message) die(js::error($message) . js::locate(helper::createLink('project', 'story', "projectID=$projectID"), 'parent')); /* Create tasks. */ - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($data->storyIdList)->fetchAll(); + $stories = $this->getByList($data->storyIdList); foreach($stories as $story) { $task = new stdclass(); @@ -1445,6 +1445,7 @@ class storyModel extends model $task->estimate = isset($data->hourPointValue) ? ($story->estimate * $data->hourPointValue) : $story->estimate; $task->openedBy = $this->app->user->account; $task->openedDate = helper::now(); + $task->desc = $story->spec; $this->dao->insert(TABLE_TASK)->data($task) ->autoCheck() From 583790a08e9eaf3f6a5f8e40c7e710e56fc73115 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 13 Nov 2020 09:08:04 +0800 Subject: [PATCH 094/187] * Finish task #8194. --- module/doc/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 67417d0e2e..4c0978103c 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -74,7 +74,7 @@ var browseType = '';

    doc->noDoc;?> - + createLink('doc', 'create', "libID={$libID}&moduleID=$moduleID"), " " . $lang->doc->create, '', "class='btn btn-info'");?> From ea9c93ba1ce907c220475fa8904c1ef52ebd3d36 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 13 Nov 2020 09:18:26 +0800 Subject: [PATCH 095/187] * Finish task #8194. --- module/doc/view/showfiles.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index 70c7d48be7..46eab0d8e8 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -79,7 +79,7 @@ id", '', "data-toggle='modal'", "class='btn' title={$lang->doc->download}", true, false, $file); - common::printLink('file', 'delete', "fileID=$file->id", '', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file); + if($changeAllowed) common::printLink('file', 'delete', "fileID=$file->id", '', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file); ?> From fb9c44d0a1269548f4b71ab60dcc97c67deb7b81 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 13 Nov 2020 11:28:25 +0800 Subject: [PATCH 096/187] * Finish task #8194. --- module/bug/model.php | 6 +++++- module/story/model.php | 10 ++++++---- module/task/model.php | 4 +++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 9f6c64d0a5..5783aed7f6 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1417,10 +1417,12 @@ class bugModel extends model * @param int $account * @param bool $appendProduct * @param int $limit + * @param array $skipProductIDList + * @param array $skipProjectIDList * @access public * @return array */ - public function getUserBugPairs($account, $appendProduct = true, $limit = 0) + public function getUserBugPairs($account, $appendProduct = true, $limit = 0, $skipProductIDList = array(), $skipProjectIDList = array()) { $bugs = array(); $stmt = $this->dao->select('t1.id, t1.title, t2.name as product') @@ -1429,6 +1431,8 @@ class bugModel extends model ->on('t1.product=t2.id') ->where('t1.assignedTo')->eq($account) ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in('0,' . $this->app->user->view->projects)->fi() + ->beginIF(!empty($skipProductIDList))->andWhere('t1.product')->notin($skipProductIDList)->fi() + ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('id desc') ->beginIF($limit > 0)->limit($limit)->fi() diff --git a/module/story/model.php b/module/story/model.php index 239025abb5..cc898f8a6d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2346,19 +2346,21 @@ class storyModel extends model /** * Get story pairs of a user. * - * @param string $account - * @param string $limit - * @param string $type requirement|story + * @param string $account + * @param string $limit + * @param string $type requirement|story + * @param array $skipProductIDList * @access public * @return array */ - public function getUserStoryPairs($account, $limit = 10, $type = 'story') + public function getUserStoryPairs($account, $limit = 10, $type = 'story', $skipProductIDList = array()) { return $this->dao->select('id, title') ->from(TABLE_STORY) ->where('deleted')->eq(0) ->andWhere('type')->eq($type) ->andWhere('assignedTo')->eq($account) + ->beginIF(!empty($skipProductIDList))->andWhere('product')->notin($skipProductIDList)->fi() ->orderBy('id_desc') ->limit($limit) ->fetchPairs('id', 'title'); diff --git a/module/task/model.php b/module/task/model.php index fc9cd43c3a..540b892574 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1995,10 +1995,11 @@ class taskModel extends model * * @param string $account * @param string $status + * @param array $skipProjectIDList * @access public * @return array */ - public function getUserTaskPairs($account, $status = 'all') + public function getUserTaskPairs($account, $status = 'all', $skipProjectIDList = array()) { $stmt = $this->dao->select('t1.id, t1.name, t2.name as project') ->from(TABLE_TASK)->alias('t1') @@ -2006,6 +2007,7 @@ class taskModel extends model ->where('t1.assignedTo')->eq($account) ->andWhere('t1.deleted')->eq(0) ->beginIF($status != 'all')->andWhere('t1.status')->in($status)->fi() + ->beginIF(!empty($skipProjectIDList))->andWhere('t1.project')->notin($skipProjectIDList)->fi() ->query(); $tasks = array(); From 7d18efad0327d58add745dfbacb05451346ad2e7 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 13 Nov 2020 13:11:10 +0800 Subject: [PATCH 097/187] * Adjust code style. --- module/project/view/story.html.php | 8 ++++++-- module/story/control.php | 2 +- module/story/lang/de.php | 11 ++++++++++- module/story/lang/en.php | 11 ++++++++++- module/story/lang/fr.php | 9 +++++++++ module/story/lang/vi.php | 9 +++++++++ module/story/lang/zh-cn.php | 11 ++++++++++- module/story/model.php | 23 ++++++++++++++++++----- 8 files changed, 73 insertions(+), 11 deletions(-) diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 40811dea4c..c82b588374 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -310,7 +310,7 @@

    ',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,h=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(h,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var c=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;h="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(h,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,c=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:40}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()});var d=function(){var e,i,n=t(this),o=t.extend({limitSize:40,suffix:"…"},n.data()),a=n.text();if(a.length>o.limitSize){e=a,i=a.substr(0,o.limitSize)+o.suffix,n.text(i).addClass("limit-text-on");var s=o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle");s.text(s.data("textExpand")),s.on("click",function(){var t=n.toggleClass("limit-text-on").hasClass("limit-text-on");n.text(t?i:e),s.text(s.data(t?"textExpand":"textCollapse"))})}else(o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle")).hide()};t.fn.textLimit=function(){return this.each(d)},t(function(){t(".text-limit").textLimit()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
    ").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var u,p,f,g,m,v=function(){u||(u=t("#subNavbar"),p=t("#pageNav"),f=t("#pageActions"),g=u.children(".nav"),m=g.outerWidth());var e=u.outerWidth(),i=p.outerWidth()||0,n=f.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void g.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,m),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),T()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])});var S=function(){var e,i="en"==config.clientLang?"//www.zentao.pm/book/zentaomanual/8.html?fullScreen=zentao":"ja"==config.clientLang?"//www.zentao.jp/book/zentaomanual/8.html?fullScreen=zentao":"//www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao",n=t("#navbar > .nav").first(),o=1e4,a=function(){clearTimeout(e),t("#helpContent").removeClass("show-error")},s=t.openHelp=function(s){s=s||i,a(),n.children("li.active:not(#helpMenuItem)").removeClass("active").addClass("close-help-tab"),t("#helpMenuItem").addClass("active");var r=t("#helpContent");if(r.length){if(t("body").hasClass("show-help-tab"))return void t("#helpIframe").get(0).contentWindow.location.replace(s)}else{r=t('

    '+lang.timeout+'

    '+s+'

    '),t("#header").after(r);var l=t("#helpIframe").get(0);e=setTimeout(function(){t("#helpContent").addClass("show-error")},o),l.onload=l.onreadystatechange=function(){this.readyState&&"complete"!=this.readyState||a()}}t("body").addClass("show-help-tab")},r=t.closeHelp=function(){t("body").removeClass("show-help-tab"),t("#helpMenuItem").removeClass("active"),n.find("li.close-help-tab").removeClass("close-help-tab").addClass("active").find("a").focus()};t(document).on("click",".open-help-tab",function(e){var i=t(this),o=t("#helpMenuItem");o.length||(o=t('
  • '+i.text()+'
  • '),n.append('
  • ').append(o)),s(i.attr("href")),e.preventDefault()}).on("click",".close-help-tab",function(t){r(),t.stopPropagation(),t.preventDefault()})};t(S),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var D=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(D)},t(function(){t("textarea.autosize").each(D),t(document).on("input paste change","textarea.autosize",D)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var M="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=M,t("html").toggleClass("is-firefox",M).toggleClass("not-firefox",!M),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
    ').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){const r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var t=270,i=e.getBoundingClientRect();i.top<0&&(t=Math.min(270,i.height)+i.top),e.style.maxHeight=Math.min(270,t)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file +function(t){function e(e){if("string"==typeof e.data){var i=e.handler,n=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,h=n.length;l","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var n;return Array.isArray(e)&&(n={},t.each(e,function(e,i){t.isPlainObject(i)?n[i.action]=i:n[i]=!0}),e=n),t.isPlainObject(e)&&(n={},t.each(e,function(e,i){i?n[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):n[e]=!1}),e=n),i?t.extend(!0,{},i,e):e}function i(e,i,n){return i=i||e.type,t(n||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var n="zui.tree",o=0,a=function(e,i){this.name=n,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:''},add:{template:''},edit:{template:''},"delete":{template:''}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},a.prototype.add=function(e,i,n,o,a){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t("
      "),r.append(s),this._initList(s,r))):s=r,s){var h=this;Array.isArray(i)||(i=[i]),t.each(i,function(e,i){var n=t("
    • ").data(i).appendTo(s);void 0!==i.id&&n.attr("data-id",i.id);var o=l.itemWrapper?t(l.itemWrapper===!0?'
    • ').append(i(h.add,"add",h.add.templateInList)).appendTo(n)}h.sort&&n.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:h.sort,$list:n,target:t.target,item:s})}},h.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}o&&(o.hasClass("open")||s&&s.open)&&o.addClass("open in")},a.prototype._initItem=function(n,o,a,s){if(void 0===o){var r=n.prev("li");o=r.length?r.data("idx")+1:1}if(a=a||n.closest("ul"),n.attr("data-idx",o).removeClass("tree-single-item"),!n.data("id")){var l=o;a.hasClass("tree")||(l=a.parent("li").data("id")+"-"+l),n.attr("data-id",l)}n.hasClass("active")&&a.parent("li").addClass("has-active-item"),s=s||n.data();var h=e(s.actions,this.actions);if(h){var c=n.find(".tree-actions");c.length||(c=t('
      ').appendTo(this.options.itemWrapper?n.find(".tree-item-wrapper"):n),t.each(h,function(t,e){e&&c.append(i(e,t))}))}var d=n.children("ul");d.length&&this._initList(d,n,o,s)},a.prototype._init=function(){var i=this.options,a=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var s=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=n+"::"+(i.name||"")+"#"+(this.$.attr("id")||o++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===s&&(r?this.isPreserve=!0:this.options.initialState=s="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===s?this.expand():"collapse"===s?this.collapse():"active"===s&&this.expandSelect(".active"),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),n=i.parent("li");a.callEvent("hit",{target:n,item:n.data()}),a.toggle(n),i.is("a")&&e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),"sort"!==i.type){var n=e.closest("li:not(.tree-action-item)");a.callEvent("action",{action:i,target:this,$item:n,item:n.data()})}})},a.prototype.preserve=function(e,i,n){if(this.isPreserve)if(e)i=i||e.data("id"),n=void 0===n&&e.hasClass("open"),n?this.store[i]=n:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var o=this;this.store={},this.$.find("li").each(function(){o.preserve(t(this))})}},a.prototype.expandSelect=function(t){this.show(t,!0)},a.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},a.prototype.show=function(e,i,n){var o=this;e instanceof t||(e=o.$.find("li").filter(e)),e.each(function(){var e=t(this);if(o.expand(e,i,n),e)for(var a=e.parent("ul");a&&a.length&&!a.hasClass("tree");){var s=a.parent("li");s.length?(o.expand(s,i,n),a=s.parent("ul")):a=!1}})},a.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),this.callEvent("collapse",t,this)},a.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},a.prototype.getOptions=function(e){this.options=t.extend({},a.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},a.prototype.toData=function(e,i){"function"==typeof e&&(i=e,e=null),e=e||this.$;var n=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),o=e.data();delete o["zui.droppable"];var a=e.children("ul");return a.length&&(o.children=n.toData(a)),"function"==typeof i?i(o,e):o}).get()},a.prototype.callEvent=function(e,i){var n;return"function"==typeof this.options[e]&&(n=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),n},t.fn.tree=function(e,i){return this.each(function(){var o=t(this),s=o.data(n),r="object"==typeof e&&e;s||o.data(n,s=new a(this,r)),"string"==typeof e&&s[e](i)})},t.fn.tree.Constructor=a,t(function(){t('[data-ride="tree"]').tree()})}(jQuery),function(t){"use strict";var e="zui.colorPicker",i='
      ',n={zh_cn:{errorTip:"不是有效的颜色值"},zh_tw:{errorTip:"不是有效的顏色值"},en:{errorTip:"Not a valid color value"}},o=function(i,n){this.name=e,this.$=t(i),this.getOptions(n),this.init()};o.prototype.init=function(){var e=this,n=e.options,o=e.$,a=o.parent(),s=!1;a.hasClass("colorpicker")?e.$picker=a:(e.$picker=t(n.template||i),s=!0),e.$picker.addClass(n.wrapper).find(".cp-title").toggle(void 0!==n.title).text(n.title),e.$menu=e.$picker.find(".dropdown-menu").toggleClass("pull-right",n.pullMenuRight),e.$btn=e.$picker.find(".btn.dropdown-toggle"),e.$btn.find(".ic").addClass("icon-"+n.icon),n.btnTip&&e.$picker.attr("data-toggle","tooltip").tooltip({title:n.btnTip,placement:n.tooltip,container:"body"}),o.attr("data-provide",null),s&&o.after(e.$picker),e.colors={},t.each(n.colors,function(i,n){if(t.zui.Color.isColor(n)){var o=new t.zui.Color(n);e.colors[o.toCssStr()]=o}}),e.updateColors(),e.$picker.on("click",".cp-tile",function(){e.setValue(t(this).data("color"))});var r=function(){var i=o.val(),a=t.zui.Color.isColor(i);o.parent().toggleClass("has-error",!(a||n.optional&&""===i)),a?e.setValue(i,!0):n.optional&&""===i?o.tooltip("hide"):o.is(":focus")||o.tooltip("show",n.errorTip)};o.is("input:not([type=hidden])")?(n.tooltip&&o.attr("data-toggle","tooltip").tooltip({trigger:"manual",placement:n.tooltip,tipClass:"tooltip-danger",container:"body"}),o.on("keyup paste input change",r)):o.appendTo(e.$picker),r()},o.prototype.addColor=function(e){e instanceof t.zui.Color||(e=new t.zui.Color(e));var i=e.toCssStr(),n=this.options;this.colors[i]||(this.colors[i]=e);var o=t('
      ',{titile:e}).data("color",e).css({color:e.contrast().toCssStr(),background:i,"border-color":e.luma()>.43?"#ccc":"transparent"}).attr("data-color",i);this.$menu.append(t("
    • ").css({width:n.tileSize,height:n.tileSize}).append(o)),n.optional&&this.$menu.find(".cp-tile.empty").parent().detach().appendTo(this.$menu)},o.prototype.updateColors=function(e){var i=this.$menu,n=this.options,e=e||this.colors,o=this,a=0;if(i.children("li:not(.heading)").remove(),t.each(e,function(t,e){o.addColor(e),a++}),n.optional){var s=t('
    • ').css({width:n.tileSize,height:n.tileSize});this.$menu.append(s),a++}i.css("width",Math.min(a,n.lineCount)*n.tileSize+6)},o.prototype.setValue=function(e,i){var n=this,o=n.options,a=n.$btn,s="";n.$menu.find(".cp-tile.active").removeClass("active");var r=o.updateBtn;if("auto"===r){var l=a.find(".color-bar");r=!l.length||function(t){l.css("background",t||"")}}if(e){var h=new t.zui.Color(e);s=h.toCssStr().toLowerCase(),r&&("function"==typeof r?r(s,a,n):a.css({background:s,color:h.contrast().toCssStr(),borderColor:h.luma()>.43?"#ccc":s})),n.colors[s]||n.addColor(h),i||n.$.val().toLowerCase()===s||n.$.val(s).trigger("change"),n.$menu.find('.cp-tile[data-color="'+s+'"]').addClass("active"),n.$.tooltip("hide"),n.$.trigger("colorchange",h)}else r&&("function"==typeof r?r(null,a,n):a.attr("style",null)),i||""===n.$.val()||n.$.val(s).trigger("change"),o.optional&&n.$.tooltip("hide"),n.$menu.find(".cp-tile.empty").addClass("active"),n.$.trigger("colorchange",null);o.updateBorder&&t(o.updateBorder).css("border-color",s),o.updateBackground&&t(o.updateBackground).css("background-color",s),o.updateColor&&t(o.updateColor).css("color",s),o.updateText&&t(o.updateText).text(s)},o.prototype.getOptions=function(i){var a=t.extend({},o.DEFAULTS,this.$.data(),i);"string"==typeof a.colors&&(a.colors=a.colors.split(","));var s=a.lang||t.zui.clientLang(),r=this.lang=t.zui.getLangData?t.zui.getLangData(e,s,n):n[s]||n.en;a.errorTip||(a.errorTip=r.errorTip),t.fn.tooltip||(a.btnTip=!1),this.options=a},o.DEFAULTS={colors:["#00BCD4","#388E3C","#3280fc","#3F51B5","#9C27B0","#795548","#F57C00","#F44336","#E91E63"],pullMenuRight:!0,wrapper:"btn-wrapper",tileSize:30,lineCount:5,optional:!0,tooltip:"top",icon:"caret-down",updateBtn:"auto"},o.LANG=n,t.fn.colorPicker=function(e){return this.each(function(){var i=t(this),n=i.data(name),a="object"==typeof e&&e;n||i.data(name,n=new o(this,a)),"string"==typeof e&&n[e]()})},t.fn.colorPicker.Constructor=o,t(function(){t('[data-provide="colorpicker"]').colorPicker()})}(jQuery),function(t,e){function i(t){return t===e&&(t=o+=1),a[t%a.length]}function n(e,i){var n=t(e);i=t.extend({percent:0,size:20,backColor:"#eee",color:"#00da88",borderColor:"#ccc",borderSize:1,rotate:-90},n.data(),i);var o=i.percent,a=i.size;"string"==typeof o&&(o=Number.parseFloat(o,10)),"string"==typeof a&&(a=Number.parseFloat(a,10)),a=Math.floor(a);var s=a/2,r=3.14*s,l="http://www.w3.org/2000/svg",h=document.createElementNS(l,"svg"),c=document.createElementNS(l,"circle"),d=document.createElementNS(l,"circle");d.setAttribute("r",s),d.setAttribute("cx",s),d.setAttribute("cy",s),d.setAttribute("fill",i.backColor),d.setAttribute("stroke",i.borderColor),d.setAttribute("stroke-width",i.borderSize),c.setAttribute("r",s/2),c.setAttribute("cx",s),c.setAttribute("cy",s),c.setAttribute("fill","transparent"),c.setAttribute("stroke-dasharray",(o*r/100).toFixed(1)+" "+r),c.setAttribute("stroke-width",s),c.setAttribute("stroke",i.color),c.setAttribute("transform","rotate(-90) translate(-"+a+")"),h.setAttribute("viewBox","0 0 "+a+" "+a),h.setAttribute("width",a),h.setAttribute("height",a),h.setAttribute("transform","rotate(180)"),h.appendChild(d),h.appendChild(c),n[0].appendChild(h);var u={width:a,height:a};"inline"===n.css("display")&&(u.display="inline-block",u.verticalAlign="middle"),n.css(u)}var o=0,a=["#00a9fc","#ff5d5d","#fdc137","#00da88","#7ec5ff","#8666b8","#bd7b46","#ff9100","#ff3d00","#f57f17","#00e5ff","#00b0ff","#2979ff","#3d5afe","#651fff","#d500f9","#f50057","#ff1744"];jQuery.fn.tableChart=function(){t(this).each(function(){var e=t(this),n=e.data(),o=n.chart||"pie",a=t(n.target);if(a.length){var s=null;if("pie"===o){n=t.extend({scaleShowLabels:!0,scaleLabel:"<%=label%>: <%=value%>"},n);var r=[],l=e.find("tbody > tr").each(function(e){var n=t(this),o=i();n.attr("data-id",e).find(".chart-color-dot").css("background",o),r.push({label:n.find(".chart-label").text(),value:parseFloat(n.data("value")||n.find(".chart-value").text()),color:o,id:e})});r.length>1?n.scaleLabelPlacement="outside":1===r.length&&(n.scaleLabelPlacement="inside",r.push({label:"",value:r[0].value/2e3,color:"#fff",showLabel:!1})),s=a.pieChart(r,n),a.on("mousemove",function(t){var e=s.getSegmentsAtEvent(t);l.removeClass("active"),e.length&&l.filter('[data-id="'+e[0].id+'"]').addClass("active")})}else if("bar"===o){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(i.data("value")||parseFloat(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(n.barValueSpacing=5),s=a.barChart(r,n)}else if("line"===o){var h=i(),c=[],d={label:e.find("thead .chart-label").text(),color:h,data:[]},l=e.find("tbody > tr").each(function(e){var i=t(this);c.push(i.find(".chart-label").text()),d.data.push(parseInt(i.find(".chart-value").text())),i.find(".chart-color-dot").css("background",h)}),r={labels:c,datasets:[d]};c.length&&(n.barValueSpacing=5),s=a.lineChart(r,n)}null!==s&&e.data("zui.chart",s)}})},t(".table-chart").tableChart();var s=function(i,n){var o=t(i);if(!o.data("pieChart")){var a=o.is("canvas")?o:o.find("canvas"),s=t.extend({value:0,color:t.getThemeColor("primary")||"#006af1",backColor:t.getThemeColor("pale")||"#E9F2FB",doughnut:!0,doughnutSize:85,width:20,height:20,showTip:!1,name:"",tipTemplate:"<%=value%>%",animation:"auto",realValue:parseFloat(o.find(".progress-value").text())},n,o.data()),r=a.length;r||(a=t("").appendTo(o)),a.attr("width")!==e?s.width=a.attr("width"):a.attr("width",s.width),a.attr("height")!==e?s.height=a.attr("height"):a.attr("height",s.height),r||8!=t.zui.browser.ie||G_vmlCanvasManager.initElement(a[0]),"auto"===s.animation&&(s.animation=s.width>30),s.value=Math.max(0,Math.min(100,s.value)),o.addClass("progress-pie-"+s.width);var l=[{value:s.value,label:s.name,color:s.color,circleBeginEnd:!0},{value:100-s.value,label:"",color:s.backColor}],h=a[s.doughnut?"doughnutChart":"pieChart"](l,t.extend({segmentShowStroke:!1,animation:s.animation,showTooltips:s.showTip,tooltipTemplate:s.tipTemplate,percentageInnerCutout:s.doughnutSize,reverseDrawOrder:!0,animationEasing:"easeInOutQuart",onAnimationProgress:s.realValue?function(t){o.find(".progress-value").text(Math.floor(s.realValue*t))}:e,onAnimationComplete:s.realValue?function(t){o.find(".progress-value").text(s.realValue)}:e},s.chartOptions));o.data("pieChart",h)}};jQuery.fn.progressPie=function(e){t(this).each(function(){var i=t(this);if(!i.closest(".hidden").length){var n=i.closest(".tab-pane");n.length&&!n.hasClass("active")?t('[data-toggle="tab"][data-target="#'+n.attr("id")+'"]').one("shown.zui.tab",function(){s(i,e)}):s(this,e)}})},jQuery.fn.pieIcon=function(e){t(this).each(function(){n(this,e)})},t(function(){t(".table-chart").tableChart();var e=t(".progress-pie");e.length>100?setTimeout(function(){e.progressPie()},1e3):e.progressPie(),t(".pie-icon").pieIcon()})}(jQuery,void 0),function(t){jQuery.fn.sparkline=function(e){t(this).each(function(){var i=t(this),n=t.extend({values:i.attr("values"),width:i.width()-4,height:i.height()-4},i.data(),e),o=n.height,a=[],s=n.width,r=n.values.split(","),l=0;for(var h in r){var c=parseFloat(r[h]);NaN!=c&&(a.push(c),l=Math.max(c,l))}var d=(Math.min(l,30),Math.min(s,Math.max(10,a.length*s/30))),u=i.children("canvas");u.length||(i.append(''),u=i.children("canvas")),u.attr("width",d).attr("height",o);var f={labels:a,datasets:[{fillColor:t.getThemeColor("pale")||"rgba(0,0,255,0.05)",strokeColor:t.getThemeColor("primary")||"#0054EC",pointColor:t.getThemeColor("secondary")||"rgba(255,136,0,1)",pointStrokeColor:"#fff",data:a}]},p={animation:!0,scaleOverride:!0,scaleStepWidth:Math.ceil(l/10),scaleSteps:10,scaleStartValue:0,showScale:!1,showTooltips:!1,pointDot:!1,scaleShowGridLines:!1,datasetStrokeWidth:1},g=t(u).lineChart(f,p);i.data("sparklineChart",g)})},t(function(){t(".sparkline").sparkline()})}(jQuery),function(t){t.fn.fixedDate=function(){return t(this).each(function(){var e=t(this).attr("autocomplete","off");"0000-00-00"==e.val()&&e.focus(function(){"0000-00-00"==e.val()&&e.val("").datetimepicker("update")}).blur(function(){""==e.val()&&e.val("0000-00-00")})})},window.datepickerOptions={language:t("html").attr("lang"),weekStart:1,todayBtn:1,autoclose:1,todayHighlight:1,startView:2,forceParse:0,showMeridian:1,format:"yyyy-mm-dd hh:ii",startDate:"1970-1-1"},t.extend(t.fn.datetimepicker.defaults,window.datepickerOptions),t(function(){var e={minView:2,format:"yyyy-mm-dd"},i={eleClass:"only-pick-time",startView:1,minView:0,maxView:1,format:"hh:ii"},n={minView:3,startView:3,format:"yyyy-mm"};t(".datepicker-wrapper").click(function(){t(this).find(".form-date, .form-datetime, .form-time, .form-month").datetimepicker("show").focus()}),t.fn.datepicker=function(i){return this.datetimepicker(t.extend({},e,i))},t.fn.timepicker=function(e){return this.datetimepicker(t.extend({},i,e))},t.fn.monthpicker=function(e){return this.datetimepicker(t.extend({},n,e))},t.fn.datepickerAll=function(){return this.find(".form-datetime").fixedDate().datetimepicker(),this.find(".form-date").fixedDate().datepicker(),this.find(".form-time").fixedDate().timepicker(),this.find(".form-month").fixedDate().monthpicker(),this},t("body").datepickerAll()})}(jQuery),function(t){var e=function(e,i){i=t.extend({idStart:0,idEnd:9,chosen:!0,datetimepicker:!0,colorPicker:!0,hotkeys:!0},i,e.data());var n=e.find(".template");!n.length&&i.template&&(n=t(i.template));var o=0,a=0,s=function(t){t.is("select.chosen")?t.next(".chosen-container").find("input").focus():t.focus()},r=function(t){var i=e.find("[data-ctrl-index]:focus,.chosen-container-active").first();if(i.length){if(i.is(".chosen-container-active")){if(i.hasClass("chosen-with-drop")&&("down"===t||"up"===t))return;i=i.prev("select.chosen")}var n=i.data("ctrlIndex"),r=i.closest("tr").data("row");"down"===t?r0?r-=1:r=a-1:"left"===t?n>0?n-=1:n=o-1:"right"===t&&(n").html(s);return r.attr("data-row",e).addClass(n.attr("class")).removeClass("template"),i.rowCreator&&i.rowCreator(r,e,i),o?o.after(r):h.append(r),c(r),r};t.extend(l,{createRow:u,template:d});for(var f=i.idStart;f<=i.idEnd;++f)u(f)}else c(e);e.on("click",".btn-copy",function(){var e=t(this),i=t(e.data("copyFrom")).val(),n=t(e.data("copyTo")).val(i).addClass("highlight");setTimeout(function(){n.removeClass("highlight")},2e3)}),i.hotkeys&&t(document).on("keydown",function(t){var e={"Ctrl+#37":"left","Ctrl+#39":"right","#38":"up","#40":"down","Ctrl+#38":"up","Ctrl+#40":"down"},i=[];t.ctrlKey&&i.push("Ctrl"),i.push("#"+t.keyCode);var n=e[i.join("+")];n&&(r(n),t.ctrlKey&&(t.stopPropagation(),t.preventDefault()))}),e.data("zui.batchActionForm",l),setTimeout(t.fixTableResponsive,0)};t.fn.batchActionForm=function(i){return this.each(function(){e(t(this),i)})}}(jQuery),function(t,e){"use strict";var i="zui.table",n={zh_cn:{selectedItems:"已选择 {0} 项",attrTotal:"{0}总计 {1}"},zh_tw:{selectedItems:"已选择 {0} 项",attrTotal:"{0}总计 {1}"},en:{selectedItems:"Seleted {0} items",attrTotal:"{0} total {1}"},de:{selectedItems:"{0} ausgewählt",attrTotal:"{0} insgesamt {1}"},fr:{selectedItems:"{0} sélectionnés",attrTotal:"{0} total {1}"}},o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),a=t.zui.browser.isIE(),s=a?200:100,r=function(e,o){var a=this;a.name=i;var s=a.$=t(e);o=a.options=t.extend({},r.DEFAULTS,this.$.data(),o),a.langName=o.lang||t.zui.clientLang(),a.lang=t.zui.getLangData(i,a.langName,n),a.id=s.attr("id"),a.id||(a.id=o.id||"table-"+t.zui.uuid(),a.noID=!0,s.attr("id",a.id),o.hot&&console.warn("ZUI: table hot replace id not defined, the element id attribute should be set.")),s.attr("data-ride")||s.attr("data-ride","table");var l=a.getTable();if(l.length){l.find("thead>tr>th").each(function(){var e=t(this);if(!e.attr("title")){var i=t.trim(e.find("a:first").text()||e.text()||"");i.length&&e.attr("title",i)}}),o.nested&&a.initNestedList(),o.checkable&&(s.on("click",".check-all",function(){a.checkAll(!t(this).hasClass("checked"))}),o.checkOnClickRow&&s.on("click","tbody>tr",function(e){t(e.target).closest('.btn,a,.not-check,.form-control,input[type="text"],.chosen-container').length||a.checkRow(t(this))}),s.on("click",'tbody input[type="checkbox"],tbody label[for]',function(e){e.stopPropagation();var i=t(this);i.is("label")&&(i=i.closest(".checkbox-primary").find('input[type="checkbox"]')),a.checkRow(i.closest("tr"),i.is(":checked"))}),o.selectable&&s.selectable(t.extend({},{selector:a.isDataTable?".fixed-left tbody>tr":"tbody>tr",selectClass:"",trigger:".c-id",clickBehavior:"multi",listenClick:!1,start:function(){this.syncSelectionsFromClass()},select:function(e){a.checkRow(e.target,!0),t.cookie("ajax_dragSelected")||(t.cookie("ajax_dragSelected","on",{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("dragSelected"))},unselect:function(t){a.checkRow(t.target,!1)},rangeStyle:{border:"1px solid #006af1",backgroundColor:"rgba(50,128,252,0.2)",borderRadius:"2px"}},t.isPlainObject(o.selectable)?o.selectable:null)));var h=a.$form=s.is("form")?s:s.find("form");h.length&&(o.ajaxForm?h.ajaxForm(t.isPlainObject(o.ajaxForm)?o.ajaxForm:null):h.on("click","[data-form-action]",function(){h.attr("action",t(this).data("formAction")).submit()})),(o.fixFooter||o.fixHeader)&&(a.pageFooterHeight=t("#footer").outerHeight(),a.updateFixUI(!0),t(window).on("scroll resize",function(){a.updateFixUI()}).on("sidebar.toggle",function(){setTimeout(function(){a.updateFixUI()},200)})),o.group&&(s.on("click",".group-toggle",function(){a.toggleRowGroup(t(this).closest("tr").data("id"))}),t(document).on("click",".group-collapse-all",function(){a.toggleGroups(!1)}).on("click",".group-expand-all",function(){a.toggleGroups(!0)})),a.defaultStatistic=s.find(".table-statistic").html(),a.updateStatistic(),a.initModals(),a.checkItems={},a.updateCheckUI()}};r.prototype.initNestedList=function(){var e=this,i=e.getTable().addClass("table-nested"),n=i.find("tbody"),o=n.children("tr[data-id]"),a={},s=[],r=e.options.preserveNested;o.each(function(e){var i=t(this),n=i.data();n.realOrder=e,n.$row=i,n.nestPath?(n.nestPathList=n.nestPath.split(","),n.nestPathList[0]||n.nestPathList.shift(),n.nestPathList[n.nestPathList.length-1]||n.nestPathList.pop(),n.nestPathLevel=n.nestPathList.length,i.attr("data-level",n.nestPathLevel)):(n.nestPath=","+n.id+",",n.nestPathList=[n.id],n.nestPathLevel=1),a[n.id]=n,s.push(n)});var l=[];t.each(s,function(t,i){return i.nestParent&&(i.parent=a[i.nestParent],i.parent)?(i.parent.children?i.parent.children.push(i):i.parent.children=[i],void(e.options.expandNestChild||e._initedNestedList||(i.$row.addClass("table-nest-hide"),i.parent.$row.addClass("table-nest-child-hide")))):(i.$row.removeClass("table-nest-hide"),void l.push(i))}),e.nestRowsMap=a,e.$nestBody=n;var h=function(i){for(var o=0;o').prependTo(s)),r.toggleClass("table-nest-toggle",!!a.children).css("marginLeft",(a.nestPathLevel-1)*e.options.nestLevelIndent),delete a.$row}};if(h(l),e.nestConfigStoreName="/"+window.config.currentModule+"/"+window.config.currentMethod+"/table."+e.id+".nestConfig",e.nestConfig=r?t.zui.store.get(e.nestConfigStoreName,{}):{},r)for(var c=0;c");i.$.addClass("load-indicator loading"),s.load(window.location.href+" #"+o,function(r){if(a===o)i.$.empty().html(s.children().html()),i.$.find('[data-ride="pager"]').pager();else{i.$.find("#"+o).empty().html(s.children().html());try{var l=t(r),h=l.find("#"+o).closest('[data-ride="table"],#'+a);if(h.length){var c=h.find(".table-statistic");c.length&&(i.defaultStatistic=c.html());var d=i.$.find('[data-ride="pager"]').data("zui.pager"),u=h.find('[data-ride="pager"]');d&&u.length&&d.set(u.data())}}catch(f){console.error(f)}}i.$.removeClass("load-indicator loading").trigger("beforeTableReload"),delete i.defaultStatistic,i.updateStatistic(),i.initModals(),i.$.datepickerAll();var p=i.$.find("tbody>tr"),g=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(p.filter('[data-id="'+t+'"]'),!0,!0),g=!0)}),g&&i.updateCheckUI(),i.$.trigger("tableReload");var m=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");if(m.length){var u=i.$.find(".pager[data-rec-total]"),v=u.length?u.attr("data-rec-total"):i.getTable().find("tbody:first>tr:not(.table-children)").length;m.text(v)}e&&e(),n.afterReload&&n.afterReload()})},r.prototype.initModals=function(){var e=this,i=e.options,n=e.$.find(i.iframeModalTrigger);if(n.length){var o={type:"iframe",onHide:i.replaceId?function(){var n=t.cookie("selfClose");(1==n||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};n.modalTrigger(o)}},r.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e=t.find("div.datatable")),e},r.prototype.toggleGroups=function(e){var i=this,n={};i.$.find("tbody>tr").each(function(){var o=t(this).closest("tr").data("id");n[o]||i.toggleRowGroup(o,e)})},r.prototype.toggleRowGroup=function(i,n){var o=this.$.find('tbody>tr[data-id="'+i+'"]'),a=o.filter(".group-summary"),s=n===e?!a.hasClass("hidden"):!!n;o.not(".group-summary").toggleClass("hidden",!s),a.toggleClass("hidden",s),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},r.prototype.updateStatistic=function(){var i=this,n=i.$.find(".table-statistic");if(n.length){if(i.defaultStatistic===e&&(i.defaultStatistic=n.html()),i.options.statisticCreator)return void n.html(i.options.statisticCreator(i)||i.defaultStatistic); +var o=i.statisticCols;if(!o&&o!==!1){o={};var a=!1;i.getTable().find("thead th").each(function(e){var i=t(this),n=i.data("statistic");n&&(a=!0,o[e]={format:n,name:i.text()})}),i.statisticCols=!!a&&o}var s=0;o&&t.each(o,function(t){o[t].total=0,o[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var e=t(this),i=e.hasClass("checked"),n=e.children("td");i&&s++,o&&t.each(o,function(t){var e=parseFloat(n.eq(t).text());isNaN(e)&&(e=0),o[t].total+=e,i&&(o[t].checkedTotal+=e)})});var r=[];if(s)r.push(i.lang.selectedItems.format(s));else if(i.defaultStatistic)return void n.html(i.defaultStatistic);o&&t.each(o,function(t){var e=o[t],n=e[s?"checkedTotal":"total"];e.format&&(n=e.format.format(n)),r.push(i.lang.attrTotal.format(e.name,n))}),n.html(r.join(", "))}},r.prototype.updateFixUI=function(e){var i=this,n=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||n-i.lastUpdateTime').append(t('
      ').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),c){var d=h[0].getBoundingClientRect();l.css({left:d.left,width:h.width()}),l.find(".fixed-header-copy").css({left:o.left-d.left,position:"relative",minWidth:i.width()}),a||h.data("fixHeaderScroll")||(h.data("fixHeaderScroll",1),i.width()>h.width()&&h.on("scroll",function(){e.fixHeader()}))}else l.css({left:o.left,width:o.width});var u=l.find("th");n.find("th").each(function(e){u.eq(e).css("width",t(this).outerWidth())})}else l.remove()},r.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var a=n.find("tbody");if(!a.length)return;e=a[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r=t.isFunction(s)?s(e,o):e.bottom>window.innerHeight-50-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r);var l=t("body"),h=l.hasClass("body-modal");if(r){var c=n.parent(),d=c.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:d?c[0].getBoundingClientRect().left:e.left,width:d?c.width():e.width}),h&&l.css("padding-bottom",40)}else o.css({width:"",left:0,bottom:0}),h&&l.css("padding-bottom",0)},r.prototype.checkAll=function(e){var i=this,n=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},r.prototype.checkRow=function(t,i,n){var o=this;o.isDataTable&&!t.is(".datatable-row-left")&&(t=o.getTable().find('.datatable-row-left[data-index="'+t.data("index")+'"]'));var a=t.find('input[type="checkbox"]');a.length&&!a.is(":disabled")&&(i===e&&(i=!a.is(":checked")),o.isDataTable?o.getTable().find('.datatable-row[data-index="'+t.data("index")+'"]').toggleClass("checked",i):t.toggleClass("checked",i),this.checkItems[t.data("id")]=i,a.prop("checked",i).trigger("change"),n||o.updateCheckUI())},r.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").not(".group-summary"),o=!1,a=null,s=0,r=!1,l=n.length;n.each(function(n){var h=t(this),c=h.find('input[type="checkbox"]');r=c.is(":checked");var d=e.isDataTable?i.find('.datatable-row[data-index="'+h.data("index")+'"]'):h;d.toggleClass("checked",r),d.toggleClass("row-check-begin",r&&!o),a&&a.toggleClass("row-check-end",!r&&o),r&&(s+=1),a=d,o=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange()},r.DEFAULTS={checkable:!0,checkOnClickRow:!0,ajaxForm:!1,selectable:!0,fixHeader:!a,fixFooter:!a,iframeWidth:900,replaceId:"self",nestLevelIndent:18,nested:!1,preserveNested:!0,hot:!1,iframeModalTrigger:".iframe"},t.fn.table=function(e){return this.each(function(){var n=t(this),o=n.data(i),a="object"==typeof e&&e;o||n.data(i,o=new r(this,a)),"string"==typeof e&&o[e]()})},r.NAME=i,t.fn.table.Constructor=r,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t,e,i){t.fn._ajaxForm=t.fn.ajaxForm;var n={timeout:e.config?e.config.timeout:0,dataType:"json",method:"post"},o="";t.fn.enableForm=function(e,n,o){return e===i&&(e=!0),this.each(function(){var i=t(this);n||i.find('[type="submit"]').attr("disabled",e?null:"disabled"),!o&&i.hasClass("load-indicator")&&i.toggleClass("loading",!e),i.toggleClass("form-disabled",!e)})},t.enableForm=function(e,i,n,o){"string"==typeof e||e instanceof t?e=t(e):(o=n,n=i,i=e,e=t("form")),e.enableForm(i!==!1,n,o)},t.disableForm=function(e,i,n){t.enableForm(e,!1,i,n)};var a=function(e,i,n){"string"==typeof i&&(n=i,i=null),n=n||"show",t.zui.messager?t.zui.messager[n](e,i):alert(e)};t.ajaxForm=function(s,r){var l=t(s);if(l.length>1)return l.each(function(){t.ajaxForm(this,r)});t.isFunction(r)&&(r={complete:r}),r=t.extend({},n,l.data(),r);var h=r.beforeSubmit,c=r.error,d=r.success,u=r.finish;delete r.finish,delete r.success,delete r.onError,delete r.beforeSubmit,r=t.extend({beforeSubmit:function(n,a,s){if(l.enableForm(!1),(h&&h(n,a,s))!==!1){var r={},c=a.find('[type="file"]');r.fileapi=c.length&&c[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&a.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,f="multipart/form-data",p=a.attr("enctype")==f||a.attr("encoding")==f,g=r.fileapi&&r.formdata,m=u&&!g||p&&!r.formdata;m&&(""==o&&(o=s.url),s.url!=o&&(s.url=o),s.url=s.url.indexOf("&")>=0?s.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":s.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")}},success:function(i,n,o){if((d&&d(i,n,o,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(s){}if(null===i||"object"!=typeof i)return i?alert(i):a("No response.","danger");var h=r.responser?t(r.responser):l.find(".form-responser");h.length||(h=t("#responser"));var c=i.message,f=function(){var n=i.callback;if(n){var o=n.indexOf("("),a=(o>0?n.substr(0,o):n).split("."),s=e,r=a[0];a.length>1&&(r=a[1],"top"===a[0]?s=e.top:"parent"===a[0]&&(s=e.parent));var h=s[r];if(t.isFunction(h)){var c=[];return o>0&&")"==n[n.length-1]&&(c=t.parseJSON("["+n.substring(o+1,n.length-1)+"]")),c.push(i),h.apply(l,c)}}};if("success"===i.result){var p=r.locate||i.locate;if(l.enableForm(!0,!!p),c){var g=l.find('[type="submit"]').first(),m=!1;g.length&&(g.popover({container:"body",trigger:"manual",content:c,tipClass:"popover-in-modal popover-success popover-form-result",placement:i.placement||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){g.popover("destroy")},r.popoverTime||2e3),m=!0),h.length&&(h.html(''+c+"").show().delay(3e3).fadeOut(100),m=!0),m||a(c,"success")}if(u)return u(i,!0,l);if((r.closeModal||i.closeModal)&&setTimeout(t.zui.closeModal,r.closeModalTime||2e3),f()===!1)return;if(p)if("loadInModal"==p){var v=t(".modal");setTimeout(function(){v.load(v.attr("ref"),function(){t(this).find(".modal-dialog").css("width",t(this).data("width")),t.zui.ajustModalPosition()})},1e3)}else if("parent"===p||"top"===p)e[p]&&setTimeout(function(){e[p].location.reload()},1200);else{var y="reload"==p?e.location.href:p;setTimeout(function(){e.location.href=y},1200)}var b=r.ajaxReload||i.ajaxReload;if(b){var w=t(b);w.length&&w.load(e.location.href+" "+b,function(){w.find('[data-toggle="modal"]').modalTrigger()})}}else{if(l.enableForm(),"string"==typeof c)h.length?h.html(''+c+"").show().delay(3e3).fadeOut(100):a(c,"danger");else if("object"==typeof c){var x=!1,C=[];t.each(c,function(e,i){var n=t.isArray(i)?i.join(""):i,o=t("#"+e);if(!o.length)return void C.push(n);var a=e+"Label",s=t("#"+a);if(!s.length){var r=o.closest(".input-group").length,l=o.closest("td").length;s=t('
      ').appendTo(l?o.closest("td"):r?o.closest(".input-group").parent():o.parent())}s.empty().append(n),o.addClass("has-error");var h=function(){var e=t("#"+a);if(e.length)return e.remove(),o.removeClass("has-error"),!0};o.on("change input mousedown",h);var c=t("#"+e+"_chosen");if(c.length&&c.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){h()===!0&&t(this).removeClass("has-error")}),!x){if(o.hasClass("chosen"))o.trigger("chosen:activate");else if(o.is("textarea")&&o.data("keditor")){var d=o.data("keditor");d.focus(),d.edit.doc.body.focus()}else o.focus();x=!0}}),C.length&&a(C.join(";"),"danger")}if(u)return u(i,!1,l);if(f()===!1)return}}},error:function(t,i,n){if((c&&c(t,i,n,l))!==!1){l.enableForm();var o="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;a(o,"danger")}}},r),l._ajaxForm(r).data("zui.ajaxform",!0),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},t.setAjaxForm=function(e,i,n){t.ajaxForm(e,t.isPlainObject(i)?i:{onFinish:i,beforeSubmit:n})},t.fn.ajaxForm=function(e){return this.each(function(){t.ajaxForm(this,e)})},t.fn.setInputRequired=function(){return this.each(function(){var e=t(this),i=e.parent();i.is(".input-control,td")?i.addClass("required"):e.is(".chosen")?e.attr("required",null).next(".chosen-container").addClass("required"):i.addClass("required"),e.attr("required",null);var n=i.closest(".input-group");n.length&&1===n.find(".required,input[required],select[required]").length&&n.addClass("required")})},t(function(){t('.form-ajax,form[data-type="ajax"]').ajaxForm(),setTimeout(function(){var i=e.config.requiredFields,n=t("form");i&&(i=i.split(",")),i&&i.length&&t.each(i,function(t,e){n.find("#"+e).attr("required","required")}),n.find("input[required],select[required],textarea[required]").setInputRequired()},400),t("#hiddenwin"),t('form[target="hiddenwin"]').on("submit",function(){var e=t(this);e.data("zui.ajaxform")||e.enableForm(!1).data("disabledTime",(new Date).getTime())}).on("click",function(){var e=t(this),i=e.data("disabledTime");i&&(new Date).getTime()-i>1e4&&e.enableForm(!0).data("disabledTime",null)})})}(jQuery,window,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i
      ').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('
      '+(n.errorText||window.lang&&window.lang.timeout)+"
      "),e&&e(!1)}},n.ajax))},n.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,o=void 0===e||null===e||""===e;n.$.toggleClass("has-search-text",!o);var a=n.getItems().removeClass("active");if(o)a.removeClass("hidden");else{var s=t.trim(e).split(" ");a.each(function(){var e=t(this),n=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(s,n))})}n.scrollTo(a.not(".hidden").first().addClass("active"))},n.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof i&&i;a||o.data(e,a=new n(this,s)),"string"==typeof i&&a[i]()})},n.NAME=e,t.fn.searchList.Constructor=n,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){"use strict";var e="zui.labelSelector",i=function(n,o){var a=this;a.name=e,a.$=t(n),o=a.options=t.extend({},i.DEFAULTS,this.$.data(),o),a.$.hide(),a.update()};i.prototype.select=function(t){t+="",this.$wrapper.find(".label.active").removeClass("active"),this.$wrapper.find('.label[data-value="'+t+'"]').addClass("active"),this.$.val(t).trigger("change")},i.prototype.update=function(){var e=this,i=e.options,n=e.$wrapper;if(!n){if(i.wrapper)n=t(i.wrapper);else{var o=e.$.next();n=o.hasClass(".label-selector")?o:t('
      ')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),o=t(this).data("value");e.hasEmptyValue!==!1&&o==n&&(o=e.hasEmptyValue),e.select(o),i.preventDefault()})}n.empty();var a=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var e=t(this),o={label:e.text(),value:e.val()},s=""===o.value||"0"===o.value,r=t(i.labelTemplate||'');i.labelClass&&!s&&r.addClass(i.labelClass),i.labelCreator?r=i.labelCreator(r):(r.data("option",o).attr("data-value",o.value),s&&!o.label?r.addClass("empty").append(''):r.text(o.label).toggleClass("active",a===o.value)),n.append(r)})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var o=t(this),a=o.data(e),s="object"==typeof n&&n;a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},i.NAME=e,t.fn.labelSelector.Constructor=i,t(function(){t('[data-provide="labelSelector"]').labelSelector()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ts.fileMaxSize&&(h.val(""),(window.bootbox||window).alert(s.fileSizeError.format(n(s.fileMaxSize)))),r.update()}),r.update()};a.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},a.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(n(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},a.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),o=n.data(e),s="object"==typeof i&&i;o||n.data(e,o=new a(this,s)),"string"==typeof i&&o[i]()})},a.NAME=e,t.fn.fileInput.Constructor=a,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var n=this;n.name=s;var o=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=o.find(".file-input").detach(),n.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),n=i.data(s),o="object"==typeof e&&e;n||i.data(s,n=new r(this,o)),"string"==typeof e&&n[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t){window.config||(window.config={}),t.createLink=window.createLink=function(t,e,n,o,a,s){if(o||(o=config.defaultView),a||(a=!1),n)for(n=n.split("&"),i=0;i0?"&":"?")+"pgm="+s),l},t(function(){var e=t("#main,#mainContent,#mainRow,.auto-fade-in");e.length&&e.hasClass("fade")&&setTimeout(function(){e.addClass("in")},e.data("fadeTime")||200)}),t.ajaxSendScore=function(e){t.get(t.createLink("score","ajax","method="+e))};var e=function(t){var e=0;if(t){var i=t.split(":");e+=60*parseInt(i[0]),e+=parseInt(i[1])}return e},n=function(t){t%=1440;var e=Math.floor(t/60),i=t%60;return e<10&&(e="0"+e),i<10&&(i="0"+i),e+":"+i},o=function(t){if("string"==typeof t&&(t=e(t)),"number"==typeof t)if(t<1e5){var i=new Date;i.setHours(Math.floor(t/60)%24),i.setMinutes(t%60),t=i}else t=new Date(t);return t},a=function(t,i){for(var a=i?o(i):new Date,s=a.getHours(),r=10*Math.floor(a.getMinutes()/10)+10,l=0;l<24;++l){var h=(l+s)%24;if(!(h<5))for(var c=0;c<6;++c){var d=n(60*h+10*c+r);t.append('")}}t.val()||(time=e(a.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),h=s.find('[name="end"],.control-time-end'),c=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=n(e(t)+30);h.find('option[value="'+i+'"]').length&&h.val(i),r.onChange&&r.onChange(h,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var d=o(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){var u=o(r.end).format("hh:mm");h.find('option[value="'+u+'"]').length&&h.val(u),r.onChange&&r.onChange(h,u)}}else l.on("change",c),a(l,r.begin),a(h,r.end),s.data("timeSpanControlInit",!0);r.end||c()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:a,createTime:o};var s=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var o=t("#searchTypeMenu");o.find("li.selected").removeClass("selected");var a=o.find('a[data-value="'+e+'"]'),s=a.text();a.parent().addClass("selected"),t("#searchTypeName").text(s),i||t("#searchInput").focus()};t.gotoObject=function(e,i){if(e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e)if(i=i.replace(/[^\d]/g,""))window.location.href=t.createLink(e,"testsuite"===e?"library":"view","id="+i);else{var n={zh_cn:"请输入数字ID进行搜索",zh_tw:"請輸入數值ID行搜索"};alert(lang.searchTip||n[t.zui.clientLang()]||"Please enter a numberic id to search")}t("#searchInput").val(i).focus()},t(function(){s(null,!0),t(document).on("keydown",function(e){e.ctrlKey&&71===e.keyCode&&(t("#searchInput").val("").focus(),e.stopPropagation(),e.preventDefault())})}),t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(){location.href=removeAnchor(location.href)},t.selectLang=window.selectLang=function(e){t.cookie("lang",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectLang"),t.refreshPage()},t.selectTheme=window.selectTheme=function(e){t.cookie("theme",e,{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("selectTheme"),t.refreshPage()},t.zui.Picker&&t.zui.Picker.enableChosen(),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0,max_drop_width:500,max_drop_height:245,no_wrap:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;var i="down",n=this.container.find(".chosen-drop"),o=this.container.position(),a=n.outerHeight();return o.top>=a&&o.top+a{page}/{totalPage}',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(!0,t.zui.Messager.DEFAULTS,{cssClass:"messagger-zt",icons:{success:"check-circle",info:"chat-line",warning:"exclamation-sign",danger:"exclamation-sign"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var n=t(e);if(!n.data("historiesInited")){n.data("historiesInited",1),i=t.extend({},n.data(),i);var o=n.find(".histories-list"),a=!0,s=!1;n.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),a=!a,t(this).find(".icon").toggleClass("icon-arrow-up",a).toggleClass("icon-arrow-down",!a);var e="#lastComment",i=t(e);i.length&&window.KindEditor&&(window.KindEditor.remove(e),i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),n=e.find(".icon"),o=n.hasClass("icon-code");n.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original);var r=n.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=r.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=r.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});n.on("click",".btn-comment",function(t){r.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var l=n.find(".comment-edit-form");l.ajaxForm({success:function(t,e,i,n){setTimeout(function(){l.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){t(".histories").histories()});var l=0,h=0;t.toggleSidebar=function(e){var i=t("#sidebar");if(i.length){var n=t("main");if(void 0===e)e=n.hasClass("hide-sidebar");else if(e&&!n.hasClass("hide-sidebar"))return;n.toggleClass("hide-sidebar",!e),clearTimeout(l),t.zui.store.set(h,e);var o=i.children(".cell"),a={overflow:"visible",maxHeight:"initial"};e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):(i.trigger("sidebar.toggle",e),t(window).width()<1900&&(a={overflow:"hidden",maxHeight:t(window).height()-45})),o.css(a)}};var c=t.initSidebar=function(){var e=t("#sidebar");if(e.length){if(e.data("init"))return!0;h="sidebar:"+(e.data("id")||config.currentModule+"/"+config.currentMethod);var i=t("main");if(i.length){i.on("click",".sidebar-toggle",function(){t.toggleSidebar(i.hasClass("hide-sidebar"))});var n=t.zui.store.get(h,e.data("hide")!==!1);n===!1&&e.addClass("no-animate"),t.toggleSidebar(n),n===!1&&setTimeout(function(){e.removeClass("no-animate")},500);var o=e.find(".sidebar-toggle");if(o.length){var a=function(){var e=o[0].getBoundingClientRect(),i=t(window).height(),n=Math.max(0,Math.floor(Math.min(i-40,e.top+e.height)-Math.max(e.top,0))/2)+(e.top<0?0-e.top:0);o.removeClass("fade").find(".icon").css("top",n+(t.zui.browser.isIE()?(i-80)/2:0))};a(),e.data("init",1).on("sidebar.toggle",a);var s=t.zui.browser.isIE()?1500:0,r=0,l=null,c=function(){var t=Date.now();return l&&(clearTimeout(l),l=null),t-rtr input[type="checkbox"]:checked');i.each(function(){var i=parseInt(t(this).val(),10);NaN!==i&&e.push(i)}),t.cookie("checkedItem",e.join(","),{expires:config.cookieLife,path:config.webRoot})},t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100}),t.extend(t.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:40}),t.fn.initIframeModal=function(){return this.each(function(){var e=t(this);if(!e.parents('[data-ride="table"],.skip-iframe-modal').length){var i={type:"iframe"};e.hasClass("export")&&t.extend(i,{width:800,shown:setCheckedCookie},e.data()),e.modalTrigger(i)}})},t(function(){t("a.iframe,.export").initIframeModal()});var d=function(){var e,i,n=t(this),o=t.extend({limitSize:40,suffix:"…"},n.data()),a=n.text();if(a.length>o.limitSize){e=a,i=a.substr(0,o.limitSize)+o.suffix,n.text(i).addClass("limit-text-on");var s=o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle");s.text(s.data("textExpand")),s.on("click",function(){var t=n.toggleClass("limit-text-on").hasClass("limit-text-on");n.text(t?i:e),s.text(s.data(t?"textExpand":"textCollapse"))})}else(o.toggleBtn?t(o.toggleBtn):n.next(".text-limit-toggle")).hide()};t.fn.textLimit=function(){return this.each(d)},t(function(){t(".text-limit").textLimit()}),t.fixedTableHead=window.fixedTableHead=function(e,i){var n=t(e);if(n.is("table")||(n=n.find("table")),n.length){var o=t(i||window),a=null,s=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),o=n.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(a!==s){a=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("
      ").addClass(n.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(n)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(){var e=t(this),i=e.data("href")||e.data("url");i&&(window.location.href=i)}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t(function(){t("body").addClass("m-{currentModule}-{currentMethod}".format(config))});var u,f,p,g,m,v=function(){u||(u=t("#subNavbar"),f=t("#pageNav"),p=t("#pageActions"),g=u.children(".nav"),m=g.outerWidth());var e=u.outerWidth(),i=f.outerWidth()||0,n=p.outerWidth()||0;if(i=i?i+15:0,n=n?n+15:0,!i&&!n)return void g.css({maxWidth:null,left:null,position:"static"});var o=Math.max(300,e-i-n),a=Math.min(o,m),s=(e-a)/2,r=i&&s.btn-toolbar");if(e.length){var i,n,o=e.children(),a=o.length,s=!1,r=null;if(a)for(o.each(function(e){i=t(this),n=i.is(".divider"),n&&!r&&i.hide(),s||n||(s=!0),r=n?null:i,!n||e!==a-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();s||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),T()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])});var S=function(){var e,i="en"==config.clientLang?"//www.zentao.pm/book/zentaomanual/8.html?fullScreen=zentao":"ja"==config.clientLang?"//www.zentao.jp/book/zentaomanual/8.html?fullScreen=zentao":"//www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao",n=t("#navbar > .nav").first(),o=1e4,a=function(){clearTimeout(e),t("#helpContent").removeClass("show-error")},s=t.openHelp=function(s){s=s||i,a(),n.children("li.active:not(#helpMenuItem)").removeClass("active").addClass("close-help-tab"),t("#helpMenuItem").addClass("active");var r=t("#helpContent");if(r.length){if(t("body").hasClass("show-help-tab"))return void t("#helpIframe").get(0).contentWindow.location.replace(s)}else{r=t('

      '+lang.timeout+'

      '+s+'

      '),t("#header").after(r);var l=t("#helpIframe").get(0);e=setTimeout(function(){t("#helpContent").addClass("show-error")},o),l.onload=l.onreadystatechange=function(){this.readyState&&"complete"!=this.readyState||a()}}t("body").addClass("show-help-tab")},r=t.closeHelp=function(){t("body").removeClass("show-help-tab"),t("#helpMenuItem").removeClass("active"),n.find("li.close-help-tab").removeClass("close-help-tab").addClass("active").find("a").focus()};t(document).on("click",".open-help-tab",function(e){var i=t(this),o=t("#helpMenuItem");o.length||(o=t('
    • '+i.text()+'
    • '),n.append('
    • ').append(o)),s(i.attr("href")),e.preventDefault()}).on("click",".close-help-tab",function(t){r(),t.stopPropagation(),t.preventDefault()})};t(S),t(function(){var e=t(".table-responsive"),i=t.fixTableResponsive=function(){e.each(function(){this.scrollHeight-3<=this.clientHeight&&this.scrollWidth-3<=this.clientWidth?t(this).addClass("scroll-none").css("overflow","visible"):t(this).removeClass("scroll-none").css("overflow","auto")})};e.length&&(t(window).on("resize",i),setTimeout(i,100))});var D=function(){var e=this,i=t(e),n=i.closest("tr").find("textarea");if(n.length){var o=32;n.each(function(){var e=t(this).closest("td"),i=e.css("height");e.css("height",this.style.height),this.style.height="auto";var n=this.value?this.scrollHeight+2:32;o=Math.max(o,n),e.css("height",i)}),n.css("height",o)}else{e.style.height="auto";var a=e.value?e.scrollHeight+2:32;e.style.height=a+"px"}};t.autoResizeTextarea=function(e){t(e).each(D)},t(function(){t("textarea.autosize").each(D),t(document).on("input paste change","textarea.autosize",D)}),t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col"),e.stopPropagation(),e.preventDefault()})});var M="undefined"!=typeof InstallTrigger;t.zui.browser.firefox=M,t("html").toggleClass("is-firefox",M).toggleClass("not-firefox",!M),t(function(){var e=t("#mainContent>.main-col"),i=e.children(".main-actions");if(i.length){var n=i.prev();if(i.length&&n.length){t('
      ').css("height",i.outerHeight()).insertAfter(i);var o=0,a=function(){var e=n[0].getBoundingClientRect(),s=e.top+e.height+120>t(window).height();if(t("body").toggleClass("main-actions-fixed",s),s){const r=n.width();r?i.width(r):o<10&&setTimeout(a,1e3)}o++};t.resetToolbarPosition=a,a(),t(window).on("resize scroll",a)}}}),t(document).on("show.zui.modal",function(e){t("body.body-modal").length&&window.parent&&window.parent!==window&&t(e.target).is(".modal")&&window.parent.$("body").addClass("hide-modal-close")}).on("hidden.zui.modal",function(){t("body.body-modal").length&&window.parent&&window.parent!==window&&window.parent.$("body").removeClass("hide-modal-close")}),t(function(){var e=t(".dropdown-menu.with-search");e.length&&(e.find(".menu-search").on("click",function(t){return t.stopPropagation(),!1}),e.on("keyup change paste","input",function(){var e=t(this),i=e.closest(".dropdown-menu.with-search"),n=e.val().toLowerCase(),o=i.find(".option");""==n?o.removeClass("hide"):o.each(function(){var e=t(this);e.toggleClass("hide",e.text().toString().toLowerCase().indexOf(n)<0&&e.data("key").toString().toLowerCase().indexOf(n)<0)})}),e.parents(".dropdown-submenu").one("mouseenter",function(){var e=t(this).find(".dropdown-list")[0];e&&e.getBoundingClientRect&&setTimeout(function(){var t=270,i=e.getBoundingClientRect();i.top<0&&(t=Math.min(270,i.height)+i.top),e.style.maxHeight=Math.min(270,t)+"px"},50)})),t(".dropdown-menu.with-search .menu-search").on("click",function(t){return t.stopPropagation(),!1})})}(jQuery),$.zui.lang("de",{"zui.pager":{pageOfText:"Seite {0}",prev:"Zurück",next:"Nächste Seite",first:"Erste Seite",last:"Letzte Seite","goto":"Goto",pageOf:"Seite {page}",totalPage:"{totalPage} Seiten",totalCount:"Total: {recTotal} Artikel",pageSize:"{recPerPage} Artikel pro Seite",itemsRange:"Seiten {start} bis {end}",pageOfTotal:"Seite {page}/{totalPage}"},"zui.boards":{append2end:"Gehen Sie zum Ende"},"zui.browser":{tip:"Online. Sorgenfrei. Aktualisiere deinen Browser noch heute!"},"zui.calendar":{weekNames:["Son","Mon","Die","Mit","Don","Fri","Sam"],monthNames:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",year:"{0}Jahr",month:"{0}Monat",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Kein Icon]",commonIcons:"Gemeinsame Symbole",webIcons:"Web-Symbol",editorIcons:"Editor-Symbol",directionalIcons:"Pfeil Zusammenfluss",otherIcons:"Andere Symbole"},"zui.colorPicker":{errorTip:"Kein gültiger Farbwert"},"zui.datagrid":{errorCannotGetDataFromRemote:"Daten vom Remote-Server ({0}) können nicht abgerufen werden.",errorCannotHandleRemoteData:"Die vom Remote-Server zurückgegebenen Daten können nicht verarbeitet werden."},"zui.guideViewer":{prevStep:"Vorheriger Schritt",nextStep:"Nächster Schritt"},"zui.tabs":{reload:"Neu laden",close:"Schliessen",closeOthers:"Schließen Sie andere Registerkarten",closeRight:"Schließen Sie die rechte Registerkarte",reopenLast:"Letzten geschlossenen Tab wiederherstellen",errorCannotFetchFromRemote:"Inhalt kann nicht vom Remote-Server abgerufen werden ({0})."},"zui.uploader":{},datetimepicker:{days:["Sonntag","Montag","Diensteg","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["Son","Mon","Die","Mit","Don","Fri","Sam"],daysMin:["Son","Mon","Die","Mit","Don","Fri","Sam"],months:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",suffix:[],meridiem:[]},chosen:{no_results_text:"Nicht gefunden"},bootbox:{OK:"OK",CANCEL:"Stornieren",CONFIRM:"Bestätigen"}}),$.zui.lang("fr",{"zui.pager":{pageOfText:"Page {0}",prev:"Prev",next:"Suivant",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"De {start} à {end}",pageOfTotal:"Page {page} de {totalPage}"},"zui.boards":{append2end:"Aller jusqu'au bout"},"zui.browser":{tip:"Naviguez sans crainte sur Internet. Mettez votre navigateur à jour dès aujourd'hui!"},"zui.calendar":{weekNames:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],monthNames:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",year:"{0} Année",month:"{0} Mois",yearMonth:"{0}-{1}"},"zui.chosenIcons":{emptyIcon:"[Aucune icône]",commonIcons:"Icônes communes",webIcons:"Icône Web",editorIcons:"Icône de l'éditeur",directionalIcons:"Flèche confluence",otherIcons:"Autres icônes"},"zui.colorPicker":{errorTip:"Pas une valeur de couleur valide"},"zui.datagrid":{errorCannotGetDataFromRemote:"Impossible d'obtenir les données du serveur distant ({0}).",errorCannotHandleRemoteData:"Impossible de traiter les données renvoyées par le serveur distant."},"zui.guideViewer":{prevStep:"Étape précédente",nextStep:"Prochaine étape"},"zui.tabs":{reload:"Recharger",close:"Fermer",closeOthers:"Fermez les autres onglets",closeRight:"Fermer l'onglet de droite",reopenLast:"Restaurer le dernier onglet fermé",errorCannotFetchFromRemote:"Impossible d'obtenir le contenu du serveur distant ({0})."},"zui.uploader":{},datetimepicker:{days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],monthsShort:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Déc"],today:"Aujourd'hui",suffix:[],meridiem:[]},chosen:{no_results_text:"Pas trouvé"},bootbox:{OK:"D'accord",CANCEL:"Annuler",CONFIRM:"Confirmer"}}); \ No newline at end of file From b13a57d82bd8e5200871081f1e62fe15c2c2c013 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 13 Nov 2020 14:48:41 +0800 Subject: [PATCH 101/187] * Adjust code style. --- module/doc/model.php | 1 + module/git/model.php | 1 + 2 files changed, 2 insertions(+) diff --git a/module/doc/model.php b/module/doc/model.php index a399234707..baee999320 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -1658,6 +1658,7 @@ class docModel extends model $doc->content = str_replace("", "", $doc->content); $doc->content = str_replace("", "", $doc->content); } + /* Get action info. */ $action = $this->loadModel('action')->getById($actionID); $history = $this->action->getHistory($actionID); diff --git a/module/git/model.php b/module/git/model.php index 365b101fe4..9a3dda53e6 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -187,6 +187,7 @@ class gitModel extends model } } + $this->repo->updateCommitCount($repo->id, $commits); $this->dao->update(TABLE_REPO)->set('lastSync')->eq(helper::now())->where('id')->eq($repo->id)->exec(); if($isPrintLog) $this->printLog("\n\nrepo #" . $repo->id . ': ' . $repo->path . " finished"); From 9b811e95cb946a8727197d3d2c45811afebbbbd7 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Fri, 13 Nov 2020 16:43:50 +0800 Subject: [PATCH 102/187] * Adjust code style and add language item. --- module/user/lang/de.php | 2 ++ module/user/lang/en.php | 2 ++ module/user/lang/fr.php | 2 ++ module/user/lang/vi.php | 2 ++ module/user/lang/zh-cn.php | 1 - module/user/model.php | 2 +- 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/user/lang/de.php b/module/user/lang/de.php index ac48a67915..2a025d4e1e 100644 --- a/module/user/lang/de.php +++ b/module/user/lang/de.php @@ -63,6 +63,8 @@ $lang->user->unlock = "Entsperren"; $lang->user->delete = "Löschen"; $lang->user->unbind = "Zdoo verbindung aufheben"; $lang->user->login = "Anmelden"; +$lang->user->bind = "Bind existing account"; +$lang->user->oauthRegister = "Register a new account"; $lang->user->mobileLogin = "Mobil"; $lang->user->editProfile = "Bearbeiten"; $lang->user->deny = "Zugriff verweigert."; diff --git a/module/user/lang/en.php b/module/user/lang/en.php index ab521245af..4d311dcb61 100644 --- a/module/user/lang/en.php +++ b/module/user/lang/en.php @@ -63,6 +63,8 @@ $lang->user->unlock = "Unlock User"; $lang->user->delete = "Delete User"; $lang->user->unbind = "Unbind from Zdoo"; $lang->user->login = "Login"; +$lang->user->bind = "Bind existing account"; +$lang->user->oauthRegister = "Register a new account"; $lang->user->mobileLogin = "Mobile"; $lang->user->editProfile = "Edit Profile"; $lang->user->deny = "Your access is denied."; diff --git a/module/user/lang/fr.php b/module/user/lang/fr.php index 211eb0c1d8..e9472e4452 100644 --- a/module/user/lang/fr.php +++ b/module/user/lang/fr.php @@ -63,6 +63,8 @@ $lang->user->unlock = "Débloquer Utilisateur"; $lang->user->delete = "Supprimer Utilisateur"; $lang->user->unbind = "Dissocier de Zdoo"; $lang->user->login = "Login"; +$lang->user->bind = "Bind existing account"; +$lang->user->oauthRegister = "Register a new account"; $lang->user->mobileLogin = "Mobile"; $lang->user->editProfile = "Editer Profil"; $lang->user->deny = "Your access is denied."; diff --git a/module/user/lang/vi.php b/module/user/lang/vi.php index 97f3622180..dbb8251e83 100644 --- a/module/user/lang/vi.php +++ b/module/user/lang/vi.php @@ -63,6 +63,8 @@ $lang->user->unlock = "Mở khóa người dùng"; $lang->user->delete = "Xóa người dùng"; $lang->user->unbind = "Gỡ kết nối từ Zdoo"; $lang->user->login = "Đăng nhập"; +$lang->user->bind = "Bind existing account"; +$lang->user->oauthRegister = "Register a new account"; $lang->user->mobileLogin = "Di động"; $lang->user->editProfile = "Sửa hồ sơ"; $lang->user->deny = "Truy cập của bạn bị từ chối."; diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index bb917b0164..d5a3a96d66 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -198,7 +198,6 @@ $lang->user->contacts->common = '联系人'; $lang->user->contacts->listName = '列表名称'; $lang->user->contacts->userList = '用户列表'; - $lang->user->contacts->manage = '维护列表'; $lang->user->contacts->contactsList = '已有列表'; $lang->user->contacts->selectedUsers = '选择用户'; diff --git a/module/user/model.php b/module/user/model.php index 1d63c13729..60d371ef62 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -871,7 +871,7 @@ class userModel extends model * * @param object $user * @access public - * @return void + * @return bool|object */ public function login($user) { From f7b2e5378d69cc7a82d77f936945901a9a14b540 Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Sat, 14 Nov 2020 22:52:37 +0800 Subject: [PATCH 103/187] * Finish task#8193. --- db/update12.4.4.sql | 3 ++- db/zentao.sql | 1 + module/job/css/create.css | 1 + module/job/css/edit.css | 1 + module/job/js/common.js | 26 +++++++++++++++++++++ module/job/lang/de.php | 4 ++++ module/job/lang/en.php | 4 ++++ module/job/lang/fr.php | 4 ++++ module/job/lang/vi.php | 4 ++++ module/job/lang/zh-cn.php | 4 ++++ module/job/lang/zh-tw.php | 4 ++++ module/job/model.php | 40 ++++++++++++++++++++++++++++++++- module/job/view/create.html.php | 13 +++++++++++ module/job/view/edit.html.php | 15 +++++++++++++ module/job/view/view.html.php | 8 +++++++ 15 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 module/job/js/common.js diff --git a/db/update12.4.4.sql b/db/update12.4.4.sql index 6db33edf22..a09eaaad24 100644 --- a/db/update12.4.4.sql +++ b/db/update12.4.4.sql @@ -1,4 +1,5 @@ -ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`; +ALTER TABLE `zt_job` ADD `customParam` text AFTER `lastTag`; +ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`; ALTER TABLE `zt_task` CHANGE `realStarted` `realStarted` datetime NOT NULL AFTER `estStarted`; ALTER TABLE `zt_group` CHANGE `program` `PRJ` mediumint(8) unsigned NOT NULL DEFAULT 0; diff --git a/db/zentao.sql b/db/zentao.sql index 905e0a125d..1a33e6149f 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -466,6 +466,7 @@ CREATE TABLE IF NOT EXISTS `zt_job` ( `lastExec` datetime DEFAULT NULL, `lastStatus` varchar(255) DEFAULT NULL, `lastTag` varchar(255) DEFAULT NULL, + `customParam` text NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/module/job/css/create.css b/module/job/css/create.css index d0fd86e9f7..84c9e88638 100644 --- a/module/job/css/create.css +++ b/module/job/css/create.css @@ -5,3 +5,4 @@ #jkHost_chosen .chosen-single{border-right:0px;} #jkJobBox{width:385px;} #svnDirBox .input-group{width:unset !important} +#paramDiv .input-group{padding:3px} diff --git a/module/job/css/edit.css b/module/job/css/edit.css index 18378d434c..6ce26cba1e 100644 --- a/module/job/css/edit.css +++ b/module/job/css/edit.css @@ -5,3 +5,4 @@ #jkHost_chosen .chosen-single{border-right:0px;} #jkJobBox{width:385px;} #svnDirBox .input-group{width:unset !important} +#paramDiv .input-group{padding:3px} diff --git a/module/job/js/common.js b/module/job/js/common.js new file mode 100644 index 0000000000..716f6af921 --- /dev/null +++ b/module/job/js/common.js @@ -0,0 +1,26 @@ +/** + * Add item. + * + * @param obj $obj + * @access public + * @return void + */ +function addItem(obj) +{ + var $inputgroup = $(obj).closest('.input-group').clone(); + $inputgroup.find('input').val(''); + $(obj).closest('.input-group').after($inputgroup); +} + +/** + * Delete item. + * + * @param obj $obj + * @access public + * @return void + */ +function deleteItem(obj) +{ + if($('#paramDiv').find("input").size() <= 2) return; + $(obj).closest('.input-group').remove(); +} diff --git a/module/job/lang/de.php b/module/job/lang/de.php index 01cca081b9..aec57830bd 100644 --- a/module/job/lang/de.php +++ b/module/job/lang/de.php @@ -26,6 +26,9 @@ $lang->job->atTime = 'At Time'; $lang->job->lastStatus = 'Last Status'; $lang->job->lastExec = 'Last Executed'; $lang->job->comment = 'Match Keywords'; +$lang->job->customParam = 'Benutzerdefinierte Bauparameter'; +$lang->job->paramName = 'Name'; +$lang->job->paramValue = 'Wert'; $lang->job->lblBasic = 'Basic Info'; @@ -33,6 +36,7 @@ $lang->job->example = 'e.g.'; $lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','"; $lang->job->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.'; $lang->job->sendExec = 'Send execute request success.'; +$lang->job->inputName = 'Bitte geben Sie den Parameternamen ein.'; $lang->job->buildTypeList['build'] = 'Only Build'; $lang->job->buildTypeList['buildAndDeploy'] = 'Build And Deploy'; diff --git a/module/job/lang/en.php b/module/job/lang/en.php index 01cca081b9..f84bf57191 100644 --- a/module/job/lang/en.php +++ b/module/job/lang/en.php @@ -26,6 +26,9 @@ $lang->job->atTime = 'At Time'; $lang->job->lastStatus = 'Last Status'; $lang->job->lastExec = 'Last Executed'; $lang->job->comment = 'Match Keywords'; +$lang->job->customParam = 'Custom build parameters'; +$lang->job->paramName = 'Name'; +$lang->job->paramValue = 'Value'; $lang->job->lblBasic = 'Basic Info'; @@ -33,6 +36,7 @@ $lang->job->example = 'e.g.'; $lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','"; $lang->job->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.'; $lang->job->sendExec = 'Send execute request success.'; +$lang->job->inputName = 'Please enter parameter name.'; $lang->job->buildTypeList['build'] = 'Only Build'; $lang->job->buildTypeList['buildAndDeploy'] = 'Build And Deploy'; diff --git a/module/job/lang/fr.php b/module/job/lang/fr.php index d8d497a70a..cb3df596b4 100644 --- a/module/job/lang/fr.php +++ b/module/job/lang/fr.php @@ -26,6 +26,9 @@ $lang->job->atTime = 'heure'; $lang->job->lastStatus = 'Dern Statut'; $lang->job->lastExec = 'Dern Exec'; $lang->job->comment = 'Corres Mots cl閟'; +$lang->job->customParam = 'Paramètres de construction personnalisés'; +$lang->job->paramName = 'Nom'; +$lang->job->paramValue = 'PH'; $lang->job->lblBasic = 'Infos de Base'; @@ -33,6 +36,7 @@ $lang->job->example = 'ex.'; $lang->job->commitEx = "Utilis pour faire correspondre les mots cl閟 utilis閟 pour cr閑r une compilation. Plusieurs mots cl閟 sont s閜ar閟 par ','"; $lang->job->cronSample = 'ex: 0 0 2 * * 2-6/1 signifie 2:00 a.m. chaque jour de la semaine.'; $lang->job->sendExec = "Envoi de la demande d'ex閏ution r閡ssie."; +$lang->job->inputName = 'Veuillez saisir le nom du paramètre.'; $lang->job->buildTypeList['build'] = 'Seulement Build'; $lang->job->buildTypeList['buildAndDeploy'] = 'Build et D閜loiement'; diff --git a/module/job/lang/vi.php b/module/job/lang/vi.php index 7330d8447a..961222932a 100644 --- a/module/job/lang/vi.php +++ b/module/job/lang/vi.php @@ -26,6 +26,9 @@ $lang->job->atTime = 'Vào lúc'; $lang->job->lastStatus = 'Tình trạng cuối'; $lang->job->lastExec = 'Xử lý cuối'; $lang->job->comment = 'Từ khóa phù hợp'; +$lang->job->customParam = 'Tham số tự chọn'; +$lang->job->paramName = 'Tên'; +$lang->job->paramValue = 'giá'; $lang->job->lblBasic = 'Basic Info'; @@ -33,6 +36,7 @@ $lang->job->example = 'ví dụ: '; $lang->job->commitEx = "Used to match the keywords used to create a compile. Multiple keywords are separated by ','"; $lang->job->cronSample = 'ví dụ: 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.'; $lang->job->sendExec = 'Gửi execute request success.'; +$lang->job->inputName = 'Hãy nhập tên tham số.'; $lang->job->buildTypeList['build'] = 'Chỉ bản dựng'; $lang->job->buildTypeList['buildAndDeploy'] = 'Bản dựng và triển khai'; diff --git a/module/job/lang/zh-cn.php b/module/job/lang/zh-cn.php index f51a8b3b69..65e5453f1e 100644 --- a/module/job/lang/zh-cn.php +++ b/module/job/lang/zh-cn.php @@ -26,6 +26,9 @@ $lang->job->atTime = '执行时间'; $lang->job->lastStatus = '最后执行状态'; $lang->job->lastExec = '最后执行时间'; $lang->job->comment = '匹配关键字'; +$lang->job->customParam = '自定义构建参数'; +$lang->job->paramName = '名称'; +$lang->job->paramValue = '值'; $lang->job->lblBasic = '基本信息'; @@ -33,6 +36,7 @@ $lang->job->example = '举例'; $lang->job->commitEx = "用于匹配创建构建任务的关键字,多个关键字用','分割"; $lang->job->cronSample = '如 0 0 2 * * 2-6/1 表示每个工作日凌晨2点'; $lang->job->sendExec = '发送执行请求成功!执行结果:%s'; +$lang->job->inputName = '请输入参数名称。'; $lang->job->buildTypeList['build'] = '仅构建'; $lang->job->buildTypeList['buildAndDeploy'] = '构建部署'; diff --git a/module/job/lang/zh-tw.php b/module/job/lang/zh-tw.php index b9a37b2ea9..6498ae41ca 100644 --- a/module/job/lang/zh-tw.php +++ b/module/job/lang/zh-tw.php @@ -26,6 +26,9 @@ $lang->job->atTime = '執行時間'; $lang->job->lastStatus = '最後執行狀態'; $lang->job->lastExec = '最後執行時間'; $lang->job->comment = '匹配關鍵字'; +$lang->job->customParam = '自定義構建參數'; +$lang->job->paramName = '名稱'; +$lang->job->paramValue = '值'; $lang->job->lblBasic = '基本信息'; @@ -33,6 +36,7 @@ $lang->job->example = '舉例'; $lang->job->commitEx = "用於匹配創建構建任務的關鍵字,多個關鍵字用','分割"; $lang->job->cronSample = '如 0 0 2 * * 2-6/1 表示每個工作日凌晨2點'; $lang->job->sendExec = '發送執行請求成功!執行結果:%s'; +$lang->job->inputName = '請輸入參數名稱。'; $lang->job->buildTypeList['build'] = '僅構建'; $lang->job->buildTypeList['buildAndDeploy'] = '構建部署'; diff --git a/module/job/model.php b/module/job/model.php index bb77d9cb2b..e97931de37 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -128,6 +128,23 @@ class jobModel extends model if($job->svnDir == '/' and $_POST['svnDir']) $job->svnDir = array_pop($_POST['svnDir']); } + $customParam = array(); + foreach($job->paramName as $key => $paramName) + { + $paramValue = zget($job->paramValue, $key, ''); + + if(empty($paramName) and !empty($paramValue)) + { + dao::$errors[] = $this->lang->job->inputName; + return false; + } + + if(!empty($paramName)) $customParam[$paramName] = $paramValue; + } + unset($job->paramName); + unset($job->paramValue); + $job->customParam = json_encode($customParam); + $this->dao->insert(TABLE_JOB)->data($job) ->batchCheck($this->config->job->create->requiredFields, 'notempty') @@ -171,6 +188,23 @@ class jobModel extends model if($job->svnDir == '/' and $_POST['svnDir']) $job->svnDir = array_pop($_POST['svnDir']); } + $customParam = array(); + foreach($job->paramName as $key => $paramName) + { + $paramValue = zget($job->paramValue, $key, ''); + + if(empty($paramName) and !empty($paramValue)) + { + dao::$errors[] = $this->lang->job->inputName; + return false; + } + + if(!empty($paramName)) $customParam[$paramName] = $paramValue; + } + unset($job->paramName); + unset($job->paramValue); + $job->customParam = json_encode($customParam); + $this->dao->update(TABLE_JOB)->data($job) ->batchCheck($this->config->job->edit->requiredFields, 'notempty') @@ -240,7 +274,7 @@ class jobModel extends model */ public function exec($id) { - $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.jkJob,t1.triggerType,t1.atTime,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password') + $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.jkJob,t1.triggerType,t1.atTime,t1.customParam,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password') ->from(TABLE_JOB)->alias('t1') ->leftJoin(TABLE_JENKINS)->alias('t2')->on('t1.jkHost=t2.id') ->where('t1.id')->eq($id) @@ -298,6 +332,10 @@ class jobModel extends model $compileID = $this->dao->lastInsertId(); $data->ZENTAO_DATA = "compile={$compileID}"; + + //Add custom parameters to the data. + foreach(json_decode($job->customParam) as $paramName => $paramValue) $data->$paramName = $paramValue; + $compile = new stdclass(); $compile->queue = $this->loadModel('ci')->sendRequest($url->url, $data, $url->userPWD); $compile->status = $compile->queue ? 'created' : 'create_fail'; diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php index f25dd6dd54..57f0345e31 100644 --- a/module/job/view/create.html.php +++ b/module/job/view/create.html.php @@ -86,6 +86,19 @@ + + job->customParam;?> + +
      + job->paramName; ?> + + job->paramValue; ?> + + + +
      + + diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index fbc5a36da6..0baae7783a 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -109,6 +109,21 @@ + + job->customParam;?> + + customParam) as $paramName => $paramValue):?> +
      + job->paramName; ?> + + job->paramValue; ?> + + + +
      + + + diff --git a/module/job/view/view.html.php b/module/job/view/view.html.php index 23b0e7153d..10d564da1d 100644 --- a/module/job/view/view.html.php +++ b/module/job/view/view.html.php @@ -97,6 +97,14 @@ ?> + + job->customParam;?> + + customParam) as $paramName => $paramValue):?> +
      + + + From 1f741b8d012cf7dc4a86b0749cd6684d241c35ef Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Sun, 15 Nov 2020 14:34:23 +0800 Subject: [PATCH 104/187] * Finish task#8198. Add comments. --- module/todo/js/common.js | 2 -- module/todo/model.php | 10 +++++++--- module/todo/view/create.html.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/module/todo/js/common.js b/module/todo/js/common.js index a84f4e4239..8f6ccdd08d 100644 --- a/module/todo/js/common.js +++ b/module/todo/js/common.js @@ -136,13 +136,11 @@ function showAppointDate(switcher) { if(switcher.checked) { - $('#date').attr('disabled','disabled'); $('#dayInput').attr('disabled','disabled'); $('.appoint').removeClass('hidden'); } else { - $('#date').removeAttr('disabled'); $('#dayInput').removeAttr('disabled'); $('.appoint').addClass('hidden'); } diff --git a/module/todo/model.php b/module/todo/model.php index 37afdb24a5..8512341086 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -47,7 +47,7 @@ class todoModel extends model if(empty($todo->cycle)) unset($todo->config); if(!empty($todo->cycle)) { - if(isset($todo->config['appointDate'])) $todo->date = date('Y-m-d'); + $todo->date = date('Y-m-d'); $todo->config['begin'] = $todo->date; if($todo->config['type'] == 'day') @@ -194,7 +194,7 @@ class todoModel extends model if(!empty($oldTodo->cycle)) { - if(isset($todo->config['appointDate'])) $todo->date = date('Y-m-d'); + $todo->date = date('Y-m-d'); $todo->config['begin'] = $todo->date; if($todo->config['type'] == 'day') @@ -537,7 +537,7 @@ class todoModel extends model $begin = $todo->config->begin; $end = $todo->config->end; $beforeDays = (int)$todo->config->beforeDays; - if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$today -{$beforeDays} days")); + if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$begin -{$beforeDays} days")); if($today < $begin or (!empty($end) && $today > $end)) continue; $newTodo = new stdclass(); @@ -570,6 +570,7 @@ class todoModel extends model $day = (int)$todo->config->day; if($day <= 0) continue; + /* If no data, judge the interval from the begin time. */ if(empty($lastCycle)) { $todayTime = new DateTime($today); @@ -581,6 +582,7 @@ class todoModel extends model $date = $today; } + /* If have data, judge the interval from the last cycle time. */ if(!empty($lastCycle->date)) { $todayTime = new DateTime($today); @@ -597,8 +599,10 @@ class todoModel extends model $date = $today; $appointDate = $todo->config->appoint->month . '-' . $todo->config->appoint->day; + // If not set cycle every year and have data, continue. if(!empty($lastCycle) and !isset($todo->config->cycleYear)) continue; + // If set appoint date, only judge month and day. if(date('m-d', strtotime($date)) != $appointDate) continue; } } diff --git a/module/todo/view/create.html.php b/module/todo/view/create.html.php index 5a14673107..bd412948f9 100644 --- a/module/todo/view/create.html.php +++ b/module/todo/view/create.html.php @@ -34,7 +34,7 @@
      - +
      From 95c2adcdb0f9ff0ff237e9b3f8678561307bfaac Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Sun, 15 Nov 2020 22:39:26 +0800 Subject: [PATCH 105/187] *Finish task #8194. --- module/bug/model.php | 23 +++++---- module/bug/view/browse.html.php | 15 +++--- module/common/model.php | 24 ++-------- module/product/view/browse.html.php | 17 +++---- module/project/control.php | 68 +++++++++++++++------------ module/project/view/story.html.php | 11 ++--- module/project/view/testtask.html.php | 8 +--- module/story/model.php | 9 ++-- 8 files changed, 86 insertions(+), 89 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 5783aed7f6..dfd5705ccd 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2509,14 +2509,14 @@ class bugModel extends model /* Check the product is closed. */ $changeAllowed = common::checkObjectChangeAllowed('bug', $bug); - $canBatchEdit = common::hasPriv('bug', 'batchEdit'); - $canBatchConfirm = common::hasPriv('bug', 'batchConfirm'); + $canBatchEdit = ($changeAllowed and common::hasPriv('bug', 'batchEdit')); + $canBatchConfirm = ($changeAllowed and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); - $canBatchActivate = common::hasPriv('bug', 'batchActivate'); - $canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch'); - $canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule'); - $canBatchResolve = common::hasPriv('bug', 'batchResolve'); - $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); + $canBatchActivate = ($changeAllowed and common::hasPriv('bug', 'batchActivate')); + $canBatchChangeBranch = ($changeAllowed and common::hasPriv('bug', 'batchChangeBranch')); + $canBatchChangeModule = ($changeAllowed and common::hasPriv('bug', 'batchChangeModule')); + $canBatchResolve = ($changeAllowed and common::hasPriv('bug', 'batchResolve')); + $canBatchAssignTo = ($changeAllowed and common::hasPriv('bug', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo); @@ -2578,8 +2578,7 @@ class bugModel extends model case 'id': if($canBatchAction) { - $disabled = $changeAllowed ? '' : 'disabled'; - echo html::checkbox('bugIDList', array($bug->id => ''), '', $disabled) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id)); + echo html::checkbox('bugIDList', array($bug->id => ''), '') . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id)); } else { @@ -2730,15 +2729,19 @@ class bugModel extends model echo substr($bug->lastEditedDate, 5, 11); break; case 'actions': + $params = "bugID=$bug->id"; if($changeAllowed) { - $params = "bugID=$bug->id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); common::printIcon('bug', 'edit', $params, $bug, 'list'); common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=$params", $bug, 'list', 'copy'); } + else + { + common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true); + } break; } echo ''; diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index b901159e36..b37104f9d1 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -211,14 +211,15 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBatchEdit = common::hasPriv('bug', 'batchEdit'); - $canBatchConfirm = common::hasPriv('bug', 'batchConfirm'); + $changeAllowed = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBatchEdit = ($changeAllowed and common::hasPriv('bug', 'batchEdit')); + $canBatchConfirm = ($changeAllowed and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); - $canBatchActivate = common::hasPriv('bug', 'batchActivate'); - $canBatchChangeBranch = common::hasPriv('bug', 'batchChangeBranch'); - $canBatchChangeModule = common::hasPriv('bug', 'batchChangeModule'); - $canBatchResolve = common::hasPriv('bug', 'batchResolve'); - $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo'); + $canBatchActivate = ($changeAllowed and common::hasPriv('bug', 'batchActivate')); + $canBatchChangeBranch = ($changeAllowed and common::hasPriv('bug', 'batchChangeBranch')); + $canBatchChangeModule = ($changeAllowed and common::hasPriv('bug', 'batchChangeModule')); + $canBatchResolve = ($changeAllowed and common::hasPriv('bug', 'batchResolve')); + $canBatchAssignTo = ($changeAllowed and common::hasPriv('bug', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo); ?> diff --git a/module/common/model.php b/module/common/model.php index 9f4897a508..f64440276f 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1490,7 +1490,7 @@ EOD; global $app, $lang; /* Check the parent object is closed. */ - if(!commonModel::checkObjectChangeAllowed($module, $object)) return false; + if(strpos('close|batchClose', $method) === false and !commonModel::checkObjectChangeAllowed($module, $object)) return false; /* Check is the super admin or not. */ if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true; @@ -1855,32 +1855,18 @@ EOD; global $app, $config; /* Check the product is closed. */ - if(!empty($object->product) and !empty($config->global->closedProductStatus)) + if(!empty($object->product) and is_numeric($object->product) and !empty($config->global->closedProductStatus)) { $productID = trim($object->product, ','); $product = $app->control->loadModel('product')->getByID($productID); if($product->status == 'closed') return false; - - /* Get the projects associated with the story. */ - if($module == 'story' and empty($object->project)) - { - $projects = $app->dbh->query('SELECT project FROM ' . TABLE_PROJECTSTORY . " WHERE `story` = '$object->id'")->fetchAll(); - $projectIDList = array(); - foreach($projects as $project) $projectIDList[] = $project->project; - - $object->project = implode(',', $projectIDList); - } } /* Check the project is closed. */ - if(!empty($object->project) and !empty($config->global->closedProjectStatus)) + if(strpos('story|bug|testtask', $module) === false and !empty($object->project) and is_numeric($object->project) and !empty($config->global->closedProjectStatus)) { - $projectIDList = explode(',', $object->project); - $projects = $app->control->loadModel('project')->getByIDList($projectIDList); - foreach($projects as $project) - { - if($project->status == 'closed') return false; - } + $project = $app->control->loadModel('project')->getByID($object->project); + if($project->status == 'closed') return false; } return true; diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 05a1e4be15..3068fc47e1 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -189,14 +189,15 @@ js::set('foldAll', $lang->project->treeLevel['root']); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBatchEdit = common::hasPriv('story', 'batchEdit'); - $canBatchClose = common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'; - $canBatchReview = common::hasPriv('story', 'batchReview'); - $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage'); - $canBatchChangeBranch = common::hasPriv('story', 'batchChangeBranch'); - $canBatchChangeModule = common::hasPriv('story', 'batchChangeModule'); - $canBatchChangePlan = common::hasPriv('story', 'batchChangePlan'); - $canBatchAssignTo = common::hasPriv('story', 'batchAssignTo'); + $changeAllowed = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBatchEdit = ($changeAllowed and common::hasPriv('story', 'batchEdit')); + $canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'); + $canBatchReview = ($changeAllowed and common::hasPriv('story', 'batchReview')); + $canBatchChangeStage = ($changeAllowed and common::hasPriv('story', 'batchChangeStage')); + $canBatchChangeBranch = ($changeAllowed and common::hasPriv('story', 'batchChangeBranch')); + $canBatchChangeModule = ($changeAllowed and common::hasPriv('story', 'batchChangeModule')); + $canBatchChangePlan = ($changeAllowed and common::hasPriv('story', 'batchChangePlan')); + $canBatchAssignTo = ($changeAllowed and common::hasPriv('story', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo); ?> diff --git a/module/project/control.php b/module/project/control.php index 7672abbd4e..18b28157d9 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -696,6 +696,10 @@ class project extends control $project = $this->commonAction($projectID); $projectID = $project->id; + /* Determines whether an object is editable. */ + $changeAllowed = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); @@ -756,24 +760,25 @@ class project extends control if($productPairs) $productID = key($productPairs); /* Assign. */ - $this->view->title = $title; - $this->view->position = $position; - $this->view->productID = $productID; - $this->view->project = $project; - $this->view->stories = $stories; - $this->view->allPlans = $allPlans; - $this->view->summary = $this->product->summary($stories); - $this->view->orderBy = $orderBy; - $this->view->type = $this->session->projectStoryBrowseType; - $this->view->param = $param; - $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink')); - $this->view->tabID = 'story'; - $this->view->storyTasks = $storyTasks; - $this->view->storyBugs = $storyBugs; - $this->view->storyCases = $storyCases; - $this->view->users = $users; - $this->view->pager = $pager; - $this->view->branchGroups = $branchGroups; + $this->view->title = $title; + $this->view->position = $position; + $this->view->productID = $productID; + $this->view->project = $project; + $this->view->stories = $stories; + $this->view->allPlans = $allPlans; + $this->view->summary = $this->product->summary($stories); + $this->view->orderBy = $orderBy; + $this->view->type = $this->session->projectStoryBrowseType; + $this->view->param = $param; + $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink')); + $this->view->tabID = 'story'; + $this->view->storyTasks = $storyTasks; + $this->view->storyBugs = $storyBugs; + $this->view->storyCases = $storyCases; + $this->view->users = $users; + $this->view->pager = $pager; + $this->view->branchGroups = $branchGroups; + $this->view->changeAllowed = $changeAllowed; $this->display(); } @@ -933,6 +938,10 @@ class project extends control $project = $this->commonAction($projectID); $projectID = $project->id; + /* Determines whether an object is editable. */ + $changeAllowed = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = pager::init($recTotal, $recPerPage, $pageID); @@ -942,17 +951,18 @@ class project extends control $tasks = $this->testtask->getProjectTasks($projectID, $orderBy, $pager); foreach($tasks as $key => $task) $productTasks[$task->product][] = $task; - $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common; - $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]); - $this->view->position[] = $this->lang->testtask->common; - $this->view->project = $project; - $this->view->projectID = $projectID; - $this->view->projectName = $this->projects[$projectID]; - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->tasks = $productTasks; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); - $this->view->products = $this->loadModel('product')->getPairs(); + $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common; + $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]); + $this->view->position[] = $this->lang->testtask->common; + $this->view->project = $project; + $this->view->projectID = $projectID; + $this->view->projectName = $this->projects[$projectID]; + $this->view->pager = $pager; + $this->view->orderBy = $orderBy; + $this->view->tasks = $productTasks; + $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); + $this->view->products = $this->loadModel('product')->getPairs(); + $this->view->changeAllowed = $changeAllowed; $this->display(); } diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 40811dea4c..d198df8f4f 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -119,7 +119,7 @@ $canBatchUnlink = common::hasPriv('project', 'batchUnlinkStory'); $canBatchToTask = common::hasPriv('story', 'batchToTask'); - $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask); + $canBatchAction = ($changeAllowed and ($canBatchEdit or $canBatchClose or $canBatchChangeStage or $canBatchUnlink or $canBatchToTask)); ?> id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -149,16 +149,13 @@ $story):?> createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$project->id"); $totalEstimate += $story->estimate; ?> - id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?> + id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id));?> id);?> @@ -199,9 +196,9 @@ id}&story={$story->id}&moduleID={$story->module}"; $lang->task->create = $lang->project->wbs; @@ -221,7 +218,7 @@ $lang->testcase->batchCreate = $lang->testcase->create; if($productID && $hasDBPriv) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap'); - if(common::hasPriv('project', 'unlinkStory', $project)) + if($changeAllowed and common::hasPriv('project', 'unlinkStory', $project)) { $unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->project->unlinkStory}'"); diff --git a/module/project/view/testtask.html.php b/module/project/view/testtask.html.php index 15a068dc73..ed6506631c 100644 --- a/module/project/view/testtask.html.php +++ b/module/project/view/testtask.html.php @@ -49,7 +49,7 @@ recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - + '> > '; From 8eb9b0afb83897e7dcd8e1b1432f20d9027f2ea2 Mon Sep 17 00:00:00 2001 From: z Date: Mon, 16 Nov 2020 08:58:44 +0800 Subject: [PATCH 106/187] * adjust code. --- module/bug/view/resolve.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index 2243989203..7285e9ecb5 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -49,8 +49,8 @@ js::set('productID' , $bug->product); From 0c1c00c1607b2bf982720efd28f1699b7330b5ee Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Mon, 16 Nov 2020 10:12:38 +0800 Subject: [PATCH 111/187] * View todo start-end times display in one line. --- module/todo/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/todo/view/view.html.php b/module/todo/view/view.html.php index edb8be36cf..01146e73a6 100644 --- a/module/todo/view/view.html.php +++ b/module/todo/view/view.html.php @@ -141,7 +141,7 @@
      testtask->product);?> @@ -73,10 +73,6 @@ $productTasks):?> -
      @@ -86,7 +82,7 @@ - id => sprintf('%03d', $task->id)), '', $disabled);?> + id => sprintf('%03d', $task->id)));?> id);?> diff --git a/module/story/model.php b/module/story/model.php index cc898f8a6d..a2117a4bc7 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3094,8 +3094,7 @@ class storyModel extends model case 'id': if($canBatchAction) { - $disabled = $changeAllowed ? '' : 'disabled'; - echo html::checkbox('storyIdList', array($story->id => ''), '', $disabled) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); + echo html::checkbox('storyIdList', array($story->id => ''), '') . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); } else { @@ -3216,9 +3215,9 @@ class storyModel extends model echo $story->version; break; case 'actions': + $vars = "story={$story->id}"; if($changeAllowed) { - $vars = "story={$story->id}"; common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); common::printIcon('story', 'review', $vars, $story, 'list', 'glasses'); common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); @@ -3226,6 +3225,10 @@ class storyModel extends model if($this->config->global->flow != 'onlyStory') common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap'); common::printIcon('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=0&storyID=$story->id", $story, 'list', 'treemap-alt', '', '', '', '', $this->lang->story->subdivide); } + else + { + common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + } break; } echo ' - - +
      +
      From 97e2891c4ab41415fb6043a8a72e40b126a5c621 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Mon, 16 Nov 2020 09:00:56 +0800 Subject: [PATCH 107/187] * Fix bug. --- module/story/model.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/module/story/model.php b/module/story/model.php index 33e4b79dca..157efbfb4f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1447,17 +1447,19 @@ class storyModel extends model $task->openedBy = $this->app->user->account; $task->openedDate = $now; - foreach($data->field as $field) + if(isset($data->field)) { - $task->$field = $story->$field; - - if($field == 'assignedTo') $task->assignedDate = $now; - if($field == 'spec') + foreach($data->field as $field) { - unset($task->$field); - $task->desc = $story->$field; - } + $task->$field = $story->$field; + if($field == 'assignedTo') $task->assignedDate = $now; + if($field == 'spec') + { + unset($task->$field); + $task->desc = $story->$field; + } + } } $this->dao->insert(TABLE_TASK)->data($task) From 5ca98d0eee62f452d8f81e49d1c9075a8fee7754 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 16 Nov 2020 09:13:06 +0800 Subject: [PATCH 108/187] * Finish task #8194. --- module/common/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/common/model.php b/module/common/model.php index f64440276f..ca78684739 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1863,7 +1863,8 @@ EOD; } /* Check the project is closed. */ - if(strpos('story|bug|testtask', $module) === false and !empty($object->project) and is_numeric($object->project) and !empty($config->global->closedProjectStatus)) + $productModuleList = array('story', 'bug', 'testtask'); + if(!in_array($module, $productModuleList) and !empty($object->project) and is_numeric($object->project) and !empty($config->global->closedProjectStatus)) { $project = $app->control->loadModel('project')->getByID($object->project); if($project->status == 'closed') return false; From fdc986d12f61543deab162187e970dd399769fa5 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Mon, 16 Nov 2020 09:18:58 +0800 Subject: [PATCH 109/187] * Edit comment. --- module/job/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/job/model.php b/module/job/model.php index e97931de37..d2663553a2 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -43,7 +43,7 @@ class jobModel extends model } /** - * Get list by triggerType field + * Get list by triggerType field. * * @param string $triggerType * @param array $repoIdList From 07030443ccc6e64352811d32949dbcc87a2d6b8b Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Mon, 16 Nov 2020 09:42:32 +0800 Subject: [PATCH 110/187] * Fix bug. --- module/job/view/edit.html.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 0baae7783a..082f31d7f7 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -122,6 +122,14 @@ +
      + job->paramName; ?> + + job->paramValue; ?> + + + +
      - + From c0e6591afedc0736b12b1485adf29b6df47e9186 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Mon, 16 Nov 2020 10:55:41 +0800 Subject: [PATCH 112/187] * Adjust code style. --- module/project/js/story.js | 15 +++++++++++++++ module/project/view/story.html.php | 2 ++ module/story/model.php | 6 ------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/module/project/js/story.js b/module/project/js/story.js index a192075d65..2279deb81d 100644 --- a/module/project/js/story.js +++ b/module/project/js/story.js @@ -40,6 +40,21 @@ $(function() }); }) + /* Judge required. */ + $('#batchToTask #submit').on('click', function () + { + var message = ''; + if($('#batchToTask #type').val() == '') message = typeError; + + if($('#batchToTask #hourPointValue').val() == '') message += workingHourError; + + if(message) + { + alert(message); + return false; + } + }) + $('.sorter-false a').unwrap(); }); diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 4807371c69..b880282c8b 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -17,6 +17,8 @@ cookie->storyProductParam);?> cookie->storyBranchParam));?> project->confirmUnlinkStory)?> +lang->error->notempty, $this->lang->task->type))?> +lang->error->notempty, $this->lang->workingHour))?> $story):?> createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$project->id"); - $totalEstimate += $story->estimate; + $storyLink = $this->createLink('story', 'view', "storyID=$story->id&version=$story->version&from=project¶m=$project->id"); + $totalEstimate += $story->estimate; ?> diff --git a/module/doc/view/create.html.php b/module/doc/view/create.html.php index d0438e8ff9..48a579d74e 100644 --- a/module/doc/view/create.html.php +++ b/module/doc/view/create.html.php @@ -86,10 +86,10 @@ diff --git a/module/doc/view/edit.html.php b/module/doc/view/edit.html.php index b73426ff4f..e9ce3e1968 100644 --- a/module/doc/view/edit.html.php +++ b/module/doc/view/edit.html.php @@ -63,10 +63,10 @@ diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index 9dd346c606..810da61349 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -87,10 +87,10 @@ From d974dbf169bb4af71b702817a13199bcd2680b38 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 13:19:49 +0800 Subject: [PATCH 124/187] * Finish task #8413. --- module/task/js/start.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/task/js/start.js b/module/task/js/start.js index 6242bbbcf8..034f6c87a7 100644 --- a/module/task/js/start.js +++ b/module/task/js/start.js @@ -11,7 +11,10 @@ function checkLeft() alert(noticeTaskStart); result = false; } - else result = confirm(confirmFinish); + else + { + result = confirm(confirmFinish); + } if(!result) setTimeout(function() {$.enableForm()}, 50); return result; } From ff1e2ac04b131ab105df07192e58570e191fc93a Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 13:32:44 +0800 Subject: [PATCH 125/187] * Finsh task #8411. --- module/story/control.php | 5 ++--- module/story/lang/de.php | 1 + module/story/lang/en.php | 1 + module/story/lang/fr.php | 1 + module/story/lang/vi.php | 1 + module/story/lang/zh-cn.php | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 9d126604b0..75044e78c6 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1063,7 +1063,7 @@ class story extends control } /** - * Batch conversion of stories into tasks. + * Batch stories convert to tasks. * * @param int $projectID * @access public @@ -1076,8 +1076,7 @@ class story extends control $this->story->batchToTask($projectID); if(dao::isError()) die(js::error(dao::getError()) . js::locate('back')); - - if(!dao::isError()) die(js::alert($this->lang->saveSuccess) . js::locate($this->createLink('project', 'task', "projectID=$projectID"), 'parent')); + die(js::alert($this->lang->story->successToTask) . js::locate($this->createLink('project', 'task', "projectID=$projectID"), 'parent')); } } diff --git a/module/story/lang/de.php b/module/story/lang/de.php index b2b835f7bb..09ec423fa3 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -64,6 +64,7 @@ $lang->story->batchToTask = 'Batch Convert to Task'; $lang->story->skipStory = '%s is a parent story. It cannot be closed.'; $lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks."; +$lang->story->successToTask = "Converted to task." $lang->story->common = 'Story'; $lang->story->id = 'ID'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 145611d3a1..d62f2c7b17 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -64,6 +64,7 @@ $lang->story->batchToTask = 'Batch Convert to Task'; $lang->story->skipStory = '%s is a parent story. It cannot be closed.'; $lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks."; +$lang->story->successToTask = "Converted to task." $lang->story->common = 'Story'; $lang->story->id = 'ID'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 93285e1ce5..115be96898 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -64,6 +64,7 @@ $lang->story->batchToTask = 'Batch Convert to Task'; $lang->story->skipStory = '%s is a parent story. It cannot be closed.'; $lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks."; +$lang->story->successToTask = "Converted to task." $lang->story->common = 'Story'; $lang->story->id = 'ID'; diff --git a/module/story/lang/vi.php b/module/story/lang/vi.php index af2feee8de..9b9a2b80e4 100644 --- a/module/story/lang/vi.php +++ b/module/story/lang/vi.php @@ -64,6 +64,7 @@ $lang->story->batchToTask = 'Batch Convert to Task'; $lang->story->skipStory = '%s is a parent story. It cannot be closed.'; $lang->story->closedStory = 'Story %s is closed and will not be closed.'; $lang->story->batchToTaskTips = "This action will create a task with the same name as the selected {$lang->storyCommon} and link {$lang->storyCommon} to the task. The closed {$lang->storyCommon} will not be converted into tasks."; +$lang->story->successToTask = "Converted to task." $lang->story->common = 'Câu chuyện'; $lang->story->id = 'ID'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 6844fba9a9..c3d0b931e9 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -64,6 +64,7 @@ $lang->story->batchToTask = '批量转任务'; $lang->story->skipStory = '需求:%s 为父需求,将不会被关闭。'; $lang->story->closedStory = '需求:%s 已关闭,将不会被关闭。'; $lang->story->batchToTaskTips = "此操作会创建与所选{$lang->storyCommon}同名的任务,并将{$lang->storyCommon}关联到任务中,已关闭的需求不会转为任务。"; +$lang->story->successToTask = '批量转任务成功'; $lang->story->common = $lang->storyCommon; $lang->story->id = '编号'; From 983927b6b94bc38658143b1dcb48cdf1b9d5d858 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 17 Nov 2020 13:37:25 +0800 Subject: [PATCH 126/187] * Finish task#8395. --- module/extension/lang/de.php | 2 +- module/extension/lang/en.php | 2 +- module/extension/lang/fr.php | 2 +- module/extension/lang/vi.php | 2 +- module/extension/lang/zh-cn.php | 2 +- module/extension/lang/zh-tw.php | 2 +- module/extension/model.php | 12 ++++++------ module/extension/view/browse.html.php | 11 +++++------ 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/module/extension/lang/de.php b/module/extension/lang/de.php index f692487ef2..d19f603477 100644 --- a/module/extension/lang/de.php +++ b/module/extension/lang/de.php @@ -51,7 +51,7 @@ $lang->extension->downloads = 'Downloads'; $lang->extension->compatible = 'Kompatibilität'; $lang->extension->grade = 'Wertung'; $lang->extension->depends = 'Benötigt'; -$lang->extension->expireDate = 'Verfällt'; +$lang->extension->expiredDate = 'Verfällt'; $lang->extension->zentaoCompatible = 'Kompatible Version'; $lang->extension->installedTime = 'Installationszeit'; $lang->extension->life = 'lifetime'; diff --git a/module/extension/lang/en.php b/module/extension/lang/en.php index b2c0feb24c..5b0ca26401 100644 --- a/module/extension/lang/en.php +++ b/module/extension/lang/en.php @@ -51,7 +51,7 @@ $lang->extension->downloads = 'Downloads'; $lang->extension->compatible = 'Compatibility'; $lang->extension->grade = 'Score'; $lang->extension->depends = 'Dependency'; -$lang->extension->expireDate = 'Expire'; +$lang->extension->expiredDate = 'Expire'; $lang->extension->zentaoCompatible = 'Compatible Version'; $lang->extension->installedTime = 'Installed Time'; $lang->extension->life = 'lifetime'; diff --git a/module/extension/lang/fr.php b/module/extension/lang/fr.php index 2ac2c48056..b383567c32 100644 --- a/module/extension/lang/fr.php +++ b/module/extension/lang/fr.php @@ -51,7 +51,7 @@ $lang->extension->downloads = 'Téléchargements'; $lang->extension->compatible = 'Compatibilité'; $lang->extension->grade = 'Score'; $lang->extension->depends = 'Dépendence'; -$lang->extension->expireDate = 'Expire le'; +$lang->extension->expiredDate = 'Expire le'; $lang->extension->zentaoCompatible = 'Version Compatible'; $lang->extension->installedTime = 'Date Installation'; $lang->extension->life = 'lifetime'; diff --git a/module/extension/lang/vi.php b/module/extension/lang/vi.php index 01c7a938c4..9336613174 100644 --- a/module/extension/lang/vi.php +++ b/module/extension/lang/vi.php @@ -51,7 +51,7 @@ $lang->extension->downloads = 'Downloads'; $lang->extension->compatible = 'Compatibility'; $lang->extension->grade = 'Điểm'; $lang->extension->depends = 'Dependency'; -$lang->extension->expireDate = 'Expire'; +$lang->extension->expiredDate = 'Expire'; $lang->extension->zentaoCompatible = 'Compatible Version'; $lang->extension->installedTime = 'Installed Time'; $lang->extension->life = 'lifetime'; diff --git a/module/extension/lang/zh-cn.php b/module/extension/lang/zh-cn.php index a157584c4d..6f64bbc913 100644 --- a/module/extension/lang/zh-cn.php +++ b/module/extension/lang/zh-cn.php @@ -51,7 +51,7 @@ $lang->extension->downloads = '下载量'; $lang->extension->compatible = '兼容性'; $lang->extension->grade = '评分'; $lang->extension->depends = '依赖'; -$lang->extension->expireDate = '到期日期'; +$lang->extension->expiredDate = '到期日期'; $lang->extension->zentaoCompatible = '适用版本'; $lang->extension->installedTime = '安装时间'; $lang->extension->life = '终身'; diff --git a/module/extension/lang/zh-tw.php b/module/extension/lang/zh-tw.php index 9298092656..7b3ea70b8f 100644 --- a/module/extension/lang/zh-tw.php +++ b/module/extension/lang/zh-tw.php @@ -51,7 +51,7 @@ $lang->extension->downloads = '下載量'; $lang->extension->compatible = '兼容性'; $lang->extension->grade = '評分'; $lang->extension->depends = '依賴'; -$lang->extension->expireDate = '到期日期'; +$lang->extension->expiredDate = '到期日期'; $lang->extension->zentaoCompatible = '適用版本'; $lang->extension->installedTime = '安裝時間'; $lang->extension->life = '終身'; diff --git a/module/extension/model.php b/module/extension/model.php index bf05963faf..9ab0ddfcc3 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -886,16 +886,16 @@ class extensionModel extends model /** * Get extension expire date. - * + * * @param int $extension * @access public - * @return void + * @return string */ public function getExpireDate($extension) { $licencePath = $this->app->getConfigRoot() . 'license/'; $today = date('Y-m-d'); - $expireDate = ''; + $expiredDate = ''; $licenceOrderFiles = glob($licencePath . 'order*' . $extension->code . $extension->version . '.txt'); foreach($licenceOrderFiles as $licenceOrderFile) @@ -908,14 +908,14 @@ class extensionModel extends model if($order->type == 'demo') $days = 31; if($order->type == 'year') $days = 365; $startDate = $order->paidDate != '0000-00-00 00:00:00' ? $order->paidDate : $order->createdDate; - if($days) $expireDate = date('Y-m-d', strtotime($startDate) + $days * 24 * 3600); + if($days) $expiredDate = date('Y-m-d', strtotime($startDate) + $days * 24 * 3600); } else { - $expireDate = $order->type; + $expiredDate = $order->type; } } - return $expireDate; + return $expiredDate; } } diff --git a/module/extension/view/browse.html.php b/module/extension/view/browse.html.php index 59bed96653..743a7b6952 100644 --- a/module/extension/view/browse.html.php +++ b/module/extension/view/browse.html.php @@ -54,14 +54,13 @@ extension->version}: {$extension->version} "; echo "{$lang->extension->author}: {$extension->author} "; - $expireDate = $this->extension->getExpireDate($extension); - - if(!empty($expireDate)) + $expiredDate = $this->extension->getExpireDate($extension); + if(!empty($expiredDate)) { - echo $lang->extension->expireDate . ': '; - if($expireDate != 'life') echo "{$expireDate}"; - else echo "{$lang->extension->life}"; + echo $lang->extension->expiredDate . ': '; + $expiredDate != 'life' ? echo "{$expiredDate}" : echo "{$lang->extension->life}"; } + ?> From 9d237be691d0906a223f3f0c9ba4d94d8c54a71e Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Tue, 17 Nov 2020 13:21:31 +0800 Subject: [PATCH 127/187] * Finish task#8380. --- module/bug/model.php | 1 + module/story/control.php | 1 + 2 files changed, 2 insertions(+) diff --git a/module/bug/model.php b/module/bug/model.php index 4643862271..3c9f5dad23 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1606,6 +1606,7 @@ class bugModel extends model * Get bugs of a story. * * @param int $storyID + * @param int $projectID * @access public * @return array */ diff --git a/module/story/control.php b/module/story/control.php index 75044e78c6..e3a5347265 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -1234,6 +1234,7 @@ class story extends control * Bugs of a story. * * @param int $storyID + * @param int $projectID * @access public * @return void */ From b100ddeb0d58857c494e788ad451921660311bcb Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Tue, 17 Nov 2020 13:45:36 +0800 Subject: [PATCH 128/187] * Finish task#8398. --- module/job/view/create.html.php | 12 ++++++------ module/job/view/edit.html.php | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php index 57f0345e31..b464750d7d 100644 --- a/module/job/view/create.html.php +++ b/module/job/view/create.html.php @@ -90,12 +90,12 @@ diff --git a/module/job/view/edit.html.php b/module/job/view/edit.html.php index 082f31d7f7..aadc358efd 100644 --- a/module/job/view/edit.html.php +++ b/module/job/view/edit.html.php @@ -114,21 +114,21 @@ From 526d2c1e757157095e4460ad5da8a1c86c7463f9 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 17 Nov 2020 13:47:16 +0800 Subject: [PATCH 129/187] * Finish task#8416. --- module/task/control.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/module/task/control.php b/module/task/control.php index cb5aa720ac..ccbce0d2af 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -738,16 +738,12 @@ class task extends control die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent')); } - $users = $this->loadModel('user')->getPairs('noletter'); - $members = $this->loadModel('project')->getTeamMemberPairs($task->project, 'nodeleted'); - $assignedTo = in_array(zget($this->app->user->account, $users), $members) === TRUE ? $this->app->user->account : ''; - $this->view->title = $this->view->project->name . $this->lang->colon .$this->lang->task->start; $this->view->position[] = $this->lang->task->start; - $this->view->users = $users; - $this->view->members = $members; - $this->view->assignedTo = $task->assignedTo == '' ? $assignedTo : $task->assignedTo; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->members = $this->loadModel('project')->getTeamMemberPairs($task->project, 'nodeleted'); + $this->view->assignedTo = $task->assignedTo == '' ? $this->app->user->account : $task->assignedTo; $this->display(); } From bb34dfe79b36cb495a266dc863851a3bcf8e67dc Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 17 Nov 2020 14:04:50 +0800 Subject: [PATCH 130/187] * Finish task #8378. --- module/bug/view/browse.html.php | 6 +++--- module/bug/view/view.html.php | 2 +- module/common/model.php | 4 ++-- module/custom/control.php | 4 ++-- module/custom/lang/de.php | 8 ++++---- module/custom/lang/en.php | 8 ++++---- module/custom/lang/fr.php | 8 ++++---- module/custom/lang/vi.php | 8 ++++---- module/custom/lang/zh-cn.php | 8 ++++---- module/custom/lang/zh-tw.php | 8 ++++---- module/custom/view/product.html.php | 4 ++-- module/custom/view/project.html.php | 4 ++-- module/doc/control.php | 8 ++++---- module/product/view/browse.html.php | 6 +++--- module/product/view/roadmap.html.php | 2 +- module/productplan/view/browse.html.php | 4 ++-- module/release/view/browse.html.php | 4 ++-- module/story/view/view.html.php | 2 +- module/testcase/view/browse.html.php | 2 +- module/testcase/view/caseheader.html.php | 4 ++-- module/testcase/view/groupcase.html.php | 2 +- module/testreport/control.php | 4 ++-- module/testsuite/view/browse.html.php | 4 ++-- module/testtask/view/browse.html.php | 4 ++-- module/testtask/view/browseunits.html.php | 2 +- module/tree/control.php | 4 ++-- 26 files changed, 62 insertions(+), 62 deletions(-) diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 7b7d20c1df..150243cbfc 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -117,7 +117,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow ?> - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> " . $lang->bug->batchCreate, '', "class='btn btn-secondary'"); @@ -189,7 +189,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow

      bug->noBug;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('bug', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('bug', 'create')):?> createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID"), " " . $lang->bug->create, '', "class='btn btn-info'");?>

      @@ -211,7 +211,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBeChanged = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBeChanged = (!empty($config->CRProduct) or $product->status != 'closed'); $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index a79713b707..540516b9cb 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -30,7 +30,7 @@
      - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> product}&branch={$bug->branch}&extra=moduleID={$bug->module}", "" . $lang->bug->create, '', "class='btn btn-primary'"); ?>
      diff --git a/module/common/model.php b/module/common/model.php index ca78684739..aed653968a 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1855,7 +1855,7 @@ EOD; global $app, $config; /* Check the product is closed. */ - if(!empty($object->product) and is_numeric($object->product) and !empty($config->global->closedProductStatus)) + if(!empty($object->product) and is_numeric($object->product) and empty($config->CRProduct)) { $productID = trim($object->product, ','); $product = $app->control->loadModel('product')->getByID($productID); @@ -1864,7 +1864,7 @@ EOD; /* Check the project is closed. */ $productModuleList = array('story', 'bug', 'testtask'); - if(!in_array($module, $productModuleList) and !empty($object->project) and is_numeric($object->project) and !empty($config->global->closedProjectStatus)) + if(!in_array($module, $productModuleList) and !empty($object->project) and is_numeric($object->project) and empty($config->CRProject)) { $project = $app->control->loadModel('project')->getByID($object->project); if($project->status == 'closed') return false; diff --git a/module/custom/control.php b/module/custom/control.php index 903b0edf79..0d1ce6e3b9 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -357,7 +357,7 @@ class custom extends control { if($_POST) { - $this->loadModel('setting')->setItem('system.common.global.closedProjectStatus', $this->post->project); + $this->loadModel('setting')->setItem('system.common.CRProject', $this->post->project); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); } @@ -377,7 +377,7 @@ class custom extends control { if($_POST) { - $this->loadModel('setting')->setItem('system.common.global.closedProductStatus', $this->post->product); + $this->loadModel('setting')->setItem('system.common.CRProduct', $this->post->product); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); } diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 6cf9a0d17f..00ca85b3c4 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -153,11 +153,11 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index d46abe9390..b498f8c401 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -153,11 +153,11 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 1a3dc44bd5..8553c5fe0e 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -153,11 +153,11 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; diff --git a/module/custom/lang/vi.php b/module/custom/lang/vi.php index 701bf485e0..2bb76b482d 100644 --- a/module/custom/lang/vi.php +++ b/module/custom/lang/vi.php @@ -153,11 +153,11 @@ $lang->custom->page = ''; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Kế hoạch'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 86bbbe20d4..7b492bc642 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -153,11 +153,11 @@ $lang->custom->page = '页面'; $lang->custom->scoreStatus[1] = '开启'; $lang->custom->scoreStatus[0] = '关闭'; -$lang->custom->closedProjectStatus[1] = '禁止修改'; -$lang->custom->closedProjectStatus[0] = '允许修改'; +$lang->custom->CRProject[1] = '禁止修改'; +$lang->custom->CRProject[0] = '允许修改'; -$lang->custom->closedProductStatus[1] = '禁止修改'; -$lang->custom->closedProductStatus[0] = '允许修改'; +$lang->custom->CRProduct[1] = '禁止修改'; +$lang->custom->CRProduct[0] = '允许修改'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '计划'; diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php index f08b4a3b39..edf42f5035 100644 --- a/module/custom/lang/zh-tw.php +++ b/module/custom/lang/zh-tw.php @@ -153,11 +153,11 @@ $lang->custom->page = '頁面'; $lang->custom->scoreStatus[1] = '開啟'; $lang->custom->scoreStatus[0] = '關閉'; -$lang->custom->closedProjectStatus[1] = '禁止修改'; -$lang->custom->closedProjectStatus[0] = '允許修改'; +$lang->custom->CRProject[1] = '禁止修改'; +$lang->custom->CRProject[0] = '允許修改'; -$lang->custom->closedProductStatus[1] = '禁止修改'; -$lang->custom->closedProductStatus[0] = '允許修改'; +$lang->custom->CRProduct[1] = '禁止修改'; +$lang->custom->CRProduct[0] = '允許修改'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '計劃'; diff --git a/module/custom/view/product.html.php b/module/custom/view/product.html.php index 716c377e09..b1c064d45b 100644 --- a/module/custom/view/product.html.php +++ b/module/custom/view/product.html.php @@ -21,8 +21,8 @@ diff --git a/module/custom/view/project.html.php b/module/custom/view/project.html.php index 735bc35510..73b00ed52e 100644 --- a/module/custom/view/project.html.php +++ b/module/custom/view/project.html.php @@ -21,8 +21,8 @@ diff --git a/module/doc/control.php b/module/doc/control.php index 1199c0d555..5f0cdc16e9 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -756,8 +756,8 @@ class doc extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $canBeChanged = false; - if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $canBeChanged = false; + if($type == 'product' and empty($this->config->CRProduct) and $object->status == 'closed') $canBeChanged = false; + if($type == 'project' and empty($this->config->CRProject) and $object->status == 'closed') $canBeChanged = false; /* According the from, set menus. */ if($this->from == 'product') @@ -856,8 +856,8 @@ class doc extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $canBeChanged = false; - if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $canBeChanged = false; + if($type == 'product' and empty($this->config->CRProduct) and $object->status == 'closed') $canBeChanged = false; + if($type == 'project' and empty($this->config->CRProject) and $object->status == 'closed') $canBeChanged = false; if($from == 'product') { diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 8a4d07e12f..5b30688c39 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -94,7 +94,7 @@ js::set('foldAll', $lang->project->treeLevel['root']); ?> - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> createLink('story', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$moduleID"), " {$lang->story->batchCreate}", '', "class='btn btn btn-secondary'");?> project->treeLevel['root']);

      story->noStory;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('story', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('story', 'create')):?> createLink('story', 'create', "productID={$productID}&branch={$branch}&moduleID={$moduleID}"), " " . $lang->story->create, '', "class='btn btn-info'");?>

      @@ -189,7 +189,7 @@ js::set('foldAll', $lang->project->treeLevel['root']); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBeChanged = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBeChanged = (!empty($config->CRProduct) or $product->status != 'closed'); $canBatchEdit = ($canBeChanged and common::hasPriv('story', 'batchEdit')); $canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'); $canBatchReview = ($canBeChanged and common::hasPriv('story', 'batchReview')); diff --git a/module/product/view/roadmap.html.php b/module/product/view/roadmap.html.php index 4fdeee1b9c..90ebd428d0 100644 --- a/module/product/view/roadmap.html.php +++ b/module/product/view/roadmap.html.php @@ -41,7 +41,7 @@

      release->noRelease;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> createLink('release', 'create', "productID=$product->id&branch=$branchKey"), " " . $lang->release->create, '', "class='btn btn-info'");?>

      diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 242a8cd17e..68e197cac0 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -24,7 +24,7 @@
      - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> id&branch=$branch", " {$lang->productplan->create}", '', "class='btn btn-primary'");?>
      @@ -34,7 +34,7 @@

      productplan->noPlan;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('productplan', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('productplan', 'create')):?> createLink('productplan', 'create', "productID=$product->id&branch=$branch"), " " . $lang->productplan->create, '', "class='btn btn-info'");?>

      diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index ff8213e84f..48ddcbc5fd 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -22,7 +22,7 @@ ?>
      - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> id&branch=$branch", " {$lang->release->create}", '', "class='btn btn-primary'");?>
      @@ -32,7 +32,7 @@

      release->noRelease;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> createLink('release', 'create', "productID=$product->id&branch=$branch"), " " . $lang->release->create, '', "class='btn btn-info'");?>

      diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index a29b2054d7..19a9a8a205 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -47,7 +47,7 @@
      - config->global->closedProductStatus) or $product->status != 'closed'): ?> + config->CRProduct) or $product->status != 'closed'): ?> product}&branch={$story->branch}&moduleID={$story->module}", "" . $lang->story->create, '', "class='btn btn-primary'"); ?>
      diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 8ab3aa076c..ac5cdc8183 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -47,7 +47,7 @@ js::set('suiteID', $suiteID);

      testcase->noCase;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('testcase', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('testcase', 'create')):?> createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule"), " " . $lang->testcase->create, '', "class='btn btn-info'");?> diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index e16a07caf6..418d056822 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -44,7 +44,7 @@ echo "

      "; echo html::a('javascript:;', $currentLable . " ", '', "class='btn btn-link' data-toggle='dropdown'"); - if(empty($this->config->global->closedProductStatus) or $product->status != 'closed') + if(!empty($this->config->CRProduct) or $product->status != 'closed') { echo "
      - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?>
      - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?>
      " . $lang->testtask->create, '', "class='btn btn-primary'");?>
      @@ -58,7 +58,7 @@ $status = $this->session->testTaskVersionStatus;

      testtask->noTesttask;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('testtask', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('testtask', 'create')):?> createLink('testtask', 'create', "product=$productID"), " " . $lang->testtask->create, '', "class='btn btn-info'");?>

      diff --git a/module/testtask/view/browseunits.html.php b/module/testtask/view/browseunits.html.php index 8b7840730f..fa234495f6 100644 --- a/module/testtask/view/browseunits.html.php +++ b/module/testtask/view/browseunits.html.php @@ -23,7 +23,7 @@ $label", '', "id='{$key}Tab' class='btn btn-link'");?>
      - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?>
      " . $lang->testtask->importUnitResult, '', "class='btn btn-primary'");?>
      diff --git a/module/tree/control.php b/module/tree/control.php index 26850600ae..c92dfdc9b5 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -45,7 +45,7 @@ class tree extends control $this->view->root = $product; /* Determines whether an object is editable. */ - $canBeChanged = (empty($this->config->global->closedProductStatus) or $product->status != 'closed') ? true : false; + $canBeChanged = (!empty($this->config->CRProduct) or $product->status != 'closed') ? true : false; } elseif(strpos($viewType, 'doc') !== false) { @@ -219,7 +219,7 @@ class tree extends control $this->view->products = $products; /* Determines whether an object is editable. */ - $canBeChanged = (empty($this->config->global->closedProjectStatus) or $project->status != 'closed') ? true : false; + $canBeChanged = (!empty($this->config->CRProject) or $project->status != 'closed') ? true : false; /* Set menu. */ $this->lang->set('menugroup.tree', 'project'); From 4ec88c316d1b8683e1be090045d4410ea69618c7 Mon Sep 17 00:00:00 2001 From: z Date: Tue, 17 Nov 2020 14:07:39 +0800 Subject: [PATCH 131/187] * adjust for realStarted. --- module/task/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index 540b892574..08e54059ec 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1478,7 +1478,7 @@ class taskModel extends model $task = fixer::input('post') ->setIF(is_numeric($this->post->consumed), 'consumed', (float)$this->post->consumed) - ->setIF($oldTask->realStarted == '0000-00-00 00:00:00', 'realStarted', $today) + ->setIF($oldTask->realStarted == '0000-00-00 00:00:00', 'realStarted', $now) ->setDefault('left', 0) ->setDefault('assignedTo', $oldTask->openedBy) ->setDefault('assignedDate', $now) From 581d8b349d195127139914085abab6bbc9e8634b Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 14:14:30 +0800 Subject: [PATCH 132/187] * Finish task #8409. --- module/project/control.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 2196d68261..7c41d5cebb 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1890,8 +1890,16 @@ class project extends control if($confirm == 'no') { /* Get the number of unfinished tasks and unresolved bugs. */ - $unfinishedTasks = $this->dao->select('COUNT(id) AS count')->from(TABLE_TASK)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->andWhere('status')->in('wait,doing')->fetch(); - $unresolvedBugs = $this->dao->select('COUNT(id) AS count')->from(TABLE_BUG)->where('project')->eq($projectID)->andWhere('deleted')->eq(0)->andWhere('status')->eq('active')->fetch(); + $unfinishedTasks = $this->dao->select('COUNT(id) AS count')->from(TABLE_TASK) + ->where('project')->eq($projectID) + ->andWhere('deleted')->eq(0) + ->andWhere('status')->in('wait,doing,pause') + ->fetch(); + $unresolvedBugs = $this->dao->select('COUNT(id) AS count')->from(TABLE_BUG) + ->where('project')->eq($projectID) + ->andWhere('deleted')->eq(0) + ->andWhere('status')->eq('active') + ->fetch(); /* Set prompt information. */ $tips = ''; From 23362073ba3c181020a5258ec73769022aff9953 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 17 Nov 2020 14:15:32 +0800 Subject: [PATCH 133/187] * Finish task #8378. --- module/project/control.php | 14 +++++++------- module/project/view/bug.html.php | 4 ++-- module/project/view/build.html.php | 4 ++-- module/project/view/burn.html.php | 2 +- module/project/view/grouptask.html.php | 4 ++-- module/project/view/manageproducts.html.php | 2 +- module/project/view/story.html.php | 4 ++-- module/project/view/task.html.php | 2 +- module/project/view/testtask.html.php | 4 ++-- module/project/view/tree.html.php | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 2196d68261..f58f4a37a0 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -130,7 +130,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; if($this->cookie->preProjectID != $projectID) { @@ -703,7 +703,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -945,7 +945,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -1065,7 +1065,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; $title = $project->name . $this->lang->colon . $this->lang->project->team; $position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name); @@ -1593,7 +1593,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; $products = $this->project->getProducts($project->id); $linkedBranches = array(); @@ -1664,7 +1664,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; $kanbanGroup = $this->project->getKanbanGroupData($stories, $tasks, $bugs, $type); $kanbanSetting = $this->project->getKanbanSetting(); @@ -1857,7 +1857,7 @@ class project extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; + if(empty($this->config->CRProject) and $project->status == 'closed') $canBeChanged = false; /* Get project's product. */ $productID = 0; diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index f7a151c82b..dc3bf5a839 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -22,7 +22,7 @@
      id", " " . $lang->bug->export, '', "class='btn btn-link export'");?> - config->global->closedProjectStatus) or $project->status != 'closed') common::printLink('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id", " " . $lang->bug->create, '', "class='btn btn-primary'");?> + config->CRProject) or $project->status != 'closed') common::printLink('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id", " " . $lang->bug->create, '', "class='btn btn-primary'");?>
      @@ -31,7 +31,7 @@

      bug->noBug;?> - config->global->closedProjectStatus) or $project->status != 'closed') and common::hasPriv('bug', 'create')):?> + config->CRProject) or $project->status != 'closed') and common::hasPriv('bug', 'create')):?> createLink('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id"), " " . $lang->bug->create, '', "class='btn btn-info'");?>

      diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 856edb982c..62fe6a7d18 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -29,7 +29,7 @@
      project->byQuery;?>
      - config->global->closedProjectStatus) or $project->status != 'closed') common::printLink('build', 'create', "project=$project->id", " " . $lang->build->create, '', "class='btn btn-primary'");?> + config->CRProject) or $project->status != 'closed') common::printLink('build', 'create', "project=$project->id", " " . $lang->build->create, '', "class='btn btn-primary'");?>
      @@ -38,7 +38,7 @@

      build->noBuild;?> - config->global->closedProjectStatus) or $project->status != 'closed') and common::hasPriv('build', 'create')):?> + config->CRProject) or $project->status != 'closed') and common::hasPriv('build', 'create')):?> createLink('build', 'create', "project=$project->id"), " " . $lang->build->create, '', "class='btn btn-info'");?>

      diff --git a/module/project/view/burn.html.php b/module/project/view/burn.html.php index c93eb2c1d2..6eb3e3385b 100644 --- a/module/project/view/burn.html.php +++ b/module/project/view/burn.html.php @@ -25,7 +25,7 @@ common::printLink('project', 'computeBurn', 'reload=yes', ' ' . $lang->project->computeBurn, 'hiddenwin', "title='{$lang->project->computeBurn}{$lang->project->burn}' class='btn btn-primary' id='computeBurn'"); echo '
      '; echo html::a($this->createLink('project', 'burn', "projectID=$projectID&type=$weekend&interval=$interval"), $lang->project->$weekend, '', "class='btn btn-link'"); - if(empty($this->config->global->closedProjectStatus) or $project->status != 'closed') common::printLink('project', 'fixFirst', "project=$project->id", $lang->project->fixFirst, '', "class='btn btn-link iframe' data-width='700'"); + if(!empty($this->config->CRProject) or $project->status != 'closed') common::printLink('project', 'fixFirst', "project=$project->id", $lang->project->fixFirst, '', "class='btn btn-link iframe' data-width='700'"); echo $lang->project->howToUpdateBurn; ?> diff --git a/module/project/view/grouptask.html.php b/module/project/view/grouptask.html.php index 9ec86748fd..53cb155ac2 100644 --- a/module/project/view/grouptask.html.php +++ b/module/project/view/grouptask.html.php @@ -53,7 +53,7 @@ ?>
      - config->global->closedProjectStatus) or $project->status != 'closed'):?> + config->CRProject) or $project->status != 'closed'):?>
      todo->beginAndEnd?>config->begin . " ~ " . $todo->config->end;?>config->begin . " ~ " . $todo->config->end;?>
      todo->cycleConfig?>
      From 3d73b747515be92a64511a3ab65773843a36ff5f Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 08:17:07 +0800 Subject: [PATCH 116/187] * Modify language items. --- module/build/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/config.php b/module/build/config.php index 86715fa4b7..bcee51e703 100644 --- a/module/build/config.php +++ b/module/build/config.php @@ -13,7 +13,7 @@ global $lang; $config->build->search['module'] = 'build'; $config->build->search['fields']['name'] = $lang->build->name; $config->build->search['fields']['id'] = $lang->build->id; -$config->build->search['fields']['product'] = '所属' . $lang->build->product; +$config->build->search['fields']['product'] = $lang->story->product; $config->build->search['fields']['scmPath'] = $lang->build->scmPath; $config->build->search['fields']['filePath'] = $lang->build->filePath; $config->build->search['fields']['date'] = $lang->build->date; From 48f7bf3bf306e09caf4fb34912b5c4fac9167c79 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 08:41:39 +0800 Subject: [PATCH 117/187] * Adjust code style. --- module/doc/control.php | 4 ---- module/doc/css/view.css | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/module/doc/control.php b/module/doc/control.php index 260e11bd74..dbacb9d029 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -447,10 +447,6 @@ class doc extends control $hyperdown = $this->app->loadClass('hyperdown'); $doc->content = $hyperdown->makeHtml($doc->content); - /* Add a newline attribute to the table. */ - $doc->content = str_replace("", "", $doc->content); - $doc->content = str_replace("", "", $doc->content); - $doc->digest = $hyperdown->makeHtml($doc->digest); } diff --git a/module/doc/css/view.css b/module/doc/css/view.css index 789fb7cf5f..3098bee6e3 100644 --- a/module/doc/css/view.css +++ b/module/doc/css/view.css @@ -19,3 +19,4 @@ .doc-fullscreen .main-row > .side-col {width: 0; position: relative; overflow: hidden} .doc-fullscreen .fullscreen-btn > .icon-fullscreen:before {content: '\e972'} .right-icon a{color: #1183fb} +.cell th,td {word-break: break-word;} From 9607713ad3a9507be4942189318ea493b39b0276 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 08:54:06 +0800 Subject: [PATCH 118/187] * Modify variable name. --- module/git/model.php | 26 +++++++++++++------------- module/svn/model.php | 24 ++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/module/git/model.php b/module/git/model.php index 9a3dda53e6..3ccd32ae29 100644 --- a/module/git/model.php +++ b/module/git/model.php @@ -111,15 +111,15 @@ class gitModel extends model * * @param object $repo * @param array $commentGroup - * @param bool $isPrintLog + * @param bool $printLog * @access public * @return void */ - public function updateCommit($repo, $commentGroup, $isPrintLog = true) + public function updateCommit($repo, $commentGroup, $printLog = true) { /* Load mudule and print log. */ $this->loadModel('repo'); - if($isPrintLog) $this->printLog("begin repo $repo->id"); + if($printLog) $this->printLog("begin repo $repo->id"); if(!$this->setRepo($repo)) return false; @@ -130,17 +130,17 @@ class gitModel extends model /* Update code commit history. */ foreach($branches as $branch) { - if($isPrintLog) $this->printLog("sync branch $branch logs."); + if($printLog) $this->printLog("sync branch $branch logs."); $_COOKIE['repoBranch'] = $branch; - if($isPrintLog) $this->printLog("get this repo logs."); + if($printLog) $this->printLog("get this repo logs."); $lastInDB = $this->repo->getLatestCommit($repo->id); /* Ignore unsynced branch. */ if(empty($lastInDB)) { - if($isPrintLog) $this->printLog("Please init repo {$repo->name}"); + if($printLog) $this->printLog("Please init repo {$repo->name}"); continue; } @@ -149,18 +149,18 @@ class gitModel extends model $objects = array(); if(!empty($logs)) { - if($isPrintLog) $this->printLog("get " . count($logs) . " logs"); - if($isPrintLog) $this->printLog('begin parsing logs'); + if($printLog) $this->printLog("get " . count($logs) . " logs"); + if($printLog) $this->printLog('begin parsing logs'); foreach($logs as $log) { - if($isPrintLog) $this->printLog("parsing log {$log->revision}"); - if($isPrintLog) $this->printLog("comment is\n----------\n" . trim($log->msg) . "\n----------"); + if($printLog) $this->printLog("parsing log {$log->revision}"); + if($printLog) $this->printLog("comment is\n----------\n" . trim($log->msg) . "\n----------"); $objects = $this->repo->parseComment($log->msg); if($objects) { - if($isPrintLog) $this->printLog('extract' . + if($printLog) $this->printLog('extract' . ' story:' . join(' ', $objects['stories']) . ' task:' . join(' ', $objects['tasks']) . ' bug:' . join(',', $objects['bugs'])); @@ -169,7 +169,7 @@ class gitModel extends model } else { - if($isPrintLog) $this->printLog('no objects found' . "\n"); + if($printLog) $this->printLog('no objects found' . "\n"); } /* Create compile by comment. */ @@ -190,7 +190,7 @@ class gitModel extends model $this->repo->updateCommitCount($repo->id, $commits); $this->dao->update(TABLE_REPO)->set('lastSync')->eq(helper::now())->where('id')->eq($repo->id)->exec(); - if($isPrintLog) $this->printLog("\n\nrepo #" . $repo->id . ': ' . $repo->path . " finished"); + if($printLog) $this->printLog("\n\nrepo #" . $repo->id . ': ' . $repo->path . " finished"); } /** diff --git a/module/svn/model.php b/module/svn/model.php index df42d04f96..74fa8ddd36 100644 --- a/module/svn/model.php +++ b/module/svn/model.php @@ -111,26 +111,26 @@ class svnModel extends model * * @param object $repo * @param array $commentGroup - * @param bool $isPrintLog + * @param bool $printLog * @access public * @return void */ - public function updateCommit($repo, $commentGroup, $isPrintLog = true) + public function updateCommit($repo, $commentGroup, $printLog = true) { /* Load mudule and print log. */ $this->loadModel('repo'); - if($isPrintLog) $this->printLog("begin repo {$repo->name}"); + if($printLog) $this->printLog("begin repo {$repo->name}"); if(!$this->setRepo($repo)) return false; /* Print log and get lastInDB. */ - if($isPrintLog) $this->printLog("get this repo logs."); + if($printLog) $this->printLog("get this repo logs."); $lastInDB = $this->repo->getLatestCommit($repo->id); /* Ignore unsynced repo. */ if(empty($lastInDB)) { - if($isPrintLog) $this->printLog("Please init repo {$repo->name}"); + if($printLog) $this->printLog("Please init repo {$repo->name}"); return false; } @@ -141,18 +141,18 @@ class svnModel extends model $objects = array(); if(!empty($logs)) { - if($isPrintLog) $this->printLog("get " . count($logs) . " logs"); - if($isPrintLog) $this->printLog('begin parsing logs'); + if($printLog) $this->printLog("get " . count($logs) . " logs"); + if($printLog) $this->printLog('begin parsing logs'); foreach($logs as $log) { - if($isPrintLog) $this->printLog("parsing log {$log->revision}"); - if($isPrintLog) $this->printLog("comment is\n----------\n" . trim($log->msg) . "\n----------"); + if($printLog) $this->printLog("parsing log {$log->revision}"); + if($printLog) $this->printLog("comment is\n----------\n" . trim($log->msg) . "\n----------"); $objects = $this->repo->parseComment($log->msg); if($objects) { - if($isPrintLog) $this->printLog('extract' . + if($printLog) $this->printLog('extract' . ' story:' . join(' ', $objects['stories']) . ' task:' . join(' ', $objects['tasks']) . ' bug:' . join(',', $objects['bugs'])); @@ -160,7 +160,7 @@ class svnModel extends model } else { - if($isPrintLog) $this->printLog('no objects found' . "\n"); + if($printLog) $this->printLog('no objects found' . "\n"); } /* Create compile by comment. */ @@ -178,7 +178,7 @@ class svnModel extends model $this->repo->updateCommitCount($repo->id, $lastInDB->commit + count($logs)); $this->dao->update(TABLE_REPO)->set('lastSync')->eq(helper::now())->where('id')->eq($repo->id)->exec(); - if($isPrintLog) $this->printLog("\n\nrepo #" . $repo->id . ': ' . $repo->path . " finished"); + if($printLog) $this->printLog("\n\nrepo #" . $repo->id . ': ' . $repo->path . " finished"); } } From 2e9d5d204f7b4b8a2e7b5d093a9b1dea3c39ae90 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 09:00:50 +0800 Subject: [PATCH 119/187] * Modify variable name. --- module/product/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index af646fad27..7b0b98a576 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -38,8 +38,8 @@ class productModel extends model /* init currentModule and currentMethod for report and story. */ if($currentModule == 'story') { - $method = ",create,batchcreate,batchclose,"; - if(strpos($method, "," . $currentMethod . ",") === false) $currentModule = 'product'; + $storyMethods = ",create,batchcreate,batchclose,"; + if(strpos($storyMethods, "," . $currentMethod . ",") === false) $currentModule = 'product'; if($currentMethod == 'view' || $currentMethod == 'change' || $currentMethod == 'review') $currentMethod = 'browse'; } if($currentMethod == 'report') $currentMethod = 'browse'; From 34b41b1daf5ae2b2f99a6075e5087c02f7c57e13 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 13:06:00 +0800 Subject: [PATCH 120/187] * Finish task #8385. --- module/build/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index b0a06424be..3a9157229e 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -58,7 +58,7 @@ class buildModel extends model * @access public * @return array */ - public function getProjectBuilds($projectID, $type, $param) + public function getProjectBuilds($projectID, $type = '', $param = '') { return $this->dao->select('t1.*, t2.name as projectName, t3.name as productName, t4.name as branchName') ->from(TABLE_BUILD)->alias('t1') From ff69596dcd5b7988ebcf66b6acb93c0173d28276 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 17 Nov 2020 13:17:14 +0800 Subject: [PATCH 121/187] * Finish task#8418. --- module/testcase/control.php | 3 --- module/testcase/model.php | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/testcase/control.php b/module/testcase/control.php index 70dd2427b4..d5b4912faf 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -109,8 +109,6 @@ class testcase extends control $actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID"); $this->config->testcase->search['onMenuBar'] = 'yes'; - $libs = $this->loadModel('caselib')->getLibraries(); - $this->config->testcase->search['params']['lib']['values'] = $libs; $this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL); $showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : ''; @@ -140,7 +138,6 @@ class testcase extends control $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); $this->view->suiteID = $suiteID; $this->view->setModule = true; - $this->view->libs = $libs; $this->display(); } diff --git a/module/testcase/model.php b/module/testcase/model.php index 0f5b9f13d4..c9eee5f6fe 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1379,6 +1379,8 @@ class testcaseModel extends model { $this->config->testcase->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->testcase->allProduct); $this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case'); + $this->config->testcase->search['params']['lib']['values'] = $this->loadModel('caselib')->getLibraries(); + if($this->session->currentProductType == 'normal') { unset($this->config->testcase->search['fields']['branch']); From 97770dd00f7dbc975d1d2884ac4370167a462dc1 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 17 Nov 2020 13:17:15 +0800 Subject: [PATCH 122/187] * Finish task #8379. --- module/bug/model.php | 18 +-- module/bug/view/browse.html.php | 16 +- module/build/control.php | 26 +-- module/build/view/view.html.php | 14 +- module/doc/control.php | 44 ++--- module/doc/model.php | 4 +- module/doc/view/objectlibs.html.php | 2 +- module/doc/view/objectlibsbylist.html.php | 2 +- module/doc/view/showfiles.html.php | 4 +- module/my/view/bug.html.php | 6 +- module/my/view/story.html.php | 12 +- module/my/view/task.html.php | 6 +- module/my/view/testcase.html.php | 10 +- module/product/view/browse.html.php | 16 +- module/productplan/control.php | 40 ++--- module/productplan/view/browse.html.php | 6 +- module/productplan/view/view.html.php | 10 +- module/project/control.php | 186 +++++++++++----------- module/project/js/storykanban.js | 2 +- module/project/view/bug.html.php | 8 +- module/project/view/kanban.html.php | 6 +- module/project/view/story.html.php | 6 +- module/project/view/storykanban.html.php | 10 +- module/project/view/task.html.php | 8 +- module/project/view/team.html.php | 6 +- module/project/view/testtask.html.php | 4 +- module/project/view/view.html.php | 4 +- module/release/view/browse.html.php | 4 +- module/release/view/view.html.php | 34 ++-- module/story/model.php | 4 +- module/testcase/model.php | 6 +- module/testreport/control.php | 26 +-- module/testreport/view/browse.html.php | 2 +- module/testsuite/control.php | 20 +-- module/testsuite/view/view.html.php | 8 +- module/testtask/control.php | 60 +++---- module/testtask/view/cases.html.php | 4 +- module/testtask/view/groupcase.html.php | 2 +- module/tree/control.php | 8 +- module/tree/view/browse.html.php | 12 +- module/tree/view/browsetask.html.php | 10 +- 41 files changed, 338 insertions(+), 338 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index dfd5705ccd..4643862271 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2507,16 +2507,16 @@ class bugModel extends model public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable') { /* Check the product is closed. */ - $changeAllowed = common::checkObjectChangeAllowed('bug', $bug); + $canBeChanged = common::checkObjectChangeAllowed('bug', $bug); - $canBatchEdit = ($changeAllowed and common::hasPriv('bug', 'batchEdit')); - $canBatchConfirm = ($changeAllowed and common::hasPriv('bug', 'batchConfirm')); + $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); + $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); - $canBatchActivate = ($changeAllowed and common::hasPriv('bug', 'batchActivate')); - $canBatchChangeBranch = ($changeAllowed and common::hasPriv('bug', 'batchChangeBranch')); - $canBatchChangeModule = ($changeAllowed and common::hasPriv('bug', 'batchChangeModule')); - $canBatchResolve = ($changeAllowed and common::hasPriv('bug', 'batchResolve')); - $canBatchAssignTo = ($changeAllowed and common::hasPriv('bug', 'batchAssignTo')); + $canBatchActivate = ($canBeChanged and common::hasPriv('bug', 'batchActivate')); + $canBatchChangeBranch = ($canBeChanged and common::hasPriv('bug', 'batchChangeBranch')); + $canBatchChangeModule = ($canBeChanged and common::hasPriv('bug', 'batchChangeModule')); + $canBatchResolve = ($canBeChanged and common::hasPriv('bug', 'batchResolve')); + $canBatchAssignTo = ($canBeChanged and common::hasPriv('bug', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo); @@ -2730,7 +2730,7 @@ class bugModel extends model break; case 'actions': $params = "bugID=$bug->id"; - if($changeAllowed) + if($canBeChanged) { common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'list', 'checked', '', 'iframe', true); diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index b37104f9d1..7b7d20c1df 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -211,15 +211,15 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $changeAllowed = (empty($config->global->closedProductStatus) or $product->status != 'closed'); - $canBatchEdit = ($changeAllowed and common::hasPriv('bug', 'batchEdit')); - $canBatchConfirm = ($changeAllowed and common::hasPriv('bug', 'batchConfirm')); + $canBeChanged = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); + $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); - $canBatchActivate = ($changeAllowed and common::hasPriv('bug', 'batchActivate')); - $canBatchChangeBranch = ($changeAllowed and common::hasPriv('bug', 'batchChangeBranch')); - $canBatchChangeModule = ($changeAllowed and common::hasPriv('bug', 'batchChangeModule')); - $canBatchResolve = ($changeAllowed and common::hasPriv('bug', 'batchResolve')); - $canBatchAssignTo = ($changeAllowed and common::hasPriv('bug', 'batchAssignTo')); + $canBatchActivate = ($canBeChanged and common::hasPriv('bug', 'batchActivate')); + $canBatchChangeBranch = ($canBeChanged and common::hasPriv('bug', 'batchChangeBranch')); + $canBatchChangeModule = ($canBeChanged and common::hasPriv('bug', 'batchChangeModule')); + $canBatchResolve = ($canBeChanged and common::hasPriv('bug', 'batchResolve')); + $canBatchAssignTo = ($canBeChanged and common::hasPriv('bug', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchConfirm or $canBatchClose or $canBatchActivate or $canBatchChangeBranch or $canBatchChangeModule or $canBatchResolve or $canBatchAssignTo); ?> diff --git a/module/build/control.php b/module/build/control.php index ee60eb135f..329160c247 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -213,7 +213,7 @@ class build extends control if(!$build) die(js::error($this->lang->notFound) . js::locate('back')); /* Determines whether an object is editable. */ - $changeAllowed = common::checkObjectChangeAllowed('build', $build); + $canBeChanged = common::checkObjectChangeAllowed('build', $build); $product = $this->loadModel('product')->getById($build->product); if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); @@ -261,18 +261,18 @@ class build extends control $this->executeHooks($buildID); /* Assign. */ - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->build = $build; - $this->view->buildPairs = $this->build->getProjectBuildPairs($build->project, 0, 0, 'noempty,notrunk'); - $this->view->actions = $this->loadModel('action')->getList('build', $buildID); - $this->view->link = $link; - $this->view->param = $param; - $this->view->orderBy = $orderBy; - $this->view->bugs = $bugs; - $this->view->type = $type; - $this->view->bugPager = $bugPager; - $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); - $this->view->changeAllowed = $changeAllowed; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->build = $build; + $this->view->buildPairs = $this->build->getProjectBuildPairs($build->project, 0, 0, 'noempty,notrunk'); + $this->view->actions = $this->loadModel('action')->getList('build', $buildID); + $this->view->link = $link; + $this->view->param = $param; + $this->view->orderBy = $orderBy; + $this->view->bugs = $bugs; + $this->view->type = $type; + $this->view->bugPager = $bugPager; + $this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch); + $this->view->canBeChanged = $canBeChanged; $this->display(); } diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index bd53d2f43f..3da4c2abb6 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -48,7 +48,7 @@ tbody tr td:first-child input{display:none;}
      deleted and $changeAllowed) + if(!$build->deleted and $canBeChanged) { echo $this->buildOperateMenu($build, 'view'); @@ -91,13 +91,13 @@ tbody tr td:first-child input{display:none;}
      ' id='stories'> - +
      id, \"story\")", ' ' . $lang->build->linkStory, '', "class='btn btn-primary'");?>
      id}")?>' id='linkedStoriesForm'> - + id}&type=story&link=$link¶m=$param&orderBy=%s";?> @@ -146,7 +146,7 @@ tbody tr td:first-child input{display:none;}
      story->stageList[$story->stage];?> id&story=$story->id"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn btn-icon' title='{$lang->build->unlinkStory}'"); @@ -176,13 +176,13 @@ tbody tr td:first-child input{display:none;}
      ' id='bugs'> - +
      id, \"bug\")", ' ' . $lang->build->linkBug, '', "class='btn btn-primary'");?>
      id");?>" id='linkedBugsForm'> - + id}&type=bug&link=$link¶m=$param&orderBy=%s";?> @@ -227,7 +227,7 @@ tbody tr td:first-child input{display:none;} @@ -135,7 +135,7 @@ diff --git a/module/my/view/bug.html.php b/module/my/view/bug.html.php index cef75a175d..beb4899cd3 100644 --- a/module/my/view/bug.html.php +++ b/module/my/view/bug.html.php @@ -73,12 +73,12 @@ ?> - + createLink('story', 'view', "id=$story->id"); - $changeAllowed = common::checkObjectChangeAllowed('story', $story); + $storyLink = $this->createLink('story', 'view', "id=$story->id"); + $canBeChanged = common::checkObjectChangeAllowed('story', $story); ?> - + case : $case->id; - $runID = $type == 'assigntome' ? $case->id : 0; - $changeAllowed = common::checkObjectChangeAllowed('testcase', $case); + $caseID = $type == 'assigntome' ? $case->case : $case->id; + $runID = $type == 'assigntome' ? $case->id : 0; + $canBeChanged = common::checkObjectChangeAllowed('testcase', $case); ?> @@ -165,7 +165,7 @@
      resolvedDate, 5, 11)?> id&bug=$bug->id"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '', '', "class='btn btn-icon' title='{$lang->build->unlinkBug}'"); diff --git a/module/doc/control.php b/module/doc/control.php index 260e11bd74..ae9fc540ff 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -759,9 +759,9 @@ class doc extends control $object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch(); /* Determines whether an object is editable. */ - $changeAllowed = true; - if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $changeAllowed = false; - if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $canBeChanged = false; + if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $canBeChanged = false; /* According the from, set menus. */ if($this->from == 'product') @@ -806,18 +806,18 @@ class doc extends control $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); - $this->view->title = $object->name; - $this->view->position[] = $object->name; + $this->view->title = $object->name; + $this->view->position[] = $object->name; - $this->view->type = $type; - $this->view->object = $object; - $this->view->files = $this->doc->getLibFiles($type, $objectID, $orderBy, $pager); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->pager = $pager; - $this->view->viewType = $viewType; - $this->view->orderBy = $orderBy; - $this->view->objectID = $objectID; - $this->view->changeAllowed = $changeAllowed; + $this->view->type = $type; + $this->view->object = $object; + $this->view->files = $this->doc->getLibFiles($type, $objectID, $orderBy, $pager); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->pager = $pager; + $this->view->viewType = $viewType; + $this->view->orderBy = $orderBy; + $this->view->objectID = $objectID; + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -859,9 +859,9 @@ class doc extends control if(empty($object)) $this->locate($this->createLink($type, 'create')); /* Determines whether an object is editable. */ - $changeAllowed = true; - if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $changeAllowed = false; - if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $canBeChanged = false; + if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $canBeChanged = false; if($from == 'product') { @@ -899,11 +899,11 @@ class doc extends control $this->view->title = $object->name; $this->view->position[] = $object->name; - $this->view->type = $type; - $this->view->object = $object; - $this->view->from = $from; - $this->view->libs = $this->doc->getLibsByObject($type, $objectID); - $this->view->changeAllowed = $changeAllowed; + $this->view->type = $type; + $this->view->object = $object; + $this->view->from = $from; + $this->view->libs = $this->doc->getLibsByObject($type, $objectID); + $this->view->canBeChanged = $canBeChanged; $this->display(); } } diff --git a/module/doc/model.php b/module/doc/model.php index baee999320..69c52605e0 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -111,11 +111,11 @@ class docModel extends model $docLib = new stdClass(); $docLib->product = $productID; $docLib->project = $projectID; - $changeAllowed = common::checkObjectChangeAllowed('doc', $docLib); + $canBeChanged = common::checkObjectChangeAllowed('doc', $docLib); $lib = isset($lib) ? $lib : new stdClass(); $actions = $this->setFastMenu($fastLib); - $actions .= ($changeAllowed and common::hasPriv('doc', 'createLib', $lib)) ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), " " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : ''; + $actions .= ($canBeChanged and common::hasPriv('doc', 'createLib', $lib)) ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), " " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : ''; $this->lang->TRActions = $actions; } diff --git a/module/doc/view/objectlibs.html.php b/module/doc/view/objectlibs.html.php index b77fad66d9..ab224bd850 100644 --- a/module/doc/view/objectlibs.html.php +++ b/module/doc/view/objectlibs.html.php @@ -57,7 +57,7 @@ collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?> collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?>
      - + " title="" class='btn btn-link ajaxCollect'> diff --git a/module/doc/view/objectlibsbylist.html.php b/module/doc/view/objectlibsbylist.html.php index 1e32f50ed2..404635cb48 100644 --- a/module/doc/view/objectlibsbylist.html.php +++ b/module/doc/view/objectlibsbylist.html.php @@ -34,7 +34,7 @@
      name);?> allCount . $lang->doc->item;?> - + collector, ',' . $this->app->user->account . ',') !== false ? 'icon-star text-yellow' : 'icon-star-empty';?> collector, ',' . $this->app->user->account . ',') !== false ? $lang->doc->cancelCollection : $lang->doc->collect;?> diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index 46eab0d8e8..a0e77b97fe 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -79,7 +79,7 @@ id", '', "data-toggle='modal'", "class='btn' title={$lang->doc->download}", true, false, $file); - if($changeAllowed) common::printLink('file', 'delete', "fileID=$file->id", '', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file); + if($canBeChanged) common::printLink('file', 'delete', "fileID=$file->id", '', 'hiddenwin', "class='btn' title={$lang->delete}", true, false, $file); ?>
      - /> + />
      @@ -100,7 +100,7 @@
      bug->resolutionList, $bug->resolution);?> id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index 4022afafec..860cc550a1 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -63,14 +63,14 @@
      - /> + />
      @@ -86,7 +86,7 @@
      story->stageList, $story->stage);?> id}"; common::printIcon('story', 'change', $vars, $story, 'list', 'fork'); @@ -105,7 +105,7 @@
      - /> + />
      @@ -121,7 +121,7 @@
      story->stageList, $child->stage);?> id}"; common::printIcon('story', 'change', $vars, $child, 'list', 'fork'); diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index a48eca713f..3d472fb57a 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -61,12 +61,12 @@
      - /> + />
      @@ -93,7 +93,7 @@
      needConfirm) { diff --git a/module/my/view/testcase.html.php b/module/my/view/testcase.html.php index 9fdf9645fc..0b84fc312f 100644 --- a/module/my/view/testcase.html.php +++ b/module/my/view/testcase.html.php @@ -67,15 +67,15 @@
      - /> + />
      @@ -93,7 +93,7 @@
      processStatus('testcase', $case);?> product&branch=$case->branch&extra=caseID=$caseID,version=$case->version,runID=$runID", $case, 'list', 'bug'); common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$caseID", $case, 'list', 'copy'); diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 3068fc47e1..8a4d07e12f 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -189,15 +189,15 @@ js::set('foldAll', $lang->project->treeLevel['root']); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $changeAllowed = (empty($config->global->closedProductStatus) or $product->status != 'closed'); - $canBatchEdit = ($changeAllowed and common::hasPriv('story', 'batchEdit')); + $canBeChanged = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBatchEdit = ($canBeChanged and common::hasPriv('story', 'batchEdit')); $canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'); - $canBatchReview = ($changeAllowed and common::hasPriv('story', 'batchReview')); - $canBatchChangeStage = ($changeAllowed and common::hasPriv('story', 'batchChangeStage')); - $canBatchChangeBranch = ($changeAllowed and common::hasPriv('story', 'batchChangeBranch')); - $canBatchChangeModule = ($changeAllowed and common::hasPriv('story', 'batchChangeModule')); - $canBatchChangePlan = ($changeAllowed and common::hasPriv('story', 'batchChangePlan')); - $canBatchAssignTo = ($changeAllowed and common::hasPriv('story', 'batchAssignTo')); + $canBatchReview = ($canBeChanged and common::hasPriv('story', 'batchReview')); + $canBatchChangeStage = ($canBeChanged and common::hasPriv('story', 'batchChangeStage')); + $canBatchChangeBranch = ($canBeChanged and common::hasPriv('story', 'batchChangeBranch')); + $canBatchChangeModule = ($canBeChanged and common::hasPriv('story', 'batchChangeModule')); + $canBatchChangePlan = ($canBeChanged and common::hasPriv('story', 'batchChangePlan')); + $canBatchAssignTo = ($canBeChanged and common::hasPriv('story', 'batchAssignTo')); $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo); ?> diff --git a/module/productplan/control.php b/module/productplan/control.php index 948efa87dd..c85fb01f13 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -250,7 +250,7 @@ class productplan extends control $this->session->set('bugList', $this->app->getURI(true) . '&type=' . 'bug'); /* Determines whether an object is editable. */ - $changeAllowed = common::checkObjectChangeAllowed('plan', $plan); + $canBeChanged = common::checkObjectChangeAllowed('plan', $plan); /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -274,25 +274,25 @@ class productplan extends control if($plan->parent == '-1') $this->view->childrenPlans = $this->productplan->getChildren($plan->id); $this->loadModel('datatable'); - $this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story'); - $this->view->title = "PLAN #$plan->id $plan->title/" . $products[$plan->product]; - $this->view->position[] = $this->lang->productplan->view; - $this->view->planStories = $planStories; - $this->view->planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all', $type == 'bug' ? $sort : 'id_desc', $bugPager); - $this->view->products = $products; - $this->view->summary = $this->product->summary($this->view->planStories); - $this->view->plan = $plan; - $this->view->actions = $this->loadModel('action')->getList('productplan', $planID); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->plans = $this->productplan->getPairs($plan->product, $plan->branch); - $this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product); - $this->view->type = $type; - $this->view->orderBy = $orderBy; - $this->view->link = $link; - $this->view->param = $param; - $this->view->storyPager = $storyPager; - $this->view->bugPager = $bugPager; - $this->view->changeAllowed = $changeAllowed; + $this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story'); + $this->view->title = "PLAN #$plan->id $plan->title/" . $products[$plan->product]; + $this->view->position[] = $this->lang->productplan->view; + $this->view->planStories = $planStories; + $this->view->planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all', $type == 'bug' ? $sort : 'id_desc', $bugPager); + $this->view->products = $products; + $this->view->summary = $this->product->summary($this->view->planStories); + $this->view->plan = $plan; + $this->view->actions = $this->loadModel('action')->getList('productplan', $planID); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->plans = $this->productplan->getPairs($plan->product, $plan->branch); + $this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product); + $this->view->type = $type; + $this->view->orderBy = $orderBy; + $this->view->link = $link; + $this->view->param = $param; + $this->view->storyPager = $storyPager; + $this->view->bugPager = $bugPager; + $this->view->canBeChanged = $canBeChanged; $this->display(); } diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 75fa9a882e..242a8cd17e 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -75,8 +75,8 @@ loadModel('file');?> file->replaceImgURL($plan, 'desc'); if($plan->parent == '-1') @@ -100,7 +100,7 @@
      - id => ''), '', $disabled) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?> + id => ''), '', $attribute) . html::a(helper::createLink('productplan', 'view', "planID=$plan->id"), sprintf('%03d', $plan->id));?> id);?> diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 03476cd12b..b3105d69fb 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -62,7 +62,7 @@
      '>
      - deleted and $plan->parent >= 0 and $changeAllowed):?> + deleted and $plan->parent >= 0 and $canBeChanged):?>
      story->stageList[$story->stage];?> createLink('productplan', 'unlinkStory', "story=$story->id&plan=$plan->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->productplan->unlinkStory}'"); @@ -363,7 +363,7 @@ id&orderBy=$orderBy");?>"> - + id}&type=bug&orderBy=%s&link=$link¶m=$param"; ?> @@ -404,7 +404,7 @@ - + @@ -77,7 +77,7 @@ - + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - + '> - + ";?>
      createLink('productplan', 'unlinkBug', "story=$bug->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '', '', "class='btn' title='{$lang->productplan->unlinkBug}'"); diff --git a/module/project/control.php b/module/project/control.php index 70a3bac44c..2196d68261 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -129,8 +129,8 @@ class project extends control setcookie('preProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; if($this->cookie->preProjectID != $projectID) { @@ -201,27 +201,27 @@ class project extends control $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($projectID, 'task', $showModule) : array(); /* Assign. */ - $this->view->tasks = $tasks; - $this->view->summary = $this->project->summary($tasks); - $this->view->tabID = 'task'; - $this->view->pager = $pager; - $this->view->recTotal = $pager->recTotal; - $this->view->recPerPage = $pager->recPerPage; - $this->view->orderBy = $orderBy; - $this->view->browseType = $browseType; - $this->view->status = $status; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->param = $param; - $this->view->projectID = $projectID; - $this->view->project = $project; - $this->view->productID = $productID; - $this->view->modules = $this->tree->getTaskOptionMenu($projectID, 0, 0, $showAllModule ? 'allModule' : ''); - $this->view->moduleID = $moduleID; - $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra); - $this->view->memberPairs = $memberPairs; - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); - $this->view->setModule = true; - $this->view->changeAllowed = $changeAllowed; + $this->view->tasks = $tasks; + $this->view->summary = $this->project->summary($tasks); + $this->view->tabID = 'task'; + $this->view->pager = $pager; + $this->view->recTotal = $pager->recTotal; + $this->view->recPerPage = $pager->recPerPage; + $this->view->orderBy = $orderBy; + $this->view->browseType = $browseType; + $this->view->status = $status; + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->param = $param; + $this->view->projectID = $projectID; + $this->view->project = $project; + $this->view->productID = $productID; + $this->view->modules = $this->tree->getTaskOptionMenu($projectID, 0, 0, $showAllModule ? 'allModule' : ''); + $this->view->moduleID = $moduleID; + $this->view->moduleTree = $this->tree->getTaskTreeMenu($projectID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra); + $this->view->memberPairs = $memberPairs; + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); + $this->view->setModule = true; + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -702,8 +702,8 @@ class project extends control $projectID = $project->id; /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -765,25 +765,25 @@ class project extends control if($productPairs) $productID = key($productPairs); /* Assign. */ - $this->view->title = $title; - $this->view->position = $position; - $this->view->productID = $productID; - $this->view->project = $project; - $this->view->stories = $stories; - $this->view->allPlans = $allPlans; - $this->view->summary = $this->product->summary($stories); - $this->view->orderBy = $orderBy; - $this->view->type = $this->session->projectStoryBrowseType; - $this->view->param = $param; - $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink')); - $this->view->tabID = 'story'; - $this->view->storyTasks = $storyTasks; - $this->view->storyBugs = $storyBugs; - $this->view->storyCases = $storyCases; - $this->view->users = $users; - $this->view->pager = $pager; - $this->view->branchGroups = $branchGroups; - $this->view->changeAllowed = $changeAllowed; + $this->view->title = $title; + $this->view->position = $position; + $this->view->productID = $productID; + $this->view->project = $project; + $this->view->stories = $stories; + $this->view->allPlans = $allPlans; + $this->view->summary = $this->product->summary($stories); + $this->view->orderBy = $orderBy; + $this->view->type = $this->session->projectStoryBrowseType; + $this->view->param = $param; + $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($projectID, $startModuleID = 0, array('treeModel', 'createProjectStoryLink')); + $this->view->tabID = 'story'; + $this->view->storyTasks = $storyTasks; + $this->view->storyBugs = $storyBugs; + $this->view->storyCases = $storyCases; + $this->view->users = $users; + $this->view->pager = $pager; + $this->view->branchGroups = $branchGroups; + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -944,8 +944,8 @@ class project extends control $projectID = $project->id; /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; /* Load pager. */ $this->app->loadClass('pager', $static = true); @@ -956,18 +956,18 @@ class project extends control $tasks = $this->testtask->getProjectTasks($projectID, $orderBy, $pager); foreach($tasks as $key => $task) $productTasks[$task->product][] = $task; - $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common; - $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]); - $this->view->position[] = $this->lang->testtask->common; - $this->view->project = $project; - $this->view->projectID = $projectID; - $this->view->projectName = $this->projects[$projectID]; - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->tasks = $productTasks; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); - $this->view->products = $this->loadModel('product')->getPairs(); - $this->view->changeAllowed = $changeAllowed; + $this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common; + $this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]); + $this->view->position[] = $this->lang->testtask->common; + $this->view->project = $project; + $this->view->projectID = $projectID; + $this->view->projectName = $this->projects[$projectID]; + $this->view->pager = $pager; + $this->view->orderBy = $orderBy; + $this->view->tasks = $productTasks; + $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); + $this->view->products = $this->loadModel('product')->getPairs(); + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -1064,16 +1064,16 @@ class project extends control $projectID = $project->id; /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; $title = $project->name . $this->lang->colon . $this->lang->project->team; $position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name); $position[] = $this->lang->project->team; - $this->view->title = $title; - $this->view->position = $position; - $this->view->changeAllowed = $changeAllowed; + $this->view->title = $title; + $this->view->position = $position; + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -1592,8 +1592,8 @@ class project extends control if(!$project) die(js::error($this->lang->notFound) . js::locate('back')); /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; $products = $this->project->getProducts($project->id); $linkedBranches = array(); @@ -1619,19 +1619,19 @@ class project extends control $this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name); $this->view->position[] = $this->view->title; - $this->view->project = $project; - $this->view->products = $products; - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), '', $linkedBranches); - $this->view->planGroups = $this->project->getPlans($products); - $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->actions = $this->loadModel('action')->getList('project', $projectID); - $this->view->dynamics = $this->loadModel('action')->getDynamic('all', 'all', 'date_desc', $pager, 'all', $projectID); - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->teamMembers = $this->project->getTeamMembers($projectID); - $this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID); - $this->view->statData = $this->project->statRelatedData($projectID); - $this->view->chartData = $chartData; - $this->view->changeAllowed = $changeAllowed; + $this->view->project = $project; + $this->view->products = $products; + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), '', $linkedBranches); + $this->view->planGroups = $this->project->getPlans($products); + $this->view->groups = $this->loadModel('group')->getPairs(); + $this->view->actions = $this->loadModel('action')->getList('project', $projectID); + $this->view->dynamics = $this->loadModel('action')->getDynamic('all', 'all', 'date_desc', $pager, 'all', $projectID); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + $this->view->teamMembers = $this->project->getTeamMembers($projectID); + $this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID); + $this->view->statData = $this->project->statRelatedData($projectID); + $this->view->chartData = $chartData; + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -1663,8 +1663,8 @@ class project extends control $stories = $this->loadModel('story')->getProjectStories($projectID, $orderBy); /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; $kanbanGroup = $this->project->getKanbanGroupData($stories, $tasks, $bugs, $type); $kanbanSetting = $this->project->getKanbanSetting(); @@ -1682,10 +1682,10 @@ class project extends control $this->view->type = $type; $this->view->kanbanGroup = $kanbanGroup; $this->view->kanbanColumns = $this->project->getKanbanColumns($kanbanSetting); - $this->view->statusMap = $changeAllowed ? $this->project->getKanbanStatusMap($kanbanSetting) : array(); + $this->view->statusMap = $canBeChanged ? $this->project->getKanbanStatusMap($kanbanSetting) : array(); $this->view->statusList = $this->project->getKanbanStatusList($kanbanSetting); $this->view->colorList = $this->project->getKanbanColorList($kanbanSetting); - $this->view->changeAllowed = $changeAllowed; + $this->view->canBeChanged = $canBeChanged; $this->display(); } @@ -1856,23 +1856,23 @@ class project extends control $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false); /* Determines whether an object is editable. */ - $changeAllowed = true; - if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + $canBeChanged = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $canBeChanged = false; /* Get project's product. */ $productID = 0; $productPairs = $this->loadModel('product')->getProductsByProject($projectID); if($productPairs) $productID = key($productPairs); - $this->view->title = $this->lang->project->storyKanban; - $this->view->position[] = html::a($this->createLink('project', 'story', "projectID=$projectID"), $project->name); - $this->view->position[] = $this->lang->project->storyKanban; - $this->view->stories = $this->story->getKanbanGroupData($stories); - $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); - $this->view->projectID = $projectID; - $this->view->project = $project; - $this->view->productID = $productID; - $this->view->changeAllowed = $changeAllowed; + $this->view->title = $this->lang->project->storyKanban; + $this->view->position[] = html::a($this->createLink('project', 'story', "projectID=$projectID"), $project->name); + $this->view->position[] = $this->lang->project->storyKanban; + $this->view->stories = $this->story->getKanbanGroupData($stories); + $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); + $this->view->projectID = $projectID; + $this->view->project = $project; + $this->view->productID = $productID; + $this->view->canBeChanged = $canBeChanged; $this->display(); } diff --git a/module/project/js/storykanban.js b/module/project/js/storykanban.js index ec9840aabe..aa43e2dc23 100644 --- a/module/project/js/storykanban.js +++ b/module/project/js/storykanban.js @@ -5,7 +5,7 @@ $(function() var $kanban = $('#kanban'); var stageMap = new Object(); - if(changeAllowed) + if(canBeChanged) { stageMap = { diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 0826aa0d29..f7a151c82b 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -75,13 +75,13 @@
      - id => ''), '', $disabled) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> + id => ''), '', $arrtibute) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?> id);?> @@ -101,7 +101,7 @@ bug->resolutionList, $bug->resolution);?> id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); diff --git a/module/project/view/kanban.html.php b/module/project/view/kanban.html.php index b692628edd..3f26e92642 100644 --- a/module/project/view/kanban.html.php +++ b/module/project/view/kanban.html.php @@ -18,7 +18,7 @@ $link = $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=kanban"); if(common::hasPriv('task', 'export')) echo html::a($link, " " . $lang->task->export, '', "class='btn btn-link iframe export' data-width='700'"); ?> - +
      @@ -199,7 +199,7 @@ id}&story={$story->id}&moduleID={$story->module}"; @@ -220,7 +220,7 @@ $lang->testcase->batchCreate = $lang->testcase->create; if($productID && $hasDBPriv) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap'); - if($changeAllowed and common::hasPriv('project', 'unlinkStory', $project)) + if($canBeChanged and common::hasPriv('project', 'unlinkStory', $project)) { $unlinkURL = $this->createLink('project', 'unlinkStory', "projectID=$project->id&storyID=$story->id&confirm=yes"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->project->unlinkStory}'"); diff --git a/module/project/view/storykanban.html.php b/module/project/view/storykanban.html.php index 07435189f3..79a2ebb2e4 100644 --- a/module/project/view/storykanban.html.php +++ b/module/project/view/storykanban.html.php @@ -10,7 +10,7 @@ ?> project->confirmUnlinkStory)?> - + app->user->account;

      story->noStory;?> - + createLink('project', 'linkStory', "project=$project->id"), " " . $lang->project->linkStory, '', "class='btn btn-info'");?>

      @@ -77,7 +77,7 @@ $account = $this->app->user->account;
      story->priList, $story->pri);?> story->statusList[$story->status];?> - +
      createLink('project', 'unlinkStory', "projectID=$projectID&story=$story->id"), "", 'hiddenwin', "title='{$lang->project->unlinkStory}'");?>
      estimate . 'h ';?>
      diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 3671a0d335..3089da8a74 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -139,16 +139,16 @@ js::set('foldAll', $lang->project->treeLevel['root']); createLink('task', 'batchCreate', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')); - if($changeAllowed and common::hasPriv('task', 'batchCreate')) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'"); + if($canBeChanged and common::hasPriv('task', 'batchCreate')) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'"); $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if($changeAllowed and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'"); + if($canBeChanged and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'"); ?> "; $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if($changeAllowed and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); + if($canBeChanged and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); ?>
      team->totalHours;?> team->limited;?> actions;?>
      hours . $lang->project->workHour;?> project->workHour;?> team->limitedList[$member->limited];?>
      testtask->product);?> @@ -98,7 +98,7 @@ id", $task, 'list', 'sitemap'); common::printIcon('testtask', 'linkCase', "taskID=$task->id", $task, 'list', 'link'); diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 7c47a1ab66..29cbf9bed6 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -102,7 +102,7 @@
      - id", "  " . $lang->project->manageMembers, '', "class='text-muted'");?> + id", "  " . $lang->project->manageMembers, '', "class='text-muted'");?>
      @@ -133,7 +133,7 @@
      - id", "  " . $lang->doc->createLib, '', "class='text-muted iframe' data-width='1000px'");?> + id", "  " . $lang->doc->createLib, '', "class='text-muted iframe' data-width='1000px'");?>
      diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index 73f0de5dcb..ff8213e84f 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -58,7 +58,7 @@
      id"), sprintf('%03d', $release->id));?> @@ -79,7 +79,7 @@ " . $this->loadModel('flow')->getFieldValue($extendField, $release) . " id&type=story&link=true"), ' ', '', "class='btn' title='{$lang->release->linkStory}'"); if(common::hasPriv('release', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "releaseID=$release->id&type=bug&link=true"), ' ', '', "class='btn' title='{$lang->release->linkBug}'"); diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index bfd784c9a2..074249bf1d 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -31,9 +31,9 @@
      deleted and $changeAllowed) + if(!$release->deleted and $canBeChanged) { echo $this->buildOperateMenu($release, 'view'); @@ -66,7 +66,7 @@
      ' id='stories'> - +
      id}, \"story\")", ' ' . $lang->release->linkStory, '', "class='btn btn-primary'");?>
      @@ -80,7 +80,7 @@
      - +
      @@ -101,7 +101,7 @@ createLink('story', 'view', "storyID=$story->id", '', true);?>
      - +
      @@ -124,7 +124,7 @@
      story->stageList[$story->stage];?> createLink('release', 'unlinkStory', "releaseID=$release->id&story=$story->id"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '', '', "class='btn' title='{$lang->release->unlinkStory}'"); @@ -136,7 +136,7 @@
      - +
      @@ -196,7 +196,7 @@ createLink('bug', 'view', "bugID=$bug->id", '', true);?>
      - +
      @@ -214,7 +214,7 @@
      resolvedDate, 5, 11)?> createLink('release', 'unlinkBug', "releaseID=$release->id&bug=$bug->id"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '', '', "class='btn' title='{$lang->release->unlinkBug}'"); @@ -226,7 +226,7 @@
      - +
      @@ -284,7 +284,7 @@ createLink('bug', 'view', "bugID=$bug->id", '', true);?>
      - +
      @@ -305,7 +305,7 @@
      openedDate?> createLink('release', 'unlinkBug', "releaseID=$release->id&bug=$bug->id&type=leftBug"); echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"leftBugList\", confirmUnlinkBug)", '', '', "class='btn' title='{$lang->release->unlinkBug}'"); @@ -317,7 +317,7 @@
      diff --git a/module/testsuite/control.php b/module/testsuite/control.php index 7d8a9f912a..8b92010fe2 100644 --- a/module/testsuite/control.php +++ b/module/testsuite/control.php @@ -152,16 +152,16 @@ class testsuite extends control $this->view->position[] = $this->lang->testsuite->common; $this->view->position[] = $this->lang->testsuite->view; - $this->view->productID = $productID; - $this->view->suite = $suite; - $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); - $this->view->actions = $this->loadModel('action')->getList('testsuite', $suiteID); - $this->view->cases = $this->testsuite->getLinkedCases($suiteID, $sort, $pager); - $this->view->orderBy = $orderBy; - $this->view->pager = $pager; - $this->view->modules = $this->loadModel('tree')->getOptionMenu($suite->product, 'case'); - $this->view->branches = $this->loadModel('branch')->getPairs($suite->product, 'noempty'); - $this->view->changeAllowed = common::checkObjectChangeAllowed('testsuite', $suite); + $this->view->productID = $productID; + $this->view->suite = $suite; + $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); + $this->view->actions = $this->loadModel('action')->getList('testsuite', $suiteID); + $this->view->cases = $this->testsuite->getLinkedCases($suiteID, $sort, $pager); + $this->view->orderBy = $orderBy; + $this->view->pager = $pager; + $this->view->modules = $this->loadModel('tree')->getOptionMenu($suite->product, 'case'); + $this->view->branches = $this->loadModel('branch')->getPairs($suite->product, 'noempty'); + $this->view->canBeChanged = common::checkObjectChangeAllowed('testsuite', $suite); $this->display(); } diff --git a/module/testsuite/view/view.html.php b/module/testsuite/view/view.html.php index 9b35495548..d52eb0c603 100644 --- a/module/testsuite/view/view.html.php +++ b/module/testsuite/view/view.html.php @@ -29,7 +29,7 @@
      deleted and $changeAllowed) + if(!$suite->deleted and $canBeChanged) { echo $this->buildOperateMenu($suite, 'view'); @@ -47,7 +47,7 @@
      - + id&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?> @@ -97,7 +97,7 @@
      stepNumber;?>
      -

      testcase->noCase;?> " . $lang->testtask->linkCase, '', "class='btn btn-info'");?>

      +

      testcase->noCase;?> " . $lang->testtask->linkCase, '', "class='btn btn-info'");?>

      diff --git a/module/testtask/view/groupcase.html.php b/module/testtask/view/groupcase.html.php index 633d292a0b..c86e6afec1 100644 --- a/module/testtask/view/groupcase.html.php +++ b/module/testtask/view/groupcase.html.php @@ -76,7 +76,7 @@
      results) ? html::a($this->createLink('testtask', 'results', "runID={$run->id}&caseID={$run->case}"), $run->results, '', "class='iframe'") : $run->results;?> stepNumber;?> - + id&caseID=$run->case&version=$run->caseVersion", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");?> case", '', 'list');?> view->root = $product; /* Determines whether an object is editable. */ - $changeAllowed = (empty($this->config->global->closedProductStatus) or $product->status != 'closed') ? true : false; + $canBeChanged = (empty($this->config->global->closedProductStatus) or $product->status != 'closed') ? true : false; } elseif(strpos($viewType, 'doc') !== false) { @@ -195,7 +195,7 @@ class tree extends control $this->view->parentModules = $parentModules; $this->view->branch = $branch; $this->view->tree = $this->tree->getProductStructure($rootID, $viewType); - $this->view->changeAllowed = isset($changeAllowed) ? $changeAllowed : true; + $this->view->canBeChanged = isset($canBeChanged) ? $canBeChanged : true; $this->display(); } @@ -219,7 +219,7 @@ class tree extends control $this->view->products = $products; /* Determines whether an object is editable. */ - $changeAllowed = (empty($this->config->global->closedProjectStatus) or $project->status != 'closed') ? true : false; + $canBeChanged = (empty($this->config->global->closedProjectStatus) or $project->status != 'closed') ? true : false; /* Set menu. */ $this->lang->set('menugroup.tree', 'project'); @@ -250,7 +250,7 @@ class tree extends control $this->view->parentModules = $parentModules; $this->view->currentModuleID = $currentModuleID; $this->view->tree = $this->tree->getTaskStructure($rootID, $productID); - $this->view->changeAllowed = $changeAllowed; + $this->view->canBeChanged = $canBeChanged; $this->display(); } diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index 4e3af61044..0bea1afa20 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -80,7 +80,7 @@ li.tree-item-story > .tree-actions .tree-action[data-type=delete]{display:none;} doc->manageType : $lang->tree->$manageChild;?> - +
      tree->syncFromProduct, '', "class='btn btn-sm btn-primary'")?>
      @@ -159,7 +159,7 @@ li.tree-item-story > .tree-actions .tree-action[data-type=delete]{display:none;}
      - + goback, '', "class='btn btn-wide'");?> @@ -265,10 +265,10 @@ $(function() } }; - if() options.actions["sort"] = false; - if() options.actions["edit"] = false; - if() options.actions["delete"] = false; - if() options.actions["subModules"] = false; + if() options.actions["sort"] = false; + if() options.actions["edit"] = false; + if() options.actions["delete"] = false; + if() options.actions["subModules"] = false; var $tree = $('#modulesTree').tree(options); diff --git a/module/tree/view/browsetask.html.php b/module/tree/view/browsetask.html.php index 6c1c7f5cec..339e4bb891 100644 --- a/module/tree/view/browsetask.html.php +++ b/module/tree/view/browsetask.html.php @@ -112,7 +112,7 @@ li.story-item > .tree-actions .tree-action[data-type=delete]{display:none;} goback, '', "class='btn btn-wide'"); echo html::hidden('parentModuleID', $currentModuleID); echo html::hidden('maxOrder', $maxOrder); @@ -216,10 +216,10 @@ $(function() } }; - if() options.actions["sort"] = false; - if() options.actions["edit"] = false; - if() options.actions["delete"] = false; - if() options.actions["subModules"] = false; + if() options.actions["sort"] = false; + if() options.actions["edit"] = false; + if() options.actions["delete"] = false; + if() options.actions["subModules"] = false; var $tree = $('#modulesTree').tree(options); From 877dc32f8815c54115b3c1191942fc3a7930d7f0 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 17 Nov 2020 13:14:06 +0800 Subject: [PATCH 123/187] * Finish task #8393. --- module/bug/view/create.html.php | 8 ++++---- module/doc/view/create.html.php | 8 ++++---- module/doc/view/edit.html.php | 8 ++++---- module/testtask/view/create.html.php | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index bbe2bf8f82..7b76e84b72 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -268,10 +268,10 @@ js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty);
      - fetch('my', 'buildContactLists'); - ?> + fetch('my', 'buildContactLists'); + ?>
      doc->mailto;?>
      - fetch('my', 'buildContactLists'); - ?> + fetch('my', 'buildContactLists'); + ?>
      doc->mailto;?>
      - mailto, "multiple class='form-control chosen'"); - echo $this->fetch('my', 'buildContactLists'); - ?> + mailto, "multiple class='form-control chosen'"); + echo $this->fetch('my', 'buildContactLists'); + ?>
      testtask->mailto;?>
      - fetch('my', 'buildContactLists'); - ?> + fetch('my', 'buildContactLists'); + ?>
      job->customParam;?>
      - job->paramName; ?> - - job->paramValue; ?> - - - + job->paramName; ?> + + job->paramValue; ?> + + +
      customParam) as $paramName => $paramValue):?>
      - job->paramName; ?> - - job->paramValue; ?> - - - + job->paramName; ?> + + job->paramValue; ?> + + +
      - job->paramName; ?> - - job->paramValue; ?> - - - + job->paramName; ?> + + job->paramValue; ?> + + +
      custom->closedProduct;?> - global->closedProductStatus) ? $config->global->closedProductStatus : 0;?> - custom->closedProductStatus as $key => $value):?> + global->CRProduct) ? $config->global->CRProduct : 0;?> + custom->CRProduct as $key => $value):?>
      custom->closedProject;?> - global->closedProjectStatus) ? $config->global->closedProjectStatus : 0;?> - custom->closedProjectStatus as $key => $value):?> + global->CRProject) ? $config->global->CRProject : 0;?> + custom->CRProject as $key => $value):?> task->typeList, $task->type);?> '>deadline, 0, 4) > 0) echo $task->deadline;?> - config->global->closedProjectStatus) or $project->status != 'closed'):?> + config->CRProject) or $project->status != 'closed'):?> project&taskID=$task->id", $task, 'list', '', '', 'iframe', true);?> id", '', 'list');?> project&taskid=$task->id", '', 'list', 'trash', 'hiddenwin');?> diff --git a/module/project/view/manageproducts.html.php b/module/project/view/manageproducts.html.php index 0275b6c339..83488b6939 100644 --- a/module/project/view/manageproducts.html.php +++ b/module/project/view/manageproducts.html.php @@ -57,7 +57,7 @@
      - config->global->closedProjectStatus) or $project->status != 'closed') echo html::submitButton();?> + config->CRProject) or $project->status != 'closed') echo html::submitButton();?>
      diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index 56f37429c0..5ab6c6bb2f 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -48,7 +48,7 @@ id", " " . $lang->story->export, '', "class='btn btn-link export'"); - if(empty($this->config->global->closedProjectStatus) or $project->status != 'closed') + if(!empty($this->config->CRProject) or $project->status != 'closed') { $this->lang->story->create = $this->lang->project->createStory; if($productID and !$this->loadModel('story')->checkForceReview()) @@ -100,7 +100,7 @@

      story->noStory;?> - config->global->closedProjectStatus) or $project->status != 'closed') and common::hasPriv('project', 'linkStory')):?> + config->CRProject) or $project->status != 'closed') and common::hasPriv('project', 'linkStory')):?> createLink('project', 'linkStory', "project=$project->id"), " " . $lang->project->linkStory, '', "class='btn btn-info'");?>

      diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 3089da8a74..a33869a1ee 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -118,7 +118,7 @@ js::set('foldAll', $lang->project->treeLevel['root']);
      - config->global->closedProjectStatus) or $project->status != 'closed'):?> + config->CRProject) or $project->status != 'closed'):?>
      - config->global->closedProjectStatus) or $project->status != 'closed'):?> + config->CRProject) or $project->status != 'closed'):?> " . $lang->testtask->create, '', "class='btn btn-primary'");?> @@ -39,7 +39,7 @@

      testtask->noTesttask;?> - config->global->closedProjectStatus) or $project->status != 'closed') and common::hasPriv('testtask', 'create')):?> + config->CRProject) or $project->status != 'closed') and common::hasPriv('testtask', 'create')):?> createLink('testtask', 'create', "product=0&project=$projectID"), " " . $lang->testtask->create, '', "class='btn btn-info'");?>

      diff --git a/module/project/view/tree.html.php b/module/project/view/tree.html.php index 28ca9dfbaa..4053e0be24 100644 --- a/module/project/view/tree.html.php +++ b/module/project/view/tree.html.php @@ -32,7 +32,7 @@ $link = common::hasPriv('task', 'report', $project) ? $this->createLink('task', 'report', "project=$projectID&browseType=$browseType") : '#'; echo html::a($link, " {$lang->task->reportChart}", '', 'class="btn btn-link"'); ?> - config->global->closedProjectStatus) or $project->status != 'closed'):?> + config->CRProject) or $project->status != 'closed'):?>
      -createLink('action', 'comment', "objectType=story&objectID=$story->id");?> +createLink('action', 'comment', "objectType=story&objectID=$story->id");?> From a34b9be9051a81ba97a0caa5c98d7b7dfdc95551 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 17 Nov 2020 17:17:38 +0800 Subject: [PATCH 159/187] * Finish task #8406. --- module/project/view/kanban.html.php | 2 +- module/project/view/task.html.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/project/view/kanban.html.php b/module/project/view/kanban.html.php index 3f26e92642..4d7c889466 100644 --- a/module/project/view/kanban.html.php +++ b/module/project/view/kanban.html.php @@ -67,7 +67,7 @@

      task->noTask;?> - + createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')), " " . $lang->task->create, '', "class='btn btn-info'");?>

      diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index a33869a1ee..32119ab86f 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -136,19 +136,23 @@ js::set('foldAll', $lang->project->treeLevel['root']);
      + project = $projectID; + ?> createLink('task', 'batchCreate', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')); - if($canBeChanged and common::hasPriv('task', 'batchCreate')) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'"); + if($canBeChanged and common::hasPriv('task', 'batchCreate', $checkObject)) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'"); $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if($canBeChanged and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'"); + if($canBeChanged and common::hasPriv('task', 'create', $checkObject)) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'"); ?> "; $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if($canBeChanged and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); + if($canBeChanged and common::hasPriv('task', 'create' $checkObject)) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); ?>
      From b26569aa2d6a8041fa52b229d5b70872496f3939 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 18 Nov 2020 09:47:27 +0800 Subject: [PATCH 164/187] * Fix a bug. --- module/extension/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/extension/view/browse.html.php b/module/extension/view/browse.html.php index 743a7b6952..db85c31526 100644 --- a/module/extension/view/browse.html.php +++ b/module/extension/view/browse.html.php @@ -58,7 +58,7 @@ if(!empty($expiredDate)) { echo $lang->extension->expiredDate . ': '; - $expiredDate != 'life' ? echo "{$expiredDate}" : echo "{$lang->extension->life}"; + echo $expiredDate != 'life' ? "{$expiredDate}" : "{$lang->extension->life}"; } ?> From 726bbc775bbcf3f0f129d7bfe09ee69bd7082153 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 18 Nov 2020 09:52:04 +0800 Subject: [PATCH 165/187] * Finish task #8407. --- module/project/view/task.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 32119ab86f..e54212298f 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -152,7 +152,7 @@ js::set('foldAll', $lang->project->treeLevel['root']); "; $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if($canBeChanged and common::hasPriv('task', 'create' $checkObject)) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); + if($canBeChanged and common::hasPriv('task', 'create', $checkObject)) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); ?>