mini-DMS: Filesystem-Backend: undef-Warnung vermeiden
[kivitendo-erp.git] / templates / webpages / requirement_spec / show.html
index 93aad7d..3cd23ef 100644 (file)
@@ -1,4 +1,5 @@
-[%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%]
+[%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%][%- USE JavaScript -%]
+[% SET sections = SELF.requirement_spec.sections_sorted || [] %]
 
 [%- INCLUDE 'common/flash.html' %]
 
@@ -10,7 +11,8 @@
  <ul>
   <li id="tab-header-function-block"><a href="#function-blocks-tab">[%- LxERP.t8("Content") %]</a></li>
   <li id="tab-header-basic-settings"><a href="controller.pl?action=RequirementSpec/ajax_show_basic_settings&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Basic settings") %]</a></li>
-  <li id="tab-header-time-cost-estimate"><a href="controller.pl?action=RequirementSpec/ajax_show_time_and_cost_estimate&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Time and cost estimate") %]</a></li>
+  <li id="tab-header-time-cost-estimate"><a href="controller.pl?action=RequirementSpec/ajax_show_time_and_cost_estimate&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Time and price estimate") %]</a></li>
+  <li id="tab-header-additional-parts"><a href="controller.pl?action=RequirementSpecPart/show&requirement_spec_id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Additional articles") %]</a></li>
   [%- UNLESS SELF.requirement_spec.is_template %]
    <li id="tab-header-versions"><a href="controller.pl?action=RequirementSpecVersion/list&requirement_spec_id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Versions") %]</a></li>
    <li id="tab-header-quotations-orders"><a href="[% SELF.url_for(controller='RequirementSpecOrder', action='list', requirement_spec_id=SELF.requirement_spec.id) %]">[%- LxERP.t8("Quotations and orders") %]</a></li>
@@ -54,7 +56,7 @@ $(function() {
       attr:     { id: "tb-front", class: "text-block-context-menu" },
       children: [
 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=0) %]
- [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
+ [% tb.presenter.jstree_data.json %][% IF !loop.last %],[% END %]
 [% END %]
       ]},
 
@@ -62,8 +64,8 @@ $(function() {
       metadata: { type: "sections" },
       attr:     { id: "sections", class: "section-context-menu" },
       children: [
-[% FOREACH section = SELF.requirement_spec.sections %]
- [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %]
+[% FOREACH section = sections %]
+ [% section.presenter.jstree_data.json %][% IF !loop.last %],[% END %]
 [% END %]
       ]},
 
@@ -72,13 +74,13 @@ $(function() {
       attr:     { id: "tb-back", class: "text-block-context-menu" },
       children: [
 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=1) %]
- [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
+ [% tb.presenter.jstree_data.json %][% IF !loop.last %],[% END %]
 [% END %]
       ]}
   ];
 
   var initially_open = ['tb-front', 'tb-back', 'sections'
-[%- FOREACH section = SELF.requirement_spec.sections -%]
+[%- FOREACH section = sections -%]
         , "fb-[% section.id %]"
  [%- FOREACH function_block = section.children -%]
         , "fb-[% function_block.id -%]"
@@ -90,9 +92,15 @@ $(function() {
       initially_open:          initially_open
     , tree_data:               tree_data
     , is_template:             [% SELF.requirement_spec.is_template ? 'true' : 'false' %]
+    , html_template_exists:    [% SELF.html_template                ? 'true' : 'false' %]
 [% IF SELF.requirement_spec_item %]
     , initially_selected_node: '#fb-[% SELF.requirement_spec_item.id %]'
 [% END %]
+    , time_based_units: {
+      [% FOREACH unit = SELF.time_based_units %]
+       [% UNLESS loop.first %], [% END %] "[% JavaScript.escape(unit.name) %]": true
+      [% END %]
+    }
   });
 });