1 /* Functions used for the requirement specs */
3 namespace("kivi.requirement_spec", function(ns) {
5 // -----------------------------------------------------------------------------
6 // ------------------------------ basic settings -------------------------------
7 // -----------------------------------------------------------------------------
9 ns.basic_settings_customer_changed = function(customer_ctrl, value_ctrl) {
11 'controller.pl?action=Customer/get_hourly_rate',
12 { id: $(customer_ctrl).val() },
13 function(data) { if (data.hourly_rate_formatted) $(value_ctrl).val(data.hourly_rate_formatted); }
17 // -----------------------------------------------------------------------------
18 // ------------------------------ the tree itself ------------------------------
19 // -----------------------------------------------------------------------------
21 ns.tree_check_move = function(data) {
22 var dragged_type = data.o.data('type');
23 var dropped_type = data.r.data('type');
25 // console.debug("dragged " + dragged_type + " dropped " + dropped_type + " dir " + data.p);
27 if ((dragged_type == "sections") || (dragged_type == "text-blocks-front") || (dragged_type == "text-blocks-back"))
30 if (dragged_type == "text-block") {
31 if ((dropped_type == "text-blocks-front") || (dropped_type == "text-blocks-back"))
32 return (data.p == "inside") || (data.p == "last");
33 if (dropped_type == "text-block")
34 return (data.p == "before") || (data.p == "after");
39 if (dragged_type == "section") {
40 if (dropped_type == "sections")
41 return (data.p == "inside") || (data.p == "last");
42 if (dropped_type == "section")
43 return (data.p == "before") || (data.p == "after");
48 // dragged_type == (sub) function blocks
49 if ((dropped_type == "text-block") || (dropped_type == "text-blocks-front") || (dropped_type == "text-blocks-back"))
52 var dropped_depth = dropped_type == "sections" ? 0 : dropped_type == "section" ? 1 : data.r.parent().parent().data('type') != "function-block" ? 2 : 3;
53 if ((data.p == "inside") || (data.p == "last"))
56 var dragged_depth = 1 + data.o.children('ul').size();
58 // console.debug("dropped_depth " + dropped_depth + " dragged_depth " + dragged_depth);
60 return (2 <= dropped_depth) && ((dragged_depth + dropped_depth) <= 4);
63 ns.tree_node_moved = function(event) {
64 // console.debug("node moved");
65 var move_obj = $.jstree._reference('#tree')._get_move();
66 var dragged = move_obj.o;
67 var dropped = move_obj.r;
68 var controller = dragged.data("type") == "text-block" ? "RequirementSpecTextBlock" : "RequirementSpecItem";
70 action: controller + "/dragged_and_dropped",
71 requirement_spec_id: $('#requirement_spec_id').val(),
72 id: dragged.data("id"),
73 dropped_id: dropped.data("id"),
74 dropped_type: dropped.data("type"),
76 current_content_type: $('#current_content_type').val(),
77 current_content_id: $('#current_content_id').val()
79 // console.debug("controller: " + controller);
80 // console.debug(data);
82 $.post("controller.pl", data, kivi.eval_json_result);
87 ns.tree_node_clicked = function(event) {
88 var node = $.jstree._reference('#tree')._get_node(event.target);
89 var type = node ? node.data('type') : undefined;
94 var url = 'controller.pl?action='
95 $.get('controller.pl', {
96 action: (/^text-block/.test(type) ? 'RequirementSpecTextBlock' : 'RequirementSpecItem') + '/ajax_list.js',
97 requirement_spec_id: $('#requirement_spec_id').val(),
98 current_content_type: $('#current_content_type').val(),
99 current_content_id: $('#current_content_id').val(),
101 clicked_id: node.data('id')
102 }, kivi.eval_json_result);
105 // -------------------------------------------------------------------------
106 // ------------------------------ text blocks ------------------------------
107 // -------------------------------------------------------------------------
109 ns.find_text_block_id = function(clicked_elt) {
110 var id = $(clicked_elt).attr('id');
111 // console.log("id: " + id);
112 if (/^text-block-\d+$/.test(id)) {
113 // console.log("find_text_block_id: case 1: " + id.substr(11));
114 return id.substr(11) * 1;
117 id = $(clicked_elt).closest("[id*=text-block-]").attr('id')
118 if (/^text-block-\d+$/.test(id)) {
119 // console.log("find_text_block_id: case 2: " + id.substr(11));
120 return id.substr(11) * 1;
123 id = $(clicked_elt).closest("[id*=tb-]").attr('id')
124 if (/^tb-\d+$/.test(id)) {
125 // console.log("find_text_block_id: case 3: " + id.substr(3));
126 return id.substr(3) * 1;
129 // console.log("find_text_block_id: case undef, id: " + id);
133 ns.find_text_block_output_position = function(clicked_elt) {
134 var output_position = $(clicked_elt).closest('#text-block-list-container').find('#text_block_output_position').val();
136 return output_position;
138 var type = $(clicked_elt).closest('#tb-back,#tb-front').data('type') || $('#current_content_type').val();
139 if (/^text-blocks-(front|back)/.test(type))
140 return type == "text-blocks-front" ? 0 : 1;
145 ns.disable_edit_text_block_commands = function(key, opt) {
146 return ns.find_text_block_id(opt.$trigger) == undefined;
149 ns.standard_text_block_ajax_call = function(key, opt, other_data) {
151 action: "RequirementSpecTextBlock/ajax_" + key,
152 requirement_spec_id: $('#requirement_spec_id').val(),
153 id: ns.find_text_block_id(opt.$trigger),
154 output_position: ns.find_text_block_output_position(opt.$trigger),
155 current_content_type: $('#current_content_type').val(),
156 current_content_id: $('#current_content_id').val()
159 $.post("controller.pl", $.extend(data, other_data || {}), kivi.eval_json_result);
164 ns.cancel_edit_text_block_form = function(id_base) {
165 var id = $('#' + id_base + '_id').val();
166 $('#' + id_base + '_form').remove();
168 $('#text-block-' + id).show();
171 ns.ask_delete_text_block = function(key, opt) {
172 if (confirm(kivi.t8("Are you sure?")))
173 ns.standard_text_block_ajax_call(key, opt);
177 ns.text_block_input_key_down = function(event) {
178 if(event.keyCode == 13) {
179 event.preventDefault();
180 var prefix = $(this).attr('id').match("^edit_function_block_\\d+")[0];
181 $("#" + prefix + "_submit").click();
186 // --------------------------------------------------------------------------------
187 // ------------------------------ sections and items ------------------------------
188 // --------------------------------------------------------------------------------
190 ns.find_item_id = function(clicked_elt) {
191 // console.log("clicked id: " + $(clicked_elt).attr('id'));
192 var id = $(clicked_elt).attr('id');
193 var result = /^(function-block|function-block-content|sub-function-block|sub-function-block-content|section|section-header)-(\d+)$/.exec(id);
195 // console.log("find_item_id: case 1: " + result[2]);
199 id = $(clicked_elt).closest("[id*=fb-]").attr('id')
200 if (/^fb-\d+$/.test(id)) {
201 // console.log("find_item_id: case 2: " + id.substr(3));
202 return id.substr(3) * 1;
205 // console.log("find_item_id: case undef");
209 ns.standard_item_ajax_call = function(key, opt, other_data) {
211 action: "RequirementSpecItem/ajax_" + key,
212 requirement_spec_id: $('#requirement_spec_id').val(),
213 id: ns.find_item_id(opt.$trigger),
214 current_content_type: $('#current_content_type').val(),
215 current_content_id: $('#current_content_id').val()
218 // console.log("I would normally POST the following now:");
219 // console.log(data);
220 $.post("controller.pl", $.extend(data, other_data || {}), kivi.eval_json_result);
225 ns.disable_edit_item_commands = function(key, opt) {
226 return ns.find_item_id(opt.$trigger) == undefined;
229 ns.disable_add_function_block_command = function(key, opt) {
230 return opt.$trigger.attr('id') == "sections";
233 ns.cancel_edit_item_form = function(form_id_base, options) {
234 $('#' + form_id_base + '_form').remove();
238 $(options.to_show).show();
239 if (options.to_hide_if_empty && (1 == $(options.to_hide_if_empty).children().size()))
240 $(options.to_hide_if_empty).hide();
243 ns.ask_delete_item = function(key, opt) {
244 if (confirm(kivi.t8("Are you sure?")))
245 ns.standard_item_ajax_call(key, opt);
249 ns.handle_text_block_popup_menu_markings = function(opt, add) {
250 var id = ns.find_text_block_id(opt.$trigger);
252 $('#text-block-' + id).toggleClass('selected', add);
256 ns.text_block_popup_menu_shown = function(opt) {
257 return ns.handle_text_block_popup_menu_markings(opt, true);
260 ns.text_block_popup_menu_hidden = function(opt) {
261 return ns.handle_text_block_popup_menu_markings(opt, false);
264 ns.handle_item_popup_menu_markings = function(opt, add) {
265 var id = ns.find_item_id(opt.$trigger);
267 $('#section-' + id + ',#function-block-' + id + ',#sub-function-block-' + id).toggleClass('selected', add);
271 ns.item_popup_menu_shown = function(opt) {
272 return ns.handle_item_popup_menu_markings(opt, true);
275 ns.item_popup_menu_hidden = function(opt) {
276 return ns.handle_item_popup_menu_markings(opt, false);
279 // -------------------------------------------------------------------------
280 // ------------------------------- templates -------------------------------
281 // -------------------------------------------------------------------------
283 ns.paste_template = function(key, opt, other_data) {
284 open_jqm_window({ url: 'controller.pl?action=RequirementSpec/select_template_to_paste' });
287 ns.paste_selected_template = function(template_id) {
288 $('#jqm_popup_dialog').jqmClose();
291 action: "RequirementSpec/paste_template",
292 id: $('#requirement_spec_id').val(),
293 template_id: template_id,
294 current_content_type: $('#current_content_type').val(),
295 current_content_id: $('#current_content_id').val()
298 // console.log("I would normally POST the following now:");
299 // console.log(data);
300 $.post("controller.pl", data, kivi.eval_json_result);
305 // -------------------------------------------------------------------------
306 // ---------------------------- basic settings -----------------------------
307 // -------------------------------------------------------------------------
308 ns.standard_basic_settings_ajax_call = function(key, opt) {
309 if (key == 'cancel') {
310 if (confirm(kivi.t8('Do you really want to cancel?'))) {
311 $('#basic_settings').show();
312 $('#basic_settings_form').remove();
317 var data = 'action=RequirementSpec/ajax_' + key + '&id=' + encodeURIComponent($('#requirement_spec_id').val());
319 $.post("controller.pl", data, kivi.eval_json_result);
324 // -------------------------------------------------------------------------
325 // -------------------------- time/cost estimate ---------------------------
326 // -------------------------------------------------------------------------
328 ns.standard_time_cost_estimate_ajax_call = function(key, opt) {
329 if ((key == 'cancel') && !confirm(kivi.t8('Do you really want to cancel?')))
332 var data = "action=RequirementSpec/ajax_" + key + "_time_and_cost_estimate&";
335 data += $('#edit_time_cost_estimate_form').serialize()
336 + '&' + $('#current_content_type').serialize()
337 + '&' + $('#current_content_id').serialize();
339 data += 'id=' + encodeURIComponent($('#requirement_spec_id').val());
341 $.post("controller.pl", data, kivi.eval_json_result);
346 ns.time_cost_estimate_input_key_down = function(event) {
347 if(event.keyCode == 13) {
348 event.preventDefault();
349 ns.standard_time_cost_estimate_ajax_call('save');
354 // -------------------------------------------------------------------------
355 // --------------------------- quotations/orders ---------------------------
356 // -------------------------------------------------------------------------
358 ns.find_quotation_order_id = function(clicked_elt) {
359 return $(clicked_elt).find('>[name=order_id]').val();
362 ns.standard_quotation_order_ajax_call = function(key, opt) {
363 if ((key == 'cancel') && !confirm(kivi.t8('Do you really want to cancel?')))
366 else if ((key == 'create') && $('#quotations_and_orders_form INPUT[name="sections[].order_part_id"]').filter(function(idx, elt) { return ($(elt).val() || '') == '' }).size()) {
367 alert(kivi.t8('There is one or more sections for which no part has been assigned yet; therefore creating the new record is not possible yet.'));
371 var data = 'action=RequirementSpecOrder/' + key
372 + '&' + $('#requirement_spec_id').serialize();
374 if ((key == 'save_assignment') || (key == 'create') || (key == 'do_update'))
375 data += '&' + $('#quotations_and_orders_form').serialize();
376 else if ((key == 'update') || (key == 'delete'))
377 data += '&rs_order_id=' + encodeURIComponent(ns.find_quotation_order_id(opt.$trigger));
379 // console.log("I would normally POST the following now:");
380 // console.log(data);
381 $.post("controller.pl", data, kivi.eval_json_result);
386 ns.ask_delete_quotation_order = function(key, opt) {
387 if (confirm(kivi.t8("Are you sure?")))
388 ns.standard_quotation_order_ajax_call(key, opt);
392 ns.disable_edit_quotation_order_commands = function(key, opt) {
393 return ns.find_quotation_order_id(opt.$trigger) == undefined;
396 ns.disable_create_quotation_order_commands = function(key, opt) {
397 return !$('#quotations_and_orders_sections');
400 ns.assign_order_part_id_to_all = function() {
401 var order_part_id = $('#quoations_and_orders_order_id').val();
402 $('#quotations_and_orders_form SELECT[name="sections[].order_part_id"]').each(function(idx, elt) {
403 $(elt).val(order_part_id);
407 // -------------------------------------------------------------------------
408 // ---------------------------- general actions ----------------------------
409 // -------------------------------------------------------------------------
411 ns.create_reqspec_pdf = function(key, opt) {
413 action: "RequirementSpec/create_pdf",
414 id: $('#requirement_spec_id').val()
416 $.download("controller.pl", data);
419 ns.copy_reqspec = function(key, opt) {
420 window.location.href = "controller.pl?action=RequirementSpec/new©_source_id=" + encodeURIComponent($('#requirement_spec_id').val());
424 ns.delete_reqspec = function(key, opt) {
425 if (confirm(kivi.t8("Are you sure?")))
426 window.location.href = "controller.pl?action=RequirementSpec/destroy&id=" + encodeURIComponent($('#requirement_spec_id').val());
430 ns.disable_commands = function(key, opt) {
431 if (key === "create_version")
432 return ($('#current_version_id').val() || '') == '' ? false : true;
436 // -------------------------------------------------------------------------
437 // -------------------------------- versions -------------------------------
438 // -------------------------------------------------------------------------
440 ns.find_versioned_copy_id = function(clicked_elt) {
441 var id = $(clicked_elt).find("[name=versioned_copy_id]");
442 return id ? id.val() : undefined;
445 ns.disable_versioned_copy_item_commands = function(key, opt) {
446 if (key === "revert_to_version")
447 return !ns.find_versioned_copy_id(opt.$trigger);
451 ns.create_version = function() {
452 open_jqm_window({ url: 'controller.pl',
453 data: { action: 'RequirementSpecVersion/new',
454 requirement_spec_id: $('#requirement_spec_id').val() },
455 id: 'new_requirement_spec_version_window' });
459 ns.create_pdf_for_versioned_copy_ajax_call = function(key, opt) {
461 action: "RequirementSpec/create_pdf",
462 id: ns.find_versioned_copy_id(opt.$trigger)
464 $.download("controller.pl", data);
469 ns.revert_to_versioned_copy_ajax_call = function(key, opt) {
470 if (!confirm(kivi.t8('Do you really want to revert to this version?')))
474 action: 'RequirementSpec/revert_to',
475 versioned_copy_id: ns.find_versioned_copy_id(opt.$trigger),
476 id: $('#requirement_spec_id').val()
479 $.post("controller.pl", data, kivi.eval_json_result);
484 // -------------------------------------------------------------------------
485 // ----------------------------- context menus -----------------------------
486 // -------------------------------------------------------------------------
488 ns.create_context_menus = function(is_template) {
490 var general_actions = {
492 , general_actions: { name: kivi.t8('Requirement spec template actions'), className: 'context-menu-heading' }
493 // , sep99: "---------"
494 , copy_reqspec: { name: kivi.t8('Copy template'), icon: "copy", callback: kivi.requirement_spec.copy_reqspec }
495 , delete_reqspec: { name: kivi.t8('Delete template'), icon: "delete", callback: kivi.requirement_spec.delete_reqspec }
498 } else { // if (is_template)
499 var general_actions = {
501 , general_actions: { name: kivi.t8('Requirement spec actions'), className: 'context-menu-heading' }
502 , create_pdf: { name: kivi.t8('Create PDF'), icon: "pdf", callback: kivi.requirement_spec.create_reqspec_pdf }
503 , create_version: { name: kivi.t8('Create new version'), icon: "new", callback: kivi.requirement_spec.create_version, disabled: kivi.requirement_spec.disable_commands }
504 , copy_reqspec: { name: kivi.t8('Copy requirement spec'), icon: "copy", callback: kivi.requirement_spec.copy_reqspec }
505 , delete_reqspec: { name: kivi.t8('Delete requirement spec'), icon: "delete", callback: kivi.requirement_spec.delete_reqspec }
506 , sep_paste_template: "---------"
507 , paste_template: { name: kivi.t8('Paste template'), icon: "paste", callback: kivi.requirement_spec.paste_template }
511 selector: '.versioned-copy-context-menu',
513 heading: { name: kivi.t8('Version actions'), className: 'context-menu-heading' }
514 , create_version_pdf: { name: kivi.t8('Create PDF'), icon: "pdf", callback: kivi.requirement_spec.create_pdf_for_versioned_copy_ajax_call }
515 , 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 }
519 var paste_template_actions = {
521 } // if (is_template) ... else ...
524 show: kivi.requirement_spec.text_block_popup_menu_shown
525 , hide: kivi.requirement_spec.text_block_popup_menu_hidden
529 selector: '.text-block-context-menu',
531 show: kivi.requirement_spec.text_block_popup_menu_shown
532 , hide: kivi.requirement_spec.text_block_popup_menu_hidden
535 heading: { name: kivi.t8('Text block actions'), className: 'context-menu-heading' }
536 , add: { name: kivi.t8('Add text block'), icon: "add", callback: kivi.requirement_spec.standard_text_block_ajax_call }
537 , edit: { name: kivi.t8('Edit text block'), icon: "edit", callback: kivi.requirement_spec.standard_text_block_ajax_call, disabled: kivi.requirement_spec.disable_edit_text_block_commands }
538 , delete: { name: kivi.t8('Delete text block'), icon: "delete", callback: kivi.requirement_spec.ask_delete_text_block, disabled: kivi.requirement_spec.disable_edit_text_block_commands }
540 , flag: { name: kivi.t8('Toggle marker'), icon: "flag", callback: kivi.requirement_spec.standard_text_block_ajax_call, disabled: kivi.requirement_spec.disable_edit_text_block_commands }
542 , copy: { name: kivi.t8('Copy'), icon: "copy", callback: kivi.requirement_spec.standard_text_block_ajax_call, disabled: kivi.requirement_spec.disable_edit_text_block_commands }
543 , paste: { name: kivi.t8('Paste'), icon: "paste", callback: kivi.requirement_spec.standard_text_block_ajax_call }
548 selector: '.basic-settings-context-menu',
550 heading: { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
551 , edit: { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
556 selector: '.edit-basic-settings-context-menu',
558 heading: { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
559 , save: { name: kivi.t8('Save'), icon: "save", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
560 , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
565 selector: '.time-cost-estimate-context-menu',
567 heading: { name: kivi.t8('Time/cost estimate actions'), className: 'context-menu-heading' }
568 , edit: { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_time_cost_estimate_ajax_call }
573 selector: '.edit-time-cost-estimate-context-menu',
575 heading: { name: kivi.t8('Time/cost estimate actions'), className: 'context-menu-heading' }
576 , save: { name: kivi.t8('Save'), icon: "save", callback: kivi.requirement_spec.standard_time_cost_estimate_ajax_call }
577 , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: kivi.requirement_spec.standard_time_cost_estimate_ajax_call }
582 selector: '.quotations-and-orders-context-menu,.quotations-and-orders-order-context-menu',
584 heading: { name: kivi.t8('Quotations/Orders actions'), className: 'context-menu-heading' }
585 , edit_assignment: { name: kivi.t8('Edit article/section assignments'), icon: "edit", callback: ns.standard_quotation_order_ajax_call }
587 , new: { name: kivi.t8('Create new qutoation/order'), icon: "add", callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_create_quotation_order_commands }
588 , update: { name: kivi.t8('Update quotation/order'), icon: "update", callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_edit_quotation_order_commands }
590 , delete: { name: kivi.t8('Delete quotation/order'), icon: "delete", callback: ns.ask_delete_quotation_order, disabled: ns.disable_edit_quotation_order_commands }
595 selector: '.quotations-and-orders-edit-assignment-context-menu',
597 heading: { name: kivi.t8('Edit article/section assignments'), className: 'context-menu-heading' }
598 , save_assignment: { name: kivi.t8('Save'), icon: "edit", callback: ns.standard_quotation_order_ajax_call }
599 , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: ns.standard_quotation_order_ajax_call }
604 selector: '.quotations-and-orders-new-context-menu',
606 heading: { name: kivi.t8('Create new quotation/order'), className: 'context-menu-heading' }
607 , create: { name: kivi.t8('Create'), icon: "edit", callback: ns.standard_quotation_order_ajax_call }
608 , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: ns.standard_quotation_order_ajax_call }
613 selector: '.quotations-and-orders-update-context-menu',
615 heading: { name: kivi.t8('Update quotation/order'), className: 'context-menu-heading' }
616 , do_update: { name: kivi.t8('Update'), icon: "update", callback: ns.standard_quotation_order_ajax_call }
617 , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: ns.standard_quotation_order_ajax_call }
622 selector: '#content',
623 items: general_actions
627 show: kivi.requirement_spec.item_popup_menu_shown
628 , hide: kivi.requirement_spec.item_popup_menu_hidden
632 selector: '.section-context-menu',
635 heading: { name: kivi.t8('Section/Function block actions'), className: 'context-menu-heading' }
636 , add_section: { name: kivi.t8('Add section'), icon: "add", callback: kivi.requirement_spec.standard_item_ajax_call }
637 , add_function_block: { name: kivi.t8('Add function block'), icon: "add", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_add_function_block_command }
639 , edit: { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_edit_item_commands }
640 , delete: { name: kivi.t8('Delete'), icon: "delete", callback: kivi.requirement_spec.ask_delete_item, disabled: kivi.requirement_spec.disable_edit_item_commands }
642 , flag: { name: kivi.t8('Toggle marker'), icon: "flag", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_edit_item_commands }
644 , copy: { name: kivi.t8('Copy'), icon: "copy", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_edit_item_commands }
645 , paste: { name: kivi.t8('Paste'), icon: "paste", callback: kivi.requirement_spec.standard_item_ajax_call }
650 selector: '.function-block-context-menu,.sub-function-block-context-menu',
653 heading: { name: kivi.t8('Function block actions'), className: 'context-menu-heading' }
654 , add_function_block: { name: kivi.t8('Add function block'), icon: "add", callback: kivi.requirement_spec.standard_item_ajax_call }
655 , add_sub_function_block: { name: kivi.t8('Add sub function block'), icon: "add", callback: kivi.requirement_spec.standard_item_ajax_call }
657 , edit: { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_edit_item_commands }
658 , delete: { name: kivi.t8('Delete'), icon: "delete", callback: kivi.requirement_spec.ask_delete_item, disabled: kivi.requirement_spec.disable_edit_item_commands }
660 , flag: { name: kivi.t8('Toggle marker'), icon: "flag", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_edit_item_commands }
662 , copy: { name: kivi.t8('Copy'), icon: "copy", callback: kivi.requirement_spec.standard_item_ajax_call, disabled: kivi.requirement_spec.disable_edit_item_commands }
663 , paste: { name: kivi.t8('Paste'), icon: "paste", callback: kivi.requirement_spec.standard_item_ajax_call }
668 }); // end of namespace(...., function() {...