From 9c0b8b1d22660973205a1a1a97fb59db6f5ff8aa Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Thu, 12 Nov 2020 21:38:08 +0800 Subject: [PATCH 01/14] * Finish task#8198. Fix bug. --- module/todo/model.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/module/todo/model.php b/module/todo/model.php index 230199ba65..37afdb24a5 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -537,7 +537,7 @@ class todoModel extends model $begin = $todo->config->begin; $end = $todo->config->end; $beforeDays = (int)$todo->config->beforeDays; - if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$begin -{$beforeDays} days")); + if(!empty($beforeDays) && $beforeDays > 0) $begin = date('Y-m-d', strtotime("$today -{$beforeDays} days")); if($today < $begin or (!empty($end) && $today > $end)) continue; $newTodo = new stdclass(); @@ -570,8 +570,27 @@ class todoModel extends model $day = (int)$todo->config->day; if($day <= 0) continue; - if(empty($lastCycle)) $date = date('Y-m-d', strtotime("{$today} +" . $day . " days")); - if(!empty($lastCycle->date)) $date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days")); + if(empty($lastCycle)) + { + $todayTime = new DateTime($today); + $beginTime = new DateTime($todo->config->begin); + $interval = $todayTime->diff($beginTime)->days; + + if($interval != $day) continue; + + $date = $today; + } + + if(!empty($lastCycle->date)) + { + $todayTime = new DateTime($today); + $lastCycleTime = new DateTime($lastCycle->date); + $interval = $todayTime->diff($lastCycleTime)->days; + + if($interval != $day) continue; + + $date = date('Y-m-d', strtotime("{$lastCycle->date} +{$day} days")); + } } if(isset($todo->config->appointDate)) { From 8a20821f92ff6c01a2e1332d9187b2f5a77f64cc Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Thu, 12 Nov 2020 17:10:47 +0800 Subject: [PATCH 02/14] * Adjust code style. --- module/story/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 6f9f5534f8..239025abb5 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1432,7 +1432,7 @@ class storyModel extends model if($message) die(js::error($message) . js::locate(helper::createLink('project', 'story', "projectID=$projectID"), 'parent')); /* Create tasks. */ - $stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($data->storyIdList)->fetchAll(); + $stories = $this->getByList($data->storyIdList); foreach($stories as $story) { $task = new stdclass(); @@ -1445,6 +1445,7 @@ class storyModel extends model $task->estimate = isset($data->hourPointValue) ? ($story->estimate * $data->hourPointValue) : $story->estimate; $task->openedBy = $this->app->user->account; $task->openedDate = helper::now(); + $task->desc = $story->spec; $this->dao->insert(TABLE_TASK)->data($task) ->autoCheck() From 583790a08e9eaf3f6a5f8e40c7e710e56fc73115 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Fri, 13 Nov 2020 09:08:04 +0800 Subject: [PATCH 03/14] * Finish task #8194. --- module/doc/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 67417d0e2e..4c0978103c 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -74,7 +74,7 @@ var browseType = '';

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

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

'+lang.timeout+'

'+s+'

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

      '+lang.timeout+'

      '+s+'

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