- Timestamp:
- 06/22/12 18:01:36 (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/draw_api.js
r6580 r6592 9 9 */ 10 10 onceOpenedHeadersMessages = {}; 11 11 var cache = new Array(); 12 12 var openTab = { 13 13 'type' : [], // 8 types of tabs, further info. see expressolivre.org/dev/wiki/mail/Documentacao … … 3551 3551 3552 3552 //DESENHO DAS CAIXA DE EMAIL 3553 function draw_email_box(input_data, location, personal ){3553 function draw_email_box(input_data, location, personal, shared){ 3554 3554 if($.trim(input_data) != ""){ 3555 3555 var box_data = valid_emails(input_data); … … 3559 3559 if((preferences.expressoMail_ldap_identifier_recipient || personal)&& $(newBox).hasClass("invalid-email-box")){ 3560 3560 //$(newBox).find(".loading").css("background-image", "../prototype/modules/mail/img/ajax-loader.gif"); 3561 show_detais(newBox, input_data, personal );3561 show_detais(newBox, input_data, personal, shared); 3562 3562 }else{ 3563 3563 $(newBox).find(".box-loading").remove(); … … 3855 3855 3856 3856 //MOSTRA OS DETALHES DAS CAIXA DE EMAIL NOS CAMPOS PARA - CC - CCO 3857 function show_detais(box, value, personal ){3857 function show_detais(box, value, personal, shared){ 3858 3858 var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 3859 3859 var group = (personal != undefined ? (personal == "G" ? true : false) : false); 3860 3860 shared = shared ? shared : false; 3861 3861 if(group){ 3862 REST.get("/ group/"+value, {}, function(data){3862 REST.get("/"+ (shared ? "shared" : "") +"group/"+value, {}, function(data){ 3863 3863 if(!data.error){ 3864 3864 if(data.collection.error) … … 3886 3886 3887 3887 if(personal){ 3888 REST.get("/ contact/"+value, {}, function(data){3888 REST.get("/"+ (shared ? "shared" : "") +"contact/"+value, {}, function(data){ 3889 3889 if(!data.error){ 3890 3890 if(data.collection.error) … … 3989 3989 currentType = ""; 3990 3990 $.each( items, function( index, item ) { 3991 if ( item.type != currentType) {3992 if(item.type == "G" && $(ul).find(".dynamic-recent").length)3991 if ( item.typel != currentType) { 3992 if(item.typel == "/groups" && $(ul).find(".dynamic-recent").length) 3993 3993 self._renderItem( ul, {name:"", value:"", type:"linha"} ); 3994 if(item.type == "P" && ($(ul).find(".dynamic-group").length || $(ul).find(".dynamic-recent").length))3994 if(item.typel == "/contacts" && ($(ul).find(".dynamic-group").length || $(ul).find(".dynamic-recent").length)) 3995 3995 self._renderItem( ul, {name:"", value:"", type:"linha"} ); 3996 currentType = item.type ;3996 currentType = item.typel; 3997 3997 } 3998 3998 self._renderItem( ul, item ); … … 4001 4001 half : true, 4002 4002 hints : ['','','','',''], 4003 score : (( parseInt(item.qtd)*5)/topContact),4003 score : ((item.number_of_messages*5)/topContact), 4004 4004 starOn : '../../prototype/plugins/jq-raty/img/star-on.png', 4005 4005 starOff : '../../prototype/plugins/jq-raty/img/star-off.png', … … 4007 4007 }); 4008 4008 }); 4009 if($(ul).find("li:last").hasClass("dynamic-separator")){ 4010 $(ul).find("li:last").remove(); 4011 } 4009 4012 } 4010 4013 }); … … 4013 4016 minLength: 1, 4014 4017 source: function(request, response){ 4015 response( $.ui.autocomplete.filter(dynamicContactList, request.term ) ); 4018 if ( request.term in cache ) { 4019 response( cache[ request.term ] ); 4020 return; 4021 } 4022 dynamicContacts = new Array(); 4023 REST.get("/usercontacts", false, function(data){ 4024 dynamicData = data.collection.itens; 4025 if(dynamicData){ 4026 $.each(dynamicData, function(index, value){ 4027 dynamic = {}; 4028 $.each(value.data, function(index, value){ 4029 dynamic[value.name] = value.value; 4030 }); 4031 dynamic['value'] = (dynamic.name ? dynamic.name +' - ': '') + dynamic.mail; 4032 dynamic['type'] = value.dataType; 4033 dynamic['typel'] = (value.dataType.substring(0,7) == "/shared" ? "/"+value.dataType.substring(7,value.dataType.length)+"s" : value.dataType) ; 4034 dynamicContacts.push(dynamic); 4035 }); 4036 } 4037 var data = $.ui.autocomplete.filter(dynamicContacts, request.term ); 4038 cache[ request.term ] = data; 4039 response( data ); 4040 }); 4016 4041 }, 4017 4042 focus: function() { … … 4023 4048 event.preventDefault(); 4024 4049 $(this).val(""); 4025 if(ui.item.type == "P")4026 draw_email_box(""+ui.item.id, $(this), true );4027 else if(ui.item.type == "G")4028 draw_email_box(""+ui.item.id, $(this), "G" );4050 if(ui.item.typel == "/contacts") 4051 draw_email_box(""+ui.item.id, $(this), true, (ui.item.type.substring(0,7) == "/shared" ? true : false)); 4052 else if(ui.item.typel == "/groups") 4053 draw_email_box(""+ui.item.id, $(this), "G", (ui.item.type.substring(0,7) == "/shared" ? true : false)); 4029 4054 else 4030 draw_email_box(ui.item.name ? "\""+ui.item.name+"\" <"+ui.item. email+">" : ui.item.email, $(this));4055 draw_email_box(ui.item.name ? "\""+ui.item.name+"\" <"+ui.item.mail+">" : ui.item.mail, $(this)); 4031 4056 return false; 4032 4057 }, … … 4041 4066 //MONTAGEM DA LISTA DE CONTATOS DINÂMICOS DO AUTO COMPLETE 4042 4067 .data( "catcomplete" )._renderItem = function( ul, item ) { 4043 var autocomplete = $(this)[0].element; 4044 ul.css({"min-width":"400px", "width":"50%", "max-height" : "180px", "overflow-y" : "auto", "min-height": "30px"}); 4045 var listContacts = DataLayer.render("../prototype/modules/mail/templates/listContacts.ejs", item); 4046 return $(listContacts).data( "item.autocomplete", item ).appendTo( ul ).find("span:last").button({ 4047 icons : { 4048 primary : "ui-icon-close" 4049 }, 4050 text: false 4051 }).click(function(event){ 4052 var removeLi = $(this).parents("li:first"); 4053 if(!event.keyCode) 4054 autocomplete.catcomplete( "close" ); 4055 $.Zebra_Dialog('Deseja remover <b>'+(item.name ? item.name+" - " : "")+ item.email+'</b>?', { 4056 'type': 'question', 4057 'custom_class': (is_ie ? 'configure-zebra-dialog' : ''), 4058 'title': 'Atenção', 4059 'buttons': ['Sim','Não'], 4060 'overlay_opacity': '0.5', 4061 'onClose': function(caption) { 4062 if(caption == 'Sim'){ 4063 $(removeLi).remove(); 4064 REST.delete("/dynamiccontact/"+item.id); 4065 updateDynamicContact(); 4066 updateDynamicContactList(); 4068 if($(ul).find("li").length < 50){ 4069 var autocomplete = $(this)[0].element; 4070 ul.css({"min-width":"500px", "width":"50%", "max-height" : "180px", "overflow-y" : "auto", "min-height": "30px"}); 4071 var listContacts = DataLayer.render("../prototype/modules/mail/templates/listContacts.ejs", item); 4072 return $(listContacts).data( "item.autocomplete", item ).appendTo( ul ).find("span:last").button({ 4073 icons : { 4074 primary : "ui-icon-close" 4075 }, 4076 text: false 4077 }).click(function(event){ 4078 var removeLi = $(this).parents("li:first"); 4079 if(!event.keyCode) 4080 autocomplete.catcomplete( "close" ); 4081 $.Zebra_Dialog('Deseja remover <b>'+(item.name ? item.name+" - " : "")+ item.email+'</b>?', { 4082 'type': 'question', 4083 'custom_class': (is_ie ? 'configure-zebra-dialog' : ''), 4084 'title': 'Atenção', 4085 'buttons': ['Sim','Não'], 4086 'overlay_opacity': '0.5', 4087 'onClose': function(caption) { 4088 if(caption == 'Sim'){ 4089 $(removeLi).remove(); 4090 REST.delete("/dynamiccontact/"+item.id); 4091 updateDynamicContact(); 4092 updateDynamicContactList(); 4093 cache = new Array(); 4094 } 4067 4095 } 4068 }4096 }); 4069 4097 }); 4070 }); 4098 } 4099 return; 4071 4100 }; 4072 4101 } -
trunk/expressoMail1_2/js/main.js
r6587 r6592 14 14 var dynamicContactList = new Array(); 15 15 var topContact = 0; 16 DataLayer.get("folder", true); 16 17 17 18 //Os IE's < 9 não possui suporte a trim() introduzida no JavaScript 1.8.1 … … 235 236 }); 236 237 238 DataLayer.get("folder", true); 239 cExecute("$this.imap_functions.get_folders_list&onload=true", update_menu); 240 237 241 setTimeout('auto_refresh()', time_refresh); 238 242 … … 2438 2442 var arrayCCo = content.find(".cco-tr").find(".box").clone(); 2439 2443 save_dynamic_contacts(arrayCCo); 2444 cache = new Array(); 2440 2445 } 2441 2446 else{ … … 2482 2487 /*Função que grava o destinatário nos contatos dinâmicos*/ 2483 2488 function save_dynamic_contacts(array){ 2484 if(parseInt(preferences.use_dynamic_contacts)){ 2489 if(parseInt(preferences.use_dynamic_contacts)){ 2490 2485 2491 $.each(array, function(i, value){ 2486 2492 var stop = false; … … 2494 2500 var exist = 0; 2495 2501 $.each(dynamicContacts, function(x, valuex){ 2496 if(valuex. email == $(value).find("input").val().match(reComplexEmail)[1]){2502 if(valuex.mail == $(value).find("input").val().match(reComplexEmail)[1]){ 2497 2503 exist = valuex.id; 2498 2504 return false; -
trunk/prototype/modules/mail/templates/listContacts.ejs
r6528 r6592 1 <% 2 var decodeType = { 3 '/dynamiccontacts': { 4 css: 'recent', 5 img: 'recent', 6 text: 'Contato dinâmico' 7 }, 8 '/contacts':{ 9 css: 'personal', 10 img: 'personal', 11 text: 'Contato pessoal', 12 }, 13 '/sharedcontact':{ 14 css: 'personal', 15 img: 'sharedcontact', 16 text: 'Contato compartilhado', 17 }, 18 '/groups':{ 19 css: 'group', 20 img: 'group', 21 text: 'Grupo pessoal', 22 }, 23 '/sharedgroup':{ 24 css: 'group', 25 img: 'sharedgroup', 26 text: 'Grupo compartilhado', 27 } 28 } 29 %> 1 30 <%if (data.type == 'linha'){%> 2 <li >31 <li class="dynamic-separator"> 3 32 <div class="line-separator"> 4 33 5 34 </div> 6 35 <%}else{%> 7 <li class="dynamic-<%= (data.type =='' ? 'recent' : (data.type == 'P' ? 'personal' : 'group'))%>">8 <a style="width:<%= (data.type == ' ' ? '91%' : '97.5%')%>; display: inline-block;">9 <img style="position:relative; top:2px; "src="../prototype/modules/mail/img/<%=d ata.type == '' ? 'recent' : (data.type== 'P' ? 'personal' : 'group')%>.png" title="<%=data.type == '' ? 'Contato Recente' : (data.type== 'P' ? 'Contato Pessoal' : 'Grupo de Contatos')%>"/>10 <%= (data.name ? data.name + " - " : "") %><%= data.email %>11 <% if(data.type == ' '){ %>36 <li class="dynamic-<%=decodeType[data.type].css%>"> 37 <a style="width:<%= (data.type == '/dynamiccontacts' ? '91%' : '97.5%')%>; display: inline-block;"> 38 <img style="position:relative; top:2px; "src="../prototype/modules/mail/img/<%=decodeType[data.type].img%>.png" title="<%=decodeType[data.type].text%>"/> 39 <%= (data.name ? (data.name.length > 20? data.name.substring(0,17)+"..." : data.name)+ " - " : "") %><%= data.mail %> 40 <% if(data.type == '/dynamiccontacts'){ %> 12 41 <div class="dynamic-stars" style="display: inline-block;float: right;"/> 13 42 <% } %> 14 43 </a> 15 <span style="width:16px; height:16px; top:5px; <%=data.type == ' ' ? '': 'display:none'%>">Excluir contato recente</span>44 <span style="width:16px; height:16px; top:5px; <%=data.type == '/dynamiccontacts' ? '': 'display:none'%>">Excluir contato recente</span> 16 45 <%}%> 17 46 </li> -
trunk/prototype/rest/catalog/UserContactsResource.php
r6572 r6592 150 150 if (($value['user'] == Config::me("uidNumber")) || ($acl[$value['user']]['read'])) { 151 151 152 $i = new Item($request->resources, ($value['user'] == Config::me("uidNumber") ? 'GroupsResource' : 'SharedGroup sResource'), $value['id']);152 $i = new Item($request->resources, ($value['user'] == Config::me("uidNumber") ? 'GroupsResource' : 'SharedGroupResource'), $value['id']); 153 153 154 154 $d = new Data(); … … 183 183 184 184 $d = new Data(); 185 $d->setName(' email');185 $d->setName('mail'); 186 186 $d->setValue($value['email']); 187 187 $d->setPrompt('Email do Grupo'); … … 275 275 276 276 $d = new Data(); 277 $i = new Item($request->resources, (($value['user'] == Config::me("uidNumber")) ? 'ContactsResource' : 'SharedContact sResource'), $value['id']);277 $i = new Item($request->resources, (($value['user'] == Config::me("uidNumber")) ? 'ContactsResource' : 'SharedContactResource'), $value['id']); 278 278 $d->setName('id'); 279 279 $d->setValue($value['id']); … … 309 309 310 310 $d = new Data(); 311 $d->setName(' email');311 $d->setName('mail'); 312 312 $d->setValue(isset($value['email']) ? $value['email'] : null); 313 313 $d->setPrompt('Email do Contato');
Note: See TracChangeset
for help on using the changeset viewer.