Opened 4 years ago

Closed 4 years ago

#2628 closed defect (fixed)

Update link to SMTA of ITPGRFA

Reported by: Gary Kinard Owned by: Kay Kittell
Priority: minor Milestone: Server 2.3.2
Component: Public Website 2 Version: N/A
Severity: Keywords:
Cc: karen.kittell@… Database Engine: N/A
Operating System: N/A

Description

Our link to the SMTA is broken.

The new/current link is: ​https://www.fao.org/3/bc083e/bc083e.pdf

Also suggest that activating this link, as well as the link to the ITPGRFA, open as a new browser session. They currently leave our site.

Lastly, capitalize the t in Treaty in the dialogue box text.

Attachments (1)

Trac_2628.sql​ (861 bytes ) - added by Benjamin Haag 4 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 by Kay Kittell, 4 years ago

Owner: changed from Kay Kittell to Benjamin Haag
Status: new → assigned

The text and the link are in the code_value_lang table. These changes should be made by Benjamin.

comment:2 by Benjamin Haag, 4 years ago

Steps to reproduce:
1) Navigate to (for example): ​https://npgsweb.ars-grin.gov/gringlobal/accessiondetail?id=1958009
2) Select the IPR tab.
3) Click the View MTA Disclaimer link.
4) In the text displayed in the modal, the URL ​http://www.fao.org/3/a-bc083e.pdf resolves, but is incorrect. It should be: ​https://www.fao.org/3/bc083e/bc083e.pdf

comment:3 by Benjamin Haag, 4 years ago

Data displayed in modal based on code MTA-SMTA in the ACCESSION_RESTRICTION_TYPE code group.

comment:4 by Benjamin Haag, 4 years ago

Cc: karen.kittell@… added

comment:5 by Benjamin Haag, 4 years ago

Change made on dev (see attached SQL script). Will be implemented on prod once reviewed.

comment:6 by Benjamin Haag, 4 years ago

Revision needed. "Treaty" corrected; revised URL not rendering as a URL, while other URL is -- but both are stored in the same format in the database (see below):

This material is covered by The International Treaty on Plant Genetic Resources for Food and Agriculture) (http://www.planttreaty.org) and is therefore distributed under a Standard Material Transfer Agreement (SMTA) (https://www.fao.org/3/bc083e/bc083e.pdf).  By accepting shipment of the requested material you are accepting the terms of the SMTA and recognize that your name and contact information (address, phone number, e-mail address) will be submitted as a recipient of this material to the Governing Body of the Treaty.

comment:7 by Benjamin Haag, 4 years ago

1) Data update (title correction and revised URL) completed and verified on DEV.
2) Changing the URL format(s) to include target="_blank" rel="noopener noreferrer" must be completed in the PW code that generates the modal.

comment:8 by Benjamin Haag, 4 years ago

Updates:
1) The final version of the corrected text (which also removes an extraneous ")" character) is:

'This material is covered by The International Treaty on Plant Genetic Resources for Food and Agriculture (​https://www.fao.org/plant-treaty/en/)
and is therefore distributed under a Standard Material Transfer Agreement (SMTA) (​https://www.fao.org/3/bc083e/bc083e.pdf).
By accepting shipment of the requested material you are accepting the terms of the SMTA and recognize that your name and contact information
(address, phone number, e-mail address) will be submitted as a recipient of this material to the Governing Body of the Treaty.'

2) Determined (K. Endress) that the following code in the code-behind of the modal (MTAdisclaimer.aspx.cs) is in fact what renders the HTML markup:

private void bindData(int iprID)

        {

            using (SecureData sd = new SecureData(false, UserManager.GetLoginToken()))

            {

                DataTable dt = sd.GetData("web_accessiondetail_ipr_disclaimer", ":accessioniprid=" + iprID, 0, 0).Tables["web_accessiondetail_ipr_disclaimer"];

                if (dt.Rows.Count > 0)

                {

                    string description = dt.Rows[0]["description"].ToString();

                    Regex regx = new Regex("http://([\\w+?\\.\\w+])+([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase);

 

                    MatchCollection mactches = regx.Matches(description);

 

                    foreach (Match match in mactches)

                    {

                        string matchURL = match.Value;

                        if (matchURL.Substring(matchURL.Length - 1, 1) == ")") matchURL = matchURL.Substring(0, matchURL.Length - 1);

                        if (matchURL.Substring(matchURL.Length - 2, 2) == ").") matchURL = matchURL.Substring(0, matchURL.Length - 2);

                        description = description.Replace(match.Value, "<a href='" + matchURL + "'>" + match.Value + "</a>");

                    }

                    lblDescription.Text = description;

                }

            }

       }

 
Last edited 4 years ago by Benjamin Haag (previous) (diff)

comment:9 by Kay Kittell, 4 years ago

Changed the code in MTA disclaimer to include rendering urls as links for https: as well as http: Also corrected the formatting of the links so they do not include the final ) or ). when the link is in parenthesis.

comment:10 by Benjamin Haag, 4 years ago

Update: decision made to update data immediately, vs. waiting to change/deploy code.

UPDATED TEXT IS BELOW. ADD TO ATTCHED SQL:

This material is covered by The International Treaty on Plant Genetic Resources for Food and Agriculture (​http://www.fao.org/plant-treaty/en/)
and is therefore distributed under a Standard Material Transfer Agreement (SMTA) (​http://www.fao.org/3/bc083e/bc083e.pdf).
By accepting shipment of the requested material you are accepting the terms of the SMTA and recognize that your name and contact information
(address, phone number, e-mail address) will be submitted as a recipient of this material to the Governing Body of the Treaty.

by Benjamin Haag, 4 years ago

Attachment: Trac_2628.sql​ added

comment:11 by Benjamin Haag, 4 years ago

Data updated and verified in production.

comment:12 by Benjamin Haag, 4 years ago

Owner: changed from Benjamin Haag to Kay Kittell

Reassigning. Requested change to URL logic is being addressed in the PW.

comment:13 by Kay Kittell, 4 years ago

Milestone: → Server 2.3.2
Priority: major → minor
Status: assigned → addressed

Changed MTAdisclaimer so the Regex that it uses to turn urls into links includes using https. Previously only looked for http and wouldn't change an https url into a link. This is in coordination with the database field change done by Benjamin for only the 1 record for FAO Standard Material Transfer Agreement description.

Last edited 4 years ago by Kay Kittell (previous) (diff)

comment:14 by Gary Kinard, 4 years ago

Resolution: → fixed
Status: addressed → closed
Note: See TracTickets for help on using tickets.