~chamindra/sahana-eden/frp3

« back to all changes in this revision

Viewing changes to controllers/gis.py

  • Committer: nursix.org
  • Date: 2010-02-15 00:36:02 UTC
  • mfrom: (609.1.1 frp)
  • Revision ID: dominic@nursix.org-20100215003602-22zwuwsifq47tn2l
Merge chamindra: Feature Class => Location Type

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
    db[table].resource.label = T('Resource')
172
172
 
173
173
    # CRUD Strings
174
 
    LIST_FEATURE_CLASS = T('List Feature Classes')
 
174
    LIST_FEATURE_CLASS = T('List Location Types')
175
175
    s3.crud_strings[table] = Storage(
176
176
        title_create = ADD_FEATURE_CLASS,
177
 
        title_display = T('Feature Class Details'),
 
177
        title_display = T('Location Type Details'),
178
178
        title_list = LIST_FEATURE_CLASS,
179
 
        title_update = T('Edit Feature Class'),
180
 
        title_search = T('Search Feature Class'),
181
 
        subtitle_create = T('Add New Feature Class'),
182
 
        subtitle_list = T('Feature Classes'),
 
179
        title_update = T('Edit Location Type'),
 
180
        title_search = T('Search Location Type'),
 
181
        subtitle_create = T('Add New Location Type'),
 
182
        subtitle_list = T('Location Types'),
183
183
        label_list_button = LIST_FEATURE_CLASS,
184
184
        label_create_button = ADD_FEATURE_CLASS,
185
 
        msg_record_created = T('Feature Class added'),
186
 
        msg_record_modified = T('Feature Class updated'),
187
 
        msg_record_deleted = T('Feature Class deleted'),
188
 
        msg_list_empty = T('No Feature Classes currently defined'))
 
185
        msg_record_created = T('Location Type added'),
 
186
        msg_record_modified = T('Location Type updated'),
 
187
        msg_record_deleted = T('Location Type deleted'),
 
188
        msg_list_empty = T('No Location Types currently defined'))
189
189
 
190
190
    return shn_rest_controller(module, resource)
191
191
 
909
909
        crud.settings.create_onaccept = lambda form: shn_audit_create(form, module, 'feature_group_contents', 'html')
910
910
        # Display a List_Create page with checkboxes to remove items
911
911
 
912
 
        # Feature Classes
 
912
        # Location Types
913
913
        query = (tables[0].feature_group_id == feature_group) & (tables[0].deleted == False)
914
914
        sqlrows = db(query).select()
915
915
        for row in sqlrows:
959
959
        crud.settings.create_onvalidation = lambda form: feature_group_dupes(form)
960
960
        crud.messages.record_created = T('Feature Group Updated')
961
961
        form1 = crud.create(tables[0], next=URL(r=request, args=[feature_group]))
962
 
        form1[0][0].append(TR(TD(T('Type:')), TD(LABEL(T('Feature Class'), INPUT(_type="radio", _name="fg1", _value="FeatureClass", value="FeatureClass")), LABEL(T('Feature'), INPUT(_type="radio", _name="fg1", _value="Feature", value="FeatureClass")))))
 
962
        form1[0][0].append(TR(TD(T('Type:')), TD(LABEL(T('Location Type'), INPUT(_type="radio", _name="fg1", _value="FeatureClass", value="FeatureClass")), LABEL(T('Feature'), INPUT(_type="radio", _name="fg1", _value="Feature", value="FeatureClass")))))
963
963
        form2 = crud.create(tables[1], next=URL(r=request, args=[feature_group]))
964
 
        form2[0][0].append(TR(TD(T('Type:')), TD(LABEL(T('Feature Class'), INPUT(_type="radio", _name="fg2", _value="FeatureClass", value="Feature")), LABEL(T('Feature'), INPUT(_type="radio", _name="fg2", _value="Feature", value="Feature")))))
 
964
        form2[0][0].append(TR(TD(T('Type:')), TD(LABEL(T('Location Type'), INPUT(_type="radio", _name="fg2", _value="FeatureClass", value="Feature")), LABEL(T('Feature'), INPUT(_type="radio", _name="fg2", _value="Feature", value="Feature")))))
965
965
        addtitle = T("Add to Feature Group")
966
966
        response.view = '%s/feature_group_contents_list_create.html' % module
967
967
        output.update(dict(subtitle=subtitle, items=items, addtitle=addtitle, form1=form1, form2=form2, feature_group=feature_group))
968
968
    else:
969
969
        # Display a simple List page
970
 
        # Feature Classes
 
970
        # Location Types
971
971
        query = (tables[0].feature_group_id == feature_group) & (tables[0].deleted == False)
972
972
        sqlrows = db(query).select()
973
973
        for row in sqlrows:
1035
1035
        return
1036
1036
 
1037
1037
def feature_group_update_items():
1038
 
    "Update a Feature Group's items (Feature Classes & Features)"
 
1038
    "Update a Feature Group's items (Location Types & Features)"
1039
1039
    if len(request.args) == 0:
1040
1040
        session.error = T("Need to specify a feature group!")
1041
1041
        redirect(URL(r=request, f='feature_group'))