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

Merge branch 'hotfix/v2.7.13'

parents 75b31638 a58be02e
Branches
No related merge requests found
......@@ -13,3 +13,19 @@ EXCEPTION
then RETURN -1;
end
$function$;
CREATE OR REPLACE FUNCTION public.discipline_setnotglobal(pdisciplineid integer)
RETURNS integer
LANGUAGE plpgsql
AS $function$
BEGIN
UPDATE disciplines SET isglobal=FALSE
WHERE disciplines.id = pdisciplineid;
RETURN 0;
EXCEPTION
when others
then RETURN -1;
end
$function$;
\ No newline at end of file
......@@ -83,6 +83,8 @@ class Controller_Api_V0_StudyPlan extends Controller_Handler_Api
if ($disciplineData->global) {
$discipline->setInactive();
$discipline->setGlobal();
} else {
$discipline->setNotGlobal();
}
}
......
......@@ -344,6 +344,15 @@ class Model_Discipline extends Model_Container
return $res;
}
public function setNotGlobal() {
$sql = 'SELECT * FROM Discipline_setNotGlobal(:discipline) as "Num"';
$res = DB::query(Database::SELECT, $sql)
->parameters([
':discipline' => $this->ID
])->execute()->get("Num");
return $res;
}
public function setActive() {
$sql = 'SELECT * FROM Discipline_setActive(:discipline) as "Num"';
$res = DB::query(Database::SELECT, $sql)
......
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