Skip to content

Commit

Permalink
Merge pull request #921 from SmoKE585/alpha
Browse files Browse the repository at this point in the history
Исправление таймеров и проверки обновлений
  • Loading branch information
sergejey authored Feb 24, 2021
2 parents f83abe8 + 5f2be68 commit 94396e6
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 21 deletions.
5 changes: 4 additions & 1 deletion modules/saverestore/saverestore.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ function admin(&$out)
$total = count($items);
if ($total) {
$iteration = 0;

// echo '<pre>';
// var_dump($items);
// die();
foreach($items as $key => $value) {
$itm = array();

Expand All @@ -212,6 +214,7 @@ function admin(&$out)
$itm['LINK'] = $value['link']['href'];
$itm['UPDATED'] = strtotime($value['updated']['textvalue']);
$itm['UPDATE_TEXT'] = date('d.m.Y H:i', $itm['UPDATED']);
$itm['DESC_UPDATE'] = strip_tags(preg_split('/\\r\\n?|\\n/', $value['content']['textvalue'])[3]);
$itm['MYVERSION'] = ($itm['ID'] == $this->config['LATEST_UPDATED_ID']) ? 1 : 0;
$out['UPDATES'][] = $itm;
$iteration++;
Expand Down
5 changes: 1 addition & 4 deletions templates/classes/classes_search_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
@version 0.2 (auto-set)
#-->

[#if DEFAULT_VIEW="list"#]
[#inc view_list.html#]
[#else#]

[#inc view_tree.html#]
[#endif#]
4 changes: 2 additions & 2 deletions templates/classes/views/SMotions.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
timeConvertVar = timeConvert(sDATA);
currentTime = new Date();

if((currentTime.getDate() - timeConvertVar[0]) == 0) {
if(currentTime.getFullYear() == timeConvertVar[2] && twoDigits(currentTime.getMonth()+1) == timeConvertVar[1] && (currentTime.getDate() - timeConvertVar[0]) == 0) {
beautyText = '<#LANG_DEVICES_PASSED_TODAY_IN#> ' + timeConvertVar[3] + ':' + timeConvertVar[4];
} else if((currentTime.getDate() - timeConvertVar[0]) == 1) {
} else if(currentTime.getFullYear() == timeConvertVar[2] && twoDigits(currentTime.getMonth()+1) == timeConvertVar[1] && (currentTime.getDate() - timeConvertVar[0]) == 1) {
beautyText = '<#LANG_DEVICES_PASSED_YESTERDAY_IN#> ' + timeConvertVar[3] + ':' + timeConvertVar[4] + ':' + timeConvertVar[5];
} else {
beautyText = timeConvertVar[0] + '.' + timeConvertVar[1] + '.' + timeConvertVar[2] + ' ' + timeConvertVar[3] + ':' + timeConvertVar[4] + ':' + timeConvertVar[5];
Expand Down
4 changes: 2 additions & 2 deletions templates/classes/views/SOpenClose.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
timeConvertVar = timeConvert(sDATA);
currentTime = new Date();

if((currentTime.getDate() - timeConvertVar[0]) == 0) {
if(twoDigits(currentTime.getMonth()+1) == timeConvertVar[1] && (currentTime.getDate() - timeConvertVar[0]) == 0) {
beautyText = '<#LANG_DEVICES_PASSED_TODAY_IN#> ' + timeConvertVar[3] + ':' + timeConvertVar[4];
} else if((currentTime.getDate() - timeConvertVar[0]) == 1) {
} else if(twoDigits(currentTime.getMonth()+1) == timeConvertVar[1] && (currentTime.getDate() - timeConvertVar[0]) == 1) {
beautyText = '<#LANG_DEVICES_PASSED_YESTERDAY_IN#> ' + timeConvertVar[3] + ':' + timeConvertVar[4] + ':' + timeConvertVar[5];
} else {
beautyText = timeConvertVar[0] + '.' + timeConvertVar[1] + '.' + timeConvertVar[2] + ' ' + timeConvertVar[3] + ':' + timeConvertVar[4] + ':' + timeConvertVar[5];
Expand Down
8 changes: 5 additions & 3 deletions templates/methods/methods_search_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
</ul>
</form>
[#else RESULT#]
<p>
<font color="red"><#LANG_NO_RECORDS_FOUND#></font>
</p>
<div class="row" style="margin-right: -15px;margin-left: -15px;">
<div class="col-md-12 text-center" style="margin-bottom: 15px;">
<div class="alert alert-warning"><#LANG_NO_RECORDS_FOUND#></div>
</div>
</div>
[#endif RESULT#]
</div>
</div>
Expand Down
15 changes: 12 additions & 3 deletions templates/objects/objects_search_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,18 @@
</div>
</div>
[#else#]
<p align=center>
<font color="red"><#LANG_NO_OBJECTS_DEFINED#></font>
</p>
<div class="row" style="margin-right: -15px;margin-left: -15px;">
<div class="col-md-12 text-right" style="margin-bottom: 15px;">
<a href="?view_mode=edit_objects" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> <#LANG_ADD_NEW_OBJECT#></a>
</div>
</div>

<div class="row" style="margin-right: -15px;margin-left: -15px;">
<div class="col-md-12 text-center" style="margin-bottom: 15px;">
<div class="alert alert-warning"><#LANG_NO_OBJECTS_DEFINED#></div>
</div>
</div>

[#endif RESULT#]


8 changes: 5 additions & 3 deletions templates/properties/properties_search_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
</ul>
</form>
[#else RESULT#]
<p>
<font color="red"><#LANG_NO_RECORDS_FOUND#></font>
</p>
<div class="row" style="margin-right: -15px;margin-left: -15px;">
<div class="col-md-12 text-center" style="margin-bottom: 15px;">
<div class="alert alert-warning"><#LANG_NO_RECORDS_FOUND#></div>
</div>
</div>
[#endif RESULT#]
</div>
</div>
Expand Down
15 changes: 12 additions & 3 deletions templates/saverestore/action_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,26 @@ <h4 class="modal-title"><#LANG_NEWSAVERESTORE_CONSOLE#></h4>
<div class="panel-heading">
<h3 class="panel-title"><#LANG_LATEST_UPDATES#></h3>
</div>
<div class="panel-body">
<div class="panel-body" id="changelogUpdate">
<ul class="list-group">
[#begin UPDATES#]
<li class="list-group-item [#if MYVERSION == 1#]panel-success[#endif#]" [#if MYVERSION == 1#]style="background: #d6e9c6;"[#endif#]>
<span class="badge">[#UPDATE_TEXT#]</span>
<div style="cursor:pointer;">
[#if MYVERSION == 1#]<span class="label label-success">Моя версия</span> [#endif#]<a href="[#LINK#]" target="_blank">[#TITLE#]</a>
<div>
[#if MYVERSION == 1#]<span class="label label-success" id="mysystemversion">Моя версия</span> [#endif#]<a href="[#LINK#]" target="_blank">[#TITLE#]</a>
<div><span class="label label-default">[#DESC_UPDATE#]</span></div>

</div>
</li>
[#end UPDATES#]
</ul>
<script>
$(document).ready(function() {
if($('#mysystemversion').length == 0) {
$('#changelogUpdate').append('<div class="alert alert-danger">Ваша система сильно устарела! Текущая версия: [#LATEST_UPDATED_BRANCH#]_[#LATEST_UPDATED_ID#]</div>');
}
});
</script>
</div>
</div>
[#endif UPDATES#]
Expand Down

0 comments on commit 94396e6

Please sign in to comment.