Добавлены ограничения по датам и времени пары для выставления посещаемости

This commit is contained in:
RomanGolienko 2025-01-17 14:14:08 +03:00
parent cfb09475b9
commit 19c0440622
1 changed files with 15 additions and 6 deletions

View File

@ -93,9 +93,18 @@
<td style="vertical-align: middle; text-align: center; width: 10%"> <h5>{$class.time_name.0} - {$class.time_name.1}</h5></td> <td style="vertical-align: middle; text-align: center; width: 10%"> <h5>{$class.time_name.0} - {$class.time_name.1}</h5></td>
<td><div class="accordion-group"> <td><div class="accordion-group">
<div class="accordion-heading"> <div class="accordion-heading">
{if $key > $currentTime.time1 AND ! isset($smarty.post.date_request) } <!-- Если эта пара еще не наступила и реквест даты не задан -->
<div class="accordion-toggle" style="pointer-events: none;"> {$class.predmet} <span style="color:#730707">- еще не наступил!</span> </div>
{else if $key > $currentTime.time1 AND $smarty.post.date_request == $currentTime.date}
<a class="accordion-toggle {if $key != $currentTime.time1 || $class.approval == 1 } collapsed {/if}" data-toggle="collapse" data-parent="#accordion{$day.day1}" href="#collapse_{$class.day1}-{$class.time1}"> <a class="accordion-toggle {if $key != $currentTime.time1 || $class.approval == 1 } collapsed {/if}" data-toggle="collapse" data-parent="#accordion{$day.day1}" href="#collapse_{$class.day1}-{$class.time1}">
{$class.predmet} {if $class.approval == 1} <span style="text-decoration: unset; color:#730707" >- отмечено!</span> {/if} {$class.predmet} {if $class.approval == 1} <span style="text-decoration: unset; color:#730707" >- отмечено!</span> {/if}
</a> </a>
{else}
<a class="accordion-toggle {if $key != $currentTime.time1 || $class.approval == 1 } collapsed {/if}" data-toggle="collapse" data-parent="#accordion{$day.day1}" href="#collapse_{$class.day1}-{$class.time1}">
{$class.predmet} {if $class.approval == 1} <span style="text-decoration: unset; color:#730707" >- отмечено!</span> {/if}
</a>
{/if}
</div> </div>
<div id="collapse_{$class.day1}-{$class.time1}" class="accordion-body collapse {if $key == $currentTime.time1 AND $class.approval != 1 } in {/if}"> <div id="collapse_{$class.day1}-{$class.time1}" class="accordion-body collapse {if $key == $currentTime.time1 AND $class.approval != 1 } in {/if}">
<div class="accordion-inner"> <div class="accordion-inner">
@ -115,7 +124,7 @@
<input type="hidden" name="attendance_add_edit[attendance][{$student_id}]" value="0"> <input type="hidden" name="attendance_add_edit[attendance][{$student_id}]" value="0">
<label for="{$student|replace:' ':''}{$key}"></label> <label for="{$student|replace:' ':''}{$key}"></label>
<input class="custom-checkbox" type="checkbox" name="attendance_add_edit[attendance][{$student_id}]" id="{$student|replace:' ':''}{$key}" value="1" {if $att == '1'} checked {/if} {if $class.approval == 1} disabled {/if}> <input class="custom-checkbox" type="checkbox" name="attendance_add_edit[attendance][{$student_id}]" id="{$student|replace:' ':''}{$key}" value="1" {if $att == '1'} checked {/if} {if $class.approval == 1 OR $smarty.post.date_request != $currentTime.date } disabled {/if}>
</td> </td>
</tr> </tr>
@ -134,11 +143,11 @@
<input type="hidden" name="attendance_add_edit[info][approval]" value="0"> <input type="hidden" name="attendance_add_edit[info][approval]" value="0">
<div class="row-fluid"> <div class="row-fluid">
<div class="span2"> <div class="span2">
<button type="submit" class="btn btn-success" {if $class.approval == 1} disabled {/if}>Сохранить</button> <button type="submit" class="btn btn-success" {if $class.approval == 1 OR $smarty.post.date_request != $currentTime.date} disabled {/if}>Сохранить</button>
</div> </div>
{if $currentUserInfo.role != 'student'} {if $currentUserInfo.role != 'student'}
<div class="span2"> <div class="span2">
<button type="submit" class="btn btn-danger" id="final_button" name="attendance_add_edit[info][approval]" value="1" {if $class.approval == 1} disabled {/if}> Закрыть </button> <button type="submit" class="btn btn-danger" id="final_button" name="attendance_add_edit[info][approval]" value="1" {if $class.approval == 1 OR $smarty.post.date_request != $currentTime.date} disabled {/if}> Закрыть </button>
<label for="final_button" style="color:#730707; pointer-events: none;"> Проставить посещаемость и закрыть возможность для редактирования. Действие необратимо!</label> <label for="final_button" style="color:#730707; pointer-events: none;"> Проставить посещаемость и закрыть возможность для редактирования. Действие необратимо!</label>
</div> </div>
{/if} {/if}