Commit 6b2e6433 authored by User expired's avatar User expired
Browse files

Merge branch 'uibk' of git.uibk.ac.at:c102215/tcexam_uibk into uibk

parents 66588675 beb84cd2
......@@ -82,11 +82,6 @@ ALTER FUNCTION set_admin_group(bigint, bigint)
OWNER TO tcexam;
-- functions for tcexam esb integration
-- assign_tcexam_user_to_group
......@@ -284,6 +279,7 @@ $BODY$
DECLARE
externalid character varying;
appointmentid character varying;
groupname character varying;
grouptype character varying;
groupvo xml;
......@@ -292,12 +288,16 @@ BEGIN
externalid = CONCAT (pgroupid,':',pappointmentid);
IF pappointmentid = 'owner' THEN
grouptype = 'B';
pappointmentid = 'Betreuergruppe';
END IF;
groupname = CONCAT (pgroupname ,' - ',pappointmentid);
IF NOT EXISTS(SELECT group_id FROM tce_user_groups WHERE external_id = externalid)
THEN
INSERT INTO tce_user_groups (group_name, external_id,group_type) VALUES (pgroupname,externalid,grouptype);
INSERT INTO tce_user_groups (group_name, external_id,group_type) VALUES (groupname,externalid,grouptype);
END IF;
END;$BODY$
END;
$BODY$
LANGUAGE plpgsql VOLATILE
SECURITY DEFINER
-- Set a secure search_path: trusted schema(s), then 'pg_temp'.
......@@ -404,7 +404,7 @@ BEGIN
theKey = pgroupid || ':' || pappointmentid;
IF (SELECT group_name FROM tce_user_groups WHERE external_id = theKey) != pgroupname THEN
UPDATE tce_user_groups set group_name = pgroupname WHERE external_id = theKey;
UPDATE tce_user_groups set group_name = CONCAT(pgroupname, ' - ',pappointmentid) WHERE external_id = theKey;
END IF;
END;
$BODY$
......
Markdown is supported
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