1 [%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%]
3 [%- INCLUDE 'common/flash.html' %]
5 [%- INCLUDE 'requirement_spec/_header.html' %]
7 [%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id, 'data-is-template'=(SELF.requirement_spec.is_template ? 1 : 0)) -%]
9 <div class="tabwidget">
11 <li><a href="#function-blocks-tab">[%- LxERP.t8("Content") %]</a></li>
12 <li><a href="controller.pl?action=RequirementSpec/ajax_edit&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Basic settings") %]</a></li>
13 [%- UNLESS SELF.requirement_spec.is_template %]
14 <li><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>
15 <li><a href="controller.pl?action=RequirementSpecVersion/list&requirement_spec_id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Versions") %]</a></li>
19 <div id="function-blocks-tab">
20 [%- UNLESS SELF.requirement_spec.is_template %]
21 <div id="requirement_spec_version">
22 [%- INCLUDE 'requirement_spec/_version.html' requirement_spec=SELF.requirement_spec -%]
26 <div id="column-container" class="clearfix">
27 <div id="tree-column">
31 <div id="content-column" class="clearfix">
32 [% L.hidden_tag('current_content_type', SELF.requirement_spec_item.id ? 'section' : '') %]
33 [% L.hidden_tag('current_content_id', SELF.requirement_spec_item.id) %]
35 <div id="column-content">
36 [%- IF SELF.requirement_spec_item -%]
37 [%- INCLUDE 'requirement_spec_item/_section.html' requirement_spec_item=SELF.requirement_spec_item -%]
39 [%- INCLUDE 'requirement_spec_item/_no_section.html' -%]
47 <script type="text/javascript">
50 var initially_open = ['sections'
51 [%- FOREACH section = SELF.requirement_spec.sections -%]
52 , "fb-[% section.id %]"
53 [%- FOREACH function_block = section.children -%]
54 , "fb-[% function_block.id -%]"
60 data: [% JSON.json(LxERP.t8("Sections")) %],
61 metadata: { type: "sections" },
62 attr: { id: "sections", class: "section-context-menu" },
64 [% FOREACH section = SELF.requirement_spec.sections %]
65 [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %]
69 [% UNLESS SELF.requirement_spec.is_template %]
71 data: [% JSON.json(LxERP.t8("Text blocks front")) %],
72 metadata: { type: "text-blocks-front" },
73 attr: { id: "tb-front", class: "text-block-context-menu" },
75 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=0) %]
76 [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
81 data: [% JSON.json(LxERP.t8("Text blocks back")) %],
82 metadata: { type: "text-blocks-back" },
83 attr: { id: "tb-back", class: "text-block-context-menu" },
85 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=1) %]
86 [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
90 initially_open = initially_open.concat(['tb-front', 'tb-back']);
96 initially_open: initially_open,
103 check_move: kivi.requirement_spec.tree_check_move,
108 theme: "requirement-spec"
110 plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
112 .bind("move_node.jstree", kivi.requirement_spec.tree_node_moved)
113 .bind("click.jstree", kivi.requirement_spec.tree_node_clicked);
114 [% IF SELF.requirement_spec_item %]
115 $.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true);
118 kivi.requirement_spec.create_context_menus([% SELF.requirement_spec.is_template ? 'true' : 'false' %]);