Skip to content
Browse files

Merge branch 'master' of git://github.com/michaelhowden/eden

  • Loading branch information...
2 parents 9b64fe1 + 8c7c67e commit d0deb0165d56e1e16e74b092ed50400a5c657f3f @flavour committed Oct 8, 2012
View
4 controllers/asset.py
@@ -41,6 +41,10 @@ def asset():
return s3db.asset_controller()
# =============================================================================
+def supplier():
+ current.request.get_vars["organisation.organisation_type_id$name"] = "Supplier"
+ return s3db.org_organisation_controller()
+# =============================================================================
def item():
""" RESTful CRUD controller """
View
4 controllers/project.py
@@ -232,7 +232,7 @@ def postp(r, output):
elif r.component_name == "beneficiary":
# Set the minimum end_date to the same as the start_date
s3.jquery_ready.append(
-'''S3.start_end_date('project_beneficiary_start_date','project_beneficiary_end_date')''')
+'''S3.start_end_date('project_beneficiary_date','project_beneficiary_end_date')''')
return output
s3.postp = postp
@@ -458,7 +458,7 @@ def location():
def prep(r):
if r.interactive:
if r.record and r.record.project_id:
- sector_ids = ptable[r.record.project_id].sector_id
+ sector_ids = s3db.project_project[r.record.project_id].sector_id
else:
sector_ids = []
set_project_multi_activity_type_id_requires(sector_ids)
View
96 modules/eden/asset.py
@@ -647,6 +647,8 @@ def asset_log_onaccept(form):
atable = s3db.asset_asset
tracker = S3Tracker()
asset_tracker = tracker(atable, asset_id)
+
+ thistime = request.now
if status == ASSET_LOG_SET_BASE:
# Set Base Location
@@ -892,54 +894,54 @@ def asset_rheader(r):
current_log = asset_get_current_log(record.id)
status = current_log.status
- if record.location_id:
- # A Base Site has been set
- # Return functionality removed - as it doesn't set site_id & organisation_id in the logs
- #if status == ASSET_LOG_ASSIGN:
- # asset_action_btns += [ A( T("Return"),
- # _href = URL(f=func,
- # args = [record.id, "log", "create"],
- # vars = dict(status = ASSET_LOG_RETURN)
- # ),
- # _class = "action-btn"
- # )
- # ]
- if status < ASSET_LOG_DONATED:
- # @ToDo: deployment setting to prevent assigning assets before returning them
- # The Asset is available for assignment (not disposed)
- asset_action_btns += [ A( T("Assign to Person"),
- _href = URL(f=func,
- args = [record.id, "log", "create"],
- vars = dict(status = ASSET_LOG_ASSIGN,
- type = "person")
- ),
- _class = "action-btn"
- ),
- A( T("Assign to Facility/Site"),
- _href = URL(f=func,
- args = [record.id, "log", "create"],
- vars = dict(status = ASSET_LOG_ASSIGN,
- type = "site")
- ),
- _class = "action-btn"
- ),
- A( T("Assign to Organization"),
- _href = URL(f=func,
- args = [record.id, "log", "create"],
- vars = dict(status = ASSET_LOG_ASSIGN,
- type = "organisation")
- ),
- _class = "action-btn"
- ),
- ]
- asset_action_btns += [ A( T("Update Status"),
- _href = URL(f=func,
- args = [record.id, "log", "create"],
- vars = None
+ #if record.location_id:
+ # A Base Site has been set
+ # Return functionality removed - as it doesn't set site_id & organisation_id in the logs
+ #if status == ASSET_LOG_ASSIGN:
+ # asset_action_btns += [ A( T("Return"),
+ # _href = URL(f=func,
+ # args = [record.id, "log", "create"],
+ # vars = dict(status = ASSET_LOG_RETURN)
+ # ),
+ # _class = "action-btn"
+ # )
+ # ]
+ if status < ASSET_LOG_DONATED:
+ # @ToDo: deployment setting to prevent assigning assets before returning them
+ # The Asset is available for assignment (not disposed)
+ asset_action_btns += [ A( T("Assign to Person"),
+ _href = URL(f=func,
+ args = [record.id, "log", "create"],
+ vars = dict(status = ASSET_LOG_ASSIGN,
+ type = "person")
),
- _class = "action-btn"
- ),
- ]
+ _class = "action-btn"
+ ),
+ A( T("Assign to Facility/Site"),
+ _href = URL(f=func,
+ args = [record.id, "log", "create"],
+ vars = dict(status = ASSET_LOG_ASSIGN,
+ type = "site")
+ ),
+ _class = "action-btn"
+ ),
+ A( T("Assign to Organization"),
+ _href = URL(f=func,
+ args = [record.id, "log", "create"],
+ vars = dict(status = ASSET_LOG_ASSIGN,
+ type = "organisation")
+ ),
+ _class = "action-btn"
+ ),
+ ]
+ asset_action_btns += [ A( T("Update Status"),
+ _href = URL(f=func,
+ args = [record.id, "log", "create"],
+ vars = None
+ ),
+ _class = "action-btn"
+ ),
+ ]
table = r.table
ltable = s3db.asset_log
View
9 modules/eden/hrm.py
@@ -127,6 +127,7 @@ def model(self):
#widget=S3OrganisationAutocompleteWidget(
# default_from_profile=True),
empty=False,
+ required = True,
script = SCRIPT('''
$(document).ready(function(){
S3FilterFieldChange({
@@ -3270,10 +3271,10 @@ def hrm_human_resource_onaccept(form):
ptable = s3db.pr_person
person_id = record.person_id
person = Storage(id = person_id)
- if setting.get_auth_person_realm_human_resource_org():
- # Set pr_person.realm_entity to the human_resource's organisation pe_id
- organisation_id = record.organisation_id
- entity = s3db.pr_get_pe_id("org_organisation", organisation_id)
+ if setting.get_auth_person_realm_human_resource_site():
+ # Set pr_person.realm_entity to the human_resource's site pe_id
+ site_id = record.site_id
+ entity = s3db.pr_get_pe_id("org_site", site_id)
if entity:
auth.set_realm_entity(ptable, person,
entity = entity,
View
16 modules/eden/menus.py
@@ -441,33 +441,23 @@ def asset(self):
M("Report", m="report"),
M("Import", m="import", p="create"),
),
- M("Items", c="supply", f="item")(
+ M("Items", f="item")(
M("New", m="create"),
M("List All"),
M("Search", m="search"),
M("Report", m="report"),
M("Import", m="import", p="create"),
),
- M("Catalogs", c="supply", f="catalog")(
- M("New", m="create"),
- M("List All"),
- #M("Search", m="search"),
- ),
- M("Item Categories", c="supply", f="item_category")(
+ M("Item Categories", f="item_category")(
M("New", m="create"),
M("List All"),
),
- M("Suppliers", c="inv", f="supplier")(
+ M("Suppliers", f="supplier")(
M("New", m="create"),
M("List All"),
M("Search", m="search"),
M("Import", m="import", p="create"),
),
- M("Facilities", c="inv", f="facility")(
- M("New", m="create"),
- M("List All"),
- #M("Search", m="search"),
- ),
)
# -------------------------------------------------------------------------
View
1 modules/s3/s3widgets.py
@@ -3480,6 +3480,7 @@ def s3_checkboxes_widget(field,
values = not isinstance(value, (list, tuple)) and [value] or value
values = [str(v) for v in values]
+ attributes["_name"] = "%s_widget" % field.name
if "_class" not in attributes:
attributes["_class"] = "s3-checkboxes-widget"
View
4 modules/s3cfg.py
@@ -228,12 +228,12 @@ def get_auth_record_approval_required_for(self):
def get_auth_realm_entity(self):
""" Hook to determine the owner entity of a record """
return self.auth.get("realm_entity", None)
- def get_auth_person_realm_human_resource_org(self):
+ def get_auth_person_realm_human_resource_site(self):
"""
Sets pr_person.realm_entity to
organisation.pe_id of hrm_human_resource
"""
- return self.auth.get("person_realm_human_resource_org", False)
+ return self.auth.get("person_realm_human_resource_site", False)
def get_auth_person_realm_member_org(self):
"""
Sets pr_person.realm_entity to
View
8 private/templates/IFRC/auth_roles.csv
@@ -162,11 +162,19 @@ project_reader,Project Reader,,pr,,,,READ,,,,,
project_reader,Project Reader,,hrm,person_search,,,READ,,,,,
project_data_entry,Project Data Entry,,project,,,,READ|CREATE,READ|CREATE|UPDATE,,,,
project_data_entry,Project Data Entry,,project,partner,,,READ,,,,,
+project_data_entry,Project Data Entry,,,,project_theme,,READ,,,,,
+project_data_entry,Project Data Entry,,,,project_hazard,,READ,,,,,
+project_data_entry,Project Data Entry,,,,project_activity_type,,READ,,,,,
+project_data_entry,Project Data Entry,,,,project_beneficiary_type,,READ,,,,,
project_data_entry,Project Data Entry,,org,,,,READ,,,,,Used to filter organisation fields
project_data_entry,Project Data Entry,,,,org_organisation,,READ|UPDATE,,,,,Used to filter organisation fields
project_data_entry,Project Data Entry,,pr,,,,READ,,,,,
project_data_entry,Project Data Entry,,hrm,person_search,,,READ,,,,,
project_editor,Project Editor,,project,,,,READ|CREATE|UPDATE,,,,,
+project_editor,Project Editor,,,,project_theme,,READ,,,,,
+project_editor,Project Editor,,,,project_hazard,,READ,,,,,
+project_editor,Project Editor,,,,project_activity_type,,READ,,,,,
+project_editor,Project Editor,,,,project_beneficiary_type,,READ,,,,,
project_editor,Project Editor,,org,,,,READ|CREATE|UPDATE,,,,,
project_editor,Project Editor,,pr,,,,READ,,,,,
project_editor,Project Editor,,hrm,person_search,,,READ,,,,,
View
3 private/templates/IFRC/config.py
@@ -48,7 +48,7 @@
settings.security.map = True
# Owner Entity
-settings.auth.person_realm_human_resource_org = True
+settings.auth.person_realm_human_resource_site = True
settings.auth.person_realm_member_org = True
def ifrc_realm_entity(table, row):
@@ -82,6 +82,7 @@ def ifrc_realm_entity(table, row):
pr_identity = "person_id",
pr_education = "person_id",
pr_note = "person_id",
+ hrm_human_resource = "site_id",
inv_recv = "site_id",
inv_recv_item = "req_id",
inv_track_item = "track_org_id",
View
2 private/templates/IFRC/project_theme.csv
@@ -43,7 +43,7 @@ Partnerships ,,,,,,,,
PASSA,,,,,,,Yes,
PMER development,,,,Yes,,,,
Private-Public Partnerships,"corporate social responsibility, private sector engagement in DRR",,,,,,,
-Programme planning and management ,,,,Yes,,,,
+Programme Planning and Management ,,,,Yes,,,,
Protecting Livelihoods,,,,,,Yes,,
Psychosocial Support,,Yes,,,,,,
Recovery,"building back better, long-term recovery and reconstruction, rehabilitation, shelter",,,,,,,
View
5 static/themes/default/widgets.css
@@ -863,9 +863,10 @@ ul.x-tree-root-ct {
margin-left: 2em;
}
-.search_select_letter_widget label,
-.s3-checkboxes-widget label {
+div.form-container form fieldset .search_select_letter_widget label,
+div.form-container form fieldset .s3-checkboxes-widget label {
white-space: nowrap;
+ text-align: left;
}
/* Checkboxes with title attributes */
/*

0 comments on commit d0deb01

Please sign in to comment.
Something went wrong with that request. Please try again.