Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1bacd5c1

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 1bacd5c15dbf06c84167d823544015d59fdc23be
  • Vorgänger 32f83e8e
  • Nachfolger 938703cc

Pflichtenhefte: Zuweisung Artikel zu Abschnitten implementiert

Unterschiede anzeigen:

js/requirement_spec.js
325 325
  return $(clicked_elt).find('>[name=order_id]').val();
326 326
};
327 327

  
328
ns.standard_quotation_order_ajax_call = function(key, opt, other_data) {
329
  var data = {
330
    action:              "RequirementSpecOrder/" + key,
331
    requirement_spec_id: $('#requirement_spec_id').val(),
332
    id:                  ns.find_quotation_order_id(opt.$trigger)
333
  };
328
ns.standard_quotation_order_ajax_call = function(key, opt) {
329
  if ((key == 'cancel') && !confirm(kivi.t8('Do you really want to cancel?')))
330
    return true;
331

  
332
  var data = 'action=RequirementSpecOrder/' + key
333
           + '&' + $('#requirement_spec_id').serialize();
334

  
335
  if (key == 'save_assignment')
336
    data += '&' + $('#quotations_and_orders_article_assignment_form').serialize();
337
  else
338
    data += '&id=' + encodeURIComponent(ns.find_quotation_order_id(opt.$trigger));
334 339

  
335 340
  // console.log("I would normally POST the following now:");
336 341
  // console.log(data);
337
  $.post("controller.pl", $.extend(data, other_data || {}), kivi.eval_json_result);
342
  $.post("controller.pl", data, kivi.eval_json_result);
338 343

  
339 344
  return true;
340 345
};
......
347 352
  return !$('#quotations_and_orders_sections');
348 353
};
349 354

  
355
ns.assign_order_part_id_to_all = function() {
356
  var order_part_id = $('#quoations_and_orders_order_id').val();
357
  $('#quotations_and_orders_article_assignment_form SELECT[name="sections[].order_part_id"]').each(function(idx, elt) {
358
    $(elt).val(order_part_id);
359
  });
360
};
361

  
350 362
// -------------------------------------------------------------------------
351 363
// ---------------------------- general actions ----------------------------
352 364
// -------------------------------------------------------------------------
......
507 519
  $.contextMenu({
508 520
    selector: '.quotations-and-orders-context-menu,.quotations-and-orders-order-context-menu',
509 521
    items:    $.extend({
510
        heading:            { name: kivi.t8('Orders/Quotations actions'), className: 'context-menu-heading' }
511
      , edit:               { name: kivi.t8('Edit article/section assignments'), icon: "edit",   callback: ns.standard_quotation_order_ajax_call }
522
        heading:            { name: kivi.t8('Orders/Quotations actions'), className: 'context-menu-heading'                                                                                            }
523
      , edit_assignment:    { name: kivi.t8('Edit article/section assignments'), icon: "edit",   callback: ns.standard_quotation_order_ajax_call                                                       }
512 524
      , sep1:               "---------"
513
      , new:                { name: kivi.t8('Create new qutoation/order'),       icon: "add",    callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_create_quotation_order_commands}
514
      , update:             { name: kivi.t8('Update quotation/order'),           icon: "update", callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_edit_quotation_order_commands }
525
      , new:                { name: kivi.t8('Create new qutoation/order'),       icon: "add",    callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_create_quotation_order_commands }
526
      , update:             { name: kivi.t8('Update quotation/order'),           icon: "update", callback: ns.standard_quotation_order_ajax_call, disabled: ns.disable_edit_quotation_order_commands   }
515 527
      , sep2:               "---------"
516
      , delete:             { name: kivi.t8('Delete quotation/order'),           icon: "delete", callback: ns.ask_delete_quotation_order,         disabled: ns.disable_edit_quotation_order_commands }
528
      , delete:             { name: kivi.t8('Delete quotation/order'),           icon: "delete", callback: ns.ask_delete_quotation_order,         disabled: ns.disable_edit_quotation_order_commands   }
529
    }, general_actions)
530
  });
531

  
532
  $.contextMenu({
533
    selector: '.quotations-and-orders-edit-assignment-context-menu',
534
    items:    $.extend({
535
        heading:         { name: kivi.t8('Edit article/section assignments'), className: 'context-menu-heading'    }
536
      , save_assignment: { name: kivi.t8('Save'),   icon: "edit",  callback: ns.standard_quotation_order_ajax_call }
537
      , cancel:          { name: kivi.t8('Cancel'), icon: "close", callback: ns.standard_quotation_order_ajax_call }
517 538
    }, general_actions)
518 539
  });
519 540

  

Auch abrufbar als: Unified diff