Beispiel #1
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'code', ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/cms', 'Number of sections'), 'value' => function (\skeeks\cms\models\CmsTreeType $cmsTreeType) {
    return $cmsTreeType->getCmsTrees()->count();
}], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active'], 'priority']]);
?>

<? $pjax::end(); ?>
Beispiel #2
0
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$query = $dataProvider->query;
$query->groupBy([\skeeks\cms\models\CmsUser::tableName() . '.id']);
$query->leftJoin(\skeeks\cms\shop\models\ShopOrder::tableName(), '`shop_order`.`user_id` = `cms_user`.`id`');
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => [['class' => \skeeks\cms\grid\UserColumnData::className(), 'attribute' => 'id', 'label' => \Yii::t('skeeks/shop/app', 'Buyer')], 'email', 'phone', ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => 'created_at', 'label' => \Yii::t('skeeks/shop/app', 'Date of registration')], ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/shop/app', 'Date of last order'), 'value' => function (\skeeks\cms\models\CmsUser $model) {
    if ($order = \skeeks\cms\shop\models\ShopOrder::find()->where(['user_id' => $model->id])->orderBy(['created_at' => SORT_DESC])->one()) {
        return \Yii::$app->formatter->asDatetime($order->created_at);
    }
    return null;
}], ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/shop/app', 'The amount paid orders'), 'value' => function (\skeeks\cms\models\CmsUser $model) {
    return \skeeks\cms\shop\models\ShopOrder::find()->where(['user_id' => $model->id, 'payed' => \skeeks\cms\components\Cms::BOOL_Y])->count();
}], ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/shop/app', 'The amount paid orders'), 'value' => function (\skeeks\cms\models\CmsUser $model) {
    return \skeeks\cms\shop\models\ShopOrder::find()->where(['user_id' => $model->id, 'payed' => \skeeks\cms\components\Cms::BOOL_Y])->count();
}]]]);
?>

<? $pjax::end(); ?>
Beispiel #3
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => ['id', ['attribute' => 'site_code', 'class' => \skeeks\cms\grid\SiteColumn::className()], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], 'name', 'base_rate']]);
?>

<? $pjax::end(); ?>
Beispiel #4
0
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\Game */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
/*echo $this->render('_search', [
      'searchModel' => $searchModel,
      'dataProvider' => $dataProvider
  ]); */
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'columns' => ['name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'attribute' => 'active']]]);
?>

<? $pjax::end(); ?>
Beispiel #5
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 16.07.2015
 */
/* @var $this           yii\web\View */
/* @var $searchModel    common\models\searchs\Game */
/* @var $dataProvider   yii\data\ActiveDataProvider */
/* @var $controller     \skeeks\cms\modules\admin\controllers\AdminController */
/* @var $columns        array */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget($gridConfig);
Beispiel #6
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $model \skeeks\cms\models\CmsContentElement */
$dataProvider->setSort(['defaultOrder' => ['priority' => SORT_ASC]]);
?>
<? $pjax = \yii\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'autoColumns' => false, 'pjax' => $pjax, 'adminController' => $controller, 'columns' => [['class' => \skeeks\cms\grid\ImageColumn2::className()], 'name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"], 'priority']]);
?>

<? \yii\widgets\Pjax::end(); ?>
Beispiel #7
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 16.07.2015
 */
/* @var $this           yii\web\View */
/* @var $searchModel    common\models\searchs\Game */
/* @var $dataProvider   yii\data\ActiveDataProvider */
/* @var $controller     \skeeks\cms\modules\admin\controllers\AdminController */
/* @var $columns        array */
?>

<?php 
\yii\bootstrap\Alert::begin(['options' => ['class' => 'alert-info']]);
?>
Добавте и настройте в эту таблицу типы контентов, которые разрешено продавать на этом сайте.
<?php 
\yii\bootstrap\Alert::end();
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => $columns]);
Beispiel #8
0
    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => [['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \Yii::t('skeeks/shop/app', 'User'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    return $model->user ? (new \skeeks\cms\shop\widgets\AdminBuyerUserWidget(['user' => $model->user]))->run() : \Yii::t('skeeks/shop/app', 'Not authorized');
}], ['class' => \yii\grid\DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \Yii::t('skeeks/shop/app', 'Profile of buyer'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    if (!$model->buyer) {
        return null;
    }
    return \yii\helpers\Html::a($model->buyer->name . " [{$model->buyer->id}]", \skeeks\cms\helpers\UrlHelper::construct('shop/admin-buyer/related-properties', ['pk' => $model->buyer->id])->enableAdmin()->toString());
}], ['class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\shop\models\ShopPersonType::find()->active()->all(), 'id', 'name'), 'attribute' => 'person_type_id', 'label' => \Yii::t('skeeks/shop/app', 'Profile type'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    return $model->personType ? $model->personType->name : "";
}], ['class' => \yii\grid\DataColumn::className(), 'filter' => false, 'label' => \Yii::t('skeeks/shop/app', 'Price of basket'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    return \Yii::$app->money->intlFormatter()->format($model->money);
}], ['class' => \yii\grid\DataColumn::className(), 'filter' => false, 'label' => \Yii::t('skeeks/shop/app', 'Number of items'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    return $model->countShopBaskets;
}], ['class' => \yii\grid\DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \Yii::t('skeeks/shop/app', 'Good'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    if ($model->shopBaskets) {
        $result = [];
        foreach ($model->shopBaskets as $shopBasket) {
            $money = \Yii::$app->money->intlFormatter()->format($shopBasket->money);
            $result[] = \yii\helpers\Html::a($shopBasket->name, $shopBasket->product ? $shopBasket->product->cmsContentElement->url : '#', ['target' => '_blank']) . <<<HTML
({$shopBasket->quantity} {$shopBasket->measure_name}) — {$money}
HTML;
        }
        return implode('<hr style="margin: 0px;"/>', $result);
    }
}], ['class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsSite::find()->active()->all(), 'id', 'name'), 'attribute' => 'site_id', 'format' => 'raw', 'visible' => false, 'label' => \Yii::t('skeeks/shop/app', 'Site'), 'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
    return $model->site->name . " [{$model->site->code}]";
}], ['class' => \skeeks\cms\grid\CreatedAtColumn::className()]]]);
?>
Beispiel #9
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$pjax = \yii\widgets\Pjax::begin();
?>

    <?php 
