From d6eb5bedc69b399cd388403adb253dc90b50772d Mon Sep 17 00:00:00 2001 From: Catouse Date: Tue, 3 Jul 2018 17:38:14 +0800 Subject: [PATCH 01/16] * update zui. --- 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 d38d95dcec..d150882fbe 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -42,7 +42,7 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ function(){var t,e,i,n,s,o={}.hasOwnProperty,a=function(t,e){function i(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,s,o,a,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),a=e.childNodes,r=[],s=0,o=a.length;s\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,s,o,a;for(i=new n,a=t.childNodes,s=0,o=a.length;s0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},e.prototype.reset_single_select_options=function(){var t,e,i,n,s;for(n=this.results_data,s=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=a&&(a.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),o<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,s,o;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(s=0,o=n.length;s0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var s,o;s=t(this),o=s.data("chosen"),"destroy"===n&&o?o.destroy():o||s.data("chosen",new i(this,n))}):this}}),i=function(e){function i(){return s=i.__super__.constructor.apply(this,arguments)}return a(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
",i),this.is_multiple?this.container.html('
    '):this.container.html(''+this.default_text+'
      '),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val())},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){var i,n,s,o,a,r,l=-1;t.length&&(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),s=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),a=this.search_results.scrollTop(),o=s+a,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight||i>=o||n=o?l=i-s>0?i-s:0:n-1&&this.search_results.scrollTop(l))},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){if(this.is_multiple&&this.max_selected_options<=this.choices_count())return this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(1);var e=this.drop_direction;if("auto"===e)if(this.drop_directionFixed)e=this.drop_directionFixed;else{var i=this.container.find(".chosen-drop"),n=this.container.offset();n.top+i.outerHeight()+30>t(window).height()+t(window).scrollTop()&&(e="up"),this.drop_directionFixed=e}return this.container.toggleClass("chosen-up","up"===e).addClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this})},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this}),this.drop_directionFixed=0),this.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length&&(this.result_highlight=i,this.result_select(e))},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,s=this;return i=t("
    • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return s.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
      ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
    • '+this.results_none_found+' ""
    • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,s,o,a,r,l,h;if(this.is_multiple){for(n=0,r=0,o="position:absolute; left: -1000px; top: -1000px; display:none;",a=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=a.length;l",{style:o}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e)}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},s=function(t,e){var i=Math.max(t.left,e.left),s=Math.max(t.top,e.top),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height);return n(i,s,t)&&n(o,a,t)&&n(i,s,e)&&n(o,a,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var s,o,a=this.options.selector,r=this;if(void 0===e)return void this.$.find(a).each(function(){r.toggle(this,i)});if("object"==typeof e?(s=t(e).closest(a),o=s.data("id")):(o=e,s=r.$.find('.slectable-item[data-id="'+o+'"]')),s&&s.length){if(o||(o=t.zui.uuid(),s.attr("data-id",o)),void 0!==i&&null!==i||(i=!r.selections[o]),!!i!=!!r.selections[o]){var l;t.isFunction(n)&&(l=n(i)),l!==!0&&(r.selections[o]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:o,selections:r.selections,target:s,selected:r.getSelectedArray()},r))}r.options.selectClass&&s.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this;e.$children=e.$.find(e.options.selector);e.selections={},e.$children.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,o,a,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,p="."+this.name+"."+this.id,f=t.isFunction(h.checkFunc)?h.checkFunc:null,g=t.isFunction(h.rangeFunc)?h.rangeFunc:null,m=!1,v=null,y="mousedown"+p,b=function(){o&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,o,i):s(o,i);if(f){var a=f.call(c,{intersect:n,target:e,range:o,targetRange:i});a===!0?c.select(e):a===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(s){m&&(a=s.pageX,r=s.pageY,o={width:Math.abs(a-e),height:Math.abs(r-i),left:a>e?e:a,top:r>i?i:r},u&&o.width
      ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(o),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||o&&(clearTimeout(l),b(),o=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(s){if(m)return x(s);var o=t.zui.getMouseButtonCode(h.mouseButton);if(!(o>-1&&s.button!==o||c.altKey||3===s.which||c.callEvent("start",s)===!1)){var a=c.$children=c.$.find(h.selector);a.addClass("slectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(s.target):"single"===r?c.select(s.target):"toggle"===r&&c.toggle(s.target,null,function(t){c.unselect()})),c.callEvent("startDrag",s)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=s.pageX,i=s.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+p,w).on("mouseup"+p,x),v=setTimeout(function(){t(document).on(y,x)},10),s.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var s=n.result,o=this.options[e];return t.isFunction(o)&&(s=o.apply(this,t.isArray(i)?i:[i])),s},t.fn.selectable=function(n){return this.each(function(){var s=t(this),o=s.data(e),a="object"==typeof n&&n;o||s.data(e,o=new i(this,a)),"string"==typeof n&&o[n]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict"; -if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",s={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},o="order",a=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},s,n.$.data(),i),n.init()};a.DEFAULTS=s,a.NAME=n,a.prototype.init=function(){var e=this,i=e.$,n=e.options,s=n.selector,a=n.containerSelector,r=n.sortingClass,l=n.dragCssClass,h=n.reverse,c=function(i){i=i||e.getItems(1);var n=i.length;n&&i.each(function(e){var i=h?n-e:e;t(this).attr("data-"+o,i).data(o,i)})};c(),i.droppable({handle:n.trigger,target:a?s+","+a:s,selector:s,container:i,always:n.always,flex:!0,lazy:n.lazy,canMoveHere:n.canMoveHere,nested:n.nested,before:n.before,nested:!!a,mouseButton:n.mouseButton,start:function(t){l&&t.element.addClass(l),e.trigger("start",t)},drag:function(t){if(i.addClass(r),t.isIn){var n=t.element,l=t.target,d=a&&l.is(a);if(d){if(!l.children(s).filter(".dragging").length){l.append(n);var u=e.getItems(1);c(u),e.trigger(o,{list:u,element:n})}return}var p=n.data(o),f=l.data(o);if(p||0===p||(e.maxOrder++,p=e.maxOrder,n.attr("data-"+o,p)),f||0===f||(e.maxOrder++,f=e.maxOrder,l.attr("data-"+o,f)),p==f)return;p>f?l[h?"after":"before"](n):l[h?"before":"after"](n);var u=e.getItems(1);c(u),e.trigger(o,{list:u,element:n})}},finish:function(t){l&&t.element&&t.element.removeClass(l),i.removeClass(r),e.trigger("finish",{list:e.getItems(),element:t.element})}})},a.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},a.prototype.reset=function(){this.destroy(),this.init()},a.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},a.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),s=i.data(n),o="object"==typeof e&&e;s?"object"==typeof e&&s.reset():i.data(n,s=new a(this,o)),"string"==typeof e&&s[e]()})},t.fn.sortable.Constructor=a}(jQuery,window,document),/*! +if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",s={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},o="order",a=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},s,n.$.data(),i),n.init()};a.DEFAULTS=s,a.NAME=n,a.prototype.init=function(){var e=this,i=e.$,n=e.options,s=n.selector,a=n.containerSelector,r=n.sortingClass,l=n.dragCssClass,h=n.reverse,c=function(i){i=i||e.getItems(1);var n=i.length;n&&i.each(function(e){var i=h?n-e:e;t(this).attr("data-"+o,i).data(o,i)})};c(),i.droppable({handle:n.trigger,target:a?s+","+a:s,selector:s,container:i,always:n.always,flex:!0,lazy:n.lazy,canMoveHere:n.canMoveHere,before:n.before,nested:n.nested&&!!a,mouseButton:n.mouseButton,start:function(t){l&&t.element.addClass(l),e.trigger("start",t)},drag:function(t){if(i.addClass(r),t.isIn){var n=t.element,l=t.target,d=a&&l.is(a);if(d){if(!l.children(s).filter(".dragging").length){l.append(n);var u=e.getItems(1);c(u),e.trigger(o,{list:u,element:n})}return}var p=n.data(o),f=l.data(o);if(p||0===p||(e.maxOrder++,p=e.maxOrder,n.attr("data-"+o,p)),f||0===f||(e.maxOrder++,f=e.maxOrder,l.attr("data-"+o,f)),p==f)return;p>f?l[h?"after":"before"](n):l[h?"before":"after"](n);var u=e.getItems(1);c(u),e.trigger(o,{list:u,element:n})}},finish:function(t){l&&t.element&&t.element.removeClass(l),i.removeClass(r),e.trigger("finish",{list:e.getItems(),element:t.element})}})},a.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},a.prototype.reset=function(){this.destroy(),this.init()},a.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},a.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),s=i.data(n),o="object"==typeof e&&e;s?"object"==typeof e&&s.reset():i.data(n,s=new a(this,o)),"string"==typeof e&&s[e]()})},t.fn.sortable.Constructor=a}(jQuery,window,document),/*! * jQuery Form Plugin * version: 4.2.2 * Requires jQuery v1.7.2 or later @@ -75,4 +75,4 @@ if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");v * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ */ 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 s="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],o=String.fromCharCode(e.which).toLowerCase(),a="",r={};e.altKey&&"alt"!==s&&(a+="alt+"),e.ctrlKey&&"ctrl"!==s&&(a+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==s&&(a+="meta+"),e.shiftKey&&"shift"!==s&&(a+="shift+"),s?r[a+s]=!0:(r[a+o]=!0,r[a+t.hotkeys.shiftNums[o]]=!0,"shift+"===a&&(r[t.hotkeys.shiftNums[o]]=!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},a[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",s=0,o=function(e,i){this.name=n,this.$=t(e),this.getOptions(i),this._init()},a={sort:{template:''},add:{template:''},edit:{template:''},"delete":{template:''}};o.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},o.prototype.add=function(e,i,n,s,o){var a,r=t(e),l=this.options;if(r.is("li")?(a=r.children("ul"),a.length||(a=t("
        "),r.append(a),this._initList(a,r))):a=r,a){var h=this;t.isArray(i)||(i=[i]),t.each(i,function(e,i){var n=t("
      • ").data(i).appendTo(a);void 0!==i.id&&n.attr("data-id",i.id);var s=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:a})}},h.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}s&&(s.hasClass("open")||a&&a.open)&&s.addClass("open in")},o.prototype._initItem=function(n,s,o,a){if(void 0===s){var r=n.prev("li");s=r.length?r.data("idx")+1:1}if(o=o||n.closest("ul"),n.attr("data-idx",s).removeClass("tree-single-item"),!n.data("id")){var l=s;o.hasClass("tree")||(l=o.parent("li").data("id")+"-"+l),n.attr("data-id",l)}a=a||n.data();var h=e(a.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,s,a)},o.prototype._init=function(){var i=this.options,o=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var a=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=n+"::"+(i.name||"")+"#"+(this.$.attr("id")||s++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===a&&(r?this.isPreserve=!0:this.options.initialState=a="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===a?this.expand():"collapse"===a&&this.collapse(),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),n=i.parent("li");o.callEvent("hit",{target:n,item:n.data()}),o.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)");o.callEvent("action",{action:i,target:this,$item:n,item:n.data()})}})},o.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 s=this;this.store={},this.$.find("li").each(function(){s.preserve(t(this))})}},o.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)},o.prototype.show=function(e,i,n){var s=this;e.each(function(){var e=t(this);if(s.expand(e,i,n),e)for(var o=e.parent("ul");o&&o.length&&!o.hasClass("tree");){var a=o.parent("li");a.length?(s.expand(a,i,n),o=a.parent("ul")):o=!1}})},o.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)},o.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)},o.prototype.getOptions=function(e){this.options=t.extend({},o.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},o.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),s=e.data();delete s["zui.droppable"];var o=e.children("ul");return o.length&&(s.children=n.toData(o)),t.isFunction(i)?i(s,e):s}).get()},o.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 s=t(this),a=s.data(n),r="object"==typeof e&&e;a||s.data(n,a=new o(this,r)),"string"==typeof e&&a[e](i)})},t.fn.tree.Constructor=o,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"}},s=function(i,n){this.name=e,this.$=t(i),this.getOptions(n),this.init()};s.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"},s.prototype.init=function(){var e=this,n=e.options,s=e.$,o=s.parent(),a=!1;o.hasClass("colorpicker")?e.$picker=o:(e.$picker=t(n.template||i),a=!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"}),s.attr("data-provide",null),a&&s.after(e.$picker),e.colors={},t.each(n.colors,function(i,n){if(t.zui.Color.isColor(n)){var s=new t.zui.Color(n);e.colors[s.toCssStr()]=s}}),e.updateColors(),e.$picker.on("click",".cp-tile",function(){e.setValue(t(this).data("color"))});var r=function(){var i=s.val(),o=t.zui.Color.isColor(i);s.parent().toggleClass("has-error",!(o||n.optional&&""===i)),o?e.setValue(i,!0):n.optional&&""===i?s.tooltip("hide"):s.is(":focus")||s.tooltip("show",n.errorTip)};s.is("input:not([type=hidden])")?(n.tooltip&&s.attr("data-toggle","tooltip").tooltip({trigger:"manual",placement:n.tooltip,tipClass:"tooltip-danger",container:"body"}),s.on("keyup paste input change",r)):s.appendTo(e.$picker),r()},s.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 s=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(s)),n.optional&&this.$menu.find(".cp-tile.empty").parent().detach().appendTo(this.$menu)},s.prototype.updateColors=function(e){var i=(this.$picker,this.$menu.children("li:not(.heading)").remove()),n=this.options,e=e||this.colors,s=this,o=0;if(t.each(e,function(t,e){s.addColor(e),o++}),n.optional){var a=t('
      • ').css({width:n.tileSize,height:n.tileSize});this.$menu.append(a),o++}i.css("width",Math.min(o,n.lineCount)*n.tileSize+6)},s.prototype.setValue=function(e,i){var n=this,s=n.options,o=n.$btn;n.$menu.find(".cp-tile.active").removeClass("active");var a="",r=s.updateBtn;if("auto"===r){var l=o.find(".color-bar");r=!l.length||function(t){l.css("background",t||"")}}if(e){var h=new t.zui.Color(e);a=h.toCssStr().toLowerCase(),r&&(t.isFunction(r)?r(a,o,n):o.css({background:a,color:h.contrast().toCssStr(),borderColor:h.luma()>.43?"#ccc":a})),n.colors[a]||n.addColor(h),i||n.$.val().toLowerCase()===a||n.$.val(a).trigger("change"),n.$menu.find('.cp-tile[data-color="'+a+'"]').addClass("active"),n.$.tooltip("hide"),n.$.trigger("colorchange",h)}else r&&(t.isFunction(r)?r(null,o,n):o.attr("style",null)),i||""===n.$.val()||n.$.val(a).trigger("change"),s.optional&&n.$.tooltip("hide"),n.$menu.find(".cp-tile.empty").addClass("active"),n.$.trigger("colorchange",null);s.updateBorder&&t(s.updateBorder).css("border-color",a),s.updateBackground&&t(s.updateBackground).css("background-color",a),s.updateColor&&t(s.updateColor).css("color",a),s.updateText&&t(s.updateText).text(a)},s.prototype.getOptions=function(e){var i=t.extend({},s.DEFAULTS,this.$.data(),e);"string"==typeof i.colors&&(i.colors=i.colors.split(","));var o=(i.lang||t.zui.clientLang()).toLowerCase();i.errorTip||(i.errorTip=n[o].errorTip),t.fn.tooltip||(i.btnTip=!1),this.options=i},t.fn.colorPicker=function(i){return this.each(function(){var n=t(this),o=n.data(e),a="object"==typeof i&&i;o||n.data(e,o=new s(this,a)),"string"==typeof i&&o[i]()})},t.fn.colorPicker.Constructor=s,t(function(){t('[data-provide="colorpicker"]').colorPicker()})}(jQuery),function(t,e){function i(t){return t===e&&(t=n+=1),s[t%s.length]}var n=0,s=["#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(),s=n.chart||"pie",o=t(n.target);if(o.length){var a=null;if("pie"===s){n=t.extend({scaleShowLabels:!0,scaleLabel:"<%=label%>: <%=value%>"},n);var r=[],l=e.find("tbody > tr").each(function(e){var n=t(this),s=i();n.attr("data-id",e).find(".chart-color-dot").css("background",s),r.push({label:n.find(".chart-label").text(),value:parseInt(n.find(".chart-value").text()),color:s,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})),a=o.pieChart(r,n),o.on("mousemove",function(t){var e=a.getSegmentsAtEvent(t);l.removeClass("active"),e.length&&l.filter('[data-id="'+e[0].id+'"]').addClass("active")})}else if("bar"===s){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),a=o.barChart(r,n)}else if("line"===s){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),a=o.lineChart(r,n)}null!==a&&e.data("zui.chart",a)}})};var o=function(i,n){var s=t(i);if(!s.data("initProgressPie")){s.data("initProgressPie",1);var o=s.is("canvas")?s:s.find("canvas"),a=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(s.find(".progress-value").text())},n,s.data()),r=o.length;r||(o=t("").appendTo(s)),o.attr("width")!==e?a.width=o.attr("width"):o.attr("width",a.width),o.attr("height")!==e?a.height=o.attr("height"):o.attr("height",a.height),r||8!=t.zui.browser.ie||G_vmlCanvasManager.initElement(o[0]),"auto"===a.animation&&(a.animation=a.width>30),a.value=Math.max(0,Math.min(100,a.value)),s.addClass("progress-pie-"+a.width);var l=[{value:a.value,label:a.name,color:a.color,circleBeginEnd:!0},{value:100-a.value,label:"",color:a.backColor}];o[a.doughnut?"doughnutChart":"pieChart"](l,t.extend({segmentShowStroke:!1,animation:a.animation,showTooltips:a.showTip,tooltipTemplate:a.tipTemplate,percentageInnerCutout:a.doughnutSize,reverseDrawOrder:!0,animationEasing:"easeInOutQuart",onAnimationProgress:a.realValue?function(t){s.find(".progress-value").text(Math.floor(a.realValue*t))}:e,onAnimationComplete:a.realValue?function(t){s.find(".progress-value").text(a.realValue)}:e},a.chartOptions))}};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(){o(i,e)}):o(this,e)}})},t(function(){t(".table-chart").tableChart();var e=t(".progress-pie");e.length>100?setTimeout(function(){e.progressPie()},1e3):e.progressPie()})}(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),s=n.height,o=[],a=n.width,r=n.values.split(","),l=0;for(var h in r){var c=parseFloat(r[h]);NaN!=c&&(o.push(c),l=Math.max(c,l))}var d=(Math.min(l,30),Math.min(a,Math.max(10,o.length*a/30))),u=i.children("canvas");u.length||(i.append(''),u=i.children("canvas")),u.attr("width",d).attr("height",s);var p={labels:o,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:o}]},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(function(){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")})})};var e={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"},i=t.extend({},e,{minView:2,format:"yyyy-mm-dd"}),n=t.extend({},e,{startView:1,minView:0,maxView:1,format:"hh:ii"});t(".datepicker-wrapper").click(function(){t(this).find(".form-date, .form-datetime, .form-time").datetimepicker("show").focus()}),window.datepickerOptions=e,t.fn.datepicker=function(e){return this.datetimepicker(t.extend({},i,e))},t.fn.timepicker=function(e){return this.datetimepicker(t.extend({},n,e))},t.fn.datepickerAll=function(){return this.find(".form-datetime").fixedDate().datetimepicker(e),this.find(".form-date").fixedDate().datepicker(),this.find(".form-time").fixedDate().timepicker(),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 s=0,o=0,a=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=o-1:"left"===t?n>0?n-=1:n=s-1:"right"===t&&(n").html(a);return r.attr("data-row",e).addClass(n.attr("class")).removeClass("template"),i.rowCreator&&i.rowCreator(r,e,i),s?s.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)};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}"}},s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),o=function(e,s){var a=this;a.name=i;var r=a.$=t(e);s=a.options=t.extend({},o.DEFAULTS,this.$.data(),s);var l=s.lang||"zh_cn";a.lang=t.isPlainObject(l)?t.extend(!0,{},n[l.lang||t.zui.clientLang()],l):n[l],r.attr("id")||(r.attr("id","table-"+t.zui.uuid()),s.hot&&console.warn("ZUI: table hot replace id not defined, the element id attribute should be set.")),r.attr("data-ride")||r.attr("data-ride","table"),a.getTable().find("thead>tr>th").each(function(){var e=t(this);e.attr("title")||e.attr("title",e.find("a").text()||e.text())}),s.checkable&&(r.on("click",".check-all",function(){a.checkAll(!t(this).hasClass("checked"))}).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))}).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"))}),s.selectable&&r.selectable(t.extend({},{selector:a.isDataTable?".fixed-left tbody>tr":"tbody>tr",selectClass:"",trigger:".c-id",clickBehavior:"multi",listenClick:!1,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(s.selectable)?s.selectable:null)));var h=a.$form=r.is("form")?r:r.find("form");h.length&&(s.ajaxForm?h.ajaxForm(t.isPlainObject(s.ajaxForm)?s.ajaxForm:null):h.on("click","[data-form-action]",function(){h.attr("action",t(this).data("formAction")).submit()})),(s.fixFooter||s.fixHeader)&&(a.pageFooterHeight=t("#footer").outerHeight(),a.updateFixUI(),t(window).on("scroll resize",function(){a.updateFixUI()}).on("sidebar.toggle",function(){setTimeout(function(){a.updateFixUI()},200)})),s.group&&(r.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=r.find(".table-statistic").html(),a.updateStatistic(),a.initModals(),a.checkItems={},a.updateCheckUI()};o.prototype.reload=function(e){var i=this,n=i.options,s=n.replaceId;if(!s)return e&&e();"self"===s&&(s=i.$.attr("id"));var o=(t(s),t("
        "));i.$.addClass("load-indicator loading"),o.load(window.location.href+" #"+s,function(){i.$.empty().html(o.children().html()).removeClass("load-indicator loading"),i.updateStatistic(),i.initModals(),i.$.datepickerAll();var s=i.$.find("tbody>tr"),a=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(s.filter('[data-id="'+t+'"]'),!0,!0),a=!0)}),a&&i.updateCheckUI(),e&&e(),n.afterReload&&n.afterReload()})},o.prototype.initModals=function(){var e=this,i=e.options,n=e.$.find(i.iframeModalTrigger);if(n.length){var s={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(s)}},o.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},o.prototype.toggleGroups=function(e){var i=this,n={};i.$.find("tbody>tr").each(function(){var s=t(this).closest("tr").data("id");n[s]||i.toggleRowGroup(s,e)})},o.prototype.toggleRowGroup=function(i,n){var s=this.$.find('tbody>tr[data-id="'+i+'"]'),o=s.filter(".group-summary"),a=n===e?!o.hasClass("hidden"):!!n;s.not(".group-summary").toggleClass("hidden",!a),o.toggleClass("hidden",a),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},o.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 s=i.statisticCols;if(!s&&s!==!1){s={};var o=!1;i.getTable().find("thead th").each(function(e){var i=t(this),n=i.data("statistic");n&&(o=!0,s[e]={format:n,name:i.text()})}),i.statisticCols=!!o&&s}var a=0;s&&t.each(s,function(t){s[t].total=0,s[t].checkedTotal=0}),i.$.find("tbody>tr").each(function(e){var i=t(this),n=i.hasClass("checked"),o=i.children("td");n&&a++,s&&t.each(s,function(t){var e=parseFloat(o.eq(t).text());isNaN(e)&&(e=0),s[t].total+=e,n&&(s[t].checkedTotal+=e)})});var r=[];if(a)r.push(i.lang.selectedItems.format(a));else if(i.defaultStatistic)return void n.html(i.defaultStatistic);s&&t.each(s,function(t){var e=s[t],n=e[a?"checkedTotal":"total"];e.format&&(n=e.format.format(n)),r.push(i.lang.attrTotal.format(e.name,n))}),n.html(r.join(", "))}},o.prototype.updateFixUI=function(e){var i=this,n=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||n-i.lastUpdateTime<100))return void(i.lastUpdateCall=setTimeout(function(){i.updateFixUI(!0)},30));if(i.lastUpdateTime=n,i.lastUpdateCall&&(clearTimeout(i.lastUpdateCall),i.lastUpdateCall=null),s){var o=i.getTable();if(o.parent().is(".table-responsive")){var a=o.find("thead"),r=0;a.find("th").each(function(){r+=t(this).outerWidth()}),o.css("min-width",r)}}i.options.fixHeader&&!i.isDataTable&&i.fixHeader(),i.options.fixFooter&&i.fixFooter()},o.prototype.fixHeader=function(){var e=this,i=e.getTable(),n=i.find("thead"),s=n[0].getBoundingClientRect(),o=e.options.fixFooter,a=t.isFunction(o)?o(s,n):s.top<("number"==typeof o?o:-5),r=e.$.find(".fix-table-copy-wrapper"),l=i.parent(),h=l.is(".table-responsive");if(a){if(r.length||(r=t('
        ').append(t('
        ').addClass(i.attr("class")).append(n.clone())).insertAfter(i)),h){var c=l[0].getBoundingClientRect();r.css({left:c.left,width:l.width()}),r.find(".fixed-header-copy").css({left:s.left-c.left,position:"relative",minWidth:i.width()}),l.data("fixHeaderScroll")||l.data("fixHeaderScroll",1).on("scroll",function(){e.fixHeader()})}else r.css({left:s.left,width:s.width});var d=r.find("th");n.find("th").each(function(e){d.eq(e).css("width",t(this).outerWidth())})}else r.remove()},o.prototype.fixFooter=function(){var e,i=this,n=i.getTable(),s=i.$.find(".table-footer");if(i.isDataTable)e=n[0].getBoundingClientRect();else{var o=n.find("tbody");if(!o.length)return;e=o[0].getBoundingClientRect()}var a=i.options.fixFooter;s.toggleClass("fixed-footer",!!r);var r=t.isFunction(a)?a(e,s):e.bottom>window.innerHeight-50-("number"==typeof a?a:i.pageFooterHeight||5);if(s.toggleClass("fixed-footer",!!r),n.toggleClass("with-footer-fixed",!!r),n.trigger("fixFooter",r),r){var l=n.parent(),h=l.is(".table-responsive");s.css({bottom:i.pageFooterHeight,left:h?l[0].getBoundingClientRect().left:e.left,width:h?l.width():e.width})}else s.css({width:"",left:0,bottom:0})},o.prototype.checkAll=function(e){var i=this,n=i.$.find("tbody>tr");n.each(function(){i.checkRow(t(this),e,!0)}),i.updateCheckUI()},o.prototype.checkRow=function(t,i,n){var s=this;s.isDataTable&&!t.is(".datatable-row-left")&&(t=s.getTable().find('.datatable-row-left[data-index="'+t.data("index")+'"]'));var o=t.find('input[type="checkbox"]');i===e&&(i=!o.is(":checked")),s.isDataTable?s.getTable().find('.datatable-row[data-index="'+t.data("index")+'"]').toggleClass("checked",i):t.toggleClass("checked",i),this.checkItems[t.data("id")]=i,o.prop("checked",i).trigger("change"),n||s.updateCheckUI()},o.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),n=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr"),s=!1,o=null,a=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&&!s),o&&o.toggleClass("row-check-end",!r&&s),r&&(a+=1),o=d,s=r,l===n+1&&d.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",a>0).find(".check-all").toggleClass("checked",!(!l||a!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange()},o.DEFAULTS={checkable:!0,ajaxForm:!1,selectable:!0,fixHeader:!0,fixFooter:!0,iframeWidth:900,replaceId:"self",hot:!1,iframeModalTrigger:".iframe"},t.fn.table=function(e){return this.each(function(){var n=t(this),s=n.data(i),a="object"==typeof e&&e;s||n.data(i,s=new o(this,a)),"string"==typeof e&&s[e]()})},o.NAME=i,t.fn.table.Constructor=o,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"},s="";t.fn.enableForm=function(e){return e===i&&(e=!0),this.each(function(){var i=t(this);i.find('[type="submit"]').attr("disabled",e?null:"disabled"),i.hasClass("load-indicator")&&i.toggleClass("loading",!e)})};var o=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(a,r){var l=t(a);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,o,a){if(l.enableForm(!1),(h&&h(n,o,a))!==!1){var r={},c=o.find('[type="file"]');r.fileapi=c.length&&c[0].files!==i,r.formdata=e.FormData!==i;var d=r.fileapi&&o.find('input[type="file"]:enabled').filter(function(){return""!==t(this).val()}),u=d.length,p="multipart/form-data",f=o.attr("enctype")==p||o.attr("encoding")==p,g=r.fileapi&&r.formdata,m=(u||f)&&!g;m&&(""==s&&(s=a.url),a.url!=s&&(a.url=s),a.url=a.url.indexOf("&")>=0?a.url+"&HTTP_X_REQUESTED_WITH=XMLHttpRequest":a.url+"?HTTP_X_REQUESTED_WITH=XMLHttpRequest")}},success:function(i,n,s){if(l.enableForm(),(d&&d(i,n,s,l))!==!1){try{"string"==typeof i&&(i=JSON.parse(i))}catch(a){}if(null===i||"object"!=typeof i)return i?alert(i):o("No response.","danger");var h=r.responser?t(r.responser):l.find(".form-responser");h.length||(h=t("#responser"));var c=i.message;if("success"===i.result){if(c){var p=l.find('[type="submit"]'),f=!1;p.length&&(p.popover({container:"body",trigger:"manual",content:c,tipClass:"popover-in-modal popover-success text-success",placement:i.placement||r.popoverPlacement||"right"}).popover("show"),setTimeout(function(){p.popover("destroy")},r.popoverTime||2e3),f=!0),h.length&&(h.html(''+c+"").show().delay(3e3).fadeOut(100),f=!0),f||o(c,"success")}if(u)return u(i,!0,l); -if((r.closeModal||i.closeModal)&&setTimeout(t.zui.closeModal,r.closeModalTime||2e3),i.callback){var g=e[i.callback];if(t.isFunction(g)&&g()===!1)return}var m=r.locate||i.locate;if(m)if("loadInModal"==m){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{var y="reload"==m?e.location.href:m;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("string"==typeof c)h.length?h.html(''+c+"").show().delay(3e3).fadeOut(100):o(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,s=t("#"+e);if(!s.length)return void C.push(n);var o=e+"Label",a=t("#"+o);if(!a.length){var r=s.closest(".input-group").length;a=t('
        ').appendTo(r?s.closest(".input-group").parent():s.parent())}a.empty().append(n),s.addClass("has-error");var l=function(){var e=t("#"+o);if(e.length)return e.remove(),s.removeClass("has-error"),!0};s.on("change input mousedown",l);var h=t("#"+e+"_chosen");h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){l()===!0&&t(this).removeClass("has-error")}),x||(s.focus(),x=!0)}),C.length&&o(C.join(";"),"danger")}if(u)return u(i,!1,l)}}},error:function(t,i,n){if((c&&c(t,i,n,l))!==!1){l.enableForm();var s="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;o(s,"danger")}}},r),l._ajaxForm(r),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},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]").setInputRequired()},400)})}(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(a)),i.$menu.append(a),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].scrollIntoView({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector)},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,s=void 0===e||null===e||""===e,o=n.getItems().removeClass("active");if(s)o.removeClass("hidden");else{var a=t.trim(e).split(" ");o.each(function(){var e=t(this),n=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(a,n))})}n.scrollTo(o.not(".hidden").first().addClass("active"))},n.DEFAULTS={selector:".list-group a",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var s=t(this),o=s.data(e),a="object"==typeof i&&i;o||s.data(e,o=new n(this,a)),"string"==typeof i&&o[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,s){var o=this;o.name=e,o.$=t(n),s=o.options=t.extend({},i.DEFAULTS,this.$.data(),s),o.$.hide(),o.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 s=e.$.next();n=s.hasClass(".label-selector")?s:t('
        ')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),s=t(this).data("value");e.hasEmptyValue!==!1&&s==n&&(s=e.hasEmptyValue),e.select(s),i.preventDefault()})}n.empty();var o=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var s=t(this),a={label:s.text(),value:s.val()},r=""===a.value||"0"===a.value;if(!r||(e.hasEmptyValue=a.value,a.label)){var l=t(i.labelTemplate||'');i.labelClass&&!r&&l.addClass(i.labelClass),i.labelCreator?l=i.labelCreator(l):(l.data("option",a).attr("data-value",a.value),r&&!a.label?l.addClass("empty").append(''):l.text(a.label).toggleClass("active",o===a.value)),n.append(l)}})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var s=t(this),o=s.data(e),a="object"==typeof n&&n;o||s.data(e,o=new i(this,a)),"string"==typeof n&&o[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";const i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776};var n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ta.fileMaxSize&&(h.val(""),(window.bootbox||window).alert(a.fileSizeError.format(n(a.fileMaxSize)))),r.update()}),r.update()};o.prototype.getFile=function(){return this.$input.prop("files")[0]},o.prototype.update=function(t){var e=this,i=e.$,s=e.getFile(),o=!s;i.toggleClass("normal",!o).toggleClass("empty",o),s?(e.oldName=s.name,i.find(".file-title").text(s.name).attr("title",s.name),i.find(".file-size").text(n(s.size)),i.find(".file-editbox").val(s.name).attr("size",s.name.length),e.options.onSelect&&e.options.onSelect(s,e)):i.find(".file-editbox").val("")},o.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),s=n.data(e),a="object"==typeof i&&i;s||n.data(e,s=new o(this,a)),"string"==typeof i&&s[i]()})},o.NAME=e,t.fn.fileInput.Constructor=o,t(function(){t('[data-provide="fileInput"]').fileInput()});var a="zui.fileInputList",r=function(e,i){var n=this;n.name=a;var s=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=s.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(a),s="object"==typeof e&&e;n||i.data(a,n=new r(this,s)),"string"==typeof e&&n[e]()})},r.NAME=a,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,s,o){if(s||(s=config.defaultView),o||(o=!1),n)for(n=n.split("&"),i=0;i'+d+"")}}t.val()||(time=e(o.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var a=t(this),r=t.extend({},i,a.data()),l=a.find('[name="begin"],.control-time-begin'),h=a.find('[name="end"],.control-time-end'),c=function(){var t=l.val();if(a.find(".hide-empty-begin").toggleClass("hide",!t),t){const i=n(e(t)+30);h.find('option[value="'+i+'"]').length&&h.val(i),r.onChange&&r.onChange(h,i)}};if(a.data("timeSpanControlInit")){if(r.begin){const d=s(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){const u=s(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),o(l,r.begin),o(h,r.end),a.data("timeSpanControlInit",!0);r.end||c()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:o,createTime:s};var a=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var s=t("#searchTypeMenu");s.find("li.selected").removeClass("selected");var o=s.find('a[data-value="'+e+'"]'),a=o.text();o.parent().addClass("selected"),t("#searchTypeName").text(a),i||t("#searchInput").focus()};t.gotoObject=function(e,i){e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e&&(window.location.href=t.createLink(e,"testsuite"===e?"library":"view","id="+i))},t(function(){a(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.chosenDefaultOptions={disable_search_threshold:1,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
        {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.zui.Messager.DEFAULTS.cssClass="messagger-zt",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);i=t.extend({},n.data(),i);var s=n.find(".histories-list"),o=!0,a=!1;n.on("click",".btn-reverse",function(){s.children("li").reverseOrder(),o=!o,t(this).find(".icon").toggleClass("icon-arrow-up",o).toggleClass("icon-arrow-down",!o)}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");a=!a,e.toggleClass("icon-plus",!a).toggleClass("icon-minus",a),s.children("li").toggleClass("show-changes",a)}).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"),s=n.hasClass("icon-code");n.toggleClass("icon-code",!s).toggleClass("icon-text",s),e.attr("title",s?i.original:i.textdiff),e.closest("li").toggleClass("show-original",s)}),s.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),e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):i.trigger("sidebar.toggle",e),t.zui.store.set(h,e)}};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");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 s=function(){var i=e.find(".sidebar-toggle");if(i.length){var n=i[0].getBoundingClientRect(),s=t(window).height(),o=Math.max(0,Math.floor(Math.min(s-40,n.top+n.height)-Math.max(n.top,0))/2)+(n.top<0?0-n.top:0);i.find(".icon").css("top",o)}};return s(),t(window).on("resize",s).on("scroll",s),e.data("init",1),!0}};c()||t(c),t.toggleQueryBox=function(e,i){var n=t(i||"#queryBox");n.length&&(void 0===e&&(e=!n.hasClass("show")),n.toggleClass("show",!!e),n.data("init")||(n.addClass("load-indicator loading").data("init",1),t.get(t.createLink("search","buildForm"),function(t){n.html(t).removeClass("loading")})),t(".querybox-toggle").toggleClass("querybox-opened",e))},t(function(){var e=t("#queryBox");e.length&&(t(document).on("click",".querybox-toggle",function(){t.toggleQueryBox()}),e.hasClass("show")&&t.toggleQueryBox(!0))}),t.extend(t.fn.colorPicker.Constructor.DEFAULTS,{colors:["#3DA7F5","#75C941","#2DBDB2","#797EC9","#FFAF38","#FF4E3E"]}),window.setCheckedCookie=function(){var e=[],i=t('#mainContent .main-table tbody>tr 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.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t(function(){t("a.iframe,.export").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.modalTrigger(i)}})});var d=function(){var e,i,n=t(this),s=t.extend({limitSize:40,suffix:"…"},n.data()),o=n.text();if(o.length>s.limitSize){e=o,i=o.substr(0,s.limitSize)+s.suffix,n.text(i).addClass("limit-text-on");var a=s.toggleBtn?t(s.toggleBtn):n.next(".text-limit-toggle");a.text(a.data("textExpand")),a.on("click",function(){var t=n.toggleClass("limit-text-on").hasClass("limit-text-on");n.text(t?i:e),a.text(a.data(t?"textExpand":"textCollapse"))})}else(s.toggleBtn?t(s.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 s=t(i||window),o=null,a=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),s=n.next(".fixed-head-table");if(i.top<0){var a=e.width();if(s.length){if(o!==a){o=a;var r=s.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var s=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())}),s.append(l).insertAfter(n)}s.css({left:i.left,width:i.width}).show()}else s.hide()};s.on("scroll",a).on("resize",a),a()}},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 s=Math.max(300,e-i-n),o=Math.min(s,m),a=(e-o)/2,r=i&&a.btn-toolbar");if(e.length){var i=!1,n=null;e.children().each(function(){var e=t(this),s=e.is(".divider");s&&!n&&e.hide(),i||s||(i=!0),n=s?null:e}),i||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),k()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])});var T=function(){var e,i="en"==config.clientLang?"http://www.zentao.pm/book/zentaomanual/8.html?fullScreen=zentao":"http://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao",n=t("#navbar > .nav").first(),s=1e4,o=function(){clearTimeout(e),t("#helpContent").removeClass("show-error")},a=t.openHelp=function(){o();var a=(n.children("li.active:not(#helpMenuItem)").removeClass("active").addClass("close-help-tab"),t("#helpMenuItem").addClass("active"),t("#helpContent"));if(a.length){if(t("body").hasClass("show-help-tab"))return void t("#helpIframe").get(0).contentWindow.location.replace(i)}else{a=t('

        '+lang.timeout+'

        '+i+'

        '),t("#header").after(a);var r=t("#helpIframe").get(0);e=setTimeout(function(){t("#helpContent").addClass("show-error")},s),r.onload=r.onreadystatechange=function(){this.readyState&&"complete"!=this.readyState||o()}}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("#helpMenuItem");i.length||(i=t('
      • '+t(this).text()+'
      • '),n.append('
      • ').append(i)),a(),e.preventDefault()}).on("click",".close-help-tab",function(t){r(),t.stopPropagation(),t.preventDefault()})};t(T)}(jQuery); \ No newline at end of file +if((r.closeModal||i.closeModal)&&setTimeout(t.zui.closeModal,r.closeModalTime||2e3),i.callback){var g=e[i.callback];if(t.isFunction(g)&&g()===!1)return}var m=r.locate||i.locate;if(m)if("loadInModal"==m){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{var y="reload"==m?e.location.href:m;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("string"==typeof c)h.length?h.html(''+c+"").show().delay(3e3).fadeOut(100):o(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,s=t("#"+e);if(!s.length)return void C.push(n);var o=e+"Label",a=t("#"+o);if(!a.length){var r=s.closest(".input-group").length;a=t('
        ').appendTo(r?s.closest(".input-group").parent():s.parent())}a.empty().append(n),s.addClass("has-error");var l=function(){var e=t("#"+o);if(e.length)return e.remove(),s.removeClass("has-error"),!0};s.on("change input mousedown",l);var h=t("#"+e+"_chosen");h.length&&h.find(".chosen-single,.chosen-choices").addClass("has-error").on("mousedown",function(){l()===!0&&t(this).removeClass("has-error")}),x||(s.focus(),x=!0)}),C.length&&o(C.join(";"),"danger")}if(u)return u(i,!1,l)}}},error:function(t,i,n){if((c&&c(t,i,n,l))!==!1){l.enableForm();var s="timeout"==i||"error"==i?e.lang?e.lang.timeout:i:t.responseText+i+n;o(s,"danger")}}},r),l._ajaxForm(r),l.on("click","[data-form-action]",function(){l.attr("action",t(this).data("formAction")).submit()})},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]").setInputRequired()},400)})}(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(a)),i.$menu.append(a),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].scrollIntoView({behavior:"smooth"})},n.prototype.getItems=function(){return this.$.find(this.options.selector)},n.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},n.prototype.search=function(e){var n=this,s=void 0===e||null===e||""===e,o=n.getItems().removeClass("active");if(s)o.removeClass("hidden");else{var a=t.trim(e).split(" ");o.each(function(){var e=t(this),n=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(a,n))})}n.scrollTo(o.not(".hidden").first().addClass("active"))},n.DEFAULTS={selector:".list-group a",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var s=t(this),o=s.data(e),a="object"==typeof i&&i;o||s.data(e,o=new n(this,a)),"string"==typeof i&&o[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,s){var o=this;o.name=e,o.$=t(n),s=o.options=t.extend({},i.DEFAULTS,this.$.data(),s),o.$.hide(),o.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 s=e.$.next();n=s.hasClass(".label-selector")?s:t('
        ')}n.parent().length||e.$.after(n),e.$wrapper=n,n.on("click",".label",function(i){var n=e.$.val(),s=t(this).data("value");e.hasEmptyValue!==!1&&s==n&&(s=e.hasEmptyValue),e.select(s),i.preventDefault()})}n.empty();var o=e.$.val();e.hasEmptyValue=!1,e.$.children("option").each(function(){var s=t(this),a={label:s.text(),value:s.val()},r=""===a.value||"0"===a.value;if(!r||(e.hasEmptyValue=a.value,a.label)){var l=t(i.labelTemplate||'');i.labelClass&&!r&&l.addClass(i.labelClass),i.labelCreator?l=i.labelCreator(l):(l.data("option",a).attr("data-value",a.value),r&&!a.label?l.addClass("empty").append(''):l.text(a.label).toggleClass("active",o===a.value)),n.append(l)}})},i.DEFAULTS={},t.fn.labelSelector=function(n){return this.each(function(){var s=t(this),o=s.data(e),a="object"==typeof n&&n;o||s.data(e,o=new i(this,a)),"string"==typeof n&&o[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";const i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776};var n=t.formatBytes=function(t,e,n){return void 0===e&&(e=2),n||(n=ta.fileMaxSize&&(h.val(""),(window.bootbox||window).alert(a.fileSizeError.format(n(a.fileMaxSize)))),r.update()}),r.update()};o.prototype.getFile=function(){return this.$input.prop("files")[0]},o.prototype.update=function(t){var e=this,i=e.$,s=e.getFile(),o=!s;i.toggleClass("normal",!o).toggleClass("empty",o),s?(e.oldName=s.name,i.find(".file-title").text(s.name).attr("title",s.name),i.find(".file-size").text(n(s.size)),i.find(".file-editbox").val(s.name).attr("size",s.name.length),e.options.onSelect&&e.options.onSelect(s,e)):i.find(".file-editbox").val("")},o.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var n=t(this),s=n.data(e),a="object"==typeof i&&i;s||n.data(e,s=new o(this,a)),"string"==typeof i&&s[i]()})},o.NAME=e,t.fn.fileInput.Constructor=o,t(function(){t('[data-provide="fileInput"]').fileInput()});var a="zui.fileInputList",r=function(e,i){var n=this;n.name=a;var s=n.$=t(e);i=n.options=t.extend({},r.DEFAULTS,this.$.data(),i),n.$template=s.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(a),s="object"==typeof e&&e;n||i.data(a,n=new r(this,s)),"string"==typeof e&&n[e]()})},r.NAME=a,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,s,o){if(s||(s=config.defaultView),o||(o=!1),n)for(n=n.split("&"),i=0;i'+d+"")}}t.val()||(time=e(o.format("hh:mm")),time=time-time%10+10,t.val(n(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var a=t(this),r=t.extend({},i,a.data()),l=a.find('[name="begin"],.control-time-begin'),h=a.find('[name="end"],.control-time-end'),c=function(){var t=l.val();if(a.find(".hide-empty-begin").toggleClass("hide",!t),t){const i=n(e(t)+30);h.find('option[value="'+i+'"]').length&&h.val(i),r.onChange&&r.onChange(h,i)}};if(a.data("timeSpanControlInit")){if(r.begin){const d=s(r.begin).format("hh:mm");l.find('option[value="'+d+'"]').length&&l.val(d),r.onChange&&r.onChange(l,d)}if(r.end){const u=s(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),o(l,r.begin),o(h,r.end),a.data("timeSpanControlInit",!0);r.end||c()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:n,initTimeSelect:o,createTime:s};var a=t.setSearchType=function(e,i){var n=t("#searchType");e||(e=n.val()),e=e||"bug",n.val(e);var s=t("#searchTypeMenu");s.find("li.selected").removeClass("selected");var o=s.find('a[data-value="'+e+'"]'),a=o.text();o.parent().addClass("selected"),t("#searchTypeName").text(a),i||t("#searchInput").focus()};t.gotoObject=function(e,i){e||(e=t("#searchType").val()),i||(i=t("#searchInput").val()),i&&e&&(window.location.href=t.createLink(e,"testsuite"===e?"library":"view","id="+i))},t(function(){a(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.chosenDefaultOptions={disable_search_threshold:1,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",search_contains:!0},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})},t(function(){t(".chosen,.chosen-simple").each(function(){var e=t(this);e.closest(".template").length||e.chosen()})}),t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'
        {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.zui.Messager.DEFAULTS.cssClass="messagger-zt",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);i=t.extend({},n.data(),i);var s=n.find(".histories-list"),o=!0,a=!1;n.on("click",".btn-reverse",function(){s.children("li").reverseOrder(),o=!o,t(this).find(".icon").toggleClass("icon-arrow-up",o).toggleClass("icon-arrow-down",!o)}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");a=!a,e.toggleClass("icon-plus",!a).toggleClass("icon-minus",a),s.children("li").toggleClass("show-changes",a)}).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"),s=n.hasClass("icon-code");n.toggleClass("icon-code",!s).toggleClass("icon-text",s),e.attr("title",s?i.original:i.textdiff),e.closest("li").toggleClass("show-original",s)}),s.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),e?(i.addClass("showing"),l=setTimeout(function(){i.removeClass("showing"),i.trigger("sidebar.toggle",e)},210)):i.trigger("sidebar.toggle",e),t.zui.store.set(h,e)}};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");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 s=function(){var i=e.find(".sidebar-toggle");if(i.length){var n=i[0].getBoundingClientRect(),s=t(window).height(),o=Math.max(0,Math.floor(Math.min(s-40,n.top+n.height)-Math.max(n.top,0))/2)+(n.top<0?0-n.top:0);i.find(".icon").css("top",o)}};return s(),t(window).on("resize",s).on("scroll",s),e.data("init",1),!0}};c()||t(c),t.toggleQueryBox=function(e,i){var n=t(i||"#queryBox");n.length&&(void 0===e&&(e=!n.hasClass("show")),n.toggleClass("show",!!e),n.data("init")||(n.addClass("load-indicator loading").data("init",1),t.get(t.createLink("search","buildForm"),function(t){n.html(t).removeClass("loading")})),t(".querybox-toggle").toggleClass("querybox-opened",e))},t(function(){var e=t("#queryBox");e.length&&(t(document).on("click",".querybox-toggle",function(){t.toggleQueryBox()}),e.hasClass("show")&&t.toggleQueryBox(!0))}),t.extend(t.fn.colorPicker.Constructor.DEFAULTS,{colors:["#3DA7F5","#75C941","#2DBDB2","#797EC9","#FFAF38","#FF4E3E"]}),window.setCheckedCookie=function(){var e=[],i=t('#mainContent .main-table tbody>tr 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.zui.ModalTrigger.DEFAULTS,{scrollInside:!0,backdrop:"static"}),t(function(){t("a.iframe,.export").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.modalTrigger(i)}})});var d=function(){var e,i,n=t(this),s=t.extend({limitSize:40,suffix:"…"},n.data()),o=n.text();if(o.length>s.limitSize){e=o,i=o.substr(0,s.limitSize)+s.suffix,n.text(i).addClass("limit-text-on");var a=s.toggleBtn?t(s.toggleBtn):n.next(".text-limit-toggle");a.text(a.data("textExpand")),a.on("click",function(){var t=n.toggleClass("limit-text-on").hasClass("limit-text-on");n.text(t?i:e),a.text(a.data(t?"textExpand":"textCollapse"))})}else(s.toggleBtn?t(s.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 s=t(i||window),o=null,a=function(){var e=n.children("thead"),i=e[0].getBoundingClientRect(),s=n.next(".fixed-head-table");if(i.top<0){var a=e.width();if(s.length){if(o!==a){o=a;var r=s.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var s=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())}),s.append(l).insertAfter(n)}s.css({left:i.left,width:i.width}).show()}else s.hide()};s.on("scroll",a).on("resize",a),a()}},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 s=Math.max(300,e-i-n),o=Math.min(s,m),a=(e-o)/2,r=i&&a.btn-toolbar");if(e.length){var i=!1,n=null;e.children().each(function(){var e=t(this),s=e.is(".divider");s&&!n&&e.hide(),i||s||(i=!0),n=s?null:e}),i||e.hide()}};t(function(){t(".input-group,.btn-group").fixInputGroup(),k()}),window.holders&&t.each(window.holders,function(e){var i=t("#"+e);i.length&&i.is("input")&&i.attr("placeholder",window.holders[e])});var T=function(){var e,i="en"==config.clientLang?"http://www.zentao.pm/book/zentaomanual/8.html?fullScreen=zentao":"http://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao",n=t("#navbar > .nav").first(),s=1e4,o=function(){clearTimeout(e),t("#helpContent").removeClass("show-error")},a=t.openHelp=function(){o();var a=(n.children("li.active:not(#helpMenuItem)").removeClass("active").addClass("close-help-tab"),t("#helpMenuItem").addClass("active"),t("#helpContent"));if(a.length){if(t("body").hasClass("show-help-tab"))return void t("#helpIframe").get(0).contentWindow.location.replace(i)}else{a=t('

        '+lang.timeout+'

        '+i+'

        '),t("#header").after(a);var r=t("#helpIframe").get(0);e=setTimeout(function(){t("#helpContent").addClass("show-error")},s),r.onload=r.onreadystatechange=function(){this.readyState&&"complete"!=this.readyState||o()}}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("#helpMenuItem");i.length||(i=t('
      • '+t(this).text()+'
      • '),n.append('
      • ').append(i)),a(),e.preventDefault()}).on("click",".close-help-tab",function(t){r(),t.stopPropagation(),t.preventDefault()})};t(T)}(jQuery); \ No newline at end of file From bbae037e9f897fa2ab20ac79328a452502182c30 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 09:08:20 +0800 Subject: [PATCH 02/16] * finish task #4529. --- module/bug/control.php | 6 +++--- module/bug/model.php | 25 +++++++++++++++++-------- module/testtask/js/common.js | 16 ++++++++++++++++ module/testtask/view/results.html.php | 6 +++--- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 1cd4977818..4d460a554d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -254,7 +254,7 @@ class bug extends control $this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted'); $this->app->loadLang('release'); - if(!empty($_POST) and !isset($_POST['stepIDList'])) + if(!empty($_POST)) { $response['result'] = 'success'; $response['message'] = ''; @@ -332,8 +332,8 @@ class bug extends control $extras = str_replace(array(',', ' '), array('&', ''), $extras); parse_str($extras); - if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID));// If set runID and resultID, get the result info by resultID as template. - if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version));// If not set runID but set caseID, get the result info by resultID and case info. + if($runID and $resultID) extract($this->bug->getBugInfoFromResult($resultID, 0, 0, isset($stepIdList) ? $stepIdList : ''));// If set runID and resultID, get the result info by resultID as template. + if(!$runID and $caseID) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version, isset($stepIdList) ? $stepIdList : ''));// If not set runID but set caseID, get the result info by resultID and case info. /* If bugID setted, use this bug as template. */ if(isset($bugID)) diff --git a/module/bug/model.php b/module/bug/model.php index dc97cd92fd..d68f1e0227 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1610,11 +1610,11 @@ class bugModel extends model * @access public * @return array */ - public function getBugInfoFromResult($resultID, $caseID = 0, $version = 0) + public function getBugInfoFromResult($resultID, $caseID = 0, $version = 0, $stepIdList = '') { $title = ''; $bugSteps = ''; - $steps = zget($_POST, 'stepIDList', array()); + $steps = explode('_', trim($stepIdList, '_')); $result = $this->dao->findById($resultID)->from(TABLE_TESTRESULT)->fetch(); if($caseID > 0) @@ -1635,38 +1635,47 @@ class bugModel extends model $bugSteps = "

        [" . $this->lang->testcase->precondition . "]

        " . "\n" . $run->case->precondition; } - $bugSteps .= $this->lang->bug->tplStep; if(!empty($stepResults)) { $i = 1; + $bugStep = ''; foreach($steps as $stepId) { if(!isset($caseSteps[$stepId])) continue; $step = $caseSteps[$stepId]; - $bugSteps .= $i . '. ' . $step->desc . "
        "; + $bugStep .= $i . '. ' . $step->desc . "
        "; $i++; } + $bugSteps .= $bugStep ? str_replace('
        ', '', $this->lang->bug->tplStep) . $bugStep : $this->lang->bug->tplStep; - $bugSteps .= $this->lang->bug->tplResult; $i = 1; + $bugResult = ''; foreach($steps as $stepId) { if(!isset($stepResults[$stepId]) or empty($stepResults[$stepId]['real'])) continue; - $bugSteps .= $i . '. ' . $stepResults[$stepId]['real'] . "
        "; + $bugResult .= $i . '. ' . $stepResults[$stepId]['real'] . "
        "; $i++; } + $bugSteps .= $bugResult ? str_replace('
        ', '', $this->lang->bug->tplResult) . $bugResult : $this->lang->bug->tplResult; - $bugSteps .= $this->lang->bug->tplExpect; $i = 1; + $bugExpect = ''; foreach($steps as $stepId) { if(!isset($caseSteps[$stepId])) continue; $step = $caseSteps[$stepId]; - if($step->expect) $bugSteps .= $i . '. ' . $step->expect . "
        "; + if($step->expect) $bugExpect .= $i . '. ' . $step->expect . "
        "; $i++; } + $bugSteps .= $bugExpect ? str_replace('
        ', '', $this->lang->bug->tplExpect) . $bugExpect : $this->lang->bug->tplExpect; + } + else + { + $bugSteps .= $this->lang->bug->tplStep; + $bugSteps .= $this->lang->bug->tplResult; + $bugSteps .= $this->lang->bug->tplExpect; } return array('title' => $title, 'steps' => $bugSteps, 'storyID' => $run->case->story, 'moduleID' => $run->case->module, 'version' => $run->case->version); diff --git a/module/testtask/js/common.js b/module/testtask/js/common.js index fcee896bf6..1c67ebf668 100644 --- a/module/testtask/js/common.js +++ b/module/testtask/js/common.js @@ -28,3 +28,19 @@ function adjustPriBoxWidth() var addonWidth = $('#ownerAndPriBox .input-group-addon').outerWidth(); $('#pri,#pri_chosen .chosen-single').css('width', boxWidth - beginWidth -addonWidth); } + +function createBug(obj) +{ + var $form = $(obj).closest('form'); + var params = $form.data('params'); + var stepIdList = ''; + $form.find('.step .step-id :checkbox').each(function() + { + if($(this).prop('checked')) stepIdList += $(this).val() + '_'; + }); + + var onlybody = config.onlybody; + config.onlybody = 'no'; + window.open(createLink('bug', 'create', params + ',stepIdList=' + stepIdList), '_blank'); + config.onlybody = onlybody; +} diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index a8b2386b5b..5842848947 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -49,7 +49,7 @@ id,projectID=$testtask->project,buildID=$testtask->build" : '';?> -
        product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'> + @@ -82,7 +82,7 @@ - + From cb65bcbc12f64f4c67528f352ccf84a540b74061 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 4 Jul 2018 09:22:34 +0800 Subject: [PATCH 03/16] * Set nowrap for modal header. --- www/theme/default/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/www/theme/default/style.css b/www/theme/default/style.css index f1298dcc33..d50e1f96cc 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -9,3 +9,4 @@ * @link http://www.zentao.net */ .divider + .divider{display:none;} +.body-modal .main-header > h2{width: 100%; overflow:hidden; text-overflow: ellipsis; white-space: nowrap;} From f055eed1ef8d771364d5f6c5c158af5956df587a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 09:48:19 +0800 Subject: [PATCH 04/16] * finish task #4590. --- config/filter.php | 2 +- module/testtask/control.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/filter.php b/config/filter.php index 6b684691fd..eaa7706976 100644 --- a/config/filter.php +++ b/config/filter.php @@ -153,7 +153,7 @@ $filter->testsuite->library->cookie['libCaseModule'] = 'int'; $filter->testsuite->library->cookie['preCaseLibID'] = 'int'; $filter->testtask->browse->cookie['preBranch'] = 'int'; -$filter->testtask->cases->cookie['preProductID'] = 'int'; +$filter->testtask->cases->cookie['preTaskID'] = 'int'; $filter->testtask->cases->cookie['taskCaseModule'] = 'int'; $filter->testtask->default->cookie['lastProduct'] = 'int'; $filter->testtask->default->cookie['preProductID'] = 'int'; diff --git a/module/testtask/control.php b/module/testtask/control.php index d31fb26907..54255159c9 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -260,9 +260,9 @@ class testtask extends control if(!$task) die(js::error($this->lang->notFound) . js::locate('back')); $productID = $task->product; $this->testtask->setMenu($this->products, $productID, $task->branch, $taskID); - setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot); + setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot); - if($this->cookie->preProductID != $productID) + if($this->cookie->preTaskID != $taskID) { $_COOKIE['taskCaseModule'] = 0; setcookie('taskCaseModule', 0, $this->config->cookieLife, $this->config->webRoot); From fbbc51db488b63e1fdffe9a08137dd8e9b03cd23 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Wed, 4 Jul 2018 09:59:54 +0800 Subject: [PATCH 05/16] * Finish task #4543. --- module/project/view/story.html.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/module/project/view/story.html.php b/module/project/view/story.html.php index b3dabe6868..3e66d14f2d 100644 --- a/module/project/view/story.html.php +++ b/module/project/view/story.html.php @@ -46,16 +46,13 @@ else { echo "'; } From e0529846e345aa859363e439d4475cd1741d261c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 10:08:49 +0800 Subject: [PATCH 06/16] * finish task #4585. --- module/doc/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/doc/model.php b/module/doc/model.php index 3d7424e651..dc2d1e0045 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -562,12 +562,12 @@ class docModel extends model ->add('version', 1) ->setDefault('product,project,module', 0) ->stripTags($this->config->doc->editor->create['id'], $this->config->allowedTags) - ->stripTags($this->config->doc->markdown->create['id'], $this->config->allowedTags) ->cleanInt('product,project,module') ->join('groups', ',') ->join('users', ',') ->remove('files,labels,uid') ->get(); + $doc->contentMarkdown = strip_tags($this->post->contentMarkdown, $this->config->allowedTags); if($doc->acl == 'private') $doc->users = $this->app->user->account; $condition = "lib = '$doc->lib' AND module = $doc->module"; @@ -638,6 +638,7 @@ class docModel extends model ->join('users', ',') ->remove('comment,files,labels,uid') ->get(); + if($doc->contentType == 'markdown') $doc->content = strip_tags($this->post->content, $this->config->allowedTags); if($doc->acl == 'private') $doc->users = $oldDoc->addedBy; $oldDocContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($docID)->andWhere('version')->eq($oldDoc->version)->fetch(); From a6e0fce73ebd65d8c70ef795e285203306d0d107 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 10:38:12 +0800 Subject: [PATCH 07/16] * finish task #4523. --- module/product/control.php | 1 + module/product/model.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 0536959547..0df8c1a293 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -214,6 +214,7 @@ class product extends control } $rootID = key($this->products); + if($this->session->product) $rootID = $this->session->product; $this->product->setMenu($this->products, $rootID); $this->view->title = $this->lang->product->create; diff --git a/module/product/model.php b/module/product/model.php index 8a88879390..971ff72fc7 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -352,11 +352,11 @@ class productModel extends model public function create() { $product = fixer::input('post') - ->setIF($this->post->acl != 'custom', 'whitelist', '') - ->setDefault('status', 'normal') - ->setDefault('createdBy', $this->app->user->account) - ->setDefault('createdDate', helper::now()) - ->setDefault('createdVersion', $this->config->version) + ->setIF($this->post->acl != 'custom', 'whitelist', '') + ->setDefault('status', 'normal') + ->setDefault('createdBy', $this->app->user->account) + ->setDefault('createdDate', helper::now()) + ->setDefault('createdVersion', $this->config->version) ->join('whitelist', ',') ->stripTags($this->config->product->editor->create['id'], $this->config->allowedTags) ->remove('uid') From e842c24e657279928847ae79600580612a6a5314 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 11:01:22 +0800 Subject: [PATCH 08/16] * finish task #4581. --- module/testreport/model.php | 2 +- module/testreport/view/blockcases.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/testreport/model.php b/module/testreport/model.php index 799300f20b..15742911e1 100644 --- a/module/testreport/model.php +++ b/module/testreport/model.php @@ -321,7 +321,7 @@ class testreportModel extends model */ public function getTaskCases($tasks, $idList = '') { - return $this->dao->select('t2.*,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status')->from(TABLE_TESTRUN)->alias('t1') + return $this->dao->select('t2.*,t1.task,t1.assignedTo,t1.lastRunner,t1.lastRunDate,t1.lastRunResult,t1.status')->from(TABLE_TESTRUN)->alias('t1') ->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id') ->where('t1.task')->in(array_keys($tasks)) ->beginIF($idList)->andWhere('t2.id')->in($idList)->fi() diff --git a/module/testreport/view/blockcases.html.php b/module/testreport/view/blockcases.html.php index b9e474f395..2360790f06 100644 --- a/module/testreport/view/blockcases.html.php +++ b/module/testreport/view/blockcases.html.php @@ -19,7 +19,7 @@ - + From 31a7f1f9a2482f6beeb496681c1d872802a2763c Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 4 Jul 2018 11:05:01 +0800 Subject: [PATCH 09/16] * Adjust size for ranzhi logo. --- module/upgrade/css/afterexec.css | 11 +++-------- module/upgrade/view/afterexec.html.php | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/module/upgrade/css/afterexec.css b/module/upgrade/css/afterexec.css index b5cd835689..d25a8583a6 100644 --- a/module/upgrade/css/afterexec.css +++ b/module/upgrade/css/afterexec.css @@ -1,13 +1,5 @@ .adbox{margin-top:20px;} -.card.ad{margin-bottom:0px;} -.card.ad > .img-wrapper { - background-position: center; - background-repeat: no-repeat; - height: 115px; - width: 100%; -} - .card { position: relative; display: block; @@ -61,6 +53,9 @@ height: 115px; width: 100%; } + +.card.ad.ad-ranzhi > .img-wrapper {background-size: 100%;} + .card.ad > .img-wrapper > img{display: none;} .card.ad > .card-heading {text-align: center;} .card.ad > .card-reveal > .card-heading { padding: 12px 10px 10px 15px;} diff --git a/module/upgrade/view/afterexec.html.php b/module/upgrade/view/afterexec.html.php index 0590377b09..e506e66f21 100644 --- a/module/upgrade/view/afterexec.html.php +++ b/module/upgrade/view/afterexec.html.php @@ -25,7 +25,7 @@
        install->product as $product):?>
        - +
        install->{$product}->name?>
        From a596142ec59209f93ea3a50f79fdbad0aebed079 Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 4 Jul 2018 11:08:11 +0800 Subject: [PATCH 10/16] * Remove useless file. --- module/upgrade/js/common.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 module/upgrade/js/common.js diff --git a/module/upgrade/js/common.js b/module/upgrade/js/common.js deleted file mode 100644 index a5e10e3c26..0000000000 --- a/module/upgrade/js/common.js +++ /dev/null @@ -1 +0,0 @@ -$(function(){$.ajustModalPosition('fit', $('.modal-dialog'))}); From 9889775cc7a7dab4dcf5c393a69f81d8caa4dd4e Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 4 Jul 2018 13:24:09 +0800 Subject: [PATCH 11/16] * Set assignedTo as closed when close todo. --- db/update10.0.sql | 1 + module/todo/model.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/db/update10.0.sql b/db/update10.0.sql index 3fe85f06c1..b5b242c41c 100644 --- a/db/update10.0.sql +++ b/db/update10.0.sql @@ -1 +1,2 @@ ALTER TABLE `zt_storyspec` CHANGE `title` `title` varchar(255) NOT NULL; +update `zt_todo` set assignedTo = 'closed', assignedDate = closedDate where status = 'closed'; diff --git a/module/todo/model.php b/module/todo/model.php index 4d56610740..6b755dd69d 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -530,10 +530,13 @@ class todoModel extends model */ public function close($todoID) { + $now = helper::now(); $this->dao->update(TABLE_TODO) ->set('status')->eq('closed') ->set('closedBy')->eq($this->app->user->account) - ->set('closedDate')->eq(helper::now()) + ->set('closedDate')->eq($now) + ->set('assignedTo')->eq('closed') + ->set('assignedDate')->eq($now) ->where('id')->eq((int)$todoID) ->exec(); $this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed'); From ce9cf8a0c7d787256967fb55d98475a7d4d27b8d Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 4 Jul 2018 13:28:04 +0800 Subject: [PATCH 12/16] * Add 10.0 upgrade sql. --- module/upgrade/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 30cd05a221..1ba716287f 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -337,6 +337,7 @@ class upgradeModel extends model case '9_8_3': $confirmContent .= file_get_contents($this->getUpgradeFile('9.8.3')); case '10_0_alpha': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.alpha')); case '10_0_beta': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.beta')); + case '10_0': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } From a703d045e05c881d92a9644da475bc5202ee719d Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 4 Jul 2018 13:28:23 +0800 Subject: [PATCH 13/16] * finish task #4587. --- module/task/model.php | 5 +++++ module/task/view/assignto.html.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/module/task/model.php b/module/task/model.php index bea8fd7a40..104e736e9e 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -822,6 +822,11 @@ class taskModel extends model ->setDefault('assignedDate', $now) ->remove('comment,showModule') ->get(); + if($oldTask->status != 'done' and $oldTask->status != 'closed' and $task->left == 0) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->task->left); + return false; + } if(!empty($oldTask->team)) { diff --git a/module/task/view/assignto.html.php b/module/task/view/assignto.html.php index dca7f7b55c..befb86256e 100644 --- a/module/task/view/assignto.html.php +++ b/module/task/view/assignto.html.php @@ -39,10 +39,12 @@
        + status != 'done' and $task->status != 'closed'):?> + From 58bf0c3e5643f32b4ced3844cfca34c4751fba94 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 4 Jul 2018 13:58:43 +0800 Subject: [PATCH 14/16] * fix bug. --- module/task/model.php | 5 +++++ module/task/view/assignto.html.php | 2 ++ module/todo/model.php | 5 ++++- module/upgrade/model.php | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/module/task/model.php b/module/task/model.php index bea8fd7a40..104e736e9e 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -822,6 +822,11 @@ class taskModel extends model ->setDefault('assignedDate', $now) ->remove('comment,showModule') ->get(); + if($oldTask->status != 'done' and $oldTask->status != 'closed' and $task->left == 0) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->task->left); + return false; + } if(!empty($oldTask->team)) { diff --git a/module/task/view/assignto.html.php b/module/task/view/assignto.html.php index dca7f7b55c..befb86256e 100644 --- a/module/task/view/assignto.html.php +++ b/module/task/view/assignto.html.php @@ -39,10 +39,12 @@ + status != 'done' and $task->status != 'closed'):?> + diff --git a/module/todo/model.php b/module/todo/model.php index 4d56610740..6b755dd69d 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -530,10 +530,13 @@ class todoModel extends model */ public function close($todoID) { + $now = helper::now(); $this->dao->update(TABLE_TODO) ->set('status')->eq('closed') ->set('closedBy')->eq($this->app->user->account) - ->set('closedDate')->eq(helper::now()) + ->set('closedDate')->eq($now) + ->set('assignedTo')->eq('closed') + ->set('assignedDate')->eq($now) ->where('id')->eq((int)$todoID) ->exec(); $this->loadModel('action')->create('todo', $todoID, 'closed', '', 'closed'); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 30cd05a221..1ba716287f 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -337,6 +337,7 @@ class upgradeModel extends model case '9_8_3': $confirmContent .= file_get_contents($this->getUpgradeFile('9.8.3')); case '10_0_alpha': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.alpha')); case '10_0_beta': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0.beta')); + case '10_0': $confirmContent .= file_get_contents($this->getUpgradeFile('10.0')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } From f7bd51a86177d83334e141812df529db4544e4b9 Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 4 Jul 2018 14:05:59 +0800 Subject: [PATCH 15/16] * Finish task #4549, 4550 --- config/filter.php | 8 ++- module/doc/control.php | 8 ++- module/doc/css/common.css | 3 - module/doc/js/browse.js | 6 -- module/doc/js/common.js | 6 ++ module/doc/lang/en.php | 1 + module/doc/lang/zh-cn.php | 1 + module/doc/view/alllibs.html.php | 18 +++++- module/doc/view/alllibsbylist.html.php | 68 +++++++++++++++++++++ module/doc/view/objectlibs.html.php | 8 +++ module/doc/view/objectlibsbylist.html.php | 74 +++++++++++++++++++++++ 11 files changed, 184 insertions(+), 17 deletions(-) create mode 100644 module/doc/view/alllibsbylist.html.php create mode 100644 module/doc/view/objectlibsbylist.html.php diff --git a/config/filter.php b/config/filter.php index 6b684691fd..7f2e5468db 100644 --- a/config/filter.php +++ b/config/filter.php @@ -97,9 +97,11 @@ $filter->bug->default->cookie['preProductID'] = 'int'; $filter->bug->create->cookie['preBranch'] = 'int'; $filter->bug->export->cookie['checkedItem'] = 'reg::checked'; -$filter->doc->browse->cookie['browseType'] = 'reg::browseType'; -$filter->doc->default->cookie['from'] = 'code'; -$filter->doc->default->cookie['product'] = 'int'; +$filter->doc->browse->cookie['browseType'] = 'reg::browseType'; +$filter->doc->alllibs->cookie['browseType'] = 'reg::browseType'; +$filter->doc->objectlibs->cookie['browseType'] = 'reg::browseType'; +$filter->doc->default->cookie['from'] = 'code'; +$filter->doc->default->cookie['product'] = 'int'; $filter->doc->showfiles->cookie['docFilesViewType'] = 'code'; $filter->file->download->cookie[$config->sessionVar] = 'code'; diff --git a/module/doc/control.php b/module/doc/control.php index f2e36ff588..1121c71599 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -619,7 +619,11 @@ class doc extends control $libs = $this->doc->getAllLibsByType($type, $pager, $product); $subLibs = array(); - if($type == 'product' or $type == 'project') $subLibs = $this->doc->getSubLibGroups($type, array_keys($libs)); + if($type == 'product' or $type == 'project') + { + $subLibs = $this->doc->getSubLibGroups($type, array_keys($libs)); + if($this->cookie->browseType == 'bylist') $this->view->users = $this->loadModel('user')->getPairs('noletter'); + } if($type == 'custom') $this->view->itemCounts = $this->doc->statLibCounts(array_keys($libs)); $this->view->type = $type; @@ -739,7 +743,7 @@ class doc extends control public function objectLibs($type, $objectID, $from = 'doc') { $this->from = $from; - setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot); + setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot); $table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT; $object = $this->dao->select('id,name')->from($table)->where('id')->eq($objectID)->fetch(); diff --git a/module/doc/css/common.css b/module/doc/css/common.css index 23926c7d45..b0dcd89fc1 100644 --- a/module/doc/css/common.css +++ b/module/doc/css/common.css @@ -26,9 +26,6 @@ .col-md-size .table .c-datetime {display: none;} .table-files .btn {padding:0 6px;} -.table-files .c-actions .btn > .icon {opacity: 0;} -.table-files .c-actions .btn > .icon.text-yellow, -.table-files tr:hover .c-actions .btn > .icon {opacity: 1;} #docsTree li > a > .icon {opacity: .65;} diff --git a/module/doc/js/browse.js b/module/doc/js/browse.js index be2e21c800..240dfcabf5 100644 --- a/module/doc/js/browse.js +++ b/module/doc/js/browse.js @@ -17,12 +17,6 @@ function browseBySearch() $('#queryBox').addClass('show'); } -function setBrowseType(type) -{ - $.cookie('browseType', type, {expires:config.cookieLife, path:config.webRoot}); - location.href = location.href; -} - $(function(){ $('#' + browseType + 'Tab').addClass('active'); if(browseType == "bysearch") diff --git a/module/doc/js/common.js b/module/doc/js/common.js index b737d4b5e9..e2e3e42572 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -16,6 +16,12 @@ function toggleAcl(acl) } } +function setBrowseType(type) +{ + $.cookie('browseType', type, {expires:config.cookieLife, path:config.webRoot}); + location.href = location.href; +} + $(document).ready(function() { $('.libs-group.sort').sortable( diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 34ef61f29c..d1ad62aa86 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -44,6 +44,7 @@ $lang->doc->acl = 'Right'; $lang->doc->groups = 'Groups'; $lang->doc->users = 'Users'; $lang->doc->item = ' Item'; +$lang->doc->num = 'Docs'; $lang->doc->searchResult = 'Search Result'; $lang->doc->moduleDoc = 'By Module'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 278af6fb23..4f2fd54078 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -44,6 +44,7 @@ $lang->doc->acl = '权限'; $lang->doc->groups = '分组'; $lang->doc->users = '用户'; $lang->doc->item = '项'; +$lang->doc->num = '文档数量'; $lang->doc->searchResult = '搜索结果'; $lang->doc->moduleDoc = '按模块浏览'; diff --git a/module/doc/view/alllibs.html.php b/module/doc/view/alllibs.html.php index a8c1074660..def2ed82a0 100644 --- a/module/doc/view/alllibs.html.php +++ b/module/doc/view/alllibs.html.php @@ -11,11 +11,14 @@ */ ?> -app->user->feedback) && !$this->cookie->feedbackView && $this->from == 'doc') ? true : false;?> +app->user->feedback) && !$this->cookie->feedbackView) ? true : false;?>
        + cookie->browseType == 'bylist'):?> + +
        @@ -25,6 +28,12 @@ projectCommon;?>
        +
        @@ -36,7 +45,7 @@
        -
        name;?>
        +
        collector, $this->app->user->account) !== false ? " " : '') . $lib->name;?>
        id] . $lang->doc->item;?>
        @@ -45,7 +54,9 @@
        - id&objectType=lib", "", 'hiddenwin', "title='{$lang->doc->collect}' class='btn btn-link'")?> + 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&objectType=doclib");?>" title="" class='btn btn-link ajaxCollect'> id", "", '', "title='{$lang->edit}' class='btn btn-link iframe'")?> id", "", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?> id&type=doc", "", '', "title='{$lang->tree->manage}' class='btn btn-link'")?> @@ -58,5 +69,6 @@
        +
        diff --git a/module/doc/view/alllibsbylist.html.php b/module/doc/view/alllibsbylist.html.php new file mode 100644 index 0000000000..fcd5c50f25 --- /dev/null +++ b/module/doc/view/alllibsbylist.html.php @@ -0,0 +1,68 @@ +
        +
        +
        +
        + + doc->custom;?> + productCommon;?> + projectCommon;?> + +
        + +
        +
        +
        caseResult == 'fail'):?> - +
        @@ -113,7 +113,7 @@ caseResult == 'fail'):?>
        testcase->createBug);?>testcase->createBug, "onclick='createBug(this)'", "btn btn-primary createBtn");?>
        id) . html::hidden('cases[]', $case->id)?> testcase->priList, $case->pri);?>createLink('testcase', 'view', "caseID=$case->id", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?>createLink('testcase', 'view', "caseID=$case->id&version=$case->version&from=testtask&taskID=$case->task", '', true), $case->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");?> testcase->typeList, $case->type);?> assignedTo);?> lastRunner);?>team) ? $lang->task->assign : $lang->task->transferTo;?> team) ? $task->assignedTo : $task->nextUser, "class='form-control chosen'");?>
        task->left;?>
        left, "class='form-control' autocomplete='off'");?> task->hour;?>
        comment;?> team) ? $lang->task->assign : $lang->task->transferTo;?> team) ? $task->assignedTo : $task->nextUser, "class='form-control chosen'");?>
        task->left;?>
        left, "class='form-control' autocomplete='off'");?> task->hour;?>
        comment;?>
        + + + + product->name;?> + project->name;?> + doc->libName;?> + + + + + + + + + + + + + createLink('doc', 'objectLibs', "type=$type&objectID=$lib->id") : $this->createLink('doc', 'browse', "libID=$lib->id");?> + + + + + + + + + + + + +
        doc->num;?>doc->addedBy;?>doc->addedDate;?>actions;?>
        name);?> + + id] . $lang->doc->item;?> + + id]) . $lang->doc->item;?> + + createdBy) echo zget($users, $lib->createdBy);?>createdDate != '00-00-00 00:00:00') echo formatTime($lib->createdDate, 'm-d h:i');?> + 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&objectType=doclib");?>" title="" class='btn btn-link ajaxCollect'> + id", "", '', "title='{$lang->edit}' class='btn btn-link iframe'")?> + id", "", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?> + id&type=doc", "", '', "title='{$lang->tree->manage}' class='btn btn-link'")?> +
        + + + + diff --git a/module/doc/view/objectlibs.html.php b/module/doc/view/objectlibs.html.php index 8e3c4ceea9..36155a33b8 100644 --- a/module/doc/view/objectlibs.html.php +++ b/module/doc/view/objectlibs.html.php @@ -15,6 +15,9 @@ from == 'doc'):?> + cookie->browseType == 'bylist'):?> + +
        @@ -22,6 +25,10 @@ name;?>
        +
        diff --git a/module/doc/view/objectlibsbylist.html.php b/module/doc/view/objectlibsbylist.html.php new file mode 100644 index 0000000000..1e7768410d --- /dev/null +++ b/module/doc/view/objectlibsbylist.html.php @@ -0,0 +1,74 @@ +
        +
        +
        +
        + name;?> +
        + +
        +
        + + + + + + + + + + $lib):?> + + doc->custom->objectLibs, 'files') === false && $libID == 'files') continue;?> + doc->custom->objectLibs, 'customFiles') === false && isset($lib->main) && !$lib->main) continue;?> + + + id");?> + id");?> + + + + + + + +
        doc->libName;?>doc->num;?>actions;?>
        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;?> + " title="" class='btn btn-link ajaxCollect'> + ", '', "title='{$lang->edit}' class='btn btn-link iframe'")?> + main)) common::printLink('doc', 'deleteLib', "libID=$libID", "", 'hiddenwin', "title='{$lang->delete}' class='btn btn-link'")?> + ", '', "title='{$lang->doc->manageType}' class='btn btn-link'")?> + +
        +
        +
        +
        From babcaa6d7f26e2797d31df81970702825d636f30 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 4 Jul 2018 14:13:14 +0800 Subject: [PATCH 16/16] * finish task #4516. --- module/project/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index 6894c34c91..ce5ca4157f 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -2301,7 +2301,7 @@ class project extends control public function importPlanStories($projectID, $planID) { $planStories = $planProducts = array(); - $planStory = $this->loadModel('story')->getPlanStories($planID); + $planStory = $this->loadModel('story')->getPlanStories($planID, 'changed,active,reviewing'); if(!empty($planStory)) { $planStories = array_keys($planStory);