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">
51 { data: [% JSON.json(LxERP.t8("Text blocks front")) %],
52 metadata: { type: "text-blocks-front" },
53 attr: { id: "tb-front", class: "text-block-context-menu" },
55 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=0) %]
56 [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
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 { data: [% JSON.json(LxERP.t8("Text blocks back")) %],
70 metadata: { type: "text-blocks-back" },
71 attr: { id: "tb-back", class: "text-block-context-menu" },
73 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=1) %]
74 [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
79 var initially_open = ['tb-front', 'tb-back', 'sections'
80 [%- FOREACH section = SELF.requirement_spec.sections -%]
81 , "fb-[% section.id %]"
82 [%- FOREACH function_block = section.children -%]
83 , "fb-[% function_block.id -%]"
91 initially_open: initially_open,
98 check_move: kivi.requirement_spec.tree_check_move,
103 theme: "requirement-spec"
105 plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
107 .bind("move_node.jstree", kivi.requirement_spec.tree_node_moved)
108 .bind("click.jstree", kivi.requirement_spec.tree_node_clicked);
109 [% IF SELF.requirement_spec_item %]
110 $.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true);
113 kivi.requirement_spec.create_context_menus([% SELF.requirement_spec.is_template ? 'true' : 'false' %]);