Pflichtenhefte: PDFs zu Arbeitskopie und Versionen erzeugen
[kivitendo-erp.git] / templates / webpages / requirement_spec / show.html
1 [%- USE JSON -%][%- USE HTML %][%- USE L %][%- USE LxERP %][%- USE P -%]
2
3 [%- INCLUDE 'common/flash.html' %]
4
5 [%- INCLUDE 'requirement_spec/_header.html' %]
6
7 [%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id) -%]
8
9 <div class="tabwidget">
10  <ul>
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   <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>
14   <li><a href="controller.pl?action=RequirementSpecVersion/list&requirement_spec_id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Versions") %]</a></li>
15  </ul>
16
17  <div id="function-blocks-tab">
18   <div id="requirement_spec_version">
19     [%- INCLUDE 'requirement_spec/_version.html' requirement_spec=SELF.requirement_spec -%]
20   </div>
21
22   <div id="column-container" class="clearfix">
23    <div id="tree-column">
24     <div id="tree"></div>
25    </div>
26
27    <div id="content-column" class="clearfix">
28     [% L.hidden_tag('current_content_type', SELF.requirement_spec_item.id ? 'section' : '') %]
29     [% L.hidden_tag('current_content_id',   SELF.requirement_spec_item.id) %]
30
31     <div id="column-content">
32      [%- IF SELF.requirement_spec_item -%]
33       [%- INCLUDE 'requirement_spec_item/_section.html' requirement_spec_item=SELF.requirement_spec_item -%]
34      [%- ELSE -%]
35       [%- INCLUDE 'requirement_spec_item/_no_section.html' -%]
36      [%- END -%]
37     </div>
38    </div>
39   </div>
40  </div>
41 </div>
42
43 <script type="text/javascript">
44  <!--
45 $(function() {
46   var tree_data = [
47     { data:     [% JSON.json(LxERP.t8("Text blocks front")) %],
48       metadata: { type: "text-blocks-front" },
49       attr:     { id: "tb-front", class: "text-block-context-menu" },
50       children: [
51 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=0) %]
52  [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
53 [% END %]
54       ]},
55
56     { data:     [% JSON.json(LxERP.t8("Sections")) %],
57       metadata: { type: "sections" },
58       attr:     { id: "sections", class: "section-context-menu" },
59       children: [
60 [% FOREACH section = SELF.requirement_spec.sections %]
61  [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %]
62 [% END %]
63       ]},
64
65     { data:     [% JSON.json(LxERP.t8("Text blocks back")) %],
66       metadata: { type: "text-blocks-back" },
67       attr:     { id: "tb-back", class: "text-block-context-menu" },
68       children: [
69 [% FOREACH tb = SELF.requirement_spec.text_blocks_sorted(output_position=1) %]
70  [% P.requirement_spec_text_block_jstree_data(tb).json %][% IF !loop.last %],[% END %]
71 [% END %]
72       ]}];
73
74   $('#tree').jstree({
75     core: {
76       animation: 0,
77       initially_open: [ "tb-front", "tb-back", "sections"
78 [%- FOREACH section = SELF.requirement_spec.sections -%]
79         , "fb-[% section.id %]"
80  [%- FOREACH function_block = section.children -%]
81         , "fb-[% function_block.id -%]"
82  [%- END -%]
83 [%- END -%]
84     ]},
85     json_data: {
86       data: tree_data
87     },
88     crrm: {
89       move: {
90         check_move: requirement_spec_tree_check_move,
91         open_move:  true
92       }
93     },
94     themes: {
95       theme: "requirement-spec"
96     },
97     plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
98   })
99   .bind("move_node.jstree", requirement_spec_tree_node_moved)
100   .bind("click.jstree",     requirement_spec_tree_node_clicked);
101 [% IF SELF.requirement_spec_item %]
102   $.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true);
103 [% END %]
104
105   create_requirement_spec_context_menus();
106 });
107
108   -->
109 </script>