Changeset 5152


Ignore:
Timestamp:
Oct 21, 2009, 2:39:54 PM (12 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1412: The selected unit for an annotation type should not be remembered when creating a new annotation type

Location:
branches/2.14-stable/www/admin/annotationtypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.14-stable/www/admin/annotationtypes/edit_annotationtype.jsp

    r4889 r5152  
    8080    title = "Create annotation type";
    8181    valueType = Type.valueOf(request.getParameter("value_type"));
    82     if (valueType.isNumerical()) unitQuery = Unit.getQuery();
    83    
    84     int recentQuantityId = Values.getInt(cc.getRecent(Item.QUANTITY.name(), 0));
    85     currentQuantityId = Values.getInt(cc.getPropertyValue("quantity"), recentQuantityId);
    86 
    87     if (cc.getPropertyFilter("defaultUnit.name") != null)
    88     {
    89       Unit currentUnit = Base.getFirstMatching(dc, Unit.getQuery(), "name", cc.getPropertyFilter("defaultUnit.name"));
    90       if (currentUnit != null) currentUnitId = currentUnit.getId();
    91     }
    92     if (currentUnitId == 0) currentUnitId = Values.getInt(cc.getRecent(Item.UNIT.name(), 0));
     82    if (valueType.isNumerical()) unitQuery = Unit.getQuery();
    9383    cc.removeObject("item");
    9484  }
  • branches/2.14-stable/www/admin/annotationtypes/index.jsp

    r5060 r5152  
    278278        Unit unit = unitId == 0 ? null : Unit.getById(dc, unitId);
    279279        annotationType.setDefaultUnit(unit);
    280         if (unit != null) cc.setRecent(unit, maxRecent);
    281280      }
    282281     
Note: See TracChangeset for help on using the changeset viewer.