1.uglobal.js的调整,将shwAB函数改为如下代码:
var arrTo = new Array();
var arrCc = new Array();
var arrBcc = new Array();
function shwAB(sTgt,sA){
var oP=new Object();
oP.sTo=divTo.innerHTML;
oP.sCc=divCc.innerHTML;
oP.sBcc=divBcc.innerHTML;
oP.sTgt=sTgt;
oP.sVersion = '2007';
var url = '/ContactSelect/Contact/ContactQuerySelectForOWA.aspx';
switch (sTgt) {
case 'divTo':
oP.array_contact_to = arrTo;
if (oP.array_contact_to == null)
{
oP.array_contact_to = new Array();
}
break;
case 'divCc':
oP.array_contact_cc = arrCc;
if (oP.array_contact_cc == null)
{
oP.array_contact_cc = new Array();
}
break;
case 'divBcc':
oP.array_contact_bcc = arrBcc;
if (oP.array_contact_bcc == null)
{
oP.array_contact_bcc = new Array();
}
break;
}
if (oP.array_contact_to == null)
{
oP.array_contact_to = new Array();
}
if (oP.array_contact_cc == null)
{
oP.array_contact_cc = new Array();
}
if (oP.array_contact_bcc == null)
{
oP.array_contact_bcc = new Array();
}
var vRetval = window.showModalDialog(url, oP, "dialogHeight:"+a_iABH+"px;dialogWidth:"+a_iABW+"px;status:no;resizable:no;help:no;");
if (oP != null) {
switch (oP.sTgt) {
case 'divTo':
if (oP.array_contact_to != null)
{
arrTo = oP.array_contact_to;
}
break;
case 'divCc':
if (oP.array_contact_cc != null)
{
arrCc = oP.array_contact_cc;
}
break;
case 'divBcc':
if (oP.array_contact_bcc != null)
{
arrBcc = oP.array_contact_bcc;
}
break;
}
}
if (oP.sType == 'To')
setRwHtml(divTo, oP.sTo);
else if (oP.sType == 'Cc')
setRwHtml(divCc, oP.sCc);
else if (oP.sType == 'Bcc');
setRwHtml(divBcc, oP.sBcc);
revtRSpn();
if(0<oP.sBcc.length)
shwBcc(1);
rslvNms(OP_ANR); //实现检查姓名
}
2.公司老通讯录页面ContactQuerySelectForOWA.aspx调整,在页面的body关闭标签</body>前加上如下代码:
<script type="text/javascript">
function window.onload() {
window.setTimeout(sizeDialog, 1);
var o = window.dialogArguments;
var arr = [];
switch (o.sTgt) {
case "divTo":
if (o.array_contact_to != null)
{
arr = o.array_contact_to;
}
break;
case "divCc":
if (o.array_contact_to != null)
{
arr = o.array_contact_cc;
}
break;
case "divBcc":
if (o.array_contact_to != null)
{
arr = o.array_contact_bcc;
}
break;
}
for (var i = 0; i < arr.length; ++i) {
selectContact(arr[i]);
}
if (o == null) {
form1.btnTo.disabled = true;
form1.btnCc.disabled = true;
form1.btnBcc.disabled = true;
}
}
function addRow(obj) {
var id = GetContactKey(obj);
var name = obj.FullName;
var deptName = obj.DeptName;
var type = obj.Type;
var newRow = gvList.insertRow(gvList.rows.length);
newRow.id = "row_" + id;
newRow.ln = allCount;
c1 = newRow.insertCell();
c1.ln = allCount;
c1.innerHTML = "<input type='checkbox' checked onclick=\"removeContactById('" + id + "')\" />"
c1.align = "center";
c2 = newRow.insertCell();
c2.innerHTML = name;
c2.ln = allCount;
if (deptName && deptName != "") c2.innerHTML += "<span class='DeptName'>(" + deptName + ")</span>";
allCount++;
showMsg();
}
var arrContact = new Array();
var count = 0;
function selectContact(obj) {
var is_undesired = false;
for (var i = 0; i < arrContact.length; i++) {
if (IsEqual(arrContact[i], obj)) {
if (arrContact[i].SelectedState == 0) {
arrContact[i].SelectedState = 1;
if (!is_undesired)
{
addRow(obj);
}
}
is_undesired = true;
}
}
if (!is_undesired)
{
obj.SelectedState = 1;
count = arrContact.push(obj);
addRow(obj);
}
}
function nodeClick(id, text, contactType, o) {
var pt = o.previousSibling.previousSibling.title;
if (currentNode != null)
currentNode.className = "nonCurNode";
currentNode = o;
o.className = "curNode";
window.frames["main"].location = "../Controls/ContactSelectQuery.aspx?GroupId=" + id + "&GroupName=" +
escape(text) + "&ContactType=" + contactType + "&FilterAttribute=" + escape(Contact_FilterAttribute) + "&FilterMessage=" + escape(Contact_FilterMessage) + '&pt=' + pt;
}
function addRec(which) {
if (window.dialogArguments == null)
return;
var is2007 = false;
var obj = window.dialogArguments;
if (obj != undefined && obj.sVersion != undefined) {
if (obj.sVersion == '2007')
is2007 = true;
}
if (!is2007) {
//For not Exchange2007
var objMessage = obj["objMessage"];
if (objMessage == null)
return;
var arr = Contact_GetSelectedContacts();
var mailList = "";
for (i = 0; i < arr.length; i++) {
if (mailList != "") mailList += ";";
mailList += arr[i].FullName + "[smtp:" + arr[i].Email1 + "]";
}
Contact_ClearSelected();
} else {
//For Exchange2007
if (obj == null) {
return;
}
var arr = Contact_GetSelectedContacts();
var mailList = "";
for (i = 0; i < arr.length; i++) {
if (mailList != "") mailList += ";";
mailList += arr[i].FullName + "[smtp:" + arr[i].Email1 + "]";
}
Contact_ClearSelected();
if (which == 0) {
obj.sType = 'To';
obj.sTo = mailList;
obj.sTgt = 'divTo';
}
else if (which == 1) {
obj.sType = 'Cc';
obj.sCc = mailList;
obj.sTgt = 'divCc';
}
else if (which == 2) {
obj.sType = 'Bcc';
obj.sBcc = mailList;
obj.sTgt = 'divBcc';
}
}
switch(obj.sTgt) {
case "divTo":
obj.array_contact_to = arr;
break;
case "divCc":
obj.array_contact_cc = arr;
break;
case "divBcc":
obj.array_contact_bcc = arr;
break;
}
CloseWindow();
}
</script>
新加入的函数会代替老的同名函数,这样做的原因是修改方便,老的同名函数是在服务器端生成的,如果不嫌麻烦能找得到,也可以修改服务器端的