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
8aeb6873
Commit
8aeb6873
authored
Mar 15, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix redmine module
parent
1c5848e3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
84 deletions
+152
-84
common/modules/support/controllers/SupportController.php
common/modules/support/controllers/SupportController.php
+52
-3
common/modules/support/models/redmine/Issue.php
common/modules/support/models/redmine/Issue.php
+2
-0
common/modules/support/models/redmine/RedmineHelper.php
common/modules/support/models/redmine/RedmineHelper.php
+13
-0
common/modules/support/views/support/_loop.php
common/modules/support/views/support/_loop.php
+64
-68
common/modules/support/views/support/index.php
common/modules/support/views/support/index.php
+16
-12
common/modules/support/views/support/view.php
common/modules/support/views/support/view.php
+5
-1
No files found.
common/modules/support/controllers/SupportController.php
View file @
8aeb6873
...
...
@@ -29,11 +29,11 @@ class SupportController extends Controller
'access'
=>
[
'class'
=>
AccessControl
::
className
(),
'user'
=>
'support'
,
'only'
=>
[
'index'
,
'create'
,
'view'
,
'file'
],
'only'
=>
[
'index'
,
'create'
,
'view'
,
'file'
,
'close'
],
'rules'
=>
[
[
'allow'
=>
true
,
'actions'
=>
[
'index'
,
'create'
,
'view'
,
'file'
],
'actions'
=>
[
'index'
,
'create'
,
'view'
,
'file'
,
'close'
],
'roles'
=>
[
'@'
],
],
],
...
...
@@ -87,9 +87,34 @@ class SupportController extends Controller
'priority_id'
=>
$model
->
priority_id
,
'status_id'
=>
$model
->
status_id
,
'tracker_id'
=>
$model
->
tracker_id
,
'author_id'
=>
$user
[
'user'
][
'id'
]
'author_id'
=>
$user
[
'user'
][
'id'
],
'assigned_to_manager_id'
=>
null
];
$membership
=
$client
->
membership
->
all
(
$model
->
project_id
);
if
(
isset
(
$membership
))
{
foreach
(
$membership
as
$member
)
{
if
(
isset
(
$member
[
'roles'
]))
{
foreach
(
$member
[
'roles'
]
as
$role
)
{
if
(
$role
[
'id'
]
==
RedmineHelper
::
MANAGER
)
{
$params
[
'assigned_to_manager_id'
]
=
$member
[
'user'
][
'id'
];
}
}
}
if
(
$params
[
'assigned_to_manager_id'
])
{
break
;
}
}
}
if
(
$model
->
files
)
{
$uploads
=
[];
...
...
@@ -125,6 +150,7 @@ class SupportController extends Controller
$client
=
$this
->
getClient
();
$user
=
$client
->
user
->
getCurrentUser
();
$model
=
$client
->
issue
->
show
(
$id
,
[
...
...
@@ -177,6 +203,29 @@ class SupportController extends Controller
]);
}
public
function
actionClose
(
$id
)
{
$client
=
$this
->
getClient
();
$user
=
$client
->
user
->
getCurrentUser
();
$model
=
$client
->
issue
->
show
(
$id
);
if
(
empty
(
$model
[
'issue'
])
||
$model
[
'issue'
][
'author'
][
'id'
]
!=
$user
[
'user'
][
'id'
])
{
throw
new
NotFoundHttpException
(
'Доступ запрещен!'
);
}
if
(
$model
[
'issue'
][
'status'
][
'id'
]
==
Issue
::
STATUS_APPROVE
)
{
$client
->
issue
->
update
(
$id
,
[
'status_id'
=>
Issue
::
STATUS_ACCEPTED
]);
}
return
$this
->
redirect
([
'/support/view/'
.
$id
]);
}
public
function
actionFile
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
...
...
common/modules/support/models/redmine/Issue.php
View file @
8aeb6873
...
...
@@ -23,6 +23,8 @@ class Issue extends yii\base\Model
const
TRACKER_NONE
=
14
;
// Не определено
const
STATUS_NEW
=
7
;
const
STATUS_APPROVE
=
16
;
const
STATUS_ACCEPTED
=
14
;
const
SCENARIO_CREATE
=
'create'
;
const
SCENARIO_UPDATE
=
'update'
;
...
...
common/modules/support/models/redmine/RedmineHelper.php
View file @
8aeb6873
...
...
@@ -8,6 +8,10 @@ class RedmineHelper
{
const
MAX_FILE_SIZE
=
5242880
;
//5mb
const
OTHER_PROJECT
=
75
;
const
MANAGER
=
3
;
public
static
$markupSet
=
[
[
'name'
=>
'Жирный'
,
...
...
@@ -152,6 +156,15 @@ class RedmineHelper
}
}
$other
[
self
::
OTHER_PROJECT
]
=
$output
[
self
::
OTHER_PROJECT
];
unset
(
$output
[
self
::
OTHER_PROJECT
]);
$output
=
[
'Доступные проекты'
=>
$output
,
$other
[
self
::
OTHER_PROJECT
]
=>
$other
];
return
$output
;
}
...
...
common/modules/support/views/support/_loop.php
View file @
8aeb6873
...
...
@@ -5,8 +5,6 @@ use yii\helpers\Html;
?>
<?php
if
(
$output
[
'models'
])
:
?>
<div
class=
"panel-group panel-group-2"
id=
"accordion_2"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading table-responsive"
>
...
...
@@ -77,6 +75,4 @@ use yii\helpers\Html;
</div>
</div>
</div>
<?php
endif
;
?>
\ No newline at end of file
common/modules/support/views/support/index.php
View file @
8aeb6873
...
...
@@ -63,6 +63,8 @@ use common\modules\support\models\redmine\RedmineHelper;
<tr>
<td
class=
"no_pad"
>
<div
class=
"panel-group panel-group-2"
id=
"accordion_2"
>
<?php
if
(
$issues
=
RedmineHelper
::
sortIsuues
(
$models
[
'issues'
]))
{
...
...
@@ -80,6 +82,8 @@ use common\modules\support\models\redmine\RedmineHelper;
}
?>
</div>
</td>
</tr>
</table>
...
...
common/modules/support/views/support/view.php
View file @
8aeb6873
...
...
@@ -27,6 +27,10 @@ $parser = new \Netcarver\Textile\Parser();
<div
class=
"row"
>
<?php
if
(
$model
[
'status'
][
'id'
]
==
Issue
::
STATUS_APPROVE
)
:
?>
<div
class=
"col-md-2 col-md-offset-10"
>
<?=
Html
::
a
(
'Закрыть'
,
[
'/support/close/'
.
$model
[
'id'
]],
[
'class'
=>
'btn btn-primary pull-right'
]);
?>
</div>
<?php
endif
;
?>
<div
class=
"col-md-12"
>
<div
class=
"panel-body panel-body-ex-1 panel-body-ex-3 notifications_box color_on_cursor"
<?=
(
$model
[
'priority'
][
'id'
]
==
Issue
::
PRIORITY_SIMPLE
?
'style="border:0;"'
:
''
)
?>
>
...
...
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