## -*- coding: utf-8 -*- <%inherit file="../casemanagement/main.mako" /> <%def name="buildNavipath()"> ${parent.buildNavipath()}
  • ${_('Case Management')}
  • ${_('Selected case documents')}
  • ${_('Phase in CM')}
  • % if c.global_warnings:
    ${c.global_warnings}
    % endif

    ${_('Phase in CM')}

    <% is_allowed = h.hasRole(('cm',)) %> % if c.show_actions: % endif <% phases_are_valid = c.phases.is_valid() %> <% current_phase = c.phases.get_current_phase_id() %> % for num, phase in enumerate(c.phases): <% if phase.id == "-1" and g.mpuls_config.is_enabled('phases', 'hideunknown'): continue %> <% p1, p2 = phase.getStart(), phase.getEnd() %> ## Only show phases which are are on the path of the current phase, or ##are after the current path % if c.phases.is_on_path(p1.id, current_phase) \ or c.phases.is_on_path(p2.id, current_phase) \ or p1.id in c.phases.get_reachable_path(current_phase, False) \ or p2.id in c.phases.get_reachable_path(current_phase, False) \ or current_phase == '-1': % if c.show_actions: % endif % if c.show_actions: % endif % endif % endfor
    ${_('Phase')}   ${_('Required fields')} ${_('Time')} % if is_allowed: ${_('Actions')} % endif
    ${h.literal(phase.getDescription())}
    % if p1.is_active(): ${_('Running')} % elif p2.is_active(): ${_('Finished')} % elif (p2.id in c.phases.get_path(current_phase)) or (p1.id in c.phases.get_path(current_phase)): ${_('Finished')} % else: ${_('Not yet started')} % endif
    % if p1.is_ok() and (c.phases.is_on_path(p1.id, current_phase,True) or c.phases.is_on_path(current_phase, p1.id, True)): Ok % else: Error % endif <% pages, order = p1.getLinks() %> % if len(pages) > 0: % for key in order: <% fields = pages.get(key, []) %> % if len(fields) > 0: ${key}: ${h.literal(", ".join([f.get_link() for f in fields]))} % endif
    % endfor % else: ${_('No required fields found')} % endif
    ${h.NA(h.format_date(p1.getTime()))} % if p1.is_ok() and phases_are_valid and p1.is_neighbor(current_phase) and h.hasRole(['cm']) and session.get('case').getState().getState() == 1: % else: % endif
    % if p2.is_ok() and (c.phases.is_on_path(p2.id, current_phase, True) or c.phases.is_on_path(current_phase, p2.id, True)): Ok % else: Error % endif <% pages, order = p2.getLinks() %> % if len(pages) > 0: % for key in order: <% fields = pages.get(key, []) %> % if len(fields) > 0: ${key}: ${h.literal(", ".join([f.get_link() for f in fields]))} % endif
    % endfor % else: ${_('No required fields found')} % endif
    ${h.NA(h.format_date(p2.getTime()))} % if p2.is_ok() and phases_are_valid and p2.is_neighbor(current_phase) and h.hasRole(['cm']) and session.get('case').getState().getState() == 1: % else: % endif
    ## ## DAUER DER PHASEN ##

    ${_('Duration of phases')}

    <% total = None %> % for num, phase in enumerate(c.phases): <% if phase.id == "-1" and g.mpuls_config.is_enabled('phases', 'hideunknown'): continue %> <% t = phase.getDuration() if t: total = total and (total + t) or t %> % endfor
    ${_('Phase')} ${_('Duration in weeks')}
    ${h.literal(phase.getDescription())} ${h.NA(h.timedelta_in_weeks(t))}
    ${_('Total')} ${h.timedelta_in_weeks(total, '-/-')}