Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
redmine_cps
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2014-10-27 11:24:14 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
61deebd6ab201a3c23792b92bd96127af3175a06
61deebd6
0 parents
Initial commit
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
LICENSE
init.rb
lib/redmine_cps/patches/app/helpers/application_helper.rb
LICENSE
0 → 100644
View file @
61deebd
This diff is collapsed. Click to expand it.
init.rb
0 → 100644
View file @
61deebd
require
'redmine'
require_dependency
"redmine_cps/patches/app/helpers/application_helper"
Redmine
::
Plugin
.
register
:redmine_cps
do
name
'Integration to CPS plugin'
author
'Dmitry Yu Okunev'
author_url
'https://github.com/xaionaro/'
description
'A plugin to intergrate Redmine to NRNU MEPhI CPS system'
url
'https://gitlab.ut.mephi.ru/ut/redmine_cps'
version
'0.0.1'
end
...
...
lib/redmine_cps/patches/app/helpers/application_helper.rb
0 → 100644
View file @
61deebd
# encoding: UTF-8
require
'application_helper'
module
CPS
module
ApplicationHelperPatch
def
self
.
included
(
base
)
base
.
extend
(
ClassMethods
)
base
.
send
(
:include
,
InstanceMethods
)
base
.
class_eval
do
alias_method_chain
:link_to_user
,
:cps
end
end
module
ClassMethods
end
module
InstanceMethods
def
link_to_user_with_cps
(
user
,
options
=
{})
if
user
.
is_a?
(
User
)
name
=
h
(
user
.
name
(
options
[
:format
]))
if
user
.
active?
||
(
User
.
current
.
admin?
&&
user
.
logged?
)
link_to
"
#{
name
}
"
,
user_path
(
user
),
{
:class
=>
user
.
css_classes
,
:title
=>
"
#{
user
.
lastname
}
#{
user
.
firstname
}
;
#{
user
.
appointment
}
"
}
else
name
end
else
h
(
user
.
to_s
)
end
end
end
end
end
ApplicationHelper
.
send
(
:include
,
CPS
::
ApplicationHelperPatch
)
...
...
Please
register
or
login
to post a comment