related to #1530 Status vérification in Sync page

This commit is contained in:
Matthieu Leproux
2021-10-20 10:09:07 +02:00
parent 8e2f12fdf0
commit f5d0caedb8
3 changed files with 13 additions and 2 deletions
+11
View File
@@ -72,6 +72,10 @@ if (isset($page['no_md5sum_number']))
$page['messages'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-no_sync_md5sum">'.l10n('Some checksums are missing.').'<i class="icon-right"></i></a>';
}
if (!is_webmaster()) {
$page['warnings'][] = l10n('Webmaster status is required.');
}
// +-----------------------------------------------------------------------+
// | tabs |
// +-----------------------------------------------------------------------+
@@ -105,6 +109,11 @@ if (isset($_GET['quick_sync']))
$general_failure = true;
if (isset($_POST['submit']))
{
if (!is_webmaster()) {
redirect(get_root_url().'admin.php?page=site_update&amp;site='.$_GET['site']);
}
if ($site_reader->open())
{
$general_failure = false;
@@ -958,6 +967,8 @@ $template->assign(
'U_HELP' => get_root_url().'admin/popuphelp.php?page=synchronize',
));
$template->assign('isWebmaster', is_webmaster());
// +-----------------------------------------------------------------------+
// | introduction : choices |
// +-----------------------------------------------------------------------+
@@ -118,7 +118,7 @@ $('#syncFiles label').click(function () {
</fieldset>
<p class="bottomButtons syncBtn">
<button class="icon-exchange buttonGradient" type="submit" value="" name="submit"> {'Synchronize'|@translate} </button>
<button class="icon-exchange buttonGradient" type="submit" value="" name="submit" {if !$isWebmaster} disabled {/if}> {'Synchronize'|@translate} </button>
</p>
</form>
{/if}{*isset $introduction*}
@@ -106,7 +106,7 @@ function get_user_activity() {
},
success: (data) => {
/* console log to help debug */
{* console.log(data); *}
console.log(data);
setCreationDate(data.result['result_lines'][data.result['result_lines'].length-1].date, data.result['result_lines'][0].date);
$(".loading").hide();