From e8b2344122c4ba928db758550e6e90c7237f2ad1 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 21 Oct 2021 13:06:02 +0800 Subject: [PATCH 001/443] * Adjust cases of testcase. --- test/api/testcases/getlist.php | 13 ++++++++----- test/data/project.yaml | 2 -- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/api/testcases/getlist.php b/test/api/testcases/getlist.php index 4ba8977926..798d71d6dc 100644 --- a/test/api/testcases/getlist.php +++ b/test/api/testcases/getlist.php @@ -18,14 +18,17 @@ pid=1 global $token; $header = array('Token' => $token->token); -$existProductCases = $rest->get('/products/2/testcases?page=1&limit=100&order=id_asc', $header); -$noProductCases = $rest->get('/products/1000/testcases?page=1&limit=10&order=id_asc', $header); +$existProductCases = $rest->get('/products/2/testcases?page=1&limit=100&order=id_asc', $header); +$notExistProductCases = $rest->get('/products/1000/testcases?page=1&limit=10&order=id_asc', $header); +$noProductCases = $rest->get('/products/0/testcases', $header); -r($existProductCases->status_code) && p() && e('200'); // 使用正确产品id查询用例列表的状态码 -r($noProductCases->status_code) && p() && e('200'); // 使用不存在的产品id查询用例列表的状态码 +r($existProductCases->status_code) && p() && e('200'); // 使用正确产品id查询用例列表的状态码 +r($notExistProductCases->status_code) && p() && e('200'); // 使用不存在的产品id查询用例列表的状态码 + +r($noProductCases) && c(400) && p('error') && e('"Need product or project or execution id.'); // 使用产品id为0查询用例列表的状态码 $existCases = $existProductCases->body->testcases; -$emptyCases = $noProductCases->body->testcases; +$emptyCases = $notExistProductCases->body->testcases; r(count($existCases)) && p() && e('50'); // 使用正确产品id获取用例列表的数量 r(count($emptyCases)) && p() && e('0'); // 使用不存在的产品id获取用例列表的数量 diff --git a/test/data/project.yaml b/test/data/project.yaml index 2925f265e3..cbe6402a19 100644 --- a/test/data/project.yaml +++ b/test/data/project.yaml @@ -10,8 +10,6 @@ fields: range: - field: type range: project - - field: product - range: single - field: lifetime range: - field: budget From 759ab4c815769a00c3fab83f155001c0e0e100ed Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Thu, 21 Oct 2021 15:18:28 +0800 Subject: [PATCH 002/443] * Rewrite p function. --- test/lib/init.php | 75 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 18 deletions(-) diff --git a/test/lib/init.php b/test/lib/init.php index 1c882b7541..c8adae6d3a 100644 --- a/test/lib/init.php +++ b/test/lib/init.php @@ -84,34 +84,73 @@ function r($result) * @access public * @return void */ -function p($key = '', $delimiter = ',') +function p($keys = '', $delimiter = ',') { global $_result; - echo ">> "; - $result = ""; - if(!is_array($_result) and !is_object($_result)) + /* Print $_result. */ + if(!$keys or !is_array($_result) and !is_object($_result)) return print(">> " . (string) $_result . "\n"); + + $object = ''; + $index = -1; + $pos = strpos($keys, ':'); + if($pos) { - $result = (string) $_result; + $arrKey = substr($keys, 0, $pos); + $keys = substr($keys, $pos + 1); + + $pos = strpos($arrKey, '['); + if($pos) + { + $object = substr($arrKey, 0, $pos); + $index = trim(substr($arrKey, $pos + 1), ']'); + } + else + { + $index = $arrKey; + } } - else - { - $keyList = explode(',', $key); - $dimension = 1; - foreach($_result as $value) - { - if(is_array($value) or is_object($value)) $dimension = 2; - } + $keys = explode($delimiter, $keys); - if($dimension == 1) $_result = array($_result); - foreach($_result as $object) + $value = $_result; + if($object) + { + if(is_array($value)) { - foreach($keyList as $key) $result .= zget($object, $key, '') . $delimiter; + $value = $value[$object]; + } + else if(is_object($value)) + { + $value = $value->$object; + } + else + { + return print(">> Error: No object name '$object'.\n"); } - $result = trim($result, $delimiter); } - echo $result . "\n"; + if($index != -1) + { + if(is_array($value)) + { + if(!isset($value[$index])) return print(">> Error: Cannot get index $index.\n"); + $value = $value[$index]; + } + else if(is_object($value)) + { + if(!isset($value->$index)) return print(">> Error: Cannot get index $index.\n"); + $value = $value->$index; + } + else + { + return print(">> Error: Not array, cannot get index $index.\n"); + } + } + + $values = array(); + foreach($keys as $key) $values[] = zget($value, $key, ''); + + echo ">> " . implode($delimiter, $values) . "\n"; return true; } From e74f44e85229b5739efdc0d23c524bee64b6c092 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 21 Oct 2021 16:04:08 +0800 Subject: [PATCH 003/443] * Add test case of bug module. --- test/api/bugs/browse.php | 34 ++++++++++ test/api/bugs/create.php | 66 +++++++++++++++++++ test/api/bugs/deleted.php | 29 +++++++++ test/api/bugs/view.php | 23 +++++++ test/data/bug.yaml | 122 ++++++++++++++++++++++++++++++++++++ test/data/zentao/config.php | 1 + 6 files changed, 275 insertions(+) create mode 100644 test/api/bugs/browse.php create mode 100644 test/api/bugs/create.php create mode 100644 test/api/bugs/deleted.php create mode 100644 test/api/bugs/view.php create mode 100644 test/data/bug.yaml diff --git a/test/api/bugs/browse.php b/test/api/bugs/browse.php new file mode 100644 index 0000000000..8628196c45 --- /dev/null +++ b/test/api/bugs/browse.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +> 200 +通过错误的productID获取bug列表的状态码 >> 200 +通过正确的productID获取bug列表的数量 >> 10 +通过错误的productID获取bug列表的数量 >> 0 + +*/ + +global $token; +$header = array('token' => $token->token); + +$existProductBugs = $rest->get('/products/1/bugs?limit=10&id_desc', $header); +$notExistProductBugs = $rest->get('/products/10/bugs?limit=10&id_desc', $header); + +r($existProductBugs->status_code) && p() && e('200'); // 通过正确的productID获取bug列表的状态码 +r($notExistProductBugs->status_code) && p() && e('200'); //通过错误的productID获取bug列表的状态码 + + +$existbugs = $existProductBugs->body->bugs; +$emptybugs = $notExistProductBugs->body->bugs; +r(count($existbugs)) && p() && e('10'); // 通过正确的productID获取bug列表的数量 +r(count($emptybugs)) && p() && e('0'); // 通过错误的productID获取bug列表的数量 + +$firstBug = $existProductBugs->body->bugs[0]; +r($firstBug) && p('title') && ('bug80'); // 获取第一个bug的标题 \ No newline at end of file diff --git a/test/api/bugs/create.php b/test/api/bugs/create.php new file mode 100644 index 0000000000..57fc256f67 --- /dev/null +++ b/test/api/bugs/create.php @@ -0,0 +1,66 @@ +#!/usr/bin/env php +> Need product id. +bug名称必填项检查 >> 『Bug标题』不能为空。 +bug版本必填项检查 >> 『影响版本』不能为空。 + +*/ + +global $token; +$header = array('token' => $token->token); +$title = '测试bug' . helper::now(); + +$data = array( + 'product' => '1', + 'title' => $title, + 'openedBuild' => '1', + 'project' => '131', + 'module' => '0', + 'execution' => '391', + 'assignedTo' => '', + 'deadline' => '0000-00-00', + 'type' => 'codeerror', + 'os' => '', + 'browser' => '', + 'color' => '', + 'severity' => '1', + 'pri' => '1', + 'steps' => '', + 'story' => '0', + 'task' => '0', + 'mailto' => '', + 'keywords' => '', + 'status' => 'active', + 'case' => '0', + 'caseVersion' => '0', + 'result' => '0', + 'testtask' => '0', +); + +$bug = $rest->post('/bugs', $data, $header); +$bug->body = array($bug->body); + +$noNameData = $data; +unset($noNameData['title']); +$noNameBug = $rest->post('/bugs', $noNameData, $header); + +$noBuildData = $data; +unset($noBuildData['openedBuild']); +$noBuildBug = $rest->post('/bugs', $noBuildData, $header); + +unset($data['product']); +$noProductBug = $rest->post('/bugs', $data, $header); + +r($noProductBug) && c(400) && p('error') && e('Need product id.'); // 产品ID检查 +r($noNameBug) && c(400) && p('error') && e('『Bug标题』不能为空。'); // bug名称必填项检查 +r($noBuildBug) && c(400) && p('error') && e('『影响版本』不能为空。'); // bug版本必填项检查 + +r($bug) && c(201) && p('title') && e($title); // 创建一个bug \ No newline at end of file diff --git a/test/api/bugs/deleted.php b/test/api/bugs/deleted.php new file mode 100644 index 0000000000..f814dc3248 --- /dev/null +++ b/test/api/bugs/deleted.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +> {"message":"success"} +使用错误的bugID删除bug >> {"message":"success"} +查询bug是否被成功删除 >> 10,1 + +*/ + +global $token; +$header = array('token' => $token->token); + +$deleteExistBug = $rest->delete('/bugs/10' , $header); +$deleteNotExistBug = $rest->delete('/bugs/201', $header); + +r($deleteExistBug) && c(200) && p() && e('{"message":"success"}'); // 使用正确的bugID删除bug +r($deleteNotExistBug) && c(200) && p() && e('{"message":"success"}'); // 使用错误的bugID删除bug + +$existBug = $rest->get('/bugs/10', $header); +$existBug->body = array($existBug->body); + +r($existBug) && c(200) && p('id,deleted') && e('10,1'); // 查询bug是否被成功删除 \ No newline at end of file diff --git a/test/api/bugs/view.php b/test/api/bugs/view.php new file mode 100644 index 0000000000..273528ed27 --- /dev/null +++ b/test/api/bugs/view.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +> BUG1 +使用错误的bugID获取bug信息 >> 404 Not found + +*/ + +global $token; +$existBug = $rest->get('/bugs/1', array('token' => $token->token)); +$existBug->body = array($existBug->body); + +$notExistBug = $rest->get('/bugs/200', array('token' => $token->token)); + +r($existBug) && c(200) && p('title') && e('BUG1'); // 使用正确的bugID获取bug信息 +r($notExistBug) && c(404) && p('error') && e('404 Not found'); // 使用错误的bugID获取bug信息 \ No newline at end of file diff --git a/test/data/bug.yaml b/test/data/bug.yaml new file mode 100644 index 0000000000..b469c4b4b7 --- /dev/null +++ b/test/data/bug.yaml @@ -0,0 +1,122 @@ +title: zt_bug +desc: Bug表 +version: 1.0 +fields: + - field: id + range: 1-10000 + - field: project + range: 131{2},0{97} + - field: product + range: 1{20} + - field: branch + range: 0 + - field: module + range: 0 + - field: execution + range: 391,0,391,0{97} + - field: plan + range: 0 + - field: story + range: 0 + - field: storyVersion + range: 0 + - field: task + range: 0 + - field: toTask + range: 0 + - field: toStory + range: 0 + - field: title + fields: + - field: title1 + range: BUG{6},`缺陷!@()[]{}|\+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();`,bug + - field: title2 + range: 1-10000 + - field: keywords + range: + - field: severity + range: 1-4:R + - field: pri + range: 1-4:R + - field: type + range: [codeerror,config,install,security,performance,standard,automation,designdefect,others] + - field: os + range: []{2},[all,ie,ie11,ie10,ie9,ie8,ie7,ie6,chrome,firefox,firefox4,firefox3,firefox2,opera,oprea11,oprea10,opera9,safari,maxthon,uc,other] + - field: browser + range: + - field: hardware + range: + - field: found + range: + - field: steps + range: ["

【步骤】


【结果】


【期望】


","【步骤】进入成果展示
【结果】乱码
【期望】正常显示
"] + - field: status + range: active{50},resolved{30},closed{20} + - field: subStatus + range: + - field: color + range: [#3da7f5,#75c941,#2dbdb2,#797ec9,#ffaf38,#ff4e3e] + - field: confirmed + range: [0,1]:R + - field: activatedCount + range: 0 + - field: mailto + range: + - field: openedBy + range: admin + - field: openedDate + range: "(-1M)-(+1w):60" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: openedBuild + range: 1,0,1,trunk{97} + - field: assignedTo + range: [admin,dev1,test1]{30},[]{20},[admin,dev1,test1]{20},[]{10},closed{20} + - field: assignedDate + range: $openedDate + - field: deadline + range: "(+2w):60" + type: timestamp + format: "YYYY-MM-DD" + - field: resolvedBy + range: []{50},$assignedTo{30},admin{20} + - field: resolution + range: []{50},bydesign{5},duplicate{5},external{5},fixed{5},notrepro{2},postponed{3},willnotfix{5},fixed{10},bydesign,external,notrepro,postponed,willnotfix,duplicate{5} + - field: resolvedBuild + range: []{55},trunk{15},[]{25},trunk{5} + - field: resolvedDate + range: + - field: closedBy + range: []{80},admin{20} + - field: closedDate + range: + - field: duplicateBug + range: 0{55},1-5,0{40},10-15 + - field: linkBug + range: + - field: case + range: 0 + - field: caseVersion + range: 0 + - field: result + range: 0 + - field: repo + range: 0 + - field: entry + range: + - field: lines + range: + - field: v1 + range: + - field: v2 + range: + - field: repoType + range: + - field: testtask + range: 0 + - field: lastEditedBy + range: + - field: lastEditedDate + range: + - field: deleted + range: 0{40},1{10},0{50} diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 41723fbf8e..af1441d34a 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -28,3 +28,4 @@ $builder->blockRandom = array('rows' => 120, 'data' => array('block', 'blockr $builder->projectProduct = array('rows' => 21, 'data' => array('projectproduct')); $builder->case = array('rows' => 10000, 'data' => array('case')); +$builder->bug = array('rows' => 100, 'data' => array('bug')); From 760d533ccdd6df4a9b41ec1247cff555ee7de325 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 21 Oct 2021 16:55:55 +0800 Subject: [PATCH 004/443] * Fix bug #15693. --- framework/base/helper.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index ec1acf2e2c..c559e38e8c 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -504,7 +504,12 @@ class baseHelper */ static public function diffDate($date1, $date2) { - return round((strtotime($date1) - strtotime($date2)) / 86400, 0); + /* Get the timestamp in the current operating system. */ + $date1 = new DateTime($date1); + $date2 = new DateTime($date2); + $date1 = date_format($date1, "U"); + $date2 = date_format($date2, "U"); + return round(($date1 - $date2) / 86400, 0); } /** From e8010e951aee59df93e20f714bde89ffce23fad9 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 22 Oct 2021 09:22:54 +0800 Subject: [PATCH 005/443] * Add table of kanban. --- db/update15.7.sql | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 db/update15.7.sql diff --git a/db/update15.7.sql b/db/update15.7.sql new file mode 100644 index 0000000000..e901955fb3 --- /dev/null +++ b/db/update15.7.sql @@ -0,0 +1,26 @@ +-- DROP TABLE IF EXISTS `zt_kanbanlane`; +CREATE TABLE IF NOT EXISTS `zt_kanbanlane` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `execution` mediumint(8) NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `color` char(30) NOT NULL, + `order` smallint(6) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- DROP TABLE IF EXISTS `zt_kanbancolumn`; +CREATE TABLE IF NOT EXISTS `zt_kanbancolumn` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `lane` mediumint(8) NOT NULL DEFAULT '0', + `parent` mediumint(8) NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `color` char(30) NOT NULL, + `limit` smallint(6) NOT NULL DEFAULT '-1', + `order` mediumint(8) NOT NULL DEFAULT '0', + `cards` text NULL, + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; From 534254a5a3ed448d718856327ea18a7bcf5b07ab Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 22 Oct 2021 01:25:55 +0000 Subject: [PATCH 006/443] * Fix bug#15682 --- module/bug/view/view.html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index a1dc5438a9..b6d6c8bdbd 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -300,7 +300,11 @@ if($bug->openedBuild) { $openedBuilds = explode(',', $bug->openedBuild); - foreach($openedBuilds as $openedBuild) isset($builds[$openedBuild]) ? print($builds[$openedBuild] . '
') : print($openedBuild . '
'); + foreach($openedBuilds as $openedBuild) + { + if(!$openedBuild) continue; + isset($builds[$openedBuild]) ? print($builds[$openedBuild] . '
') : print($openedBuild . '
'); + } } else { From d76b563cc5408b3348408f2a8d53c9297d9a0a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Mon, 25 Oct 2021 13:34:41 +0800 Subject: [PATCH 007/443] * Add project managed products lang. --- module/project/lang/de.php | 3 +++ module/project/lang/en.php | 3 +++ module/project/lang/fr.php | 3 +++ module/project/lang/vi.php | 3 +++ module/project/lang/zh-cn.php | 3 +++ 5 files changed, 15 insertions(+) diff --git a/module/project/lang/de.php b/module/project/lang/de.php index 55a95073d0..3ea1073bff 100644 --- a/module/project/lang/de.php +++ b/module/project/lang/de.php @@ -229,3 +229,6 @@ $lang->project->endGreaterParent = "The end date of the parent project: %s. It $lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set."; $lang->project->endLetterChild = "The maximum finish date for the project set: %s. The completion date of a project cannot be greater than the maximum completion date of the project set."; $lang->project->childLongTime = "There are long-term projects in the child project, and the parent project should also be a long-term project."; + +$lang->project->action = new stdclass(); +$lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; diff --git a/module/project/lang/en.php b/module/project/lang/en.php index dc574d6ebf..049dd9f874 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -288,3 +288,6 @@ $lang->project->beginGreateChild = "The minimum start date of the project set $lang->project->endLetterChild = "The maximum finish date for the project set: %s. The completion date of a project cannot be greater than the maximum completion date of the project set."; $lang->project->childLongTime = "There are long-term projects in the child project, and the parent project should also be a long-term project."; $lang->project->confirmUnlinkMember = "Do you want to remove this user from project?"; + +$lang->project->action = new stdclass(); +$lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; diff --git a/module/project/lang/fr.php b/module/project/lang/fr.php index ad8cc6e623..abe25e1d72 100644 --- a/module/project/lang/fr.php +++ b/module/project/lang/fr.php @@ -229,3 +229,6 @@ $lang->project->endGreaterParent = "The end date of the parent project: %s. It $lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set."; $lang->project->endLetterChild = "The maximum finish date for the project set: %s. The completion date of a project cannot be greater than the maximum completion date of the project set."; $lang->project->childLongTime = "There are long-term projects in the child project, and the parent project should also be a long-term project."; + +$lang->project->action = new stdclass(); +$lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; diff --git a/module/project/lang/vi.php b/module/project/lang/vi.php index 78cf1f7963..023856e72f 100644 --- a/module/project/lang/vi.php +++ b/module/project/lang/vi.php @@ -229,3 +229,6 @@ $lang->project->endGreaterParent = "The end date of the parent project: %s. It $lang->project->beginGreateChild = "The minimum start date of the project set: %s. The start date of the project cannot be less than the minimum start date of the project set."; $lang->project->endLetterChild = "The maximum finish date for the project set: %s. The completion date of a project cannot be greater than the maximum completion date of the project set."; $lang->project->childLongTime = "There are long-term projects in the child project, and the parent project should also be a long-term project."; + +$lang->project->action = new stdclass(); +$lang->project->action->managed = '$date, managed by $actor. $extra' . "\n"; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 56cba084d1..5456081c7e 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -288,3 +288,6 @@ $lang->project->beginGreateChild = "项目集的最小开始日期:%s,项 $lang->project->endLetterChild = "项目集的最大完成日期:%s,项目的完成日期不能大于项目集的最大完成日期"; $lang->project->childLongTime = "子项目中有长期项目,父项目也应该是长期项目"; $lang->project->confirmUnlinkMember = "您确定从该项目中移除该用户吗?"; + +$lang->project->action = new stdclass(); +$lang->project->action->managed = '$date, 由 $actor 维护。$extra' . "\n"; From 3d22a50a001fd71e03b36a3e255650f37ae5a8a0 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 25 Oct 2021 14:13:44 +0800 Subject: [PATCH 008/443] * Create the single execution Kanban lane and Kanban column. --- config/zentaopms.php | 2 + db/zentao.sql | 25 ++++ module/bug/model.php | 4 +- module/common/lang/common.php | 1 + module/execution/control.php | 17 +-- module/execution/model.php | 6 +- module/kanban/lang/zh-cn.php | 35 ++++++ module/kanban/model.php | 223 ++++++++++++++++++++++++++++++++++ module/upgrade/model.php | 23 ++++ 9 files changed, 325 insertions(+), 11 deletions(-) create mode 100644 module/kanban/lang/zh-cn.php create mode 100644 module/kanban/model.php diff --git a/config/zentaopms.php b/config/zentaopms.php index 8508db61cd..5acf07c756 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -228,6 +228,8 @@ define('TABLE_RELATION', '`' . $config->db->prefix . 'relation`'); define('TABLE_REPOHISTORY', '`' . $config->db->prefix . 'repohistory`'); define('TABLE_REPOFILES', '`' . $config->db->prefix . 'repofiles`'); define('TABLE_REPOBRANCH', '`' . $config->db->prefix . 'repobranch`'); +define('TABLE_KANBANLANE', '`' . $config->db->prefix . 'kanbanlane`'); +define('TABLE_KANBANCOLUMN', '`' . $config->db->prefix . 'kanbancolumn`'); if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`'); if(!defined('TABLE_PROJECTSPEC')) define('TABLE_PROJECTSPEC', '`' . $config->db->prefix . 'projectspec`'); diff --git a/db/zentao.sql b/db/zentao.sql index 72235445df..925ff437a2 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -595,6 +595,31 @@ CREATE TABLE IF NOT EXISTS `zt_job` ( `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_kanbanlane`; +CREATE TABLE IF NOT EXISTS `zt_kanbanlane` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `execution` mediumint(8) NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `color` char(30) NOT NULL, + `order` smallint(6) NOT NULL DEFAULT '0', + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +-- DROP TABLE IF EXISTS `zt_kanbancolumn`; +CREATE TABLE IF NOT EXISTS `zt_kanbancolumn` ( + `id` int(8) NOT NULL AUTO_INCREMENT, + `lane` mediumint(8) NOT NULL DEFAULT '0', + `parent` mediumint(8) NOT NULL DEFAULT '0', + `type` char(30) NOT NULL, + `name` varchar(255) NOT NULL DEFAULT '', + `color` char(30) NOT NULL, + `limit` smallint(6) NOT NULL DEFAULT '-1', + `order` mediumint(8) NOT NULL DEFAULT '0', + `cards` text NULL, + `deleted` enum('0','1') NOT NULL default '0', + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_lang`; CREATE TABLE IF NOT EXISTS `zt_lang` ( `id` mediumint(8) unsigned NOT NULL auto_increment, diff --git a/module/bug/model.php b/module/bug/model.php index 24718b5a6b..8cfa5e97a6 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1575,7 +1575,9 @@ class bugModel extends model ->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi() ->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi() ->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi() - ->orderBy($orderBy)->page($pager)->fetchAll(); + ->orderBy($orderBy) + ->page($pager) + ->fetchAll('id'); } $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug'); diff --git a/module/common/lang/common.php b/module/common/lang/common.php index 57a3c16b1c..137b14fb8e 100644 --- a/module/common/lang/common.php +++ b/module/common/lang/common.php @@ -75,6 +75,7 @@ $lang->file = new stdclass(); $lang->misc = new stdclass(); $lang->acl = new stdclass(); $lang->curd = new stdclass(); +$lang->kanban = new stdclass(); $lang->projectbuild = new stdclass(); $lang->projectrelease = new stdclass(); diff --git a/module/execution/control.php b/module/execution/control.php index 3b71572c4a..f819837e60 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1825,26 +1825,27 @@ class execution extends control * Kanban. * * @param int $executionID - * @param string $type - * @param string $orderBy + * @param string $objectType + * @param string $groupBy * @access public * @return void */ - public function kanban($executionID, $type = 'story', $orderBy = 'order_asc') + public function kanban($executionID, $objectType = 'all', $groupBy = 'id_desc') { /* Save to session. */ $uri = $this->app->getURI(true); - $this->app->session->set('taskList', $uri, 'execution'); - $this->app->session->set('bugList', $uri, 'qa'); + $this->app->session->set('taskList', $uri, 'execution'); + $this->app->session->set('bugList', $uri, 'qa'); /* Compatibility IE8*/ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); + $lanes = $this->loadModel('kanban')->getLanesByExecution($executionID, $objectType); $this->execution->setMenu($executionID); $execution = $this->loadModel('execution')->getById($executionID); - $tasks = $this->execution->getKanbanTasks($executionID, "id"); - $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); - $stories = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, $orderBy); + $tasks = $this->execution->getKanbanTasks($executionID, "id"); + $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); + $stories = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, $orderBy); /* Determines whether an object is editable. */ $canBeChanged = common::canModify('execution', $execution); diff --git a/module/execution/model.php b/module/execution/model.php index a1ebf3927e..fa7539ccf2 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -379,6 +379,8 @@ class executionModel extends model $creatorExists = false; $teamMembers = array(); + $this->loadModel('kanban')->addKanbanLanes($executionID); + /* Save order. */ $this->dao->update(TABLE_EXECUTION)->set('`order`')->eq($executionID * 5)->where('id')->eq($executionID)->exec(); $this->file->updateObjectID($this->post->uid, $executionID, 'execution'); @@ -3154,7 +3156,7 @@ class executionModel extends model */ public function getKanbanTasks($executionID, $orderBy = 'status_asc, id_desc', $pager = null) { - $tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') + $tasks = $this->dao->select('t1.*, t1.id as id, t2.id AS storyID, t2.title AS storyTitle, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName') ->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') @@ -3163,7 +3165,7 @@ class executionModel extends model ->andWhere('t1.parent')->ge(0) ->orderBy($orderBy) ->page($pager) - ->fetchAll(); + ->fetchAll('id'); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task'); diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php new file mode 100644 index 0000000000..f61ea60e52 --- /dev/null +++ b/module/kanban/lang/zh-cn.php @@ -0,0 +1,35 @@ +kanban = new stdClass(); + +$lang->kanban->storyColumn = array(); +$lang->kanban->storyColumn['backlog'] = 'Backlog'; +$lang->kanban->storyColumn['ready'] = '准备好'; +$lang->kanban->storyColumn['develop'] = '开发'; +$lang->kanban->storyColumn['developing'] = '进行中'; +$lang->kanban->storyColumn['developed'] = '完成'; +$lang->kanban->storyColumn['test'] = '测试'; +$lang->kanban->storyColumn['testing'] = '进行中'; +$lang->kanban->storyColumn['tested'] = '完成'; +$lang->kanban->storyColumn['verified'] = '已验收'; +$lang->kanban->storyColumn['released'] = '已发布'; +$lang->kanban->storyColumn['closed'] = '已关闭'; + +$lang->kanban->bugColumn = array(); +$lang->kanban->bugColumn['unconfirmed'] = '待确认'; +$lang->kanban->bugColumn['confirmed'] = '已确认'; +$lang->kanban->bugColumn['resolving'] = '解决中'; +$lang->kanban->bugColumn['fixing'] = '进行中'; +$lang->kanban->bugColumn['fixed'] = '完成'; +$lang->kanban->bugColumn['test'] = '测试'; +$lang->kanban->bugColumn['testing'] = '进行中'; +$lang->kanban->bugColumn['tested'] = '完成'; +$lang->kanban->bugColumn['closed'] = '已关闭'; + +$lang->kanban->taskColumn = array(); +$lang->kanban->taskColumn['wait'] = '未开始'; +$lang->kanban->taskColumn['develop'] = '开发'; +$lang->kanban->taskColumn['developing'] = '研发中'; +$lang->kanban->taskColumn['developed'] = '研发完毕'; +$lang->kanban->taskColumn['pause'] = '已暂停'; +$lang->kanban->taskColumn['canceled'] = '已取消'; +$lang->kanban->taskColumn['closed'] = '已关闭'; diff --git a/module/kanban/model.php b/module/kanban/model.php new file mode 100644 index 0000000000..d709f69563 --- /dev/null +++ b/module/kanban/model.php @@ -0,0 +1,223 @@ + + * @package kanban + * @version $Id: model.php 5118 2021-10-22 10:18:41Z $ + * @link https://www.zentao.net + */ +?> +dao->select('*')->from(TABLE_KANBANLANE) + ->where('execution')->eq($executionID) + ->andWhere('deleted')->eq(0) + ->beginIF($objectType != 'all')->andWhere('type')->eq($objectType) + ->fetchAll('id'); + } + + /** + * Add execution Kanban lanes. + * + * @param int|array $executionIdList + * @access public + * @return void + */ + public function addKanbanLanes($executionIdList) + { + if(is_numeric($executionIdList)) $executionIdList = (array)$executionIdList; + if(!is_array($executionIdList) or empty($executionIdList)) return; + + /* Set lane Information. */ + global $lang; + $storyLane = clone $bugLane = clone $taskLane = new stdClass(); + $storyLane->type = 'story'; + $storyLane->name = $lang->SRCommon; + $storyLane->color = '#7ec5ff'; + $storyLane->order = '5'; + + $bugLane->type = 'bug'; + $bugLane->name = $lang->bug->common; + $bugLane->color = '#ba55d3'; + $bugLane->order = '10'; + + $taskLane->type = 'task'; + $taskLane->name = $lang->task->common; + $taskLane->color = '#4169e1'; + $taskLane->order = '15'; + + /* Get stories, bugs and tasks. */ + $stories = $this->dao->select('t1.*,t2.project as project')->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_PROJECTSTORY)->alias('t2')->on('t1.id=t2.story') + ->where('t1.deleted')->eq(0) + ->andWhere('t1.parent')->ne('-1') + ->andWhere('t2.project')->in($executionIdList) + ->fetchGroup('project', 'id'); + + $bugs = $this->dao->select('*')->from(TABLE_BUG) + ->where('deleted')->eq(0) + ->andWhere('execution')->in($executionIdList) + ->fetchGroup('execution', 'id'); + + $tasks = $this->dao->select('*')->from(TABLE_TASK) + ->where('deleted')->eq(0) + ->andWhere('parent')->ne('-1') + ->andWhere('execution')->in($executionIdList) + ->fetchGroup('execution', 'id'); + + foreach($executionIdList as $executionID) + { + $storyLaneID = 0; + $bugLaneID = 0; + $taskLaneID = 0; + $developColumn = 0; + $testColumn = 0; + $resolvingColumn = 0; + + $lanes[$executionID] = new stdClass(); + $storyLane->execution = $bugLane->execution = $taskLane->execution = $executionID; + + $this->dao->insert(TABLE_KANBANLANE)->data($storyLane)->exec(); + $storyLaneID = $this->dao->lastInsertId(); + + $this->dao->insert(TABLE_KANBANLANE)->data($bugLane)->exec(); + $bugLaneID = $this->dao->lastInsertId(); + + $this->dao->insert(TABLE_KANBANLANE)->data($taskLane)->exec(); + $taskLaneID = $this->dao->lastInsertId(); + + $executionStories = empty($stories[$executionID]) ? array() : $stories[$executionID]; + foreach($this->lang->kanban->storyColumn as $type => $name) + { + $data = new stdClass(); + $data->lane = $storyLaneID; + $data->name = $name; + $data->type = $type; + $data->cards = ''; + if(strpos(',developing,developed,', $type) !== false) $data->parent = $developColumn; + if(strpos(',testing,tested,', $type) !== false) $data->parent = $testColumn; + if(strpos(',ready,develop,test,', $type) === false) + { + foreach($executionStories as $storyID => $story) + { + if($type == 'backlog' and $story->status == 'active' and $story->stage == 'projected') + { + $data->cards .= $storyID . ','; + unset($executionStories[$storyID]); + } + + if($type == 'closed' and $story->status == 'closed' and $story->stage == 'closed') + { + $data->cards .= $storyID . ','; + unset($executionStories[$storyID]); + } + + if($story->stage == $type and strpos(',backlog,closed,', $type) === false and $story->status == 'active') + { + $data->cards .= $storyID . ','; + unset($executionStories[$storyID]); + } + } + if(!empty($data->cards)) $data->cards = ',' . $data->cards; + } + $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); + if($type == 'develop') $developColumn = $this->dao->lastInsertId(); + if($type == 'test') $testColumn = $this->dao->lastInsertId(); + } + + $executionBugs = empty($bugs[$executionID]) ? array() : $bugs[$executionID]; + foreach($this->lang->kanban->bugColumn as $type => $name) + { + $data = new stdClass(); + $data->lane = $bugLaneID; + $data->name = $name; + $data->type = $type; + $data->cards = ''; + if(strpos(',fixing,fixed,', $type) !== false) $data->parent = $resolvingColumn; + if(strpos(',testing,tested,', $type) !== false) $data->parent = $testColumn; + if(strpos(',resolving,fixing,test,testing,tested,', $type) === false) + { + foreach($executionBugs as $bugID => $bug) + { + if($type == 'unconfirmed' and $bug->status == 'active' and $bug->confirmed == 0) + { + $data->cards .= $bugID . ','; + unset($executionBugs[$bugID]); + } + + if($type == 'confirmed' and $bug->status == 'active' and $bug->confirmed == 1) + { + $data->cards .= $bugID . ','; + unset($executionBugs[$bugID]); + } + + if($type == 'fixed' and $bug->status == 'resolved') + { + $data->cards .= $bugID . ','; + unset($executionBugs[$bugID]); + } + + if($type == 'closed' and $bug->status == 'closed') + { + $data->cards .= $bugID . ','; + unset($executionBugs[$bugID]); + } + } + $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); + if($type == 'resolving') $resolvingColumn = $this->dao->lastInsertId(); + if($type == 'test') $testColumn = $this->dao->lastInsertId(); + } + } + + $executionTasks = empty($tasks[$executionID]) ? array() : $tasks[$executionID]; + foreach($this->lang->kanban->taskColumn as $type => $name) + { + $data = new stdClass(); + $data->lane = $taskLaneID; + $data->name = $name; + $data->type = $type; + $data->cards = ''; + if(strpos(',developing,developed,', $type) !== false) $data->parent = $developColumn; + if(strpos(',develop,', $type) === false) + { + foreach($executionTasks as $taskID => $task) + { + if($type == 'developing' and $task->status == 'doing') + { + $data->cards .= $taskID . ','; + unset($executionTasks[$taskID]); + } + + if($type == 'developed' and $task->status == 'done') + { + $data->cards .= $taskID . ','; + unset($executionTasks[$taskID]); + } + + if(strpos(',wait,pause,canceled,closed,', $type) !== false and $task->status == $type) + { + $data->cards .= $taskID . ','; + unset($executionTasks[$taskID]); + } + } + $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); + if($type == 'develop') $developColumn = $this->dao->lastInsertId(); + } + } + } + } +} diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 48da796885..bb4db3301a 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -725,6 +725,11 @@ class upgradeModel extends model $this->saveLogs('Execute 15_6'); $this->execSQL($this->getUpgradeFile('15.6')); $this->appendExec('15_6'); + case '15_7': + $this->saveLogs('Execute 15_7'); + $this->execSQL($this->getUpgradeFile('15.7')); + $this->addKanbanLanes(); + $this->appendExec('15_7'); } $this->deletePatch(); @@ -5321,4 +5326,22 @@ class upgradeModel extends model $this->dao->update(TABLE_CONFIG)->set('`value`')->eq(trim($data->value, ','))->where('id')->eq($data->id)->exec(); return true; } + + /** + * Add single execution Kanban lanes. + * + * @access public + * @return bool + */ + public function addKanbanLanes() + { + $executionIdList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('type')->in('sprint,stage')->fetchPairs(); + + if(empty($executionIdList)) return true; + + /* Create lanes. */ + $lanes = $this->loadModel('kanban')->addKanbanLanes($executionIdList); + + return true; + } } From 6765c0bdae2def2a967aab1602be99d78df93737 Mon Sep 17 00:00:00 2001 From: dingna Date: Mon, 25 Oct 2021 14:48:21 +0800 Subject: [PATCH 009/443] * Add testcase of product. --- test/api/products/create.php | 33 +++++++++++++++++++++++++++++++ test/api/products/delete.php | 20 +++++++++++++++++++ test/api/products/getbyid.php | 20 +++++++++++++++++++ test/api/products/getlist.php | 37 +++++++++++++++++++++++++++++++++++ test/api/products/update.php | 16 +++++++++++++++ 5 files changed, 126 insertions(+) create mode 100644 test/api/products/create.php create mode 100644 test/api/products/delete.php create mode 100644 test/api/products/getbyid.php create mode 100644 test/api/products/getlist.php create mode 100644 test/api/products/update.php diff --git a/test/api/products/create.php b/test/api/products/create.php new file mode 100644 index 0000000000..bcae1dfa39 --- /dev/null +++ b/test/api/products/create.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php + $token->token); + +$pass = $rest->post('/products', array('name' => 'CESHI1', 'program' => '1', 'code' => 'CESHI1'), $header); +r($pass) && c(200) && p('name,code') && e('CESHI1,CESHI1'); //测试创建所属项目集为1的产品 + +$noProgram = $rest->post('/products', array('name' => 'CESHI2', 'code' => 'CESHI2'), $header); +r($noProgram) && c(200) && p('program') && e('0'); //测试创建独立产品 + +$emptyName = $rest->post('/products', array(), $header); +r($emptyName) && c(400) && p('error') && e('『产品名称』不能为空。'); //测试产品名称为空的情况 + +$emptyCode = $rest->post('/products', array('name' => 'CESHI3'), $header); +r($emptyCode) && c(400) && p('error') && e('『产品代号』不能为空。'); //测试产品代号为空的情况 + +$existedName = $rest->post('/products', array('name' => 'CESHI1', 'code' => 'CESHI4'), $header); +r($existedName->status_code) && p() && e('400'); //测试状态码 +r($existedName->body->error) && p('name:0') && e('『产品名称』已经有『CESHI1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); //测试产品名称已存在 + +$existedCode = $rest->post('/products', array('name' => 'CESHI4','code' => 'CESHI1'), $header); +r($existedCode->status_code) && p() && e('400'); //测试状态码 +r($existedCode->body->error) && p('code:0') && e('『产品代号』已经有『CESHI1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); //测试产品代号已存在 diff --git a/test/api/products/delete.php b/test/api/products/delete.php new file mode 100644 index 0000000000..9a803a85ab --- /dev/null +++ b/test/api/products/delete.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php + $token->token); + +$pass = $rest->delete('/products/190', $header); +r($pass->status_code) && p('') && e('200'); //调用成功,返回200 + +$findProduct = $rest->get('/products/190', $header); +r($findProduct->status_code) && p() && e('200'); //调用查找接口,成功返回200 +r($findProduct->body) && p('deleted') && e('1'); //已删除的产品的deleted字段为1 diff --git a/test/api/products/getbyid.php b/test/api/products/getbyid.php new file mode 100644 index 0000000000..3ad072d6fa --- /dev/null +++ b/test/api/products/getbyid.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php + $token->token); + +$pass = $rest->get('/products/1', $header); +r($pass->status_code) && p() && e('200'); //调用成功,返回200 +r($pass->body) && p('code') && e('code1'); //期望code为code1 + +$fail = $rest->get('/products/1000', $header); +r($fail->status_code) && p() && e('404'); //ID为1000的产品不存在,返回401 diff --git a/test/api/products/getlist.php b/test/api/products/getlist.php new file mode 100644 index 0000000000..5ddf85268d --- /dev/null +++ b/test/api/products/getlist.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php + $token->token); + +$allProducts = $rest->get('/products', $header); +$productList = $allProducts->body->products; +r($allProducts->status_code) && p() && e('200'); //调用成功,返回200 +r(count($productList)) && p() && e('191'); //测试所有产品的数量 +r($productList) && p('0:id,code') && e('1,code1'); //查看所有产品中第一个产品的ID和code + +$closedProducts = $rest->get('/products?status=closed', $header); +$productList = $closedProducts->body->products; +r($closedProducts->status_code) && p() && e('200'); //调用成功,返回200 +r(count($productList)) && p() && e('90'); //测试已关闭的产品的数量 +r($productList) && p('0:id,code') && e('21,code21'); //查看已关闭的第一个产品的ID和code + +$normalProducts = $rest->get('/products?status=normal', $header); +$productList = $normalProducts->body->products; +r($normalProducts->status_code) && p() && e('200'); //调用成功,返回200 +r(count($productList)) && p() && e('101'); //测试正常状态的产品的数量 +r($productList) && p('0:id,code') && e('1,code1'); //查看正常状态的第一个产品的ID和code + +$statusError = $rest->get('/products?status=doing', $header); +r($statusError->status_code) && p() && e('200'); //调用成功,返回200 +r(count($statusError->body->products)) && p() && e('0'); //测试使用错误的状态参数查询时结果为空 + + diff --git a/test/api/products/update.php b/test/api/products/update.php new file mode 100644 index 0000000000..262c24cb40 --- /dev/null +++ b/test/api/products/update.php @@ -0,0 +1,16 @@ +#!/usr/bin/env php + $token->token); + +$pass = $rest->put('/products/1', array('name' => '测试正常产品1'), $header); +r($pass->status_code) && p() && e('200'); //调用成功,返回200 From a72b84e25762b8e065b6826dfa54326589364829 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 25 Oct 2021 15:03:27 +0800 Subject: [PATCH 010/443] * Get Kanban data. --- module/execution/control.php | 29 +++++++++++++++++++++++------ module/kanban/model.php | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index f819837e60..dea9973497 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1825,27 +1825,44 @@ class execution extends control * Kanban. * * @param int $executionID - * @param string $objectType - * @param string $groupBy + * @param string $orderBy + * @param string $type * @access public * @return void */ - public function kanban($executionID, $objectType = 'all', $groupBy = 'id_desc') + public function kanban($executionID, $orderBy = 'all', $type = 'id_desc') { /* Save to session. */ $uri = $this->app->getURI(true); $this->app->session->set('taskList', $uri, 'execution'); $this->app->session->set('bugList', $uri, 'qa'); - /* Compatibility IE8*/ + /* Compatibility IE8. */ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); - $lanes = $this->loadModel('kanban')->getLanesByExecution($executionID, $objectType); + $kanbanLanes = $this->loadModel('kanban')->getLanesByExecution($executionID); + $kanbanColumns = $this->kanban->getColumnsByLane(array_keys($kanbanLanes)); + $kanban = array(); + + foreach($kanbanLanes as $laneID => $lane) + { + $kanban[$lane->type] = $lane; + $kanban[$lane->type]->columns = array(); + foreach($kanbanColumns as $columnID => $column) + { + if($column->lane == $laneID) + { + $kanban[$lane->type]->columns[$columnID] = $column; + unset($kanbanColumns[$columnID]); + } + } + } + $this->execution->setMenu($executionID); $execution = $this->loadModel('execution')->getById($executionID); $tasks = $this->execution->getKanbanTasks($executionID, "id"); $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); - $stories = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, $orderBy); + $stories = $this->loadModel('story')->getExecutionStories($executionID); /* Determines whether an object is editable. */ $canBeChanged = common::canModify('execution', $execution); diff --git a/module/kanban/model.php b/module/kanban/model.php index d709f69563..9825ac6c45 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -30,6 +30,25 @@ class kanbanModel extends model ->fetchAll('id'); } + /** + * Get Kanban columns by lane ID. + * + * @param int|array $lanes + * @param string $type + * @access public + * @return void + */ + public function getColumnsByLane($lanes, $type = 'all') + { + if(empty($lanes)) return array(); + return $this->dao->select('t2.id as id, t2.*')->from(TABLE_KANBANLANE)->alias('t1') + ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.id=t2.lane') + ->where('t2.deleted')->eq(0) + ->andWhere('t2.lane')->in($lanes) + ->beginIF($type !== 'all')->andWhere('t1.type')->eq($type)->fi() + ->fetchAll('id'); + } + /** * Add execution Kanban lanes. * From 5ad02fe55846cb3621b81b7491e950b3b23bccde Mon Sep 17 00:00:00 2001 From: dingna Date: Mon, 25 Oct 2021 15:25:28 +0800 Subject: [PATCH 011/443] * Fix the bug that no navigation after clicking the subtask on the Work page. --- module/my/view/task.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 6bcafdb5f2..e8a267bace 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -158,7 +158,7 @@ pri;?>' title='task->priList, $child->pri);?>'>task->priList, $child->pri);?> parent > 0) echo '' . $this->lang->task->childrenAB . ' ';?> - createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color' data-group='project'");?> + createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color'");?> systemMode == 'new'):?> createLink('project', 'view', "projectID=$child->project"), $child->projectName);?> From 546edae92a2049438b7978779a1b0befe3639dd0 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 25 Oct 2021 16:11:36 +0800 Subject: [PATCH 012/443] * Adjust code of kanban. --- config/zentaopms.php | 14 +++++++------- module/execution/control.php | 10 +++++----- module/kanban/model.php | 9 ++++++--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/config/zentaopms.php b/config/zentaopms.php index 5acf07c756..8ce5a9a7cb 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -223,13 +223,13 @@ define('TABLE_JOB', '`' . $config->db->prefix . 'job`'); define('TABLE_COMPILE', '`' . $config->db->prefix . 'compile`'); define('TABLE_MR', '`' . $config->db->prefix . 'mr`'); -define('TABLE_REPO', '`' . $config->db->prefix . 'repo`'); -define('TABLE_RELATION', '`' . $config->db->prefix . 'relation`'); -define('TABLE_REPOHISTORY', '`' . $config->db->prefix . 'repohistory`'); -define('TABLE_REPOFILES', '`' . $config->db->prefix . 'repofiles`'); -define('TABLE_REPOBRANCH', '`' . $config->db->prefix . 'repobranch`'); -define('TABLE_KANBANLANE', '`' . $config->db->prefix . 'kanbanlane`'); -define('TABLE_KANBANCOLUMN', '`' . $config->db->prefix . 'kanbancolumn`'); +define('TABLE_REPO', '`' . $config->db->prefix . 'repo`'); +define('TABLE_RELATION', '`' . $config->db->prefix . 'relation`'); +define('TABLE_REPOHISTORY', '`' . $config->db->prefix . 'repohistory`'); +define('TABLE_REPOFILES', '`' . $config->db->prefix . 'repofiles`'); +define('TABLE_REPOBRANCH', '`' . $config->db->prefix . 'repobranch`'); +define('TABLE_KANBANLANE', '`' . $config->db->prefix . 'kanbanlane`'); +define('TABLE_KANBANCOLUMN', '`' . $config->db->prefix . 'kanbancolumn`'); if(!defined('TABLE_LANG')) define('TABLE_LANG', '`' . $config->db->prefix . 'lang`'); if(!defined('TABLE_PROJECTSPEC')) define('TABLE_PROJECTSPEC', '`' . $config->db->prefix . 'projectspec`'); diff --git a/module/execution/control.php b/module/execution/control.php index dea9973497..25b9c9c672 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1825,12 +1825,12 @@ class execution extends control * Kanban. * * @param int $executionID - * @param string $orderBy * @param string $type + * @param string $orderBy * @access public * @return void */ - public function kanban($executionID, $orderBy = 'all', $type = 'id_desc') + public function kanban($executionID, $type = 'story', $orderBy = 'order_asc') { /* Save to session. */ $uri = $this->app->getURI(true); @@ -1840,14 +1840,14 @@ class execution extends control /* Compatibility IE8. */ if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); - $kanbanLanes = $this->loadModel('kanban')->getLanesByExecution($executionID); - $kanbanColumns = $this->kanban->getColumnsByLane(array_keys($kanbanLanes)); - $kanban = array(); + $kanbanLanes = $this->loadModel('kanban')->getLanesByExecution($executionID); + $kanban = array(); foreach($kanbanLanes as $laneID => $lane) { $kanban[$lane->type] = $lane; $kanban[$lane->type]->columns = array(); + $kanbanColumns = $this->kanban->getColumnsByLane(array_keys($kanbanLanes), $executionID, $lane->type); foreach($kanbanColumns as $columnID => $column) { if($column->lane == $laneID) diff --git a/module/kanban/model.php b/module/kanban/model.php index 9825ac6c45..cb4bc8a645 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -36,16 +36,16 @@ class kanbanModel extends model * @param int|array $lanes * @param string $type * @access public - * @return void + * @return array */ - public function getColumnsByLane($lanes, $type = 'all') + public function getColumnsByLane($lanes, $type) { if(empty($lanes)) return array(); return $this->dao->select('t2.id as id, t2.*')->from(TABLE_KANBANLANE)->alias('t1') ->leftJoin(TABLE_KANBANCOLUMN)->alias('t2')->on('t1.id=t2.lane') ->where('t2.deleted')->eq(0) ->andWhere('t2.lane')->in($lanes) - ->beginIF($type !== 'all')->andWhere('t1.type')->eq($type)->fi() + ->andWhere('t1.type')->eq($type)->fi() ->fetchAll('id'); } @@ -85,17 +85,20 @@ class kanbanModel extends model ->where('t1.deleted')->eq(0) ->andWhere('t1.parent')->ne('-1') ->andWhere('t2.project')->in($executionIdList) + ->orderBy('id_asc') ->fetchGroup('project', 'id'); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('deleted')->eq(0) ->andWhere('execution')->in($executionIdList) + ->orderBy('id_asc') ->fetchGroup('execution', 'id'); $tasks = $this->dao->select('*')->from(TABLE_TASK) ->where('deleted')->eq(0) ->andWhere('parent')->ne('-1') ->andWhere('execution')->in($executionIdList) + ->orderBy('id_asc') ->fetchGroup('execution', 'id'); foreach($executionIdList as $executionID) From f860008e5602256062c2240e4ba240087ae64773 Mon Sep 17 00:00:00 2001 From: liugang Date: Mon, 25 Oct 2021 16:18:48 +0800 Subject: [PATCH 013/443] * Remove the outdated code. --- lib/base/front/front.class.php | 3 --- lib/front/front.class.php | 2 -- 2 files changed, 5 deletions(-) diff --git a/lib/base/front/front.class.php b/lib/base/front/front.class.php index 4779559811..a8cd5c52d1 100644 --- a/lib/base/front/front.class.php +++ b/lib/base/front/front.class.php @@ -172,7 +172,6 @@ class baseHTML $selectedItems = ",$selectedItems,"; foreach($options as $key => $value) { - $key = str_replace('item', '', $key); $selected = strpos($selectedItems, ",$key,") !== false ? " selected='selected'" : ''; $string .= "\n"; } @@ -209,7 +208,6 @@ class baseHTML $string .= "\n"; foreach($options as $key => $value) { - $key = str_replace('item', '', $key); $selected = strpos($selectedItems, ",$key,") !== false ? " selected='selected'" : ''; $string .= "\n"; } @@ -280,7 +278,6 @@ class baseHTML foreach($options as $key => $value) { - $key = str_replace('item', '', $key); if($isBlock) $string .= "
').appendTo(e),"EMPTY"!==n.id&&(i.append('
'),t.options.readonly||i.append(['
','","
"].join("")));var d=t.options;d.minColumnWidth&&i.css("min-width",d.minColumnWidth),d.maxColHeight&&i.find(".kanban-lane-items").css("max-height",d.maxColHeight),d.laneItemsClass&&i.find(".kanban-lane-items").addClass(d.laneItemsClass),d.laneColClass&&i.addClass(d.laneColClass)}return"EMPTY"===n.id&&i.appendTo(e),i.attr("data-type",n.type),i},t.prototype.renderLaneItem=function(n,e,t){var i=e.children('.kanban-item[data-id="'+n.id+'"]');if(i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,i,t);else{var d=i.find(".title");d.length||(d=a('
').appendTo(i)),d.text(n.name||n.title)}return i},t.prototype.adjustKanbanSize=function(n,t){var i=this,d=i.options.noLaneName?0:i.options.laneNameWidth,o=n.columns.length+(i.options.readonly?0:1),s=i.options.minColumnWidth*o+d;if(t=t||i.$.children('.kanban-board[data-id="'+n.id+'"]'),t.removeClass("kanban-size-inited").css({minWidth:s}),!i.options.useFlex||!e){var r=Math.max(s,i.$.width()),l=Math.floor((r-d)/o);t.find(".kanban-col").css("width",l),i.options.maxColHeight&&"auto"!==i.options.maxColHeight&&(t.children(".kanban-lane").each(function(){var n=a(this),e=n.height();n.children(".kanban-col,.kanban-sub-lanes").css("min-height",e)}),t.find(".kanban-lane:not(.has-sub-lane),.kanban-sub-lane").each(function(){var n=a(this),e=n.height(),t=n.children(".kanban-lane-col").css("height","auto");t.each(function(){e=Math.max(e,a(this).outerHeight()+1)}),t.css("height",e)})),t.addClass("kanban-size-inited")}},t.prototype.adjustSize=function(){for(var a=0;a-1){var o=this.data[t];n=a.extend(o,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,d=i.$,s=d.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(d),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items .kanban-item').length,b=s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count');i.options.countRender?i.options.countRender(b,p,n.columns[l],i):b.text(p||(i.options.showZeroCount?0:""))}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var o=this;t=t||o.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var d=n.columns,s={},r=!1,l=0;l','
','
','','',t.options.showCount?'':"","
","
",'
',"
",""].join("")).appendTo(e)),o.data("col",n),o.attr("data-type",n.type).attr("data-subs-count",n.subs.length);var i=o.children(".kanban-header-col");i.find(".title>.icon").attr("class","icon icon-"+(n.icon||""));var d=i.find(".title>.text").text(n.name);n.color&&d.css("color",n.color),t.options.showCount&&i.find(".title>.count").text(n.count||(t.options.showZeroCount?0:"")),t.options.onRenderHeaderCol&&t.options.onRenderHeaderCol(o,n,e)},t.prototype.renderHeaderCol=function(n,e,t){var o=this;if(n.parentType&&t){var i=e.children('.kanban-header-parent-col[data-id="'+t.id+'"]');i.attr("data-subs-count",t.subs.length),o.options.useFlex&&i.css("flex",t.subs.length+" 1 0%"),e=i.children(".kanban-header-sub-cols")}var d=e.children('.kanban-header-col[data-id="'+n.id+'"]'),s="ADD"===n.id;if(d.length)d.removeClass("kanban-expired"),s&&d.appendTo(e);else{d=a(['
',"<"+(s?"a":"div")+' class="title">','','',o.options.showCount?'':"","","
"].join("")).appendTo(e),s?d.children(".title").addClass("action").attr("data-action","addCol"):(d.children(".title").addClass("action-dbc").attr("data-action","editCol"),o.options.readonly||d.append(['
','',"
"].join("")));var r=o.options.minColWidth;r&&d.css("min-width",r)}d.data("col",n),d.attr("data-type",n.type),d.find(".title>.icon").attr("class","icon icon-"+(n.icon||""));var l=d.find(".title>.text").text(n.name);n.color&&l.css("color",n.color),o.options.showCount&&d.find(".title>.count").text(n.count||(o.options.showZeroCount?0:"")),o.options.onRenderHeaderCol&&o.options.onRenderHeaderCol(d,n,e)},t.prototype.renderLane=function(n,t,o,i){var d=this;o=o||d.$.children('.kanban-board[data-id="'+n.kanban+'"]');var s=o.children('.kanban-lane[data-id="'+n.id+'"]');if(s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("clearfix")),s.data("lane",n),!d.options.noLaneName){var r=s.children('.kanban-lane-name[data-id="'+n.id+'"]');r.length||(r=a('
').appendTo(s)),r.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&r.css("background-color",n.color),d.options.onRenderLaneName&&d.options.onRenderLaneName(r,n,o,t)}s.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),s.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?d.renderSubLanes(n,t,s):d.renderLaneItems(t,n.items,s,n,i),d.options.readonly||d.renderLaneCol({id:"EMPTY",type:"EMPTY"},s),s.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var o=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var d=0;d').appendTo(o),e||d.addClass("clearfix")),d.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,d,n,i),d.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e,t,o){for(var i=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(o.append('
'),t.options.readonly||o.append(['
','","
"].join("")));var i=t.options;i.minColWidth&&o.css("min-width",i.minColWidth),i.maxColHeight&&o.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&o.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&o.addClass(i.laneColClass)}return"EMPTY"===n.id&&o.appendTo(e),o.attr("data-type",n.type),o},t.prototype.renderLaneItem=function(n,e,t,o,i){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t,o,i);else{var s=d.find(".title");s.length||(s=a('
').appendTo(d)),s.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){for(var o=this,i=n.columns,d=o.options.noLaneName?0:o.options.laneNameWidth,s=o.options.readonly?0:1,r=0;r Date: Tue, 26 Oct 2021 11:46:33 +0800 Subject: [PATCH 017/443] * Correct Kanban data. --- module/common/lang/common.php | 1 - module/kanban/config.php | 31 ++++++++++++++++++++++ module/kanban/model.php | 48 +++++++++++++++++++---------------- 3 files changed, 57 insertions(+), 23 deletions(-) diff --git a/module/common/lang/common.php b/module/common/lang/common.php index 137b14fb8e..57a3c16b1c 100644 --- a/module/common/lang/common.php +++ b/module/common/lang/common.php @@ -75,7 +75,6 @@ $lang->file = new stdclass(); $lang->misc = new stdclass(); $lang->acl = new stdclass(); $lang->curd = new stdclass(); -$lang->kanban = new stdclass(); $lang->projectbuild = new stdclass(); $lang->projectrelease = new stdclass(); diff --git a/module/kanban/config.php b/module/kanban/config.php index 7928dd1b39..e5b8241338 100644 --- a/module/kanban/config.php +++ b/module/kanban/config.php @@ -17,3 +17,34 @@ $config->kanban->default->task = new stdclass(); $config->kanban->default->task->name = $lang->task->common; $config->kanban->default->task->color = '#4169e1'; $config->kanban->default->task->order = '15'; + +$config->kanban->column = new stdclass(); +$config->kanban->column->status['story']['backlog'] = 'active'; +$config->kanban->column->status['story']['developing'] = 'active'; +$config->kanban->column->status['story']['developed'] = 'active'; +$config->kanban->column->status['story']['testing'] = 'active'; +$config->kanban->column->status['story']['tested'] = 'active'; +$config->kanban->column->status['story']['verified'] = 'active'; +$config->kanban->column->status['story']['released'] = 'active'; +$config->kanban->column->status['story']['closed'] = 'closed'; + +$config->kanban->column->status['bug']['unconfirmed'] = 'active'; +$config->kanban->column->status['bug']['confirmed'] = 'active'; +$config->kanban->column->status['bug']['fixed'] = 'resolved'; +$config->kanban->column->status['bug']['closed'] = 'closed'; + +$config->kanban->column->status['task']['developing'] = 'doing'; +$config->kanban->column->status['task']['developed'] = 'done'; +$config->kanban->column->status['task']['wait'] = 'wait'; +$config->kanban->column->status['task']['pause'] = 'pause'; +$config->kanban->column->status['task']['canceled'] = 'canceled'; +$config->kanban->column->status['task']['closed'] = 'closed'; + +$config->kanban->column->stage['story']['backlog'] = 'active'; +$config->kanban->column->stage['story']['developing'] = 'developing'; +$config->kanban->column->stage['story']['developed'] = 'developed'; +$config->kanban->column->stage['story']['testing'] = 'testing'; +$config->kanban->column->stage['story']['tested'] = 'tested'; +$config->kanban->column->stage['story']['verified'] = 'verified'; +$config->kanban->column->stage['story']['released'] = 'released'; +$config->kanban->column->stage['story']['closed'] = 'closed'; diff --git a/module/kanban/model.php b/module/kanban/model.php index 5b021797fa..0d5907c673 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -97,17 +97,16 @@ class kanbanModel extends model $data->name = $name; $data->type = $colType; $data->cards = ''; + if(strpos(',developing,developed,', $colType) !== false) $data->parent = $devColumnID; if(strpos(',testing,tested,', $colType) !== false) $data->parent = $testColumnID; if(strpos(',ready,develop,test,', $colType) === false) { + $storyStatus = $this->config->kanban->column->status['story'][$colType]; + $storyStage = $this->config->kanban->column->stage['story'][$colType]; foreach($objects as $storyID => $story) { - if($colType == 'backlog' and $story->status == 'active' and $story->stage == 'projected') $data->cards .= $storyID . ','; - - if($colType == 'closed' and $story->status == 'closed' and $story->stage == 'closed') $data->cards .= $storyID . ','; - - if($story->stage == $colType and strpos(',backlog,closed,', $colType) === false and $story->status == 'active') $data->cards .= $storyID . ','; + if($story->status == $storyStatus and $story->stage == $storyStage) $data->cards .= $storyID . ','; } if(!empty($data->cards)) $data->cards = ',' . $data->cards; } @@ -130,20 +129,27 @@ class kanbanModel extends model if(strpos(',testing,tested,', $colType) !== false) $data->parent = $testColumnID; if(strpos(',resolving,fixing,test,testing,tested,', $colType) === false) { + $bugStatus = $this->config->kanban->column->status['bug'][$colType]; foreach($objects as $bugID => $bug) { - if($colType == 'unconfirmed' and $bug->status == 'active' and $bug->confirmed == 0) $data->cards .= $bugID . ','; - - if($colType == 'confirmed' and $bug->status == 'active' and $bug->confirmed == 1) $data->cards .= $bugID . ','; - - if($colType == 'fixed' and $bug->status == 'resolved') $data->cards .= $bugID . ','; - - if($colType == 'closed' and $bug->status == 'closed') $data->cards .= $bugID . ','; + if($colType == 'unconfirmed' and $bug->status == $bugStatus and $bug->confirmed == 0) + { + $data->cards .= $bugID . ','; + } + elseif($colType == 'confirmed' and $bug->status == $bugStatus and $bug->confirmed == 1) + { + $data->cards .= $bugID . ','; + } + elseif($bug->status == $bugStatus) + { + $data->cards .= $bugID . ','; + } } - $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); - if($colType == 'resolving') $resolvingColumnID = $this->dao->lastInsertId(); - if($colType == 'test') $testColumnID = $this->dao->lastInsertId(); + if(!empty($data->cards)) $data->cards = ',' . $data->cards; } + $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); + if($colType == 'resolving') $resolvingColumnID = $this->dao->lastInsertId(); + if($colType == 'test') $testColumnID = $this->dao->lastInsertId(); } } elseif($type == 'task') @@ -158,18 +164,16 @@ class kanbanModel extends model if(strpos(',developing,developed,', $colType) !== false) $data->parent = $devColumnID; if(strpos(',develop,', $colType) === false) { + $taskStatus = $this->config->kanban->column->status['task'][$colType]; foreach($objects as $taskID => $task) { - if($colType == 'developing' and $task->status == 'doing') $data->cards .= $taskID . ','; + if($task->status == $taskStatus) $data->cards .= $taskID . ','; - if($colType == 'developed' and $task->status == 'done') $data->cards .= $taskID . ','; - - if(strpos(',wait,pause,canceled,closed,', $colType) !== false and $task->status == $colType) $data->cards .= $taskID . ','; } - - $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); - if($colType == 'develop') $devColumnID = $this->dao->lastInsertId(); + if(!empty($data->cards)) $data->cards = ',' . $data->cards; } + $this->dao->insert(TABLE_KANBANCOLUMN)->data($data)->exec(); + if($colType == 'develop') $devColumnID = $this->dao->lastInsertId(); } } } From 83a1e66eabe6422933a2f2e3a2eec2bc377a39aa Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 26 Oct 2021 13:35:02 +0800 Subject: [PATCH 018/443] * Adjust code. --- module/kanban/config.php | 31 ------------------------------- module/kanban/model.php | 8 ++++---- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/module/kanban/config.php b/module/kanban/config.php index e5b8241338..7928dd1b39 100644 --- a/module/kanban/config.php +++ b/module/kanban/config.php @@ -17,34 +17,3 @@ $config->kanban->default->task = new stdclass(); $config->kanban->default->task->name = $lang->task->common; $config->kanban->default->task->color = '#4169e1'; $config->kanban->default->task->order = '15'; - -$config->kanban->column = new stdclass(); -$config->kanban->column->status['story']['backlog'] = 'active'; -$config->kanban->column->status['story']['developing'] = 'active'; -$config->kanban->column->status['story']['developed'] = 'active'; -$config->kanban->column->status['story']['testing'] = 'active'; -$config->kanban->column->status['story']['tested'] = 'active'; -$config->kanban->column->status['story']['verified'] = 'active'; -$config->kanban->column->status['story']['released'] = 'active'; -$config->kanban->column->status['story']['closed'] = 'closed'; - -$config->kanban->column->status['bug']['unconfirmed'] = 'active'; -$config->kanban->column->status['bug']['confirmed'] = 'active'; -$config->kanban->column->status['bug']['fixed'] = 'resolved'; -$config->kanban->column->status['bug']['closed'] = 'closed'; - -$config->kanban->column->status['task']['developing'] = 'doing'; -$config->kanban->column->status['task']['developed'] = 'done'; -$config->kanban->column->status['task']['wait'] = 'wait'; -$config->kanban->column->status['task']['pause'] = 'pause'; -$config->kanban->column->status['task']['canceled'] = 'canceled'; -$config->kanban->column->status['task']['closed'] = 'closed'; - -$config->kanban->column->stage['story']['backlog'] = 'active'; -$config->kanban->column->stage['story']['developing'] = 'developing'; -$config->kanban->column->stage['story']['developed'] = 'developed'; -$config->kanban->column->stage['story']['testing'] = 'testing'; -$config->kanban->column->stage['story']['tested'] = 'tested'; -$config->kanban->column->stage['story']['verified'] = 'verified'; -$config->kanban->column->stage['story']['released'] = 'released'; -$config->kanban->column->stage['story']['closed'] = 'closed'; diff --git a/module/kanban/model.php b/module/kanban/model.php index 0d5907c673..b6955b7b68 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -102,8 +102,8 @@ class kanbanModel extends model if(strpos(',testing,tested,', $colType) !== false) $data->parent = $testColumnID; if(strpos(',ready,develop,test,', $colType) === false) { - $storyStatus = $this->config->kanban->column->status['story'][$colType]; - $storyStage = $this->config->kanban->column->stage['story'][$colType]; + $storyStatus = $this->config->kanban->storyColumnStatusList[$colType]; + $storyStage = $this->config->kanban->storyColumnStageList[$colType]; foreach($objects as $storyID => $story) { if($story->status == $storyStatus and $story->stage == $storyStage) $data->cards .= $storyID . ','; @@ -129,7 +129,7 @@ class kanbanModel extends model if(strpos(',testing,tested,', $colType) !== false) $data->parent = $testColumnID; if(strpos(',resolving,fixing,test,testing,tested,', $colType) === false) { - $bugStatus = $this->config->kanban->column->status['bug'][$colType]; + $bugStatus = $this->config->kanban->bugColumnStatusList[$colType]; foreach($objects as $bugID => $bug) { if($colType == 'unconfirmed' and $bug->status == $bugStatus and $bug->confirmed == 0) @@ -164,7 +164,7 @@ class kanbanModel extends model if(strpos(',developing,developed,', $colType) !== false) $data->parent = $devColumnID; if(strpos(',develop,', $colType) === false) { - $taskStatus = $this->config->kanban->column->status['task'][$colType]; + $taskStatus = $this->config->kanban->taskColumnStatusList[$colType]; foreach($objects as $taskID => $task) { if($task->status == $taskStatus) $data->cards .= $taskID . ','; From 4d09ade9cb0fe6b9a99c47dd9013b6a60d66283f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 26 Oct 2021 14:37:39 +0800 Subject: [PATCH 019/443] * Get card data of kanban column. --- module/execution/control.php | 6 +++++- module/kanban/lang/en.php | 35 +++++++++++++++++++++++++++++++++++ module/kanban/model.php | 12 ++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 module/kanban/lang/en.php diff --git a/module/execution/control.php b/module/execution/control.php index 11c7079776..1d33689ac7 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1841,7 +1841,11 @@ class execution extends control if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); $kanban = $this->loadModel('kanban')->getExecutionKanban($executionID); - if(empty($kanban)) $this->kanban->createLanes($executionID); + if(empty($kanban)) + { + $this->kanban->createLanes($executionID); + $kanban = $this->kanban->getExecutionKanban($executionID); + } $this->execution->setMenu($executionID); $execution = $this->loadModel('execution')->getById($executionID); diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php new file mode 100644 index 0000000000..091db93088 --- /dev/null +++ b/module/kanban/lang/en.php @@ -0,0 +1,35 @@ +kanban = new stdClass(); + +$lang->kanban->storyColumn = array(); +$lang->kanban->storyColumn['backlog'] = 'Backlog'; +$lang->kanban->storyColumn['ready'] = 'Ready'; +$lang->kanban->storyColumn['develop'] = 'Development'; +$lang->kanban->storyColumn['developing'] = 'Doing'; +$lang->kanban->storyColumn['developed'] = 'Done'; +$lang->kanban->storyColumn['test'] = 'Testing'; +$lang->kanban->storyColumn['testing'] = 'Doing'; +$lang->kanban->storyColumn['tested'] = 'Done'; +$lang->kanban->storyColumn['verified'] = 'Verified'; +$lang->kanban->storyColumn['released'] = 'Released'; +$lang->kanban->storyColumn['closed'] = 'Closed'; + +$lang->kanban->bugColumn = array(); +$lang->kanban->bugColumn['unconfirmed'] = 'Unconfirmed'; +$lang->kanban->bugColumn['confirmed'] = 'Confirmed'; +$lang->kanban->bugColumn['resolving'] = 'Resolving'; +$lang->kanban->bugColumn['fixing'] = 'Doing'; +$lang->kanban->bugColumn['fixed'] = 'Done'; +$lang->kanban->bugColumn['test'] = 'Test'; +$lang->kanban->bugColumn['testing'] = 'Doing'; +$lang->kanban->bugColumn['tested'] = 'Done'; +$lang->kanban->bugColumn['closed'] = 'Closed'; + +$lang->kanban->taskColumn = array(); +$lang->kanban->taskColumn['wait'] = 'Wait'; +$lang->kanban->taskColumn['develop'] = 'Develop'; +$lang->kanban->taskColumn['developing'] = 'Developing'; +$lang->kanban->taskColumn['developed'] = 'Developed'; +$lang->kanban->taskColumn['pause'] = 'Pause'; +$lang->kanban->taskColumn['canceled'] = 'Canceled'; +$lang->kanban->taskColumn['closed'] = 'Closed'; diff --git a/module/kanban/model.php b/module/kanban/model.php index b6955b7b68..97844906f5 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -35,10 +35,22 @@ class kanbanModel extends model ->andWhere('lane')->in(array_keys($lanes)) ->fetchGroup('lane', 'id'); + if($objectType == 'story' or $objectType == 'all') $stories = $this->loadModel('story')->getExecutionStories($executionID); + if($objectType == 'bug' or $objectType == 'all') $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); + if($objectType == 'task' or $objectType == 'all') $tasks = $this->loadModel('execution')->getKanbanTasks($executionID, "id"); foreach($columns as $laneID => $cols) { + $laneType = $lanes[$laneID]->type; foreach($cols as $colID => $col) { + $cardIdList = array_filter(explode(',', $col->cards)); + $col->cards = array(); + foreach($cardIdList as $objectID) + { + if($laneType == 'story') $col->cards[$objectID] = zget($stories, $objectID, ''); + if($laneType == 'bug') $col->cards[$objectID] = zget($bugs, $objectID, ''); + if($laneType == 'task') $col->cards[$objectID] = zget($tasks, $objectID, ''); + } if($col->parent > 0) { $cols[$col->parent]->childs[$colID] = $col; From 0dc857f2bb207624b45b8f74de3a57a9a5778344 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 26 Oct 2021 14:38:00 +0800 Subject: [PATCH 020/443] * Code for task #43519. --- module/kanban/config.php | 49 ++++++++++++++++++++++ module/kanban/control.php | 46 ++++++++++++++++++++ module/kanban/js/setwip.js | 28 +++++++++++++ module/kanban/lang/zh-cn.php | 7 ++++ module/kanban/model.php | 47 +++++++++++++++++++++ module/kanban/view/setwip.html.php | 67 ++++++++++++++++++++++++++++++ 6 files changed, 244 insertions(+) create mode 100644 module/kanban/control.php create mode 100644 module/kanban/js/setwip.js create mode 100644 module/kanban/view/setwip.html.php diff --git a/module/kanban/config.php b/module/kanban/config.php index 7928dd1b39..bbb2528cdb 100644 --- a/module/kanban/config.php +++ b/module/kanban/config.php @@ -2,6 +2,9 @@ global $lang; $config->kanban = new stdclass(); +$config->kanban->setwip = new stdclass(); +$config->kanban->setwip->requiredFields = 'limit'; + $config->kanban->default = new stdclass(); $config->kanban->default->story = new stdclass(); $config->kanban->default->story->name = $lang->SRCommon; @@ -17,3 +20,49 @@ $config->kanban->default->task = new stdclass(); $config->kanban->default->task->name = $lang->task->common; $config->kanban->default->task->color = '#4169e1'; $config->kanban->default->task->order = '15'; + +$config->kanban->storyColumnStageList = array(); +$config->kanban->storyColumnStageList['backlog'] = 'projected'; +$config->kanban->storyColumnStageList['ready'] = 'projected'; +$config->kanban->storyColumnStageList['develop'] = 'developing'; +$config->kanban->storyColumnStageList['developing'] = 'developing'; +$config->kanban->storyColumnStageList['developed'] = 'developed'; +$config->kanban->storyColumnStageList['test'] = 'testing'; +$config->kanban->storyColumnStageList['testing'] = 'testing'; +$config->kanban->storyColumnStageList['tested'] = 'tested'; +$config->kanban->storyColumnStageList['verified'] = 'verified'; +$config->kanban->storyColumnStageList['released'] = 'released'; +$config->kanban->storyColumnStageList['closed'] = 'closed'; + +$config->kanban->storyColumnStatusList = array(); +$config->kanban->storyColumnStatusList['backlog'] = 'active'; +$config->kanban->storyColumnStatusList['ready'] = 'active'; +$config->kanban->storyColumnStatusList['develop'] = 'active'; +$config->kanban->storyColumnStatusList['developing'] = 'active'; +$config->kanban->storyColumnStatusList['developed'] = 'active'; +$config->kanban->storyColumnStatusList['test'] = 'active'; +$config->kanban->storyColumnStatusList['testing'] = 'active'; +$config->kanban->storyColumnStatusList['tested'] = 'active'; +$config->kanban->storyColumnStatusList['verified'] = 'active'; +$config->kanban->storyColumnStatusList['released'] = 'active'; +$config->kanban->storyColumnStatusList['closed'] = 'closed'; + +$config->kanban->bugColumnStatusList = array(); +$config->kanban->bugColumnStatusList['unconfirmed'] = 'active'; +$config->kanban->bugColumnStatusList['confirmed'] = 'active'; +$config->kanban->bugColumnStatusList['resolving'] = 'active'; +$config->kanban->bugColumnStatusList['fixing'] = 'active'; +$config->kanban->bugColumnStatusList['fixed'] = 'resolved'; +$config->kanban->bugColumnStatusList['test'] = 'resolved'; +$config->kanban->bugColumnStatusList['testing'] = 'resolved'; +$config->kanban->bugColumnStatusList['tested'] = 'resolved'; +$config->kanban->bugColumnStatusList['closed'] = 'closed'; + +$config->kanban->taskColumnStatusList = array(); +$config->kanban->taskColumnStatusList['wait'] = 'wait'; +$config->kanban->taskColumnStatusList['develop'] = 'wait'; +$config->kanban->taskColumnStatusList['developing'] = 'doing'; +$config->kanban->taskColumnStatusList['developed'] = 'done'; +$config->kanban->taskColumnStatusList['pause'] = 'pause'; +$config->kanban->taskColumnStatusList['canceled'] = 'cancel'; +$config->kanban->taskColumnStatusList['closed'] = 'closed'; diff --git a/module/kanban/control.php b/module/kanban/control.php new file mode 100644 index 0000000000..94c1b179ca --- /dev/null +++ b/module/kanban/control.php @@ -0,0 +1,46 @@ + + * @package kanban + * @version $Id: control.php 4460 2021-10-26 11:03:02Z chencongzhi520@gmail.com $ + * @link https://www.zentao.net + */ +class kanban extends control +{ + /** + * Set WIP. + * + * @param int $columnID + * @param int $executionID + * @access public + * @return void + */ + public function setWIP($columnID, $executionID = 0) + { + if($_POST) + { + $this->kanban->setWIP($columnID); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $this->loadModel('action')->create('wip', $columnID, 'Edited'); + die(js::reload('parent.parent')); + } + + $this->app->loadLang('story'); + + $column = $this->kanban->getColumnById($columnID); + if(!$column) die(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'kanban', "executionID=$executionID"))); + + $status = zget($this->config->kanban->{$column->laneType . 'ColumnStatusList'}, $column->type); + $title = isset($column->parentName) ? $column->parentName . '/' . $column->name : $column->name; + + $this->view->title = $title . $this->lang->colon . $this->lang->kanban->setWIP . '(' . $this->lang->kanban->WIP . ')'; + $this->view->column = $column; + $this->view->status = $status; + $this->display(); + } +} diff --git a/module/kanban/js/setwip.js b/module/kanban/js/setwip.js new file mode 100644 index 0000000000..cf7b4a0563 --- /dev/null +++ b/module/kanban/js/setwip.js @@ -0,0 +1,28 @@ +$(function() +{ + $('#noLimit').click(function() + { + if($(this).attr('checked') == 'checked') + { + $('#WIPCount').attr('disabled', true); + } + else + { + $('#WIPCount').removeAttr('disabled'); + } + }) +}) + +/** + * Set WIP count. + * + * @access public + * @return void + */ +function setWIPLimit() +{ + var count = $('#WIPCount').val(); + if($('#noLimit').attr('checked') == 'checked') count = -1;; + + $('#limit').val(count); +} diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index f61ea60e52..598b428eea 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -1,6 +1,13 @@ kanban = new stdClass(); +$lang->kanban->WIP = 'WIP'; +$lang->kanban->setWIP = '在制品设置'; +$lang->kanban->WIPStatus = '在制品状态'; +$lang->kanban->WIPStage = '在制品阶段'; +$lang->kanban->WIPCount = '在制品数量'; +$lang->kanban->noLimit = '不限制∞'; + $lang->kanban->storyColumn = array(); $lang->kanban->storyColumn['backlog'] = 'Backlog'; $lang->kanban->storyColumn['ready'] = '准备好'; diff --git a/module/kanban/model.php b/module/kanban/model.php index 5b021797fa..d4cf5e496b 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -265,4 +265,51 @@ class kanbanModel extends model } } } + + /** + ** Get column by id. + ** + ** @param int $columnID + ** @access public + ** @return object + **/ + public function getColumnById($columnID) + { + $column = $this->dao->select('t1.*, t2.type as laneType')->from(TABLE_KANBANCOLUMN)->alias('t1') + ->leftjoin(TABLE_KANBANLANE)->alias('t2')->on('t1.lane=t2.id') + ->where('t1.id')->eq($columnID) + ->andWhere('t1.deleted')->eq(0) + ->fetch(); + + if(!empty($column->parent)) $column->parentName = $this->dao->findById($column->parent)->from(TABLE_KANBANCOLUMN)->fetch('name'); + + return $column; + } + + /** + * Set WIP limit. + * + * @param int $columnID + * @access public + * @return bool + */ + public function setWIP($columnID) + { + $column = $this->getColumnById($columnID); + $data = fixer::input('post') + ->remove('WIPCount,noLimit') + ->get(); + + $this->lang->kanbancolumn = new stdclass(); + $this->lang->kanbancolumn->limit = $this->lang->kanban->WIPCount; + + $this->dao->update(TABLE_KANBANCOLUMN)->data($data) + ->autoCheck() + ->check(is_numeric($data->limit), 'limit', 'gt', 0) + ->batchcheck($this->config->kanban->setwip->requiredFields, 'notempty') + ->where('id')->eq($columnID) + ->exec(); + + return dao::isError(); + } } diff --git a/module/kanban/view/setwip.html.php b/module/kanban/view/setwip.html.php new file mode 100644 index 0000000000..2cca3105b1 --- /dev/null +++ b/module/kanban/view/setwip.html.php @@ -0,0 +1,67 @@ + + * @package kanban + * @version $Id: setwip.html.php 935 2021-10-25 10:56:24Z liyuchun@easycorp.ltd $ + * @link https://www.zentao.net + */ +?> + + +
+
+
+

+ " . $title . '';?> +

+
+
+ + + + + + + laneType == 'story'):?> + + + + + + + + + + + + +
kanban->WIPStatus;?> + kanban->{$column->laneType . 'Column'}, $column->type, ''), "class='form-control' disabled");?> +
kanban->WIPStage;?> + kanban->storyColumnStageList, $column->type);?> + story->stageList, $stage), "class='form-control' disabled");?> +
kanban->WIPCount;?> + limit, "class='form-control'");?> +
+ limit == -1 ? 'disabled' : '';?> + limit != -1 ? $column->limit : '', "class='form-control' $attr");?> +
+
+ +
+ limit == -1 ? 'checked' : '';?>/> + +
+
+
+
+ +
+
+
+
+ From 43d52ddb9bee790529887e55830dd4f0c3a5037e Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 26 Oct 2021 14:54:16 +0800 Subject: [PATCH 021/443] * improve style for affixed header in kanban. --- module/common/view/kanban.html.php | 5 ++++- module/execution/css/kanbandemo.css | 3 +++ www/js/zui/kanban/min.js | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php index 35d471b01b..f68785dc0f 100644 --- a/module/common/view/kanban.html.php +++ b/module/common/view/kanban.html.php @@ -429,7 +429,10 @@ $.extend($.fn.kanban.Constructor.DEFAULTS, } $kanban.find('.kanban-header-col[data-type="doingProject"] > .title > .count').text(doingProjectCount || 0); $kanban.find('.kanban-header-col[data-type="doingExecution"] > .title > .count').text(doingExecutionCount || 0); - + }, + onCreate(kanban) + { + kanban.$.on('scroll', updateKanbanAffixState); updateKanbanAffixState(); } }); diff --git a/module/execution/css/kanbandemo.css b/module/execution/css/kanbandemo.css index bbf9863f78..723bae2963 100644 --- a/module/execution/css/kanbandemo.css +++ b/module/execution/css/kanbandemo.css @@ -8,3 +8,6 @@ .kanban-item > .infos > .label-pri {min-width: 16px; line-height: 14px; height: 16px; padding: 0;} .kanban-item > .infos > .label-severity {transform: scale(.75);} .kanban-item > .infos > .avatar {position: absolute; right: 0; top: 0} + +.kanban-affixed .kanban-header-col > .title > .text, +.kanban-affixed .kanban-header-col > .title > .count {color: #fff!important;} diff --git a/www/js/zui/kanban/min.js b/www/js/zui/kanban/min.js index 3913d4626a..ca1bfda77b 100644 --- a/www/js/zui/kanban/min.js +++ b/www/js/zui/kanban/min.js @@ -4,4 +4,4 @@ * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ -!function(a){"use strict";var n="zui.kanban",e="object"==typeof CSS&&CSS.supports("display","flex"),t=function(o,i){var d=this;d.name=n,d.$=a(o).addClass("kanban"),d.options=i=a.extend({},t.DEFAULTS,this.$.data(),i),d.data=i.data||[],d.render(d.data);var s=function(n){if(i.onAction){var e=a(this);i.onAction(e.data("action"),e,n,d)}};if(d.$.on("click",".action",s).on("dblclick",".action-dbc",s),"auto"===i.droppable&&(i.droppable=!i.readonly),i.droppable){var r={selector:".kanban-item",target:'.kanban-lane-col:not([data-type="EMPTY"])',drop:function(a){"function"==typeof i.droppable?i.droppable(a):i.onAction&&i.onAction("dropItem",a.element,a,d)}};"object"==typeof i.droppable&&a.extend(r,i.droppable),d.$.droppable(r)}e&&i.useFlex||a(window).on("resize",function(){d.adjustSize()}),i.useFlex&&e||d.$.addClass("not-use-flex"),console.log("Kanban",this)};t.prototype.render=function(a){var n=this;a&&(n.data=a),n.data&&!Array.isArray(n.data)&&(n.data=[n.data]);var t=n.data||[];n.options.beforeRender&&n.options.beforeRender(n,t),n.$.toggleClass("kanban-readonly",!!n.options.readonly).toggleClass("kanban-no-lane-name",!!n.options.noLaneName),n.$.children(".kanban-board").addClass("kanban-expired");for(var o=0;o-1){var o=this.data[t];n=a.extend(o,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,d=i.$,s=d.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(d),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items .kanban-item').length,b=s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count');i.options.countRender?i.options.countRender(b,p,n.columns[l],i):b.text(p||(i.options.showZeroCount?0:""))}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var o=this;t=t||o.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var d=n.columns,s={},r=!1,l=0;l','
','
','','',t.options.showCount?'':"","
","
",'
',"
",""].join("")).appendTo(e)),o.data("col",n),o.attr("data-type",n.type).attr("data-subs-count",n.subs.length);var i=o.children(".kanban-header-col");i.find(".title>.icon").attr("class","icon icon-"+(n.icon||""));var d=i.find(".title>.text").text(n.name);n.color&&d.css("color",n.color),t.options.showCount&&i.find(".title>.count").text(n.count||(t.options.showZeroCount?0:"")),t.options.onRenderHeaderCol&&t.options.onRenderHeaderCol(o,n,e)},t.prototype.renderHeaderCol=function(n,e,t){var o=this;if(n.parentType&&t){var i=e.children('.kanban-header-parent-col[data-id="'+t.id+'"]');i.attr("data-subs-count",t.subs.length),o.options.useFlex&&i.css("flex",t.subs.length+" 1 0%"),e=i.children(".kanban-header-sub-cols")}var d=e.children('.kanban-header-col[data-id="'+n.id+'"]'),s="ADD"===n.id;if(d.length)d.removeClass("kanban-expired"),s&&d.appendTo(e);else{d=a(['
',"<"+(s?"a":"div")+' class="title">','','',o.options.showCount?'':"","","
"].join("")).appendTo(e),s?d.children(".title").addClass("action").attr("data-action","addCol"):(d.children(".title").addClass("action-dbc").attr("data-action","editCol"),o.options.readonly||d.append(['
','',"
"].join("")));var r=o.options.minColWidth;r&&d.css("min-width",r)}d.data("col",n),d.attr("data-type",n.type),d.find(".title>.icon").attr("class","icon icon-"+(n.icon||""));var l=d.find(".title>.text").text(n.name);n.color&&l.css("color",n.color),o.options.showCount&&d.find(".title>.count").text(n.count||(o.options.showZeroCount?0:"")),o.options.onRenderHeaderCol&&o.options.onRenderHeaderCol(d,n,e)},t.prototype.renderLane=function(n,t,o,i){var d=this;o=o||d.$.children('.kanban-board[data-id="'+n.kanban+'"]');var s=o.children('.kanban-lane[data-id="'+n.id+'"]');if(s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("clearfix")),s.data("lane",n),!d.options.noLaneName){var r=s.children('.kanban-lane-name[data-id="'+n.id+'"]');r.length||(r=a('
').appendTo(s)),r.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&r.css("background-color",n.color),d.options.onRenderLaneName&&d.options.onRenderLaneName(r,n,o,t)}s.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),s.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?d.renderSubLanes(n,t,s):d.renderLaneItems(t,n.items,s,n,i),d.options.readonly||d.renderLaneCol({id:"EMPTY",type:"EMPTY"},s),s.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var o=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var d=0;d').appendTo(o),e||d.addClass("clearfix")),d.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,d,n,i),d.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e,t,o){for(var i=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(o.append('
'),t.options.readonly||o.append(['
','","
"].join("")));var i=t.options;i.minColWidth&&o.css("min-width",i.minColWidth),i.maxColHeight&&o.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&o.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&o.addClass(i.laneColClass)}return"EMPTY"===n.id&&o.appendTo(e),o.attr("data-type",n.type),o},t.prototype.renderLaneItem=function(n,e,t,o,i){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t,o,i);else{var s=d.find(".title");s.length||(s=a('
').appendTo(d)),s.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){for(var o=this,i=n.columns,d=o.options.noLaneName?0:o.options.laneNameWidth,s=o.options.readonly?0:1,r=0;r-1){var o=this.data[t];n=a.extend(o,n),this.data[t]=n}else this.data.push(n)}n.id||(n.id=a.zui.uuid());var i=this,d=i.$,s=d.children('.kanban-board[data-id="'+n.id+'"]');s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(d),e||s.addClass("no-flex")),i.renderKanbanHeader(n,s),s.children(".kanban-lane").addClass("kanban-expired");for(var r=n.lanes||[],l=0;l .kanban-lane-items .kanban-item').length,b=s.find('.kanban-header-col[data-id="'+c+'"] > .title > .count');i.options.countRender?i.options.countRender(b,p,n.columns[l],i):b.text(p||(i.options.showZeroCount?0:""))}i.adjustKanbanSize(n,s),i.options.onRenderKanban&&i.options.onRenderKanban(s,n,i)},t.prototype.renderKanbanHeader=function(n,t){var o=this;t=t||o.$.children('.kanban-board[data-id="'+n.id+'"]');var i=t.children(".kanban-header");i.length||(i=a('
').prependTo(t),e||i.addClass("clearfix")),i.children(".kanban-col").addClass("kanban-expired");for(var d=n.columns,s={},r=!1,l=0;l','
','
','','',t.options.showCount?'':"","
","
",'
',"
",""].join("")).appendTo(e)),o.data("col",n),o.attr("data-type",n.type).attr("data-subs-count",n.subs.length);var i=o.children(".kanban-header-col");i.find(".title>.icon").attr("class","icon icon-"+(n.icon||""));var d=i.find(".title>.text").text(n.name);n.color&&d.css("color",n.color),t.options.showCount&&i.find(".title>.count").text(n.count||(t.options.showZeroCount?0:"")),t.options.onRenderHeaderCol&&t.options.onRenderHeaderCol(o,n,e)},t.prototype.renderHeaderCol=function(n,e,t){var o=this;if(n.parentType&&t){var i=e.children('.kanban-header-parent-col[data-id="'+t.id+'"]');i.attr("data-subs-count",t.subs.length),o.options.useFlex&&i.css("flex",t.subs.length+" 1 0%"),e=i.children(".kanban-header-sub-cols")}var d=e.children('.kanban-header-col[data-id="'+n.id+'"]'),s="ADD"===n.id;if(d.length)d.removeClass("kanban-expired"),s&&d.appendTo(e);else{d=a(['
',"<"+(s?"a":"div")+' class="title">','','',o.options.showCount?'':"","","
"].join("")).appendTo(e),s?d.children(".title").addClass("action").attr("data-action","addCol"):(d.children(".title").addClass("action-dbc").attr("data-action","editCol"),o.options.readonly||d.append(['
','',"
"].join("")));var r=o.options.minColWidth;r&&d.css("min-width",r)}d.data("col",n),d.attr("data-type",n.type),d.find(".title>.icon").attr("class","icon icon-"+(n.icon||""));var l=d.find(".title>.text").text(n.name);n.color&&l.css("color",n.color),o.options.showCount&&d.find(".title>.count").text(n.count||(o.options.showZeroCount?0:"")),o.options.onRenderHeaderCol&&o.options.onRenderHeaderCol(d,n,e)},t.prototype.renderLane=function(n,t,o,i){var d=this;o=o||d.$.children('.kanban-board[data-id="'+n.kanban+'"]');var s=o.children('.kanban-lane[data-id="'+n.id+'"]');if(s.length?s.removeClass("kanban-expired"):(s=a('
').appendTo(o),e||s.addClass("clearfix")),s.data("lane",n),!d.options.noLaneName){var r=s.children('.kanban-lane-name[data-id="'+n.id+'"]');r.length||(r=a('
').appendTo(s)),r.empty().attr("title",n.name).append(a('').text(n.name)),n.color&&r.css("background-color",n.color),d.options.onRenderLaneName&&d.options.onRenderLaneName(r,n,o,t)}s.children(".kanban-col,.kanban-sub-lanes").addClass("kanban-expired"),s.toggleClass("has-sub-lane",!!n.subLanes),n.subLanes?d.renderSubLanes(n,t,s):d.renderLaneItems(t,n.items,s,n,i),d.options.readonly||d.renderLaneCol({id:"EMPTY",type:"EMPTY"},s),s.children(".kanban-expired").remove()},t.prototype.renderSubLanes=function(n,e,t){var o=this,i=t.children('.kanban-sub-lanes[data-id="'+n.id+'"]');i.length?i.removeClass("kanban-expired"):i=a('
').appendTo(t),i.children(".kanban-sub-lane").addClass("kanban-expired");for(var d=0;d').appendTo(o),e||d.addClass("clearfix")),d.children(".kanban-col").addClass("kanban-expired"),this.renderLaneItems(t,n.items,d,n,i),d.children(".kanban-expired").remove()},t.prototype.renderLaneItems=function(a,n,e,t,o){for(var i=this,d=0;d').appendTo(e),"EMPTY"!==n.id&&(o.append('
'),t.options.readonly||o.append(['
','","
"].join("")));var i=t.options;i.minColWidth&&o.css("min-width",i.minColWidth),i.maxColHeight&&o.find(".kanban-lane-items").css("max-height",i.maxColHeight),i.laneItemsClass&&o.find(".kanban-lane-items").addClass(i.laneItemsClass),i.laneColClass&&o.addClass(i.laneColClass)}return"EMPTY"===n.id&&o.appendTo(e),o.attr("data-type",n.type),o},t.prototype.renderLaneItem=function(n,e,t,o,i){var d=e.children('.kanban-item[data-id="'+n.id+'"]');if(d.length?d.removeClass("kanban-expired"):d=a('
').appendTo(e),this.options.itemRender)this.options.itemRender(n,d,t,o,i);else{var s=d.find(".title");s.length||(s=a('
').appendTo(d)),s.text(n.name||n.title)}return d},t.prototype.adjustKanbanSize=function(n,t){for(var o=this,i=n.columns,d=o.options.noLaneName?0:o.options.laneNameWidth,s=o.options.readonly?0:1,r=0;r Date: Tue, 26 Oct 2021 14:54:57 +0800 Subject: [PATCH 022/443] * remove width limit in kanban page. --- module/execution/css/kanbandemo.css | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/module/execution/css/kanbandemo.css b/module/execution/css/kanbandemo.css index 723bae2963..1b0dbba8ca 100644 --- a/module/execution/css/kanbandemo.css +++ b/module/execution/css/kanbandemo.css @@ -1,12 +1,14 @@ -.kanban {overflow-x: auto;} -.kanban + .kanban {margin-top: 15px;} -.kanban-item > .title { display: block;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;} -.kanban-item > .infos {position: relative; margin-top: 5px;} -.kanban-item > .infos > .info + .info {margin-left: 10px;} +#main > .container {max-width: none!important; padding: 0 15px} + +.kanban {overflow-x: auto} +.kanban + .kanban {margin-top: 15px} +.kanban-item > .title { display: block;white-space: nowrap; overflow: hidden; text-overflow: ellipsis} +.kanban-item > .infos {position: relative; margin-top: 5px} +.kanban-item > .infos > .info + .info {margin-left: 10px} .kanban-item > .infos > .info-id, .kanban-item > .infos > .info-estimate {font-size: 12px; position: relative; top: 2px} -.kanban-item > .infos > .label-pri {min-width: 16px; line-height: 14px; height: 16px; padding: 0;} -.kanban-item > .infos > .label-severity {transform: scale(.75);} +.kanban-item > .infos > .label-pri {min-width: 16px; line-height: 14px; height: 16px; padding: 0} +.kanban-item > .infos > .label-severity {transform: scale(.75)} .kanban-item > .infos > .avatar {position: absolute; right: 0; top: 0} .kanban-affixed .kanban-header-col > .title > .text, From cc3fb38f5056dc23ec5d09545b001b92f3f123bd Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 26 Oct 2021 14:55:12 +0800 Subject: [PATCH 023/443] * fix maxCount not show in kanban header. --- module/execution/js/kanbandemo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/js/kanbandemo.js b/module/execution/js/kanbandemo.js index d5c2ba7f21..144e65475f 100644 --- a/module/execution/js/kanbandemo.js +++ b/module/execution/js/kanbandemo.js @@ -490,7 +490,7 @@ addColumnRenderer('task', renderTaskItem); */ function renderColumnCount($count, count, col) { - var text = count + '/' + (!col.maxCount ? '' : ''); + var text = count + '/' + (col.maxCount || ''); $count.html(text + ''); } From ad05f1d4cfa0b4a427c9bd50ce537e5d588b69f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 26 Oct 2021 15:03:27 +0800 Subject: [PATCH 024/443] * Add kanban view. --- module/execution/control.php | 12 - module/execution/js/kanban.js | 786 ++++++++++++++++++-------- module/execution/view/kanban.html.php | 195 +------ module/kanban/model.php | 10 +- 4 files changed, 560 insertions(+), 443 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 11c7079776..0d6e2c3dce 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1845,20 +1845,13 @@ class execution extends control $this->execution->setMenu($executionID); $execution = $this->loadModel('execution')->getById($executionID); - $tasks = $this->execution->getKanbanTasks($executionID, "id"); - $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); - $stories = $this->loadModel('story')->getExecutionStories($executionID); /* Determines whether an object is editable. */ $canBeChanged = common::canModify('execution', $execution); - $kanbanGroup = $this->execution->getKanbanGroupData($stories, $tasks, $bugs, $type); - $kanbanSetting = $this->execution->getKanbanSetting(); - $this->view->title = $this->lang->execution->kanban; $this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name); $this->view->position[] = $this->lang->execution->kanban; - $this->view->stories = $stories; $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); $this->view->storyOrder = $orderBy; $this->view->orderBy = 'id_asc'; @@ -1866,11 +1859,6 @@ class execution extends control $this->view->browseType = ''; $this->view->execution = $execution; $this->view->type = $type; - $this->view->kanbanGroup = $kanbanGroup; - $this->view->kanbanColumns = $this->execution->getKanbanColumns($kanbanSetting); - $this->view->statusMap = $canBeChanged ? $this->execution->getKanbanStatusMap($kanbanSetting) : array(); - $this->view->statusList = $this->execution->getKanbanStatusList($kanbanSetting); - $this->view->colorList = $this->execution->getKanbanColorList($kanbanSetting); $this->view->canBeChanged = $canBeChanged; $this->display(); diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 001ec4c5df..d5c2ba7f21 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1,253 +1,549 @@ +/** + * Get story demo kanban data + * 获取“软件需求”看板演示数据 + * @returns {Object} Kanban data + * @todo 该方法作为演示,应该在最终版本中移除 + */ +function getStoryKanbanDemoData() +{ + /* Define kanban columns 定义看板列 */ + var columns = + [ + /* 看板列定义数据结构: + id: 列 ID(确保在页面上唯一), + type: 类型, + name: 显示的名称, + color: 列名称颜色, + parentType: 所属的父级列类型 + asParent: 是否作为父级列 + itemType: 看板条目类型,例如:'story'(需求) + maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ + {id: 'story-blacklog', type: 'blacklog', name: 'Blacklog', color: '', maxCount: 0}, + {id: 'story-ready', type: 'ready', name: '准备好', color: '', maxCount: 4}, + {id: 'story-dev', type: 'dev', name: '开发', color: '', maxCount: 4, asParent: true}, + {id: 'story-dev-doing', type: 'dev-doing', name: '进行中', color: '#126eed', maxCount: 2, parentType: 'dev'}, + {id: 'story-dev-done', type: 'dev-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'dev'}, + {id: 'story-test', type: 'test', name: '测试', color: '', maxCount: 4, asParent: true}, + {id: 'story-test-doing', type: 'test-doing', name: '进行中', color: '#126eed', maxCount: 2, parentType: 'test'}, + {id: 'story-test-done', type: 'test-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'test'}, + {id: 'story-accepted', type: 'accepted', name: '已验收', color: '', maxCount: 0}, + {id: 'story-published', type: 'published', name: '已发布', color: '', maxCount: 0}, + ]; + + /* Define items in blacklog column 定义 Blacklog 列上的条目 */ + var blacklogColItems = + [ + /* 需求数据结构: + id: ID,通常为需求 ID, + title: 名称, + order: 显示顺序,如果指定为 0,则按 ID 倒序排序, + pri: 优先级, + estimate: 预估时间, + assignedTo: 指派给, + deadline: 截止日期 */ + {id: 10010, title: '第一条 Blacklog', order: 1, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10011, title: '文档模块的实现', order: 2, pri: 2, estimate: 0, assignedTo: 'sunhao'}, + {id: 10012, title: '实现软件需求看板视图中不同分组条件的看板展示方式', order: 3, pri: 3, estimate: 10, assignedTo: 'admin'}, + {id: 10013, title: 'Blacklog 3', order: 4, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + {id: 10014, title: '实现泳道的更多操作菜单', order: 5, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + ]; + /* Define items in ready column 定义 准备好 列上的条目 */ + var readyColItems = + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10020, title: '在看板列中实现创建任务功能', order: 10, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10021, title: '实现泳道的上下移动', order: 11, pri: 2, estimate: 0, assignedTo: 'sunhao'}, + {id: 10024, title: '实现泳道的更多操作菜单', order: 15, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + ]; + var devDoingColItems = /* Define items in dev/doing column 定义 开发/进行中 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10030, title: '实现看板的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10031, title: '实现卡片拖动效果功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var devDoneColItems = /* Define items in dev/done column 定义 开发/完成 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10040, title: '实现看板列卡片排序功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var testDoingColItems = /* Define items in test/doing column 定义 测试/进行中 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10050, title: '实现看板列的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10051, title: '实现Bug卡片的更多操作功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var testDoneColItems = /* Define items in test/done column 定义 测试/完成 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10060, title: '实现任务卡片的更多操作功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var acceptedColItems = + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10070, title: '实现执行看板的新建按钮组功能', order: 10, pri: 3, estimate: 12, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10071, title: '在看板列中实现提交Bug功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + {id: 10072, title: '在看板列中实现需求的添加和关联功能', order: 10, pri: 3, estimate: 10, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10073, title: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var publishedColItems = + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10080, title: '实现任务看板视图中泳道分组下拉菜单功能', order: 10, pri: 3, estimate: 2, assignedTo: 'admin'}, + ]; + + /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ + var items = + { + /* 看板列类型: 条目列表 */ + blacklog: blacklogColItems, + ready: readyColItems, + 'dev-doing': devDoingColItems, + 'dev-done': devDoneColItems, + 'test-doing': testDoingColItems, + 'test-done': testDoneColItems, + accepted: acceptedColItems, + published: publishedColItems, + }; + + /* Define kanban lanes 定义看板泳道 */ + var lanes = + [ + /* 泳道数据结构: + id: 泳道 ID,确保页面上唯一,可以为数字或字符串, + name: 名称, + items: 定义每列上的条目 + color: 泳道名称背景色 + defaultItemType: 看板泳道上的条目默认类型,例如:'story'(需求) */ + {id: 'story', name: '软件需求', items: items, color: '#3dc6fc', defaultItemType: 'story'}, + ] + + /* Return kanban data 返回看板数据 */ + /* 看板数据结构: + id: ID,确保页面上唯一,可以为数字或字符串, + columns: 定义看板上的所有列, + lanes: 定义看板上的所有泳道 + defaultItemType: 看板上的条目默认类型,例如:'story'(需求) */ + return {id: 'story', columns: columns, lanes: lanes, defaultItemType: 'story'}; +} + +/** + * Get bug demo kanban data + * 获取“Bug”看板演示数据 + * @returns {Object} Kanban data + * @todo 该方法作为演示,应该在最终版本中移除 + */ +function getBugKanbanDemoData() +{ + /* Define kanban columns 定义看板列 */ + var columns = + [ + /* 看板列定义数据结构: + id: 列 ID(确保在页面上唯一), + type: 类型, + name: 显示的名称, + color: 列名称颜色, + parentType: 所属的父级列类型 + asParent: 是否作为父级列 + itemType: 看板条目类型,例如:'story'(需求) + maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ + {id: 'bug-wait', type: 'wait', name: '待确认', color: '', maxCount: 0}, + {id: 'bug-confirmed', type: 'confirmed', name: '已确认', color: '', maxCount: 4}, + {id: 'bug-resolving', type: 'resolving', name: '解决中', color: '', maxCount: 4, asParent: true}, + {id: 'bug-resolving-doing', type: 'resolving-doing',name: '进行中', color: '#126eed', maxCount: 2, parentType: 'resolving'}, + {id: 'bug-resolving-done', type: 'resolving-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'resolving'}, + {id: 'bug-test', type: 'test', name: '测试', color: '', maxCount: 4, asParent: true}, + {id: 'bug-test-doing', type: 'test-doing', name: '测试中', color: '#126eed', maxCount: 2, parentType: 'test'}, + {id: 'bug-test-done', type: 'test-done', name: '测试完毕', color: '#2fab8e', maxCount: 2, parentType: 'test'}, + {id: 'bug-closed', type: 'closed', name: '已关闭', color: '', maxCount: 0}, + ]; + + /* Define items in wait column 定义 待确认 列上的条目 */ + var waitColItems = + [ + /* bug 数据结构: + id: ID,通常为 Bug ID, + title: 名称, + order: 显示顺序,如果指定为 0,则按 ID 倒序排序, + pri: 优先级, + severity: 紧急程度, + assignedTo: 指派给 */ + {id: 10010, title: '在看板列中实现创建任务功能', order: 10, pri: 1, severity: 2, assignedTo: 'admin'}, + {id: 10011, title: '实现泳道的上下移动', order: 11, pri: 2, severity: 1, assignedTo: 'sunhao'}, + {id: 10014, title: '实现泳道的更多操作菜单', order: 15, pri: 0, severity: 1, assignedTo: 'sunhao'}, + ]; + /* Define items in confirmed column 定义 已确认 列上的条目 */ + var confirmedColItems = + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10020, title: '在看板列中实现创建任务功能', order: 10, pri: 1, severity: 2, assignedTo: 'admin'}, + {id: 10021, title: '实现泳道的上下移动', order: 11, pri: 2, severity: 1, assignedTo: 'sunhao'}, + {id: 10024, title: '实现泳道的更多操作菜单', order: 15, pri: 0, severity: 1, assignedTo: 'sunhao'}, + ]; + var resolvingDoingColItems = /* Define items in resolving/doing column 定义 开发/进行中 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10030, title: '实现看板的更多操作菜单', order: 10, pri: 3, severity: 1, assignedTo: 'admin'}, + {id: 10031, title: '实现卡片拖动效果功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + ]; + var resolvingDoneColItems = /* Define items in resolving/done column 定义 开发/完成 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10040, title: '实现看板列卡片排序功能', order: 10, pri: 1, severity: 4, assignedTo: 'admin'}, + ]; + var testDoingColItems = /* Define items in test/doing column 定义 测试/进行中 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10050, title: '实现看板列的更多操作菜单', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, + {id: 10051, title: '实现Bug卡片的更多操作功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + ]; + var testDoneColItems = /* Define items in test/done column 定义 测试/完成 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10060, title: '实现任务卡片的更多操作功能', order: 10, pri: 1, severity: 4, assignedTo: 'admin'}, + ]; + var closedColItems = + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10070, title: '实现执行看板的新建按钮组功能', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, + {id: 10071, title: '在看板列中实现提交Bug功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + {id: 10072, title: '在看板列中实现需求的添加和关联功能', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, + {id: 10073, title: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + ]; + + /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ + var items = + { + /* 看板列类型: 条目列表 */ + wait: waitColItems, + confirmed: confirmedColItems, + 'resolving-doing': resolvingDoingColItems, + 'resolving-done': resolvingDoneColItems, + 'test-doing': testDoingColItems, + 'test-done': testDoneColItems, + closed: closedColItems, + }; + + /* Define kanban lanes 定义看板泳道 */ + var lanes = + [ + /* 泳道数据结构: + id: 泳道 ID,确保页面上唯一,可以为数字或字符串, + name: 名称, + items: 定义每列上的条目 + color: 泳道名称背景色 + defaultItemType: 看板泳道上的条目默认类型,例如:'bug'(Bug) */ + {id: 'bug', name: 'Bug', items: items, color: '#9c30b0', defaultItemType: 'bug'}, + ] + + /* Return kanban data 返回看板数据 */ + /* 看板数据结构: + id: ID,确保页面上唯一,可以为数字或字符串, + columns: 定义看板上的所有列, + lanes: 定义看板上的所有泳道 + defaultItemType: 看板上的条目默认类型,例如:'bug'(Bug) */ + return {id: 'bug', columns: columns, lanes: lanes, defaultItemType: 'bug'}; +} + +/** + * Get task demo kanban data + * 获取“任务”看板演示数据 + * @returns {Object} Kanban data + * @todo 该方法作为演示,应该在最终版本中移除 + */ +function getTaskKanbanDemoData() +{ + /* Define kanban columns 定义看板列 */ + var columns = + [ + /* 看板列定义数据结构: + id: 列 ID(确保在页面上唯一), + type: 类型, + name: 显示的名称, + color: 列名称颜色, + parentType: 所属的父级列类型 + asParent: 是否作为父级列 + itemType: 看板条目类型,例如:'task'(任务) + maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ + {id: 'task-wait', type: 'wait', name: '未开始', color: '', maxCount: 0}, + {id: 'task-dev', type: 'dev', name: '开发', color: '', maxCount: 4, asParent: true}, + {id: 'task-dev-doing', type: 'dev-doing', name: '研发中', color: '#126eed', maxCount: 2, parentType: 'dev'}, + {id: 'task-dev-done', type: 'dev-done', name: '研发完成', color: '#2fab8e', maxCount: 2, parentType: 'dev'}, + {id: 'task-pause', type: 'pause', name: '已暂停', color: '', maxCount: 0}, + {id: 'task-cancel', type: 'cancel', name: '已取消', color: '', maxCount: 0}, + {id: 'task-closed', type: 'closed', name: '已关闭', color: '', maxCount: 0}, + ]; + + /* Define items in wait column 定义 未开始 列上的条目 */ + var waitColItems = + [ + /* 任务数据结构: + id: ID,通常为任务 ID, + name: 名称, + order: 显示顺序,如果指定为 0,则按 ID 倒序排序, + pri: 优先级, + estimate: 预估时间, + assignedTo: 指派给, + deadline: 截止日期 */ + {id: 10020, name: '在看板列中实现创建任务功能', order: 10, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10021, name: '实现泳道的上下移动', order: 11, pri: 2, estimate: 0, assignedTo: 'sunhao', deadline: '2021-10-22'}, + {id: 10024, name: '实现泳道的更多操作菜单', order: 15, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + ]; + var devDoingColItems = /* Define items in dev/doing column 定义 开发/进行中 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10030, name: '实现看板的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10031, name: '实现卡片拖动效果功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var devDoneColItems = /* Define items in dev/done column 定义 开发/完成 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10040, name: '实现看板列卡片排序功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var pauseColItems = /* Define items in pause column 定义 已暂停 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10050, name: '实现看板列的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10051, name: '实现Bug卡片的更多操作功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var cancelColItems = /* Define items in cancel column 定义 已取消 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10060, name: '实现任务卡片的更多操作功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var closedColItems = + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10070, name: '实现执行看板的新建按钮组功能', order: 10, pri: 3, estimate: 12, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10071, name: '在看板列中实现提交Bug功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + {id: 10072, name: '在看板列中实现任务的添加和关联功能', order: 10, pri: 3, estimate: 10, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10073, name: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + + /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ + var items = + { + /* 看板列类型: 条目列表 */ + wait: waitColItems, + 'dev-doing': devDoingColItems, + 'dev-done': devDoneColItems, + pause: pauseColItems, + cancel: cancelColItems, + closed: closedColItems, + }; + + /* Define kanban lanes 定义看板泳道 */ + var lanes = + [ + /* 泳道数据结构: + id: 泳道 ID,确保页面上唯一,可以为数字或字符串, + name: 名称, + items: 定义每列上的条目 + color: 泳道名称背景色 + defaultItemType: 看板泳道上的条目默认类型,例如:'task'(任务) */ + {id: 'task', name: '任务', items: items, color: '#126eed', defaultItemType: 'task'}, + ] + + /* Return kanban data 返回看板数据 */ + /* 看板数据结构: + id: ID,确保页面上唯一,可以为数字或字符串, + columns: 定义看板上的所有列, + lanes: 定义看板上的所有泳道 + defaultItemType: 看板上的条目默认类型,例如:'task'(任务) */ + return {id: 'task', columns: columns, lanes: lanes, defaultItemType: 'task'}; +} + + +/** + * Render user account + * @param {String} userAccount User account + * @returns {string} + */ +function renderUserAvatar(userAccount) +{ + var hue = $.zui.strCode(userAccount) * 43 / 360; + return ('
' + + userAccount[0].toUpperCase() + + '
'); +} + +/** + * Render story item 提供方法渲染看板中的需求条目 + * @param {Object} item Story item object + * @param {JQuery} $item Kanban item element + * @param {Object} col Column object + * @returns {JQuery} $item Kanban item element + */ +function renderStoryItem(item, $item, col) +{ + var $title = $item.find('.title'); + if(!$title.length) + { + $title = $(' ') + .attr('href', $.createLink('story', 'view', 'storyID=' + item.id)); + $title.appendTo($item); + } + $title.attr('title', item.title).find('.text').text(item.title); + + var $infos = $item.find('.infos'); + if(!$infos.length) + { + $infos = $('
').appendTo($item); + } + $infos.html( + [ + '#' + item.id + '', + '' + item.pri + '', + item.estimate ? '' + item.estimate + 'h' : '', + item.assignedTo ? renderUserAvatar(item.assignedTo) : '', + ].join('')); + + $item.attr('data-type', 'story').addClass('kanban-item-story'); + + return $item; +} + + +/** + * Render bug item 提供方法渲染看板中的 Bug 条目 + * @param {Object} item Bug item object + * @param {JQuery} $item Kanban item element + * @param {Object} col Column object + * @returns {JQuery} $item Kanban item element + */ +function renderBugItem(item, $item, col) +{ + var $title = $item.find('.title'); + if(!$title.length) + { + $title = $(' ') + .attr('href', $.createLink('bug', 'view', 'bugID=' + item.id)); + $title.appendTo($item); + } + $title.attr('title', item.title).find('.text').text(item.title); + + var $infos = $item.find('.infos'); + if(!$infos.length) + { + $infos = $('
').appendTo($item); + } + $infos.html( + [ + '#' + item.id + '', + '', + '' + item.pri + '', + item.assignedTo ? renderUserAvatar(item.assignedTo) : '', + ].join('')); + + $item.attr('data-type', 'bug').addClass('kanban-item-bug'); + + return $item; +} + +/** + * Render task item 提供方法渲染看板中的任务条目 + * @param {Object} item Task item object + * @param {JQuery} $item Kanban item element + * @param {Object} col Column object + * @returns {JQuery} $item Kanban item element + */ +function renderTaskItem(item, $item, col) +{ + var $title = $item.find('.title'); + if(!$title.length) + { + $title = $(' ') + .attr('href', $.createLink('task', 'view', 'taskID=' + item.id)); + $title.appendTo($item); + } + $title.attr('title', item.name).find('.text').text(item.name); + + var $infos = $item.find('.infos'); + if(!$infos.length) + { + $infos = $('
').appendTo($item); + } + $infos.html( + [ + '#' + item.id + '', + '' + item.pri + '', + item.estimate ? '' + item.estimate + 'h' : '', + item.assignedTo ? renderUserAvatar(item.assignedTo) : '', + ].join('')); + + $item.attr('data-type', 'task').addClass('kanban-item-task'); + + return $item; +} + + +/* Add column renderer/ 添加特定列类型或列条目类型渲染方法 */ +addColumnRenderer('story', renderStoryItem); +addColumnRenderer('bug', renderBugItem); +addColumnRenderer('task', renderTaskItem); + +/** + * Render column count 渲染看板列头上的条目数目 + * @param {JQuery} $count Kanban count element + * @param {number} count Column items count + * @param {number} col Column object + * @param {Object} kanban Kanban intance + */ +function renderColumnCount($count, count, col) +{ + var text = count + '/' + (!col.maxCount ? '' : ''); + $count.html(text + ''); +} + +/** + * Updata kanban data + * 更新看板上的数据 + * @param {string} kanbanID Kanban id 看板 ID + * @param {Object} data Kanban data 看板数据 + */ +function updateKanban(kanbanID, data) +{ + var $kanban = $('#kanban-' + kanbanID); + if(!$kanban.length) return; + + $kanban.data('zui.kanban').render(data); +} + +/** + * Create kanban in page + * 在界面上创建一个看板界面 + * @param {string} kanbanID Kanban id 看板 ID + * @param {Object} data Kanban data 看板数据 + * @param {Object} options Kanban options 组件初始化数据 看板名称 + */ +function createKanban(kanbanID, data, options) +{ + var $kanban = $('#kanban-' + kanbanID); + if($kanban.length) return updateKanban(kanbanID, data); + + $kanban = $('
').appendTo('#kanbans'); + $kanban.kanban($.extend({data: data}, options)); +} + +/* Example code: */ $(function() { - var isFirefox = $.zui.browser.firefox; - var adjustBoardsHeight = function() + /* Common options 用于初始化看板的通用选项 */  + var commonOptions = { - var $cBoards = $('.c-boards'); - var viewHeight = $(window).height() - $('#header').height() - $('#footer').height() - 111; - if ($cBoards.length === 1) - { - var $boardsWrapper = $cBoards.find('.boards-wrapper'); - $boardsWrapper.css('min-height', viewHeight); - if($boardsWrapper.height() > $boardsWrapper.find('.boards').height()) - { - $boardsWrapper.find('.boards').css(isFirefox ? 'height' : 'min-height', $boardsWrapper.height() - 1); - } - return - } - - $cBoards.each(function() - { - var $theBoards = $(this); - - var $boardsWrapper = $theBoards.find('.boards-wrapper'); - var minHeight = Math.min($theBoards.prev().find('.board-story').outerHeight() + 4, viewHeight); - $boardsWrapper.css({maxHeight: viewHeight, minHeight: minHeight}); - if($boardsWrapper.height() > $boardsWrapper.find('.boards').height()) - { - var $boards = $boardsWrapper.find('.boards'); - $boards.css({maxHeight: $theBoards.height(), minHeight: minHeight}); - if ($boards.outerHeight() < minHeight) $boards.css('height', minHeight); - } - }); - }; - adjustBoardsHeight(); - - var boardID = ''; - var onlybody = config.requestType == 'GET' ? "&onlybody=yes" : "?onlybody=yes"; - $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot}); - var $kanban = $('#kanban'); - - // Get scrollbar width - var getScrollbarWidth = function () - { - var outer = document.createElement("div"); - outer.style.visibility = "hidden"; - outer.style.width = "100px"; - outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps - - document.body.appendChild(outer); - - var widthNoScroll = outer.offsetWidth; - // force scrollbars - outer.style.overflow = "scroll"; - - // add innerdiv - var inner = document.createElement("div"); - inner.style.width = "100%"; - outer.appendChild(inner); - - var widthWithScroll = inner.offsetWidth; - - // remove divs - outer.parentNode.removeChild(outer); - - return widthNoScroll - widthWithScroll; + maxColHeight: 'auto', + minColWidth: 240, + dropable: true, + showCount: true, + showZeroCount: true, + countRender: renderColumnCount }; - var scrollbarWidth = getScrollbarWidth(); - var fixBoardWidth = function() - { - var $table = $kanban.children('.table:first'); - var kanbanWidth = $table.width(); - var $cBoards = $table.find('thead>tr>th.c-board:not(.c-side)'); - var boardCount = $cBoards.length; - var $cSide = $table.find('thead>tr>th.c-board.c-side'); - var totalWidth = kanbanWidth - scrollbarWidth - 1; - if ($cSide.length) totalWidth = totalWidth - ($cSide.outerWidth() + 5); - var cBoardWidth = Math.floor(totalWidth/boardCount); - $cBoards.not(':last').width(cBoardWidth); - if ($cSide.length) $cBoards.first().width(cBoardWidth + (isFirefox ? 0 : 5)); - $kanban.find('.boards > .board').width(cBoardWidth - (isFirefox ? 21 : 22)); - }; - fixBoardWidth(); + /* Create story kanban 创建需求看板 */ + createKanban('story', getStoryKanbanDemoData(), commonOptions); - var updateUI = function() - { - fixBoardWidth(); - adjustBoardsHeight(); - $kanban.data('zui.table').updateFixUI(); - }; + /* Create bug kanban 创建 Bug 看板 */ + createKanban('bug', getBugKanbanDemoData(), commonOptions); - $(window).on('resize', updateUI); - - var refresh = function(force) - { - var selfClose = $.cookie('selfClose'); - $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot}); - if(selfClose == 1 || force) - { - $kanban.load(location.href + ' #kanban>*', updateUI); - } - }; - window.refreshKanban = refresh; - - var kanbanModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: 800}); - var dropTo = function(id, from, to, type) - { - if(statusMap[type][from] && statusMap[type][from][to]) - { - var method = statusMap[type][from][to]; - var link = $.createLink(type, method, 'id=' + id + '&subStatus=' + to); - if(method == 'ajaxChangeSubStatus') - { - $.getJSON(link, function(response) - { - if(response.result == 'fail' && response.message) - { - bootAlert(response.message); - setTimeout(function(){location.reload();}, 1000); - } - }); - } - else - { - kanbanModalTrigger.show( - { - url: link + onlybody, - shown: function(){$('.modal-iframe').addClass('with-titlebar').data('cancel-reload', true)}, - width: 900, - hidden: refresh - }); - } - } - - /* Keep the draged element stay in the new place. */ - return true; - }; - - $kanban.droppable( - { - selector: '.board-item:not(.disabled)', - target: function($ele) - { - var itemType = $ele.data('type'); - var $board = $ele.closest('.board'); - var type = $board.data('type'); - return $board.siblings('.board').filter(function() - { - var typeMap = statusMap[itemType]; - var actionMap = typeMap && typeMap[type]; - return !!actionMap && actionMap[$(this).data('type')]; - }); - }, - start: function(e) - { - $kanban.addClass('dragging'); - e.targets.addClass('can-drop-in'); - var $item = $(e.element).addClass('dragging'); - $item.closest('.boards').addClass('dragging'); - }, - drag: function(e) - { - var $item = $(e.element); - var $target = $(e.target); - var $holder = $target.find('.board-drag-holder'); - if (!$holder.length) $holder = $('
').appendTo($target); - $kanban.find('.c-board.dragging').removeClass('dragging'); - $kanban.find('.c-board.s-' + $target.data('type')).addClass('dragging'); - $holder.height($item.outerHeight()); - }, - drop: function(e) - { - var result = dropTo(e.element.data('id'), e.element.closest('.board').data('type'), e.target.data('type'), e.element.data('type')); - if(result !== false) - { - e.element.insertBefore(e.target.find('.board-drag-holder')); - } - }, - finish: function() - { - $kanban.removeClass('dragging').find('.can-drop-in').removeClass('can-drop-in'); - $kanban.find('.dragging').removeClass('dragging'); - } - }); - - $kanban.on('click', '.kanbaniframe', function(e) - { - var $link = $(this); - kanbanModalTrigger.show( - { - url: $link.attr('href'), - shown: function(){$('.modal-iframe').addClass('with-titlebar').data('cancel-reload', true)}, - hidden: refresh, - width: $(this).is('.task-assignedTo,.bug-assignedTo') ? 800 : 1100 - }); - return false; - }); - - fixKanbanSide($kanban); + /* Create task kanban 创建 任务 看板 */ + createKanban('task', getTaskKanbanDemoData(), commonOptions); }); - -function fixKanbanSide($kanban) -{ - if($kanban.length == 0) return false; - - fixSideInit(); - $kanban.scroll(fixSide);//Fix kanban side when scrolling. - - var tableWidth, kanbanOffset, fixedSide, $fixedSide; - function fixSide() - { - kanbanOffset = $kanban.offset().left; - $fixedSide = $kanban.parent().find('.fixedSide'); - if($fixedSide.length <= 0 && kanbanOffset < $kanban.scrollLeft()) - { - var $th = $kanban.find('table thead tr th:first'); - - tableWidth = $th.width(); - - fixedSide = "'; - $kanban.find('table tbody tr').each(function() - { - var $td = $(this).find('td:first'); - fixedSide = fixedSide + "'; - }); - fixedSide = fixedSide + '
" + $th.html()+ '
" + $td.html() + '
'; - - $kanban.before(fixedSide); - - $('.fixedSide').width(tableWidth); - $('.fixedSide').css('top', $kanban.offset()); - - /* Reset height. */ - var index = 1; - $('.fixedSide tbody tr').each(function() - { - var $td = $kanban.find('table tbody tr:nth-child(' + index + ') td:first'); - - if($(this).find('td:first div:first').length == 0) $(this).find('td:first').html('
'); - $(this).find('td:first div:first').height($td.height()); - - index++; - }) - } - if($fixedSide.length > 0 && kanbanOffset >= $kanban.scrollLeft()) $fixedSide.remove(); - } - function fixSideInit() - { - $fixedSide = $kanban.parent().find('.fixedSide'); - if($fixedSide.length > 0) $fixedSide.remove(); - fixSide(); - } -} diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 5db8444efb..1b12366872 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -9,7 +9,8 @@ */ ?> - + + - -
- 0) - { - $hasTask = true; - break; - } - } - ?> - -
-

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

+ +
+
+ Section +
+
+
- - - - - - - - - - - - - $group):?> - - - - - - - -
- -
- - - -
-
- createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', 'class="kanbaniframe group-title" title="' . $story->title . '"'); - } - else - { - echo "{$story->title}"; - } - ?> - - - -
-
- #id?> - story->priList, $story->pri);?> - story->stageList[$story->stage];?> -
estimate . 'h ';?>
-
-
- -
- - -
-
-
- -
- tasks[$col])):?> - tasks[$col] as $task):?> - -
- parent > 0 ? "" . $lang->task->childrenAB . ' ' : ''; - if(common::hasPriv('task', 'view')) - { - echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "{$childrenAB}{$task->name}", '', 'class="title kanbaniframe" title="' . $task->name . '"'); - } - else - { - echo "{$childrenAB}{$task->name}"; - } - ?> -
- " . zget($realnames, $task->assignedTo) . ""; - if(empty($task->assignedTo)) $assignedToRealName = "{$lang->task->noAssigned}"; - if(common::hasPriv('task', 'assignTo', $task)) - { - echo html::a($this->createLink('task', 'assignTo', "executionID={$task->execution}&taskID={$task->id}", '', true), ' ' . $assignedToRealName, '', 'class="btn btn-icon-left kanbaniframe task-assignedTo"'); - } - else - { - echo " {$assignedToRealName}"; - } - ?> - delay)):?> - task->delayed;?> - - left;?>h -
-
- - - bugs[$col])):?> - bugs[$col] as $bug):?> -
- createLink('bug', 'view', "bugID=$bug->id", '', true), " #{$bug->id}{$bug->title}", '', 'class="title kanbaniframe" title="' . $bug->title . '"'); - } - else - { - echo " #{$bug->id}{$bug->title}"; - } - ?> -
- " . zget($realnames, $bug->assignedTo) . ""; - if(empty($bug->assignedTo)) $assignedToRealName = "{$lang->task->noAssigned}"; - if(common::hasPriv('bug', 'assignTo', $bug)) - { - echo html::a($this->createLink('bug', 'assignTo', "bugID={$bug->id}", '', true), ' ' . $assignedToRealName, '', 'class="btn btn-icon-left kanbaniframe bug-assignedTo"'); - } - else - { - echo " {$assignedToRealName}"; - } - ?> - bug->statusList, $bug->status);?> -
-
- - -
- -
-
-
-
- + + diff --git a/module/kanban/model.php b/module/kanban/model.php index 5b021797fa..13fe2bf507 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -47,8 +47,14 @@ class kanbanModel extends model } } - foreach($lanes as $laneID => $lane) $lane->columns = $columns[$laneID]; - return $lanes; + $kanban = array(); + foreach($lanes as $laneID => $lane) + { + $lane->columns = $columns[$laneID]; + $kanban[$lane->type] = $lane; + } + + return $kanban; } /** From c45866a3a32dca367fad01a4c91fb6959262a8dd Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 26 Oct 2021 15:24:09 +0800 Subject: [PATCH 025/443] * Code for task #43519. --- module/kanban/config.php | 12 +++++------- module/kanban/model.php | 12 ++++++------ module/kanban/view/setwip.html.php | 2 ++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/kanban/config.php b/module/kanban/config.php index bbb2528cdb..573728094d 100644 --- a/module/kanban/config.php +++ b/module/kanban/config.php @@ -21,13 +21,16 @@ $config->kanban->default->task->name = $lang->task->common; $config->kanban->default->task->color = '#4169e1'; $config->kanban->default->task->order = '15'; +$config->kanban->parentColumn = array(); +$config->kanban->parentColumn['story'] = array('develop', 'test'); +$config->kanban->parentColumn['bug'] = array('resolving', 'test'); +$config->kanban->parentColumn['task'] = array('develop'); + $config->kanban->storyColumnStageList = array(); $config->kanban->storyColumnStageList['backlog'] = 'projected'; $config->kanban->storyColumnStageList['ready'] = 'projected'; -$config->kanban->storyColumnStageList['develop'] = 'developing'; $config->kanban->storyColumnStageList['developing'] = 'developing'; $config->kanban->storyColumnStageList['developed'] = 'developed'; -$config->kanban->storyColumnStageList['test'] = 'testing'; $config->kanban->storyColumnStageList['testing'] = 'testing'; $config->kanban->storyColumnStageList['tested'] = 'tested'; $config->kanban->storyColumnStageList['verified'] = 'verified'; @@ -37,10 +40,8 @@ $config->kanban->storyColumnStageList['closed'] = 'closed'; $config->kanban->storyColumnStatusList = array(); $config->kanban->storyColumnStatusList['backlog'] = 'active'; $config->kanban->storyColumnStatusList['ready'] = 'active'; -$config->kanban->storyColumnStatusList['develop'] = 'active'; $config->kanban->storyColumnStatusList['developing'] = 'active'; $config->kanban->storyColumnStatusList['developed'] = 'active'; -$config->kanban->storyColumnStatusList['test'] = 'active'; $config->kanban->storyColumnStatusList['testing'] = 'active'; $config->kanban->storyColumnStatusList['tested'] = 'active'; $config->kanban->storyColumnStatusList['verified'] = 'active'; @@ -50,17 +51,14 @@ $config->kanban->storyColumnStatusList['closed'] = 'closed'; $config->kanban->bugColumnStatusList = array(); $config->kanban->bugColumnStatusList['unconfirmed'] = 'active'; $config->kanban->bugColumnStatusList['confirmed'] = 'active'; -$config->kanban->bugColumnStatusList['resolving'] = 'active'; $config->kanban->bugColumnStatusList['fixing'] = 'active'; $config->kanban->bugColumnStatusList['fixed'] = 'resolved'; -$config->kanban->bugColumnStatusList['test'] = 'resolved'; $config->kanban->bugColumnStatusList['testing'] = 'resolved'; $config->kanban->bugColumnStatusList['tested'] = 'resolved'; $config->kanban->bugColumnStatusList['closed'] = 'closed'; $config->kanban->taskColumnStatusList = array(); $config->kanban->taskColumnStatusList['wait'] = 'wait'; -$config->kanban->taskColumnStatusList['develop'] = 'wait'; $config->kanban->taskColumnStatusList['developing'] = 'doing'; $config->kanban->taskColumnStatusList['developed'] = 'done'; $config->kanban->taskColumnStatusList['pause'] = 'pause'; diff --git a/module/kanban/model.php b/module/kanban/model.php index d4cf5e496b..f485bdfd1e 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -267,12 +267,12 @@ class kanbanModel extends model } /** - ** Get column by id. - ** - ** @param int $columnID - ** @access public - ** @return object - **/ + * Get column by id. + * + * @param int $columnID + * @access public + * @return object + */ public function getColumnById($columnID) { $column = $this->dao->select('t1.*, t2.type as laneType')->from(TABLE_KANBANCOLUMN)->alias('t1') diff --git a/module/kanban/view/setwip.html.php b/module/kanban/view/setwip.html.php index 2cca3105b1..df3c066d53 100644 --- a/module/kanban/view/setwip.html.php +++ b/module/kanban/view/setwip.html.php @@ -21,6 +21,7 @@
+ type, $config->kanban->parentColumn[$column->laneType])):?> + "; t < this.weekStart + 7;) e += '"; - e += "", this.picker.find(".datetimepicker-days thead").append(e) - }, fillMonths: function () { - for (var t = "", e = 0; e < 12;) t += '' + this.lang.monthsShort[e++] + ""; - this.picker.find(".datetimepicker-months td").html(t) - }, fill: function () { - if (null != this.date && null != this.viewDate) { - var i = new Date(this.viewDate), n = i.getUTCFullYear(), o = i.getUTCMonth(), s = i.getUTCDate(), - r = i.getUTCHours(), l = i.getUTCMinutes(), - h = this.startDate !== -(1 / 0) ? this.startDate.getUTCFullYear() : -(1 / 0), - c = this.startDate !== -(1 / 0) ? this.startDate.getUTCMonth() : -(1 / 0), - d = this.endDate !== 1 / 0 ? this.endDate.getUTCFullYear() : 1 / 0, - u = this.endDate !== 1 / 0 ? this.endDate.getUTCMonth() : 1 / 0, - f = new e(this.date.getUTCFullYear(), this.date.getUTCMonth(), this.date.getUTCDate()).valueOf(), - p = new Date; - if (this.picker.find(".datetimepicker-days thead th:eq(1)").text(this.lang.months[o] + " " + n), "time" == this.formatViewType) { - var g = r % 12 ? r % 12 : 12, m = (g < 10 ? "0" : "") + g, v = (l < 10 ? "0" : "") + l, - y = this.lang.meridiem[r < 12 ? 0 : 1]; - this.picker.find(".datetimepicker-hours thead th:eq(1)").text(m + ":" + v + " " + y.toUpperCase()), this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(m + ":" + v + " " + y.toUpperCase()) - } else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(s + " " + this.lang.months[o] + " " + n), this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(s + " " + this.lang.months[o] + " " + n); - this.picker.find("tfoot th.today").text(this.lang.today).toggle(this.todayBtn !== !1), this.updateNavArrows(), this.fillMonths(); - var b = e(n, o - 1, 28, 0, 0, 0, 0), w = a.getDaysInMonth(b.getUTCFullYear(), b.getUTCMonth()); - b.setUTCDate(w), b.setUTCDate(w - (b.getUTCDay() - this.weekStart + 7) % 7); - var x = new Date(b); - x.setUTCDate(x.getUTCDate() + 42), x = x.valueOf(); - for (var C, _ = []; b.valueOf() < x;) b.getUTCDay() == this.weekStart && _.push(""), C = "", b.getUTCFullYear() < n || b.getUTCFullYear() == n && b.getUTCMonth() < o ? C += " old" : (b.getUTCFullYear() > n || b.getUTCFullYear() == n && b.getUTCMonth() > o) && (C += " new"), this.todayHighlight && b.getUTCFullYear() == p.getFullYear() && b.getUTCMonth() == p.getMonth() && b.getUTCDate() == p.getDate() && (C += " today"), b.valueOf() == f && (C += " active"), (b.valueOf() + 864e5 <= this.startDate || b.valueOf() > this.endDate || t.inArray(b.getUTCDay(), this.daysOfWeekDisabled) !== -1) && (C += " disabled"), _.push('"), b.getUTCDay() == this.weekEnd && _.push(""), b.setUTCDate(b.getUTCDate() + 1); - this.picker.find(".datetimepicker-days tbody").empty().append(_.join("")), _ = []; - for (var k = "", T = "", S = "", D = 0; D < 24; D++) { - var M = e(n, o, s, D); - C = "", M.valueOf() + 36e5 <= this.startDate || M.valueOf() > this.endDate ? C += " disabled" : r == D && (C += " active"), this.showMeridian && 2 == this.lang.meridiem.length ? (T = D < 12 ? this.lang.meridiem[0] : this.lang.meridiem[1], T != S && ("" != S && _.push(""), _.push('
' + T.toUpperCase() + "")), S = T, k = D % 12 ? D % 12 : 12, _.push('' + k + ""), 23 == D && _.push("
")) : (k = D + ":00", _.push('' + k + "")) - } - this.picker.find(".datetimepicker-hours td").html(_.join("")), _ = [], k = "", T = "", S = ""; - for (var D = 0; D < 60; D += this.minuteStep) { - var M = e(n, o, s, r, D, 0); - C = "", M.valueOf() < this.startDate || M.valueOf() > this.endDate ? C += " disabled" : Math.floor(l / this.minuteStep) == Math.floor(D / this.minuteStep) && (C += " active"), this.showMeridian && 2 == this.lang.meridiem.length ? (T = r < 12 ? this.lang.meridiem[0] : this.lang.meridiem[1], T != S && ("" != S && _.push(""), _.push('
' + T.toUpperCase() + "")), S = T, k = r % 12 ? r % 12 : 12, _.push('' + k + ":" + (D < 10 ? "0" + D : D) + ""), 59 == D && _.push("
")) : (k = D + ":00", _.push('' + r + ":" + (D < 10 ? "0" + D : D) + "")) - } - this.picker.find(".datetimepicker-minutes td").html(_.join("")); - var P = this.date.getUTCFullYear(), - z = this.picker.find(".datetimepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active"); - P == n && z.eq(this.date.getUTCMonth()).addClass("active"), (n < h || n > d) && z.addClass("disabled"), n == h && z.slice(0, c).addClass("disabled"), n == d && z.slice(u + 1).addClass("disabled"), _ = "", n = 10 * parseInt(n / 10, 10); - var L = this.picker.find(".datetimepicker-years").find("th:eq(1)").text(n + "-" + (n + 9)).end().find("td"); - n -= 1; - for (var D = -1; D < 11; D++) _ += ' d ? " disabled" : "") + '">' + n + "", n += 1; - L.html(_), this.place() - } - }, updateNavArrows: function () { - var t = new Date(this.viewDate), e = t.getUTCFullYear(), i = t.getUTCMonth(), n = t.getUTCDate(), - o = t.getUTCHours(); - switch (this.viewMode) { - case 0: - this.startDate !== -(1 / 0) && e <= this.startDate.getUTCFullYear() && i <= this.startDate.getUTCMonth() && n <= this.startDate.getUTCDate() && o <= this.startDate.getUTCHours() ? this.picker.find(".prev").css({visibility: "hidden"}) : this.picker.find(".prev").css({visibility: "visible"}), this.endDate !== 1 / 0 && e >= this.endDate.getUTCFullYear() && i >= this.endDate.getUTCMonth() && n >= this.endDate.getUTCDate() && o >= this.endDate.getUTCHours() ? this.picker.find(".next").css({visibility: "hidden"}) : this.picker.find(".next").css({visibility: "visible"}); - break; - case 1: - this.startDate !== -(1 / 0) && e <= this.startDate.getUTCFullYear() && i <= this.startDate.getUTCMonth() && n <= this.startDate.getUTCDate() ? this.picker.find(".prev").css({visibility: "hidden"}) : this.picker.find(".prev").css({visibility: "visible"}), this.endDate !== 1 / 0 && e >= this.endDate.getUTCFullYear() && i >= this.endDate.getUTCMonth() && n >= this.endDate.getUTCDate() ? this.picker.find(".next").css({visibility: "hidden"}) : this.picker.find(".next").css({visibility: "visible"}); - break; - case 2: - this.startDate !== -(1 / 0) && e <= this.startDate.getUTCFullYear() && i <= this.startDate.getUTCMonth() ? this.picker.find(".prev").css({visibility: "hidden"}) : this.picker.find(".prev").css({visibility: "visible"}), this.endDate !== 1 / 0 && e >= this.endDate.getUTCFullYear() && i >= this.endDate.getUTCMonth() ? this.picker.find(".next").css({visibility: "hidden"}) : this.picker.find(".next").css({visibility: "visible"}); - break; - case 3: - case 4: - this.startDate !== -(1 / 0) && e <= this.startDate.getUTCFullYear() ? this.picker.find(".prev").css({visibility: "hidden"}) : this.picker.find(".prev").css({visibility: "visible"}), this.endDate !== 1 / 0 && e >= this.endDate.getUTCFullYear() ? this.picker.find(".next").css({visibility: "hidden"}) : this.picker.find(".next").css({visibility: "visible"}) - } - }, mousewheel: function (t) { - if (t.preventDefault(), t.stopPropagation(), !this.wheelPause) { - this.wheelPause = !0; - var e = t.originalEvent, i = e.wheelDelta, n = i > 0 ? 1 : 0 === i ? 0 : -1; - this.wheelViewModeNavigationInverseDirection && (n = -n), this.showMode(n), setTimeout(function () { - this.wheelPause = !1 - }.bind(this), this.wheelViewModeNavigationDelay) - } - }, click: function (i) { - i.stopPropagation(), i.preventDefault(); - var n = t(i.target).closest("span, td, th, legend"); - if (1 == n.length) { - if (n.is(".disabled")) return void this.element.trigger({ - type: "outOfRange", - date: this.viewDate, - startDate: this.startDate, - endDate: this.endDate - }); - switch (n[0].nodeName.toLowerCase()) { - case"th": - switch (n[0].className) { - case"switch": - this.showMode(1); - break; - case"prev": - case"next": - var o = a.modes[this.viewMode].navStep * ("prev" == n[0].className ? -1 : 1); - switch (this.viewMode) { - case 0: - this.viewDate = this.moveHour(this.viewDate, o); - break; - case 1: - this.viewDate = this.moveDate(this.viewDate, o); - break; - case 2: - this.viewDate = this.moveMonth(this.viewDate, o); - break; - case 3: - case 4: - this.viewDate = this.moveYear(this.viewDate, o) - } - this.fill(); - break; - case"today": - var s = new Date; - s = e(s.getFullYear(), s.getMonth(), s.getDate(), s.getHours(), s.getMinutes(), s.getSeconds(), 0), s < this.startDate ? s = this.startDate : s > this.endDate && (s = this.endDate), this.viewMode = this.startViewMode, this.showMode(0), this._setDate(s), this.fill(), this.autoclose && this.hide() - } - break; - case"span": - if (!n.is(".disabled")) { - var r = this.viewDate.getUTCFullYear(), l = this.viewDate.getUTCMonth(), - h = this.viewDate.getUTCDate(), c = this.viewDate.getUTCHours(), - d = this.viewDate.getUTCMinutes(), u = this.viewDate.getUTCSeconds(); - if (n.is(".month") ? (this.viewDate.setUTCDate(1), l = n.parent().find("span").index(n), h = this.viewDate.getUTCDate(), this.viewDate.setUTCMonth(l), this.element.trigger({ - type: "changeMonth", - date: this.viewDate - }), this.viewSelect >= 3 && this._setDate(e(r, l, h, c, d, u, 0))) : n.is(".year") ? (this.viewDate.setUTCDate(1), r = parseInt(n.text(), 10) || 0, this.viewDate.setUTCFullYear(r), this.element.trigger({ - type: "changeYear", - date: this.viewDate - }), this.viewSelect >= 4 && this._setDate(e(r, l, h, c, d, u, 0))) : n.is(".hour") ? (c = parseInt(n.text(), 10) || 0, (n.hasClass("hour_am") || n.hasClass("hour_pm")) && (12 == c && n.hasClass("hour_am") ? c = 0 : 12 != c && n.hasClass("hour_pm") && (c += 12)), this.viewDate.setUTCHours(c), this.element.trigger({ - type: "changeHour", - date: this.viewDate - }), this.viewSelect >= 1 && this._setDate(e(r, l, h, c, d, u, 0))) : n.is(".minute") && (d = parseInt(n.text().substr(n.text().indexOf(":") + 1), 10) || 0, this.viewDate.setUTCMinutes(d), this.element.trigger({ - type: "changeMinute", - date: this.viewDate - }), this.viewSelect >= 0 && this._setDate(e(r, l, h, c, d, u, 0))), 0 != this.viewMode) { - var f = this.viewMode; - this.showMode(-1), this.fill(), f == this.viewMode && this.autoclose && this.hide() - } else this.fill(), this.autoclose && this.hide() - } - break; - case"td": - if (n.is(".day") && !n.is(".disabled")) { - var h = parseInt(n.text(), 10) || 1, r = this.viewDate.getUTCFullYear(), - l = this.viewDate.getUTCMonth(), c = this.viewDate.getUTCHours(), - d = this.viewDate.getUTCMinutes(), u = this.viewDate.getUTCSeconds(); - n.is(".old") ? 0 === l ? (l = 11, r -= 1) : l -= 1 : n.is(".new") && (11 == l ? (l = 0, r += 1) : l += 1), this.viewDate.setUTCFullYear(r), this.viewDate.setUTCMonth(l, h), this.element.trigger({ - type: "changeDay", - date: this.viewDate - }), this.viewSelect >= 2 && this._setDate(e(r, l, h, c, d, u, 0)); - var f = this.viewMode; - this.showMode(-1), this.fill(), f == this.viewMode && this.autoclose && this.hide() - } - } - } - }, _setDate: function (t, e) { - e && "date" != e || (this.date = t), e && "view" != e || (this.viewDate = t), this.fill(), this.setValue(); - var i; - this.isInput ? i = this.element : this.component && (i = this.element.find("input")), i && (i.change(), this.autoclose && (!e || "date" == e)), this.element.trigger({ - type: "changeDate", - date: this.date - }), null === t && (this.date = this.viewDate) - }, moveMinute: function (t, e) { - if (!e) return t; - var i = new Date(t.valueOf()); - return i.setUTCMinutes(i.getUTCMinutes() + e * this.minuteStep), i - }, moveHour: function (t, e) { - if (!e) return t; - var i = new Date(t.valueOf()); - return i.setUTCHours(i.getUTCHours() + e), i - }, moveDate: function (t, e) { - if (!e) return t; - var i = new Date(t.valueOf()); - return i.setUTCDate(i.getUTCDate() + e), i - }, moveMonth: function (t, e) { - if (!e) return t; - var i, n, o = new Date(t.valueOf()), a = o.getUTCDate(), s = o.getUTCMonth(), r = Math.abs(e); - if (e = e > 0 ? 1 : -1, 1 == r) n = e == -1 ? function () { - return o.getUTCMonth() == s - } : function () { - return o.getUTCMonth() != i - }, i = s + e, o.setUTCMonth(i), (i < 0 || i > 11) && (i = (i + 12) % 12); else { - for (var l = 0; l < r; l++) o = this.moveMonth(o, e); - i = o.getUTCMonth(), o.setUTCDate(a), n = function () { - return i != o.getUTCMonth() - } - } - for (; n();) o.setUTCDate(--a), o.setUTCMonth(i); - return o - }, moveYear: function (t, e) { - return this.moveMonth(t, 12 * e) - }, dateWithinRange: function (t) { - return t >= this.startDate && t <= this.endDate - }, keydown: function (t) { - if (this.picker.is(":not(:visible)")) return void (27 == t.keyCode && this.show()); - var e, i, n, o = !1; - switch (t.keyCode) { - case 27: - this.hide(), t.preventDefault(); - break; - case 37: - case 39: - if (!this.keyboardNavigation) break; - e = 37 == t.keyCode ? -1 : 1, viewMode = this.viewMode, t.ctrlKey ? viewMode += 2 : t.shiftKey && (viewMode += 1), 4 == viewMode ? (i = this.moveYear(this.date, e), n = this.moveYear(this.viewDate, e)) : 3 == viewMode ? (i = this.moveMonth(this.date, e), n = this.moveMonth(this.viewDate, e)) : 2 == viewMode ? (i = this.moveDate(this.date, e), n = this.moveDate(this.viewDate, e)) : 1 == viewMode ? (i = this.moveHour(this.date, e), n = this.moveHour(this.viewDate, e)) : 0 == viewMode && (i = this.moveMinute(this.date, e), n = this.moveMinute(this.viewDate, e)), this.dateWithinRange(i) && (this.date = i, this.viewDate = n, this.setValue(), this.update(), t.preventDefault(), o = !0); - break; - case 38: - case 40: - if (!this.keyboardNavigation) break; - e = 38 == t.keyCode ? -1 : 1, viewMode = this.viewMode, t.ctrlKey ? viewMode += 2 : t.shiftKey && (viewMode += 1), 4 == viewMode ? (i = this.moveYear(this.date, e), n = this.moveYear(this.viewDate, e)) : 3 == viewMode ? (i = this.moveMonth(this.date, e), n = this.moveMonth(this.viewDate, e)) : 2 == viewMode ? (i = this.moveDate(this.date, 7 * e), n = this.moveDate(this.viewDate, 7 * e)) : 1 == viewMode ? this.showMeridian ? (i = this.moveHour(this.date, 6 * e), n = this.moveHour(this.viewDate, 6 * e)) : (i = this.moveHour(this.date, 4 * e), n = this.moveHour(this.viewDate, 4 * e)) : 0 == viewMode && (i = this.moveMinute(this.date, 4 * e), n = this.moveMinute(this.viewDate, 4 * e)), this.dateWithinRange(i) && (this.date = i, this.viewDate = n, this.setValue(), this.update(), t.preventDefault(), o = !0); - break; - case 13: - if (0 != this.viewMode) { - var a = this.viewMode; - this.showMode(-1), this.fill(), a == this.viewMode && this.autoclose && this.hide() - } else this.fill(), this.autoclose && this.hide(); - t.preventDefault(); - break; - case 9: - this.hide() - } - if (o) { - var s; - this.isInput ? s = this.element : this.component && (s = this.element.find("input")), s && s.change(), this.element.trigger({ - type: "changeDate", - date: this.date - }) - } - }, showMode: function (t) { - if (t) { - var e = Math.max(0, Math.min(a.modes.length - 1, this.viewMode + t)); - e >= this.minView && e <= this.maxView && (this.element.trigger({ - type: "changeMode", - date: this.viewDate, - oldViewMode: this.viewMode, - newViewMode: e - }), this.viewMode = e) - } - this.picker.find(">div").hide().filter(".datetimepicker-" + a.modes[this.viewMode].clsName).css("display", "block"), this.updateNavArrows() - }, reset: function (t) { - this._setDate(null, "date") - } - }, t.fn.datetimepicker = function (e) { - var n = Array.apply(null, arguments); - return n.shift(), this.each(function () { - var o = t(this), a = o.data("datetimepicker"), s = "object" == typeof e && e; - a || o.data("datetimepicker", a = new i(this, t.extend({}, t.fn.datetimepicker.defaults, o.data(), s))), "string" == typeof e && "function" == typeof a[e] && a[e].apply(a, n) - }) - }, t.fn.datetimepicker.defaults = {pickerPosition: "auto-right"}, t.fn.datetimepicker.Constructor = i; - var n = t.fn.datetimepicker.dates = { - en: { - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], - daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], - daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - meridiem: ["am", "pm"], - suffix: ["st", "nd", "rd", "th"], - today: "Today" - }, - "zh-cn": { - days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], - daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], - daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], - months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - today: "今日", - suffix: [], - meridiem: [] - }, - "zh-tw": { - days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], - daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], - daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], - months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - today: "今天", - suffix: [], - meridiem: ["上午", "下午"] - } - }, o = function (e) { - var i = n[e]; - return i || (i = t.zui && t.zui.getLangData ? n[e] = t.zui.getLangData("datetimepicker", this.language, n) : n.en), i - }, a = { - modes: [{clsName: "minutes", navFnc: "Hours", navStep: 1}, { - clsName: "hours", - navFnc: "Date", - navStep: 1 - }, {clsName: "days", navFnc: "Month", navStep: 1}, { - clsName: "months", - navFnc: "FullYear", - navStep: 1 - }, {clsName: "years", navFnc: "FullYear", navStep: 10}], - isLeapYear: function (t) { - return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0 - }, - getDaysInMonth: function (t, e) { - return [31, a.isLeapYear(t) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][e] - }, - getDefaultFormat: function (t, e) { - if ("standard" == t) return "input" == e ? "yyyy-mm-dd hh:ii" : "yyyy-mm-dd hh:ii:ss"; - if ("php" == t) return "input" == e ? "Y-m-d H:i" : "Y-m-d H:i:s"; - throw new Error("Invalid format type.") - }, - validParts: function (t) { - if ("standard" == t) return /hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g; - if ("php" == t) return /[dDjlNwzFmMnStyYaABgGhHis]/g; - throw new Error("Invalid format type.") - }, - nonpunctuation: /[^ -\/:-@\[-`{-~\t\n\rTZ]+/g, - parseFormat: function (t, e) { - var i = t.replace(this.validParts(e), "\0").split("\0"), n = t.match(this.validParts(e)); - if (!i || !i.length || !n || 0 == n.length) throw new Error("Invalid date format."); - return {separators: i, parts: n} - }, - parseDate: function (n, a, s, r) { - if (n instanceof Date) { - var l = new Date(n.valueOf() - 6e4 * n.getTimezoneOffset()); - return l.setMilliseconds(0), l - } - if (/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n) && (a = this.parseFormat("yyyy-mm-dd", r)), /^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(n) && (a = this.parseFormat("yyyy-mm-dd hh:ii", r)), /^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(n) && (a = this.parseFormat("yyyy-mm-dd hh:ii:ss", r)), /^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(n)) { - var h, c, d = /([-+]\d+)([dmwy])/, u = n.match(/([-+]\d+)([dmwy])/g); - n = new Date; - for (var f = 0; f < u.length; f++) switch (h = d.exec(u[f]), c = parseInt(h[1]), h[2]) { - case"d": - n.setUTCDate(n.getUTCDate() + c); - break; - case"m": - n = i.prototype.moveMonth.call(i.prototype, n, c); - break; - case"w": - n.setUTCDate(n.getUTCDate() + 7 * c); - break; - case"y": - n = i.prototype.moveYear.call(i.prototype, n, c) - } - return e(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds(), 0) - } - var p, g, h, u = n && n.match(this.nonpunctuation) || [], n = new Date(0, 0, 0, 0, 0, 0, 0), m = {}, - v = ["hh", "h", "ii", "i", "ss", "s", "yyyy", "yy", "M", "MM", "m", "mm", "D", "DD", "d", "dd", "H", "HH", "p", "P"], - y = { - hh: function (t, e) { - return t.setUTCHours(e) - }, h: function (t, e) { - return t.setUTCHours(e) - }, HH: function (t, e) { - return t.setUTCHours(12 == e ? 0 : e) - }, H: function (t, e) { - return t.setUTCHours(12 == e ? 0 : e) - }, ii: function (t, e) { - return t.setUTCMinutes(e) - }, i: function (t, e) { - return t.setUTCMinutes(e) - }, ss: function (t, e) { - return t.setUTCSeconds(e) - }, s: function (t, e) { - return t.setUTCSeconds(e) - }, yyyy: function (t, e) { - return t.setUTCFullYear(e) - }, yy: function (t, e) { - return t.setUTCFullYear(2e3 + e) - }, m: function (t, e) { - for (e -= 1; e < 0;) e += 12; - for (e %= 12, t.setUTCMonth(e); t.getUTCMonth() != e;) t.setUTCDate(t.getUTCDate() - 1); - return t - }, d: function (t, e) { - return t.setUTCDate(e) - }, p: function (t, e) { - return t.setUTCHours(1 == e ? t.getUTCHours() + 12 : t.getUTCHours()) - } - }; - if (y.M = y.MM = y.mm = y.m, y.dd = y.d, y.P = y.p, n = e(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds()), u.length == a.parts.length) { - for (var f = 0, b = a.parts.length; f < b; f++) { - if (p = parseInt(u[f], 10), h = a.parts[f], isNaN(p)) switch (h) { - case"MM": - g = t(o(s).months).filter(function () { - var t = this.slice(0, u[f].length), e = u[f].slice(0, t.length); - return t == e - }), p = t.inArray(g[0], o(s).months) + 1; - break; - case"M": - g = t(o(s).monthsShort).filter(function () { - var t = this.slice(0, u[f].length), e = u[f].slice(0, t.length); - return t == e - }), p = t.inArray(g[0], o(s).monthsShort) + 1; - break; - case"p": - case"P": - p = t.inArray(u[f].toLowerCase(), o(s).meridiem) - } - m[h] = p - } - for (var w, f = 0; f < v.length; f++) w = v[f], w in m && !isNaN(m[w]) && y[w](n, m[w]) - } - return n - }, - formatDate: function (e, i, n, s) { - if (null == e) return ""; - var r; - if ("standard" == s) r = { - yy: e.getUTCFullYear().toString().substring(2), - yyyy: e.getUTCFullYear(), - m: e.getUTCMonth() + 1, - M: o(n).monthsShort[e.getUTCMonth()], - MM: o(n).months[e.getUTCMonth()], - d: e.getUTCDate(), - D: o(n).daysShort[e.getUTCDay()], - DD: o(n).days[e.getUTCDay()], - p: 2 == o(n).meridiem.length ? o(n).meridiem[e.getUTCHours() < 12 ? 0 : 1] : "", - h: e.getUTCHours(), - i: e.getUTCMinutes(), - s: e.getUTCSeconds() - }, 2 == o(n).meridiem.length ? r.H = r.h % 12 == 0 ? 12 : r.h % 12 : r.H = r.h, r.HH = (r.H < 10 ? "0" : "") + r.H, r.P = r.p.toUpperCase(), r.hh = (r.h < 10 ? "0" : "") + r.h, r.ii = (r.i < 10 ? "0" : "") + r.i, r.ss = (r.s < 10 ? "0" : "") + r.s, r.dd = (r.d < 10 ? "0" : "") + r.d, r.mm = (r.m < 10 ? "0" : "") + r.m; else { - if ("php" != s) throw new Error("Invalid format type."); - r = { - y: e.getUTCFullYear().toString().substring(2), - Y: e.getUTCFullYear(), - F: o(n).months[e.getUTCMonth()], - M: o(n).monthsShort[e.getUTCMonth()], - n: e.getUTCMonth() + 1, - t: a.getDaysInMonth(e.getUTCFullYear(), e.getUTCMonth()), - j: e.getUTCDate(), - l: o(n).days[e.getUTCDay()], - D: o(n).daysShort[e.getUTCDay()], - w: e.getUTCDay(), - N: 0 == e.getUTCDay() ? 7 : e.getUTCDay(), - S: e.getUTCDate() % 10 <= o(n).suffix.length ? o(n).suffix[e.getUTCDate() % 10 - 1] : "", - a: 2 == o(n).meridiem.length ? o(n).meridiem[e.getUTCHours() < 12 ? 0 : 1] : "", - g: e.getUTCHours() % 12 == 0 ? 12 : e.getUTCHours() % 12, - G: e.getUTCHours(), - i: e.getUTCMinutes(), - s: e.getUTCSeconds() - }, r.m = (r.n < 10 ? "0" : "") + r.n, r.d = (r.j < 10 ? "0" : "") + r.j, r.A = r.a.toString().toUpperCase(), r.h = (r.g < 10 ? "0" : "") + r.g, r.H = (r.G < 10 ? "0" : "") + r.G, r.i = (r.i < 10 ? "0" : "") + r.i, r.s = (r.s < 10 ? "0" : "") + r.s - } - for (var e = [], l = t.extend([], i.separators), h = 0, c = i.parts.length; h < c; h++) l.length && e.push(l.shift()), e.push(r[i.parts[h]]); - return l.length && e.push(l.shift()), e.join("") - }, - convertViewMode: function (t) { - switch (t) { - case 4: - case"decade": - t = 4; - break; - case 3: - case"year": - t = 3; - break; - case 2: - case"month": - t = 2; - break; - case 1: - case"day": - t = 1; - break; - case 0: - case"hour": - t = 0 - } - return t - }, - headTemplate: '', - contTemplate: '', - footTemplate: '' - }; - a.template = '
kanban->WIPStatus;?> @@ -37,6 +38,7 @@
kanban->WIPCount;?> From b6f3608ab4fdf304bcc7cbe997c0a0f6d29f1629 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 26 Oct 2021 15:38:00 +0800 Subject: [PATCH 026/443] * change kanban page width to full size. --- module/execution/css/kanbandemo.css | 7 +++++-- module/execution/js/kanbandemo.js | 15 ++++++++++++++- module/execution/view/kanbandemo.html.php | 6 ++---- www/js/zui/kanban/min.css | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/module/execution/css/kanbandemo.css b/module/execution/css/kanbandemo.css index 1b0dbba8ca..ea21b9413e 100644 --- a/module/execution/css/kanbandemo.css +++ b/module/execution/css/kanbandemo.css @@ -1,6 +1,9 @@ -#main > .container {max-width: none!important; padding: 0 15px} +#header {position: fixed; top: 0; left: 0; right: 0; z-index: 10;} +#mainMenu {position: fixed; padding: 10px 15px; top: 60px; left: 0; right: 0; background-color: #efefef; z-index: 0;} +#main {padding-bottom: 0; padding-top: 50px;} +#main > .container {max-width: none!important; padding: 0} +#kanbanContainer {border-radius: 0; margin: 48px 0 0 0;} -.kanban {overflow-x: auto} .kanban + .kanban {margin-top: 15px} .kanban-item > .title { display: block;white-space: nowrap; overflow: hidden; text-overflow: ellipsis} .kanban-item > .infos {position: relative; margin-top: 5px} diff --git a/module/execution/js/kanbandemo.js b/module/execution/js/kanbandemo.js index 144e65475f..cd000d210b 100644 --- a/module/execution/js/kanbandemo.js +++ b/module/execution/js/kanbandemo.js @@ -524,6 +524,19 @@ function createKanban(kanbanID, data, options) $kanban.kanban($.extend({data: data}, options)); } +$.extend($.fn.kanban.Constructor.DEFAULTS, +{ + onRender: function() + { + var maxWidth = 0; + $('#kanbans .kanban-board').each(function() + { + maxWidth = Math.max(maxWidth, $(this).outerWidth()); + }); + $('#kanbanContainer').css('min-width', maxWidth + 40); + } +}); + /* Example code: */ $(function() { @@ -532,7 +545,7 @@ $(function() { maxColHeight: 'auto', minColWidth: 240, - dropable: true, + droppable: true, showCount: true, showZeroCount: true, countRender: renderColumnCount diff --git a/module/execution/view/kanbandemo.html.php b/module/execution/view/kanbandemo.html.php index c6b8d5f50e..3c2f69dc3a 100644 --- a/module/execution/view/kanbandemo.html.php +++ b/module/execution/view/kanbandemo.html.php @@ -48,13 +48,11 @@ -
+
Section
-
-
-
+
diff --git a/www/js/zui/kanban/min.css b/www/js/zui/kanban/min.css index 5acc352c6b..530c038cd1 100644 --- a/www/js/zui/kanban/min.css +++ b/www/js/zui/kanban/min.css @@ -3,4 +3,4 @@ * http://openzui.com * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT - */.kanban{min-height:300px;overflow-x:auto}.kanban-header,.kanban-lane,.kanban-sub-lane{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;flex-direction:row;background-color:#f1f3f5;border-bottom:2px solid #fff;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.kanban-header{padding-left:20px;background-color:rgba(0,0,0,.07)}.kanban-no-lane-name .kanban-header{padding-left:0}.kanban-col{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.not-use-flex .kanban-col{-webkit-box-flex:0;-webkit-flex:none;-ms-flex:none;flex:none}.no-flex .kanban-col{float:left}.kanban-col+.kanban-col{border-left:2px solid #fff}.kanban-header-col{position:relative;height:32px}.kanban-header-col>.title{display:block;height:32px;margin:0 32px;line-height:32px;text-align:center}.kanban-header-col>.title>.text{display:inline-block;max-width:100px;margin:0 5px;overflow:hidden;text-overflow:'';white-space:nowrap}.kanban-header-col>.title>.count,.kanban-header-col>.title>.icon{position:relative;top:-12px}.kanban-header-col>.title>.count{color:#8b91a2}.kanban-header-col[data-id=ADD]>.title{margin:6px;opacity:.7}.kanban-header-col[data-id=ADD]>.actions{display:none}.kanban-header-col>.actions{position:absolute;top:0;right:0}.kanban-header-col>.actions>.btn{min-width:32px}.kanban-header-col>.actions>.btn>.icon{opacity:.5}.kanban-header-has-parent>.kanban-header-col{height:64px;padding:16px 0}.kanban-header-parent-col{padding:0!important}.kanban-header-parent-col>.kanban-header-col{height:32px;padding:0}.kanban-header-sub-cols{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-top:-1px;margin-left:-2px;flex-direction:row;border-top:2px solid #fff;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row}.kanban-header-sub-cols>.kanban-col{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.no-flex .kanban-header-sub-cols{display:table;table-layout:fixed}.no-flex .kanban-header-sub-cols>.kanban-col{width:50%}.kanban-lane{min-height:100px}.kanban-lane+.kanban-lane{margin-top:3px}.no-flex .kanban-lane{position:relative;padding-left:20px}.kanban-lane-name{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:20px;overflow:hidden;color:#fff;text-align:center;background-color:#3dc6fd;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:0;-webkit-flex:none;-ms-flex:none;flex:none}.kanban-lane-name>.text{position:absolute;top:5px;right:1px;bottom:5px;display:block;overflow:hidden;line-height:20px;text-align:center;white-space:normal;-webkit-writing-mode:tb-rl;-ms-writing-mode:tb-rl;writing-mode:tb-rl;-webkit-writing-mode:vertical-rl;writing-mode:vertical-rl}.no-flex .kanban-lane-name{position:absolute;top:0;bottom:0;left:0}.kanban-header+.kanban-lane>.kanban-lane-name{margin-top:-33px}.kanban-header.kanban-header-has-parent+.kanban-lane>.kanban-lane-name{margin-top:-65px}.kanban-sub-lanes{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-direction:column;-webkit-box-flex:1;-webkit-flex:auto;-ms-flex:auto;flex:auto;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:stretch;-webkit-justify-content:stretch;-ms-flex-pack:stretch;justify-content:stretch;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column}.kanban-sub-lanes.no-sub-lane{background-color:#f1f3f5}.kanban-sub-lane{-webkit-box-flex:1;-webkit-flex:auto;-ms-flex:auto;flex:auto}.kanban-lane-col.drop-to{outline:3px solid rgba(255,190,57,.25);outline-offset:-3px}.kanban-lane-col.drop-to .kanban-lane-actions>.btn{background-color:rgba(255,190,57,.25);border:1px dotted #ff9800}.kanban-lane-col.drop-to .kanban-lane-actions>.btn>span{opacity:0}.kanban-lane-col[data-type=EMPTY]{background-color:#fff}.kanban-lane-items{max-height:300px;padding:0 10px 10px;overflow:auto}.kanban-size-inited .kanban-lane-items{max-height:100%!important}.kanban-lane-actions{padding:10px 15px}.kanban-item{padding:10px;margin-top:10px;background:#fff;border:1px solid #fff;border-radius:4px;-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);-webkit-transition:-webkit-box-shadow .2s,-webkit-transform .2s;-o-transition:box-shadow .2s,-o-transform .2s;transition:-webkit-box-shadow .2s,-webkit-transform .2s;transition:box-shadow .2s,transform .2s;transition:box-shadow .2s,transform .2s,-webkit-box-shadow .2s,-webkit-transform .2s,-o-transform .2s}.kanban-item.drag-from{background-color:#aaa;opacity:.2}.kanban-item:hover{border-color:rgba(0,0,0,.1);-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.09);box-shadow:0 4px 10px 0 rgba(0,0,0,.09)}.kanban-item.drag-shadow{border-color:rgba(0,0,0,.2);-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.09),0 4px 20px 0 rgba(0,0,0,.5);box-shadow:0 4px 10px 0 rgba(0,0,0,.09),0 4px 20px 0 rgba(0,0,0,.5);-webkit-transform:scale(1.1);-ms-transform:scale(1.1);-o-transform:scale(1.1);transform:scale(1.1)} \ No newline at end of file + */.kanban{min-height:300px}.kanban-header,.kanban-lane,.kanban-sub-lane{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;flex-direction:row;background-color:#f1f3f5;border-bottom:2px solid #fff;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.kanban-header{padding-left:20px;background-color:rgba(0,0,0,.07)}.kanban-no-lane-name .kanban-header{padding-left:0}.kanban-col{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.not-use-flex .kanban-col{-webkit-box-flex:0;-webkit-flex:none;-ms-flex:none;flex:none}.no-flex .kanban-col{float:left}.kanban-col+.kanban-col{border-left:2px solid #fff}.kanban-header-col{position:relative;height:32px}.kanban-header-col>.title{display:block;height:32px;margin:0 32px;line-height:32px;text-align:center}.kanban-header-col>.title>.text{display:inline-block;max-width:100px;margin:0 5px;overflow:hidden;text-overflow:'';white-space:nowrap}.kanban-header-col>.title>.count,.kanban-header-col>.title>.icon{position:relative;top:-12px}.kanban-header-col>.title>.count{color:#8b91a2}.kanban-header-col[data-id=ADD]>.title{margin:6px;opacity:.7}.kanban-header-col[data-id=ADD]>.actions{display:none}.kanban-header-col>.actions{position:absolute;top:0;right:0}.kanban-header-col>.actions>.btn{min-width:32px}.kanban-header-col>.actions>.btn>.icon{opacity:.5}.kanban-header-has-parent>.kanban-header-col{height:64px;padding:16px 0}.kanban-header-parent-col{padding:0!important}.kanban-header-parent-col>.kanban-header-col{height:32px;padding:0}.kanban-header-sub-cols{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-top:-1px;margin-left:-2px;flex-direction:row;border-top:2px solid #fff;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row}.kanban-header-sub-cols>.kanban-col{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.no-flex .kanban-header-sub-cols{display:table;table-layout:fixed}.no-flex .kanban-header-sub-cols>.kanban-col{width:50%}.kanban-lane{min-height:100px}.kanban-lane+.kanban-lane{margin-top:3px}.no-flex .kanban-lane{position:relative;padding-left:20px}.kanban-lane-name{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:20px;overflow:hidden;color:#fff;text-align:center;background-color:#3dc6fd;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-flex:0;-webkit-flex:none;-ms-flex:none;flex:none}.kanban-lane-name>.text{position:absolute;top:5px;right:1px;bottom:5px;display:block;overflow:hidden;line-height:20px;text-align:center;white-space:normal;-webkit-writing-mode:tb-rl;-ms-writing-mode:tb-rl;writing-mode:tb-rl;-webkit-writing-mode:vertical-rl;writing-mode:vertical-rl}.no-flex .kanban-lane-name{position:absolute;top:0;bottom:0;left:0}.kanban-header+.kanban-lane>.kanban-lane-name{margin-top:-33px}.kanban-header.kanban-header-has-parent+.kanban-lane>.kanban-lane-name{margin-top:-65px}.kanban-sub-lanes{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;flex-direction:column;-webkit-box-flex:1;-webkit-flex:auto;-ms-flex:auto;flex:auto;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:stretch;-webkit-justify-content:stretch;-ms-flex-pack:stretch;justify-content:stretch;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column}.kanban-sub-lanes.no-sub-lane{background-color:#f1f3f5}.kanban-sub-lane{-webkit-box-flex:1;-webkit-flex:auto;-ms-flex:auto;flex:auto}.kanban-lane-col.drop-to{outline:3px solid rgba(255,190,57,.25);outline-offset:-3px}.kanban-lane-col.drop-to .kanban-lane-actions>.btn{background-color:rgba(255,190,57,.25);border:1px dotted #ff9800}.kanban-lane-col.drop-to .kanban-lane-actions>.btn>span{opacity:0}.kanban-lane-col[data-type=EMPTY]{background-color:#fff}.kanban-lane-items{max-height:300px;padding:0 10px 10px;overflow:auto}.kanban-size-inited .kanban-lane-items{max-height:100%!important}.kanban-lane-actions{padding:10px 15px}.kanban-item{padding:10px;margin-top:10px;background:#fff;border:1px solid #fff;border-radius:4px;-webkit-box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);box-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06);-webkit-transition:-webkit-box-shadow .2s,-webkit-transform .2s;-o-transition:box-shadow .2s,-o-transform .2s;transition:-webkit-box-shadow .2s,-webkit-transform .2s;transition:box-shadow .2s,transform .2s;transition:box-shadow .2s,transform .2s,-webkit-box-shadow .2s,-webkit-transform .2s,-o-transform .2s}.kanban-item.drag-from{background-color:#aaa;opacity:.2}.kanban-item:hover{border-color:rgba(0,0,0,.1);-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.09);box-shadow:0 4px 10px 0 rgba(0,0,0,.09)}.kanban-item.drag-shadow{border-color:rgba(0,0,0,.2);-webkit-box-shadow:0 4px 10px 0 rgba(0,0,0,.09),0 4px 20px 0 rgba(0,0,0,.5);box-shadow:0 4px 10px 0 rgba(0,0,0,.09),0 4px 20px 0 rgba(0,0,0,.5);-webkit-transform:scale(1.1);-ms-transform:scale(1.1);-o-transform:scale(1.1);transform:scale(1.1)} \ No newline at end of file From 0063ed7950a9a0097631b3dc13c0876c91f1b53e Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 26 Oct 2021 15:47:50 +0800 Subject: [PATCH 027/443] * replace kanban with kanbandemo. --- module/execution/control.php | 52 -- module/execution/css/kanban.css | 79 +-- module/execution/css/kanbandemo.css | 18 - module/execution/js/kanban.js | 791 +++++++++++++++------- module/execution/js/kanbandemo.js | 562 --------------- module/execution/view/kanban.html.php | 193 +----- module/execution/view/kanbandemo.html.php | 59 -- 7 files changed, 575 insertions(+), 1179 deletions(-) delete mode 100644 module/execution/css/kanbandemo.css delete mode 100644 module/execution/js/kanbandemo.js delete mode 100644 module/execution/view/kanbandemo.html.php diff --git a/module/execution/control.php b/module/execution/control.php index d4ae5a32f5..11c7079776 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1876,58 +1876,6 @@ class execution extends control $this->display(); } - /** - * Kanban demo page. - * - * @param int $executionID - * @param string $type - * @param string $orderBy - * @access public - * @return void - */ - public function kanbandemo($executionID, $type = 'story', $orderBy = 'order_asc') - { - /* Save to session. */ - $uri = $this->app->getURI(true); - $this->app->session->set('taskList', $uri, 'execution'); - $this->app->session->set('bugList', $uri, 'qa'); - - /* Compatibility IE8*/ - if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7"); - - $this->execution->setMenu($executionID); - $execution = $this->loadModel('execution')->getById($executionID); - $tasks = $this->execution->getKanbanTasks($executionID, "id"); - $bugs = $this->loadModel('bug')->getExecutionBugs($executionID); - $stories = $this->loadModel('story')->getExecutionStories($executionID, 0, 0, $orderBy); - - /* Determines whether an object is editable. */ - $canBeChanged = common::canModify('execution', $execution); - - $kanbanGroup = $this->execution->getKanbanGroupData($stories, $tasks, $bugs, $type); - $kanbanSetting = $this->execution->getKanbanSetting(); - - $this->view->title = $this->lang->execution->kanban; - $this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name); - $this->view->position[] = $this->lang->execution->kanban; - $this->view->stories = $stories; - $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); - $this->view->storyOrder = $orderBy; - $this->view->orderBy = 'id_asc'; - $this->view->executionID = $executionID; - $this->view->browseType = ''; - $this->view->execution = $execution; - $this->view->type = $type; - $this->view->kanbanGroup = $kanbanGroup; - $this->view->kanbanColumns = $this->execution->getKanbanColumns($kanbanSetting); - $this->view->statusMap = $canBeChanged ? $this->execution->getKanbanStatusMap($kanbanSetting) : array(); - $this->view->statusList = $this->execution->getKanbanStatusList($kanbanSetting); - $this->view->colorList = $this->execution->getKanbanColorList($kanbanSetting); - $this->view->canBeChanged = $canBeChanged; - - $this->display(); - } - /** * Execution kanban. * diff --git a/module/execution/css/kanban.css b/module/execution/css/kanban.css index a00e56c37d..ea21b9413e 100644 --- a/module/execution/css/kanban.css +++ b/module/execution/css/kanban.css @@ -1,65 +1,18 @@ -.boards {display: table; table-layout: fixed; width: auto; min-height: 50px; min-width: 140px;} -.boards .board:not(:last-child) {border-right: 1px solid #ddd;} -.board {display: table-cell; width: 16.666666667%; padding: 10px; border: 1px solid transparent; transition: background-color .2s, opacity .2s; vertical-align: top;} -.board-item {border: 1px solid #EBEBEB; padding: 5px 10px; cursor: move; border-radius: 2px; background-color: #fff; transition: border .2s, opacity .2s; overflow: hidden;} -.board-item.disabled {cursor: not-allowed;} -.board-item:hover {border-color: #ccc;} -.board-item > .title {line-height: 20px; max-height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-all;} -.board-item > .info {line-height: 22px; margin-top: 6px;} -.board-item + .board-item {margin-top: 10px;} -.board-item .task-left {float: right; font-size: 12px; color: #a6aab8;} -.boards-wrapper {overflow: auto;} -.board.can-drop-in {background-color: #fff !important; opacity: 1 !important;} -.c-board.dragging {color: #006af1;} -.board.drop-to {background-color: #fff0d5 !important;} -.board-drag-holder {background: #ccc; background: rgba(0, 0, 0, .1); border-radius: 2px; border: 1px solid rgba(0,0,0,.05); display: none;} -.board.drop-to .board-drag-holder {display: block;} -.board-item + .board-drag-holder {margin-top: 10px;} -.board-item.dragging {opacity: .35;} -.board-item .btn {padding: 2px 10px 2px 23px; font-size: 12px; position: relative; left: -2px; height: 24px;} -.board-item .btn-icon-left > .icon {width: 22px; height: 22px; line-height: 20px; font-size: 14px; opacity: 1; top: 1px;} -.board-item .btn-icon-left > span {max-width: 80px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;} -.board-title {padding-right: 20px;} -.board-actions {position: absolute; right: 3px; top: 3px;} -.board-actions.nav > li > a {padding: 3px 3px;} +#header {position: fixed; top: 0; left: 0; right: 0; z-index: 10;} +#mainMenu {position: fixed; padding: 10px 15px; top: 60px; left: 0; right: 0; background-color: #efefef; z-index: 0;} +#main {padding-bottom: 0; padding-top: 50px;} +#main > .container {max-width: none!important; padding: 0} +#kanbanContainer {border-radius: 0; margin: 48px 0 0 0;} -#kanban {overflow-y: auto; min-height: 350px;} -#kanban > .table {min-width: 1100px; table-layout: auto;} -#kanban.dragging .boards.dragging .board {background: #eee; opacity: .35; border-color: #f1f1f1;} -#kanban thead > tr > th {padding-left: 0; padding-right: 0;} -#kanban thead .c-side {padding: 5px; max-width: 15%; min-width: 200px;} -#kanban .label-pri {width: 16px; height: 16px; line-height: 12px; min-width: 16px; font-size: 12px; padding: 0;} -#kanban tbody > tr > td {line-height: 24px;} -#kanban .c-board {border-bottom: 4px #EAF3FC solid; min-width: 140px;} -#kanban .c-board.s-wait {border-color: #7EC5FF;} -#kanban .c-board.s-doing {border-color: #0991FF;} -#kanban .c-board.s-pause {border-color: #fdc137;} -#kanban .c-board.s-done {border-color: #0BD986;} -#kanban .c-board.s-cancel {border-color: #CBD0DB;} -#kanban .c-board.s-closed {border-color: #838A9D;} -#kanban .table-grouped tbody > tr:hover {background: transparent;} -#kanban .c-boards, #kanban td.c-side {border-bottom: 1px solid #eee;} -#kanban .group-info > span + span {display: inline-block; margin-left: 8px;} -#kanban th.c-board {color: #3c4353; font-weight: bold;} -#kanban .fix-table-copy-wrapper {overflow: visible !important;} -#kanban .fix-table-copy-wrapper th.c-board {color: #eee;} -#kanban .fix-table-copy-wrapper th.c-board .btn-link {color: #fff;} -#kanban .group-title {word-break: break-all; line-height: 16px; padding: 3px 0; display: block;} +.kanban + .kanban {margin-top: 15px} +.kanban-item > .title { display: block;white-space: nowrap; overflow: hidden; text-overflow: ellipsis} +.kanban-item > .infos {position: relative; margin-top: 5px} +.kanban-item > .infos > .info + .info {margin-left: 10px} +.kanban-item > .infos > .info-id, +.kanban-item > .infos > .info-estimate {font-size: 12px; position: relative; top: 2px} +.kanban-item > .infos > .label-pri {min-width: 16px; line-height: 14px; height: 16px; padding: 0} +.kanban-item > .infos > .label-severity {transform: scale(.75)} +.kanban-item > .infos > .avatar {position: absolute; right: 0; top: 0} -.table-grouped > tbody > tr, -.table-grouped > tbody > tr:hover {background: #fff !important;} - -.fixedSide {position: fixed; background-color: rgb(75, 75, 75, .85); color: #eee; z-index: 999;} -.fixedSide .dropdown-menu {background-color: rgb(75, 75, 75, .85);} -.fixedSide .dropdown-menu > li > a {color: #eee;} -.fixedSide .btn-link, .fixedSide a , .fixedSide .text-muted {color: #eee;} -.fixedSide .c-board {border-bottom: 4px #EAF3FC solid; min-width: 140px;} -.fixedSide th.c-board {color: #3c4353; font-weight: bold;} -.fixedSide td.c-side {border-bottom: 1px solid #eee;} -.fixedSide thead .c-side {padding: 5px !important; max-width: 15%; min-width: 200px;} -.fixedSide thead > tr > th {padding-left: 0; padding-right: 0;} -.fixedSide tbody > tr > td {line-height: 24px;} -.fixedSide thead > tr > th, .fixedSide tbody > tr > td {min-height: 36px; padding: 2px 8px !important;} -.fixedSide .group-title {word-break: break-all; line-height: 16px; padding: 3px 0; display: block;} -.fixedSide .group-info > span + span {display: inline-block; margin-left: 8px;} -.fixedSide .label-pri {width: 16px; height: 16px; line-height: 12px; min-width: 16px; font-size: 12px; padding: 0;} +.kanban-affixed .kanban-header-col > .title > .text, +.kanban-affixed .kanban-header-col > .title > .count {color: #fff!important;} diff --git a/module/execution/css/kanbandemo.css b/module/execution/css/kanbandemo.css deleted file mode 100644 index ea21b9413e..0000000000 --- a/module/execution/css/kanbandemo.css +++ /dev/null @@ -1,18 +0,0 @@ -#header {position: fixed; top: 0; left: 0; right: 0; z-index: 10;} -#mainMenu {position: fixed; padding: 10px 15px; top: 60px; left: 0; right: 0; background-color: #efefef; z-index: 0;} -#main {padding-bottom: 0; padding-top: 50px;} -#main > .container {max-width: none!important; padding: 0} -#kanbanContainer {border-radius: 0; margin: 48px 0 0 0;} - -.kanban + .kanban {margin-top: 15px} -.kanban-item > .title { display: block;white-space: nowrap; overflow: hidden; text-overflow: ellipsis} -.kanban-item > .infos {position: relative; margin-top: 5px} -.kanban-item > .infos > .info + .info {margin-left: 10px} -.kanban-item > .infos > .info-id, -.kanban-item > .infos > .info-estimate {font-size: 12px; position: relative; top: 2px} -.kanban-item > .infos > .label-pri {min-width: 16px; line-height: 14px; height: 16px; padding: 0} -.kanban-item > .infos > .label-severity {transform: scale(.75)} -.kanban-item > .infos > .avatar {position: absolute; right: 0; top: 0} - -.kanban-affixed .kanban-header-col > .title > .text, -.kanban-affixed .kanban-header-col > .title > .count {color: #fff!important;} diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 001ec4c5df..cd000d210b 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -1,253 +1,562 @@ -$(function() +/** + * Get story demo kanban data + * 获取“软件需求”看板演示数据 + * @returns {Object} Kanban data + * @todo 该方法作为演示,应该在最终版本中移除 + */ +function getStoryKanbanDemoData() { - var isFirefox = $.zui.browser.firefox; - var adjustBoardsHeight = function() + /* Define kanban columns 定义看板列 */ + var columns = + [ + /* 看板列定义数据结构: + id: 列 ID(确保在页面上唯一), + type: 类型, + name: 显示的名称, + color: 列名称颜色, + parentType: 所属的父级列类型 + asParent: 是否作为父级列 + itemType: 看板条目类型,例如:'story'(需求) + maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ + {id: 'story-blacklog', type: 'blacklog', name: 'Blacklog', color: '', maxCount: 0}, + {id: 'story-ready', type: 'ready', name: '准备好', color: '', maxCount: 4}, + {id: 'story-dev', type: 'dev', name: '开发', color: '', maxCount: 4, asParent: true}, + {id: 'story-dev-doing', type: 'dev-doing', name: '进行中', color: '#126eed', maxCount: 2, parentType: 'dev'}, + {id: 'story-dev-done', type: 'dev-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'dev'}, + {id: 'story-test', type: 'test', name: '测试', color: '', maxCount: 4, asParent: true}, + {id: 'story-test-doing', type: 'test-doing', name: '进行中', color: '#126eed', maxCount: 2, parentType: 'test'}, + {id: 'story-test-done', type: 'test-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'test'}, + {id: 'story-accepted', type: 'accepted', name: '已验收', color: '', maxCount: 0}, + {id: 'story-published', type: 'published', name: '已发布', color: '', maxCount: 0}, + ]; + + /* Define items in blacklog column 定义 Blacklog 列上的条目 */ + var blacklogColItems = + [ + /* 需求数据结构: + id: ID,通常为需求 ID, + title: 名称, + order: 显示顺序,如果指定为 0,则按 ID 倒序排序, + pri: 优先级, + estimate: 预估时间, + assignedTo: 指派给, + deadline: 截止日期 */ + {id: 10010, title: '第一条 Blacklog', order: 1, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10011, title: '文档模块的实现', order: 2, pri: 2, estimate: 0, assignedTo: 'sunhao'}, + {id: 10012, title: '实现软件需求看板视图中不同分组条件的看板展示方式', order: 3, pri: 3, estimate: 10, assignedTo: 'admin'}, + {id: 10013, title: 'Blacklog 3', order: 4, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + {id: 10014, title: '实现泳道的更多操作菜单', order: 5, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + ]; + /* Define items in ready column 定义 准备好 列上的条目 */ + var readyColItems = + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10020, title: '在看板列中实现创建任务功能', order: 10, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10021, title: '实现泳道的上下移动', order: 11, pri: 2, estimate: 0, assignedTo: 'sunhao'}, + {id: 10024, title: '实现泳道的更多操作菜单', order: 15, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + ]; + var devDoingColItems = /* Define items in dev/doing column 定义 开发/进行中 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10030, title: '实现看板的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10031, title: '实现卡片拖动效果功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var devDoneColItems = /* Define items in dev/done column 定义 开发/完成 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10040, title: '实现看板列卡片排序功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var testDoingColItems = /* Define items in test/doing column 定义 测试/进行中 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10050, title: '实现看板列的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10051, title: '实现Bug卡片的更多操作功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var testDoneColItems = /* Define items in test/done column 定义 测试/完成 列上的条目 */ + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10060, title: '实现任务卡片的更多操作功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var acceptedColItems = + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10070, title: '实现执行看板的新建按钮组功能', order: 10, pri: 3, estimate: 12, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10071, title: '在看板列中实现提交Bug功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + {id: 10072, title: '在看板列中实现需求的添加和关联功能', order: 10, pri: 3, estimate: 10, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10073, title: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var publishedColItems = + [ + /* 需求数据结构参见 blacklogColItems 定义 */ + {id: 10080, title: '实现任务看板视图中泳道分组下拉菜单功能', order: 10, pri: 3, estimate: 2, assignedTo: 'admin'}, + ]; + + /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ + var items = { - var $cBoards = $('.c-boards'); - var viewHeight = $(window).height() - $('#header').height() - $('#footer').height() - 111; - if ($cBoards.length === 1) - { - var $boardsWrapper = $cBoards.find('.boards-wrapper'); - $boardsWrapper.css('min-height', viewHeight); - if($boardsWrapper.height() > $boardsWrapper.find('.boards').height()) - { - $boardsWrapper.find('.boards').css(isFirefox ? 'height' : 'min-height', $boardsWrapper.height() - 1); - } - return - } + /* 看板列类型: 条目列表 */ + blacklog: blacklogColItems, + ready: readyColItems, + 'dev-doing': devDoingColItems, + 'dev-done': devDoneColItems, + 'test-doing': testDoingColItems, + 'test-done': testDoneColItems, + accepted: acceptedColItems, + published: publishedColItems, + }; - $cBoards.each(function() - { - var $theBoards = $(this); + /* Define kanban lanes 定义看板泳道 */ + var lanes = + [ + /* 泳道数据结构: + id: 泳道 ID,确保页面上唯一,可以为数字或字符串, + name: 名称, + items: 定义每列上的条目 + color: 泳道名称背景色 + defaultItemType: 看板泳道上的条目默认类型,例如:'story'(需求) */ + {id: 'story', name: '软件需求', items: items, color: '#3dc6fc', defaultItemType: 'story'}, + ] - var $boardsWrapper = $theBoards.find('.boards-wrapper'); - var minHeight = Math.min($theBoards.prev().find('.board-story').outerHeight() + 4, viewHeight); - $boardsWrapper.css({maxHeight: viewHeight, minHeight: minHeight}); - if($boardsWrapper.height() > $boardsWrapper.find('.boards').height()) - { - var $boards = $boardsWrapper.find('.boards'); - $boards.css({maxHeight: $theBoards.height(), minHeight: minHeight}); - if ($boards.outerHeight() < minHeight) $boards.css('height', minHeight); - } + /* Return kanban data 返回看板数据 */ + /* 看板数据结构: + id: ID,确保页面上唯一,可以为数字或字符串, + columns: 定义看板上的所有列, + lanes: 定义看板上的所有泳道 + defaultItemType: 看板上的条目默认类型,例如:'story'(需求) */ + return {id: 'story', columns: columns, lanes: lanes, defaultItemType: 'story'}; +} + +/** + * Get bug demo kanban data + * 获取“Bug”看板演示数据 + * @returns {Object} Kanban data + * @todo 该方法作为演示,应该在最终版本中移除 + */ +function getBugKanbanDemoData() +{ + /* Define kanban columns 定义看板列 */ + var columns = + [ + /* 看板列定义数据结构: + id: 列 ID(确保在页面上唯一), + type: 类型, + name: 显示的名称, + color: 列名称颜色, + parentType: 所属的父级列类型 + asParent: 是否作为父级列 + itemType: 看板条目类型,例如:'story'(需求) + maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ + {id: 'bug-wait', type: 'wait', name: '待确认', color: '', maxCount: 0}, + {id: 'bug-confirmed', type: 'confirmed', name: '已确认', color: '', maxCount: 4}, + {id: 'bug-resolving', type: 'resolving', name: '解决中', color: '', maxCount: 4, asParent: true}, + {id: 'bug-resolving-doing', type: 'resolving-doing',name: '进行中', color: '#126eed', maxCount: 2, parentType: 'resolving'}, + {id: 'bug-resolving-done', type: 'resolving-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'resolving'}, + {id: 'bug-test', type: 'test', name: '测试', color: '', maxCount: 4, asParent: true}, + {id: 'bug-test-doing', type: 'test-doing', name: '测试中', color: '#126eed', maxCount: 2, parentType: 'test'}, + {id: 'bug-test-done', type: 'test-done', name: '测试完毕', color: '#2fab8e', maxCount: 2, parentType: 'test'}, + {id: 'bug-closed', type: 'closed', name: '已关闭', color: '', maxCount: 0}, + ]; + + /* Define items in wait column 定义 待确认 列上的条目 */ + var waitColItems = + [ + /* bug 数据结构: + id: ID,通常为 Bug ID, + title: 名称, + order: 显示顺序,如果指定为 0,则按 ID 倒序排序, + pri: 优先级, + severity: 紧急程度, + assignedTo: 指派给 */ + {id: 10010, title: '在看板列中实现创建任务功能', order: 10, pri: 1, severity: 2, assignedTo: 'admin'}, + {id: 10011, title: '实现泳道的上下移动', order: 11, pri: 2, severity: 1, assignedTo: 'sunhao'}, + {id: 10014, title: '实现泳道的更多操作菜单', order: 15, pri: 0, severity: 1, assignedTo: 'sunhao'}, + ]; + /* Define items in confirmed column 定义 已确认 列上的条目 */ + var confirmedColItems = + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10020, title: '在看板列中实现创建任务功能', order: 10, pri: 1, severity: 2, assignedTo: 'admin'}, + {id: 10021, title: '实现泳道的上下移动', order: 11, pri: 2, severity: 1, assignedTo: 'sunhao'}, + {id: 10024, title: '实现泳道的更多操作菜单', order: 15, pri: 0, severity: 1, assignedTo: 'sunhao'}, + ]; + var resolvingDoingColItems = /* Define items in resolving/doing column 定义 开发/进行中 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10030, title: '实现看板的更多操作菜单', order: 10, pri: 3, severity: 1, assignedTo: 'admin'}, + {id: 10031, title: '实现卡片拖动效果功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + ]; + var resolvingDoneColItems = /* Define items in resolving/done column 定义 开发/完成 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10040, title: '实现看板列卡片排序功能', order: 10, pri: 1, severity: 4, assignedTo: 'admin'}, + ]; + var testDoingColItems = /* Define items in test/doing column 定义 测试/进行中 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10050, title: '实现看板列的更多操作菜单', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, + {id: 10051, title: '实现Bug卡片的更多操作功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + ]; + var testDoneColItems = /* Define items in test/done column 定义 测试/完成 列上的条目 */ + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10060, title: '实现任务卡片的更多操作功能', order: 10, pri: 1, severity: 4, assignedTo: 'admin'}, + ]; + var closedColItems = + [ + /* Bug 数据结构参见 waitColItems 定义 */ + {id: 10070, title: '实现执行看板的新建按钮组功能', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, + {id: 10071, title: '在看板列中实现提交Bug功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + {id: 10072, title: '在看板列中实现需求的添加和关联功能', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, + {id: 10073, title: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, + ]; + + /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ + var items = + { + /* 看板列类型: 条目列表 */ + wait: waitColItems, + confirmed: confirmedColItems, + 'resolving-doing': resolvingDoingColItems, + 'resolving-done': resolvingDoneColItems, + 'test-doing': testDoingColItems, + 'test-done': testDoneColItems, + closed: closedColItems, + }; + + /* Define kanban lanes 定义看板泳道 */ + var lanes = + [ + /* 泳道数据结构: + id: 泳道 ID,确保页面上唯一,可以为数字或字符串, + name: 名称, + items: 定义每列上的条目 + color: 泳道名称背景色 + defaultItemType: 看板泳道上的条目默认类型,例如:'bug'(Bug) */ + {id: 'bug', name: 'Bug', items: items, color: '#9c30b0', defaultItemType: 'bug'}, + ] + + /* Return kanban data 返回看板数据 */ + /* 看板数据结构: + id: ID,确保页面上唯一,可以为数字或字符串, + columns: 定义看板上的所有列, + lanes: 定义看板上的所有泳道 + defaultItemType: 看板上的条目默认类型,例如:'bug'(Bug) */ + return {id: 'bug', columns: columns, lanes: lanes, defaultItemType: 'bug'}; +} + +/** + * Get task demo kanban data + * 获取“任务”看板演示数据 + * @returns {Object} Kanban data + * @todo 该方法作为演示,应该在最终版本中移除 + */ +function getTaskKanbanDemoData() +{ + /* Define kanban columns 定义看板列 */ + var columns = + [ + /* 看板列定义数据结构: + id: 列 ID(确保在页面上唯一), + type: 类型, + name: 显示的名称, + color: 列名称颜色, + parentType: 所属的父级列类型 + asParent: 是否作为父级列 + itemType: 看板条目类型,例如:'task'(任务) + maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ + {id: 'task-wait', type: 'wait', name: '未开始', color: '', maxCount: 0}, + {id: 'task-dev', type: 'dev', name: '开发', color: '', maxCount: 4, asParent: true}, + {id: 'task-dev-doing', type: 'dev-doing', name: '研发中', color: '#126eed', maxCount: 2, parentType: 'dev'}, + {id: 'task-dev-done', type: 'dev-done', name: '研发完成', color: '#2fab8e', maxCount: 2, parentType: 'dev'}, + {id: 'task-pause', type: 'pause', name: '已暂停', color: '', maxCount: 0}, + {id: 'task-cancel', type: 'cancel', name: '已取消', color: '', maxCount: 0}, + {id: 'task-closed', type: 'closed', name: '已关闭', color: '', maxCount: 0}, + ]; + + /* Define items in wait column 定义 未开始 列上的条目 */ + var waitColItems = + [ + /* 任务数据结构: + id: ID,通常为任务 ID, + name: 名称, + order: 显示顺序,如果指定为 0,则按 ID 倒序排序, + pri: 优先级, + estimate: 预估时间, + assignedTo: 指派给, + deadline: 截止日期 */ + {id: 10020, name: '在看板列中实现创建任务功能', order: 10, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10021, name: '实现泳道的上下移动', order: 11, pri: 2, estimate: 0, assignedTo: 'sunhao', deadline: '2021-10-22'}, + {id: 10024, name: '实现泳道的更多操作菜单', order: 15, pri: 0, estimate: 0, assignedTo: 'sunhao'}, + ]; + var devDoingColItems = /* Define items in dev/doing column 定义 开发/进行中 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10030, name: '实现看板的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10031, name: '实现卡片拖动效果功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var devDoneColItems = /* Define items in dev/done column 定义 开发/完成 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10040, name: '实现看板列卡片排序功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var pauseColItems = /* Define items in pause column 定义 已暂停 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10050, name: '实现看板列的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10051, name: '实现Bug卡片的更多操作功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + var cancelColItems = /* Define items in cancel column 定义 已取消 列上的条目 */ + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10060, name: '实现任务卡片的更多操作功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, + ]; + var closedColItems = + [ + /* 任务数据结构参见 waitColItems 定义 */ + {id: 10070, name: '实现执行看板的新建按钮组功能', order: 10, pri: 3, estimate: 12, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10071, name: '在看板列中实现提交Bug功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + {id: 10072, name: '在看板列中实现任务的添加和关联功能', order: 10, pri: 3, estimate: 10, assignedTo: 'admin', deadline: '2021-10-30'}, + {id: 10073, name: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, + ]; + + /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ + var items = + { + /* 看板列类型: 条目列表 */ + wait: waitColItems, + 'dev-doing': devDoingColItems, + 'dev-done': devDoneColItems, + pause: pauseColItems, + cancel: cancelColItems, + closed: closedColItems, + }; + + /* Define kanban lanes 定义看板泳道 */ + var lanes = + [ + /* 泳道数据结构: + id: 泳道 ID,确保页面上唯一,可以为数字或字符串, + name: 名称, + items: 定义每列上的条目 + color: 泳道名称背景色 + defaultItemType: 看板泳道上的条目默认类型,例如:'task'(任务) */ + {id: 'task', name: '任务', items: items, color: '#126eed', defaultItemType: 'task'}, + ] + + /* Return kanban data 返回看板数据 */ + /* 看板数据结构: + id: ID,确保页面上唯一,可以为数字或字符串, + columns: 定义看板上的所有列, + lanes: 定义看板上的所有泳道 + defaultItemType: 看板上的条目默认类型,例如:'task'(任务) */ + return {id: 'task', columns: columns, lanes: lanes, defaultItemType: 'task'}; +} + + +/** + * Render user account + * @param {String} userAccount User account + * @returns {string} + */ +function renderUserAvatar(userAccount) +{ + var hue = $.zui.strCode(userAccount) * 43 / 360; + return ('
' + + userAccount[0].toUpperCase() + + '
'); +} + +/** + * Render story item 提供方法渲染看板中的需求条目 + * @param {Object} item Story item object + * @param {JQuery} $item Kanban item element + * @param {Object} col Column object + * @returns {JQuery} $item Kanban item element + */ +function renderStoryItem(item, $item, col) +{ + var $title = $item.find('.title'); + if(!$title.length) + { + $title = $(' ') + .attr('href', $.createLink('story', 'view', 'storyID=' + item.id)); + $title.appendTo($item); + } + $title.attr('title', item.title).find('.text').text(item.title); + + var $infos = $item.find('.infos'); + if(!$infos.length) + { + $infos = $('
').appendTo($item); + } + $infos.html( + [ + '#' + item.id + '', + '' + item.pri + '', + item.estimate ? '' + item.estimate + 'h' : '', + item.assignedTo ? renderUserAvatar(item.assignedTo) : '', + ].join('')); + + $item.attr('data-type', 'story').addClass('kanban-item-story'); + + return $item; +} + + +/** + * Render bug item 提供方法渲染看板中的 Bug 条目 + * @param {Object} item Bug item object + * @param {JQuery} $item Kanban item element + * @param {Object} col Column object + * @returns {JQuery} $item Kanban item element + */ +function renderBugItem(item, $item, col) +{ + var $title = $item.find('.title'); + if(!$title.length) + { + $title = $(' ') + .attr('href', $.createLink('bug', 'view', 'bugID=' + item.id)); + $title.appendTo($item); + } + $title.attr('title', item.title).find('.text').text(item.title); + + var $infos = $item.find('.infos'); + if(!$infos.length) + { + $infos = $('
').appendTo($item); + } + $infos.html( + [ + '#' + item.id + '', + '', + '' + item.pri + '', + item.assignedTo ? renderUserAvatar(item.assignedTo) : '', + ].join('')); + + $item.attr('data-type', 'bug').addClass('kanban-item-bug'); + + return $item; +} + +/** + * Render task item 提供方法渲染看板中的任务条目 + * @param {Object} item Task item object + * @param {JQuery} $item Kanban item element + * @param {Object} col Column object + * @returns {JQuery} $item Kanban item element + */ +function renderTaskItem(item, $item, col) +{ + var $title = $item.find('.title'); + if(!$title.length) + { + $title = $(' ') + .attr('href', $.createLink('task', 'view', 'taskID=' + item.id)); + $title.appendTo($item); + } + $title.attr('title', item.name).find('.text').text(item.name); + + var $infos = $item.find('.infos'); + if(!$infos.length) + { + $infos = $('
').appendTo($item); + } + $infos.html( + [ + '#' + item.id + '', + '' + item.pri + '', + item.estimate ? '' + item.estimate + 'h' : '', + item.assignedTo ? renderUserAvatar(item.assignedTo) : '', + ].join('')); + + $item.attr('data-type', 'task').addClass('kanban-item-task'); + + return $item; +} + + +/* Add column renderer/ 添加特定列类型或列条目类型渲染方法 */ +addColumnRenderer('story', renderStoryItem); +addColumnRenderer('bug', renderBugItem); +addColumnRenderer('task', renderTaskItem); + +/** + * Render column count 渲染看板列头上的条目数目 + * @param {JQuery} $count Kanban count element + * @param {number} count Column items count + * @param {number} col Column object + * @param {Object} kanban Kanban intance + */ +function renderColumnCount($count, count, col) +{ + var text = count + '/' + (col.maxCount || ''); + $count.html(text + ''); +} + +/** + * Updata kanban data + * 更新看板上的数据 + * @param {string} kanbanID Kanban id 看板 ID + * @param {Object} data Kanban data 看板数据 + */ +function updateKanban(kanbanID, data) +{ + var $kanban = $('#kanban-' + kanbanID); + if(!$kanban.length) return; + + $kanban.data('zui.kanban').render(data); +} + +/** + * Create kanban in page + * 在界面上创建一个看板界面 + * @param {string} kanbanID Kanban id 看板 ID + * @param {Object} data Kanban data 看板数据 + * @param {Object} options Kanban options 组件初始化数据 看板名称 + */ +function createKanban(kanbanID, data, options) +{ + var $kanban = $('#kanban-' + kanbanID); + if($kanban.length) return updateKanban(kanbanID, data); + + $kanban = $('
').appendTo('#kanbans'); + $kanban.kanban($.extend({data: data}, options)); +} + +$.extend($.fn.kanban.Constructor.DEFAULTS, +{ + onRender: function() + { + var maxWidth = 0; + $('#kanbans .kanban-board').each(function() + { + maxWidth = Math.max(maxWidth, $(this).outerWidth()); }); - }; - adjustBoardsHeight(); - - var boardID = ''; - var onlybody = config.requestType == 'GET' ? "&onlybody=yes" : "?onlybody=yes"; - $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot}); - var $kanban = $('#kanban'); - - // Get scrollbar width - var getScrollbarWidth = function () - { - var outer = document.createElement("div"); - outer.style.visibility = "hidden"; - outer.style.width = "100px"; - outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps - - document.body.appendChild(outer); - - var widthNoScroll = outer.offsetWidth; - // force scrollbars - outer.style.overflow = "scroll"; - - // add innerdiv - var inner = document.createElement("div"); - inner.style.width = "100%"; - outer.appendChild(inner); - - var widthWithScroll = inner.offsetWidth; - - // remove divs - outer.parentNode.removeChild(outer); - - return widthNoScroll - widthWithScroll; - }; - - var scrollbarWidth = getScrollbarWidth(); - var fixBoardWidth = function() - { - var $table = $kanban.children('.table:first'); - var kanbanWidth = $table.width(); - var $cBoards = $table.find('thead>tr>th.c-board:not(.c-side)'); - var boardCount = $cBoards.length; - var $cSide = $table.find('thead>tr>th.c-board.c-side'); - var totalWidth = kanbanWidth - scrollbarWidth - 1; - if ($cSide.length) totalWidth = totalWidth - ($cSide.outerWidth() + 5); - var cBoardWidth = Math.floor(totalWidth/boardCount); - $cBoards.not(':last').width(cBoardWidth); - if ($cSide.length) $cBoards.first().width(cBoardWidth + (isFirefox ? 0 : 5)); - $kanban.find('.boards > .board').width(cBoardWidth - (isFirefox ? 21 : 22)); - }; - fixBoardWidth(); - - var updateUI = function() - { - fixBoardWidth(); - adjustBoardsHeight(); - $kanban.data('zui.table').updateFixUI(); - }; - - $(window).on('resize', updateUI); - - var refresh = function(force) - { - var selfClose = $.cookie('selfClose'); - $.cookie('selfClose', 0, {expires:config.cookieLife, path:config.webRoot}); - if(selfClose == 1 || force) - { - $kanban.load(location.href + ' #kanban>*', updateUI); - } - }; - window.refreshKanban = refresh; - - var kanbanModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: 800}); - var dropTo = function(id, from, to, type) - { - if(statusMap[type][from] && statusMap[type][from][to]) - { - var method = statusMap[type][from][to]; - var link = $.createLink(type, method, 'id=' + id + '&subStatus=' + to); - if(method == 'ajaxChangeSubStatus') - { - $.getJSON(link, function(response) - { - if(response.result == 'fail' && response.message) - { - bootAlert(response.message); - setTimeout(function(){location.reload();}, 1000); - } - }); - } - else - { - kanbanModalTrigger.show( - { - url: link + onlybody, - shown: function(){$('.modal-iframe').addClass('with-titlebar').data('cancel-reload', true)}, - width: 900, - hidden: refresh - }); - } - } - - /* Keep the draged element stay in the new place. */ - return true; - }; - - $kanban.droppable( - { - selector: '.board-item:not(.disabled)', - target: function($ele) - { - var itemType = $ele.data('type'); - var $board = $ele.closest('.board'); - var type = $board.data('type'); - return $board.siblings('.board').filter(function() - { - var typeMap = statusMap[itemType]; - var actionMap = typeMap && typeMap[type]; - return !!actionMap && actionMap[$(this).data('type')]; - }); - }, - start: function(e) - { - $kanban.addClass('dragging'); - e.targets.addClass('can-drop-in'); - var $item = $(e.element).addClass('dragging'); - $item.closest('.boards').addClass('dragging'); - }, - drag: function(e) - { - var $item = $(e.element); - var $target = $(e.target); - var $holder = $target.find('.board-drag-holder'); - if (!$holder.length) $holder = $('
').appendTo($target); - $kanban.find('.c-board.dragging').removeClass('dragging'); - $kanban.find('.c-board.s-' + $target.data('type')).addClass('dragging'); - $holder.height($item.outerHeight()); - }, - drop: function(e) - { - var result = dropTo(e.element.data('id'), e.element.closest('.board').data('type'), e.target.data('type'), e.element.data('type')); - if(result !== false) - { - e.element.insertBefore(e.target.find('.board-drag-holder')); - } - }, - finish: function() - { - $kanban.removeClass('dragging').find('.can-drop-in').removeClass('can-drop-in'); - $kanban.find('.dragging').removeClass('dragging'); - } - }); - - $kanban.on('click', '.kanbaniframe', function(e) - { - var $link = $(this); - kanbanModalTrigger.show( - { - url: $link.attr('href'), - shown: function(){$('.modal-iframe').addClass('with-titlebar').data('cancel-reload', true)}, - hidden: refresh, - width: $(this).is('.task-assignedTo,.bug-assignedTo') ? 800 : 1100 - }); - return false; - }); - - fixKanbanSide($kanban); + $('#kanbanContainer').css('min-width', maxWidth + 40); + } }); -function fixKanbanSide($kanban) +/* Example code: */ +$(function() { - if($kanban.length == 0) return false; - - fixSideInit(); - $kanban.scroll(fixSide);//Fix kanban side when scrolling. - - var tableWidth, kanbanOffset, fixedSide, $fixedSide; - function fixSide() + /* Common options 用于初始化看板的通用选项 */  + var commonOptions = { - kanbanOffset = $kanban.offset().left; - $fixedSide = $kanban.parent().find('.fixedSide'); - if($fixedSide.length <= 0 && kanbanOffset < $kanban.scrollLeft()) - { - var $th = $kanban.find('table thead tr th:first'); + maxColHeight: 'auto', + minColWidth: 240, + droppable: true, + showCount: true, + showZeroCount: true, + countRender: renderColumnCount + }; - tableWidth = $th.width(); + /* Create story kanban 创建需求看板 */ + createKanban('story', getStoryKanbanDemoData(), commonOptions); - fixedSide = "'; - $kanban.find('table tbody tr').each(function() - { - var $td = $(this).find('td:first'); - fixedSide = fixedSide + "'; - }); - fixedSide = fixedSide + '
" + $th.html()+ '
" + $td.html() + '
'; + /* Create bug kanban 创建 Bug 看板 */ + createKanban('bug', getBugKanbanDemoData(), commonOptions); - $kanban.before(fixedSide); - - $('.fixedSide').width(tableWidth); - $('.fixedSide').css('top', $kanban.offset()); - - /* Reset height. */ - var index = 1; - $('.fixedSide tbody tr').each(function() - { - var $td = $kanban.find('table tbody tr:nth-child(' + index + ') td:first'); - - if($(this).find('td:first div:first').length == 0) $(this).find('td:first').html('
'); - $(this).find('td:first div:first').height($td.height()); - - index++; - }) - } - if($fixedSide.length > 0 && kanbanOffset >= $kanban.scrollLeft()) $fixedSide.remove(); - } - function fixSideInit() - { - $fixedSide = $kanban.parent().find('.fixedSide'); - if($fixedSide.length > 0) $fixedSide.remove(); - fixSide(); - } -} + /* Create task kanban 创建 任务 看板 */ + createKanban('task', getTaskKanbanDemoData(), commonOptions); +}); diff --git a/module/execution/js/kanbandemo.js b/module/execution/js/kanbandemo.js deleted file mode 100644 index cd000d210b..0000000000 --- a/module/execution/js/kanbandemo.js +++ /dev/null @@ -1,562 +0,0 @@ -/** - * Get story demo kanban data - * 获取“软件需求”看板演示数据 - * @returns {Object} Kanban data - * @todo 该方法作为演示,应该在最终版本中移除 - */ -function getStoryKanbanDemoData() -{ - /* Define kanban columns 定义看板列 */ - var columns = - [ - /* 看板列定义数据结构: - id: 列 ID(确保在页面上唯一), - type: 类型, - name: 显示的名称, - color: 列名称颜色, - parentType: 所属的父级列类型 - asParent: 是否作为父级列 - itemType: 看板条目类型,例如:'story'(需求) - maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ - {id: 'story-blacklog', type: 'blacklog', name: 'Blacklog', color: '', maxCount: 0}, - {id: 'story-ready', type: 'ready', name: '准备好', color: '', maxCount: 4}, - {id: 'story-dev', type: 'dev', name: '开发', color: '', maxCount: 4, asParent: true}, - {id: 'story-dev-doing', type: 'dev-doing', name: '进行中', color: '#126eed', maxCount: 2, parentType: 'dev'}, - {id: 'story-dev-done', type: 'dev-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'dev'}, - {id: 'story-test', type: 'test', name: '测试', color: '', maxCount: 4, asParent: true}, - {id: 'story-test-doing', type: 'test-doing', name: '进行中', color: '#126eed', maxCount: 2, parentType: 'test'}, - {id: 'story-test-done', type: 'test-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'test'}, - {id: 'story-accepted', type: 'accepted', name: '已验收', color: '', maxCount: 0}, - {id: 'story-published', type: 'published', name: '已发布', color: '', maxCount: 0}, - ]; - - /* Define items in blacklog column 定义 Blacklog 列上的条目 */ - var blacklogColItems = - [ - /* 需求数据结构: - id: ID,通常为需求 ID, - title: 名称, - order: 显示顺序,如果指定为 0,则按 ID 倒序排序, - pri: 优先级, - estimate: 预估时间, - assignedTo: 指派给, - deadline: 截止日期 */ - {id: 10010, title: '第一条 Blacklog', order: 1, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10011, title: '文档模块的实现', order: 2, pri: 2, estimate: 0, assignedTo: 'sunhao'}, - {id: 10012, title: '实现软件需求看板视图中不同分组条件的看板展示方式', order: 3, pri: 3, estimate: 10, assignedTo: 'admin'}, - {id: 10013, title: 'Blacklog 3', order: 4, pri: 0, estimate: 0, assignedTo: 'sunhao'}, - {id: 10014, title: '实现泳道的更多操作菜单', order: 5, pri: 0, estimate: 0, assignedTo: 'sunhao'}, - ]; - /* Define items in ready column 定义 准备好 列上的条目 */ - var readyColItems = - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10020, title: '在看板列中实现创建任务功能', order: 10, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10021, title: '实现泳道的上下移动', order: 11, pri: 2, estimate: 0, assignedTo: 'sunhao'}, - {id: 10024, title: '实现泳道的更多操作菜单', order: 15, pri: 0, estimate: 0, assignedTo: 'sunhao'}, - ]; - var devDoingColItems = /* Define items in dev/doing column 定义 开发/进行中 列上的条目 */ - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10030, title: '实现看板的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10031, title: '实现卡片拖动效果功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - ]; - var devDoneColItems = /* Define items in dev/done column 定义 开发/完成 列上的条目 */ - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10040, title: '实现看板列卡片排序功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, - ]; - var testDoingColItems = /* Define items in test/doing column 定义 测试/进行中 列上的条目 */ - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10050, title: '实现看板列的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10051, title: '实现Bug卡片的更多操作功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - ]; - var testDoneColItems = /* Define items in test/done column 定义 测试/完成 列上的条目 */ - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10060, title: '实现任务卡片的更多操作功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, - ]; - var acceptedColItems = - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10070, title: '实现执行看板的新建按钮组功能', order: 10, pri: 3, estimate: 12, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10071, title: '在看板列中实现提交Bug功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - {id: 10072, title: '在看板列中实现需求的添加和关联功能', order: 10, pri: 3, estimate: 10, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10073, title: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - ]; - var publishedColItems = - [ - /* 需求数据结构参见 blacklogColItems 定义 */ - {id: 10080, title: '实现任务看板视图中泳道分组下拉菜单功能', order: 10, pri: 3, estimate: 2, assignedTo: 'admin'}, - ]; - - /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ - var items = - { - /* 看板列类型: 条目列表 */ - blacklog: blacklogColItems, - ready: readyColItems, - 'dev-doing': devDoingColItems, - 'dev-done': devDoneColItems, - 'test-doing': testDoingColItems, - 'test-done': testDoneColItems, - accepted: acceptedColItems, - published: publishedColItems, - }; - - /* Define kanban lanes 定义看板泳道 */ - var lanes = - [ - /* 泳道数据结构: - id: 泳道 ID,确保页面上唯一,可以为数字或字符串, - name: 名称, - items: 定义每列上的条目 - color: 泳道名称背景色 - defaultItemType: 看板泳道上的条目默认类型,例如:'story'(需求) */ - {id: 'story', name: '软件需求', items: items, color: '#3dc6fc', defaultItemType: 'story'}, - ] - - /* Return kanban data 返回看板数据 */ - /* 看板数据结构: - id: ID,确保页面上唯一,可以为数字或字符串, - columns: 定义看板上的所有列, - lanes: 定义看板上的所有泳道 - defaultItemType: 看板上的条目默认类型,例如:'story'(需求) */ - return {id: 'story', columns: columns, lanes: lanes, defaultItemType: 'story'}; -} - -/** - * Get bug demo kanban data - * 获取“Bug”看板演示数据 - * @returns {Object} Kanban data - * @todo 该方法作为演示,应该在最终版本中移除 - */ -function getBugKanbanDemoData() -{ - /* Define kanban columns 定义看板列 */ - var columns = - [ - /* 看板列定义数据结构: - id: 列 ID(确保在页面上唯一), - type: 类型, - name: 显示的名称, - color: 列名称颜色, - parentType: 所属的父级列类型 - asParent: 是否作为父级列 - itemType: 看板条目类型,例如:'story'(需求) - maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ - {id: 'bug-wait', type: 'wait', name: '待确认', color: '', maxCount: 0}, - {id: 'bug-confirmed', type: 'confirmed', name: '已确认', color: '', maxCount: 4}, - {id: 'bug-resolving', type: 'resolving', name: '解决中', color: '', maxCount: 4, asParent: true}, - {id: 'bug-resolving-doing', type: 'resolving-doing',name: '进行中', color: '#126eed', maxCount: 2, parentType: 'resolving'}, - {id: 'bug-resolving-done', type: 'resolving-done', name: '完成', color: '#2fab8e', maxCount: 2, parentType: 'resolving'}, - {id: 'bug-test', type: 'test', name: '测试', color: '', maxCount: 4, asParent: true}, - {id: 'bug-test-doing', type: 'test-doing', name: '测试中', color: '#126eed', maxCount: 2, parentType: 'test'}, - {id: 'bug-test-done', type: 'test-done', name: '测试完毕', color: '#2fab8e', maxCount: 2, parentType: 'test'}, - {id: 'bug-closed', type: 'closed', name: '已关闭', color: '', maxCount: 0}, - ]; - - /* Define items in wait column 定义 待确认 列上的条目 */ - var waitColItems = - [ - /* bug 数据结构: - id: ID,通常为 Bug ID, - title: 名称, - order: 显示顺序,如果指定为 0,则按 ID 倒序排序, - pri: 优先级, - severity: 紧急程度, - assignedTo: 指派给 */ - {id: 10010, title: '在看板列中实现创建任务功能', order: 10, pri: 1, severity: 2, assignedTo: 'admin'}, - {id: 10011, title: '实现泳道的上下移动', order: 11, pri: 2, severity: 1, assignedTo: 'sunhao'}, - {id: 10014, title: '实现泳道的更多操作菜单', order: 15, pri: 0, severity: 1, assignedTo: 'sunhao'}, - ]; - /* Define items in confirmed column 定义 已确认 列上的条目 */ - var confirmedColItems = - [ - /* Bug 数据结构参见 waitColItems 定义 */ - {id: 10020, title: '在看板列中实现创建任务功能', order: 10, pri: 1, severity: 2, assignedTo: 'admin'}, - {id: 10021, title: '实现泳道的上下移动', order: 11, pri: 2, severity: 1, assignedTo: 'sunhao'}, - {id: 10024, title: '实现泳道的更多操作菜单', order: 15, pri: 0, severity: 1, assignedTo: 'sunhao'}, - ]; - var resolvingDoingColItems = /* Define items in resolving/doing column 定义 开发/进行中 列上的条目 */ - [ - /* Bug 数据结构参见 waitColItems 定义 */ - {id: 10030, title: '实现看板的更多操作菜单', order: 10, pri: 3, severity: 1, assignedTo: 'admin'}, - {id: 10031, title: '实现卡片拖动效果功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, - ]; - var resolvingDoneColItems = /* Define items in resolving/done column 定义 开发/完成 列上的条目 */ - [ - /* Bug 数据结构参见 waitColItems 定义 */ - {id: 10040, title: '实现看板列卡片排序功能', order: 10, pri: 1, severity: 4, assignedTo: 'admin'}, - ]; - var testDoingColItems = /* Define items in test/doing column 定义 测试/进行中 列上的条目 */ - [ - /* Bug 数据结构参见 waitColItems 定义 */ - {id: 10050, title: '实现看板列的更多操作菜单', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, - {id: 10051, title: '实现Bug卡片的更多操作功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, - ]; - var testDoneColItems = /* Define items in test/done column 定义 测试/完成 列上的条目 */ - [ - /* Bug 数据结构参见 waitColItems 定义 */ - {id: 10060, title: '实现任务卡片的更多操作功能', order: 10, pri: 1, severity: 4, assignedTo: 'admin'}, - ]; - var closedColItems = - [ - /* Bug 数据结构参见 waitColItems 定义 */ - {id: 10070, title: '实现执行看板的新建按钮组功能', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, - {id: 10071, title: '在看板列中实现提交Bug功能', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, - {id: 10072, title: '在看板列中实现需求的添加和关联功能', order: 10, pri: 3, severity: 3, assignedTo: 'admin'}, - {id: 10073, title: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, severity: 2, assignedTo: 'sunhao'}, - ]; - - /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ - var items = - { - /* 看板列类型: 条目列表 */ - wait: waitColItems, - confirmed: confirmedColItems, - 'resolving-doing': resolvingDoingColItems, - 'resolving-done': resolvingDoneColItems, - 'test-doing': testDoingColItems, - 'test-done': testDoneColItems, - closed: closedColItems, - }; - - /* Define kanban lanes 定义看板泳道 */ - var lanes = - [ - /* 泳道数据结构: - id: 泳道 ID,确保页面上唯一,可以为数字或字符串, - name: 名称, - items: 定义每列上的条目 - color: 泳道名称背景色 - defaultItemType: 看板泳道上的条目默认类型,例如:'bug'(Bug) */ - {id: 'bug', name: 'Bug', items: items, color: '#9c30b0', defaultItemType: 'bug'}, - ] - - /* Return kanban data 返回看板数据 */ - /* 看板数据结构: - id: ID,确保页面上唯一,可以为数字或字符串, - columns: 定义看板上的所有列, - lanes: 定义看板上的所有泳道 - defaultItemType: 看板上的条目默认类型,例如:'bug'(Bug) */ - return {id: 'bug', columns: columns, lanes: lanes, defaultItemType: 'bug'}; -} - -/** - * Get task demo kanban data - * 获取“任务”看板演示数据 - * @returns {Object} Kanban data - * @todo 该方法作为演示,应该在最终版本中移除 - */ -function getTaskKanbanDemoData() -{ - /* Define kanban columns 定义看板列 */ - var columns = - [ - /* 看板列定义数据结构: - id: 列 ID(确保在页面上唯一), - type: 类型, - name: 显示的名称, - color: 列名称颜色, - parentType: 所属的父级列类型 - asParent: 是否作为父级列 - itemType: 看板条目类型,例如:'task'(任务) - maxCount: 最大数目,该列上允许展示的条目最大数目,如果为 0 表示无限制 */ - {id: 'task-wait', type: 'wait', name: '未开始', color: '', maxCount: 0}, - {id: 'task-dev', type: 'dev', name: '开发', color: '', maxCount: 4, asParent: true}, - {id: 'task-dev-doing', type: 'dev-doing', name: '研发中', color: '#126eed', maxCount: 2, parentType: 'dev'}, - {id: 'task-dev-done', type: 'dev-done', name: '研发完成', color: '#2fab8e', maxCount: 2, parentType: 'dev'}, - {id: 'task-pause', type: 'pause', name: '已暂停', color: '', maxCount: 0}, - {id: 'task-cancel', type: 'cancel', name: '已取消', color: '', maxCount: 0}, - {id: 'task-closed', type: 'closed', name: '已关闭', color: '', maxCount: 0}, - ]; - - /* Define items in wait column 定义 未开始 列上的条目 */ - var waitColItems = - [ - /* 任务数据结构: - id: ID,通常为任务 ID, - name: 名称, - order: 显示顺序,如果指定为 0,则按 ID 倒序排序, - pri: 优先级, - estimate: 预估时间, - assignedTo: 指派给, - deadline: 截止日期 */ - {id: 10020, name: '在看板列中实现创建任务功能', order: 10, pri: 1, estimate: 2, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10021, name: '实现泳道的上下移动', order: 11, pri: 2, estimate: 0, assignedTo: 'sunhao', deadline: '2021-10-22'}, - {id: 10024, name: '实现泳道的更多操作菜单', order: 15, pri: 0, estimate: 0, assignedTo: 'sunhao'}, - ]; - var devDoingColItems = /* Define items in dev/doing column 定义 开发/进行中 列上的条目 */ - [ - /* 任务数据结构参见 waitColItems 定义 */ - {id: 10030, name: '实现看板的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10031, name: '实现卡片拖动效果功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - ]; - var devDoneColItems = /* Define items in dev/done column 定义 开发/完成 列上的条目 */ - [ - /* 任务数据结构参见 waitColItems 定义 */ - {id: 10040, name: '实现看板列卡片排序功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, - ]; - var pauseColItems = /* Define items in pause column 定义 已暂停 列上的条目 */ - [ - /* 任务数据结构参见 waitColItems 定义 */ - {id: 10050, name: '实现看板列的更多操作菜单', order: 10, pri: 3, estimate: 0, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10051, name: '实现Bug卡片的更多操作功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - ]; - var cancelColItems = /* Define items in cancel column 定义 已取消 列上的条目 */ - [ - /* 任务数据结构参见 waitColItems 定义 */ - {id: 10060, name: '实现任务卡片的更多操作功能', order: 10, pri: 1, estimate: 4, assignedTo: 'admin', deadline: '2021-10-30'}, - ]; - var closedColItems = - [ - /* 任务数据结构参见 waitColItems 定义 */ - {id: 10070, name: '实现执行看板的新建按钮组功能', order: 10, pri: 3, estimate: 12, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10071, name: '在看板列中实现提交Bug功能', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - {id: 10072, name: '在看板列中实现任务的添加和关联功能', order: 10, pri: 3, estimate: 10, assignedTo: 'admin', deadline: '2021-10-30'}, - {id: 10073, name: '实现任务看板视图中不同分组条件的看板展示方式', order: 11, pri: 2, estimate: 2, assignedTo: 'sunhao'}, - ]; - - /* Define kanban items in lane 定义看板泳道内每一列的条目,属性名为看板列类型,属性值为条目列表 */ - var items = - { - /* 看板列类型: 条目列表 */ - wait: waitColItems, - 'dev-doing': devDoingColItems, - 'dev-done': devDoneColItems, - pause: pauseColItems, - cancel: cancelColItems, - closed: closedColItems, - }; - - /* Define kanban lanes 定义看板泳道 */ - var lanes = - [ - /* 泳道数据结构: - id: 泳道 ID,确保页面上唯一,可以为数字或字符串, - name: 名称, - items: 定义每列上的条目 - color: 泳道名称背景色 - defaultItemType: 看板泳道上的条目默认类型,例如:'task'(任务) */ - {id: 'task', name: '任务', items: items, color: '#126eed', defaultItemType: 'task'}, - ] - - /* Return kanban data 返回看板数据 */ - /* 看板数据结构: - id: ID,确保页面上唯一,可以为数字或字符串, - columns: 定义看板上的所有列, - lanes: 定义看板上的所有泳道 - defaultItemType: 看板上的条目默认类型,例如:'task'(任务) */ - return {id: 'task', columns: columns, lanes: lanes, defaultItemType: 'task'}; -} - - -/** - * Render user account - * @param {String} userAccount User account - * @returns {string} - */ -function renderUserAvatar(userAccount) -{ - var hue = $.zui.strCode(userAccount) * 43 / 360; - return ('
' - + userAccount[0].toUpperCase() - + '
'); -} - -/** - * Render story item 提供方法渲染看板中的需求条目 - * @param {Object} item Story item object - * @param {JQuery} $item Kanban item element - * @param {Object} col Column object - * @returns {JQuery} $item Kanban item element - */ -function renderStoryItem(item, $item, col) -{ - var $title = $item.find('.title'); - if(!$title.length) - { - $title = $(' ') - .attr('href', $.createLink('story', 'view', 'storyID=' + item.id)); - $title.appendTo($item); - } - $title.attr('title', item.title).find('.text').text(item.title); - - var $infos = $item.find('.infos'); - if(!$infos.length) - { - $infos = $('
').appendTo($item); - } - $infos.html( - [ - '#' + item.id + '', - '' + item.pri + '', - item.estimate ? '' + item.estimate + 'h' : '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', - ].join('')); - - $item.attr('data-type', 'story').addClass('kanban-item-story'); - - return $item; -} - - -/** - * Render bug item 提供方法渲染看板中的 Bug 条目 - * @param {Object} item Bug item object - * @param {JQuery} $item Kanban item element - * @param {Object} col Column object - * @returns {JQuery} $item Kanban item element - */ -function renderBugItem(item, $item, col) -{ - var $title = $item.find('.title'); - if(!$title.length) - { - $title = $(' ') - .attr('href', $.createLink('bug', 'view', 'bugID=' + item.id)); - $title.appendTo($item); - } - $title.attr('title', item.title).find('.text').text(item.title); - - var $infos = $item.find('.infos'); - if(!$infos.length) - { - $infos = $('
').appendTo($item); - } - $infos.html( - [ - '#' + item.id + '', - '', - '' + item.pri + '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', - ].join('')); - - $item.attr('data-type', 'bug').addClass('kanban-item-bug'); - - return $item; -} - -/** - * Render task item 提供方法渲染看板中的任务条目 - * @param {Object} item Task item object - * @param {JQuery} $item Kanban item element - * @param {Object} col Column object - * @returns {JQuery} $item Kanban item element - */ -function renderTaskItem(item, $item, col) -{ - var $title = $item.find('.title'); - if(!$title.length) - { - $title = $(' ') - .attr('href', $.createLink('task', 'view', 'taskID=' + item.id)); - $title.appendTo($item); - } - $title.attr('title', item.name).find('.text').text(item.name); - - var $infos = $item.find('.infos'); - if(!$infos.length) - { - $infos = $('
').appendTo($item); - } - $infos.html( - [ - '#' + item.id + '', - '' + item.pri + '', - item.estimate ? '' + item.estimate + 'h' : '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', - ].join('')); - - $item.attr('data-type', 'task').addClass('kanban-item-task'); - - return $item; -} - - -/* Add column renderer/ 添加特定列类型或列条目类型渲染方法 */ -addColumnRenderer('story', renderStoryItem); -addColumnRenderer('bug', renderBugItem); -addColumnRenderer('task', renderTaskItem); - -/** - * Render column count 渲染看板列头上的条目数目 - * @param {JQuery} $count Kanban count element - * @param {number} count Column items count - * @param {number} col Column object - * @param {Object} kanban Kanban intance - */ -function renderColumnCount($count, count, col) -{ - var text = count + '/' + (col.maxCount || ''); - $count.html(text + ''); -} - -/** - * Updata kanban data - * 更新看板上的数据 - * @param {string} kanbanID Kanban id 看板 ID - * @param {Object} data Kanban data 看板数据 - */ -function updateKanban(kanbanID, data) -{ - var $kanban = $('#kanban-' + kanbanID); - if(!$kanban.length) return; - - $kanban.data('zui.kanban').render(data); -} - -/** - * Create kanban in page - * 在界面上创建一个看板界面 - * @param {string} kanbanID Kanban id 看板 ID - * @param {Object} data Kanban data 看板数据 - * @param {Object} options Kanban options 组件初始化数据 看板名称 - */ -function createKanban(kanbanID, data, options) -{ - var $kanban = $('#kanban-' + kanbanID); - if($kanban.length) return updateKanban(kanbanID, data); - - $kanban = $('
').appendTo('#kanbans'); - $kanban.kanban($.extend({data: data}, options)); -} - -$.extend($.fn.kanban.Constructor.DEFAULTS, -{ - onRender: function() - { - var maxWidth = 0; - $('#kanbans .kanban-board').each(function() - { - maxWidth = Math.max(maxWidth, $(this).outerWidth()); - }); - $('#kanbanContainer').css('min-width', maxWidth + 40); - } -}); - -/* Example code: */ -$(function() -{ - /* Common options 用于初始化看板的通用选项 */  - var commonOptions = - { - maxColHeight: 'auto', - minColWidth: 240, - droppable: true, - showCount: true, - showZeroCount: true, - countRender: renderColumnCount - }; - - /* Create story kanban 创建需求看板 */ - createKanban('story', getStoryKanbanDemoData(), commonOptions); - - /* Create bug kanban 创建 Bug 看板 */ - createKanban('bug', getBugKanbanDemoData(), commonOptions); - - /* Create task kanban 创建 任务 看板 */ - createKanban('task', getTaskKanbanDemoData(), commonOptions); -}); diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 5db8444efb..3c2f69dc3a 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -9,7 +9,8 @@ */ ?> - + + - -
- 0) - { - $hasTask = true; - break; - } - } - ?> - -
-

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

+ +
+
+ Section
- - - - - - - - - - - - - $group):?> - - - - - - - -
- -
- - - -
-
- createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', 'class="kanbaniframe group-title" title="' . $story->title . '"'); - } - else - { - echo "{$story->title}"; - } - ?> - - - -
-
- #id?> - story->priList, $story->pri);?> - story->stageList[$story->stage];?> -
estimate . 'h ';?>
-
-
- -
- - -
-
-
- -
- tasks[$col])):?> - tasks[$col] as $task):?> - -
- parent > 0 ? "" . $lang->task->childrenAB . ' ' : ''; - if(common::hasPriv('task', 'view')) - { - echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "{$childrenAB}{$task->name}", '', 'class="title kanbaniframe" title="' . $task->name . '"'); - } - else - { - echo "{$childrenAB}{$task->name}"; - } - ?> -
- " . zget($realnames, $task->assignedTo) . ""; - if(empty($task->assignedTo)) $assignedToRealName = "{$lang->task->noAssigned}"; - if(common::hasPriv('task', 'assignTo', $task)) - { - echo html::a($this->createLink('task', 'assignTo', "executionID={$task->execution}&taskID={$task->id}", '', true), ' ' . $assignedToRealName, '', 'class="btn btn-icon-left kanbaniframe task-assignedTo"'); - } - else - { - echo " {$assignedToRealName}"; - } - ?> - delay)):?> - task->delayed;?> - - left;?>h -
-
- - - bugs[$col])):?> - bugs[$col] as $bug):?> -
- createLink('bug', 'view', "bugID=$bug->id", '', true), " #{$bug->id}{$bug->title}", '', 'class="title kanbaniframe" title="' . $bug->title . '"'); - } - else - { - echo " #{$bug->id}{$bug->title}"; - } - ?> -
- " . zget($realnames, $bug->assignedTo) . ""; - if(empty($bug->assignedTo)) $assignedToRealName = "{$lang->task->noAssigned}"; - if(common::hasPriv('bug', 'assignTo', $bug)) - { - echo html::a($this->createLink('bug', 'assignTo', "bugID={$bug->id}", '', true), ' ' . $assignedToRealName, '', 'class="btn btn-icon-left kanbaniframe bug-assignedTo"'); - } - else - { - echo " {$assignedToRealName}"; - } - ?> - bug->statusList, $bug->status);?> -
-
- - -
- -
-
-
- +
- + + diff --git a/module/execution/view/kanbandemo.html.php b/module/execution/view/kanbandemo.html.php deleted file mode 100644 index 3c2f69dc3a..0000000000 --- a/module/execution/view/kanbandemo.html.php +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - -
-
- Section -
-
-
- - - From 1da7061d7a999427dbc46a53836d7f5d30456c81 Mon Sep 17 00:00:00 2001 From: zenggang Date: Tue, 26 Oct 2021 07:49:56 +0000 Subject: [PATCH 028/443] * Fix menu pri judge --- module/common/model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/common/model.php b/module/common/model.php index df20f14caa..1e3d490b0f 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -731,6 +731,9 @@ class commonModel extends model $linkPart = explode('|', $menu['link']); if(!isset($linkPart[2])) continue; $method = $linkPart[2]; + + if($currentModule == 'report' and $method == 'annualData') continue; // Skip some pages that do not require permissions. + if(common::hasPriv($currentModule, $method)) { $display = true; From a6e7949301e55937f577cfad3a17ca5da1791ff1 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 26 Oct 2021 16:39:44 +0800 Subject: [PATCH 029/443] * refactor avatar helper, the $user param cannot be an avatar url now. --- lib/front/front.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 716a533b74..9ff779b05a 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -229,7 +229,7 @@ class html extends baseHTML /** * Create user avatar. * - * @param string|object|array $user User object or user avatar url or user account + * @param string|object|array $user User object or user account * @param string|int $size Avatar size, can be a number or preset sizes: "xs", "sm", "", "lg", "xl", default is "" * @param string $className Avatar element class name, default is "avatar-circle" * @param string $attrib Extra attributes on avatar element @@ -248,7 +248,6 @@ class html extends baseHTML if(is_string($user)) { $userObj->account = $user; - if(strlen($user) > 1) $userObj->avatar = $user; $user = $userObj; } elseif(is_array($user)) From 77d40738690d6da5aec8ce0e40a493e16067841e Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Tue, 26 Oct 2021 16:57:36 +0800 Subject: [PATCH 030/443] * improve avatar style in kanban. --- module/execution/js/kanban.js | 19 +- www/js/zui/min.js | 5141 +-------------------------------- 2 files changed, 24 insertions(+), 5136 deletions(-) diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index d5c2ba7f21..073525823d 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -354,16 +354,15 @@ function getTaskKanbanDemoData() /** - * Render user account - * @param {String} userAccount User account + * Render user avatar + * @param {String|{account: string, avatar: string}} user User account or user object * @returns {string} */ -function renderUserAvatar(userAccount) +function renderUserAvatar(user) { - var hue = $.zui.strCode(userAccount) * 43 / 360; - return ('
' - + userAccount[0].toUpperCase() - + '
'); + if(typeof user === 'string') user = {account: user}; + if(!user.avatar && window.userList && window.userList[user.account]) user = window.userList[user.account]; + return $('
').avatar({user: user}); } /** @@ -394,8 +393,8 @@ function renderStoryItem(item, $item, col) '#' + item.id + '', '' + item.pri + '', item.estimate ? '' + item.estimate + 'h' : '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', ].join('')); + if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo)); $item.attr('data-type', 'story').addClass('kanban-item-story'); @@ -431,8 +430,8 @@ function renderBugItem(item, $item, col) '#' + item.id + '', '', '' + item.pri + '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', ].join('')); + if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo)); $item.attr('data-type', 'bug').addClass('kanban-item-bug'); @@ -467,8 +466,8 @@ function renderTaskItem(item, $item, col) '#' + item.id + '', '' + item.pri + '', item.estimate ? '' + item.estimate + 'h' : '', - item.assignedTo ? renderUserAvatar(item.assignedTo) : '', ].join('')); + if(item.assignedTo) $infos.append(renderUserAvatar(item.assignedTo)); $item.attr('data-type', 'task').addClass('kanban-item-task'); diff --git a/www/js/zui/min.js b/www/js/zui/min.js index 1d99c24589..89fbdeab96 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -1,3929 +1,37 @@ /*! - * ZUI: ZUI for Zentao - v1.9.2 - 2021-10-15 + * ZUI: ZUI for Zentao - v1.9.2 - 2021-10-26 * http://openzui.com - * GitHub: https://github.com/easysoft/zui.git + * GitHub: https://github.com/easysoft/zui.git * Copyright (c) 2021 cnezsoft.com; Licensed MIT */ -!function (t, e, i) { - "use strict"; - if ("undefined" == typeof t) throw new Error("ZUI requires jQuery"); - t.zui || (t.zui = function (e) { - t.isPlainObject(e) && t.extend(t.zui, e) - }); - var n = {all: -1, left: 0, middle: 1, right: 2}, o = 0; - t.zui({ - uuid: function (t) { - var e = 1e5 * (Date.now() - 1580890015292) + 10 * Math.floor(1e4 * Math.random()) + o++ % 10; - return t ? e : e.toString(36) - }, callEvent: function (t, e, n) { - if ("function" == typeof t) { - n !== i && (t = t.bind(n)); - var o = t(e); - return e && (e.result = o), !(o !== i && !o) - } - return 1 - }, strCode: function (t) { - var e = 0; - if ("string" != typeof t && (t = String(t)), t && t.length) for (var i = 0; i < t.length; ++i) e += (i + 1) * t.charCodeAt(i); - return e - }, getMouseButtonCode: function (t) { - return "number" != typeof t && (t = n[t]), t !== i && null !== t || (t = -1), t - }, defaultLang: "en", clientLang: function () { - var i, n = e.config; - if ("undefined" != typeof n && n.clientLang && (i = n.clientLang), !i) { - var o = t("html").attr("lang"); - i = o ? o : navigator.userLanguage || navigator.userLanguage || t.zui.defaultLang - } - return i.replace("-", "_").toLowerCase() - }, langDataMap: {}, addLangData: function (e, i, n) { - var o = {}; - n && i && e ? (o[i] = {}, o[i][e] = n) : e && i && !n ? (n = i, t.each(n, function (t) { - o[t] = {}, o[t][e] = n[t] - })) : !e || i || n || t.each(n, function (e) { - var i = n[e]; - t.each(i, function (t) { - o[t] || (o[t] = {}), o[t][e] = i[t] - }) - }), t.extend(!0, t.zui.langDataMap, o) - }, getLangData: function (e, i, n) { - if (!arguments.length) return t.extend({}, t.zui.langDataMap); - if (1 === arguments.length) return t.extend({}, t.zui.langDataMap[e]); - if (2 === arguments.length) { - var o = t.zui.langDataMap[e]; - return o ? i ? o[i] : o : {} - } - if (3 === arguments.length) { - i = i || t.zui.clientLang(); - var o = t.zui.langDataMap[e], a = o ? o[i] : {}; - return t.extend(!0, {}, n[i] || n.en || n.zh_cn, a) - } - return null - }, lang: function () { - return arguments.length && t.isPlainObject(arguments[arguments.length - 1]) ? t.zui.addLangData.apply(null, arguments) : t.zui.getLangData.apply(null, arguments) - }, _scrollbarWidth: 0, checkBodyScrollbar: function () { - if (document.body.clientWidth >= e.innerWidth) return 0; - if (!t.zui._scrollbarWidth) { - var i = document.createElement("div"); - i.className = "scrollbar-measure", document.body.appendChild(i), t.zui._scrollbarWidth = i.offsetWidth - i.clientWidth, document.body.removeChild(i) - } - return t.zui._scrollbarWidth - }, fixBodyScrollbar: function () { - if (t.zui.checkBodyScrollbar()) { - var e = t("body"), i = parseInt(e.css("padding-right") || 0, 10); - return t.zui._scrollbarWidth && e.css({ - paddingRight: i + t.zui._scrollbarWidth, - overflowY: "hidden" - }), !0 - } - }, resetBodyScrollbar: function () { - t("body").css({paddingRight: "", overflowY: ""}) - } - }), t.fn.callEvent = function (e, n, o) { - var a = t(this), s = e.indexOf(".zui."), r = s < 0 ? e : e.substring(0, s), l = t.Event(r, n); - if (o === i && s > 0 && (o = a.data(e.substring(s + 1))), o && o.options) { - var h = o.options[r]; - "function" == typeof h && (l.result = t.zui.callEvent(h, l, o)) - } - return a.trigger(l), l - }, t.fn.callComEvent = function (t, e, n) { - n === i || Array.isArray(n) || (n = [n]); - var o, a = this; - a.trigger(e, n); - var s = t.options[e]; - return s && (o = s.apply(t, n)), o - } -}(jQuery, window, void 0), function (t) { - "use strict"; - t.fn.fixOlPd = function (e) { - return e = e || 10, this.each(function () { - var i = t(this); - i.css("paddingLeft", Math.ceil(Math.log10(i.children().length)) * e + 10) - }) - }, t(function () { - t(".ol-pd-fix,.article ol").fixOlPd() - }) -}(jQuery), +function (t) { - "use strict"; - var e = '[data-dismiss="alert"]', i = "zui.alert", n = function (i) { - t(i).on("click", e, this.close) - }; - n.prototype.close = function (e) { - function n() { - s.trigger("closed." + i).remove() - } - - var o = t(this), a = o.attr("data-target"); - a || (a = o.attr("href"), a = a && a.replace(/.*(?=#[^\s]*$)/, "")); - var s = t(a); - e && e.preventDefault(), s.length || (s = o.hasClass("alert") ? o : o.parent()), s.trigger(e = t.Event("close." + i)), e.isDefaultPrevented() || (s.removeClass("in"), t.support.transition && s.hasClass("fade") ? s.one(t.support.transition.end, n).emulateTransitionEnd(150) : n()) - }; - var o = t.fn.alert; - t.fn.alert = function (e) { - return this.each(function () { - var o = t(this), a = o.data(i); - a || o.data(i, a = new n(this)), "string" == typeof e && a[e].call(o) - }) - }, t.fn.alert.Constructor = n, t.fn.alert.noConflict = function () { - return t.fn.alert = o, this - }, t(document).on("click." + i + ".data-api", e, n.prototype.close) -}(window.jQuery), function (t, e) { - "use strict"; - var i = "zui.pager", n = {page: 1, recTotal: 0, recPerPage: 10}, o = { - zh_cn: { - pageOfText: "第 {0} 页", - prev: "上一页", - next: "下一页", - first: "第一页", - last: "最后一页", - "goto": "跳转", - pageOf: "第 {page} 页", - totalPage: "共 {totalPage} 页", - totalCount: "共 {recTotal} 项", - pageSize: "每页 {recPerPage} 项", - itemsRange: "第 {start} ~ {end} 项", - pageOfTotal: "第 {page}/{totalPage} 页" - }, - zh_tw: { - pageOfText: "第 {0} 頁", - prev: "上一頁", - next: "下一頁", - first: "第一頁", - last: "最後一頁", - "goto": "跳轉", - pageOf: "第 {page} 頁", - totalPage: "共 {totalPage} 頁", - totalCount: "共 {recTotal} 項", - pageSize: "每頁 {recPerPage} 項", - itemsRange: "第 {start} ~ {end} 項", - pageOfTotal: "第 {page}/{totalPage} 頁" - }, - en: { - pageOfText: "Page {0}", - prev: "Prev", - next: "Next", - first: "First", - last: "Last", - "goto": "Goto", - pageOf: "Page {page}", - totalPage: "{totalPage} pages", - totalCount: "Total: {recTotal} items", - pageSize: "{recPerPage} per page", - itemsRange: "From {start} to {end}", - pageOfTotal: "Page {page} of {totalPage}" - } - }, a = function (e, n) { - var s = this; - s.name = i, s.$ = t(e), n = s.options = t.extend({}, a.DEFAULTS, this.$.data(), n), s.langName = n.lang || t.zui.clientLang(), s.lang = t.zui.getLangData(i, s.langName, o), s.state = {}, s.set(n.page, n.recTotal, n.recPerPage, !0), s.$.on("click", ".pager-goto-btn", function () { - var e = t(this).closest(".pager-goto"), i = parseInt(e.find(".pager-goto-input").val()); - NaN !== i && s.set(i) - }).on("click", ".pager-item", function () { - var e = t(this).data("page"); - "number" == typeof e && e > 0 && s.set(e) - }).on("click", ".pager-size-menu [data-size]", function () { - var e = t(this).data("size"); - "number" == typeof e && e > 0 && s.set(-1, -1, e) - }) - }; - a.prototype.set = function (e, i, o, a) { - var s = this; - "object" == typeof e && null !== e && (o = e.recPerPage, i = e.recTotal, e = e.page); - var r = s.state; - r || (r = t.extend({}, n)); - var l = t.extend({}, r); - return "number" == typeof o && o > 0 && (r.recPerPage = o), "number" == typeof i && i >= 0 && (r.recTotal = i), "number" == typeof e && e >= 0 && (r.page = e), r.totalPage = r.recTotal && r.recPerPage ? Math.ceil(r.recTotal / r.recPerPage) : 1, r.page = Math.max(0, Math.min(r.page, r.totalPage)), r.pageRecCount = r.recTotal, r.page && r.recTotal && (r.page < r.totalPage ? r.pageRecCount = r.recPerPage : r.page > 1 && (r.pageRecCount = r.recTotal - r.recPerPage * (r.page - 1))), r.skip = r.page > 1 ? (r.page - 1) * r.recPerPage : 0, r.start = r.skip + 1, r.end = r.skip + r.pageRecCount, r.prev = r.page > 1 ? r.page - 1 : 0, r.next = r.page < r.totalPage ? r.page + 1 : 0, s.state = r, a || l.page === r.page && l.recTotal === r.recTotal && l.recPerPage === r.recPerPage || s.$.callComEvent(s, "onPageChange", [r, l]), s.render() - }, a.prototype.createLinkItem = function (i, n, o) { - var a = this; - n === e && (n = i); - var s = t('').attr("href", i ? a.createLink(i, a.state) : "###").html(n); - return o || (s = t("
  • ").append(s).toggleClass("active", i === a.state.page).toggleClass("disabled", !i || i === a.state.page)), s - }, a.prototype.createNavItems = function (t) { - var i = this, n = i.$, o = i.state, a = o.totalPage, s = o.page, r = function (t, o) { - if (t === !1) return void n.append(i.createLinkItem(0, o || i.options.navEllipsisItem)); - o === e && (o = t); - for (var a = t; a <= o; ++a) n.append(i.createLinkItem(a)) - }; - t === e && (t = i.options.maxNavCount || 10), r(1), a > 1 && (a <= t ? r(2, a) : s < t - 2 ? (r(2, t - 2), r(!1), r(a)) : s > a - t + 2 ? (r(!1), r(a - t + 2, a)) : (r(!1), r(s - Math.ceil((t - 4) / 2), s + Math.floor((t - 4) / 2)), r(!1), r(a))) - }, a.prototype.createGoto = function () { - var e = this, i = this.state, - n = t('
    "); - return n - }, a.prototype.createSizeMenu = function () { - var e = this, i = this.state, n = t(''), o = e.options.pageSizeOptions; - "string" == typeof o && (o = o.split(",")); - for (var a = 0; a < o.length; ++a) { - var s = o[a]; - "string" == typeof s && (s = parseInt(s)); - var r = t('
  • ' + s + "
  • ").toggleClass("active", s === i.recPerPage); - n.append(r) - } - return t('
    ').addClass(e.options.menuDirection).append(n) - }, a.prototype.createElement = function (e, i, n) { - var o = this, a = o.createLinkItem.bind(o), s = o.lang; - switch (e) { - case"prev": - return a(n.prev, s.prev); - case"prev_icon": - return a(n.prev, ''); - case"next": - return a(n.next, s.next); - case"next_icon": - return a(n.next, ''); - case"first": - return a(1, s.first); - case"first_icon": - return a(1, ''); - case"last": - return a(n.totalPage, s.last); - case"last_icon": - return a(n.totalPage, ''); - case"space": - case"|": - return t('
  • '); - case"nav": - case"pages": - return void o.createNavItems(); - case"total_text": - return t(('
    ' + s.totalCount + "
    ").format(n)); - case"page_text": - return t(('
    ' + s.pageOf + "
    ").format(n)); - case"total_page_text": - return t(('
    ' + s.totalPage + "
    ").format(n)); - case"page_of_total_text": - return t(('
    ' + s.pageOfTotal + "
    ").format(n)); - case"page_size_text": - return t(('
    ' + s.pageSize + "
    ").format(n)); - case"items_range_text": - return t(('
    ' + s.itemsRange + "
    ").format(n)); - case"goto": - return o.createGoto(); - case"size_menu": - return o.createSizeMenu(); - default: - return t("
  • ").html(e.format(n)) - } - }, a.prototype.createLink = function (i, n) { - i === e && (i = this.state.page), n === e && (n = this.state); - var o = this.options.linkCreator; - return "string" == typeof o ? o.format(t.extend({}, n, {page: i})) : "function" == typeof o ? o(i, n) : "#page=" + i - }, a.prototype.render = function (e) { - var i = this, n = i.state, o = i.options.elementCreator || i.createElement, a = t.isPlainObject(o); - e = e || i.elements || i.options.elements, "string" == typeof e && (e = e.split(",")), i.elements = e, i.$.empty(); - for (var s = 0; s < e.length; ++s) { - var r = t.trim(e[s]), l = a ? o[r] || o : o, h = l.call(i, r, i.$, n); - h === !1 && (h = i.createElement(r, i.$, n)), h instanceof t && ("LI" !== h[0].tagName && (h = t("
  • ").append(h)), i.$.append(h)) - } - var c = null; - return i.$.children("li").each(function () { - var e = t(this), i = !!e.children(".pager-item").length; - c ? c.toggleClass("pager-item-right", !i) : i && e.addClass("pager-item-left"), c = i ? e : null - }), c && c.addClass("pager-item-right"), i.$.callComEvent(i, "onRender", [n]), i - }, a.DEFAULTS = t.extend({ - elements: ["first_icon", "prev_icon", "pages", "next_icon", "last_icon", "page_of_total_text", "items_range_text", "total_text"], - prevIcon: "icon-double-angle-left", - nextIcon: "icon-double-angle-right", - firstIcon: "icon-step-backward", - lastIcon: "icon-step-forward", - navEllipsisItem: '', - maxNavCount: 10, - menuDirection: "dropdown", - pageSizeOptions: [10, 20, 30, 50, 100] - }, n), t.fn.pager = function (e) { - return this.each(function () { - var n = t(this), o = n.data(i), s = "object" == typeof e && e; - o || n.data(i, o = new a(this, s)), "string" == typeof e && o[e]() - }) - }, a.NAME = i, a.LANG = o, t.fn.pager.Constructor = a, t(function () { - t('[data-ride="pager"]').pager() - }) -}(jQuery, void 0), +function (t) { - "use strict"; - var e = "zui.tab", i = function (e) { - this.element = t(e) - }; - i.prototype.show = function () { - var i = this.element, n = i.closest("ul:not(.dropdown-menu)"), o = i.attr("data-target") || i.attr("data-tab"); - if (o || (o = i.attr("href"), o = o && o.replace(/.*(?=#[^\s]*$)/, "")), !i.parent("li").hasClass("active")) { - var a = n.find(".active:last a")[0], s = t.Event("show." + e, {relatedTarget: a}); - if (i.trigger(s), !s.isDefaultPrevented()) { - var r = t(o); - this.activate(i.parent("li"), n), this.activate(r, r.parent(), function () { - i.trigger({type: "shown." + e, relatedTarget: a}) - }) - } - } - }, i.prototype.activate = function (e, i, n) { - function o() { - a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), e.addClass("active"), s ? (e[0].offsetWidth, e.addClass("in")) : e.removeClass("fade"), e.parent(".dropdown-menu") && e.closest("li.dropdown").addClass("active"), n && n() - } - - var a = i.find("> .active"), s = n && t.support.transition && a.hasClass("fade"); - s ? a.one(t.support.transition.end, o).emulateTransitionEnd(150) : o(), a.removeClass("in") - }; - var n = t.fn.tab; - t.fn.tab = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e); - a || o.data(e, a = new i(this)), "string" == typeof n && a[n]() - }) - }, t.fn.tab.Constructor = i, t.fn.tab.noConflict = function () { - return t.fn.tab = n, this - }, t(document).on("click.zui.tab.data-api", '[data-toggle="tab"], [data-tab]', function (e) { - e.preventDefault(), t(this).tab("show") - }) -}(window.jQuery), +function (t) { - "use strict"; - - function e() { - var t = document.createElement("bootstrap"), e = { - WebkitTransition: "webkitTransitionEnd", - MozTransition: "transitionend", - OTransition: "oTransitionEnd otransitionend", - transition: "transitionend" - }; - for (var i in e) if (void 0 !== t.style[i]) return {end: e[i]}; - return !1 - } - - t.fn.emulateTransitionEnd = function (e) { - var i = !1, n = this; - t(this).one("bsTransitionEnd", function () { - i = !0 - }); - var o = function () { - i || t(n).trigger(t.support.transition.end) - }; - return setTimeout(o, e), this - }, t(function () { - t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = { - bindType: t.support.transition.end, - delegateType: t.support.transition.end, - handle: function (e) { - if (t(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) - } - }) - }) -}(jQuery), +function (t) { - "use strict"; - var e = "zui.collapse", i = function (e, n) { - this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, n), this.transitioning = null, this.options.parent && (this.$parent = t(this.options.parent)), this.options.toggle && this.toggle() - }; - i.DEFAULTS = {toggle: !0}, i.prototype.dimension = function () { - var t = this.$element.hasClass("width"); - return t ? "width" : "height" - }, i.prototype.show = function () { - if (!this.transitioning && !this.$element.hasClass("in")) { - var i = t.Event("show." + e); - if (this.$element.trigger(i), !i.isDefaultPrevented()) { - var n = this.$parent && this.$parent.find(".in"); - if (n && n.length) { - var o = n.data(e); - if (o && o.transitioning) return; - n.collapse("hide"), o || n.data(e, null) - } - var a = this.dimension(); - this.$element.removeClass("collapse").addClass("collapsing")[a](0), this.transitioning = 1; - var s = function () { - this.$element.removeClass("collapsing").addClass("in")[a]("auto"), this.transitioning = 0, this.$element.trigger("shown." + e) - }; - if (!t.support.transition) return s.call(this); - var r = t.camelCase(["scroll", a].join("-")); - this.$element.one(t.support.transition.end, s.bind(this)).emulateTransitionEnd(350)[a](this.$element[0][r]) - } - } - }, i.prototype.hide = function () { - if (!this.transitioning && this.$element.hasClass("in")) { - var i = t.Event("hide." + e); - if (this.$element.trigger(i), !i.isDefaultPrevented()) { - var n = this.dimension(); - this.$element[n](this.$element[n]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1; - var o = function () { - this.transitioning = 0, this.$element.trigger("hidden." + e).removeClass("collapsing").addClass("collapse") - }; - return t.support.transition ? void this.$element[n](0).one(t.support.transition.end, o.bind(this)).emulateTransitionEnd(350) : o.call(this) - } - } - }, i.prototype.toggle = function () { - this[this.$element.hasClass("in") ? "hide" : "show"]() - }; - var n = t.fn.collapse; - t.fn.collapse = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e), s = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof n && n); - a || o.data(e, a = new i(this, s)), "string" == typeof n && a[n]() - }) - }, t.fn.collapse.Constructor = i, t.fn.collapse.noConflict = function () { - return t.fn.collapse = n, this - }, t(document).on("click." + e + ".data-api", "[data-toggle=collapse]", function (i) { - var n, o = t(this), - a = o.attr("data-target") || i.preventDefault() || (n = o.attr("href")) && n.replace(/.*(?=#[^\s]+$)/, ""), - s = t(a), r = s.data(e), l = r ? "toggle" : o.data(), h = o.attr("data-parent"), c = h && t(h); - r && r.transitioning || (c && c.find('[data-toggle=collapse][data-parent="' + h + '"]').not(o).addClass("collapsed"), o[s.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), s.collapse(l) - }) -}(window.jQuery), function (t, e) { - "use strict"; - var i = 1200, n = 992, o = 768, a = e(t), s = function () { - var t = a.width(); - e("html").toggleClass("screen-desktop", t >= n && t < i).toggleClass("screen-desktop-wide", t >= i).toggleClass("screen-tablet", t >= o && t < n).toggleClass("screen-phone", t < o).toggleClass("device-mobile", t < n).toggleClass("device-desktop", t >= n) - }, r = "", l = navigator.userAgent; - l.match(/(iPad|iPhone|iPod)/i) ? r += " os-ios" : l.match(/android/i) ? r += " os-android" : l.match(/Win/i) ? r += " os-windows" : l.match(/Mac/i) ? r += " os-mac" : l.match(/Linux/i) ? r += " os-linux" : l.match(/X11/i) && (r += " os-unix"), "ontouchstart" in document.documentElement && (r += " is-touchable"), e("html").addClass(r), a.resize(s), s() -}(window, jQuery), function (t) { - "use strict"; - var e = { - zh_cn: '您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...', - zh_tw: '您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...', - en: 'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...' - }, i = function () { - for (var t = !1, e = 11; e > 5; e--) if (this.isIE(e)) { - t = e; - break - } - this.ie = t, this.cssHelper() - }; - i.prototype.cssHelper = function () { - var e = this.ie, i = t("html"); - i.toggleClass("ie", e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"), e && i.addClass("ie-" + e).toggleClass("gt-ie-7 gte-ie-8 support-ie", e >= 8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie", e < 8).toggleClass("gt-ie-8 gte-ie-9", e >= 9).toggleClass("lte-ie-8 lt-ie-9", e < 9).toggleClass("gt-ie-9 gte-ie-10", e >= 10).toggleClass("lte-ie-9 lt-ie-10", e < 10).toggleClass("gt-ie-10 gte-ie-11", e >= 11).toggleClass("lte-ie-10 lt-ie-11", e < 11) - }, i.prototype.tip = function (i) { - var n = t("#browseHappyTip"); - n.length || (n = t('
    '), n.prependTo("body")), i || (i = t.zui.getLangData("zui.browser", t.zui.clientLang(), e), "object" == typeof i && (i = i.tip)), n.find(".content").html(i) - }, i.prototype.isIE = function (t) { - if (11 === t) return this.isIE11(); - if (10 === t) return this.isIE10(); - if (!t && (this.isIE11() || this.isIE10())) return !0; - var e = document.createElement("b"); - return e.innerHTML = "", 1 === e.getElementsByTagName("i").length - }, i.prototype.isIE10 = function () { - return navigator.appVersion.indexOf("MSIE 10") !== -1 - }, i.prototype.isIE11 = function () { - var t = navigator.userAgent; - return t.indexOf("Trident") !== -1 && t.indexOf("rv:11") !== -1 - }, t.zui({browser: new i}), t(function () { - t("body").hasClass("disabled-browser-tip") || t.zui.browser.ie && t.zui.browser.ie < 8 && t.zui.browser.tip() - }) -}(jQuery), function (t) { - "use strict"; - var e = 864e5, i = function (t) { - return t instanceof Date || ("number" == typeof t && t < 1e10 && (t *= 1e3), t = new Date(t)), t - }, n = function (t) { - return i(t).getTime() - }, o = function (t, e) { - t = i(t), void 0 === e && (e = "yyyy-MM-dd hh:mm:ss"); - var n = { - "M+": t.getMonth() + 1, - "d+": t.getDate(), - "h+": t.getHours(), - "m+": t.getMinutes(), - "s+": t.getSeconds(), - "q+": Math.floor((t.getMonth() + 3) / 3), - "S+": t.getMilliseconds() - }; - /(y+)/i.test(e) && (e = e.replace(RegExp.$1, (t.getFullYear() + "").substr(4 - RegExp.$1.length))); - for (var o in n) new RegExp("(" + o + ")").test(e) && (e = e.replace(RegExp.$1, 1 == RegExp.$1.length ? n[o] : ("00" + n[o]).substr(("" + n[o]).length))); - return e - }, a = function (t, e) { - return t.setTime(t.getTime() + e), t - }, s = function (t, i) { - return a(t, i * e) - }, r = function (t) { - return new Date(i(t).getTime()) - }, l = function (t) { - return t % 4 === 0 && t % 100 !== 0 || t % 400 === 0 - }, h = function (t, e) { - return [31, l(t) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][e] - }, c = function (t) { - return h(t.getFullYear(), t.getMonth()) - }, d = function (t) { - return t.setHours(0), t.setMinutes(0), t.setSeconds(0), t.setMilliseconds(0), t - }, u = function (t, e) { - var i = t.getDate(); - return t.setDate(1), t.setMonth(t.getMonth() + e), t.setDate(Math.min(i, c(t))), t - }, f = function (t, e) { - e = e || 1; - for (var i = new Date(t.getTime()); i.getDay() != e;) i = s(i, -1); - return d(i) - }, p = function (t, e) { - return t.toDateString() === e.toDateString() - }, g = function (t, e) { - var i = f(t), n = s(r(i), 7); - return e >= i && e < n - }, m = function (t, e) { - return t.getFullYear() === e.getFullYear() - }, v = { - formatDate: o, - createDate: i, - date: { - ONEDAY_TICKS: e, - create: i, - getTimestamp: n, - format: o, - addMilliseconds: a, - addDays: s, - cloneDate: r, - isLeapYear: l, - getDaysInMonth: h, - getDaysOfThisMonth: c, - clearTime: d, - addMonths: u, - getLastWeekday: f, - isSameDay: p, - isSameWeek: g, - isSameYear: m - } - }; - t.$ && t.$.zui ? $.zui(v) : t.dateHelper = v.date, t.noDatePrototypeHelper || (Date.ONEDAY_TICKS = e, Date.prototype.format || (Date.prototype.format = function (t) { - return o(this, t) - }), Date.prototype.addMilliseconds || (Date.prototype.addMilliseconds = function (t) { - return a(this, t) - }), Date.prototype.addDays || (Date.prototype.addDays = function (t) { - return s(this, t) - }), Date.prototype.clone || (Date.prototype.clone = function () { - return r(this) - }), Date.isLeapYear || (Date.isLeapYear = function (t) { - return l(t) - }), Date.getDaysInMonth || (Date.getDaysInMonth = function (t, e) { - return h(t, e) - }), Date.prototype.isLeapYear || (Date.prototype.isLeapYear = function () { - return l(this.getFullYear()) - }), Date.prototype.clearTime || (Date.prototype.clearTime = function () { - return d(this) - }), Date.prototype.getDaysInMonth || (Date.prototype.getDaysInMonth = function () { - return c(this) - }), Date.prototype.addMonths || (Date.prototype.addMonths = function (t) { - return u(this, t) - }), Date.prototype.getLastWeekday || (Date.prototype.getLastWeekday = function (t) { - return f(this, t) - }), Date.prototype.isSameDay || (Date.prototype.isSameDay = function (t) { - return p(t, this) - }), Date.prototype.isSameWeek || (Date.prototype.isSameWeek = function (t) { - return g(t, this) - }), Date.prototype.isSameYear || (Date.prototype.isSameYear = function (t) { - return m(this, t) - }), Date.create || (Date.create = function (t) { - return i(t) - }), Date.timestamp || (Date.timestamp = function (t) { - return n(t) - })) -}(window), function () { - "use strict"; - var t = function (t, e) { - if (arguments.length > 1) { - var i; - if (2 == arguments.length && "object" == typeof e) for (var n in e) void 0 !== e[n] && (i = new RegExp("({" + n + "})", "g"), t = t.replace(i, e[n])); else for (var o = 1; o < arguments.length; o++) void 0 !== arguments[o] && (i = new RegExp("({[" + (o - 1) + "]})", "g"), t = t.replace(i, arguments[o])) - } - return t - }, e = function (t) { - if (null !== t) { - var e, i; - return i = /\d*/i, e = t.match(i), e == t - } - return !1 - }, i = {formatString: t, string: {format: t, isNum: e}}; - window.$ && window.$.zui ? $.zui(i) : window.stringHelper = i.string, window.noStringPrototypeHelper || (String.prototype.format || (String.prototype.format = function () { - var e = [].slice.call(arguments); - return e.unshift(this), t.apply(this, e) - }), String.prototype.isNum || (String.prototype.isNum = function () { - return e(this) - }), String.prototype.endsWith || (String.prototype.endsWith = function (t, e) { - return (void 0 === e || e > this.length) && (e = this.length), this.substring(e - t.length, e) === t - }), String.prototype.startsWith || Object.defineProperty(String.prototype, "startsWith", { - value: function (t, e) { - return e = !e || e < 0 ? 0 : +e, this.substring(e, e + t.length) === t - } - }), String.prototype.includes || (String.prototype.includes = function () { - return String.prototype.indexOf.apply(this, arguments) !== -1 - })) -}(),/*! +!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var n={all:-1,left:0,middle:1,right:2},o=0;t.zui({uuid:function(t){var e=1e5*(Date.now()-1580890015292)+10*Math.floor(1e4*Math.random())+o++%10;return t?e:e.toString(36)},callEvent:function(t,e,n){if("function"==typeof t){n!==i&&(t=t.bind(n));var o=t(e);return e&&(e.result=o),!(o!==i&&!o)}return 1},strCode:function(t){var e=0;if("string"!=typeof t&&(t=String(t)),t&&t.length)for(var i=0;i=e.innerWidth)return 0;if(!t.zui._scrollbarWidth){var i=document.createElement("div");i.className="scrollbar-measure",document.body.appendChild(i),t.zui._scrollbarWidth=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return t.zui._scrollbarWidth},fixBodyScrollbar:function(){if(t.zui.checkBodyScrollbar()){var e=t("body"),i=parseInt(e.css("padding-right")||0,10);return t.zui._scrollbarWidth&&e.css({paddingRight:i+t.zui._scrollbarWidth,overflowY:"hidden"}),!0}},resetBodyScrollbar:function(){t("body").css({paddingRight:"",overflowY:""})}}),t.fn.callEvent=function(e,n,o){var a=t(this),s=e.indexOf(".zui."),r=s<0?e:e.substring(0,s),l=t.Event(r,n);if(o===i&&s>0&&(o=a.data(e.substring(s+1))),o&&o.options){var h=o.options[r];"function"==typeof h&&(l.result=t.zui.callEvent(h,l,o))}return a.trigger(l),l},t.fn.callComEvent=function(t,e,n){n===i||Array.isArray(n)||(n=[n]);var o,a=this;a.trigger(e,n);var s=t.options[e];return s&&(o=s.apply(t,n)),o}}(jQuery,window,void 0),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",n=function(i){t(i).on("click",e,this.close)};n.prototype.close=function(e){function n(){s.trigger("closed."+i).remove()}var o=t(this),a=o.attr("data-target");a||(a=o.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var s=t(a);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,n).emulateTransitionEnd(150):n())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),a=o.data(i);a||o.data(i,a=new n(this)),"string"==typeof e&&a[e].call(o)})},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click."+i+".data-api",e,n.prototype.close)}(window.jQuery),function(t,e){"use strict";var i="zui.pager",n={page:1,recTotal:0,recPerPage:10},o={zh_cn:{pageOfText:"第 {0} 页",prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 {page} 页",totalPage:"共 {totalPage} 页",totalCount:"共 {recTotal} 项",pageSize:"每页 {recPerPage} 项",itemsRange:"第 {start} ~ {end} 项",pageOfTotal:"第 {page}/{totalPage} 页"},zh_tw:{pageOfText:"第 {0} 頁",prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 {page} 頁",totalPage:"共 {totalPage} 頁",totalCount:"共 {recTotal} 項",pageSize:"每頁 {recPerPage} 項",itemsRange:"第 {start} ~ {end} 項",pageOfTotal:"第 {page}/{totalPage} 頁"},en:{pageOfText:"Page {0}",prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page {page}",totalPage:"{totalPage} pages",totalCount:"Total: {recTotal} items",pageSize:"{recPerPage} per page",itemsRange:"From {start} to {end}",pageOfTotal:"Page {page} of {totalPage}"}},a=function(e,n){var s=this;s.name=i,s.$=t(e),n=s.options=t.extend({},a.DEFAULTS,this.$.data(),n),s.langName=n.lang||t.zui.clientLang(),s.lang=t.zui.getLangData(i,s.langName,o),s.state={},s.set(n.page,n.recTotal,n.recPerPage,!0),s.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&s.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&s.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&s.set(-1,-1,e)})};a.prototype.set=function(e,i,o,a){var s=this;"object"==typeof e&&null!==e&&(o=e.recPerPage,i=e.recTotal,e=e.page);var r=s.state;r||(r=t.extend({},n));var l=t.extend({},r);return"number"==typeof o&&o>0&&(r.recPerPage=o),"number"==typeof i&&i>=0&&(r.recTotal=i),"number"==typeof e&&e>=0&&(r.page=e),r.totalPage=r.recTotal&&r.recPerPage?Math.ceil(r.recTotal/r.recPerPage):1,r.page=Math.max(0,Math.min(r.page,r.totalPage)),r.pageRecCount=r.recTotal,r.page&&r.recTotal&&(r.page1&&(r.pageRecCount=r.recTotal-r.recPerPage*(r.page-1))),r.skip=r.page>1?(r.page-1)*r.recPerPage:0,r.start=r.skip+1,r.end=r.skip+r.pageRecCount,r.prev=r.page>1?r.page-1:0,r.next=r.page').attr("href",i?a.createLink(i,a.state):"###").html(n);return o||(s=t("
  • ").append(s).toggleClass("active",i===a.state.page).toggleClass("disabled",!i||i===a.state.page)),s},a.prototype.createNavItems=function(t){var i=this,n=i.$,o=i.state,a=o.totalPage,s=o.page,r=function(t,o){if(t===!1)return void n.append(i.createLinkItem(0,o||i.options.navEllipsisItem));o===e&&(o=t);for(var a=t;a<=o;++a)n.append(i.createLinkItem(a))};t===e&&(t=i.options.maxNavCount||10),r(1),a>1&&(a<=t?r(2,a):sa-t+2?(r(!1),r(a-t+2,a)):(r(!1),r(s-Math.ceil((t-4)/2),s+Math.floor((t-4)/2)),r(!1),r(a)))},a.prototype.createGoto=function(){var e=this,i=this.state,n=t('
    ");return n},a.prototype.createSizeMenu=function(){var e=this,i=this.state,n=t(''),o=e.options.pageSizeOptions;"string"==typeof o&&(o=o.split(","));for(var a=0;a'+s+"
  • ").toggleClass("active",s===i.recPerPage);n.append(r)}return t('
    ').addClass(e.options.menuDirection).append(n)},a.prototype.createElement=function(e,i,n){var o=this,a=o.createLinkItem.bind(o),s=o.lang;switch(e){case"prev":return a(n.prev,s.prev);case"prev_icon":return a(n.prev,'');case"next":return a(n.next,s.next);case"next_icon":return a(n.next,'');case"first":return a(1,s.first);case"first_icon":return a(1,'');case"last":return a(n.totalPage,s.last);case"last_icon":return a(n.totalPage,'');case"space":case"|":return t('
  • ');case"nav":case"pages":return void o.createNavItems();case"total_text":return t(('
    '+s.totalCount+"
    ").format(n));case"page_text":return t(('
    '+s.pageOf+"
    ").format(n));case"total_page_text":return t(('
    '+s.totalPage+"
    ").format(n));case"page_of_total_text":return t(('
    '+s.pageOfTotal+"
    ").format(n));case"page_size_text":return t(('
    '+s.pageSize+"
    ").format(n));case"items_range_text":return t(('
    '+s.itemsRange+"
    ").format(n));case"goto":return o.createGoto();case"size_menu":return o.createSizeMenu();default:return t("
  • ").html(e.format(n))}},a.prototype.createLink=function(i,n){i===e&&(i=this.state.page),n===e&&(n=this.state);var o=this.options.linkCreator;return"string"==typeof o?o.format(t.extend({},n,{page:i})):"function"==typeof o?o(i,n):"#page="+i},a.prototype.render=function(e){var i=this,n=i.state,o=i.options.elementCreator||i.createElement,a=t.isPlainObject(o);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var s=0;s").append(h)),i.$.append(h))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),c&&c.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[n]),i},a.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},n),t.fn.pager=function(e){return this.each(function(){var n=t(this),o=n.data(i),s="object"==typeof e&&e;o||n.data(i,o=new a(this,s)),"string"==typeof e&&o[e]()})},a.NAME=i,a.LANG=o,t.fn.pager.Constructor=a,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,n=i.closest("ul:not(.dropdown-menu)"),o=i.attr("data-target")||i.attr("data-tab");if(o||(o=i.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=n.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:a});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(o);this.activate(i.parent("li"),n),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,n){function o(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var a=i.find("> .active"),s=n&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,o).emulateTransitionEnd(150):o(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=function(n){return this.each(function(){var o=t(this),a=o.data(e);a||o.data(e,a=new i(this)),"string"==typeof n&&a[n]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(n).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.$parent&&this.$parent.find(".in");if(n&&n.length){var o=n.data(e);if(o&&o.transitioning)return;n.collapse("hide"),o||n.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,s.bind(this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one(t.support.transition.end,o.bind(this)).emulateTransitionEnd(350):o.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=t.fn.collapse;t.fn.collapse=function(n){return this.each(function(){var o=t(this),a=o.data(e),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof n&&n);a||o.data(e,a=new i(this,s)),"string"==typeof n&&a[n]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var n,o=t(this),a=o.attr("data-target")||i.preventDefault()||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),s=t(a),r=s.data(e),l=r?"toggle":o.data(),h=o.attr("data-parent"),c=h&&t(h);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+h+'"]').not(o).addClass("collapsed"),o[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,n=992,o=768,a=e(t),s=function(){var t=a.width();e("html").toggleClass("screen-desktop",t>=n&&t=i).toggleClass("screen-tablet",t>=o&&t=n)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),a.resize(s),s()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var n=t("#browseHappyTip");n.length||(n=t('
    '),n.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),n.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t){"use strict";var e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},n=function(t){return i(t).getTime()},o=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e},a=function(t,e){return t.setTime(t.getTime()+e),t},s=function(t,i){return a(t,i*e)},r=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},h=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},c=function(t){return h(t.getFullYear(),t.getMonth())},d=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,c(t))),t},f=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=s(i,-1);return d(i)},p=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=f(t),n=s(r(i),7);return e>=i&&e1){var i;if(2==arguments.length&&"object"==typeof e)for(var n in e)void 0!==e[n]&&(i=new RegExp("({"+n+"})","g"),t=t.replace(i,e[n]));else for(var o=1;othis.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*! * jQuery resize event - v1.1 * http://benalman.com/projects/jquery-resize-plugin/ * Copyright (c) 2010 "Cowboy" Ben Alman * MIT & GPL http://benalman.com/about/license/ */ - function (t, e, i) { - "$:nomunge"; - - function n() { - o = e[r](function () { - a.each(function () { - var e = t(this), i = e.width(), n = e.height(), o = t.data(this, h); - i === o.w && n === o.h || e.trigger(l, [o.w = i, o.h = n]) - }), n() - }, s[c]) - } - - var o, a = t([]), s = t.resize = t.extend(t.resize, {}), r = "setTimeout", l = "resize", - h = l + "-special-event", c = "delay", d = "throttleWindow"; - s[c] = 250, s[d] = !0, t.event.special[l] = { - setup: function () { - if (!s[d] && this[r]) return !1; - var e = t(this); - a = a.add(e), t.data(this, h, {w: e.width(), h: e.height()}), 1 === a.length && n() - }, teardown: function () { - if (!s[d] && this[r]) return !1; - var e = t(this); - a = a.not(e), e.removeData(h), a.length || clearTimeout(o) - }, add: function (e) { - function n(e, n, a) { - var s = t(this), r = t.data(this, h) || {}; - r.w = n !== i ? n : s.width(), r.h = a !== i ? a : s.height(), o.apply(this, arguments) - } - - if (!s[d] && this[r]) return !1; - var o; - return "function" == typeof e ? (o = e, n) : (o = e.handler, void (e.handler = n)) - } - } - }(jQuery, this),/*! +function(t,e,i){"$:nomunge";function n(){o=e[r](function(){a.each(function(){var e=t(this),i=e.width(),n=e.height(),o=t.data(this,h);i===o.w&&n===o.h||e.trigger(l,[o.w=i,o.h=n])}),n()},s[c])}var o,a=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",h=l+"-special-event",c="delay",d="throttleWindow";s[c]=250,s[d]=!0,t.event.special[l]={setup:function(){if(!s[d]&&this[r])return!1;var e=t(this);a=a.add(e),t.data(this,h,{w:e.width(),h:e.height()}),1===a.length&&n()},teardown:function(){if(!s[d]&&this[r])return!1;var e=t(this);a=a.not(e),e.removeData(h),a.length||clearTimeout(o)},add:function(e){function n(e,n,a){var s=t(this),r=t.data(this,h)||{};r.w=n!==i?n:s.width(),r.h=a!==i?a:s.height(),o.apply(this,arguments)}if(!s[d]&&this[r])return!1;var o;return"function"==typeof e?(o=e,n):(o=e.handler,void(e.handler=n))}}}(jQuery,this),/*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * Copyright 2006, 2014 Klaus Hartl * Released under the MIT license */ - function (t) { - "function" == typeof define && define.amd ? define(["jquery"], t) : t("object" == typeof exports ? require("jquery") : jQuery) - }(function (t) { - function e(t) { - return r.raw ? t : encodeURIComponent(t) - } - - function i(t) { - return r.raw ? t : decodeURIComponent(t) - } - - function n(t) { - return e(r.json ? JSON.stringify(t) : String(t)) - } - - function o(t) { - 0 === t.indexOf('"') && (t = t.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")); - try { - return t = decodeURIComponent(t.replace(s, " ")), r.json ? JSON.parse(t) : t - } catch (e) { - } - } - - function a(t, e) { - var i = r.raw ? t : o(t); - return "function" == typeof e ? e(i) : i - } - - var s = /\+/g, r = t.cookie = function (o, s, l) { - if (void 0 !== s && "function" != typeof s) { - if (l = t.extend({}, r.defaults, l), "number" == typeof l.expires) { - var h = l.expires, c = l.expires = new Date; - c.setTime(+c + 864e5 * h) - } - return document.cookie = [e(o), "=", n(s), l.expires ? "; expires=" + l.expires.toUTCString() : "", l.path ? "; path=" + l.path : "", l.domain ? "; domain=" + l.domain : "", l.secure ? "; secure" : ""].join("") - } - for (var d = o ? void 0 : {}, u = document.cookie ? document.cookie.split("; ") : [], f = 0, p = u.length; f < p; f++) { - var g = u[f].split("="), m = i(g.shift()), v = g.join("="); - if (o && o === m) { - d = a(v, s); - break - } - o || void 0 === (v = a(v)) || (d[m] = v) - } - return d - }; - r.defaults = {}, t.removeCookie = function (e, i) { - return void 0 !== t.cookie(e) && (t.cookie(e, "", t.extend({}, i, {expires: -1})), !t.cookie(e)) - } - }), function (t, e) { - "use strict"; - var i, n, o = "localStorage", a = "page_" + t.location.pathname + t.location.search, s = function () { - this.silence = !0; - try { - o in t && t[o] && t[o].setItem && (this.enable = !0, i = t[o]) - } catch (s) { - } - this.enable || (n = {}, i = { - getLength: function () { - var t = 0; - return e.each(n, function () { - t++ - }), t - }, key: function (t) { - var i, o = 0; - return e.each(n, function (e) { - return o === t ? (i = e, !1) : void o++ - }), i - }, removeItem: function (t) { - delete n[t] - }, getItem: function (t) { - return n[t] - }, setItem: function (t, e) { - n[t] = e - }, clear: function () { - n = {} - } - }), this.storage = i, this.page = this.get(a, {}) - }; - s.prototype.pageSave = function () { - if (e.isEmptyObject(this.page)) this.remove(a); else { - var t, i = []; - for (t in this.page) { - var n = this.page[t]; - null === n && i.push(t) - } - for (t = i.length - 1; t >= 0; t--) delete this.page[i[t]]; - this.set(a, this.page) - } - }, s.prototype.pageRemove = function (t) { - "undefined" != typeof this.page[t] && (this.page[t] = null, this.pageSave()) - }, s.prototype.pageClear = function () { - this.page = {}, this.pageSave() - }, s.prototype.pageGet = function (t, e) { - var i = this.page[t]; - return void 0 === e || null !== i && void 0 !== i ? i : e - }, s.prototype.pageSet = function (t, i) { - e.isPlainObject(t) ? e.extend(!0, this.page, t) : this.page[this.serialize(t)] = i, this.pageSave() - }, s.prototype.check = function () { - if (!this.enable && !this.silence) throw new Error("Browser not support localStorage or enable status been set true."); - return this.enable - }, s.prototype.length = function () { - return this.check() ? i.getLength ? i.getLength() : i.length : 0 - }, s.prototype.removeItem = function (t) { - return i.removeItem(t), this - }, s.prototype.remove = function (t) { - return this.removeItem(t) - }, s.prototype.getItem = function (t) { - return i.getItem(t) - }, s.prototype.get = function (t, e) { - var i = this.deserialize(this.getItem(t)); - return "undefined" != typeof i && null !== i || "undefined" == typeof e ? i : e - }, s.prototype.key = function (t) { - return i.key(t) - }, s.prototype.setItem = function (t, e) { - return i.setItem(t, e), this - }, s.prototype.set = function (t, e) { - return void 0 === e ? this.remove(t) : (this.setItem(t, this.serialize(e)), this) - }, s.prototype.clear = function () { - return i.clear(), this - }, s.prototype.forEach = function (t) { - for (var e = this.length(), n = e - 1; n >= 0; n--) { - var o = i.key(n); - t(o, this.get(o)) - } - return this - }, s.prototype.getAll = function () { - var t = {}; - return this.forEach(function (e, i) { - t[e] = i - }), t - }, s.prototype.serialize = function (t) { - return "string" == typeof t ? t : JSON.stringify(t) - }, s.prototype.deserialize = function (t) { - if ("string" == typeof t) try { - return JSON.parse(t) - } catch (e) { - return t || void 0 - } - }, e.zui({store: new s}) -}(window, jQuery), function (t) { - "use strict"; - var e = "zui.searchBox", i = function (e, n) { - var o = this; - o.name = name, o.$ = t(e), o.options = n = t.extend({}, i.DEFAULTS, o.$.data(), n); - var a = o.$.is(n.inputSelector) ? o.$ : o.$.find(n.inputSelector); - if (a.length) { - var s = function () { - o.changeTimer && (clearTimeout(o.changeTimer), o.changeTimer = null) - }, r = function () { - s(); - var t = o.getSearch(); - if (t !== o.lastValue) { - var e = "" === t; - a.toggleClass("empty", e), o.$.callComEvent(o, "onSearchChange", [t, e]), o.lastValue = t - } - }; - o.$input = a = a.first(), a.on(n.listenEvent, function (t) { - o.changeTimer = setTimeout(function () { - r() - }, n.changeDelay) - }).on("focus", function (t) { - a.addClass("focus"), o.$.callComEvent(o, "onFocus", [t]) - }).on("blur", function (t) { - a.removeClass("focus"), o.$.callComEvent(o, "onBlur", [t]) - }).on("keydown", function (t) { - var e = 0, i = t.which; - 27 === i && n.escToClear ? (this.setSearch("", !0), r(), e = 1) : 13 === i && n.onPressEnter && (r(), o.$.callComEvent(o, "onPressEnter", [t])); - var a = o.$.callComEvent(o, "onKeyDown", [t]); - a === !1 && (e = 1), e && t.preventDefault() - }), o.$.on("click", ".search-clear-btn", function (t) { - o.setSearch("", !0), r(), o.focus(), t.preventDefault() - }), r() - } else console.error("ZUI: search box init error, cannot find search box input element.") - }; - i.DEFAULTS = { - inputSelector: 'input[type="search"],input[type="text"]', - listenEvent: "change input paste", - changeDelay: 500 - }, i.prototype.getSearch = function () { - return this.$input && t.trim(this.$input.val()) - }, i.prototype.setSearch = function (t, e) { - var i = this.$input; - i && (i.val(t), e || i.trigger("change")) - }, i.prototype.focus = function () { - this.$input && this.$input.focus() - }, t.fn.searchBox = function (n) { - return this.each(function () { - var o = t(this), a = o.data(e), s = "object" == typeof n && n; - a || o.data(e, a = new i(this, s)), "string" == typeof n && a[n]() - }) - }, i.NAME = e, t.fn.searchBox.Constructor = i -}(jQuery), function (t, e) { - "use strict"; - var i = "zui.draggable", n = {container: "body", move: !0}, o = 0, a = function (e, i) { - var a = this; - a.$ = t(e), a.id = o++, a.options = t.extend({}, n, a.$.data(), i), a.init() - }; - a.DEFAULTS = n, a.NAME = i, a.prototype.init = function () { - var n, o, a, s, r, l = this, h = l.$, c = "before", d = "drag", u = "finish", f = "." + i + "." + l.id, - p = "mousedown" + f, g = "mouseup" + f, m = "mousemove" + f, v = l.options, y = v.selector, b = v.handle, - w = h, x = "function" == typeof v.move, C = function (t) { - var e = t.pageX, i = t.pageY; - r = !0; - var o = {left: e - a.x, top: i - a.y}; - w.removeClass("drag-ready").addClass("dragging"), v.move && (x ? v.move(o, w) : w.css(o)), v[d] && v[d]({ - event: t, - element: w, - startOffset: a, - pos: o, - offset: {x: e - n.x, y: i - n.y}, - smallOffset: {x: e - s.x, y: i - s.y} - }), s.x = e, s.y = i, v.stopPropagation && t.stopPropagation() - }, _ = function (i) { - if (t(e).off(f), !r) return void w.removeClass("drag-ready"); - var o = {left: i.pageX - a.x, top: i.pageY - a.y}; - w.removeClass("drag-ready dragging"), v.move && (x ? v.move(o, w) : w.css(o)), v[u] && v[u]({ - event: i, - element: w, - startOffset: a, - pos: o, - offset: {x: i.pageX - n.x, y: i.pageY - n.y}, - smallOffset: {x: i.pageX - s.x, y: i.pageY - s.y} - }), i.preventDefault(), v.stopPropagation && i.stopPropagation() - }, k = function (i) { - var l = t.zui.getMouseButtonCode(v.mouseButton); - if (!(l > -1 && i.button !== l)) { - var h = t(this); - if (y && (w = b ? h.closest(y) : h), v[c]) { - var d = v[c]({event: i, element: w}); - if (d === !1) return - } - var u = t(v.container), f = w.offset(); - o = u.offset(), n = {x: i.pageX, y: i.pageY}, a = { - x: i.pageX - f.left + o.left, - y: i.pageY - f.top + o.top - }, s = t.extend({}, n), r = !1, w.addClass("drag-ready"), i.preventDefault(), v.stopPropagation && i.stopPropagation(), t(e).on(m, C).on(g, _) - } - }; - b ? h.on(p, b, k) : y ? h.on(p, y, k) : h.on(p, k) - }, a.prototype.destroy = function () { - var n = "." + i + "." + this.id; - this.$.off(n), t(e).off(n), this.$.data(i, null) - }, t.fn.draggable = function (e) { - return this.each(function () { - var n = t(this), o = n.data(i), s = "object" == typeof e && e; - o || n.data(i, o = new a(this, s)), "string" == typeof e && o[e]() - }) - }, t.fn.draggable.Constructor = a -}(jQuery, document), function (t, e, i) { - "use strict"; - var n = "zui.droppable", - o = {target: ".droppable-target", deviation: 5, sensorOffsetX: 0, sensorOffsetY: 0, dropToClass: "drop-to"}, - a = 0, s = function (e, i) { - var n = this; - n.id = a++, n.$ = t(e), n.options = t.extend({}, o, n.$.data(), i), n.init() - }; - s.DEFAULTS = o, s.NAME = n, s.prototype.trigger = function (e, i) { - return t.zui.callEvent(this.options[e], i, this) - }, s.prototype.init = function () { - var o, a, s, r, l, h, c, d, u, f, p, g, m, v = this, y = v.$, b = v.options, w = b.deviation, - x = "." + n + "." + v.id, C = "mousedown" + x, _ = "mouseup" + x, k = "mousemove" + x, T = b.selector, - S = b.handle, D = b.flex, M = b.container, P = b.canMoveHere, z = b.dropToClass, L = y, F = !1, - I = M ? t(b.container).first() : T ? y : t("body"), $ = function (e) { - if (F && (p = {left: e.pageX, top: e.pageY}, !(i.abs(p.left - d.left) < w && i.abs(p.top - d.top) < w))) { - if (null === s) { - var n = I.css("position"); - "absolute" != n && "relative" != n && "fixed" != n && (h = n, I.css("position", "relative")), s = L.clone().removeClass("drag-from").addClass("drag-shadow").css({ - position: "absolute", - width: L.outerWidth(), - transition: "none" - }).appendTo(I), L.addClass("dragging"), v.trigger("start", { - event: e, - element: L, - shadowElement: s, - targets: o - }) - } - var c = {left: p.left - f.left, top: p.top - f.top}, m = {left: c.left - u.left, top: c.top - u.top}; - s.css(m), t.extend(g, p); - var y = !1; - r = !1, D || o.removeClass(z); - var x = null; - if (o.each(function () { - var e = t(this), i = e.offset(), n = e.outerWidth(), o = e.outerHeight(), - a = i.left + b.sensorOffsetX, s = i.top + b.sensorOffsetY; - if (p.left > a && p.top > s && p.left < a + n && p.top < s + o && (x && x.removeClass(z), x = e, !b.nested)) return !1 - }), x) { - r = !0; - var C = x.data("id"); - L.data("id") != C && (l = !1), (null === a || a.data("id") !== C && !l) && (y = !0), a = x, D && o.removeClass(z), a.addClass(z) - } - D ? null !== a && a.length && (r = !0) : (L.toggleClass("drop-in", r), s.toggleClass("drop-in", r)), P && P(L, a) === !1 || v.trigger("drag", { - event: e, - isIn: r, - target: a, - element: L, - isNew: y, - selfTarget: l, - clickOffset: f, - offset: c, - position: {left: c.left - u.left, top: c.top - u.top}, - mouseOffset: p - }), e.preventDefault() - } - }, A = function (i) { - if (t(e).off(x), clearTimeout(m), F) { - if (F = !1, h && I.css("position", h), null === s) return L.removeClass("drag-from"), void v.trigger("always", { - event: i, - cancel: !0 - }); - r || (a = null); - var n = !0; - p = i ? {left: i.pageX, top: i.pageY} : g; - var c = {left: p.left - f.left, top: p.top - f.top}, d = {left: p.left - g.left, top: p.top - g.top}; - g.left = p.left, g.top = p.top; - var y = { - event: i, - isIn: r, - target: a, - element: L, - isNew: !l && null !== a, - selfTarget: l, - offset: c, - mouseOffset: p, - position: {left: c.left - u.left, top: c.top - u.top}, - lastMouseOffset: g, - moveOffset: d - }; - n = v.trigger("beforeDrop", y), n && r && v.trigger("drop", y), o.removeClass(z), L.removeClass("dragging").removeClass("drag-from"), s.remove(), s = null, v.trigger("finish", y), v.trigger("always", y), i && i.preventDefault() - } - }, E = function (i) { - var n = t.zui.getMouseButtonCode(b.mouseButton); - if (!(n > -1 && i.button !== n)) { - var p = t(this); - T && (L = S ? p.closest(T) : p), L.hasClass("drag-shadow") || b.before && b.before({ - event: i, - element: L - }) === !1 || (F = !0, o = "function" == typeof b.target ? b.target(L, y) : I.find(b.target), a = null, s = null, r = !1, l = !0, h = null, c = L.offset(), u = I.offset(), u.top = u.top - I.scrollTop(), u.left = u.left - I.scrollLeft(), d = { - left: i.pageX, - top: i.pageY - }, g = t.extend({}, d), f = { - left: d.left - c.left, - top: d.top - c.top - }, L.addClass("drag-from"), t(e).on(k, $).on(_, A), m = setTimeout(function () { - t(e).on(C, A) - }, 10), i.preventDefault(), b.stopPropagation && i.stopPropagation()) - } - }; - S ? y.on(C, S, E) : T ? y.on(C, T, E) : y.on(C, E) - }, s.prototype.destroy = function () { - var i = "." + n + "." + this.id; - this.$.off(i), t(e).off(i), this.$.data(n, null) - }, s.prototype.reset = function () { - this.destroy(), this.init() - }, t.fn.droppable = function (e) { - return this.each(function () { - var i = t(this), o = i.data(n), a = "object" == typeof e && e; - o || i.data(n, o = new s(this, a)), "string" == typeof e && o[e]() - }) - }, t.fn.droppable.Constructor = s -}(jQuery, document, Math), +function (t, e) { - "use strict"; - - function i(e, i, a) { - return this.each(function () { - var s = t(this), r = s.data(n), l = t.extend({}, o.DEFAULTS, s.data(), "object" == typeof e && e); - r || s.data(n, r = new o(this, l)), "string" == typeof e ? r[e](i, a) : l.show && r.show(i, a) - }) - } - - var n = "zui.modal", o = function (i, o) { - var a = this; - a.options = o, a.$body = t(document.body), a.$element = t(i), a.$backdrop = a.isShown = null, a.scrollbarWidth = 0, o.moveable === e && (a.options.moveable = a.$element.hasClass("modal-moveable")), o.remote && a.$element.find(".modal-content").load(o.remote, function () { - a.$element.trigger("loaded." + n) - }), o.scrollInside && t(window).on("resize." + n, function () { - a.isShown && a.adjustPosition(e, 100) - }) - }; - o.VERSION = "3.2.0", o.TRANSITION_DURATION = 300, o.BACKDROP_TRANSITION_DURATION = 150, o.DEFAULTS = { - backdrop: !0, - keyboard: !0, - show: !0, - position: "fit" - }; - var a = function (e, i) { - var n = t(window); - i.left = Math.max(0, Math.min(i.left, n.width() - e.outerWidth())), i.top = Math.max(0, Math.min(i.top, n.height() - e.outerHeight())), e.css(i) - }; - o.prototype.toggle = function (t, e) { - return this.isShown ? this.hide() : this.show(t, e) - }, o.prototype.adjustPosition = function (i, o) { - var s = this; - if (clearTimeout(s.reposTask), o) return void (s.reposTask = setTimeout(s.adjustPosition.bind(s, i, 0), o)); - var r = s.options; - if (i === e && (i = r.position), i !== e && null !== i) { - "function" == typeof i && (i = i(s)); - var l = s.$element.find(".modal-dialog"), h = t(window).height(), - c = {maxHeight: "initial", overflow: "visible"}, d = l.find(".modal-body").css(c); - if (r.scrollInside && d.length) { - var u = r.headerHeight, f = r.footerHeight, p = l.find(".modal-header"), g = l.find(".modal-footer"); - "number" != typeof u && (u = p.length ? p.outerHeight() : "function" == typeof u ? u(p) : 0), "number" != typeof f && (f = g.length ? g.outerHeight() : "function" == typeof f ? f(g) : 0), c.maxHeight = h - u - f, c.overflow = d[0].scrollHeight > c.maxHeight ? "auto" : "visible", d.css(c) - } - var m = Math.max(0, (h - l.outerHeight()) / 2); - if ("fit" === i ? i = {top: m > 50 ? Math.floor(2 * m / 3) : m} : "center" === i ? i = {top: m} : t.isPlainObject(i) || (i = {top: i}), l.hasClass("modal-moveable")) { - var v = null, y = r.rememberPos; - y && (y === !0 ? v = s.$element.data("modal-pos") : t.zui.store && (v = t.zui.store.pageGet(n + ".rememberPos." + y))), i = t.extend(i, {left: Math.max(0, (t(window).width() - l.outerWidth()) / 2)}, v), "inside" === r.moveable ? a(l, i) : l.css(i) - } else l.css(i) - } - }, o.prototype.setMoveable = function () { - t.fn.draggable || console.error("Moveable modal requires draggable.js."); - var e = this, i = e.options, o = e.$element.find(".modal-dialog").removeClass("modal-dragged"); - o.toggleClass("modal-moveable", !!i.moveable), e.$element.data("modal-moveable-setup") || o.draggable({ - container: e.$element, - handle: ".modal-header", - before: function () { - var t = o.css("margin-top"); - t && "0px" !== t && o.css("top", t).css("margin-top", "").addClass("modal-dragged") - }, - finish: function (o) { - var a = i.rememberPos; - a && (e.$element.data("modal-pos", o.pos), t.zui.store && a !== !0 && t.zui.store.pageSet(n + ".rememberPos." + a, o.pos)) - }, - move: "inside" !== i.moveable || function (t) { - a(o, t) - } - }) - }, o.prototype.show = function (e, i) { - var a = this, s = t.Event("show." + n, {relatedTarget: e}); - a.$element.trigger(s), a.$element.toggleClass("modal-scroll-inside", !!a.options.scrollInside), a.isShown || s.isDefaultPrevented() || (a.isShown = !0, a.options.moveable && a.setMoveable(), a.options.backdrop !== !1 && (a.setScrollbar(), a.$body.addClass("modal-open")), a.escape(), a.$element.on("click.dismiss." + n, '[data-dismiss="modal"]', function (t) { - a.hide(), t.stopPropagation() - }), a.backdrop(function () { - var s = t.support.transition && a.$element.hasClass("fade"); - a.$element.parent().length || a.$element.appendTo(a.$body), a.$element.show().scrollTop(0), s && a.$element[0].offsetWidth, a.$element.addClass("in").attr("aria-hidden", !1), a.adjustPosition(i), a.enforceFocus(); - var r = t.Event("shown." + n, {relatedTarget: e}); - s ? a.$element.find(".modal-dialog").one("bsTransitionEnd", function () { - a.$element.trigger("focus").trigger(r) - }).emulateTransitionEnd(o.TRANSITION_DURATION) : a.$element.trigger("focus").trigger(r) - })) - }, o.prototype.hide = function (e) { - e && e.preventDefault && e.preventDefault(); - var i = this; - e = t.Event("hide." + n), i.$element.trigger(e), i.isShown && !e.isDefaultPrevented() && (i.isShown = !1, i.options.backdrop !== !1 && (i.$body.removeClass("modal-open"), i.resetScrollbar()), i.escape(), t(document).off("focusin." + n), i.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss." + n), t.support.transition && i.$element.hasClass("fade") ? i.$element.one("bsTransitionEnd", i.hideModal.bind(i)).emulateTransitionEnd(o.TRANSITION_DURATION) : i.hideModal()) - }, o.prototype.enforceFocus = function () { - t(document).off("focusin." + n).on("focusin." + n, function (t) { - this.$element[0] === t.target || this.$element.has(t.target).length || this.$element.trigger("focus") - }.bind(this)) - }, o.prototype.escape = function () { - this.isShown && this.options.keyboard ? t(document).on("keydown.dismiss." + n, function (i) { - if (27 == i.which) { - var o = t.Event("escaping." + n), a = this.$element.triggerHandler(o, "esc"); - if (a != e && !a) return; - this.hide() - } - }.bind(this)) : this.isShown || t(document).off("keydown.dismiss." + n) - }, o.prototype.hideModal = function () { - var t = this; - this.$element.hide(), this.backdrop(function () { - t.$element.trigger("hidden." + n) - }) - }, o.prototype.removeBackdrop = function () { - this.$backdrop && this.$backdrop.remove(), this.$backdrop = null - }, o.prototype.backdrop = function (e) { - var i = this, a = this.$element.hasClass("fade") ? "fade" : ""; - if (this.isShown && this.options.backdrop) { - var s = t.support.transition && a; - if (this.$backdrop = t('
  • ').appendTo("body").data(n,i);var s=function(t,i,n){n=n||e[t],"function"==typeof n&&o.on(i+a,n)};s("onShow","show"),s("shown","shown"),s("onHide","hide",function(t){if("iframe"===e.type&&i.$iframeBody){var n=i.$iframeBody.triggerHandler("modalhide"+a,[i]);n===!1&&t.preventDefault()}var o=e.onHide;if(o)return o(t)}),s("hidden","hidden"),s("loaded","loaded"),o.on("shown"+a,function(){i.isShown=!0}).on("hidden"+a,function(){i.isShown=!1}),this.$modal=o,this.$dialog=o.find(".modal-dialog"),e.mergeOptions&&(this.options=e)},r.prototype.show=function(i){var a=this,l=t.extend({},r.DEFAULTS,a.options,{url:a.$trigger?a.$trigger.attr("href")||a.$trigger.attr("data-url")||a.$trigger.data("url"):a.options.url},i),h=a.isShown;l=a.initOptions(l),h||a.init(l);var c=a.$modal,d=c.find(".modal-dialog"),u=l.custom,f=d.find(".modal-body").css("padding","").toggleClass("load-indicator loading",!!h),p=d.find(".modal-header"),g=d.find(".modal-content");c.toggleClass("fade",l.fade).addClass(l.className).toggleClass("modal-loading",!h).toggleClass("modal-scroll-inside",!!l.scrollInside),d.toggleClass("modal-md","md"===l.size).toggleClass("modal-sm","sm"===l.size).toggleClass("modal-lg","lg"===l.size).toggleClass("modal-fullscreen","fullscreen"===l.size),p.toggle(l.showHeader),p.find(".modal-icon").attr("class","modal-icon icon-"+l.icon),p.find(".modal-title-name").text(l.title||""),l.size&&"fullscreen"===l.size&&(l.width="",l.height="");var m=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){a.adjustPosition(l.position)},100)},v=function(t,e){return"undefined"==typeof t&&(t=l.delay),setTimeout(function(){d=c.find(".modal-dialog"),l.width&&"auto"!=l.width&&d.css("width",l.width),l.height&&"auto"!=l.height&&(d.css("height",l.height),"iframe"===l.type&&f.css("height",d.height()-p.outerHeight())),a.adjustPosition(l.position),c.removeClass("modal-loading").removeClass("modal-updating"),h&&f.removeClass("loading"),"iframe"!=l.type&&(f=d.off("resize."+n).find(".modal-body").off("resize."+n),l.scrollInside&&(f=f.children().off("resize."+n)),(f.length?f:d).on("resize."+n,m)),e&&e()},t)};if("custom"===l.type&&u)if("function"==typeof u){var y=u({modal:c,options:l,modalTrigger:a,ready:v});typeof y===s&&(f.html(y),v())}else u instanceof t?(f.html(t("
    ").append(u.clone()).html()),v()):(f.html(u),v());else if(l.url){var b=function(){var t=c.callComEvent(a,"broken");"string"==typeof t&&f.html(t),v()};if(c.attr("ref",l.url),"iframe"===l.type){c.addClass("modal-iframe"),this.firstLoad=!0;var w="iframe-"+l.name;p.detach(),f.detach(),g.empty().append(p).append(f),f.css("padding",0).html(''),l.waittime>0&&(a.waitTimeout=v(l.waittime,b));var x=document.getElementById(w);x.onload=x.onreadystatechange=function(i){var o=!!l.scrollInside;if(a.firstLoad&&c.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){a.firstLoad=!1,l.waittime>0&&clearTimeout(a.waitTimeout);try{c.attr("ref",x.contentWindow.location.href);var s=e.frames[w].$;if(s&&"auto"===l.height&&"fullscreen"!=l.size){var r=s("body").addClass("body-modal").toggleClass("body-modal-scroll-inside",o);a.$iframeBody=r,l.iframeBodyClass&&r.addClass(l.iframeBodyClass);var h=[],d=function(i){c.removeClass("fade");var n=r.outerHeight();if(i===!0&&l.onlyIncreaseHeight&&(n=Math.max(n,f.data("minModalHeight")||0),f.data("minModalHeight",n)),o){var a=l.headerHeight;"number"!=typeof a?a=p.outerHeight():"function"==typeof a&&(a=a(p));var s=t(e).height();n=Math.min(n,s-a)}for(h.length>1&&n===h[0]&&(n=Math.max(n,h[1])),h.push(n);h.length>2;)h.shift();f.css("height",n),l.fade&&c.addClass("fade"),v()};c.callComEvent(a,"loaded",{modalType:"iframe",jQuery:s}),setTimeout(d,100),r.off("resize."+n).on("resize."+n,d),o&&t(e).off("resize."+n).on("resize."+n,d)}else v();var u=l.handleLinkInIframe;u&&s("body").on("click","string"==typeof u?u:"a[href]",function(){t(this).is('[data-toggle="modal"]')||c.addClass("modal-updating")}),l.iframeStyle&&s("head").append("")}catch(i){v()}}}}else t.ajax(t.extend({url:l.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?d.parent().empty().append(s):s.filter(".modal-content").length?d.find(".modal-content").replaceWith(s):f.wrapInner(s)}catch(r){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:r,data:i}),c.html(i)}c.callComEvent(a,"loaded",{modalType:o}),v(),l.scrollInside&&t(e).off("resize."+n).on("resize."+n,m)},error:b},l.ajaxOptions))}h||c.modal({show:"show",backdrop:l.backdrop,moveable:l.moveable,rememberPos:l.rememberPos,keyboard:l.keyboard,scrollInside:l.scrollInside})},r.prototype.close=function(t,i){var n=this;(t||i)&&n.$modal.on("hidden"+a,function(){"function"==typeof t&&t(),typeof i===s&&i.length&&!n.$modal.data("cancel-reload")&&("this"===i?e.location.reload():e.location=i)}),n.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.adjustPosition=function(t){t=t===i?this.options.position:t,"function"==typeof t&&(t=t(this)),this.$modal.modal("adjustPosition",t)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var o=t(this),a=o.data(n),l=t.extend({title:o.attr("title")||o.text(),url:o.attr("href"),type:o.hasClass("iframe")?"iframe":""},o.data(),t.isPlainObject(e)&&e);return a?void(typeof e==s?a[e](i):l.show&&a.show(i)):(o.data(n,a=new r(l,o)),void o.on((l.trigger||"click")+".toggle."+n,function(e){l=t.extend(l,{url:o.attr("href")||o.attr("data-url")||o.data("url")||l.url}),a.toggle(l),o.is("a")&&e.preventDefault()}))})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var n=t(this);n.hasClass("modal")?l.call(n,e,i):n.modalTrigger(e,i)})},t.fn.modal.bs=l;var h=function(e){return e?e=t(e):(e=t(".modal.modal-trigger"),!e.length),e&&e instanceof t?e:null},c=function(i,o,a){var s=i;if("function"==typeof i){var r=a;a=o,o=i,i=r}i=h(i),i&&i.length?i.each(function(){t(this).data(n).close(o,a)}):t("body").hasClass("modal-open")||t(".modal.in").length||t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(s,o,a)},d=function(t,e){e=h(e),e&&e.length&&e.modal("adjustPosition",t)},u=function(e,i){"string"==typeof e&&(e={url:e});var o=h(i);o&&o.length&&o.each(function(){t(this).data(n).show(e)})};t.zui({reloadModal:u,closeModal:c,ajustModalPosition:d,adjustModalPosition:d}),t(document).on("click."+n+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),o=i.attr("href"),a=null;try{a=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}a&&a.length||(i.data(n)?i.trigger(".toggle."+n):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+n+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,n){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n);for(var o=this.options.trigger.split(" "),a=o.length;a--;){var s=o[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,this.toggle.bind(this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,this.enter.bind(this)),this.$element.on(l+"."+this.type,this.options.selector,this.leave.bind(this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,n){i[t]!=n&&(e[t]=n)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var n=this;if(n.$element.trigger(i),i.isDefaultPrevented())return;var o=n.tip();n.setContent(e),n.options.animation&&o.addClass("fade");var a="function"==typeof n.options.placement?n.options.placement.call(n,o[0],n.$element[0]):n.options.placement,s=/\s?auto?\s?/i,r=s.test(a);r&&(a=a.replace(s,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(a),n.options.container?o.appendTo(n.options.container):o.insertAfter(n.$element);var l=n.getPosition(),h=o[0].offsetWidth,c=o[0].offsetHeight;if(r){var d=n.$element.parent(),u=a,f=document.documentElement.scrollTop||document.body.scrollTop,p="body"==n.options.container?window.innerWidth:d.outerWidth(),g="body"==n.options.container?window.innerHeight:d.outerHeight(),m="body"==n.options.container?0:d.offset().left;a="bottom"==a&&l.top+l.height+c-f>g?"top":"top"==a&&l.top-f-c<0?"bottom":"right"==a&&l.right+h>p?"left":"left"==a&&l.left-h

    '}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](n),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,n=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!n&&("$next"==n?e.next(".popover"):t(n))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var n=t(this),o=n.data("zui.popover"),a="object"==typeof i&&i;o||n.data("zui.popover",o=new e(this,a)),"string"==typeof i&&o[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(e){t(o).remove(),t(a).each(function(e){var o=i(t(this));o.hasClass("open")&&(o.trigger(e=t.Event("hide."+n)),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden."+n))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n;try{n=i&&t(i)}catch(o){}return n&&n.length?n:e.parent()}var n="zui.dropdown",o=".dropdown-backdrop",a="[data-toggle=dropdown]",s=function(e){t(e).on("click."+n,this.toggle)};s.prototype.toggle=function(o){var a=t(this);if(!a.is(".disabled, :disabled")){var s=i(a),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('',a={icons:{},type:"default",placement:"top",time:4e3,parent:"body",close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)?r=t.extend({},r,e):e&&(r?r.content=e:r={content:e});var l=this;r=l.options=t.extend({},a,r),l.id=r.id||n++;var h=s[l.id];h&&h.destroy(),s[l.id]=l,l.$=t(o.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var c=!1,d=l.$.find(".messager-actions"),u=function(e){var n=t('
    ' + this.lang.daysMin[t++ % 7] + "
    ' + b.getUTCDate() + "
    ' + a.headTemplate + a.contTemplate + a.footTemplate + '
    ' + a.headTemplate + a.contTemplate + a.footTemplate + '
    ' + a.headTemplate + "" + a.footTemplate + '
    ' + a.headTemplate + a.contTemplate + a.footTemplate + '
    ' + a.headTemplate + a.contTemplate + a.footTemplate + "
    ", t.fn.datetimepicker.DPGlobal = a, t.fn.datetimepicker.noConflict = function () { - return t.fn.datetimepicker = old, this - }, t(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api", '[data-provide="datetimepicker"]', function (e) { - var i = t(this); - i.data("datetimepicker") || (e.preventDefault(), i.datetimepicker("show")) - }), t(function () { - t('[data-provide="datetimepicker-inline"]').datetimepicker() - }) - }(window.jQuery),/*! bootbox.js v4.4.0 http://bootboxjs.com/license.txt */ - function (t, e) { - "use strict"; - "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e(require("jquery")) : t.bootbox = e(t.jQuery) - }(this, function t(e, i) { - "use strict"; - - function n(t) { - var i = e.zui && e.zui.getLangData ? e.zui.getLangData("bootbox", p.locale, m) : m[p.locale]; - return i ? i[t] : m.en[t] - } - - function o(t, e, i) { - t.stopPropagation(), t.preventDefault(); - var n = "function" == typeof i && i.call(e, t) === !1; - n || e.modal("hide") - } - - function a(t) { - var e, i = 0; - for (e in t) i++; - return i - } - - function s(t, i) { - var n = 0; - e.each(t, function (t, e) { - i(t, e, n++) - }) - } - - function r(t) { - var i, n; - if ("object" != typeof t) throw new Error("Please supply an object of options"); - if (!t.message) throw new Error("Please specify a message"); - return t = e.extend({}, p, t), t.buttons || (t.buttons = {}), i = t.buttons, n = a(i), s(i, function (t, o, a) { - if ("function" == typeof o && (o = i[t] = {callback: o}), "object" !== e.type(o)) throw new Error("button with key " + t + " must be an object"); - o.label || (o.label = t), o.className || (2 === n && ("ok" === t || "confirm" === t) || 1 === n ? o.className = "btn-primary" : o.className = "btn-default") - }), t - } - - function l(t, e) { - var i = t.length, n = {}; - if (i < 1 || i > 2) throw new Error("Invalid argument length"); - return 2 === i || "string" == typeof t[0] ? (n[e[0]] = t[0], n[e[1]] = t[1]) : n = t[0], n - } - - function h(t, i, n) { - return e.extend(!0, {}, t, l(i, n)) - } - - function c(t, e, i, n) { - var o = {className: "bootbox-" + t, buttons: d.apply(null, e)}; - return u(h(o, n, i), e) - } - - function d() { - for (var t = {}, e = 0, i = arguments.length; e < i; e++) { - var o = arguments[e], a = o.toLowerCase(), s = o.toUpperCase(); - t[a] = {label: n(s)} - } - return t - } - - function u(t, e) { - var n = {}; - return s(e, function (t, e) { - n[e] = !0 - }), s(t.buttons, function (t) { - if (n[t] === i) throw new Error("button key " + t + " is not allowed (options are " + e.join("\n") + ")") - }), t - } - - var f = { - dialog: "", - header: "", - footer: "", - closeButton: "", - form: "", - inputs: { - text: "", - textarea: "", - email: "", - select: "", - checkbox: "
    ", - date: "", - time: "", - number: "", - password: "" - } - }, p = { - locale: e.zui && e.zui.clientLang ? e.zui.clientLang() : "en", - backdrop: "static", - animate: !0, - className: null, - closeButton: !0, - show: !0, - container: "body" - }, g = {}; - g.alert = function () { - var t; - if (t = c("alert", ["ok"], ["message", "callback"], arguments), t.callback && "function" != typeof t.callback) throw new Error("alert requires callback property to be a function when provided"); - return t.buttons.ok.callback = t.onEscape = function () { - return "function" != typeof t.callback || t.callback.call(this) - }, g.dialog(t) - }, g.confirm = function () { - var t; - if (t = c("confirm", ["confirm", "cancel"], ["message", "callback"], arguments), t.buttons.cancel.callback = t.onEscape = function () { - return t.callback.call(this, !1) - }, t.buttons.confirm.callback = function () { - return t.callback.call(this, !0) - }, "function" != typeof t.callback) throw new Error("confirm requires a callback"); - return g.dialog(t) - }, g.prompt = function () { - var t, n, o, a, r, l, c; - if (a = e(f.form), n = { - className: "bootbox-prompt", - buttons: d("cancel", "confirm"), - value: "", - inputType: "text" - }, t = u(h(n, arguments, ["title", "callback"]), ["confirm", "cancel"]), l = t.show === i || t.show, t.message = a, t.buttons.cancel.callback = t.onEscape = function () { - return t.callback.call(this, null) - }, t.buttons.confirm.callback = function () { - var i; - switch (t.inputType) { - case"text": - case"textarea": - case"email": - case"select": - case"date": - case"time": - case"number": - case"password": - i = r.val(); - break; - case"checkbox": - var n = r.find("input:checked"); - i = [], s(n, function (t, n) { - i.push(e(n).val()) - }) - } - return t.callback.call(this, i) - }, t.show = !1, !t.title) throw new Error("prompt requires a title"); - if ("function" != typeof t.callback) throw new Error("prompt requires a callback"); - if (!f.inputs[t.inputType]) throw new Error("invalid prompt type"); - switch (r = e(f.inputs[t.inputType]), t.inputType) { - case"text": - case"textarea": - case"email": - case"date": - case"time": - case"number": - case"password": - r.val(t.value); - break; - case"select": - var p = {}; - if (c = t.inputOptions || [], !Array.isArray(c)) throw new Error("Please pass an array of input options"); - if (!c.length) throw new Error("prompt with select requires options"); - s(c, function (t, n) { - var o = r; - if (n.value === i || n.text === i) throw new Error("given options in wrong format"); - n.group && (p[n.group] || (p[n.group] = e("").attr("label", n.group)), o = p[n.group]), o.append("") - }), s(p, function (t, e) { - r.append(e) - }), r.val(t.value); - break; - case"checkbox": - var m = Array.isArray(t.value) ? t.value : [t.value]; - if (c = t.inputOptions || [], !c.length) throw new Error("prompt with checkbox requires options"); - if (!c[0].value || !c[0].text) throw new Error("given options in wrong format"); - r = e("
    "), s(c, function (i, n) { - var o = e(f.inputs[t.inputType]); - o.find("input").attr("value", n.value), o.find("label").append(n.text), s(m, function (t, e) { - e === n.value && o.find("input").prop("checked", !0) - }), r.append(o) - }) - } - return t.placeholder && r.attr("placeholder", t.placeholder), t.pattern && r.attr("pattern", t.pattern), t.maxlength && r.attr("maxlength", t.maxlength), a.append(r), a.on("submit", function (t) { - t.preventDefault(), t.stopPropagation(), o.find(".btn-primary").click() - }), o = g.dialog(t), o.off("shown.zui.modal"), o.on("shown.zui.modal", function () { - r.focus() - }), l === !0 && o.modal("show"), o - }, g.dialog = function (t) { - t = r(t); - var n = e(f.dialog), a = n.find(".modal-dialog"), l = n.find(".modal-body"), h = t.buttons, c = "", - d = {onEscape: t.onEscape}; - if (e.fn.modal === i) throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details."); - if (s(h, function (t, e) { - c += "", d[t] = e.callback - }), l.find(".bootbox-body").html(t.message), t.animate === !0 && n.addClass("fade"), t.className && n.addClass(t.className), "large" === t.size ? a.addClass("modal-lg") : "small" === t.size && a.addClass("modal-sm"), t.title && l.before(f.header), t.closeButton) { - var u = e(f.closeButton); - t.title ? n.find(".modal-header").prepend(u) : u.css("margin-top", "-10px").prependTo(l) - } - return t.title && n.find(".modal-title").html(t.title), c.length && (l.after(f.footer), n.find(".modal-footer").html(c)), n.on("hidden.zui.modal", function (t) { - t.target === this && n.remove() - }), n.on("shown.zui.modal", function () { - n.find(".btn-primary:first").focus() - }), "static" !== t.backdrop && n.on("click.dismiss.zui.modal", function (t) { - n.children(".modal-backdrop").length && (t.currentTarget = n.children(".modal-backdrop").get(0)), t.target === t.currentTarget && n.trigger("escape.close.bb") - }), n.on("escape.close.bb", function (t) { - d.onEscape && o(t, n, d.onEscape) - }), n.on("click", ".modal-footer button", function (t) { - var i = e(this).data("bb-handler"); - o(t, n, d[i]) - }), n.on("click", ".bootbox-close-button", function (t) { - o(t, n, d.onEscape) - }), n.on("keyup", function (t) { - 27 === t.which && n.trigger("escape.close.bb") - }), e(t.container).append(n), n.modal({ - backdrop: !!t.backdrop && "static", - keyboard: !1, - show: !1 - }), t.show && n.modal("show"), n - }, g.setDefaults = function () { - var t = {}; - 2 === arguments.length ? t[arguments[0]] = arguments[1] : t = arguments[0], e.extend(p, t) - }, g.hideAll = function () { - return e(".bootbox").modal("hide"), g - }; - var m = { - en: {OK: "OK", CANCEL: "Cancel", CONFIRM: "Confirm"}, - zh_cn: {OK: "确认", CANCEL: "取消", CONFIRM: "确认"}, - zh_tw: {OK: "確認", CANCEL: "取消", CONFIRM: "確認"} - }; - return g.addLocale = function (t, i) { - return e.each(["OK", "CANCEL", "CONFIRM"], function (t, e) { - if (!i[e]) throw new Error("Please supply a translation for '" + e + "'") - }), m[t] = {OK: i.OK, CANCEL: i.CANCEL, CONFIRM: i.CONFIRM}, g - }, g.removeLocale = function (t) { - return delete m[t], g - }, g.setLocale = function (t) { - return g.setDefaults("locale", t) - }, g.init = function (i) { - return t(i || e) - }, g - }),/*! +!function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}var i=function(e,i){var o=this;this.element=t(e),this.language=(i.language||this.element.data("date-language")||(t.zui&&t.zui.clientLang?t.zui.clientLang().replace("_","-"):"zh-cn")).toLowerCase(),this.lang=t.zui&&t.zui.getLangData?t.zui.getLangData("datetimepicker",this.language,n):n[this.language],this.isRTL=this.lang.rtl||!1,this.formatType=i.formatType||this.element.data("format-type")||"standard",this.format=a.parseFormat(i.format||this.element.data("date-format")||this.lang.format||a.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent(),this.componentReset=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-remove").parent(),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=i.linkField||this.element.data("link-field")||!1,this.linkFormat=a.parseFormat(i.linkFormat||this.element.data("link-format")||a.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=i.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=i.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=i.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=i.initialDate||new Date,this.pickerClass=i.eleClass,this.onlyPickTime=i.maxView<=1,this.pickerId=i.eleId,this._attachEvents(),this.formatViewType="datetime","formatViewType"in i?this.formatViewType=i.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in i?this.minView=i.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=a.convertViewMode(this.minView),this.maxView=a.modes.length-1,"maxView"in i?this.maxView=i.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=a.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in i?this.wheelViewModeNavigation=i.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in i?this.wheelViewModeNavigationInverseDirection=i.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in i?this.wheelViewModeNavigationDelay=i.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in i?this.startViewMode=i.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=a.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in i?this.viewSelect=i.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=a.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in i?this.forceParse=i.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=t(a.template).appendTo(this.isInline?this.element:"body").on({click:this.click.bind(this)}),this.wheelViewModeNavigation&&(t.fn.mousewheel?this.picker.on({mousewheel:this.mousewheel.bind(this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(".prev span, .next span").toggleClass("icon-arrow-left icon-arrow-right")),t(document).on("mousedown",function(e){0===t(e.target).closest(".datetimepicker").length&&o.hide()}),this.autoclose=!1,"autoclose"in i?this.autoclose=i.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in i?this.keyboardNavigation=i.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=i.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=i.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(i.weekStart||this.element.data("date-weekstart")||this.lang.weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-(1/0),this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(i.startDate||this.element.data("date-startdate")),this.setEndDate(i.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(i.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};i.prototype={constructor:i,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}],[this.component,{click:this.show.bind(this)}]],this.componentReset&&this._events.push([this.componentReset,{click:this.reset.bind(this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:this.show.bind(this)}]];for(var t,e,i=0;i=this.startDate&&t<=this.endDate?(this.date=t,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:t,startDate:this.startDate,endDate:this.endDate})},setFormat:function(t){this.format=a.parseFormat(t,this.formatType);var e;this.isInput?e=this.element:this.component&&(e=this.element.find("input")),e&&e.val()&&this.setValue()},setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e):(this.component&&this.element.find("input").val(e),this.element.data("date",e)),this.linkField&&t("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(t){return void 0==t&&(t=this.format),a.formatDate(this.date,t,this.language,this.formatType)},setStartDate:function(t){this.startDate=t||-(1/0),this.startDate!==-(1/0)&&(this.startDate=a.parseDate(this.startDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setEndDate:function(t){this.endDate=t||1/0,this.endDate!==1/0&&(this.endDate=a.parseDate(this.endDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this.daysOfWeekDisabled=e||[],Array.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=t.map(this.daysOfWeekDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var e=0;t("div").each(function(){var i=parseInt(t(this).css("zIndex"),10);i>e&&(e=i)});var i,n,o,a=e+10;this.component?(i=this.component.offset(),o=i.left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition&&"auto-left"!==this.pickerPosition||(o+=this.component.outerWidth()-this.picker.outerWidth())):(i=this.element.offset(),o=i.left);var s=0===this.pickerPosition.indexOf("auto-"),r=s?(i.top+this.picker.outerHeight()>t(window).height()+t(window).scrollTop()?"top":"bottom")+(0===this.pickerPosition.lastIndexOf("-left")?"-left":"-right"):this.pickerPosition;n="top-left"===r||"top-right"===r?i.top-this.picker.outerHeight():i.top+this.height,this.picker.css({top:n,left:o,zIndex:a}).attr("class","datetimepicker dropdown-menu datetimepicker-dropdown-"+r),this.pickerClass&&this.picker.addClass(this.pickerClass),this.pickerId&&this.picker.attr("id",this.pickerId),this.onlyPickTime&&this.picker.addClass("datetimepicker-only-time")}},update:function(){var t,e=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(t=arguments[0],e=!0):(t=this.element.data("date")||(this.isInput?this.element.val():this.element.find("input").val())||this.initialDate,("string"==typeof t||t instanceof String)&&(t=t.replace(/^\s+|\s+$/g,""))),t||(t=new Date,e=!1),this.date=a.parseDate(t,this.format,this.language,this.formatType),e&&this.setValue(),this.datethis.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var t=this.weekStart,e="";t'+this.lang.daysMin[t++%7]+"";e+="",this.picker.find(".datetimepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+=''+this.lang.monthsShort[e++]+"";this.picker.find(".datetimepicker-months td").html(t)},fill:function(){if(null!=this.date&&null!=this.viewDate){var i=new Date(this.viewDate),n=i.getUTCFullYear(),o=i.getUTCMonth(),s=i.getUTCDate(),r=i.getUTCHours(),l=i.getUTCMinutes(),h=this.startDate!==-(1/0)?this.startDate.getUTCFullYear():-(1/0),c=this.startDate!==-(1/0)?this.startDate.getUTCMonth():-(1/0),d=this.endDate!==1/0?this.endDate.getUTCFullYear():1/0,u=this.endDate!==1/0?this.endDate.getUTCMonth():1/0,f=new e(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),p=new Date;if(this.picker.find(".datetimepicker-days thead th:eq(1)").text(this.lang.months[o]+" "+n),"time"==this.formatViewType){var g=r%12?r%12:12,m=(g<10?"0":"")+g,v=(l<10?"0":"")+l,y=this.lang.meridiem[r<12?0:1];this.picker.find(".datetimepicker-hours thead th:eq(1)").text(m+":"+v+" "+y.toUpperCase()),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(m+":"+v+" "+y.toUpperCase())}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(s+" "+this.lang.months[o]+" "+n),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(s+" "+this.lang.months[o]+" "+n);this.picker.find("tfoot th.today").text(this.lang.today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var b=e(n,o-1,28,0,0,0,0),w=a.getDaysInMonth(b.getUTCFullYear(),b.getUTCMonth());b.setUTCDate(w),b.setUTCDate(w-(b.getUTCDay()-this.weekStart+7)%7);var x=new Date(b);x.setUTCDate(x.getUTCDate()+42),x=x.valueOf();for(var C,_=[];b.valueOf()"),C="",b.getUTCFullYear()n||b.getUTCFullYear()==n&&b.getUTCMonth()>o)&&(C+=" new"),this.todayHighlight&&b.getUTCFullYear()==p.getFullYear()&&b.getUTCMonth()==p.getMonth()&&b.getUTCDate()==p.getDate()&&(C+=" today"),b.valueOf()==f&&(C+=" active"),(b.valueOf()+864e5<=this.startDate||b.valueOf()>this.endDate||t.inArray(b.getUTCDay(),this.daysOfWeekDisabled)!==-1)&&(C+=" disabled"),_.push(''+b.getUTCDate()+""),b.getUTCDay()==this.weekEnd&&_.push(""),b.setUTCDate(b.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(_.join("")),_=[];for(var k="",T="",S="",D=0;D<24;D++){var M=e(n,o,s,D);C="",M.valueOf()+36e5<=this.startDate||M.valueOf()>this.endDate?C+=" disabled":r==D&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=D<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=S&&(""!=S&&_.push(""),_.push('
    '+T.toUpperCase()+"")),S=T,k=D%12?D%12:12,_.push(''+k+""),23==D&&_.push("
    ")):(k=D+":00",_.push(''+k+""))}this.picker.find(".datetimepicker-hours td").html(_.join("")),_=[],k="",T="",S="";for(var D=0;D<60;D+=this.minuteStep){var M=e(n,o,s,r,D,0);C="",M.valueOf()this.endDate?C+=" disabled":Math.floor(l/this.minuteStep)==Math.floor(D/this.minuteStep)&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=r<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=S&&(""!=S&&_.push(""),_.push('
    '+T.toUpperCase()+"")),S=T,k=r%12?r%12:12,_.push(''+k+":"+(D<10?"0"+D:D)+""),59==D&&_.push("
    ")):(k=D+":00",_.push(''+r+":"+(D<10?"0"+D:D)+""))}this.picker.find(".datetimepicker-minutes td").html(_.join(""));var P=this.date.getUTCFullYear(),z=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(n).end().find("span").removeClass("active");P==n&&z.eq(this.date.getUTCMonth()).addClass("active"),(nd)&&z.addClass("disabled"),n==h&&z.slice(0,c).addClass("disabled"),n==d&&z.slice(u+1).addClass("disabled"),_="",n=10*parseInt(n/10,10);var L=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(n+"-"+(n+9)).end().find("td");n-=1;for(var D=-1;D<11;D++)_+='d?" disabled":"")+'">'+n+"",n+=1;L.html(_),this.place()}},updateNavArrows:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth(),n=t.getUTCDate(),o=t.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&n<=this.startDate.getUTCDate()&&o<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&n>=this.endDate.getUTCDate()&&o>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&n<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&n>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var e=t.originalEvent,i=e.wheelDelta,n=i>0?1:0===i?0:-1;this.wheelViewModeNavigationInverseDirection&&(n=-n),this.showMode(n),setTimeout(function(){this.wheelPause=!1}.bind(this),this.wheelViewModeNavigationDelay)}},click:function(i){i.stopPropagation(),i.preventDefault();var n=t(i.target).closest("span, td, th, legend");if(1==n.length){if(n.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(n[0].nodeName.toLowerCase()){case"th":switch(n[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var o=a.modes[this.viewMode].navStep*("prev"==n[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,o);break;case 1:this.viewDate=this.moveDate(this.viewDate,o);break;case 2:this.viewDate=this.moveMonth(this.viewDate,o);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,o)}this.fill();break;case"today":var s=new Date;s=e(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),0),sthis.endDate&&(s=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(s),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!n.is(".disabled")){var r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),h=this.viewDate.getUTCDate(),c=this.viewDate.getUTCHours(),d=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();if(n.is(".month")?(this.viewDate.setUTCDate(1),l=n.parent().find("span").index(n),h=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(l),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(e(r,l,h,c,d,u,0))):n.is(".year")?(this.viewDate.setUTCDate(1),r=parseInt(n.text(),10)||0,this.viewDate.setUTCFullYear(r),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(e(r,l,h,c,d,u,0))):n.is(".hour")?(c=parseInt(n.text(),10)||0,(n.hasClass("hour_am")||n.hasClass("hour_pm"))&&(12==c&&n.hasClass("hour_am")?c=0:12!=c&&n.hasClass("hour_pm")&&(c+=12)),this.viewDate.setUTCHours(c),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(e(r,l,h,c,d,u,0))):n.is(".minute")&&(d=parseInt(n.text().substr(n.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(d),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(e(r,l,h,c,d,u,0))),0!=this.viewMode){var f=this.viewMode;this.showMode(-1),this.fill(),f==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(n.is(".day")&&!n.is(".disabled")){var h=parseInt(n.text(),10)||1,r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),c=this.viewDate.getUTCHours(),d=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();n.is(".old")?0===l?(l=11,r-=1):l-=1:n.is(".new")&&(11==l?(l=0,r+=1):l+=1),this.viewDate.setUTCFullYear(r),this.viewDate.setUTCMonth(l,h),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(e(r,l,h,c,d,u,0));var f=this.viewMode;this.showMode(-1),this.fill(),f==this.viewMode&&this.autoclose&&this.hide()}}}},_setDate:function(t,e){e&&"date"!=e||(this.date=t),e&&"view"!=e||(this.viewDate=t),this.fill(),this.setValue();var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),this.autoclose&&(!e||"date"==e)),this.element.trigger({type:"changeDate",date:this.date}),null===t&&(this.date=this.viewDate)},moveMinute:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+e*this.minuteStep),i},moveHour:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCHours(i.getUTCHours()+e),i},moveDate:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCDate(i.getUTCDate()+e),i},moveMonth:function(t,e){if(!e)return t;var i,n,o=new Date(t.valueOf()),a=o.getUTCDate(),s=o.getUTCMonth(),r=Math.abs(e);if(e=e>0?1:-1,1==r)n=e==-1?function(){return o.getUTCMonth()==s}:function(){return o.getUTCMonth()!=i},i=s+e,o.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var l=0;l=this.startDate&&t<=this.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return void(27==t.keyCode&&this.show());var e,i,n,o=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;e=37==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),n=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),n=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,e),n=this.moveDate(this.viewDate,e)):1==viewMode?(i=this.moveHour(this.date,e),n=this.moveHour(this.viewDate,e)):0==viewMode&&(i=this.moveMinute(this.date,e),n=this.moveMinute(this.viewDate,e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;e=38==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),n=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),n=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,7*e),n=this.moveDate(this.viewDate,7*e)):1==viewMode?this.showMeridian?(i=this.moveHour(this.date,6*e),n=this.moveHour(this.viewDate,6*e)):(i=this.moveHour(this.date,4*e),n=this.moveHour(this.viewDate,4*e)):0==viewMode&&(i=this.moveMinute(this.date,4*e),n=this.moveMinute(this.viewDate,4*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=n,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 13:if(0!=this.viewMode){var a=this.viewMode;this.showMode(-1),this.fill(),a==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();t.preventDefault();break;case 9:this.hide()}if(o){var s;this.isInput?s=this.element:this.component&&(s=this.element.find("input")),s&&s.change(),this.element.trigger({type:"changeDate",date:this.date})}},showMode:function(t){if(t){var e=Math.max(0,Math.min(a.modes.length-1,this.viewMode+t));e>=this.minView&&e<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:e}),this.viewMode=e)}this.picker.find(">div").hide().filter(".datetimepicker-"+a.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(t){this._setDate(null,"date")}},t.fn.datetimepicker=function(e){var n=Array.apply(null,arguments);return n.shift(),this.each(function(){var o=t(this),a=o.data("datetimepicker"),s="object"==typeof e&&e;a||o.data("datetimepicker",a=new i(this,t.extend({},t.fn.datetimepicker.defaults,o.data(),s))),"string"==typeof e&&"function"==typeof a[e]&&a[e].apply(a,n)})},t.fn.datetimepicker.defaults={pickerPosition:"auto-right"},t.fn.datetimepicker.Constructor=i;var n=t.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"},"zh-cn":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",suffix:[],meridiem:[]},"zh-tw":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",suffix:[],meridiem:["上午","下午"]}},o=function(e){var i=n[e];return i||(i=t.zui&&t.zui.getLangData?n[e]=t.zui.getLangData("datetimepicker",this.language,n):n.en),i},a={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4===0&&t%100!==0||t%400===0},getDaysInMonth:function(t,e){return[31,a.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},getDefaultFormat:function(t,e){if("standard"==t)return"input"==e?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==t)return"input"==e?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(t){if("standard"==t)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==t)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(t,e){var i=t.replace(this.validParts(e),"\0").split("\0"),n=t.match(this.validParts(e));if(!i||!i.length||!n||0==n.length)throw new Error("Invalid date format.");return{separators:i,parts:n}},parseDate:function(n,a,s,r){if(n instanceof Date){var l=new Date(n.valueOf()-6e4*n.getTimezoneOffset());return l.setMilliseconds(0),l}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n)&&(a=this.parseFormat("yyyy-mm-dd",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(n)&&(a=this.parseFormat("yyyy-mm-dd hh:ii",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(n)&&(a=this.parseFormat("yyyy-mm-dd hh:ii:ss",r)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(n)){var h,c,d=/([-+]\d+)([dmwy])/,u=n.match(/([-+]\d+)([dmwy])/g);n=new Date;for(var f=0;f',contTemplate:'',footTemplate:''};a.template='
    '+a.headTemplate+a.contTemplate+a.footTemplate+'
    '+a.headTemplate+a.contTemplate+a.footTemplate+'
    '+a.headTemplate+""+a.footTemplate+'
    '+a.headTemplate+a.contTemplate+a.footTemplate+'
    '+a.headTemplate+a.contTemplate+a.footTemplate+"
    ",t.fn.datetimepicker.DPGlobal=a,t.fn.datetimepicker.noConflict=function(){return t.fn.datetimepicker=old,this},t(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(e){ +var i=t(this);i.data("datetimepicker")||(e.preventDefault(),i.datetimepicker("show"))}),t(function(){t('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery),/*! bootbox.js v4.4.0 http://bootboxjs.com/license.txt */ +function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function n(t){var i=e.zui&&e.zui.getLangData?e.zui.getLangData("bootbox",p.locale,m):m[p.locale];return i?i[t]:m.en[t]}function o(t,e,i){t.stopPropagation(),t.preventDefault();var n="function"==typeof i&&i.call(e,t)===!1;n||e.modal("hide")}function a(t){var e,i=0;for(e in t)i++;return i}function s(t,i){var n=0;e.each(t,function(t,e){i(t,e,n++)})}function r(t){var i,n;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=e.extend({},p,t),t.buttons||(t.buttons={}),i=t.buttons,n=a(i),s(i,function(t,o,a){if("function"==typeof o&&(o=i[t]={callback:o}),"object"!==e.type(o))throw new Error("button with key "+t+" must be an object");o.label||(o.label=t),o.className||(2===n&&("ok"===t||"confirm"===t)||1===n?o.className="btn-primary":o.className="btn-default")}),t}function l(t,e){var i=t.length,n={};if(i<1||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(n[e[0]]=t[0],n[e[1]]=t[1]):n=t[0],n}function h(t,i,n){return e.extend(!0,{},t,l(i,n))}function c(t,e,i,n){var o={className:"bootbox-"+t,buttons:d.apply(null,e)};return u(h(o,n,i),e)}function d(){for(var t={},e=0,i=arguments.length;e
    ",header:"",footer:"",closeButton:"",form:"
    ",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
    ",date:"",time:"",number:"",password:""}},p={locale:e.zui&&e.zui.clientLang?e.zui.clientLang():"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},g={};g.alert=function(){var t;if(t=c("alert",["ok"],["message","callback"],arguments),t.callback&&"function"!=typeof t.callback)throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return"function"!=typeof t.callback||t.callback.call(this)},g.dialog(t)},g.confirm=function(){var t;if(t=c("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},"function"!=typeof t.callback)throw new Error("confirm requires a callback");return g.dialog(t)},g.prompt=function(){var t,n,o,a,r,l,c;if(a=e(f.form),n={className:"bootbox-prompt",buttons:d("cancel","confirm"),value:"",inputType:"text"},t=u(h(n,arguments,["title","callback"]),["confirm","cancel"]),l=t.show===i||t.show,t.message=a,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=r.val();break;case"checkbox":var n=r.find("input:checked");i=[],s(n,function(t,n){i.push(e(n).val())})}return t.callback.call(this,i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if("function"!=typeof t.callback)throw new Error("prompt requires a callback");if(!f.inputs[t.inputType])throw new Error("invalid prompt type");switch(r=e(f.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":r.val(t.value);break;case"select":var p={};if(c=t.inputOptions||[],!Array.isArray(c))throw new Error("Please pass an array of input options");if(!c.length)throw new Error("prompt with select requires options");s(c,function(t,n){var o=r;if(n.value===i||n.text===i)throw new Error("given options in wrong format");n.group&&(p[n.group]||(p[n.group]=e("").attr("label",n.group)),o=p[n.group]),o.append("")}),s(p,function(t,e){r.append(e)}),r.val(t.value);break;case"checkbox":var m=Array.isArray(t.value)?t.value:[t.value];if(c=t.inputOptions||[],!c.length)throw new Error("prompt with checkbox requires options");if(!c[0].value||!c[0].text)throw new Error("given options in wrong format");r=e("
    "),s(c,function(i,n){var o=e(f.inputs[t.inputType]);o.find("input").attr("value",n.value),o.find("label").append(n.text),s(m,function(t,e){e===n.value&&o.find("input").prop("checked",!0)}),r.append(o)})}return t.placeholder&&r.attr("placeholder",t.placeholder),t.pattern&&r.attr("pattern",t.pattern),t.maxlength&&r.attr("maxlength",t.maxlength),a.append(r),a.on("submit",function(t){t.preventDefault(),t.stopPropagation(),o.find(".btn-primary").click()}),o=g.dialog(t),o.off("shown.zui.modal"),o.on("shown.zui.modal",function(){r.focus()}),l===!0&&o.modal("show"),o},g.dialog=function(t){t=r(t);var n=e(f.dialog),a=n.find(".modal-dialog"),l=n.find(".modal-body"),h=t.buttons,c="",d={onEscape:t.onEscape};if(e.fn.modal===i)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(s(h,function(t,e){c+="",d[t]=e.callback}),l.find(".bootbox-body").html(t.message),t.animate===!0&&n.addClass("fade"),t.className&&n.addClass(t.className),"large"===t.size?a.addClass("modal-lg"):"small"===t.size&&a.addClass("modal-sm"),t.title&&l.before(f.header),t.closeButton){var u=e(f.closeButton);t.title?n.find(".modal-header").prepend(u):u.css("margin-top","-10px").prependTo(l)}return t.title&&n.find(".modal-title").html(t.title),c.length&&(l.after(f.footer),n.find(".modal-footer").html(c)),n.on("hidden.zui.modal",function(t){t.target===this&&n.remove()}),n.on("shown.zui.modal",function(){n.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&n.on("click.dismiss.zui.modal",function(t){n.children(".modal-backdrop").length&&(t.currentTarget=n.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&n.trigger("escape.close.bb")}),n.on("escape.close.bb",function(t){d.onEscape&&o(t,n,d.onEscape)}),n.on("click",".modal-footer button",function(t){var i=e(this).data("bb-handler");o(t,n,d[i])}),n.on("click",".bootbox-close-button",function(t){o(t,n,d.onEscape)}),n.on("keyup",function(t){27===t.which&&n.trigger("escape.close.bb")}),e(t.container).append(n),n.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&n.modal("show"),n},g.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(p,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"Confirm"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return g.addLocale=function(t,i){return e.each(["OK","CANCEL","CONFIRM"],function(t,e){if(!i[e])throw new Error("Please supply a translation for '"+e+"'")}),m[t]={OK:i.OK,CANCEL:i.CANCEL,CONFIRM:i.CONFIRM},g},g.removeLocale=function(t){return delete m[t],g},g.setLocale=function(t){return g.setDefaults("locale",t)},g.init=function(i){return t(i||e)},g}),/*! Chosen, a Select Box Enhancer for jQuery and Prototype by Patrick Filler for Harvest, http://getharvest.com @@ -3933,804 +41,8 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ - function () { - var t, e, i, n, o, a = {}.hasOwnProperty, s = function (t, e) { - function i() { - this.constructor = t - } - - for (var n in e) a.call(e, n) && (t[n] = e[n]); - return i.prototype = e.prototype, t.prototype = new i, t.__super__ = e.prototype, t - }, r = { - zh_cn: {no_results_text: "没有找到"}, - zh_tw: {no_results_text: "沒有找到"}, - en: {no_results_text: "No results match"} - }, l = {}; - n = function () { - function e() { - this.options_index = 0, this.parsed = [] - } - - return e.prototype.add_node = function (t) { - return "OPTGROUP" === t.nodeName.toUpperCase() ? this.add_group(t) : this.add_option(t) - }, e.prototype.add_group = function (e) { - var i, n, o, a, s, r; - for (i = this.parsed.length, this.parsed.push({ - array_index: i, - group: !0, - label: this.escapeExpression(e.label), - children: 0, - disabled: e.disabled, - title: e.title, - search_keys: t.trim(e.getAttribute("data-keys") || "").replace(/,/g, " ") - }), s = e.childNodes, r = [], o = 0, a = s.length; o < a; o++) n = s[o], r.push(this.add_option(n, i, e.disabled)); - return r - }, e.prototype.add_option = function (e, i, n) { - if ("OPTION" === e.nodeName.toUpperCase()) return "" !== e.text ? (null != i && (this.parsed[i].children += 1), this.parsed.push({ - array_index: this.parsed.length, - options_index: this.options_index, - value: e.value, - text: e.text, - title: e.title, - html: e.innerHTML, - selected: e.selected, - disabled: n === !0 ? n : e.disabled, - group_array_index: i, - classes: e.className, - style: e.style.cssText, - data: e.getAttribute("data-data"), - search_keys: (t.trim(e.getAttribute("data-keys") || "") + e.value).replace(/,/, " ") - })) : this.parsed.push({ - array_index: this.parsed.length, - options_index: this.options_index, - empty: !0 - }), this.options_index += 1 - }, e.prototype.escapeExpression = function (t) { - var e, i; - return null == t || t === !1 ? "" : /[\&\<\>\"\'\`]/.test(t) ? (e = { - "<": "<", - ">": ">", - '"': """, - "'": "'", - "`": "`" - }, i = /&(?!\w+;)|[\<\>\"\'\`]/g, t.replace(i, function (t) { - return e[t] || "&" - })) : t - }, e - }(), n.select_to_array = function (t) { - var e, i, o, a, s; - for (i = new n, s = t.childNodes, o = 0, a = s.length; o < a; o++) e = s[o], i.add_node(e); - return i.parsed - }, e = function () { - function e(i, n) { - if (this.form_field = i, this.options = t.extend({}, l, null != n ? n : {}), e.browser_is_supported()) { - var o = this.options.lang || t.zui.clientLang ? t.zui.clientLang() : "en", - a = t.zui.clientLang ? t.zui.clientLang() : "en"; - t.isPlainObject(o) ? this.lang = t.zui.getLangData ? t.zui.getLangData("chosen", a, r) : t.extend(o, r.en, r[a]) : this.lang = t.zui.getLangData ? t.zui.getLangData("chosen", o, r) : r[o || a] || r.en, this.is_multiple = this.form_field.multiple, this.set_default_text(), this.set_default_values(), this.setup(), this.set_up_html(), this.register_observers() - } - } - - return e.prototype.set_default_values = function () { - var t = this, e = t.options; - t.click_test_action = function (e) { - return t.test_active_click(e) - }, t.activate_action = function (e) { - return t.activate_field(e) - }, t.active_field = !1, t.mouse_on_container = !1, t.results_showing = !1, t.result_highlighted = null, t.allow_single_deselect = null != e.allow_single_deselect && null != this.form_field.options[0] && "" === t.form_field.options[0].text && e.allow_single_deselect, t.disable_search_threshold = e.disable_search_threshold || 0, t.disable_search = e.disable_search || !1, t.enable_split_word_search = null == e.enable_split_word_search || e.enable_split_word_search, t.group_search = null == e.group_search || e.group_search, t.search_contains = e.search_contains || !1, t.single_backstroke_delete = null == e.single_backstroke_delete || e.single_backstroke_delete, t.max_selected_options = e.max_selected_options || 1 / 0, t.drop_direction = e.drop_direction || "auto", t.drop_item_height = void 0 !== e.drop_item_height ? e.drop_item_height : 25, t.max_drop_height = void 0 !== e.max_drop_height ? e.max_drop_height : 240, t.middle_highlight = e.middle_highlight, t.compact_search = e.compact_search || !1, t.inherit_select_classes = e.inherit_select_classes || !1, t.display_selected_options = null == e.display_selected_options || e.display_selected_options, t.sort_value_splitter = e.sort_value_spliter || e.sort_value_splitter || ",", t.sort_field = e.sort_field; - var i = e.max_drop_width; - return "string" == typeof i && i.indexOf("px") === i.length - 2 && (i = parseInt(i.substring(0, i.length - 2))), t.max_drop_width = i, t.display_disabled_options = null == e.display_disabled_options || e.display_disabled_options - }, e.prototype.set_default_text = function () { - return this.form_field.getAttribute("data-placeholder") ? this.default_text = this.form_field.getAttribute("data-placeholder") : this.is_multiple ? this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || e.default_multiple_text : this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || e.default_single_text, this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || this.lang.no_results_text || e.default_no_result_text - }, e.prototype.mouse_enter = function () { - return this.mouse_on_container = !0 - }, e.prototype.mouse_leave = function () { - return this.mouse_on_container = !1 - }, e.prototype.input_focus = function (t) { - var e = this; - if (this.is_multiple) { - if (!this.active_field) return setTimeout(function () { - return e.container_mousedown() - }, 50) - } else if (!this.active_field) return this.activate_field() - }, e.prototype.input_blur = function (t) { - var e = this; - if (!this.mouse_on_container) return this.active_field = !1, setTimeout(function () { - return e.blur_test() - }, 100) - }, e.prototype.results_option_build = function (e) { - var i, n, o, a, s; - i = "", s = this.results_data; - var r = e && e.first ? [] : null; - for (o = 0, a = s.length; o < a; o++) n = s[o], i += n.group ? this.result_add_group(n) : this.result_add_option(n), r && n.selected && r.push(n); - if (r) { - var l, h; - if (this.sort_field && this.is_multiple) { - l = t(this.sort_field); - var c = l.val(); - if (h = "string" == typeof c && c.length ? c.split(this.sort_value_splitter) : [], h.length) { - var d = {}; - for (o = 0; o < h.length; ++o) d[h[o]] = o; - r.sort(function (t, e) { - var i = d[t.value], n = d[e.value]; - return void 0 === i && (i = 0), void 0 === n && (n = 0), i - n - }) - } - } - for (h = [], o = 0; o < r.length; ++o) n = r[o], this.is_multiple ? (this.choice_build(n), h.push(n.value)) : this.single_set_selected_text(n.text); - l && l.length && l.val(h.join(this.sort_value_splitter)) - } - return i - }, e.prototype.result_add_option = function (t) { - var e, i; - return t.search_match && this.include_option_in_results(t) ? (e = [], t.disabled || t.selected && this.is_multiple || e.push("active-result"), !t.disabled || t.selected && this.is_multiple || e.push("disabled-result"), t.selected && e.push("result-selected"), null != t.group_array_index && e.push("group-option"), "" !== t.classes && e.push(t.classes), i = document.createElement("li"), i.className = e.join(" "), i.style.cssText = t.style, i.title = t.title, i.setAttribute("data-option-array-index", t.array_index), i.setAttribute("data-data", t.data), i.innerHTML = t.search_text, this.outerHTML(i)) : "" - }, e.prototype.result_add_group = function (t) { - var e; - return (t.search_match || t.group_match) && t.active_options > 0 ? (e = document.createElement("li"), e.className = "group-result", e.title = t.title, e.innerHTML = t.search_text, this.outerHTML(e)) : "" - }, e.prototype.results_update_field = function () { - this.set_default_text(), this.is_multiple || this.results_reset_cleanup(), this.result_clear_highlight(), this.results_build(), this.results_showing && (this.winnow_results(), this.autoResizeDrop()) - }, e.prototype.reset_single_select_options = function () { - var t, e, i, n, o; - for (n = this.results_data, o = [], e = 0, i = n.length; e < i; e++) t = n[e], t.selected ? o.push(t.selected = !1) : o.push(void 0); - return o - }, e.prototype.results_toggle = function () { - return this.results_showing ? this.results_hide() : this.results_show() - }, e.prototype.results_search = function (t) { - return this.results_showing ? this.winnow_results(1) : this.results_show() - }, e.prototype.winnow_results = function (t) { - var e, i, n, o, a, s, r, l, h, c, d, u, f; - for (this.no_results_clear(), a = 0, r = this.get_search_text(), e = r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), o = this.search_contains ? "" : "^", n = new RegExp(o + e, "i"), c = new RegExp(e, "i"), f = this.results_data, d = 0, u = f.length; d < u; d++) i = f[d], i.search_match = !1, s = null, this.include_option_in_results(i) && (i.group && (i.group_match = !1, i.active_options = 0), null != i.group_array_index && this.results_data[i.group_array_index] && (s = this.results_data[i.group_array_index], 0 === s.active_options && s.search_match && (a += 1), s.active_options += 1), i.group && !this.group_search || (i.search_text = i.group ? i.label : i.html, i.search_keys_match = this.search_string_match(i.search_keys, n), i.search_text_match = this.search_string_match(i.search_text, n), i.search_match = i.search_text_match || i.search_keys_match, i.search_match && !i.group && (a += 1), i.search_match ? (i.search_text_match && i.search_text.length ? (l = i.search_text.search(c), h = i.search_text.substr(0, l + r.length) + "" + i.search_text.substr(l + r.length), i.search_text = h.substr(0, l) + "" + h.substr(l)) : i.search_keys_match && i.search_keys.length && (l = i.search_keys.search(c), h = i.search_keys.substr(0, l + r.length) + "" + i.search_keys.substr(l + r.length), i.search_text += '  ' + h.substr(0, l) + "" + h.substr(l) + ""), null != s && (s.group_match = !0)) : null != i.group_array_index && this.results_data[i.group_array_index].search_match && (i.search_match = !0))); - return this.result_clear_highlight(), a < 1 && r.length ? (this.update_results_content(""), this.no_results(r)) : (this.update_results_content(this.results_option_build()), this.winnow_results_set_highlight(t)) - }, e.prototype.search_string_match = function (t, e) { - var i, n, o, a; - if (e.test(t)) return !0; - if (this.enable_split_word_search && (t.indexOf(" ") >= 0 || 0 === t.indexOf("[")) && (n = t.replace(/\[|\]/g, "").split(" "), n.length)) for (o = 0, a = n.length; o < a; o++) if (i = n[o], e.test(i)) return !0 - }, e.prototype.choices_count = function () { - var t, e, i, n; - if (null != this.selected_option_count) return this.selected_option_count; - for (this.selected_option_count = 0, n = this.form_field.options, e = 0, i = n.length; e < i; e++) t = n[e], t.selected && "" != t.value && (this.selected_option_count += 1); - return this.selected_option_count - }, e.prototype.choices_click = function (t) { - if (t.preventDefault(), !this.results_showing && !this.is_disabled) return this.results_show() - }, e.prototype.keyup_checker = function (t) { - var e, i; - switch (e = null != (i = t.which) ? i : t.keyCode, this.search_field_scale(), e) { - case 8: - if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) return this.keydown_backstroke(); - if (!this.pending_backstroke) return this.result_clear_highlight(), this.results_search(); - break; - case 13: - if (t.preventDefault(), this.results_showing) return this.result_select(t); - break; - case 27: - return this.results_showing && this.results_hide(), !0; - case 9: - case 38: - case 40: - case 16: - case 91: - case 17: - break; - default: - return this.results_search() - } - }, e.prototype.clipboard_event_checker = function (t) { - var e = this; - return setTimeout(function () { - return e.results_search() - }, 50) - }, e.prototype.container_width = function () { - return null != this.options.width ? this.options.width : this.form_field && this.form_field.classList && this.form_field.classList.contains("form-control") ? "100%" : "" + this.form_field.offsetWidth + "px" - }, e.prototype.include_option_in_results = function (t) { - return !(this.is_multiple && !this.display_selected_options && t.selected) && (!(!this.display_disabled_options && t.disabled) && !t.empty) - }, e.prototype.search_results_touchstart = function (t) { - return this.touch_started = !0, this.search_results_mouseover(t) - }, e.prototype.search_results_touchmove = function (t) { - return this.touch_started = !1, this.search_results_mouseout(t) - }, e.prototype.search_results_touchend = function (t) { - if (this.touch_started) return this.search_results_mouseup(t) - }, e.prototype.outerHTML = function (t) { - var e; - return t.outerHTML ? t.outerHTML : (e = document.createElement("div"), e.appendChild(t), e.innerHTML) - }, e.browser_is_supported = function () { - return "Microsoft Internet Explorer" === window.navigator.appName ? document.documentMode >= 8 : !/iP(od|hone)/i.test(window.navigator.userAgent) && (!/Android/i.test(window.navigator.userAgent) || !/Mobile/i.test(window.navigator.userAgent)) - }, e.default_multiple_text = "", e.default_single_text = "", e.default_no_result_text = "No results match", e - }(), t = jQuery, t.fn.extend({ - chosen: function (n) { - return e.browser_is_supported() ? this.each(function (e) { - var o = t(this), a = o.data("chosen"); - "destroy" === n && a ? a.destroy() : a || o.data("chosen", new i(this, t.extend({}, o.data(), n))) - }) : this - } - }), i = function (e) { - function i() { - return o = i.__super__.constructor.apply(this, arguments) - } - - return s(i, e), i.prototype.setup = function () { - return this.form_field_jq = t(this.form_field), this.current_selectedIndex = this.form_field.selectedIndex, this.is_rtl = this.form_field_jq.hasClass("chosen-rtl") - }, i.prototype.set_up_html = function () { - var e, i; - e = ["chosen-container"], e.push("chosen-container-" + (this.is_multiple ? "multi" : "single")), this.inherit_select_classes && this.form_field.className && e.push(this.form_field.className), this.is_rtl && e.push("chosen-rtl"); - var n = this.form_field.getAttribute("data-css-class"); - return n && e.push(n), i = { - "class": e.join(" "), - style: "width: " + this.container_width() + ";", - title: this.form_field.title - }, this.form_field.id.length && (i.id = this.form_field.id.replace(/[^\w]/g, "_") + "_chosen"), this.container = t("
    ", i), this.is_multiple ? this.container.html('
      ') : (this.container.html('' + this.default_text + '
        '), this.compact_search ? this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")) : this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")), this.options.highlight_selected !== !1 && this.container.addClass("chosen-highlight-selected")), this.form_field_jq.hide().after(this.container), this.dropdown = this.container.find("div.chosen-drop").first(), this.search_field = this.container.find("input").first(), this.search_results = this.container.find("ul.chosen-results").first(), this.search_field_scale(), this.search_no_results = this.container.find("li.no-results").first(), this.is_multiple ? (this.search_choices = this.container.find("ul.chosen-choices").first(), this.search_container = this.container.find("li.search-field").first()) : (this.search_container = this.container.find("div.chosen-search").first(), this.selected_item = this.container.find(".chosen-single").first()), this.options.drop_width && this.dropdown.css("width", this.options.drop_width).addClass("chosen-drop-size-limited"), this.max_drop_width && this.dropdown.addClass("chosen-auto-max-width"), this.options.no_wrap && this.dropdown.addClass("chosen-no-wrap"), this.results_build(), this.set_tab_index(), this.set_label_behavior(), this.form_field_jq.trigger("chosen:ready", {chosen: this}) - }, i.prototype.register_observers = function () { - var t = this; - return this.container.bind("mousedown.chosen", function (e) { - t.container_mousedown(e) - }), this.container.bind("mouseup.chosen", function (e) { - t.container_mouseup(e) - }), this.container.bind("mouseenter.chosen", function (e) { - t.mouse_enter(e) - }), this.container.bind("mouseleave.chosen", function (e) { - t.mouse_leave(e) - }), this.search_results.bind("mouseup.chosen", function (e) { - t.search_results_mouseup(e) - }), this.search_results.bind("mouseover.chosen", function (e) { - t.search_results_mouseover(e) - }), this.search_results.bind("mouseout.chosen", function (e) { - t.search_results_mouseout(e) - }), this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen", function (e) { - t.search_results_mousewheel(e) - }), this.search_results.bind("touchstart.chosen", function (e) { - t.search_results_touchstart(e) - }), this.search_results.bind("touchmove.chosen", function (e) { - t.search_results_touchmove(e) - }), this.search_results.bind("touchend.chosen", function (e) { - t.search_results_touchend(e) - }), this.form_field_jq.bind("chosen:updated.chosen", function (e) { - t.results_update_field(e) - }), this.form_field_jq.bind("chosen:activate.chosen", function (e) { - t.activate_field(e) - }), this.form_field_jq.bind("chosen:open.chosen", function (e) { - t.container_mousedown(e) - }), this.form_field_jq.bind("chosen:close.chosen", function (e) { - t.input_blur(e) - }), this.search_field.bind("blur.chosen", function (e) { - t.input_blur(e) - }), this.search_field.bind("keyup.chosen", function (e) { - t.keyup_checker(e) - }), this.search_field.bind("keydown.chosen", function (e) { - t.keydown_checker(e) - }), this.search_field.bind("focus.chosen", function (e) { - t.input_focus(e) - }), this.search_field.bind("cut.chosen", function (e) { - t.clipboard_event_checker(e) - }), this.search_field.bind("paste.chosen", function (e) { - t.clipboard_event_checker(e) - }), this.is_multiple ? this.search_choices.bind("click.chosen", function (e) { - t.choices_click(e) - }) : this.container.bind("click.chosen", function (t) { - t.preventDefault() - }) - }, i.prototype.destroy = function () { - return t(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action), this.search_field[0].tabIndex && (this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex), this.container.remove(), this.form_field_jq.removeData("chosen"), this.form_field_jq.show() - }, i.prototype.search_field_disabled = function () { - return this.is_disabled = this.form_field_jq[0].disabled, this.is_disabled ? (this.container.addClass("chosen-disabled"), this.search_field[0].disabled = !0, this.is_multiple || this.selected_item.unbind("focus.chosen", this.activate_action), this.close_field()) : (this.container.removeClass("chosen-disabled"), this.search_field[0].disabled = !1, this.is_multiple ? void 0 : this.selected_item.bind("focus.chosen", this.activate_action)) - }, i.prototype.container_mousedown = function (e) { - if (!this.is_disabled && (e && "mousedown" === e.type && !this.results_showing && e.preventDefault(), null == e || !t(e.target).hasClass("search-choice-close"))) return this.active_field ? this.is_multiple || !e || t(e.target)[0] !== this.selected_item[0] && !t(e.target).parents("a.chosen-single").length || (e.preventDefault(), this.results_toggle()) : (this.is_multiple && this.search_field.val(""), t(this.container[0].ownerDocument).bind("click.chosen", this.click_test_action), this.results_show()), this.activate_field() - }, i.prototype.container_mouseup = function (t) { - if ("ABBR" === t.target.nodeName && !this.is_disabled) return this.results_reset(t) - }, i.prototype.search_results_mousewheel = function (t) { - var e; - if (t.originalEvent && (e = -t.originalEvent.wheelDelta || t.originalEvent.detail), null != e) return t.preventDefault(), "DOMMouseScroll" === t.type && (e = 40 * e), this.search_results.scrollTop(e + this.search_results.scrollTop()) - }, i.prototype.blur_test = function (t) { - if (!this.active_field && this.container.hasClass("chosen-container-active")) return this.close_field() - }, i.prototype.close_field = function () { - return t(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action), this.active_field = !1, this.results_hide(), this.container.removeClass("chosen-container-active"), this.clear_backstroke(), this.show_search_field_default(), this.search_field_scale() - }, i.prototype.activate_field = function () { - return this.container.addClass("chosen-container-active"), this.active_field = !0, this.search_field.val(this.search_field.val()), this.search_field.focus() - }, i.prototype.test_active_click = function (e) { - var i; - return i = t(e.target).closest(".chosen-container"), i.length && this.container[0] === i[0] ? this.active_field = !0 : this.close_field() - }, i.prototype.results_build = function () { - return this.parsing = !0, this.selected_option_count = null, this.results_data = n.select_to_array(this.form_field), this.is_multiple ? this.search_choices.find("li.search-choice").remove() : this.is_multiple || (this.single_set_selected_text(), this.disable_search || this.form_field.options.length <= this.disable_search_threshold ? (this.search_field[0].readOnly = !0, this.container.addClass("chosen-container-single-nosearch"), this.container.removeClass("chosen-with-search")) : (this.search_field[0].readOnly = !1, this.container.removeClass("chosen-container-single-nosearch"), this.container.addClass("chosen-with-search"))), this.update_results_content(this.results_option_build({first: !0})), this.search_field_disabled(), this.show_search_field_default(), this.search_field_scale(), this.parsing = !1 - }, i.prototype.result_do_highlight = function (t, e) { - if (t.length) { - var i, n, o, a, s, r, l = -1; - this.result_clear_highlight(), this.result_highlight = t, this.result_highlight.addClass("highlighted"), o = parseInt(this.search_results.css("maxHeight"), 10), r = this.result_highlight.outerHeight(), s = this.search_results.scrollTop(), a = o + s, n = this.result_highlight.position().top + this.search_results.scrollTop(), i = n + r, this.middle_highlight && (e || "always" === this.middle_highlight) ? l = Math.min(n - r, Math.max(0, n - (o - r) / 2)) : i >= a ? l = i - o > 0 ? i - o : 0 : n < s && (l = n), l > -1 ? this.search_results.scrollTop(l) : this.result_highlight.scrollIntoView && this.result_highlight.scrollIntoView() - } - }, i.prototype.result_clear_highlight = function () { - return this.result_highlight && this.result_highlight.removeClass("highlighted"), this.result_highlight = null - }, i.prototype.results_show = function () { - var e = this; - if (e.is_multiple && e.max_selected_options <= e.choices_count()) return e.form_field_jq.trigger("chosen:maxselected", {chosen: this}), !1; - e.results_showing = !0, e.search_field.focus(), e.search_field.val(e.search_field.val()), e.container.addClass("chosen-with-drop"), e.winnow_results(1); - var i = e.drop_direction; - if ("function" == typeof i && (i = i.call(this)), "auto" === i) if (e.drop_directionFixed) i = e.drop_directionFixed; else { - var n = e.container.find(".chosen-drop"), o = n.outerHeight(); - e.drop_item_height && o < e.max_drop_height && (o = Math.min(e.max_drop_height, n.find(".chosen-results>.active-result").length * e.drop_item_height)); - var a = e.container.offset(); - a.top + o + 30 > t(window).height() + t(window).scrollTop() && (i = "up"), e.drop_directionFixed = i - } - return e.container.toggleClass("chosen-up", "up" === i), e.autoResizeDrop(), e.form_field_jq.trigger("chosen:showing_dropdown", {chosen: e}) - }, i.prototype.autoResizeDrop = function () { - var e = this, i = e.max_drop_width; - if (i) { - var n = e.container.find(".chosen-drop"); - n.removeClass("in"); - var o = 0, a = n.find(".chosen-results"), s = a.children("li"), - r = parseFloat(a.css("padding-left").replace("px", "")), - l = parseFloat(a.css("padding-right").replace("px", "")), - h = (isNaN(r) ? 0 : r) + (isNaN(l) ? 0 : l); - s.each(function () { - o = Math.max(o, t(this).outerWidth()) - }), n.css("width", Math.min(o + h + 20, i)), e.fixDropWidthTimer = setTimeout(function () { - e.fixDropWidthTimer = null, n.addClass("in"), e.winnow_results_set_highlight(1) - }, 50) - } - }, i.prototype.update_results_content = function (t) { - return this.search_results.html(t) - }, i.prototype.results_hide = function () { - var t = this; - return t.fixDropWidthTimer && (clearTimeout(t.fixDropWidthTimer), t.fixDropWidthTimer = null), t.results_showing && (t.result_clear_highlight(), t.container.removeClass("chosen-with-drop"), t.form_field_jq.trigger("chosen:hiding_dropdown", {chosen: t}), t.drop_directionFixed = 0), t.results_showing = !1 - }, i.prototype.set_tab_index = function (t) { - var e; - if (this.form_field.tabIndex) return e = this.form_field.tabIndex, this.form_field.tabIndex = -1, this.search_field[0].tabIndex = e - }, i.prototype.set_label_behavior = function () { - var e = this; - if (this.form_field_label = this.form_field_jq.parents("label"), !this.form_field_label.length && this.form_field.id.length && (this.form_field_label = t("label[for='" + this.form_field.id + "']")), this.form_field_label.length > 0) return this.form_field_label.bind("click.chosen", function (t) { - return e.is_multiple ? e.container_mousedown(t) : e.activate_field() - }) - }, i.prototype.show_search_field_default = function () { - return this.is_multiple && this.choices_count() < 1 && !this.active_field ? (this.search_field.val(this.default_text), this.search_field.addClass("default")) : (this.search_field.val(""), this.search_field.removeClass("default")) - }, i.prototype.search_results_mouseup = function (e) { - var i; - if (i = t(e.target).hasClass("active-result") ? t(e.target) : t(e.target).parents(".active-result").first(), i.length) return this.result_highlight = i, this.result_select(e), this.search_field.focus() - }, i.prototype.search_results_mouseover = function (e) { - var i; - if (i = t(e.target).hasClass("active-result") ? t(e.target) : t(e.target).parents(".active-result").first()) return this.result_do_highlight(i) - }, i.prototype.search_results_mouseout = function (e) { - if (t(e.target).hasClass("active-result")) return this.result_clear_highlight() - }, i.prototype.choice_build = function (e) { - var i, n, o = this; - return i = t("
      • ", {"class": "search-choice"}).html("" + e.html + ""), e.disabled ? i.addClass("search-choice-disabled") : (n = t("", { - "class": "search-choice-close", - "data-option-array-index": e.array_index - }), n.bind("click.chosen", function (t) { - return o.choice_destroy_link_click(t) - }), i.append(n)), this.search_container.before(i) - }, i.prototype.choice_destroy_link_click = function (e) { - if (e.preventDefault(), e.stopPropagation(), !this.is_disabled) return this.choice_destroy(t(e.target)) - }, i.prototype.choice_destroy = function (t) { - if (this.result_deselect(t[0].getAttribute("data-option-array-index"))) return this.show_search_field_default(), this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1 && this.results_hide(), t.parents("li").first().remove(), this.search_field_scale() - }, i.prototype.results_reset = function () { - var t = this.form_field_jq.val(); - this.reset_single_select_options(), this.form_field.options[0].selected = !0, this.single_set_selected_text(), this.show_search_field_default(), this.results_reset_cleanup(); - var e = this.form_field_jq.val(), i = {selected: e}; - if (t === e || e.length || (i.deselected = t), this.form_field_jq.trigger("change", i), this.sync_sort_field(), this.active_field) return this.results_hide() - }, i.prototype.results_reset_cleanup = function () { - return this.current_selectedIndex = this.form_field.selectedIndex, this.selected_item.find("abbr").remove() - }, i.prototype.result_select = function (t) { - var e, i; - if (this.result_highlight) return e = this.result_highlight, this.result_clear_highlight(), this.is_multiple && this.max_selected_options <= this.choices_count() ? (this.form_field_jq.trigger("chosen:maxselected", {chosen: this}), !1) : (this.is_multiple ? e.removeClass("active-result") : this.reset_single_select_options(), i = this.results_data[e[0].getAttribute("data-option-array-index")], i.selected = !0, this.form_field.options[i.options_index].selected = !0, this.selected_option_count = null, this.is_multiple ? this.choice_build(i) : this.single_set_selected_text(i.text), (t.metaKey || t.ctrlKey) && this.is_multiple || this.results_hide(), this.search_field.val(""), (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) && (this.form_field_jq.trigger("change", {selected: this.form_field.options[i.options_index].value}), this.sync_sort_field()), this.current_selectedIndex = this.form_field.selectedIndex, this.search_field_scale()) - }, i.prototype.single_set_selected_text = function (t) { - return null == t && (t = this.default_text), t === this.default_text ? this.selected_item.addClass("chosen-default") : (this.single_deselect_control_build(), this.selected_item.removeClass("chosen-default")), this.compact_search && this.search_field.attr("placeholder", t), this.selected_item.find("span").attr("title", t).text(t) - }, i.prototype.sync_sort_field = function () { - var e = this; - if (e.is_multiple && e.sort_field) { - var i = t(e.sort_field); - if (!i.length) return; - var n = []; - e.search_choices.find("li.search-choice").each(function () { - var i = t(this), o = i.children(".search-choice-close").first().data("optionArrayIndex"), - a = e.results_data[o]; - a && a.selected && n.push(a.value) - }), i.val(n.join(e.sort_value_splitter)).trigger("change") - } - }, i.prototype.result_deselect = function (t) { - var e; - return e = this.results_data[t], !this.form_field.options[e.options_index].disabled && (e.selected = !1, this.form_field.options[e.options_index].selected = !1, this.selected_option_count = null, this.result_clear_highlight(), this.results_showing && this.winnow_results(), this.form_field_jq.trigger("change", {deselected: this.form_field.options[e.options_index].value}), this.sync_sort_field(), this.search_field_scale(), !0) - }, i.prototype.single_deselect_control_build = function () { - if (this.allow_single_deselect) return this.selected_item.find("abbr").length || this.selected_item.find("span").first().after(''), this.selected_item.addClass("chosen-single-with-deselect") - }, i.prototype.get_search_text = function () { - return this.search_field.val() === this.default_text ? "" : t("
        ").text(t.trim(this.search_field.val())).html() - }, i.prototype.winnow_results_set_highlight = function (t) { - var e, i; - if (i = this.is_multiple ? [] : this.search_results.find(".result-selected.active-result"), e = i.length ? i.first() : this.search_results.find(".active-result").first(), null != e) return this.result_do_highlight(e, t) - }, i.prototype.no_results = function (e) { - var i; - return i = t('
      • ' + this.results_none_found + ' ""
      • '), i.find("span").first().html(e), this.search_results.append(i), this.form_field_jq.trigger("chosen:no_results", {chosen: this}) - }, i.prototype.no_results_clear = function () { - return this.search_results.find(".no-results").remove() - }, i.prototype.keydown_arrow = function () { - var t; - return this.results_showing && this.result_highlight ? (t = this.result_highlight.nextAll("li.active-result").first()) ? this.result_do_highlight(t) : void 0 : this.results_show() - }, i.prototype.keyup_arrow = function () { - var t; - return this.results_showing || this.is_multiple ? this.result_highlight ? (t = this.result_highlight.prevAll("li.active-result"), t.length ? this.result_do_highlight(t.first()) : (this.choices_count() > 0 && this.results_hide(), this.result_clear_highlight())) : void 0 : this.results_show() - }, i.prototype.keydown_backstroke = function () { - var t; - return this.pending_backstroke ? (this.choice_destroy(this.pending_backstroke.find("a").first()), this.clear_backstroke()) : (t = this.search_container.siblings("li.search-choice").last(), t.length && !t.hasClass("search-choice-disabled") ? (this.pending_backstroke = t, this.single_backstroke_delete ? this.keydown_backstroke() : this.pending_backstroke.addClass("search-choice-focus")) : void 0) - }, i.prototype.clear_backstroke = function () { - return this.pending_backstroke && this.pending_backstroke.removeClass("search-choice-focus"), this.pending_backstroke = null - }, i.prototype.keydown_checker = function (t) { - var e, i; - switch (e = null != (i = t.which) ? i : t.keyCode, this.search_field_scale(), 8 !== e && this.pending_backstroke && this.clear_backstroke(), e) { - case 8: - this.backstroke_length = this.search_field.val().length; - break; - case 9: - this.results_showing && !this.is_multiple && this.result_select(t), this.mouse_on_container = !1; - break; - case 13: - t.preventDefault(); - break; - case 38: - t.preventDefault(), this.keyup_arrow(); - break; - case 40: - t.preventDefault(), this.keydown_arrow() - } - }, i.prototype.search_field_scale = function () { - var e, i, n, o, a, s, r, l, h; - if (this.is_multiple) { - for (n = 0, r = 0, a = "position:absolute; left: -1000px; top: -1000px; display:none;", s = ["font-size", "font-style", "font-weight", "font-family", "line-height", "text-transform", "letter-spacing"], l = 0, h = s.length; l < h; l++) o = s[l], a += o + ":" + this.search_field.css(o) + ";"; - return e = t("
        ", {style: a}), e.text(this.search_field.val()), t("body").append(e), r = e.width() + 25, e.remove(), i = this.container.outerWidth(), r > i - 10 && (r = i - 10), this.search_field.css({width: r + "px"}) - } - }, i - }(e), i.DEFAULTS = l, i.LANGUAGES = r, t.fn.chosen.Constructor = i - }.call(this), function (t) { - "use strict"; - var e = "zui.selectable", i = function (i, n) { - this.name = e, this.$ = t(i), this.id = t.zui.uuid(), this.selectOrder = 1, this.selections = {}, this.getOptions(n), this._init() - }, n = function (t, e, i) { - return t >= i.left && t <= i.left + i.width && e >= i.top && e <= i.top + i.height - }, o = function (t, e) { - var i = Math.max(t.left, e.left), o = Math.max(t.top, e.top), a = Math.min(t.left + t.width, e.left + e.width), - s = Math.min(t.top + t.height, e.top + e.height); - return n(i, o, t) && n(a, s, t) && n(i, o, e) && n(a, s, e) - }; - i.DEFAULTS = { - selector: "li,tr,div", - trigger: "", - selectClass: "active", - rangeStyle: { - border: "1px solid " + (t.zui.colorset ? t.zui.colorset.primary : "#3280fc"), - backgroundColor: t.zui.colorset ? new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr() : "rgba(50, 128, 252, 0.2)" - }, - clickBehavior: "toggle", - ignoreVal: 3, - listenClick: !0 - }, i.prototype.getOptions = function (e) { - this.options = t.extend({}, i.DEFAULTS, this.$.data(), e) - }, i.prototype.select = function (t) { - this.toggle(t, !0) - }, i.prototype.unselect = function (t) { - this.toggle(t, !1) - }, i.prototype.toggle = function (e, i, n) { - var o, a, s = this.options.selector, r = this; - if (void 0 === e) return void this.$.find(s).each(function () { - r.toggle(this, i) - }); - if ("object" == typeof e ? (o = t(e).closest(s), a = o.data("id")) : (a = e, o = r.$.find('.slectable-item[data-id="' + a + '"]')), o && o.length) { - if (a || (a = t.zui.uuid(), o.attr("data-id", a)), void 0 !== i && null !== i || (i = !r.selections[a]), !!i != !!r.selections[a]) { - var l; - "function" == typeof n && (l = n(i)), l !== !0 && (r.selections[a] = !!i && r.selectOrder++, r.callEvent(i ? "select" : "unselect", { - id: a, selections: r.selections, target: o, - selected: r.getSelectedArray() - }, r)) - } - r.options.selectClass && o.toggleClass(r.options.selectClass, i) - } - }, i.prototype.getSelectedArray = function () { - var e = []; - return t.each(this.selections, function (t, i) { - i && e.push(t) - }), e - }, i.prototype.syncSelectionsFromClass = function () { - var e = this, i = e.$children = e.$.find(e.options.selector); - e.selections = {}, i.each(function () { - var i = t(this); - e.selections[i.data("id")] = i.hasClass(e.options.selectClass) - }) - }, i.prototype._init = function () { - var e, i, n, a, s, r, l, h = this.options, c = this, d = h.ignoreVal, u = !0, - f = "." + this.name + "." + this.id, p = "function" == typeof h.checkFunc ? h.checkFunc : null, - g = "function" == typeof h.rangeFunc ? h.rangeFunc : null, m = !1, v = null, y = "mousedown" + f, - b = function () { - a && c.$children.each(function () { - var e = t(this), i = e.offset(); - i.width = e.outerWidth(), i.height = e.outerHeight(); - var n = g ? g.call(this, a, i) : o(a, i); - if (p) { - var s = p.call(c, {intersect: n, target: e, range: a, targetRange: i}); - s === !0 ? c.select(e) : s === !1 && c.unselect(e) - } else n ? c.select(e) : c.multiKey || c.unselect(e) - }) - }, w = function (o) { - m && (s = o.pageX, r = o.pageY, a = { - width: Math.abs(s - e), - height: Math.abs(r - i), - left: s > e ? e : s, - top: r > i ? i : r - }, u && a.width < d && a.height < d || (n || (n = t('.selectable-range[data-id="' + c.id + '"]'), n.length || (n = t('
        ').css(t.extend({ - zIndex: 1060, - position: "absolute", - top: e, - left: i, - pointerEvents: "none" - }, c.options.rangeStyle)).appendTo(t("body")))), n.css(a), clearTimeout(l), l = setTimeout(b, 10), u = !1)) - }, x = function (e) { - t(document).off(f), clearTimeout(v), m && (m = !1, n && n.remove(), u || a && (clearTimeout(l), b(), a = null), c.callEvent("finish", { - selections: c.selections, - selected: c.getSelectedArray() - }), e.preventDefault()) - }, C = function (o) { - if (m) return x(o); - var a = t.zui.getMouseButtonCode(h.mouseButton); - if (!(a > -1 && o.button !== a || c.altKey || 3 === o.which || c.callEvent("start", o) === !1)) { - var s = c.$children = c.$.find(h.selector); - s.addClass("slectable-item"); - var r = c.multiKey ? "multi" : h.clickBehavior; - if ("single" === r && c.unselect(), h.listenClick && ("multi" === r ? c.toggle(o.target) : "single" === r ? c.select(o.target) : "toggle" === r && c.toggle(o.target, null, function (t) { - c.unselect() - })), c.callEvent("startDrag", o) === !1) return void c.callEvent("finish", { - selections: c.selections, - selected: c.getSelectedArray() - }); - e = o.pageX, i = o.pageY, n = null, u = !0, m = !0, t(document).on("mousemove" + f, w).on("mouseup" + f, x), v = setTimeout(function () { - t(document).on(y, x) - }, 10), o.preventDefault() - } - }, _ = h.container && "default" !== h.container ? t(h.container) : this.$; - h.trigger ? _.on(y, h.trigger, C) : _.on(y, C), t(document).on("keydown", function (t) { - var e = t.keyCode; - 17 === e || 91 == e ? c.multiKey = e : 18 === e && (c.altKey = !0) - }).on("keyup", function (t) { - c.multiKey = !1, c.altKey = !1 - }) - }, i.prototype.callEvent = function (e, i) { - var n = t.Event(e + "." + this.name); - this.$.trigger(n, i); - var o = n.result, a = this.options[e]; - return "function" == typeof a && (o = a.apply(this, Array.isArray(i) ? i : [i])), o - }, t.fn.selectable = 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]() - }) - }, t.fn.selectable.Constructor = i, t(function () { - t('[data-ride="selectable"]').selectable() - }) -}(jQuery), +function (t, e, i) { - "use strict"; - if (!t.fn.droppable) return void console.error("Sortable requires droppable.js"); - var n = "zui.sortable", o = {selector: "li,div", dragCssClass: "invisible", sortingClass: "sortable-sorting"}, - a = "order", s = function (e, i) { - var n = this; - n.$ = t(e), n.options = t.extend({}, o, n.$.data(), i), n.init() - }; - s.DEFAULTS = o, s.NAME = n, s.prototype.init = function () { - var e, i = this, n = i.$, o = i.options, s = o.selector, r = o.containerSelector, l = o.sortingClass, - h = o.dragCssClass, c = o.targetSelector, d = o.reverse, u = function (e) { - e = e || i.getItems(1); - var n = e.length; - n && e.each(function (e) { - var i = d ? n - e : e; - t(this).attr("data-" + a, i).data(a, i) - }) - }; - u(), n.droppable({ - handle: o.trigger, - target: c ? c : r ? s + "," + r : s, - selector: s, - container: n, - always: o.always, - flex: !0, - lazy: o.lazy, - canMoveHere: o.canMoveHere, - dropToClass: o.dropToClass, - before: o.before, - nested: !!r, - mouseButton: o.mouseButton, - stopPropagation: o.stopPropagation, - start: function (t) { - h && t.element.addClass(h), e = !1, i.trigger("start", t) - }, - drag: function (t) { - if (n.addClass(l), t.isIn) { - var o = t.element, h = t.target, c = r && h.is(r); - if (c) { - if (!h.children(s).filter(".dragging").length) { - h.append(o); - var f = i.getItems(1); - u(f), i.trigger(a, {list: f, element: o}) - } - return - } - var p = o.data(a), g = h.data(a); - if (p === g) return u(f); - p > g ? h[d ? "after" : "before"](o) : h[d ? "before" : "after"](o), e = !0; - var f = i.getItems(1); - u(f), i.trigger(a, {list: f, element: o}) - } - }, - finish: function (t) { - h && t.element && t.element.removeClass(h), n.removeClass(l), i.trigger("finish", { - list: i.getItems(), - element: t.element, - changed: e - }) - } - }) - }, s.prototype.destroy = function () { - this.$.droppable("destroy"), this.$.data(n, null) - }, s.prototype.reset = function () { - this.destroy(), this.init() - }, s.prototype.getItems = function (e) { - var i = this.$.find(this.options.selector).not(".drag-shadow"); - return e ? i : i.map(function () { - var e = t(this); - return {item: e, order: e.data("order")} - }) - }, s.prototype.trigger = function (e, i) { - return t.zui.callEvent(this.options[e], i, this) - }, t.fn.sortable = function (e) { - return this.each(function () { - var i = t(this), o = i.data(n), a = "object" == typeof e && e; - o ? "object" == typeof e && o.reset() : i.data(n, o = new s(this, a)), "string" == typeof e && o[e]() - }) - }, t.fn.sortable.Constructor = s -}(jQuery, window, document), function (t, e) { - "use strict"; - var i = "zui.contextmenu", n = { - animation: "fade", - menuTemplate: '', - toggleTrigger: !1, - duration: 200, - limitInsideWindow: !0 - }, o = !1, a = {}, s = "zui-contextmenu-" + t.zui.uuid(), r = 0, l = 0, h = function () { - return t(document).off("mousemove." + i).on("mousemove." + i, function (t) { - r = t.clientX, l = t.clientY - }), a - }, c = function (e, i) { - if ("string" == typeof e && (e = "seperator" === e || "divider" === e || "-" === e || "|" === e ? {type: "seperator"} : { - label: e, - id: i - }), "seperator" === e.type || "divider" === e.type) return t('
      • '); - var n = t("
        ").attr({href: e.url || "###", "class": e.className, style: e.style}).data("item", e); - return e.html ? e.html === !0 ? n.html(e.label || e.text) : n = t(e.html) : n.text(e.label || e.text), e.onClick && n.on("click", e.onClick), t("
      • ").toggleClass("disabled", e.disabled === !0).append(n) - }, d = function (e) { - var i = t("#" + s); - return i.length && i.hasClass("contextmenu-show") && (!e || (i.data("options") || {}).id === e) - }, u = null, f = function (e, i) { - "function" == typeof e && (i = e, e = null), u && (clearTimeout(u), u = null); - var n = t("#" + s); - if (n.length) { - var o = n.removeClass("contextmenu-show").data("options"); - if (!e || o.id === e) { - var r = function () { - n.find(".contextmenu-menu").removeClass("open"), o.onHidden && o.onHidden(), i && i() - }; - o.onHide && o.onHide(); - var l = o.animation; - n.find(".contextmenu-menu").removeClass("in"), l ? u = setTimeout(r, o.duration) : r() - } - } - return a - }, p = function (h, d, p) { - t.isPlainObject(h) && (p = d, d = h, h = d.items), o = !0, d = t.extend({}, n, d); - var g = t("#" + s); - g.length || (g = t('
        ').appendTo("body")); - var m = g.find(".contextmenu-menu").off("click." + i).on("click." + i, "a,.contextmenu-item", function (e) { - var i = t(this), n = d.onClickItem && d.onClickItem(i.data("item"), i, e, d); - n !== !1 && f() - }).empty(); - m.attr("class", "contextmenu-menu" + (d.className ? " " + d.className : "")), g.attr("class", "contextmenu contextmenu-show"); - var v = d.menuCreator; - if (v) m.append(v(h, d)); else { - m.append(d.menuTemplate); - var y = m.children().first(), b = d.itemCreator || c, w = typeof h; - if ("string" === w ? h = h.split(",") : "function" === w && (h = h(d)), !h) return !1; - t.each(h, function (t, e) { - y.append(b(e, t, d)) - }) - } - var x = d.animation, C = d.duration; - x === !0 && (d.animation = x = "fade"), u && (clearTimeout(u), u = null); - var _ = function () { - m.addClass("in"), d.onShown && d.onShown(), p && p() - }; - d.onShow && d.onShow(), g.data("options", { - animation: x, - onHide: d.onHide, - onHidden: d.onHidden, - id: d.id, - duration: C - }); - var k = d.x, T = d.y; - k === e && (k = (d.event || d).clientX), k === e && (k = r), T === e && (T = (d.event || d).clientY), T === e && (T = l); - var y = m.children().first(), S = y.outerWidth(), D = y.outerHeight(); - if (d.position) { - var M = d.position({x: k, y: T, width: S, height: D}, d, m); - M && (k = M.x, T = M.y) - } - if (d.limitInsideWindow) { - var P = t(window); - k = Math.max(0, Math.min(k, P.width() - S)), T = Math.max(0, Math.min(T, P.height() - D)) - } - return g.css({left: k, top: T}).show(), m.addClass("open"), x ? (m.addClass(x), u = setTimeout(function () { - _(), o = !1 - }, 10)) : (_(), o = !1), a - }; - t.extend(a, {NAME: i, DEFAULTS: n, show: p, hide: f, listenMouse: h, isShow: d}), t.zui({ContextMenu: a}); - var g = function (e, n) { - var o = this; - o.name = i, o.$ = t(e), o.id = t.zui.uuid(), n = o.options = t.extend({trigger: "contextmenu"}, a.DEFAULTS, this.$.data(), n); - var s = function (t) { - if ("mousedown" !== t.type || 2 === t.button) { - if (n.toggleTrigger && o.isShow()) o.hide(); else { - var e = {x: t.clientX, y: t.clientY, event: t}; - if (o.show(e) === !1) return - } - return t.preventDefault(), t.returnValue = !1, !1 - } - }, r = n.trigger, l = r + "." + i; - n.selector ? o.$.on(l, n.selector, s) : o.$.on(l, s), n.show && o.show("object" == typeof n.show ? n.show : null) - }; - g.prototype.destory = function () { - that.$.off("." + i) - }, g.prototype.hide = function (t) { - return a.hide(this.id, t) - }, g.prototype.show = function (e, i) { - return e = t.extend({id: this.id, $toggle: this.$}, this.options, e), a.show(e, i) - }, g.prototype.isShow = function () { - return d(this.id) - }, t.fn.contextmenu = 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 g(this, a)), "string" == typeof e && o[e]() - }) - }, t.fn.contextmenu.Constructor = g, t.fn.contextDropdown = function (e) { - t(this).contextmenu(t.extend({ - trigger: "click", animation: "fade", toggleTrigger: !0, menuCreator: function (e, i) { - var n = i.$toggle, o = n.attr("data-target"); - o || (o = n.attr("href"), o = o && /#/.test(o) && o.replace(/.*(?=#[^\s]*$)/, "")); - var a = o ? t(o) : n.next(".dropdown-menu"), s = i.transferEvent; - if (s !== !1) { - var r = "data-contextmenu-index"; - a.find("a,.contextmenu-item").each(function (e) { - t(this).attr(r, e) - }); - var l = a.clone(); - return l.on("string" == typeof s ? s : "click", "a,.contextmenu-item", function (e) { - var i = a.find("[" + r + '="' + t(this).attr(r) + '"]'), n = i[0]; - if (n) return n[e.type] ? n[e.type]() : i.trigger(e.type), e.preventDefault(), e.stopPropagation(), !1 - }), l - } - return a.clone() - }, position: function (t, e, i) { - var n = e.placement, o = e.$toggle; - if (!n) { - var a = i.find(".dropdown-menu"), s = a.hasClass("pull-right"), r = o.parent().hasClass("dropup"); - n = s ? r ? "top-right" : "bottom-right" : r ? "top-left" : "bottom-left", s && a.removeClass("pull-right") - } - var l = o[0].getBoundingClientRect(); - switch (n) { - case"top-left": - return {x: l.left, y: Math.floor(l.top - t.height)}; - case"top-right": - return {x: Math.floor(l.right - t.width), y: Math.floor(l.top - t.height)}; - case"bottom-left": - return {x: l.left, y: l.bottom}; - case"bottom-right": - return {x: Math.floor(l.right - t.width), y: l.bottom} - } - return t - } - }, e)) - }, t(document).on("click", function (e) { - var n = t(e.target), a = n.closest('[data-toggle="context-dropdown"]'); - if (a.length) { - var s = a.data(i); - s || a.contextDropdown({show: !0}) - } else o || n.closest(".contextmenu").length || f() - }) -}(jQuery, void 0),/*! +function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
        ",i),this.is_multiple?this.container.html('
          '):(this.container.html('
          '+this.default_text+'
            '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),h=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+h+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
          • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
            ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
          • '+this.results_none_found+' ""
          • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,h;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.slectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, +selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,f="."+this.name+"."+this.id,p="function"==typeof h.checkFunc?h.checkFunc:null,g="function"==typeof h.rangeFunc?h.rangeFunc:null,m=!1,v=null,y="mousedown"+f,b=function(){a&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(p){var s=p.call(c,{intersect:n,target:e,range:a,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width
            ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(f),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return x(o);var a=t.zui.getMouseButtonCode(h.mouseButton);if(!(a>-1&&o.button!==a||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(h.selector);s.addClass("slectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+f,w).on("mouseup"+f,x),v=setTimeout(function(){t(document).on(y,x)},10),o.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=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]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,h=o.dragCssClass,c=o.targetSelector,d=o.reverse,u=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};u(),n.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){h&&t.element.addClass(h),e=!1,i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,h=t.target,c=r&&h.is(r);if(c){if(!h.children(s).filter(".dragging").length){h.append(o);var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}return}var p=o.data(a),g=h.data(a);if(p===g)return u(f);p>g?h[d?"after":"before"](o):h[d?"before":"after"](o),e=!0;var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}},finish:function(t){h&&t.element&&t.element.removeClass(h),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i="zui.contextmenu",n={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,a={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,h=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),a},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
          • ');var n=t("
            ").attr({href:e.url||"###","class":e.className,style:e.style}).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.onClick&&n.on("click",e.onClick),t("
          • ").toggleClass("disabled",e.disabled===!0).append(n)},d=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+s);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return a},p=function(h,d,p){t.isPlainObject(h)&&(p=d,d=h,h=d.items),o=!0,d=t.extend({},n,d);var g=t("#"+s);g.length||(g=t('
            ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(h,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=d.itemCreator||c,w=typeof h;if("string"===w?h=h.split(","):"function"===w&&(h=h(d)),!h)return!1;t.each(h,function(t,e){y.append(b(e,t,d))})}var x=d.animation,C=d.duration;x===!0&&(d.animation=x="fade"),u&&(clearTimeout(u),u=null);var _=function(){m.addClass("in"),d.onShown&&d.onShown(),p&&p()};d.onShow&&d.onShow(),g.data("options",{animation:x,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:C});var k=d.x,T=d.y;k===e&&(k=(d.event||d).clientX),k===e&&(k=r),T===e&&(T=(d.event||d).clientY),T===e&&(T=l);var y=m.children().first(),S=y.outerWidth(),D=y.outerHeight();if(d.position){var M=d.position({x:k,y:T,width:S,height:D},d,m);M&&(k=M.x,T=M.y)}if(d.limitInsideWindow){var P=t(window);k=Math.max(0,Math.min(k,P.width()-S)),T=Math.max(0,Math.min(T,P.height()-D))}return g.css({left:k,top:T}).show(),m.addClass("open"),x?(m.addClass(x),u=setTimeout(function(){_(),o=!1},10)):(_(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:f,listenMouse:h,isShow:d}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var s=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=n.trigger,l=r+"."+i;n.selector?o.$.on(l,n.selector,s):o.$.on(l,s),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return d(this.id)},t.fn.contextmenu=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 g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var s=a.data(i);s||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! * jQuery Form Plugin * version: 4.2.2 * Requires jQuery v1.7.2 or later @@ -4751,430 +63,7 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ - function (t) { - "function" == typeof define && define.amd ? define(["jquery"], t) : "object" == typeof module && module.exports ? module.exports = function (e, i) { - return "undefined" == typeof i && (i = "undefined" != typeof window ? require("jquery") : require("jquery")(e)), t(i), i - } : t(jQuery) - }(function (t) { - "use strict"; - - function e(e) { - var i = e.data; - e.isDefaultPrevented() || (e.preventDefault(), t(e.target).closest("form").ajaxSubmit(i)) - } - - function i(e) { - var i = e.target, n = t(i); - if (!n.is("[type=submit],[type=image]")) { - var o = n.closest("[type=submit]"); - if (0 === o.length) return; - i = o[0] - } - var a = i.form; - if (a.clk = i, "image" === i.type) if ("undefined" != typeof e.offsetX) a.clk_x = e.offsetX, a.clk_y = e.offsetY; else if ("function" == typeof t.fn.offset) { - var s = n.offset(); - a.clk_x = e.pageX - s.left, a.clk_y = e.pageY - s.top - } else a.clk_x = e.pageX - i.offsetLeft, a.clk_y = e.pageY - i.offsetTop; - setTimeout(function () { - a.clk = a.clk_x = a.clk_y = null - }, 100) - } - - function n() { - if (t.fn.ajaxSubmit.debug) { - var e = "[jquery.form] " + Array.prototype.join.call(arguments, ""); - window.console && window.console.log ? window.console.log(e) : window.opera && window.opera.postError && window.opera.postError(e) - } - } - - var o = /\r?\n/g, a = {}; - a.fileapi = void 0 !== t('').get(0).files, a.formdata = "undefined" != typeof window.FormData; - var s = !!t.fn.prop; - t.fn.attr2 = function () { - if (!s) return this.attr.apply(this, arguments); - var t = this.prop.apply(this, arguments); - return t && t.jquery || "string" == typeof t ? t : this.attr.apply(this, arguments) - }, t.fn.ajaxSubmit = function (e, i, o, r) { - function l(i) { - var n, o, a = t.param(i, e.traditional).split("&"), s = a.length, r = []; - for (n = 0; n < s; n++) a[n] = a[n].replace(/\+/g, " "), o = a[n].split("="), r.push([decodeURIComponent(o[0]), decodeURIComponent(o[1])]); - return r - } - - function h(i) { - for (var n = new FormData, o = 0; o < i.length; o++) n.append(i[o].name, i[o].value); - if (e.extraData) { - var a = l(e.extraData); - for (o = 0; o < a.length; o++) a[o] && n.append(a[o][0], a[o][1]) - } - e.data = null; - var s = t.extend(!0, {}, t.ajaxSettings, e, { - contentType: !1, - processData: !1, - cache: !1, - type: d || "POST" - }); - e.uploadProgress && (s.xhr = function () { - var i = t.ajaxSettings.xhr(); - return i.upload && i.upload.addEventListener("progress", function (t) { - var i = 0, n = t.loaded || t.position, o = t.total; - t.lengthComputable && (i = Math.ceil(n / o * 100)), e.uploadProgress(t, n, o, i) - }, !1), i - }), s.data = null; - var r = s.beforeSend; - return s.beforeSend = function (t, i) { - e.formData ? i.data = e.formData : i.data = n, r && r.call(this, t, i) - }, t.ajax(s) - } - - function c(i) { - function o(t) { - var e = null; - try { - t.contentWindow && (e = t.contentWindow.document) - } catch (i) { - n("cannot get iframe.contentWindow document: " + i) - } - if (e) return e; - try { - e = t.contentDocument ? t.contentDocument : t.document - } catch (i) { - n("cannot get iframe.contentDocument: " + i), e = t.document - } - return e - } - - function a() { - function e() { - try { - var t = o(m).readyState; - n("state = " + t), t && "uninitialized" === t.toLowerCase() && setTimeout(e, 50) - } catch (i) { - n("Server abort: ", i, " (", i.name, ")"), r(M), C && clearTimeout(C), C = void 0 - } - } - - var i = p.attr2("target"), a = p.attr2("action"), s = "multipart/form-data", - l = p.attr("enctype") || p.attr("encoding") || s; - _.setAttribute("target", f), d && !/post/i.test(d) || _.setAttribute("method", "POST"), a !== c.url && _.setAttribute("action", c.url), c.skipEncodingOverride || d && !/post/i.test(d) || p.attr({ - encoding: "multipart/form-data", - enctype: "multipart/form-data" - }), c.timeout && (C = setTimeout(function () { - x = !0, r(D) - }, c.timeout)); - var h = []; - try { - if (c.extraData) for (var u in c.extraData) c.extraData.hasOwnProperty(u) && (t.isPlainObject(c.extraData[u]) && c.extraData[u].hasOwnProperty("name") && c.extraData[u].hasOwnProperty("value") ? h.push(t('', T).val(c.extraData[u].value).appendTo(_)[0]) : h.push(t('', T).val(c.extraData[u]).appendTo(_)[0])); - c.iframeTarget || g.appendTo(S), m.attachEvent ? m.attachEvent("onload", r) : m.addEventListener("load", r, !1), setTimeout(e, 15); - try { - _.submit() - } catch (v) { - var y = document.createElement("form").submit; - y.apply(_) - } - } finally { - _.setAttribute("action", a), _.setAttribute("enctype", l), i ? _.setAttribute("target", i) : p.removeAttr("target"), t.each(h, function () { - this.remove() - }) - } - } - - function r(e) { - if (!v.aborted && !I) { - if (F = o(m), F || (n("cannot access response document"), e = M), e === D && v) return v.abort("timeout"), void k.reject(v, "timeout"); - if (e === M && v) return v.abort("server abort"), void k.reject(v, "error", "server abort"); - if (F && F.location.href !== c.iframeSrc || x) { - m.detachEvent ? m.detachEvent("onload", r) : m.removeEventListener("load", r, !1); - var i, a = "success"; - try { - if (x) throw"timeout"; - var s = "xml" === c.dataType || F.XMLDocument || t.isXMLDoc(F); - if (n("isXml=" + s), !s && window.opera && (null === F.body || !F.body.innerHTML) && --$) return n("requeing onLoad callback, DOM not available"), void setTimeout(r, 250); - var l = F.body ? F.body : F.documentElement; - v.responseText = l ? l.innerHTML : null, v.responseXML = F.XMLDocument ? F.XMLDocument : F, s && (c.dataType = "xml"), v.getResponseHeader = function (t) { - var e = {"content-type": c.dataType}; - return e[t.toLowerCase()] - }, l && (v.status = Number(l.getAttribute("status")) || v.status, v.statusText = l.getAttribute("statusText") || v.statusText); - var h = (c.dataType || "").toLowerCase(), d = /(json|script|text)/.test(h); - if (d || c.textarea) { - var f = F.getElementsByTagName("textarea")[0]; - if (f) v.responseText = f.value, v.status = Number(f.getAttribute("status")) || v.status, v.statusText = f.getAttribute("statusText") || v.statusText; else if (d) { - var p = F.getElementsByTagName("pre")[0], y = F.getElementsByTagName("body")[0]; - p ? v.responseText = p.textContent ? p.textContent : p.innerText : y && (v.responseText = y.textContent ? y.textContent : y.innerText) - } - } else "xml" === h && !v.responseXML && v.responseText && (v.responseXML = A(v.responseText)); - try { - L = O(v, h, c) - } catch (b) { - a = "parsererror", v.error = i = b || a - } - } catch (b) { - n("error caught: ", b), a = "error", v.error = i = b || a - } - v.aborted && (n("upload aborted"), a = null), v.status && (a = v.status >= 200 && v.status < 300 || 304 === v.status ? "success" : "error"), "success" === a ? (c.success && c.success.call(c.context, L, "success", v), k.resolve(v.responseText, "success", v), u && t.event.trigger("ajaxSuccess", [v, c])) : a && ("undefined" == typeof i && (i = v.statusText), c.error && c.error.call(c.context, v, a, i), k.reject(v, "error", i), u && t.event.trigger("ajaxError", [v, c, i])), u && t.event.trigger("ajaxComplete", [v, c]), u && !--t.active && t.event.trigger("ajaxStop"), c.complete && c.complete.call(c.context, v, a), I = !0, c.timeout && clearTimeout(C), setTimeout(function () { - c.iframeTarget ? g.attr("src", c.iframeSrc) : g.remove(), v.responseXML = null - }, 100) - } - } - } - - var l, h, c, u, f, g, m, v, b, w, x, C, _ = p[0], k = t.Deferred(); - if (k.abort = function (t) { - v.abort(t) - }, i) for (h = 0; h < y.length; h++) l = t(y[h]), s ? l.prop("disabled", !1) : l.removeAttr("disabled"); - c = t.extend(!0, {}, t.ajaxSettings, e), c.context = c.context || c, f = "jqFormIO" + (new Date).getTime(); - var T = _.ownerDocument, S = p.closest("body"); - if (c.iframeTarget ? (g = t(c.iframeTarget, T), w = g.attr2("name"), w ? f = w : g.attr2("name", f)) : (g = t(''),l.waittime>0&&(a.waitTimeout=v(l.waittime,b));var x=document.getElementById(w);x.onload=x.onreadystatechange=function(i){var o=!!l.scrollInside;if(a.firstLoad&&c.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){a.firstLoad=!1,l.waittime>0&&clearTimeout(a.waitTimeout);try{c.attr("ref",x.contentWindow.location.href);var s=e.frames[w].$;if(s&&"auto"===l.height&&"fullscreen"!=l.size){var r=s("body").addClass("body-modal").toggleClass("body-modal-scroll-inside",o);a.$iframeBody=r,l.iframeBodyClass&&r.addClass(l.iframeBodyClass);var h=[],d=function(i){c.removeClass("fade");var n=r.outerHeight();if(i===!0&&l.onlyIncreaseHeight&&(n=Math.max(n,f.data("minModalHeight")||0),f.data("minModalHeight",n)),o){var a=l.headerHeight;"number"!=typeof a?a=p.outerHeight():"function"==typeof a&&(a=a(p));var s=t(e).height();n=Math.min(n,s-a)}for(h.length>1&&n===h[0]&&(n=Math.max(n,h[1])),h.push(n);h.length>2;)h.shift();f.css("height",n),l.fade&&c.addClass("fade"),v()};c.callComEvent(a,"loaded",{modalType:"iframe",jQuery:s}),setTimeout(d,100),r.off("resize."+n).on("resize."+n,d),o&&t(e).off("resize."+n).on("resize."+n,d)}else v();var u=l.handleLinkInIframe;u&&s("body").on("click","string"==typeof u?u:"a[href]",function(){t(this).is('[data-toggle="modal"]')||c.addClass("modal-updating")}),l.iframeStyle&&s("head").append("")}catch(i){v()}}}}else t.ajax(t.extend({url:l.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?d.parent().empty().append(s):s.filter(".modal-content").length?d.find(".modal-content").replaceWith(s):f.wrapInner(s)}catch(r){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:r,data:i}),c.html(i)}c.callComEvent(a,"loaded",{modalType:o}),v(),l.scrollInside&&t(e).off("resize."+n).on("resize."+n,m)},error:b},l.ajaxOptions))}h||c.modal({show:"show",backdrop:l.backdrop,moveable:l.moveable,rememberPos:l.rememberPos,keyboard:l.keyboard,scrollInside:l.scrollInside})},r.prototype.close=function(t,i){var n=this;(t||i)&&n.$modal.on("hidden"+a,function(){"function"==typeof t&&t(),typeof i===s&&i.length&&!n.$modal.data("cancel-reload")&&("this"===i?e.location.reload():e.location=i)}),n.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.adjustPosition=function(t){t=t===i?this.options.position:t,"function"==typeof t&&(t=t(this)),this.$modal.modal("adjustPosition",t)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var o=t(this),a=o.data(n),l=t.extend({title:o.attr("title")||o.text(),url:o.attr("href"),type:o.hasClass("iframe")?"iframe":""},o.data(),t.isPlainObject(e)&&e);return a?void(typeof e==s?a[e](i):l.show&&a.show(i)):(o.data(n,a=new r(l,o)),void o.on((l.trigger||"click")+".toggle."+n,function(e){l=t.extend(l,{url:o.attr("href")||o.attr("data-url")||o.data("url")||l.url}),a.toggle(l),o.is("a")&&e.preventDefault()}))})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var n=t(this);n.hasClass("modal")?l.call(n,e,i):n.modalTrigger(e,i)})},t.fn.modal.bs=l;var h=function(e){return e?e=t(e):(e=t(".modal.modal-trigger"),!e.length),e&&e instanceof t?e:null},c=function(i,o,a){var s=i;if("function"==typeof i){var r=a;a=o,o=i,i=r}i=h(i),i&&i.length?i.each(function(){t(this).data(n).close(o,a)}):t("body").hasClass("modal-open")||t(".modal.in").length||t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(s,o,a)},d=function(t,e){e=h(e),e&&e.length&&e.modal("adjustPosition",t)},u=function(e,i){"string"==typeof e&&(e={url:e});var o=h(i);o&&o.length&&o.each(function(){t(this).data(n).show(e)})};t.zui({reloadModal:u,closeModal:c,ajustModalPosition:d,adjustModalPosition:d}),t(document).on("click."+n+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),o=i.attr("href"),a=null;try{a=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}a&&a.length||(i.data(n)?i.trigger(".toggle."+n):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+n+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
            ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,n){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n);for(var o=this.options.trigger.split(" "),a=o.length;a--;){var s=o[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,this.toggle.bind(this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,this.enter.bind(this)),this.$element.on(l+"."+this.type,this.options.selector,this.leave.bind(this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,n){i[t]!=n&&(e[t]=n)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var n=this;if(n.$element.trigger(i),i.isDefaultPrevented())return;var o=n.tip();n.setContent(e),n.options.animation&&o.addClass("fade");var a="function"==typeof n.options.placement?n.options.placement.call(n,o[0],n.$element[0]):n.options.placement,s=/\s?auto?\s?/i,r=s.test(a);r&&(a=a.replace(s,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(a),n.options.container?o.appendTo(n.options.container):o.insertAfter(n.$element);var l=n.getPosition(),h=o[0].offsetWidth,c=o[0].offsetHeight;if(r){var d=n.$element.parent(),u=a,f=document.documentElement.scrollTop||document.body.scrollTop,p="body"==n.options.container?window.innerWidth:d.outerWidth(),g="body"==n.options.container?window.innerHeight:d.outerHeight(),m="body"==n.options.container?0:d.offset().left;a="bottom"==a&&l.top+l.height+c-f>g?"top":"top"==a&&l.top-f-c<0?"bottom":"right"==a&&l.right+h>p?"left":"left"==a&&l.left-h

          • '}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](n),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,n=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!n&&("$next"==n?e.next(".popover"):t(n))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var n=t(this),o=n.data("zui.popover"),a="object"==typeof i&&i;o||n.data("zui.popover",o=new e(this,a)),"string"==typeof i&&o[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(e){t(o).remove(),t(a).each(function(e){var o=i(t(this));o.hasClass("open")&&(o.trigger(e=t.Event("hide."+n)),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden."+n))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n;try{n=i&&t(i)}catch(o){}return n&&n.length?n:e.parent()}var n="zui.dropdown",o=".dropdown-backdrop",a="[data-toggle=dropdown]",s=function(e){t(e).on("click."+n,this.toggle)};s.prototype.toggle=function(o){var a=t(this);if(!a.is(".disabled, :disabled")){var s=i(a),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('',a={icons:{},type:"default",placement:"top",time:4e3,parent:"body",close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)?r=t.extend({},r,e):e&&(r?r.content=e:r={content:e});var l=this;r=l.options=t.extend({},a,r),l.id=r.id||n++;var h=s[l.id];h&&h.destroy(),s[l.id]=l,l.$=t(o.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var c=!1,d=l.$.find(".messager-actions"),u=function(e){var n=t('
            ').appendTo("body").data(n,i);var s=function(t,i,n){n=n||e[t],"function"==typeof n&&o.on(i+a,n)};s("onShow","show"),s("shown","shown"),s("onHide","hide",function(t){if("iframe"===e.type&&i.$iframeBody){var n=i.$iframeBody.triggerHandler("modalhide"+a,[i]);n===!1&&t.preventDefault()}var o=e.onHide;if(o)return o(t)}),s("hidden","hidden"),s("loaded","loaded"),o.on("shown"+a,function(){i.isShown=!0}).on("hidden"+a,function(){i.isShown=!1}),this.$modal=o,this.$dialog=o.find(".modal-dialog"),e.mergeOptions&&(this.options=e)},r.prototype.show=function(i){var a=this,l=t.extend({},r.DEFAULTS,a.options,{url:a.$trigger?a.$trigger.attr("href")||a.$trigger.attr("data-url")||a.$trigger.data("url"):a.options.url},i),h=a.isShown;l=a.initOptions(l),h||a.init(l);var c=a.$modal,d=c.find(".modal-dialog"),u=l.custom,f=d.find(".modal-body").css("padding","").toggleClass("load-indicator loading",!!h),p=d.find(".modal-header"),g=d.find(".modal-content");c.toggleClass("fade",l.fade).addClass(l.className).toggleClass("modal-loading",!h).toggleClass("modal-scroll-inside",!!l.scrollInside),d.toggleClass("modal-md","md"===l.size).toggleClass("modal-sm","sm"===l.size).toggleClass("modal-lg","lg"===l.size).toggleClass("modal-fullscreen","fullscreen"===l.size),p.toggle(l.showHeader),p.find(".modal-icon").attr("class","modal-icon icon-"+l.icon),p.find(".modal-title-name").text(l.title||""),l.size&&"fullscreen"===l.size&&(l.width="",l.height="");var m=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){a.adjustPosition(l.position)},100)},v=function(t,e){return"undefined"==typeof t&&(t=l.delay),setTimeout(function(){d=c.find(".modal-dialog"),l.width&&"auto"!=l.width&&d.css("width",l.width),l.height&&"auto"!=l.height&&(d.css("height",l.height),"iframe"===l.type&&f.css("height",d.height()-p.outerHeight())),a.adjustPosition(l.position),c.removeClass("modal-loading").removeClass("modal-updating"),h&&f.removeClass("loading"),"iframe"!=l.type&&(f=d.off("resize."+n).find(".modal-body").off("resize."+n),l.scrollInside&&(f=f.children().off("resize."+n)),(f.length?f:d).on("resize."+n,m)),e&&e()},t)};if("custom"===l.type&&u)if("function"==typeof u){var y=u({modal:c,options:l,modalTrigger:a,ready:v});typeof y===s&&(f.html(y),v())}else u instanceof t?(f.html(t("
            ").append(u.clone()).html()),v()):(f.html(u),v());else if(l.url){var b=function(){var t=c.callComEvent(a,"broken");"string"==typeof t&&f.html(t),v()};if(c.attr("ref",l.url),"iframe"===l.type){c.addClass("modal-iframe"),this.firstLoad=!0;var w="iframe-"+l.name;p.detach(),f.detach(),g.empty().append(p).append(f),f.css("padding",0).html(''),l.waittime>0&&(a.waitTimeout=v(l.waittime,b));var x=document.getElementById(w);x.onload=x.onreadystatechange=function(i){var o=!!l.scrollInside;if(a.firstLoad&&c.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){a.firstLoad=!1,l.waittime>0&&clearTimeout(a.waitTimeout);try{c.attr("ref",x.contentWindow.location.href);var s=e.frames[w].$;if(s&&"auto"===l.height&&"fullscreen"!=l.size){var r=s("body").addClass("body-modal").toggleClass("body-modal-scroll-inside",o);a.$iframeBody=r,l.iframeBodyClass&&r.addClass(l.iframeBodyClass);var h=[],d=function(i){c.removeClass("fade");var n=r.outerHeight();if(i===!0&&l.onlyIncreaseHeight&&(n=Math.max(n,f.data("minModalHeight")||0),f.data("minModalHeight",n)),o){var a=l.headerHeight;"number"!=typeof a?a=p.outerHeight():"function"==typeof a&&(a=a(p));var s=t(e).height();n=Math.min(n,s-a)}for(h.length>1&&n===h[0]&&(n=Math.max(n,h[1])),h.push(n);h.length>2;)h.shift();f.css("height",n),l.fade&&c.addClass("fade"),v()};c.callComEvent(a,"loaded",{modalType:"iframe",jQuery:s}),setTimeout(d,100),r.off("resize."+n).on("resize."+n,d),o&&t(e).off("resize."+n).on("resize."+n,d)}else v();var u=l.handleLinkInIframe;u&&s("body").on("click","string"==typeof u?u:"a[href]",function(){t(this).is('[data-toggle="modal"]')||c.addClass("modal-updating")}),l.iframeStyle&&s("head").append("")}catch(i){v()}}}}else t.ajax(t.extend({url:l.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?d.parent().empty().append(s):s.filter(".modal-content").length?d.find(".modal-content").replaceWith(s):f.wrapInner(s)}catch(r){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:r,data:i}),c.html(i)}c.callComEvent(a,"loaded",{modalType:o}),v(),l.scrollInside&&t(e).off("resize."+n).on("resize."+n,m)},error:b},l.ajaxOptions))}h||c.modal({show:"show",backdrop:l.backdrop,moveable:l.moveable,rememberPos:l.rememberPos,keyboard:l.keyboard,scrollInside:l.scrollInside})},r.prototype.close=function(t,i){var n=this;(t||i)&&n.$modal.on("hidden"+a,function(){"function"==typeof t&&t(),typeof i===s&&i.length&&!n.$modal.data("cancel-reload")&&("this"===i?e.location.reload():e.location=i)}),n.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.adjustPosition=function(t){t=t===i?this.options.position:t,"function"==typeof t&&(t=t(this)),this.$modal.modal("adjustPosition",t)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var o=t(this),a=o.data(n),l=t.extend({title:o.attr("title")||o.text(),url:o.attr("href"),type:o.hasClass("iframe")?"iframe":""},o.data(),t.isPlainObject(e)&&e);return a?void(typeof e==s?a[e](i):l.show&&a.show(i)):(o.data(n,a=new r(l,o)),void o.on((l.trigger||"click")+".toggle."+n,function(e){l=t.extend(l,{url:o.attr("href")||o.attr("data-url")||o.data("url")||l.url}),a.toggle(l),o.is("a")&&e.preventDefault()}))})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var n=t(this);n.hasClass("modal")?l.call(n,e,i):n.modalTrigger(e,i)})},t.fn.modal.bs=l;var h=function(e){return e?e=t(e):(e=t(".modal.modal-trigger"),!e.length),e&&e instanceof t?e:null},c=function(i,o,a){var s=i;if("function"==typeof i){var r=a;a=o,o=i,i=r}i=h(i),i&&i.length?i.each(function(){t(this).data(n).close(o,a)}):t("body").hasClass("modal-open")||t(".modal.in").length||t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(s,o,a)},d=function(t,e){e=h(e),e&&e.length&&e.modal("adjustPosition",t)},u=function(e,i){"string"==typeof e&&(e={url:e});var o=h(i);o&&o.length&&o.each(function(){t(this).data(n).show(e)})};t.zui({reloadModal:u,closeModal:c,ajustModalPosition:d,adjustModalPosition:d}),t(document).on("click."+n+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),o=i.attr("href"),a=null;try{a=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}a&&a.length||(i.data(n)?i.trigger(".toggle."+n):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+n+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
            ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,n){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n);for(var o=this.options.trigger.split(" "),a=o.length;a--;){var s=o[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,this.toggle.bind(this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,this.enter.bind(this)),this.$element.on(l+"."+this.type,this.options.selector,this.leave.bind(this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,n){i[t]!=n&&(e[t]=n)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var n=this;if(n.$element.trigger(i),i.isDefaultPrevented())return;var o=n.tip();n.setContent(e),n.options.animation&&o.addClass("fade");var a="function"==typeof n.options.placement?n.options.placement.call(n,o[0],n.$element[0]):n.options.placement,s=/\s?auto?\s?/i,r=s.test(a);r&&(a=a.replace(s,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(a),n.options.container?o.appendTo(n.options.container):o.insertAfter(n.$element);var l=n.getPosition(),h=o[0].offsetWidth,c=o[0].offsetHeight;if(r){var d=n.$element.parent(),u=a,f=document.documentElement.scrollTop||document.body.scrollTop,p="body"==n.options.container?window.innerWidth:d.outerWidth(),g="body"==n.options.container?window.innerHeight:d.outerHeight(),m="body"==n.options.container?0:d.offset().left;a="bottom"==a&&l.top+l.height+c-f>g?"top":"top"==a&&l.top-f-c<0?"bottom":"right"==a&&l.right+h>p?"left":"left"==a&&l.left-h

            '}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](n),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,n=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!n&&("$next"==n?e.next(".popover"):t(n))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var n=t(this),o=n.data("zui.popover"),a="object"==typeof i&&i;o||n.data("zui.popover",o=new e(this,a)),"string"==typeof i&&o[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(e){t(o).remove(),t(a).each(function(e){var o=i(t(this));o.hasClass("open")&&(o.trigger(e=t.Event("hide."+n)),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden."+n))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n;try{n=i&&t(i)}catch(o){}return n&&n.length?n:e.parent()}var n="zui.dropdown",o=".dropdown-backdrop",a="[data-toggle=dropdown]",s=function(e){t(e).on("click."+n,this.toggle)};s.prototype.toggle=function(o){var a=t(this);if(!a.is(".disabled, :disabled")){var s=i(a),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('',a={icons:{},type:"default",placement:"top",time:4e3,parent:"body",close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)?r=t.extend({},r,e):e&&(r?r.content=e:r={content:e});var l=this;r=l.options=t.extend({},a,r),l.id=r.id||n++;var h=s[l.id];h&&h.destroy(),s[l.id]=l,l.$=t(o.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var c=!1,d=l.$.find(".messager-actions"),u=function(e){var n=t('
            From 641c4ba36224b5f11ad062d33577143142c69ad4 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 17 Nov 2021 15:08:45 +0800 Subject: [PATCH 288/443] * Finish task #44369. --- module/productplan/view/view.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 2609a86a82..f41b4328f3 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -364,7 +364,7 @@ id}&type=bug&orderBy=%s&link=$link¶m=$param"; ?> From d7763fdee5f00f08baf157c926bbab2647742052 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 17 Nov 2021 15:16:22 +0800 Subject: [PATCH 289/443] * Finish task #44369. --- module/group/lang/resource.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index a17a839279..1355b617df 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -837,6 +837,7 @@ $lang->resource->bug->confirmStoryChange = 'confirmStoryChange'; $lang->resource->bug->delete = 'deleteAction'; $lang->resource->bug->batchChangeModule = 'batchChangeModule'; $lang->resource->bug->batchChangeBranch = 'batchChangeBranch'; +$lang->resource->bug->batchChangePlan = 'batchChangePlan'; $lang->bug->methodOrder[0] = 'index'; $lang->bug->methodOrder[5] = 'browse'; From 3f6bdc127bb5e51ebf6b52c889c77530598eda1c Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 17 Nov 2021 15:20:28 +0800 Subject: [PATCH 290/443] * Finish task #44369. --- module/bug/lang/en.php | 1 + module/bug/lang/zh-cn.php | 1 + 2 files changed, 2 insertions(+) diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 4df3eeb931..18eb2ea9b9 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -99,6 +99,7 @@ $lang->bug->edit = 'Edit Bug'; $lang->bug->batchEdit = 'Batch Edit'; $lang->bug->batchChangeModule = 'Batch Edit Modules'; $lang->bug->batchChangeBranch = 'Batch Edit Branches'; +$lang->bug->batchChangePlan = 'Batch Edit Plans' $lang->bug->batchClose = 'Batch Close'; $lang->bug->assignTo = 'Assign'; $lang->bug->assignAction = 'Assign Bug'; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index 8c11dead7d..9a6a576eaf 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -99,6 +99,7 @@ $lang->bug->edit = '编辑Bug'; $lang->bug->batchEdit = '批量编辑'; $lang->bug->batchChangeModule = '批量修改模块'; $lang->bug->batchChangeBranch = '批量修改分支'; +$lang->bug->batchChangePlan = '批量修改计划'; $lang->bug->batchClose = '批量关闭'; $lang->bug->assignTo = '指派'; $lang->bug->assignAction = '指派Bug'; From bebdb6eff96a8d98b657fc760decb88b4ebe6a72 Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Wed, 17 Nov 2021 15:34:04 +0800 Subject: [PATCH 291/443] * update selectable component in zui. --- www/js/zui/min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/zui/min.js b/www/js/zui/min.js index 62a6922973..b78461ff88 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -41,8 +41,8 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ -function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
            ",i),this.is_multiple?this.container.html('
              '):(this.container.html(''+this.default_text+'
                '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),h=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+h+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
              • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
                ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
              • '+this.results_none_found+' ""
              • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,h;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.slectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, -selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,f="."+this.name+"."+this.id,p="function"==typeof h.checkFunc?h.checkFunc:null,g="function"==typeof h.rangeFunc?h.rangeFunc:null,m=!1,v=null,y="mousedown"+f,b=function(){a&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(p){var s=p.call(c,{intersect:n,target:e,range:a,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width
                ').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(f),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return x(o);var a=t.zui.getMouseButtonCode(h.mouseButton);if(!(a>-1&&o.button!==a||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(h.selector);s.addClass("slectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+f,w).on("mouseup"+f,x),v=setTimeout(function(){t(document).on(y,x)},10),o.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=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]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,h=o.dragCssClass,c=o.targetSelector,d=o.reverse,u=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};u(),n.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){h&&t.element.addClass(h),e=!1,i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,h=t.target,c=r&&h.is(r);if(c){if(!h.children(s).filter(".dragging").length){h.append(o);var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}return}var p=o.data(a),g=h.data(a);if(p===g)return u(f);p>g?h[d?"after":"before"](o):h[d?"before":"after"](o),e=!0;var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}},finish:function(t){h&&t.element&&t.element.removeClass(h),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i="zui.contextmenu",n={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,a={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,h=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),a},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
              • ');var n=t("
                ").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick),t("
              • ").toggleClass("disabled",e.disabled===!0).append(n)},d=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+s);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return a},p=function(h,d,p){t.isPlainObject(h)&&(p=d,d=h,h=d.items),o=!0,d=t.extend({},n,d);var g=t("#"+s);g.length||(g=t('
                ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(h,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=d.itemCreator||c,w=typeof h;if("string"===w?h=h.split(","):"function"===w&&(h=h(d)),!h)return!1;t.each(h,function(t,e){y.append(b(e,t,d))})}var x=d.animation,C=d.duration;x===!0&&(d.animation=x="fade"),u&&(clearTimeout(u),u=null);var _=function(){m.addClass("in"),d.onShown&&d.onShown(),p&&p()};d.onShow&&d.onShow(),g.data("options",{animation:x,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:C});var k=d.x,T=d.y;k===e&&(k=(d.event||d).clientX),k===e&&(k=r),T===e&&(T=(d.event||d).clientY),T===e&&(T=l);var y=m.children().first(),S=y.outerWidth(),D=y.outerHeight();if(d.position){var M=d.position({x:k,y:T,width:S,height:D},d,m);M&&(k=M.x,T=M.y)}if(d.limitInsideWindow){var P=t(window);k=Math.max(0,Math.min(k,P.width()-S)),T=Math.max(0,Math.min(T,P.height()-D))}return g.css({left:k,top:T}).show(),m.addClass("open"),x?(m.addClass(x),u=setTimeout(function(){_(),o=!1},10)):(_(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:f,listenMouse:h,isShow:d}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var s=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=n.trigger,l=r+"."+i;n.selector?o.$.on(l,n.selector,s):o.$.on(l,s),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return d(this.id)},t.fn.contextmenu=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 g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var s=a.data(i);s||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! +function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
                ",i),this.is_multiple?this.container.html('
                  '):(this.container.html('
                  '+this.default_text+'
                    '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),h=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+h+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
                  • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
                    ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
                  • '+this.results_none_found+' ""
                  • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,h;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.selectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, +selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,f="."+this.name+"."+this.id,p="function"==typeof h.checkFunc?h.checkFunc:null,g="function"==typeof h.rangeFunc?h.rangeFunc:null,m=!1,v=null,y="mousedown"+f,b=function(){a&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(p){var s=p.call(c,{intersect:n,target:e,range:a,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(f),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return x(o);var a=t.zui.getMouseButtonCode(h.mouseButton);if(!(a>-1&&o.button!==a||t(o.target).closest("input,select,textarea,label").length||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(h.selector);s.addClass("selectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+f,w).on("mouseup"+f,x),v=setTimeout(function(){t(document).on(y,x)},10),o.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=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]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,h=o.dragCssClass,c=o.targetSelector,d=o.reverse,u=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};u(),n.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){h&&t.element.addClass(h),e=!1,i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,h=t.target,c=r&&h.is(r);if(c){if(!h.children(s).filter(".dragging").length){h.append(o);var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}return}var p=o.data(a),g=h.data(a);if(p===g)return u(f);p>g?h[d?"after":"before"](o):h[d?"before":"after"](o),e=!0;var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}},finish:function(t){h&&t.element&&t.element.removeClass(h),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i="zui.contextmenu",n={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,a={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,h=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),a},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
                  • ');var n=t("
                    ").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick),t("
                  • ").toggleClass("disabled",e.disabled===!0).append(n)},d=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+s);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return a},p=function(h,d,p){t.isPlainObject(h)&&(p=d,d=h,h=d.items),o=!0,d=t.extend({},n,d);var g=t("#"+s);g.length||(g=t('
                    ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(h,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=d.itemCreator||c,w=typeof h;if("string"===w?h=h.split(","):"function"===w&&(h=h(d)),!h)return!1;t.each(h,function(t,e){y.append(b(e,t,d))})}var x=d.animation,C=d.duration;x===!0&&(d.animation=x="fade"),u&&(clearTimeout(u),u=null);var _=function(){m.addClass("in"),d.onShown&&d.onShown(),p&&p()};d.onShow&&d.onShow(),g.data("options",{animation:x,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:C});var k=d.x,T=d.y;k===e&&(k=(d.event||d).clientX),k===e&&(k=r),T===e&&(T=(d.event||d).clientY),T===e&&(T=l);var y=m.children().first(),S=y.outerWidth(),D=y.outerHeight();if(d.position){var M=d.position({x:k,y:T,width:S,height:D},d,m);M&&(k=M.x,T=M.y)}if(d.limitInsideWindow){var P=t(window);k=Math.max(0,Math.min(k,P.width()-S)),T=Math.max(0,Math.min(T,P.height()-D))}return g.css({left:k,top:T}).show(),m.addClass("open"),x?(m.addClass(x),u=setTimeout(function(){_(),o=!1},10)):(_(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:f,listenMouse:h,isShow:d}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var s=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=n.trigger,l=r+"."+i;n.selector?o.$.on(l,n.selector,s):o.$.on(l,s),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return d(this.id)},t.fn.contextmenu=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 g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var s=a.data(i);s||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! * jQuery Form Plugin * version: 4.2.2 * Requires jQuery v1.7.2 or later From 0d399519504eff03eeebbe178308d4c3f7414837 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Wed, 17 Nov 2021 16:14:53 +0800 Subject: [PATCH 292/443] * Code for task #44361. --- module/execution/control.php | 1 - module/stakeholder/model.php | 2 +- module/upgrade/css/mergeprogram.css | 5 +++++ module/upgrade/js/mergeprogram.js | 23 +++++++++++++++++++++ module/upgrade/view/mergebyproduct.html.php | 14 +++++++++++-- www/js/zui/min.js | 4 ++-- 6 files changed, 43 insertions(+), 6 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 338370fb72..144c94a87c 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -3317,5 +3317,4 @@ class execution extends control $groups = $this->lang->kanban->group->$type; die(html::select("group", $groups, $group, 'class="form-control chosen" data-max_drop_width="215"')); } - } diff --git a/module/stakeholder/model.php b/module/stakeholder/model.php index 18b6e47045..f400c73c09 100644 --- a/module/stakeholder/model.php +++ b/module/stakeholder/model.php @@ -328,7 +328,7 @@ class stakeholderModel extends model } } - if(empty($parents)) return false; + if(empty($parents)) return array(); /* Get all parent stakeholders.*/ $parentStakeholders = $this->dao->select('objectID, user')->from(TABLE_STAKEHOLDER)->where('objectID')->in(array_keys($parents))->andWhere('deleted')->eq('0')->fetchAll(); diff --git a/module/upgrade/css/mergeprogram.css b/module/upgrade/css/mergeprogram.css index 9a4843bd25..0d5e054dc3 100644 --- a/module/upgrade/css/mergeprogram.css +++ b/module/upgrade/css/mergeprogram.css @@ -34,3 +34,8 @@ div.divider {vertical-align: middle;} .sprintGroup {margin-left: 6px;} .programParams td > label:first-child {margin-right: 10px;} .programParams td > label:last-child {margin-left: 0px;} + +.projectList .scroll-handle .checkbox-primary {display: inline-block;} +.sprintRename {margin-top: 5px;} +.sprintRename input {display: inline-block; width: auto;} +.sprintRename .btn-group {display: inline-block;} diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index 1690fd8615..12c0bae379 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -1150,3 +1150,26 @@ function isSelectAll(lineID = 0, type = 'product') if(objectNum > checkedObjectNum || objectNum == 0) checked = false; return checked; } + +$(function() +{ + $('.sprintItem').mouseover(function() + { + $(this).find('#sprintEdit').removeClass('hidden'); + }).mouseout(function() + { + $(this).find('#sprintEdit').addClass('hidden'); + }) + + $(document).on('click', '#sprintEdit i', function() + { + $(this).parents('.sprintItem').addClass('hidden'); + $(this).parents('.sprintItem').next('.sprintRename').removeClass('hidden'); + }) + + $('.sprintRename button.name-cancel').click(function() + { + $(this).closest('.sprintRename').addClass('hidden'); + $(this).closest('.sprintRename').prev('.sprintItem').removeClass('hidden'); + }) +}) diff --git a/module/upgrade/view/mergebyproduct.html.php b/module/upgrade/view/mergebyproduct.html.php index 3847d25860..f5d22033b7 100644 --- a/module/upgrade/view/mergebyproduct.html.php +++ b/module/upgrade/view/mergebyproduct.html.php @@ -29,8 +29,18 @@
                    diff --git a/www/js/zui/min.js b/www/js/zui/min.js index 62a6922973..b78461ff88 100644 --- a/www/js/zui/min.js +++ b/www/js/zui/min.js @@ -41,8 +41,8 @@ Copyright (c) 2011 Harvest http://getharvest.com MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ -function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
                    ",i),this.is_multiple?this.container.html('
                      '):(this.container.html(''+this.default_text+'
                        '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),h=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+h+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
                      • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
                        ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
                      • '+this.results_none_found+' ""
                      • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,h;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.slectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, -selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,f="."+this.name+"."+this.id,p="function"==typeof h.checkFunc?h.checkFunc:null,g="function"==typeof h.rangeFunc?h.rangeFunc:null,m=!1,v=null,y="mousedown"+f,b=function(){a&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(p){var s=p.call(c,{intersect:n,target:e,range:a,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(f),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return x(o);var a=t.zui.getMouseButtonCode(h.mouseButton);if(!(a>-1&&o.button!==a||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(h.selector);s.addClass("slectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+f,w).on("mouseup"+f,x),v=setTimeout(function(){t(document).on(y,x)},10),o.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=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]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,h=o.dragCssClass,c=o.targetSelector,d=o.reverse,u=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};u(),n.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){h&&t.element.addClass(h),e=!1,i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,h=t.target,c=r&&h.is(r);if(c){if(!h.children(s).filter(".dragging").length){h.append(o);var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}return}var p=o.data(a),g=h.data(a);if(p===g)return u(f);p>g?h[d?"after":"before"](o):h[d?"before":"after"](o),e=!0;var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}},finish:function(t){h&&t.element&&t.element.removeClass(h),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i="zui.contextmenu",n={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,a={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,h=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),a},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
                      • ');var n=t("
                        ").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick),t("
                      • ").toggleClass("disabled",e.disabled===!0).append(n)},d=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+s);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return a},p=function(h,d,p){t.isPlainObject(h)&&(p=d,d=h,h=d.items),o=!0,d=t.extend({},n,d);var g=t("#"+s);g.length||(g=t('
                        ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(h,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=d.itemCreator||c,w=typeof h;if("string"===w?h=h.split(","):"function"===w&&(h=h(d)),!h)return!1;t.each(h,function(t,e){y.append(b(e,t,d))})}var x=d.animation,C=d.duration;x===!0&&(d.animation=x="fade"),u&&(clearTimeout(u),u=null);var _=function(){m.addClass("in"),d.onShown&&d.onShown(),p&&p()};d.onShow&&d.onShow(),g.data("options",{animation:x,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:C});var k=d.x,T=d.y;k===e&&(k=(d.event||d).clientX),k===e&&(k=r),T===e&&(T=(d.event||d).clientY),T===e&&(T=l);var y=m.children().first(),S=y.outerWidth(),D=y.outerHeight();if(d.position){var M=d.position({x:k,y:T,width:S,height:D},d,m);M&&(k=M.x,T=M.y)}if(d.limitInsideWindow){var P=t(window);k=Math.max(0,Math.min(k,P.width()-S)),T=Math.max(0,Math.min(T,P.height()-D))}return g.css({left:k,top:T}).show(),m.addClass("open"),x?(m.addClass(x),u=setTimeout(function(){_(),o=!1},10)):(_(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:f,listenMouse:h,isShow:d}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var s=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=n.trigger,l=r+"."+i;n.selector?o.$.on(l,n.selector,s):o.$.on(l,s),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return d(this.id)},t.fn.contextmenu=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 g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var s=a.data(i);s||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! +function(){var t,e,i,n,o,a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,n,o,a,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,a=s.length;o\"\'\`]/.test(t)?(e={"<":"<",">":">",'"':""","'":"'","`":"`"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&"})):t},e}(),n.select_to_array=function(t){var e,i,o,a,s;for(i=new n,s=t.childNodes,o=0,a=s.length;o0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,n,o;for(n=this.results_data,o=[],e=0,i=n.length;e"+i.search_text.substr(l+r.length),i.search_text=h.substr(0,l)+""+h.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),h=i.search_keys.substr(0,l+r.length)+""+i.search_keys.substr(l+r.length),i.search_text+='  '+h.substr(0,l)+""+h.substr(l)+""),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),a<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,n,o,a;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(n=t.replace(/\[|\]/g,"").split(" "),n.length))for(o=0,a=n.length;o0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(n){return e.browser_is_supported()?this.each(function(e){var o=t(this),a=o.data("chosen");"destroy"===n&&a?a.destroy():a||o.data("chosen",new i(this,t.extend({},o.data(),n)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var n=this.form_field.getAttribute("data-css-class");return n&&e.push(n),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("
                        ",i),this.is_multiple?this.container.html('
                          '):(this.container.html('
                          '+this.default_text+'
                            '),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,n,o,a,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),a=o+s,n=this.result_highlight.position().top+this.search_results.scrollTop(),i=n+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(n-r,Math.max(0,n-(o-r)/2)):i>=a?l=i-o>0?i-o:0:n-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var n=e.container.find(".chosen-drop"),o=n.outerHeight();e.drop_item_height&&o.active-result").length*e.drop_item_height));var a=e.container.offset();a.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var n=e.container.find(".chosen-drop");n.removeClass("in");var o=0,a=n.find(".chosen-results"),s=a.children("li"),r=parseFloat(a.css("padding-left").replace("px","")),l=parseFloat(a.css("padding-right").replace("px","")),h=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),n.css("width",Math.min(o+h+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,n.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,n,o=this;return i=t("
                          • ",{"class":"search-choice"}).html(""+e.html+""),e.disabled?i.addClass("search-choice-disabled"):(n=t("",{"class":"search-choice-close","data-option-array-index":e.array_index}),n.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var n=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),a=e.results_data[o];a&&a.selected&&n.push(a.value)}),i.val(n.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after(''),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("
                            ").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('
                          • '+this.results_none_found+' ""
                          • '),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,n,o,a,s,r,l,h;if(this.is_multiple){for(n=0,r=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,h=s.length;l",{style:a}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,n){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(n),this._init()},n=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),a=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return n(i,o,t)&&n(a,s,t)&&n(i,o,e)&&n(a,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,n){var o,a,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),a=o.data("id")):(a=e,o=r.$.find('.selectable-item[data-id="'+a+'"]')),o&&o.length){if(a||(a=t.zui.uuid(),o.attr("data-id",a)),void 0!==i&&null!==i||(i=!r.selections[a]),!!i!=!!r.selections[a]){var l;"function"==typeof n&&(l=n(i)),l!==!0&&(r.selections[a]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:a,selections:r.selections,target:o, +selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,n,a,s,r,l,h=this.options,c=this,d=h.ignoreVal,u=!0,f="."+this.name+"."+this.id,p="function"==typeof h.checkFunc?h.checkFunc:null,g="function"==typeof h.rangeFunc?h.rangeFunc:null,m=!1,v=null,y="mousedown"+f,b=function(){a&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var n=g?g.call(this,a,i):o(a,i);if(p){var s=p.call(c,{intersect:n,target:e,range:a,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else n?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,a={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&a.width').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),n.css(a),clearTimeout(l),l=setTimeout(b,10),u=!1))},x=function(e){t(document).off(f),clearTimeout(v),m&&(m=!1,n&&n.remove(),u||a&&(clearTimeout(l),b(),a=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return x(o);var a=t.zui.getMouseButtonCode(h.mouseButton);if(!(a>-1&&o.button!==a||t(o.target).closest("input,select,textarea,label").length||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(h.selector);s.addClass("selectable-item");var r=c.multiKey?"multi":h.clickBehavior;if("single"===r&&c.unselect(),h.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,n=null,u=!0,m=!0,t(document).on("mousemove"+f,w).on("mouseup"+f,x),v=setTimeout(function(){t(document).on(y,x)},10),o.preventDefault()}},_=h.container&&"default"!==h.container?t(h.container):this.$;h.trigger?_.on(y,h.trigger,C):_.on(y,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var n=t.Event(e+"."+this.name);this.$.trigger(n,i);var o=n.result,a=this.options[e];return"function"==typeof a&&(o=a.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=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]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var n="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},a="order",s=function(e,i){var n=this;n.$=t(e),n.options=t.extend({},o,n.$.data(),i),n.init()};s.DEFAULTS=o,s.NAME=n,s.prototype.init=function(){var e,i=this,n=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,h=o.dragCssClass,c=o.targetSelector,d=o.reverse,u=function(e){e=e||i.getItems(1);var n=e.length;n&&e.each(function(e){var i=d?n-e:e;t(this).attr("data-"+a,i).data(a,i)})};u(),n.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:n,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){h&&t.element.addClass(h),e=!1,i.trigger("start",t)},drag:function(t){if(n.addClass(l),t.isIn){var o=t.element,h=t.target,c=r&&h.is(r);if(c){if(!h.children(s).filter(".dragging").length){h.append(o);var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}return}var p=o.data(a),g=h.data(a);if(p===g)return u(f);p>g?h[d?"after":"before"](o):h[d?"before":"after"](o),e=!0;var f=i.getItems(1);u(f),i.trigger(a,{list:f,element:o})}},finish:function(t){h&&t.element&&t.element.removeClass(h),n.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e})}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(n,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i=this.$.find(this.options.selector).not(".drag-shadow");return e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(n),a="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(n,o=new s(this,a)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i="zui.contextmenu",n={animation:"fade",menuTemplate:'',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,a={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,h=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),a},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('
                          • ');var n=t("
                            ").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);return e.html?e.html===!0?n.html(e.label||e.text):n=t(e.html):n.text(e.label||e.text),e.icon&&n.prepend(''),e.onClick&&n.on("click",e.onClick),t("
                          • ").toggleClass("disabled",e.disabled===!0).append(n)},d=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,f=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var n=t("#"+s);if(n.length){var o=n.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){n.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;n.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return a},p=function(h,d,p){t.isPlainObject(h)&&(p=d,d=h,h=d.items),o=!0,d=t.extend({},n,d);var g=t("#"+s);g.length||(g=t('
                            ').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),n=d.onClickItem&&d.onClickItem(i.data("item"),i,e,d);n!==!1&&f()}).empty();m.attr("class","contextmenu-menu"+(d.className?" "+d.className:"")),g.attr("class","contextmenu contextmenu-show");var v=d.menuCreator;if(v)m.append(v(h,d));else{m.append(d.menuTemplate);var y=m.children().first(),b=d.itemCreator||c,w=typeof h;if("string"===w?h=h.split(","):"function"===w&&(h=h(d)),!h)return!1;t.each(h,function(t,e){y.append(b(e,t,d))})}var x=d.animation,C=d.duration;x===!0&&(d.animation=x="fade"),u&&(clearTimeout(u),u=null);var _=function(){m.addClass("in"),d.onShown&&d.onShown(),p&&p()};d.onShow&&d.onShow(),g.data("options",{animation:x,onHide:d.onHide,onHidden:d.onHidden,id:d.id,duration:C});var k=d.x,T=d.y;k===e&&(k=(d.event||d).clientX),k===e&&(k=r),T===e&&(T=(d.event||d).clientY),T===e&&(T=l);var y=m.children().first(),S=y.outerWidth(),D=y.outerHeight();if(d.position){var M=d.position({x:k,y:T,width:S,height:D},d,m);M&&(k=M.x,T=M.y)}if(d.limitInsideWindow){var P=t(window);k=Math.max(0,Math.min(k,P.width()-S)),T=Math.max(0,Math.min(T,P.height()-D))}return g.css({left:k,top:T}).show(),m.addClass("open"),x?(m.addClass(x),u=setTimeout(function(){_(),o=!1},10)):(_(),o=!1),a};t.extend(a,{NAME:i,DEFAULTS:n,show:p,hide:f,listenMouse:h,isShow:d}),t.zui({ContextMenu:a});var g=function(e,n){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),n=o.options=t.extend({trigger:"contextmenu"},a.DEFAULTS,this.$.data(),n);var s=function(t){if("mousedown"!==t.type||2===t.button){if(n.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=n.trigger,l=r+"."+i;n.selector?o.$.on(l,n.selector,s):o.$.on(l,s),n.show&&o.show("object"==typeof n.show?n.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return a.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),a.show(e,i)},g.prototype.isShow=function(){return d(this.id)},t.fn.contextmenu=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 g(this,a)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var n=i.$toggle,o=n.attr("data-target");o||(o=n.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var a=o?t(o):n.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";a.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=a.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=a.find("["+r+'="'+t(this).attr(r)+'"]'),n=i[0];if(n)return n[e.type]?n[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return a.clone()},position:function(t,e,i){var n=e.placement,o=e.$toggle;if(!n){var a=i.find(".dropdown-menu"),s=a.hasClass("pull-right"),r=o.parent().hasClass("dropup");n=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&a.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(n){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var n=t(e.target),a=n.closest('[data-toggle="context-dropdown"]');if(a.length){var s=a.data(i);s||a.contextDropdown({show:!0})}else o||n.closest(".contextmenu").length||f()})}(jQuery,void 0),/*! * jQuery Form Plugin * version: 4.2.2 * Requires jQuery v1.7.2 or later From 3e93ba664b16f8e51a244d27570a62bb8cd4982e Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 17 Nov 2021 16:33:42 +0800 Subject: [PATCH 293/443] * Fix bug #16390. --- module/bug/lang/en.php | 2 +- module/productplan/lang/en.php | 1 + module/productplan/lang/zh-cn.php | 1 + module/productplan/view/view.html.php | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index c8302a24e5..2845453b20 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -101,7 +101,7 @@ $lang->bug->edit = 'Edit Bug'; $lang->bug->batchEdit = 'Batch Edit'; $lang->bug->batchChangeModule = 'Batch Edit Modules'; $lang->bug->batchChangeBranch = 'Batch Edit Branches'; -$lang->bug->batchChangePlan = 'Batch Edit Plans' +$lang->bug->batchChangePlan = 'Batch Edit Plans'; $lang->bug->batchClose = 'Batch Close'; $lang->bug->assignTo = 'Assign'; $lang->bug->assignAction = 'Assign Bug'; diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index 80e832cd21..a20848b1f1 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -20,6 +20,7 @@ $lang->productplan->bugSummary = "Total %s Bugs on this page."; $lang->productplan->basicInfo = 'Basic Info'; $lang->productplan->batchEdit = 'Batch Edit'; $lang->productplan->project = 'Project'; +$lang->productplan->plan = 'Plan'; $lang->productplan->batchUnlink = "Batch Unlink"; $lang->productplan->linkStory = "Link Story"; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index 4ff355ac7a..4ccc703dd5 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -20,6 +20,7 @@ $lang->productplan->bugSummary = "本页共 %s 个Bug"; $lang->productplan->basicInfo = '基本信息'; $lang->productplan->batchEdit = '批量编辑'; $lang->productplan->project = '项目'; +$lang->productplan->plan = '计划'; $lang->productplan->batchUnlink = "批量移除"; $lang->productplan->linkStory = "关联{$lang->SRCommon}"; diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index f41b4328f3..14577fba59 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -441,7 +441,7 @@ $plans = array(0 => $lang->null) + $plans; $withSearch = count($plans) > 8; echo "