Skip to content

Commit

Permalink
IFRC: AF Branches
Browse files Browse the repository at this point in the history
BOCA: Tweaks
  • Loading branch information
flavour committed Jun 12, 2015
1 parent 63a2682 commit ac10ab6
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
df41b81 (2015-06-12 11:24:36)
63a2682 (2015-06-12 13:10:48)
4 changes: 3 additions & 1 deletion modules/s3db/org.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,9 @@ def model(self):
),
Field("ranking", "integer",
label = T("Ranking"),
requires = IS_IN_SET((1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)),
requires = IS_EMPTY_OR(
IS_IN_SET((1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)),
),
),
*s3_meta_fields()
)
Expand Down
Binary file added modules/templates/IFRC/AF.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions modules/templates/IFRC/af_branch.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Organisation,Branch,Type,Region,Country
Afghan Red Crescent Society,Badakhshan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Badghis,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Baghlan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Bamyan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Daikundi,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Farah,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Faryab,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Ghazni,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Ghor,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Helmand,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Herat,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Jalalabad,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Jawzjan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Kabul,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Kandahar,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Kapisa,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Khost,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Kuduz,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Kunar,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Laghman,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Logar,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Mazar-e-Sharif,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Nimroz,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Nooristan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Oruzgan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Paktia,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Paktika,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Panjshir,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Parwan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Samangan,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Sar-e-Pul,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Takhar,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Wardak,Red Cross / Red Crescent,South Asia,AF
Afghan Red Crescent Society,Zabul,Red Cross / Red Crescent,South Asia,AF
34 changes: 30 additions & 4 deletions modules/templates/IFRC/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2314,10 +2314,36 @@ def customise_member_membership_type_controller(**attr):
def customise_org_capacity_assessment_controller(**attr):

# Organisation needs to be an NS/Branch
ns_only("org_capacity_assessment",
required = True,
branches = True,
)
#ns_only("org_capacity_assessment",
# required = True,
# branches = True,
# )

# Hard-code to ARCS (@ToDo: Use root_org once evaluation completed)
from s3 import IS_ONE_OF
db = current.db
s3db = current.s3db
otable = s3db.org_organisation
arcs = db(otable.name == "Afghan Red Crescent Society").select(otable.id,
limitby=(0, 1)
).first()
if not arcs:
# Prepop not done, bail
return attr

btable = s3db.org_organisation_branch
rows = db(btable.organisation_id == arcs.id).select(btable.branch_id)
filter_opts = [row.branch_id for row in rows]

f = s3db.org_capacity_assessment.organisation_id
f.label = T("Branch")
f.widget = None
f.requires = IS_ONE_OF(db, "org_organisation.id",
s3db.org_OrganisationRepresent(parent=False, acronym=False),
filterby = "id",
filter_opts = filter_opts,
orderby = "org_organisation.name",
sort = True)

return attr

Expand Down
2 changes: 1 addition & 1 deletion modules/templates/IFRC/org_logos.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id,file
"American Red Cross","../../../static/img/logo/arc.png"
"Afghan Red Crescent Society","AfghanRC_logo.jpg"
"Afghan Red Crescent Society","AF.png"
"Honduran Red Cross","CRH.png"
"Indonesian Red Cross Society (Palang Merah Indonesia)","PMI.png"
"International Committee of the Red Cross","ICRC.png"
Expand Down
1 change: 1 addition & 0 deletions modules/templates/IFRC/tasks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ org,organisation_type,default/organisation_type.csv,organisation_type.xsl
org,office_type,office_type.csv,office_type.xsl
org,region,org_region.csv,region.xsl
org,organisation,organisation.csv,organisation.xsl
org,organisation,af_branch.csv,organisation.xsl
#org,organisation,hn_branch.csv,organisation.xsl
org,organisation,nz_branch.csv,organisation.xsl
org,organisation,tl_branch.csv,organisation.xsl
Expand Down

0 comments on commit ac10ab6

Please sign in to comment.