Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6ebacae9

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 6ebacae90e52d35ce729638490a015060f12fee3
  • Vorgänger 9205a42e
  • Nachfolger 8651e027

ActionBar: Verwendung bei Wiedervorlagen

Unterschiede anzeigen:

bin/mozilla/fu.pl
1 1
use POSIX qw(strftime);
2 2

  
3 3
use SL::FU;
4
use SL::Locale::String qw(t8);
4 5
use SL::ReportGenerator;
5 6

  
6 7
require "bin/mozilla/reportgenerator.pl";
......
99 100
  $params{trans_id}   = $form->{LINKS}->[0]->{trans_id} if (@{ $form->{LINKS} });
100 101
  $form->{FOLLOW_UPS} = FU->follow_ups(%params);
101 102

  
103
  setup_fu_display_form_action_bar() unless $::form->{POPUP_MODE};
104

  
102 105
  $form->header(no_layout => $::form->{POPUP_MODE});
103 106
  print $form->parse_html_template('fu/add_edit');
104 107

  
......
232 235

  
233 236
  $form->{title}    = $locale->text('Follow-Ups');
234 237

  
238
  setup_fu_search_action_bar();
235 239
  $form->header();
236 240
  print $form->parse_html_template('fu/search');
237 241

  
......
347 351
    $report->add_data($row);
348 352
  }
349 353

  
354
  setup_fu_report_action_bar();
350 355
  $report->generate_with_headers();
351 356

  
352 357
  $main::lxdebug->leave_sub();
......
409 414

  
410 415
  $form->{title} = $locale->text('Edit Access Rights for Follow-Ups');
411 416

  
417
  setup_fu_edit_access_rights_action_bar();
418

  
412 419
  $form->header();
413 420
  print $form->parse_html_template('fu/edit_access_rights');
414 421

  
......
475 482
  $form->error($locale->text('No action defined.'));
476 483
}
477 484

  
485
sub setup_fu_search_action_bar {
486
  my %params = @_;
487

  
488
  for my $bar ($::request->layout->get('actionbar')) {
489
    $bar->add(
490
      action => [
491
        t8('Show'),
492
        submit    => [ '#form', { action => "report" } ],
493
        accesskey => 'enter',
494
      ],
495
    );
496
  }
497
}
498

  
499
sub setup_fu_display_form_action_bar {
500
  my %params = @_;
501

  
502
  for my $bar ($::request->layout->get('actionbar')) {
503
    $bar->add(
504
      action => [
505
        t8('Save'),
506
        submit    => [ '#form', { action => "save" } ],
507
        accesskey => 'enter',
508
      ],
509
      action => [
510
        t8('Finish'),
511
        submit   => [ '#form', { action => "finish" } ],
512
        disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef,
513
      ],
514
      action => [
515
        t8('Delete'),
516
        submit   => [ '#form', { action => "delete" } ],
517
        disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef,
518
        confirm  => t8('Do you really want to delete this object?'),
519
      ],
520
    );
521
  }
522
}
523

  
524
sub setup_fu_report_action_bar {
525
  my %params = @_;
526

  
527
  for my $bar ($::request->layout->get('actionbar')) {
528
    $bar->add(
529
      action => [
530
        t8('Finish'),
531
        submit => [ '#form', { action => "finish" } ],
532
        checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
533
      ],
534
      action => [
535
        t8('Delete'),
536
        submit  => [ '#form', { action => "delete" } ],
537
        checks  => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
538
        confirm => t8('Do you really want to delete the selected objects?'),
539
      ],
540
    );
541
  }
542
}
543

  
544
sub setup_fu_edit_access_rights_action_bar {
545
  my %params = @_;
546

  
547
  for my $bar ($::request->layout->get('actionbar')) {
548
    $bar->add(
549
      action => [
550
        t8('Save'),
551
        submit    => [ '#form', { action => "save_access_rights" } ],
552
        accesskey => 'enter',
553
      ],
554
    );
555
  }
556
}
557

  
478 558
1;

Auch abrufbar als: Unified diff