Skip to content

Commit b7b4c79

Browse files
author
r.tschu
committed
fixed failed merge
1 parent a9f76cd commit b7b4c79

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

block_evasys_sync.php

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public function get_content() {
220220
'startdisabled' => $startdisabled || $standardttimemode,
221221
'enddisabled' => $enddisabled || $standardttimemode,
222222
'onlyend' => $startdisabled && !$standardttimemode,
223+
'disablesubmit' => $enddisabled,
223224
// If the evaluation hasn't ended yet, display option to restart it.
224225
'startoption' => $startoption,
225226
// Only allow coursemapping before starting an evaluation.

classes/evasys_synchronizer.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,11 @@ public function notify_evaluation_responsible_person($dates, $newparticipantsadd
302302
"Falls Sie für diesen Kurs bereits eine E-Mail erhalten haben, wurden gerade neue Teilnehmer*innen ".
303303
"hinzugefügt oder der Zeitraum angepasst. Dies ist ggf. unten angegeben.\r\n\r\n";
304304

305+
$standardtime = false;
305306
if ($dates != "Standard") {
306307
$notifsubject .= ' SONDERWUNSCH';
307308
} else {
309+
$standardtime = true;
308310
$dates = self::getstandardtimemode($course->category);
309311
}
310312
$startdate = new \DateTime('@' . $dates["start"], \core_date::get_server_timezone_object());
@@ -315,7 +317,7 @@ public function notify_evaluation_responsible_person($dates, $newparticipantsadd
315317
$formattedenddate = $enddate->format('d.m.Y H:i');
316318

317319
$notiftext .= "Gewünschter Evaluationszeitraum: " . $formattedstartdate . " bis " .
318-
$formattedenddate . $textdatechanged . "\r\n\r\n";
320+
$formattedenddate . $textdatechanged . ($standardtime ? " (Standardzeitraum)" : "") . "\r\n\r\n";
319321
if ($newparticipantsadded) {
320322
$notiftext .= "Der Evaluation wurden neue Teilnehmer*innen hinzugefügt.\r\n\r\n";
321323
}
@@ -395,10 +397,11 @@ public function set_evaluation_period($dates) : bool {
395397
$data = new course_evaluation_allocation(0);
396398
$data->set('course', $this->courseid);
397399
$data->set('state', course_evaluation_allocation::STATE_MANUAL);
398-
}
399-
400-
if ($data->get('startdate') != $dates['start'] || $data->get('enddate') != $dates['end']) {
401-
$changed = true;
400+
} else {
401+
// Don't display date changed warning on first sync.
402+
if ($data->get('startdate') != $dates['start'] || $data->get('enddate') != $dates['end']) {
403+
$changed = true;
404+
}
402405
}
403406

404407
$data->set('startdate', $dates['start']);

templates/block.mustache

+5-7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Example context (json):
2525
"startdisabled": false,
2626
"enddisabled": false,
2727
"startoption": false,
28+
"onlyend": false,
29+
"disablesubmit": false,
2830
"coursemappingenabled": true,
2931
"nostudents": false,
3032
"emailsentnotice": true,
@@ -41,7 +43,7 @@ Example context (json):
4143
{{#courses}}
4244
{{#.}}
4345
<div title="{{# str}}evacourseid, block_evasys_sync{{/str}} {{evasyscourseid}}
44-
{{# str}}evainternalid, block_evasys_sync{{/str}} {{technicalid}}">
46+
{{# str}}evainternalid, block_evasys_sync{{/str}} {{technicalid}}">
4547
<span class="emphasize">{{# str}}evacoursename, block_evasys_sync{{/str}}</span> {{evasyscoursetitle}}</div>
4648
<div>
4749
<span class="emphasize">{{# str}}countparticipants, block_evasys_sync{{/str}}</span>
@@ -64,10 +66,6 @@ Example context (json):
6466
{{#coursemappingenabled}}
6567
{{> block_evasys_sync/coursemapping}}
6668
{{/coursemappingenabled}}
67-
<form action="{{href}}" method="post" id="evasys_block_form">
68-
<input type="hidden" name="sesskey" value="{{sesskey}}">
69-
<input type="hidden" name="courseid" value="{{courseid}}">
70-
{{#startdisabled}}<input id="only_end" type="hidden" name="only_end" value="true">{{/startdisabled}}
7169
{{#warning}}<div style="color: red; ">{{# str}}warning_inconsistent_states, block_evasys_sync{{/str}}</div>{{/warning}}
7270
{{#emailsentnotice}}<div style="color: limegreen; ">{{# str}}emailsentnotice, block_evasys_sync{{/str}}</div>{{/emailsentnotice}}
7371
{{#evaluationperiodsetnotice}}<div style="color: limegreen; ">{{# str}}evalperiodsetnotice, block_evasys_sync{{/str}}</div>{{/evaluationperiodsetnotice}}
@@ -110,10 +108,10 @@ Example context (json):
110108
{{/block_evasys_sync/datetimepicker}}
111109
</fieldset>
112110
{{^direct}}
113-
<input id='evasyssubmitbutton' class="in_box_button" type="submit" value="{{# str}}invitestudents, block_evasys_sync{{/str}}" {{#enddisabled}}disabled{{/enddisabled}}/>
111+
<input id='evasyssubmitbutton' class="in_box_button" type="submit" value="{{# str}}invitestudents, block_evasys_sync{{/str}}" {{#disablesubmit}}disabled{{/disablesubmit}}/>
114112
{{/direct}}
115113
{{#direct}}
116-
<input id='evasyssubmitbutton' class="in_box_button" type="submit" value="{{# str}}planorstartevaluation, block_evasys_sync{{/str}}" {{#enddisabled}}disabled{{/enddisabled}}/>
114+
<input id='evasyssubmitbutton' class="in_box_button" type="submit" value="{{# str}}planorstartevaluation, block_evasys_sync{{/str}}" {{#disablesubmit}}disabled{{/disablesubmit}}/>
117115
{{/direct}}
118116
{{/showcontrols}}
119117
</form>

0 commit comments

Comments
 (0)