From deb70550327e83c41c463d71f49cc4bbaa09f72f Mon Sep 17 00:00:00 2001 From: Alex Solomaha Date: Sat, 10 Dec 2016 01:22:36 +0200 Subject: [PATCH] Closes #19; Refactor --- README.md | 7 + composer.json | 13 +- composer.lock | 1471 ++++++++++++++++- config/main.php | 5 +- giiTemplates/crud/my/views/index.php | 2 +- migrations/m161208_212800_event_refactor.php | 28 + ...tion_table_for_trigger_and_task_tables.php | 91 + models/Task.php | 77 +- models/TaskAction.php | 72 - models/{Event.php => Trigger.php} | 74 +- .../controllers/TaskActionController.php | 124 -- ...ntController.php => TriggerController.php} | 28 +- modules/admin/models/TaskActionSearch.php | 72 - modules/admin/models/TaskSearch.php | 9 +- .../{EventSearch.php => TriggerSearch.php} | 11 +- modules/admin/views/event/_form.php | 53 - modules/admin/views/event/index.php | 41 - modules/admin/views/task-action/_form.php | 40 - modules/admin/views/task-action/create.php | 18 - modules/admin/views/task-action/update.php | 19 - modules/admin/views/task-action/view.php | 37 - modules/admin/views/task/_form.php | 40 +- modules/admin/views/task/index.php | 16 +- modules/admin/views/task/view.php | 3 + modules/admin/views/trigger/_form.php | 96 ++ .../admin/views/{event => trigger}/create.php | 8 +- .../views/{task-action => trigger}/index.php | 26 +- .../admin/views/{event => trigger}/update.php | 8 +- .../admin/views/{event => trigger}/view.php | 16 +- scheme.jpg | Bin 38089 -> 0 bytes servers/Panel.php | 178 +- smarthome.sql | 125 -- views/layouts/_left.php | 9 +- web/css/site.css | 8 +- 34 files changed, 1987 insertions(+), 838 deletions(-) create mode 100644 migrations/m161208_212800_event_refactor.php create mode 100644 migrations/m161209_211635_create_junction_table_for_trigger_and_task_tables.php delete mode 100644 models/TaskAction.php rename models/{Event.php => Trigger.php} (58%) delete mode 100644 modules/admin/controllers/TaskActionController.php rename modules/admin/controllers/{EventController.php => TriggerController.php} (80%) delete mode 100644 modules/admin/models/TaskActionSearch.php rename modules/admin/models/{EventSearch.php => TriggerSearch.php} (85%) delete mode 100644 modules/admin/views/event/_form.php delete mode 100644 modules/admin/views/event/index.php delete mode 100644 modules/admin/views/task-action/_form.php delete mode 100644 modules/admin/views/task-action/create.php delete mode 100644 modules/admin/views/task-action/update.php delete mode 100644 modules/admin/views/task-action/view.php create mode 100644 modules/admin/views/trigger/_form.php rename modules/admin/views/{event => trigger}/create.php (50%) rename modules/admin/views/{task-action => trigger}/index.php (54%) rename modules/admin/views/{event => trigger}/update.php (60%) rename modules/admin/views/{event => trigger}/view.php (71%) delete mode 100644 scheme.jpg delete mode 100644 smarthome.sql diff --git a/README.md b/README.md index 3a3df6b..999bba9 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,10 @@ php yii migrate **NOTES:** - Check and edit the other files in the `config/` directory to customize your application as required. + + +To start the server: + +~~~ +php yii panel +~~~ diff --git a/composer.json b/composer.json index 51fa65b..883cdff 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,13 @@ "dmstr/yii2-adminlte-asset": "2.*", "linslin/yii2-curl": "1.0.8", "shifrin/yii2-noty": "^1.0", - "ratchet/pawl": "^0.2.2" + "ratchet/pawl": "^0.2.2", + "voskobovich/yii2-many-many-behavior": "^3.2", + "kartik-v/yii2-widgets": "^3.4", + "kartik-v/yii2-datecontrol": "^1.9", + "voskobovich/yii2-linker-behavior": "4.0.1-rc" }, "require-dev": { - "yiisoft/yii2-codeception": "*", "yiisoft/yii2-debug": "*", "yiisoft/yii2-gii": "*", "yiisoft/yii2-faker": "*" @@ -25,12 +28,6 @@ "config": { "process-timeout": 1800 }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/Devristo/phpws" - } - ], "extra": { "asset-installer-paths": { "npm-asset-library": "vendor/npm", diff --git a/composer.lock b/composer.lock index f5c52f7..55a815f 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "4eebb1b64abc9c9ef27b292ac4defceb", - "content-hash": "e1ae4793c697f2640f949031921bb1fa", + "hash": "93b039facde77e73e4fa37dec8dcedaa", + "content-hash": "06c2ad7f9fe21fa14444b1ff254ecdf3", "packages": [ { "name": "almasaeed2010/adminlte", @@ -663,6 +663,62 @@ ], "time": "2016-10-24 15:52:54" }, + { + "name": "fxp/composer-asset-plugin", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/fxpio/composer-asset-plugin.git", + "reference": "60bc94db574103dfc73acb907fa79c6dfc86c96e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fxpio/composer-asset-plugin/zipball/60bc94db574103dfc73acb907fa79c6dfc86c96e", + "reference": "60bc94db574103dfc73acb907fa79c6dfc86c96e", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.3" + }, + "require-dev": { + "composer/composer": "^1.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Fxp\\Composer\\AssetPlugin\\FxpAssetPlugin", + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Fxp\\Composer\\AssetPlugin\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Pluchino", + "email": "francois.pluchino@gmail.com" + } + ], + "description": "NPM/Bower Dependency Manager for Composer", + "homepage": "https://github.com/fxpio/composer-asset-plugin", + "keywords": [ + "asset", + "bower", + "composer", + "dependency manager", + "nodejs", + "npm", + "package" + ], + "time": "2016-10-12 08:03:45" + }, { "name": "guzzle/common", "version": "v3.9.2", @@ -923,6 +979,1262 @@ ], "time": "2016-06-24 23:00:38" }, + { + "name": "kartik-v/bootstrap-fileinput", + "version": "v4.3.5", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/bootstrap-fileinput.git", + "reference": "6e1a8ca5ca04d4927540ccf18bbfc3253286bd0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/bootstrap-fileinput/zipball/6e1a8ca5ca04d4927540ccf18bbfc3253286bd0c", + "reference": "6e1a8ca5ca04d4927540ccf18bbfc3253286bd0c", + "shasum": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\plugins\\fileinput\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "An enhanced HTML 5 file input for Bootstrap 3.x with features for file preview for many file types, multiple selection, ajax uploads, and more.", + "homepage": "https://github.com/kartik-v/bootstrap-fileinput", + "keywords": [ + "ajax", + "bootstrap", + "delete", + "file", + "image", + "input", + "jquery", + "multiple", + "preview", + "progress", + "upload" + ], + "time": "2016-09-20 05:47:41" + }, + { + "name": "kartik-v/bootstrap-star-rating", + "version": "v4.0.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/bootstrap-star-rating.git", + "reference": "d66083c14f9386ede23fccb76dea1a380db67ded" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/bootstrap-star-rating/zipball/d66083c14f9386ede23fccb76dea1a380db67ded", + "reference": "d66083c14f9386ede23fccb76dea1a380db67ded", + "shasum": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A simple yet powerful JQuery star rating plugin for Bootstrap.", + "homepage": "https://github.com/kartik-v/bootstrap-star-rating", + "keywords": [ + "Rating", + "awesome", + "bootstrap", + "font", + "glyphicon", + "star", + "svg" + ], + "time": "2016-02-28 16:13:18" + }, + { + "name": "kartik-v/dependent-dropdown", + "version": "v1.4.4", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/dependent-dropdown.git", + "reference": "a13970aec78e8eaae5cb9f1168df20d443f95113" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/dependent-dropdown/zipball/a13970aec78e8eaae5cb9f1168df20d443f95113", + "reference": "a13970aec78e8eaae5cb9f1168df20d443f95113", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "kartik\\plugins\\depdrop\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A multi level dependent dropdown JQuery plugin that allows nested dependencies.", + "homepage": "https://github.com/kartik-v/dependent-dropdown", + "keywords": [ + "dependent", + "dropdown", + "jquery", + "option", + "select" + ], + "time": "2015-12-16 18:15:01" + }, + { + "name": "kartik-v/php-date-formatter", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/php-date-formatter.git", + "reference": "38984fb614f3ebc3605a8e369eee1406feea02a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/php-date-formatter/zipball/38984fb614f3ebc3605a8e369eee1406feea02a4", + "reference": "38984fb614f3ebc3605a8e369eee1406feea02a4", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "kartik\\plugins\\dateformatter\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A Javascript datetime formatting and manipulation library using PHP date-time formats.", + "homepage": "https://github.com/kartik-v/php-date-formatter", + "keywords": [ + "date", + "datetime", + "formatter", + "javascript", + "php", + "php-date-formatter.js", + "time" + ], + "time": "2015-12-21 18:22:51" + }, + { + "name": "kartik-v/yii2-datecontrol", + "version": "v1.9.4", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-datecontrol.git", + "reference": "4e858b5cd38130c37739b2f582b66a044f77c95c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-datecontrol/zipball/4e858b5cd38130c37739b2f582b66a044f77c95c", + "reference": "4e858b5cd38130c37739b2f582b66a044f77c95c", + "shasum": "" + }, + "require": { + "kartik-v/php-date-formatter": ">1.3", + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\datecontrol\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Date control module allowing separation of formats for View and Model for Yii Framework 2.0", + "homepage": "https://github.com/kartik-v/yii2-datecontrol", + "keywords": [ + "control", + "date", + "extension", + "format", + "yii", + "yii2" + ], + "time": "2015-07-30 18:30:18" + }, + { + "name": "kartik-v/yii2-krajee-base", + "version": "v1.8.7", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-krajee-base.git", + "reference": "8f558809e6093c8f4f4599b7b9fd64b366b22a60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-krajee-base/zipball/8f558809e6093c8f4f4599b7b9fd64b366b22a60", + "reference": "8f558809e6093c8f4f4599b7b9fd64b366b22a60", + "shasum": "" + }, + "require": { + "yiisoft/yii2-bootstrap": "@dev" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\base\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Base library and foundation components for all Yii2 Krajee extensions.", + "homepage": "https://github.com/kartik-v/yii2-krajee-base", + "keywords": [ + "base", + "extension", + "foundation", + "krajee", + "widget", + "yii2" + ], + "time": "2016-09-04 09:25:29" + }, + { + "name": "kartik-v/yii2-widget-activeform", + "version": "v1.4.8", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-activeform.git", + "reference": "53c2f877f12ba0b79e8346b6cae50cbba2bcfc69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-activeform/zipball/53c2f877f12ba0b79e8346b6cae50cbba2bcfc69", + "reference": "53c2f877f12ba0b79e8346b6cae50cbba2bcfc69", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\form\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).", + "homepage": "https://github.com/kartik-v/yii2-widget-activeform", + "keywords": [ + "activefield", + "activeform", + "extension", + "field", + "form", + "widget", + "yii2" + ], + "time": "2016-04-27 18:38:05" + }, + { + "name": "kartik-v/yii2-widget-affix", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-affix.git", + "reference": "2184119bfa518c285406156f744769b13b861712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-affix/zipball/2184119bfa518c285406156f744769b13b861712", + "reference": "2184119bfa518c285406156f744769b13b861712", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\affix\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A scrollspy and affixed enhanced navigation to highlight page sections (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-affix", + "keywords": [ + "affix", + "bootstrap", + "extension", + "jquery", + "navigation", + "plugin", + "scrollspy", + "widget", + "yii2" + ], + "time": "2014-11-09 04:56:27" + }, + { + "name": "kartik-v/yii2-widget-alert", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-alert.git", + "reference": "5b312eeaf429c2affe6a96217d79f0c761159643" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-alert/zipball/5b312eeaf429c2affe6a96217d79f0c761159643", + "reference": "5b312eeaf429c2affe6a96217d79f0c761159643", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\alert\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-alert", + "keywords": [ + "alert", + "block", + "bootstrap", + "extension", + "flash", + "jquery", + "notification", + "plugin", + "widget", + "yii2" + ], + "time": "2014-11-19 06:44:12" + }, + { + "name": "kartik-v/yii2-widget-colorinput", + "version": "v1.0.3", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-colorinput.git", + "reference": "3f6e847ef72cf6e27e4d3b4870b00b8f80d51752" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-colorinput/zipball/3f6e847ef72cf6e27e4d3b4870b00b8f80d51752", + "reference": "3f6e847ef72cf6e27e4d3b4870b00b8f80d51752", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\color\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-colorinput", + "keywords": [ + "HTML5", + "color", + "extension", + "form", + "input", + "jquery", + "plugin", + "widget", + "yii2" + ], + "time": "2016-01-14 11:15:49" + }, + { + "name": "kartik-v/yii2-widget-datepicker", + "version": "v1.4.2", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-datepicker.git", + "reference": "8738f6dc3211d949b05189ba103aab786143fc6c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-datepicker/zipball/8738f6dc3211d949b05189ba103aab786143fc6c", + "reference": "8738f6dc3211d949b05189ba103aab786143fc6c", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\date\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).", + "homepage": "https://github.com/kartik-v/yii2-widget-datepicker", + "keywords": [ + "date", + "extension", + "form", + "jquery", + "picker", + "plugin", + "select2", + "widget", + "yii2" + ], + "time": "2016-09-04 10:52:50" + }, + { + "name": "kartik-v/yii2-widget-datetimepicker", + "version": "v1.4.2", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-datetimepicker.git", + "reference": "f4e7024e31da40460d1b36dc880c2ec20a21bf6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-datetimepicker/zipball/f4e7024e31da40460d1b36dc880c2ec20a21bf6e", + "reference": "f4e7024e31da40460d1b36dc880c2ec20a21bf6e", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\datetime\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-datetimepicker", + "keywords": [ + "datetime", + "extension", + "form", + "jquery", + "picker", + "plugin", + "select2", + "widget", + "yii2" + ], + "time": "2016-01-10 12:18:38" + }, + { + "name": "kartik-v/yii2-widget-depdrop", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-depdrop.git", + "reference": "6918ca6f7d7be153c80f6aa9c261f9b333293e9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-depdrop/zipball/6918ca6f7d7be153c80f6aa9c261f9b333293e9c", + "reference": "6918ca6f7d7be153c80f6aa9c261f9b333293e9c", + "shasum": "" + }, + "require": { + "kartik-v/dependent-dropdown": "~1.4", + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\depdrop\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Widget that enables setting up dependent dropdowns with nested dependencies (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-depdrop", + "keywords": [ + "dependent", + "dropdown", + "extension", + "form", + "jquery", + "plugin", + "widget", + "yii2" + ], + "time": "2016-01-10 17:30:48" + }, + { + "name": "kartik-v/yii2-widget-fileinput", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-fileinput.git", + "reference": "3b8f6819f2cd01becff5251b8b952ac3e57b903a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-fileinput/zipball/3b8f6819f2cd01becff5251b8b952ac3e57b903a", + "reference": "3b8f6819f2cd01becff5251b8b952ac3e57b903a", + "shasum": "" + }, + "require": { + "kartik-v/bootstrap-fileinput": "~4.2", + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\file\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "An enhanced FileInput widget for Bootstrap 3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-fileinput", + "keywords": [ + "extension", + "file", + "form", + "input", + "jquery", + "plugin", + "upload", + "widget", + "yii2" + ], + "time": "2016-06-16 06:53:01" + }, + { + "name": "kartik-v/yii2-widget-growl", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-growl.git", + "reference": "c79abaa47e9103e93345cd1eca7bc75e17e9a92e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-growl/zipball/c79abaa47e9103e93345cd1eca7bc75e17e9a92e", + "reference": "c79abaa47e9103e93345cd1eca7bc75e17e9a92e", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\growl\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A widget to generate growl based notifications using bootstrap-growl plugin (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-growl", + "keywords": [ + "alert", + "bootstrap", + "extension", + "growl", + "jquery", + "notification", + "plugin", + "widget", + "yii2" + ], + "time": "2015-05-03 08:23:04" + }, + { + "name": "kartik-v/yii2-widget-rangeinput", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-rangeinput.git", + "reference": "ad82cf956b95555d39dbb534587c7827b1dc7bdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-rangeinput/zipball/ad82cf956b95555d39dbb534587c7827b1dc7bdf", + "reference": "ad82cf956b95555d39dbb534587c7827b1dc7bdf", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\range\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-rangeinput", + "keywords": [ + "HTML5", + "extension", + "form", + "input", + "jquery", + "plugin", + "range", + "widget", + "yii2" + ], + "time": "2015-11-22 06:52:44" + }, + { + "name": "kartik-v/yii2-widget-rating", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-rating.git", + "reference": "69b192bc2b26a435618e17eed7c56294ef805fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-rating/zipball/69b192bc2b26a435618e17eed7c56294ef805fab", + "reference": "69b192bc2b26a435618e17eed7c56294ef805fab", + "shasum": "" + }, + "require": { + "kartik-v/bootstrap-star-rating": "*", + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\rating\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-rating", + "keywords": [ + "Rating", + "bootstrap", + "extension", + "form", + "input", + "jquery", + "plugin", + "star", + "widget", + "yii2" + ], + "time": "2016-02-17 19:13:26" + }, + { + "name": "kartik-v/yii2-widget-select2", + "version": "v2.0.8", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-select2.git", + "reference": "4d03239c1e28ef8d3b96ab7fe360f5cbda34fb69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-select2/zipball/4d03239c1e28ef8d3b96ab7fe360f5cbda34fb69", + "reference": "4d03239c1e28ef8d3b96ab7fe360f5cbda34fb69", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "kartik\\select2\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).", + "homepage": "https://github.com/kartik-v/yii2-widget-select2", + "keywords": [ + "dropdown", + "extension", + "form", + "jquery", + "plugin", + "select2", + "widget", + "yii2" + ], + "time": "2016-02-17 11:49:30" + }, + { + "name": "kartik-v/yii2-widget-sidenav", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-sidenav.git", + "reference": "02ee4f142d7dfbb316f878e538cc7b946f4502d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-sidenav/zipball/02ee4f142d7dfbb316f878e538cc7b946f4502d2", + "reference": "02ee4f142d7dfbb316f878e538cc7b946f4502d2", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\sidenav\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-sidenav", + "keywords": [ + "bootstrap", + "extension", + "jquery", + "menu", + "navigation", + "plugin", + "sidenav", + "widget", + "yii2" + ], + "time": "2014-11-09 08:07:23" + }, + { + "name": "kartik-v/yii2-widget-spinner", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-spinner.git", + "reference": "3132ba14d58e0564d17f3b846b04c42aa72bdde3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-spinner/zipball/3132ba14d58e0564d17f3b846b04c42aa72bdde3", + "reference": "3132ba14d58e0564d17f3b846b04c42aa72bdde3", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\spinner\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A widget to render animated CSS3 loading spinners with VML fallback for IE (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-spinner", + "keywords": [ + "CSS3", + "extension", + "jquery", + "loading", + "plugin", + "spinner", + "widget", + "yii2" + ], + "time": "2014-11-09 05:02:05" + }, + { + "name": "kartik-v/yii2-widget-switchinput", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-switchinput.git", + "reference": "7d8ee999d79bcdc1601da5cd59439ac7eb1f5ea6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-switchinput/zipball/7d8ee999d79bcdc1601da5cd59439ac7eb1f5ea6", + "reference": "7d8ee999d79bcdc1601da5cd59439ac7eb1f5ea6", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\switchinput\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle switchinputes (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-switchinput", + "keywords": [ + "bootstrap", + "extension", + "form", + "input", + "jquery", + "plugin", + "switchinput", + "toggle", + "widget", + "yii2" + ], + "time": "2016-01-10 16:47:35" + }, + { + "name": "kartik-v/yii2-widget-timepicker", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-timepicker.git", + "reference": "fa230caf281fbf6abea29a5dc1c28ebc005e4438" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-timepicker/zipball/fa230caf281fbf6abea29a5dc1c28ebc005e4438", + "reference": "fa230caf281fbf6abea29a5dc1c28ebc005e4438", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\time\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-timepicker", + "keywords": [ + "bootstrap", + "extension", + "form", + "jquery", + "picker", + "plugin", + "time", + "widget", + "yii2" + ], + "time": "2016-01-12 09:50:39" + }, + { + "name": "kartik-v/yii2-widget-touchspin", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-touchspin.git", + "reference": "afc56f68d87c65c9659b76ac82ae4ae8160634c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-touchspin/zipball/afc56f68d87c65c9659b76ac82ae4ae8160634c6", + "reference": "afc56f68d87c65c9659b76ac82ae4ae8160634c6", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\touchspin\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle touchspines (sub repo split from yii2-widgets)", + "homepage": "https://github.com/kartik-v/yii2-widget-touchspin", + "keywords": [ + "bootstrap", + "extension", + "form", + "input", + "jquery", + "plugin", + "spinner", + "touch", + "widget", + "yii2" + ], + "time": "2016-01-10 17:10:39" + }, + { + "name": "kartik-v/yii2-widget-typeahead", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widget-typeahead.git", + "reference": "e369cd55cb2fb9d3a82b57ea6c9a62d69f14fb94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widget-typeahead/zipball/e369cd55cb2fb9d3a82b57ea6c9a62d69f14fb94", + "reference": "e369cd55cb2fb9d3a82b57ea6c9a62d69f14fb94", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "~1.7" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\typeahead\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).", + "homepage": "https://github.com/kartik-v/yii2-widget-typeahead", + "keywords": [ + "dropdown", + "extension", + "form", + "jquery", + "plugin", + "typeahead", + "widget", + "yii2" + ], + "time": "2015-06-28 18:05:41" + }, + { + "name": "kartik-v/yii2-widgets", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/kartik-v/yii2-widgets.git", + "reference": "f435d5e96c4848844bdfa9cee58249ccfb3e2dd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kartik-v/yii2-widgets/zipball/f435d5e96c4848844bdfa9cee58249ccfb3e2dd2", + "reference": "f435d5e96c4848844bdfa9cee58249ccfb3e2dd2", + "shasum": "" + }, + "require": { + "kartik-v/yii2-krajee-base": "*", + "kartik-v/yii2-widget-activeform": "*", + "kartik-v/yii2-widget-affix": "*", + "kartik-v/yii2-widget-alert": "*", + "kartik-v/yii2-widget-colorinput": "*", + "kartik-v/yii2-widget-datepicker": "*", + "kartik-v/yii2-widget-datetimepicker": "*", + "kartik-v/yii2-widget-depdrop": "*", + "kartik-v/yii2-widget-fileinput": "*", + "kartik-v/yii2-widget-growl": "*", + "kartik-v/yii2-widget-rangeinput": "*", + "kartik-v/yii2-widget-rating": "*", + "kartik-v/yii2-widget-select2": "*", + "kartik-v/yii2-widget-sidenav": "*", + "kartik-v/yii2-widget-spinner": "*", + "kartik-v/yii2-widget-switchinput": "*", + "kartik-v/yii2-widget-timepicker": "*", + "kartik-v/yii2-widget-touchspin": "*", + "kartik-v/yii2-widget-typeahead": "*" + }, + "type": "yii2-extension", + "autoload": { + "psr-4": { + "kartik\\widgets\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD 3-Clause" + ], + "authors": [ + { + "name": "Kartik Visweswaran", + "email": "kartikv2@gmail.com", + "homepage": "http://www.krajee.com/" + } + ], + "description": "Collection of useful widgets for Yii Framework 2.0 extending functionalities for Bootstrap", + "homepage": "https://github.com/kartik-v/yii2-widgets", + "keywords": [ + "extension", + "form", + "widget", + "yii2" + ], + "time": "2014-11-09 19:54:17" + }, { "name": "linslin/yii2-curl", "version": "1.0.8", @@ -1931,6 +3243,115 @@ ], "time": "2016-11-25 12:32:42" }, + { + "name": "voskobovich/yii2-linker-behavior", + "version": "4.0.1-rc", + "source": { + "type": "git", + "url": "https://github.com/voskobovich/yii2-linker-behavior.git", + "reference": "b4f0e9b05bbd53fdbd3fcca318b31f6cced4cc66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voskobovich/yii2-linker-behavior/zipball/b4f0e9b05bbd53fdbd3fcca318b31f6cced4cc66", + "reference": "b4f0e9b05bbd53fdbd3fcca318b31f6cced4cc66", + "shasum": "" + }, + "require": { + "fxp/composer-asset-plugin": "*", + "php": ">=5.4.0", + "yiisoft/yii2": "^2" + }, + "require-dev": { + "codeception/codeception": "*", + "yiisoft/yii2-codeception": "^2" + }, + "type": "yii2-behavior", + "autoload": { + "psr-4": { + "voskobovich\\linker\\": "src", + "voskobovich\\linker\\interfaces\\": "src/interfaces", + "voskobovich\\linker\\updaters\\": "src/updaters" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Vitaly Voskobovich", + "email": "vitaly@voskobovich.com", + "homepage": "http://voskobovich.com" + }, + { + "name": "Konstantin Sirotkin", + "email": "beowulfenator@gmail.com", + "homepage": "http://beowulfenator.github.io" + } + ], + "description": "This behavior makes it easy to maintain many-to-many and one-to-many relations in your ActiveRecord models.", + "homepage": "https://github.com/voskobovich/yii2-linker-behavior", + "keywords": [ + "Active Record", + "Behavior", + "ar", + "many-to-many", + "one-to-many", + "relations", + "yii2" + ], + "time": "2016-12-04 11:00:39" + }, + { + "name": "voskobovich/yii2-many-many-behavior", + "version": "v3.2.2", + "source": { + "type": "git", + "url": "https://github.com/voskobovich/yii2-many-to-many-behavior.git", + "reference": "cb130c10aceefe57bd2d3b0544986d84026455ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voskobovich/yii2-many-to-many-behavior/zipball/cb130c10aceefe57bd2d3b0544986d84026455ae", + "reference": "cb130c10aceefe57bd2d3b0544986d84026455ae", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "yiisoft/yii2": "~2.0.0" + }, + "require-dev": { + "yiisoft/yii2-codeception": "~2.0" + }, + "type": "yii2-behavior", + "autoload": { + "psr-4": { + "voskobovich\\behaviors\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Vitaly Voskobovich", + "email": "vitaly@voskobovich.com", + "homepage": "http://voskobovich.com" + } + ], + "description": "This behavior makes it easy to maintain relations many-to-many in the your ActiveRecord model.", + "homepage": "https://github.com/voskobovich/ManyToManyBehavior", + "keywords": [ + "Active Record", + "Behavior", + "many-to-many", + "relation", + "yii2" + ], + "time": "2016-01-14 09:39:52" + }, { "name": "yiisoft/yii2", "version": "2.0.10", @@ -2287,52 +3708,6 @@ "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", "time": "2016-04-07 12:29:16" }, - { - "name": "yiisoft/yii2-codeception", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/yiisoft/yii2-codeception.git", - "reference": "c916a36d09fc128b05a374e7922bc56854334d56" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-codeception/zipball/c916a36d09fc128b05a374e7922bc56854334d56", - "reference": "c916a36d09fc128b05a374e7922bc56854334d56", - "shasum": "" - }, - "require": { - "yiisoft/yii2": ">=2.0.4" - }, - "type": "yii2-extension", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "yii\\codeception\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Mark Jebri", - "email": "mark.github@yandex.ru" - } - ], - "description": "The Codeception integration for the Yii framework", - "keywords": [ - "codeception", - "yii2" - ], - "abandoned": "codeception/codeception", - "time": "2016-03-17 03:41:26" - }, { "name": "yiisoft/yii2-debug", "version": "2.0.7", diff --git a/config/main.php b/config/main.php index 873695f..e1fd364 100644 --- a/config/main.php +++ b/config/main.php @@ -5,8 +5,8 @@ $params = require(__DIR__ . '/params.php'); return [ 'id' => 'basic', 'name' => 'SmartHome', - 'sourceLanguage' => 'ru', 'language' => 'ru', + 'sourceLanguage' => 'ru', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'components' => [ @@ -77,6 +77,9 @@ return [ 'api' => [ 'class' => 'app\modules\api\Module', ], + 'datecontrol' => [ + 'class' => '\kartik\datecontrol\Module' + ], ], 'params' => $params, 'defaultRoute' => ['panel/index'], diff --git a/giiTemplates/crud/my/views/index.php b/giiTemplates/crud/my/views/index.php index bf7175a..d897040 100644 --- a/giiTemplates/crud/my/views/index.php +++ b/giiTemplates/crud/my/views/index.php @@ -61,7 +61,7 @@ if (($tableSchema = $generator->getTableSchema()) === false) { } ?> - ['class' => 'yii\grid\ActionColumn'], + ['class' => 'app\components\ActionButtonColumn'], ], ]); ?> diff --git a/migrations/m161208_212800_event_refactor.php b/migrations/m161208_212800_event_refactor.php new file mode 100644 index 0000000..60f4174 --- /dev/null +++ b/migrations/m161208_212800_event_refactor.php @@ -0,0 +1,28 @@ +renameTable('event', 'trigger'); + $this->dropColumn('trigger', 'task_id'); + + $this->addColumn('task', 'type', $this->integer()->notNull()->after('id')); + $this->addColumn('task', 'item_id', $this->integer()->after('type')); + $this->addColumn('task', 'item_value', $this->string()->after('item_id')); + + $this->dropTable('task_action'); + } + + public function safeDown() + { + $this->renameTable('trigger', 'event'); + $this->addColumn('trigger', 'task_id', $this->integer()->notNull()->after('id')); + + $this->dropColumn('task', 'type'); + $this->dropColumn('task', 'item_id'); + $this->dropColumn('task', 'item_value'); + } +} diff --git a/migrations/m161209_211635_create_junction_table_for_trigger_and_task_tables.php b/migrations/m161209_211635_create_junction_table_for_trigger_and_task_tables.php new file mode 100644 index 0000000..e85b4f1 --- /dev/null +++ b/migrations/m161209_211635_create_junction_table_for_trigger_and_task_tables.php @@ -0,0 +1,91 @@ +createTable('trigger_task', [ + 'trigger_id' => $this->integer(), + 'task_id' => $this->integer(), + 'PRIMARY KEY(trigger_id, task_id)', + ]); + + // creates index for column `trigger_id` + $this->createIndex( + 'idx-trigger_task-trigger_id', + 'trigger_task', + 'trigger_id' + ); + + // add foreign key for table `trigger` + $this->addForeignKey( + 'fk-trigger_task-trigger_id', + 'trigger_task', + 'trigger_id', + 'trigger', + 'id', + 'CASCADE' + ); + + // creates index for column `task_id` + $this->createIndex( + 'idx-trigger_task-task_id', + 'trigger_task', + 'task_id' + ); + + // add foreign key for table `task` + $this->addForeignKey( + 'fk-trigger_task-task_id', + 'trigger_task', + 'task_id', + 'task', + 'id', + 'CASCADE' + ); + } + + /** + * @inheritdoc + */ + public function down() + { + // drops foreign key for table `trigger` + $this->dropForeignKey( + 'fk-trigger_task-trigger_id', + 'trigger_task' + ); + + // drops index for column `trigger_id` + $this->dropIndex( + 'idx-trigger_task-trigger_id', + 'trigger_task' + ); + + // drops foreign key for table `task` + $this->dropForeignKey( + 'fk-trigger_task-task_id', + 'trigger_task' + ); + + // drops index for column `task_id` + $this->dropIndex( + 'idx-trigger_task-task_id', + 'trigger_task' + ); + + $this->dropTable('trigger_task'); + } +} diff --git a/models/Task.php b/models/Task.php index 17bbf41..37a04a8 100644 --- a/models/Task.php +++ b/models/Task.php @@ -2,19 +2,27 @@ namespace app\models; +use voskobovich\linker\LinkerBehavior; use Yii; +use yii\db\ActiveRecord; use yii\helpers\ArrayHelper; /** * This is the model class for table "task". * * @property integer $id + * @property integer $type + * @property integer $item_id + * @property string $item_value * @property string $name * - * @property TaskAction[] $taskActions + * @property Item $item + * @property Trigger[] $triggers */ -class Task extends \yii\db\ActiveRecord +class Task extends ActiveRecord { + const TYPE_ITEM_VALUE = 10; + /** * @inheritdoc */ @@ -29,8 +37,10 @@ class Task extends \yii\db\ActiveRecord public function rules() { return [ - [['name'], 'required'], - [['name'], 'string', 'max' => 255], + [['name', 'type'], 'required'], + [['type', 'item_id'], 'integer'], + [['item_value', 'name'], 'string', 'max' => 255], + [['trigger_ids'], 'each', 'rule' => ['integer']], ]; } @@ -41,20 +51,69 @@ class Task extends \yii\db\ActiveRecord { return [ 'id' => 'ID', - 'name' => 'Name', + 'type' => 'Тип', + 'item_id' => 'Элемент', + 'item_value' => 'Значение Элемента', + 'trigger_ids' => 'Triggers', + 'name' => 'Название', ]; } + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + [ + 'class' => LinkerBehavior::className(), + 'relations' => [ + 'trigger_ids' => 'triggers', + ], + ], + ]; + } + + /** + * @return array + */ + public static function getList() + { + return ArrayHelper::map(self::find()->all(), 'id', 'name'); + } + + /** + * @return array + */ + public static function getTypes() + { + return [ + self::TYPE_ITEM_VALUE => 'Изменить значение Элемента', + ]; + } + + /** + * @return string + */ + public function getTypeLabel() + { + return self::getTypes()[$this->type]; + } + /** * @return \yii\db\ActiveQuery */ - public function getTaskActions() + public function getTriggers() { - return $this->hasMany(TaskAction::className(), ['task_id' => 'id']); + return $this->hasMany(Trigger::className(), ['id' => 'trigger_id']) + ->viaTable('trigger_task', ['task_id' => 'id']); } - public static function getList() + /** + * @return \yii\db\ActiveQuery + */ + public function getItem() { - return ArrayHelper::map(self::find()->all(), 'id', 'name'); + return $this->hasOne(Item::className(), ['id' => 'item_id']); } } diff --git a/models/TaskAction.php b/models/TaskAction.php deleted file mode 100644 index 66b9f01..0000000 --- a/models/TaskAction.php +++ /dev/null @@ -1,72 +0,0 @@ - 255], - ]; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'id' => 'ID', - 'type' => 'Тип', - 'item_id' => 'Элемент', - 'item_value' => 'Значение Элемента', - 'task_id' => 'Задача', - 'name' => 'Название', - ]; - } - - /** - * @return \yii\db\ActiveQuery - */ - public function getItem() - { - return $this->hasOne(Item::className(), ['id' => 'item_id']); - } - - public static function getTypes() - { - return [ - self::TYPE_CHANGE_ITEM_VALUE => 'Изменить значение Элемента', - ]; - } -} diff --git a/models/Event.php b/models/Trigger.php similarity index 58% rename from models/Event.php rename to models/Trigger.php index a85e115..4f37e80 100644 --- a/models/Event.php +++ b/models/Trigger.php @@ -2,26 +2,26 @@ namespace app\models; +use voskobovich\linker\LinkerBehavior; use Yii; use yii\db\ActiveRecord; use yii\helpers\ArrayHelper; /** - * This is the model class for table "event". + * This is the model class for table "trigger". * * @property integer $id * @property integer $type - * @property string $trig_date + * @property integer $trig_date * @property string $trig_time * @property string $trig_time_wdays * @property integer $trig_item_id * @property string $trig_item_value - * @property integer $task_id * @property string $name * - * @property Task $task + * @property Task[] $tasks */ -class Event extends ActiveRecord +class Trigger extends ActiveRecord { const TYPE_BY_ITEM_VALUE = 10; const TYPE_BY_USER_ITEM_CHANGE = 20; @@ -33,7 +33,7 @@ class Event extends ActiveRecord */ public static function tableName() { - return 'event'; + return 'trigger'; } /** @@ -43,9 +43,26 @@ class Event extends ActiveRecord { return [ [['type', 'name'], 'required'], - [['type', 'trig_item_id', 'task_id'], 'integer'], - [['type'], 'in', 'range' => self::getStatusesArray()], - [['trig_date', 'trig_item_value', 'name', 'trig_time', 'trig_time_wdays'], 'string', 'max' => 255], + [['type', 'trig_item_id', 'trig_date'], 'integer'], + [['type'], 'in', 'range' => self::getTypesArray()], + [['trig_item_value', 'name', 'trig_time', 'trig_time_wdays'], 'string', 'max' => 255], + [['trig_time', 'trig_time_wdays', 'trig_date'], 'default', 'value' => null], + [['task_ids'], 'each', 'rule' => ['integer']], + ]; + } + + /** + * @inheritdoc + */ + public function behaviors() + { + return [ + [ + 'class' => LinkerBehavior::className(), + 'relations' => [ + 'task_ids' => 'tasks', + ], + ], ]; } @@ -62,7 +79,7 @@ class Event extends ActiveRecord 'trig_time_wdays' => 'Дни срабатывания', 'trig_item_id' => 'Элемент срабатывания', 'trig_item_value' => 'Значение элемента срабатывания', - 'task_id' => 'Задача', + 'task_ids' => 'Задачи', 'name' => 'Имя', ]; } @@ -70,7 +87,7 @@ class Event extends ActiveRecord /** * @return array */ - public static function getStatuses() + public static function getTypes() { return [ self::TYPE_BY_ITEM_VALUE => 'Значение Элемента', @@ -83,26 +100,33 @@ class Event extends ActiveRecord /** * @return array */ - public static function getStatusesArray() + public static function getTypesArray() { - return [ - self::TYPE_BY_ITEM_VALUE, - self::TYPE_BY_USER_ITEM_CHANGE, - self::TYPE_BY_DATE, - self::TYPE_BY_TIME, - ]; + return array_keys(self::getTypes()); + } + + /** + * @return string + */ + public function getTypeLabel() + { + return self::getTypes()[$this->type]; + } + + /** + * @return array + */ + public static function getList() + { + return ArrayHelper::map(self::find()->all(), 'id', 'name'); } /** * @return \yii\db\ActiveQuery */ - public function getTask() + public function getTasks() { - return $this->hasOne(Task::className(), ['id' => 'task_id']); - } - - public static function getList() - { - return ArrayHelper::map(self::find()->all(), 'id', 'name'); + return $this->hasMany(Task::className(), ['id' => 'task_id']) + ->viaTable('trigger_task', ['trigger_id' => 'id']); } } diff --git a/modules/admin/controllers/TaskActionController.php b/modules/admin/controllers/TaskActionController.php deleted file mode 100644 index 8265518..0000000 --- a/modules/admin/controllers/TaskActionController.php +++ /dev/null @@ -1,124 +0,0 @@ - [ - 'class' => VerbFilter::className(), - 'actions' => [ - 'delete' => ['POST'], - ], - ], - ]; - } - - /** - * Lists all TaskAction models. - * @return mixed - */ - public function actionIndex() - { - $searchModel = new TaskActionSearch(); - $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - - return $this->render('index', [ - 'searchModel' => $searchModel, - 'dataProvider' => $dataProvider, - ]); - } - - /** - * Displays a single TaskAction model. - * @param integer $id - * @return mixed - */ - public function actionView($id) - { - return $this->render('view', [ - 'model' => $this->findModel($id), - ]); - } - - /** - * Creates a new TaskAction model. - * If creation is successful, the browser will be redirected to the 'view' page. - * @return mixed - */ - public function actionCreate() - { - $model = new TaskAction(); - - if ($model->load(Yii::$app->request->post()) && $model->save()) { - return $this->redirect(['view', 'id' => $model->id]); - } else { - return $this->render('create', [ - 'model' => $model, - ]); - } - } - - /** - * Updates an existing TaskAction model. - * If update is successful, the browser will be redirected to the 'view' page. - * @param integer $id - * @return mixed - */ - public function actionUpdate($id) - { - $model = $this->findModel($id); - - if ($model->load(Yii::$app->request->post()) && $model->save()) { - return $this->redirect(['view', 'id' => $model->id]); - } else { - return $this->render('update', [ - 'model' => $model, - ]); - } - } - - /** - * Deletes an existing TaskAction 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 TaskAction model based on its primary key value. - * If the model is not found, a 404 HTTP exception will be thrown. - * @param integer $id - * @return TaskAction the loaded model - * @throws NotFoundHttpException if the model cannot be found - */ - protected function findModel($id) - { - if (($model = TaskAction::findOne($id)) !== null) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); - } - } -} diff --git a/modules/admin/controllers/EventController.php b/modules/admin/controllers/TriggerController.php similarity index 80% rename from modules/admin/controllers/EventController.php rename to modules/admin/controllers/TriggerController.php index aaa48b5..d9dde75 100644 --- a/modules/admin/controllers/EventController.php +++ b/modules/admin/controllers/TriggerController.php @@ -3,16 +3,16 @@ namespace app\modules\admin\controllers; use Yii; -use app\models\Event; -use app\modules\admin\models\EventSearch; +use app\models\Trigger; +use app\modules\admin\models\TriggerSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; /** - * EventController implements the CRUD actions for Event model. + * TriggerController implements the CRUD actions for Trigger model. */ -class EventController extends Controller +class TriggerController extends Controller { /** * @inheritdoc @@ -30,12 +30,12 @@ class EventController extends Controller } /** - * Lists all Event models. + * Lists all Trigger models. * @return mixed */ public function actionIndex() { - $searchModel = new EventSearch(); + $searchModel = new TriggerSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ @@ -45,7 +45,7 @@ class EventController extends Controller } /** - * Displays a single Event model. + * Displays a single Trigger model. * @param integer $id * @return mixed */ @@ -57,13 +57,13 @@ class EventController extends Controller } /** - * Creates a new Event model. + * Creates a new Trigger model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { - $model = new Event(); + $model = new Trigger(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); @@ -75,7 +75,7 @@ class EventController extends Controller } /** - * Updates an existing Event model. + * Updates an existing Trigger model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed @@ -94,7 +94,7 @@ class EventController extends Controller } /** - * Deletes an existing Event model. + * Deletes an existing Trigger model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed @@ -107,15 +107,15 @@ class EventController extends Controller } /** - * Finds the Event model based on its primary key value. + * Finds the Trigger model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id - * @return Event the loaded model + * @return Trigger the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { - if (($model = Event::findOne($id)) !== null) { + if (($model = Trigger::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); diff --git a/modules/admin/models/TaskActionSearch.php b/modules/admin/models/TaskActionSearch.php deleted file mode 100644 index 6b1ee51..0000000 --- a/modules/admin/models/TaskActionSearch.php +++ /dev/null @@ -1,72 +0,0 @@ - $query, - ]); - - $this->load($params); - - if (!$this->validate()) { - // uncomment the following line if you do not want to return any records when validation fails - // $query->where('0=1'); - return $dataProvider; - } - - // grid filtering conditions - $query->andFilterWhere([ - 'id' => $this->id, - 'type' => $this->type, - 'item_id' => $this->item_id, - ]); - - $query->andFilterWhere(['like', 'item_value', $this->item_value]) - ->andFilterWhere(['like', 'name', $this->name]); - - return $dataProvider; - } -} diff --git a/modules/admin/models/TaskSearch.php b/modules/admin/models/TaskSearch.php index f0b9967..e1b2fc5 100644 --- a/modules/admin/models/TaskSearch.php +++ b/modules/admin/models/TaskSearch.php @@ -18,8 +18,8 @@ class TaskSearch extends Task public function rules() { return [ - [['id'], 'integer'], - [['name'], 'safe'], + [['id', 'type', 'item_id'], 'integer'], + [['item_value', 'name'], 'safe'], ]; } @@ -60,9 +60,12 @@ class TaskSearch extends Task // grid filtering conditions $query->andFilterWhere([ 'id' => $this->id, + 'type' => $this->type, + 'item_id' => $this->item_id, ]); - $query->andFilterWhere(['like', 'name', $this->name]); + $query->andFilterWhere(['like', 'item_value', $this->item_value]) + ->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; } diff --git a/modules/admin/models/EventSearch.php b/modules/admin/models/TriggerSearch.php similarity index 85% rename from modules/admin/models/EventSearch.php rename to modules/admin/models/TriggerSearch.php index b530874..9ddb216 100644 --- a/modules/admin/models/EventSearch.php +++ b/modules/admin/models/TriggerSearch.php @@ -5,12 +5,12 @@ namespace app\modules\admin\models; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; -use app\models\Event; +use app\models\Trigger; /** - * EventSearch represents the model behind the search form about `app\models\Event`. + * TriggerSearch represents the model behind the search form about `app\models\Trigger`. */ -class EventSearch extends Event +class TriggerSearch extends Trigger { /** * @inheritdoc @@ -18,7 +18,7 @@ class EventSearch extends Event public function rules() { return [ - [['id', 'type', 'trig_item_id', 'task_id'], 'integer'], + [['id', 'type', 'trig_item_id'], 'integer'], [['trig_date', 'trig_time', 'trig_time_wdays', 'trig_item_value', 'name'], 'safe'], ]; } @@ -41,7 +41,7 @@ class EventSearch extends Event */ public function search($params) { - $query = Event::find(); + $query = Trigger::find(); // add conditions that should always apply here @@ -62,7 +62,6 @@ class EventSearch extends Event 'id' => $this->id, 'type' => $this->type, 'trig_item_id' => $this->trig_item_id, - 'task_id' => $this->task_id, ]); $query->andFilterWhere(['like', 'trig_date', $this->trig_date]) diff --git a/modules/admin/views/event/_form.php b/modules/admin/views/event/_form.php deleted file mode 100644 index 2b0367d..0000000 --- a/modules/admin/views/event/_form.php +++ /dev/null @@ -1,53 +0,0 @@ - - -
- - - - field($model, 'type')->dropDownList(Event::getStatuses(), [ - 'prompt' => '-- выберите тип --' - ]) ?> - -
-
- field($model, 'trig_time')->textInput(['maxlength' => true]) ?> -
-
- field($model, 'trig_time_wdays')->textInput(['maxlength' => true]) ?> -
-
- - field($model, 'trig_date')->textInput(['maxlength' => true]) ?> - - field($model, 'trig_item_id')->dropDownList(Item::getList(), [ - 'prompt' => '-- выберите элемент --' - ]) ?> - - field($model, 'trig_item_value')->textInput(['maxlength' => true]) ?> - - field($model, 'task_id')->dropDownList(Task::getList(), [ - 'prompt' => '-- выберите задачу --' - ]) ?> - - field($model, 'name')->textInput(['maxlength' => true]) ?> - -
- isNewRecord ? 'Добавить' : 'Сохранить', - ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/modules/admin/views/event/index.php b/modules/admin/views/event/index.php deleted file mode 100644 index 3a3b742..0000000 --- a/modules/admin/views/event/index.php +++ /dev/null @@ -1,41 +0,0 @@ -title = 'Events'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

- 'btn btn-success']) ?> -

- render('_search', ['model' => $searchModel]); ?> - - - $dataProvider, - 'summaryOptions' => ['class' => 'alert alert-info'], - 'layout' => '{summary}
{items}
{pager}', - 'filterModel' => $searchModel, - 'columns' => [ - 'id', - 'type', - 'trig_date', - 'trig_time', - 'trig_time_wdays', - // 'trig_item_id', - // 'trig_item_value', - // 'task_id', - // 'name', - - ['class' => 'yii\grid\ActionColumn'], - ], - ]); ?> - -
diff --git a/modules/admin/views/task-action/_form.php b/modules/admin/views/task-action/_form.php deleted file mode 100644 index 331a5b6..0000000 --- a/modules/admin/views/task-action/_form.php +++ /dev/null @@ -1,40 +0,0 @@ - - -
- - - - field($model, 'task_id')->dropDownList(Task::getList(), [ - 'prompt' => '-- выберите задачу --', - ]) ?> - - field($model, 'type')->dropDownList(TaskAction::getTypes(), [ - 'prompt' => '-- выберите тип --', - ]) ?> - - field($model, 'item_id')->dropDownList(Item::getList(), [ - 'prompt' => '-- выберите элемент --', - ]) ?> - - field($model, 'item_value')->textInput(['maxlength' => true]) ?> - - field($model, 'name')->textInput(['maxlength' => true]) ?> - -
- isNewRecord ? 'Добавить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/modules/admin/views/task-action/create.php b/modules/admin/views/task-action/create.php deleted file mode 100644 index 9ad6032..0000000 --- a/modules/admin/views/task-action/create.php +++ /dev/null @@ -1,18 +0,0 @@ -title = 'Добавить Task Action'; -$this->params['breadcrumbs'][] = ['label' => 'Task Actions', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/modules/admin/views/task-action/update.php b/modules/admin/views/task-action/update.php deleted file mode 100644 index 9880b3d..0000000 --- a/modules/admin/views/task-action/update.php +++ /dev/null @@ -1,19 +0,0 @@ -title = 'Изменить Task Action: ' . $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Task Actions', 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; -$this->params['breadcrumbs'][] = 'Редактирование'; -?> -
- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/modules/admin/views/task-action/view.php b/modules/admin/views/task-action/view.php deleted file mode 100644 index 9e54856..0000000 --- a/modules/admin/views/task-action/view.php +++ /dev/null @@ -1,37 +0,0 @@ -title = $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Task Actions', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

- $model->id], ['class' => 'btn btn-primary']) ?> - $model->id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'id', - 'type', - 'item_id', - 'item_value', - 'name', - ], - ]) ?> - -
diff --git a/modules/admin/views/task/_form.php b/modules/admin/views/task/_form.php index 5c589a3..e947808 100644 --- a/modules/admin/views/task/_form.php +++ b/modules/admin/views/task/_form.php @@ -4,6 +4,10 @@ /* @var $model app\models\Task */ /* @var $form yii\widgets\ActiveForm */ +use app\models\Item; +use app\models\Task; +use app\models\Trigger; +use kartik\select2\Select2; use yii\helpers\Html; use yii\widgets\ActiveForm; ?> @@ -12,7 +16,41 @@ use yii\widgets\ActiveForm; - field($model, 'name')->textInput(['maxlength' => true]) ?> +
+
+

Основное

+ + field($model, 'name')->textInput(['maxlength' => true]) ?> + + field($model, 'type')->dropDownList(Task::getTypes(), [ + 'prompt' => '--- выберите тип ---' + ]) ?> +
+
+

Выполнить

+ + field($model, 'item_id')->widget(Select2::className(), [ + 'data' => Item::getList(), + 'options' => [ + 'placeholder' => 'Выберите элемент ...', + ], + ]) ?> + + field($model, 'item_value')->textInput(['maxlength' => true]) ?> +
+
+

