Skip to content
Snippets Groups Projects
Commit 1d838409 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

ADD: discipline formid and showing it in dean's list #595

parent b2fecf6f
Branches
No related merge requests found
ALTER TABLE disciplines
ADD COLUMN formid integer DEFAULT NULL;
--ALTER TABLE ONLY disciplines
-- ADD CONSTRAINT disciplines_ibfk_7 FOREIGN KEY (formid) REFERENCES study_form(id);
drop view if exists public.view_disciplines_stat;
DROP FUNCTION IF EXISTS public.disciplinecollection_get(psemesterid integer, pfacultyid integer, pgradenum integer, pdegree bachelor_master_specialist);
CREATE OR REPLACE FUNCTION public.disciplinecollection_get(psemesterid integer, pfacultyid integer, pgradenum integer DEFAULT NULL::integer, pdegree bachelor_master_specialist DEFAULT NULL::bachelor_master_specialist)
RETURNS TABLE("ID" integer, "SubjectName" character varying, "AuthorID" integer, "ExamType" exam_credit_grading_credit, "State" text, "IsInactive" boolean, "IsGlobalStub" boolean, "PlanExternalID" integer, "GlobalName" character varying)
RETURNS TABLE("ID" integer, "SubjectName" character varying, "AuthorID" integer, "ExamType" exam_credit_grading_credit, "StudyForm" integer, "State" text, "IsInactive" boolean, "IsGlobalStub" boolean, "PlanExternalID" integer, "GlobalName" character varying)
LANGUAGE plpgsql
AS $function$
-- select public.discipline_getwithfullness(
......@@ -14,6 +21,7 @@ BEGIN
view_disciplines.SubjectName As SubjectName,
view_disciplines.AuthorID As AuthorID,
view_disciplines.ExamType As ExamType,
disciplines.FormID AS StudyForm,
CASE
WHEN (view_disciplines.MaxRate < 100 AND view_disciplines.IsLocked = 0) THEN 'no_map'
WHEN (view_disciplines.MaxRate = 100 AND view_disciplines.IsLocked = 0) THEN 'no_rates'
......@@ -32,3 +40,13 @@ BEGIN
(view_disciplines.Degree = pdegree or ((public.view_disciplines.Degree = pdegree)is unknown));
END
$function$;
CREATE OR REPLACE VIEW public.view_disciplines_stat
AS SELECT ff.name,
( SELECT count(*) AS count
FROM disciplinecollection_get(11, ff.id) disciplinecollection_get("ID", "SubjectName", "AuthorID", "ExamType", "StudyForm", "State", "IsInactive", "PlanExternalID", "GlobalName", "GlobalName_1")) AS "Всего дисциплин",
( SELECT count(*) AS count
FROM disciplinecollection_get(11, ff.id) t("ID", "SubjectName", "AuthorID", "ExamType", "StudyForm", "State", "IsInactive", "PlanExternalID", "GlobalName", "GlobalName_1")
WHERE t."State" = 'no_map'::text AND t."IsInactive" = false) AS "Без УКД"
FROM faculties ff;
......@@ -31,6 +31,7 @@
<td style="width: 400px;">Название </td>
<td style="width: 200px;">Автор</td>
<td style="width: 150px;">Тип контроля </td>
<td style="width: 150px;">форма обуч. </td>
{% if InMainList %}
<td style="width: 200px;">вкл./выкл.</td>
{% endif %}
......@@ -57,6 +58,13 @@
<td style="white-space: normal;">
{{ discipline.ExamType | replace({'credit': "зачет", 'exam': "экзамен", 'grading_credit': "дифзачет"}) }}
</td>
<td style="white-space: normal;">
{% if discipline.StudyForm %}
{{ discipline.StudyForm | replace({1: "очная", 2: "очно-заочная", 3: "заочная"}) }}
{% else %}
n/a
{% endif %}
</td>
<td>
{% if discipline.IsGlobalStub %}
<a class="discipline_stub_{{ discipline.ID }}"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment