Send the selected SDO to cc its liaison manager. See

- Legacy-Id: 2361
This commit is contained in:
Emilio A. Sánchez López 2010-07-20 17:33:57 +00:00
parent 251b161eac
commit 9f8b0afd15

View file

@ -3,9 +3,11 @@
return this.each(function () {
var form = $(this);
var organization = form.find('#id_organization');
var from = form.find('#id_from_field');
var poc = form.find('#id_to_poc');
var cc = form.find('#id_cc1');
var reply = form.find('#id_replyto');
var purpose = form.find('#id_purpose');
var config = {};
var readConfig = function() {
@ -24,7 +26,7 @@
};
var updatePOC = function() {
var organization = $(this).find('option:selected');
var entity = organization.find('option:selected');
var url = config.poc_update_url;
$.ajax({
url: url,
@ -32,7 +34,7 @@
cache: false,
async: true,
dataType: 'json',
data: {entity_id: organization.val()},
data: {entity_id: entity.val()},
success: function(response){
if (!response.error) {
render_mails_into(poc, response.poc);
@ -43,7 +45,8 @@
};
var updateCC = function() {
var organization = $(this).find('option:selected');
var entity = organization.find('option:selected');
var sdo = from.find('option:selected');
var url = config.cc_update_url;
$.ajax({
url: url,
@ -51,7 +54,8 @@
cache: false,
async: true,
dataType: 'json',
data: {to_entity_id: organization.val()},
data: {to_entity_id: organization.val(),
sdo_id: sdo.val()},
success: function(response){
if (!response.error) {
render_mails_into(cc, response.cc);
@ -69,11 +73,14 @@
var initTriggers = function() {
organization.change(updatePOC);
organization.change(updateCC);
from.change(updateCC);
reply.keyup(updateFrom);
};
var updateOnInit = function() {
updateFrom();
updateCC();
updatePOC();
};
var initForm = function() {