Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
613e8694
Commit
613e8694
authored
Mar 09, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1044 - Натянуть верстку
parent
a197b57c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
61 deletions
+55
-61
common/modules/support/controllers/SupportController.php
common/modules/support/controllers/SupportController.php
+9
-10
common/modules/support/views/support/_loop.php
common/modules/support/views/support/_loop.php
+13
-13
common/modules/support/views/support/index.php
common/modules/support/views/support/index.php
+4
-4
common/modules/users/controllers/UserAdminController.php
common/modules/users/controllers/UserAdminController.php
+1
-1
common/modules/users/forms/UserForm.php
common/modules/users/forms/UserForm.php
+4
-11
common/modules/users/models/User.php
common/modules/users/models/User.php
+2
-13
composer.json
composer.json
+2
-9
console/migrations/m160304_091243_fix_user_table.php
console/migrations/m160304_091243_fix_user_table.php
+20
-0
No files found.
common/modules/support/controllers/SupportController.php
View file @
613e8694
...
@@ -7,6 +7,7 @@ use yii\filters\AccessControl;
...
@@ -7,6 +7,7 @@ use yii\filters\AccessControl;
use
yii\web\Controller
;
use
yii\web\Controller
;
use
yii\web\NotFoundHttpException
;
use
yii\web\NotFoundHttpException
;
use
common\models\Settings
;
use
common\modules\support\models\redmine\Issue
;
use
common\modules\support\models\redmine\Issue
;
use
common\modules\support\models\redmine\IssueSearch
;
use
common\modules\support\models\redmine\IssueSearch
;
...
@@ -46,20 +47,18 @@ class SupportController extends Controller
...
@@ -46,20 +47,18 @@ class SupportController extends Controller
public
function
actionIndex
()
public
function
actionIndex
()
{
{
$
s
=
Yii
::
$app
->
request
->
get
(
's'
);
$
client
=
new
\Redmine\Client
(
'http://help-russia.ru'
,
Yii
::
$app
->
support
->
identity
->
redmine_key
);
$works
=
Issue
::
find
()
->
me
()
->
search
(
$s
)
->
work
()
->
all
();
$works
=
$client
->
issue
->
all
([
$ratings
=
Issue
::
find
()
->
me
()
->
search
(
$s
)
->
rating
()
->
all
();
'author_id'
=>
23
$tests
=
Issue
::
find
()
->
me
()
->
search
(
$s
)
->
test
()
->
all
();
]);
$approves
=
Issue
::
find
()
->
me
()
->
search
(
$s
)
->
approve
()
->
all
();
$accepteds
=
Issue
::
find
()
->
me
()
->
search
(
$s
)
->
accepted
()
->
all
();
return
$this
->
render
(
'index'
,
[
return
$this
->
render
(
'index'
,
[
'works'
=>
$works
,
'works'
=>
$works
,
'ratings'
=>
$ratings
,
//
'ratings' => $ratings,
'tests'
=>
$tests
,
//
'tests' => $tests,
'approves'
=>
$approves
,
//
'approves' => $approves,
'accepteds'
=>
$accepteds
,
//
'accepteds' => $accepteds,
]);
]);
}
}
...
...
common/modules/support/views/support/_loop.php
View file @
613e8694
...
@@ -4,7 +4,8 @@ use yii\helpers\Html;
...
@@ -4,7 +4,8 @@ use yii\helpers\Html;
?>
?>
<?php
if
(
$models
)
:
?>
<?php
if
(
$output
[
'issues'
])
:
?>
<div
class=
"panel-group panel-group-2"
id=
"accordion_2"
>
<div
class=
"panel-group panel-group-2"
id=
"accordion_2"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading table-responsive"
>
<div
class=
"panel-heading table-responsive"
>
...
@@ -34,7 +35,7 @@ use yii\helpers\Html;
...
@@ -34,7 +35,7 @@ use yii\helpers\Html;
</div>
</div>
<div
id=
"collapse_1"
class=
"panel-collapse collapse in"
>
<div
id=
"collapse_1"
class=
"panel-collapse collapse in"
>
<?php
foreach
(
$
models
as
$model
)
:
?>
<?php
foreach
(
$
output
[
'issues'
]
as
$model
)
:
?>
<div
class=
"panel-body panel-body-ex-1 color_on_cursor gray_box_2"
>
<div
class=
"panel-body panel-body-ex-1 color_on_cursor gray_box_2"
>
<table
class=
"w100pr"
>
<table
class=
"w100pr"
>
<tbody>
<tbody>
...
@@ -44,25 +45,24 @@ use yii\helpers\Html;
...
@@ -44,25 +45,24 @@ use yii\helpers\Html;
<a href=""><span class="caret caret_top"></span></a>
<a href=""><span class="caret caret_top"></span></a>
<a href=""><span class="caret"></span></a>
<a href=""><span class="caret"></span></a>
</div> -->
</div> -->
<span>
<?=
$model
->
id
?>
</span>
<span>
<?=
$model
[
'id'
]
?>
</span>
</td>
</td>
<td
class=
"box_td_cont"
>
<td
class=
"box_td_cont"
>
<p><strong>
<?=
Html
::
a
(
$model
->
subject
,
[
'/support/view/'
.
$model
->
id
])
?>
</strong></p>
<p><strong>
<?=
Html
::
a
(
$model
[
'subject'
],
[
'/support/view/'
.
$model
[
'id'
]
])
?>
</strong></p>
</td>
</td>
<td
class=
"box_td"
>
<td
class=
"box_td"
>
<span>
<?=
date
(
'd.m.Y'
,
strtotime
(
$model
->
created_on
))
?>
</span>
<span>
<?=
date
(
'd.m.Y'
,
strtotime
(
$model
[
'created_on'
]
))
?>
</span>
</td>
</td>
<td
class=
"box_td"
>
<td
class=
"box_td"
>
<span>
<?=
(
$model
->
due_date
?
date
(
'd.m.Y'
,
strtotime
(
$model
->
due_date
))
:
''
)
?>
</span>
<span>
<?=
(
$model
->
due_date
?
date
(
'd.m.Y'
,
strtotime
(
$model
[
'due_date'
]
))
:
''
)
?>
</span>
</td>
</td>
<td
class=
"box_td"
>
<td
class=
"box_td"
>
<p
class=
"pull-left"
><strong>
<?=
Yii
::
$app
->
formatter
->
asCurrency
(
$model
->
price_for_customer
,
'RUR'
,
[],
[
\NumberFormatter
::
CURRENCY_SYMBOL
=>
'₽'
])
?>
</strong></p>
<p
class=
"pull-left"
><strong>
<?=
Yii
::
$app
->
formatter
->
asCurrency
(
$model
[
'price_for_customer'
]
,
'RUR'
,
[],
[
\NumberFormatter
::
CURRENCY_SYMBOL
=>
'₽'
])
?>
</strong></p>
<?php
if
(
$model
->
paid
)
:
?>
<div
class=
"tooltip_wr pull-right"
>
<!--
<div class="tooltip_wr pull-right">
<div class="tooltip_box">Счет был выставлен</div>
<div class="tooltip_box">Счет был выставлен</div>
<span class="tooltip_cont"><img src="/images/score_icon.jpg" height="24" width="19" alt=""></span>
<span class="tooltip_cont"><img src="/images/score_icon.jpg" height="24" width="19" alt=""></span>
</div>
</div> -->
<?php
endif
;
?>
</td>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
...
common/modules/support/views/support/index.php
View file @
613e8694
...
@@ -61,13 +61,13 @@ use yii\widgets\ActiveForm;
...
@@ -61,13 +61,13 @@ use yii\widgets\ActiveForm;
<tr>
<tr>
<td
class=
"no_pad"
>
<td
class=
"no_pad"
>
<?=
$this
->
render
(
'_loop'
,
[
'
models
'
=>
$ratings
,
'title'
=>
'Задачи на оценке'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
output
'
=>
$ratings
,
'title'
=>
'Задачи на оценке'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
models
'
=>
$works
,
'title'
=>
'Задачи в работе'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
output
'
=>
$works
,
'title'
=>
'Задачи в работе'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
models
'
=>
$tests
,
'title'
=>
'Задачи на тестировании'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
output
'
=>
$tests
,
'title'
=>
'Задачи на тестировании'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
models
'
=>
$approves
,
'title'
=>
'Задачи ожидающие проверки'
]);
?>
<?=
$this
->
render
(
'_loop'
,
[
'
output
'
=>
$approves
,
'title'
=>
'Задачи ожидающие проверки'
]);
?>
</td>
</td>
</tr>
</tr>
...
...
common/modules/users/controllers/UserAdminController.php
View file @
613e8694
...
@@ -221,10 +221,10 @@ class UserAdminController extends \common\components\AdminController
...
@@ -221,10 +221,10 @@ class UserAdminController extends \common\components\AdminController
public
function
actionUpdate
(
$id
)
public
function
actionUpdate
(
$id
)
{
{
$model
=
$this
->
loadModel
(
$id
);
$model
=
$this
->
loadModel
(
$id
);
$old_password
=
$model
->
password
;
$model
->
password_c
=
$model
->
password
=
null
;
$model
->
password_c
=
$model
->
password
=
null
;
$model
->
scenario
=
User
::
SCENARIO_UPDATE
;
$model
->
scenario
=
User
::
SCENARIO_UPDATE
;
$old_password
=
$model
->
password
;
\yii
::
$app
->
controller
->
page_title
=
'Редактирование пользователя <small>'
.
$model
->
name
.
'</small>'
;
\yii
::
$app
->
controller
->
page_title
=
'Редактирование пользователя <small>'
.
$model
->
name
.
'</small>'
;
\yii
::
$app
->
controller
->
tabs
=
[
\yii
::
$app
->
controller
->
tabs
=
[
...
...
common/modules/users/forms/UserForm.php
View file @
613e8694
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
use
\yii\helpers\ArrayHelper
;
use
\yii\helpers\ArrayHelper
;
use
common\modules\users\models\User
;
use
common\modules\users\models\User
;
use
common\modules\support\models\redmine\User
as
RedmineUser
;
$js
=
<<<JS
$js
=
<<<JS
visibleSupport();
visibleSupport();
...
@@ -14,21 +13,16 @@ $js = <<<JS
...
@@ -14,21 +13,16 @@ $js = <<<JS
{
{
if($('#user-role').val() == 'support')
if($('#user-role').val() == 'support')
{
{
$('#user-
support_id
').closest('.form-group').show();
$('#user-
redmine_key
').closest('.form-group').show();
}
}
else
else
{
{
$('#user-
support_id
').closest('.form-group').hide();
$('#user-
redmine_key
').closest('.form-group').hide();
}
}
}
}
JS;
JS;
\Yii
::
$app
->
view
->
registerJs
(
$js
,
\yii\web\View
::
POS_READY
,
'SupportID'
);
\Yii
::
$app
->
view
->
registerJs
(
$js
,
\yii\web\View
::
POS_READY
,
'SupportID'
);
$redmineUsers
=
RedmineUser
::
find
()
->
select
([
'*'
,
"CONCAT(login, ' (', firstname, ' ', lastname, ')') AS specialName"
])
->
where
([
'type'
=>
RedmineUser
::
TYPE_USER
])
->
all
();
return
[
return
[
'activeForm'
=>
[
'activeForm'
=>
[
'id'
=>
'user-form'
,
'id'
=>
'user-form'
,
...
@@ -55,9 +49,8 @@ return [
...
@@ -55,9 +49,8 @@ return [
'items'
=>
User
::
$role_list
,
'items'
=>
User
::
$role_list
,
'class'
=>
'form-control'
,
'class'
=>
'form-control'
,
],
],
'support_id'
=>
[
'redmine_key'
=>
[
'type'
=>
'dropdownlist'
,
'type'
=>
'text'
,
'items'
=>
ArrayHelper
::
map
(
$redmineUsers
,
'id'
,
'specialName'
),
'class'
=>
'form-control'
,
'class'
=>
'form-control'
,
],
],
'password'
=>
[
'type'
=>
'password'
,
'class'
=>
'form-control'
,
'pwd-id'
=>
'passwordStrengthDiv'
],
'password'
=>
[
'type'
=>
'password'
,
'class'
=>
'form-control'
,
'pwd-id'
=>
'passwordStrengthDiv'
],
...
...
common/modules/users/models/User.php
View file @
613e8694
...
@@ -113,7 +113,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -113,7 +113,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
$attrs
=
array_merge
(
parent
::
attributeLabels
(),
array
(
$attrs
=
array_merge
(
parent
::
attributeLabels
(),
array
(
"password_c"
=>
"Пароль еще раз"
,
"password_c"
=>
"Пароль еще раз"
,
"fio"
=>
"Фамилия имя отчество"
,
"fio"
=>
"Фамилия имя отчество"
,
'
support_id'
=>
'Пользователь из
Redmine'
,
'
redmine_key'
=>
'API Key
Redmine'
,
"name"
=>
"Имя"
,
"name"
=>
"Имя"
,
"surname"
=>
"Фамилия"
,
"surname"
=>
"Фамилия"
,
"remember_me"
=>
"Запомни меня"
,
"remember_me"
=>
"Запомни меня"
,
...
@@ -144,7 +144,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -144,7 +144,7 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
self
::
SCENARIO_SEND_NEW_PASSWORD
,
self
::
SCENARIO_SEND_NEW_PASSWORD
,
self
::
SCENARIO_RECOVER_PASSWORD
self
::
SCENARIO_RECOVER_PASSWORD
],
'message'
=>
'Пожалуйста, укажите корректный e-mail адрес'
],
],
'message'
=>
'Пожалуйста, укажите корректный e-mail адрес'
],
[[
'send_email'
,
'
support_id
'
],
'safe'
],
[[
'send_email'
,
'
redmine_key
'
],
'safe'
],
[[
'fio'
,
'name'
,
'surname'
],
'safe'
,
'on'
=>
[
[[
'fio'
,
'name'
,
'surname'
],
'safe'
,
'on'
=>
[
self
::
SCENARIO_CREATE
,
self
::
SCENARIO_CREATE
,
],
'message'
=>
'Пожалуйста, укажите Ваше имя'
],
],
'message'
=>
'Пожалуйста, укажите Ваше имя'
],
...
@@ -496,17 +496,6 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
...
@@ -496,17 +496,6 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
return
$url
;
return
$url
;
}
}
public
function
beforeSave
(
$insert
){
if
(
strtolower
(
$this
->
scenario
)
==
'update'
){
if
(
isset
(
$this
->
password
)
&&
empty
(
$this
->
password
))
unset
(
$this
->
password
);
}
return
parent
::
beforeSave
(
$insert
);
}
public
function
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
)
{
public
function
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
)
{
if
(
!
parent
::
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
))
if
(
!
parent
::
validate
(
$attributeNames
=
null
,
$clearErrors
=
true
))
return
false
;
return
false
;
...
...
composer.json
View file @
613e8694
...
@@ -22,22 +22,15 @@
...
@@ -22,22 +22,15 @@
"
lagman/yii2-eav
"
:
"
*
"
,
"
lagman/yii2-eav
"
:
"
*
"
,
"
himiklab/yii2-sortable-grid-view-widget
"
:
"
*
"
,
"
himiklab/yii2-sortable-grid-view-widget
"
:
"
*
"
,
"
c006/yii2-migration-utility
"
:
"
dev-master
"
,
"
c006/yii2-migration-utility
"
:
"
dev-master
"
,
"
league/csv
"
:
"
~7.0@dev
"
,
"
jwage/easy-csv
"
:
"
~1.0@dev
"
,
"
2amigos/yii2-date-picker-widget
"
:
"
~1.0
"
,
"
2amigos/yii2-date-picker-widget
"
:
"
~1.0
"
,
"
kartik-v/dependent-dropdown
"
:
"
dev-master
"
,
"
kartik-v/dependent-dropdown
"
:
"
dev-master
"
,
"
phpoffice/phpword
"
:
"
dev-master
"
,
"
phpoffice/phpexcel
"
:
"
dev-master
"
,
"
mpdf/mpdf
"
:
"
dev-master
"
,
"
dompdf/dompdf
"
:
"
dev-master
"
,
"
tecnick.com/tcpdf
"
:
"
dev-master
"
,
"
mikehaertl/phpwkhtmltopdf
"
:
"
^2.0@dev
"
,
"mirocow/yii2-minify-view"
:
"*"
,
"mirocow/yii2-minify-view"
:
"*"
,
"
kartik-v/yii2-widget-fileinput
"
:
"
@dev
"
,
"
kartik-v/yii2-widget-fileinput
"
:
"
@dev
"
,
"
nodge/yii2-eauth
"
:
"
~2.0
"
,
"
nodge/yii2-eauth
"
:
"
~2.0
"
,
"
xj/yii2-tagit-widget
"
:
"
*
"
,
"
xj/yii2-tagit-widget
"
:
"
*
"
,
"
bower-asset/jquery-cookie
"
:
"
*
"
,
"
bower-asset/jquery-cookie
"
:
"
*
"
,
"
2amigos/yii2-transliterator-helper
"
:
"
*
"
"
2amigos/yii2-transliterator-helper
"
:
"
*
"
,
"kbsali/redmine-api"
:
"~1.0"
},
},
"require-dev"
:
{
"require-dev"
:
{
"
yiisoft/yii2-codeception
"
:
"
*
"
,
"
yiisoft/yii2-codeception
"
:
"
*
"
,
...
...
console/migrations/m160304_091243_fix_user_table.php
0 → 100644
View file @
613e8694
<?php
use
yii\db\Schema
;
use
yii\db\Migration
;
class
m160304_091243_fix_user_table
extends
Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public
function
safeUp
()
{
$this
->
alterColumn
(
'users'
,
'support_id'
,
Schema
::
TYPE_STRING
.
'(50) DEFAULT NULL'
);
$this
->
renameColumn
(
'users'
,
'support_id'
,
'redmine_key'
);
}
public
function
safeDown
()
{
$this
->
renameTable
(
'users'
,
'redmine_key'
,
'support_id'
);
$this
->
renameColumn
(
'users'
,
'support_id'
,
Schema
::
TYPE_INTEGER
.
'(11) DEFAULT NULL'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment