Example #1
0
    def process_request(self, req):
        req.perm.require(self.BILLING_PERMISSION)
        messages = []

        def addMessage(s):
            messages.extend([s]);

        if req.method == 'POST':
            if req.args.has_key('setbillingtime'):
                self.set_bill_date(req.authname)
                addMessage("All tickets last bill date updated")

        mgr = CustomReportManager(self.env, self.log)
        data = {};
        data["statuses"] = get_statuses(self)
        data["reports"] = mgr.get_reports_by_group(CustomReportManager.TimingAndEstimationKey);
        #self.log.debug("DEBUG got %s, %s" % (data["reports"], type(data["reports"])));
        data["billing_info"] = {"messages":         messages,
                                "href":             req.href.Billing(),
                                "report_base_href": req.href.report(),
                                "usermanual_href":  req.href.wiki(user_manual_wiki_title),
                                "usermanual_title": user_manual_title }

        self.set_request_billing_dates(data)

        add_stylesheet(req, "Billing/billingplugin.css")
        add_script(req, "Billing/date.js")
        add_script(req, "Billing/linkifyer.js")
        return 'billing.html', data, None
Example #2
0
    def process_request(self, req):
        messages = []

        def addMessage(s):
            messages.extend([s])

        if not re.search('/Billing', req.path_info):
            return None

        if req.method == 'POST':
            if req.args.has_key('setbillingtime'):
                self.set_bill_date(req.authname)
                addMessage("All tickets last bill date updated")

        mgr = CustomReportManager(self.env, self.log)
        req.hdf["billing_info"] = {
            "messages": messages,
            "href": req.href.Billing(),
            "report_base_href": req.href.report(),
            "reports":
            mgr.get_reports_by_group("Timing and Estimation Plugin"),
            "usermanual_href": req.href.wiki(user_manual_wiki_title),
            "usermanual_title": user_manual_title
        }
        self.set_request_billing_dates(req)
        add_stylesheet(req, "Billing/billingplugin.css")
        add_script(req, "Billing/linkifyer.js")
        return 'billing.cs', 'text/html'
Example #3
0
    def reports_need_upgrade(self):
        mgr = CustomReportManager(self.env, self.log)
        db_report_hash = mgr.get_reports_by_group(
            CustomReportManager.TimingAndEstimationKey)
        db_reports = Set()
        py_reports = Set()
        for report_group in all_reports:
            for report in report_group['reports']:
                py_reports.add((report['uuid'], report['version']))
        for key, report_group in db_report_hash.items():
            for report in report_group['reports']:
                db_reports.add((report['uuid'], report['version']))
        #diff = db_reports.symmetric_difference(py_reports)

        # the things in the python reports that are not in the database
        diff = py_reports.difference(db_reports)
        for py in diff.copy():
            for db in db_reports:
                #if we have the same report and the db has a higher version
                # remove it from the difference
                if db[0] == py[0] and db[1] >= py[1]:
                    diff.remove(py)
        if len(diff) > 0:
            self.log.debug("T&E needs upgrades for the following reports: %s" %
                           diff)
        return len(diff) > 0
Example #4
0
    def process_request(self, req):
        messages = []

        def addMessage(s):
            messages.extend([s]);

        if not re.search('/Billing', req.path_info):
            return None


        if req.method == 'POST':
            if req.args.has_key('setbillingtime'):
                self.set_bill_date(req.authname)
                addMessage("All tickets last bill date updated")

        mgr = CustomReportManager(self.env, self.log)
        req.hdf["billing_info"] = {"messages":         messages,
                                   "href":             req.href.Billing(),
                                   "report_base_href": req.href.report(),
                                   "reports":          mgr.get_reports_by_group("Timing and Estimation Plugin"),
                                   "usermanual_href":  req.href.wiki(user_manual_wiki_title),
                                   "usermanual_title": user_manual_title
                                   }
        self.set_request_billing_dates(req)
        add_stylesheet(req, "Billing/billingplugin.css")
        add_script(req, "Billing/linkifyer.js")
        return 'billing.cs', 'text/html'
    def process_request(self, req):
        req.perm.require(self.BILLING_PERMISSION)
        messages = []

        def addMessage(s):
            messages.extend([s])

        if req.method == 'POST':
            if req.args.has_key('setbillingtime'):
                self.set_bill_date(req.authname, req.args.get('newbilltime'))
                addMessage("All tickets last bill date updated")

        mgr = CustomReportManager(self.env, self.log)
        data = {}
        data["statuses"] = get_statuses(self.env)
        data["reports"] = mgr.get_reports_by_group(
            CustomReportManager.TimingAndEstimationKey)
        # Handle pulling in report_descriptions
        # Could be added to custom report stuff, but that requires
        # coordinating with too many people for me to care right now
        report_descriptions = {}
        for h in reports.all_reports:
            report_descriptions[h["title"]] = h["description"]
        for key in data["reports"]:
            if report_descriptions.has_key(key):
                data["reports"][key]["description"] = report_descriptions[key]
        #self.log.debug("DEBUG got %s, %s" % (data["reports"], type(data["reports"])));
        data["billing_info"] = {
            "messages": messages,
            "href": req.href.billing(),
            "report_base_href": req.href.report(),
            "usermanual_href": req.href.wiki(user_manual_wiki_title),
            "usermanual_title": user_manual_title
        }

        self.set_request_billing_dates(data)

        add_stylesheet(req, "billing/billingplugin.css")
        add_script(req, "billing/date.js")
        add_script(req, "billing/linkifyer.js")
        if hasattr(Chrome(self.env), 'jenv'):
            return 'billing_jinja.html', data
        else:
            return 'billing.html', data, None
Example #6
0
    def process_request(self, req):
        messages = []
        req.perm.require("TIME_VIEW")
        def addMessage(s):
            messages.extend([s]);

        if req.method == 'POST':
            req.perm.require("TIME_ADMIN")
            if req.args.has_key('setbillingtime'):
                self.set_bill_date(req.authname, req.args.get('newbilltime'))
                addMessage("All tickets last bill date updated")

        mgr = CustomReportManager(self.env, self.log)
        data = {};
        data["is_time_admin"] = req.perm.has_permission("TIME_ADMIN")
        data["statuses"] = get_statuses(self.env)
        data["reports"] = mgr.get_reports_by_group(CustomReportManager.TimingAndEstimationKey);
        # Handle pulling in report_descriptions
        # Could be added to custom report stuff, but that requires 
        # coordinating with too many people for me to care right now
        report_descriptions = {}
        for h in reports.all_reports:
            report_descriptions[h["title"]] = h["description"]
        for key in data["reports"]:
            if report_descriptions.has_key(key):
                data["reports"][key]["description"] = report_descriptions[key]
        #self.log.debug("DEBUG got %s, %s" % (data["reports"], type(data["reports"])));
        data["billing_info"] = {"messages":         messages,
                                "href":             req.href.billing(),
                                "report_base_href": req.href.report(),
                                "usermanual_href":  req.href.wiki(user_manual_wiki_title),
                                "usermanual_title": user_manual_title }

        self.set_request_billing_dates(data)

        add_stylesheet(req, "billing/billingplugin.css")
        add_script(req, "billing/date.js")
        add_script(req, "billing/linkifyer.js")
        return 'billing.html', data, None