admin.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. script('updatenotification', 'admin');
  3. style('updatenotification', 'admin');
  4. /** @var array $_ */
  5. /** @var bool $isNewVersionAvailable */
  6. $isNewVersionAvailable = $_['isNewVersionAvailable'];
  7. /** @var string $newVersionString */
  8. $newVersionString = $_['newVersionString'];
  9. /** @var bool $isUpdateChecked */
  10. $isUpdateChecked = $_['isUpdateChecked'];
  11. /** @var string $lastCheckedDate */
  12. $lastCheckedDate = $_['lastChecked'];
  13. /** @var array $channels */
  14. $channels = $_['channels'];
  15. /** @var string $currentChannel */
  16. $currentChannel = $_['currentChannel'];
  17. /** @var string $updateServerURL */
  18. $updateServerURL = $_['updateServerURL'];
  19. /** @var bool $isDefaultUpdateServerURL */
  20. $isDefaultUpdateServerURL = $_['isDefaultUpdateServerURL'];
  21. ?>
  22. <form id="oca_updatenotification_section" class="followupsection">
  23. <p>
  24. <?php if ($isNewVersionAvailable === true) { ?>
  25. <strong><?php p($l->t('A new version is available: %s', [$newVersionString])); ?></strong>
  26. <?php if ($_['updaterEnabled']) { ?>
  27. <input type="button" id="oca_updatenotification_button" value="<?php p($l->t('Open updater')) ?>">
  28. <?php } ?>
  29. <?php if (!empty($_['downloadLink'])) { ?>
  30. <a href="<?php p($_['downloadLink']); ?>" class="button<?php if ($_['updaterEnabled']) { p(' hidden'); } ?>"><?php p($l->t('Download now')) ?></a>
  31. <?php } ?>
  32. <?php if (!empty($_['versionIsEol'])) { ?>
  33. <p>
  34. <span class="warning">
  35. <span class="icon icon-error"></span>
  36. <?php p($l->t('The version you are running is not maintained anymore. Please make sure to update to a supported version as soon as possible.')); ?>
  37. </span>
  38. </p>
  39. <?php } ?>
  40. <?php } elseif (!$isUpdateChecked) { ?>
  41. <?php p($l->t('The update check is not yet finished. Please refresh the page.')); ?>
  42. <?php } else { ?>
  43. <?php p($l->t('Your version is up to date.')); ?>
  44. <span class="icon-info svg" title="<?php p($l->t('Checked on %s', [$lastCheckedDate])) ?>"></span>
  45. <?php } ?>
  46. <?php if (!$isDefaultUpdateServerURL) { ?>
  47. <br />
  48. <em>
  49. <?php p($l->t("A non-default update server is in use to be checked for updates:")); ?>
  50. <code><?php p($updateServerURL); ?></code>
  51. </em>
  52. <?php } ?>
  53. </p>
  54. <p>
  55. <label for="release-channel"><?php p($l->t('Update channel:')) ?></label>
  56. <select id="release-channel">
  57. <option value="<?php p($currentChannel); ?>"><?php p($currentChannel); ?></option>
  58. <?php foreach ($channels as $channel => $channelTitle){ ?>
  59. <option value="<?php p($channelTitle) ?>">
  60. <?php p($channelTitle) ?>
  61. </option>
  62. <?php } ?>
  63. </select>
  64. <span id="channel_save_msg" class="msg"></span><br />
  65. <em><?php p($l->t('You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel.')); ?></em><br />
  66. <em><?php p($l->t('Note that after a new release it can take some time before it shows up here. We roll out new versions spread out over time to our users and sometimes skip a version when issues are found.')); ?></em>
  67. </p>
  68. <p id="oca_updatenotification_groups">
  69. <?php p($l->t('Notify members of the following groups about available updates:')); ?>
  70. <input name="oca_updatenotification_groups_list" type="hidden" id="oca_updatenotification_groups_list" value="<?php p($_['notify_groups']) ?>" style="width: 400px"><br />
  71. <em class="<?php if (!in_array($currentChannel, ['daily', 'git'])) p('hidden'); ?>">
  72. <?php p($l->t('Only notification for app updates are available.')); ?>
  73. <?php if ($currentChannel === 'daily') p($l->t('The selected update channel makes dedicated notifications for the server obsolete.')); ?>
  74. <?php if ($currentChannel === 'git') p($l->t('The selected update channel does not support updates of the server.')); ?>
  75. </em>
  76. </p>
  77. </form>