Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
404700e6
Commit
404700e6
authored
May 16, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Правки по рассылкам по кейсам
parent
301af5eb
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
44 deletions
+121
-44
common/modules/triggers/controllers/DefaultController.php
common/modules/triggers/controllers/DefaultController.php
+64
-42
common/modules/triggers/models/CasesSchedule.php
common/modules/triggers/models/CasesSchedule.php
+5
-2
console/migrations/m160512_151201_update_the_cases_schedule_table.php
...ations/m160512_151201_update_the_cases_schedule_table.php
+52
-0
No files found.
common/modules/triggers/controllers/DefaultController.php
View file @
404700e6
This diff is collapsed.
Click to expand it.
common/modules/triggers/models/CasesSchedule.php
View file @
404700e6
...
@@ -15,6 +15,7 @@ use common\modules\messageTemplate\models\MessageTemplate;
...
@@ -15,6 +15,7 @@ use common\modules\messageTemplate\models\MessageTemplate;
* @property integer $case_id
* @property integer $case_id
* @property integer $template_id
* @property integer $template_id
* @property string $sended_date
* @property string $sended_date
* @property string $email
* @property integer $sended
* @property integer $sended
* @property integer $actual
* @property integer $actual
*
*
...
@@ -38,12 +39,13 @@ class CasesSchedule extends \yii\db\ActiveRecord
...
@@ -38,12 +39,13 @@ class CasesSchedule extends \yii\db\ActiveRecord
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'user_id'
,
'case_id'
],
'required'
],
[[
'case_id'
],
'required'
],
[[
'email'
],
'string'
],
[[
'user_id'
,
'case_id'
,
'template_id'
,
'sended'
,
'actual'
],
'integer'
],
[[
'user_id'
,
'case_id'
,
'template_id'
,
'sended'
,
'actual'
],
'integer'
],
[[
'sended_date'
],
'safe'
],
[[
'sended_date'
],
'safe'
],
[[
'template_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
MessageTemplate
::
className
(),
'targetAttribute'
=>
[
'template_id'
=>
'id'
]],
[[
'template_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
MessageTemplate
::
className
(),
'targetAttribute'
=>
[
'template_id'
=>
'id'
]],
[[
'case_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
CoContent
::
className
(),
'targetAttribute'
=>
[
'case_id'
=>
'id'
]],
[[
'case_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
CoContent
::
className
(),
'targetAttribute'
=>
[
'case_id'
=>
'id'
]],
[[
'user_id'
],
'exist'
,
'skipOnError'
=>
tru
e
,
'targetClass'
=>
User
::
className
(),
'targetAttribute'
=>
[
'user_id'
=>
'id'
]],
[[
'user_id'
],
'exist'
,
'skipOnError'
=>
fals
e
,
'targetClass'
=>
User
::
className
(),
'targetAttribute'
=>
[
'user_id'
=>
'id'
]],
];
];
}
}
...
@@ -55,6 +57,7 @@ class CasesSchedule extends \yii\db\ActiveRecord
...
@@ -55,6 +57,7 @@ class CasesSchedule extends \yii\db\ActiveRecord
return
[
return
[
'id'
=>
'ID'
,
'id'
=>
'ID'
,
'user_id'
=>
'Пользователь'
,
'user_id'
=>
'Пользователь'
,
'email'
=>
'E-mail'
,
'case_id'
=>
'Кейс'
,
'case_id'
=>
'Кейс'
,
'template_id'
=>
'Шаблон'
,
'template_id'
=>
'Шаблон'
,
'sended_date'
=>
'Дата отправки'
,
'sended_date'
=>
'Дата отправки'
,
...
...
console/migrations/m160512_151201_update_the_cases_schedule_table.php
0 → 100644
View file @
404700e6
<?php
use
yii\db\Migration
;
class
m160512_151201_update_the_cases_schedule_table
extends
Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public
function
safeUp
()
{
$this
->
dropForeignKey
(
'fk_cases_schedule_user'
,
'cases_schedule'
);
$this
->
alterColumn
(
'cases_schedule'
,
'user_id'
,
$this
->
integer
(
11
)
->
defaultValue
(
null
)
);
$this
->
addForeignKey
(
'fk_cases_schedule_user'
,
'cases_schedule'
,
'user_id'
,
'users'
,
'id'
);
$this
->
addColumn
(
'cases_schedule'
,
'email'
,
'varchar(255) NOT NULL'
);
}
public
function
safeDown
()
{
$this
->
dropForeignKey
(
'fk_cases_schedule_user'
,
'cases_schedule'
);
$this
->
alterColumn
(
'cases_schedule'
,
'user_id'
,
$this
->
integer
(
11
)
->
notNull
()
);
$this
->
addForeignKey
(
'fk_cases_schedule_user'
,
'cases_schedule'
,
'user_id'
,
'users'
,
'id'
);
$this
->
dropColumn
(
'cases_schedule'
,
'email'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment