Merge branch 'release/v0.0.96'

This commit is contained in:
Roland Schneider 2017-01-13 22:21:45 +01:00
commit 4d6e384b32
14 changed files with 417 additions and 16 deletions

View File

@ -138,10 +138,6 @@ class AdminMenuStructure{
$items = [];
$items[] = ['label' => 'Kártya események', 'url' => ['/door-log/index' , 'DoorLogSearch[start]' =>$todayDatetime,'DoorLogSearch[end]' => $tomorrowDatetime ] ];
$items[] = ['label' => 'Esemény napló', 'url' => ['/log/index' , 'LogSearch[start]' =>$todayDatetime,'LogSearch[end]' => $tomorrowDatetime ] ];
// $items[] = ['label' => 'Részletek aktiválása', 'url' => ['/ugiro/parts' ] ];
// $items[] = ['label' => 'Bevétel', 'url' => ['/transfer/summary' , 'TransferSummarySearch[start]' =>$today,'TransferSummarySearch[end]' => $tomorrow ] ];
// $items[] = ['label' => 'Napi bevételek', 'url' => ['/transfer/list', 'TransferListSearch[start]' =>$todayDatetime,'TransferListSearch[end]' => $tomorrowDatetime ] ];
// $items[] = ['label' => 'Kassza müveletek', 'url' => ['/account-state/index'] ];
$this->menuItems[] = ['label' => 'Események', 'url' => $this->emptyUrl,
'items' => $items
];
@ -152,14 +148,21 @@ class AdminMenuStructure{
/////////////////////////////
$items = [];
$items[] = ['label' => 'Hírlevelek', 'url' => ['/newsletter/index' , 'NewsletterSearch[start]' =>$todayDatetime,'NewsletterSearch[end]' => $tomorrowDatetime ] ];
// $items[] = ['label' => 'Részletek aktiválása', 'url' => ['/ugiro/parts' ] ];
// $items[] = ['label' => 'Bevétel', 'url' => ['/transfer/summary' , 'TransferSummarySearch[start]' =>$today,'TransferSummarySearch[end]' => $tomorrow ] ];
// $items[] = ['label' => 'Napi bevételek', 'url' => ['/transfer/list', 'TransferListSearch[start]' =>$todayDatetime,'TransferListSearch[end]' => $tomorrowDatetime ] ];
// $items[] = ['label' => 'Kassza müveletek', 'url' => ['/account-state/index'] ];
$this->menuItems[] = ['label' => 'Hírlevél', 'url' => $this->emptyUrl,
'items' => $items
];
/////////////////////////////
// Development
/////////////////////////////
if ( Yii::$app->user ){
$items = [];
$items[] = ['label' => 'Kapu Ki', 'url' => ['/door-log/out' ] ];
$items[] = ['label' => 'Kapu Be', 'url' => ['/door-log/in' ] ];
$this->menuItems[] = ['label' => 'Development', 'url' => $this->emptyUrl,
'items' => $items
];
}
}
}

View File

@ -2,6 +2,10 @@
namespace backend\controllers;
use backend\models\DoorMoveForm;
use common\components\Helper;
use common\models\Card;
use common\models\Ticket;
use Yii;
use common\models\DoorLog;
use backend\models\DoorLogSearch;
@ -61,6 +65,72 @@ class DoorLogController extends Controller
]);
}
public function actionIn( )
{
$model = new DoorMoveForm();
if ($model->load(Yii::$app->request->post()) && $model->validate() ) {
$log = new DoorLog();
//5559 9719
$log->id_card = 9719;
$log->id_customer = 5559;
$log->id_ticket_current = $model->id_ticket;
$log->direction = 3;
$log->id_key = 1;
$log->type = 0;
$log->source_app = DoorLog::$SOURCE_APP_FITNESS_ADMIN;
$log->id_account = null;
$log->card_flag = 0;
$log->flag_out = 0;
$log->save(false);
Helper::flash("success", "Belépett " .$model->id_ticket);
return $this->redirect(['in']);
}else{
$model->id_ticket = $this->findTicket();
return $this->render('move', [
'model' => $model
]);
}
}
public function actionOut()
{
$model = new DoorMoveForm();
if ($model->load(Yii::$app->request->post()) && $model->validate() ) {
$log = new DoorLog();
$log->id_card = 9719;
$log->id_customer = 5559;
$log->id_ticket_current = $model->id_ticket;
$log->direction = 1;
$log->id_key = null;
$log->type = 0;
$log->source_app = DoorLog::$SOURCE_APP_FITNESS_ADMIN;
$log->id_account = null;
$log->card_flag = 0;
$log->flag_out = 0;
$log->save(false);
Helper::flash("success", "Kilépett " .$model->id_ticket );
return $this->redirect(['out']);
}else{
$model->id_ticket = $this->findTicket();
return $this->render('move', [
'model' => $model
]);
}
}
private function findTicket(){
$idCard = 9719;
$card = Card::findOne($idCard);
$tickets = Ticket::readActive($card);
if ( count($tickets) > 0 ){
return $tickets[0]->id_ticket;
}
return "";
}
/**
* Creates a new DoorLog model.
* If creation is successful, the browser will be redirected to the 'view' page.

View File

@ -0,0 +1,31 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use common\models\Card;
use common\models\Customer;
use common\models\Ticket;
use common\models\Account;
use yii\web\UploadedFile;
/**
* ContactForm is the model behind the contact form.
* @property integer id_ticket
*/
class DoorMoveForm extends Model{
public $id_ticket;
public $message;
public function rules(){
return [
[['id_ticket'], 'required'],
[['id_ticket'], 'integer']
];
}
}

