X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=templates%2Fwebpages%2Frequirement_spec%2Fshow.html;h=285dcee155c0d37b1c69891047659b80b5294cdd;hb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44;hp=38711c14d2b85ef9d04b0860604a315df7813cf3;hpb=e8b07984052b974e46a84a2a4a8a4d3fd10e797a;p=kivitendo-erp.git diff --git a/templates/webpages/requirement_spec/show.html b/templates/webpages/requirement_spec/show.html index 38711c14d..285dcee15 100644 --- a/templates/webpages/requirement_spec/show.html +++ b/templates/webpages/requirement_spec/show.html @@ -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' %] @@ -6,14 +7,15 @@ [%- L.hidden_tag('requirement_spec_id', SELF.requirement_spec.id, 'data-is-template'=(SELF.requirement_spec.is_template ? 1 : 0)) -%] -
+
@@ -62,7 +64,7 @@ $(function() { metadata: { type: "sections" }, attr: { id: "sections", class: "section-context-menu" }, children: [ -[% FOREACH section = SELF.requirement_spec.sections %] +[% FOREACH section = sections %] [% P.requirement_spec_item_jstree_data(section).json %][% IF !loop.last %],[% END %] [% END %] ]}, @@ -78,7 +80,7 @@ $(function() { ]; 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 -%]" @@ -86,32 +88,20 @@ $(function() { [%- END -%] ]; - $('#tree').jstree({ - core: { - animation: 0, - initially_open: initially_open, - }, - json_data: { - data: tree_data - }, - crrm: { - move: { - check_move: kivi.requirement_spec.tree_check_move, - open_move: true - } - }, - themes: { - theme: "requirement-spec" - }, - plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ] - }) - .bind("move_node.jstree", kivi.requirement_spec.tree_node_moved) - .bind("click.jstree", kivi.requirement_spec.tree_node_clicked); + kivi.requirement_spec.initialize_requirement_spec({ + 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 %] - $.jstree._reference("#tree").select_node('#fb-[% SELF.requirement_spec_item.id %]', true); + , initially_selected_node: '#fb-[% SELF.requirement_spec_item.id %]' [% END %] - - kivi.requirement_spec.create_context_menus([% SELF.requirement_spec.is_template ? 'true' : 'false' %]); + , time_based_units: { + [% FOREACH unit = SELF.time_based_units %] + [% UNLESS loop.first %], [% END %] "[% JavaScript.escape(unit.name) %]": true + [% END %] + } + }); }); -->