1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Add more fields

This commit is contained in:
Daniel 2021-10-15 09:36:00 -03:00
parent a65cc89d32
commit b7c9ed84ca

View file

@ -22,62 +22,65 @@ if (!User::isAdmin()) {
<div class="panel-body"> <div class="panel-body">
<form id="panelScheduler_commandsForm"> <form id="panelScheduler_commandsForm">
<div class="row"> <div class="row">
<input type="hidden" name="id" id="Scheduler_commandsid" value="" > <input type="hidden" name="id" id="Scheduler_commandsid" value="" >
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<label for="Scheduler_commandscallbackURL"><?php echo __("CallbackURL"); ?>:</label> <label for="Scheduler_commandscallbackURL"><?php echo __("CallbackURL"); ?>:</label>
<input type="text" id="Scheduler_commandscallbackURL" name="callbackURL" class="form-control input-sm" placeholder="<?php echo __("CallbackURL"); ?>" required="true"> <input type="text" id="Scheduler_commandscallbackURL" name="callbackURL" class="form-control input-sm" placeholder="<?php echo __("CallbackURL"); ?>" required="true">
</div> </div>
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<label for="Scheduler_commandsparameters"><?php echo __("Parameters"); ?>:</label> <label for="Scheduler_commandsparameters"><?php echo __("Parameters"); ?>:</label>
<textarea id="Scheduler_commandsparameters" name="parameters" class="form-control input-sm" placeholder="<?php echo __("Parameters"); ?>" required="true"></textarea> <textarea id="Scheduler_commandsparameters" name="parameters" class="form-control input-sm" placeholder="<?php echo __("Parameters"); ?>" required="true"></textarea>
</div> </div>
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<label for="Scheduler_commandsdate_to_execute"><?php echo __("Date To Execute"); ?>:</label> <label for="Scheduler_commandsdate_to_execute"><?php echo __("Date To Execute"); ?>:</label>
<input type="text" id="Scheduler_commandsdate_to_execute" name="date_to_execute" class="form-control input-sm" placeholder="<?php echo __("Date To Execute"); ?>" required="true" autocomplete="off"> <input type="text" id="Scheduler_commandsdate_to_execute" name="date_to_execute" class="form-control input-sm" placeholder="<?php echo __("Date To Execute"); ?>" required="true" autocomplete="off">
</div> </div>
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<label for="Scheduler_commandsexecuted_in"><?php echo __("Executed In"); ?>:</label> <label for="Scheduler_commandsexecuted_in"><?php echo __("Executed In"); ?>:</label>
<input type="text" id="Scheduler_commandsexecuted_in" name="executed_in" class="form-control input-sm" placeholder="<?php echo __("Executed In"); ?>" required="true" autocomplete="off"> <input type="text" id="Scheduler_commandsexecuted_in" name="executed_in" class="form-control input-sm" placeholder="<?php echo __("Executed In"); ?>" required="true" autocomplete="off">
</div> </div>
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<label for="status"><?php echo __("Status"); ?>:</label> <label for="status"><?php echo __("Status"); ?>:</label>
<select class="form-control input-sm" name="status" id="Scheduler_commandsstatus"> <select class="form-control input-sm" name="status" id="Scheduler_commandsstatus">
<option value="a"><?php echo __("Active"); ?></option> <option value="a"><?php echo __("Active"); ?></option>
<option value="i"><?php echo __("Inactive"); ?></option> <option value="i"><?php echo __("Inactive"); ?></option>
</select> <option value="c"><?php echo __("Canceled"); ?></option>
</div> <option value="e"><?php echo __("Executed"); ?></option>
<div class="form-group col-sm-12"> <option value="r"><?php echo __("Repeat"); ?></option>
<label for="Scheduler_commandscallbackResponse"><?php echo __("CallbackResponse"); ?>:</label> </select>
<textarea id="Scheduler_commandscallbackResponse" name="callbackResponse" class="form-control input-sm" placeholder="<?php echo __("CallbackResponse"); ?>" required="true"></textarea> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandscallbackResponse"><?php echo __("CallbackResponse"); ?>:</label>
<label for="Scheduler_commandstimezone"><?php echo __("Timezone"); ?>:</label> <textarea id="Scheduler_commandscallbackResponse" name="callbackResponse" class="form-control input-sm" placeholder="<?php echo __("CallbackResponse"); ?>" required="true"></textarea>
<input type="text" id="Scheduler_commandstimezone" name="timezone" class="form-control input-sm" placeholder="<?php echo __("Timezone"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandstimezone"><?php echo __("Timezone"); ?>:</label>
<label for="Scheduler_commandsrepeat_minute"><?php echo __("Repeat Minute"); ?>:</label> <input type="text" id="Scheduler_commandstimezone" name="timezone" class="form-control input-sm" placeholder="<?php echo __("Timezone"); ?>" required="true">
<input type="number" step="1" id="Scheduler_commandsrepeat_minute" name="repeat_minute" class="form-control input-sm" placeholder="<?php echo __("Repeat Minute"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandsrepeat_minute"><?php echo __("Repeat Minute"); ?>:</label>
<label for="Scheduler_commandsrepeat_hour"><?php echo __("Repeat Hour"); ?>:</label> <input type="number" step="1" id="Scheduler_commandsrepeat_minute" name="repeat_minute" class="form-control input-sm" placeholder="<?php echo __("Repeat Minute"); ?>" required="true">
<input type="number" step="1" id="Scheduler_commandsrepeat_hour" name="repeat_hour" class="form-control input-sm" placeholder="<?php echo __("Repeat Hour"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandsrepeat_hour"><?php echo __("Repeat Hour"); ?>:</label>
<label for="Scheduler_commandsrepeat_day_of_month"><?php echo __("Repeat Day Of Month"); ?>:</label> <input type="number" step="1" id="Scheduler_commandsrepeat_hour" name="repeat_hour" class="form-control input-sm" placeholder="<?php echo __("Repeat Hour"); ?>" required="true">
<input type="number" step="1" id="Scheduler_commandsrepeat_day_of_month" name="repeat_day_of_month" class="form-control input-sm" placeholder="<?php echo __("Repeat Day Of Month"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandsrepeat_day_of_month"><?php echo __("Repeat Day Of Month"); ?>:</label>
<label for="Scheduler_commandsrepeat_month"><?php echo __("Repeat Month"); ?>:</label> <input type="number" step="1" id="Scheduler_commandsrepeat_day_of_month" name="repeat_day_of_month" class="form-control input-sm" placeholder="<?php echo __("Repeat Day Of Month"); ?>" required="true">
<input type="number" step="1" id="Scheduler_commandsrepeat_month" name="repeat_month" class="form-control input-sm" placeholder="<?php echo __("Repeat Month"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandsrepeat_month"><?php echo __("Repeat Month"); ?>:</label>
<label for="Scheduler_commandsrepeat_day_of_week"><?php echo __("Repeat Day Of Week"); ?>:</label> <input type="number" step="1" id="Scheduler_commandsrepeat_month" name="repeat_month" class="form-control input-sm" placeholder="<?php echo __("Repeat Month"); ?>" required="true">
<input type="number" step="1" id="Scheduler_commandsrepeat_day_of_week" name="repeat_day_of_week" class="form-control input-sm" placeholder="<?php echo __("Repeat Day Of Week"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<div class="form-group col-sm-12"> <label for="Scheduler_commandsrepeat_day_of_week"><?php echo __("Repeat Day Of Week"); ?>:</label>
<label for="Scheduler_commandstype"><?php echo __("Type"); ?>:</label> <input type="number" step="1" id="Scheduler_commandsrepeat_day_of_week" name="repeat_day_of_week" class="form-control input-sm" placeholder="<?php echo __("Repeat Day Of Week"); ?>" required="true">
<input type="text" id="Scheduler_commandstype" name="type" class="form-control input-sm" placeholder="<?php echo __("Type"); ?>" required="true"> </div>
</div> <div class="form-group col-sm-12">
<label for="Scheduler_commandstype"><?php echo __("Type"); ?>:</label>
<input type="text" id="Scheduler_commandstype" name="type" class="form-control input-sm" placeholder="<?php echo __("Type"); ?>" required="true">
</div>
<div class="form-group col-sm-12"> <div class="form-group col-sm-12">
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<span class="btn btn-success" id="newScheduler_commandsLink" onclick="clearScheduler_commandsForm()"><i class="fas fa-plus"></i> <?php echo __("New"); ?></span> <span class="btn btn-success" id="newScheduler_commandsLink" onclick="clearScheduler_commandsForm()"><i class="fas fa-plus"></i> <?php echo __("New"); ?></span>
@ -96,39 +99,37 @@ if (!User::isAdmin()) {
<table id="Scheduler_commandsTable" class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0"> <table id="Scheduler_commandsTable" class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th><?php echo __("CallbackURL"); ?></th> <th><?php echo __("Parameters"); ?></th>
<th><?php echo __("Parameters"); ?></th> <th><?php echo __("Date To Execute"); ?></th>
<th><?php echo __("Date To Execute"); ?></th> <th><?php echo __("Executed In"); ?></th>
<th><?php echo __("Executed In"); ?></th> <th><?php echo __("Status"); ?></th>
<th><?php echo __("Status"); ?></th> <th><?php echo __("CallbackResponse"); ?></th>
<th><?php echo __("CallbackResponse"); ?></th> <th><?php echo __("Timezone"); ?></th>
<th><?php echo __("Timezone"); ?></th> <th><?php echo __("Repeat Minute"); ?></th>
<th><?php echo __("Repeat Minute"); ?></th> <th><?php echo __("Repeat Hour"); ?></th>
<th><?php echo __("Repeat Hour"); ?></th> <th><?php echo __("Repeat Day Of Month"); ?></th>
<th><?php echo __("Repeat Day Of Month"); ?></th> <th><?php echo __("Repeat Month"); ?></th>
<th><?php echo __("Repeat Month"); ?></th> <th><?php echo __("Repeat Day Of Week"); ?></th>
<th><?php echo __("Repeat Day Of Week"); ?></th> <th><?php echo __("Type"); ?></th>
<th><?php echo __("Type"); ?></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tfoot> <tfoot>
<tr> <tr>
<th>#</th> <th>#</th>
<th><?php echo __("CallbackURL"); ?></th> <th><?php echo __("Parameters"); ?></th>
<th><?php echo __("Parameters"); ?></th> <th><?php echo __("Date To Execute"); ?></th>
<th><?php echo __("Date To Execute"); ?></th> <th><?php echo __("Executed In"); ?></th>
<th><?php echo __("Executed In"); ?></th> <th><?php echo __("Status"); ?></th>
<th><?php echo __("Status"); ?></th> <th><?php echo __("CallbackResponse"); ?></th>
<th><?php echo __("CallbackResponse"); ?></th> <th><?php echo __("Timezone"); ?></th>
<th><?php echo __("Timezone"); ?></th> <th><?php echo __("Repeat Minute"); ?></th>
<th><?php echo __("Repeat Minute"); ?></th> <th><?php echo __("Repeat Hour"); ?></th>
<th><?php echo __("Repeat Hour"); ?></th> <th><?php echo __("Repeat Day Of Month"); ?></th>
<th><?php echo __("Repeat Day Of Month"); ?></th> <th><?php echo __("Repeat Month"); ?></th>
<th><?php echo __("Repeat Month"); ?></th> <th><?php echo __("Repeat Day Of Week"); ?></th>
<th><?php echo __("Repeat Day Of Week"); ?></th> <th><?php echo __("Type"); ?></th>
<th><?php echo __("Type"); ?></th>
<th></th> <th></th>
</tr> </tr>
</tfoot> </tfoot>
@ -152,142 +153,145 @@ if (!User::isAdmin()) {
<script type="text/javascript"> <script type="text/javascript">
function clearScheduler_commandsForm() { function clearScheduler_commandsForm() {
$('#Scheduler_commandsid').val(''); $('#Scheduler_commandsid').val('');
$('#Scheduler_commandscallbackURL').val(''); $('#Scheduler_commandscallbackURL').val('');
$('#Scheduler_commandsparameters').val(''); $('#Scheduler_commandsparameters').val('');
$('#Scheduler_commandsdate_to_execute').val(''); $('#Scheduler_commandsdate_to_execute').val('');
$('#Scheduler_commandsexecuted_in').val(''); $('#Scheduler_commandsexecuted_in').val('');
$('#Scheduler_commandsstatus').val(''); $('#Scheduler_commandsstatus').val('');
$('#Scheduler_commandscallbackResponse').val(''); $('#Scheduler_commandscallbackResponse').val('');
$('#Scheduler_commandstimezone').val(''); $('#Scheduler_commandstimezone').val('');
$('#Scheduler_commandsrepeat_minute').val(''); $('#Scheduler_commandsrepeat_minute').val('');
$('#Scheduler_commandsrepeat_hour').val(''); $('#Scheduler_commandsrepeat_hour').val('');
$('#Scheduler_commandsrepeat_day_of_month').val(''); $('#Scheduler_commandsrepeat_day_of_month').val('');
$('#Scheduler_commandsrepeat_month').val(''); $('#Scheduler_commandsrepeat_month').val('');
$('#Scheduler_commandsrepeat_day_of_week').val(''); $('#Scheduler_commandsrepeat_day_of_week').val('');
$('#Scheduler_commandstype').val(''); $('#Scheduler_commandstype').val('');
} }
$(document).ready(function () { $(document).ready(function () {
$('#addScheduler_commandsBtn').click(function () { $('#addScheduler_commandsBtn').click(function () {
$.ajax({ $.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/addScheduler_commandsVideo.php', url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/addScheduler_commandsVideo.php',
data: $('#panelScheduler_commandsForm').serialize(), data: $('#panelScheduler_commandsForm').serialize(),
type: 'post', type: 'post',
success: function (response) { success: function (response) {
if (response.error) { if (response.error) {
avideoAlertError(response.msg); avideoAlertError(response.msg);
} else { } else {
avideoToast("<?php echo __("Your register has been saved!"); ?>"); avideoToast("<?php echo __("Your register has been saved!"); ?>");
$("#panelScheduler_commandsForm").trigger("reset"); $("#panelScheduler_commandsForm").trigger("reset");
}
clearScheduler_commandsForm();
tableVideos.ajax.reload();
modal.hidePleaseWait();
} }
clearScheduler_commandsForm(); });
tableVideos.ajax.reload();
modal.hidePleaseWait();
}
}); });
}); var Scheduler_commandstableVar = $('#Scheduler_commandsTable').DataTable({
var Scheduler_commandstableVar = $('#Scheduler_commandsTable').DataTable({ serverSide: true,
serverSide: true, "ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/list.json.php",
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/list.json.php", "columns": [
"columns": [ {"data": "id"},
{"data": "id"}, {"data": "parameters"},
{"data": "callbackURL"}, {"data": "date_to_execute"},
{"data": "parameters"}, {"data": "executed_in"},
{"data": "date_to_execute"}, {"data": "status"},
{"data": "executed_in"}, {"data": "callbackResponse"},
{"data": "status"}, {"data": "timezone"},
{"data": "callbackResponse"}, {"data": "repeat_minute"},
{"data": "timezone"}, {"data": "repeat_hour"},
{"data": "repeat_minute"}, {"data": "repeat_day_of_month"},
{"data": "repeat_hour"}, {"data": "repeat_month"},
{"data": "repeat_day_of_month"}, {"data": "repeat_day_of_week"},
{"data": "repeat_month"}, {"data": "type"},
{"data": "repeat_day_of_week"}, {
{"data": "type"}, sortable: false,
{ data: null,
sortable: false, defaultContent: $('#Scheduler_commandsbtnModelLinks').html()
data: null,
defaultContent: $('#Scheduler_commandsbtnModelLinks').html()
}
],
select: true,
});
$('#newScheduler_commands').on('click', function (e) {
e.preventDefault();
$('#panelScheduler_commandsForm').trigger("reset");
$('#Scheduler_commandsid').val('');
});
$('#panelScheduler_commandsForm').on('submit', function (e) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/add.json.php',
data: $('#panelScheduler_commandsForm').serialize(),
type: 'post',
success: function (response) {
if (response.error) {
avideoAlertError(response.msg);
} else {
avideoToast("<?php echo __("Your register has been saved!"); ?>");
$("#panelScheduler_commandsForm").trigger("reset");
} }
Scheduler_commandstableVar.ajax.reload(); ],
$('#Scheduler_commandsid').val(''); select: true,
modal.hidePleaseWait();
}
}); });
}); $('#newScheduler_commands').on('click', function (e) {
$('#Scheduler_commandsTable').on('click', 'button.delete_Scheduler_commands', function (e) { e.preventDefault();
e.preventDefault(); $('#panelScheduler_commandsForm').trigger("reset");
var tr = $(this).closest('tr')[0]; $('#Scheduler_commandsid').val('');
var data = Scheduler_commandstableVar.row(tr).data(); });
swal({ $('#panelScheduler_commandsForm').on('submit', function (e) {
title: "<?php echo __("Are you sure?"); ?>", e.preventDefault();
text: "<?php echo __("You will not be able to recover this action!"); ?>",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then(function (willDelete) {
if (willDelete) {
modal.showPleaseWait(); modal.showPleaseWait();
$.ajax({ $.ajax({
type: "POST", url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/add.json.php',
url: "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/delete.json.php", data: $('#panelScheduler_commandsForm').serialize(),
data: data type: 'post',
success: function (response) {
}).done(function (resposta) { if (response.error) {
if (resposta.error) { avideoAlertError(response.msg);
avideoAlertError(resposta.msg); } else {
} avideoToast("<?php echo __("Your register has been saved!"); ?>");
Scheduler_commandstableVar.ajax.reload(); $("#panelScheduler_commandsForm").trigger("reset");
modal.hidePleaseWait(); }
Scheduler_commandstableVar.ajax.reload();
$('#Scheduler_commandsid').val('');
modal.hidePleaseWait();
}
}); });
} else { });
$('#Scheduler_commandsTable').on('click', 'button.delete_Scheduler_commands', function (e) {
e.preventDefault();
var tr = $(this).closest('tr')[0];
var data = Scheduler_commandstableVar.row(tr).data();
swal({
title: "<?php echo __("Are you sure?"); ?>",
text: "<?php echo __("You will not be able to recover this action!"); ?>",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then(function (willDelete) {
if (willDelete) {
modal.showPleaseWait();
$.ajax({
type: "POST",
url: "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/delete.json.php",
data: data
} }).done(function (resposta) {
}); if (resposta.error) {
}); avideoAlertError(resposta.msg);
$('#Scheduler_commandsTable').on('click', 'button.edit_Scheduler_commands', function (e) { }
e.preventDefault(); Scheduler_commandstableVar.ajax.reload();
var tr = $(this).closest('tr')[0]; modal.hidePleaseWait();
var data = Scheduler_commandstableVar.row(tr).data(); });
$('#Scheduler_commandsid').val(data.id); } else {
$('#Scheduler_commandscallbackURL').val(data.callbackURL);
$('#Scheduler_commandsparameters').val(data.parameters); }
$('#Scheduler_commandsdate_to_execute').val(data.date_to_execute); });
$('#Scheduler_commandsexecuted_in').val(data.executed_in); });
$('#Scheduler_commandsstatus').val(data.status); $('#Scheduler_commandsTable').on('click', 'button.edit_Scheduler_commands', function (e) {
$('#Scheduler_commandscallbackResponse').val(data.callbackResponse); e.preventDefault();
$('#Scheduler_commandstimezone').val(data.timezone); var tr = $(this).closest('tr')[0];
$('#Scheduler_commandsrepeat_minute').val(data.repeat_minute); var data = Scheduler_commandstableVar.row(tr).data();
$('#Scheduler_commandsrepeat_hour').val(data.repeat_hour); $('#Scheduler_commandsid').val(data.id);
$('#Scheduler_commandsrepeat_day_of_month').val(data.repeat_day_of_month); $('#Scheduler_commandscallbackURL').val(data.callbackURL);
$('#Scheduler_commandsrepeat_month').val(data.repeat_month); $('#Scheduler_commandsparameters').val(data.parameters);
$('#Scheduler_commandsrepeat_day_of_week').val(data.repeat_day_of_week); $('#Scheduler_commandsdate_to_execute').val(data.date_to_execute);
$('#Scheduler_commandstype').val(data.type); $('#Scheduler_commandsexecuted_in').val(data.executed_in);
}); $('#Scheduler_commandsstatus').val(data.status);
$('#Scheduler_commandscallbackResponse').val(data.callbackResponse);
$('#Scheduler_commandstimezone').val(data.timezone);
$('#Scheduler_commandsrepeat_minute').val(data.repeat_minute);
$('#Scheduler_commandsrepeat_hour').val(data.repeat_hour);
$('#Scheduler_commandsrepeat_day_of_month').val(data.repeat_day_of_month);
$('#Scheduler_commandsrepeat_month').val(data.repeat_month);
$('#Scheduler_commandsrepeat_day_of_week').val(data.repeat_day_of_week);
$('#Scheduler_commandstype').val(data.type);
});
}); });
</script> </script>
<script> $(document).ready(function () {$('#Scheduler_commandsdate_to_execute').datetimepicker({format: 'yyyy-mm-dd hh:ii',autoclose: true });});</script> <script> $(document).ready(function () {
<script> $(document).ready(function () {$('#Scheduler_commandsexecuted_in').datetimepicker({format: 'yyyy-mm-dd hh:ii',autoclose: true });});</script> $('#Scheduler_commandsdate_to_execute').datetimepicker({format: 'yyyy-mm-dd hh:ii', autoclose: true});
});</script>
<script> $(document).ready(function () {
$('#Scheduler_commandsexecuted_in').datetimepicker({format: 'yyyy-mm-dd hh:ii', autoclose: true});
});</script>