Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolves #535 #595

Merged
merged 1 commit into from
Oct 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.cocoon.caching.CacheableProcessingComponent;
import org.apache.excalibur.source.SourceValidity;
import org.apache.excalibur.source.impl.validity.NOPValidity;
import org.dspace.core.ConfigurationManager;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.services.ConfigurationService;
Expand All @@ -33,6 +34,8 @@
import java.io.IOException;
import java.sql.SQLException;

import static org.apache.commons.lang3.StringUtils.isNotBlank;

/**
* Navigation Elements for viewing statistics related to Items.
*
Expand Down Expand Up @@ -113,12 +116,15 @@ public void addOptions(Options options) throws SAXException, WingException, UIEx
}
}

// ufal - this is called only for authorised with admin rights (e.g., admin rights to a community/collection)
if(dso != null && dso.getHandle() != null){
statistics.addItemXref(contextPath + "/handle/" + dso.getHandle() + "/statistics-google", T_statistics_ga_head);
}else {
statistics.addItemXref(contextPath + "/statistics-google", T_statistics_ga_head);
}
//show ga link only if we have a key file set
if(isNotBlank(ConfigurationManager.getProperty("lr", "lr.ga.analytics.key.file"))) {
// ufal - this is called only for authorised with admin rights (e.g., admin rights to a community/collection)
if (dso != null && dso.getHandle() != null) {
statistics.addItemXref(contextPath + "/handle/" + dso.getHandle() + "/statistics-google", T_statistics_ga_head);
} else {
statistics.addItemXref(contextPath + "/statistics-google", T_statistics_ga_head);
}
}
}

protected boolean displayStatsType(Context context, String type, DSpaceObject dso) throws SQLException {
Expand Down