Commit 8a304c6f authored by Виталий Мурашко's avatar Виталий Мурашко

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

parents 4779d796 0e149db4
...@@ -195,7 +195,7 @@ JS; ...@@ -195,7 +195,7 @@ JS;
case 'email': case 'email':
$tmp = $this->field($this->model, $key, $optEl)->input($element['type'], $opt); $tmp = $this->field($this->model, $key, $optEl)->input($element['type'], $opt);
if(!empty($element['hint'])) $tmp = $tmp->hint($element['hint']); if(!empty($element['hint'])) $tmp = $tmp->hint($element['hint']);
if($element['options']['label'] === false) $tmp = $tmp->label(false); if(array_key_exists('options', $element) && $element['options']['label'] === false) $tmp = $tmp->label(false);
$config['options'][] = $tmp; $config['options'][] = $tmp;
break; break;
case 'password': case 'password':
...@@ -216,7 +216,7 @@ JS; ...@@ -216,7 +216,7 @@ JS;
//$optEl['template'] = '{label}<div class="col-md-8">{input}</div>{error}{hint}'; //$optEl['template'] = '{label}<div class="col-md-8">{input}</div>{error}{hint}';
$tmp = $this->field($this->model, $key, $optEl)->dropDownList($element['items'],$opt); $tmp = $this->field($this->model, $key, $optEl)->dropDownList($element['items'],$opt);
if(!empty($element['hint'])) $tmp = $tmp->hint($element['hint']); if(!empty($element['hint'])) $tmp = $tmp->hint($element['hint']);
if($element['options']['label'] === false) $tmp = $tmp->label(false); if(array_key_exists('options', $element) && $element['options']['label'] === false) $tmp = $tmp->label(false);
$config['options'][] = $tmp; $config['options'][] = $tmp;
break; break;
case 'listBox': case 'listBox':
......
<?php <?php
namespace common\components;
/** /**
* API UniSender * API UniSender
* *
...@@ -76,7 +76,7 @@ class UnisenderAPI { ...@@ -76,7 +76,7 @@ class UnisenderAPI {
public function createList($title=null){ public function createList($title=null){
if ($title===null) { if ($title===null) {
$date = new DateTime; $date = new \DateTime;
$title = $date->format('YmdHis').(rand(100000, 999999)); $title = $date->format('YmdHis').(rand(100000, 999999));
} }
return $this->callMethod( return $this->callMethod(
...@@ -87,6 +87,15 @@ class UnisenderAPI { ...@@ -87,6 +87,15 @@ class UnisenderAPI {
); );
} }
public function getVisitedLinks($campaign_id){
return $this->callMethod(
'getVisitedLinks',
[
'campaign_id' => $campaign_id
]
);
}
public function createCampaign($message_id){ public function createCampaign($message_id){
return $this->callMethod( return $this->callMethod(
'createCampaign', 'createCampaign',
......
...@@ -36,7 +36,7 @@ class Settings extends \common\components\ActiveRecordModel ...@@ -36,7 +36,7 @@ class Settings extends \common\components\ActiveRecordModel
public function rules() public function rules()
{ {
return [ return [
[['module_id', 'code', 'name', 'value', 'element', 'description'], 'required'], [['module_id', 'code', 'name', /*'value',*/ 'element', /*'description'*/], 'required'],
[['value', 'element'], 'string'], [['value', 'element'], 'string'],
[['hidden'], 'integer'], [['hidden'], 'integer'],
[['module_id', 'code'], 'string', 'max' => 50], [['module_id', 'code'], 'string', 'max' => 50],
......
...@@ -19,7 +19,6 @@ class BidAdminController extends AdminController ...@@ -19,7 +19,6 @@ class BidAdminController extends AdminController
'Manage' => 'Управление заявками', 'Manage' => 'Управление заявками',
'Create' => 'Добавление заявки', 'Create' => 'Добавление заявки',
'Update' => 'Редактирование заявки', 'Update' => 'Редактирование заявки',
'Delete' => 'Удаление заявки',
'View' => 'Просмотр заявки', 'View' => 'Просмотр заявки',
]; ];
} }
...@@ -103,19 +102,6 @@ class BidAdminController extends AdminController ...@@ -103,19 +102,6 @@ class BidAdminController extends AdminController
} }
} }
/**
* Deletes an existing Bid model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/** /**
* Finds the Bid model based on its primary key value. * Finds the Bid model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown. * If the model is not found, a 404 HTTP exception will be thrown.
......
...@@ -19,11 +19,24 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -19,11 +19,24 @@ class Bid extends \common\components\ActiveRecordModel
{ {
const SCENARIO_PROJECT = 'project'; const SCENARIO_PROJECT = 'project';
const SCENARIO_CALLBACK = 'callback'; const SCENARIO_CALLBACK = 'callback';
const SCENARIO_SUBSCRIBE = 'subscribe';
const FORM_SUBSCRIBE = 'subscribe';
const FORM_CALLBACK = 'callback';
const FORM_PROJECT = 'project';
const FORM_MESSAGE = 'message';
const FILE_FOLDER = '/uploads/bids/'; const FILE_FOLDER = '/uploads/bids/';
public $file; public $file;
public static $form_titles = [
self::FORM_PROJECT => 'Расчитать проект',
self::FORM_CALLBACK => 'Обратный звонок',
self::FORM_SUBSCRIBE => 'Подписка',
self::FORM_MESSAGE => 'Сообщение с сайта',
];
/** /**
* @inheritdoc * @inheritdoc
*/ */
...@@ -47,16 +60,18 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -47,16 +60,18 @@ class Bid extends \common\components\ActiveRecordModel
{ {
return [ return [
[['name', 'phone', 'email'], 'required', 'on' => self::SCENARIO_PROJECT], [['name', 'phone', 'email'], 'required', 'on' => self::SCENARIO_PROJECT],
[['email'], 'email', 'on' => self::SCENARIO_PROJECT], [['email'], 'email'],
[['name', 'phone'], 'required', 'on' => self::SCENARIO_CALLBACK], [['name', 'phone'], 'required', 'on' => self::SCENARIO_CALLBACK],
[['email'], 'required', 'on' => self::SCENARIO_SUBSCRIBE],
[['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif, xls, xlsx, doc, docx, pdf'], [['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif, xls, xlsx, doc, docx, pdf'],
[['text'], 'string'], [['text'], 'string'],
[['name'], 'string', 'max' => 100], [['name'], 'string', 'max' => 100],
[['phone'], 'string', 'max' => 30], [['phone'], 'string', 'max' => 30],
[['email'], 'string', 'max' => 70], [['email'], 'string', 'max' => 70],
[['filename'], 'string', 'max' => 50], [['filename', 'form'], 'string', 'max' => 50],
]; ];
} }
...@@ -73,6 +88,7 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -73,6 +88,7 @@ class Bid extends \common\components\ActiveRecordModel
'filename' => 'Прикрепленный файл', 'filename' => 'Прикрепленный файл',
'file' => 'Прикрепленный файл', 'file' => 'Прикрепленный файл',
'text' => 'Сообщение', 'text' => 'Сообщение',
'form' => 'Форма отправки',
'created_at' => 'Дата добавления', 'created_at' => 'Дата добавления',
'updated_at' => 'Дата обновления', 'updated_at' => 'Дата обновления',
]; ];
...@@ -100,6 +116,8 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -100,6 +116,8 @@ class Bid extends \common\components\ActiveRecordModel
} }
public function send() public function send()
{
try
{ {
$email = Settings::getValue('bids-support-email'); $email = Settings::getValue('bids-support-email');
...@@ -115,6 +133,10 @@ class Bid extends \common\components\ActiveRecordModel ...@@ -115,6 +133,10 @@ class Bid extends \common\components\ActiveRecordModel
$subject = "Заявка с сайта TaskOn"; $subject = "Заявка с сайта TaskOn";
mail($email, $subject, $message, $headers); @mail($email, $subject, $message, $headers);
}
catch (Exception $e)
{
}
} }
} }
...@@ -19,7 +19,7 @@ class SearchBid extends Bid ...@@ -19,7 +19,7 @@ class SearchBid extends Bid
{ {
return [ return [
[['id'], 'integer'], [['id'], 'integer'],
[['name', 'phone', 'email', 'filename', 'text', 'created_at'], 'safe'], [['name', 'phone', 'email', 'filename', 'text', 'created_at', 'form'], 'safe'],
]; ];
} }
...@@ -60,6 +60,7 @@ class SearchBid extends Bid ...@@ -60,6 +60,7 @@ class SearchBid extends Bid
// grid filtering conditions // grid filtering conditions
$query->andFilterWhere([ $query->andFilterWhere([
'id' => $this->id, 'id' => $this->id,
'form' => $this->form,
'created_at' => ($this->created_at?strtotime($this->created_at):$this->created_at), 'created_at' => ($this->created_at?strtotime($this->created_at):$this->created_at),
]); ]);
......
...@@ -34,6 +34,14 @@ $this->params['breadcrumbs'][] = $this->title; ...@@ -34,6 +34,14 @@ $this->params['breadcrumbs'][] = $this->title;
} }
], ],
'text:ntext', 'text:ntext',
[
'attribute' => 'form',
'filter' => Bid::$form_titles,
'value' => function($model)
{
return ($model->form?Bid::$form_titles[$model->form]:null);
}
],
[ [
'attribute' => 'created_at', 'attribute' => 'created_at',
'format' => ['date', 'php:d.m.Y H:i:s'] 'format' => ['date', 'php:d.m.Y H:i:s']
......
...@@ -3,7 +3,12 @@ ...@@ -3,7 +3,12 @@
namespace common\modules\content\models; namespace common\modules\content\models;
use Yii; use Yii;
use yii\behaviors\TimestampBehavior;
use himiklab\sitemap\behaviors\SitemapBehavior;
use \yii\helpers\Url;
use common\modules\content\models\CoBlocks; use common\modules\content\models\CoBlocks;
use common\modules\content\models\CoContentLang;
use common\modules\languages\models\Languages; use common\modules\languages\models\Languages;
use common\models\MetaTags; use common\models\MetaTags;
...@@ -47,7 +52,29 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -47,7 +52,29 @@ class CoContent extends \common\components\ActiveRecordModel
], ],
'langs' => [ 'langs' => [
'class' => 'common\modules\content\components\CoContentLangBehavior', 'class' => 'common\modules\content\components\CoContentLangBehavior',
] ],
'timestamp' => [
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => time(),
],
'sitemap' => [
'class' => SitemapBehavior::className(),
'scope' => function ($model) {
/** @var \yii\db\ActiveQuery $model */
$model->select(['url', 'updated_at', 'priority']);
// $model->andWhere(['is_deleted' => 0]);
},
'dataClosure' => function ($model) {
return [
'loc' => Url::to($model->url, true),
'lastmod' => date('c', $model->updated_at),
'changefreq' => SitemapBehavior::CHANGEFREQ_DAILY,
'priority' => $model->priority
];
}
],
]; ];
} }
...@@ -68,7 +95,8 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -68,7 +95,8 @@ class CoContent extends \common\components\ActiveRecordModel
[['image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'], [['image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['url'], 'required'], [['url'], 'required'],
[['url'], 'string', 'max' => 250], [['url'], 'string', 'max' => 250],
[['category_id'], 'safe'] [['category_id', 'priority'], 'safe'],
[['priority'], 'double']
]; ];
} }
...@@ -83,6 +111,7 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -83,6 +111,7 @@ class CoContent extends \common\components\ActiveRecordModel
'url' => Yii::t('content', 'Url'), 'url' => Yii::t('content', 'Url'),
'name' => Yii::t('content', 'Name'), 'name' => Yii::t('content', 'Name'),
'image' => 'Превью', 'image' => 'Превью',
'priority' => 'Приоритет в Sitemap',
'title' => Yii::t('content', 'Title'), 'title' => Yii::t('content', 'Title'),
'text' => Yii::t('content', 'Content'), 'text' => Yii::t('content', 'Content'),
'active' => Yii::t('content', 'Active'), 'active' => Yii::t('content', 'Active'),
......
...@@ -70,6 +70,8 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all(); ...@@ -70,6 +70,8 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
'label' => ' ' 'label' => ' '
], false); ?> ], false); ?>
<?= $form->field($model, 'priority')->textInput(['maxlength' => 3])->hint('По умолчанию: 0.8') ?>
<?php if($model->preview) <?php if($model->preview)
{ {
echo Html::img(\Yii::$app->params['frontUrl'] . CoContent::PHOTO_FOLDER . $model->preview); echo Html::img(\Yii::$app->params['frontUrl'] . CoContent::PHOTO_FOLDER . $model->preview);
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
use yii\helpers\Html; use yii\helpers\Html;
use yii\helpers\Url; use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\grid\GridView; use yii\grid\GridView;
use common\modules\content\models\CoCategory;
/* @var $this yii\web\View */ /* @var $this yii\web\View */
/* @var $searchModel common\modules\content\models\SearchCoContent */ /* @var $searchModel common\modules\content\models\SearchCoContent */
...@@ -18,7 +20,7 @@ use yii\grid\GridView; ...@@ -18,7 +20,7 @@ use yii\grid\GridView;
<?= \common\components\zii\AdminGrid::widget([ <?= \common\components\zii\AdminGrid::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
//'filterModel' => $searchModel, 'filterModel' => $searchModel,
'columns' => [ 'columns' => [
// 'name', // 'name',
//'url:url', //'url:url',
...@@ -31,6 +33,7 @@ use yii\grid\GridView; ...@@ -31,6 +33,7 @@ use yii\grid\GridView;
], ],
[ [
'attribute' => 'category_id', 'attribute' => 'category_id',
'filter' => ArrayHelper::map(CoCategory::find()->all(), 'id', 'name'),
'format' => 'text', 'format' => 'text',
'value' => function($data) { 'value' => function($data) {
if(!empty($data->category)) if(!empty($data->category))
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
namespace common\modules\faq\models; namespace common\modules\faq\models;
use Yii; use Yii;
use \common\components\validators\TransliterateValidator;
use yii\behaviors\TimestampBehavior; use yii\behaviors\TimestampBehavior;
use \yii\helpers\StringHelper; use \yii\helpers\StringHelper;
use \common\models\MetaTags;
use yii\helpers\Url; use yii\helpers\Url;
use yii\db\Expression; use yii\db\Expression;
use himiklab\sitemap\behaviors\SitemapBehavior; use \common\models\MetaTags;
use \common\components\validators\TransliterateValidator;
/** /**
* This is the model class for table "faq". * This is the model class for table "faq".
* *
...@@ -44,23 +44,6 @@ class Faq extends \common\components\ActiveRecordModel ...@@ -44,23 +44,6 @@ class Faq extends \common\components\ActiveRecordModel
'meta' => [ 'meta' => [
'class' => 'common\components\activeRecordBehaviors\MetaTagBehavior', 'class' => 'common\components\activeRecordBehaviors\MetaTagBehavior',
], ],
'sitemap' => [
'class' => SitemapBehavior::className(),
'scope' => function ($model) {
/** @var \yii\db\ActiveQuery $model */
$model->select(['url', 'updated_at']);
// $model->andWhere(['is_deleted' => 0]);
},
'dataClosure' => function ($model) {
/** @var self $model */
return [
'loc' => Url::to($model->url, true),
'lastmod' => date('c', $model->updated_at),
'changefreq' => SitemapBehavior::CHANGEFREQ_DAILY,
'priority' => 0.8
];
}
],
'timestamp' => [ 'timestamp' => [
'class' => TimestampBehavior::className(), 'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at', 'createdAtAttribute' => 'created_at',
......
...@@ -21,7 +21,7 @@ class Conditions { ...@@ -21,7 +21,7 @@ class Conditions {
*/ */
public static function init(){ public static function init(){
// Переопределили переменную конфиг (чтобы в дальнейшем было проще обращатся) // Переопределили переменную конфиг (чтобы в дальнейшем было проще обращатся)
self::$config = require(__DIR__.'\config\main.php'); self::$config = require(__DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'main.php');
// Сначала производится проверка всех классов условий на наличие необходимых констант и переменных // Сначала производится проверка всех классов условий на наличие необходимых констант и переменных
self::createConditions(); self::createConditions();
// Если до этого момента скрипт не остановился и не вернул ошибку, значит возвращаем экземпляр класса // Если до этого момента скрипт не остановился и не вернул ошибку, значит возвращаем экземпляр класса
...@@ -38,7 +38,7 @@ class Conditions { ...@@ -38,7 +38,7 @@ class Conditions {
// Перебираем все условия что указаны в конфиге // Перебираем все условия что указаны в конфиге
foreach(self::$config as $condition) { foreach(self::$config as $condition) {
// Если путь к классу указан, и файл по этому пути существует // Если путь к классу указан, и файл по этому пути существует
if (isset($condition['class']) && file_exists(\Yii::getAlias('@mainRoot').DIRECTORY_SEPARATOR.$condition['class'].'.php')) { if (isset($condition['class']) && file_exists(\Yii::getAlias('@mainRoot').DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $condition['class']).'.php')) {
// Занесли класс в переменную // Занесли класс в переменную
$class = $condition['class']::init(); $class = $condition['class']::init();
// Проверяем наличие обязательных констант // Проверяем наличие обязательных констант
......
...@@ -30,7 +30,8 @@ class TriggerAdminController extends AdminController { ...@@ -30,7 +30,8 @@ class TriggerAdminController extends AdminController {
'Getconditionhtml' => 'Получаем html блок с условием', 'Getconditionhtml' => 'Получаем html блок с условием',
'Getandconditionhtml' => 'Получаем html новой строки с условиями', 'Getandconditionhtml' => 'Получаем html новой строки с условиями',
'Testing' => 'Testing page' 'Testing' => 'Testing page',
'Getresult' => 'Testing page',
]; ];
} }
...@@ -50,6 +51,12 @@ class TriggerAdminController extends AdminController { ...@@ -50,6 +51,12 @@ class TriggerAdminController extends AdminController {
); );
} }
public function actionGetresult($id){
$obj=new \UnisenderAPI();
$result = $obj->getVisitedLinks($id);
var_dump($result);
}
/** /**
* @return string * @return string
*/ */
......
...@@ -93,10 +93,10 @@ class TriggerTrigger extends \common\components\ActiveRecordModel ...@@ -93,10 +93,10 @@ class TriggerTrigger extends \common\components\ActiveRecordModel
// Тут добавляем кнопки управления // Тут добавляем кнопки управления
if (count($this->conditions)>0) { if (count($this->conditions)>0) {
foreach($this->conditions as $condition_array) { foreach($this->conditions as $condition_array) {
$table .= self::getControlButtons($condition_array); $table .= Conditions::getControlButtons($condition_array);
} }
} else } else
$table .= self::getControlButtons(); $table .= Conditions::getControlButtons();
$table .= '</tbody>'; $table .= '</tbody>';
// Формируем футер // Формируем футер
$table .= '<tfoot>'; $table .= '<tfoot>';
......
<?php <?php
use \common\components\UnisenderAPI;
use \yii\helpers\Json;
$email = 'bystrov@kupitsite.ru'; $email = 'bystrov@kupitsite.ru';
$sender = new UnisenderAPI(); $sender = new UnisenderAPI();
// Create the send list // Create the send list
$newListId = $sender->createList(); $newList = $sender->createList();
// Subscribe user to new List $newListObject=Json::decode($newList);
$sender->subscribe(['list_ids' => $newListId, 'fields' => ['email' => $email]]); if (array_key_exists('result', $newListObject) && array_key_exists('id', $newListObject['result'])) {
// Create new message $newListId=$newListObject['result']['id'];
$newMessageId=$sender->createEmailMessage('bystrov', $email, 'Testing Subject', 'Testing Body', $newListId); // Subscribe user to new List
// Create new campaign $sender->subscribe(['list_ids' => $newListId, 'fields' => ['email' => $email]]);
$newCampaign = $sender->createCampaign($newMessageId); // Create new message
$newMessageId=$sender->createEmailMessage('bystrov', $email, 'Testing Subject', 'Testing Body <br><a href="http://www.google.com/">Testing link</a>', $newListId);
// Create new campaign
$newCampaign = $sender->createCampaign($newMessageId);
}
echo 'Рассылка: '.((isset($newCampaign)) ? $newCampaign : 'Not found');
echo '<br>';
echo 'Список: '.((isset($newListId)) ? $newListId : 'Not found');
echo '<br>';
echo 'Сообщение: '.((isset($newMessageId)) ? $newMessageId : 'Not found');
\ No newline at end of file
...@@ -410,13 +410,13 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -410,13 +410,13 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
public function getRole() public function getRole()
{ {
$auth = AuthItem::find()->joinWith('assignment', true) // $auth = AuthItem::find()->joinWith('assignment', true)
->andWhere(['rule_name' => 'group']) // ->andWhere(['rule_name' => 'group'])
->andWhere(['auth_assignment.user_id' => $this->id]) // ->andWhere(['auth_assignment.user_id' => $this->id])
->one(); // ->one();
//
return $auth->name; // return $auth->name;
/*$assigment = AuthAssignment::find(['userid' => $this->id])->one(); $assigment = AuthAssignment::find(['userid' => $this->id])->one();
if (!$assigment) if (!$assigment)
{ {
$assigment = new AuthAssignment(); $assigment = new AuthAssignment();
...@@ -426,7 +426,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -426,7 +426,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
} }
return $assigment->role; return $assigment->role;
return 'admin';*/ return 'admin';
} }
public function getRoleName() public function getRoleName()
......
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160205_084445_addcolumn_bids extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->addColumn('bids', 'form', Schema::TYPE_STRING . '(50) DEFAULT NULL');
}
public function safeDown()
{
$this->dropColumn('bids', 'form');
}
}
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160205_104801_add_column_co_content extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->addColumn('co_content', 'priority', "FLOAT( 3, 1 ) DEFAULT '0.8' AFTER url");
}
public function safeDown()
{
$this->dropColumn('co_content', 'priority');
}
}
<?php
use yii\db\Migration;
use yii\db\Schema;
class m160205_131239_add_new_column_to_trigger_schedule extends Migration
{
public function safeUp()
{
$this->addColumn(
'trigger_schedule',
'list_id',
Schema::TYPE_INTEGER.' DEFAULT NULL'
);
}
public function safeDown()
{
$this->dropColumn(
'trigger_schedule',
'list_id'
);
}
}
...@@ -27,36 +27,21 @@ return [ ...@@ -27,36 +27,21 @@ return [
'class' => 'himiklab\sitemap\Sitemap', 'class' => 'himiklab\sitemap\Sitemap',
'models' => [ 'models' => [
// your models // your models
'common\modules\faq\models\Faq', 'common\modules\content\models\CoContent',
], ],
'urls'=> [ 'urls'=> [
// your additional urls // // your additional urls
[
'loc' => '/faq',
'changefreq' => \himiklab\sitemap\behaviors\SitemapBehavior::CHANGEFREQ_DAILY,
'priority' => 0.8,
'faq' => [
'publication' => [
'name' => 'Вопрос-Ответ',
'language' => 'ru',
],
// 'access' => 'Subscription',
// 'genres' => 'Blog, UserGenerated',
// 'publication_date' => 'YYYY-MM-DDThh:mm:ssTZD',
// 'title' => 'Example Title',
// 'keywords' => 'example, keywords, comma-separated',
// 'stock_tickers' => 'NASDAQ:A, NASDAQ:B',
],
// 'images' => [
// [ // [
// 'loc' => 'http://example.com/image.jpg', // 'loc' => '/faq',
// 'caption' => 'This is an example of a caption of an image', // 'changefreq' => \himiklab\sitemap\behaviors\SitemapBehavior::CHANGEFREQ_DAILY,
// 'geo_location' => 'City, State', // 'priority' => 0.8,
// 'title' => 'Example image', // 'faq' => [
// 'license' => 'http://example.com/license', // 'publication' => [
// 'name' => 'Вопрос-Ответ',
// 'language' => 'ru',
// ],
// ], // ],
// ], // ],
],
], ],
'enableGzip' => true, // default is false 'enableGzip' => true, // default is false
'cacheExpire' => 1, // 1 second. Default is 24 hours 'cacheExpire' => 1, // 1 second. Default is 24 hours
......
...@@ -22,7 +22,9 @@ use common\modules\bids\models\Bid; ...@@ -22,7 +22,9 @@ use common\modules\bids\models\Bid;
], ],
]); ?> ]); ?>
<?php echo Html::hiddenInput('scenario', $model->scenario); ?> <?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo Html::hiddenInput('Bid[form]', Bid::FORM_CALLBACK, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'name', [ <?php echo $form->field($model, 'name', [
'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>', 'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
......
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use common\modules\bids\models\Bid;
?>
<div class="row"> <div class="row">
<div class="col-md-12 col-xs-12 col-sm-12"> <div class="col-md-12 col-xs-12 col-sm-12">
<div class="keys_send_mail"> <div class="keys_send_mail">
<p>Процесс создания кейса очень трудоемкий.Поэтому мы занимаемся созданием кейсов свободное от работы время. Подпишитесь, чтобы следить за обновлениями.</p> <p>Процесс создания кейса очень трудоемкий.Поэтому мы занимаемся созданием кейсов свободное от работы время. Подпишитесь, чтобы следить за обновлениями.</p>
<form class="keys_mail_form"> <?php
<input type="email" placeholder="E-mail*" class="field-input required email"></input> $model = new Bid;
<button class="save-button">Подписаться</button> $model->scenario = Bid::SCENARIO_SUBSCRIBE;
</form>
<div class="send_secce">Вы успешно подписались на обновление раздела «Кейсы». Нам приятно, что вы следите за нашим развитием :-)</div> $form = ActiveForm::begin([
'action' => '/',
'options' => [
'class' => 'keys_mail_form bids-form',
],
]); ?>
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo Html::hiddenInput('Bid[form]', Bid::FORM_SUBSCRIBE, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'email', [
'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
'errorOptions' => []
])->textInput([
'placeholder' => 'E-mail*'
]); ?>
<?php echo Html::submitButton('Подписаться', ['class' => 'save-button']); ?>
<?php ActiveForm::end(); ?>
<div class="send_secce" style="display:none;">Вы успешно подписались на обновление раздела «Кейсы». Нам приятно, что вы следите за нашим развитием :-)</div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
<?php
use common\models\Settings;
?>
<ul class="social_link">
<?php $s = Settings::getValue('social-link-vk'); if($s): ?><li><a href="<?=$s?>" class="soc_item"><i class="fa fa-vk"></i></a></li><? endif; ?>
<?php $s = Settings::getValue('social-link-fb'); if($s): ?><li><a href="<?=$s?>" class="soc_item"><i class="fbicon"></i></a></li><? endif; ?>
<?php $s = Settings::getValue('social-link-youtube'); if($s): ?><li><a href="<?=$s?>" class="soc_item"><i class="fa fa-youtube"></i></a></li><? endif; ?>
<?php $s = Settings::getValue('social-link-instagram'); if($s): ?><li><a href="<?=$s?>" class="soc_item"><i class="fa fa-instagram"></i></a></li><? endif; ?>
<?php $s = Settings::getValue('social-link-twitter'); if($s): ?><li><a href="<?=$s?>" class="soc_item"><i class="fa fa-twitter"></i></a></li><? endif; ?>
<?php $s = Settings::getValue('social-link-google'); if($s): ?><li><a href="<?=$s?>" class="soc_item"><i class="gplusicon"></i></a></li><? endif; ?>
</ul>
\ No newline at end of file
...@@ -28,7 +28,9 @@ use common\modules\bids\models\Bid; ...@@ -28,7 +28,9 @@ use common\modules\bids\models\Bid;
], ],
]); ?> ]); ?>
<?php echo Html::hiddenInput('scenario', $model->scenario); ?> <?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo Html::hiddenInput('Bid[form]', Bid::FORM_PROJECT, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'name', [ <?php echo $form->field($model, 'name', [
'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>', 'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
...@@ -98,14 +100,9 @@ use common\modules\bids\models\Bid; ...@@ -98,14 +100,9 @@ use common\modules\bids\models\Bid;
</div> </div>
</div> </div>
<div class="col-md-6 col-xs-6 col-sm-12"> <div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li> <?php echo $this->render('block/social'); ?>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div> </div>
<div class="col-md-3 col-xs-3 col-sm-12"> <div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div> <div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
......
...@@ -18,14 +18,9 @@ ...@@ -18,14 +18,9 @@
</div> </div>
</div> </div>
<div class="col-md-6 col-xs-6 col-sm-12"> <div class="col-md-6 col-xs-6 col-sm-12">
<ul class="social_link">
<li><a href="#" class="soc_item"><i class="fa fa-vk"></i></a></li> <?php echo $this->render('block/social'); ?>
<li><a href="#" class="soc_item"><i class="fbicon"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-youtube"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-instagram"></i></a></li>
<li><a href="#" class="soc_item"><i class="fa fa-twitter"></i></a></li>
<li><a href="#" class="soc_item"><i class="gplusicon"></i></a></li>
</ul>
</div> </div>
<div class="col-md-3 col-xs-3 col-sm-12"> <div class="col-md-3 col-xs-3 col-sm-12">
<div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div> <div class="taskon"><img src="/images/taskon.png" height="31" width="100" alt=""></div>
......
...@@ -11,7 +11,7 @@ use common\modules\languages\widgets\Languages; ...@@ -11,7 +11,7 @@ use common\modules\languages\widgets\Languages;
<div class="phone_menu"><?=\common\models\Settings::getValue('content-phone')?></div> <div class="phone_menu"><?=\common\models\Settings::getValue('content-phone')?></div>
<ul> <ul>
<li><?=Html::a(\Yii::t('menu', 'About'), ['/about']);?></li> <li><?=Html::a(\Yii::t('menu', 'About'), ['/about']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Portfolio'), ['/case']);?></li> <li><?=Html::a(\Yii::t('menu', 'Portfolio'), ['/portfolio']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Blog'), ['/#']);?></li> <li><?=Html::a(\Yii::t('menu', 'Blog'), ['/#']);?></li>
<!-- <li><?=Html::a(\Yii::t('menu', 'Analytics school'), ['/school']);?></li> --> <!-- <li><?=Html::a(\Yii::t('menu', 'Analytics school'), ['/school']);?></li> -->
<li><?=Html::a(\Yii::t('menu', 'Contacts'), ['/contacts']);?></li> <li><?=Html::a(\Yii::t('menu', 'Contacts'), ['/contacts']);?></li>
...@@ -30,7 +30,7 @@ use common\modules\languages\widgets\Languages; ...@@ -30,7 +30,7 @@ use common\modules\languages\widgets\Languages;
<nav class="top_nav clearfix"> <nav class="top_nav clearfix">
<ul> <ul>
<li><?=Html::a(\Yii::t('menu', 'About'), ['/about']);?></li> <li><?=Html::a(\Yii::t('menu', 'About'), ['/about']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Portfolio'), ['/case']);?></li> <li><?=Html::a(\Yii::t('menu', 'Portfolio'), ['/portfolio']);?></li>
<li><?=Html::a(\Yii::t('menu', 'Blog'), ['/#']);?></li> <li><?=Html::a(\Yii::t('menu', 'Blog'), ['/#']);?></li>
<!-- <li><?=Html::a(\Yii::t('menu', 'Analytics school'), ['/school']);?></li> --> <!-- <li><?=Html::a(\Yii::t('menu', 'Analytics school'), ['/school']);?></li> -->
<li><?=Html::a(\Yii::t('menu', 'Contacts'), ['/contacts']);?></li> <li><?=Html::a(\Yii::t('menu', 'Contacts'), ['/contacts']);?></li>
......
...@@ -92,7 +92,9 @@ use \common\modules\bids\models\Bid; ...@@ -92,7 +92,9 @@ use \common\modules\bids\models\Bid;
], ],
]); ?> ]); ?>
<?php echo Html::hiddenInput('scenario', $model->scenario); ?> <?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo Html::hiddenInput('Bid[form]', Bid::FORM_MESSAGE, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'name', [ <?php echo $form->field($model, 'name', [
'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>', 'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
......
...@@ -34,7 +34,8 @@ $('form.bids-form').on('beforeSubmit', function(e) { ...@@ -34,7 +34,8 @@ $('form.bids-form').on('beforeSubmit', function(e) {
if(response.success) if(response.success)
{ {
form.find('input[name!="scenario"], textarea').val(''); form.find('input:not(.not_clear), textarea').val('');
$('.send_secce').show();
} }
} }
} }
......
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