NIHVIVO-if all grants or pubs are hidden, the manage link should still be displayed
This commit is contained in:
parent
a59d3c872d
commit
c3d67a7872
3 changed files with 21 additions and 27 deletions
|
@ -98,15 +98,5 @@ $(document).ready(function(){
|
|||
return false;
|
||||
});
|
||||
|
||||
// if there are no selected pub, hide the manage link; same for grants
|
||||
if ( $('ul#authorInAuthorshipList').children('li').length < 1 ) {
|
||||
$('a#managePropLink').hide();
|
||||
}
|
||||
if ( $('ul#hasResearcherRoleList').children('li').length < 1 &&
|
||||
$('ul#hasPrincipalInvestigatorRoleList').children('li').length < 1 &&
|
||||
$('ul#hasCo-PrincipalInvestigatorRoleList').children('li').length < 1 &&
|
||||
$('ul#hasInvestigatorRoleList').children('li').length < 1 ) {
|
||||
$('a#manageGrantLink').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -101,16 +101,18 @@ public class ManageGrantsForIndividualController extends FreemarkerHttpServlet {
|
|||
ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
|
||||
while (results.hasNext()) {
|
||||
QuerySolution soln = results.nextSolution();
|
||||
String subclassUri = soln.get("subclass").toString();
|
||||
VClass vClass = (VClass) vcDao.getVClassByURI(subclassUri);
|
||||
String subclass = ((vClass.getName() == null) ? subclassUri : vClass.getName());
|
||||
RDFNode subclassUri= soln.get("subclass");
|
||||
if ( subclassUri != null ) {
|
||||
String subclassUriStr = soln.get("subclass").toString();
|
||||
VClass vClass = (VClass) vcDao.getVClassByURI(subclassUriStr);
|
||||
String subclass = ((vClass.getName() == null) ? subclassUriStr : vClass.getName());
|
||||
if(!subclassToGrants.containsKey(subclass)) {
|
||||
subclassToGrants.put(subclass, new ArrayList<Map<String,String>>()); //list of grant information
|
||||
}
|
||||
String label = soln.get("label").toString();
|
||||
List<Map<String,String>> grantsList = subclassToGrants.get(subclass);
|
||||
grantsList.add(QueryUtils.querySolutionToStringValueMap(soln));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e, e);
|
||||
}
|
||||
|
|
|
@ -98,16 +98,18 @@ public class ManagePublicationsForIndividualController extends FreemarkerHttpSer
|
|||
ResultSet results = QueryUtils.getQueryResults(queryStr, vreq);
|
||||
while (results.hasNext()) {
|
||||
QuerySolution soln = results.nextSolution();
|
||||
String subclassUri = soln.get("subclass").toString();
|
||||
VClass vClass = (VClass) vcDao.getVClassByURI(subclassUri);
|
||||
String subclass = ((vClass.getName() == null) ? subclassUri : vClass.getName());
|
||||
RDFNode subclassUri= soln.get("subclass");
|
||||
if ( subclassUri != null ) {
|
||||
String subclassUriStr = soln.get("subclass").toString();
|
||||
VClass vClass = (VClass) vcDao.getVClassByURI(subclassUriStr);
|
||||
String subclass = ((vClass.getName() == null) ? subclassUriStr : vClass.getName());
|
||||
if(!subclassToPublications.containsKey(subclass)) {
|
||||
subclassToPublications.put(subclass, new ArrayList<Map<String,String>>()); //list of publication information
|
||||
}
|
||||
|
||||
List<Map<String,String>> publicationsList = subclassToPublications.get(subclass);
|
||||
publicationsList.add(QueryUtils.querySolutionToStringValueMap(soln));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e, e);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue