Split document type retention policies
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -657,6 +657,7 @@
|
||||
- Chart updates: Show last update date and time in list view and details view.
|
||||
Change color scheme to match rest of project. Increase size of data points.
|
||||
Improve responsive settings. Redirect to the current view after queueing.
|
||||
- Split document type retention policies into it own view.
|
||||
|
||||
3.0.3 (2018-08-17)
|
||||
==================
|
||||
|
||||
@@ -704,6 +704,7 @@ Other changes
|
||||
- Chart updates: Show last update date and time in list view and details view.
|
||||
Change color scheme to match rest of project. Increase size of data points.
|
||||
Improve responsive settings. Redirect to the current view after queueing.
|
||||
- Split document type retention policies into it own view.
|
||||
|
||||
|
||||
Removals
|
||||
|
||||
@@ -71,12 +71,13 @@ from .links import (
|
||||
link_document_type_delete, link_document_type_edit,
|
||||
link_document_type_filename_create, link_document_type_filename_delete,
|
||||
link_document_type_filename_edit, link_document_type_filename_list,
|
||||
link_document_type_list, link_document_type_setup,
|
||||
link_document_update_page_count, link_document_version_download,
|
||||
link_document_version_list, link_document_version_return_document,
|
||||
link_document_version_return_list, link_document_version_revert,
|
||||
link_document_version_view, link_duplicated_document_list,
|
||||
link_duplicated_document_scan, link_trash_can_empty
|
||||
link_document_type_list, link_document_type_policies,
|
||||
link_document_type_setup, link_document_update_page_count,
|
||||
link_document_version_download, link_document_version_list,
|
||||
link_document_version_return_document, link_document_version_return_list,
|
||||
link_document_version_revert, link_document_version_view,
|
||||
link_duplicated_document_list, link_duplicated_document_scan,
|
||||
link_trash_can_empty
|
||||
)
|
||||
from .menus import menu_documents
|
||||
from .permissions import (
|
||||
@@ -385,6 +386,7 @@ class DocumentsApp(MayanAppConfig):
|
||||
menu_list_facet.bind_links(
|
||||
links=(
|
||||
link_document_type_filename_list,
|
||||
link_document_type_policies,
|
||||
link_acl_list, link_object_event_types_user_subcriptions_list,
|
||||
link_events_for_object,
|
||||
), sources=(DocumentType,)
|
||||
|
||||
@@ -149,6 +149,7 @@ icon_document_type_filename = Icon(
|
||||
icon_document_type_filename_create = Icon(
|
||||
driver_name='fontawesome', symbol='plus'
|
||||
)
|
||||
icon_document_type_policies = Icon(driver_name='fontawesome', symbol='times')
|
||||
icon_document_type_setup = icon_document_type
|
||||
|
||||
|
||||
|
||||
@@ -364,6 +364,12 @@ link_document_type_delete = Link(
|
||||
permissions=(permission_document_type_delete,), tags='dangerous',
|
||||
text=_('Delete'), view='documents:document_type_delete',
|
||||
)
|
||||
link_document_type_policies = Link(
|
||||
args='resolved_object.id',
|
||||
icon_class_path='mayan.apps.documents.icons.icon_document_type_policies',
|
||||
permissions=(permission_document_type_edit,),
|
||||
text=_('Policies'), view='documents:document_type_policies',
|
||||
)
|
||||
link_document_type_edit = Link(
|
||||
args='resolved_object.id', icon_class=icon_document_type_edit,
|
||||
permissions=(permission_document_type_edit,), text=_('Edit'),
|
||||
|
||||
@@ -32,6 +32,7 @@ from .views import (
|
||||
RecentAccessDocumentListView, RecentAddedDocumentListView,
|
||||
ScanDuplicatedDocuments
|
||||
)
|
||||
from .views.document_type_views import DocumentTypeDeletionPoliciesEditView
|
||||
from .views.favorite_document_views import (
|
||||
FavoriteAddView, FavoriteDocumentListView, FavoriteRemoveView
|
||||
)
|
||||
@@ -40,6 +41,54 @@ from .views.trashed_document_views import (
|
||||
TrashedDocumentListView, TrashedDocumentRestoreView
|
||||
)
|
||||
|
||||
urlpatterns_document_types = [
|
||||
url(
|
||||
regex=r'^type/list/$', view=DocumentTypeListView.as_view(),
|
||||
name='document_type_list'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/create/$', view=DocumentTypeCreateView.as_view(),
|
||||
name='document_type_create'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/edit/$', view=DocumentTypeEditView.as_view(),
|
||||
name='document_type_edit'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/delete/$',
|
||||
view=DocumentTypeDeleteView.as_view(), name='document_type_delete'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/documents/$',
|
||||
view=DocumentTypeDocumentListView.as_view(),
|
||||
name='document_type_document_list'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/filename/list/$',
|
||||
view=DocumentTypeFilenameListView.as_view(),
|
||||
name='document_type_filename_list'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/filename/(?P<pk>\d+)/edit/$',
|
||||
view=DocumentTypeFilenameEditView.as_view(),
|
||||
name='document_type_filename_edit'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/filename/(?P<pk>\d+)/delete/$',
|
||||
view=DocumentTypeFilenameDeleteView.as_view(),
|
||||
name='document_type_filename_delete'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/filename/create/$',
|
||||
view=DocumentTypeFilenameCreateView.as_view(),
|
||||
name='document_type_filename_create'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/deletion_policies/$',
|
||||
view=DocumentTypeDeletionPoliciesEditView.as_view(),
|
||||
name='document_type_policies'
|
||||
),
|
||||
]
|
||||
|
||||
urlpatterns_favorite_documents = [
|
||||
url(
|
||||
@@ -275,49 +324,6 @@ urlpatterns = [
|
||||
name='document_page_view_reset'
|
||||
),
|
||||
|
||||
# Admin views
|
||||
url(
|
||||
regex=r'^type/list/$', view=DocumentTypeListView.as_view(),
|
||||
name='document_type_list'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/create/$', view=DocumentTypeCreateView.as_view(),
|
||||
name='document_type_create'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/edit/$', view=DocumentTypeEditView.as_view(),
|
||||
name='document_type_edit'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/delete/$',
|
||||
view=DocumentTypeDeleteView.as_view(), name='document_type_delete'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/documents/$',
|
||||
view=DocumentTypeDocumentListView.as_view(),
|
||||
name='document_type_document_list'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/filename/list/$',
|
||||
view=DocumentTypeFilenameListView.as_view(),
|
||||
name='document_type_filename_list'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/filename/(?P<pk>\d+)/edit/$',
|
||||
view=DocumentTypeFilenameEditView.as_view(),
|
||||
name='document_type_filename_edit'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/filename/(?P<pk>\d+)/delete/$',
|
||||
view=DocumentTypeFilenameDeleteView.as_view(),
|
||||
name='document_type_filename_delete'
|
||||
),
|
||||
url(
|
||||
regex=r'^type/(?P<pk>\d+)/filename/create/$',
|
||||
view=DocumentTypeFilenameCreateView.as_view(),
|
||||
name='document_type_filename_create'
|
||||
),
|
||||
|
||||
# Tools
|
||||
|
||||
url(
|
||||
@@ -326,6 +332,7 @@ urlpatterns = [
|
||||
name='duplicated_document_scan'
|
||||
),
|
||||
]
|
||||
urlpatterns.extend(urlpatterns_document_types)
|
||||
urlpatterns.extend(urlpatterns_favorite_documents)
|
||||
urlpatterns.extend(urlpatterns_trashed_documents)
|
||||
|
||||
|
||||
@@ -80,10 +80,7 @@ class DocumentTypeListView(SingleObjectListView):
|
||||
|
||||
|
||||
class DocumentTypeCreateView(SingleObjectCreateView):
|
||||
fields = (
|
||||
'label', 'trash_time_period', 'trash_time_unit', 'delete_time_period',
|
||||
'delete_time_unit'
|
||||
)
|
||||
fields = ('label',)
|
||||
model = DocumentType
|
||||
post_action_redirect = reverse_lazy(viewname='documents:document_type_list')
|
||||
view_permission = permission_document_type_create
|
||||
@@ -112,15 +109,35 @@ class DocumentTypeDeleteView(SingleObjectDeleteView):
|
||||
}
|
||||
|
||||
|
||||
class DocumentTypeEditView(SingleObjectEditView):
|
||||
class DocumentTypeDeletionPoliciesEditView(SingleObjectEditView):
|
||||
fields = (
|
||||
'label', 'trash_time_period', 'trash_time_unit', 'delete_time_period',
|
||||
'trash_time_period', 'trash_time_unit', 'delete_time_period',
|
||||
'delete_time_unit'
|
||||
)
|
||||
model = DocumentType
|
||||
object_permission = permission_document_type_edit
|
||||
post_action_redirect = reverse_lazy(viewname='documents:document_type_list')
|
||||
|
||||
def get_extra_context(self):
|
||||
return {
|
||||
'object': self.get_object(),
|
||||
'title': _(
|
||||
'Deletion policies for document type: %s'
|
||||
) % self.get_object(),
|
||||
}
|
||||
|
||||
def get_save_extra_data(self):
|
||||
return {
|
||||
'_user': self.request.user,
|
||||
}
|
||||
|
||||
|
||||
class DocumentTypeEditView(SingleObjectEditView):
|
||||
fields = ('label',)
|
||||
model = DocumentType
|
||||
object_permission = permission_document_type_edit
|
||||
post_action_redirect = reverse_lazy(viewname='documents:document_type_list')
|
||||
|
||||
def get_extra_context(self):
|
||||
return {
|
||||
'object': self.get_object(),
|
||||
|
||||
Reference in New Issue
Block a user