Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8e082571

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 8e082571fb1ea2d8a46b863a764a56fb26823226
  • Vorgänger 73816905
  • Nachfolger 1ae7f9a1

Pflichtenheft: Projektverknüpfung anlegen, bearbeiten

- Pflichtenhefte mit einem bestehenden Projekt verknüpfen,
- neues Projekt anlegen,
- nicht mit einem Projekt verknüpfen.

Unterschiede anzeigen:

SL/Controller/RequirementSpec.pm
18 18
use SL::Controller::Helper::RequirementSpec;
19 19
use SL::DB::Customer;
20 20
use SL::DB::Project;
21
use SL::DB::ProjectStatus;
22
use SL::DB::ProjectType;
21 23
use SL::DB::RequirementSpecComplexity;
22 24
use SL::DB::RequirementSpecRisk;
23 25
use SL::DB::RequirementSpecStatus;
......
29 31

  
30 32
use Rose::Object::MakeMethods::Generic
31 33
(
32
  scalar                  => [ qw(requirement_spec_item customers types statuses visible_item visible_section) ],
33
  'scalar --get_set_init' => [ qw(requirement_spec complexities risks projects copy_source js current_text_block_output_position) ],
34
  scalar                  => [ qw(requirement_spec_item visible_item visible_section) ],
35
  'scalar --get_set_init' => [ qw(requirement_spec customers types statuses complexities risks projects project_types project_statuses default_project_type default_project_status copy_source js
36
                                  current_text_block_output_position) ],
34 37
);
35 38

  
36 39
__PACKAGE__->run_before('setup');
37
__PACKAGE__->run_before('load_select_options',  only => [ qw(new ajax_edit create update list) ]);
38 40

  
39 41
__PACKAGE__->make_filtered(
40 42
  MODEL      => 'RequirementSpec',
......
110 112
    ->render($self);
111 113
}
112 114

  
115
sub action_ajax_edit_project_link {
116
  my ($self) = @_;
117

  
118
  my $html   = $self->render('requirement_spec/_project_link_form', { output => 0 }, submit_as => 'ajax');
119

  
120
  $self->js
121
    ->hide('#basic_settings')
122
    ->after('#basic_settings', $html)
123
    ->render($self);
124
}
125

  
113 126
sub action_ajax_show_time_and_cost_estimate {
114 127
  my ($self) = @_;
115 128

  
......
186 199
  $self->create_or_update;
187 200
}
188 201

  
202
sub action_update_project_link {
203
  my $self   = shift;
204
  my $action = delete($::form->{project_link_action}) || 'keep';
205

  
206
  return $self->update_project_link_none_keep_existing($action) if $action =~ m{none|keep|existing};
207
  return $self->update_project_link_new($action)                if $action eq 'new';
208
  return $self->update_project_link_create($action)             if $action eq 'create';
209

  
210
  die "Unknown project link action '$action'";
211
}
212

  
189 213
sub action_destroy {
190 214
  my ($self) = @_;
191 215

  
......
273 297
  return 1;
274 298
}
275 299

  
276
sub init_complexities {
300
sub init_js                     { SL::ClientJS->new                                           }
301
sub init_complexities           { SL::DB::Manager::RequirementSpecComplexity->get_all_sorted  }
302
sub init_default_project_status { SL::DB::Manager::ProjectStatus->find_by(name => 'planning') }
303
sub init_default_project_type   { SL::DB::ProjectType->new(id => 1)->load                     }
304
sub init_project_statuses       { SL::DB::Manager::ProjectStatus->get_all_sorted              }
305
sub init_project_types          { SL::DB::Manager::ProjectType->get_all_sorted                }
306
sub init_projects               { SL::DB::Manager::Project->get_all_sorted                    }
307
sub init_risks                  { SL::DB::Manager::RequirementSpecRisk->get_all_sorted        }
308
sub init_statuses               { SL::DB::Manager::RequirementSpecStatus->get_all_sorted      }
309
sub init_types                  { SL::DB::Manager::RequirementSpecType->get_all_sorted        }
310

  
311
sub init_customers {
277 312
  my ($self) = @_;
278
  return SL::DB::Manager::RequirementSpecComplexity->get_all_sorted;
279
}
280 313

  
281
sub init_risks {
282
  my ($self) = @_;
283
  return SL::DB::Manager::RequirementSpecRisk->get_all_sorted;
284
}
314
  my @filter = ('!obsolete' => 1);
315
  @filter    = ( or => [ @filter, id => $self->requirement_spec->customer_id ] ) if $self->requirement_spec && $self->requirement_spec->customer_id;
285 316

  
286
sub init_projects {
287
  my ($self) = @_;
288
  $self->projects(SL::DB::Manager::Project->get_all_sorted);
317
  return SL::DB::Manager::Customer->get_all_sorted(where => \@filter);
289 318
}
290 319

  
291 320
sub init_requirement_spec {
......
298 327
  $self->copy_source(SL::DB::RequirementSpec->new(id => $::form->{copy_source_id})->load) if $::form->{copy_source_id};
299 328
}
300 329

  
301
sub init_js {
302
  my ($self) = @_;
303
  $self->js(SL::ClientJS->new);
304
}
305

  
306 330
sub init_current_text_block_output_position {
307 331
  my ($self) = @_;
308 332
  $self->current_text_block_output_position($::form->{current_content_type} !~ m/^(?:text-blocks|tb)-(front|back)/ ? -1 : $1 eq 'front' ? 0 : 1);
309 333
}
310 334

  
311
sub load_select_options {
312
  my ($self) = @_;
313

  
314
  my @filter = ('!obsolete' => 1);
315
  @filter    = ( or => [ @filter, id => $self->requirement_spec->customer_id ] ) if $self->requirement_spec && $self->requirement_spec->customer_id;
316

  
317
  $self->customers(SL::DB::Manager::Customer->get_all_sorted(where => \@filter));
318
  $self->statuses( SL::DB::Manager::RequirementSpecStatus->get_all_sorted);
319
  $self->types(    SL::DB::Manager::RequirementSpecType->get_all_sorted);
320
}
321

  
322 335
#
323 336
# helpers
324 337
#
......
502 515
  return @files;
503 516
}
504 517

  
518
sub update_project_link_none_keep_existing {
519
  my ($self, $action) = @_;
520

  
521
  $self->requirement_spec->update_attributes(project_id => undef)                     if $action eq 'none';
522
  $self->requirement_spec->update_attributes(project_id => $::form->{new_project_id}) if $action eq 'existing';
523

  
524
  return $self->invalidate_version
525
    ->replaceWith('#basic_settings', $self->render('requirement_spec/_show_basic_settings', { output => 0 }))
526
    ->remove('#project_link_form')
527
    ->flash('info', t8('The project link has been updated.'))
528
    ->render($self);
529
}
530

  
531
sub update_project_link_new {
532
  my ($self) = @_;
533

  
534
  return $self->js
535
    ->replaceWith('#project_link_form', $self->render('requirement_spec/_new_project_form', { output => 0 }))
536
    ->render($self);
537
}
538

  
539
sub update_project_link_create {
540
  my ($self)  = @_;
541
  my $params  = delete($::form->{project}) || {};
542
  my $project = SL::DB::Project->new(
543
    %{ $params },
544
    valid  => 1,
545
    active => 1,
546
  );
547

  
548
  my @errors = $project->validate;
549

  
550
  return $self->js->error(@errors)->render($self) if @errors;
551

  
552
  my $db = $self->requirement_spec->db;
553
  if (!$db->do_transaction(sub {
554
    $project->save;
555
    $self->requirement_spec->update_attributes(project_id => $project->id);
556

  
557
  })) {
558
    $::lxdebug->message(LXDebug::WARN(), "Error: " . $db->error);
559
    return $self->js->error(t8('Saving failed. Error message from the database: #1', $db->error))->render($self);
560
  }
561

  
562
  return $self->invalidate_version
563
    ->replaceWith('#basic_settings', $self->render('requirement_spec/_show_basic_settings', { output => 0 }))
564
    ->remove('#project_link_form')
565
    ->flash('info', t8('The project has been created.'))
566
    ->flash('info', t8('The project link has been updated.'))
567
    ->render($self);
568
}
569

  
505 570
1;
js/locale/de.js
32 32
"Edit":"Bearbeiten",
33 33
"Edit article/section assignments":"Zuweisung Artikel/Abschnitte bearbeiten",
34 34
"Edit picture":"Bild bearbeiten",
35
"Edit project link":"Projektverknüpfung bearbeiten",
35 36
"Edit text block":"Textblock bearbeiten",
36 37
"Enter longdescription":"Langtext eingeben",
37 38
"Function block actions":"Funktionsblockaktionen",
......
40 41
"Part picker":"Artikelauswahl",
41 42
"Paste":"Einfügen",
42 43
"Paste template":"Vorlage einfügen",
44
"Project link actions":"Projektverknüpfungs-Aktionen",
43 45
"Quotations/Orders actions":"Aktionen für Angebote/Aufträge",
44 46
"Requirement spec actions":"Pflichtenheftaktionen",
45 47
"Requirement spec template actions":"Pflichtenheftvorlagen-Aktionen",
js/requirement_spec.js
444 444
  if (key == 'cancel') {
445 445
    if (confirm(kivi.t8('Do you really want to cancel?'))) {
446 446
      $('#basic_settings').show();
447
      $('#basic_settings_form').remove();
447
      $('#basic_settings_form,#project_link_form').remove();
448 448
    }
449 449
    return true;
450 450
  }
