Skip to content

Commit

Permalink
Update dependencies, README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-wdmg committed Jul 1, 2020
1 parent 3c8789a commit fac3e4e
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 41 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

## 1.1.9 (2020-07-01)
* Update dependencies, README.md
* Fixed error determining loading of common modules
* Rebased to base ActiveRecord model

## 1.1.8 (2020-03-27)
* Added pagination
* Up to date dependencies
Expand All @@ -18,7 +23,7 @@ Changelog
* Module refactoring

## 1.1.3 (2019-06-05)
* Module transferred to base module interface. Update Yii2 version.
* Module transferred to base module interface. Update Yii2 version

## 1.1.2 (2019-06-01)
* Bugfix, routing and refactoring
Expand Down
4 changes: 2 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Yii2 Tickets
*
* @category Module
* @version 1.1.8
* @version 1.1.9
* @author Alexsander Vyshnyvetskyy <[email protected]>
* @link https://github.com/wdmg/yii2-tickets
* @copyright Copyright (c) 2019 - 2020 W.D.M.Group, Ukraine
Expand Down Expand Up @@ -45,7 +45,7 @@ class Module extends BaseModule
/**
* @var string the module version
*/
private $version = "1.1.8";
private $version = "1.1.9";

/**
* @var integer, priority of initialization
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
[![Yii2](https://img.shields.io/badge/required-Yii2_v2.0.33-blue.svg)](https://packagist.org/packages/yiisoft/yii2)
[![Yii2](https://img.shields.io/badge/required-Yii2_v2.0.35-blue.svg)](https://packagist.org/packages/yiisoft/yii2)
[![Downloads](https://img.shields.io/packagist/dt/wdmg/yii2-tickets.svg)](https://packagist.org/packages/wdmg/yii2-tickets)
[![Packagist Version](https://img.shields.io/packagist/v/wdmg/yii2-tickets.svg)](https://packagist.org/packages/wdmg/yii2-tickets)
![Progress](https://img.shields.io/badge/progress-in_development-red.svg)
![Progress](https://img.shields.io/badge/progress-ready_to_use-green.svg)
[![GitHub license](https://img.shields.io/github/license/wdmg/yii2-tickets.svg)](https://github.com/wdmg/yii2-tickets/blob/master/LICENSE)

<img src="./docs/images/yii2-tickets.png" width="100%" alt="Yii2 Tickets Module" />

# Yii2 Tickets Module
Ticket system for Yii2
Ticket system for Yii2.

This module is an integral part of the [Butterfly.СMS](https://butterflycms.com/) content management system, but can also be used as an standalone extension.

Copyrights (c) 2019-2020 [W.D.M.Group, Ukraine](https://wdmg.com.ua/)

# Requirements
* PHP 5.6 or higher
* Yii2 v.2.0.33 and newest
* Yii2 v.2.0.35 and newest
* [Yii2 Base](https://github.com/wdmg/yii2-base) module (required)
* [Yii2 Editor](https://github.com/wdmg/yii2-editor) module
* [Yii2 Tasks](https://github.com/wdmg/yii2-tasks) module (optionaly)
Expand Down Expand Up @@ -60,7 +66,8 @@ Use the `Module::dashboardNavItems()` method of the module to generate a navigat
?>


# Status and version [in progress development]
# Status and version [ready to use]
* v.1.1.9 - Update dependencies, README.md
* v.1.1.8 - Added pagination, up to date dependencies
* v.1.1.7 - Fixed deprecated class declaration
* v.1.1.6 - Added extra options to composer.json and navbar menu icon
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["yii2", "yii2-tickets", "ticket system", "wdmg"],
"type": "yii2-extension",
"license": "MIT",
"version": "1.1.8",
"version": "1.1.9",
"homepage": "https://github.com/wdmg/yii2-tickets",
"support": {
"source": "https://github.com/wdmg/yii2-tickets",
Expand All @@ -21,8 +21,8 @@
}
],
"require": {
"yiisoft/yii2": "^2.0.33",
"wdmg/yii2-base": "^1.2.0",
"yiisoft/yii2": "^2.0.35",
"wdmg/yii2-base": "^1.2.4",
"wdmg/yii2-editor": "^1.0.10",
"wdmg/yii2-helpers": "^1.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion controllers/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function beforeAction($action)
);
$session['viewed-flash'] = array_merge(array_unique($viewed), ['tickets-need-modules']);
}

parent::setViewPath('@vendor/wdmg/yii2-tickets/views/tickets');
return parent::beforeAction($action);
}
Expand Down
Binary file added docs/images/yii2-tickets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion messages/ru-RU/app/modules/tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

'Open' => 'Открыт',
'Waiting' => 'Ожидание',
'In Work' => 'В работе',
'In work' => 'В работе',
'Closed' => 'Закрыт',

'Label' => 'Метка',
Expand All @@ -52,6 +52,8 @@
'Skipped' => 'Пропуск',
'Wontfix' => 'Не исправить',

'Change ticket status on' => 'Изменить статус тикета на',

'View ticket: {name}' => 'Просмотр тикета: {name}',
'Update ticket: {name}' => 'Редактирование тикета: {name}',

Expand Down
8 changes: 4 additions & 4 deletions models/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function init()
$this->_module = parent::getModule(true);
}

/**
/**
* {@inheritdoc}
*/
public function behaviors()
Expand Down Expand Up @@ -198,11 +198,11 @@ public function getUser($user_id = null)
* Return all ticket status
* @return array
*/
public static function getAllStatus()
public static function getAllStatusesList()
{
return [
self::TK_STATUS_OPEN => Yii::t('app/modules/tickets', 'Open'),
self::TK_STATUS_WATING => Yii::t('app/modules/tickets', 'Wating'),
self::TK_STATUS_WATING => Yii::t('app/modules/tickets', 'Waiting'),
self::TK_STATUS_INWORK => Yii::t('app/modules/tickets', 'In work'),
self::TK_STATUS_CLOSED => Yii::t('app/modules/tickets', 'Closed')
];
Expand All @@ -212,7 +212,7 @@ public static function getAllStatus()
* Return all ticket labels
* @return array
*/
public static function getAllLabels()
public static function getAllLabelsList()
{
return [
self::TK_LABEL_UNLABELED => Yii::t('app/modules/tickets', 'Unlabeled'),
Expand Down
9 changes: 9 additions & 0 deletions models/TicketsMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ public static function tableName()
return '{{%tickets_messages}}';
}

/**
* {@inheritdoc}
*/
public function init()
{
parent::init();
$this->_module = parent::getModule(true);
}

/**
* {@inheritdoc}
*/
Expand Down
19 changes: 16 additions & 3 deletions views/tickets/_form.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use wdmg\widgets\SelectInput;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use wdmg\widgets\Editor;
Expand Down Expand Up @@ -30,9 +31,21 @@

<?= $form->field($model, 'access_token')->textInput(['readonly' => true]) ?>

<?= $form->field($model, 'label')->dropDownList($model::getAllLabels()); ?>

<?= $form->field($model, 'status')->dropDownList($model::getAllStatus()); ?>
<?= $form->field($model, 'label')->widget(SelectInput::class, [
'items' => $model->getAllLabelsList(),
'options' => [
'id' => 'ticket-form-label',
'class' => 'form-control'
]
]); ?>

<?= $form->field($model, 'status')->widget(SelectInput::class, [
'items' => $model->getAllStatusesList(),
'options' => [
'id' => 'ticket-form-status',
'class' => 'form-control'
]
]); ?>

<hr/>
<div class="form-group">
Expand Down
16 changes: 8 additions & 8 deletions views/tickets/all.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
],
[
'attribute' => 'user_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'User'),
'value' => function($model) {
if($model->user_id == $model->user['id'])
if($model->user['id'] && $model->user['username'])
return Html::a($model->user['username'], ['../admin/users/view/?id='.$model->user['id']], [
return Html::a($model->user['username'], ['../users/users/view', 'id' => $model->user['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -52,12 +52,12 @@
],
[
'attribute' => 'assigned_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Assigned user'),
'value' => function($model) {
if($model->assigned_id == $model->assigned['id'])
if($model->assigned['id'] && $model->assigned['username'])
return Html::a($model->assigned['username'], ['../admin/users/view/?id='.$model->assigned['id']], [
return Html::a($model->assigned['username'], ['../users/users/view', 'id' => $model->assigned['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -69,12 +69,12 @@
],
[
'attribute' => 'task_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Task'),
'value' => function($model) {
if($model->task_id == $model->task['id'])
if($model->task['id'] && $model->task['title'])
return Html::a($model->task['title'], ['../admin/tasks/item/view/?id='.$model->task['id']], [
return Html::a($model->task['title'], ['../tasks/item/view', 'id' => $model->task['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -86,12 +86,12 @@
],
[
'attribute' => 'subunit_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Subunit'),
'value' => function($model) {
if($model->subunit_id == $model->subunit['id'])
if($model->subunit['id'] && $model->subunit['title'])
return Html::a($model->subunit['title'], ['../admin/tasks/subunits/view/?id='.$model->subunit['id']], [
return Html::a($model->subunit['title'], ['../tasks/subunits/view', 'id' => $model->subunit['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand Down
12 changes: 6 additions & 6 deletions views/tickets/current.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
'message:ntext',
[
'attribute' => 'user_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Assigned user'),
'value' => function($model) {
if($model->user_id == $model->user['id'])
if($model->user['id'] && $model->user['username'])
return Html::a($model->user['username'], ['../admin/users/view/?id='.$model->user['id']], [
return Html::a($model->user['username'], ['../users/users/view', 'id' => $model->user['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -47,12 +47,12 @@
],
[
'attribute' => 'task_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Task'),
'value' => function($model) {
if($model->task_id == $model->task['id'])
if($model->task['id'] && $model->task['title'])
return Html::a($model->task['title'], ['../admin/tasks/item/view/?id='.$model->task['id']], [
return Html::a($model->task['title'], ['../tasks/item/view', 'id' => $model->task['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -64,12 +64,12 @@
],
[
'attribute' => 'subunit_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Subunit'),
'value' => function($model) {
if($model->subunit_id == $model->subunit['id'])
if($model->subunit['id'] && $model->subunit['title'])
return Html::a($model->subunit['title'], ['../admin/tasks/subunits/view/?id='.$model->subunit['id']], [
return Html::a($model->subunit['title'], ['../tasks/subunits/view', 'id' => $model->subunit['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand Down
12 changes: 6 additions & 6 deletions views/tickets/my.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
],
[
'attribute' => 'user_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'User'),
'value' => function($model) {
if($model->user_id == $model->user['id'])
if($model->user['id'] && $model->user['username'])
return Html::a($model->user['username'], ['../admin/users/view/?id='.$model->user['id']], [
return Html::a($model->user['username'], ['../users/users/view', 'id' => $model->user['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -53,12 +53,12 @@
],
[
'attribute' => 'task_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Task'),
'value' => function($model) {
if($model->task_id == $model->task['id'])
if($model->task['id'] && $model->task['title'])
return Html::a($model->task['title'], ['../admin/tasks/item/view/?id='.$model->task['id']], [
return Html::a($model->task['title'], ['../tasks/item/view', 'id' => $model->task['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand All @@ -70,12 +70,12 @@
],
[
'attribute' => 'subunit_id',
'format' => 'html',
'format' => 'raw',
'header' => Yii::t('app/modules/tickets', 'Subunit'),
'value' => function($model) {
if($model->subunit_id == $model->subunit['id'])
if($model->subunit['id'] && $model->subunit['title'])
return Html::a($model->subunit['title'], ['../admin/tasks/subunits/view/?id='.$model->subunit['id']], [
return Html::a($model->subunit['title'], ['../tasks/subunits/view', 'id' => $model->subunit['id']], [
'target' => '_blank',
'data-pjax' => 0
]);
Expand Down
2 changes: 1 addition & 1 deletion views/tickets/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<hr/>
<?php if ($model->status !== $model::TK_STATUS_CLOSED) : ?>
<div class="form-group">
<label><?= Yii::t('app/modules/tickets', 'Change task status on') ?>: </label>
<label><?= Yii::t('app/modules/tickets', 'Change ticket status on') ?>: </label>
<?php

if($model->status !== $model::TK_STATUS_OPEN)
Expand Down

0 comments on commit fac3e4e

Please sign in to comment.