Changeset 24078

2011-05-21T19:55:39+12:00 (13 years ago)

There was a bug in Admin pages when listing users where the list users page could only display status and groups info for the admin user (and this was wrong to: the last user's status and groups would be displayed under the admin user instead). This was because the ids assigned to the status and group cells were identical, and so these got successively overwritten on each pass through the user list for displaying their details. Not sure how this ever worked before, so wasn't too sure of the solution and therefore don't know that the current fix is the most optimal kind: there may be better ways of expressing the same in xslt and javascript.

1 edited


  • main/trunk/greenstone3/web/interfaces/default/transform/authen.xsl

    r23972 r24078  
    382382      </tr>
    383383      <xsl:for-each select="/page/pageResponse/authenticationNode/service/userNodeList/userNode">
     384    <script type="text/javascript">
     385    <xsl:text disable-output-escaping="yes">
     386    var username="</xsl:text><xsl:value-of select="@umun"/><xsl:text disable-output-escaping="yes">";
     387    </xsl:text>
     388    </script>
    384389    <tr>
    385390      <td bgcolor="#eeeeee"><xsl:value-of select="@umun"/></td>
    386       <td id="status" bgcolor="#eeeeee">
     391      <!--<td id="status" bgcolor="#eeeeee">-->
     392      <td bgcolor="#eeeeee"><xsl:attribute name="id">status<xsl:value-of select="@umun"/></xsl:attribute>
    387393        <script type="text/javascript">
    388394          <xsl:text disable-output-escaping="yes">
    389395        var status="</xsl:text><xsl:value-of select="@umas"/><xsl:text disable-output-escaping="yes">";
    390396        if (status=="true"){
    391           document.getElementById("status").innerHTML="enabled";
     397          document.getElementById("status"+username).innerHTML="enabled";
    392398        }
    393399        if (status=="false"){
    394           document.getElementById("status").innerHTML="disabled";
     400          document.getElementById("status"+username).innerHTML="disabled";
    395401        }
    396402          </xsl:text>       
    397403        </script>
    398404      </td>
    399       <td id="group" bgcolor="#eeeeee">
     405      <!--<td id="group" bgcolor="#eeeeee">-->
     406      <td bgcolor="#eeeeee"><xsl:attribute name="id">group<xsl:value-of select="@umun"/></xsl:attribute>
    400407        <script type="text/javascript">
    401408          <xsl:text disable-output-escaping="yes">
    406413          new_groups+=split_groups[j]+" &lt;br /&gt; ";
    407414        }
    408         document.getElementById('group').innerHTML=new_groups;
     415        document.getElementById('group'+username).innerHTML=new_groups;
    409416          </xsl:text>       
    410417        </script>
Note: See TracChangeset for help on using the changeset viewer.