mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
update
This commit is contained in:
parent
4e075a8674
commit
37e14a8982
30 changed files with 1745 additions and 1293 deletions
File diff suppressed because it is too large
Load diff
|
@ -28,13 +28,19 @@ if (!PlayLists::canAddVideoOnPlaylist($_POST['videos_id'])) {
|
|||
}
|
||||
|
||||
$playList = new PlayList($_POST['playlists_id']);
|
||||
if (empty($playList) || User::getId() !== $playList->getUsers_id() || empty($_POST['videos_id'])) {
|
||||
if (empty($playList) || empty($_POST['videos_id'])) {
|
||||
$obj->msg = __("Permission denied");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
if(!PlayLists::canManageAllPlaylists() && User::getId() !== $playList->getUsers_id() ){
|
||||
$obj->msg = __("This is not your playlist");
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$obj->error = false;
|
||||
$obj->status = $playList->addVideo($_POST['videos_id'], $_POST['add']);
|
||||
$obj->users_id = $playList->getUsers_id();
|
||||
|
||||
//log_error("videos id: ".$_POST['videos_id']." playlist_id: ".$_POST['playlists_id']);
|
||||
die(json_encode($obj));
|
||||
|
|
|
@ -724,8 +724,10 @@ class PlayList extends ObjectYPT {
|
|||
return false;
|
||||
}
|
||||
$this->clearEmptyLists();
|
||||
if(empty($this->getUsers_id()) || !PlayLists::canManageAllPlaylists()){
|
||||
$users_id = User::getId();
|
||||
$this->setUsers_id($users_id);
|
||||
}
|
||||
$this->showOnTV = intval($this->showOnTV);
|
||||
$playlists_id = parent::save();
|
||||
if (!empty($playlists_id)) {
|
||||
|
|
|
@ -20,10 +20,15 @@ if (empty($_POST['name'])) {
|
|||
}
|
||||
$obj = new PlayList(@$_POST['id']);
|
||||
|
||||
if (PlayLists::canManageAllPlaylists()) {
|
||||
if(!empty($_REQUEST['users_id'])){
|
||||
$obj->setUsers_id($_REQUEST['users_id']);
|
||||
}
|
||||
}else{
|
||||
if(!empty($obj->getUsers_id())){
|
||||
forbidIfItIsNotMyUsersId($obj->getUsers_id());
|
||||
}
|
||||
|
||||
}
|
||||
$obj->setName($_POST['name']);
|
||||
$obj->setStatus($_POST['status']);
|
||||
echo '{"status":"'.$obj->save().'"}';
|
||||
echo '{"status":"'.$obj->save().'", "users_id":"'.$obj->getUsers_id().'"}';
|
||||
|
|
|
@ -29,27 +29,6 @@ class AVideoPlugin
|
|||
}
|
||||
}
|
||||
|
||||
public static function addRoutes()
|
||||
{
|
||||
global $global;
|
||||
if (empty($global)) {
|
||||
$global = [];
|
||||
}
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
foreach ($plugins as $value) {
|
||||
if (in_array($value['dirName'], $global['skippPlugins'])) {
|
||||
continue;
|
||||
}
|
||||
self::YPTstart();
|
||||
$p = static::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$p->addRoutes();
|
||||
}
|
||||
self::YPTend("{$value['dirName']}::" . __FUNCTION__);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function addView($videos_id, $total)
|
||||
{
|
||||
global $global;
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
|
||||
use Pecee\SimpleRouter\SimpleRouter; //required if we want to define routes on our plugin.
|
||||
|
||||
class OptionsTest extends PluginAbstract {
|
||||
|
||||
public function getTags() {
|
||||
|
@ -51,15 +49,6 @@ class OptionsTest extends PluginAbstract {
|
|||
public function getHeadCode() {
|
||||
}
|
||||
|
||||
public function addRoutes()
|
||||
{
|
||||
global $basePath;
|
||||
SimpleRouter::get($basePath."OptionsTest/home", function() {
|
||||
require_once "plugin/OptionsTest/home.php"; exit;
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getCustomizeAdvancedOptions()
|
||||
{
|
||||
$options["optionsTestVariable"]=false;
|
||||
|
|
|
@ -437,7 +437,8 @@ TimeLogEnd($timeName, __LINE__);
|
|||
method: 'POST',
|
||||
data: {
|
||||
'status': "public",
|
||||
'name': inputValue
|
||||
'name': inputValue,
|
||||
'user': '<?php echo $users_id; ?>'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.status > 0) {
|
||||
|
|
|
@ -368,10 +368,6 @@ abstract class PluginAbstract {
|
|||
return array();
|
||||
}
|
||||
|
||||
public function addRoutes() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function addView($videos_id, $total) {
|
||||
return false;
|
||||
}
|
||||
|
|
138
plugin/Scheduler/Objects/Email_to_user.php
Normal file
138
plugin/Scheduler/Objects/Email_to_user.php
Normal file
|
@ -0,0 +1,138 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../../videos/configuration.php';
|
||||
|
||||
class Email_to_user extends ObjectYPT {
|
||||
|
||||
protected $id, $sent_at, $timezone, $emails_messages_id, $users_id;
|
||||
|
||||
static function getSearchFieldsNames() {
|
||||
return array('timezone');
|
||||
}
|
||||
|
||||
static function getTableName() {
|
||||
return 'email_to_user';
|
||||
}
|
||||
|
||||
static function getAllEmails_messages() {
|
||||
global $global;
|
||||
$table = "emails_messages";
|
||||
$sql = "SELECT * FROM {$table} WHERE 1=1 ";
|
||||
|
||||
$sql .= self::getSqlFromPost();
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
$rows = array();
|
||||
if ($res != false) {
|
||||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
*
|
||||
* @var array $global
|
||||
* @var object $global['mysqli']
|
||||
*/
|
||||
_error_log($sql . ' Error : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
||||
static function setSent($email_to_user_id){
|
||||
global $global;
|
||||
if(!is_array($email_to_user_id)){
|
||||
$email_to_user_id = array($email_to_user_id);
|
||||
}
|
||||
$sql = "UPDATE email_to_user SET sent_at = NOW(), timezone = ? WHERE id IN (". implode(', ', $email_to_user_id).")";
|
||||
return sqlDAL::writeSql($sql, 's', [date_default_timezone_get()]);
|
||||
}
|
||||
|
||||
static function alreadyHasMessageSet($users_id, $emails_messages_id){
|
||||
global $global;
|
||||
$sql = "SELECT * FROM email_to_user WHERE sent_at is NULL AND users_id = ? AND emails_messages_id = ?";
|
||||
$res = sqlDAL::readSql($sql, 'ii', [$users_id, $emails_messages_id], true);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
//var_dump($sql, [$users_id, $emails_messages_id], $fullData);
|
||||
return !empty($fullData);
|
||||
}
|
||||
|
||||
static function getAllToSend(){
|
||||
global $global;
|
||||
$sql = "SELECT * FROM email_to_user WHERE sent_at is NULL ";
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
return $fullData;
|
||||
}
|
||||
|
||||
static function getAllEmailsToSend(){
|
||||
global $global;
|
||||
$emails = new stdClass();
|
||||
$sql = "SELECT message, subject, GROUP_CONCAT(u.email) as emails, GROUP_CONCAT(etu.id) as ids
|
||||
FROM email_to_user etu
|
||||
LEFT JOIN users u ON users_id = u.id
|
||||
LEFT JOIN emails_messages em ON emails_messages_id = em.id
|
||||
WHERE sent_at IS NULL
|
||||
GROUP BY emails_messages_id";
|
||||
$res = sqlDAL::readSql($sql);
|
||||
$fullData = sqlDAL::fetchAllAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
return $fullData;
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = intval($id);
|
||||
}
|
||||
|
||||
function setSent_at($sent_at) {
|
||||
$this->sent_at = $sent_at;
|
||||
}
|
||||
|
||||
function setTimezone($timezone) {
|
||||
$this->timezone = $timezone;
|
||||
}
|
||||
|
||||
function setEmails_messages_id($emails_messages_id) {
|
||||
$this->emails_messages_id = intval($emails_messages_id);
|
||||
}
|
||||
|
||||
function setUsers_id($users_id) {
|
||||
$this->users_id = intval($users_id);
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return intval($this->id);
|
||||
}
|
||||
|
||||
function getSent_at() {
|
||||
return $this->sent_at;
|
||||
}
|
||||
|
||||
function getTimezone() {
|
||||
return $this->timezone;
|
||||
}
|
||||
|
||||
function getEmails_messages_id() {
|
||||
return intval($this->emails_messages_id);
|
||||
}
|
||||
|
||||
function getUsers_id() {
|
||||
return intval($this->users_id);
|
||||
}
|
||||
|
||||
public function save() {
|
||||
|
||||
if(self::alreadyHasMessageSet($this->users_id, $this->emails_messages_id)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(empty($this->sent_at)){
|
||||
$this->sent_at = 'NULL';
|
||||
}
|
||||
|
||||
return parent::save();
|
||||
}
|
||||
|
||||
}
|
58
plugin/Scheduler/Objects/Emails_messages.php
Normal file
58
plugin/Scheduler/Objects/Emails_messages.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
require_once dirname(__FILE__) . '/../../../videos/configuration.php';
|
||||
|
||||
class Emails_messages extends ObjectYPT {
|
||||
|
||||
protected $id,$message,$subject;
|
||||
|
||||
static function getSearchFieldsNames() {
|
||||
return array('message','subject');
|
||||
}
|
||||
|
||||
static function getTableName() {
|
||||
return 'emails_messages';
|
||||
}
|
||||
|
||||
function setId($id) {
|
||||
$this->id = intval($id);
|
||||
}
|
||||
|
||||
function setMessage($message) {
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
function setSubject($subject) {
|
||||
$this->subject = $subject;
|
||||
}
|
||||
|
||||
|
||||
function getId() {
|
||||
return intval($this->id);
|
||||
}
|
||||
|
||||
function getMessage() {
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
function getSubject() {
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
static function setOrCreate($message, $subject): Emails_messages {
|
||||
global $global;
|
||||
$sql = "SELECT id FROM emails_messages WHERE message = ? ";
|
||||
$res = sqlDAL::readSql($sql, 's', [$message], true);
|
||||
$data = sqlDAL::fetchAssoc($res);
|
||||
sqlDAL::close($res);
|
||||
if(empty($data)){
|
||||
$obj = new Emails_messages(0);
|
||||
$obj->setMessage($message);
|
||||
$obj->setSubject($subject);
|
||||
}else{
|
||||
$obj = new Emails_messages($data['id']);
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,6 +5,8 @@ require_once $global['systemRootPath'] . 'objects/ICS.php';
|
|||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Scheduler_commands.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Emails_messages.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Email_to_user.php';
|
||||
|
||||
class Scheduler extends PluginAbstract
|
||||
{
|
||||
|
@ -43,7 +45,7 @@ class Scheduler extends PluginAbstract
|
|||
|
||||
public function getPluginVersion()
|
||||
{
|
||||
return "4.3";
|
||||
return "4.4";
|
||||
}
|
||||
|
||||
public function updateScript()
|
||||
|
@ -84,6 +86,13 @@ class Scheduler extends PluginAbstract
|
|||
sqlDal::writeSqlTry(trim($value));
|
||||
}
|
||||
}
|
||||
if (AVideoPlugin::compareVersion($this->getName(), "4.4") < 0) {
|
||||
$sqls = file_get_contents($global['systemRootPath'] . 'plugin/Scheduler/install/updateV4.4.sql');
|
||||
$sqlParts = explode(";", $sqls);
|
||||
foreach ($sqlParts as $value) {
|
||||
sqlDal::writeSqlTry(trim($value));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -94,6 +103,7 @@ class Scheduler extends PluginAbstract
|
|||
$obj->watchDogSocket = true;
|
||||
$obj->watchDogLiveServer = true;
|
||||
$obj->watchDogLiveServerSSL = true;
|
||||
$obj->sendEmails = true;
|
||||
/*
|
||||
$obj->textSample = "text";
|
||||
$obj->checkboxSample = true;
|
||||
|
@ -112,6 +122,27 @@ class Scheduler extends PluginAbstract
|
|||
return $obj;
|
||||
}
|
||||
|
||||
static function sendEmails(){
|
||||
$obj = AVideoPlugin::getDataObjectIfEnabled('Scheduler');
|
||||
if($obj->sendEmails){
|
||||
$messages = Email_to_user::getAllEmailsToSend();
|
||||
echo 'Scheduler::sendEmails found '.count($messages).PHP_EOL;
|
||||
foreach ($messages as $value) {
|
||||
$to = explode(',', $value['emails']);
|
||||
// Make sure the emails in $to are unique
|
||||
$to = array_unique($to);
|
||||
|
||||
$subject = $value['subject'];
|
||||
$message = $value['message'];
|
||||
echo "Scheduler::sendEmails [{$subject}] found emails ".count($to).PHP_EOL;
|
||||
//var_dump($to);
|
||||
sendSiteEmailAsync($to, $subject, $message);
|
||||
$ids = explode(',', $value['ids']);
|
||||
Email_to_user::setSent($ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getPluginMenu()
|
||||
{
|
||||
global $global;
|
||||
|
|
27
plugin/Scheduler/View/Email_to_user/add.json.php
Normal file
27
plugin/Scheduler/View/Email_to_user/add.json.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Email_to_user.php';
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
$obj->msg = "";
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Scheduler');
|
||||
|
||||
if(!User::isAdmin()){
|
||||
$obj->msg = "You cant do this";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$o = new Email_to_user(@$_POST['id']);
|
||||
$o->setSent_at($_POST['sent_at']);
|
||||
$o->setTimezone($_POST['timezone']);
|
||||
$o->setEmails_messages_id($_POST['emails_messages_id']);
|
||||
$o->setUsers_id($_POST['users_id']);
|
||||
|
||||
if($id = $o->save()){
|
||||
$obj->error = false;
|
||||
}
|
||||
|
||||
echo json_encode($obj);
|
20
plugin/Scheduler/View/Email_to_user/delete.json.php
Normal file
20
plugin/Scheduler/View/Email_to_user/delete.json.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Email_to_user.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Scheduler');
|
||||
|
||||
if(!User::isAdmin()){
|
||||
$obj->msg = "You cant do this";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$id = intval($_POST['id']);
|
||||
$row = new Email_to_user($id);
|
||||
$obj->error = !$row->delete();
|
||||
die(json_encode($obj));
|
||||
?>
|
29
plugin/Scheduler/View/Email_to_user/index.php
Normal file
29
plugin/Scheduler/View/Email_to_user/index.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo getLanguage(); ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: Scheduler</title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/View/{$classname}/index_head.php';
|
||||
?>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/View/{$classname}/index_body.php';
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.js"></script>
|
||||
</body>
|
||||
</html>
|
228
plugin/Scheduler/View/Email_to_user/index_body.php
Normal file
228
plugin/Scheduler/View/Email_to_user/index_body.php
Normal file
|
@ -0,0 +1,228 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fas fa-cog"></i> <?php echo __("Configurations"); ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="panel panel-default ">
|
||||
<div class="panel-heading"><i class="far fa-plus-square"></i> <?php echo __("Create"); ?></div>
|
||||
<div class="panel-body">
|
||||
<form id="panelEmail_to_userForm">
|
||||
<div class="row">
|
||||
<input type="hidden" name="id" id="Email_to_userid" value="">
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Email_to_usersent_at"><?php echo __("Sent At"); ?>:</label>
|
||||
<input type="text" id="Email_to_usersent_at" name="sent_at" class="form-control input-sm" placeholder="<?php echo __("Sent At"); ?>" autocomplete="off">
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Email_to_usertimezone"><?php echo __("Timezone"); ?>:</label>
|
||||
<input type="text" id="Email_to_usertimezone" name="timezone" class="form-control input-sm" placeholder="<?php echo __("Timezone"); ?>">
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Email_to_useremails_messages_id"><?php echo __("Emails Messages Id"); ?>:</label>
|
||||
<select class="form-control input-sm" name="emails_messages_id" id="Email_to_useremails_messages_id">
|
||||
<?php
|
||||
$options = Email_to_user::getAllEmails_messages();
|
||||
foreach ($options as $value) {
|
||||
echo '<option value="' . $value['id'] . '">' . $value['id'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Email_to_userusers_id"><?php echo __("Users Id"); ?>:</label>
|
||||
<select class="form-control input-sm" name="users_id" id="Email_to_userusers_id">
|
||||
<?php
|
||||
$options = User::getAllUsers();
|
||||
foreach ($options as $value) {
|
||||
echo '<option value="' . $value['id'] . '">' . $value['id'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="btn-group pull-right">
|
||||
<span class="btn btn-success" id="newEmail_to_userLink" onclick="clearEmail_to_userForm()"><i class="fas fa-plus"></i> <?php echo __("New"); ?></span>
|
||||
<button class="btn btn-primary" type="submit"><i class="fas fa-save"></i> <?php echo __("Save"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="panel panel-default ">
|
||||
<div class="panel-heading"><i class="fas fa-edit"></i> <?php echo __("Edit"); ?></div>
|
||||
<div class="panel-body">
|
||||
<table id="Email_to_userTable" class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php echo __("Sent At"); ?></th>
|
||||
<th><?php echo __("Timezone"); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php echo __("Sent At"); ?></th>
|
||||
<th><?php echo __("Timezone"); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Email_to_userbtnModelLinks" style="display: none;">
|
||||
<div class="btn-group pull-right">
|
||||
<button href="" class="edit_Email_to_user btn btn-default btn-xs">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
<button href="" class="delete_Email_to_user btn btn-danger btn-xs">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function clearEmail_to_userForm() {
|
||||
$('#Email_to_userid').val('');
|
||||
$('#Email_to_usersent_at').val('');
|
||||
$('#Email_to_usertimezone').val('');
|
||||
$('#Email_to_useremails_messages_id').val('');
|
||||
$('#Email_to_userusers_id').val('');
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('#addEmail_to_userBtn').click(function() {
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/addEmail_to_userVideo.php',
|
||||
data: $('#panelEmail_to_userForm').serialize(),
|
||||
type: 'post',
|
||||
success: function(response) {
|
||||
if (response.error) {
|
||||
avideoAlertError(response.msg);
|
||||
} else {
|
||||
avideoToast("<?php echo __("Your register has been saved!"); ?>");
|
||||
$("#panelEmail_to_userForm").trigger("reset");
|
||||
}
|
||||
clearEmail_to_userForm();
|
||||
tableVideos.ajax.reload();
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
var Email_to_usertableVar = $('#Email_to_userTable').DataTable({
|
||||
serverSide: true,
|
||||
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Email_to_user/list.json.php",
|
||||
"columns": [{
|
||||
"data": "id"
|
||||
},
|
||||
{
|
||||
"data": "sent_at"
|
||||
},
|
||||
{
|
||||
"data": "timezone"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
data: null,
|
||||
defaultContent: $('#Email_to_userbtnModelLinks').html()
|
||||
}
|
||||
],
|
||||
select: true,
|
||||
});
|
||||
$('#newEmail_to_user').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#panelEmail_to_userForm').trigger("reset");
|
||||
$('#Email_to_userid').val('');
|
||||
});
|
||||
$('#panelEmail_to_userForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Email_to_user/add.json.php',
|
||||
data: $('#panelEmail_to_userForm').serialize(),
|
||||
type: 'post',
|
||||
success: function(response) {
|
||||
if (response.error) {
|
||||
avideoAlertError(response.msg);
|
||||
} else {
|
||||
avideoToast("<?php echo __("Your register has been saved!"); ?>");
|
||||
$("#panelEmail_to_userForm").trigger("reset");
|
||||
}
|
||||
Email_to_usertableVar.ajax.reload();
|
||||
$('#Email_to_userid').val('');
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#Email_to_userTable').on('click', 'button.delete_Email_to_user', function(e) {
|
||||
e.preventDefault();
|
||||
var tr = $(this).closest('tr')[0];
|
||||
var data = Email_to_usertableVar.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/Email_to_user/delete.json.php",
|
||||
data: data
|
||||
|
||||
}).done(function(resposta) {
|
||||
if (resposta.error) {
|
||||
avideoAlertError(resposta.msg);
|
||||
}
|
||||
Email_to_usertableVar.ajax.reload();
|
||||
modal.hidePleaseWait();
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#Email_to_userTable').on('click', 'button.edit_Email_to_user', function(e) {
|
||||
e.preventDefault();
|
||||
var tr = $(this).closest('tr')[0];
|
||||
var data = Email_to_usertableVar.row(tr).data();
|
||||
$('#Email_to_userid').val(data.id);
|
||||
$('#Email_to_usersent_at').val(data.sent_at);
|
||||
$('#Email_to_usertimezone').val(data.timezone);
|
||||
$('#Email_to_useremails_messages_id').val(data.emails_messages_id);
|
||||
$('#Email_to_userusers_id').val(data.users_id);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#Email_to_usersent_at').datetimepicker({
|
||||
format: 'yyyy-mm-dd hh:ii',
|
||||
autoclose: true
|
||||
});
|
||||
});
|
||||
</script>
|
5
plugin/Scheduler/View/Email_to_user/index_head.php
Normal file
5
plugin/Scheduler/View/Email_to_user/index_head.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Scheduler');
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
|
||||
<link href="<?php echo $global['webSiteRootURL']; ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
|
10
plugin/Scheduler/View/Email_to_user/list.json.php
Normal file
10
plugin/Scheduler/View/Email_to_user/list.json.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Email_to_user.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$rows = Email_to_user::getAll();
|
||||
$total = Email_to_user::getTotal();
|
||||
|
||||
?>
|
||||
{"data": <?php echo json_encode($rows); ?>, "draw": <?php echo intval(@$_REQUEST['draw']); ?>, "recordsTotal":<?php echo $total; ?>, "recordsFiltered":<?php echo $total; ?>}
|
25
plugin/Scheduler/View/Emails_messages/add.json.php
Normal file
25
plugin/Scheduler/View/Emails_messages/add.json.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Emails_messages.php';
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
$obj->msg = "";
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Scheduler');
|
||||
|
||||
if(!User::isAdmin()){
|
||||
$obj->msg = "You cant do this";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$o = new Emails_messages(@$_POST['id']);
|
||||
$o->setMessage($_POST['message']);
|
||||
$o->setSubject($_POST['subject']);
|
||||
|
||||
if($id = $o->save()){
|
||||
$obj->error = false;
|
||||
}
|
||||
|
||||
echo json_encode($obj);
|
20
plugin/Scheduler/View/Emails_messages/delete.json.php
Normal file
20
plugin/Scheduler/View/Emails_messages/delete.json.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Emails_messages.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->error = true;
|
||||
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Scheduler');
|
||||
|
||||
if(!User::isAdmin()){
|
||||
$obj->msg = "You cant do this";
|
||||
die(json_encode($obj));
|
||||
}
|
||||
|
||||
$id = intval($_POST['id']);
|
||||
$row = new Emails_messages($id);
|
||||
$obj->error = !$row->delete();
|
||||
die(json_encode($obj));
|
||||
?>
|
29
plugin/Scheduler/View/Emails_messages/index.php
Normal file
29
plugin/Scheduler/View/Emails_messages/index.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo getLanguage(); ?>">
|
||||
<head>
|
||||
<title><?php echo $config->getWebSiteTitle(); ?> :: Scheduler</title>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/head.php';
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/View/{$classname}/index_head.php';
|
||||
?>
|
||||
</head>
|
||||
<body class="<?php echo $global['bodyClass']; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/View/{$classname}/index_body.php';
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
?>
|
||||
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.js"></script>
|
||||
</body>
|
||||
</html>
|
194
plugin/Scheduler/View/Emails_messages/index_body.php
Normal file
194
plugin/Scheduler/View/Emails_messages/index_body.php
Normal file
|
@ -0,0 +1,194 @@
|
|||
<?php
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../../videos/configuration.php';
|
||||
}
|
||||
if (!User::isAdmin()) {
|
||||
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fas fa-cog"></i> <?php echo __("Configurations"); ?>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="panel panel-default ">
|
||||
<div class="panel-heading"><i class="far fa-plus-square"></i> <?php echo __("Create"); ?></div>
|
||||
<div class="panel-body">
|
||||
<form id="panelEmails_messagesForm">
|
||||
<div class="row">
|
||||
<input type="hidden" name="id" id="Emails_messagesid" value="">
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Emails_messagesmessage"><?php echo __("Message"); ?>:</label>
|
||||
<textarea id="Emails_messagesmessage" name="message" class="form-control input-sm" placeholder="<?php echo __("Message"); ?>" required="true"></textarea>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<label for="Emails_messagessubject"><?php echo __("Subject"); ?>:</label>
|
||||
<input type="text" id="Emails_messagessubject" name="subject" class="form-control input-sm" placeholder="<?php echo __("Subject"); ?>" required="true">
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="btn-group pull-right">
|
||||
<span class="btn btn-success" id="newEmails_messagesLink" onclick="clearEmails_messagesForm()"><i class="fas fa-plus"></i> <?php echo __("New"); ?></span>
|
||||
<button class="btn btn-primary" type="submit"><i class="fas fa-save"></i> <?php echo __("Save"); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="panel panel-default ">
|
||||
<div class="panel-heading"><i class="fas fa-edit"></i> <?php echo __("Edit"); ?></div>
|
||||
<div class="panel-body">
|
||||
<table id="Emails_messagesTable" class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php echo __("Message"); ?></th>
|
||||
<th><?php echo __("Subject"); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><?php echo __("Message"); ?></th>
|
||||
<th><?php echo __("Subject"); ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="Emails_messagesbtnModelLinks" style="display: none;">
|
||||
<div class="btn-group pull-right">
|
||||
<button href="" class="edit_Emails_messages btn btn-default btn-xs">
|
||||
<i class="fa fa-edit"></i>
|
||||
</button>
|
||||
<button href="" class="delete_Emails_messages btn btn-danger btn-xs">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function clearEmails_messagesForm() {
|
||||
$('#Emails_messagesid').val('');
|
||||
$('#Emails_messagesmessage').val('');
|
||||
$('#Emails_messagessubject').val('');
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('#addEmails_messagesBtn').click(function() {
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/addEmails_messagesVideo.php',
|
||||
data: $('#panelEmails_messagesForm').serialize(),
|
||||
type: 'post',
|
||||
success: function(response) {
|
||||
if (response.error) {
|
||||
avideoAlertError(response.msg);
|
||||
} else {
|
||||
avideoToast("<?php echo __("Your register has been saved!"); ?>");
|
||||
$("#panelEmails_messagesForm").trigger("reset");
|
||||
}
|
||||
clearEmails_messagesForm();
|
||||
tableVideos.ajax.reload();
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
var Emails_messagestableVar = $('#Emails_messagesTable').DataTable({
|
||||
serverSide: true,
|
||||
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Emails_messages/list.json.php",
|
||||
"columns": [{
|
||||
"data": "id"
|
||||
},
|
||||
{
|
||||
"data": "message"
|
||||
},
|
||||
{
|
||||
"data": "subject"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
data: null,
|
||||
defaultContent: $('#Emails_messagesbtnModelLinks').html()
|
||||
}
|
||||
],
|
||||
select: true,
|
||||
});
|
||||
$('#newEmails_messages').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#panelEmails_messagesForm').trigger("reset");
|
||||
$('#Emails_messagesid').val('');
|
||||
});
|
||||
$('#panelEmails_messagesForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Emails_messages/add.json.php',
|
||||
data: $('#panelEmails_messagesForm').serialize(),
|
||||
type: 'post',
|
||||
success: function(response) {
|
||||
if (response.error) {
|
||||
avideoAlertError(response.msg);
|
||||
} else {
|
||||
avideoToast("<?php echo __("Your register has been saved!"); ?>");
|
||||
$("#panelEmails_messagesForm").trigger("reset");
|
||||
}
|
||||
Emails_messagestableVar.ajax.reload();
|
||||
$('#Emails_messagesid').val('');
|
||||
modal.hidePleaseWait();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#Emails_messagesTable').on('click', 'button.delete_Emails_messages', function(e) {
|
||||
e.preventDefault();
|
||||
var tr = $(this).closest('tr')[0];
|
||||
var data = Emails_messagestableVar.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/Emails_messages/delete.json.php",
|
||||
data: data
|
||||
|
||||
}).done(function(resposta) {
|
||||
if (resposta.error) {
|
||||
avideoAlertError(resposta.msg);
|
||||
}
|
||||
Emails_messagestableVar.ajax.reload();
|
||||
modal.hidePleaseWait();
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#Emails_messagesTable').on('click', 'button.edit_Emails_messages', function(e) {
|
||||
e.preventDefault();
|
||||
var tr = $(this).closest('tr')[0];
|
||||
var data = Emails_messagestableVar.row(tr).data();
|
||||
$('#Emails_messagesid').val(data.id);
|
||||
$('#Emails_messagesmessage').val(data.message);
|
||||
$('#Emails_messagessubject').val(data.subject);
|
||||
});
|
||||
});
|
||||
</script>
|
5
plugin/Scheduler/View/Emails_messages/index_head.php
Normal file
5
plugin/Scheduler/View/Emails_messages/index_head.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled('Scheduler');
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
|
||||
<link href="<?php echo $global['webSiteRootURL']; ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
|
10
plugin/Scheduler/View/Emails_messages/list.json.php
Normal file
10
plugin/Scheduler/View/Emails_messages/list.json.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
require_once '../../../../videos/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Scheduler/Objects/Emails_messages.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$rows = Emails_messages::getAll();
|
||||
$total = Emails_messages::getTotal();
|
||||
|
||||
?>
|
||||
{"data": <?php echo json_encode($rows); ?>, "draw": <?php echo intval(@$_REQUEST['draw']); ?>, "recordsTotal":<?php echo $total; ?>, "recordsFiltered":<?php echo $total; ?>}
|
|
@ -186,18 +186,39 @@ if (!User::isAdmin()) {
|
|||
var Scheduler_commandstableVar = $('#Scheduler_commandsTable').DataTable({
|
||||
serverSide: true,
|
||||
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/Scheduler/View/Scheduler_commands/list.json.php",
|
||||
"columns": [
|
||||
{"data": "id"},
|
||||
{"data": "parameters"},
|
||||
{"data": "date_to_execute"},
|
||||
{"data": "executed_in"},
|
||||
{"data": "status"},
|
||||
{"data": "repeat_minute"},
|
||||
{"data": "repeat_hour"},
|
||||
{"data": "repeat_day_of_month"},
|
||||
{"data": "repeat_month"},
|
||||
{"data": "repeat_day_of_week"},
|
||||
{"data": "type"},
|
||||
"columns": [{
|
||||
"data": "id"
|
||||
},
|
||||
{
|
||||
"data": "parameters"
|
||||
},
|
||||
{
|
||||
"data": "date_to_execute"
|
||||
},
|
||||
{
|
||||
"data": "executed_in"
|
||||
},
|
||||
{
|
||||
"data": "status"
|
||||
},
|
||||
{
|
||||
"data": "repeat_minute"
|
||||
},
|
||||
{
|
||||
"data": "repeat_hour"
|
||||
},
|
||||
{
|
||||
"data": "repeat_day_of_month"
|
||||
},
|
||||
{
|
||||
"data": "repeat_month"
|
||||
},
|
||||
{
|
||||
"data": "repeat_day_of_week"
|
||||
},
|
||||
{
|
||||
"data": "type"
|
||||
},
|
||||
{
|
||||
sortable: false,
|
||||
data: null,
|
||||
|
@ -283,9 +304,19 @@ if (!User::isAdmin()) {
|
|||
});
|
||||
});
|
||||
</script>
|
||||
<script> $(document).ready(function () {
|
||||
$('#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>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#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>
|
|
@ -26,6 +26,8 @@ AVideoPlugin::loadPlugin("Scheduler");
|
|||
<div class="panel-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a data-toggle="tab" href="#Scheduler_commands"><?php echo __("Scheduler Commands"); ?></a></li>
|
||||
<li class=""><a data-toggle="tab" href="#Emails_messages"><?php echo __("Emails Messages"); ?></a></li>
|
||||
<li class=""><a data-toggle="tab" href="#Email_to_user"><?php echo __("Email To User"); ?></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="Scheduler_commands" class="tab-pane fade in active" style="padding: 10px;">
|
||||
|
@ -33,6 +35,16 @@ AVideoPlugin::loadPlugin("Scheduler");
|
|||
include $global['systemRootPath'] . 'plugin/Scheduler/View/Scheduler_commands/index_body.php';
|
||||
?>
|
||||
</div>
|
||||
<div id="Emails_messages" class="tab-pane fade " style="padding: 10px;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/View/Emails_messages/index_body.php';
|
||||
?>
|
||||
</div>
|
||||
<div id="Email_to_user" class="tab-pane fade " style="padding: 10px;">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/View/Email_to_user/index_body.php';
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,3 +25,36 @@ CREATE TABLE IF NOT EXISTS `scheduler_commands` (
|
|||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE)
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `emails_messages` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`message` TEXT NOT NULL,
|
||||
`subject` VARCHAR(255) NOT NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `unique_msg` (`message` ASC))
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `email_to_user` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`sent_at` DATETIME NULL,
|
||||
`timezone` VARCHAR(255) NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
`emails_messages_id` INT NOT NULL,
|
||||
`users_id` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_email_to_user_emails_messages1_idx` (`emails_messages_id` ASC),
|
||||
INDEX `fk_email_to_user_users1_idx` (`users_id` ASC),
|
||||
CONSTRAINT `fk_email_to_user_emails_messages1`
|
||||
FOREIGN KEY (`emails_messages_id`)
|
||||
REFERENCES `emails_messages` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_email_to_user_users1`
|
||||
FOREIGN KEY (`users_id`)
|
||||
REFERENCES `users` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
32
plugin/Scheduler/install/updateV4.4.sql
Normal file
32
plugin/Scheduler/install/updateV4.4.sql
Normal file
|
@ -0,0 +1,32 @@
|
|||
CREATE TABLE IF NOT EXISTS `emails_messages` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`message` TEXT NOT NULL,
|
||||
`subject` VARCHAR(255) NOT NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `unique_msg` (`message` ASC))
|
||||
ENGINE = InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `email_to_user` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`sent_at` DATETIME NULL,
|
||||
`timezone` VARCHAR(255) NULL,
|
||||
`created` DATETIME NULL,
|
||||
`modified` DATETIME NULL,
|
||||
`emails_messages_id` INT NOT NULL,
|
||||
`users_id` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_email_to_user_emails_messages1_idx` (`emails_messages_id` ASC),
|
||||
INDEX `fk_email_to_user_users1_idx` (`users_id` ASC),
|
||||
CONSTRAINT `fk_email_to_user_emails_messages1`
|
||||
FOREIGN KEY (`emails_messages_id`)
|
||||
REFERENCES `emails_messages` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION,
|
||||
CONSTRAINT `fk_email_to_user_users1`
|
||||
FOREIGN KEY (`users_id`)
|
||||
REFERENCES `users` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION)
|
||||
ENGINE = InnoDB;
|
|
@ -53,3 +53,5 @@ function _log($msg){
|
|||
}
|
||||
|
||||
include $global['systemRootPath'] . 'plugin/Scheduler/watchDog.php';
|
||||
|
||||
Scheduler::sendEmails();
|
|
@ -5,9 +5,6 @@ require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
|||
require_once $global['systemRootPath'] . 'plugin/TopMenu/Objects/Menu.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/TopMenu/Objects/MenuItem.php';
|
||||
|
||||
use Pecee\SimpleRouter\SimpleRouter; //required if we want to define routes on our plugin.
|
||||
|
||||
|
||||
class TopMenu extends PluginAbstract {
|
||||
const PERMISSION_CAN_EDIT = 0;
|
||||
|
||||
|
@ -56,16 +53,6 @@ class TopMenu extends PluginAbstract {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function addRoutes()
|
||||
{
|
||||
global $basePath;
|
||||
SimpleRouter::get($basePath."/menu/{menuSeoUrlItem}", function($menuSeoUrlItem) {
|
||||
$_GET['menuSeoUrlItem']=$menuSeoUrlItem;
|
||||
require_once "plugin/TopMenu/seo.php";
|
||||
},['defaultParameterRegex' => '.*']);
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getHeadCode() {
|
||||
global $global;
|
||||
$css = '<link href="' .getURL('plugin/TopMenu/style.css') . '" rel="stylesheet" type="text/css"/>';
|
||||
|
|
|
@ -45,6 +45,7 @@ time.duration {
|
|||
border-radius: 5px;
|
||||
opacity: 0.8;
|
||||
text-shadow: 1px 1px 4px #000;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.thumbsImageContainer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue