Skip to content

Commit

Permalink
* Minor Homepage enhancements for Nepal + remove CMS Menu
Browse files Browse the repository at this point in the history
* Enable & Enhance Inv for Nepal
  • Loading branch information
michaelhowden committed May 7, 2015
1 parent cc1cb2c commit 6b6aef3
Show file tree
Hide file tree
Showing 47 changed files with 5,554 additions and 106 deletions.
5 changes: 5 additions & 0 deletions controllers/inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,11 @@ def set_track_attr(status):
tracktable.recv_bin.writable = True

def prep(r):
if r.vars.get("recv.status") == '2':
s3.crud_strings.inv_recv.title_list = T("Existing Shipments to Received")
if r.vars.get("recv.status__ne") == '2':
s3.crud_strings.inv_recv.title_list = T("Received Shipments")

record = r.record
if record and \
record.status not in (SHIP_STATUS_IN_PROCESS, SHIP_STATUS_SENT):
Expand Down
5 changes: 3 additions & 2 deletions modules/s3db/inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,8 @@ def inv_send_controller(cls):
s3 = response.s3

# Limit site_id to sites the user has permissions for
error_msg = T("You do not have permission for any facility to send a shipment.")
error_msg = T("You do not have permission for any %(site)s to send a shipment.") % \
dict(site=current.deployment_settings.get_inv_facility_label)
current.auth.permitted_facilities(table=sendtable, error_msg=error_msg)

# Set Validator for checking against the number of items in the warehouse
Expand Down Expand Up @@ -2534,7 +2535,7 @@ def inv_send_process():
site_id = send_record.to_site_id,
comments = send_record.comments,
status = SHIP_STATUS_SENT,
type = 1, # 1:"Another Inventory"
type = 11, # 11:"Another Inventory"
)

