| 352 | | bwGrid.addAttendee("",uid,role,partstat,"person"); |
|---|
| | 352 | if (uid.indexOf(",") != -1) { |
|---|
| | 353 | // we have a list of uids from a group |
|---|
| | 354 | alert("can't add a group yet, but soon..."); |
|---|
| | 355 | } else { |
|---|
| | 356 | // we have a single uid |
|---|
| | 357 | bwGrid.addAttendee("",uid,role,partstat,"person"); |
|---|
| | 358 | } |
|---|
| 1129 | | // use the calendar address uri if available, otherwise use email |
|---|
| 1130 | | var curUri = ""; |
|---|
| 1131 | | if (entry.caladruri != undefined && entry.caladruri.value != undefined) { |
|---|
| 1132 | | curUri = entry.caladruri.value; |
|---|
| 1133 | | } |
|---|
| 1134 | | if (curUri == "" && entry.email != undefined && entry.email[0] != undefined && entry.email[0].value != undefined) { |
|---|
| 1135 | | var curEmail = entry.email[0].value; |
|---|
| 1136 | | if (curEmail != "") { |
|---|
| 1137 | | curUri = "mailto:" + curEmail; |
|---|
| | 1132 | if (curKind == "group") { |
|---|
| | 1133 | if (entry.member != undefined && entry.member.length > 0) { |
|---|
| | 1134 | var members = ""; |
|---|
| | 1135 | for (var i = 0; i < entry.member.length; i++ ) { |
|---|
| | 1136 | members += entry.member[i].value + ","; |
|---|
| | 1137 | } |
|---|
| | 1138 | members = members.substring(0,members.length-1); |
|---|
| | 1139 | var curItem = {label: curFn, value: members}; |
|---|
| | 1140 | items.push(curItem); |
|---|
| 1139 | | } |
|---|
| 1140 | | |
|---|
| 1141 | | // only add the entry if there is a uri and a label to use |
|---|
| 1142 | | if (curUri != "" && curLabel != "") { |
|---|
| 1143 | | var curItem = {label: curLabel, value: curUri}; |
|---|
| 1144 | | items.push(curItem); |
|---|
| | 1142 | } else { |
|---|
| | 1143 | // this is probably not enough: we should account for all email addresses if there is no calendar uri |
|---|
| | 1144 | if (entry.email != undefined && entry.email[0] != undefined && entry.email[0].value != undefined) { |
|---|
| | 1145 | curEmail = entry.email[0].value; |
|---|
| | 1146 | } |
|---|
| | 1147 | if (curFn != "") { |
|---|
| | 1148 | curLabel = curFn + ", " + curEmail; |
|---|
| | 1149 | } else { |
|---|
| | 1150 | curLabel = curEmail; |
|---|
| | 1151 | } |
|---|
| | 1152 | |
|---|
| | 1153 | // use the calendar address uri if available, otherwise use email |
|---|
| | 1154 | var curUri = ""; |
|---|
| | 1155 | if (entry.caladruri != undefined && entry.caladruri.value != undefined) { |
|---|
| | 1156 | curUri = entry.caladruri.value; |
|---|
| | 1157 | } |
|---|
| | 1158 | if (curUri == "" && entry.email != undefined && entry.email[0] != undefined && entry.email[0].value != undefined) { |
|---|
| | 1159 | var curEmail = entry.email[0].value; |
|---|
| | 1160 | if (curEmail != "") { |
|---|
| | 1161 | curUri = "mailto:" + curEmail; |
|---|
| | 1162 | } |
|---|
| | 1163 | } |
|---|
| | 1164 | |
|---|
| | 1165 | // only add the entry if there is a uri and a label to use |
|---|
| | 1166 | if (curUri != "" && curLabel != "") { |
|---|
| | 1167 | var curItem = {label: curLabel, value: curUri}; |
|---|
| | 1168 | items.push(curItem); |
|---|
| | 1169 | } |
|---|