Skip to content

Commit

Permalink
Organisation Type can be Multiple & Hierarchical
Browse files Browse the repository at this point in the history
Tweak CRUD Strings for consistency (& their translations)
S3SQLInlineLink reads field.default & field.writable
  • Loading branch information
flavour committed Jun 26, 2014
1 parent 2c23922 commit 682c6da
Show file tree
Hide file tree
Showing 48 changed files with 1,153 additions and 977 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
54ac923 (2014-06-25 17:52:43)
2c23922 (2014-06-26 17:49:36)
32 changes: 16 additions & 16 deletions controllers/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def catalog():
""" RESTful CRUD controller """

return s3_rest_controller("supply", "catalog",
rheader=s3db.supply_catalog_rheader)
rheader = s3db.supply_catalog_rheader,
)

# -----------------------------------------------------------------------------
def item():
Expand Down Expand Up @@ -91,8 +92,8 @@ def catalog_item():
"""

return s3_rest_controller("supply", "catalog_item",
csv_template=("supply", "catalog_item"),
csv_stylesheet=("supply", "catalog_item.xsl"),
csv_template = ("supply", "catalog_item"),
csv_stylesheet = ("supply", "catalog_item.xsl"),
)

# -----------------------------------------------------------------------------
Expand All @@ -115,25 +116,24 @@ def item_category():
def supplier():
""" RESTful CRUD controller """

get_vars["organisation.organisation_type_id$name"] = "Supplier"
get_vars["organisation_type.name"] = "Supplier"

# Load model
table = s3db.org_organisation

# Modify CRUD Strings
ADD_SUPPLIER = T("Add Supplier")
s3.crud_strings.org_organisation = Storage(
label_create=ADD_SUPPLIER,
title_display=T("Supplier Details"),
title_list=T("Suppliers"),
title_update=T("Edit Supplier"),
title_upload=T("Import Suppliers"),
label_list_button=T("List Suppliers"),
label_delete_button=T("Delete Supplier"),
msg_record_created=T("Supplier added"),
msg_record_modified=T("Supplier updated"),
msg_record_deleted=T("Supplier deleted"),
msg_list_empty=T("No Suppliers currently registered")
label_create = T("Create Supplier"),
title_display = T("Supplier Details"),
title_list = T("Suppliers"),
title_update = T("Edit Supplier"),
title_upload = T("Import Suppliers"),
label_list_button = T("List Suppliers"),
label_delete_button = T("Delete Supplier"),
msg_record_created = T("Supplier added"),
msg_record_modified = T("Supplier updated"),
msg_record_deleted = T("Supplier deleted"),
msg_list_empty = T("No Suppliers currently registered")
)

# Modify filter_widgets
Expand Down
29 changes: 14 additions & 15 deletions controllers/inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,25 +396,24 @@ def supplier():
Filtered version of the organisation() REST controller
"""

get_vars["organisation.organisation_type_id$name"] = "Supplier"
get_vars["organisation_type.name"] = "Supplier"

# Load model
table = s3db.org_organisation

# Modify CRUD Strings
ADD_SUPPLIER = T("Add Supplier")
s3.crud_strings.org_organisation = Storage(
label_create=ADD_SUPPLIER,
title_display=T("Supplier Details"),
title_list=T("Suppliers"),
title_update=T("Edit Supplier"),
title_upload=T("Import Suppliers"),
label_list_button=T("List Suppliers"),
label_delete_button=T("Delete Supplier"),
msg_record_created=T("Supplier added"),
msg_record_modified=T("Supplier updated"),
msg_record_deleted=T("Supplier deleted"),
msg_list_empty=T("No Suppliers currently registered")
label_create = T("Create Supplier"),
title_display = T("Supplier Details"),
title_list = T("Suppliers"),
title_update = T("Edit Supplier"),
title_upload = T("Import Suppliers"),
label_list_button = T("List Suppliers"),
label_delete_button = T("Delete Supplier"),
msg_record_created = T("Supplier added"),
msg_record_modified = T("Supplier updated"),
msg_record_deleted = T("Supplier deleted"),
msg_list_empty = T("No Suppliers currently registered")
)

# Modify filter_widgets
Expand Down Expand Up @@ -1050,7 +1049,7 @@ def prep(r):
listadd = False,
)

output = s3_rest_controller(rheader=s3db.inv_recv_rheader)
output = s3_rest_controller(rheader = s3db.inv_recv_rheader)
return output

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -1418,7 +1417,7 @@ def track_item():
)
s3.filter = (FS("expiry_date") != None)

