Browse Source

Add skill list for management - refs BT#9583 #7385

Angel Fernando Quiroz Campos 10 năm trước cách đây
mục cha
commit
5473790233
2 tập tin đã thay đổi với 75 bổ sung0 xóa
  1. 39 0
      main/admin/skill_list.php
  2. 36 0
      main/template/default/skill/list.tpl

+ 39 - 0
main/admin/skill_list.php

@@ -0,0 +1,39 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+ * Skill list for management
+ * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
+ * @package chamilo.admin
+ */
+use ChamiloSession as Session;
+
+$cidReset = true;
+
+require_once '../inc/global.inc.php';
+
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_admin_script();
+
+if (api_get_setting('allow_skills_tool') != 'true') {
+    api_not_allowed();
+}
+
+$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
+
+$message = Session::has('message') ? Session::read('message') : null;
+
+/* View */
+$skill = new Skill();
+$skillList = $skill->get_all();
+
+$tpl = new Template(get_lang('ManageSkills'));
+$tpl->assign('message', $message);
+$tpl->assign('skills', $skillList);
+
+$content = $tpl->fetch('default/skill/list.tpl');
+
+$tpl->assign('content', $content);
+$tpl->display_one_col_template();
+
+Session::erase('message');

+ 36 - 0
main/template/default/skill/list.tpl

@@ -0,0 +1,36 @@
+<header class="page-header">
+    <h1>{{ "ManageSkills" | get_lang }}</h1>
+</header>
+
+<table class="table table-hover table-striped">
+    <thead>
+        <tr>
+            <th>{{ "Name" | get_lang }}</th>
+            <th>{{ "ShortCode" | get_lang }}</th>
+            <th>{{ "Description" | get_lang }}</th>
+            <th>{{ "Options" | get_lang }}</th>
+        </tr>
+    </thead>
+    <tfoot>
+        <tr>
+            <th>{{ "Name" | get_lang }}</th>
+            <th>{{ "ShortName" | get_lang }}</th>
+            <th>{{ "Description" | get_lang }}</th>
+            <th>{{ "Options" | get_lang }}</th>
+        </tr>
+    </tfoot>
+    <tbody>
+        {% for skill in skills %}
+            <tr>
+                <td>{{ skill.name }}</td>
+                <td>{{ skill.short_code }}</td>
+                <td>{{ skill.description }}</td>
+                <td>
+                    <a href="{{ _p.web_main }}admin/skill_edit.php?id={{ skill.id }}" class="btn btn-default">
+                        <i class="fa fa-edit"></i> {{ "Edit" | get_lang }}
+                    </a>
+                </td>
+            </tr>
+        {% endfor %}
+    </tbody>
+</table>