/*echo $this->render('@skeeks/cms/views/admin-cms-content-element/_search', [
      'searchModel' => $searchModel,
      'dataProvider' => $dataProvider,
      'content_id' => $content_id,
      'cmsContent' => $cmsContent,
  ]); */
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'autoColumns' => false, 'pjax' => $pjax, 'adminController' => $controller, 'columns' => ['id', 'name', 'price', ['filter' => \v3toys\skeeks\models\V3toysOrder::getShippingMethods(), 'attribute' => 'shipping_type', 'value' => function (\v3toys\skeeks\models\V3toysShippingCity $v3toysShippingCity) {
    return $v3toysShippingCity->shippingTypeName;
}]]]);
?>

<?php 
$pjax::end();
?>

<?php 
\yii\bootstrap\Alert::begin(['options' => ['class' => 'alert-info']]);
?>
    <b>php yii v3toys/init/shipping-city</b> - используйте эту комманду для импорта статусов из api
<?php 
\yii\bootstrap\Alert::end();
?>
Beispiel #10
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$dataProvider->query->andWhere(['type' => \skeeks\cms\shop\models\ShopDiscount::TYPE_DISCOUNT_SAVE]);
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['id', ['attribute' => 'name', 'label' => \Yii::t('skeeks/shop/app', 'Name of the program')], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], 'priority']]);
?>

