From 2a271f9b1c7cc7a65810553ae8b61e5ee71abb8c Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Mon, 18 Oct 2021 10:01:04 +0900 Subject: [PATCH] =?UTF-8?q?change:=20=E7=99=BB=E9=8C=B2=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=BC=E3=83=A0=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E6=8A=95=E7=A8=BF=E3=81=AE=E9=80=9A=E7=9F=A5=E3=82=92=E3=83=AB?= =?UTF-8?q?=E3=83=BC=E3=83=A0=E7=AE=A1=E7=90=86=E3=81=AB=E3=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E3=81=9B=E3=81=9A=E3=81=AB=E6=9C=AC=E4=BA=BA=E3=81=AE?= =?UTF-8?q?=E3=81=BF=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=20https://github.?= =?UTF-8?q?com/NetCommons3/NetCommons3/issues/1669?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...34459814_update_mail_answer_receivable.php | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Config/Migration/1634459814_update_mail_answer_receivable.php diff --git a/Config/Migration/1634459814_update_mail_answer_receivable.php b/Config/Migration/1634459814_update_mail_answer_receivable.php new file mode 100644 index 0000000..63c3516 --- /dev/null +++ b/Config/Migration/1634459814_update_mail_answer_receivable.php @@ -0,0 +1,72 @@ + + * @link http://www.netcommons.org NetCommons Project + * @license http://www.netcommons.org/license.txt NetCommons License + * @copyright Copyright 2014, NetCommons Project + */ + +App::uses('NetCommonsMigration', 'NetCommons.Config/Migration'); + +/** + * 登録フォームのフォーム投稿の通知をルーム管理には通知せずに本人のみに設定できるようにする + * + * @author Shohei Nakajima + * @package NetCommons\Roles\Config\Migration + * @see https://github.com/NetCommons3/NetCommons3/issues/1669 + */ +class UpdateMailAnswerReceivable extends NetCommonsMigration { + +/** + * Migration description + * + * @var string + */ + public $description = 'update_mail_answer_receivable'; + +/** + * Actions to be performed + * + * @var array $migration + */ + public $migration = array( + 'up' => array( + ), + 'down' => array( + ), + ); + +/** + * Before migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function before($direction) { + return true; + } + +/** + * After migration callback + * + * @param string $direction Direction of migration process (up or down) + * @return bool Should process continue + */ + public function after($direction) { + if ($direction === 'up') { + $update = array( + 'fixed' => '\'0\'', + 'modified' => '\'' . gmdate('Y-m-d H:i:s') . '\'' + ); + $conditions = array( + 'role_key' => 'room_administrator', + 'permission' => 'mail_answer_receivable', + ); + $DefaultRolePermission = $this->generateModel('DefaultRolePermission'); + $DefaultRolePermission->updateAll($update, $conditions); + } + return true; + } +}