Revision 405a41ef
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
js/requirement_spec.js | ||
---|---|---|
290 | 290 |
return true; |
291 | 291 |
} |
292 | 292 |
|
293 |
// ------------------------------------------------------------------------- |
|
294 |
// ---------------------------- general actions ---------------------------- |
|
295 |
// ------------------------------------------------------------------------- |
|
296 |
|
|
297 |
function download_reqspec_pdf(key, opt) { |
|
298 |
var data = { |
|
299 |
action: "RequirementSpec/download_pdf", |
|
300 |
id: $('#requirement_spec_id').val() |
|
301 |
}; |
|
302 |
$.download("controller.pl", data); |
|
303 |
} |
|
304 |
|
|
305 |
function copy_reqspec(key, opt) { |
|
306 |
window.location.href = "controller.pl?action=RequirementSpec/new©_source_id=" + encodeURIComponent($('#requirement_spec_id').val()); |
|
307 |
return true; |
|
308 |
} |
|
309 |
|
|
310 |
function delete_reqspec(key, opt) { |
|
311 |
if (confirm(kivi.t8("Are you sure?"))) |
|
312 |
window.location.href = "controller.pl?action=RequirementSpec/destroy&id=" + encodeURIComponent($('#requirement_spec_id').val()); |
|
313 |
return true; |
|
314 |
} |
|
315 |
|
|
293 | 316 |
// ------------------------------------------------------------------------- |
294 | 317 |
// ----------------------------- context menus ----------------------------- |
295 | 318 |
// ------------------------------------------------------------------------- |
... | ... | |
300 | 323 |
hide: requirement_spec_text_block_popup_menu_hidden |
301 | 324 |
}; |
302 | 325 |
|
326 |
var general_actions = { |
|
327 |
sep98: "---------" |
|
328 |
, general_actions: { name: kivi.t8('Requirement spec actions:') } |
|
329 |
, sep99: "---------" |
|
330 |
, copy_reqspec: { name: kivi.t8('Copy requirement spec'), icon: "copy", callback: copy_reqspec } |
|
331 |
, delete_reqspec: { name: kivi.t8('Delete requirement spec'), icon: "delete", callback: delete_reqspec } |
|
332 |
}; |
|
333 |
|
|
303 | 334 |
$.contextMenu({ |
304 | 335 |
selector: '.text-block-context-menu', |
305 | 336 |
events: { |
306 | 337 |
show: requirement_spec_text_block_popup_menu_shown |
307 | 338 |
, hide: requirement_spec_text_block_popup_menu_hidden |
308 | 339 |
}, |
309 |
items: { |
|
310 |
add: { name: kivi.t8('Add text block'), icon: "add", callback: standard_text_block_ajax_call }
|
|
311 |
, edit: { name: kivi.t8('Edit text block'), icon: "edit", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }
|
|
312 |
, delete: { name: kivi.t8('Delete text block'), icon: "delete", callback: ask_delete_text_block, disabled: disable_edit_text_block_commands }
|
|
313 |
, sep1: "---------" |
|
314 |
, flag: { name: kivi.t8('Toggle marker'), icon: "flag", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }
|
|
315 |
, sep2: "---------" |
|
316 |
, copy: { name: kivi.t8('Copy'), icon: "copy", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }
|
|
317 |
, paste: { name: kivi.t8('Paste'), icon: "paste", callback: standard_text_block_ajax_call }
|
|
318 |
} |
|
340 |
items: $.extend({
|
|
341 |
add: { name: kivi.t8('Add text block'), icon: "add", callback: standard_text_block_ajax_call }
|
|
342 |
, edit: { name: kivi.t8('Edit text block'), icon: "edit", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }
|
|
343 |
, delete: { name: kivi.t8('Delete text block'), icon: "delete", callback: ask_delete_text_block, disabled: disable_edit_text_block_commands }
|
|
344 |
, sep1: "---------"
|
|
345 |
, flag: { name: kivi.t8('Toggle marker'), icon: "flag", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }
|
|
346 |
, sep2: "---------"
|
|
347 |
, copy: { name: kivi.t8('Copy'), icon: "copy", callback: standard_text_block_ajax_call, disabled: disable_edit_text_block_commands }
|
|
348 |
, paste: { name: kivi.t8('Paste'), icon: "paste", callback: standard_text_block_ajax_call }
|
|
349 |
}, general_actions)
|
|
319 | 350 |
}); |
320 | 351 |
|
321 | 352 |
var events = { |
... | ... | |
326 | 357 |
$.contextMenu({ |
327 | 358 |
selector: '.section-context-menu', |
328 | 359 |
events: events, |
329 |
items: { |
|
360 |
items: $.extend({
|
|
330 | 361 |
add_section: { name: kivi.t8('Add section'), icon: "add", callback: standard_item_ajax_call } |
331 | 362 |
, add_function_block: { name: kivi.t8('Add function block'), icon: "add", callback: standard_item_ajax_call, disabled: disable_add_function_block_command } |
332 | 363 |
, sep1: "---------" |
... | ... | |
337 | 368 |
, sep3: "---------" |
338 | 369 |
, copy: { name: kivi.t8('Copy'), icon: "copy", callback: standard_item_ajax_call, disabled: disable_edit_item_commands } |
339 | 370 |
, paste: { name: kivi.t8('Paste'), icon: "paste", callback: standard_item_ajax_call } |
340 |
} |
|
371 |
}, general_actions)
|
|
341 | 372 |
}); |
342 | 373 |
|
343 | 374 |
$.contextMenu({ |
344 | 375 |
selector: '.function-block-context-menu,.sub-function-block-context-menu', |
345 | 376 |
events: events, |
346 |
items: { |
|
377 |
items: $.extend({
|
|
347 | 378 |
add_function_block: { name: kivi.t8('Add function block'), icon: "add", callback: standard_item_ajax_call } |
348 | 379 |
, add_sub_function_block: { name: kivi.t8('Add sub function block'), icon: "add", callback: standard_item_ajax_call } |
349 | 380 |
, sep1: "---------" |
... | ... | |
354 | 385 |
, sep3: "---------" |
355 | 386 |
, copy: { name: kivi.t8('Copy'), icon: "copy", callback: standard_item_ajax_call, disabled: disable_edit_item_commands } |
356 | 387 |
, paste: { name: kivi.t8('Paste'), icon: "paste", callback: standard_item_ajax_call } |
357 |
} |
|
388 |
}, general_actions)
|
|
358 | 389 |
}); |
359 | 390 |
|
360 | 391 |
$.contextMenu({ |
361 | 392 |
selector: '.time-cost-estimate-context-menu', |
362 | 393 |
events: events, |
363 |
items: { edit: { name: kivi.t8('Edit'), icon: "edit", callback: standard_time_cost_estimate_ajax_call } }
|
|
394 |
items: $.extend({ edit: { name: kivi.t8('Edit'), icon: "edit", callback: standard_time_cost_estimate_ajax_call } }, general_actions)
|
|
364 | 395 |
}); |
365 | 396 |
|
366 | 397 |
$.contextMenu({ |
367 | 398 |
selector: '.edit-time-cost-estimate-context-menu', |
368 | 399 |
events: events, |
369 |
items: { |
|
400 |
items: $.extend({
|
|
370 | 401 |
save: { name: kivi.t8('Save'), icon: "save", callback: standard_time_cost_estimate_ajax_call } |
371 | 402 |
, cancel: { name: kivi.t8('Cancel'), icon: "close", callback: standard_time_cost_estimate_ajax_call } |
372 |
} |
|
403 |
}, general_actions)
|
|
373 | 404 |
}); |
374 | 405 |
} |
Auch abrufbar als: Unified diff
Pflichtenhefte: Kopieren (clonen) generell und Löschen aus Kontextmenü implementiert