output = s3_rest_controller(rheader=s3db.inv_rheader)
output = s3_rest_controller(rheader = s3db.inv_rheader)
return output

# =============================================================================
Expand Down
25 changes: 12 additions & 13 deletions controllers/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,26 +724,25 @@ def partners():
"""

# @ToDo: This could need to be a deployment setting
get_vars["organisation.organisation_type_id$name"] = \
get_vars["organisation_type.name"] = \
"Academic,Bilateral,Government,Intergovernmental,NGO,UN agency"

# Load model
table = s3db.org_organisation

# Modify CRUD Strings
ADD_PARTNER = T("Add Partner Organization")
s3.crud_strings.org_organisation = Storage(
label_create=ADD_PARTNER,
title_display=T("Partner Organization Details"),
title_list=T("Partner Organizations"),
title_update=T("Edit Partner Organization"),
title_upload=T("Import Partner Organizations"),
label_list_button=T("List Partner Organizations"),
label_delete_button=T("Delete Partner Organization"),
msg_record_created=T("Partner Organization added"),
msg_record_modified=T("Partner Organization updated"),
msg_record_deleted=T("Partner Organization deleted"),
msg_list_empty=T("No Partner Organizations currently registered")
label_create = T("Create Partner Organization"),
title_display = T("Partner Organization Details"),
title_list = T("Partner Organizations"),
title_update = T("Edit Partner Organization"),
title_upload = T("Import Partner Organizations"),
label_list_button = T("List Partner Organizations"),
label_delete_button = T("Delete Partner Organization"),
msg_record_created = T("Partner Organization added"),
msg_record_modified = T("Partner Organization updated"),
msg_record_deleted = T("Partner Organization deleted"),
msg_list_empty = T("No Partner Organizations currently registered")
)

return s3db.org_organisation_controller()
Expand Down
5 changes: 2 additions & 3 deletions languages/bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@
'Add New Scenario': 'Dodaj novi scenarij',
'Add New School District': 'Dodaj novi školski rejon',
'Add New School Report': 'Dodaj novi izvještaj o školama',
'Add New Sector': 'Dodaj novi sektor',
'Add New Sent Item': 'Dodaj novu poslanu stavku',
'Add New Setting': 'Dodaj novu postavku',
'Add New Shelter': 'Dodaj novo sklonište',
Expand Down Expand Up @@ -489,7 +488,6 @@
'Add Organization to Project': 'Dodaj organizaciju projektu',
'Add Participant': 'Dodaj učesnika',
'Add Partner': 'Dodaj partnera',
'Add Partner Organization': 'Dodaj partnersku organizaciju',
'Add Peer': 'Dodaj saradnika',
'Add People to Commitment': 'Dodaj ljude u zaduženje',
'Add Person': 'Dodaj osobu',
Expand Down Expand Up @@ -561,7 +559,6 @@
'Add Sub-Category': 'Traži potkategoriju',
'Add Subscription': 'Dodaj pretplatu',
'Add Subsector': 'Dodaj podsektor',
'Add Supplier': 'Dodaj dobavljača',
'Add Survey Answer': 'Dodaj odgovor na istraživanje',
'Add Survey Question': 'Dodajte anketno pitanje',
'Add Survey Section': 'Dodajte anketnu sekciju',
Expand Down Expand Up @@ -1725,6 +1722,7 @@
'Create Office Type': 'Kreiraj tip kancelarije',
'Create Organization': 'Kreiraj organizaciju',
'Create Organization Type': 'Kreiraj tip organizacije',
'Create Partner Organization': 'Kreiraj partnersku organizaciju',
'Create Personal Effects': 'Kreiraj lične uticaja',
'Create PoI Type': 'Kreiraj tačku interesa',
'Create Point of Interest': 'Kreiraj tačku interesa',
Expand Down Expand Up @@ -1756,6 +1754,7 @@
'Create Staff Member': 'Kreiraj člana osoblja',
'Create Status': 'Kreiraj status',
'Create Status Report': 'Kreiraj statusni izvještaj',
'Create Supplier': 'Kreiraj dobavljača',
'Create Symbology': 'Kreiraj značenje simbola',
'Create Tag': 'Kreiraj oznaku',
'Create Task': 'Kreiraj zadatak',
Expand Down
3 changes: 1 addition & 2 deletions languages/en-gb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
'Add New Program': 'Add New Programme',
'Add Organization Domain': 'Add Organisation Domain',
'Add Organization to Project': 'Add Organisation to Project',
'Add Partner Organization': 'Add Partner Organisation',
'Add Partner Organizations': 'Add Partner Organisations',
'Add Program Hours': 'Add Programme Hours',
'Canceled': 'Cancelled',
'Cannot make an Organization a branch of itself!': 'Cannot make an Organisation a branch of itself!',
Expand All @@ -39,6 +37,7 @@
'Create Catalog Item': 'Create Catalogue Item',
'Create Organization': 'Create Organisation',
'Create Organization Type': 'Create Organisation Type',
'Create Partner Organization': 'Create Partner Organisation',
'Create Program': 'Create Programme',
'Credentialling Organization': 'Credentialling Organisation',
'Current Owned By (Organization/Branch)': 'Current Owned By (Organisation/Branch)',
Expand Down
3 changes: 2 additions & 1 deletion languages/km.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
'Add Organization to Activity': 'បន្ថែម​សកម្មភាព​របស់​អង្គការ',
'Add Organization to Project': 'បន្ថែម​អង្គការ​ទៅ​គម្រោង',
'Add Participant': 'បន្ថែម​អ្នក​ចូលរួម',
'Add Partner Organization': 'បន្ថែម​អង្គការ​ដៃគូរ',
'Add Person': 'បន្ថែម​មនុស្ស',
'Add Point': 'បន្ថែម​ចំណុច',
'Add Polygon': 'បន្ថែម​ពហុកោណថ្មី',
Expand All @@ -217,6 +216,7 @@
'Add Region': 'បន្ថែម​តំបន់',
'Add Resource Type': 'បន្ថែម​ប្រភេទ​ធនធាន',
'Add Response Summary': 'បន្ថែមការសង្ខេប​អំពី​ចម្លើយ​តប',
'Add Sector': 'បន្ថែម​ផ្នែក',
'Add Sector to Organization': 'បន្ថែមផ្នែកទៅ​អង្គការ',
'Add Sector to Project': 'បន្ថែម​ផ្នែក​​ទៅ​គម្រោង',
'Add Sector to Theme': 'បន្ថែម​ផ្នែក​ទៅ​ស្បែក',
Expand Down Expand Up @@ -591,6 +591,7 @@
'Create Office': 'បន្ថែម​ការិយាល័យ',
'Create Organization Type': 'បន្ថែម​ប្រភេទ​អង្គការ',
'Create Organization': 'បន្ថែម​អង្គការ',
'Create Partner Organization': 'បន្ថែម​អង្គការ​ដៃគូរ',
'Create PoI Type': 'បន្ថែម​ប្រភេទ PoI',
'Create Point of Interest': 'បន្ថែម​ចំណុច​ចាប់អារម្មណ៍​ថ្មី',
'Create Policy or Strategy': 'បន្ថែម​គោលនយោបាយ ឬ​យុទ្ធសាស្ត្រ',
Expand Down
2 changes: 1 addition & 1 deletion languages/ne.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@
'Add Organization to Activity': 'कृयाकलापको बनावट राख्नुहोस्',
'Add Organization to Project': 'परियोजनामा संस्था राख्नुहोस्',
'Add Participant': 'सहभागी राख्नुहोस्',
'Add Partner Organization': 'सहकारी संस्था राख्नुहोस्',
'Add Person': 'ब्यक्ति राख्नुहोस्',
"Add Person's Details": 'ब्यक्तिको विवरण राख्नुहोस्',
'Add PoI Type': 'पोलको प्रकार राख्नुहोस्',
Expand Down Expand Up @@ -622,6 +621,7 @@
'Create Network': 'नेटवर्क राख्नुहोस् ',
'Create Office Type': 'कार्यलयको प्रकार राख्नुहोस्',
'Create Organization Type': 'संस्थाको प्रकार राख्नुहोस्',
'Create Partner Organization': 'सहकारी संस्था राख्नुहोस्',
'Create Program': 'कार्यक्रम',
'Create Project': 'परियोजना राख्नुहोस्',
'Create Projection': 'योजना राख्नुहोस्',
Expand Down
2 changes: 1 addition & 1 deletion languages/prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
'Add Organization to Activity': 'سازمان فعالیت را اضافه کنید',
'Add Organization to Project': 'پروژه موسسه را اضافه نمایید',
'Add Participant': 'شریک را اضافه نمایید',
'Add Partner Organization': 'همکار موسسه را اضافه نمایید',
'Add Person': 'شخص را اضافه نمایید',
"Add Person's Details": 'مشخصات شخص را اضافه نمایید',
'Add PoI Type': 'نوع POL را اضافه نمایید',
Expand Down Expand Up @@ -618,6 +617,7 @@
'Create Network': 'شبکه را اضافه نمایید',
'Create Office Type': 'نوع اداره را اضافه نمایید',
'Create Organization Type': 'نوع موسسه را اضافه نمایید',
'Create Partner Organization': 'همکار موسسه را اضافه نمایید',
'Create Program': 'برنامه را اضافه نمایید',
'Create Project': 'پروژه را اضافه نمایید',
'Create Projection': 'تصویر را اضافه نمایید',
Expand Down
2 changes: 1 addition & 1 deletion languages/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
'Add Organization to Activity': 'اضافه کړی د فعالیت موسسه',
'Add Organization to Project': 'اضافه کړی موسسه پروژی ته',
'Add Participant': 'اضافه کړی ګډونوال',
'Add Partner Organization': 'اضافه کړی همکاره موسسی',
'Add Person': 'اضافه کړی کسان',
"Add Person's Details": 'اضافه کړی د کسانو معلومات',
'Add PoI Type': 'اضافه کړی د پل (pol ) بڼه',
Expand Down Expand Up @@ -619,6 +618,7 @@
'Create Network': 'اضافه کړی شبکه',
'Create Office Type': 'اضافه کړی د دفتر بڼه',
'Create Organization Type': 'اضافه کړی د موسسی بڼه',
'Create Partner Organization': 'اضافه کړی همکاره موسسی',
'Create Program': 'اضافه کړی پروګرام',
'Create Project': 'اضافه کړی پروژه ',
'Create Projection': 'اضافه کړی نقشه',
Expand Down
6 changes: 2 additions & 4 deletions languages/vi.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@
'Add Organization to Project': 'Thêm tổ chức tham gia dự án',
'Add Parser Settings': 'Thêm cài đặt cú pháp',
'Add Participant': 'Thêm người tham dự',
'Add Partner Organization': 'Thêm tổ chức đối tác',
'Add Partner Organizations': 'Thêm tổ chức đối tác',
'Add Person to Commitment': 'Thêm đối tượng cam kết',
'Add Person': 'Thêm họ tên',
'Add Photo': 'Thêm ảnh',
Expand Down Expand Up @@ -314,8 +312,6 @@
'Add Storage Location ': 'Thêm vị trí lưu trữ',
'Add Storage Location': 'Thêm vị trí lưu trữ',
'Add Sub-Category': 'Thêm danh mục cấp dưới',
'Add Supplier': 'Thêm nhà cung cấp',
'Add Suppliers': 'Thêm nhà cung cấp',
'Add Survey Answer': 'Thêm trả lời khảo sát',
'Add Survey Question': 'Thêm câu hỏi khảo sát',
'Add Survey Section': 'Thêm phần Khảo sát',
Expand Down Expand Up @@ -934,6 +930,7 @@
'Create Office': 'Thêm văn phòng',
'Create Organization Type': 'Thêm loại hình tổ chức',
'Create Organization': 'Thêm tổ chức',
'Create Partner Organization': 'Thêm tổ chức đối tác',
'Create PDF': 'Tạo PDF',
'Create Program': 'Thêm chương trình',
'Create Project': 'Thêm dự án',
Expand All @@ -950,6 +947,7 @@
'Create Skill': 'Thêm kỹ năng',
'Create Staff Member': 'Thêm cán bộ',
'Create Status': 'Thêm trạng thái',
'Create Supplier': 'Thêm nhà cung cấp',
'Create Symbology': 'Thêm biểu tượng',
'Create Task': 'Thêm nhiệm vụ',
'Create Team': 'Tạo đội TNV',
Expand Down
3 changes: 1 addition & 2 deletions modules/s3/s3filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from gluon.contrib.simplejson.ordered_dict import OrderedDict

from gluon import *
from gluon.sqlhtml import MultipleOptionsWidget
from gluon.storage import Storage
from gluon.tools import callback

Expand Down Expand Up @@ -1772,7 +1771,7 @@ def variable(self, resource, get_vars=None):
return variable

# Detect and resolve __typeof queries
BELONGS = current.db._adapter.BELONGS
#BELONGS = current.db._adapter.BELONGS
resolve = S3ResourceQuery._resolve_hierarchy
selector = resource.prefix_selector(selector)
for key, value in get_vars.items():
Expand Down
Loading

0 comments on commit 682c6da

Please sign in to comment.