Preorder Status Trigger Email done
This commit is contained in:
@@ -395,17 +395,38 @@
|
||||
|
||||
<h4 class="mt-3">Emailtemplates</h4>
|
||||
<?php foreach(PreorderstatusModel::getAll() as $status): ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label text-right" for="mailtemplates_<?=$status->code?>"><?=$status->code?></label>
|
||||
<div class="form-group row" id="statustemplate-<?=$status->code?>">
|
||||
<label class="col-lg-2 col-form-label text-right text-monospace" for="mailtemplates_<?=$status->code?>"><?=$status->name?></label>
|
||||
<div class="col-lg-10">
|
||||
<select name="mailtemplates[<?=$status->code?>]" id="mailtemplates_<?=$status->code?>" class="select2">
|
||||
<option value=""></option>
|
||||
<?php foreach(MailtemplateModel::search(["is_include" => "0"]) as $template): ?>
|
||||
<option value="<?=$template->id?>"><?=$template->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend text-monospace">
|
||||
<span class="input-group-text" id="basic-addon1"><?=$status->code?></span>
|
||||
</div>
|
||||
<select name="mailtemplates[<?=$status->code?>]" id="mailtemplate-<?=$status->code?>" class="form-control select2">
|
||||
<option value=""></option>
|
||||
<?php foreach(MailtemplateModel::search(["is_include" => "0"]) as $template): ?>
|
||||
<option value="<?=$template->id?>" <?=(is_array($campaign->statusnotifcation_mailtemplates) && array_key_exists($status->code, $campaign->statusnotifcation_mailtemplates) && $campaign->statusnotifcation_mailtemplates[$status->code]->mailtemplate_id == $template->id) ? "selected='selected'" : ""?>><?=$template->name?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend text-monospace">
|
||||
<span class="input-group-text">@</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="test_to" id="test-to-<?=$status->code?>" value="" placeholder="Test Emailadresse" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-success" type="button" onclick="sendTestStatusEmail(<?=$status->code?>)"><i class="fas fa-envelope"></i> Testmail versenden</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -530,5 +551,31 @@
|
||||
closeOnSelect: false,
|
||||
background: "bg-danger"
|
||||
});
|
||||
|
||||
function sendTestStatusEmail(status_code) {
|
||||
if(!status_code) return;
|
||||
|
||||
var template_id = $("#mailtemplate-" + status_code).val();
|
||||
var email_to = $("#test-to-" + status_code).val();
|
||||
|
||||
$.post("<?=self::getUrl("Preordercampaign", "Api")?>",
|
||||
{
|
||||
do: "sendStatusEmail",
|
||||
campaign_id: <?=$campaign->id?>,
|
||||
template_id: template_id,
|
||||
to_email: email_to
|
||||
},
|
||||
(success) => {
|
||||
if(success.status == "OK") {
|
||||
window.notify("success", "Testmail wurde versendet");
|
||||
} else {
|
||||
window.notify("error", "Beim versenden ist ein Fehler aufgetragen.");
|
||||
}
|
||||
|
||||
console.log(success);
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
@@ -59,6 +59,9 @@ class MailtemplateModel {
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$res = $db->select("Mailtemplate", "*", "$where ORDER BY name LIMIT 1");
|
||||
|
||||
mfLoghandler::singleton()->debug($where);
|
||||
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new Mailtemplate($data);
|
||||
|
||||
@@ -167,33 +167,51 @@ class Preorder extends mfBaseModel {
|
||||
|
||||
$this->log->debug(__METHOD__ . ": Looking for $classname in $filepath");
|
||||
|
||||
if(!file_exists($filepath)) {
|
||||
$this->log->debug(__METHOD__ . ": $filepath not found");
|
||||
continue;
|
||||
if(file_exists($filepath)) {
|
||||
require_once $filepath;
|
||||
}
|
||||
|
||||
require_once $filepath;
|
||||
if(class_exists($classname)) {
|
||||
$trigger = new $classname($this, $new_status);
|
||||
$trigger->run();
|
||||
|
||||
if(!class_exists($classname)) {
|
||||
$this->log->debug(__METHOD__ . ": $classname not found");
|
||||
continue;
|
||||
}
|
||||
|
||||
$trigger = new $classname($this, $new_status);
|
||||
$trigger->run();
|
||||
|
||||
//var_dump($status["action"]);
|
||||
if(array_key_exists("action", $status) && is_array($status) && property_exists($trigger, "run_action") && $trigger->run_action) {
|
||||
foreach($status["action"] as $type => $action) {
|
||||
if(!array_key_exists($type, $actions)) {
|
||||
$actions[$type] = [];
|
||||
//var_dump($status["action"]);
|
||||
if (array_key_exists("action", $status) && is_array($status)) {
|
||||
foreach ($status["action"] as $type => $action) {
|
||||
if (!array_key_exists($type, $actions)) {
|
||||
$actions[$type] = [];
|
||||
}
|
||||
$action["status_code"] = $intermediate_code;
|
||||
$actions[$type][] = $action;
|
||||
}
|
||||
$action["status_code"] = $intermediate_code;
|
||||
$actions[$type][] = $action;
|
||||
}
|
||||
} else {
|
||||
$this->log->debug(__METHOD__ . ": $classname not found");
|
||||
}
|
||||
|
||||
// TODO create email action if status templates configured in Campaign
|
||||
$campaign = new Preordercampaign($this->preordercampaign_id);
|
||||
if(!$campaign->id) continue;
|
||||
|
||||
$status_mail = PreordercampaignStatusnotificationMailtemplate::getFirst(["preordercampaign_id" => $this->preordercampaign_id, "status_code" => $intermediate_code]);
|
||||
if($status_mail) {
|
||||
$mailtemplate = $status_mail->mailtemplate;
|
||||
if(!$mailtemplate) continue;
|
||||
|
||||
if(!array_key_exists("email", $actions)) {
|
||||
$actions["email"] = [];
|
||||
}
|
||||
$actions["email"][] = [
|
||||
"template" => $mailtemplate->code,
|
||||
"from" => "campaign",
|
||||
"data" => "preorder, adb_hausnummer, adb_wohneinheit",
|
||||
"status_code" => $intermediate_code
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($actions);exit;
|
||||
|
||||
// run last email action
|
||||
if(array_key_exists("email", $actions) && is_array($actions["email"]) && count($actions["email"])) {
|
||||
// get last email action, ignore previous status'
|
||||
@@ -210,6 +228,7 @@ class Preorder extends mfBaseModel {
|
||||
}
|
||||
|
||||
if($send_email) {
|
||||
$this->log->debug(__METHOD__.": Sending Email Action for Status ".$email_action["status_code"]);
|
||||
$email_to = $this->runTriggerEmailAction($email_action);
|
||||
if($email_to === false) {
|
||||
$this->log->warning(__METHOD__ . ": Could not send preorder action email (Preorder " . $this->id . ")");
|
||||
@@ -223,7 +242,7 @@ class Preorder extends mfBaseModel {
|
||||
$psn_log->save();
|
||||
}
|
||||
} else {
|
||||
$this->log->warning(__METHOD__.": Not sending status email because same or higher status email was sent already (Preorder ".$this->id.")");
|
||||
$this->log->warning(__METHOD__.": Not sending status (".$email_action["status_code"].") email because same or higher status email was sent already (Preorder ".$this->id.")");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +261,11 @@ class Preorder extends mfBaseModel {
|
||||
}
|
||||
|
||||
$to = $this->email;
|
||||
|
||||
if(array_key_exists("to", $action) && $action["to"]) {
|
||||
$to = $action["to"];
|
||||
}
|
||||
|
||||
if(!$to) {
|
||||
$this->log->warning(__METHOD__.": Keine To Adresse (Preorder ".$this->id.")");
|
||||
return false;
|
||||
@@ -289,7 +313,9 @@ class Preorder extends mfBaseModel {
|
||||
}
|
||||
|
||||
$subject = $mailtemplate->getVariableReplacedSubject($replacers);
|
||||
$body = $mailtemplate->renderBody($replacers);
|
||||
$body = "<html><head></head><body>";
|
||||
$body .= $mailtemplate->renderBody($replacers);
|
||||
$body .= "</body></html>\n";
|
||||
|
||||
$body_type = $mailtemplate->body_html ? "html" : "text";
|
||||
|
||||
@@ -306,7 +332,7 @@ class Preorder extends mfBaseModel {
|
||||
$email->setHeader("X-".ucfirst(MFAPPNAME)."-ps", $this->getProperty("status")->code);
|
||||
// add attachments
|
||||
foreach($mailtemplate->files as $file) {
|
||||
if($file->filename && $file->file_id && $file->file->storage_filename);
|
||||
if(!$file->filename || !$file->file_id || !$file->file->store_filename) continue;
|
||||
$this->log->debug($file->file->getFullPath());
|
||||
$email->addAttachment($file->file->getFullPath(), null, $file->filename, $file->file->mimetype ?: null);
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ class PreorderModel {
|
||||
if(is_array($limit) && count($limit)) {
|
||||
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
|
||||
} elseif(is_numeric($count)) {
|
||||
} elseif(is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['count'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ class Preordercampaign extends mfBaseModel {
|
||||
private $all_fcp_names;
|
||||
private $active_operators;
|
||||
private $passive_operators;
|
||||
private $statusnotifcation_mailtemplates;
|
||||
|
||||
public function getAllFcpNames() {
|
||||
if(!$this->id) return [];
|
||||
@@ -255,6 +256,17 @@ class Preordercampaign extends mfBaseModel {
|
||||
return $this->active_operators;
|
||||
}
|
||||
|
||||
if($name == "statusnotifcation_mailtemplates") {
|
||||
$snmts = PreordercampaignStatusnotificationMailtemplate::search(["preordercampaign_id" => $this->id]);
|
||||
if(!count($snmts)) {
|
||||
return [];
|
||||
}
|
||||
foreach($snmts as $snmt) {
|
||||
$this->statusnotifcation_mailtemplates[$snmt->status_code] = $snmt;
|
||||
}
|
||||
return $this->statusnotifcation_mailtemplates;
|
||||
}
|
||||
|
||||
if($name == "apiusers") {
|
||||
$items = PreordercampaignApiuserModel::search(["preordercampaign_id" => $this->id]);
|
||||
foreach($items as $poa) {
|
||||
|
||||
@@ -213,7 +213,7 @@ class PreordercampaignController extends mfBaseController {
|
||||
}
|
||||
|
||||
$r = $this->request;
|
||||
//var_dump($r);exit;
|
||||
//var_dump($r->get());exit;
|
||||
$id = $r->id;
|
||||
if(is_numeric($id) && $id > 0) {
|
||||
$mode = "edit";
|
||||
@@ -478,6 +478,46 @@ class PreordercampaignController extends mfBaseController {
|
||||
}
|
||||
}
|
||||
|
||||
// Delete Status Email Templates from Campaign
|
||||
/*foreach(PreordercampaignStatusnotificationMailtemplate::search(["preordercampaign_id" => $campaign->id]) as $status_mailtemplate) {
|
||||
$status_mailtemplate->delete();
|
||||
}*/
|
||||
|
||||
$mailtemplates_delete = [];
|
||||
// Save Status Email Templates
|
||||
foreach($r->mailtemplates as $status_code => $mailtemplate_id) {
|
||||
if(!$mailtemplate_id) {
|
||||
$mailtemplates_delete[] = $status_code;
|
||||
continue;
|
||||
}
|
||||
|
||||
$mailtemplate = new Mailtemplate($mailtemplate_id);
|
||||
if(!$mailtemplate) continue;
|
||||
|
||||
$mt_data = [
|
||||
"preordercampaign_id" => $campaign->id,
|
||||
"status_code" => $status_code,
|
||||
"mailtemplate_id" => $mailtemplate_id,
|
||||
];
|
||||
|
||||
$statusmailtemplate = PreordercampaignStatusnotificationMailtemplate::getFirst(["preordercampaign_id" => $campaign->id, "status_code" => $status_code]);
|
||||
if($statusmailtemplate) {
|
||||
$statusmailtemplate->update($mt_data);
|
||||
} else {
|
||||
$statusmailtemplate = PreordercampaignStatusnotificationMailtemplate::create($mt_data);
|
||||
}
|
||||
|
||||
if(!$statusmailtemplate->save()) {
|
||||
$this->layout()->setFlash("Fehler beim Speichern der Status Emailtemplates", "warn");
|
||||
}
|
||||
}
|
||||
|
||||
foreach($mailtemplates_delete as $mt_code) {
|
||||
$status_mt = PreordercampaignStatusnotificationMailtemplate::getFirst(["preordercampaign_id" => $campaign->id, "status_code" => $mt_code]);
|
||||
if($status_mt) {
|
||||
$status_mt->delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->layout()->setFlash("Vorbestellkampagne erfolgreich gespeichert.", "success");
|
||||
@@ -595,7 +635,75 @@ class PreordercampaignController extends mfBaseController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function apiAction() {
|
||||
if(!$this->me->is(["Admin","netowner"]) && !$this->me->can("Preorder")) {
|
||||
$this->redirect("Dashboard");
|
||||
}
|
||||
$do = $this->request->do;
|
||||
$data = [];
|
||||
|
||||
switch($do) {
|
||||
case "sendStatusEmail":
|
||||
$return = $this->sendStatusEmailApi();
|
||||
break;
|
||||
default:
|
||||
$return = false;
|
||||
}
|
||||
|
||||
if(!is_array($return) || !count($return)) {
|
||||
$data = ["status" => "error"];
|
||||
$this->returnJson($data);
|
||||
}
|
||||
$data['status'] = "OK";
|
||||
$data['result'] = $return;
|
||||
$this->returnJson($data);
|
||||
}
|
||||
|
||||
private function sendStatusEmailApi() {
|
||||
$campaign_id = $this->request->campaign_id;
|
||||
$template_id = $this->request->template_id;
|
||||
$to_email = $this->request->to_email;
|
||||
|
||||
if(!$to_email) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!is_numeric($campaign_id) || $campaign_id < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$campaign = new Preordercampaign($campaign_id);
|
||||
if(!$campaign->id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$preorder = PreorderModel::getFirst(["preordercampaign_id" => $campaign_id]);
|
||||
if(!$preorder) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$template = new Mailtemplate($template_id);
|
||||
if(!$template->id || !$template->code) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$email_data = [
|
||||
"template" => $template->code,
|
||||
"from" => "campaign",
|
||||
"to" => $to_email,
|
||||
"data" => "preorder, adb_hausnummer, adb_wohneinheit"
|
||||
];
|
||||
|
||||
$preorder->runTriggerEmailAction($email_data);
|
||||
|
||||
return ["message" => "Testemail sent"];
|
||||
}
|
||||
|
||||
/****************************
|
||||
* begin Campaign Admin actions
|
||||
*/
|
||||
|
||||
protected function adminAction() {
|
||||
$this->layout()->setTemplate("Preordercampaign/Admin");
|
||||
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
class PreordercampaignStatusnotificationMailtemplate extends mfBaseModel {
|
||||
private $preordercampaign;
|
||||
private $mailtemplate;
|
||||
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
|
||||
$classname = ucfirst($name);
|
||||
$idfield = $name."_id";
|
||||
$this->$name = mfValuecache::singleton()->get("mfObjectmodel-$name-".$this->$idfield);
|
||||
if(!$this->$name) {
|
||||
$this->$name = new $classname($this->$idfield);
|
||||
}
|
||||
|
||||
if($this->$name->id) {
|
||||
mfValuecache::singleton()->set("mfObjectmodel-$name-".$this->$name->id, $this->$name);
|
||||
return $this->$name;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
/********************************
|
||||
* Begin static Model functions
|
||||
*/
|
||||
|
||||
public static function create(Array $data) {
|
||||
$model = new PreordercampaignStatusnotificationMailtemplate();
|
||||
|
||||
$table_fields = [
|
||||
"preordercampaign_id", "status_code", "mailtemplate_id",
|
||||
"result","create_by","edit_by","create","edit"
|
||||
];
|
||||
|
||||
foreach($data as $field => $value) {
|
||||
if(in_array($field, $table_fields)) {
|
||||
$model->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
|
||||
if($model->create_by === null) {
|
||||
$model->create_by = $me->id;
|
||||
}
|
||||
if($model->edit_by === null) {
|
||||
$model->edit_by = $me->id;
|
||||
}
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function getAll() {
|
||||
$items = [];
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select("PreordercampaignStatusnotificationMailtemplate", "*", "1 = 1 ORDER BY preordercampaign_id, status_code");
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new PreordercampaignStatusnotificationMailtemplate($data);
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
|
||||
}
|
||||
|
||||
public static function getFirst($filter) {
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT * FROM PreordercampaignStatusnotificationMailtemplate
|
||||
WHERE $where
|
||||
ORDER BY preordercampaign_id, status_code LIMIT 1";
|
||||
//var_dump($sql);exit;
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new PreordercampaignStatusnotificationMailtemplate($data);
|
||||
if($item->id) {
|
||||
return $item;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function count($filter) {
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT COUNT(*) as cnt FROM PreordercampaignStatusnotificationMailtemplate
|
||||
WHERE $where";
|
||||
|
||||
//mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
return $data->cnt;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function search($filter, $limit = false, $order = false) {
|
||||
//var_dump($filter);exit;
|
||||
$items = [];
|
||||
|
||||
if(!$order) {
|
||||
$order = "preordercampaign_id ASC, status_code ASC";
|
||||
}
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT * FROM PreordercampaignStatusnotificationMailtemplate
|
||||
WHERE $where
|
||||
ORDER BY $order";
|
||||
|
||||
if(is_array($limit) && count($limit)) {
|
||||
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
|
||||
} elseif(is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['count'];
|
||||
}
|
||||
}
|
||||
|
||||
mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
$res = $db->query($sql);
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[$data->id] = new PreordercampaignStatusnotificationMailtemplate($data);
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
private static function getSqlFilter($filter) {
|
||||
$where = "1=1 ";
|
||||
|
||||
if(array_key_exists("preordercampaign_id", $filter)) {
|
||||
$preordercampaign_id = $filter['preordercampaign_id'];
|
||||
if(is_numeric($preordercampaign_id)) {
|
||||
$where .= " AND PreordercampaignStatusnotificationMailtemplate.preordercampaign_id=$preordercampaign_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("status_code", $filter)) {
|
||||
$status_code = $filter['status_code'];
|
||||
if(is_numeric($status_code)) {
|
||||
$where .= " AND PreordercampaignStatusnotificationMailtemplate.status_code=$status_code";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("mailtemplate_id", $filter)) {
|
||||
$mailtemplate_id = $filter['mailtemplate_id'];
|
||||
if(is_numeric($mailtemplate_id)) {
|
||||
$where .= " AND PreordercampaignStatusnotificationMailtemplate.mailtemplate_id=$mailtemplate_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("add-where", $filter)) {
|
||||
$where .= " ".$filter['add-where'];
|
||||
}
|
||||
|
||||
//var_dump($filter, $where);exit;
|
||||
return $where;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class CreatePreordercampaignStatusnotificationMailtemplate extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table('PreordercampaignStatusnotificationMailtemplate');
|
||||
$table->addColumn("preordercampaign_id", "integer", ["null" => false]);
|
||||
$table->addColumn("status_code", "integer", ["null" => false]);
|
||||
$table->addColumn("mailtemplate_id", "integer", ["null" => false]);
|
||||
|
||||
$table->addColumn("create_by", "integer", ["null" => false]);
|
||||
$table->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$table->addColumn("create", "integer", ["null" => false]);
|
||||
$table->addColumn("edit", "integer", ["null" => false]);
|
||||
|
||||
$table->create();
|
||||
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table('PreordercampaignStatusnotificationMailtemplate')->drop()->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,7 +342,7 @@ class mfBaseController
|
||||
$t[3] = 0;
|
||||
}
|
||||
} else {
|
||||
$t = array(0, 0, 0);
|
||||
$t = array(0, 0, 0, 0);
|
||||
}
|
||||
// make and return timestamp
|
||||
$ts = mktime($t[1], $t[2], $t[3], $d[2], $d[1], $d[3]);
|
||||
|
||||
Reference in New Issue
Block a user