Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c96c4bb2

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID c96c4bb2c3561b54ef23330fdb1fa1d528b26fff
  • Vorgänger 1af50c02
  • Nachfolger 14faa2e3

Pflichtenhefte auf Versionen zurücksetzen können

Unterschiede anzeigen:

js/requirement_spec.js
252 252
  return handle_text_block_popup_menu_markings(opt, false);
253 253
}
254 254

  
255

  
256 255
function handle_item_popup_menu_markings(opt, add) {
257 256
  var id = find_item_id(opt.$trigger);
258 257
  if (id)
......
323 322
// -------------------------------- versions -------------------------------
324 323
// -------------------------------------------------------------------------
325 324

  
325
function find_versioned_copy_id(clicked_elt) {
326
  var id = $(clicked_elt).find("[name=versioned_copy_id]");
327
  return id ? id.val() : undefined;
328
}
329

  
330
function disable_versioned_copy_item_commands(key, opt) {
331
  if (key === "revert_to_version")
332
    return !find_versioned_copy_id(opt.$trigger);
333
  return false;
334
}
335

  
326 336
function create_requirement_spec_version() {
327 337
  open_jqm_window({ url:  'controller.pl',
328 338
                    data: { action:              'RequirementSpecVersion/new',
......
331 341
  return true;
332 342
}
333 343

  
344
function create_pdf_for_versioned_copy_ajax_call(key, opt) {
345
  // TODO: create_pdf_for_versioned_copy_ajax_call
346

  
347
  return true;
348
}
349

  
350
function revert_to_versioned_copy_ajax_call(key, opt) {
351
  if (!confirm(kivi.t8('Do you really want to revert to this version?')))
352
    return true;
353

  
354
  var data = {
355
    action:            'RequirementSpec/revert_to',
356
    versioned_copy_id: find_versioned_copy_id(opt.$trigger),
357
    id:                $('#requirement_spec_id').val()
358
  };
359

  
360
  $.post("controller.pl", data, eval_json_result);
361

  
362
  return true;
363
}
364

  
334 365
// -------------------------------------------------------------------------
335 366
// ----------------------------- context menus -----------------------------
336 367
// -------------------------------------------------------------------------
......
414 445

  
415 446
  $.contextMenu({
416 447
    selector: '.time-cost-estimate-context-menu',
417
    events:   events,
418 448
    items:    $.extend({ edit: { name: kivi.t8('Edit'), icon: "edit", callback: standard_time_cost_estimate_ajax_call } }, general_actions)
419 449
  });
420 450

  
421 451
  $.contextMenu({
422 452
    selector: '.edit-time-cost-estimate-context-menu',
423
    events:   events,
424 453
    items:    $.extend({
425 454
        save:   { name: kivi.t8('Save'),   icon: "save",  callback: standard_time_cost_estimate_ajax_call }
426 455
      , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: standard_time_cost_estimate_ajax_call }
427 456
    }, general_actions)
428 457
  });
458

  
459
  $.contextMenu({
460
    selector: '.versioned-copy-context-menu',
461
    items:    $.extend({
462
        // create_pdf:        { name: kivi.t8('Create PDF'),        icon: "pdf",    callback: create_pdf_for_versioned_copy_ajax_call                                                }
463
      revert_to_version: { name: kivi.t8('Revert to version'), icon: "revert", callback: revert_to_versioned_copy_ajax_call,     disabled: disable_versioned_copy_item_commands }
464
    }, general_actions)
465
  });
429 466
}

Auch abrufbar als: Unified diff