Permalink
Browse files

HRM Department moved to organisation-restricted table, Make the Site …

…Label a deployment_setting, Optimise auth.define_tables(), Reduce the number of T's in templates, Fix Office/Warehouse L4 import
  • Loading branch information...
1 parent d21731f commit 677c40a5e10a4f353db041c52ee0a1a988df288b @flavour flavour committed Oct 9, 2012
View
@@ -1 +1 @@
-d532d89 (2012-10-08 19:56:20)
+d21731f (2012-10-09 12:25:13)
View
@@ -143,7 +143,7 @@ def prep(r):
table = r.table
table.site_id.comment = DIV(DIV(_class="tooltip",
- _title="%s|%s|%s" % (T("Office/Warehouse/Facility"),
+ _title="%s|%s|%s" % (settings.get_org_site_label(),
T("The facility where this position is based."),
T("Enter some characters to bring up a list of possible matches."))))
table.status.writable = False
@@ -693,6 +693,19 @@ def postp(r, output):
# =============================================================================
# Jobs
# =============================================================================
+def department():
+ """ Departments Controller """
+
+ mode = session.s3.hrm.mode
+ def prep(r):
+ if mode is not None:
+ r.error(403, message=auth.permission.INSUFFICIENT_PRIVILEGES)
+ return True
+ s3.prep = prep
+
+ output = s3_rest_controller()
+ return output
+
def job_role():
""" Job Roles Controller """
View
@@ -709,6 +709,19 @@ def postp(r, output):
# =============================================================================
# Jobs
# =============================================================================
+def department():
+ """ Departments Controller """
+
+ mode = session.s3.hrm.mode
+ def prep(r):
+ if mode is not None:
+ r.error(403, message=auth.permission.INSUFFICIENT_PRIVILEGES)
+ return True
+ s3.prep = prep
+
+ output = s3_rest_controller()
+ return output
+
def job_role():
""" Job Roles Controller """
View
@@ -39,6 +39,7 @@
'Delete Organization': 'Delete Organisation',
'Delete Organization Domain': 'Delete Organisation Domain',
'Delete Organization Type': 'Delete Organisation Type',
+'Department Catalog': 'Department Catalogue',
'Edit Catalog': 'Edit Catalogue',
'Edit Catalog Item': 'Edit Catalogue Item',
'Edit Organization': 'Edit Organisation',
View
@@ -214,12 +214,12 @@
%(email)s""")
_messages["confirmation_email_subject"] = "%s %s" % (settings.get_system_name(),
- T("access granted"))
+ T("access granted"))
_messages["confirmation_email"] = "%s %s %s %s. %s." % (T("Welcome to the"),
- settings.get_system_name(),
- T("Portal at"),
- s3.base_url,
- T("Thanks for your assistance"))
+ settings.get_system_name(),
+ T("Portal at"),
+ s3.base_url,
+ T("Thanks for your assistance"))
# We don't wish to clutter the groups list with 1 per user.
_settings.create_user_groups = False
@@ -229,19 +229,16 @@
_settings.logout_onlogout = s3_auth_on_logout
_settings.login_onaccept = s3_auth_on_login
_settings.login_next = settings.get_auth_login_next()
-if settings.get_auth_registration_volunteer() and \
- settings.has_module("vol"):
+if settings.has_module("vol") and \
+ settings.get_auth_registration_volunteer():
_settings.register_next = URL(c="vol", f="person")
-# Default Language for authenticated users
-_settings.table_user.language.default = settings.get_L10n_default_language()
-
# Languages available in User Profiles
-field = _settings.table_user.language
if len(s3.l10n_languages) > 1:
- field.requires = IS_IN_SET(s3.l10n_languages,
- zero=None)
+ _settings.table_user.language.requires = IS_IN_SET(s3.l10n_languages,
+ zero=None)
else:
+ field = _settings.table_user.language
field.default = s3.l10n_languages.keys()[0]
field.readable = False
field.writable = False
View
@@ -49,8 +49,8 @@
# To pass to global scope
asset_types = {
"VEHICLE" : ASSET_TYPE_VEHICLE,
- "RADIO" : ASSET_TYPE_RADIO,
- "TELEPHONE" : ASSET_TYPE_TELEPHONE,
+ "RADIO" : ASSET_TYPE_RADIO,
+ "TELEPHONE" : ASSET_TYPE_TELEPHONE,
"OTHER" : ASSET_TYPE_OTHER,
}
@@ -104,7 +104,9 @@ def model(self):
UNKNOWN_OPT = current.messages.UNKNOWN_OPT
- vehicle = current.deployment_settings.has_module("vehicle")
+ settings = current.deployment_settings
+ org_site_label = settings.get_org_site_label()
+ vehicle = settings.has_module("vehicle")
# Shortcuts
add_component = self.add_component
@@ -169,7 +171,7 @@ def model(self):
# This is a component, so needs to be a super_link
# - can't override field name, ondelete or requires
super_link("site_id", "org_site",
- label = T("Office/Warehouse/Facility"),
+ label = org_site_label,
default = auth.user.site_id if auth.is_logged_in() else None,
readable = True,
writable = True,
@@ -288,7 +290,7 @@ def model(self):
"number",
(T("Category"), "item_id$item_category_id"),
(T("Item"), "item_id"),
- (T("Office/Warehouse/Facility"), "site"),
+ (org_site_label, "site"),
"L1",
"L2",
]
@@ -366,7 +368,7 @@ def model(self):
# Asset Log
#
- asset_log_status_opts = {ASSET_LOG_SET_BASE : T("Base Office/Warehouse/Facility Set"),
+ asset_log_status_opts = {ASSET_LOG_SET_BASE : T("Base %(facility)s Set") % org_site_label,
ASSET_LOG_ASSIGN : T("Assigned"),
ASSET_LOG_RETURN : T("Returned"),
ASSET_LOG_CHECK : T("Checked"),
@@ -431,7 +433,7 @@ def model(self):
# This is a component, so needs to be a super_link
# - can't override field name, ondelete or requires
super_link("site_id", "org_site",
- label = T("Warehouse/Facility/Office"),
+ label = org_site_label,
#filterby = "site_id",
#filter_opts = auth.permitted_facilities(redirect_on_error=False),
instance_types = auth.org_site_types,
Oops, something went wrong.

0 comments on commit 677c40a

Please sign in to comment.