View File

@ -0,0 +1,24 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\DoorLog */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="door-log-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_ticket')->textInput() ?>
<div class="form-group">
<?= Html::submitButton( Yii::t('common/door_log', 'Create') ) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -0,0 +1,20 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\DoorLog */
$this->title = "Move";
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Door Logs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = Yii::t('common/door_log', 'Update');
?>
<div class="door-log-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_move', [
'model' => $model,
]) ?>
</div>

View File

@ -1,3 +1,5 @@
-0.0.96
- add asset compress
-0.0.95
- add inventory changes (4 h)
- 20170106

View File

@ -5,7 +5,7 @@ return [
'supportEmail' => 'rocho02@gmail.com',
'infoEmail' => 'info@rocho-net.hu',
'user.passwordResetTokenExpire' => 3600,
'version' => 'v0.0.95',
'version' => 'v0.0.96',
'company' => 'movar',//gyor
'company_name' => "Freimann Kft.",
'product_visiblity' => 'account',// on reception which products to display. account or global

View File

@ -19,6 +19,9 @@ use yii\helpers\ArrayHelper;
* @property integer $id_account
* @property string $created_at
* @property string $source_app
* @property integer id_ticket_current
* @property integer card_flag
* @property integer flag_out
*/
class DoorLog extends \yii\db\ActiveRecord
{

5
common/mysql/index.sql Normal file
View File

@ -0,0 +1,5 @@
create index idx_door_Log_2 on door_log (created_at,id_ticket_current, direction);
create index idx_door_Log_3 on door_log (created_at, id_customer, id_ticket_current, direction);
create index idx_ticket_2 on ticket (start,end,status,count_move_out,max_usage_count,id_card);
create index idx_card_1 on card ( type, id_card);
create index idx_contract_1 on contract ( id_customer, expired_at,flag );

View File

@ -30,7 +30,8 @@
"mpdf/mpdf": "^6.0",
"os/php-excel": "^2.1",
"phpoffice/phpexcel": "^1.8",
"2amigos/yii2-tinymce-widget": "~1.1"
"2amigos/yii2-tinymce-widget": "~1.1",
"iisns/yii2-assets-compress": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",

189
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "f8904c887de6d8934d7e32a613a802b4",
"content-hash": "b1809c8690ea12eaadb899a9549ef697",
"hash": "6f107bd4aac24595297e9f71bfd031f3",
"content-hash": "42a9442876f84ea41b6767df22460fcf",
"packages": [
{
"name": "2amigos/yii2-tinymce-widget",
@ -740,6 +740,53 @@
],
"time": "2013-11-30 08:25:19"
},
{
"name": "iisns/yii2-assets-compress",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/iisns/yii2-assets-compress.git",
"reference": "37009a8b0f4b3bcdd417b223db0d3fb6e9c26034"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/iisns/yii2-assets-compress/zipball/37009a8b0f4b3bcdd417b223db0d3fb6e9c26034",
"reference": "37009a8b0f4b3bcdd417b223db0d3fb6e9c26034",
"shasum": ""
},
"require": {
"mrclay/minify": "*",
"natxet/cssmin": "*",
"tedivm/jshrink": "*",
"yiisoft/yii2": "*"
},
"type": "yii2-extension",
"autoload": {
"psr-4": {
"iisns\\assets\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Shiyang",
"email": "dr@shiyang.me"
}
],
"description": "This solution enables you to dynamically combine js and css files to optimize the html page.",
"keywords": [
"JS",
"assets",
"compress",
"css",
"iisns",
"yii2"
],
"time": "2016-02-12 14:59:50"
},
{
"name": "kartik-v/bootstrap-fileinput",
"version": "v4.2.7",
@ -1905,6 +1952,98 @@
],
"time": "2015-03-01 10:27:49"
},
{
"name": "mrclay/minify",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/mrclay/minify.git",
"reference": "f4cb31135d288f951bb0af1f23a03d4c00ba9446"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mrclay/minify/zipball/f4cb31135d288f951bb0af1f23a03d4c00ba9446",
"reference": "f4cb31135d288f951bb0af1f23a03d4c00ba9446",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"php": ">=5.2.1"
},
"require-dev": {
"tubalmartin/cssmin": "~2.4.8"
},
"suggest": {
"tubalmartin/cssmin": "Support minify with CSSMin (YUI PHP port)"
},
"type": "library",
"autoload": {
"classmap": [
"min/lib/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Stephen Clay",
"email": "steve@mrclay.org",
"role": "Developer"
}
],
"description": "Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers",
"homepage": "http://code.google.com/p/minify/",
"time": "2016-03-08 11:49:57"
},
{
"name": "natxet/CssMin",
"version": "v3.0.4",
"source": {
"type": "git",
"url": "https://github.com/natxet/CssMin.git",
"reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/natxet/CssMin/zipball/92de3fe3ccb4f8298d31952490ef7d5395855c39",
"reference": "92de3fe3ccb4f8298d31952490ef7d5395855c39",
"shasum": ""
},
"require": {
"php": ">=5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Joe Scylla",
"email": "joe.scylla@gmail.com",
"homepage": "https://profiles.google.com/joe.scylla"
}
],
"description": "Minifying CSS",
"homepage": "http://code.google.com/p/cssmin/",
"keywords": [
"css",
"minify"
],
"time": "2015-09-25 11:13:11"
},
{
"name": "os/php-excel",
"version": "2.1",
@ -2104,6 +2243,52 @@
],
"time": "2015-06-06 14:19:39"
},
{
"name": "tedivm/jshrink",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/tedious/JShrink.git",
"reference": "688527a2e854d7935f24f24c7d5eb1b604742bf9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tedious/JShrink/zipball/688527a2e854d7935f24f24c7d5eb1b604742bf9",
"reference": "688527a2e854d7935f24f24c7d5eb1b604742bf9",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"fabpot/php-cs-fixer": "0.4.0",
"phpunit/phpunit": "4.0.*",
"satooshi/php-coveralls": "dev-master"
},
"type": "library",
"autoload": {
"psr-0": {
"JShrink": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Robert Hafner",
"email": "tedivm@tedivm.com"
}
],
"description": "Javascript Minifier built in PHP",
"homepage": "http://github.com/tedious/JShrink",
"keywords": [
"javascript",
"minifier"
],
"time": "2015-07-04 07:35:09"
},
{
"name": "tinymce/tinymce",
"version": "4.3.12",

View File

@ -39,7 +39,7 @@ class DoorlogController extends Controller{
$log->id_ticket_current = $ticket;
$log->direction = 3;
$log->id_key = 1;
$log->type = 0;
$log->type = 5;
$log->source_app = DoorLog::$SOURCE_APP_FITNESS_ADMIN;
$log->id_account = null;
$log->card_flag = 0;
@ -60,7 +60,7 @@ class DoorlogController extends Controller{
$log->id_ticket_current = $ticket;
$log->direction = 1;
$log->id_key = null;
$log->type = 0;
$log->type = 7;
$log->source_app = DoorLog::$SOURCE_APP_FITNESS_ADMIN;
$log->id_account = null;
$log->card_flag = 0;

View File

@ -0,0 +1,49 @@
<?php
/**
* Configuration file for the "yii asset" console command.
* Note that in the console environment, some path aliases like '@webroot' and '@web' may not exist.
* Please define these missing path aliases.
*/
Yii::setAlias('@webroot', realpath(__DIR__ . '/../web'));
Yii::setAlias('@web', '/');
return [
// Adjust command/callback for JavaScript files compressing:
'jsCompressor' => 'java -jar compiler.jar --js {from} --js_output_file {to} --warning_level QUIET',
// Adjust command/callback for CSS files compressing:
'cssCompressor' => 'java -jar yuicompressor.jar --type css {from} -o {to}',
// The list of asset bundles to compress:
'bundles' => [
'frontend\assets\AppAsset',
'yii\web\YiiAsset',
'yii\web\JqueryAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset'
],
// Asset bundle for compression output:
'targets' => [
'allFrontEnd' => [
'class' => 'frontend\assets\MyAsset' ,
'basePath' => '@webroot/assets',
'baseUrl' => '@web/assets',
'js' => 'js/all-{hash}.js',
'css' => 'css/all-{hash}.css',
],
],
// Asset manager configuration:
'assetManager' => [
'basePath' => '@webroot/assets',
'baseUrl' => '@web/assets',
// 'bundles' => [
// 'yii\bootstrap\BootstrapAsset' => [
// 'basePath' => '@webroot',
// 'baseUrl' => '@web',
// 'sourcePath' => null,
// ],
// 'yii\bootstrap\BootstrapPluginAsset' => [
// 'basePath' => '@webroot',
// 'baseUrl' => '@web',
// 'sourcePath' => null,
// ]
// ]
],
];

View File

@ -10,9 +10,17 @@ return [
'id' => 'app-frontend',
'name' =>'Fitness recepció',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'bootstrap' => ['log','assetsAutoCompress'],
'controllerNamespace' => 'frontend\controllers',
'components' => [
'assetsAutoCompress' =>
[
'class' => '\iisns\assets\AssetsCompressComponent',
'enabled' => true,
'jsCompress' => true,
'cssFileCompile' => true,
'jsFileCompile' => true,
],
'request' => [
'enableCsrfValidation'=>false,
],