Skip to content

Options

hypha.apply.todo.options

PROJECT_WAITING_PAF module-attribute

PROJECT_WAITING_PAF = 'project_waiting_paf'

PROJECT_SUBMIT_PAF module-attribute

PROJECT_SUBMIT_PAF = 'project_submit_paf'

PAF_REQUIRED_CHANGES module-attribute

PAF_REQUIRED_CHANGES = 'paf_required_changes'

PAF_WAITING_ASSIGNEE module-attribute

PAF_WAITING_ASSIGNEE = 'paf_waiting_assignee'

PAF_WAITING_APPROVAL module-attribute

PAF_WAITING_APPROVAL = 'paf_waiting_approval'

PROJECT_WAITING_CONTRACT module-attribute

PROJECT_WAITING_CONTRACT = 'project_waiting_contract'

PROJECT_WAITING_CONTRACT_DOCUMENT module-attribute

PROJECT_WAITING_CONTRACT_DOCUMENT = 'project_waiting_contract_document'

PROJECT_WAITING_CONTRACT_REVIEW module-attribute

PROJECT_WAITING_CONTRACT_REVIEW = 'project_waiting_contract_review'

PROJECT_WAITING_INVOICE module-attribute

PROJECT_WAITING_INVOICE = 'project_waiting_invoice'

INVOICE_REQUIRED_CHANGES module-attribute

INVOICE_REQUIRED_CHANGES = 'invoice_required_changes'

INVOICE_WAITING_APPROVAL module-attribute

INVOICE_WAITING_APPROVAL = 'invoice_waiting_approval'

INVOICE_WAITING_PAID module-attribute

INVOICE_WAITING_PAID = 'invoice_waiting_paid'

REPORT_DUE module-attribute

REPORT_DUE = 'report_due'

TASKS_CODE_CHOICES module-attribute

TASKS_CODE_CHOICES = ((PROJECT_WAITING_PAF, 'Project waiting PAF'), (PROJECT_SUBMIT_PAF, 'Project submit PAF'), (PAF_REQUIRED_CHANGES, 'PAF required changes'), (PAF_WAITING_ASSIGNEE, 'PAF waiting assignee'), (PAF_WAITING_APPROVAL, 'PAF waiting approval'), (PROJECT_WAITING_CONTRACT, 'Project waiting contract'), (PROJECT_WAITING_CONTRACT_DOCUMENT, 'Project waiting contract document'), (PROJECT_WAITING_CONTRACT_REVIEW, 'Project waiting contract review'), (PROJECT_WAITING_INVOICE, 'Project waiting invoice'), (INVOICE_REQUIRED_CHANGES, 'Invoice required changes'), (INVOICE_WAITING_APPROVAL, 'Invoice waiting approval'), (INVOICE_WAITING_PAID, 'Invoice waiting paid'), (REPORT_DUE, 'Report due'))

template_map module-attribute

template_map = {PROJECT_WAITING_PAF: {'text': gettext('Project [{related.title}]({link}) is waiting for PAF'), 'icon': 'dashboard-paf', 'url': '{link}', 'type': gettext('project')}, PROJECT_SUBMIT_PAF: {'text': gettext('Project [{related.title}]({link}) is waiting for PAF submission'), 'icon': 'dashboard-paf', 'url': '{link}', 'type': gettext('project')}, PAF_REQUIRED_CHANGES: {'text': gettext('PAF for project [{related.title}]({link}) required changes or more information'), 'icon': 'dashboard-paf', 'url': '{link}', 'type': gettext('project')}, PAF_WAITING_ASSIGNEE: {'text': gettext('PAF for project [{related.title}]({link}) is waiting for assignee'), 'icon': 'dashboard-paf', 'url': '{link}', 'type': gettext('project')}, PAF_WAITING_APPROVAL: {'text': gettext('PAF for project [{related.title}]({link}) is waiting for your approval'), 'icon': 'dashboard-paf', 'url': '{link}', 'type': gettext('project')}, PROJECT_WAITING_CONTRACT: {'text': gettext('Project [{related.title}]({link}) is waiting for contract'), 'icon': 'dashboard-contract', 'url': '{link}', 'type': gettext('project')}, PROJECT_WAITING_CONTRACT_DOCUMENT: {'text': gettext('Project [{related.title}]({link}) is waiting for contracting documents'), 'icon': 'dashboard-document', 'url': '{link}', 'type': gettext('project')}, PROJECT_WAITING_CONTRACT_REVIEW: {'text': gettext('Contract for project [{related.title}]({link}) is waiting for review'), 'icon': 'dashboard-contract', 'url': '{link}', 'type': gettext('project')}, PROJECT_WAITING_INVOICE: {'text': gettext('Project [{related.title}]({link}) is waiting for invoice'), 'icon': 'dashboard-invoice', 'url': '{link}', 'type': gettext('project')}, INVOICE_REQUIRED_CHANGES: {'text': gettext('Invoice [{related.invoice_number}]({link}) required changes or more information'), 'icon': 'dashboard-invoice', 'url': '{link}', 'type': gettext('project')}, INVOICE_WAITING_APPROVAL: {'text': gettext('Invoice [{related.invoice_number}]({link}) is waiting for your approval'), 'icon': 'dashboard-invoice', 'url': '{link}', 'type': gettext('project')}, INVOICE_WAITING_PAID: {'text': gettext('Invoice [{related.invoice_number}]({link}) is waiting to be paid'), 'icon': 'dashboard-invoice', 'url': '{link}', 'type': gettext('project')}, REPORT_DUE: {'text': gettext('Report for project [{related.title}]({link}) is due'), 'icon': 'dashboard-report', 'url': '{link}', 'type': gettext('project')}}

get_task_template

get_task_template(request, code, related_obj, **kwargs)
Source code in hypha/apply/todo/options.py
def get_task_template(request, code, related_obj, **kwargs):
    templates = copy.deepcopy(template_map)
    try:
        template = templates[code]
    except KeyError:
        # Unregistered code
        return
    template_kwargs = {
        "related": related_obj,
        "link": link_to(related_obj, request),
    }
    template["text"] = template["text"].format(**template_kwargs)
    template["url"] = template["url"].format(**template_kwargs)
    return template