<? $pjax::end(); ?>
    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'isOpenNewWindow' => @$isOpenNewWindow ? true : false, 'columns' => [['attribute' => 'status', 'class' => \yii\grid\DataColumn::className(), 'filter' => \skeeks\cms\reviews2\models\Reviews2Message::getStatuses(), 'format' => 'raw', 'value' => function (\skeeks\cms\reviews2\models\Reviews2Message $model) {
    if ($model->status == \skeeks\cms\reviews2\models\Reviews2Message::STATUS_NEW) {
        $class = "default";
    } else {
        if ($model->status == \skeeks\cms\reviews2\models\Reviews2Message::STATUS_PROCESSED) {
            $class = "warning";
        } else {
            if ($model->status == \skeeks\cms\reviews2\models\Reviews2Message::STATUS_CANCELED) {
                $class = "danger";
            } else {
                if ($model->status == \skeeks\cms\reviews2\models\Reviews2Message::STATUS_ALLOWED) {
                    $class = "success";
                }
            }
        }
    }
    return '<span class="label label-' . $class . '">' . \yii\helpers\ArrayHelper::getValue(\skeeks\cms\reviews2\models\Reviews2Message::getStatuses(), $model->status) . '</span>';
}], ['class' => \skeeks\cms\grid\CreatedAtColumn::className(), 'label' => \Yii::t('skeeks/reviews2', 'Added')], ['class' => \skeeks\cms\grid\CreatedByColumn::className()], ['class' => \skeeks\cms\grid\SiteColumn::className()], ['attribute' => 'element_id', 'relation' => 'element', 'class' => \skeeks\cms\grid\CmsContentElementColumn::className()], ['filter' => \skeeks\cms\models\CmsContent::getDataForSelect(), 'attribute' => 'content_id', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\reviews2\models\Reviews2Message $model) {
    return $model->element->cmsContent->name;
}], ['filter' => \Yii::$app->reviews2->ratings, 'attribute' => 'rating', 'class' => \yii\grid\DataColumn::className()]]]);
?>

<? $pjax::end(); ?>

Beispiel #12
0
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\Game */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'priority', ['class' => \yii\grid\DataColumn::className(), 'attribute' => "siteCodes", 'filter' => false, 'value' => function (\skeeks\cms\shop\models\ShopPersonType $model) {
    $result = [];
    if ($model->sites) {
        foreach ($model->sites as $site) {
            $result[] = "{$site->name} [{$site->code}]";
        }
    }
    return implode(", ", $result);
}], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]]);
?>

<? $pjax::end(); ?>
Beispiel #13
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => ['name', 'value']]);
?>

<? $pjax::end(); ?>
Beispiel #14
0
/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 15.06.2015
 */
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'columns' => ['name', 'code', ['attribute' => 'emails', 'class' => \yii\grid\DataColumn::className(), 'format' => 'raw', 'value' => function (\skeeks\modules\cms\form2\models\Form2Form $model) {
    return $model->emails;
}], ['attribute' => 'phones', 'class' => \yii\grid\DataColumn::className(), 'format' => 'raw', 'value' => function (\skeeks\modules\cms\form2\models\Form2Form $model) {
    return $model->phones;
}], ['label' => \Yii::t('skeeks/form2/app', 'Number of fields in the form'), 'class' => \yii\grid\DataColumn::className(), 'format' => 'raw', 'value' => function (\skeeks\modules\cms\form2\models\Form2Form $model) {
    return count($model->createModelFormSend()->relatedPropertiesModel->attributeLabels());
}], ['label' => \Yii::t('skeeks/form2/app', 'Number of posts'), 'class' => \yii\grid\DataColumn::className(), 'format' => 'raw', 'value' => function (\skeeks\modules\cms\form2\models\Form2Form $model) {
    return \yii\helpers\Html::a(count($model->form2FormSends), \skeeks\cms\helpers\UrlHelper::construct('/form2/admin-form-send', ['Form2FormSend' => ['form_id' => $model->id]])->enableAdmin()->toString());
}]]]);
?>

<? $pjax::end(); ?>
Beispiel #15
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>



    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'columns' => [['class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\Yii::$app->shop->shopPersonTypes, 'id', 'name'), 'attribute' => 'shop_person_type_id', 'value' => function (\skeeks\cms\shop\models\ShopBuyer $model) {
    return $model->shopPersonType->name;
}], 'name', ['class' => \skeeks\cms\grid\UserColumnData::className(), 'attribute' => 'cms_user_id']]]);
?>

