コード例 #1
0
ファイル: webui.py プロジェクト: pombredanne/trachacks
    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
コード例 #2
0
def index(names):
    self_name, conn_names = parse_names(names)
    return render_template('index.html',
                           self_name=self_name,
                           conn_names=conn_names,
                           path='{}?{}'.format(names,
                                               request.query_string.decode()),
                           statuses=get_statuses(),
                           unknown_status=get_unknown_status(),
                           statuses_rows=get_visible_count(),
                           statuses_cols=len(conn_names.split(",")) + 1)
コード例 #3
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, 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
コード例 #4
0
ファイル: webui.py プロジェクト: nyuhuhuu/trachacks
    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