Changeset 3447


Ignore:
Timestamp:
Jun 5, 2007, 8:39:03 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #629. The 'removed' option has been removed from the preset selector since the query
system can't include that as a filter.

Location:
branches/2.3.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3.1/src/clients/web/net/sf/basedb/clients/web/taglib/table/PresetSelector.java

    r2637 r3447  
    7878 
    7979  /**
    80     If the header should be visible or not.
     80    If the preset selector should be visible or not.
    8181  */
    8282  private boolean visible = true;
     83 
     84  /**
     85    If the 'removed' option should be included in the preset selector or not.
     86    If the list contains items that are not removable, the option is never included.
     87  */
     88  private boolean disableRemoved = false;
     89 
     90  /**
     91    If the 'owned by me' option should be included in the preset selector or not.
     92    If the list contains items that are not ownable, the option is never included.
     93  */
     94  private boolean disableOwnedBy = false;
     95
     96  /**
     97    If the 'shared to me' option should be included in the preset selector or not.
     98    If the list contains items that are not shareable, the option is never included.
     99  */
     100  private boolean disableSharedTo = false;
     101
     102  /**
     103    If the 'in project' option should be included in the preset selector or not.
     104    If the list contains items that are not removable, the option is never included.
     105  */
     106  private boolean disableInProject = false;
     107
     108  /**
     109    If the 'owned by others' option should be included in the preset selector or not.
     110    If the list contains items that are not ownable, the option is never included.
     111  */
     112  private boolean disableOthers = false; 
    83113 
    84114  private String onChange = "presetOnChange()";
     
    132162  }
    133163
     164  public void setDisableremoved(boolean disable)
     165  {
     166    this.disableRemoved = disable;
     167  }
     168  public boolean getDisableremoved()
     169  {
     170    return disableRemoved;
     171  }
     172 
     173  public void setDisableownedby(boolean disable)
     174  {
     175    this.disableOwnedBy = disable;
     176  }
     177  public boolean getDisableownedby()
     178  {
     179    return disableOwnedBy;
     180  }
     181 
     182  public void setDisablesharedto(boolean disable)
     183  {
     184    this.disableSharedTo = disable;
     185  }
     186  public boolean getDisablesharedto()
     187  {
     188    return disableSharedTo;
     189  }
     190 
     191  public void setDisableinproject(boolean disable)
     192  {
     193    this.disableInProject = disable;
     194  }
     195  public boolean getDisableinproject()
     196  {
     197    return disableInProject;
     198  }
     199 
     200  public void setDisableothers(boolean disable)
     201  {
     202    this.disableOthers = disable;
     203  }
     204  public boolean getDisableothers()
     205  {
     206    return disableOthers;
     207  }
     208 
    134209  /*
    135210    Display methods
     
    194269    if (dataClass != null)
    195270    {
    196       if (RemovableData.class.isAssignableFrom(dataClass))
     271      if (RemovableData.class.isAssignableFrom(dataClass) && !disableRemoved)
    197272      {
    198273        boolean current = cc.getInclude().contains(Include.REMOVED);
     
    203278        numOptions++;
    204279      }
    205       if (OwnableData.class.isAssignableFrom(dataClass))
     280      if (OwnableData.class.isAssignableFrom(dataClass) && !disableOwnedBy)
    206281      {
    207282        boolean current = cc.getInclude().contains(Include.MINE);
     
    216291        )
    217292      {
    218         boolean current = cc.getInclude().contains(Include.SHARED);
    219         sb.append("<option value=\"option:shared:").append(current ? "0" : "1").append("\"");
    220         sb.append(" title=\"Show/hide items shared to me\">");
    221         sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Shared to me\n");
    222         table.addHidden("shared", Boolean.toString(current));
    223         numOptions++;
     293        if (!disableSharedTo)
     294        {
     295          boolean current = cc.getInclude().contains(Include.SHARED);
     296          sb.append("<option value=\"option:shared:").append(current ? "0" : "1").append("\"");
     297          sb.append(" title=\"Show/hide items shared to me\">");
     298          sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Shared to me\n");
     299          table.addHidden("shared", Boolean.toString(current));
     300          numOptions++;
     301        }
    224302       
    225         if (sc.getActiveProjectId() != 0 && !ProjectData.class.isAssignableFrom(dataClass))
     303        if (sc.getActiveProjectId() != 0 && !ProjectData.class.isAssignableFrom(dataClass) && !disableInProject)
    226304        {
    227           current = cc.getInclude().contains(Include.IN_PROJECT);
     305          boolean current = cc.getInclude().contains(Include.IN_PROJECT);
    228306          sb.append("<option value=\"option:inproject:").append(current ? "0" : "1").append("\"");
    229307          sb.append(" title=\"Show/hide items in current project\">");
     
    234312      }
    235313 
    236       if (sc.hasPermission(Permission.READ, itemType) &&
     314      if (sc.hasPermission(Permission.READ, itemType) && !disableOthers &&
    237315          (
    238316            OwnableData.class.isAssignableFrom(dataClass) ||
  • branches/2.3.1/www/WEB-INF/table.tld

    r2942 r3447  
    312312      <rtexprvalue>true</rtexprvalue>
    313313    </attribute>
     314    <attribute>
     315      <name>disableremoved</name>
     316      <required>false</required>
     317      <rtexprvalue>true</rtexprvalue>
     318    </attribute>
     319    <attribute>
     320      <name>disableownedby</name>
     321      <required>false</required>
     322      <rtexprvalue>true</rtexprvalue>
     323    </attribute>
     324    <attribute>
     325      <name>disablesharedto</name>
     326      <required>false</required>
     327      <rtexprvalue>true</rtexprvalue>
     328    </attribute>
     329    <attribute>
     330      <name>disableinproject</name>
     331      <required>false</required>
     332      <rtexprvalue>true</rtexprvalue>
     333    </attribute>
     334    <attribute>
     335      <name>disableothers</name>
     336      <required>false</required>
     337      <rtexprvalue>true</rtexprvalue>
     338    </attribute>
    314339  </tag>
    315340
  • branches/2.3.1/www/admin/diskusage/details/view_details.jsp

    r3443 r3447  
    421421              colspan="3"
    422422              onchange="presetOnChange()"
     423              disableremoved="true"
    423424            />
    424425          </tbl:columns>
Note: See TracChangeset for help on using the changeset viewer.