......
684 684
      , delete_reqspec:  { name: kivi.t8('Delete template'), icon: "delete", callback: kivi.requirement_spec.delete_reqspec }
685 685
    };
686 686

  
687
    $.contextMenu({
688
      selector: '.basic-settings-context-menu',
689
      items:    $.extend({
690
          heading: { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
691
        , edit:    { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
692
      }, general_actions)
693
    });
694

  
687 695
  } else {                      // if (is_template)
688 696
    var general_actions = {
689 697
        sep98:              "---------"
......
705 713
      }, general_actions)
706 714
    });
707 715

  
716
    $.contextMenu({
717
      selector: '.basic-settings-context-menu',
718
      items:    $.extend({
719
          heading:           { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
720
        , edit:              { name: kivi.t8('Edit'),              icon: "edit", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
721
        , edit_project_link: { name: kivi.t8('Edit project link'),               callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
722
      }, general_actions)
723
    });
724

  
725
    $.contextMenu({
726
      selector: '.edit-project-link-context-menu',
727
      items:    $.extend({
728
          heading: { name: kivi.t8('Project link actions'), className: 'context-menu-heading' }
729
        , save:    { name: kivi.t8('Save'),   icon: "save",  callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
730
        , cancel:  { name: kivi.t8('Cancel'), icon: "close", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
731
      }, general_actions)
732
    });
733

  
708 734
    var paste_template_actions = {
709 735
    };
710 736
  }                             // if (is_template) ... else ...
......
747 773
    }, general_actions)
748 774
  });
