* Finish task #8199.

This commit is contained in:
tianshujie98
2020-11-03 17:25:01 +08:00
parent 4ea37d68a2
commit a2a50698ee
14 changed files with 349 additions and 148 deletions
+1
View File
@@ -0,0 +1 @@
ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`;
+1
View File
@@ -304,6 +304,7 @@ CREATE TABLE IF NOT EXISTS `zt_doc` (
`addedDate` datetime NOT NULL,
`editedBy` varchar(30) NOT NULL,
`editedDate` datetime NOT NULL,
`mailto` text,
`acl` varchar(10) NOT NULL DEFAULT 'open',
`groups` varchar(255) NOT NULL,
`users` text NOT NULL,
+4 -2
View File
@@ -320,6 +320,8 @@ class doc extends control
$this->send(array('result' => 'fail', 'message' => sprintf($this->lang->duplicate, $this->lang->doc->common), 'locate' => $this->createLink('doc', 'view', "docID=$docID")));
}
$this->executeHooks($docID);
$fileAction = '';
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
$this->action->create('doc', $docID, 'Created', $fileAction);
@@ -371,7 +373,7 @@ class doc extends control
$this->view->type = $type;
$this->view->docType = $docType;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('nocode');
$this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted');
$this->display();
}
@@ -424,7 +426,7 @@ class doc extends control
$this->view->type = $type;
$this->view->libs = $this->doc->getLibs($type = 'all', $extra = 'withObject');
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('noletter', $doc->users);
$this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted', $doc->users);
$this->display();
}
+2
View File
@@ -1 +1,3 @@
#whiteListBox .input-group:last-child{margin-top:10px}
#mailtoGroup .input-group-btn > .btn {margin-left: -1px!important;}
#mailtoGroup .chosen-container-single a {border-left-width: 0px;}
+7
View File
@@ -47,6 +47,7 @@ $lang->doc->users = 'Benutzer';
$lang->doc->item = ' Einträge';
$lang->doc->num = 'Doks';
$lang->doc->searchResult = 'Suchergebnis';
$lang->doc->mailto = 'Mailto';
$lang->doc->moduleDoc = 'Nach Modulen';
$lang->doc->searchDoc = 'Suche';
@@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = 'Display Empty Library';
$lang->doc->customShowLibsList['children'] = 'Display Child-category Documents';
$lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon}s Only";
$lang->doc->mail = new stdclass();
$lang->doc->mail->create = new stdclass();
$lang->doc->mail->edit = new stdclass();
$lang->doc->mail->create->title = "%s created document #%s:%s";
$lang->doc->mail->edit->title = "%s edited document #%s:%s";
$lang->doc->confirmDelete = "Möchten Sie dieses Dokument löschen?";
$lang->doc->confirmDeleteLib = "Möchten Sie diese Bibliothek löschen?";
$lang->doc->errorEditSystemDoc = "System Dokumentenbibliothek darf nicht geändert werden.";
+7
View File
@@ -47,6 +47,7 @@ $lang->doc->users = 'Users';
$lang->doc->item = ' Items';
$lang->doc->num = 'Documents';
$lang->doc->searchResult = 'Search Result';
$lang->doc->mailto = 'Mailto';
$lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Search';
@@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = 'Display Empty Library';
$lang->doc->customShowLibsList['children'] = 'Display Child-category Documents';
$lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon}s Only";
$lang->doc->mail = new stdclass();
$lang->doc->mail->create = new stdclass();
$lang->doc->mail->edit = new stdclass();
$lang->doc->mail->create->title = "%s created document #%s:%s";
$lang->doc->mail->edit->title = "%s edited document #%s:%s";
$lang->doc->confirmDelete = "Do you want to delete this document?";
$lang->doc->confirmDeleteLib = "Do you want to delete this document library?";
$lang->doc->errorEditSystemDoc = "You don't have to change system document library.";
+7
View File
@@ -47,6 +47,7 @@ $lang->doc->users = 'Utilisateurs';
$lang->doc->item = ' Objets';
$lang->doc->num = 'Documents';
$lang->doc->searchResult = 'Résultat de Recherche';
$lang->doc->mailto = 'Mailto';
$lang->doc->moduleDoc = 'Par Module';
$lang->doc->searchDoc = 'Rechercher';
@@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = 'Montrer Bibliothèques Vides';
$lang->doc->customShowLibsList['children'] = 'Montrer sous-catégorie de Documents';
$lang->doc->customShowLibsList['unclosed'] = "Montrer {$lang->projectCommon}s actifs seulement";
$lang->doc->mail = new stdclass();
$lang->doc->mail->create = new stdclass();
$lang->doc->mail->edit = new stdclass();
$lang->doc->mail->create->title = "%s created document #%s:%s";
$lang->doc->mail->edit->title = "%s edited document #%s:%s";
$lang->doc->confirmDelete = "Voulez-vous supprimer ce document ?";
$lang->doc->confirmDeleteLib = "Voulez-vous supprimer cette Bibliothèque ?";
$lang->doc->errorEditSystemDoc = "Vous n'avez pas besoin de changer de système de Bibliothèque.";
+153 -146
View File
@@ -10,104 +10,105 @@
* @link http://www.zentao.net
*/
/* Fields. */
$lang->doc->common = 'Tài liệu';
$lang->doc->id = 'ID';
$lang->doc->product = $lang->productCommon;
$lang->doc->project = $lang->projectCommon;
$lang->doc->lib = 'Thư viện';
$lang->doc->module = 'Danh mục';
$lang->doc->title = 'Tên';
$lang->doc->digest = 'Tóm tắt';
$lang->doc->comment = 'Nhận xét';
$lang->doc->type = 'Loại';
$lang->doc->content = 'Text';
$lang->doc->keywords = 'Tags';
$lang->doc->url = 'URL';
$lang->doc->files = 'Files';
$lang->doc->addedBy = 'Author';
$lang->doc->addedDate = 'Đã thêm';
$lang->doc->editedBy = 'UpdatedBy';
$lang->doc->editedDate = 'UpdatedDate';
$lang->doc->version = 'Phiên bản';
$lang->doc->basicInfo = 'Thông tin cơ bản';
$lang->doc->deleted = 'Đã xóa';
$lang->doc->fileObject = 'Dependent Item';
$lang->doc->whiteList = 'Danh sách trắng';
$lang->doc->contentType = 'Định dạng';
$lang->doc->separator = "<i class='icon-angle-right'></i>";
$lang->doc->fileTitle = 'File tên';
$lang->doc->filePath = 'File Path';
$lang->doc->extension = 'Extension';
$lang->doc->size = 'Size';
$lang->doc->download = 'Tải về';
$lang->doc->acl = 'Right';
$lang->doc->fileName = 'Files';
$lang->doc->groups = 'Nhóm';
$lang->doc->users = 'Người dùng';
$lang->doc->item = ' Items';
$lang->doc->num = 'Documents';
$lang->doc->searchResult = 'Search kết quả';
$lang->doc->common = 'Tài liệu';
$lang->doc->id = 'ID';
$lang->doc->product = $lang->productCommon;
$lang->doc->project = $lang->projectCommon;
$lang->doc->lib = 'Thư viện';
$lang->doc->module = 'Danh mục';
$lang->doc->title = 'Tên';
$lang->doc->digest = 'Tóm tắt';
$lang->doc->comment = 'Nhận xét';
$lang->doc->type = 'Loại';
$lang->doc->content = 'Text';
$lang->doc->keywords = 'Tags';
$lang->doc->url = 'URL';
$lang->doc->files = 'Files';
$lang->doc->addedBy = 'Author';
$lang->doc->addedDate = 'Đã thêm';
$lang->doc->editedBy = 'UpdatedBy';
$lang->doc->editedDate = 'UpdatedDate';
$lang->doc->version = 'Phiên bản';
$lang->doc->basicInfo = 'Thông tin cơ bản';
$lang->doc->deleted = 'Đã xóa';
$lang->doc->fileObject = 'Dependent Item';
$lang->doc->whiteList = 'Danh sách trắng';
$lang->doc->contentType = 'Định dạng';
$lang->doc->separator = "<i class='icon-angle-right'></i>";
$lang->doc->fileTitle = 'File tên';
$lang->doc->filePath = 'File Path';
$lang->doc->extension = 'Extension';
$lang->doc->size = 'Size';
$lang->doc->download = 'Tải về';
$lang->doc->acl = 'Right';
$lang->doc->fileName = 'Files';
$lang->doc->groups = 'Nhóm';
$lang->doc->users = 'Người dùng';
$lang->doc->item = ' Items';
$lang->doc->num = 'Documents';
$lang->doc->searchResult = 'Search kết quả';
$lang->doc->mailto = 'Mailto';
$lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Tìm kiếm';
$lang->doc->fast = 'Quick Entry';
$lang->doc->allDoc = 'Tất cả tài liệu';
$lang->doc->openedByMe = 'Của bạn';
$lang->doc->orderByOpen = 'Recent Added';
$lang->doc->orderByEdit = 'Recent Updated';
$lang->doc->orderByVisit = 'Last Visited';
$lang->doc->todayEdited = 'Updated Today';
$lang->doc->pastEdited = 'Tổng Updated';
$lang->doc->myDoc = 'My tài liệu';
$lang->doc->myCollection = 'My Favorites';
$lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Tìm kiếm';
$lang->doc->fast = 'Quick Entry';
$lang->doc->allDoc = 'Tất cả tài liệu';
$lang->doc->openedByMe = 'Của bạn';
$lang->doc->orderByOpen = 'Recent Added';
$lang->doc->orderByEdit = 'Recent Updated';
$lang->doc->orderByVisit = 'Last Visited';
$lang->doc->todayEdited = 'Updated Today';
$lang->doc->pastEdited = 'Tổng Updated';
$lang->doc->myDoc = 'My tài liệu';
$lang->doc->myCollection = 'My Favorites';
/* Methods list */
$lang->doc->index = 'Document Home';
$lang->doc->create = 'Tạo tài liệu';
$lang->doc->edit = 'Sửa tài liệu';
$lang->doc->delete = 'Xóa tài liệu';
$lang->doc->browse = 'Document danh sách';
$lang->doc->view = 'Document Detail';
$lang->doc->diff = 'Diff';
$lang->doc->diffAction = 'Diff tài liệu';
$lang->doc->sort = 'Đánh giá tài liệu';
$lang->doc->manageType = 'Quản lý danh mục';
$lang->doc->editType = 'Sửa';
$lang->doc->deleteType = 'Xóa';
$lang->doc->addType = 'Thêm';
$lang->doc->childType = 'Categories';
$lang->doc->collect = 'Thêm Favorite';
$lang->doc->cancelCollection = 'Remove Favorite';
$lang->doc->deleteFile = 'Xóa File';
$lang->doc->index = 'Document Home';
$lang->doc->create = 'Tạo tài liệu';
$lang->doc->edit = 'Sửa tài liệu';
$lang->doc->delete = 'Xóa tài liệu';
$lang->doc->browse = 'Document danh sách';
$lang->doc->view = 'Document Detail';
$lang->doc->diff = 'Diff';
$lang->doc->diffAction = 'Diff tài liệu';
$lang->doc->sort = 'Đánh giá tài liệu';
$lang->doc->manageType = 'Quản lý danh mục';
$lang->doc->editType = 'Sửa';
$lang->doc->deleteType = 'Xóa';
$lang->doc->addType = 'Thêm';
$lang->doc->childType = 'Categories';
$lang->doc->collect = 'Thêm Favorite';
$lang->doc->cancelCollection = 'Remove Favorite';
$lang->doc->deleteFile = 'Xóa File';
$lang->doc->libName = 'Thư viện tài liệu';
$lang->doc->libType = 'Danh mục';
$lang->doc->custom = 'Tùy biến thư viện tài liệu';
$lang->doc->customAB = 'Tùy biến Doc Lib';
$lang->doc->createLib = 'Tạo thư viện tài liệu';
$lang->doc->allLibs = 'Library danh sách';
$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->projectCommon} Libraries";
$lang->doc->showFiles = 'Attachments';
$lang->doc->editLib = 'Sửa thư viện tài liệu';
$lang->doc->deleteLib = 'Xóa thư viện tài liệu';
$lang->doc->fixedMenu = 'Sửa to Menu';
$lang->doc->removeMenu = 'Remove from Menu';
$lang->doc->search = 'Tìm kiếm';
$lang->doc->libName = 'Thư viện tài liệu';
$lang->doc->libType = 'Danh mục';
$lang->doc->custom = 'Tùy biến thư viện tài liệu';
$lang->doc->customAB = 'Tùy biến Doc Lib';
$lang->doc->createLib = 'Tạo thư viện tài liệu';
$lang->doc->allLibs = 'Library danh sách';
$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->projectCommon} Libraries";
$lang->doc->showFiles = 'Attachments';
$lang->doc->editLib = 'Sửa thư viện tài liệu';
$lang->doc->deleteLib = 'Xóa thư viện tài liệu';
$lang->doc->fixedMenu = 'Sửa to Menu';
$lang->doc->removeMenu = 'Remove from Menu';
$lang->doc->search = 'Tìm kiếm';
/* Query condition list. */
$lang->doc->allProduct = 'All' . $lang->productCommon;
$lang->doc->allProject = 'All' . $lang->projectCommon;
$lang->doc->allProduct = 'All' . $lang->productCommon;
$lang->doc->allProject = 'All' . $lang->projectCommon;
$lang->doc->libTypeList['product'] = $lang->productCommon . ' thư viện';
$lang->doc->libTypeList['project'] = $lang->projectCommon . ' thư viện';
$lang->doc->libTypeList['custom'] = 'Tùy biến thư viện';
$lang->doc->libTypeList['product'] = $lang->productCommon . ' thư viện';
$lang->doc->libTypeList['project'] = $lang->projectCommon . ' thư viện';
$lang->doc->libTypeList['custom'] = 'Tùy biến thư viện';
$lang->doc->libIconList['product'] = 'icon-cube';
$lang->doc->libIconList['project'] = 'icon-stack';
$lang->doc->libIconList['custom'] = 'icon-folder-o';
$lang->doc->libIconList['product'] = 'icon-cube';
$lang->doc->libIconList['project'] = 'icon-stack';
$lang->doc->libIconList['custom'] = 'icon-folder-o';
$lang->doc->systemLibs['product'] = $lang->productCommon;
$lang->doc->systemLibs['project'] = $lang->projectCommon;
$lang->doc->systemLibs['product'] = $lang->productCommon;
$lang->doc->systemLibs['project'] = $lang->projectCommon;
global $config;
if($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest') unset($lang->doc->systemLibs['project']);
@@ -115,76 +116,82 @@ if($config->global->flow == 'onlyStory' or $config->global->flow == 'onlyTest')
if($config->global->flow == 'onlyTask') unset($lang->doc->systemLibs['product']);
if($config->global->flow == 'onlyTask') unset($lang->doc->libTypeList['product']);
$lang->doc->aclList['open'] = 'Công khai';
$lang->doc->aclList['custom'] = 'Tùy biến';
$lang->doc->aclList['private'] = 'Riêng tư';
$lang->doc->aclList['open'] = 'Công khai';
$lang->doc->aclList['custom'] = 'Tùy biến';
$lang->doc->aclList['private'] = 'Riêng tư';
$lang->doc->typeList['html'] = 'Html';
$lang->doc->typeList['markdown'] = 'Markdown';
$lang->doc->typeList['url'] = 'URL';
$lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
$lang->doc->typeList['html'] = 'Html';
$lang->doc->typeList['markdown'] = 'Markdown';
$lang->doc->typeList['url'] = 'URL';
$lang->doc->typeList['word'] = 'Word';
$lang->doc->typeList['ppt'] = 'PPT';
$lang->doc->typeList['excel'] = 'Excel';
$lang->doc->types['text'] = 'Text';
$lang->doc->types['url'] = 'URL';
$lang->doc->types['text'] = 'Text';
$lang->doc->types['url'] = 'URL';
$lang->doc->contentTypeList['html'] = 'HTML';
$lang->doc->contentTypeList['markdown'] = 'MarkDown';
$lang->doc->contentTypeList['html'] = 'HTML';
$lang->doc->contentTypeList['markdown'] = 'MarkDown';
$lang->doc->browseType = 'Danh mục';
$lang->doc->browseTypeList['list'] = 'Danh sách';
$lang->doc->browseTypeList['grid'] = 'Card';
$lang->doc->browseType = 'Danh mục';
$lang->doc->browseTypeList['list'] = 'Danh sách';
$lang->doc->browseTypeList['grid'] = 'Card';
$lang->doc->fastMenuList['byediteddate'] = 'Recent Edited';
//$lang->doc->fastMenuList['visiteddate'] = 'Recently Visited';
$lang->doc->fastMenuList['openedbyme'] = 'My tài liệu';
$lang->doc->fastMenuList['collectedbyme'] = 'My Favorites';
$lang->doc->fastMenuList['byediteddate'] = 'Recent Edited';
//$lang->doc->fastMenuList['visiteddate'] = 'Recently Visited';
$lang->doc->fastMenuList['openedbyme'] = 'My tài liệu';
$lang->doc->fastMenuList['collectedbyme'] = 'My Favorites';
$lang->doc->fastMenuIconList['byediteddate'] = 'icon-folder-upload';
//$lang->doc->fastMenuIconList['visiteddate'] = 'icon-folder-move';
$lang->doc->fastMenuIconList['openedbyme'] = 'icon-folder-account';
$lang->doc->fastMenuIconList['collectedbyme'] = 'icon-folder-star';
$lang->doc->fastMenuIconList['byediteddate'] = 'icon-folder-upload';
//$lang->doc->fastMenuIconList['visiteddate'] = 'icon-folder-move';
$lang->doc->fastMenuIconList['openedbyme'] = 'icon-folder-account';
$lang->doc->fastMenuIconList['collectedbyme'] = 'icon-folder-star';
$lang->doc->customObjectLibs['files'] = 'Hiện Attachment thư viện';
$lang->doc->customObjectLibs['customFiles'] = 'Hiện Custom thư viện';
$lang->doc->customObjectLibs['files'] = 'Hiện Attachment thư viện';
$lang->doc->customObjectLibs['customFiles'] = 'Hiện Custom thư viện';
$lang->doc->orderLib = 'Đánh giá Thiết lập';
$lang->doc->customShowLibs = 'Display Thiết lập';
$lang->doc->customShowLibsList['zero'] = 'Display Empty thư viện';
$lang->doc->customShowLibsList['children'] = 'Display Child-category tài liệu';
$lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon} Only";
$lang->doc->orderLib = 'Đánh giá Thiết lập';
$lang->doc->customShowLibs = 'Display Thiết lập';
$lang->doc->customShowLibsList['zero'] = 'Display Empty thư viện';
$lang->doc->customShowLibsList['children'] = 'Display Child-category tài liệu';
$lang->doc->customShowLibsList['unclosed'] = "Display Active {$lang->projectCommon} Only";
$lang->doc->confirmDelete = "Bạn có muốn xóa this document?";
$lang->doc->confirmDeleteLib = "Bạn có muốn xóa this document library?";
$lang->doc->errorEditSystemDoc = "You don't have to change system document library.";
$lang->doc->errorEmptyProduct = "Không có {$lang->productCommon}. It cannot be created.";
$lang->doc->errorEmptyProject = "Không có {$lang->projectCommon}. It cannot be created.";
$lang->doc->errorMainSysLib = "This library không thể xóa.";
$lang->doc->accessDenied = "Access bị từ chối!";
$lang->doc->versionNotFount = 'Nó does not exist in bản dựng này.';
$lang->doc->noDoc = 'Không có documents. ';
$lang->doc->cannotCreateOffice = 'Sorry, %s can only be created in ZenTao Enterprise. Contact us at renee@easysoft.ltd to try ZenTao Enterprise.';
$lang->doc->mail = new stdclass();
$lang->doc->mail->create = new stdclass();
$lang->doc->mail->edit = new stdclass();
$lang->doc->mail->create->title = "%s created document #%s:%s";
$lang->doc->mail->edit->title = "%s edited document #%s:%s";
$lang->doc->confirmDelete = "Bạn có muốn xóa this document?";
$lang->doc->confirmDeleteLib = "Bạn có muốn xóa this document library?";
$lang->doc->errorEditSystemDoc = "You don't have to change system document library.";
$lang->doc->errorEmptyProduct = "Không có {$lang->productCommon}. It cannot be created.";
$lang->doc->errorEmptyProject = "Không có {$lang->projectCommon}. It cannot be created.";
$lang->doc->errorMainSysLib = "This library không thể xóa.";
$lang->doc->accessDenied = "Access bị từ chối!";
$lang->doc->versionNotFount = 'Nó does not exist in bản dựng này.';
$lang->doc->noDoc = 'Không có documents. ';
$lang->doc->cannotCreateOffice = 'Sorry, %s can only be created in ZenTao Enterprise. Contact us at renee@easysoft.ltd to try ZenTao Enterprise.';
$lang->doc->notSetOffice = "<p>To create a %s document, you need to configure <a href='%s' target='_parent'>office convert</a>.<p>";
$lang->doc->noSearchedDoc = 'Không có documents found.';
$lang->doc->noEditedDoc = 'Bạn có not edited any documents.';
$lang->doc->noOpenedDoc = 'Bạn chưa tạo any documents.';
$lang->doc->noCollectedDoc = 'Bạn có not favorited any documents.';
$lang->doc->noSearchedDoc = 'Không có documents found.';
$lang->doc->noEditedDoc = 'Bạn có not edited any documents.';
$lang->doc->noOpenedDoc = 'Bạn chưa tạo any documents.';
$lang->doc->noCollectedDoc = 'Bạn có not favorited any documents.';
$lang->doc->noticeAcl['lib']['product']['default'] = 'Users who can access the selected product có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['product']['custom'] = 'Users who can access the selected product or users in the whiltelist có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['project']['default'] = 'Users who can access the selected project có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users who can access the selected project or users in the whiltelist có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['custom']['open'] = 'Tất cả users có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['custom']['private'] = 'Chỉ the one who created it có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['product']['default'] = 'Users who can access the selected product có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['product']['custom'] = 'Users who can access the selected product or users in the whiltelist có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['project']['default'] = 'Users who can access the selected project có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users who can access the selected project or users in the whiltelist có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['custom']['open'] = 'Tất cả users có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist có thể truy cập nó.';
$lang->doc->noticeAcl['lib']['custom']['private'] = 'Chỉ the one who created it có thể truy cập nó.';
$lang->doc->noticeAcl['doc']['open'] = 'Users who can access the document library which the document belongs có thể truy cập nó.';
$lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist có thể truy cập nó.';
$lang->doc->noticeAcl['doc']['private'] = 'Chỉ the one who created it có thể truy cập nó.';
$lang->doc->noticeAcl['doc']['open'] = 'Users who can access the document library which the document belongs có thể truy cập nó.';
$lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist có thể truy cập nó.';
$lang->doc->noticeAcl['doc']['private'] = 'Chỉ the one who created it có thể truy cập nó.';
$lang->doc->placeholder = new stdclass();
$lang->doc->placeholder->url = 'URL';
$lang->doc->placeholder = new stdclass();
$lang->doc->placeholder->url = 'URL';
$lang->doclib = new stdclass();
$lang->doclib->name = 'Tên';
+7
View File
@@ -47,6 +47,7 @@ $lang->doc->users = '用户';
$lang->doc->item = '项';
$lang->doc->num = '文档数量';
$lang->doc->searchResult = '搜索结果';
$lang->doc->mailto = '抄送给';
$lang->doc->moduleDoc = '按模块浏览';
$lang->doc->searchDoc = '搜索';
@@ -155,6 +156,12 @@ $lang->doc->customShowLibsList['zero'] = '显示空文档的库';
$lang->doc->customShowLibsList['children'] = '显示子分类的文档';
$lang->doc->customShowLibsList['unclosed'] = '只显示未关闭的项目';
$lang->doc->mail = new stdclass();
$lang->doc->mail->create = new stdclass();
$lang->doc->mail->edit = new stdclass();
$lang->doc->mail->create->title = "%s创建了文档 #%s:%s";
$lang->doc->mail->edit->title = "%s编辑了文档 #%s:%s";
$lang->doc->confirmDelete = "您确定删除该文档吗?";
$lang->doc->confirmDeleteLib = "您确定删除该文档库吗?";
$lang->doc->errorEditSystemDoc = "系统文档库无需修改。";
+100
View File
@@ -618,6 +618,7 @@ class docModel extends model
->cleanInt('product,project,module,lib')
->join('groups', ',')
->join('users', ',')
->join('mailto', ',')
->remove('files,labels,uid')
->get();
@@ -693,6 +694,7 @@ class docModel extends model
->cleanInt('module')
->join('groups', ',')
->join('users', ',')
->join('mailto', ',')
->remove('comment,files,labels,uid')
->get();
if($doc->contentType == 'markdown') $doc->content = $this->post->content;
@@ -1625,4 +1627,102 @@ class docModel extends model
return $actions;
}
/**
* Send mail.
*
* @param int $docID
* @param int $actionID
* @access public
* @return void
*/
public function sendmail($docID, $actionID)
{
$this->loadModel('mail');
$doc = $this->getById($docID);
$users = $this->loadModel('user')->getPairs('noletter');
/* Get action info. */
$action = $this->loadModel('action')->getById($actionID);
$history = $this->action->getHistory($actionID);
$action->history = isset($history[$actionID]) ? $history[$actionID] : array();
/* Get mail content. */
$modulePath = $this->app->getModulePath($appName = '', 'doc');
$oldcwd = getcwd();
$viewFile = $modulePath . 'view/sendmail.html.php';
chdir($modulePath . 'view');
if(file_exists($modulePath . 'ext/view/sendmail.html.php'))
{
$viewFile = $modulePath . 'ext/view/sendmail.html.php';
chdir($modulePath . 'ext/view');
}
ob_start();
include $viewFile;
foreach(glob($modulePath . 'ext/view/sendmail.*.html.hook.php') as $hookFile) include $hookFile;
$mailContent = ob_get_contents();
ob_end_clean();
chdir($oldcwd);
$sendUsers = $this->getToAndCcList($doc);
if(!$sendUsers) return;
list($toList, $ccList) = $sendUsers;
$subject = $this->getSubject($doc, $action->action);
/* Send mail. */
$this->mail->send($toList, $subject, $mailContent, $ccList);
if($this->mail->isError()) trigger_error(join("\n", $this->mail->getError()));
}
/**
* Get mail subject.
*
* @param object $doc
* @param string $actionType created|edited
* @access public
* @return string
*/
public function getSubject($doc, $actionType)
{
/* Set email title. */
if($actionType == 'created')
{
return sprintf($this->lang->doc->mail->create->title, $this->app->user->realname, $doc->id, $doc->title);
}
else
{
return sprintf($this->lang->doc->mail->edit->title, $this->app->user->realname, $doc->id, $doc->title);
}
}
/**
* Get toList and ccList.
*
* @param object $doc
* @access public
* @return bool|array
*/
public function getToAndCcList($doc)
{
/* Set toList and ccList. */
$toList = '';
$ccList = str_replace(' ', '', trim($doc->mailto, ','));
if(empty($toList))
{
if(empty($ccList)) return false;
if(strpos($ccList, ',') === false)
{
$toList = $ccList;
$ccList = '';
}
else
{
$commaPos = strpos($ccList, ',');
$toList = substr($ccList, 0, $commaPos);
$ccList = substr($ccList, $commaPos + 1);
}
}
return array($toList, $ccList);
}
}
+11
View File
@@ -82,6 +82,17 @@
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control chosen'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
+11
View File
@@ -59,6 +59,17 @@
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doc->mailto;?></th>
<td colspan="2">
<div class="input-group">
<?php
echo html::select('mailto[]', $users, '', "multiple class='form-control chosen'");
echo $this->fetch('my', 'buildContactLists');
?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td colspan='2'>
+35
View File
@@ -0,0 +1,35 @@
<?php
/**
* The sendmail file of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2020 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Shujie Tian <tianshujie@easycorp.ltd>
* @package doc
* @version $Id: sendmail.html.php 3717 2020-11-03 15:35:07Z tianshujie@easycorp.ltd $
* @link https://www.zentao.net
*/
?>
<?php $mailTitle = 'DOCUMENT #' . $doc->id . ' ' . $doc->title;?>
<?php include $this->app->getModuleRoot() . 'common/view/mail.header.html.php';?>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='600' style='border: none; border-collapse: collapse;'>
<tr>
<td style='padding: 10px; background-color: #F8FAFE; border: none; font-size: 14px; font-weight: 500; border-bottom: 1px solid #e5e5e5;'>
<?php $color = empty($doc->color) ? '#333' : $doc->color;?>
<?php echo html::a(zget($this->config->mail, 'domain', common::getSysURL()) . helper::createLink('doc', 'view', "docID=$doc->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style='padding: 10px; border: none;'>
<fieldset style='border: 1px solid #e5e5e5'>
<legend style='color: #114f8e'><?php echo $this->lang->doc->content;?></legend>
<div style='padding: 5px;'><?php echo $doc->content;?></div>
</fieldset>
</td>
</tr>
<?php include $this->app->getModuleRoot() . 'common/view/mail.footer.html.php';?>
+3
View File
@@ -9,12 +9,14 @@ $config->message->objectTypes['bug'] = array('opened', 'edited', 'commen
$config->message->objectTypes['case'] = array('opened', 'edited', 'commented', 'reviewed', 'confirmed');
$config->message->objectTypes['testtask'] = array('opened', 'edited', 'started', 'blocked', 'closed', 'activated');
$config->message->objectTypes['todo'] = array('opened', 'edited');
$config->message->objectTypes['doc'] = array('created', 'edited');
$config->message->available = array();
$config->message->available['mail']['story'] = $config->message->objectTypes['story'];
$config->message->available['mail']['task'] = $config->message->objectTypes['task'];
$config->message->available['mail']['bug'] = $config->message->objectTypes['bug'];
$config->message->available['mail']['testtask'] = array('opened', 'edited', 'closed');
$config->message->available['mail']['doc'] = $config->message->objectTypes['doc'];
$config->message->available['webhook'] = $config->message->objectTypes;
@@ -23,6 +25,7 @@ $config->message->available['message']['story'] = $config->message->objectTyp
$config->message->available['message']['task'] = $config->message->objectTypes['task'];
$config->message->available['message']['testtask'] = $config->message->objectTypes['testtask'];
$config->message->available['message']['todo'] = $config->message->objectTypes['todo'];
$config->message->available['message']['doc'] = $config->message->objectTypes['doc'];
$config->message->typeLink = array();
$config->message->typeLink['mail'] = 'mail|index';