993:
994:
995: --Bug 4599990. Modified the code to handle the case where the security profile restricts the organizations
996: --to be displayed to that part of the hierarchy with organization selected in the user assignment as the top org
997: FUNCTION PJI_ORGANIZATION_LOV RETURN PJI_ORGANIZATION_LIST_TBL
998: IS
999: l_Organization_List PJI_ORGANIZATION_LIST_TBL := PJI_ORGANIZATION_LIST_TBL();
1000: l_Count NUMBER;
1001: --Bug 4599990.
995: --Bug 4599990. Modified the code to handle the case where the security profile restricts the organizations
996: --to be displayed to that part of the hierarchy with organization selected in the user assignment as the top org
997: FUNCTION PJI_ORGANIZATION_LOV RETURN PJI_ORGANIZATION_LIST_TBL
998: IS
999: l_Organization_List PJI_ORGANIZATION_LIST_TBL := PJI_ORGANIZATION_LIST_TBL();
1000: l_Count NUMBER;
1001: --Bug 4599990.
1002: l_top_organization_id per_security_profiles.organization_id%TYPE;
1003: l_user_id NUMBER;
1019: --Bug 4599990. View All Orgz
1020: IF l_top_organization_id = 0 THEN
1021:
1022: SELECT
1023: PJI_ORGANIZATION_LIST(
1024: orgd.organization_id_child
1025: , org.name
1026: , orgd.organization_id_parent)
1027: BULK COLLECT INTO l_Organization_List
1039: --as the top org
1040: ELSIF l_user_assmt_flag = 'N' THEN
1041:
1042: SELECT
1043: PJI_ORGANIZATION_LIST(
1044: orgd.organization_id_child
1045: , org.name
1046: , orgd.organization_id_parent)
1047: BULK COLLECT INTO l_Organization_List
1062: --assignment as the top org
1063: ELSIF l_user_assmt_flag = 'Y' THEN
1064:
1065: SELECT
1066: PJI_ORGANIZATION_LIST(
1067: orgd.organization_id_child
1068: , org.name
1069: , orgd.organization_id_parent)
1070: BULK COLLECT INTO l_Organization_List
1117: OR sec.organization_id IS NOT NULL))
1118: LOOP
1119: l_Count:=l_Count+1;
1120: l_Organization_List.EXTEND;
1121: l_Organization_List(l_Count):=PJI_ORGANIZATION_LIST(NULL,NULL,NULL);
1122: l_Organization_List(l_Count).ID:=cur_Top_Organization_List.organization_id_child;
1123: l_Organization_List(l_Count).VALUE:=cur_Top_Organization_List.name;
1124: l_Organization_List(l_Count).PARENT_ID:=NULL;
1125: NULL;
1128: --Bug 4599990. If the top org is already derived earlier then it can be used here.
1129: ELSE
1130: l_Count:=l_Count+1;
1131: l_Organization_List.EXTEND;
1132: l_Organization_List(l_Count):=PJI_ORGANIZATION_LIST(NULL,NULL,NULL);
1133: l_Organization_List(l_Count).ID:=l_top_organization_id;
1134: l_Organization_List(l_Count).VALUE:=l_top_org_name;
1135: l_Organization_List(l_Count).PARENT_ID:=NULL;
1136: