var PeopleSchema=BusinessObject.create({base:ItemSchema,fields:[{name:"first",label:"First",required:true},{name:"middle",label:"Middle",inputSize:3},{name:"last",label:"Last",required:true},{name:"prefix",base:BaseFields.select,label:"Title",selectArgs:{optional:true},inputSize:3,choices:[{value:"Dr.",text:"Dr."},{value:"Hon.",text:"Hon."},{value:"Miss",text:"Miss"},{value:"Mr.",text:"Mr."},{value:"Mrs.",text:"Mrs."},{value:"Ms.",text:"Ms."},{value:"Prof.",text:"Prof."}]},{name:"suffix",base:BaseFields.select,label:"Suffix",selectArgs:{optional:true},inputSize:3,choices:[{value:"I",text:"I"},{value:"II",text:"II"},{value:"III",text:"III"},{value:"Jr.",text:"Jr."},{value:"Sr.",text:"Sr."}]},{name:"hAddress",label:"Street Address",base:BaseFields.textArea,inputRows:2,inputCols:60},{name:"hCity",label:"City"},{name:"hState",base:Fields.state,inputSize:1},{name:"hZip",base:Fields.postalCode,inputSize:7},{name:"hCountry",base:Fields.country},{name:"company",label:"Company"},{name:"wTitle",label:"Title"},{name:"wAddress",label:"Street Address",base:BaseFields.textArea,inputRows:2,inputCols:60},{name:"wCity",label:"City"},{name:"wState",base:Fields.state,inputSize:1},{name:"wZip",base:Fields.postalCode,inputSize:7},{name:"wCountry",base:Fields.country},{name:"oAddress",label:"Street Address",base:BaseFields.textArea,inputRows:2,inputCols:60},{name:"oCity",label:"City"},{name:"oState",base:Fields.state,inputSize:1},{name:"oZip",base:Fields.postalCode,inputSize:7},{name:"oCountry",base:Fields.country},{name:"hPhone",label:"Home Phone",inputSize:17},{name:"hFax",label:"Home Fax",inputSize:17},{name:"wPhone",label:"Work Phone",inputSize:17},{name:"wFax",label:"Work Fax",inputSize:17},{name:"cPhone",label:"Cell Phone",inputSize:17},{name:"oPhone",label:"Other Phone",inputSize:17},{name:"email",label:"Email",base:Fields.email},{name:"webSite",base:Fields.url,label:"Web Site"},{name:"role",label:"Role"},{name:"gender",label:"Gender",base:BaseFields.select,choices:[{value:"",text:""},{value:"M",text:"Male"},{value:"F",text:"Female"}]},{name:"birthday",label:"Birthday",base:BaseFields.date},{name:"text",label:"Notes",base:BaseFields.richText,inputRows:4,inputCols:60},{name:"categories",label:"Categories"},{name:"userName",label:"Nexo User Name"},{name:"image",label:"Image"},{name:"fullName",label:"Name",getValue:function(bo,item){var s=StringEx.joinOptional(" ",item.prefix,item.first,item.middle,item.last,item.suffix);if(!s)s=item.email;return s}},{name:"fullNameWithDetailLink",label:"Name",base:Fields.detailLink,detailLinkArgs:{title:"fullName"}},{name:"fullNameLastFirst",base:Fields.compound,label:"Name",fieldNames:["last","first"],delimiter:", "},{name:"fullNameLastFirstWithDetailLink",label:"Name",base:Fields.detailLink,detailLinkArgs:{title:"fullNameLastFirst"}},{name:"fullNameWithVCard",base:Fields.compound,label:"Name",fieldNames:["vCard","fullNameWithDetailLink"]},{name:"fullNameLastFirstWithVCard",base:Fields.compound,label:"Name",fieldNames:["vCard","fullNameLastFirstWithDetailLink"]},{name:"hMap",base:Fields.map,mapArgs:{location:"fullName",address:"hAddress",city:"hCity",state:"hState",postalCode:"hZip",country:"hCountry"}},{name:"hFullAddress",base:Fields.fullAddress,label:"Home Address",fullAddressArgs:{map:"hMap",address:"hAddress",city:"hCity",state:"hState",postalCode:"hZip",country:"hCountry"}},{name:"wMap",base:Fields.map,mapArgs:{location:"company",address:"wAddress",city:"wCity",state:"wState",postalCode:"wZip",country:"hCountry"}},{name:"wFullAddress",base:Fields.fullAddress,label:"Work Address",fullAddressArgs:{map:"wMap",address:"wAddress",city:"wCity",state:"wState",postalCode:"wZip",country:"hCountry"}},{name:"wFullInfo",base:Fields.compound,label:"Company",fieldNames:["company","wTitle","wFullAddress"],delimiter:"<br/>"},{name:"oMap",base:Fields.map,mapArgs:{location:"fullName",address:"oAddress",city:"oCity",state:"oState",postalCode:"oZip",country:"oCountry"}},{name:"oFullAddress",base:Fields.fullAddress,label:"Other Address",fullAddressArgs:{map:"oMap",address:"oAddress",city:"oCity",state:"oState",postalCode:"oZip",country:"oCountry"}},{name:"phoneList",label:"Phone",base:Fields.compound,label:"Phone",fieldNames:["cPhoneDesc","hPhoneDesc","hFaxDesc","wPhoneDesc","wFaxDesc","oPhoneDesc"],delimiter:"<br/>"},{name:"hPhoneDesc",base:Fields.compound,fieldNames:["hPhone"],outputSuffix:" (h)"},{name:"hFaxDesc",base:Fields.compound,fieldNames:["hFax"],outputSuffix:" (f)"},{name:"wPhoneDesc",base:Fields.compound,fieldNames:["wPhone"],outputSuffix:" (w)"},{name:"wFaxDesc",base:Fields.compound,fieldNames:["wFax"],outputSuffix:" (f)"},{name:"cPhoneDesc",base:Fields.compound,fieldNames:["cPhone"],outputSuffix:" (c)"},{name:"oPhoneDesc",base:Fields.compound,fieldNames:["oPhone"],outputSuffix:" (o)"},{name:"vCard",label:"vCard",base:Fields.vCard,vCardArgs:{}}]});var People={base:Table,id:"People",title:"People",allowItems:true,allowFolders:false,allowDrag:true,allowComments:true,itemName:"Person",itemsName:"People",ImportDialog:"importdialog/104966641.js",addFormAction:"people/add",updateFormAction:"people/update",createSectionMenuItems:function(menuItems,section){var t=People;if(U.un&&section.permissions.addContent){menuItems.addDivider();menuItems.add("Import vCards...",t._0,section.nodeId)}if(section.items&&section.items.length>0){menuItems.add("Export vCards...",t._4,section.nodeId)}if(U.owner&&section.items&&section.items.length>0){var isGroup=(page.site.siteType==1);var menuLabel="Invite People"+(isGroup?" to Group":" as Friends")+"...";menuItems.addDivider();menuItems.add(menuLabel,t._1,section.nodeId)}},createItemMenuItems:function(menuItems,item){var t=People;if(U.un&&U.owner){var isGroup=(page.site.siteType==1);var menuLabel="Invite Person"+(isGroup?" to Group":" as Friend")+"...";menuItems.addDivider();menuItems.add(menuLabel,t._2,item.nodeId)}},_2:function(nodeId){var item=page.nodes[nodeId];if(item){var email=PeopleSchema.getValue("email",item);C.invite({website:page.site.userName,to:email})}},_1:function(nodeId){var s=page.nodes[nodeId];if(s){var emailList="";for(var i=0;i<s.items.length;i++){var item=s.items[i];var email=PeopleSchema.getValue("email",item);if(email){emailList+=(emailList.length>0?", ":"")+email}}if(emailList.length==0){Dialog.alert("None of the People records contain email addresses.")}else{C.invite({website:page.site.userName,to:emailList})}}},_0:function(nodeId){var t=People;var s=page.nodes[nodeId];if(s){Module.showDialog(People,"ImportDialog",{parentId:nodeId})}},_4:function(nodeId){var t=People;var s=page.nodes[nodeId];if(s){var msg={page:page.pageId,version:page.version,t:head.time,h:head.h,nodeId:nodeId,type:"peopleSection"};var q=Html.formatQuery(msg);var href=A.commandsBase+"desktopintegration/getvcard"+q;if(href){N.openWindow(href,"")}else{Dialog.alert("There are no People to export.")}}},_5:function(s){var t=People;var sch=PeopleSchema;var href=null;var items=s.items;if(items.length>0){var sb=new StringBuilder();for(var i=0;i<items.length;i++){if(i>0)sb.write("&");var item=items[i];var vCardField=sch.getField("vCard");vCardField.formatQueryString(sb,sch,item,i)}if(!sb.isEmpty()){href=t._3(sb.toString())}}return href},_3:function(q){return A.commandsBase+"desktopintegration/getvcards?"+q},editLayout:new InputLayout(PeopleSchema,{fields:[{name:"first"},{name:"middle",sameRow:true},{name:"last",sameRow:true},{name:"email",tab:"Person",column:true,inputSize:25},{name:"cPhone",label:"Cell",fieldSet:"Phone Numbers"},{name:"hPhone",label:"Home"},{name:"hFax",label:"Hm Fax"},{name:"wPhone",label:"Work"},{name:"wFax",label:"Wk Fax"},{name:"oPhone",label:"Other"},{name:"prefix",fieldSet:"",column:true},{name:"suffix",sameRow:true},{name:"role"},{name:"gender"},{name:"birthday"},{name:"webSite",inputSize:30},{name:"userName",inputSize:30},{name:"hAddress",tab:"Home",fieldSet:"Home Address"},{name:"hCity"},{name:"hState",sameRow:true},{name:"hZip",sameRow:true},{name:"hCountry"},{name:"company",tab:"Work",inputSize:40},{name:"wTitle",inputSize:40},{name:"wAddress",fieldSet:"Work Address"},{name:"wCity"},{name:"wState",sameRow:true},{name:"wZip",sameRow:true},{name:"wCountry"},{name:"oAddress",tab:"Other",fieldSet:"Other Address"},{name:"oCity"},{name:"oState",sameRow:true},{name:"oZip",sameRow:true},{name:"oCountry"},{name:"text",tab:"Notes"}]}),addItems:function(id,beforeId){var t=Modules["People"];t.base.addItems(id,beforeId,People)},updateItem:function(itemId){var t=Modules["People"];t.base.updateItem(itemId,People)},deleteItem:function(id){ContentItem.deleteItem(id)},sendMessage:function(item,dlg){dlg.to=item.email},sendUpdateRequest:function(item,dlg){dlg.to=item.email||dlg.to;dlg.fields=[{name:"first",label:"First Name",width:150,value:item.first},{name:"last",label:"Last Name",width:150,value:item.last},{name:"email",label:"E-Mail",width:200,value:item.email},{name:"hPhone",label:"Home Phone",width:150,value:item.hPhone},{name:"hAddress",label:"Home Address",width:200,value:item.hAddress},{name:"hCity",label:"City",width:150,value:item.hCity},{name:"hState",label:"State",width:50,value:item.hState},{name:"hZip",label:"Zip",width:100,value:item.hZip},{name:"comments.add",label:"Comments",type:"TextArea"}]},renderEmpty:function(w,s){Section.renderEmpty(w,s)},defaultLayout:"List",detailLayout:"ItemDetail",layouts:{List:new GridLayout(PeopleSchema,{fields:["fullNameWithDetailLink","phoneList","hFullAddress"]},{orderBy:"last asc, first asc"}),Notes:new GridLayout(PeopleSchema,{fields:["fullNameWithVCard","email","phoneList","text"]},{orderBy:"last asc, first asc"}),Detail:new PanelLayout(PeopleSchema,{fields:["image","fullNameWithVCard","role","email","phoneList","hFullAddress","wFullInfo","oFullAddress","webSite"]},{orderBy:"last asc, first asc"}),ItemDetail:new PanelLayout(PeopleSchema,{fields:["image","fullNameWithVCard","role","email","phoneList","hFullAddress","wFullInfo","oFullAddress","webSite","birthday","gender","text","createdAndBy","modifiedAndBy"]},{kind:1})},onItemTip:function(evt,item){}};Module.add(People);