sub action_show {
my ($self) = @_;
- my $item = $::form->{requirement_spec_item_id} ? SL::DB::RequirementSpecItem->new(id => $::form->{requirement_spec_item_id})->load : @{ $self->requirement_spec->sections }[0];
+ my $title = $self->requirement_spec->is_template ? t8('Show requirement spec template') : t8('Show requirement spec');
+ my $item = $::form->{requirement_spec_item_id} ? SL::DB::RequirementSpecItem->new(id => $::form->{requirement_spec_item_id})->load : @{ $self->requirement_spec->sections }[0];
$self->requirement_spec_item($item);
- $self->render('requirement_spec/show', title => t8('Show requirement spec'));
+ $self->render('requirement_spec/show', title => $title);
}
sub action_create {
unlink $result{file_name};
}
+sub action_select_template_to_paste {
+ my ($self) = @_;
+
+ my @templates = grep { @{ $_->sections } || @{ $_->text_blocks } } @{ SL::DB::Manager::RequirementSpec->get_all(where => [ is_template => 1 ], sort_by => 'lower(title)') };
+ $self->render('requirement_spec/select_template_to_paste', { layout => 0 }, TEMPLATES => \@templates);
+}
+
#
# filters
#
"Map":"Karte",
"Part picker":"Artikelauswahl",
"Paste":"Einfügen",
+"Paste template":"Vorlage einfügen",
"Requirement spec actions":"Pflichtenheftaktionen",
"Requirement spec template actions":"Pflichtenheftvorlagen-Aktionen",
"Revert to version":"Auf Version zurücksetzen",
current_content_id: $('#current_content_id').val()
};
- // console.log("I would normally POST the following now:");
- // console.log(data);
- $.post("controller.pl", $.extend(data, other_data || {}), kivi.eval_json_result);
+ console.log("I would normally POST the following now:");
+ console.log(data);
+ // $.post("controller.pl", $.extend(data, other_data || {}), kivi.eval_json_result);
return true;
};
return ns.handle_item_popup_menu_markings(opt, false);
};
+ns.paste_template = function(key, opt, other_data) {
+ open_jqm_window({ url: 'controller.pl?action=RequirementSpec/select_template_to_paste' });
+};
+
// -------------------------------------------------------------------------
// -------------------------- time/cost estimate ---------------------------
// -------------------------------------------------------------------------
} else { // if (is_template)
var general_actions = {
- sep98: "---------"
- , general_actions: { name: kivi.t8('Requirement spec actions'), className: 'context-menu-heading' }
- // , sep99: "---------"
- , create_pdf: { name: kivi.t8('Create PDF'), icon: "pdf", callback: kivi.requirement_spec.create_reqspec_pdf }
- , create_version: { name: kivi.t8('Create new version'), icon: "new", callback: kivi.requirement_spec.create_version, disabled: kivi.requirement_spec.disable_commands }
- , copy_reqspec: { name: kivi.t8('Copy requirement spec'), icon: "copy", callback: kivi.requirement_spec.copy_reqspec }
- , delete_reqspec: { name: kivi.t8('Delete requirement spec'), icon: "delete", callback: kivi.requirement_spec.delete_reqspec }
+ sep98: "---------"
+ , general_actions: { name: kivi.t8('Requirement spec actions'), className: 'context-menu-heading' }
+ , create_pdf: { name: kivi.t8('Create PDF'), icon: "pdf", callback: kivi.requirement_spec.create_reqspec_pdf }
+ , create_version: { name: kivi.t8('Create new version'), icon: "new", callback: kivi.requirement_spec.create_version, disabled: kivi.requirement_spec.disable_commands }
+ , copy_reqspec: { name: kivi.t8('Copy requirement spec'), icon: "copy", callback: kivi.requirement_spec.copy_reqspec }
+ , delete_reqspec: { name: kivi.t8('Delete requirement spec'), icon: "delete", callback: kivi.requirement_spec.delete_reqspec }
+ , sep_paste_template: "---------"
+ , paste_template: { name: kivi.t8('Paste template'), icon: "paste", callback: kivi.requirement_spec.paste_template }
};
$.contextMenu({
, revert_to_version: { name: kivi.t8('Revert to version'), icon: "revert", callback: kivi.requirement_spec.revert_to_versioned_copy_ajax_call, disabled: kivi.requirement_spec.disable_versioned_copy_item_commands }
}, general_actions)
});
+
+ var paste_template_actions = {
+ };
} // if (is_template) ... else ...
var events = {
'#1 h' => '#1 h',
'#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.',
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.',
+ '#1 section(s)' => '#1 Abschnitt(e)',
+ '#1 text block(s) back' => '#1 Textlock/-blöcke vorne',
+ '#1 text block(s) front' => '#1 Textblock/-blöcke hinten',
'%' => '%',
'(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' => '(empfohlen) Fügen Sie die verwaisten Währungen in Ihr System ein. Sie können den Namen der Währung einfach ändern, indem Sie die Felder oben bearbeiten. Benutzen Sie keine Namen von Währungen, die Sie bereits benutzen.',
'*/' => '*/',
'Destination bin' => 'Ziellagerplatz',
'Destination warehouse' => 'Ziellager',
'Destination warehouse and bin' => 'Ziellager und -lagerplatz',
+ 'Detail view' => 'Detailanzeige',
'Details (one letter abbreviation)' => 'D',
'Difference' => 'Differenz',
'Directory' => 'Verzeichnis',
'No project type has been created yet.' => 'Es wurden noch keine Projekttypen angelegt.',
'No report with id #1' => 'Es gibt keinen Report mit der Id #1',
'No requirement spec statuses has been created yet.' => 'Es wurden noch keine Pflichtenheftstatus angelegt.',
+ 'No requirement spec templates have been created yet.' => 'Es wurden noch keine Pflichtenheftvorlangen angelegt.',
'No requirement spec type has been created yet.' => 'Es wurden noch keine Pflichtenhefttypen angelegt.',
'No risks level has been created yet.' => 'Es wurden noch keine Risikograde angelegt.',
'No sections created yet' => 'Keine Abschnitte erstellt',
'Partsgroup (name)' => 'Warengruppe (Name)',
'Password' => 'Passwort',
'Paste' => 'Einfügen',
+ 'Paste template' => 'Vorlage einfügen',
'Payables' => 'Verbindlichkeiten',
'Payment' => 'Zahlungsausgang',
'Payment / Delivery Options' => 'Zahlungs- und Lieferoptionen',
'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
'Select tax office...' => 'Finanzamt auswählen...',
+ 'Select template to paste' => 'Einzufügende Vorlage auswählen',
'Select type of removal' => 'Grund der Entnahme auswählen',
'Select type of transfer' => 'Grund der Umlagerung auswählen',
'Selected' => 'Ausgewählt',
'Show overdue sales quotations and requests for quotations...' => 'Überfällige Angebote und Preisanfragen anzeigen...',
'Show parts' => 'Artikel anzeigen',
'Show requirement spec' => 'Pflichtenheft anzeigen',
+ 'Show requirement spec template' => 'Pflichtenheftvorlage anzeigen',
'Show settings' => 'Einstellungen anzeigen',
'Show the picture in the part form' => 'Bild in Warenmaske anzeigen',
'Show the pictures in the result for search parts' => 'Bilder in Suchergebnis für Stammdaten -> Berichte -> Waren anzeigen',
'Weight' => 'Gewicht',
'Weight unit' => 'Gewichtseinheit',
'What <b>term</b> you are looking for?' => 'Nach welchem <b>Begriff</b> wollen Sie suchen?',
+ 'What this template contains' => 'Was diese Vorlage enthält',
'What type of item is this?' => 'Was ist dieser Artikel?',
'Which is located at doc/kivitendo-Dokumentation.pdf. Click here: ' => 'Diese befindet sich unter doc/kivitendo-Dokumentation.pdf. Klicken Sie hier:',
'With Extension Of Time' => 'mit Dauerfristverlängerung',
--- /dev/null
+[%- USE LxERP -%][%- USE HTML -%][%- USE L -%]
+[%- BLOCK text_blocks %]
+ [%- IF blocks.size %]
+ <li>
+ [%- title %]:
+ <ol>
+ [%- FOREACH block = blocks %]
+ <li>[%- HTML.escape(block.title) %]</li>
+ [%- END %]
+ </ol>
+ </li>
+ [%- END %]
+[%- END %]
+
+<h1>[%- LxERP.t8("Select template to paste") %]</h1>
+
+[%- IF !TEMPLATES.size %]
+<p>[%- LxERP.t8("No requirement spec templates have been created yet.") %]</p>
+
+<p><a href="#" onclick="$('#jqm_popup_dialog').jqmClose();">[%- LxERP.t8("Abort") %]</a></p>
+
+[%- ELSE %]
+
+<table>
+ <tr class="listheading">
+ <th>[%- LxERP.t8("Detail view") %]</th>
+ <th>[%- LxERP.t8("Paste template") %]</th>
+ <th>[%- LxERP.t8("Title") %]</th>
+ <th>[%- LxERP.t8("Last modification") %]</th>
+ </tr>
+
+[%- FOREACH template = TEMPLATES %]
+ <tr class="listrow[% loop.count % 2 %]">
+ <td>
+ <a href="#" onclick="$('#select-template-details-row-[% template.id %]').toggle(); $(this).find('span').toggle();">
+ <span>[+]</span>
+ <span style="display: none;">[-]</span>
+ </a>
+ </td>
+ <td><a href="#" onclick="paste_selected_template([% template.id %]);">[%- LxERP.t8("Paste template") %]</a></td>
+ <td>[%- HTML.escape(template.title) %]</td>
+ <td>[% template.mtime ? template.mtime.to_kivitendo(precision='minute') : template.itime.to_kivitendo(precision='minute') %]</td>
+ </tr>
+
+ <tr class="listrow[% loop.count % 2 %]" style="display: none;" id="select-template-details-row-[% template.id %]">
+ [% SET front = template.text_blocks_sorted(output_position=0) %]
+ [% SET sections = template.sections_sorted %]
+ [% SET back = template.text_blocks_sorted(output_position=1) %]
+ <td colspan="4">
+ [%- LxERP.t8("What this template contains") %]:<br>
+ <ul>
+ [% PROCESS text_blocks blocks=front title=LxERP.t8("#1 text block(s) front", front.size) %]
+
+ [%- IF sections.size %]
+ <li>[%- LxERP.t8("#1 section(s)", sections.size) %]:
+ <ol>
+ [%- FOREACH section = sections %]
+ <li>[%- HTML.escape(section.fb_number) %]: [%- HTML.escape(section.title) %]</li>
+ [%- END %]
+ </ol>
+ </li>
+ [%- END %]
+
+ [% PROCESS text_blocks blocks=back title=LxERP.t8("#1 text block(s) back", back.size) %]
+ </ul>
+ </td>
+ </tr>
+[%- END %]
+</table>
+
+<p><a href="#" onclick="$('#jqm_popup_dialog').jqmClose();">[%- LxERP.t8("Abort") %]</a></p>
+[%- END %]