749 775

  
750
  $.contextMenu({
751
    selector: '.basic-settings-context-menu',
752
    items:    $.extend({
753
        heading: { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
754
      , edit:    { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
755
    }, general_actions)
756
  });
757

  
758 776
  $.contextMenu({
759 777
    selector: '.edit-basic-settings-context-menu',
760 778
    items:    $.extend({
locale/de/all
562 562
  'Create a new predefined text' => 'Einen neuen vordefinierten Textblock anlegen',
563 563
  'Create a new printer'        => 'Einen neuen Drucker anlegen',
564 564
  'Create a new project'        => 'Neues Projekt anlegen',
565
  'Create a new project and link to it.' => 'Neues Projekt anlegen und damit verknüpfen.',
565 566
  'Create a new project status' => 'Einen neuen Projektstatus anlegen',
566 567
  'Create a new project type'   => 'Einen neuen Projekttypen anlegen',
567 568
  'Create a new requirement spec' => 'Ein neues Pflichtenheft anlegen',
......
803 804
  'Display options'             => 'Anzeigeoptionen',
804 805
  'Do not change the tax rate of taxkey 0.' => 'Ändern Sie nicht den Steuersatz vom Steuerschlüssel 0.',
805 806
  'Do not check for duplicates' => 'Nicht nach Dubletten suchen',
807
  'Do not link to a project.'   => 'Nicht mit einem Projekt verknüpfen.',
806 808
  'Do not modify this position' => 'Diese Position nicht verändern',
807 809
  'Do not set default buchungsgruppe' => 'Nie Standardbuchungsgruppe setzen',
808 810
  'Do you really want to cancel?' => 'Wollen Sie wirklich abbrechen?',
......
926 928
  'Edit delivery term'          => 'Lieferbedingungen bearbeiten',
927 929
  'Edit department'             => 'Abteilung bearbeiten',
928 930
  'Edit file'                   => 'Datei bearbeiten',
931
  'Edit general settings'       => 'Grundeinstellungen bearbeiten',
929 932
  'Edit greetings'              => 'Anreden bearbeiten',
930 933
  'Edit note'                   => 'Notiz bearbeiten',
931 934
  'Edit payment term'           => 'Zahlungsbedingungen bearbeiten',
......
934 937
  'Edit prices and discount (if not used, textfield is ONLY set readonly)' => 'Preise und Rabatt in Formularen frei anpassen (falls deaktiviert, wird allerdings NUR das textfield auf READONLY gesetzt / kann je nach Browserversion und technischen Fähigkeiten des Anwenders noch umgangen werden)',
935 938
  'Edit project'                => 'Projekt bearbeiten',
936 939
  'Edit project #1'             => 'Projekt #1 bearbeiten',
940
  'Edit project link'           => 'Projektverknüpfung bearbeiten',
937 941
  'Edit project status'         => 'Projektstatus bearbeiten',
938 942
  'Edit project type'           => 'Projekttypen bearbeiten',
939 943
  'Edit requirement spec'       => 'Pflichtenheft bearbeiten',
......
1300 1304
  'June'                        => 'Juni',
1301 1305
  'KNE-Export erfolgreich!'     => 'KNE-Export erfolgreich!',
1302 1306
  'KNr. beim Kunden'            => 'KNr. beim Kunden',
1307
  'Keep the project link the way it is.' => 'Die aktuelle Verknüpfung beibehalten.',
1303 1308
  'Keine Suchergebnisse gefunden!' => 'Keine Suchergebnisse gefunden!',
1304 1309
  'Knowledge'                   => 'Wissen',
1305 1310
  'Konten'                      => 'Konten',
......
1350 1355
  'Line endings'                => 'Zeilenumbrüche',
1351 1356
  'Link direction'              => 'Verknüpfungsrichtung',
1352 1357
  'Link to'                     => 'Verknüpfen mit',
1358
  'Link to the following project:' => 'Mit dem folgenden Projekt verknüpfen:',
1353 1359
  'Linked Records'              => 'Verknüpfte Belege',
1354 1360
  'List Accounts'               => 'Konten anzeigen',
1355 1361
  'List Languages'              => 'Sprachen anzeigen',
......
1809 1815
  'Project Transactions'        => 'Projektbuchungen',
1810 1816
  'Project Type'                => 'Projekttyp',
1811 1817
  'Project Types'               => 'Projekttypen',
1818
  'Project link actions'        => 'Projektverknüpfungs-Aktionen',
1812 1819
  'Project type'                => 'Projekttyp',
1813 1820
  'Projects'                    => 'Projekte',
1814 1821
  'Projecttransactions'         => 'Projektbuchungen',
......
2434 2441
  'The project has been deleted.' => 'Das Projekt wurde gelöscht.',
2435 2442
  'The project has been saved.' => 'Das Projekt wurde gespeichert.',
2436 2443
  'The project is in use and cannot be deleted.' => 'Das Projekt ist in Verwendung und kann nicht gelöscht werden.',
2444
  'The project link has been updated.' => 'Die Projektverknüpfung wurde aktualisiert.',
2437 2445
  'The project number is already in use.' => 'Die Projektnummer wird bereits verwendet.',
2438 2446
  'The project number is missing.' => 'Die Projektnummer fehlt.',
2439 2447
  'The project status has been created.' => 'Der Projektstatus wurde angelegt.',
......
2565 2573
  'This option controls the method used for profit determination.' => 'Dieser Parameter legt die Berechnungsmethode für die Gewinnermittlung fest.',
2566 2574
  'This option controls the posting and calculation behavior for the accounting method.' => 'Dieser Parameter steuert die Buchungs- und Berechnungsmethoden für die Versteuerungsart.',
2567 2575
  'This partnumber is not unique. You should change it.' => 'Diese Artikelnummer ist nicht eindeutig. Bitte wählen Sie eine andere.',
2576
  'This requirement spec is currently linked to the following project:' => 'Dieses Pflichtenheft ist mit dem folgenden Projekt verknüpft:',
2568 2577
  'This requirement spec is currently not linked to a project.' => 'Dieses Pflichtenheft ist noch nicht mit einem Projekt verknüpft.',
2569 2578
  'This requires you to manually correct entries for which an automatic conversion failed and to check those for which it succeeded.' => 'Dies erfordert, dass Sie diejenigen Einträge manuell korrigieren, für die die automatische Umstellung fehlschlug, sowie dass Sie diejenigen überprüfen, für die die Umstellung erfolgreich war.',
2570 2579
  'This transaction has to be split into several transactions manually.' => 'Diese Buchung muss manuell in mehrere Buchungen aufgeteilt werden.',
templates/webpages/requirement_spec/_form.html
3 3
            submit_as = 'post'
4 4
%]
5 5
<form method="post" action="controller.pl" id="[% id_prefix %]"[% UNLESS submit_as == 'post' %] class="edit-basic-settings-context-menu"[% END %]>
6
 <h2>[% LxERP.t8("Edit general settings") %]</h2>
7

  
6 8
 [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ '_id') %]
7 9
 [% L.hidden_tag("requirement_spec.is_template", SELF.requirement_spec.is_template, id=id_prefix _ '_is_template') %]
8 10

  
templates/webpages/requirement_spec/_new_project_form.html
1
[%- USE LxERP -%][%- USE L -%]
2
[%- SET id_prefix = "project_link_form"
3
        style     = "width: 300px" %]
4
<form method="post" action="controller.pl" id="[% id_prefix %]"[% UNLESS submit_as == 'post' %] class="edit-project-link-context-menu"[% END %]>
5
 <h2>[% LxERP.t8("Edit project link") %]: [% LxERP.t8("Create a new project") %]</h2>
6

  
7
 [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ "_id") %]
8
 [% L.hidden_tag("project_link_action", "create", id=id_prefix _ "_project_link_action") %]
9

  
10
 <table class="rs_input_field">
11
  <tr>
12
   <td>[% LxERP.t8("Project Number") %]</td>
13
   <td>[% L.input_tag("project.projectnumber", "", id=id_prefix _ "_projectnumber", style=style) %]</td>
14
  </tr>
15

  
16
  <tr>
17
   <td>[% LxERP.t8("Description") %]</td>
18
   <td>[% L.input_tag("project.description", SELF.requirement_spec.title, id=id_prefix _ "_description", style=style) %]</td>
19
  </tr>
20

  
21
  <tr>
22
   <td>[% LxERP.t8("Project Type") %]</td>
23
   <td>[% L.select_tag("project.project_type_id", SELF.project_types, default=SELF.default_project_type.id, title_key="description", id=id_prefix _ "_project_type_id", style=style) %]</td>
24
  </tr>
25

  
26
  <tr>
27
   <td>[% LxERP.t8("Project Status") %]</td>
28
   <td>[% L.select_tag("project.project_status_id", SELF.project_statuses, default=SELF.default_project_status.id, title_key="description", id=id_prefix _ "_project_status_id", style=style) %]</td>
29
  </tr>
30

  
31
  <tr>
32
   <td>[% LxERP.t8("Customer") %]</td>
33
   <td>[% L.select_tag("project.customer_id", SELF.customers, default=SELF.requirement_spec.customer_id, title_key="name", with_empty=1, id=id_prefix _ "_customer_id", style=style) %]</td>
34
  </tr>
35
 </table>
36

  
37
 <p>
38
  [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update_project_link",  "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ '_submit') %]
39
  <script type="text/javascript"><!--
40
  $(function() {
41
    $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
42
      if(event.keyCode == 13) {
43
        event.preventDefault();
44
        $('#[% id_prefix %]_submit').click();
45
        return false;
46
      }
47
    });
48
  });
49
--></script>
50
 </p>
51
</form>
templates/webpages/requirement_spec/_project_link_details.html
1
[%- USE HTML -%][%- USE LxERP -%]
2
<table>
3
 <tr class="listrow">
4
  <td>[% LxERP.t8("Project Number") %]:</td>
5
  <td>[% HTML.escape(requirement_spec.project.projectnumber) %]</td>
6
 </tr>
7

  
8
 <tr class="listrow">
9
  <td>[% LxERP.t8("Description") %]:</td>
10
  <td>[% HTML.escape(requirement_spec.project.description) %]</td>
11
 </tr>
12

  
13
 <tr class="listrow">
14
  <td>[% LxERP.t8("Customer") %]:</td>
15
  <td>[% HTML.escape(requirement_spec.project.customer.name) %]</td>
16
 </tr>
17

  
18
 <tr class="listrow">
19
  <td>[% LxERP.t8("Type") %]:</td>
20
  <td>[% HTML.escape(requirement_spec.project.project_type.description) %]</td>
21
 </tr>
22

  
23
 <tr class="listrow">
24
  <td>[% LxERP.t8("Status") %]:</td>
25
  <td>[% HTML.escape(requirement_spec.project.project_status.description) %]</td>
26
 </tr>
27
</table>
templates/webpages/requirement_spec/_project_link_form.html
1
[%- USE LxERP -%][%- USE L -%]
2
[%- SET id_prefix = "project_link_form" %]
3
<form method="post" action="controller.pl" id="[% id_prefix %]"[% UNLESS submit_as == 'post' %] class="edit-project-link-context-menu"[% END %]>
4
 <h2>[% LxERP.t8("Edit project link") %]</h2>
5

  
6
 [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ "_id") %]
7

  
8
 [% IF !SELF.requirement_spec.project_id %]
9
  <p>[% LxERP.t8("This requirement spec is currently not linked to a project.") %]</p>
10

  
11
 [% ELSE %]
12
  <p>[% LxERP.t8("This requirement spec is currently linked to the following project:") %]</p>
13
  [% INCLUDE "requirement_spec/_project_link_details.html" requirement_spec=SELF.requirement_spec %]
14
 [% END %]
15

  
16
 <table>
17
  <tr><td colspan="2">[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_keep", value="keep", label=LxERP.t8("Keep the project link the way it is."), checked="1") %]</td></tr>
18
  [% IF SELF.requirement_spec.project_id %]
19
   <tr><td colspan="2">[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_none", value="none", label=LxERP.t8("Do not link to a project.")) %]</td></tr>
20
  [% END %]
21
  <tr><td colspan="2">[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_new", value="new", label=LxERP.t8("Create a new project and link to it.")) %]</td></tr>
22
  <tr>
23
   <td>[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_existing", value="existing", label=LxERP.t8("Link to the following project:")) %]</td>
24
   <td>[% L.select_tag("new_project_id", SELF.projects, id=id_prefix _ "_new_project_id", title_key="full_description", disabled="true") %]</td>
25
  </tr>
26
 </table>
27

  
28
 <p>
29
  [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update_project_link",  "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ "_submit") %]
30
  <script type="text/javascript"><!--
31
  $(function() {
32
    $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
33
      if(event.keyCode == 13) {
34
        event.preventDefault();
35
        $('#[% id_prefix %]_submit').click();
36
        return false;
37
      }
38
    });
39

  
40
    $('[name=project_link_action]').change(function() {
41
      $('#[% id_prefix %]_new_project_id').prop('disabled', !$('#[% id_prefix %]_project_link_action_existing').prop('checked'));
42
    });
43
  });
44
--></script>
45
 </p>
46
</form>
templates/webpages/requirement_spec/_show_basic_settings.html
48 48
  <p>[% LxERP.t8("This requirement spec is currently not linked to a project.") %]</p>
49 49

  
50 50
 [% ELSE %]
51
  <table>
52
   <tr class="listrow">
53
    <td>[% LxERP.t8("Project Number") %]:</td>
54
    <td>[% HTML.escape(SELF.requirement_spec.project.projectnumber) %]</td>
55
   </tr>
56

  
57
   <tr class="listrow">
58
    <td>[% LxERP.t8("Description") %]:</td>
59
    <td>[% HTML.escape(SELF.requirement_spec.project.description) %]</td>
60
   </tr>
61

  
62
   <tr class="listrow">
63
    <td>[% LxERP.t8("Customer") %]:</td>
64
    <td>[% HTML.escape(SELF.requirement_spec.project.customer.name) %]</td>
65
   </tr>
66

  
67
   <tr class="listrow">
68
    <td>[% LxERP.t8("Type") %]:</td>
69
    <td>[% HTML.escape(SELF.requirement_spec.project.project_type.description) %]</td>
70
   </tr>
71

  
72
   <tr class="listrow">
73
    <td>[% LxERP.t8("Status") %]:</td>
74
    <td>[% HTML.escape(SELF.requirement_spec.project.project_status.description) %]</td>
75
   </tr>
76
  </table>
77

  
51
  [% INCLUDE 'requirement_spec/_project_link_details.html' requirement_spec=SELF.requirement_spec %]
78 52
 [% END %]
79 53
[% END %]
80 54
</div>

Auch abrufbar als: Unified diff