Skip to content

Commit

Permalink
Called js and fixed import errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunga001 committed Nov 23, 2023
1 parent f9ad7a0 commit ff475b1
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 38 deletions.
23 changes: 12 additions & 11 deletions src/bika/reports/browser/reports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,26 @@

import importlib
import os

from DateTime import DateTime
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from datetime import datetime
from plone.app.layout.globals.interfaces import IViewView
from zope.component import getAdapters
from zope.interface import implements

from bika.lims import api
from bika.lims import bikaMessageFactory as _
from bika.lims.browser import BrowserView
from bika.lims.browser.bika_listing import BikaListingView
from bika.reports.browser.reports.selection_macros import SelectionMacrosView
from bika.reports.interfaces import IAdministrationReport
from bika.reports.interfaces import IProductivityReport
from bika.lims.utils import createPdf
from bika.lims.utils import getUsers
from bika.lims.utils import logged_in_client
from DateTime import DateTime
from plone.app.layout.globals.interfaces import IViewView
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.reports import _
from bika.reports.browser.reports.selection_macros import SelectionMacrosView
from bika.reports.interfaces import IAdministrationReport
from bika.reports.interfaces import IProductivityReport
from senaite.core.catalog import REPORT_CATALOG
from zope.component import getAdapters
from zope.interface import implements


class ProductivityView(BrowserView):
Expand Down Expand Up @@ -255,7 +256,7 @@ def __call__(self):
if "report_module" in self.request:
module = self.request["report_module"]
else:
module = "bika.lims.browser.reports.%s" % report_id
module = "bika.reports.browser.reports.%s" % report_id
try:
Report = getattr(importlib.import_module(module), "Report")
# required during error redirect: the report must have a copy of
Expand Down
11 changes: 6 additions & 5 deletions src/bika/reports/browser/reports/administration_usershistory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@

from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.lims import api
from bika.lims import bikaMessageFactory as _
from bika.lims import logger
from bika.lims.browser import BrowserView
from bika.lims.browser.reports.selection_macros import SelectionMacrosView
from plone.app.layout.globals.interfaces import IViewView
from zope.interface import implements

from bika.lims import api
from bika.lims.browser import BrowserView
from bika.reports import _
from bika.reports import logger
from bika.reports.browser.reports.selection_macros import SelectionMacrosView


class Report(BrowserView):
implements(IViewView)
Expand Down
2 changes: 1 addition & 1 deletion src/bika/reports/browser/reports/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name="productivity"
class="bika.reports.browser.reports.ProductivityView"
permission="zope2.View"
layer="bika.reports.interfaces.IBikaReportsLayer"
layer="bika.reports.interfaces.IBikaReportsLayer"
/>

<browser:page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@

from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.lims import bikaMessageFactory as _
from bika.lims.browser import BrowserView
from bika.lims.browser.reports.selection_macros import SelectionMacrosView
from plone.app.layout.globals.interfaces import IViewView
from senaite.core.workflow import ANALYSIS_WORKFLOW
from zope.interface import implements

from bika.lims.browser import BrowserView
from bika.reports import _
from bika.reports.browser.reports.selection_macros import SelectionMacrosView
from senaite.core.workflow import ANALYSIS_WORKFLOW


class Report(BrowserView):
implements(IViewView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@

from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.lims import bikaMessageFactory as _
from bika.lims.browser import BrowserView
from bika.lims.browser.reports.selection_macros import SelectionMacrosView
from plone.app.layout.globals.interfaces import IViewView
from zope.interface import implements

from bika.lims.browser import BrowserView
from bika.reports import _
from bika.reports.reports.reports.selection_macros import SelectionMacrosView


class Report(BrowserView):
implements(IViewView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from bika.lims import api
from bika.lims import bikaMessageFactory as _
from bika.lims.browser import BrowserView
from bika.lims.browser.reports.selection_macros import SelectionMacrosView
from bika.reports.browser.reports.selection_macros import SelectionMacrosView
from plone.app.layout.globals.interfaces import IViewView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from senaite.core.catalog import SAMPLE_CATALOG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@
# Copyright 2018-2021 by it's authors.
# Some rights reserved, see README and LICENSE.

from bika.lims import bikaMessageFactory as _
from bika.lims import logger
from bika.lims.browser import BrowserView
from bika.lims.browser.reports.selection_macros import SelectionMacrosView
from bika.lims.workflow import getTransitionDate
from plone.app.layout.globals.interfaces import IViewView
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.globals.interfaces import IViewView
from senaite.core.catalog import SAMPLE_CATALOG
from zope.interface import implements

from bika.lims.browser import BrowserView
from bika.lims.workflow import getTransitionDate
from bika.reports import _
from bika.reports import logger
from bika.reports.browser.reports.selection_macros import SelectionMacrosView


class Report(BrowserView):
implements(IViewView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
# Copyright 2018-2021 by it's authors.
# Some rights reserved, see README and LICENSE.

from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.globals.interfaces import IViewView
from zope.interface import implements

from bika.lims import api
from bika.lims import bikaMessageFactory as _
from bika.lims.browser import BrowserView
from bika.lims.browser.reports.selection_macros import SelectionMacrosView
from plone.app.layout.globals.interfaces import IViewView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from bika.reports import _
from bika.reports.browser.reports.selection_macros import SelectionMacrosView
from senaite.core.catalog import SAMPLE_CATALOG
from zope.interface import implements


def percentage(part, whole):
Expand Down
9 changes: 9 additions & 0 deletions src/bika/reports/browser/reports/templates/administration.pt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@
}
</style>
</metal:block>
<metal:block fill-slot="senaite_legacy_resources"
tal:define="portal context/@@plone_portal_state/portal;">
<script type="text/javascript"
tal:attributes="src python:portal.absolute_url() + '/senaite_widgets/datetimewidget.js'"></script>
<script type="text/javascript"
src="bika.lims.reports.js"
tal:attributes="src string:${portal/absolute_url}/++plone++bika.reports/js/bika.lims.reports.js"></script>

</metal:block>
</head>

<body>
Expand Down
9 changes: 9 additions & 0 deletions src/bika/reports/browser/reports/templates/productivity.pt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@
</style>

</metal:block>
<metal:block fill-slot="senaite_legacy_resources"
tal:define="portal context/@@plone_portal_state/portal;">
<script type="text/javascript"
tal:attributes="src python:portal.absolute_url() + '/senaite_widgets/datetimewidget.js'"></script>
<script type="text/javascript"
src="bika.lims.reports.js"
tal:attributes="src string:${portal/absolute_url}/++plone++bika.reports/js/bika.lims.reports.js"></script>

</metal:block>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion src/bika/reports/browser/reports/templates/reports.pt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:metal="http://xml.zope.org/namespaces/metal"
metal:use-macro="here/main_template/macros/master"
i18n:domain="senaite.core">
i18n:domain="bika.reports">
<body>

<metal:content-title fill-slot="content-title">
Expand Down
4 changes: 3 additions & 1 deletion src/bika/reports/browser/static/js/bika.lims.reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
coffee --no-header -w -o ../ -c bika.lims.reports.coffee
*/

(function() {
(function() {"use strict";
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

window.ReportFolderView = (function() {
Expand Down Expand Up @@ -48,3 +48,5 @@
})();

}).call(this);
obj = new window["ReportFolderView"]();
obj.load();

0 comments on commit ff475b1

Please sign in to comment.