Skip to content
Snippets Groups Projects
Commit 0ad2dad5 authored by srosse's avatar srosse
Browse files

Merge OpenOLAT 12.3 to OpenOLAT default branch with 51c56b217e536d4f046edcfa0a4417ca4d645551

parents 2007596a 586a42bb
No related branches found
No related tags found
No related merge requests found
......@@ -314,7 +314,6 @@ public class CheckListRunController extends FormBasicController implements Contr
theOne = wrapper.getDbCheckbox();
}
boolean grantPoints = false;
if(theOne == null) {
//only warning because this happen in course preview
logWarn("A checkbox is missing: " + courseOres + " / " + courseNode.getIdent(), null);
......@@ -325,10 +324,7 @@ public class CheckListRunController extends FormBasicController implements Contr
} else {
score = 0f;
}
if(wrapper.getCheckbox().getPoints() != null) {
grantPoints = true;
}
checkboxManager.check(theOne, getIdentity(), score, Boolean.valueOf(checked));
//make sure all results is on the database before calculating some scores
//manager commit already
......@@ -337,11 +333,10 @@ public class CheckListRunController extends FormBasicController implements Contr
Checkbox checkbox = wrapper.getCheckbox();
logUpdateCheck(checkbox.getCheckboxId(), checkbox.getTitle());
}
exposeUserDataToVC(ureq, flc);
return grantPoints;
return courseNode.hasScoreConfigured() || courseNode.hasPassedConfigured();
}
private void logUpdateCheck(String checkboxId, String boxTitle) {
......
......@@ -47,9 +47,7 @@ import org.olat.core.logging.Tracing;
import org.olat.core.util.FileUtils;
import org.olat.core.util.StringHelper;
import org.olat.core.util.Util;
import org.olat.core.util.nodes.INode;
import org.olat.core.util.tree.TreeVisitor;
import org.olat.core.util.tree.Visitor;
import org.olat.core.util.vfs.OlatRelPathImpl;
import org.olat.core.util.vfs.VFSContainer;
import org.olat.modules.docpool.DocumentPoolModule;
......@@ -59,6 +57,7 @@ import org.olat.modules.taxonomy.TaxonomyService;
import org.olat.modules.taxonomy.manager.TaxonomyTreeBuilder;
import org.olat.modules.taxonomy.model.TaxonomyRefImpl;
import org.olat.modules.taxonomy.model.TaxonomyTreeNode;
import org.olat.modules.taxonomy.model.TaxonomyTreeNodeType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -122,46 +121,16 @@ public class DocumentPoolNotificationsHandler implements NotificationsHandler {
TreeModel model = builder.buildTreeModel();
si = new SubscriptionInfo(subscriber.getKey(), p.getType(), getTitleItemForPublisher(), null);
new TreeVisitor(new Visitor() {
@Override
public void visit(INode node) {
TaxonomyTreeNode tNode = (TaxonomyTreeNode)node;
if(tNode.getTaxonomyLevel() != null && tNode.isDocumentsLibraryEnabled() && tNode.isCanRead()) {
VFSContainer container = taxonomyService.getDocumentsLibrary(tNode.getTaxonomyLevel());
List<FileInfo> fInfos = FolderManager.getFileInfos(((OlatRelPathImpl)container).getRelPath(), compareDate);
String prefixBusinessPath = "[DocumentPool:" + taxonomy.getKey() + "][TaxonomyLevel:" + tNode.getTaxonomyLevel().getKey() + "][path=";
for (FileInfo infos:fInfos) {
String title = infos.getRelPath();
// don't show changes in meta-directories. first quick check
// for any dot files and then compare with our black list of
// known exclude prefixes
if (title != null && title.indexOf("/.") != -1 && FileUtils.isMetaFilename(title)) {
// skip this file, continue with next item in folder
continue;
}
MetaInfo metaInfo = infos.getMetaInfo();
String iconCssClass = null;
if (metaInfo != null) {
if (metaInfo.getTitle() != null) {
title += " (" + metaInfo.getTitle() + ")";
}
iconCssClass = metaInfo.getIconCssClass();
}
Identity ident = infos.getAuthor();
Date modDate = infos.getLastModified();
String desc = translator.translate("notifications.document.entry", new String[] { title, NotificationHelper.getFormatedName(ident) });
String urlToSend = null;
String businessPath = null;
if(p.getBusinessPath() != null) {
businessPath = prefixBusinessPath + infos.getRelPath() + "]";
urlToSend = BusinessControlFactory.getInstance().getURLFromBusinessPathString(businessPath);
}
si.addSubscriptionListItem(new SubscriptionListItem(desc, urlToSend, businessPath, modDate, iconCssClass));
}
}
new TreeVisitor(node -> {
TaxonomyTreeNode tNode = (TaxonomyTreeNode)node;
if(tNode.getTaxonomyLevel() != null && tNode.isDocumentsLibraryEnabled() && tNode.isCanRead()) {
VFSContainer container = taxonomyService.getDocumentsLibrary(tNode.getTaxonomyLevel());
String prefixBusinessPath = "[DocumentPool:" + taxonomy.getKey() + "][TaxonomyLevel:" + tNode.getTaxonomyLevel().getKey() + "][path=";
createSubscriptionInfo(container, prefixBusinessPath, compareDate, si, p, translator);
} else if(tNode.getType() == TaxonomyTreeNodeType.templates) {
VFSContainer container = taxonomyService.getDocumentsLibrary(taxonomy);
String prefixBusinessPath = "[DocumentPool:" + taxonomy.getKey() + "][Templates:0s][path=";
createSubscriptionInfo(container, prefixBusinessPath, compareDate, si, p, translator);
}
}, model.getRootNode(), false).visitAll();
} else {
......@@ -173,6 +142,40 @@ public class DocumentPoolNotificationsHandler implements NotificationsHandler {
return notificationsManager.getNoSubscriptionInfo();
}
}
private void createSubscriptionInfo(VFSContainer container, String prefixBusinessPath, Date compareDate, SubscriptionInfo si, Publisher p, Translator translator) {
List<FileInfo> fInfos = FolderManager.getFileInfos(((OlatRelPathImpl)container).getRelPath(), compareDate);
for (FileInfo infos:fInfos) {
String title = infos.getRelPath();
// don't show changes in meta-directories. first quick check
// for any dot files and then compare with our black list of
// known exclude prefixes
if (title != null && title.indexOf("/.") != -1 && FileUtils.isMetaFilename(title)) {
// skip this file, continue with next item in folder
continue;
}
MetaInfo metaInfo = infos.getMetaInfo();
String iconCssClass = null;
if (metaInfo != null) {
if (metaInfo.getTitle() != null) {
title += " (" + metaInfo.getTitle() + ")";
}
iconCssClass = metaInfo.getIconCssClass();
}
Identity ident = infos.getAuthor();
Date modDate = infos.getLastModified();
String desc = translator.translate("notifications.document.entry", new String[] { title, NotificationHelper.getFormatedName(ident) });
String urlToSend = null;
String businessPath = null;
if(p.getBusinessPath() != null) {
businessPath = prefixBusinessPath + infos.getRelPath() + "]";
urlToSend = BusinessControlFactory.getInstance().getURLFromBusinessPathString(businessPath);
}
si.addSubscriptionListItem(new SubscriptionListItem(desc, urlToSend, businessPath, modDate, iconCssClass));
}
}
@Override
public String createTitleInfo(Subscriber subscriber, Locale locale) {
......
......@@ -80,7 +80,6 @@ public class TaxonomyTreeNode extends GenericTreeNode {
return taxonomyLevel != null && taxonomyLevel.getType() != null
&& taxonomyLevel.getType().isDocumentsLibraryEnabled()
&& (taxonomyLevel.getType().isDocumentsLibraryManageCompetenceEnabled()
|| taxonomyLevel.getType().isDocumentsLibraryTeachCompetenceReadEnabled()
|| taxonomyLevel.getType().isDocumentsLibraryTeachCompetenceReadEnabled()
|| taxonomyLevel.getType().isDocumentsLibraryHaveCompetenceReadEnabled()
|| taxonomyLevel.getType().isDocumentsLibraryTargetCompetenceReadEnabled());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment