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
4845311e
Commit
4845311e
authored
Mar 02, 2016
by
Виталий Мурашко
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.task-on.com/ktask/task-on.com
Conflicts: common/modules/users/models/User.php
parents
17f6666c
3f58b15f
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
296 additions
and
55 deletions
+296
-55
common/components/UnisenderAPI.php
common/components/UnisenderAPI.php
+31
-25
common/modules/bids/models/SearchBid.php
common/modules/bids/models/SearchBid.php
+5
-0
common/modules/bids/views/bid/mail-all.php
common/modules/bids/views/bid/mail-all.php
+9
-0
common/modules/blog/models/SearchSession.php
common/modules/blog/models/SearchSession.php
+13
-4
common/modules/blog/views/post/_load.php
common/modules/blog/views/post/_load.php
+6
-4
common/modules/blog/views/post/view.php
common/modules/blog/views/post/view.php
+6
-4
common/modules/sessions/models/Session.php
common/modules/sessions/models/Session.php
+8
-0
common/modules/testings/models/Passing.php
common/modules/testings/models/Passing.php
+48
-0
common/modules/triggers/components/conditions/conditions/CheckEmailToReading.php
.../components/conditions/conditions/CheckEmailToReading.php
+2
-2
common/modules/triggers/components/conditions/conditions/CheckUserToRegistration.php
...ponents/conditions/conditions/CheckUserToRegistration.php
+4
-4
common/modules/triggers/components/conditions/conditions/UserSuccessfullyCompletedTheTest.php
...onditions/conditions/UserSuccessfullyCompletedTheTest.php
+34
-0
common/modules/triggers/components/conditions/conditions/UserUnsuccessfullyCompletedTheTest.php
...ditions/conditions/UserUnsuccessfullyCompletedTheTest.php
+34
-0
common/modules/triggers/components/conditions/config/main.php
...on/modules/triggers/components/conditions/config/main.php
+6
-0
common/modules/users/models/User.php
common/modules/users/models/User.php
+18
-10
frontend/views/layouts/footer-index.php
frontend/views/layouts/footer-index.php
+4
-0
frontend/views/layouts/footer-testing.php
frontend/views/layouts/footer-testing.php
+5
-1
frontend/views/layouts/footer.php
frontend/views/layouts/footer.php
+4
-0
frontend/web/css/custom.css
frontend/web/css/custom.css
+44
-1
frontend/web/images/up-button.png
frontend/web/images/up-button.png
+0
-0
frontend/web/js/custom.js
frontend/web/js/custom.js
+15
-0
No files found.
common/components/UnisenderAPI.php
View file @
4845311e
...
@@ -101,17 +101,23 @@ class UnisenderAPI {
...
@@ -101,17 +101,23 @@ class UnisenderAPI {
}
}
/**
/**
* @param $campaign_id
* @param $message_id
* @param $message_id
* @return array
* @param $email
* @return array|mixed
*/
*/
public
function
getMessageStatuses
(
$
message_id
){
public
function
getMessageStatuses
(
$
campaign_id
,
$message_id
,
$email
){
$
this
->
statuses
=
$this
->
callMethod
(
$
result
=
$this
->
callMethod
(
'
checkEmail
'
,
'
getCampaignDeliveryStats
'
,
[
[
'
email_id'
=>
$message
_id
'
campaign_id'
=>
$campaign
_id
]
]
);
);
$this
->
statuses
=
Json
::
decode
(
$this
->
statuses
);
if
(
array_key_exists
(
'result'
,
$result
)
&&
array_key_exists
(
'letter_id'
,
$result
[
'result'
])
&&
$result
[
'result'
][
'letter_id'
]
==
$message_id
)
{
foreach
(
$result
[
'result'
][
'data'
]
as
$data
)
{
$this
->
statuses
[]
=
$data
[
1
];
}
}
return
$this
->
statuses
;
return
$this
->
statuses
;
}
}
...
@@ -119,8 +125,8 @@ class UnisenderAPI {
...
@@ -119,8 +125,8 @@ class UnisenderAPI {
* @return bool
* @return bool
*/
*/
public
function
isLinkVisited
(){
public
function
isLinkVisited
(){
if
(
array_key_exists
(
'result'
,
$this
->
statuses
)
&&
array_key_exists
(
'status'
,
$this
->
statuses
[
'result'
])
)
{
foreach
(
$this
->
statuses
as
$status
)
{
if
(
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_LINK_VISITED
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_SPAM_FOLDER
)
if
(
$status
==
ConditionBase
::
MESSAGE_LINK_VISITED
||
$status
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
||
$status
==
ConditionBase
::
MESSAGE_SPAM_FOLDER
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -130,8 +136,8 @@ class UnisenderAPI {
...
@@ -130,8 +136,8 @@ class UnisenderAPI {
* @return bool
* @return bool
*/
*/
public
function
isUnsubscribed
(){
public
function
isUnsubscribed
(){
if
(
array_key_exists
(
'result'
,
$this
->
statuses
)
&&
array_key_exists
(
'status'
,
$this
->
statuses
[
'result'
])
)
{
foreach
(
$this
->
statuses
as
$status
)
{
if
(
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
)
if
(
$status
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -141,8 +147,8 @@ class UnisenderAPI {
...
@@ -141,8 +147,8 @@ class UnisenderAPI {
* @return bool
* @return bool
*/
*/
public
function
isReaded
(){
public
function
isReaded
(){
if
(
array_key_exists
(
'result'
,
$this
->
statuses
)
&&
array_key_exists
(
'status'
,
$this
->
statuses
[
'result'
])
)
{
foreach
(
$this
->
statuses
as
$status
)
{
if
(
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_READ
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_SPAM_FOLDER
)
if
(
$status
==
ConditionBase
::
MESSAGE_READ
||
$status
==
ConditionBase
::
MESSAGE_SPAM_FOLDER
||
$status
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -152,8 +158,8 @@ class UnisenderAPI {
...
@@ -152,8 +158,8 @@ class UnisenderAPI {
* @return bool
* @return bool
*/
*/
public
function
isDelivered
(){
public
function
isDelivered
(){
if
(
array_key_exists
(
'result'
,
$this
->
statuses
)
&&
array_key_exists
(
'status'
,
$this
->
statuses
[
'result'
])
)
{
foreach
(
$this
->
statuses
as
$status
)
{
if
(
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_DELIVERED
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_LINK_VISITED
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_READ
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
||
$this
->
statuses
[
'result'
][
'status'
]
==
ConditionBase
::
MESSAGE_SPAM_FOLDER
)
if
(
$status
==
ConditionBase
::
MESSAGE_DELIVERED
||
$status
==
ConditionBase
::
MESSAGE_SPAM_FOLDER
||
$status
==
ConditionBase
::
MESSAGE_LINK_VISITED
||
$status
==
ConditionBase
::
MESSAGE_UNSUBSCRIBED
||
$status
==
ConditionBase
::
MESSAGE_READ
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
common/modules/bids/models/SearchBid.php
View file @
4845311e
...
@@ -47,6 +47,11 @@ class SearchBid extends Bid
...
@@ -47,6 +47,11 @@ class SearchBid extends Bid
$dataProvider
=
new
ActiveDataProvider
([
$dataProvider
=
new
ActiveDataProvider
([
'query'
=>
$query
,
'query'
=>
$query
,
'sort'
=>
[
'defaultOrder'
=>
[
'created_at'
=>
SORT_DESC
]
]
]);
]);
$this
->
load
(
$params
);
$this
->
load
(
$params
);
...
...
common/modules/bids/views/bid/mail-all.php
View file @
4845311e
<?php
<?php
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\helpers\Url
;
use
common\modules\bids\models\BidFile
;
use
common\modules\bids\models\BidFile
;
?>
?>
...
@@ -27,6 +28,10 @@ Email: <?=$model->email?><br>
...
@@ -27,6 +28,10 @@ Email: <?=$model->email?><br>
<?php
if
(
$session
)
:
?>
<?php
if
(
$session
)
:
?>
<?php
$last
=
$session
->
lastUrl
;
?>
Запрос отправлен со страницы:
<a
href=
"
<?=
Url
::
to
([
$last
->
url
],
true
)
?>
"
>
<?=
Url
::
to
([
$last
->
url
],
true
)
?>
</a>
<hr>
<hr>
<?php
if
(
$session
->
utmUrls
)
:
?>
<?php
if
(
$session
->
utmUrls
)
:
?>
...
@@ -46,6 +51,10 @@ Email: <?=$model->email?><br>
...
@@ -46,6 +51,10 @@ Email: <?=$model->email?><br>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
<?php
else
:
?>
<h3>
Данных UTM нет
</h3>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
endif
;
?>
\ No newline at end of file
common/modules/blog/models/SearchSession.php
View file @
4845311e
...
@@ -51,6 +51,11 @@ class SearchSession extends Session
...
@@ -51,6 +51,11 @@ class SearchSession extends Session
$dataProvider
=
new
ActiveDataProvider
([
$dataProvider
=
new
ActiveDataProvider
([
'query'
=>
$query
,
'query'
=>
$query
,
'sort'
=>
[
'defaultOrder'
=>
[
'created_at'
=>
SORT_DESC
]
]
]);
]);
$this
->
load
(
$params
);
$this
->
load
(
$params
);
...
@@ -61,16 +66,20 @@ class SearchSession extends Session
...
@@ -61,16 +66,20 @@ class SearchSession extends Session
return
$dataProvider
;
return
$dataProvider
;
}
}
$query
->
joinWith
(
'urls'
);
$query
->
select
([
'*'
,
'urls.time'
]
);
$query
->
select
([
'*'
,
new
\yii\db\Expression
(
"SUM("
.
SessionUrl
::
tableName
()
.
".updated_at - "
.
SessionUrl
::
tableName
()
.
".created_at) as time"
)]);
$queryUrl
=
SessionUrl
::
find
()
->
select
(
'session_id, url, SUM('
.
SessionUrl
::
tableName
()
.
'.updated_at - '
.
SessionUrl
::
tableName
()
.
'.created_at) as time'
)
->
andWhere
([
'url'
=>
$this
->
blogUrl
])
->
groupBy
(
'session_id'
);
$query
->
leftJoin
([
'urls'
=>
$queryUrl
],
'urls.session_id = id'
);
// grid filtering conditions
// grid filtering conditions
$query
->
andFilterWhere
([
$query
->
andFilterWhere
([
'id'
=>
$this
->
id
,
'id'
=>
$this
->
id
,
'user_id'
=>
$this
->
user_id
,
'user_id'
=>
$this
->
user_id
,
'created_at'
=>
$this
->
created_at
,
'created_at'
=>
$this
->
created_at
SessionUrl
::
tableName
()
.
'.url'
=>
$this
->
blogUrl
]);
]);
$query
->
andFilterWhere
([
'like'
,
'PHPSESSID'
,
$this
->
PHPSESSID
])
$query
->
andFilterWhere
([
'like'
,
'PHPSESSID'
,
$this
->
PHPSESSID
])
...
...
common/modules/blog/views/post/_load.php
View file @
4845311e
...
@@ -23,16 +23,18 @@ use yii\helpers\Url;
...
@@ -23,16 +23,18 @@ use yii\helpers\Url;
<?php
foreach
(
$model
->
postTags
as
$tag
)
:
?>
<?php
foreach
(
$model
->
postTags
as
$tag
)
:
?>
<a
href=
"
<?=
$tag
->
url
;
?>
"
>
#
<?=
$tag
->
name
?>
</a>
<a
href=
"
<?=
$tag
->
url
;
?>
"
>
#
<?=
$tag
->
name
?>
</a>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
</div>
</div>
<div
class=
"article_short_txt"
>
<div
class=
"article_short_txt"
>
<div
class=
"preview-image"
>
<?php
if
(
$model
->
preview
)
:
<?php
if
(
$model
->
preview
)
:
echo
Html
::
img
(
$model
->
preview
);
echo
Html
::
img
(
$model
->
preview
);
endif
;
?>
endif
;
?>
</div>
<?=
$model
->
lang
->
cutText
(
650
)
?>
<?=
$model
->
lang
->
cutText
(
650
)
?>
</div>
</div>
...
...
common/modules/blog/views/post/view.php
View file @
4845311e
...
@@ -30,16 +30,18 @@ use yii\helpers\Url;
...
@@ -30,16 +30,18 @@ use yii\helpers\Url;
<?php
foreach
(
$model
->
postTags
as
$tag
)
:
?>
<?php
foreach
(
$model
->
postTags
as
$tag
)
:
?>
<a
href=
"
<?=
$tag
->
url
;
?>
"
>
#
<?=
$tag
->
name
?>
</a>
<a
href=
"
<?=
$tag
->
url
;
?>
"
>
#
<?=
$tag
->
name
?>
</a>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
</div>
</div>
<div
class=
"article_short_txt"
>
<div
class=
"article_short_txt"
>
<div
class=
"preview-image"
>
<?php
if
(
$model
->
preview
)
:
<?php
if
(
$model
->
preview
)
:
echo
Html
::
img
(
$model
->
preview
);
echo
Html
::
img
(
$model
->
preview
);
endif
;
?>
endif
;
?>
</div>
<?=
$model
->
lang
->
text
?>
<?=
$model
->
lang
->
text
?>
</div>
</div>
...
...
common/modules/sessions/models/Session.php
View file @
4845311e
...
@@ -100,4 +100,12 @@ class Session extends \common\components\ActiveRecordModel
...
@@ -100,4 +100,12 @@ class Session extends \common\components\ActiveRecordModel
{
{
return
$this
->
hasMany
(
SessionUrl
::
className
(),
[
'session_id'
=>
'id'
])
->
where
([
'utm'
=>
1
]);
return
$this
->
hasMany
(
SessionUrl
::
className
(),
[
'session_id'
=>
'id'
])
->
where
([
'utm'
=>
1
]);
}
}
/**
* @return \yii\db\ActiveQuery
*/
public
function
getLastUrl
()
{
return
$this
->
hasOne
(
SessionUrl
::
className
(),
[
'session_id'
=>
'id'
])
->
orderBy
([
'created_at'
=>
SORT_DESC
]);
}
}
}
common/modules/testings/models/Passing.php
View file @
4845311e
...
@@ -2,12 +2,22 @@
...
@@ -2,12 +2,22 @@
namespace
common\modules\testings\models
;
namespace
common\modules\testings\models
;
use
common\modules\triggers\components\conditions\conditions\UserSuccessfullyCompletedTheTest
;
use
common\modules\triggers\components\conditions\conditions\UserUnsuccessfullyCompletedTheTest
;
use
common\modules\triggers\models\TriggerCondition
;
use
common\modules\triggers\models\TriggerTrigger
;
use
Yii
;
use
Yii
;
use
yii\behaviors\TimestampBehavior
;
use
yii\behaviors\TimestampBehavior
;
use
yii\db\Expression
;
use
yii\db\Expression
;
use
common\modules\users\models\User
;
use
common\modules\users\models\User
;
/**
* Class Passing
* @package common\modules\testings\models
*
* @property integer $passed
*/
class
Passing
extends
\common\components\ActiveRecordModel
class
Passing
extends
\common\components\ActiveRecordModel
{
{
const
PAGE_SIZE
=
10
;
const
PAGE_SIZE
=
10
;
...
@@ -210,4 +220,42 @@ class Passing extends \common\components\ActiveRecordModel
...
@@ -210,4 +220,42 @@ class Passing extends \common\components\ActiveRecordModel
return
true
;
return
true
;
}
}
public
function
afterSave
(
$insert
,
$changedAttributes
)
{
parent
::
afterSave
(
$insert
,
$changedAttributes
);
$this
->
initTriggerByTestFinish
([
'email'
=>
Yii
::
$app
->
user
->
identity
->
email
]);
}
/**
* @param array $params
* @return bool
*/
public
function
initTriggerByTestFinish
(
$params
=
array
())
{
/** @var TriggerTrigger[] $actualTriggers */
$actualTriggers
=
TriggerTrigger
::
getActualTriggers
();
foreach
(
$actualTriggers
as
$trigger
)
{
$exists
=
TriggerCondition
::
find
()
->
where
([
'trigger_id'
=>
$trigger
->
id
,
'condition_id'
=>
((
$this
->
passed
==
1
)
?
UserSuccessfullyCompletedTheTest
::
CONDITION_ID
:
UserUnsuccessfullyCompletedTheTest
::
CONDITION_ID
)])
->
exists
();
$count
=
TriggerCondition
::
find
()
->
where
([
'trigger_id'
=>
$trigger
->
id
])
->
count
();
// Добавляем в расписание срабатывание триггера завершения теста только при условии что у оно триггера есть и оно там одно
if
(
$exists
===
true
&&
$count
==
1
)
{
$init
=
$trigger
->
initAction
(
$params
);
if
(
$init
===
true
)
{
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
Yii
::
$app
->
urlManager
->
createAbsoluteUrl
(
'/triggers/default/rechecktriggers'
));
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
true
);
if
(
!
curl_exec
(
$curl
))
{
$this
->
addError
(
'passed'
,
curl_error
(
$curl
));
return
false
;
}
return
true
;
}
else
{
$this
->
addError
(
'passed'
,
$init
);
return
false
;
}
}
}
return
true
;
}
}
}
common/modules/triggers/components/conditions/conditions/CheckEmailToReading.php
View file @
4845311e
...
@@ -21,7 +21,7 @@ class CheckEmailToReading extends ConditionBase implements ConditionInterface {
...
@@ -21,7 +21,7 @@ class CheckEmailToReading extends ConditionBase implements ConditionInterface {
}
}
/**
/**
* @param $message
* @param
\common\modules\triggers\models\TriggerSchedule
$message
* @return bool
* @return bool
*/
*/
public
function
check
(
$message
){
public
function
check
(
$message
){
...
@@ -29,7 +29,7 @@ class CheckEmailToReading extends ConditionBase implements ConditionInterface {
...
@@ -29,7 +29,7 @@ class CheckEmailToReading extends ConditionBase implements ConditionInterface {
// Создаем объект унисендера
// Создаем объект унисендера
$sender
=
new
UnisenderAPI
();
$sender
=
new
UnisenderAPI
();
// Делаем запрос на получение статуса сообщения
// Делаем запрос на получение статуса сообщения
$sender
->
getMessageStatuses
(
$message
->
message_id
);
$sender
->
getMessageStatuses
(
$message
->
campaign_id
,
$message
->
message_id
,
$message
->
email
);
return
$sender
->
isReaded
();
return
$sender
->
isReaded
();
}
}
return
true
;
return
true
;
...
...
common/modules/triggers/components/conditions/conditions/CheckUserToRegistration.php
View file @
4845311e
...
@@ -5,13 +5,12 @@ namespace common\modules\triggers\components\conditions\conditions;
...
@@ -5,13 +5,12 @@ namespace common\modules\triggers\components\conditions\conditions;
use
common\components\UnisenderAPI
;
use
common\components\UnisenderAPI
;
use
common\modules\triggers\components\conditions\vendor\ConditionBase
;
use
common\modules\triggers\components\conditions\vendor\ConditionBase
;
use
common\modules\triggers\components\conditions\vendor\ConditionInterface
;
use
common\modules\triggers\components\conditions\vendor\ConditionInterface
;
use
common\modules\users\models\User
;
class
CheckUserToRegistration
extends
ConditionBase
implements
ConditionInterface
{
class
CheckUserToRegistration
extends
ConditionBase
implements
ConditionInterface
{
const
CONDITION_ID
=
6
;
const
CONDITION_ID
=
6
;
public
$recall
=
false
;
public
$name
=
'Пользователь зарегистрировался'
;
public
$name
=
'Пользователь зарегистрировался (Игнорируется оператором "И")'
;
/**
/**
* @param null|string $conditionName
* @param null|string $conditionName
...
@@ -26,6 +25,7 @@ class CheckUserToRegistration extends ConditionBase implements ConditionInterfac
...
@@ -26,6 +25,7 @@ class CheckUserToRegistration extends ConditionBase implements ConditionInterfac
* @return bool
* @return bool
*/
*/
public
function
check
(
$message
){
public
function
check
(
$message
){
return
true
;
$exists
=
User
::
find
()
->
where
([
'email'
=>
$message
->
email
])
->
exists
();
return
$exists
;
}
}
}
}
\ No newline at end of file
common/modules/triggers/components/conditions/conditions/UserSuccessfullyCompletedTheTest.php
0 → 100644
View file @
4845311e
<?php
/**
* Created by PhpStorm.
* User: shakarim
* Date: 3/2/16
* Time: 11:36 PM
*/
namespace
common\modules\triggers\components\conditions\conditions
;
use
common\modules\triggers\components\conditions\vendor\ConditionBase
;
use
common\modules\triggers\components\conditions\vendor\ConditionInterface
;
class
UserSuccessfullyCompletedTheTest
extends
ConditionBase
implements
ConditionInterface
{
const
CONDITION_ID
=
7
;
public
$name
=
'Пользователь успешно сдал тест (игнорируется оператором И)'
;
/**
* @param null|string $conditionName
* @return $this mixed
*/
public
static
function
init
(
$conditionName
=
__CLASS__
){
return
parent
::
init
(
$conditionName
);
}
/**
* @param $message
* @return bool
*/
public
function
check
(
$message
){
return
false
;
}
}
\ No newline at end of file
common/modules/triggers/components/conditions/conditions/UserUnsuccessfullyCompletedTheTest.php
0 → 100644
View file @
4845311e
<?php
/**
* Created by PhpStorm.
* User: shakarim
* Date: 3/2/16
* Time: 11:36 PM
*/
namespace
common\modules\triggers\components\conditions\conditions
;
use
common\modules\triggers\components\conditions\vendor\ConditionBase
;
use
common\modules\triggers\components\conditions\vendor\ConditionInterface
;
class
UserUnsuccessfullyCompletedTheTest
extends
ConditionBase
implements
ConditionInterface
{
const
CONDITION_ID
=
8
;
public
$name
=
'Пользователь не сдал тест (игнорируется оператором И)'
;
/**
* @param null|string $conditionName
* @return $this mixed
*/
public
static
function
init
(
$conditionName
=
__CLASS__
){
return
parent
::
init
(
$conditionName
);
}
/**
* @param $message
* @return bool
*/
public
function
check
(
$message
){
return
false
;
}
}
\ No newline at end of file
common/modules/triggers/components/conditions/config/main.php
View file @
4845311e
...
@@ -12,6 +12,12 @@ return [
...
@@ -12,6 +12,12 @@ return [
'check-user-to-registration'
=>
[
'check-user-to-registration'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckUserToRegistration'
,
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckUserToRegistration'
,
],
],
'user-successfully-completed-the-test'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\UserSuccessfullyCompletedTheTest'
,
],
'user-unsuccessfully-completed-the-test'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\UserUnsuccessfullyCompletedTheTest'
,
],
'check-clicking-on-the-link'
=>
[
'check-clicking-on-the-link'
=>
[
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckClickingOnTheLink'
,
'class'
=>
'common\modules\triggers\components\conditions\conditions\CheckClickingOnTheLink'
,
'params'
=>
[
'params'
=>
[
...
...
common/modules/users/models/User.php
View file @
4845311e
...
@@ -130,7 +130,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -130,7 +130,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
/*
[['email'], 'required', 'on' => [
[[
'email'
],
'required'
,
'on'
=>
[
self
::
SCENARIO_ACTIVATE_REQUEST
,
self
::
SCENARIO_ACTIVATE_REQUEST
,
self
::
SCENARIO_CHANGE_PASSWORD_REQUEST
,
self
::
SCENARIO_CHANGE_PASSWORD_REQUEST
,
self
::
SCENARIO_CREATE
,
self
::
SCENARIO_CREATE
,
...
@@ -140,7 +140,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -140,7 +140,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
self
::
SCENARIO_UPDATE
,
self
::
SCENARIO_UPDATE
,
self
::
SCENARIO_SEND_NEW_PASSWORD
,
self
::
SCENARIO_SEND_NEW_PASSWORD
,
self
::
SCENARIO_RECOVER_PASSWORD
self
::
SCENARIO_RECOVER_PASSWORD
], 'message' => 'Пожалуйста, укажите корректный e-mail адрес'],
*/
],
'message'
=>
'Пожалуйста, укажите корректный e-mail адрес'
],
[[
'send_email'
],
'safe'
],
[[
'send_email'
],
'safe'
],
[[
'fio'
,
'name'
,
'surname'
],
'safe'
,
'on'
=>
[
[[
'fio'
,
'name'
,
'surname'
],
'safe'
,
'on'
=>
[
self
::
SCENARIO_CREATE
,
self
::
SCENARIO_CREATE
,
...
@@ -184,11 +184,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -184,11 +184,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
self::SCENARIO_SEND_NEW_PASSWORD,
self::SCENARIO_SEND_NEW_PASSWORD,
self::SCENARIO_LOGIN,
self::SCENARIO_LOGIN,
]],*/
]],*/
/*
[['email'], 'unique','on' => [
[[
'email'
],
'unique'
,
'on'
=>
[
self
::
SCENARIO_REGISTRATION
,
self
::
SCENARIO_REGISTRATION
,
self
::
SCENARIO_CREATE
,
self
::
SCENARIO_CREATE
,
]
, 'message' => 'Данный email уже есть'],*/
]
],
//
[['email'], '\common\components\validators\RuEmailValidator'],
[[
'email'
],
'\common\components\validators\RuEmailValidator'
],
[[
'password_c'
],
'compare'
,
'compareAttribute'
=>
'password'
,
'on'
=>
[
[[
'password_c'
],
'compare'
,
'compareAttribute'
=>
'password'
,
'on'
=>
[
self
::
SCENARIO_REGISTRATION
,
self
::
SCENARIO_REGISTRATION
,
self
::
SCENARIO_CHANGE_PASSWORD
,
self
::
SCENARIO_CHANGE_PASSWORD
,
...
@@ -204,11 +204,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -204,11 +204,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
[[
'is_deleted'
],
'integer'
,
'integerOnly'
=>
true
],
[[
'is_deleted'
],
'integer'
,
'integerOnly'
=>
true
],
//array('phone', 'integer'),
//array('phone', 'integer'),
[[
'fio'
],
'string'
,
'min'
=>
2
],
[[
'fio'
],
'string'
,
'min'
=>
2
],
//
[['email'], 'string','max' => 200],
[[
'email'
],
'string'
,
'max'
=>
200
],
[[
'source'
],
'string'
,
'max'
=>
50
],
[[
'source'
],
'string'
,
'max'
=>
50
],
[[
'status'
],
'\yii\validators\RangeValidator'
,
'range'
=>
[
'active'
,
'new'
,
'blocked'
],
'allowArray'
=>
true
],
[[
'status'
],
'\yii\validators\RangeValidator'
,
'range'
=>
[
'active'
,
'new'
,
'blocked'
],
'allowArray'
=>
true
],
[[
'activate_code'
],
'safe'
],
[[
'activate_code'
],
'safe'
],
//
[['email'], 'filter','filter' => 'trim'],
[[
'email'
],
'filter'
,
'filter'
=>
'trim'
],
[[
'csv_file'
],
'file'
,
'mimeTypes'
=>
'csv'
,
'on'
=>
[
[[
'csv_file'
],
'file'
,
'mimeTypes'
=>
'csv'
,
'on'
=>
[
self
::
SCENARIO_CSV_IMPORT
,
self
::
SCENARIO_CSV_IMPORT
,
]],
]],
...
@@ -518,13 +518,19 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -518,13 +518,19 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
public
function
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
)
{
public
function
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
)
{
if
(
!
parent
::
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
))
if
(
!
parent
::
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
))
return
false
;
return
false
;
/*if ($this->scenario===self::SCENARIO_REGISTRATION) {
if
(
$this
->
scenario
===
self
::
SCENARIO_REGISTRATION
||
$this
->
scenario
===
self
::
SCENARIO_SOCIAL_REGISTRATION
)
{
if
(
!
$this
->
afterRegistration
([
'email'
=>
$this
->
email
,
'user_fio'
=>
$this
->
getFio
()]))
if
(
!
$this
->
afterRegistration
([
'email'
=>
$this
->
email
,
'user_fio'
=>
$this
->
getFio
()]))
return
false
;
return
false
;
}
*/
}
return
true
;
return
true
;
}
}
public
function
afterDelete
()
{
TriggerSchedule
::
deleteAll
([
'email'
=>
$this
->
email
]);
}
public
function
getFio
()
public
function
getFio
()
{
{
$result
=
$this
->
name
;
$result
=
$this
->
name
;
...
@@ -577,7 +583,9 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -577,7 +583,9 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
$actualTriggers
=
TriggerTrigger
::
getActualTriggers
();
$actualTriggers
=
TriggerTrigger
::
getActualTriggers
();
foreach
(
$actualTriggers
as
$trigger
)
{
foreach
(
$actualTriggers
as
$trigger
)
{
$exists
=
TriggerCondition
::
find
()
->
where
([
'trigger_id'
=>
$trigger
->
id
,
'condition_id'
=>
CheckUserToRegistration
::
CONDITION_ID
])
->
exists
();
$exists
=
TriggerCondition
::
find
()
->
where
([
'trigger_id'
=>
$trigger
->
id
,
'condition_id'
=>
CheckUserToRegistration
::
CONDITION_ID
])
->
exists
();
if
(
$exists
===
true
)
{
$count
=
TriggerCondition
::
find
()
->
where
([
'trigger_id'
=>
$trigger
->
id
])
->
count
();
// Добавляем в расписание срабатывание триггера регистрации только при условии что у триггера условие регистрации есть и оно там одно
if
(
$exists
===
true
&&
$count
==
1
)
{
$init
=
$trigger
->
initAction
(
$params
);
$init
=
$trigger
->
initAction
(
$params
);
if
(
$init
===
true
)
{
if
(
$init
===
true
)
{
$curl
=
curl_init
();
$curl
=
curl_init
();
...
...
frontend/views/layouts/footer-index.php
View file @
4845311e
...
@@ -128,4 +128,8 @@ FileUploadBundle::register($this);
...
@@ -128,4 +128,8 @@ FileUploadBundle::register($this);
</div>
</div>
</footer>
</footer>
<div
class=
"up-button-container"
>
<div
class=
"up-button"
></div>
</div>
<?php
echo
$this
->
render
(
'block/callback'
);
?>
<?php
echo
$this
->
render
(
'block/callback'
);
?>
\ No newline at end of file
frontend/views/layouts/footer-testing.php
View file @
4845311e
...
@@ -15,3 +15,7 @@
...
@@ -15,3 +15,7 @@
</div>
</div>
</div>
</div>
</footer>
</footer>
<div
class=
"up-button-container"
>
<div
class=
"up-button"
></div>
</div>
\ No newline at end of file
frontend/views/layouts/footer.php
View file @
4845311e
...
@@ -31,4 +31,8 @@
...
@@ -31,4 +31,8 @@
</div>
</div>
</footer>
</footer>
<div
class=
"up-button-container"
>
<div
class=
"up-button"
></div>
</div>
<?php
echo
$this
->
render
(
'block/callback'
);
?>
<?php
echo
$this
->
render
(
'block/callback'
);
?>
\ No newline at end of file
frontend/web/css/custom.css
View file @
4845311e
...
@@ -264,9 +264,37 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
...
@@ -264,9 +264,37 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.subsc_blog
{
.subsc_blog
{
margin-top
:
50px
;
margin-top
:
50px
;
}
}
.language-markup
{
pre
code
{
font-size
:
14px
;
font-size
:
14px
;
}
}
.article_short_txt
ol
li
{
line-height
:
30px
;
}
.preview-image
{
text-align
:
center
;
}
.up-button
{
background
:
url(../images/up-button.png)
no-repeat
left
top
;
width
:
56px
;
height
:
72px
;
position
:
absolute
;
left
:
-80px
;
top
:
0
;
cursor
:
pointer
;
display
:
none
;
}
.up-button
:hover
{
background-position
:
right
top
;
}
.up-button-container
{
position
:
fixed
;
width
:
970px
;
height
:
0px
;
bottom
:
150px
;
left
:
50%
;
margin-left
:
-485px
;
z-index
:
2
;
}
/* ------------ BLOG MODAL ------------------ */
/* ------------ BLOG MODAL ------------------ */
...
@@ -467,6 +495,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
...
@@ -467,6 +495,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.gen_mail_top
a
.toggle_bottom
{
.gen_mail_top
a
.toggle_bottom
{
margin-top
:
50px
;
margin-top
:
50px
;
}
}
.article_short_txt
iframe
{
width
:
100%
;
}
}
}
@media
(
max-width
:
768px
)
{
@media
(
max-width
:
768px
)
{
...
@@ -514,6 +545,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
...
@@ -514,6 +545,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.subsc_form
input
,
.subsc_blog_form
input
{
.subsc_form
input
,
.subsc_blog_form
input
{
width
:
100%
;
width
:
100%
;
}
}
pre
code
{
font-size
:
12px
;
}
}
}
@media
only
screen
and
(
max-width
:
479px
)
and
(
min-width
:
320px
)
{
@media
only
screen
and
(
max-width
:
479px
)
and
(
min-width
:
320px
)
{
...
@@ -527,3 +561,12 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
...
@@ -527,3 +561,12 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
display
:
none
;
display
:
none
;
}
}
}
}
@media
only
screen
and
(
max-width
:
479px
)
{
.article_short_view
{
display
:
none
;
}
.article_short_tags
{
margin-top
:
0
;
}
}
\ No newline at end of file
frontend/web/images/up-button.png
0 → 100644
View file @
4845311e
6.03 KB
frontend/web/js/custom.js
View file @
4845311e
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
window
).
scroll
(
function
(){
if
(
$
(
window
).
scrollTop
()
>
700
)
{
$
(
'
.up-button
'
).
show
();
}
else
{
$
(
'
.up-button
'
).
hide
();
}
});
$
(
'
.up-button
'
).
click
(
function
(){
$
(
"
html, body
"
).
animate
({
scrollTop
:
0
},
"
slow
"
);
});
$
(
"
a.toggle_bottom
"
).
click
(
function
()
{
$
(
"
a.toggle_bottom
"
).
click
(
function
()
{
var
a
=
$
(
this
);
var
a
=
$
(
this
);
$
(
"
html, body
"
).
animate
({
scrollTop
:
$
(
a
.
attr
(
'
href
'
)).
position
().
top
-
50
},
"
slow
"
);
$
(
"
html, body
"
).
animate
({
scrollTop
:
$
(
a
.
attr
(
'
href
'
)).
position
().
top
-
50
},
"
slow
"
);
...
...
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