diff --git a/db/demo.sql b/db/demo.sql index 5318e9bd66..cccc3cb27c 100644 --- a/db/demo.sql +++ b/db/demo.sql @@ -226,6 +226,11 @@ INSERT INTO `zt_productplan` (`id`, `product`, `title`, `desc`, `begin`, `end`, INSERT INTO `zt_project` (`id`, `isCat`, `catID`, `type`, `parent`, `name`, `code`, `begin`, `end`, `days`, `status`, `statge`, `pri`, `desc`, `openedBy`, `openedDate`, `closedBy`, `closedDate`, `canceledBy`, `canceledDate`, `PO`, `PM`, `QD`, `RD`, `team`, `acl`, `whitelist`, `order`, `deleted`) VALUES(1, '0', 0, 'sprint', 0, '企业网站第一期', 'coWeb1', '2012-06-05', '2012-12-04', 184, 'done', '1', '1', '开发企业网站的基本雏形。
', '', 0, '', 0, '', 0, 'productManager', 'projectManager', 'testManager', 'productManager', '公司开发团队', 'open', '', '5', '0'); INSERT INTO `zt_project` (`id`, `isCat`, `catID`, `type`, `parent`, `name`, `code`, `begin`, `end`, `days`, `status`, `statge`, `pri`, `desc`, `openedBy`, `openedDate`, `closedBy`, `closedDate`, `canceledBy`, `canceledDate`, `PO`, `PM`, `QD`, `RD`, `team`, `acl`, `whitelist`, `order`, `deleted`) VALUES(2, '0', 0, 'sprint', 0, '企业网站第二期', 'coWebsite2', '2013-06-05', '2014-06-04', 365, 'wait', '1', '1', '', '', 0, '', 0, '', 0, 'productManager', 'projectManager', 'testManager', 'productManager', '公司开发团队', 'open', '', '10', '0'); +INSERT INTO `zt_doclib` (`id`, `product`, `project`, `name`, `acl`, `main`) VALUES(1, 1, 0, '公司企业网站建设', 'open','1'); +INSERT INTO `zt_doclib` (`id`, `product`, `project`, `name`, `acl`, `main`) VALUES(2, 2, 0, '企业内部工时管理系统', 'open', '1'); +INSERT INTO `zt_doclib` (`id`, `product`, `project`, `name`, `acl`, `main`) VALUES(3, 0, 1, '企业网站第一期', 'open', '1'); +INSERT INTO `zt_doclib` (`id`, `product`, `project`, `name`, `acl`, `main`) VALUES(4, 0, 2, '企业网站第二期', 'open', '1'); + INSERT INTO `zt_projectproduct` (`project`, `product`) VALUES(1, 1); INSERT INTO `zt_projectproduct` (`project`, `product`) VALUES(2, 1); diff --git a/db/update8.2.6.sql b/db/update8.2.6.sql index 5a57635e28..a683b5bd4b 100644 --- a/db/update8.2.6.sql +++ b/db/update8.2.6.sql @@ -21,3 +21,4 @@ ADD `users` text NOT NULL AFTER `groups`; ALTER TABLE `zt_doclib` ADD `acl` varchar(10) COLLATE 'utf8_general_ci' NOT NULL DEFAULT 'open' AFTER `name`; ALTER TABLE `zt_doc` ADD `acl` varchar(10) NOT NULL DEFAULT 'open' AFTER `editedDate`; ALTER TABLE `zt_doclib` ADD `main` enum('0','1') COLLATE 'utf8_general_ci' NOT NULL DEFAULT '0' AFTER `users`; +UPDATE `zt_doc` SET `type` = 'text' WHERE `type` = 'file'; diff --git a/module/doc/control.php b/module/doc/control.php index 257c376de7..946462c3af 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -324,6 +324,7 @@ class doc extends control $this->view->type = $type; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode'); + $this->view->crumb = $this->doc->getCrumbs($libID, $moduleID, $docID = 0, $this->from); $this->display(); } @@ -378,6 +379,7 @@ class doc extends control $this->view->type = $type; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode'); + $this->view->crumb = $this->doc->getCrumbs($libID, $doc->module, $docID = 0, $this->from); $this->display(); } @@ -752,7 +754,7 @@ class doc extends control $this->view->type = $type; $this->view->object = $object; $this->view->from = $from; - $this->view->libs = $this->doc->getLibByObject($type, $objectID); + $this->view->libs = $this->doc->getLibsByObject($type, $objectID); $this->display(); } } diff --git a/module/doc/css/common.css b/module/doc/css/common.css index 62317003d7..5d699e79e9 100644 --- a/module/doc/css/common.css +++ b/module/doc/css/common.css @@ -1,11 +1,12 @@ .libs-group-heading {color: #808080; border-bottom:1px solid #ddd; padding:8px; text-align:center; background:#DDF3F5} -.libs-group-heading a{display:block;width:100%;height:100%;} +.libs-group-heading a{display:block;width:100%;height:100%; overflow: hidden; white-space: nowrap;} .libs-group{padding:10px 10px 10px 10px;} .lib {float: left; display: block; width:80px; padding: 5px; margin:0px 3px; text-align: center; color: #333; overflow: hidden; text-overflow: ellipsis;} .lib .file-icon{font-size:30px;} .lib .lib-name{height: 2em; line-height: 14px; overflow: hidden;} .lib:hover, .lib:focus, .lib:active {border-color: #2e6dad; background-color: #EBF2F9; color: #2e6dad} .crumb{margin-right:10px;} +#titlebar > .heading > strong > i{display:inline;} #modulemenu .nav > li > .dropdown > a#libType{display:inline-block;} #modulemenu .nav > li > .dropdown.open > a#libType{background:#e5e5e5;} diff --git a/module/doc/css/index.css b/module/doc/css/index.css index 7268af7b6a..98cf3d7588 100644 --- a/module/doc/css/index.css +++ b/module/doc/css/index.css @@ -1,5 +1,6 @@ .lib-heading{border-right:1px solid #ddd;} #libs table td.row{padding:0px;} +#libs table td.none{border-right:0px} #libs table td.lib-more{border-left:1px solid #ddd;} #libs table td.lib-more a.more{display:block;width:100%;height:100%} .table.project,.table.product{border:0px;} diff --git a/module/doc/css/showfiles.css b/module/doc/css/showfiles.css index 0aca702f2d..7b8057b4c7 100644 --- a/module/doc/css/showfiles.css +++ b/module/doc/css/showfiles.css @@ -11,7 +11,7 @@ .lib-file .card-heading > .icon-download {opacity: .5; position: relative; top: 2px} .lib-file .card-heading {color: #114f8e} .lib-file .card-heading:hover {background-color: #EBF2F9; color: #2e6dad} -.lib-file .card-heading > .delete {opacity: 0; margin-top:-1px; margin-right:5px} +.lib-file .card-heading > .delete {opacity: 0.2; margin-top:-1px; margin-right:5px} .lib-file .card-heading > .delete .icon{font-size:16px;} .lib-file .card-heading:hover > .delete{opacity:1} .lib-file .media-wrapper > .icon-holder {font-size: 105px; opacity: 1; color: rgba(255,255,255,.7); opacity: .6} diff --git a/module/doc/css/view.css b/module/doc/css/view.css index aed9210f73..e69de29bb2 100644 --- a/module/doc/css/view.css +++ b/module/doc/css/view.css @@ -1 +0,0 @@ -#titlebar > .heading > strong.crumb > i.icon-angle-right{display:inline;} diff --git a/module/doc/js/edit.js b/module/doc/js/edit.js index fd0b5cb41c..66dae955b9 100644 --- a/module/doc/js/edit.js +++ b/module/doc/js/edit.js @@ -1,6 +1,6 @@ $(function() { - toggleAcl($('#acl').val()); + toggleAcl($('input[name="acl"]:checked').val()); $('input[name="type"]').change(function() { var type = $(this).val(); diff --git a/module/doc/js/editlib.js b/module/doc/js/editlib.js new file mode 100644 index 0000000000..cf352ddab1 --- /dev/null +++ b/module/doc/js/editlib.js @@ -0,0 +1,4 @@ +$(function() +{ + toggleAcl($('input[name="acl"]:checked').val()); +}) diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 8b6ca0ab42..eed0fbf104 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -39,6 +39,8 @@ $lang->doc->moduleDoc = 'By module'; $lang->doc->searchDoc = 'By search'; $lang->doc->allDoc = 'All doc'; $lang->doc->openedByMe = 'Added by me'; +$lang->doc->orderByOpen = 'Last added'; +$lang->doc->orderByEdit = 'Last edited'; /* Actions. */ $lang->doc->index = 'Index'; @@ -49,6 +51,8 @@ $lang->doc->browse = 'Browse doc'; $lang->doc->view = 'View doc'; $lang->doc->diff = 'Diff'; $lang->doc->manageType = 'Manage type'; +$lang->doc->editType = 'Edit type'; +$lang->doc->deleteType = 'Delete type'; $lang->doc->addType = 'Add type'; $lang->doc->libName = 'Library name'; diff --git a/module/doc/model.php b/module/doc/model.php index 277ae552c1..ae83a97ca0 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -755,7 +755,7 @@ class docModel extends model */ public function getLibsByObject($type, $objectID, $mode = '') { - $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('id desc')->fetchAll('id'); + $objectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere($type)->eq($objectID)->orderBy('id')->fetchAll('id'); if($type == 'product') { $hasProject = $this->dao->select('DISTINCT product')->from(TABLE_PROJECTPRODUCT)->alias('t1') @@ -1096,7 +1096,7 @@ class docModel extends model $objectName = $this->dao->select('name')->from($table)->where('id')->eq($lib->$type)->fetch('name'); } $crumb = ''; - if($objectName) $crumb .= $objectName . $this->lang->arrow; + if($objectName) $crumb .= html::a(helper::createLink('doc', 'objectLibs', "type=$type&objectID={$lib->$type}&from=$from"), $objectName) . $this->lang->arrow; $crumb .= html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=all¶m=0&orderBy=id_desc&from=$from"), $lib->name); foreach($parents as $module) $crumb .= $this->lang->arrow . html::a(helper::createLink('doc', 'browse', "libID=$libID&browseType=byModule¶m=$module->id&orderBy=id_desc&from=$from"), $module->name); if($doc) $crumb .= $this->lang->arrow . $doc->title; diff --git a/module/doc/view/alllibs.html.php b/module/doc/view/alllibs.html.php index fa655103b8..b0e7741177 100644 --- a/module/doc/view/alllibs.html.php +++ b/module/doc/view/alllibs.html.php @@ -20,7 +20,7 @@ id])): ?> "?> -
id&from=doc"), $lib->name)?>
+
id&from=doc"), $lib->name, '', "title='{$lib->name}'")?>
id] as $subLibID => $subLibName):?> .actions {position: absolute; bottom: -30px; left: -1px; right: -1px; background-color: #333; background-color: rgba(0,0,0,.5); margin: 0; opacity: 0; transition: opacity .2s;} -#filesPanel .file:hover > .actions {opacity: 1} -#filesPanel .file > .actions > a {line-height: 30px; display: inline-block; padding: 0 8px; color: #fff;} +#filesPanel .file.create {height:88px;} +#filesPanel .file.create a{height:100%;} +#filesPanel .file.create .file-icon {height:100%; opacity: 0.5; color:#ddd;} +#filesPanel .file.create .icon-plus {font-size: 18px; display: block; text-align: center; position: absolute; top: 0; right: 0; left: 0; bottom: 0; line-height: 60px; opacity: 0.5; transition: opacity .2s; text-shadow: 1px 1px 3px rgba(0,0,0,.2);} +#filesPanel .file.create:hover .icon-plus {opacity: .9; animation: flash-icon 1s linear alternate infinite} +#filesPanel .file.create:hover .file-icon {opacity: .9; animation: flash-icon 1s linear alternate infinite}
@@ -68,6 +71,12 @@
+
+ ' title='doc->addType?>'> + + + +
id")?>'> @@ -76,6 +85,12 @@
+
+ ' title='doc->create?>'> + + + +
diff --git a/module/doc/view/create.html.php b/module/doc/view/create.html.php index 6a6eaee324..1eace88b28 100644 --- a/module/doc/view/create.html.php +++ b/module/doc/view/create.html.php @@ -18,8 +18,7 @@
- icons['doc']);?> - doc->create;?> + arrow . $lang->doc->create;?>
diff --git a/module/doc/view/edit.html.php b/module/doc/view/edit.html.php index 5cc08e24e9..a69c3bbea7 100644 --- a/module/doc/view/edit.html.php +++ b/module/doc/view/edit.html.php @@ -18,7 +18,7 @@
icons['doc']);?> id;?> - createLink('doc', 'view', "docID=$doc->id"), $doc->title);?> + arrow . html::a($this->createLink('doc', 'view', "docID=$doc->id"), $doc->title);?> icons['edit']) . ' ' . $lang->doc->edit;?>
@@ -45,7 +45,7 @@ type == 'url') echo "class='hidden'"?>> doc->content;?> - content), "style='width:100%; height:200px'") . html::hidden('contentType', $doc->contentType);?> + type == 'url' ? '' : htmlspecialchars($doc->content), "style='width:100%; height:200px'") . html::hidden('contentType', $doc->contentType);?> type != 'url') echo "class='hidden'"?>> doc->url;?> diff --git a/module/doc/view/footer.html.php b/module/doc/view/footer.html.php index 2eb7410426..5644fbe0c7 100644 --- a/module/doc/view/footer.html.php +++ b/module/doc/view/footer.html.php @@ -1,9 +1,12 @@ - diff --git a/module/doc/view/index.html.php b/module/doc/view/index.html.php index 757f2ca5f7..62ce6897fa 100644 --- a/module/doc/view/index.html.php +++ b/module/doc/view/index.html.php @@ -31,7 +31,7 @@ id])):?> '?> -
id&from=doc"), $product->name)?>
+
id&from=doc"), $product->name, '', "title='{$product->name}'")?>
id] as $libID => $libName):?> id])):?> '?> -
id&from=doc"), $project->name)?>
+
id&from=doc"), $project->name, '', "title='{$project->name}'")?>
id] as $libID => $libName):?>
- $lib):?> + $libName):?> id&browseType=all¶m=0&orderBy=id_desc&from=$from"); - if($libID == 'project') $libLink = inlink('allLibs', "type=project&extra=product=$lib->id"); - if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$lib->id"); + $libLink = inlink('browse', "libID=$libID&browseType=all¶m=0&orderBy=id_desc&from=$from"); + if($libID == 'project') $libLink = inlink('allLibs', "type=project&extra=product=$object->id"); + if($libID == 'files') $libLink = inlink('showFiles', "type=$type&objectID=$object->id"); ?> - + -
name?>
+
diff --git a/module/doc/view/showfiles.html.php b/module/doc/view/showfiles.html.php index c4472a4d57..f12fde2095 100644 --- a/module/doc/view/showfiles.html.php +++ b/module/doc/view/showfiles.html.php @@ -12,7 +12,7 @@ ?>
- name . ': ' . $lang->doclib->files?> + id}&from={$this->from}"), $object->name) . $lang->arrow . $lang->doclib->files?>
diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 5249defae9..7017e83c51 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -149,7 +149,7 @@ class upgradeModel extends model case '8_2_4': case '8_2_5': case '8_2_6': - $this->execSQL($this->getUpgradeFile('8.2.1')); + $this->execSQL($this->getUpgradeFile('8.2.6')); $this->adjustDocModule(); $this->moveDocContent(); $this->adjustPriv8_3();