Hide Create outage button if there is an ongoing outage #172.

This commit is contained in:
Mikhail Golenkov
2020-02-04 16:51:41 +11:00
parent a906f993f0
commit 0137811f2b

View File

@@ -26,6 +26,7 @@
use auth_outage\output\manage\history_table;
use auth_outage\output\manage\planned_table;
use auth_outage\output\renderer;
use auth_outage\dml\outagedb;
defined('MOODLE_INTERNAL') || die();
@@ -47,9 +48,12 @@ echo $viewbag['warning'];
$table->finish_output();
?>
<?php endif; ?>
<input type="button" class="form-submit"
value="<?php echo get_string('outagecreate', 'auth_outage'); ?>"
onclick="location.href='<?php echo $urlnew; ?>';"/>
<?php $outage = outagedb::get_ongoing(); ?>
<?php if (is_null($outage)): ?>
<input type="button" class="form-submit"
value="<?php echo get_string('outagecreate', 'auth_outage'); ?>"
onclick="location.href='<?php echo $urlnew; ?>';"/>
<?php endif; ?>
</section>
<section id="section_outage_history">