Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
tiki
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Tiki Wiki CMS Groupware
tiki
Commits
bf5a1ab4
Commit
bf5a1ab4
authored
Nov 10, 2016
by
kroky6
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] show ItemLink add button only if user has permission to add items to remote tracker
parent
1520c7e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
lib/core/Tracker/Field/ItemLink.php
lib/core/Tracker/Field/ItemLink.php
+4
-0
templates/trackerinput/itemlink.tpl
templates/trackerinput/itemlink.tpl
+2
-2
templates/trackerinput/itemlink_selector.tpl
templates/trackerinput/itemlink_selector.tpl
+1
-1
No files found.
lib/core/Tracker/Field/ItemLink.php
View file @
bf5a1ab4
...
...
@@ -250,6 +250,8 @@ class Tracker_Field_ItemLink extends Tracker_Field_Abstract implements Tracker_F
function
renderInput
(
$context
=
array
())
{
$trackerPerms
=
Perms
::
get
(
'tracker'
,
$this
->
getOption
(
'trackerId'
));
if
(
$this
->
useSelector
())
{
$value
=
$this
->
getValue
();
$placeholder
=
tr
(
TikiLib
::
lib
(
'object'
)
->
get_title
(
'tracker'
,
$this
->
getOption
(
'trackerId'
)));
...
...
@@ -295,6 +297,7 @@ class Tracker_Field_ItemLink extends Tracker_Field_Abstract implements Tracker_F
'status'
=>
$status
,
'selector_value'
=>
$value
,
'format'
=>
$format
,
'createTrackerItems'
=>
$trackerPerms
->
create_tracker_items
,
]);
return
$template
;
...
...
@@ -303,6 +306,7 @@ class Tracker_Field_ItemLink extends Tracker_Field_Abstract implements Tracker_F
$data
=
array
(
'list'
=>
$this
->
getItemList
(),
'displayFieldsListType'
=>
$this
->
getOption
(
'displayFieldsListType'
),
'createTrackerItems'
=>
$trackerPerms
->
create_tracker_items
,
);
$servicelib
=
TikiLib
::
lib
(
'service'
);
...
...
templates/trackerinput/itemlink.tpl
View file @
bf5a1ab4
...
...
@@ -7,7 +7,7 @@
{
capture
assign
=
fieldvalue
}{
if
is_array
(
$field.value
)
}{
','
|
implode
:
$field.value
}{
else
}{
$field.value
}{/
if
}{/
capture
}
{
wikiplugin
_name
=
trackerlist
trackerId
=
$field.options_map.trackerId
fields
=
':'
|
implode
:
$field.options_map.displayFieldsList
editableall
=
"y"
showlinks
=
"y"
sortable
=
"type:reset"
sortList
=
"[1,0]"
tsfilters
=
"type:nofilter"
tsfilteroptions
=
"type:reset"
tspaginate
=
"max:5"
checkbox
=
"/"
|
cat
:
$field.ins_id
|
cat
:
"//////y/"
|
cat
:
$fieldvalue
filterfield
=
$field.options_map.preSelectFieldThere
exactvalue
=
$data.preselection_value
ignoreRequestItemId
=
y
}
{/
wikiplugin
}
{
if
$field.options_map.addItems
}
{
if
$field.options_map.addItems
and
$data.createTrackerItems
}
<a
class=
"btn btn-default insert-tracker-item"
href=
"
{
service
controller
=
tracker
action
=
insert_item
trackerId
=
$field.options_map.trackerId
next
=
$data.next
|
escape
}
"
data-href=
"
{
service
controller
=
tracker
action
=
insert_item
trackerId
=
$field.options_map.trackerId
next
=
$data.next
|
escape
}
"
>
{
$field.options_map.addItems
|
escape
}
</a>
{
if
$field.options_map.preSelectFieldThere
}
{
jq
}
...
...
@@ -49,7 +49,7 @@
</option>
{/
foreach
}
</select>
{
if
$field.options_map.addItems
}
{
if
$field.options_map.addItems
and
$data.createTrackerItems
}
<a
class=
"btn btn-default insert-tracker-item"
href=
"
{
service
controller
=
tracker
action
=
insert_item
trackerId
=
$field.options_map.trackerId
next
=
$data.next
|
escape
}
"
data-href=
"
{
service
controller
=
tracker
action
=
insert_item
trackerId
=
$field.options_map.trackerId
next
=
$data.next
|
escape
}
"
>
{
$field.options_map.addItems
|
escape
}
</a>
{
if
$field.options_map.preSelectFieldThere
}
{
jq
}
...
...
templates/trackerinput/itemlink_selector.tpl
View file @
bf5a1ab4
{* $Id: itemlink.tpl 51847 2014-07-04 18:08:48Z lphuberdeau $ *}
<div
class=
"item-link"
>
{
object_selector
_id
=
$field.ins_id
_simplevalue
=
$field.value
_simplename
=
$field.ins_id
_placeholder
=
$data.placeholder
type
=
"trackeritem"
tracker_id
=
$field.options_map.trackerId
tracker_status
=
$data.status
_format
=
$data.format
}
{
if
$field.options_map.addItems
}
{
if
$field.options_map.addItems
and
$data.createTrackerItems
}
<a
class=
"btn btn-default insert-tracker-item"
href=
"
{
service
controller
=
tracker
action
=
insert_item
trackerId
=
$field.options_map.trackerId
}
"
>
{
$field.options_map.addItems
|
escape
}
</a>
{
jq
}
$('#{
{
$field.ins_id
|
escape
}
}')
...
...
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