Changeset 7407


Ignore:
Timestamp:
Oct 5, 2017, 12:54:16 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2097: Implement support for device verification

Added list/view/edit pages to the web client for devices.

Location:
trunk
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/edit/EditUtil.java

    r7006 r7407  
    7474      Item.ANNOTATIONTYPECATEGORY, Item.ANNOTATIONTYPE,
    7575      Item.QUANTITY, Item.UNIT, Item.EXTRAVALUETYPE, Item.REPORTERTYPE, Item.ITEMSUBTYPE,
    76       Item.ITEMLIST, Item.SYNCFILTER
     76      Item.ITEMLIST, Item.SYNCFILTER, Item.USERDEVICE
    7777    };
    7878
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java

    r7006 r7407  
    7878      Item.ANNOTATIONTYPE, Item.ANNOTATIONTYPECATEGORY, Item.QUANTITY, Item.UNIT,
    7979      Item.SESSION, Item.JOB, Item.MESSAGE, Item.PROJECT, Item.FILE, Item.FILESERVER,
    80       Item.CHANGEHISTORY, Item.PERMISSIONTEMPLATE, Item.ITEMSUBTYPE, Item.ITEMLIST
     80      Item.CHANGEHISTORY, Item.PERMISSIONTEMPLATE, Item.ITEMSUBTYPE, Item.ITEMLIST,
     81      Item.USERDEVICE
    8182    };
    8283
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/common.properties

    r6991 r7407  
    206206item.anytoany Any to any link
    207207item.anytoany+ Any to any links
     208item.userdevice Device
     209item.userdevice+ Devices
  • trunk/src/clients/web/net/sf/basedb/clients/web/resources/menu.properties

    r7295 r7407  
    3939resetlistsettings.title Reset list settings
    4040resetlistsettings.tooltip Reset visible columns, sort order, filters, etc. to default settings on all lists
     41devices.tooltip.1 List your verified devices
     42devices.tooltip.0 You do not have permission to access devices
     43sessions.tooltip.1  Check you login sessions
     44sessions.tooltip.0  You do not have permission to access sessions
    4145logout.title  Logout
    4246logout.tooltip  Exit from BASE
     
    8589jobs.tooltip.1  Check the status of your jobs
    8690jobs.tooltip.0  You do not have permission to access jobs
    87 sessions.tooltip.1  Check you login sessions
    88 sessions.tooltip.0  You do not have permission to access sessions
    8991# --------------
    9092physicalbioassays.tooltip.1 Manage physical bioassays
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/PresetSelector.java

    r6875 r7407  
    3131import net.sf.basedb.core.data.RemovableData;
    3232import net.sf.basedb.core.data.ShareableData;
     33import net.sf.basedb.core.data.UserDeviceData;
    3334import net.sf.basedb.core.data.OwnableData;
    3435import net.sf.basedb.core.data.SessionData;
     
    273274          (
    274275            OwnableData.class.isAssignableFrom(dataClass) ||
    275             SessionData.class.isAssignableFrom(dataClass)
     276            SessionData.class.isAssignableFrom(dataClass) ||
     277            UserDeviceData.class.isAssignableFrom(dataClass)
    276278          )
    277279        )
  • trunk/www/include/menu.jsp

    r7295 r7407  
    6262  import="net.sf.basedb.clients.web.util.HTML"
    6363  import="net.sf.basedb.clients.web.resources.Bundle"
     64  import="net.sf.basedb.util.EmailUtil"
    6465  import="net.sf.basedb.util.Values"
    6566  import="net.sf.basedb.util.resources.ResourceBundleWrapper"
     
    507508    final boolean hasJobs               = !sc.hasPermission(Permission.DENIED, Item.JOB);
    508509    final boolean hasSessions           = !sc.hasPermission(Permission.DENIED, Item.SESSION);
     510    final boolean hasDevices            = !sc.hasPermission(Permission.DENIED, Item.USERDEVICE);
     511    final boolean supportsDeviceVerification = EmailUtil.isEnabled() &&
     512        (user.getUseDeviceVerification() || sc.hasPermission(Permission.READ, Item.USERDEVICE));
    509513    %>
    510514    <m:menu
     
    569573        tooltip="<%=menu.getString("jobs.tooltip", hasJobs)%>"
    570574        enabled="<%=hasJobs%>"
    571       />
    572       <m:menuitem
    573         title="<%=common.getString("item.session+")%>"
    574         url="<%=root+"views/sessions/index.jsp?ID="+ID%>"
    575         tooltip="<%=menu.getString("sessions.tooltip", hasSessions)%>"
    576         enabled="<%=hasSessions%>"
    577575      />
    578576      <m:menuseparator />
     
    669667        data-popup="ResetFilter, 450, 300"
    670668        tooltip="<%=menu.getString("resetlistsettings.tooltip")%>"
     669      />
     670      <m:menuseparator />
     671      <m:menuitem
     672        title="<%=common.getString("item.userdevice+")%>"
     673        url="<%=root+"views/devices/index.jsp?ID="+ID%>"
     674        tooltip="<%=menu.getString("devices.tooltip", hasDevices)%>"
     675        enabled="<%=hasDevices%>"
     676        visible="<%=supportsDeviceVerification %>"
     677      />
     678      <m:menuitem
     679        title="<%=common.getString("item.session+")%>"
     680        url="<%=root+"views/sessions/index.jsp?ID="+ID%>"
     681        tooltip="<%=menu.getString("sessions.tooltip", hasSessions)%>"
     682        enabled="<%=hasSessions%>"
    671683      />
    672684      <m:menuseparator />
  • trunk/www/include/scripts/main-2.js

    r7199 r7407  
    20712071    controllers['UNIT'] = { url:'admin/quantities/units/index.jsp', width:600, height:400, noAnyToAny:true };
    20722072    controllers['USER'] = { url:'admin/users/index.jsp', width:750, height:500 };
     2073    controllers['USERDEVICE'] = { url:'views/devices/index.jsp', width:450, height:300, noAnyToAny:true };
    20732074    controllers['WELL'] = { url:'lims/plates/wells/index.jsp', width:750, height:500, noAnyToAny:true };
    20742075  }
  • trunk/www/views/sessions/list_sessions.jsp

    r7406 r7407  
    4848  import="net.sf.basedb.clients.web.PermissionUtil"
    4949  import="net.sf.basedb.clients.web.util.HTML"
     50  import="net.sf.basedb.util.EmailUtil"
    5051  import="net.sf.basedb.util.Values"
    5152  import="net.sf.basedb.util.formatter.Formatter"
     
    8182try
    8283{
    83   final User user = cc.getInclude().contains(Include.OTHERS) ?
    84     null : User.getById(dc, sc.getLoggedInUserId());
     84  final User user = User.getById(dc, sc.getLoggedInUserId());
     85  final boolean supportsDeviceVerification = EmailUtil.isEnabled() &&
     86      (user.getUseDeviceVerification() || sc.hasPermission(Permission.READ, Item.USERDEVICE));
    8587
    8688  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
    8789  try
    8890  {
    89     final ItemQuery<Session> query = Base.getConfiguredQuery(dc, cc, true, Session.getQuery(user), mode);
     91    final ItemQuery<Session> query = Base.getConfiguredQuery(dc, cc, true, Session.getQuery(cc.getInclude().contains(Include.OTHERS) ? null : user), mode);
    9092    sessions = query.iterate(dc);
    9193  }
     
    177179        exportable="true"
    178180      />
    179       <tbl:columndef
    180         id="device"
    181         property="device.name"
    182         datatype="string"
    183         title="Device"
    184         sortable="true"
    185         filterable="true"
    186         exportable="true"
    187       />
     181      <%
     182      if (supportsDeviceVerification)
     183      {
     184        %>
     185        <tbl:columndef
     186          id="device"
     187          property="device.name"
     188          datatype="string"
     189          title="Device"
     190          sortable="true"
     191          filterable="true"
     192          exportable="true"
     193        />
     194        <%
     195      }
     196      %>
    188197      <tbl:columndef
    189198        id="authenticationMethod"
Note: See TracChangeset for help on using the changeset viewer.