<? $pjax::end(); ?>
 /**
  * @param CmsContent $cmsContent
  * @return array
  */
 public static function getColumnsByContent($cmsContent = null, $dataProvider = null)
 {
     $autoColumns = [];
     if (!$cmsContent) {
         return [];
     }
     $model = CmsContentElement::find()->where(['content_id' => $cmsContent->id])->one();
     if (!$model) {
         $model = new CmsContentElement(['content_id' => $cmsContent->id]);
     }
     if (is_array($model) || is_object($model)) {
         foreach ($model as $name => $value) {
             $autoColumns[] = ['attribute' => $name, 'visible' => false, 'format' => 'raw', 'class' => \yii\grid\DataColumn::className(), 'value' => function ($model, $key, $index) use($name) {
                 if (is_array($model->{$name})) {
                     return implode(",", $model->{$name});
                 } else {
                     return $model->{$name};
                 }
             }];
         }
         $searchRelatedPropertiesModel = new \skeeks\cms\models\searchs\SearchRelatedPropertiesModel();
         $searchRelatedPropertiesModel->initProperties($cmsContent->cmsContentProperties);
         $searchRelatedPropertiesModel->load(\Yii::$app->request->get());
         if ($dataProvider) {
             $searchRelatedPropertiesModel->search($dataProvider);
         }
         /**
          * @var $model \skeeks\cms\models\CmsContentElement
          */
         if ($model->relatedPropertiesModel) {
             $autoColumns = ArrayHelper::merge($autoColumns, GridViewStandart::getColumnsByRelatedPropertiesModel($model->relatedPropertiesModel, $searchRelatedPropertiesModel));
         }
     }
     return $autoColumns;
 }
Beispiel #17
0
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\Game */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => [['class' => \skeeks\cms\grid\ImageColumn2::className(), 'attribute' => 'image_id', 'relationName' => 'image'], 'username', 'name', ['class' => \skeeks\cms\grid\CreatedAtColumn::className()], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => 'logged_at'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\models\User $model) {
    $result = [];
    if ($roles = \Yii::$app->authManager->getRolesByUser($model->id)) {
        foreach ($roles as $role) {
            $result[] = $role->description . " ({$role->name})";
        }
    }
    return implode(', ', $result);
}, 'format' => 'html', 'label' => \Yii::t('app', 'Roles')], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]]);
Beispiel #18
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 16.07.2015
 */
/* @var $this           yii\web\View */
/* @var $searchModel    common\models\searchs\Game */
/* @var $dataProvider   yii\data\ActiveDataProvider */
/* @var $controller     \skeeks\cms\modules\admin\controllers\AdminController */
/* @var $columns        array */
?>

<? \yii\bootstrap\Alert::begin([
    'options' =>
    [
        'class' => 'alert-info'
    ]
]); ?>
<?php 
echo \Yii::t('skeeks/shop/app', 'In this section, you can customize what content you can sell on your site.');
?>
<? \yii\bootstrap\Alert::end(); ?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => [['filter' => false, 'attribute' => 'content_id', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\shop\models\ShopContent $model) {
    return $model->content->name . " ({$model->content->contentType->name})";
}]]]);
Beispiel #19
0
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'columns' => [['attribute' => 'status', 'class' => \yii\grid\DataColumn::className(), 'filter' => \skeeks\modules\cms\form2\models\Form2FormSend::getStatuses(), 'format' => 'raw', 'value' => function (\skeeks\modules\cms\form2\models\Form2FormSend $model) {
    if ($model->status == \skeeks\modules\cms\form2\models\Form2FormSend::STATUS_NEW) {
        $class = "danger";
    } else {
        if ($model->status == \skeeks\modules\cms\form2\models\Form2FormSend::STATUS_PROCESSED) {
            $class = "warning";
        } else {
            if ($model->status == \skeeks\modules\cms\form2\models\Form2FormSend::STATUS_EXECUTED) {
                $class = "success";
            }
        }
    }
    return '<span class="label label-' . $class . '">' . \yii\helpers\ArrayHelper::getValue(\skeeks\modules\cms\form2\models\Form2FormSend::getStatuses(), $model->status) . '</span>';
}], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => 'processed_at'], ['class' => \skeeks\cms\grid\UserColumnData::className(), 'attribute' => 'processed_by'], ['attribute' => 'form_id', 'class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\skeeks\modules\cms\form2\models\Form2Form::find()->all(), 'id', 'name'), 'value' => function (\skeeks\modules\cms\form2\models\Form2FormSend $model) {
    return $model->form->name;
}], ['class' => \skeeks\cms\grid\CreatedAtColumn::className(), 'label' => 'Отправлена'], ['attribute' => 'site_code', 'class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsSite::find()->all(), 'code', 'name'), 'value' => function (\skeeks\modules\cms\form2\models\Form2FormSend $model) {
    return $model->site->name;
}], 'comment']]);
?>

<? $pjax::end(); ?>
Beispiel #20
0
            ['class' => 'yii\grid\ActionColumn',],
        ],
    ]);
    Pjax::end();
    */
?>

</div>
-->


