Fix wrong use of templates, avoid mix use of template and display::header

pull/2487/head
jmontoyaa 8 years ago
parent 201cf11bb7
commit d702205891
  1. 4
      main/admin/career_dashboard.php
  2. 99
      main/template/default/admin/career_dashboard.tpl

@ -28,8 +28,6 @@ $interbreadcrumb[] = array(
);
$tpl = new Template(get_lang('CareersAndPromotions'));
Display :: display_header(null);
$html = null;
$form = new FormValidator('filter_form', 'GET', api_get_self());
@ -150,5 +148,3 @@ $tpl->assign('form_filter', $html);
$tpl->assign('data', $careers);
$layout = $tpl->get_template('admin/career_dashboard.tpl');
$tpl->display($layout);
Display::display_footer();

@ -1,60 +1,61 @@
{% extends template ~ "/layout/layout_1_col.tpl" %}
{{ actions }}
{% block content %}
{{ form_filter }}
{{ form_filter }}
{% for item in data %}
<div id="career-{{ item.id }}" class="career panel panel-default">
<div class="panel-heading">
<h4><a href="{{ _p.web }}main/admin/careers.php?action=edit&id={{ item.id }}">{{ item.name }}</a></h4>
</div>
<div class="panel-body">
{{ item.description }}
<table class="table promotions">
<thead class="title">
<th>{{ 'Promotions' | get_lang }}</th>
<th>{{ 'StudyCycle' | get_lang }} </th>
<th>{{ 'Courses' | get_lang }} </th>
</thead>
{% for promotions in item.career %}
{% for prom in promotions %}
{% set line = prom.sessions|length + 1 %}
<tr>
<td class="promo" rowspan="{{ line }}">
<h4 id="promotion-id-{{ prom.id }}">
<a title="{{ prom.name }}" href="{{ _p.web }}main/admin/promotions.php?action=edit&id={{ prom.id }}">
{{ prom.name }}
</a>
</h4>
</td>
{% if line == 1 %}
<td>&nbsp;</td><td>&nbsp;</td>
{% endif %}
</tr>
{% for session in prom.sessions %}
{% set sessionid = session.data.id %}
{% for item in data %}
<div id="career-{{ item.id }}" class="career panel panel-default">
<div class="panel-heading">
<h4><a href="{{ _p.web }}main/admin/careers.php?action=edit&id={{ item.id }}">{{ item.name }}</a></h4>
</div>
<div class="panel-body">
{{ item.description }}
<table class="table promotions">
<thead class="title">
<th>{{ 'Promotions' | get_lang }}</th>
<th>{{ 'StudyCycle' | get_lang }} </th>
<th>{{ 'Courses' | get_lang }} </th>
</thead>
{% for promotions in item.career %}
{% for prom in promotions %}
{% set line = prom.sessions|length + 1 %}
<tr>
<td class="cycles">
<h4 id="session-id-{{ sessionid }}">
<a title="{{ session.data.name }}" href="{{ _p.web }}main/session/resume_session.php?id_session={{ sessionid }}">
{{ session.data.name }}
<td class="promo" rowspan="{{ line }}">
<h4 id="promotion-id-{{ prom.id }}">
<a title="{{ prom.name }}" href="{{ _p.web }}main/admin/promotions.php?action=edit&id={{ prom.id }}">
{{ prom.name }}
</a>
</h4>
</td>
<td class="courses">
<ul>
{% for course in session.courses %}
<li><a href="{{ _p.web }}courses/{{ course.directory }}/index.php?id_session={{ sessionid }}" title="{{ course.title }}">{{ course.title }}</a></li>
{% endfor %}
</ul>
</td>
{% if line == 1 %}
<td>&nbsp;</td><td>&nbsp;</td>
{% endif %}
</tr>
{% for session in prom.sessions %}
{% set sessionid = session.data.id %}
<tr>
<td class="cycles">
<h4 id="session-id-{{ sessionid }}">
<a title="{{ session.data.name }}" href="{{ _p.web }}main/session/resume_session.php?id_session={{ sessionid }}">
{{ session.data.name }}
</a>
</h4>
</td>
<td class="courses">
<ul>
{% for course in session.courses %}
<li><a href="{{ _p.web }}courses/{{ course.directory }}/index.php?id_session={{ sessionid }}" title="{{ course.title }}">{{ course.title }}</a></li>
{% endfor %}
</ul>
</td>
</tr>
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
</table>
</table>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
{% endblock %}

Loading…
Cancel
Save