diff --git a/db/update12.4.4.sql b/db/update12.4.4.sql new file mode 100644 index 0000000000..4e83bbfc11 --- /dev/null +++ b/db/update12.4.4.sql @@ -0,0 +1 @@ +ALTER TABLE `zt_doc` ADD `mailto` text AFTER `editedDate`; diff --git a/db/zentao.sql b/db/zentao.sql index 04d63244d0..2a0fbb021d 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -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, diff --git a/module/doc/control.php b/module/doc/control.php index dd5ab8dbf9..9dbc452a94 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -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(); } diff --git a/module/doc/css/create.css b/module/doc/css/create.css index f31a665884..f9cea96d28 100644 --- a/module/doc/css/create.css +++ b/module/doc/css/create.css @@ -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;} diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index c971aec9e2..705df7d315 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -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."; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 6489696f55..709a8e8b8e 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -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."; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index e5a30df8b5..e4f8887a60 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -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."; diff --git a/module/doc/lang/vi.php b/module/doc/lang/vi.php index d3ea1fd8d5..7e51f6941f 100644 --- a/module/doc/lang/vi.php +++ b/module/doc/lang/vi.php @@ -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 = ""; -$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 = ""; +$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 = "
To create a %s document, you need to configure office convert.
"; -$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'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 80bd9b4e93..66fc445b97 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -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 = "系统文档库无需修改。"; diff --git a/module/doc/model.php b/module/doc/model.php index 4c14f661d1..a928e479f2 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -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); + } } diff --git a/module/doc/view/create.html.php b/module/doc/view/create.html.php index bd066c5746..d0438e8ff9 100644 --- a/module/doc/view/create.html.php +++ b/module/doc/view/create.html.php @@ -82,6 +82,17 @@
| + color) ? '#333' : $doc->color;?> + config->mail, 'domain', common::getSysURL()) . helper::createLink('doc', 'view', "docID=$doc->id", 'html'), $mailTitle, '', "style='color: {$color}; text-decoration: underline;'");?> + | +