From f3ae6c1ecc9481313ba648949db49a6a710371c3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Aug 2014 08:09:22 +0000 Subject: [PATCH 1/4] * finish task #1999. --- module/doc/control.php | 3 +++ module/doc/js/edit.js | 49 +++++++++++++++++++++++++++++++++++ module/doc/model.php | 3 +++ module/doc/view/edit.html.php | 15 +++++++++-- 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 module/doc/js/edit.js diff --git a/module/doc/control.php b/module/doc/control.php index d529830939..2d3516f830 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -359,7 +359,10 @@ class doc extends control $this->view->doc = $doc; $this->view->libID = $libID; + $this->view->libs = $this->libs; $this->view->moduleOptionMenu = $moduleOptionMenu; + $this->view->products = $doc->project == 0 ? $this->product->getPairs() : $this->project->getProducts($doc->project); + $this->view->projects = $this->loadModel('project')->getPairs('all'); $this->display(); } diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js new file mode 100644 index 0000000000..76fd00eb7d --- /dev/null +++ b/module/doc/js/edit.js @@ -0,0 +1,49 @@ +function loadModule(lib) +{ + if(lib == 'product') + { + type = 'productdoc'; + root = 0; + } + else if(lib == 'project') + { + type = 'projectdoc'; + root = 0; + } + else + { + type = 'customdoc'; + root = lib; + } + + $.get(createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + root + '&viewType=' + type), function(data) + { + $('#module').parents('td').html(data); + $("#module").removeAttr('onchange'); + $("#module").chosen(defaultChosenOptions); + }); +} + +function changeByLib(lib) +{ + if(lib == 'product') + { + $('#product').parents('tr').show(); + $('#project').parents('tr').hide(); + } + else if(lib == 'project') + { + $('#product').parents('tr').show(); + $('#project').parents('tr').show(); + } + else + { + $('#product').parents('tr').hide(); + $('#project').parents('tr').hide(); + } +} + +$(function() +{ + changeByLib($('#lib').val()); +}) diff --git a/module/doc/model.php b/module/doc/model.php index 1d6a08d354..232290e2e8 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -218,6 +218,9 @@ class docModel extends model $doc = fixer::input('post') ->cleanInt('module') ->setDefault('module', 0) + ->setIF($this->post->lib == 'product', 'project', 0) + ->setIF(($this->post->lib != 'product' and $this->post->lib != 'project'), 'project', 0) + ->setIF(($this->post->lib != 'product' and $this->post->lib != 'project'), 'product', 0) ->skipSpecial($this->config->doc->editor->edit['id']) ->encodeURL('url') ->add('editedBy', $this->app->user->account) diff --git a/module/doc/view/edit.html.php b/module/doc/view/edit.html.php index fa1282a893..300e58975c 100644 --- a/module/doc/view/edit.html.php +++ b/module/doc/view/edit.html.php @@ -29,6 +29,18 @@ $(document).ready(function()
+ + + + + + + + + + + + @@ -68,8 +80,7 @@ $(document).ready(function()
doc->lib;?>lib, "class='form-control chosen' onchange='loadModule(this.value);changeByLib(this.value)'");?>
doc->project;?>project, "class='form-control chosen' onchange=loadProducts(this.value)");?>
doc->product;?>product, "class='form-control chosen'");?>
doc->module;?> module, "class='form-control chosen'");?>
- - product) . html::hidden('project', $doc->project);?> +
From 62aa572dbc508e350f55d6278ef668907c32d86a Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Aug 2014 08:28:32 +0000 Subject: [PATCH 2/4] * finish task #2206. --- module/bug/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/bug/model.php b/module/bug/model.php index 0d4c974499..5de3d31ee9 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -762,6 +762,7 @@ class bugModel extends model ->fetch(); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('resolvedDate')->ge($project->begin) + ->andWhere('resolution')->ne('postponed') ->andWhere('product')->eq($productID) ->andWhere('deleted')->eq(0) ->orderBy('openedDate ASC') From 5d4410f71388423f32f95ae85488aee2467f7111 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Aug 2014 08:59:52 +0000 Subject: [PATCH 3/4] * finish task #2047. --- module/bug/view/view.html.php | 4 ++-- module/build/js/common.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 3a1818bb52..dd3279f8c6 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -33,8 +33,8 @@ common::printIcon('bug', 'confirmBug', $params, $bug, 'button', 'search', '', 'iframe', true); common::printIcon('bug', 'assignTo', $params, '', 'button', '', '', 'iframe', true); common::printIcon('bug', 'resolve', $params, $bug, 'button', '', '', 'iframe showinonlybody', true); - common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe', true); - common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe', true); + common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true); + common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true); common::printIcon('bug', 'toStory', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']); common::printIcon('bug', 'createCase', $convertParams, '', 'button', 'sitemap'); diff --git a/module/build/js/common.js b/module/build/js/common.js index e69de29bb2..1f3ddf85b3 100644 --- a/module/build/js/common.js +++ b/module/build/js/common.js @@ -0,0 +1,4 @@ +$(document).ready(function() +{ + $("a.preview").modalTrigger({width:1000, type:'iframe'}); +}) From f5c3728f530b9d0749e6dcd5c71167783bf98dbe Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 15 Aug 2014 09:12:39 +0000 Subject: [PATCH 4/4] * finish task #2016. --- module/group/view/privbygroup.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/group/view/privbygroup.html.php b/module/group/view/privbygroup.html.php index 50ff9e2ac4..daf6aaf808 100644 --- a/module/group/view/privbygroup.html.php +++ b/module/group/view/privbygroup.html.php @@ -12,7 +12,7 @@ ?>
-
+
name;?>