Comment 3 for bug 893937

Revision history for this message
Carl Leitner (litlfred) wrote :

The geographic setup for CSSC is different than the default because it uses Zones. Because this is the case, you should probably not use the ManageAccessFacility module. Instead you should create a new module specific to CSSC.

Here is an explanation.

In the default way of defining the facility (not used by CSSC), the class for facility extends iHRIS_ListByLocation which is defined here:
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-common/4.1-dev/view/head:/modules/Geography/Geography.xml#L262
with:
 county:district:[region]:country
and selectable forms country and district as defined on lines 255-256

In the CSSC Facility module, you can see here
 http://bazaar.launchpad.net/~ihris+cssc/ihris-manage-cssc/4.1/view/head:/modules/Facility/Facility.xml#L172
how the geography is setup for CSSC as:
  cssc_village:cssc_ward:county:district:[region]:cssc_zone:country
This means that in the tree view for selecting the facility location, first we show country, then we show the zones, then we skip over the region and show the district, then we show the county, then we show the cssc_ward, then we show the cssc_village.

On lines 148-151 we see that the forms we are allowed to select for the facility location are cssc_village, cssc_ward, country and district (Note... I think that country is a typo here and it should be county).

To make things work for CSSC, you should copy the ManageAccessFacility module from here:
  http://bazaar.launchpad.net/~intrahealth+informatics/ihris-manage/4.1-dev/files/head:/modules/ManageAccessFacility/
into the CSSC customizations. You will then want to modify it to work for CSSC. Here are the steps you would need to take:

1) In the .xml file, you should all references to ManageAccessFaciltiy to CSSCAccessFacility so there is not naming conflict.

2) In the .xml file you should replace lines 157-161 with the forms that you want to be able to select for the user. These are probably facility, cssc_village, cssc_ward,county,district,cssc_zone,country

3)In the .xml you should replace line 167 with something like:
facility+location:cssc_village:cssc_ward:county:district:[region]:cssc_zone:country

4) in the lib directory, rename the file iHRIS_Module_ManageAccessFaciltiy.php to iHRIS_Module_CSSCAccessFacility.php. Also edit this file to rename the class from iHRIS_Module_ManageAccessFaciltiy to iHRIS_Module_CSSCAccessFacility