Skip to content

Commit

Permalink
webui: move formatClientName to custom-functions.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Mar 18, 2020
1 parent 8c37c58 commit 551c4dc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ $this->headTitle($title);
field: 'client',
sortable: true,
formatter: function(value) {
return '<a href="<?php echo $this->basePath() . '/client/details/'; ?>'+value+'">'+value+'</a>';
return formatClientName(value, basePath);
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion webui/module/Job/view/job/job/details.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ $this->headTitle($title);
{
field: 'client',
formatter: function(value) {
return '<a href="<?php echo $this->basePath() . '/client/details/'; ?>'+value+'">'+value+'</a>';
return formatClientName(value, basePath);
}
},
{
Expand Down
6 changes: 1 addition & 5 deletions webui/module/Job/view/job/job/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,6 @@ $this->headTitle($title);

}

function formatClientName(value) {
return '<a href="<?php echo $this->basePath() . '/client/details/'; ?>'+value+'">'+value+'</a>';
}

function attachJobTable() {
jobtable = $('#jobtable').bootstrapTable({
locale: '<?php echo str_replace('_','-', $_SESSION['bareos']['locale']); ?>',
Expand Down Expand Up @@ -419,7 +415,7 @@ $this->headTitle($title);
field: 'client',
sortable: true,
formatter: function(value) {
return formatClientName(value);
return formatClientName(value, basePath);
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion webui/module/Media/view/media/media/details.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ $this->headTitle($title);
field: 'client',
sortable: true,
formatter: function(value) {
return '<a href="<?php echo $this->basePath() . '/client/details/'; ?>'+value+'">'+value+'</a>';
return formatClientName(value, basePath);
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions webui/public/js/custom-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ function formatJobName(value, basePath, displayRange) {
}
}

function formatClientName(value, basePath) {
return '<a href="' + basePath + '/client/details/' + value + '">' + value + '</a>';
}

function formatJobType(data) {
var output;
switch(data) {
Expand Down

0 comments on commit 551c4dc

Please sign in to comment.