1

Topic: Allow Users to Modify their Records?

Hi all,

We've had a couple of requests lately from users who've submitted records with typos, or later found that they've got an image they could've added, to see if they can edit their records.

Is the functionality available in the Drupal Iforms modules to allow users to edit their own existing records?

If so, can you advise of what the config should be on the iForm page to allow this?

Many thanks,

Steve

2

Re: Allow Users to Modify their Records?

OK, I think I worked it out - you can just use the Sample With Occurrences form but pass it an occurence_id or sample_id as a URL variable?

3

Re: Allow Users to Modify their Records?

Hi Steve
Yes, that's right, you just pass sample_id=n (or occurrence_id=n) as a URL parameter. I then create a report grid or dynamic report page to show a user a list of their records with an edit link pointing to your page.

In case it helps, the My Records page configuration from iRecord is below:
Form type - Reporting - Dynamic Report Explorer
Configure the map size/layers etc as normal
Controls to add to the map:
  layerSwitcher
  panZoomBar
  drawPolygon
  drawLine
  drawPoint
  fullscreen
User Interface - Interface Style - Tabs
User Interface - Form Structure:

[standard_params]
@allowSave=true
@linkToMapDiv=map
@taxon_list_id=15
@filter-my_records=1
@indexedLocationTypeIds=[15,1370,2188]
@otherLocationTypeIds=[2412]
[map]
@dataSource=library/occurrences/filterable_explore_list_mapping
@dataSourceLoRes=library/occurrences/filterable_explore_list_mapping_lores
=Records=
[report_grid]
@dataSource=library/occurrences/filterable_explore_list
@rowId=occurrence_id
@downloadLink=true
=Species=
[report_grid]
@id=species
@dataSource=library/taxa/filterable_explore_list
@downloadLink=true
@rowId=taxon_meaning_id
@linkFilterToMap=false
=Taxon groups=
[report_grid]
@id=taxon_groups
@dataSource=library/taxon_groups/filterable_explore_list
@downloadLink=true
@rowId=taxon_group_id
@linkFilterToMap=false
=Families=
<p>This report shows a breakdown of the species and record counts by taxonomic family.</p>
[report_grid]
@id=families
@dataSource=library/taxa/filterable_explore_list_taxonomy_breakdown
@downloadLink=true
@linkFilterToMap=false
=Photos=
[report_grid]
@id=photos
@dataSource=library/occurrence_images/filterable_explore_list
@rowId=occurrence_id
@includeAllColumns=false
@headers=false
@galleryColCount=4
@itemsPerPage=16

Report settings - preset parameter values:

smpattrs=
occattrs=
default_input_form=enter-record-list
my_records=1
release_status=A

Column configuration (click Edit Source, then paste this in, then click Edit Form):

[
  [
    {
      "actions":
      [
        {
          "caption":"Edit this record",
          "url":"{rootFolder}{input_form}",
          "urlParams":
          {
            "occurrence_id":"{occurrence_id}"
          },
          "img":"{rootFolder}/sites/all/modules/iform/media/images/nuvola/package_editors-22px.png",
          "visibility_field":"belongs_to_user"
        },
        {
          "caption":"View record details",
          "url":"{rootFolder}record-details",
          "urlParams":
          {
            "occurrence_id":"{occurrence_id}"
          },
          "img":"{rootFolder}/sites/all/modules/iform/media/images/nuvola/find-22px.png"
        }
      ]
    }
  ],
  [
    {
      "actions":
      [
        {
          "caption":"Species summary",
          "img":"{rootFolder}/sites/all/modules/iform/media/images/nuvola/find-22px.png",
          "url":"species-details",
          "urlParams":
          {
            "taxon_meaning_id":"{taxon_meaning_id}"
          }
        }
      ]
    },
    {
      "fieldname":"record_status",
      "visible":false
    }
  ],
  [

  ],
  [

  ],
  [
    {
      "fieldname":"media",
      "template":"<div class='gallery-item status-{record_status} certainty-{certainty}'><a class='fancybox' href='{imageFolder}{media}'><img src='{imageFolder}thumb-{media}' title='{taxon}' alt='{taxon}'/><br/>{taxon}</a></div>"
    }
  ]
]

Note that this column configuration points to record details and species details pages that you might not have, so you might want to take those links out.

Best wishes
John

John van Breda
Biodiverse IT