<?php 
/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
use skeeks\cms\modules\admin\widgets\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'settingsData' => ['orderBy' => ''], 'columns' => ['name', 'description', ['attribute' => 'ruleName']]]);
Beispiel #21
0
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\Game */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'pjax' => $pjax, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['code', ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'name', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopOrderStatus $model) {
    return \yii\helpers\Html::label($model->name, null, ['style' => "background: {$model->color}", 'class' => "label"]);
}], 'description', 'priority']]);
?>

<? $pjax::end(); ?>
Beispiel #22
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 16.07.2016
 */
/* @var $this yii\web\View */
$response = \Yii::$app->v3toysApi->getProductsDataByIds(['in_stock' => 1]);
?>
<p>3.1.3 Метод getProductsDataByIds - получение данных о товаре по коду</p>

<?php 
if ($response->isError) {
    ?>
    <?php 
    echo $response->error_code;
    ?>
    <?php 
    echo $response->error_message;
} else {
    ?>
    <?php 
    /*
        print_r($response->data);
    */
    ?>
    <?php 
    echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['models' => (array) $response->data]), 'columns' => ['id', 'title', 'deleted', 'quantity', 'buy_price', 'base_price', 'mr_price', 'price', 'excl_quantity', 'sku', 'barcode', 'brand']]);
}
Beispiel #23
0
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin();
?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'autoColumns' => false, 'pjax' => $pjax, 'adminController' => $controller, 'columns' => ['id', ['class' => \skeeks\cms\grid\CreatedAtColumn::className()], ['attribute' => 'user_id', 'class' => \skeeks\cms\grid\UserColumnData::className()], 'name', 'phone', 'email', ['attribute' => 'shipping_method', 'filter' => \v3toys\skeeks\models\V3toysOrder::getShippingMethods(), 'value' => function (\v3toys\skeeks\models\V3toysOrder $v3toysOrder) {
    return $v3toysOrder->deliveryName;
}], 'v3toys_order_id', ['attribute' => 'v3toys_status_id', 'filter' => \yii\helpers\ArrayHelper::map(\v3toys\skeeks\models\V3toysOrderStatus::find()->all(), 'v3toys_id', 'name'), 'value' => function (\v3toys\skeeks\models\V3toysOrder $v3toysOrder) {
    return $v3toysOrder->v3toys_status_id ? $v3toysOrder->status->name : null;
}], ['label' => 'К оплате', 'value' => function (\v3toys\skeeks\models\V3toysOrder $v3toysOrder) {
    return \Yii::$app->money->convertAndFormat($v3toysOrder->money);
}], ['label' => 'Скидка', 'value' => function (\v3toys\skeeks\models\V3toysOrder $v3toysOrder) {
    return \Yii::$app->money->convertAndFormat($v3toysOrder->moneyDiscount);
}], ['label' => 'Доставка', 'value' => function (\v3toys\skeeks\models\V3toysOrder $v3toysOrder) {
    return \Yii::$app->money->convertAndFormat($v3toysOrder->moneyDelivery);
}]]]);
?>

    <?php 
if ($dataProvider->query->count()) {
    ?>
        <?php 
    /**
     * @var $order \v3toys\skeeks\models\V3toysOrder $order
     */
    $moneyTotalNoDelivery = \Yii::$app->money->newMoney();
Beispiel #24
0
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\Game */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => ['value', ['class' => \skeeks\cms\grid\UserColumnData::className(), 'attribute' => 'user_id'], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'approved'], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'def']]]);
Beispiel #25
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 01.09.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $model \skeeks\cms\models\CmsContentElement */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'adminController' => $controller, 'columns' => [['attribute' => 'id', 'value' => function ($model, $index, $dataColumn) {
    return $model->id;
}, 'filter' => false], ['attribute' => 'message', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
    return $model->message;
}], ['attribute' => 'category', 'value' => function ($model, $index, $dataColumn) {
    return $model->category;
}, 'filter' => \yii\helpers\ArrayHelper::map($searchModel::getCategories(), 'category', 'category')], ['attribute' => 'status', 'value' => function ($model, $index, $widget) {
    /** @var SourceMessage $model */
    return $model->isTranslated() ? 'Translated' : 'Not translated';
}, 'filter' => $searchModel->getStatus()]]]);
?>
<!--