# Change the status for all track items in this shipment to In transit
Expand Down
2 changes: 1 addition & 1 deletion modules/s3db/supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def model(self):
supply_item_represent,
sort=True),
sortby = "name",
widget = S3AutocompleteWidget("supply", "item"),
#widget = S3AutocompleteWidget("supply", "item"),
comment=S3AddResourceLink(c="supply",
f="item",
label=ADD_ITEM,
Expand Down
126 changes: 114 additions & 12 deletions modules/templates/Nepal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def config(settings):
T = current.T

settings.base.system_name = T("Nepal Sahana Disaster Management Platform")
#settings.base.system_name_short = T("Sahana")
settings.base.system_name_short = T("Sahana")

# PrePopulate data
settings.base.prepopulate = ("Nepal", "default/users")
Expand Down Expand Up @@ -128,6 +128,108 @@ def config(settings):
# Uncomment to disable the Commit step in the workflow & simply move direct to Ship
settings.req.use_commit = False

def customise_inv_home():
response = current.response
response.title = T("Sahana : Warehouse Management")
s3 = response.s3
s3.stylesheets.append("../themes/CERT/homepage.css")
response.title
from s3 import S3CustomController
S3CustomController._view("Nepal","inv_index.html")
menus = [{"title": T("Receive"),
"icon": "sign-in",
"description": T("Receive a New shipment or an Existing shipment at your site"),
"module": "inv",
"function": "recv",
"args": None,
"vars": {"recv.status":2},
"buttons": [{"args": "create",
"icon": "plus",
"label": T("New"),
},
{"args":"list",
"vars": {"recv.status":2},
"icon": "list",
"label": T("Existing"),
}]
},
{"title": T("Send"),
"icon": "sign-out",
"description": T("Send a shipment from your site."),
"module": "inv",
"function": "send",
"args": "create",
"buttons": [{"args": "create",
"icon": "plus",
"label": T("New"),
}]
},
{"title": T("Stock"),
"icon": "cubes",
"description": T("List of stock at sites"),
"module": "inv",
"function": "inv_item",
"args": None,
"buttons": [{"args": "create",
"icon": "square",
"label": T("Your Site"), #@ToDo: look up name of facility
},
{"args": "list",
"icon": "th",
"label": T("All"),
}]
},
{"title": T("Received Shipments"),
"icon": "indent",
"description": T("List of received shipments"),
"module": "inv",
"function": "recv",
"args": "summary",
"vars": {"recv.status__ne":2},
"buttons": [{"args":"list",
"vars": {"recv.status__ne":2},
"icon": "square",
"label": T("Your Site"), #@ToDo: look up name of facility
},
{"args":"list",
"vars": {"recv.status__ne":2},
"icon": "th",
"label": T("All"),
}]
},
{"title": T("Sent Shipments"),
"icon": "outdent",
"description": T("List of sent shipments"),
"module": "inv",
"function": "send",
"args": "summary",
"buttons": [{"args": "create",
"icon": "square",
"label": T("Your Site"), #@ToDo: look up name of facility
},
{"args": "list",
"icon": "th",
"label": T("All"),
}]
},
{"title": T("Warehouses"),
"icon": "th",
"description": T("List of Warehouses."),
"module": "inv",
"function": "warehouse",
"args": "summary",
"buttons": [{"args": "create",
"icon": "plus",
"label": T("Create"), #@ToDo: look up name of facility
},
{"args": "summary",
"icon": "list",
"label": T("All"),
}]
},
]
return dict(menus = menus)
settings.customise_inv_home = customise_inv_home
# -------------------------------------------------------------------------
# Comment/uncomment modules here to disable/enable them
# Modules menu is defined in modules/eden/menu.py
Expand Down Expand Up @@ -185,7 +287,7 @@ def config(settings):
#description = "Central point to record details on People",
restricted = True,
access = "|1|", # Only Administrators can see this module in the default menu (access to controller is possible to all still)
module_type = 10
module_type = None
)),
("org", Storage(
name_nice = T("Organizations"),
Expand All @@ -197,7 +299,7 @@ def config(settings):
name_nice = T("Staff"),
#description = "Human Resources Management",
restricted = True,
module_type = 2,
module_type = None,
)),
("vol", Storage(
name_nice = T("Volunteers"),
Expand All @@ -209,7 +311,7 @@ def config(settings):
name_nice = T("Content Management"),
#description = "Content Management System",
restricted = True,
module_type = 10,
module_type = None,
)),
#("doc", Storage(
# name_nice = T("Documents"),
Expand All @@ -231,12 +333,12 @@ def config(settings):
restricted = True,
module_type = None, # Not displayed
)),
#("inv", Storage(
# name_nice = T("Warehouses"),
# #description = "Receiving and Sending Items",
# restricted = True,
# module_type = 4
#)),
("inv", Storage(
name_nice = T("Warehouses"),
#description = "Receiving and Sending Items",
restricted = True,
module_type = 4
)),
#("asset", Storage(
# name_nice = T("Assets"),
# #description = "Recording and Assigning Assets",
Expand Down Expand Up @@ -272,10 +374,10 @@ def config(settings):
name_nice = T("Hospitals"),
#description = "Helps to monitor status of hospitals",
restricted = True,
module_type = 10
module_type = 3
)),
("patient", Storage(
name_nice = T("Patient Tracking"),
name_nice = T("Patient"),
#description = "Tracking of Patients",
restricted = True,
module_type = 10
Expand Down
99 changes: 65 additions & 34 deletions modules/templates/Nepal/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,89 +64,120 @@ def __call__(self):
item = ""
output["item"] = item

menus = [{"title": T("Volunteers"),
"icon": "user",
"description": T("Manage people who have volunteered for your organization, their contact details, certicates and trainings."),
"module": "vol",
"function": "volunteer",
menus = [{"title": T("Organizations"),
"icon": "sitemap",
"description": T("List of Organizations responding with contact details and their activities to provide 3W (Who's Doing What Where)."),
"module": "org",
"function": "organisation",
"args": None,
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus-sign",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Shelters"),
"icon": "home",
"description": T("List of Shelters."),
"module": "cr",
"function": "shelter",
{"title": T("Volunteers"),
"icon": "user",
"description": T("Manage people volunteering for your organization, their contact details, certificates and trainings."),
"module": "vol",
"function": "volunteer",
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus-sign",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Hospitals"),
"icon": "h-sign",
"description": T("List of Hospitals."),
"icon": "hospital-o",
"description": T("List of Hospitals and other Health Facilities."),
"module": "hms",
"function": "hospital",
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus-sign",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Patients"),
"icon": "ambulance",
"description": T("List of Patients."),
"module": "patient",
"function": "patient",
{"title": T("Warehouses"),
"icon": "th",
"description": T("Manage Warehouses, their stock and shipments."),
"module": "inv",
"function": "index",
"buttons": [{"function": "warehouse",
"args": "summary",
"icon": "list",
"label": T("View"),
},
{"function": "warehouse",
"args": "create",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Resources"),
"icon": "cube",
"description": T("Resources that organizations have that are useful for response."),
"module": "org",
"function": "resource",
"args": None,
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus-sign",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Requests"),
"icon": "truck",
"description": T("Requests for goods or services."),
"module": "req",
"function": "req",
"args": None,
{"title": T("Shelters"),
"icon": "home",
"description": T("List of Shelters for displaced people."),
"module": "cr",
"function": "shelter",
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus-sign",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Resources"),
"icon": "wrench",
"description": T("Resources that organizations have that are useful for response."),
"module": "org",
"function": "resource",
{"title": T("Patients"),
"icon": "ambulance",
"description": T("Register and of Patients."),
"module": "patient",
"function": "patient",
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus",
"label": T("Create"),
}]
},
{"title": T("Requests"),
"icon": "truck",
"description": T("Requests for resources or services."),
"module": "req",
"function": "req",
"args": None,
"buttons": [{"args": "summary",
"icon": "list",
"label": T("View"),
},
{"args": "create",
"icon": "plus-sign",
"icon": "plus",
"label": T("Create"),
}]
},
Expand Down
Loading

0 comments on commit 6b6aef3

Please sign in to comment.