Skip to content

Commit 37a53af

Browse files
Merge branch 'master' into SAK-51161
2 parents 989589e + 659f12a commit 37a53af

File tree

159 files changed

+2135
-1232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+2135
-1232
lines changed

.well-known/funding-manifest-urls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://www.apereo.org/funding.json

assignment/impl/src/java/org/sakaiproject/assignment/impl/AssignmentServiceImpl.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,7 +4607,6 @@ public Map<String, String> transferCopyEntities(String fromContext, String toCon
46074607
AssignmentAllPurposeItem oAllPurposeItem = assignmentSupplementItemService.getAllPurposeItem(oAssignmentId);
46084608
if (oAllPurposeItem != null) {
46094609
AssignmentAllPurposeItem nAllPurposeItem = assignmentSupplementItemService.newAllPurposeItem();
4610-
assignmentSupplementItemService.saveAllPurposeItem(nAllPurposeItem);
46114610
nAllPurposeItem.setAssignmentId(nAssignment.getId());
46124611
nAllPurposeItem.setTitle(oAllPurposeItem.getTitle());
46134612
nAllPurposeItem.setText(oAllPurposeItem.getText());
@@ -4629,14 +4628,23 @@ public Map<String, String> transferCopyEntities(String fromContext, String toCon
46294628
}
46304629
}
46314630
nAllPurposeItem.setAttachmentSet(nAllPurposeItemAttachments);
4631+
4632+
// First save the AllPurposeItem to persist it before creating access entries
4633+
assignmentSupplementItemService.saveAllPurposeItem(nAllPurposeItem);
4634+
4635+
// Now clean up existing access entries
46324636
assignmentSupplementItemService.cleanAllPurposeItemAccess(nAllPurposeItem);
4637+
4638+
// Create and save new access entries
46334639
Set<AssignmentAllPurposeItemAccess> accessSet = new HashSet<>();
46344640
AssignmentAllPurposeItemAccess access = assignmentSupplementItemService.newAllPurposeItemAccess();
46354641
access.setAccess(userDirectoryService.getCurrentUser().getId());
46364642
access.setAssignmentAllPurposeItem(nAllPurposeItem);
4637-
assignmentSupplementItemService.saveAllPurposeItemAccess(access);
46384643
accessSet.add(access);
46394644
nAllPurposeItem.setAccessSet(accessSet);
4645+
4646+
// Save both the access entry and the updated AllPurposeItem
4647+
assignmentSupplementItemService.saveAllPurposeItemAccess(access);
46404648
assignmentSupplementItemService.saveAllPurposeItem(nAllPurposeItem);
46414649
}
46424650
} catch (Exception e) {

assignment/impl/src/test/org/sakaiproject/assignment/impl/AssignmentTestConfiguration.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import org.sakaiproject.rubrics.api.RubricsService;
5757
import org.sakaiproject.search.api.SearchIndexBuilder;
5858
import org.sakaiproject.search.api.SearchService;
59-
import org.sakaiproject.serialization.MapperFactory;
6059
import org.sakaiproject.site.api.SiteService;
6160
import org.sakaiproject.springframework.orm.hibernate.AdditionalHibernateMappings;
6261
import org.sakaiproject.tags.api.TagService;
@@ -342,11 +341,4 @@ public TagService tagService() {
342341
public LTIService ltiService() {
343342
return mock(LTIService.class);
344343
}
345-
346-
@Bean(name = "mapperFactory")
347-
public MapperFactory mapperFactory() {
348-
MapperFactory factory = new MapperFactory();
349-
factory.init();
350-
return factory;
351-
}
352344
}

assignment/tool/src/java/org/sakaiproject/assignment/entityproviders/AssignmentEntityProvider.java

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -809,25 +809,19 @@ private Map<String, Object> submissionToMap(Set<String> activeSubmitters, Assign
809809
for (PeerAssessmentItem review : reviews) {
810810
if (!review.getRemoved() && (review.getScore() != null || (StringUtils.isNotBlank(review.getComment())))) {
811811
//only show peer reviews that have either a score or a comment saved
812-
if (assignment.getPeerAssessmentAnonEval()) {
813-
//annonymous eval
814-
review.setAssessorDisplayName(rb.getFormattedMessage("gen.reviewer.countReview", completedReviews.size() + 1));
815-
} else {
816-
//need to set the assessor's display name
817-
try {
818-
if (assignment.getIsGroup()) {
819-
String siteId = toolManager.getCurrentPlacement().getContext();
820-
Site site = siteService.getSite(siteId);
821-
review.setAssessorDisplayName(site.getGroup(review.getId().getAssessorUserId()).getTitle());
822-
} else {
823-
review.setAssessorDisplayName(userDirectoryService.getUser(review.getId().getAssessorUserId()).getDisplayName());
824-
}
825-
} catch (IdUnusedException | UserNotDefinedException e) {
826-
//reviewer doesn't exist or one of userId/groupId/siteId is wrong
827-
log.warn("Either no site, or user: {}", e.toString());
828-
//set a default one:
829-
review.setAssessorDisplayName(rb.getFormattedMessage("gen.reviewer.countReview", completedReviews.size() + 1));
812+
try {
813+
if (assignment.getIsGroup()) {
814+
String siteId = assignment.getContext();
815+
Site site = siteService.getSite(siteId);
816+
review.setAssessorDisplayName(site.getGroup(review.getId().getAssessorUserId()).getTitle());
817+
} else {
818+
review.setAssessorDisplayName(userDirectoryService.getUser(review.getId().getAssessorUserId()).getDisplayName());
830819
}
820+
} catch (IdUnusedException | UserNotDefinedException e) {
821+
//reviewer doesn't exist or one of userId/groupId/siteId is wrong
822+
log.warn("Either no site, or user: {}", e.toString());
823+
//set a default one:
824+
review.setAssessorDisplayName(rb.getFormattedMessage("gen.reviewer.countReview", completedReviews.size() + 1));
831825
}
832826
// get attachments for peer review item
833827
List<PeerAssessmentAttachment> attachments = assignmentPeerAssessmentService.getPeerAssessmentAttachments(review.getId().getSubmissionId(), review.getId().getAssessorUserId());

assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10720,8 +10720,8 @@ public void doEdit_assignment(RunData data) {
1072010720
state.setAttribute(NEW_ASSIGNMENT_PEER_ASSESSMENT_NUM_REVIEWS, a.getPeerAssessmentNumberReviews());
1072110721
state.setAttribute(NEW_ASSIGNMENT_PEER_ASSESSMENT_INSTRUCTIONS, a.getPeerAssessmentInstructions());
1072210722
}
10723-
if (!(Boolean) serverConfigurationService.getBoolean("assignment.usePeerAssessment", true)) {
10724-
state.setAttribute(NEW_ASSIGNMENT_USE_PEER_ASSESSMENT, false);
10723+
if (!serverConfigurationService.getBoolean("assignment.usePeerAssessment", true)) {
10724+
state.setAttribute(NEW_ASSIGNMENT_USE_PEER_ASSESSMENT, Boolean.FALSE.toString());
1072510725
}
1072610726
// set whether we use the review service or not
1072710727
// TODO content review

assignment/tool/src/webapp/vm/assignment/assignment_macros.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<i class="fa fa-users" aria-hidden="true" title="$tlang.getString('gen.groupassignment')"></i>
2525
#end
2626
#if (!$assignment.getAttachments().isEmpty())
27-
<i class="icon-sakai--clip" aria-hidden="true"></i>
27+
<span class="si si-attachment" aria-hidden="true"></span>
2828
<span class="sr-only">$tlang.getString("gen.has.att")</span>
2929
#end
3030
#if ($assignment.getContentReview())

assignment/tool/src/webapp/vm/assignment/chef_assignments_instructor_list_submissions.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ function printView(url) {
459459
#end
460460

461461
#if ($gusers)
462-
<div class="badge text-bg-info fs-6">
462+
<div class="badge bg-primary fs-6">
463463
#foreach ($user in $gusers)
464464
#if($velocityCount > 1), #end
465465
#set($is_user_duplicate=false)

assignment/tool/src/webapp/vm/assignment/chef_assignments_student_view_submission.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ $(document).ready(function(){
555555
</label>
556556
</td>
557557
<td headers="description" width="100%"> ##mozilla does not resize table children dynamically , so set here
558-
<span class="badge text-bg-info fs-6">
558+
<span class="badge bg-primary fs-6">
559559
#set($gusers = $!service.getSortedGroupUsers($group))
560560
#foreach ($user in $gusers)
561561
$formattedText.escapeHtml($user.getDisplayName())#if ($showUserId) ($formattedText.escapeHtml($user.getDisplayId())) #end

calendar/calendar-tool/tool/src/java/org/sakaiproject/calendar/tool/CalendarAction.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4649,7 +4649,6 @@ public void doNew(RunData data, Context context)
46494649
state.setState(STATE_NEW);
46504650
state.setCalendarEventId("", "");
46514651
state.setIsNewCalendar(true);
4652-
state.setIsPastAlertOff(true);
46534652
sstate.setAttribute(FREQUENCY_SELECT, null);
46544653
sstate.setAttribute(CalendarAction.SSTATE__RECURRING_RULE, null);
46554654

@@ -4827,18 +4826,6 @@ else if(hour.equals("100") || minute.equals("100")) {
48274826

48284827
state.setNewData(calId, title,description,Integer.parseInt(month),Integer.parseInt(day),year,houri,Integer.parseInt(minute),Integer.parseInt(dhour),Integer.parseInt(dminute),type,timeType,location, addfieldsMap, intentionStr);
48294828
state.setState(STATE_NEW);
4830-
}
4831-
else if( event_startTime.before(now_time) && state.getIsPastAlertOff() ) {
4832-
// IsPastAlertOff
4833-
// true: no alert shown -> then show the alert, set false;
4834-
// false: Alert shown, if user click ADD - doAdd again -> accept it, set true, set alert empty;
4835-
4836-
String errorCode = rb.getString("java.alert.past");
4837-
addAlert(sstate, errorCode);
4838-
4839-
state.setNewData(state.getPrimaryCalendarReference(), title,description,Integer.parseInt(month),Integer.parseInt(day),year,houri,Integer.parseInt(minute),Integer.parseInt(dhour),Integer.parseInt(dminute),type,timeType,location, addfieldsMap, intentionStr);
4840-
state.setState(STATE_NEW);
4841-
state.setIsPastAlertOff(false);
48424829
} else if (!DateFormatterUtil.checkDate(Integer.parseInt(day), Integer.parseInt(month), Integer.parseInt(year))) {
48434830
addAlert(sstate, rb.getString("date.invalid"));
48444831
state.setNewData(state.getPrimaryCalendarReference(), title,description,Integer.parseInt(month),Integer.parseInt(day),year,houri,Integer.parseInt(minute),Integer.parseInt(dhour),Integer.parseInt(dminute),type,timeType,location, addfieldsMap, intentionStr);

calendar/calendar-tool/tool/src/java/org/sakaiproject/calendar/tool/CalendarActionState.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ public class CalendarActionState
7676

7777
private String m_AttachmentFlag = "false";
7878
private LocalEvent savedData = new LocalEvent();
79-
private boolean m_IsPastAlertOff = true;
80-
8179

8280
private String m_state = "";
8381
private String currentpage = "second";
@@ -213,16 +211,6 @@ public void setIsNewCalendar(boolean isNewcal)
213211

214212
} // setIsNewCalendar
215213

216-
/**
217-
* Get the status of past alert off: true - no alert shown; false - alert shown
218-
* @return IsPastAlertOff
219-
*/
220-
public boolean getIsPastAlertOff()
221-
{
222-
return m_IsPastAlertOff;
223-
224-
} // getIsPastAlertOff
225-
226214
/**
227215
* Gets the main calendar ID associated with the event list. Many calendars may be merged into this list, but there is only one one calendar that is used for adding/modifying events.
228216
*/
@@ -231,16 +219,6 @@ public String getPrimaryCalendarReference()
231219
return m_primaryCalendarReference;
232220
}
233221

234-
/**
235-
* Set the status of past alert off: true - no alert shown; false - alert shown
236-
* @param IsPastAlertOff The status of past alert off: true - no alert shown; false - alert shown
237-
*/
238-
public void setIsPastAlertOff(boolean IsPastAlertOff)
239-
{
240-
m_IsPastAlertOff = IsPastAlertOff;
241-
242-
} // setIsPastAlertOff
243-
244222
/**
245223
* Sets the main calendar ID associated with the event list. Many calendars may be merged into this
246224
* list, but there is only one one calendar that is used for adding/modifying events/

calendar/calendar-tool/tool/src/webapp/vm/calendar/chef_calendar_new.vm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,18 +370,17 @@ $(function() {
370370
#set($day=$date.getDay())
371371
#set($year=$todayYear)
372372
#end
373-
<input type="text" id="newCalendarDate" name="newCalendarDate" class="datepicker" value="">
373+
<input type="text" id="newCalendarDate" name="newCalendarDate" class="datepicker">
374374
<script type="text/javascript">
375375
localDatePicker({
376376
input:'#newCalendarDate',
377377
useTime:0,
378-
val:"$year$H$month$H$day",
378+
val:"${year}-${month}-${day}",
379379
parseFormat: 'YYYY-MM-DD',
380380
ashidden:{
381381
month:"month",
382382
day:"day",
383383
year:"yearSelect",
384-
iso8601: 'newCalendarDateISO8601'
385384
}
386385
});
387386
</script>

common/archive-impl/impl2/src/java/org/sakaiproject/archive/impl/SiteMerger.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
import org.sakaiproject.util.Xml;
5959
import org.sakaiproject.util.MergeConfig;
6060

61+
import org.sakaiproject.component.cover.ComponentManager;
62+
6163
@Slf4j
6264
@Setter
6365
public class SiteMerger {
@@ -289,13 +291,16 @@ private void processMerge(String filePath, String siteId, StringBuilder results,
289291
serviceName = translateServiceName(element.getTagName());
290292
}
291293

294+
EntityProducer service = (EntityProducer) org.sakaiproject.component.cover.ComponentManager.get(serviceName);
292295

293-
Collection<EntityProducer> entityProducers = entityManager.getEntityProducers();
294296
// find the service using the EntityManager
295-
EntityProducer service = entityProducers.stream()
296-
.filter(ep -> serviceName.equals(ep.getClass().getName()) || serviceName.equals(ep.getLabel()))
297-
.findFirst()
298-
.orElse(null);
297+
if ( service == null ) {
298+
Collection<EntityProducer> entityProducers = entityManager.getEntityProducers();
299+
service = entityProducers.stream()
300+
.filter(ep -> serviceName.equals(ep.getClass().getName()) || serviceName.equals(ep.getLabel()))
301+
.findFirst()
302+
.orElse(null);
303+
}
299304

300305
try {
301306
String msg = "";

conversations/api/src/main/resources/conversations.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ restore=Restore
195195
restore_this_post=Restore this post. It will be visible to everybody once more.
196196
save=Save
197197
save_as_draft=Save as Draft
198+
search=Search
198199
search_field_tooltip=Search input field
199200
search_placeholder=Search
200201
settings=Settings

conversations/impl/src/main/java/org/sakaiproject/conversations/impl/ConversationsServiceImpl.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ private TopicTransferBean decorateTopicBean(TopicTransferBean topicBean, Convers
18881888
topicBean.canPin = settings.getAllowPinning() && securityService.unlock(Permissions.TOPIC_PIN.label, siteRef);
18891889
topicBean.canBookmark = settings.getAllowBookmarking();
18901890
topicBean.canTag = securityService.unlock(Permissions.TOPIC_TAG.label, siteRef);
1891-
topicBean.canReact = !topicBean.isMine && settings.getAllowReactions();
1891+
topicBean.canReact = !topicBean.isMine && settings.getAllowReactions() && securityService.unlock(Permissions.POST_REACT.label, siteRef);
18921892
topicBean.canUpvote = !topicBean.isMine && settings.getAllowUpvoting() && !topicBean.hidden && securityService.unlock(Permissions.POST_UPVOTE.label, siteRef);
18931893
topicBean.canViewUpvotes = settings.getAllowUpvoting();
18941894
} else {
@@ -2697,13 +2697,27 @@ public String archive(String siteId, Document doc, Stack<Element> stack, String
26972697
topicEl.setAttribute("title", topic.getTitle());
26982698
topicEl.setAttribute("type", topic.getType().name());
26992699
topicEl.setAttribute("post-before-viewing", Boolean.toString(topic.getMustPostBeforeViewing()));
2700+
topicEl.setAttribute("anonymous", Boolean.toString(topic.getAnonymous()));
27002701
topicEl.setAttribute("allow-anonymous-posts", Boolean.toString(topic.getAllowAnonymousPosts()));
27012702
topicEl.setAttribute("pinned", Boolean.toString(topic.getPinned()));
27022703
topicEl.setAttribute("draft", Boolean.toString(topic.getDraft()));
27032704
topicEl.setAttribute("visibility", topic.getVisibility().name());
27042705
topicEl.setAttribute("creator", topic.getMetadata().getCreator());
27052706
topicEl.setAttribute("created", Long.toString(topic.getMetadata().getCreated().getEpochSecond()));
27062707

2708+
if (topic.getShowDate() != null) {
2709+
topicEl.setAttribute("show-date", Long.toString(topic.getShowDate().getEpochSecond()));
2710+
}
2711+
if (topic.getHideDate() != null) {
2712+
topicEl.setAttribute("hide-date", Long.toString(topic.getHideDate().getEpochSecond()));
2713+
}
2714+
if (topic.getLockDate() != null) {
2715+
topicEl.setAttribute("lock-date", Long.toString(topic.getLockDate().getEpochSecond()));
2716+
}
2717+
if (topic.getDueDate() != null) {
2718+
topicEl.setAttribute("due-date", Long.toString(topic.getDueDate().getEpochSecond()));
2719+
}
2720+
27072721
Element messageEl = doc.createElement("message");
27082722
messageEl.appendChild(doc.createCDATASection(topic.getMessage()));
27092723
topicEl.appendChild(messageEl);
@@ -2749,10 +2763,15 @@ public String merge(String toSiteId, Element root, String archivePath, String fr
27492763
topicBean.mustPostBeforeViewing = Boolean.parseBoolean(topicEl.getAttribute("post-before-viewing"));
27502764
topicBean.anonymous = Boolean.parseBoolean(topicEl.getAttribute("anonymous"));
27512765
topicBean.allowAnonymousPosts = Boolean.parseBoolean(topicEl.getAttribute("allow-anonymous-posts"));
2752-
topicBean.draft = Boolean.parseBoolean(topicEl.getAttribute("draft"));
2766+
topicBean.draft = true;
27532767
topicBean.pinned = Boolean.parseBoolean(topicEl.getAttribute("pinned"));
27542768
topicBean.visibility = topicEl.getAttribute("visibility");
27552769

2770+
topicBean.showDate = topicEl.hasAttribute("show-date") ? Instant.ofEpochSecond(Long.parseLong(topicEl.getAttribute("show-date"))) : null;
2771+
topicBean.hideDate = topicEl.hasAttribute("hide-date") ? Instant.ofEpochSecond(Long.parseLong(topicEl.getAttribute("hide-date"))) : null;
2772+
topicBean.lockDate = topicEl.hasAttribute("lock-date") ? Instant.ofEpochSecond(Long.parseLong(topicEl.getAttribute("lock-date"))) : null;
2773+
topicBean.dueDate = topicEl.hasAttribute("due-date") ? Instant.ofEpochSecond(Long.parseLong(topicEl.getAttribute("due-date"))) : null;
2774+
27562775
NodeList messageNodes = topicEl.getElementsByTagName("message");
27572776
if (messageNodes.getLength() == 1) {
27582777
topicBean.message = ((Element) messageNodes.item(0)).getFirstChild().getNodeValue();

0 commit comments

Comments
 (0)