Skip to content
This repository
Browse code

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

  • Loading branch information...
commit d0deb0165d56e1e16e74b092ed50400a5c657f3f 2 parents 9b64fe1 + 8c7c67e
Fran Boon authored October 08, 2012
4  controllers/asset.py
@@ -41,6 +41,10 @@ def asset():
41 41
     return s3db.asset_controller()
42 42
 
43 43
 # =============================================================================
  44
+def supplier():
  45
+    current.request.get_vars["organisation.organisation_type_id$name"] = "Supplier"
  46
+    return s3db.org_organisation_controller()
  47
+# =============================================================================
44 48
 def item():
45 49
     """ RESTful CRUD controller """
46 50
 
4  controllers/project.py
@@ -232,7 +232,7 @@ def postp(r, output):
232 232
             elif r.component_name == "beneficiary":
233 233
                     # Set the minimum end_date to the same as the start_date
234 234
                     s3.jquery_ready.append(
235  
-'''S3.start_end_date('project_beneficiary_start_date','project_beneficiary_end_date')''')
  235
+'''S3.start_end_date('project_beneficiary_date','project_beneficiary_end_date')''')
236 236
         return output
237 237
     s3.postp = postp
238 238
 
@@ -458,7 +458,7 @@ def location():
458 458
     def prep(r):
459 459
         if r.interactive:
460 460
             if r.record and r.record.project_id:
461  
-                sector_ids = ptable[r.record.project_id].sector_id
  461
+                sector_ids = s3db.project_project[r.record.project_id].sector_id
462 462
             else:
463 463
                 sector_ids = []
464 464
             set_project_multi_activity_type_id_requires(sector_ids)
96  modules/eden/asset.py
@@ -647,6 +647,8 @@ def asset_log_onaccept(form):
647 647
             atable = s3db.asset_asset
648 648
             tracker = S3Tracker()
649 649
             asset_tracker = tracker(atable, asset_id)
  650
+            
  651
+            thistime = request.now
650 652
 
651 653
             if status == ASSET_LOG_SET_BASE:
652 654
                 # Set Base Location
@@ -892,54 +894,54 @@ def asset_rheader(r):
892 894
             current_log = asset_get_current_log(record.id)
893 895
             status = current_log.status
894 896
 
895  
-            if record.location_id:
896  
-                # A Base Site has been set
897  
-                # Return functionality removed  - as it doesn't set site_id & organisation_id in the logs
898  
-                #if status == ASSET_LOG_ASSIGN:
899  
-                #    asset_action_btns += [ A( T("Return"),
900  
-                #                              _href = URL(f=func,
901  
-                #                                          args = [record.id, "log", "create"],
902  
-                #                                          vars = dict(status = ASSET_LOG_RETURN)
903  
-                #                                        ),
904  
-                #                              _class = "action-btn"
905  
-                #                            )
906  
-                #                           ]
907  
-                if status < ASSET_LOG_DONATED:
908  
-                    # @ToDo: deployment setting to prevent assigning assets before returning them
909  
-                    # The Asset is available for assignment (not disposed)
910  
-                    asset_action_btns += [ A( T("Assign to Person"),
911  
-                                              _href = URL(f=func,
912  
-                                                          args = [record.id, "log", "create"],
913  
-                                                          vars = dict(status = ASSET_LOG_ASSIGN,
914  
-                                                                      type = "person")
915  
-                                                        ),
916  
-                                              _class = "action-btn"
917  
-                                            ),
918  
-                                          A( T("Assign to Facility/Site"),
919  
-                                              _href = URL(f=func,
920  
-                                                          args = [record.id, "log", "create"],
921  
-                                                          vars = dict(status = ASSET_LOG_ASSIGN,
922  
-                                                                      type = "site")
923  
-                                                        ),
924  
-                                              _class = "action-btn"
925  
-                                            ),
926  
-                                          A( T("Assign to Organization"),
927  
-                                             _href = URL(f=func,
928  
-                                                         args = [record.id, "log", "create"],
929  
-                                                         vars = dict(status = ASSET_LOG_ASSIGN,
930  
-                                                                     type = "organisation")
931  
-                                                        ),
932  
-                                             _class = "action-btn"
933  
-                                           ),
934  
-                                        ]
935  
-                asset_action_btns += [  A( T("Update Status"),
936  
-                                           _href = URL(f=func,
937  
-                                                       args = [record.id, "log", "create"],
938  
-                                                       vars = None
  897
+            #if record.location_id:
  898
+            # A Base Site has been set
  899
+            # Return functionality removed  - as it doesn't set site_id & organisation_id in the logs
  900
+            #if status == ASSET_LOG_ASSIGN:
  901
+            #    asset_action_btns += [ A( T("Return"),
  902
+            #                              _href = URL(f=func,
  903
+            #                                          args = [record.id, "log", "create"],
  904
+            #                                          vars = dict(status = ASSET_LOG_RETURN)
  905
+            #                                        ),
  906
+            #                              _class = "action-btn"
  907
+            #                            )
  908
+            #                           ]
  909
+            if status < ASSET_LOG_DONATED:
  910
+                # @ToDo: deployment setting to prevent assigning assets before returning them
  911
+                # The Asset is available for assignment (not disposed)
  912
+                asset_action_btns += [ A( T("Assign to Person"),
  913
+                                          _href = URL(f=func,
  914
+                                                      args = [record.id, "log", "create"],
  915
+                                                      vars = dict(status = ASSET_LOG_ASSIGN,
  916
+                                                                  type = "person")
939 917
                                                     ),
940  
-                                           _class = "action-btn"
941  
-                                         ),
942  
-                                      ]
  918
+                                          _class = "action-btn"
  919
+                                        ),
  920
+                                      A( T("Assign to Facility/Site"),
  921
+                                          _href = URL(f=func,
  922
+                                                      args = [record.id, "log", "create"],
  923
+                                                      vars = dict(status = ASSET_LOG_ASSIGN,
  924
+                                                                  type = "site")
  925
+                                                    ),
  926
+                                          _class = "action-btn"
  927
+                                        ),
  928
+                                      A( T("Assign to Organization"),
  929
+                                         _href = URL(f=func,
  930
+                                                     args = [record.id, "log", "create"],
  931
+                                                     vars = dict(status = ASSET_LOG_ASSIGN,
  932
+                                                                 type = "organisation")
  933
+                                                    ),
  934
+                                         _class = "action-btn"
  935
+                                       ),
  936
+                                    ]
  937
+            asset_action_btns += [  A( T("Update Status"),
  938
+                                       _href = URL(f=func,
  939
+                                                   args = [record.id, "log", "create"],
  940
+                                                   vars = None
  941
+                                                ),
  942
+                                       _class = "action-btn"
  943
+                                     ),
  944
+                                  ]
943 945
 
944 946
             table = r.table
945 947
             ltable = s3db.asset_log
9  modules/eden/hrm.py
@@ -127,6 +127,7 @@ def model(self):
127 127
                                     #widget=S3OrganisationAutocompleteWidget(
128 128
                                     #    default_from_profile=True),
129 129
                                     empty=False,
  130
+                                    required = True,
130 131
                                     script = SCRIPT('''
131 132
 $(document).ready(function(){
132 133
  S3FilterFieldChange({
@@ -3270,10 +3271,10 @@ def hrm_human_resource_onaccept(form):
3270 3271
     ptable = s3db.pr_person
3271 3272
     person_id = record.person_id
3272 3273
     person = Storage(id = person_id)
3273  
-    if setting.get_auth_person_realm_human_resource_org():
3274  
-        # Set pr_person.realm_entity to the human_resource's organisation pe_id
3275  
-        organisation_id = record.organisation_id
3276  
-        entity = s3db.pr_get_pe_id("org_organisation", organisation_id)
  3274
+    if setting.get_auth_person_realm_human_resource_site():
  3275
+        # Set pr_person.realm_entity to the human_resource's site pe_id
  3276
+        site_id = record.site_id
  3277
+        entity = s3db.pr_get_pe_id("org_site", site_id)
3277 3278
         if entity:
3278 3279
             auth.set_realm_entity(ptable, person,
3279 3280
                                   entity = entity,
16  modules/eden/menus.py
@@ -441,33 +441,23 @@ def asset(self):
441 441
                         M("Report", m="report"),
442 442
                         M("Import", m="import", p="create"),
443 443
                     ),
444  
-                    M("Items", c="supply", f="item")(
  444
+                    M("Items", f="item")(
445 445
                         M("New", m="create"),
446 446
                         M("List All"),
447 447
                         M("Search", m="search"),
448 448
                         M("Report", m="report"),
449 449
                         M("Import", m="import", p="create"),
450 450
                     ),
451  
-                    M("Catalogs", c="supply", f="catalog")(
452  
-                        M("New", m="create"),
453  
-                        M("List All"),
454  
-                        #M("Search", m="search"),
455  
-                    ),
456  
-                    M("Item Categories", c="supply", f="item_category")(
  451
+                    M("Item Categories", f="item_category")(
457 452
                         M("New", m="create"),
458 453
                         M("List All"),
459 454
                     ),
460  
-                    M("Suppliers", c="inv", f="supplier")(
  455
+                    M("Suppliers", f="supplier")(
461 456
                         M("New", m="create"),
462 457
                         M("List All"),
463 458
                         M("Search", m="search"),
464 459
                         M("Import", m="import", p="create"),
465 460
                     ),
466  
-                    M("Facilities", c="inv", f="facility")(
467  
-                        M("New", m="create"),
468  
-                        M("List All"),
469  
-                        #M("Search", m="search"),
470  
-                    ),
471 461
                 )
472 462
 
473 463
     # -------------------------------------------------------------------------
1  modules/s3/s3widgets.py
@@ -3480,6 +3480,7 @@ def s3_checkboxes_widget(field,
3480 3480
     values = not isinstance(value, (list, tuple)) and [value] or value
3481 3481
     values = [str(v) for v in values]
3482 3482
 
  3483
+    attributes["_name"] = "%s_widget" % field.name
3483 3484
     if "_class" not in attributes:
3484 3485
         attributes["_class"] = "s3-checkboxes-widget"
3485 3486
 
4  modules/s3cfg.py
@@ -228,12 +228,12 @@ def get_auth_record_approval_required_for(self):
228 228
     def get_auth_realm_entity(self):
229 229
         """ Hook to determine the owner entity of a record """
230 230
         return self.auth.get("realm_entity", None)
231  
-    def get_auth_person_realm_human_resource_org(self):
  231
+    def get_auth_person_realm_human_resource_site(self):
232 232
         """
233 233
             Sets pr_person.realm_entity to
234 234
             organisation.pe_id of hrm_human_resource
235 235
         """
236  
-        return self.auth.get("person_realm_human_resource_org", False)
  236
+        return self.auth.get("person_realm_human_resource_site", False)
237 237
     def get_auth_person_realm_member_org(self):
238 238
         """
239 239
             Sets pr_person.realm_entity to
8  private/templates/IFRC/auth_roles.csv
@@ -162,11 +162,19 @@ project_reader,Project Reader,,pr,,,,READ,,,,,
162 162
 project_reader,Project Reader,,hrm,person_search,,,READ,,,,,
163 163
 project_data_entry,Project Data Entry,,project,,,,READ|CREATE,READ|CREATE|UPDATE,,,,
164 164
 project_data_entry,Project Data Entry,,project,partner,,,READ,,,,,
  165
+project_data_entry,Project Data Entry,,,,project_theme,,READ,,,,,
  166
+project_data_entry,Project Data Entry,,,,project_hazard,,READ,,,,,
  167
+project_data_entry,Project Data Entry,,,,project_activity_type,,READ,,,,,
  168
+project_data_entry,Project Data Entry,,,,project_beneficiary_type,,READ,,,,,
165 169
 project_data_entry,Project Data Entry,,org,,,,READ,,,,,Used to filter organisation fields
166 170
 project_data_entry,Project Data Entry,,,,org_organisation,,READ|UPDATE,,,,,Used to filter organisation fields
167 171
 project_data_entry,Project Data Entry,,pr,,,,READ,,,,,
168 172
 project_data_entry,Project Data Entry,,hrm,person_search,,,READ,,,,,
169 173
 project_editor,Project Editor,,project,,,,READ|CREATE|UPDATE,,,,,
  174
+project_editor,Project Editor,,,,project_theme,,READ,,,,,
  175
+project_editor,Project Editor,,,,project_hazard,,READ,,,,,
  176
+project_editor,Project Editor,,,,project_activity_type,,READ,,,,,
  177
+project_editor,Project Editor,,,,project_beneficiary_type,,READ,,,,,
170 178
 project_editor,Project Editor,,org,,,,READ|CREATE|UPDATE,,,,,
171 179
 project_editor,Project Editor,,pr,,,,READ,,,,,
172 180
 project_editor,Project Editor,,hrm,person_search,,,READ,,,,,
3  private/templates/IFRC/config.py
@@ -48,7 +48,7 @@
48 48
 settings.security.map = True
49 49
 
50 50
 # Owner Entity
51  
-settings.auth.person_realm_human_resource_org = True
  51
+settings.auth.person_realm_human_resource_site = True
52 52
 settings.auth.person_realm_member_org = True
53 53
 
54 54
 def ifrc_realm_entity(table, row):
@@ -82,6 +82,7 @@ def ifrc_realm_entity(table, row):
82 82
                             pr_identity = "person_id",
83 83
                             pr_education = "person_id",
84 84
                             pr_note = "person_id",
  85
+                            hrm_human_resource = "site_id",
85 86
                             inv_recv = "site_id",
86 87
                             inv_recv_item = "req_id",
87 88
                             inv_track_item = "track_org_id",
2  private/templates/IFRC/project_theme.csv
@@ -43,7 +43,7 @@ Partnerships ,,,,,,,,
43 43
 PASSA,,,,,,,Yes,
44 44
 PMER development,,,,Yes,,,,
45 45
 Private-Public Partnerships,"corporate social responsibility, private sector engagement in DRR",,,,,,,
46  
-Programme planning and management ,,,,Yes,,,,
  46
+Programme Planning and Management ,,,,Yes,,,,
47 47
 Protecting Livelihoods,,,,,,Yes,,
48 48
 Psychosocial Support,,Yes,,,,,,
49 49
 Recovery,"building back better, long-term recovery and reconstruction, rehabilitation, shelter",,,,,,,
5  static/themes/default/widgets.css
@@ -863,9 +863,10 @@ ul.x-tree-root-ct {
863 863
     margin-left: 2em;
864 864
 }
865 865
 
866  
-.search_select_letter_widget label,
867  
-.s3-checkboxes-widget label {
  866
+div.form-container form fieldset .search_select_letter_widget label,
  867
+div.form-container form fieldset  .s3-checkboxes-widget label {
868 868
     white-space: nowrap;
  869
+    text-align: left;
869 870
 }
870 871
 /* Checkboxes with title attributes */
871 872
 /*

0 notes on commit d0deb01

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