Commit 3645a14a authored by Олег Гиммельшпах's avatar Олег Гиммельшпах

Merge branch 'master' of git.task-on.com:ktask/task-on.com

parents 861cb092 6e2149a9
<?php <?php
namespace common\components; namespace common\components;
use common\modules\triggers\components\conditions\conditions\CheckPresenceTime;
use Yii; use Yii;
use yii\filters\AccessControl; use yii\filters\AccessControl;
use yii\web\Controller; use yii\web\Controller;
...@@ -61,6 +62,8 @@ abstract class BaseController extends Controller ...@@ -61,6 +62,8 @@ abstract class BaseController extends Controller
public function beforeAction($action) public function beforeAction($action)
{ {
CheckPresenceTime::init()->initScript();
/*if(substr($currentUrl, -1) == '/' && $currentUrl!="/") { /*if(substr($currentUrl, -1) == '/' && $currentUrl!="/") {
$urlWithoutSlash = substr($currentUrl, 0, -1); $urlWithoutSlash = substr($currentUrl, 0, -1);
return $this->redirect($urlWithoutSlash,true,301); return $this->redirect($urlWithoutSlash,true,301);
......
...@@ -193,10 +193,13 @@ class TriggerTrigger extends \common\components\ActiveRecordModel ...@@ -193,10 +193,13 @@ class TriggerTrigger extends \common\components\ActiveRecordModel
/** /**
* Метод возвращает массив актуальных на данный момент триггеров * Метод возвращает массив актуальных на данный момент триггеров
* @param $id
* @return array|\yii\db\ActiveRecord[] * @return array|\yii\db\ActiveRecord[]
*/ */
public static function getActualTriggers() { public static function getActualTriggers($id=null) {
return TriggerTrigger::find()->indexBy('id')->all(); return ($id===null)
? TriggerTrigger::find()->indexBy('id')->all()
: TriggerTrigger::find()->joinWith('triggerConditions')->where(['trigger_condition.condition_id' => $id])->all();
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment