--  SQL file representing changes to the functionalities model
--  Generated at Mon Apr 23 20:12:00 WEST 2007
--  DO NOT EDIT THIS FILE, run the generating script instead

--  Preamble

START TRANSACTION;

-- 
--  Updating existing functionalities
-- 

--  ID: 26328 UUID: '173e00ae-66ff-408b-a8ce-d4a4011fe3f5'
UPDATE `ACCESSIBLE_ITEM` AS own SET own.`KEY_AVAILABILITY_POLICY` = NULL WHERE own.`UUID` = '173e00ae-66ff-408b-a8ce-d4a4011fe3f5';
INSERT INTO `AVAILABILITY_POLICY` (`OJB_CONCRETE_CLASS`, `KEY_ROOT_DOMAIN_OBJECT`, `KEY_ACCESSIBLE_ITEM`, `EXPRESSION`, `TARGET_GROUP`) SELECT 'net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability', 1, `ID_INTERNAL`, 'ifTrue($I(selectedDepartmentUnitID, \'organizationalStructure.DepartmentUnit\').site.showSectionTeachers)', 'ifTrue($I(selectedDepartmentUnitID, \'organizationalStructure.DepartmentUnit\').site.showSectionTeachers)' FROM `ACCESSIBLE_ITEM` WHERE `UUID` = '173e00ae-66ff-408b-a8ce-d4a4011fe3f5';
UPDATE `ACCESSIBLE_ITEM` AS f, `AVAILABILITY_POLICY` AS ap SET f.`KEY_AVAILABILITY_POLICY` = ap.`ID_INTERNAL` WHERE f.`UUID` = '173e00ae-66ff-408b-a8ce-d4a4011fe3f5' AND ap.`KEY_ACCESSIBLE_ITEM` = f.`ID_INTERNAL`;

--  ID: 26329 UUID: '3bd0759b-edca-4ff7-87d6-6e03b6be1b3c'
UPDATE `ACCESSIBLE_ITEM` AS own SET own.`KEY_AVAILABILITY_POLICY` = NULL WHERE own.`UUID` = '3bd0759b-edca-4ff7-87d6-6e03b6be1b3c';
INSERT INTO `AVAILABILITY_POLICY` (`OJB_CONCRETE_CLASS`, `KEY_ROOT_DOMAIN_OBJECT`, `KEY_ACCESSIBLE_ITEM`, `EXPRESSION`, `TARGET_GROUP`) SELECT 'net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability', 1, `ID_INTERNAL`, 'ifTrue($I(selectedDepartmentUnitID, \'organizationalStructure.DepartmentUnit\').site.showSectionEmployees)', 'ifTrue($I(selectedDepartmentUnitID, \'organizationalStructure.DepartmentUnit\').site.showSectionEmployees)' FROM `ACCESSIBLE_ITEM` WHERE `UUID` = '3bd0759b-edca-4ff7-87d6-6e03b6be1b3c';
UPDATE `ACCESSIBLE_ITEM` AS f, `AVAILABILITY_POLICY` AS ap SET f.`KEY_AVAILABILITY_POLICY` = ap.`ID_INTERNAL` WHERE f.`UUID` = '3bd0759b-edca-4ff7-87d6-6e03b6be1b3c' AND ap.`KEY_ACCESSIBLE_ITEM` = f.`ID_INTERNAL`;

--  ID: 26330 UUID: '85372e2e-ffe0-48ff-a758-1017a11c797f'
UPDATE `ACCESSIBLE_ITEM` AS own SET own.`KEY_AVAILABILITY_POLICY` = NULL WHERE own.`UUID` = '85372e2e-ffe0-48ff-a758-1017a11c797f';
INSERT INTO `AVAILABILITY_POLICY` (`OJB_CONCRETE_CLASS`, `KEY_ROOT_DOMAIN_OBJECT`, `KEY_ACCESSIBLE_ITEM`, `EXPRESSION`, `TARGET_GROUP`) SELECT 'net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability', 1, `ID_INTERNAL`, 'ifTrue($I(selectedDepartmentUnitID, \'organizationalStructure.DepartmentUnit\').site.showSectionCourses)', 'ifTrue($I(selectedDepartmentUnitID, \'organizationalStructure.DepartmentUnit\').site.showSectionCourses)' FROM `ACCESSIBLE_ITEM` WHERE `UUID` = '85372e2e-ffe0-48ff-a758-1017a11c797f';
UPDATE `ACCESSIBLE_ITEM` AS f, `AVAILABILITY_POLICY` AS ap SET f.`KEY_AVAILABILITY_POLICY` = ap.`ID_INTERNAL` WHERE f.`UUID` = '85372e2e-ffe0-48ff-a758-1017a11c797f' AND ap.`KEY_ACCESSIBLE_ITEM` = f.`ID_INTERNAL`;

COMMIT;
