Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7c54e92f

Von Moritz Bunkus vor fast 10 Jahren hinzugefügt

  • ID 7c54e92fc42214744a82cec3f648d0e044ede238
  • Vorgänger f93577f6
  • Nachfolger a34c05f3

Pflichtenhefte: Ausgabemöglichkeit als HTML

Menüpunkte dafür werden aber nur eingeblendet, sofern auch eine Vorlage
dafür im Vorlagenverzeichnis existiert.

Die erzeugte HTML-Seite wird in einem neuen Browserfenster angezeigt.

Unterschiede anzeigen:

js/requirement_spec.js
151 151
      plugins: [ "themes", "json_data", "ui", "crrm", "dnd" ]
152 152
    });
153 153

  
154
  ns.create_context_menus(data.is_template);
154
  ns.create_context_menus(data);
155 155
  $('#requirement_spec_tabs').on("tabsbeforeactivate", ns.tabs_before_activate);
156 156

  
157 157
  ns.time_based_units = data.time_based_units;
......
647 647
  $.download("controller.pl", data);
648 648
};
649 649

  
650
ns.create_reqspec_html = function(key, opt) {
651
  window.open("controller.pl?action=RequirementSpec/create_html&id=" + encodeURIComponent($('#requirement_spec_id').val()), '_blank');
652
  return true;
653
};
654

  
650 655
ns.copy_reqspec = function(key, opt) {
651 656
  window.location.href = "controller.pl?action=RequirementSpec/new&copy_source_id=" + encodeURIComponent($('#requirement_spec_id').val());
652 657
  return true;
......
697 702
  return true;
698 703
};
699 704

  
705
ns.create_html_for_versioned_copy_ajax_call = function(key, opt) {
706
  window.open("controller.pl?action=RequirementSpec/create_html&id=" + encodeURIComponent(ns.find_versioned_copy_id(opt.$trigger) || $('#requirement_spec_id').val()), '_blank');
707
  return true;
708
};
709

  
700 710
ns.revert_to_versioned_copy_ajax_call = function(key, opt) {
701 711
  if (!confirm(kivi.t8('Do you really want to revert to this version?')))
702 712
    return true;
......
862 872
// ----------------------------- context menus -----------------------------
863 873
// -------------------------------------------------------------------------
864 874

  
865
ns.create_context_menus = function(is_template) {
866
  if (is_template) {
875
ns.create_context_menus = function(data) {
876
  if (data.is_template) {
867 877
    var general_actions = {
868 878
        sep98:           "---------"
869 879
      , general_actions: { name: kivi.t8('Requirement spec template actions'), className: 'context-menu-heading' }
......
887 897
        sep98:              "---------"
888 898
      , general_actions:    { name: kivi.t8('Requirement spec actions'), className: 'context-menu-heading' }
889 899
      , create_pdf:         { name: kivi.t8('Create PDF'),              icon: "pdf",    callback: kivi.requirement_spec.create_reqspec_pdf }
900
      , create_html:        { name: kivi.t8('Create HTML'),             icon: "html",   callback: kivi.requirement_spec.create_reqspec_html }
890 901
      , create_version:     { name: kivi.t8('Create new version'),      icon: "new",    callback: kivi.requirement_spec.create_version, disabled: kivi.requirement_spec.disable_commands }
891 902
      , copy_reqspec:       { name: kivi.t8('Copy requirement spec'),   icon: "copy",   callback: kivi.requirement_spec.copy_reqspec   }
892 903
      , delete_reqspec:     { name: kivi.t8('Delete requirement spec'), icon: "delete", callback: kivi.requirement_spec.delete_reqspec }
......
896 907
      , paste_template:     { name: kivi.t8('Paste template'),     icon: "paste",  callback: kivi.requirement_spec.paste_template }
897 908
    };
898 909

  
910
    var versioned_copy_actions = {
911
        heading:             { name: kivi.t8('Version actions'), className: 'context-menu-heading' }
912
      , create_version_pdf:  { name: kivi.t8('Create PDF'),        icon: "pdf",    callback: kivi.requirement_spec.create_pdf_for_versioned_copy_ajax_call                                                                      }
913
      , create_version_html: { name: kivi.t8('Create HTML'),       icon: "html",   callback: kivi.requirement_spec.create_html_for_versioned_copy_ajax_call                                                                     }
914
      , revert_to_version:   { name: kivi.t8('Revert to version'), icon: "revert", callback: kivi.requirement_spec.revert_to_versioned_copy_ajax_call,     disabled: kivi.requirement_spec.disable_versioned_copy_item_commands }
915
    };
916

  
917
    if (!data.html_template_exists) {
918
      delete general_actions.create_html;
919
      delete versioned_copy_actions.create_version_html;
920
    }
921

  
899 922
    $.contextMenu({
900 923
      selector: '.versioned-copy-context-menu',
901
      items:    $.extend({
902
          heading:            { name: kivi.t8('Version actions'), className: 'context-menu-heading' }
903
        , create_version_pdf: { name: kivi.t8('Create PDF'),        icon: "pdf",    callback: kivi.requirement_spec.create_pdf_for_versioned_copy_ajax_call                                                                      }
904
        , revert_to_version:  { name: kivi.t8('Revert to version'), icon: "revert", callback: kivi.requirement_spec.revert_to_versioned_copy_ajax_call,     disabled: kivi.requirement_spec.disable_versioned_copy_item_commands }
905
      }, general_actions)
924
      items:    $.extend(versioned_copy_actions, general_actions)
906 925
    });
907 926

  
908 927
    $.contextMenu({

Auch abrufbar als: Unified diff