Changeset 33855

Show
Ignore:
Timestamp:
22.01.2020 15:03:19 (4 weeks ago)
Author:
davidb
Message:

Code added to detect if the CGI parameter already specifies a collection, and if it does, auto-select it and go straight into the starting page for deposit an item for that collection. If the user is not in the right group then an error message is produced

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/depositor_home.xsl

    r33755 r33855  
    4747            <script type="text/javascript"> 
    4848                <xsl:text disable-output-escaping="yes"> 
     49                  var availableDepositorCols = [ 
     50                </xsl:text> 
     51                <xsl:for-each select="/page/pageResponse/depositorPage/collectionList/collection"> 
     52                  <xsl:text disable-output-escaping="yes">"</xsl:text><xsl:value-of select="@name"/><xsl:text disable-output-escaping="yes">"</xsl:text>, 
     53                </xsl:for-each> 
     54                <xsl:text disable-output-escaping="yes"> 
     55                  null ] <!-- to simplify array initialization --> 
     56                </xsl:text> 
     57            </script> 
     58 
     59            <script type="text/javascript"> 
     60                <xsl:text disable-output-escaping="yes"> 
     61                  var col = gs.cgiParams["c"]; 
     62                  if (col &amp;&amp; availableDepositorCols.includes(col)) {  
     63                      document.location.href = gs.xsltParams.library_name + "?a=de&amp;sa=getwizard&amp;c=" + col; 
     64                  }     
     65                </xsl:text> 
     66            </script> 
     67 
     68            <script type="text/javascript"> 
     69                <xsl:text disable-output-escaping="yes"> 
    4970                    $("#colSelect").change(function() 
    5071                    {