Skip to content

Commit

Permalink
Merge pull request #122 from WebFiori/dev
Browse files Browse the repository at this point in the history
Fix to CRON EMail Bug + The Outut Button
  • Loading branch information
usernane authored Jan 31, 2022
2 parents b803394 + a07ca2a commit e5d4691
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"webfiori/ui":"2.2.3",
"webfiori/jsonx":"3.0.0",
"webfiori/http":"3.1.1",
"webfiori/database":"0.3.8"
"webfiori/database":"0.3.9"
},
"keywords": [
"framework",
Expand Down
7 changes: 4 additions & 3 deletions webfiori/framework/WebFioriApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class WebFioriApp {
*/
private static $LC;
/**
* An instance of system functions class.
* An instance of framework configuration class.
*
* @var ConfigController
*
Expand Down Expand Up @@ -253,6 +253,7 @@ private static function _autoRegisterHelper($options) {
}
}
/**
* Returns the instance which is used as main application configuration class.
*
* @return Config
*/
Expand Down Expand Up @@ -492,7 +493,7 @@ private function _initVersionInfo() {
*
* @since 2.1
*/
define('WF_VERSION', '2.4.6');
define('WF_VERSION', '2.4.7');
/**
* A constant that tells the type of framework version.
*
Expand All @@ -508,7 +509,7 @@ private function _initVersionInfo() {
*
* @since 2.1
*/
define('WF_RELEASE_DATE', '2022-01-17');
define('WF_RELEASE_DATE', '2022-01-31');
}
private function _loadConstants() {
if (!class_exists(APP_DIR_NAME.'\ini\GlobalConstants')) {
Expand Down
18 changes: 9 additions & 9 deletions webfiori/framework/cron/CronEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,44 +72,44 @@ public function __construct($sendAccName, $receivers = []) {
}


$this->importance(1);
$this->document()->getBody()->setStyle([
$this->setPriority(1);
$this->getDocument()->getBody()->setStyle([
'font-family' => 'monospace'
]);
$dearNode = new HTMLNode('p');
$dearNode->addTextNode('Dear,');
$this->insertNode($dearNode);
$this->insert($dearNode);
$paragraph = new HTMLNode('p');
$paragraph->setStyle([
'text-align' => 'justify'
]);

if ($activeJob->isSuccess()) {
$this->subject('Background Task Status: Task \''.$activeJob->getJobName().'\' 😃');
$this->setSubject('Background Task Status: Task \''.$activeJob->getJobName().'\' 😃');
$text = 'This automatic system email is sent to notify you that the background job '
.'\''.$activeJob->getJobName().'\' was <b style="color:green">successfully completed '
.'without any issues</b>. For more details about execution process, '
.'please check the attached execution log file.</p>';
} else {
$this->subject('Background Task Status: Task \''.$activeJob->getJobName().'\' 😲');
$this->setSubject('Background Task Status: Task \''.$activeJob->getJobName().'\' 😲');
$text = 'This automatic email is sent to notify you that the background job '
.'\''.$activeJob->getJobName().'\' <b style="color:red">did not successfully complet due some error(s)'
.'</b>. To investigate the cause of failure, '
.'please check the attached execution log file. It may lead you to '
.'the cause of the issue.';
}
$paragraph->addTextNode($text, false);
$this->insertNode($paragraph);
$this->write('<p>Technical Info:</p>');
$this->insertNode($this->_createJobInfoTable($activeJob));
$this->insert($paragraph);
$this->insert('p')->text('Technical Info:');
$this->insert($this->_createJobInfoTable($activeJob));
$logTxt = '';

foreach (Cron::getLogArray() as $logEntry) {
$logTxt .= $logEntry."\r\n";
}
$file = new File($activeJob->getJobName().'-ExecLog-'.date('Y-m-d H-i-s').'.log');
$file->setRawData($logTxt);
$this->attach($file);
$this->addAttachment($file);
}
}
/**
Expand Down
1 change: 1 addition & 0 deletions webfiori/framework/cron/webUI/CronView.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function createVDialog($model, $titleModel, $messageModel, $closeAction,
'@click' => "$closeAction"
])->text('Close');
$dialogActions->addChild('v-btn', [
'v-if' => 'output_dialog.output.length !== 0',
'color' => "primary",
'text',
'@click' => "output_dialog.show = true"
Expand Down

0 comments on commit e5d4691

Please sign in to comment.