commit
3d2eddad39
@ -0,0 +1,13 @@ |
||||
<span ng-if="!$ctrl.field.isEmpty()"> |
||||
|
||||
<a role="link" |
||||
target="_blank" |
||||
title='{{ ::$ctrl.field.text.linkTitle }}' |
||||
ng-href="{{ $ctrl.field.timeEntriesLink }}"> |
||||
{{ $ctrl.displayText }} |
||||
</a> |
||||
</span> |
||||
|
||||
<span ng-if="$ctrl.field.isEmpty()" title="{{ $ctrl.displayText }}"> |
||||
{{ $ctrl.displayText }} |
||||
</span> |
@ -0,0 +1,56 @@ |
||||
// -- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See doc/COPYRIGHT.rdoc for more details.
|
||||
// ++
|
||||
|
||||
import {WorkPackageResourceInterface} from '../../api/api-v3/hal-resources/work-package-resource.service'; |
||||
import {DurationDisplayField} from './wp-display-duration-field.module'; |
||||
|
||||
export class SpentTimeDisplayField extends DurationDisplayField { |
||||
public template: string = '/components/wp-display/field-types/wp-display-spent-time-field.directive.html'; |
||||
public text: any; |
||||
public timeEntriesLink: string; |
||||
public isManualRenderer = false; |
||||
|
||||
constructor(public resource: WorkPackageResourceInterface, |
||||
public name: string, |
||||
public schema) { |
||||
super(resource, name, schema); |
||||
|
||||
this.text = { |
||||
linkTitle: this.I18n.t('js.work_packages.message_view_spent_time') |
||||
}; |
||||
|
||||
if (resource.project) { |
||||
resource.project.$load().then(project => { |
||||
this.timeEntriesLink = |
||||
URI |
||||
.expand('/projects/{identifier}/time_entries', project) |
||||
.toString(); |
||||
}); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue