Indicia-Team / ecobat

Repository for Ecobat specific code.
GNU General Public License v3.0
0 stars 0 forks source link

Indicia Pages #10

Closed SophieDavison closed 8 years ago

SophieDavison commented 8 years ago

Hi John,

Thanks very much for sorting the colorbox thing out - works perfectly now!!

Would you be able to teach me how to edit the Indicia pages? We don't want to do anything major, only add some text here and there to assist users with data entry and make the process a bit clearer, but when we try and edit say, the page where they maps to attribute page, if on that page I click 'edit' it just takes me to editing the page with the upload form - and the same for the analysis pages.

Please let me know if that doesn't make sense/you want any more explanation.

Cheers,

Sophie

johnvanbreda commented 8 years ago

Hi Sophie, The Indicia pages are "functional" rather than "content", so the output is a bit more embedded in the code than the Drupal content. Having said that its by no means impossible though it would be easier to explain with specific examples. If you want, can you give me a couple of examples of exactly what you want to change and I'll write up a few tutorial notes for you on how to do it. Cheers John

SophieDavison commented 8 years ago

Some examples of things we wanted to alter on the Indicia pages:

On the page where people match up the columns in their spreadsheet to the fields in the database, we wanted to include a little bit of text to explain to people about what means and that they should leave it selected where they have previously defined a particular field or they don't have data for the field e.g. supplementary data.

We were also wanting to include a note on the page people see if a number of records in an import fail to upload successfully (due to an error in the spreadsheet, for example) to explain that they then have to download the generated spreadsheet containing failed records, correct the errors and then re-upload the generated spreadsheet, rather than re-uploading their whole dataset again.

johnvanbreda commented 8 years ago

Hi Sophie, For the first point, I think you basically need to edit and append some text to the paragraph at the top of the column mapping page? We can do this using the facility to translate Indicia pages to other languages, which can also be used to change the wording used for English to your own preferences. To do that you can use a file which contains the translations to apply. You'll need to edit the file directly on the server using an FTP client - I'll give you the instructions here for safe-keeping but if you prefer just pass the text to me and I'll do it.

  1. First you need to know the ID of the page you are going to do some translation on. When logged in as admin, click the Edit tab for the page, then check the URL. In this instance it says "node/13/edit" so that means your ID is 13 (a node is Drupal parlance for any piece of content, e.g. a page or a snippet).
  2. Now you've got that you'll need to use the FTP tool to browse to the folder newsite/sites/all/modules/iform/client_helpers/prebuilt_forms/lang and create a file called node.13.en.php if it does not already exist. In this case I've already applied a couple of translations to the names of the columns so it will already be there.
  3. If the file is new, you'll need to paste in the following text as a template:
global $custom_term_overrides;
$custom_term_overrides[] = array(
  '' => '',
);

If the file exists, add a line above the final parenthesis containing just '' => '',

  1. The '' => '', bit is a placeholder for a translation - with the key of the item you are translating from in the first pair of quotes, then the final translation to show in the 2nd. So, you need to find out the key. Often the key is going to be exactly the same as the text you see on screen, particularly for shorter translations. Sometimes, and particularly for longer translations, the key is shorter to make it less cumbersome to use. To find the key, add &notranslate to the page and reload it. You will see square brackets around the various keys on the page, which will contain the untranslated keys. You need to copy the relevant key out of the square brackets and paste it into the first pair of quotes.
  2. Paste your translation into the 2nd pair of quotes and save the file, then upload to the server. If your translation contains a single quote then precede it with a backslash, e.g. john's should be written as john\'s.

The key you need is column_mapping_instructions so the file content will look something like:

global $custom_term_overrides;
$custom_term_overrides[] = array(
  'column_mapping_instructions' => 'My text goes here',
);

For your second suggestion, I actually like the idea of adding some more explanatory text here as part of the standard code, as it will be useful for other users of Indicia. Would you like to propose some text to add to the page in the event of there being some errors?

SophieDavison commented 8 years ago

Hi John,

Okay, for now I think it's probably easier if I just send you the text, which is as follows.

On the page where people match up the columns in their spreadsheet to the fields in the database: Previously defined fields (i.e. spatial reference system, pass definition, sensitivity) can be left as unless the data contains multiple spatial reference systems (or sensitivity options). In this case, the fields should be matched to the columns in your csv file which outline the spatial reference system (or sensitivity) for each row of your data. Fields for which you do not have data (i.e. supplementary data) should also be left as .

A note on the page people see if a number of records in an import fail to upload successfully (due to an error in the spreadsheet, for example): If part of your upload was unsuccessful, download the generated CSV file which holds the rows of data that did not upload. Find the column 'Problem' which lists the associated error for each row. Correct the error, and then re-upload the CSV file containing only the rows of data which did not upload correctly. Please do not re-upload the whole dataset again.

Are we still okay to edit pages on the website whilst you're sorting it out today or do you want us to leave it alone for a bit??

Cheers

Sophie

SophieDavison commented 8 years ago

In the second paragraph above (if a number of records in an import fail to upload successfully etc) it should read

'Correct the error, and then re-upload the CSV file containing only the rows of data which did not upload correctly. Please do not re-upload the whole dataset again.'

Can we have the only in bold please? Just to make it clear.

Thank you!!

johnvanbreda commented 8 years ago

This should be done now - I've not tested the last page with the instructions on downloading errors as I don't want to upload into the live db, so let me know if it's not OK. Otherwise please close this issue.