| @@ 45-112 (lines=68) @@ | ||
| 42 | ||
| 43 | class AuditLogView(BikaListingView): |
|
| 44 | ||
| 45 | def __init__(self, context, request): |
|
| 46 | super(AuditLogView, self).__init__(context, request) |
|
| 47 | ||
| 48 | self.catalog = AUDITLOG_CATALOG |
|
| 49 | ||
| 50 | self.contentFilter = { |
|
| 51 | "path": "/", |
|
| 52 | "sort_on": "snapshot_created", |
|
| 53 | "sort_order": "descending", |
|
| 54 | } |
|
| 55 | ||
| 56 | self.context_actions = {} |
|
| 57 | ||
| 58 | self.title = self.context.translate(_("Audit Log")) |
|
| 59 | self.icon = "{}/{}".format( |
|
| 60 | self.portal_url, |
|
| 61 | "/++resource++bika.lims.images/auditlog_big.png" |
|
| 62 | ) |
|
| 63 | ||
| 64 | self.show_select_column = False |
|
| 65 | self.pagesize = 25 |
|
| 66 | ||
| 67 | self.columns = collections.OrderedDict(( |
|
| 68 | ("title", { |
|
| 69 | "title": _("Title"), |
|
| 70 | "index": "title"}), |
|
| 71 | ("version", { |
|
| 72 | "title": _("Version"), |
|
| 73 | "index": "snapshot_version", |
|
| 74 | "sortable": True}), |
|
| 75 | ("modified", { |
|
| 76 | "title": _("Date Modified"), |
|
| 77 | "index": "modified", |
|
| 78 | "sortable": True}), |
|
| 79 | ("actor", { |
|
| 80 | "title": _("Actor"), |
|
| 81 | "index": "actor", |
|
| 82 | "sortable": True}), |
|
| 83 | ("fullname", { |
|
| 84 | "title": _("Fullname"), |
|
| 85 | "index": "fullname", |
|
| 86 | "sortable": True}), |
|
| 87 | ("roles", { |
|
| 88 | "title": _("Roles"), |
|
| 89 | "sortable": False, |
|
| 90 | "toggle": False}), |
|
| 91 | ("remote_address", { |
|
| 92 | "title": _("Remote IP"), |
|
| 93 | "sortable": True}), |
|
| 94 | ("action", { |
|
| 95 | "title": _("Action"), |
|
| 96 | "index": "action", |
|
| 97 | "sortable": True}), |
|
| 98 | ("review_state", { |
|
| 99 | "title": _("Workflow State"), |
|
| 100 | "index": "review_state", |
|
| 101 | "sortable": True}), |
|
| 102 | ("diff", { |
|
| 103 | "title": _("Changes"), |
|
| 104 | "sortable": False}), |
|
| 105 | )) |
|
| 106 | ||
| 107 | self.review_states = [ |
|
| 108 | { |
|
| 109 | "id": "default", |
|
| 110 | "title": _("Active"), |
|
| 111 | "contentFilter": {}, |
|
| 112 | "columns": self.columns.keys(), |
|
| 113 | } |
|
| 114 | ] |
|
| 115 | ||
| @@ 36-100 (lines=65) @@ | ||
| 33 | """Controlpanel Listing for Departments |
|
| 34 | """ |
|
| 35 | ||
| 36 | def __init__(self, context, request): |
|
| 37 | super(DepartmentsView, self).__init__(context, request) |
|
| 38 | ||
| 39 | self.catalog = SETUP_CATALOG |
|
| 40 | self.show_select_row = False |
|
| 41 | self.show_select_column = True |
|
| 42 | self.pagesize = 25 |
|
| 43 | ||
| 44 | self.contentFilter = { |
|
| 45 | "portal_type": "Department", |
|
| 46 | "sort_order": "ascending", |
|
| 47 | "sort_on": "sortable_title" |
|
| 48 | } |
|
| 49 | ||
| 50 | self.context_actions = { |
|
| 51 | _("Add"): { |
|
| 52 | "url": "++add++Department", |
|
| 53 | "permission": AddDepartment, |
|
| 54 | "icon": "++resource++bika.lims.images/add.png"} |
|
| 55 | } |
|
| 56 | ||
| 57 | self.title = self.context.translate(_("Lab Departments")) |
|
| 58 | self.icon = "{}/{}".format( |
|
| 59 | self.portal_url, |
|
| 60 | "/++resource++bika.lims.images/department_big.png" |
|
| 61 | ) |
|
| 62 | ||
| 63 | self.columns = collections.OrderedDict(( |
|
| 64 | ("Title", { |
|
| 65 | "title": _("Department"), |
|
| 66 | "index": "sortable_title"}), |
|
| 67 | ("DepartmentID", { |
|
| 68 | "title": _("Department ID"), |
|
| 69 | "index": "department_id", |
|
| 70 | "toggle": False}), |
|
| 71 | ("Description", { |
|
| 72 | "title": _("Description"), |
|
| 73 | "toggle": True}), |
|
| 74 | ("Manager", { |
|
| 75 | "title": _("Manager"), |
|
| 76 | "toggle": True}), |
|
| 77 | ("ManagerPhone", { |
|
| 78 | "title": _("Manager Phone"), |
|
| 79 | "toggle": True}), |
|
| 80 | ("ManagerEmail", { |
|
| 81 | "title": _("Manager Email"), |
|
| 82 | "toggle": True}), |
|
| 83 | )) |
|
| 84 | ||
| 85 | self.review_states = [ |
|
| 86 | { |
|
| 87 | "id": "default", |
|
| 88 | "title": _("Active"), |
|
| 89 | "contentFilter": {"is_active": True}, |
|
| 90 | "columns": self.columns.keys(), |
|
| 91 | }, { |
|
| 92 | "id": "inactive", |
|
| 93 | "title": _("Inactive"), |
|
| 94 | "contentFilter": {"is_active": False}, |
|
| 95 | "columns": self.columns.keys(), |
|
| 96 | }, { |
|
| 97 | "id": "all", |
|
| 98 | "title": _("All"), |
|
| 99 | "contentFilter": {}, |
|
| 100 | "columns": self.columns.keys(), |
|
| 101 | }, |
|
| 102 | ] |
|
| 103 | ||