-->
Beispiel #26
0
/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$dataProvider->query->andWhere(['type' => \skeeks\cms\shop\models\ShopDiscount::TYPE_DEFAULT]);
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['id', ['attribute' => 'name'], ['attribute' => 'value', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\shop\models\ShopDiscount $shopDiscount) {
    if ($shopDiscount->value_type == \skeeks\cms\shop\models\ShopDiscount::VALUE_TYPE_P) {
        return \Yii::$app->formatter->asPercent($shopDiscount->value / 100);
    } else {
        $money = \skeeks\modules\cms\money\Money::fromString((string) $shopDiscount->value, $shopDiscount->currency_code);
        return \Yii::$app->money->intlFormatter()->format($money);
    }
}], ['attribute' => 'active', 'class' => \skeeks\cms\grid\BooleanColumn::className()], ['attribute' => 'active_from', 'class' => \skeeks\cms\grid\DateTimeColumnData::className()], ['attribute' => 'active_to', 'class' => \skeeks\cms\grid\DateTimeColumnData::className()], ['class' => \skeeks\cms\grid\UpdatedByColumn::className()], ['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], 'priority']]);
?>

<? $pjax::end(); ?>
Beispiel #27
0
    $searchModel->content_id = $content_id;
}
$columns = \skeeks\cms\shop\controllers\AdminCmsContentElementController::getColumns($cmsContent, $dataProvider);
$columns = \yii\helpers\ArrayHelper::merge($columns, [['label' => \Yii::t('skeeks/shop/app', 'Available quantity'), 'class' => \yii\grid\DataColumn::class, 'visible' => false, 'attribute' => 'quantity', 'value' => function (\skeeks\cms\shop\models\ShopCmsContentElement $shopCmsContentElement) {
    return $shopCmsContentElement->shopProduct ? $shopCmsContentElement->shopProduct->quantity : " - ";
}]]);
?>

<? $pjax = \yii\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'content_id' => $content_id, 'cmsContent' => $cmsContent]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'autoColumns' => false, 'pjax' => $pjax, 'adminController' => $controller, 'settingsData' => ['namespace' => \Yii::$app->controller->action->getUniqueId() . $content_id], 'columns' => $columns]);
?>

<? $pjax::end() ?>

<? \yii\bootstrap\Alert::begin([
    'options' => [
        'class' => 'alert-info',
    ],
]); ?>
    <?php 
echo \Yii::t('skeeks/shop/app', 'Change the properties and rights of access to information block you can');
?>
 <?php 
echo \yii\helpers\Html::a(\Yii::t('skeeks/shop/app', 'Content Settings'), \skeeks\cms\helpers\UrlHelper::construct(['/cms/admin-cms-content/update', 'pk' => $content_id])->enableAdmin()->toString());
?>
Beispiel #28
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'priority', 'rate', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]]);
?>

<? $pjax::end(); ?>
Beispiel #29
0
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$pjax = \yii\widgets\Pjax::begin();
?>

    <?php 
/*echo $this->render('@skeeks/cms/views/admin-cms-content-element/_search', [
      'searchModel' => $searchModel,
      'dataProvider' => $dataProvider,
      'content_id' => $content_id,
      'cmsContent' => $cmsContent,
  ]); */
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'autoColumns' => false, 'pjax' => $pjax, 'adminController' => $controller, 'columns' => ['id', ['class' => \skeeks\cms\grid\CreatedAtColumn::className()], ['attribute' => 'user_id', 'class' => \skeeks\cms\grid\UserColumnData::className()], 'full_name', 'phone', 'email', 'status_name', ['label' => 'К оплате', 'value' => function (\v3toys\skeeks\models\V3toysMessage $v3toysOrder) {
    return \Yii::$app->money->convertAndFormat($v3toysOrder->money);
}]]]);
?>

<?php 
$pjax::end();
?>


Beispiel #30
0
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 02.06.2015
 */
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>

<? $pjax = \skeeks\cms\modules\admin\widgets\Pjax::begin(); ?>

    <?php 
echo $this->render('_search', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridViewStandart::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => $pjax, 'adminController' => \Yii::$app->controller, 'settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"], 'columns' => ['name', 'code', ['value' => function (\skeeks\cms\models\CmsContentType $model) {
    $contents = \yii\helpers\ArrayHelper::map($model->cmsContents, 'id', 'name');
    return implode(', ', $contents);
}, 'label' => 'Контент'], 'priority']]);
?>

<? $pjax::end(); ?>