Активируется через

+ + field($model, 'trigger_ids')->widget(Select2::className(), [ + 'data' => Trigger::getList(), + 'showToggleAll' => false, + 'options' => [ + 'placeholder' => 'Выберите триггеры ...', + 'multiple' => true, + ], + ]) ?> +
+
isNewRecord ? 'Добавить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> diff --git a/modules/admin/views/task/index.php b/modules/admin/views/task/index.php index 14b85bc..98bf274 100644 --- a/modules/admin/views/task/index.php +++ b/modules/admin/views/task/index.php @@ -4,10 +4,12 @@ /* @var $searchModel app\modules\admin\models\TaskSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ +use app\models\Task; use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; -$this->title = 'Tasks'; + +$this->title = 'Задачи'; $this->params['breadcrumbs'][] = $this->title; ?>
@@ -15,7 +17,6 @@ $this->params['breadcrumbs'][] = $this->title;

'btn btn-success']) ?>

- render('_search', ['model' => $searchModel]); ?> params['breadcrumbs'][] = $this->title; 'filterModel' => $searchModel, 'columns' => [ 'id', + [ + 'filter' => Task::getTypes(), + 'attribute' => 'type', + 'value' => function (Task $model) { + return $model->getTypeLabel(); + }, + ], +// 'item_id', +// 'item_value', 'name', - ['class' => 'yii\grid\ActionColumn'], + ['class' => 'app\components\ActionButtonColumn'], ], ]); ?> diff --git a/modules/admin/views/task/view.php b/modules/admin/views/task/view.php index 4e8fb46..960eeb6 100644 --- a/modules/admin/views/task/view.php +++ b/modules/admin/views/task/view.php @@ -27,6 +27,9 @@ $this->params['breadcrumbs'][] = $this->title; 'model' => $model, 'attributes' => [ 'id', + 'type', + 'item_id', + 'item_value', 'name', ], ]) ?> diff --git a/modules/admin/views/trigger/_form.php b/modules/admin/views/trigger/_form.php new file mode 100644 index 0000000..2509f62 --- /dev/null +++ b/modules/admin/views/trigger/_form.php @@ -0,0 +1,96 @@ + + +
+ + + +
+
+

Основное

+ + field($model, 'name')->textInput(['maxlength' => true]) ?> + + field($model, 'type')->dropDownList(Trigger::getTypes(), [ + 'prompt' => '--- выберите тип ---' + ]) ?> +
+
+ +

Условия

+ +
+
+ field($model, 'trig_time')->widget(TimePicker::className(), [ + 'pluginOptions' => [ + 'showMeridian' => false, + 'defaultTime' => false, + ], + ]) ?> +
+
+ field($model, 'trig_time_wdays')->textInput(['maxlength' => true]) ?> +
+
+ + field($model, 'trig_date')->widget(DateControl::className(), [ + 'type' => DateControl::FORMAT_DATETIME, + 'displayTimezone' => Yii::$app->formatter->timeZone, + 'saveFormat' => 'php:U', + 'options' => [ + 'pluginOptions' => [ + 'todayHighlight' => true, + 'todayBtn' => true, + ], + ], + ]) ?> + +
+
+ field($model, 'trig_item_id')->widget(Select2::className(), [ + 'data' => Item::getList(), + 'options' => [ + 'placeholder' => 'Выберите элемент ...', + ], + ]) ?> +
+
+ field($model, 'trig_item_value')->textInput(['maxlength' => true]) ?> +
+
+
+
+

Выполнить

+ + field($model, 'task_ids')->widget(Select2::className(), [ + 'data' => \app\models\Task::getList(), + 'showToggleAll' => false, + 'options' => [ + 'placeholder' => 'Выберите задачи ...', + 'multiple' => true, + ], + ]) ?> +
+
+ +
+ isNewRecord ? 'Добавить' : 'Сохранить', + ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
diff --git a/modules/admin/views/event/create.php b/modules/admin/views/trigger/create.php similarity index 50% rename from modules/admin/views/event/create.php rename to modules/admin/views/trigger/create.php index edf3c1f..f7213d9 100644 --- a/modules/admin/views/event/create.php +++ b/modules/admin/views/trigger/create.php @@ -1,15 +1,15 @@ title = 'Добавить Event'; -$this->params['breadcrumbs'][] = ['label' => 'Events', 'url' => ['index']]; +$this->title = 'Добавить Trigger'; +$this->params['breadcrumbs'][] = ['label' => 'Triggers', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> -
+
render('_form', [ 'model' => $model, diff --git a/modules/admin/views/task-action/index.php b/modules/admin/views/trigger/index.php similarity index 54% rename from modules/admin/views/task-action/index.php rename to modules/admin/views/trigger/index.php index 7750b70..82f60e4 100644 --- a/modules/admin/views/task-action/index.php +++ b/modules/admin/views/trigger/index.php @@ -1,21 +1,22 @@ title = 'Task Actions'; + +$this->title = 'Triggers'; $this->params['breadcrumbs'][] = $this->title; ?> -
+

'btn btn-success']) ?>

- render('_search', ['model' => $searchModel]); ?> params['breadcrumbs'][] = $this->title; 'filterModel' => $searchModel, 'columns' => [ 'id', - 'type', - 'item_id', - 'item_value', 'name', + [ + 'filter' => Trigger::getTypes(), + 'attribute' => 'type', + 'value' => function (Trigger $model) { + return $model->getTypeLabel(); + }, + ], +// 'trig_date', +// 'trig_time', +// 'trig_time_wdays', +// 'trig_item_id', +// 'trig_item_value', - ['class' => 'yii\grid\ActionColumn'], + ['class' => 'app\components\ActionButtonColumn'], ], ]); ?> diff --git a/modules/admin/views/event/update.php b/modules/admin/views/trigger/update.php similarity index 60% rename from modules/admin/views/event/update.php rename to modules/admin/views/trigger/update.php index c23321c..5d3a28a 100644 --- a/modules/admin/views/event/update.php +++ b/modules/admin/views/trigger/update.php @@ -1,16 +1,16 @@ title = 'Изменить Event: ' . $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Events', 'url' => ['index']]; +$this->title = 'Изменить Trigger: ' . $model->name; +$this->params['breadcrumbs'][] = ['label' => 'Triggers', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; $this->params['breadcrumbs'][] = 'Редактирование'; ?> -
+
render('_form', [ 'model' => $model, diff --git a/modules/admin/views/event/view.php b/modules/admin/views/trigger/view.php similarity index 71% rename from modules/admin/views/event/view.php rename to modules/admin/views/trigger/view.php index 5540f47..689541b 100644 --- a/modules/admin/views/event/view.php +++ b/modules/admin/views/trigger/view.php @@ -1,16 +1,16 @@ title = $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Events', 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => 'Triggers', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> -
+

$model->id], ['class' => 'btn btn-primary']) ?> @@ -27,13 +27,15 @@ $this->params['breadcrumbs'][] = $this->title; 'model' => $model, 'attributes' => [ 'id', - 'type', - 'trig_date', - 'trig_time', + [ + 'attribute' => 'type', + 'value' => $model->getTypeLabel(), + ], + 'trig_date:datetime', + 'trig_time:time', 'trig_time_wdays', 'trig_item_id', 'trig_item_value', - 'task_id', 'name', ], ]) ?> diff --git a/scheme.jpg b/scheme.jpg deleted file mode 100644 index 0a660c5d68848624be8afd9aba447051a2f778fa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38089 zcmeFZ2V4}{@;^F=3JQoM1w=*#1j$+Qh)5PkKyp%%EIA2?gCMXVIfx=KO3p~mj0A}i zhn#a5a)x2TYxnN%75DDl-TV80-uu1xE_@n#db&@as#A5U>RWXVeh@ziIL}$(rpCzRxBPAgrrK6-Gr@l-NX1q+#z;K0`oAt^y zP9_EhwwpINdHDnd1;MPMk|O*P+ya99-x?t}bLI>w2`McZ87==+hO7L4`v?CSL_vI_ zi|{ic!8Onc3Iak30(=7q4D|C9!OuUSUw#Nq5S~1Bnuz$!SrXue;`5*r1cZbqP7RsQ5nZ#V=6@Ofk(lXrel3k!_Xe}TV+ZduXD?i&rK4xL z&dPR!T~J8)riiGR%pF-dc?Cr!^#>Z7TG~3g#!pO4&CD$<9i5zAT%WnQ`@Hh?^ZzLz zFd{N4`c2H+cd>~{$tkI6=^2>?g+;|BrDf$6b@dHj8k?G1T6>VaefVTqdF;@A_5!ou6wBr}(tf7wuMy_`A5r!jVgICS z7(_})01O@>1qcG#Im?!a5Ru$S3}gfSXGfY_mc_6u=EcPDh=($J2IO68;_S-HN*n#e zd}yHH9v&3>Y<(@%*w%z20}py>J%UD_tISY>bw3wK=f&+dd}@Gj%^{SKgV4;H0$#8B_}*6*WC`>-cFKi1#6nNKuikTlh2bec0f81;H`6JBU^ZofJOxq?Nbft2|vRfy$^8w*(UlblRpsWFD z4h+u0+>)A4ONH+j?RU;!$3;2t%o~Lso?Fk)k$sZ&%nwq1A;x|uLIJj?m2qk>g%-OP z(g9l}c*2Oi40o|C1y4dsY5WO(n z^;SG+dc@xOv~DY=`SSHbn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T!saa+0xZaN~; zAC4P~0LSozPRndFGC+x8tI5@5H#s$ZtLTHRIQb(>s?lfsRyFruJ=gv3?&l!2K&_p+ z`D!Y_B4IdaM4vEfb`CKO*as0Mz=;fn^j~4_(>Rx7T@wgJu$f~>$ft=j2WpQ1GP|f_ zwi3Q}hWLdq!*JA<{LemChk5L$S%d&|f$_|u5se+hEO;a+Av7OHVheG;axn&>*EJZK z{_+O(+>?b(1{Qpa8bM_1B~T;;RFo=*N?{*_n!rJZvqA6DJPr-R!9LHz#_>=hn}eSN z7Q8)aPEweS$AW!tR@-i>n)Y?X!bXT6_?+=MU%7lhb(<;7MQg;}3DjrUx#TWtYG%-q z)=K5_FHFoB2sW_9(L-$~ecbq25@W6FH%{EA;9Z)fHi_PtiSgaA+P+8D}xZ&4oShYgMhV9Tz?MkFt-v)z)Zq^ zHPgR;1lMw>Z?gP9EQlZD|BYPq?{e4W`~Q7@fMr=O%W_!scheduleEvents(); + $this->scheduleTriggers(); $this->log('Server started'); } @@ -354,7 +355,7 @@ class Panel implements MessageComponentInterface } // Trig event - $this->trigItemValueEvent($item, $value); + $this->triggerItemValue($item, $value); if (in_array($item->type, [ Item::TYPE_SWITCH, @@ -418,7 +419,7 @@ class Panel implements MessageComponentInterface } // Trig event - $this->trigItemValueEvent($item, $value); + $this->triggerItemValue($item, $value); if (in_array($item->type, [ Item::TYPE_SWITCH, @@ -933,10 +934,10 @@ class Panel implements MessageComponentInterface * @param Item $item * @param string $value */ - private function trigItemValueEvent($item, $value) + private function triggerItemValue($item, $value) { // Find event - $event = Event::findOne([ + $event = Trigger::findOne([ 'trig_item_id' => $item->id, 'trig_item_value' => $value, ]); @@ -945,28 +946,29 @@ class Panel implements MessageComponentInterface return; } - $this->trigEvent($event); + $this->trigger($event); } /** - * @param TaskAction $action + * @param Task $task */ - private function doTaskAction($action) + private function doTask($task) { - switch ($action->type) { - case TaskAction::TYPE_CHANGE_ITEM_VALUE: - $item = $action->item; + switch ($task->type) { + case Task::TYPE_ITEM_VALUE: + $item = $task->item; switch ($item->type) { case Item::TYPE_SWITCH: $data = [ - 'type' => $action->item_value == '1' ? 'turnON' : 'turnOFF', + 'type' => $task->item_value == '1' ? 'turnON' : 'turnOFF', 'pin' => $item->pin, ]; break; case Item::TYPE_RGB: - $rgbData = $this->valueToRgbData($action->item_value); + $rgbData = $this->valueToRgbData($task->item_value); + $red = $rgbData[0]; $green = $rgbData[1]; $blue = $rgbData[2]; @@ -984,7 +986,7 @@ class Panel implements MessageComponentInterface default: $data = [ 'type' => 'value', - 'value' => $action->item_value, + 'value' => $task->item_value, 'pin' => $item->pin, ]; @@ -997,171 +999,173 @@ class Panel implements MessageComponentInterface } } + /** + * @param string $value + * @return array + */ private function valueToRgbData($value) { return explode(',', $value); } /** - * @param Event $event + * @param Trigger $trigger */ - private function trigEvent($event) + private function trigger($trigger) { - $this->log("Event [{$event->id}] triggered. Doing the tasks..."); + $this->log("Trigger [{$trigger->id}] triggered. Doing the tasks..."); // Do the tasks - $task = $event->task; - - foreach ($task->taskActions as $action) { - $this->doTaskAction($action); + foreach ($trigger->tasks as $task) { + $this->doTask($task); } - $this->log("Tasks for Event [{$event->id}] done!"); + $this->log("Tasks for Trigger [{$trigger->id}] done!"); } /** - * @param Event $event + * @param Trigger $trigger */ - private function trigDateEvent($event) + private function triggerDate($trigger) { - $this->trigEvent($event); + $this->trigger($trigger); } /** - * @param Event $event + * @param Trigger $trigger */ - private function trigTimeEvent($event) + private function triggerTime($trigger) { - $this->trigEvent($event); + $this->trigger($trigger); - $this->scheduleEvents(); + $this->scheduleTriggers(); } - protected function scheduleEvents() + protected function scheduleTriggers() { - $this->log("Scheduling Events..."); + $this->log("Scheduling Triggers..."); - /** @var Event[] $events */ - $events = Event::find()->where([ + /** @var Trigger[] $triggers */ + $triggers = Trigger::find()->where([ 'type' => [ - Event::TYPE_BY_DATE, - Event::TYPE_BY_TIME, + Trigger::TYPE_BY_DATE, + Trigger::TYPE_BY_TIME, ], ])->all(); - foreach ($events as $event) { - switch ($event->type) { - case Event::TYPE_BY_DATE: - if (isset($this->eventTimers[$event->id])) { - $this->log("Event [{$event->id}] already scheduled"); + foreach ($triggers as $trigger) { + switch ($trigger->type) { + case Trigger::TYPE_BY_DATE: + if (isset($this->eventTimers[$trigger->id])) { + $this->log("Trigger [{$trigger->id}] already scheduled"); break; } - if ($event->trig_date and $event->trig_date > time()) { - $timeout = $event->trig_date - time(); + if ($trigger->trig_date and $trigger->trig_date > time()) { + $timeout = $trigger->trig_date - time(); - $this->log("Scheduling Event [{$event->id}] with timeout $timeout sec."); + $this->log("Scheduling Trigger [{$trigger->id}] with timeout $timeout sec."); - $this->eventTimers[$event->id] = $this->loop->addTimer( + $this->eventTimers[$trigger->id] = $this->loop->addTimer( $timeout, - function () use ($event) { - $this->log("Event [{$event->id}] triggered by date"); + function () use ($trigger) { + $this->log("Trigger [{$trigger->id}] triggered by date"); - if (isset($this->eventTimers[$event->id])) { - unset($this->eventTimers[$event->id]); + if (isset($this->eventTimers[$trigger->id])) { + unset($this->eventTimers[$trigger->id]); } - return $this->trigDateEvent($event); + return $this->triggerDate($trigger); }); } else { - $this->log("Event [{$event->id}] expired by date"); + $this->log("Trigger [{$trigger->id}] expired by date"); } break; - case Event::TYPE_BY_TIME: - if ($event->trig_time_wdays != '') { // Every week events - $this->log("Event [{$event->id}] runs every week"); + case Trigger::TYPE_BY_TIME: + if ($trigger->trig_time_wdays != '') { // Every week triggers + $this->log("Trigger [{$trigger->id}] runs every week"); - $days = explode(',', $event->trig_time_wdays); + $days = explode(',', $trigger->trig_time_wdays); foreach ($days as $day) { - $trigTimestamp = strtotime($day . ', ' . $event->trig_time); + $trigTimestamp = strtotime($day . ', ' . $trigger->trig_time); if (strtolower(date('l')) == $day) { - $trigTimestamp = strtotime('+1 week, ' . $event->trig_time); + $trigTimestamp = strtotime('+1 week, ' . $trigger->trig_time); } - if (isset($this->eventTimers[$event->id][$trigTimestamp])) { - $this->log("Event [{$event->id}] already scheduled by time [$trigTimestamp]"); + if (isset($this->eventTimers[$trigger->id][$trigTimestamp])) { + $this->log("Trigger [{$trigger->id}] already scheduled by time [$trigTimestamp]"); break; } if (time() < $trigTimestamp) { $timeout = $trigTimestamp - time(); - $this->log("Scheduling Event [{$event->id}] with timeout $timeout sec. for timeout [$trigTimestamp]"); + $this->log("Scheduling Trigger [{$trigger->id}] with timeout $timeout sec. for timeout [$trigTimestamp]"); - $this->eventTimers[$event->id][$trigTimestamp] = $this->loop->addTimer( + $this->eventTimers[$trigger->id][$trigTimestamp] = $this->loop->addTimer( $timeout, - function () use ($event, $trigTimestamp) { - $this->log("Event [{$event->id}] triggered by time [$trigTimestamp]"); + function () use ($trigger, $trigTimestamp) { + $this->log("Trigger [{$trigger->id}] triggered by time [$trigTimestamp]"); - if (isset($this->eventTimers[$event->id][$trigTimestamp])) { - unset($this->eventTimers[$event->id][$trigTimestamp]); + if (isset($this->eventTimers[$trigger->id][$trigTimestamp])) { + unset($this->eventTimers[$trigger->id][$trigTimestamp]); } - return $this->trigTimeEvent($event); + return $this->triggerTime($trigger); } ); } else { $this->log("Trigger time $trigTimestamp is lower than current time " . time()); } } - } else { // Everyday events - $this->log("Event [{$event->id}] runs every day"); + } else { // Everyday triggers + $this->log("Trigger [{$trigger->id}] runs every day"); - if (isset($this->eventTimers[$event->id])) { - $this->log("Event [{$event->id}] already scheduled by time"); + if (isset($this->eventTimers[$trigger->id])) { + $this->log("Trigger [{$trigger->id}] already scheduled by time"); break; } - // Schedule event for today - $trigTimestamp = strtotime('today, ' . $event->trig_time); + // Schedule trigger for today + $trigTimestamp = strtotime('today, ' . $trigger->trig_time); if (time() < $trigTimestamp) { $timeout = $trigTimestamp - time(); - $this->log("Scheduling Event [{$event->id}] with timeout $timeout sec."); + $this->log("Scheduling Trigger [{$trigger->id}] with timeout $timeout sec."); - $this->eventTimers[$event->id] = $this->loop->addTimer( + $this->eventTimers[$trigger->id] = $this->loop->addTimer( $timeout, - function () use ($event) { - $this->log("Event [{$event->id}] triggered by time"); + function () use ($trigger) { + $this->log("Trigger [{$trigger->id}] triggered by time"); - if (isset($this->eventTimers[$event->id])) { - unset($this->eventTimers[$event->id]); + if (isset($this->eventTimers[$trigger->id])) { + unset($this->eventTimers[$trigger->id]); } - return $this->trigTimeEvent($event); + return $this->triggerTime($trigger); } ); } else { - $trigTimestamp = strtotime('tomorrow, ' . $event->trig_time); + $trigTimestamp = strtotime('tomorrow, ' . $trigger->trig_time); $timeout = $trigTimestamp - time(); - $this->log("Event [{$event->id}] expired by time. Scheduling for the next day ($timeout sec.)..."); + $this->log("Trigger [{$trigger->id}] expired by time. Scheduling for the next day ($timeout sec.)..."); - $this->eventTimers[$event->id] = $this->loop->addTimer( + $this->eventTimers[$trigger->id] = $this->loop->addTimer( $timeout, - function () use ($event) { - $this->log("Event [{$event->id}] triggered by time"); + function () use ($trigger) { + $this->log("Trigger [{$trigger->id}] triggered by time"); - if (isset($this->eventTimers[$event->id])) { - unset($this->eventTimers[$event->id]); + if (isset($this->eventTimers[$trigger->id])) { + unset($this->eventTimers[$trigger->id]); } - return $this->trigTimeEvent($event); + return $this->triggerTime($trigger); } ); } diff --git a/smarthome.sql b/smarthome.sql deleted file mode 100644 index 69b080b..0000000 --- a/smarthome.sql +++ /dev/null @@ -1,125 +0,0 @@ --- phpMyAdmin SQL Dump --- version 4.4.15.5 --- http://www.phpmyadmin.net --- --- Хост: 127.0.0.1:3306 --- Время создания: Авг 15 2016 г., 01:06 --- Версия сервера: 5.6.29 --- Версия PHP: 7.0.4 - -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8mb4 */; - --- --- База данных: `smarthome` --- - --- -------------------------------------------------------- - --- --- Структура таблицы `history` --- - -CREATE TABLE IF NOT EXISTS `history` ( - `id` int(11) NOT NULL, - `item_id` int(11) NOT NULL, - `commited_at` int(11) NOT NULL, - `value` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- Структура таблицы `item` --- - -CREATE TABLE IF NOT EXISTS `item` ( - `id` int(11) NOT NULL, - `type` int(11) NOT NULL, - `update_interval` int(11) NOT NULL, - `save_history_interval` int(11) DEFAULT '0', - `room_id` int(11) DEFAULT NULL, - `url` varchar(255) NOT NULL, - `name` varchar(255) NOT NULL, - `sort_order` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- - --- --- Структура таблицы `room` --- - -CREATE TABLE IF NOT EXISTS `room` ( - `id` int(11) NOT NULL, - `name` varchar(255) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Индексы сохранённых таблиц --- - --- --- Индексы таблицы `history` --- -ALTER TABLE `history` - ADD PRIMARY KEY (`id`), - ADD KEY `item_id` (`item_id`); - --- --- Индексы таблицы `item` --- -ALTER TABLE `item` - ADD PRIMARY KEY (`id`), - ADD KEY `group_id` (`room_id`); - --- --- Индексы таблицы `room` --- -ALTER TABLE `room` - ADD PRIMARY KEY (`id`); - --- --- AUTO_INCREMENT для сохранённых таблиц --- - --- --- AUTO_INCREMENT для таблицы `history` --- -ALTER TABLE `history` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT для таблицы `item` --- -ALTER TABLE `item` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- AUTO_INCREMENT для таблицы `room` --- -ALTER TABLE `room` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; --- --- Ограничения внешнего ключа сохраненных таблиц --- - --- --- Ограничения внешнего ключа таблицы `history` --- -ALTER TABLE `history` - ADD CONSTRAINT `history_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `item` (`id`) ON DELETE CASCADE; - --- --- Ограничения внешнего ключа таблицы `item` --- -ALTER TABLE `item` - ADD CONSTRAINT `item_ibfk_1` FOREIGN KEY (`room_id`) REFERENCES `room` (`id`) ON DELETE CASCADE; - -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/views/layouts/_left.php b/views/layouts/_left.php index 5072cea..5f06c9b 100644 --- a/views/layouts/_left.php +++ b/views/layouts/_left.php @@ -27,13 +27,10 @@ ['label' => 'Настройки', 'options' => ['class' => 'header']], ['label' => 'Элементы', 'icon' => 'fa fa-cubes', 'url' => ['/admin/item/index']], ['label' => 'Платы', 'icon' => 'fa fa-cogs', 'url' => ['/admin/board/index']], - ['label' => 'Events', 'icon' => 'fa fa-cogs', 'items' => [ - ['label' => 'События', 'icon' => 'fa fa-cubes', 'url' => ['/admin/event/index']], - ['label' => 'Задачи', 'icon' => 'fa fa-cubes', 'url' => ['/admin/task/index']], - ['label' => 'Действия', 'icon' => 'fa fa-cubes', 'url' => ['/admin/task-action/index']], - ]], + ['label' => 'Triggers', 'icon' => 'fa fa-feed', 'url' => ['/admin/trigger/index']], + ['label' => 'Задачи', 'icon' => 'fa fa-check', 'url' => ['/admin/task/index']], ['label' => 'Комнаты', 'icon' => 'fa fa-folder-open', 'url' => ['/admin/room/index']], - ['label' => 'История', 'icon' => 'fa fa-bar-chart', 'url' => ['/admin/history/index']], +// ['label' => 'История', 'icon' => 'fa fa-bar-chart', 'url' => ['/admin/history/index']], ['label' => 'Пользователи', 'icon' => 'fa fa-users', 'url' => ['/admin/user/index']], ['label' => 'Yii2', 'options' => ['class' => 'header'], 'visible' => YII_DEBUG], diff --git a/web/css/site.css b/web/css/site.css index adaa987..1cf2c4f 100644 --- a/web/css/site.css +++ b/web/css/site.css @@ -141,8 +141,8 @@ position: absolute; top: 50px; display: block; - width: 20px; - height: 20px; + width: 30px; + height: 30px; background: #605ca8; border-radius: 50%; } @@ -185,3 +185,7 @@ transform: translateY(-25px); } } + +.select2-container--krajee .select2-selection--single { + line-height: 2; +}