Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 51fec310

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 51fec3106e49e1ffc7d6a0a2c577bea8641efbff
  • Vorgänger 48aa4607
  • Nachfolger d90408d8

Pflichtenheftversionen anlegen und auflisten

Unterschiede anzeigen:

SL/Controller/RequirementSpec.pm
4 4

  
5 5
use parent qw(SL::Controller::Base);
6 6

  
7
use Rose::DB::Object::Helpers;
8

  
9 7
use SL::ClientJS;
10 8
use SL::Controller::Helper::GetModels;
11 9
use SL::Controller::Helper::Paginated;
......
52 50
  type          => t8('Requirement Spec Type'),
53 51
  status        => t8('Requirement Spec Status'),
54 52
  projectnumber => t8('Project Number'),
53
  version       => t8('Version'),
54
  mtime         => t8('Last modification'),
55 55
);
56 56

  
57 57
#
......
191 191
sub setup {
192 192
  my ($self) = @_;
193 193

  
194
  $::auth->assert('config');
194
  $::auth->assert('sales_quotation_edit');
195 195
  $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec);
196 196
  $::request->{layout}->use_javascript("${_}.js") for qw(jquery.jstree jquery/jquery.contextMenu client_js requirement_spec);
197 197
  $self->is_template($::form->{is_template} ? 1 : 0);
......
267 267
    }
268 268
  })) {
269 269
    $::lxdebug->message(LXDebug::WARN(), "Error: " . $db->error);
270
    @errors = ($::locale->text('Saving failed. Erro message from the database: #1'), $db->error);
270
    @errors = ($::locale->text('Saving failed. Error message from the database: #1'), $db->error);
271 271
    return SL::ClientJS->new->error(@errors)->render($self) if $::request->is_ajax;
272 272

  
273 273
    $self->requirement_spec->id(undef) if $is_new;
......
300 300
  $args{where} = [
301 301
    and => [
302 302
      @{ $args{where} || [] },
303
      is_template => $self->is_template
303
      working_copy_id => undef,
304
      is_template     => $self->is_template
304 305
    ]];
305 306

  
306 307
  $self->db_args(\%args);
......
314 315
  my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
315 316
  $self->{report} = $report;
316 317

  
317
  my @columns     = qw(title customer status type projectnumber);
318
  my @sortable    = qw(title customer status type projectnumber);
318
  my @columns     = qw(title customer status type projectnumber mtime version);
319
  my @sortable    = qw(title customer status type projectnumber mtime);
319 320

  
320 321
  my %column_defs = (
321 322
    title         => { obj_link => sub { $self->url_for(action => 'show', id => $_[0]->id, callback => $callback) } },
......
325 326
                       sub      => sub { $_[0]->project_id ? $_[0]->project->projectnumber : '' } },
326 327
    status        => { sub      => sub { $_[0]->status->description } },
327 328
    type          => { sub      => sub { $_[0]->type->description } },
329
    version       => { sub      => sub { $_[0]->version_id ? $_[0]->version->version_number : t8('Working copy without version') } },
330
    mtime         => { sub      => sub { $_[0]->mtime->to_kivitendo(precision => 'minute') } },
328 331
  );
329 332

  
330 333
  map { $column_defs{$_}->{text} ||= $::locale->text( $self->get_sort_spec->{$_}->{title} ) } keys %column_defs;

Auch abrufbar als: Unified diff