Changeset 6754 for branches/2.4/expressoMail1_2
- Timestamp:
- 07/11/12 11:45:10 (12 years ago)
- Location:
- branches/2.4
- Files:
-
- 29 edited
- 14 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/trunk merged eligible /sandbox/2.4.1-3 6237-6527
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/2.4/expressoMail1_2/inc/class.db_functions.inc.php
r6331 r6754 24 24 include_once(PHPGW_API_INC.'/class.db.inc.php'); 25 25 } 26 include_once('class.dynamic_contacts.inc.php');27 26 28 27 class db_functions … … 248 247 } 249 248 250 //Gera lista de contatos para ser gravado e acessado pelo expresso offline.251 function get_dropdown_contacts_to_cache() {252 return $this->get_dropdown_contacts();253 }254 255 function get_dropdown_contacts(){256 $contacts = $this->get_cc_contacts();257 $groups = $this->get_cc_groups();258 259 if(($contacts) && ($groups))260 $stringDropDownContacts = $contacts . ',' . $groups;261 elseif ((!$contacts) && (!$groups))262 $stringDropDownContacts = '';263 elseif (($contacts) && (!$groups))264 $stringDropDownContacts = $contacts;265 elseif ((!$contacts) && ($groups))266 $stringDropDownContacts = $groups;267 268 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) {269 // Free others requests270 session_write_close();271 $dynamic_contact = new dynamic_contacts();272 $dynamic = $dynamic_contact->dynamic_contact_toString();273 if ($dynamic)274 $stringDropDownContacts .= ($stringDropDownContacts ? ',' : '') . $dynamic;275 }276 return $stringDropDownContacts;277 }278 249 function getUserByEmail($params){ 279 250 // Follow the referral … … 309 280 } 310 281 311 function get_dynamic_contacts()312 {313 // Pesquisa os emails e ultima inserção nos contatos dinamicos.314 if(!$this->db->select('phpgw_expressomail_contacts','data','id_owner ='.$this->user_id,__LINE__,__FILE__))315 {316 return $this->db->Error;317 }318 while($this->db->next_record())319 {320 $result[] = $this->db->row();321 }322 if($result) foreach($result as $item)323 {324 $contacts = unserialize($item['data']);325 }326 if (count($contacts) == 0)327 {328 return null;329 }330 //Sort by email331 function cmp($a, $b) { return strcmp($a["email"], $b["email"]);}332 usort($contacts,"cmp");333 return $contacts;334 }335 function update_contacts($contacts=array())336 {337 338 339 if(!$this->db->select('phpgw_expressomail_contacts','data','id_owner ='.$this->user_id,__LINE__,__FILE__))340 {341 $result['dberr1'] = $this->db->Error;342 }343 $regs = array();344 while($this->db->next_record())345 {346 $regs[] = $this->db->row();347 }348 $old_contatacts = array();349 foreach($regs as $old){350 $old_contatacts = unserialize($old['data']);351 }352 353 foreach($old_contatacts as $i => $v)354 foreach($contacts as $ii => $vv)355 if(trim($v['email']) == trim($vv['email']))356 unset($old_contatacts[$i]);357 358 359 $old_contatacts = array_merge( $old_contatacts , $contacts);360 // Atualiza um email nos contatos dinamicos.361 if(!$this->db->update('phpgw_expressomail_contacts ','data=\''.serialize($old_contatacts).'\'','id_owner ='.$this->user_id,__LINE__,__FILE__))362 {363 return $this->db->Error;364 }365 return $contacts;366 }367 282 function update_preferences($params){ 368 283 $string_serial = urldecode($params['prefe_string']); … … 375 290 else 376 291 return array("success" => true); 377 }378 379 function insert_contact($contact)380 {381 $contacts[] = array( 'timestamp' => time(),382 'email' => $contact );383 384 // Insere um email nos contatos dinamicos.385 $query = 'INSERT INTO phpgw_expressomail_contacts (data, id_owner) ' .386 'values ( \''.serialize($contacts).'\', '.$this->user_id.')';387 388 if(!$this->db->query($query,__LINE__,__FILE__))389 return $this->db->Error;390 return $contacts;391 }392 393 function remove_dynamic_contact($user_id,$line,$file)394 {395 $where = $user_id.' = id_owner';396 $this->db->delete('phpgw_expressomail_contacts',$where,$line,$file);397 292 } 398 293 -
branches/2.4/expressoMail1_2/inc/class.functions.inc.php
r6733 r6754 15 15 function CalculateDateOffset() 16 16 { 17 18 17 19 $zones = $this->getTimezones();20 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));21 18 19 $zones = $this->getTimezones(); 20 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones)); 21 22 22 $timezone_index = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone']; 23 23 $user_timezone = $zones[$timezone_index]; -
branches/2.4/expressoMail1_2/inc/class.imap_functions.inc.php
r6735 r6754 1095 1095 function get_info_msg($params) 1096 1096 { 1097 1098 1097 if(isset($params['alarm'])){ 1099 1098 $alarm = $params['alarm']; … … 1140 1139 //$return['signature'] = $return_get_body['signature']; 1141 1140 } 1142 1141 1143 1142 $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 1144 1143 if (preg_match($pattern, $header_, $fields)) 1145 $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0])));1144 $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 1146 1145 1147 1146 $return['Recent'] = $header->Recent; … … 1400 1399 $return['login'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id'];//$GLOBALS['phpgw_info']['user']['account_id']; 1401 1400 $return['reply_toaddress'] = $header->reply_toaddress; 1402 1401 1403 1402 if(($return['from']['email'] == '@unspecified-domain' || $return['sender']['email'] == null) && $return['msg_folder'] == 'INBOX/Drafts'){ 1404 1403 $return['from']['email'] = "Rascunho"; 1405 1404 } 1406 1405 1407 1406 if(strpos($return['toaddress2'], 'undisclosed-recipients') !== false){ 1408 1407 $return['toaddress2'] = $this->functions->getLang('without destination'); … … 1677 1676 break; 1678 1677 1679 1678 case 'CANCEL': 1680 1679 1681 1680 $ical = $icalService->getComponent('vevent'); … … 2811 2810 $header = $this->get_header($msg_numb); 2812 2811 $header_ = imap_fetchheader($this->mbox, $msg_numb, FT_UID); 2813 $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 2814 if (preg_match($pattern, $header_, $fields)) 2815 $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 2812 $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi'; 2813 if (preg_match($pattern, $header_, $fields)) 2814 $return['DispositionNotificationTo'] = base64_encode(trim(str_ireplace('Disposition-Notification-To:', '', $fields[0]))); 2816 2815 2817 2816 $message_id = $header->message_id; … … 2918 2917 if($att['disposition'] == 'embedded' && $isHTML) //Caso mensagem em texto simples converter os embedded para attachments 2919 2918 { 2920 $body = str_replace('"../prototype/getArchive.php?mailAttachment='.$att['id'].'"', $att['name'], $body);2921 $mailService->addStringImage(base64_decode($att['source']), $att['type'], mb_convert_encoding($att['name'], 'ISO-8859-1' , 'UTF-8,ISO-8859-1')); 2919 $body = str_replace('"../prototype/getArchive.php?mailAttachment='.$att['id'].'"', '"'.mb_convert_encoding($att['name'], 'ISO-8859-1' , 'UTF-8,ISO-8859-1').'"', $body); 2920 $mailService->addStringImage(base64_decode($att['source']), $att['type'], mb_convert_encoding($att['name'], 'ISO-8859-1' , 'UTF-8,ISO-8859-1')); 2922 2921 } 2923 2922 else 2924 2923 $mailService->addStringAttachment(base64_decode($att['source']), mb_convert_encoding($att['name'], 'ISO-8859-1' , 'UTF-8,ISO-8859-1'), $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' ); 2925 2924 2926 2925 $message_size_total += $att['size']; … … 2937 2936 { 2938 2937 $body = str_ireplace('<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />' , '<img src="'.$att['name'].'" />', $body); 2939 $mailService->addStringImage($att['source'], $att['type'],mb_convert_encoding($att['name'], 'ISO-8859-1' , 'UTF-8,ISO-8859-1') ); 2938 $mailService->addStringImage($att['source'], $att['type'],mb_convert_encoding($att['name'], 'ISO-8859-1' , 'UTF-8,ISO-8859-1') ); 2940 2939 } 2941 2940 else … … 2948 2947 $mbox_stream = $this->open_mbox(mb_convert_encoding($value['folder'] , 'ISO-8859-1' , 'UTF7-IMAP')); 2949 2948 $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']); 2950 2951 $mailService->addStringAttachment($rawmsg, mb_convert_encoding(base64_decode($value['name']), 'ISO-8859-1' , 'UTF-8,ISO-8859-1'), 'message/rfc822', '7bit', 'attachment' );2949 2950 $mailService->addStringAttachment($rawmsg, mb_convert_encoding(base64_decode($value['name']), 'ISO-8859-1' , 'UTF-8,ISO-8859-1'), 'message/rfc822', '7bit', 'attachment' ); 2952 2951 $message_size_total += mb_strlen($rawmsg); //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg. 2953 2952 unset($rawmsg); … … 3029 3028 */ 3030 3029 //////////////////////////////////////////////////////////////////////////////////////////////////// 3031 3032 3030 if ($isHTML) 3033 { 3034 $defaultStyle = ''; 3035 3036 if(isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_family_editor']) && $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_family_editor']) 3037 $defaultStyle .= ' font-family:'.$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_family_editor'] .';'; 3038 3039 if(isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_size_editor']) && $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_size_editor']) 3040 $defaultStyle .= ' font-size:'.$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_size_editor'].';'; 3041 3042 $body = '<span class="'.$defaultStyle.'">'.$body.'</span>'; 3031 { 3032 $this->rfc2397ToEmbeddedAttachment($mailService , $body); 3033 3034 $defaultStyle = ''; 3035 if(isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_family_editor']) && $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_family_editor']) 3036 $defaultStyle .= ' font-family:'.$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_family_editor'] .';'; 3037 3038 if(isset($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_size_editor']) && $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_size_editor']) 3039 $defaultStyle .= ' font-size:'.$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['font_size_editor'].';'; 3040 3041 $body = '<span class="'.$defaultStyle.'">'.$body.'</span>'; 3043 3042 $mailService->setBodyHtml($body); 3044 } 3043 } 3045 3044 else 3046 3045 $mailService->setBodyText($body); … … 3074 3073 error_log("$now - $userip - $sent [$subject] - $userid => $addrs\r\n", 3, "/home/expressolivre/mail_senders.log"); 3075 3074 } 3076 if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) { 3077 $contacts = new dynamic_contacts(); 3078 $new_contacts = $contacts->add_dynamic_contacts($toaddress . "," . $ccaddress . "," . $ccoaddress); 3079 return array("success" => true, "new_contacts" => $new_contacts); 3080 } 3081 3082 if($params['uids_save'] ) 3083 $this->delete_msgs(array('folder'=> $params['save_folder'] , 'msgs_number' => $params['uids_save'])); 3075 if($params['uids_save'] ) 3076 $this->delete_msgs(array('folder'=> $params['save_folder'] , 'msgs_number' => $params['uids_save'])); 3084 3077 3085 3086 3078 //return array("success" => true, "folder" => $folder_list); 3087 3079 return array("success" => true, "load" => $has_new_folder); … … 3839 3831 } 3840 3832 3841 function send_notification($params) 3842 { 3843 $mailService = ServiceLocator::getService('mail'); 3833 function send_notification($params) 3834 { 3835 $mailService = ServiceLocator::getService('mail'); 3844 3836 $body = lang("Your message: %1",$params['subject']) . '<br>'; 3845 3837 $body .= lang("Received in: %1",date("d/m/Y H:i",$params['date'])) . '<br>'; 3846 3838 $body .= lang("Has been read by: %1 < %2 > at %3", $_SESSION['phpgw_info']['expressomail']['user']['fullname'], $_SESSION['phpgw_info']['expressomail']['user']['email'], date("d/m/Y H:i")); 3847 return $mailService->sendMail(base64_decode($params['notificationto']), 3848 $_SESSION['phpgw_info']['expressomail']['user']['email'],3849 $this->htmlspecialchars_decode(lang("Read receipt: %1",$params['subject'])),3850 $body); 3839 return $mailService->sendMail(base64_decode($params['notificationto']), 3840 $_SESSION['phpgw_info']['expressomail']['user']['email'], 3841 $this->htmlspecialchars_decode(lang("Read receipt: %1",$params['subject'])), 3842 $body); 3851 3843 3852 3844 } … … 4907 4899 $return['msgs'][$i]['flag'] .= $msg->Deleted ? $msg->Deleted : ''; 4908 4900 4909 $header = imap_fetchheader( $imap, $v , FT_UID ); // Necessario para recuperar se a mensagem é importante ou não.4901 $header = imap_fetchheader( $imap, $v , FT_UID ); // Necessario para recuperar se a mensagem é importante ou não. 4910 4902 $importante = array(); 4911 4903 … … 5188 5180 * @param <Array> <$proc> <ações do filtro> 5189 5181 * @return <Regras do usuário em Array> 5190 * @access <public>5182 * @access public 5191 5183 */ 5192 5184 function apliSieveFilter($msgs , $proc) … … 5229 5221 return $ret; 5230 5222 } 5223 5224 /** 5225 * Método que convert imagens no formato rfc2397 para Embedded Attachment 5226 * 5227 * @license http://www.gnu.org/copyleft/gpl.html GPL 5228 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 5229 * @sponsor Caixa Econômica Federal 5230 * @author Cristiano Corrêa Schmidt 5231 * @param <MailService> <$mailService> <Referencia objeto MailService> 5232 * @param <String> <$body> <Referencia Corpo do email> 5233 * @return <void> 5234 * @access public 5235 */ 5236 function rfc2397ToEmbeddedAttachment( &$mailService , &$body ) 5237 { 5238 $matches = array(); 5239 preg_match_all("/src=[\'|\"]+data:([^,]*);base64,([a-zA-Z0-9\+\/\=]+)[\'|\"]+/i", $body, $matches, PREG_SET_ORDER); //Resgata imagens em rfc2397 5240 5241 foreach ($matches as $i => &$v) 5242 { 5243 $ext = explode(';', $v[1]); //quebra todos os parametros em um array. 5244 $mailService->addStringImage(base64_decode($v[2]), $ext[0] , 'EmbeddedImage'.$i.'.'.$this->mimeToExtension($v[1])); 5245 $body = str_replace($v[0], 'src="EmbeddedImage'.$i.'.'.$this->mimeToExtension($ext[0]).'"' , $body); 5246 } 5247 } 5248 5249 /** 5250 * Método que retorna a extensão do arquivo atraves do mime type 5251 * 5252 * @license http://www.gnu.org/copyleft/gpl.html GPL 5253 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 5254 * @sponsor Caixa Econômica Federal 5255 * @author Cristiano Corrêa Schmidt 5256 * @param <String> <$mimeType> <Mime Type do arquivo> 5257 * @return <String> <extensão> 5258 * @access public 5259 */ 5260 function mimeToExtension($mimeType) 5261 { 5262 switch ( $mimeType ) 5263 { 5264 case 'image/bmp' : 5265 return 'bmp'; 5266 case 'image/cgm' : 5267 return 'cgm'; 5268 case 'image/vnd.djvu' : 5269 return 'djv'; 5270 case 'image/gif' : 5271 return 'gif'; 5272 case 'image/x-icon' : 5273 return 'ico'; 5274 case 'image/ief' : 5275 return 'ief'; 5276 case 'image/jpeg' : 5277 return 'jpg'; 5278 case 'image/x-macpaint' : 5279 return 'mac'; 5280 case 'image/pict' : 5281 return 'pct'; 5282 case 'image/png' : 5283 return 'png'; 5284 case 'image/x-quicktime' : 5285 return 'qti'; 5286 case 'image/x-rgb' : 5287 return 'rgb'; 5288 case 'image/tiff' : 5289 return 'tif'; 5290 default: 5291 return ''; 5292 } 5293 5294 } 5295 5296 5297 /** 5298 * Método que retorna as mensagens com a flag $FilteredMessage que representa as mensagens filtradas que devem ser alertadas para o usuário 5299 * 5300 * @license http://www.gnu.org/copyleft/gpl.html GPL 5301 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 5302 * @sponsor Caixa Econômica Federal 5303 * @author Airton Bordin Junior <airton@prognus.com.br> 5304 * @author Marcieli <marcieli@prognus.com.br> 5305 * @author Marcos <marcosw@prognus.com.br> 5306 * @param <Array> <$paramFolders> <Pastas onde devem ser buscadas as mensagens> 5307 * @return <Mensagens encontradas com a flag $FilteredMessage> 5308 * @access <public> 5309 */ 5310 function getFlaggedAlertMessages($paramFolders) { 5311 5312 $folders = explode(",", $paramFolders['folders']); 5313 5314 $messages = array(); 5315 $result = array(); 5316 $label = '$FilteredMessage'; 5317 5318 foreach ($folders as $folder) { 5319 $this->mbox = $this->open_mbox($folder); 5320 /* Não deletadas, não lidas e com a flag */ 5321 $messages = imap_search($this->mbox, 'UNDELETED UNSEEN KEYWORD "$FilteredMessage"', SE_UID); 5322 if(is_array($messages)) 5323 foreach ($messages as $k => $m) { 5324 $headers = imap_fetch_overview($this->mbox, $m, FT_UID); 5325 $date = explode(" ", $headers[0]->date); 5326 $result[$m."_".$folder] = array ( 5327 'udate' => $headers[0]->udate, 5328 'smalldate' => $date[5], 5329 'from' => $headers[0]->from, 5330 'subject' => self::decodeMimeString($headers[0]->subject), 5331 'msg_number' => $m, 5332 'msg_folder' => $folder 5333 ); 5334 } 5335 } 5336 $result_final = array(); 5337 foreach ($result as $r){ 5338 $result_final[] = $r; 5339 } 5340 5341 return $result_final; 5342 } 5343 5344 /** 5345 * Esta função é chamada ao clicar sobre uma mensagem listada nos alertas de Filtro por Remetente 5346 * remove a flag e chama a função que recupera os dados da mensagem, para serem utilizados na abertura da aba de leitura da msg 5347 */ 5348 function open_flagged_msg($params){ 5349 $message_number = $params['msg_number']; 5350 $message_folder = $params['msg_folder']; 5351 $alarm = $params['alarm']; 5352 if ($message_folder && $message_number) { 5353 $this->mbox = $this->open_mbox($message_folder); 5354 imap_clearflag_full($this->mbox, $message_number, '$FilteredMessage', ST_UID); 5355 } 5356 $r = $this->get_info_msg(array('msg_number' => $message_number, 'msg_folder' =>urlencode($message_folder), 'alarm' => ($alarm))); 5357 return $r; 5358 } 5359 5360 /** 5361 * Remove a flag que caracteriza uma mensagem como alertada por Filtro por Remetente. 5362 * se houver o parametro msg_number, então remove a flag de uma msg especifica 5363 * se não houver o parametro msg_number, mas sim o from, então remove a flag de todas as msgs da pasta (parametro from), 5364 * e que o remetente for o from. 5365 */ 5366 function removeFlagMessagesFilter($params){ 5367 $message_number = $params['msg_number']; 5368 $folder = $params['folder']; 5369 5370 if(isset($message_number)){ 5371 if(isset($folder)){ 5372 $message_number = explode(',', $message_number); 5373 $this->mbox = $this->open_mbox($folder); 5374 foreach ($message_number as $k => $m) { 5375 imap_clearflag_full($this->mbox, $m, '$FilteredMessage', ST_UID); 5376 } 5377 } 5378 } 5379 else{ 5380 $from = $params['from']; 5381 if(isset($folder) && isset($from)){ 5382 $this->mbox = $this->open_mbox($folder); 5383 $messages = imap_search($this->mbox, 'UNDELETED UNSEEN KEYWORD "$FilteredMessage"', SE_UID); 5384 } 5385 if(is_array($messages)){ 5386 foreach ($messages as $k => $m) { 5387 $headers = imap_fetch_overview($this->mbox, $m, FT_UID); 5388 if(strpos($headers[0]->from, $from) > 0){ 5389 imap_clearflag_full($this->mbox, $m, '$FilteredMessage', ST_UID); 5390 } 5391 } 5392 } 5393 } 5394 5395 return array('status' => "success"); 5396 } 5397 5231 5398 } 5232 5399 ?> -
branches/2.4/expressoMail1_2/inc/class.ldap_functions.inc.php
r6139 r6754 436 436 $ldapService->connection = $this->ds; 437 437 $campos_extras = ''; 438 $justthese = array("cn", "mail", "telephonenumber", "mobile", "phpgwaccountvisible", "uid", "employeenumber", "ou" );438 $justthese = array("cn", "mail", "telephonenumber", "mobile", "phpgwaccountvisible", "uid", "employeenumber", "ou","vacationActive","vacationInfo"); 439 439 foreach($searchable_fields as $fields_ldap => $value_field) 440 440 { … … 473 473 $this->ldapConnect(true,$i); 474 474 $filter="(|(cn=*$search_for*)(mail=*$search_for*))"; 475 $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid","employeeNumber", "ou" );475 $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid","employeeNumber", "ou","vacationActive","vacationInfo"); 476 476 $sr=@ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, $this->max_result+1); 477 477 if(!$sr) … … 496 496 497 497 $info_return['search_for'] = $params['search_for']; 498 return $ info_return;498 return $this->toISO8859($info_return); 499 499 } 500 500 501 /*Converte um parametro de UTF-8 para ISO8859*/ 502 function toISO8859($data) 503 { 504 if(!is_array($data)) 505 return mb_convert_encoding( $data , 'ISO-8859-1' , 'UTF-8 , ISO-8859-1' ); 506 $return = array(); 507 foreach ($data as $i => $v) 508 $return[$this->toISO8859($i)] = $this->toISO8859($v); 509 return $return; 510 } 511 501 512 function make_quicksearch_card($info, $cn) 502 513 { … … 553 564 '<tr class="quicksearchcontacts_unselected">' . 554 565 '<td class="cc" width="1%">' . 555 '<a title="'.$this->functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\' )">' .566 '<a title="'.$this->functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\', \''.$contacts_result["uid"].'\')">' . 556 567 $photo_link . 557 568 '</a>' . … … 559 570 '<td class="cc">' . 560 571 '<span name="cn">' . ($empNumber != "" ? $empNumber : $uid) . $contacts_result['cn'] . '</span>' . '<br>' . 561 '<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\' )">' .572 '<a title="'.$functions->getLang("Write message").'" onClick="javascript:QuickSearchUser.create_new_message(\''.$contacts_result["cn"].'\', \''.$contacts_result["mail"].'\', \''.$contacts_result["uid"].'\')">' . 562 573 '<font color=blue>' . 563 574 '<span name="mail">' . $contacts_result['mail'] . '</span></a></font>'. -
branches/2.4/expressoMail1_2/index.php
r6669 r6754 38 38 <script src="../prototype/plugins/farbtastic/farbtastic.js" language="javascript"></script> 39 39 <script src="../prototype/api/datalayer.js" language="javascript"></script> 40 <script src="../prototype/api/rest.js" language="javascript"></script> 40 41 <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script> 41 <script language="javascript">DataLayer.dispatchPath = "../prototype/";</script> 42 <script language="javascript"> 43 DataLayer.dispatchPath = "../prototype/"; 44 REST.dispatchPath = "../prototype/"; 45 REST.load(""); 46 </script> 42 47 <script src="../library/ckeditor/ckeditor.js" language="javascript" charset="utf-8"></script> 43 48 <script src="../library/ckeditor/adapters/jquery.js" language="javascript"></script> … … 56 61 <script type="text/javascript" src="../prototype/plugins/datejs/sugarpak.js"></script> 57 62 <script type="text/javascript" src="../prototype/plugins/datejs/parser.js"></script> 63 <script type="text/javascript" src="../prototype/plugins/jq-raty/js/jquery.raty.min.js"></script> 58 64 59 65 <script type="text/javascript" src="../prototype/plugins/watermark/jquery.watermarkinput.js"></script> … … 71 77 <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.date.js"></script> 72 78 <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.codecs.js"></script> 73 79 <link rel="stylesheet" type="text/css" href="../prototype/plugins/freeow/style/freeow/freeow.css" > 80 <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.min.js"></script> 81 <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.js"></script> 82 74 83 75 84 <script src="js/rich_text_editor.js" type="text/javascript"></script> … … 194 203 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; 195 204 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache']; 205 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['expressoMail_ldap_identifier_recipient'] = $current_config['expressoMail_ldap_identifier_recipient']; 196 206 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_x_origin'] = $current_config['expressoMail_use_x_origin']; 197 207 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0"; … … 215 225 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] : "0"; 216 226 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] : "0"; 217 218 227 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] : 1; 219 228 // ACL for block edit Personal Data. … … 274 283 $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter']; 275 284 echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\' 276 var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\' </script>'; 285 var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\' 286 </script>'; 277 287 // End Set Anti-Spam options. 278 288 … … 352 362 "js/main.js," . 353 363 "js/draw_api.js,"; 354 355 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) 356 { 357 //echo $obj -> getFilesJs("js/shortcut.js", $update_version);358 $scripts .= "js/shortcut.js,"; 359 } 360 364 365 if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) 366 { 367 //echo $obj -> getFilesJs("js/shortcut.js", $update_version); 368 $scripts .= "js/shortcut.js,"; 369 } 370 361 371 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']) 362 372 $scripts .= "js/local_messages.js,"; … … 364 374 "js/DropDownContacts.js," . 365 375 "js/doiMenuData.js," . 366 "js/connector.js"; 376 "js/connector.js"; 367 377 echo $obj -> getFilesJs($scripts, $update_version); 368 378 echo ' -
branches/2.4/expressoMail1_2/js/QuickCatalogSearch.js
r6631 r6754 14 14 }); 15 15 }); 16 16 17 17 /* showlist */ 18 18 emQuickCatalogSearch.prototype.showList = function(data, begin, end, ID, field) … … 125 125 switch(data_['type_catalog']) { 126 126 case 'G': 127 if(data_['extra_ldap_fields'] != undefined){128 if(data_['extra_ldap_fields'].length != 0) 129 var extra_fields = (data_['extra_ldap_fields']).split("#");127 if(data_['extra_ldap_fields'] != undefined){ 128 if(data_['extra_ldap_fields'].length != 0) 129 var extra_fields = (data_['extra_ldap_fields']).split("#"); 130 130 else 131 131 var extra_fields = []; … … 149 149 } 150 150 } 151 if (data_[id_contact].vacationactive == "TRUE"){ 152 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 153 if ( data_[id_contact].vacationinfo ){ 154 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data_[id_contact].vacationinfo +'</span></div></div>'); 155 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 156 var link = $('<a>').html('Ver mais'); 157 link.attr('id','more'); 158 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 159 details.append(link); 160 } 161 } 162 } 151 163 break; 152 164 case 'P': … … 157 169 if(data_[id_contact].telephonenumber != null) 158 170 details.append('<p><label class="attribute">Telefone</label>' + '<span class="value">' + data_[id_contact].telephonenumber + '</span></p>'); 171 if (data_[id_contact].vacationactive == "TRUE"){ 172 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 173 if (data_[id_contact].vacationinfo){ 174 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data_[id_contact].vacationinfo +'</span></div></div>'); 175 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 176 var link = $('<a>').html('Ver mais'); 177 link.attr('id','more'); 178 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 179 details.append(link); 180 } 181 } 182 } 159 183 break; 160 184 default: 161 if(data_['extra_ldap_fields'] != undefined){ 162 if(data_['extra_ldap_fields'].length != 0) 163 var extra_fields = (data_['extra_ldap_fields']).split("#");185 if(data_['extra_ldap_fields'] != undefined){ 186 if(data_['extra_ldap_fields'].length != 0) 187 var extra_fields = (data_['extra_ldap_fields']).split("#"); 164 188 else 165 189 var extra_fields = []; … … 190 214 } 191 215 } 216 if (data_[id_contact].vacationactive == "TRUE"){ 217 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 218 if (data_[id_contact].vacationinfo){ 219 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data_[id_contact].vacationinfo +'</span></div></div>'); 220 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 221 var link = $('<a>').html('Ver mais'); 222 link.attr('id','more'); 223 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 224 details.append(link); 225 } 226 } 227 } 192 228 break; 193 229 } … … 255 291 var signal = "+"; 256 292 var btnClass = "add"; 257 var emailList = content.find(field_).val(); 258 var emails_adicionados = emailList.split(","); 293 emails_adicionados = ""; 294 var emailList = content.find(field_).filter("input").parent().find("div input"); 295 // var array = content.find(".to-tr").find(".box"); 296 $.each(emailList, function(index, value){ 297 emails_adicionados += $(value).val() + ","; 298 }); 299 emails_adicionados = emails_adicionados.split(","); 259 300 for(aux=0; aux<emails_adicionados.length -1; aux++) { 260 301 if(emails_adicionados[aux].match(/<([^<]*)>[\s]*$/)){ … … 279 320 else if(contact_name.toLowerCase().indexOf(data.search_for.toLowerCase()) != -1 && data.search_for.indexOf(" ") == -1 && data.search_for.indexOf("@") == -1) 280 321 contact_name = contact_name.substring(0, contact_name.toLowerCase().indexOf(data.search_for.toLowerCase())) + "<u>" + contact_name.substr(contact_name.toLowerCase().indexOf(data.search_for.toLowerCase()), data.search_for.length) + "</u>" + contact_name.substring(contact_name.toLowerCase().indexOf(data.search_for.toLowerCase()) + data.search_for.length); 281 var line = '<span class="menu-control"><button class="'+btnClass+'" id="actions_'+i+'" onClick="'+exist+'(document.getElementById(\'contact_' + i + '\').innerHTML, this, \'contact_' + i + '\')">'+ signal +'</button></span><div id="contact_' + i + '" onDblClick="'+exist+'(this.innerHTML, document.getElementById(\'actions_'+i+'\'), \'contact_' + i + '\')"><div class="name_contact"><strong class="name">' + contact_name + '</strong><em class="email">' + ((utf8_decoder(data[i-1].mail) != undefined)? (utf8_decoder(data[i-1].mail) == 'undefined' ? get_lang("No mail") : utf8_decoder(data[i-1].mail)) : get_lang("No mail")) + '</em></div></div>'; 322 var vacationImg = ''; 323 if (data[i-1].vacationactive == "TRUE") 324 vacationImg = '<img src="templates/default/images/mala-small.png"/>'; 325 var line = '<span class="menu-control"><button class="'+btnClass+'" id="actions_'+i+'" onClick="'+exist+'(document.getElementById(\'contact_' + i + '\').innerHTML, this, \'contact_' + i + '\')">'+ signal +'</button></span><div id="contact_' + i + '" onDblClick="'+exist+'(this.innerHTML, document.getElementById(\'actions_'+i+'\'), \'contact_' + i + '\')"><div class="name_contact"><strong class="name">' + contact_name +' '+ vacationImg +'</strong><em class="email">' + ((utf8_decoder(data[i-1].mail) != undefined)? (utf8_decoder(data[i-1].mail) == 'undefined' ? get_lang("No mail") : utf8_decoder(data[i-1].mail)) : get_lang("No mail")) + '</em></div></div>'; 282 326 Op.innerHTML = line; 283 327 $(Op).val(i - 1); … … 317 361 } 318 362 } 319 } 363 } 364 if (data[first_contact].vacationactive == "TRUE"){ 365 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 366 if ( data[first_contact].vacationinfo ){ 367 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data[first_contact].vacationinfo +'</span></div></div>'); 368 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 369 var link = $('<a>').html('Ver mais'); 370 link.attr('id','more'); 371 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 372 details.append(link); 373 } 374 } 375 } 320 376 break; 321 377 case 'P': … … 326 382 if(data[first_contact].telephonenumber != null) 327 383 details.append('<p><label class="attribute">Telefone</label>' + '<span class="value">' + data[first_contact].telephonenumber + '</span></p>'); 384 if (data[first_contact].vacationactive == "TRUE"){ 385 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 386 if ( data[first_contact].vacationinfo ){ 387 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data[first_contact].vacationinfo +'</span></div></div>'); 388 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 389 var link = $('<a>').html('Ver mais'); 390 link.attr('id','more'); 391 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 392 details.append(link); 393 } 394 } 395 } 328 396 break; 329 397 default: … … 358 426 } 359 427 } 428 if (data[first_contact].vacationactive == "TRUE"){ 429 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 430 if ( data[first_contact].vacationinfo ){ 431 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data[first_contact].vacationinfo +'</span></div></div>'); 432 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 433 var link = $('<a>').html('Ver mais'); 434 link.attr('id','more'); 435 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 436 details.append(link); 437 } 438 } 439 } 360 440 break; 361 441 } 362 var string_results = sliderValue + " " + get_lang("of") + " " + paginas + " (" + data.length + " " + get_lang("Results") + ")"; 363 442 var string_results = sliderValue + " " + get_lang("of") + " " + paginas + " (" + data.length + " " + get_lang("Results") + ")"; 443 $( "#amount-text" ).val( string_results ).attr('readonly', true); 364 444 $("button").button(); 365 445 //$("button.remove").button({icons:{primary:"ui-icon-close"}, text: false}); … … 389 469 }else 390 470 var extra_fields = []; 391 if(preferences.default_fields_quick_search != 0 && data[this.value] ) { 392 393 if(data[this.value].telephonenumber )471 if(preferences.default_fields_quick_search != 0 && data[this.value] ) { 472 details.append('<p><label class="attribute">' + utf8_decoder(data[this.value].cn[0]) + "</label>" + '<span class="value">' + (data[this.value].mail ? data[this.value].mail[0] : "")+ "</span></p>"); 473 if(data[this.value].telephonenumber ) 394 474 details.append('<p><label class="attribute">Telefone</label>' + '<span class="value">' + (data[this.value].telephonenumber ? data[this.value].telephonenumber[0] : "")+ "</span></p>"); 395 475 } … … 405 485 } 406 486 } 487 if (data[this.value].vacationactive == "TRUE"){ 488 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 489 if ( data[this.value].vacationinfo ){ 490 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data[this.value].vacationinfo +'</span></div></div>'); 491 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 492 var link = $('<a>').html('Ver mais'); 493 link.attr('id','more'); 494 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 495 details.append(link); 496 } 497 } 498 } 407 499 break; 408 500 case 'P': … … 413 505 if(data[this.value].telephonenumber != null) 414 506 details.append('<p><label class="attribute">Telefone</label>' + '<span class="value">' + data[this.value].telephonenumber + "</span></p>"); 507 if (data[this.value].vacationactive == "TRUE"){ 508 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 509 if ( data[this.value].vacationinfo ){ 510 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data[this.value].vacationinfo +'</span></div></div>'); 511 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 512 var link = $('<a>').html('Ver mais'); 513 link.attr('id','more'); 514 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 515 details.append(link); 516 } 517 } 518 } 415 519 break; 416 520 default: 417 if(this.value == undefined) 418 break; 419 521 if(this.value == undefined) 522 break; 523 420 524 if(data['extra_ldap_fields'].length != 0) 421 525 var extra_fields = (data['extra_ldap_fields']).split("#"); … … 447 551 } 448 552 } 553 if (data[this.value].vacationactive == "TRUE"){ 554 details.append('<p><img src="templates/default/images/mala-big.png"/><span class="title-outoffice">Filtro "Fora do Escritório" ativo.</span></p>'); 555 if ( data[this.value].vacationinfo ){ 556 details.append('<div class="outoffice"><div class="outoffice-inner"><span>'+ data[this.value].vacationinfo +'</span></div></div>') 557 if ( $('.outoffice-inner').height() > $('.outoffice').height() ){ 558 var link = $('<a>').html('Ver mais'); 559 link.attr('id','more'); 560 link.bind('click',function(){$('.outoffice').animate({height: $('.outoffice-inner').height(),width: '-=15px'},800); $('#more').unbind('click').hide();}); 561 details.append(link); 562 } 563 } 564 } 449 565 break; 450 566 } … … 587 703 var nome = $(contact).clone().find('.name').text(); 588 704 var email = $(contact).clone().find('.email').text(); 589 590 705 if(email == get_lang("No mail")){ 591 706 alert(get_lang("It is not possible to add this contact as a recipient because it does not have email")); … … 594 709 return; 595 710 } 596 597 711 verifyEmails(email, divs); 598 599 final_contact = "\""+nome +"\" <"+email+">, "; 600 601 var emailList = content.find(field_).val(); 602 //remove os caracteres da busca 603 emailList = emailList.substr(0,emailList.lastIndexOf(',')+1); 604 605 if (emailList[0] != '"' && emailList.indexOf(",") < 0) 606 emailList = emailList.substr(end_); 607 if(emailList.lastIndexOf(",") > 0){ 608 if(emailList.substr(emailList.length-1, emailList.length) == "," || emailList.substr(emailList.length-2, 1) == ","){ 609 emailList = emailList.substr(0, emailList.lastIndexOf(",") + 1); 610 } else { 611 emailList = emailList.substr(0, emailList.lastIndexOf("") + 1); 612 final_contact = ","+final_contact; 712 final_contact = "\""+nome +"\" <"+email+">"; 713 714 final_contact = final_contact.replace(/\/n/, ""); 715 var index = parseInt(divs.split("_")[1])-1; 716 if(data_[index].type_contact == "G"){ 717 var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 718 if(ldap_id){ 719 draw_email_box( 720 (data_[index][ldap_id.toLowerCase()] ? data_[index][ldap_id.toLowerCase()][0] : final_contact) 721 , content.find(field_).filter("input") 722 ); 723 }else{ 724 draw_email_box(final_contact, content.find(field_).filter("input")); 725 } 726 }else{ 727 draw_email_box((data_[index].id_contact ? data_[index].id_contact : data_[index].id), content.find(field_).filter("input"), (data_[index].id_contact ? true : "G")); 613 728 } 614 }615 616 final_contact = final_contact.replace(/\/n/, "");617 new_emailList = emailList + final_contact;618 content.find(field_).val(new_emailList);619 620 content.find(field_).trigger("update");621 622 729 content.find(field_).filter("input").val(""); 623 730 button.onclick = function(){ … … 625 732 }; 626 733 var div = document.getElementById(divs); 627 628 734 div.ondblclick = function(){ 629 735 remove_contact_field(div.innerHTML, button, divs); 630 736 }; 631 632 737 button.innerHTML = '<span class="ui-button-text" style="">x</span>'; 633 738 } … … 639 744 function remove_contact_field(contact, button, divs) { 640 745 var email = $(contact).clone().find('.email').text(); 641 var exist = false; 642 643 var emailList = content.find(field_).val(); 644 var emails_adicionados = emailList.split(","); 645 646 verifyEmails(email, divs); 647 648 for(i=0; i<emails_adicionados.length -1; i++) { 649 650 if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)){ 651 if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) { 652 emails_adicionados[i] = "%"; 653 exist = true; 654 } 655 }else{ 656 if(emails_adicionados[i].toLowerCase() == email.toLowerCase()) { 657 emails_adicionados[i] = "%"; 658 exist = true; 659 } 660 } 661 } 662 663 if (exist == false) 664 return false; 665 var novos_contatos = emails_adicionados.join(","); 666 novos_contatos = novos_contatos.replace(/%,/g, ""); 667 content.find(field_).val(novos_contatos); 668 746 var array = content.find(field_).parent().find("div input"); 747 $.each(array, function(index, value){ 748 var validated_email = $(value).val(); 749 if(validated_email.match(/<([^<]*)>[\s]*$/)){ 750 if(validated_email.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) { 751 $(value).parent().remove(); 752 } 753 } 754 }); 755 669 756 button.onclick = function(){ 670 757 add_contact_field(document.getElementById(divs).innerHTML, button, divs); 671 758 }; 672 673 759 var div = document.getElementById(divs); 674 675 760 div.ondblclick = function(){ 676 761 add_contact_field(div.innerHTML, button, divs); 677 762 }; 678 679 content.find(field_).trigger("update");680 763 button.innerHTML = '<span class="ui-button-text" style="">+</span>'; 681 764 } -
branches/2.4/expressoMail1_2/js/QuickSearchUser.js
r5477 r6754 53 53 } 54 54 55 emQuickSearchUser.prototype.create_new_message = function (cn, mail )55 emQuickSearchUser.prototype.create_new_message = function (cn, mail, uid) 56 56 { 57 57 QuickSearchUser.closeWindow(); 58 var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 58 59 59 if (openTab.type[currentTab] != 4) 60 { 61 Element("msg_number").value = "\""+cn+"\" <"+mail+">"; 60 if (openTab.type[currentTab] != 4){ 62 61 new_message("new","null"); 63 62 } 64 else 65 { 66 var ToField = Element('to_'+currentTab); 67 ToField.value = ToField.value +"\""+cn+"\" <"+mail+">,"; 63 64 if(ldap_id){ 65 draw_email_box(uid, $("#content_id_"+currentTab).find(".to").filter("input")); 66 }else{ 67 draw_email_box("\""+cn+"\" <"+mail+">", $("#content_id_"+currentTab).find(".to").filter("input")); 68 68 } 69 69 } -
branches/2.4/expressoMail1_2/js/TreeShow.js
r6607 r6754 88 88 var aux = ttree.getFolder().split(cyrus_delimiter); 89 89 var aux2; 90 91 if(ttree.getFolder() == "") 92 { 93 ttree.setFolder("root"); 94 } 95 90 91 if(ttree.getFolder() == "") 92 { 93 ttree.setFolder("root"); 94 } 95 96 96 if( ttree.getFolder() != "" ) 97 97 { -
branches/2.4/expressoMail1_2/js/abas.js
r6691 r6754 270 270 parent_bb.insertBefore(td, bb); 271 271 272 if((typeof(id_value) == 'string') && id_value.match(/_r/)){ 272 if((typeof(id_value) == 'string') && id_value.match(/_r/)){ 273 273 $(td).draggable({ 274 274 start : function(){ … … 306 306 var border_id = ui.draggable.find("input[type=hidden]").attr("name"); 307 307 if(folder_to_move == "border_tr"){ 308 var id_msg = border_id.split("_")[0]; 308 var id_msg = border_id.split("_")[0]; 309 309 folder = $("#input_folder_"+border_id+"_r")[0] ? $("#input_folder_"+border_id+"_r").val() : (openTab.imapBox[border_id] ? openTab.imapBox[border_id]:get_current_folder()); 310 310 move_msgs2(folder, id_msg, border_id, folder_to, to_folder_title,true); … … 400 400 } 401 401 var caption = ""; 402 if (border != null){403 Element("font_"+border.id).style.width = (border_width - 35)+'px'; 404 Element("font_"+border.id).innerHTML = title; 405 } 402 if (border != null){ 403 Element("font_"+border.id).style.width = (border_width - 35)+'px'; 404 Element("font_"+border.id).innerHTML = title; 405 } 406 406 return(title); 407 407 } … … 435 435 'width' : width, 436 436 'onClose': function(clicked) { 437 if(clicked == 'Cancelar'){ 438 if (RichTextEditor.plain[id] != true)439 setTimeout("RichTextEditor.focus("+ID+")",100);440 else441 $('#body_'+ID).focus();442 437 if(clicked == 'Cancelar'){ 438 if (RichTextEditor.plain[id] != true) 439 setTimeout("RichTextEditor.focus("+ID+")",100); 440 else 441 $('#body_'+ID).focus(); 442 } 443 443 if(clicked == 'Descartar alterações' || clicked == 'Descartar alterações e anexos' ) { 444 444 if (openTab.imapBox[ID] && !openTab.toPreserve[ID]) … … 502 502 function delete_border(ID, msg_sent) 503 503 { 504 505 if($("#border_id_"+ID).attr("title") == get_lang("New Message")){ 506 var to = $("#content_id_"+ID).find(".to").parent(".email-area").find("div").length || $("#content_id_"+ID).find(".email-area").find(".to").val() || $("#content_id_"+ID).find(".to").val();507 var cc = $("#content_id_"+ID).find(".cc").parent(".email-area").find("div").length || $("#content_id_"+ID).find(".email-area").find(".cc").val() || $("#content_id_"+ID).find(".cc").val();508 var cco = $("#content_id_"+ID).find(".cco").parent(".email-area").find("div").length || $("#content_id_"+ID).find(".email-area").find(".cco").val() || $("#content_id_"+ID).find(".cco").val();509 var subject = $("#content_id_"+ID).find(".subject").val(); 510 var auxAttachments = false; 511 var attachments = $("#content_id_"+ID).find("ul.attachments-list").find("li").each(function(){ 512 ($(this).find("p").length > 0) ? auxAttachments = true : auxAttachments;513 if(auxAttachments)514 return false;515 }); 516 var textArea = RichTextEditor.getData("body_"+ID); 517 518 if(!to && !cc && !cco && !auxAttachments && subject == "" && textArea == "") 519 close_delete(ID, msg_sent);504 505 if($("#border_id_"+ID).attr("title") == get_lang("New Message")){ 506 var to = $("#content_id_"+ID).find(".to").parent(".email-area").find("div").length || $("#content_id_"+ID).find(".email-area").find(".to").val(); 507 var cc = $("#content_id_"+ID).find(".cc").parent(".email-area").find("div").length || $("#content_id_"+ID).find(".email-area").find(".cc").val(); 508 var cco = $("#content_id_"+ID).find(".cco").parent(".email-area").find("div").length || $("#content_id_"+ID).find(".email-area").find(".cco").val(); 509 var subject = $("#content_id_"+ID).find(".subject").val(); 510 var auxAttachments = false; 511 var attachments = $("#content_id_"+ID).find("ul.attachments-list").find("li").each(function(){ 512 ($(this).find("p").length > 0) ? auxAttachments = true : auxAttachments; 513 if(auxAttachments) 514 return false; 515 }); 516 var textArea = RichTextEditor.getData("body_"+ID); 517 518 if(!to && !cc && !cco && !auxAttachments && subject == "" && textArea == "") 519 close_delete(ID, msg_sent); 520 520 } 521 521 var bolExecuteClose = true; -
branches/2.4/expressoMail1_2/js/ccQuickAdd.js
r6690 r6754 1 /* Build the Object */ 2 var ccQuickAddOne = {3 send : function(data){ 4 var email = data[4]; 1 /* Build the Object */ 2 var ccQuickAddOne = { 3 send : function(data){ 4 var email = data[4]; 5 5 var handler = function (responseText) 6 6 { … … 9 9 write_msg("Problema ao contactar servidor"); 10 10 return; 11 }else if (data['status'] == 'alreadyExists'){ 11 }else if (data['status'] == 'alreadyExists'){ 12 12 alert(data['msg']); 13 13 return; … … 16 16 } 17 17 18 write_msg(get_lang("Contact added successfully.")); 18 var exist = 0; 19 $.each(dynamicContacts, function(x, valuex){ 20 if(valuex.mail == email){ 21 exist = valuex.id; 22 return false; 23 } 24 }); 25 if(exist){ 26 REST.delete("/dynamiccontact/"+exist); 27 write_msg(get_lang("The contact was moved from recent contacts to personal contacts successful.")); 28 }else{ 29 write_msg(get_lang("Contact added successfully.")); 30 } 19 31 }; 20 32 21 var data2 = new Array(); 22 for( var i in data ) 23 data2[ data2.length ] = data[i]; 24 25 var sdata= 'add='+escape(connector.serialize(data2));33 var data2 = new Array(); 34 for( var i in data ) 35 data2[ data2.length ] = data[i]; 36 37 var sdata = 'add='+escape(connector.serialize(data2)); 26 38 var CC_url = '../index.php?menuaction=contactcenter.ui_data.data_manager&method='; 27 39 connector.newRequest('cQuickAdd.Send', CC_url+'quick_add', 'POST', handler, sdata); 40 updateDynamicPersonalContacts(); 41 cache = new Array(); 28 42 return true; 29 43 }, 30 showList: function(data){ 31 var cc_data = ((typeof data) == 'object' ) ? data : data.split(','); 32 quickContact = $("#quickAddContact").html( DataLayer.render( BASE_PATH + "modules/mail/templates/quickAddContact.ejs",{ nick : cc_data[0], fname : cc_data[1], lname : cc_data[2], email : cc_data[3] })); 33 quickContact.dialog({ 34 resizable : false, 35 title : get_lang("Quick Add"), 36 modal : true, 37 buttons : [ 38 { 39 text: get_lang("Cancel"), 40 click: function() 41 { 42 $(this).dialog("close"); 43 }44 }, 45 { 46 text: get_lang("Save"), 47 click: function() 48 { 49 data = { 50 nick: $(this).find('#quickAddOne_nickName').val(), 51 name: $(this).find('#quickAddOne_firstName').val(), 52 last: $(this).find('#quickAddOne_lastName').val(), 53 telefone: "", 54 email: $(this).find('#quickAddOne_email').val() 55 }; 56 $(this).find('input').removeClass("required-fail"); 57 if(data.name ==""){ 58 $(this).find('#quickAddOne_firstName').addClass("required-fail"); 59 return false; 60 }else if(data.email ==""){ 61 $(this).find('#quickAddOne_email').addClass("required-fail"); 62 return false; 63 }else if(!validateEmail(data.email)){ 64 $(this).find('#quickAddOne_email').addClass("required-fail"); 65 new $.Zebra_Dialog(get_lang("QuickAddInvalidMail", data.email),{ 66 'buttons': false, 67 'modal': false, 68 'position': ['right - 20', 'top + 20'], 69 'auto_close': 3000 70 }); 71 return false; 72 } 73 if(ccQuickAddOne.send(data)) 74 $(this).dialog("close"); 75 } 76 } 77 ] 78 }); 79 80 }44 showList: function(data){ 45 var cc_data = ((typeof data) == 'object' ) ? data : data.split(','); 46 quickContact = $("#quickAddContact").html( DataLayer.render( BASE_PATH + "modules/mail/templates/quickAddContact.ejs",{ nick : cc_data[0], fname : cc_data[1], lname : cc_data[2], email : cc_data[3] })); 47 quickContact.dialog({ 48 resizable : false, 49 title : get_lang("Quick Add"), 50 modal : true, 51 buttons : [ 52 { 53 text: get_lang("Cancel"), 54 click: function() 55 { 56 $(this).dialog("close"); 57 } 58 }, 59 { 60 text: get_lang("Save"), 61 click: function() 62 { 63 data = { 64 nick: $(this).find('#quickAddOne_nickName').val(), 65 name: $(this).find('#quickAddOne_firstName').val(), 66 last: $(this).find('#quickAddOne_lastName').val(), 67 telefone: "", 68 email: $(this).find('#quickAddOne_email').val() 69 }; 70 $(this).find('input').removeClass("required-fail"); 71 if(data.name ==""){ 72 $(this).find('#quickAddOne_firstName').addClass("required-fail"); 73 return false; 74 }else if(data.email ==""){ 75 $(this).find('#quickAddOne_email').addClass("required-fail"); 76 return false; 77 }else if(!validateEmail(data.email)){ 78 $(this).find('#quickAddOne_email').addClass("required-fail"); 79 new $.Zebra_Dialog(get_lang("QuickAddInvalidMail", data.email),{ 80 'buttons': false, 81 'modal': false, 82 'position': ['right - 20', 'top + 20'], 83 'auto_close': 3000 84 }); 85 return false; 86 } 87 if(ccQuickAddOne.send(data)) 88 $(this).dialog("close"); 89 } 90 } 91 ] 92 }); 93 quickContact.next().css("background-color", "#E0EEEE").find("button").addClass("button").addClass("small"); 94 } 81 95 }; -
branches/2.4/expressoMail1_2/js/common_functions.js
r6727 r6754 775 775 } 776 776 777 function search_emails(value ){777 function search_emails(value, data){ 778 778 var resize = false; 779 779 resize = resize_borders(); … … 815 815 connector.loadScript("search"); 816 816 if (typeof(EsearchE) == 'undefined' || typeof(ttree) == 'undefined'){ 817 setTimeout("search_emails('"+value+"' )",500);817 setTimeout("search_emails('"+value+"', '"+data+"')",500); 818 818 return false; 819 819 } 820 EsearchE.showForms(value );820 EsearchE.showForms(value, data); 821 821 $("#em_message_search").val(""); 822 822 } … … 1127 1127 Element("check_box_message_"+main_list[i].id).checked = true; 1128 1128 remove_className(Element(main_list[i].id), 'selected_msg'); 1129 if(!$("#"+main_list[i].id).hasClass("selected_shortcut_msg")){ 1130 //add_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg current_selected');1131 add_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg');1132 } else {1133 $("#"+main_list[i].id).addClass("selected_msg");1134 $("#"+main_list[i].id).addClass("selected_shortcut_msg");1135 $("#"+main_list[i].id).addClass("current_selected");1136 }1129 if(!$("#"+main_list[i].id).hasClass("selected_shortcut_msg")){ 1130 //add_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg current_selected'); 1131 add_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg'); 1132 } else { 1133 $("#"+main_list[i].id).addClass("selected_msg"); 1134 $("#"+main_list[i].id).addClass("selected_shortcut_msg"); 1135 $("#"+main_list[i].id).addClass("current_selected"); 1136 } 1137 1137 } 1138 1138 } … … 1144 1144 remove_className(Element(main_list[i].id), 'selected_msg selected_shortcut_msg'); 1145 1145 $("#"+main_list[i].id).removeClass("selected_msg"); 1146 $("#"+main_list[i].id).removeClass("current_selected"); 1147 } 1148 } 1146 $("#"+main_list[i].id).removeClass("current_selected"); 1147 } 1148 } 1149 1149 1150 } 1150 1151 -
branches/2.4/expressoMail1_2/js/doiMenuData.js
r5866 r6754 195 195 items: menuToolsItems 196 196 }); 197 197 var reComplexEmail = /<([^<]*)>[\s]*$/; 198 $.contextMenu({ 199 selector: ".box", 200 autoHide:true, 201 items: { 202 "add" : {name: get_lang("Quick Add"), icon : "quick-add",callback: function(key, opt){ var fname = $(opt.$trigger).find("input").val().split('"')[1];ccQuickAddOne.showList(','+fname+', ,'+$.trim($(opt.$trigger).find("input").val()).match(reComplexEmail)[1]); }}, 203 "remove" : {name:get_lang("Remove recipient"), icon:"delete-box",callback: function(key, opt){ $(opt.$trigger).remove(); }}, 204 "sep1": "---------", 205 "quick_search" : {name:get_lang("Quick search of messages"), icon: "quick-search-contact",callback: function(key, opt){ search_emails($.trim($(opt.$trigger).find("input").val()).match(reComplexEmail)[1]); }}, 206 "full_search" : {name:get_lang("Search messages of ..."), icon: "quick-search-contact",callback: function(key, opt){ search_emails("", $.trim($(opt.$trigger).find("input").val()).match(reComplexEmail)[1]);}} 207 } 208 }); 198 209 199 210 function updateLabelsColumn(messageInfo) { … … 294 305 } 295 306 296 297 298 299 300 301 307 function loadExtraLDAPBox(data, element){ 308 menuItensLabel = {}; 309 menuItensLabel["Name"] = {name: "<b>"+data[0].value+"</b>", disabled: true}; 310 menuItensLabel["Email"] = {name: data[1].value, disabled: true}; 311 if(data[2].value){ 312 menuItensLabel["TelefoneLabel"] = {name: "<b>"+get_lang("Telephone")+"</b>", disabled: true}; 313 menuItensLabel["TelefoneValue"] = {name: data[2].value, disabled: true}; 314 } 315 if(data[3]){ 316 if(data[3].value == "TRUE"){ 317 menuItensLabel["outOffice"] = {name: "<b>"+get_lang("Out of office")+"</b>", disabled: true}; 318 menuItensLabel["outOfficeValue"] = {name: data[4].value.substring(0, 20), disabled: true}; 319 } 320 } 321 $.contextMenu({ 322 selector: "#content_id_"+currentTab+" "+element+" .box-info", 323 trigger: 'hover', 324 delay:100, 325 autoHide:true, 326 items: menuItensLabel 327 }); 328 } 329 330 function loadGroupBox(data, element){ 331 menuItensLabel = {}; 332 menuItensLabel["ContactGroupLabelAll"] = {name:"<b>"+get_lang("Group contacts")+"</b>", disabled: true}; 333 menuItensLabel["sep1"] = "---------"; 334 if(data.itens){ 335 var aux = 0; 336 for(var item in data.itens){ 337 if(parseInt(item) <= 4){ 338 menuItensLabel["ContactGroupLabel"+item] = {name: "<b>"+data.itens[item].data[0].value+"</b>", disabled: true}; 339 menuItensLabel["ContactGroupValue"+item] = {name: data.itens[item].data[2].value, disabled: true}; 340 }else{ 341 aux++; 342 if(aux == 1) 343 menuItensLabel["MoreContactGroupValue"] = {name : get_lang("And more %1 contact", aux), disabled: true }; 344 else 345 menuItensLabel["MoreContactGroupValue"] = {name : get_lang("And more %1 contact", aux)+"s", disabled: true }; 346 } 347 } 348 } 349 $.contextMenu({ 350 selector: "#content_id_"+currentTab+" "+element+" .box-info", 351 trigger: 'hover', 352 delay:100, 353 autoHide:true, 354 items: menuItensLabel 355 }); 356 } 357 358 359 360 361 -
branches/2.4/expressoMail1_2/js/draw_api.js
r6732 r6754 8 8 * formatação, etc.) 9 9 */ 10 11 focusIn = ""; 12 canMakeBox = true; 13 fastSearch = false; 14 10 15 onceOpenedHeadersMessages = {}; 11 16 var cache = new Array(); 12 17 var openTab = { 13 18 'type' : [], // 8 types of tabs, further info. see expressolivre.org/dev/wiki/mail/Documentacao … … 891 896 var _mouse_out; 892 897 var _cell; 893 var colGroupMain = document.getElementById("colgroup_main_"+numBox); 894 898 var colGroupMain = document.getElementById("colgroup_main_"+numBox); 899 var colGroupHead = document.getElementById("colgroup_head_"+numBox); 895 900 for (var r=0;r<trM.length;r++) { 896 901 for (var c=0;c<trM[r].cells.length;c++) { … … 899 904 if (is_mozilla && !is_webkit) { 900 905 if (!emptyBody) { 901 colGroupMain.childNodes[c].setAttribute("width",colSizes[tbl][c]); 906 colGroupMain.childNodes[c].setAttribute("width",colSizes[tbl][c]); 902 907 } 903 colGroupHead.childNodes[c].setAttribute("width",colSizes[tbl][c]); 908 colGroupHead.childNodes[c].setAttribute("width",colSizes[tbl][c]); 904 909 if (tbH.rows[0].cells[c].className=="th_resizable") { 905 910 // lots of stupid fixes for FF to redraw cell content … … 929 934 document.getElementById("colgroup_main_"+numBox).childNodes[c].setAttribute("width",colSizes[tbl][c]); 930 935 931 } 932 if (is_webkit || is_ie){ 933 var arrHeader = $('.message_header td'); 934 var arrBody = $('#tbody_box :first td'); 935 for(i=0;i<arrHeader.length;i++){ 936 } 937 if (is_webkit || is_ie){ 938 var arrHeader = $('.message_header td'); 939 var arrBody = $('#tbody_box :first td'); 940 for(i=0;i<arrHeader.length;i++){ 936 941 if(arrBody[i] !== undefined && arrBody[i].width !== undefined) 937 arrHeader[i].width = arrBody[i].width; 938 } 942 arrHeader[i].width = arrBody[i].width; 943 } 939 944 } 940 945 } … … 1506 1511 if ((headers_msgs.Forwarded == 'F') || (headers_msgs.Draft == 'X' && headers_msgs.Answered == 'A')){ 1507 1512 td_element21.onclick=function(){search_emails(headers_msgs.subject.replace(/^(re: ?|fw: ?|enc: ?|res: ?|fwd: ?)*/gi,''),true);}; 1508 td_element21.innerHTML = "<img src ='templates/"+template+"/images/forwarded. gif' title='"+get_lang('Forwarded')+"'>";1513 td_element21.innerHTML = "<img src ='templates/"+template+"/images/forwarded.png' title='"+get_lang('Forwarded')+"'>"; 1509 1514 headers_msgs.Draft = '' 1510 1515 headers_msgs.Answered = ''; … … 1512 1517 } 1513 1518 else if (headers_msgs.Draft == 'X') 1514 td_element21.innerHTML = "<img src ='templates/"+template+"/images/draft. gif' title='"+get_lang('Draft')+"'>";1519 td_element21.innerHTML = "<img src ='templates/"+template+"/images/draft.png' title='"+get_lang('Draft')+"'>"; 1515 1520 else if (headers_msgs.Answered == 'A'){ 1516 1521 td_element21.onclick=function(){search_emails(headers_msgs.subject.replace(/^(re: ?|fw: ?|enc: ?|res: ?|fwd: ?)*/gi,''),true);}; 1517 td_element21.innerHTML = "<img src ='templates/"+template+"/images/answered. gif' title='"+get_lang('Answered')+"'>";1522 td_element21.innerHTML = "<img src ='templates/"+template+"/images/answered.png' title='"+get_lang('Answered')+"'>"; 1518 1523 }else 1519 1524 td_element21.innerHTML = " "; … … 1764 1769 .html('<img src="../prototype/modules/mail/img/flagEditor.png">'); 1765 1770 1766 if(fail != 'success'){ 1767 $('#td_message_followup_' + messageClickedId + ', ' + 1768 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 1769 MsgsCallbackFollowupflag[fail](); 1770 }else{ 1771 $('#td_message_followup_' + messageClickedId + ', ' + 1772 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", headers_msgs.followupflagged.backgroundColor); 1773 updateCacheFollowupflag(messageClickedId, msg_folder, true); 1774 } 1771 1772 if(fail != 'success'){ 1773 $('#td_message_followup_' + messageClickedId + ', ' + 1774 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 1775 MsgsCallbackFollowupflag[fail](); 1776 }else{ 1777 $('#td_message_followup_' + messageClickedId + ', ' + 1778 'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", headers_msgs.followupflagged.backgroundColor); 1779 updateCacheFollowupflag(messageClickedId, msg_folder, true); 1780 } 1775 1781 }); 1776 1782 … … 1982 1988 var msg_selected; 1983 1989 function draw_message(info_msg, ID){ 1990 // remove a flag $FilteredMessage da mensagem ao ser lida 1991 if(info_msg.Unseen == "U"){ 1992 $.each(fromRules, function(index, value) { 1993 if(value == info_msg.msg_folder){ 1994 cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+info_msg.msg_folder+"&msg_number="+info_msg.msg_number, function(){}); 1995 return false; 1996 } 1997 }); 1998 } 1984 1999 var content = document.getElementById('content_id_' + ID); 1985 2000 … … 3033 3048 var newAttendeeName = ""; 3034 3049 3035 var name = decoded.match(/"([^"]*)"/) ? decoded.match(/"([^"]*)"/)[1] : ''; 3036 var mail = decoded.match(/<([^<]*)>[\s]*$/) ? decoded.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() : decoded;3037 3038 3039 3050 var name = decoded.match(/"([^"]*)"/) ? decoded.match(/"([^"]*)"/)[1] : ''; 3051 var mail = decoded.match(/<([^<]*)>[\s]*$/) ? decoded.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() : decoded; 3052 3053 3054 var user = DataLayer.get('user', ["=", "mail", mail], true); 3040 3055 3041 3056 if( $.type(user) == "array") 3042 user = user[0]; 3043 3044 if(user != ''){ 3045 //user = {name : name , mail : mail};3046 if(User.me.mail == user.mail)3047 return(null);3048 user.isExternal = (!!user && !(!!user.isExternal)) ? 0 : 1;3049 3050 return DataLayer.merge({3051 name: user.name,3052 mail: user.mail,3053 acl: 'r',3054 delegatedFrom: '0',3055 status: '4',3056 isExternal: user.isExternal3057 }, !!user.id ? {id : DataLayer.put('participant', {user: user.id, isExternal: user.isExternal})} : {id: DataLayer.put('participant', {user: user})});3058 }else if(mail.match(/[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])/)){3059 3060 var userId = DataLayer.put('user', {3061 name: name,3062 mail: mail,3063 isExternal: '1'3064 });3065 var newAttendeeId = DataLayer.put('participant', {3066 user: userId,3067 isExternal: '1'3068 });3069 3070 return {3071 id: newAttendeeId,3072 name: name,3073 mail: mail,3074 acl: 'r',3075 delegatedFrom: '0',3076 status: '4',3077 isExternal: '1'3078 };3079 3080 }else3081 3057 user = user[0]; 3058 3059 if(user != ''){ 3060 //user = {name : name , mail : mail}; 3061 if(User.me.mail == user.mail) 3062 return(null); 3063 user.isExternal = (!!user && !(!!user.isExternal)) ? 0 : 1; 3064 3065 return DataLayer.merge({ 3066 name: user.name, 3067 mail: user.mail, 3068 acl: 'r', 3069 delegatedFrom: '0', 3070 status: '4', 3071 isExternal: user.isExternal 3072 }, !!user.id ? {id : DataLayer.put('participant', {user: user.id, isExternal: user.isExternal})} : {id: DataLayer.put('participant', {user: user})}); 3073 }else if(mail.match(/[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])/)){ 3074 3075 var userId = DataLayer.put('user', { 3076 name: name, 3077 mail: mail, 3078 isExternal: '1' 3079 }); 3080 var newAttendeeId = DataLayer.put('participant', { 3081 user: userId, 3082 isExternal: '1' 3083 }); 3084 3085 return { 3086 id: newAttendeeId, 3087 name: name, 3088 mail: mail, 3089 acl: 'r', 3090 delegatedFrom: '0', 3091 status: '4', 3092 isExternal: '1' 3093 }; 3094 3095 }else 3096 return (null); 3082 3097 }) 3083 3098 … … 3508 3523 resizeWindow(); 3509 3524 3510 $("#div_message_scroll_"+ID).scrollTo( 0, 400, {queue:true} ); 3525 $("#div_message_scroll_"+ID).scrollTo( 0, 400, {queue:true} ); 3511 3526 } 3512 3527 … … 3559 3574 } 3560 3575 3561 function input_binds(input, ID){ 3562 var mySource = new Array(); 3563 var myArray = contacts.split(","); 3564 for(var i in myArray){ 3565 var teste = myArray[i].split(";"); 3566 if(teste.length > 1) 3567 mySource.push({name : teste[0], email: teste[1], value : (teste[0] +" - "+teste[1])}); 3568 else 3569 mySource.push({name : "", email: teste[0], value :teste[0]}); 3570 } 3571 input.bind( "keydown", function( event ) { 3572 if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { 3573 event.preventDefault(); 3574 } 3575 if((event.keyCode) == 120){ 3576 //DESENHO DAS CAIXA DE EMAIL 3577 function draw_email_box(input_data, location, personal, shared){ 3578 if($.trim(input_data) != ""){ 3579 var box_data = valid_emails(input_data); 3580 DataLayer.render("../prototype/modules/mail/templates/emailBox.ejs", box_data, function(html){ 3581 var newBox = location.before(html).prev(); 3582 box_actions(newBox); 3583 if((preferences.expressoMail_ldap_identifier_recipient || personal)&& $(newBox).hasClass("invalid-email-box")){ 3584 //$(newBox).find(".loading").css("background-image", "../prototype/modules/mail/img/ajax-loader.gif"); 3585 show_detais(newBox, input_data, personal, shared); 3586 }else{ 3587 $(newBox).find(".box-loading").remove(); 3588 } 3589 }); 3590 } 3591 } 3592 3593 function valid_emails(email){ 3594 var ContactBox = {name:"", email:"", valid : false}; 3595 var reSimpleEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$/; 3596 var reComplexEmail = /<([^<]*)>[\s]*$/; 3597 var validation = email.split('"'); 3598 3599 //FUNÇÃO QUE VALIDA OS DADOS QUANDO O EMAIL É DIGITADO COM ("NOME SOBRENOME" <Email@dominio.com>) 3600 var complexValidation = function(complexMail){ 3601 var Objct = {}; 3602 if($.trim(complexMail[1]).match(reComplexEmail)){ 3603 if($.trim(complexMail[1]).match(reComplexEmail).length){ 3604 Objct['email'] = $.trim(complexMail[1]).match(reComplexEmail)[1]; 3605 } 3606 }else{ 3607 Objct['email'] = $.trim(complexMail[1]); 3608 } 3609 Objct['name'] = complexMail[0]; 3610 Objct['valid'] = reSimpleEmail.test(Objct['email'].toLowerCase()); 3611 return Objct; 3612 } 3613 switch (validation.length) { 3614 //PEGA TODO O CONTEUDO E SETA COMO SE FOSSE O EMAIL 3615 case 1: 3616 validation.unshift(""); 3617 ContactBox = complexValidation(validation); 3618 break; 3619 //CORRIGI ERRO DE DIGITAÇÃO COMO ( huahua"<huhau@hauhau.com>) ou (hahahaha"huahua@email.com) ou ainda (hahahaha"huahua@ema il.com) 3620 case 2: 3621 ContactBox = complexValidation(validation); 3622 break; 3623 //RECEBE O EMAIL CORRETAMENTE SÓ VALIDA POSSIVEIS ERROS COMO O DE CIMA E OS CORRIGI CASO ACONTEÇAM 3624 case 3: 3625 //RETIRA O PRIMEIRO INDICE QUE FICOU "INUTIL" 3626 validation.shift(); 3627 ContactBox = complexValidation(validation); 3628 break; 3629 //SE EXISTIREM MAIS DO QUE 2 (") 3630 default: 3631 if($.trim(validation[validation.length-1]).match(reComplexEmail)){ 3632 if($.trim(validation[validation.length-1]).match(reComplexEmail).length){ 3633 ContactBox.mail = $.trim(validation[validation.length-1]).match(reComplexEmail)[1]; 3634 } 3635 }else{ 3636 ContactBox.mail = $.trim(complexMail[1]); 3637 } 3638 ContactBox.valid = reSimpleEmail.test(ContactBox.mail.toLowerCase()); 3639 } 3640 return ContactBox; 3641 } 3642 3643 //EVENTO DOS INPUTS PARA - CC - CCO 3644 function input_keydowns(input, ID){ 3645 var f9 = false; 3646 input.keydown(function(e){ 3647 f9 = false; 3648 focusIn = input; 3649 var focusing = input.parent().find(".email-text"); 3650 //SE OS CONTATOS DINAMICOS ESTAO ATIVOS 3651 if(parseInt(preferences.use_dynamic_contacts) && !input.hasClass("box-input")){ 3652 //SELECIONA O CONTATO E EVITA OUTROS COMANDOS 3653 if ( e.keyCode === $.ui.keyCode.TAB && $( this ).data( "catcomplete" ).menu.active ) { 3654 e.preventDefault(); 3655 return false; 3656 } 3657 3658 //FECHA OS CONTATOS DINÂMICOS 3659 if( (e.keyCode == 27) && $( this ).data( "catcomplete" ).menu.active ){ 3660 e.stopPropagation(); 3661 e.preventDefault(); 3662 } 3663 3664 //SELECIONA O CONTATO E EVITA OUTROS COMANDOS 3665 if(e.keyCode == $.ui.keyCode.ENTER && $( this ).data( "catcomplete" ).menu.active){ 3666 e.preventDefault(); 3667 return false; 3668 } 3669 3670 if(e.keyCode == $.ui.keyCode.DELETE && $( this ).data( "catcomplete" ).menu.active){ 3671 if($($( this ).data( "catcomplete" ).menu.element).find(".ui-state-hover").parents("li:first").hasClass("dynamic-recent")) 3672 $($( this ).data( "catcomplete" ).menu.element).find(".ui-state-hover").next().trigger("click"); 3673 return false; 3674 } 3675 } 3676 //BUSCA COM A TECLA F9 3677 if((e.keyCode) == 120){ 3678 f9 = true; 3576 3679 emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3577 }else if( (event.keyCode == 27) && $( this ).data( "autocomplete" ).menu.active ){ 3578 event.stopPropagation(); 3579 event.preventDefault(); 3580 } 3581 }).autocomplete({ 3582 minLength: 0, 3583 source: function( request, response ) { 3584 response( $.ui.autocomplete.filter( 3585 mySource, extractLast( request.term ) ) ); 3680 e.preventDefault(); 3681 return false; 3682 } 3683 3684 //AO DIGITAR ENTER, ";", "," " " 3685 if(e.keyCode == 13 || e.keyCode == 9 || (e.keyCode == 188 && !e.shiftKey) || (e.keyCode == 191 && !e.shiftKey) ){ 3686 if(e.keyCode == 13){ 3687 e.preventDefault(); 3688 } 3689 if(input.val() != ""){ 3690 if(e.keyCode != 9) 3691 e.preventDefault(); 3692 draw_email_box(input.val(), input); 3693 if(input.hasClass("box-input")){ 3694 input.remove(); 3695 focusing.focus(); 3696 return; 3697 } 3698 } 3699 if(input.length) 3700 input.val(""); 3701 } 3702 if((e.keyCode == 8 || e.keyCode == 37) && input.val() == "" && input.prev().hasClass("box")){ 3703 e.preventDefault(); 3704 input.prev().focus(); 3705 return; 3706 } 3707 //AO DIGITAR " " 3708 if(e.keyCode == 32){ 3709 if(!input.val().length){ 3710 e.preventDefault(); 3711 return; 3712 }else{ 3713 var texto = input.val(); 3714 texto = texto.substring(0, getPosition(input[0])); 3715 if(texto.split('"').length-1 == 0){ 3716 if(input.val().split('"').length-1 == 0){ 3717 e.preventDefault(); 3718 e.stopPropagation(); 3719 draw_email_box(input.val(), input); 3720 input.val(""); 3721 if(input.hasClass("box-input")){ 3722 input.remove(); 3723 focusing.focus(); 3724 return; 3725 } 3726 return; 3727 } 3728 } 3729 } 3730 } 3731 //AO DIGITAR ">" 3732 if(e.keyCode == 190 && e.shiftKey && input.val().length == getPosition(input[0])){ 3733 input.val(input.val()+">"); 3734 draw_email_box(input.val(), input); 3735 e.preventDefault(); 3736 input.val(""); 3737 if(input.hasClass("box-input")){ 3738 input.remove(); 3739 focusing.focus(); 3740 return; 3741 } 3742 } 3743 setTimeout(function(){ 3744 if(input.val()[input.val().length-1] == ";"){ 3745 draw_email_box(input.val().substring(0, input.val().length-1), input); 3746 input.val(""); 3747 } 3748 }, 100); 3749 //INPUT AUTO RESIZE 3750 setTimeout(function(){ 3751 input_search = $(input).val(); 3752 var char = input.val().charAt(input.val().length-1); 3753 var maiusculas = RegExp("[A-Z]"); 3754 /*Se o ultimo caracter for ">" é porque o campo está sendo editado (a partir de duplo clique)*/ 3755 var tamanho = 0; 3756 if(char == ">"){ 3757 /*Faz um calculo prévio do tamanho do campo de acordo com o tamanho de cada caracter da string*/ 3758 for(i=0; i<input.val().length; i++){ 3759 /*Se o caracter for maiúsculo, o valor de pixel é maior*/ 3760 if(maiusculas.test(input.val().substr(i, 1)) == true){ 3761 tamanho += 9; 3762 } 3763 else{ 3764 tamanho += 7.1; 3765 } 3766 } 3767 input.css("width", tamanho); 3768 } 3769 /*Ao inserir novo contato, não existe a necessidade de calcular tamanho do campo*/ 3770 else{ 3771 input.css("width", 15+(input.val().length * 9)); 3772 } 3773 input.parent().scrollTo(":last"); 3774 }, 100); 3775 }) 3776 //AO SAIR DO FOCO MONTAGEM DA CAIXA DE EMAIL 3777 .focusout(function(e){ 3778 var these = $(this); 3779 3780 // Função para monstar a caixinha de e-mail. 3781 function makeBoxMail(){ 3782 if(canMakeBox && !fastSearch){ 3783 if(!( f9 || click || $(this).parents("tr:first").find("button").hasClass("ui-state-active") )){ 3784 if($(input).val() != "") 3785 draw_email_box(input.val(), input); 3786 if(input.hasClass("box-input")) 3787 input.remove(); 3788 $(input).val(""); 3789 input_search = ""; 3790 } 3791 f9 = false; 3792 click = false; 3793 } 3794 canMakeBox = true; 3795 fastSearch = false; 3796 } 3797 3798 /* 3799 ** Verifica se o dynamic contact esta aberto ou fechado, caso esteja aberto, 3800 ** demora 250 millisegundos para executar a função makeBoxMail. 3801 */ 3802 these.data('is_open') ? setTimeout(makeBoxMail,250) : makeBoxMail(); 3803 }) 3804 //AO COLAR UM TEXTO NO CAMPO 3805 .bind("paste", function(e){ 3806 $(this).trigger("keydown"); 3807 var pthis = $(this); 3808 setTimeout(function() { 3809 var str = pthis.val().replace(/[,;\t\n]/gi, ","); 3810 str = str.split(","); 3811 $.each(str, function(index, value){ 3812 draw_email_box(value, pthis); 3813 }); 3814 pthis.val(""); 3815 }, 50); 3816 }); 3817 //SE FOR EDIÇÃO DE EMAILS RECALCULA O INPUT E SETA O FOCO 3818 if(input.hasClass("box-input")){ 3819 input.trigger("keydown"); 3820 input.focus(); 3821 } 3822 } 3823 var input_search = ""; 3824 var click = false; 3825 //EVENTOS DA CAIXA 3826 function box_actions(box){ 3827 //AO PRESSIONAR UMA TECLA COM A CAIXA SELECIONADA 3828 box.keydown(function(e){ 3829 switch (e.keyCode) { 3830 case $.ui.keyCode.LEFT: 3831 //VERIFICA SE EXISTE ALGUMA CAIXA A ESQUERDA 3832 if($(this).prev().hasClass("box")) 3833 $(this).removeClass("box-selected").prev().focus(); 3834 break; 3835 case $.ui.keyCode.RIGHT: 3836 //VERIFICA SE EXISTE ALGUMA CAIXA A DIREITA 3837 if($(this).next().hasClass("box")) 3838 $(this).removeClass("box-selected").next().focus(); 3839 //SENAO FOCO O INPUT DO EMAIL 3840 else 3841 $(this).removeClass("box-selected").next().focus(); 3842 break; 3843 case $.ui.keyCode.HOME: 3844 //SELECIONO A PRIMEIRA CAIXA 3845 e.preventDefault(); 3846 $(this).parents(".email-area").find("div:first").focus(); 3847 break; 3848 case $.ui.keyCode.END: 3849 //SELECIONO A ULTIMA CAIXA 3850 e.preventDefault(); 3851 $(this).parents(".email-area").find("div:last").focus(); 3852 break; 3853 case $.ui.keyCode.DELETE: 3854 //VERIFICA SE EXISTE ALGUMA CAIXA A DIREITA 3855 if($(this).next().hasClass("box")) 3856 $(this).next().focus(); 3857 //SENAO FOCO O INPUT DO EMAIL 3858 else 3859 $(this).next().focus(); 3860 //REMOVO ESTA CAIXA 3861 $(this).remove(); 3862 break; 3863 case $.ui.keyCode.BACKSPACE: 3864 //VERIFICA SE EXISTE ALGUMA CAIXA A ESQUERDA 3865 if($(this).prev().hasClass("box")) 3866 $(this).removeClass("box-selected").prev().focus(); 3867 //SENAO HOUVER VERIFICA SE EXISTE ALGUMA CAIXA A DIREITA 3868 else if($(this).next().hasClass("box")) 3869 $(this).next().focus(); 3870 //SENAO HOUVER NEM A DIREITA NEM A ESQUERDA SETO O FOCO NO INPUT DO EMAIL 3871 else 3872 $(this).next().focus(); 3873 //REMOVO ESTA CAIXA 3874 $(this).remove(); 3875 e.preventDefault(); 3876 break; 3877 case $.ui.keyCode.ENTER: 3878 e.preventDefault(); 3879 $(this).trigger("dblclick"); 3880 break; 3881 } 3882 }) 3883 //AO FAZER UM DUPLO CLICK NA CAIXA 3884 .dblclick(function(e){ 3885 var input = $(this).find("input").clone(); 3886 input.css("display" , "inline-block"); 3887 $(this).before(input); 3888 input_keydowns(input, currentTab); 3889 $(this).remove(); 3890 //CLICK SIMPLES NA CAIXA 3891 }).click(function(){ 3892 $(this).focus(); 3893 //AO DAR O FOCO NA CAIXA 3894 }).focus(function(){ 3895 $(this).parent().find("div").removeClass("box-selected"); 3896 $(this).addClass("box-selected"); 3897 }).focusout(function(){ 3898 $(this).removeClass("box-selected"); 3899 }).draggable({ 3900 revert: 'invalid', 3901 helper : 'clone', 3902 stack: "body", 3903 containment : ".new-msg-head-data", 3904 start: function(e, ui){ 3905 $(this).parent().droppable( "disable" ); 3586 3906 }, 3587 focus: function() { 3588 return false; 3589 }, 3590 select: function( event, ui ) { 3591 var terms = mySplit( this.value ); 3592 terms.pop(); 3593 terms.push( (ui.item.name != "" ? "\""+ui.item.name+"\" " : "") + (ui.item.email ? "<"+ui.item.email+">" : "")); 3594 terms.push( "" ); 3595 this.value = terms.join( ", " ); 3596 return false; 3597 }, 3598 autoFocus: true 3599 }).data( "autocomplete" )._renderItem = function( ul, item ) { 3600 ul.css({"max-height" : "115px", "overflow-y" : "auto"}); 3601 if( $(ul).find("li").length > 10 ){ 3907 stop : function(e, ui){ 3908 $(this).parent().droppable( "enable" ); 3909 } 3910 }); 3911 } 3912 3913 //MOSTRA OS DETALHES DAS CAIXA DE EMAIL NOS CAMPOS PARA - CC - CCO 3914 function show_detais(box, value, personal, shared){ 3915 var ldap_id = preferences.expressoMail_ldap_identifier_recipient; 3916 var group = (personal != undefined ? (personal == "G" ? true : false) : false); 3917 shared = shared ? shared : false; 3918 if(group){ 3919 REST.get("/"+ (shared ? "shared" : "") +"group/"+value, {}, function(data){ 3920 if(!data.error){ 3921 if(data.collection.error) 3922 box.find(".box-loading").remove(); 3923 else{ 3924 box.find(".box-loading").removeClass("box-loading").addClass("box-info"); 3925 box.addClass("box-"+value).removeClass("invalid-email-box"); 3926 loadGroupBox(data.collection, ".box-"+value); 3927 box.unbind("dblclick").bind("dblclick", function(e){ 3928 new $.Zebra_Dialog(get_lang("Impossible editing this contact, but it's possible to remove it"), { 3929 'buttons': false, 3930 'modal': false, 3931 'position': ['right - 20', 'top + 20'], 3932 'auto_close': 3000 3933 }); 3934 }).find(".box-input").val("\""+data.collection.data[1].value+"\" <"+data.collection.data[1].value+">"); 3935 box.find(".email-box-value").html( (data.collection.data[1].value.length > 18 ? data.collection.data[1].value.substring(0, 15)+"...": data.collection.data[1].value)) 3936 } 3937 }else{ 3938 box.find(".box-loading").remove(); 3939 } 3940 }); 3941 return; 3942 } 3943 3944 if(personal){ 3945 REST.get("/"+ (shared ? "shared" : "") +"contact/"+value, {}, function(data){ 3946 if(!data.error){ 3947 if(data.collection.error) 3948 box.find(".box-loading").remove(); 3949 else{ 3950 box.find(".box-loading").removeClass("box-loading").addClass("box-info"); 3951 box.addClass("box-"+value).removeClass("invalid-email-box"); 3952 loadExtraLDAPBox(data.collection.data, ".box-"+value); 3953 box.unbind("dblclick").bind("dblclick", function(e){ 3954 new $.Zebra_Dialog(get_lang("Impossible editing this contact, but it's possible to remove it"), { 3955 'buttons': false, 3956 'modal': false, 3957 'position': ['right - 20', 'top + 20'], 3958 'auto_close': 3000 3959 }); 3960 }).find(".box-input").val("\""+data.collection.data[0].value+"\" <"+data.collection.data[1].value+">"); 3961 box.find(".email-box-value").html( (data.collection.data[0].value.length > 18 ? data.collection.data[0].value.substring(0, 15)+"...": data.collection.data[0].value)) 3962 } 3963 }else{ 3964 box.find(".box-loading").remove(); 3965 } 3966 }); 3967 return; 3968 } 3969 3970 REST.get("/usersldap", {field : ldap_id,value: value}, function(data){ 3971 if(!data.error){ 3972 if(data.collection.error) 3973 box.find(".box-loading").remove(); 3974 else{ 3975 box.find(".box-loading").removeClass("box-loading").addClass("box-info"); 3976 box.addClass("box-"+value).removeClass("invalid-email-box"); 3977 loadExtraLDAPBox(data.collection.itens[0].data, ".box-"+value); 3978 box.unbind("dblclick").bind("dblclick", function(e){ 3979 new $.Zebra_Dialog(get_lang("Impossible editing this contact, but it's possible to remove it"), { 3980 'buttons': false, 3981 'modal': false, 3982 'position': ['right - 20', 'top + 20'], 3983 'auto_close': 3000 3984 }); 3985 }).find(".box-input").val("\""+data.collection.itens[0].data[0].value+"\" <"+data.collection.itens[0].data[1].value+">"); 3986 box.find(".email-box-value").html( (data.collection.itens[0].data[0].value.length > 18 ? data.collection.itens[0].data[0].value.substring(0, 15)+"...": data.collection.itens[0].data[0].value)) 3987 if(data.collection.itens[0].data[3].value == "TRUE"){ 3988 box.removeClass("invalid-email-box").addClass("out-office-box"); 3989 } 3990 } 3991 }else{ 3992 box.find(".box-loading").remove(); 3993 } 3994 }); 3995 } 3996 3997 //FUNÇÃO QUE "SETA" OS BINDS DOS CAMPOS PARA - CC - CCO 3998 function input_binds(div, ID){ 3999 4000 //AO CLICAR NA DIV SETA O FOCO NO INPUT 4001 div.click(function(e){ 4002 if(e.target == $(this)[0]){ 4003 $(this).find("input:last").focus(); 4004 $(this).find("div").removeClass("box-selected"); 4005 } 4006 }) 4007 4008 //AO SAIR DO FOCO DA DIV ELE RETIRA TODAS AS CLASSES DE CAIXAS SELECIONADAS 4009 .focusout(function(e){ 4010 if(!$(e.target).parents(".email-area:first").length) 4011 $(this).find("div").removeClass("box-selected"); 4012 }).droppable({ 4013 hoverClass: "box-draggable-hover", 4014 accept : ".box", 4015 drop : function(e, ui){ 4016 ui.draggable.parent().droppable( "enable" ); 4017 var box = ui.draggable.clone(); 4018 box_actions(box); 4019 if(box.find(".box-info").length){ 4020 box.unbind("dblclick").bind("dblclick", function(e){ 4021 new $.Zebra_Dialog('<strong>Impossivel editar</strong> um contato do ldap\n' + 4022 '<strong>Porém</strong>é possivel remove-lo', { 4023 'buttons': false, 4024 'modal': false, 4025 'position': ['right - 20', 'top + 20'], 4026 'auto_close': 3000 4027 }); 4028 }); 4029 } 4030 $(this).prepend(box); 4031 ui.draggable.remove(); 4032 } 4033 }); 4034 4035 //MAKE KEYDOWN 4036 input_keydowns(div.find("input"), ID); 4037 4038 4039 //VERIFICA PREFERENCIA DE CONTATOS DINÂMICOS ESTA ATIVA 4040 if(parseInt(preferences.use_dynamic_contacts)){ 4041 //PREPARAÇÃO DA ARRAY DOS CONTATOS DINÂMICOS 4042 4043 $.widget( "custom.catcomplete", $.ui.autocomplete, { 4044 _renderMenu: function( ul, items ) { 4045 var self = this, 4046 currentType = ""; 4047 $.each( items, function( index, item ) { 4048 if ( item.typel != currentType) { 4049 if(item.typel == "/groups" && $(ul).find(".dynamic-recent").length) 4050 self._renderItem( ul, {name:"", value:"", type:"linha"} ); 4051 if(item.typel == "/contacts" && ($(ul).find(".dynamic-group").length || $(ul).find(".dynamic-recent").length)) 4052 self._renderItem( ul, {name:"", value:"", type:"linha"} ); 4053 currentType = item.typel; 4054 } 4055 self._renderItem( ul, item ); 4056 $(ul).find("li:last").find(".dynamic-stars").raty({ 4057 readOnly : true, 4058 half : true, 4059 hints : ['','','','',''], 4060 score : ((item.number_of_messages*5)/topContact) > 0.5 ? ((item.number_of_messages*5)/topContact) : 0.5, 4061 starOn : '../../prototype/plugins/jq-raty/img/star-on.png', 4062 starOff : '../../prototype/plugins/jq-raty/img/star-off.png', 4063 starHalf : '../../prototype/plugins/jq-raty/img/star-half.png' 4064 }); 4065 }); 4066 if($(ul).find("li:last").hasClass("dynamic-separator")){ 4067 $(ul).find("li:last").remove(); 4068 } 4069 } 4070 }); 4071 //INSERÇÃO DO AUTO COMPLETE AO INPUT 4072 div.find("input").catcomplete({ 4073 minLength: 1, 4074 source: function(request, response){ 4075 if ( request.term in cache ) { 4076 response( cache[ request.term ] ); 4077 return; 4078 } 4079 dynamicContactsList = new Array(); 4080 REST.get("/usercontacts", false, function(data){ 4081 dynamicData = data.collection.itens; 4082 if(dynamicData){ 4083 $.each(dynamicData, function(index, value){ 4084 dynamic = {}; 4085 $.each(value.data, function(index, value){ 4086 dynamic[value.name] = value.value; 4087 }); 4088 dynamic['value'] = (dynamic.name ? dynamic.name +' - ': '') + dynamic.mail; 4089 dynamic['type'] = value.dataType; 4090 dynamic['typel'] = (value.dataType.substring(0,7) == "/shared" ? "/"+value.dataType.substring(7,value.dataType.length)+"s" : value.dataType) ; 4091 dynamicContactsList.push(dynamic); 4092 }); 4093 } 4094 var data = $.ui.autocomplete.filter(dynamicContactsList, request.term ); 4095 cache[ request.term ] = data; 4096 response( data ); 4097 }); 4098 }, 4099 focus: function() { 4100 return false; 4101 }, 4102 4103 //EVENTO AO SELECIONAR UM CONTATO DINÂMICO 4104 select: function( event, ui ) { 4105 canMakeBox = false; 4106 event.preventDefault(); 4107 $(this).val(""); 4108 if(ui.item.typel == "/contacts") 4109 draw_email_box(""+ui.item.id, $(this), true, (ui.item.type.substring(0,7) == "/shared" ? true : false)); 4110 else if(ui.item.typel == "/groups") 4111 draw_email_box(""+ui.item.id, $(this), "G", (ui.item.type.substring(0,7) == "/shared" ? true : false)); 4112 else 4113 draw_email_box(ui.item.name ? "\""+ui.item.name+"\" <"+ui.item.mail+">" : ui.item.mail, $(this)); 4114 return false; 4115 }, 4116 autoFocus: true, 4117 position : { my: "left top", at: "left bottom", collision: "fit" } 4118 }).bind('catcompleteopen', function(event, ui) { 4119 $(this).data('is_open',true); 4120 }).bind('catcompleteclose', function(event, ui) { 4121 canMakeBox = true; 4122 $(this).data('is_open',false); 4123 }) 4124 4125 //MONTAGEM DA LISTA DE CONTATOS DINÂMICOS DO AUTO COMPLETE 4126 .data( "catcomplete" )._renderItem = function( ul, item ) { 4127 if($(ul).find("li").length < 50){ 4128 var autocomplete = $(this)[0].element; 4129 //cálculo dinâmico da largura da lista 4130 var width = (item.label ? item.label.length : (item.value ? item.value.length : (item.email ? item.email.length : 20 ))); 4131 width = width*5 + (is_ie ? 170 : 200) + 16; 4132 if (width < $(ul).width()) 4133 width = $(ul).width(); 4134 ul.css({"min-width":width,"max-height" : "180px", "overflow-y" : "auto", "min-height": "30px"}); 4135 var listContacts = DataLayer.render("../prototype/modules/mail/templates/listContacts.ejs", item); 4136 return $(listContacts).data( "item.autocomplete", item ).appendTo( ul ).find("span:last").button({ 4137 icons : { 4138 primary : "ui-icon-close" 4139 }, 4140 text: false 4141 }).click(function(event){ 4142 var removeLi = $(this).parents("li:first"); 4143 if(!event.keyCode) 4144 autocomplete.catcomplete( "close" ); 4145 canMakeBox = false; 4146 $.Zebra_Dialog('Deseja remover <b>'+(item.name ? item.name+" - " : "")+ item.mail+'</b>?', { 4147 'type': 'question', 4148 'custom_class': (is_ie ? 'configure-zebra-dialog' : ''), 4149 'title': 'Atenção', 4150 'buttons': ['Sim','Não'], 4151 'overlay_opacity': '0.5', 4152 'onClose': function(caption) { 4153 if(caption == 'Sim'){ 4154 $(removeLi).remove(); 4155 REST.delete("/dynamiccontact/"+item.id); 4156 updateDynamicContact(); 4157 cache = new Array(); 4158 }else if(caption == 'Não'){ 4159 $(focusIn).focus(); 4160 } 4161 } 4162 }); 4163 }); 4164 } 3602 4165 return; 3603 } 3604 return $( "<li></li>" ) 3605 .data( "item.autocomplete", item ) 3606 .append( "<a>" + item.name + " - " + item.email + "</a>" ) 3607 .appendTo( ul ); 3608 }; 3609 input.parents("tr:first").find("button").button().click(function(){ 3610 emQuickSearch($(this).parents("tr:first").find("textarea").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 4166 }; 4167 } 4168 4169 //FUNÇÃO DOS BOTÕES PARA - CC - CCO 4170 div.parents("tr:first").find("button").button().click(function(){ 4171 click = true; 4172 fastSearch = true; 4173 if(!$(":focus").hasClass("new-message-input")) 4174 emQuickSearch(($(this).parents("tr:first").find("input").val() ? $(this).parents("tr:first").find("input").val() : input_search), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3611 4175 }); 3612 4176 } … … 3615 4179 connector.loadScript("color_palette"); 3616 4180 connector.loadScript('wfolders'); 4181 connector.loadScript("ccQuickAdd"); 3617 4182 3618 4183 if(typeof(RichTextEditor) == 'undefined' || typeof(ColorPalette) == 'undefined' || typeof(wfolders) == 'undefined') … … 3662 4227 button.toggleClass("expressomail-button-icon-ative"); 3663 4228 field.toggle(); 3664 field.find("textarea").val("").focus(); 3665 if(!field.find("textarea").hasClass("elastic")){ 3666 field.find("textarea").css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("elastic").elastic().unbind('blur'); 3667 input_binds(field.find("textarea"), ID); 4229 field.find("textarea").val("").parent().find("input").focus(); 4230 field.find(".email-area div").remove(); 4231 if(!field.find("textarea").hasClass("track")){ 4232 field.find("textarea").css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("track"); 4233 input_binds(field.find(".email-area"), ID); 3668 4234 } 3669 4235 } 3670 4236 3671 input_binds(content.find('[name="input_ to"]').css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("elastic").elastic().unbind('blur').focus(), ID);4237 input_binds(content.find('[name="input_aux_to"]').css("max-width" , parseInt(content.find(".email-area").css("width"))-5).focus().parent().css({"max-height" : "115px", "overflow-y" : "auto"}), ID); 3672 4238 3673 4239 //Botão TextoRico/TextoSimples 3674 4240 content.find(".new-msg-head-right-buttons").find(".button").button().filter(".rich-button").click(function(){ 3675 /*Se o texto do botão for "Texto simples" exibirá a mensagem antes de alterar para texto simples*/ 3676 if($(".rich-button").find("span").text() == get_lang("Simple Text")){ 3677 $.Zebra_Dialog(get_lang("Convert this message into plain text can make parts of it are removed. Continue?"), { 3678 'type': 'warning', 3679 'overlay_opacity': '0.5', 3680 'buttons': ['OK','Cancelar'], 3681 'width' : 380, 3682 'onClose': function(clicked) { 3683 if(clicked == 'OK'){ 3684 RichTextEditor.setPlain(check_input(content.find('[name="textplain_rt_checkbox"]')), ID); 3685 $(".rich-button").find("span").text(get_lang("Rich Text")); 3686 }3687 } 3688 }) 3689 } 3690 /*Se o texto do botão for "Texto rico" simplesmente altera para texto rico*/ 3691 else{ 3692 RichTextEditor.setPlain(check_input(content.find('[name="textplain_rt_checkbox"]')), ID); 3693 $(".rich-button").find("span").text(get_lang("Simple Text")); 3694 4241 /*Se o texto do botão for "Texto simples" exibirá a mensagem antes de alterar para texto simples*/ 4242 if($(".rich-button").find("span").text() == get_lang("Simple Text")){ 4243 $.Zebra_Dialog(get_lang("Convert this message into plain text can make parts of it are removed. Continue?"), { 4244 'type': 'warning', 4245 'overlay_opacity': '0.5', 4246 'buttons': ['OK','Cancelar'], 4247 'width' : 380, 4248 'onClose': function(clicked) { 4249 if(clicked == 'OK'){ 4250 RichTextEditor.setPlain(check_input(content.find('[name="textplain_rt_checkbox"]')), ID); 4251 $(".rich-button").find("span").text(get_lang("Rich Text")); 4252 } 4253 } 4254 }) 4255 } 4256 /*Se o texto do botão for "Texto rico" simplesmente altera para texto rico*/ 4257 else{ 4258 RichTextEditor.setPlain(check_input(content.find('[name="textplain_rt_checkbox"]')), ID); 4259 $(".rich-button").find("span").text(get_lang("Simple Text")); 4260 } 3695 4261 }) 3696 4262 … … 3934 4500 3935 4501 var el_shared_users = Element("el_shared_users"); 4502 /* Recupera a pasta atual do usuário (selecionada) */ 4503 var user_shared = folder.split(cyrus_delimiter); 4504 /* Verifica se está nas próprias pastas */ 4505 if(user_shared[0] == "INBOX"){ 4506 user_shared = User.me.uid; 4507 }else{ 4508 user_shared = user_shared[1]; 4509 } 3936 4510 // The element was loaded and populated...so return. 3937 4511 if(el_shared_users){ … … 3944 4518 _option.text = el_shared_users.options[x].text; 3945 4519 _option.value = el_shared_users.options[x].value; 4520 /* Faz o tratamento do nome da pasta para fazer a verificação e selecionar o valor no select */ 4521 var str_begin_name = _option.text.indexOf('<') + 1; 4522 var str_end_name = _option.text.indexOf('@'); 4523 var user_selected_name = _option.text.substring(str_begin_name, str_end_name); 4524 /* Verifica se é o usuário da pasta selecionada */ 4525 if(user_selected_name == user_shared){ 4526 _option.selected = 'selected'; 4527 } 3946 4528 sel_from.options[sel_from.options.length] = _option ; 3947 4529 } … … 3969 4551 if(data.length > 0) { 3970 4552 tr1_1.style.display = ''; 3971 4553 var mycn = typeof(data.myname != 'undefined') ? data.myname : ''; 3972 4554 var _option = document.createElement("OPTION"); 3973 4555 _option.text = '"'+mycn+'" <'+Element("user_email").value+'>'; 3974 4556 _option.value = mycn+";"+Element("user_email").value; 4557 /* Verifica se é o usuário logado */ 4558 if(user_shared == User.me.uid) 4559 _option.selected = 'selected'; 3975 4560 sel_from.options[sel_from.options.length] = _option; 3976 4561 3977 4562 var options = ''; 3978 var cn = ''; 3979 4563 var cn = ''; 3980 4564 for (var x = 0; x < data.length; x++) { 3981 4565 cn = typeof(data[x].cn[0] != 'undefined') ? data[x].cn[0] : ''; … … 3983 4567 _option.text = '"'+cn+'" <'+data[x].mail[0]+'>'; 3984 4568 _option.value = cn+';'+data[x].mail[0]+';'+data[x].save_shared[0]+';'+data[x].uid[0]; 4569 /* Faz o tratamento do nome da pasta para fazer a verificação e selecionar o valor no select */ 4570 var str_begin_name = _option.text.indexOf('<') + 1; 4571 var str_end_name = _option.text.indexOf('@'); 4572 var user_selected_name = _option.text.substring(str_begin_name, str_end_name); 4573 /* Verifica se é o usuário da pasta selecionada */ 4574 if(user_selected_name == user_shared){ 4575 _option.selected = 'selected'; 4576 } 3985 4577 sel_from.options[sel_from.options.length] = _option ; 3986 4578 } … … 4335 4927 cc_data[3] = array_addrs[0]; 4336 4928 4929 var onclick = ''; 4930 $.each(cc_data, function(index, value){ 4931 onclick += "'"+value+"',"; 4932 }); 4933 onclick = onclick.substr(0, onclick.length-1); 4337 4934 var sm_envelope_img1 = '<img style="cursor:'+ (is_ie ? 'hand' : 'pointer') +'" title="' + get_lang("Add Contact") + 4338 '" onclick="ccQuickAddOne.showList( \''+cc_data+'\')" src="./templates/'+template+'/images/user_card.png">';4935 '" onclick="ccQuickAddOne.showList(['+onclick+'])" src="./templates/'+template+'/images/user_card.png">'; 4339 4936 var to_addybook_add = "<SPAN id='insert_plugin_"+idx_cc+"_"+ID+"'>"; 4340 4937 to_addybook_add += addrs; -
branches/2.4/expressoMail1_2/js/main.js
r6736 r6754 6 6 var results_search_messages = ""; 7 7 var cabecalho = '<h4>ExpressoLivre - ExpressoMail</h4>'; 8 // Variavel para controle de atualização das mensagens listadas na modal de alerta de filtro por remetente 9 var checkAlarmsFilter = false; 10 11 var dynamicPersonalContacts = new Array(); 12 var dynamicContacts = new Array(); 13 var topContact = 0; 14 DataLayer.get("folder", true); 8 15 9 16 //Os IE's < 9 não possui suporte a trim() introduzida no JavaScript 1.8.1 10 17 if(!String.prototype.trim){ 11 18 String.prototype.trim = function(){ 12 13 19 return this.replace(/^\s+|\s+$/g,''); 20 } 14 21 } 15 22 … … 19 26 return folders.join(cyrus_delimiter); 20 27 } 28 29 function updateDynamicContact(){ 30 dynamicContacts = new Array(); 31 var dynamicData = REST.get("/dynamiccontacts").collection.itens; 32 if(dynamicData){ 33 $.each(dynamicData, function(index, value){ 34 if(index ==0){ 35 topContact = parseInt(value.data[2].value); 36 } 37 var dynamic = { 38 name : value.data[0].value, 39 mail : value.data[1].value, 40 value: value.data[0].value + " - " + value.data[1].value, 41 type: "", 42 id: parseInt(value.data[3].value), 43 qtd : parseInt(value.data[2].value) 44 }; 45 dynamicContacts.push(dynamic); 46 }); 47 } 48 } 49 50 51 function updateDynamicPersonalContacts(){ 52 dynamicPersonalContacts = new Array(); 53 var contactsData = REST.get("/contacts").collection.itens; 54 if(contactsData){ 55 $.each(contactsData, function(index, value){ 56 var contact = { 57 id : parseInt(value.data[0].value), 58 name : value.data[1].value, 59 email : value.data[2].value, 60 value: value.data[1].value + " - " + value.data[2].value, 61 type: "P" 62 }; 63 dynamicPersonalContacts.push(contact); 64 }); 65 } 66 } 67 21 68 function init(){ 22 69 if (!is_ie) 23 70 Element('tableDivAppbox').width = '100%'; 24 71 25 var save_contacts = function(data){26 contacts = data;27 if (preferences.use_local_messages == 1 && window.google && google.gears)28 if (expresso_local_messages.is_offline_installed())29 expresso_local_messages.capt_url('controller.php?action=$this.db_functions.get_dropdown_contacts_to_cache');30 31 }32 72 var save_preferences = function(data){ 33 73 … … 69 109 //Substituido por padrão Jquery 70 110 cExecute ("$this.imap_functions.get_range_msgs2&folder=INBOX&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type=SORTARRIVAL&search_box_type=ALL&sort_box_reverse=1", handler_draw_box); 71 cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); //Save contacts needs preferences.111 //cExecute ("$this.db_functions.get_dropdown_contacts", save_contacts); //Save contacts needs preferences. 72 112 if(preferences.hide_folders == "1") 73 113 Element('divAppboxHeader').innerHTML = title_app_menu; … … 116 156 117 157 $(".collapse_folders").removeClass("ui-icon-triangle-1-w"); 118 $(".collapse_folders").addClass("ui-icon-triangle-1-e"); 119 158 $(".collapse_folders").addClass("ui-icon-triangle-1-e"); 159 $(".collapse_folders").parent().attr('title', "Expandir"); 120 160 $.cookie('collapse_folders', "true"); 121 161 refresh(); … … 127 167 $("#folderscol").show(); 128 168 $(".collapse_folders").removeClass("ui-icon-triangle-1-e"); 129 $(".collapse_folders").addClass("ui-icon-triangle-1-w"); 130 169 $(".collapse_folders").addClass("ui-icon-triangle-1-w"); 170 $(".collapse_folders").parent().attr('title', "Ocultar"); 131 171 $.cookie('collapse_folders', "false"); 132 172 refresh(); … … 143 183 } 144 184 ); 185 186 if(parseInt(preferences.use_dynamic_contacts)){ 187 var load_dynamics = function(){ 188 updateDynamicContact(); 189 updateDynamicPersonalContacts(); 190 }; 191 load_dynamics(); 192 } 145 193 } 146 194 var handler_automatic_trash_cleanness = function(data){ … … 160 208 mobile_device = ( ( data.constructor == Boolean ) ? data : ( data === 'true' ) ); 161 209 }); 210 211 DataLayer.get("folder", true); 212 cExecute("$this.imap_functions.get_folders_list&onload=true", update_menu); 213 162 214 setTimeout('auto_refresh()', time_refresh); 163 215 … … 192 244 cyrus_delimiter = Element('cyrus_delimiter').value; 193 245 194 cExecute ("$this.db_functions.get_dropdown_contacts_to_cache", function(data) {contacts = data;});246 //cExecute ("$this.db_functions.get_dropdown_contacts_to_cache", function(data) {contacts = data;}); 195 247 //cExecute ("$this.functions.get_preferences", save_preferences); 196 248 } … … 279 331 msg_to_delete.childNodes[1].innerHTML = ""; 280 332 write_msg(get_lang("Attachments removed")); 281 folderName = Base64.encode(folder); 282 folderName = folderName.replace(/=/gi, ''); 283 333 folderName = Base64.encode(folder); 334 folderName = folderName.replace(/=/gi, ''); 335 delete_border(msg_num+'_r_'+folderName,'false'); //close email tab 284 336 } 285 337 }; … … 386 438 // se existir prepara os dados para serem enviados e chama a 387 439 // operação na applet 388 389 440 390 441 // if ((msg_info.DispositionNotificationTo) && ((msg_info.Unseen == 'U') || (msg_info.Recent == 'N'))){ … … 510 561 511 562 function refresh(alert_new_msg){ 563 getFromAlertRules(); 512 564 var handler_refresh = function(data){ 565 if(checkAlarmsFilter){ 566 handlerMessageFilter = function (data) { 567 alarmFollowupflagged('filtersAlarms', data); 568 } 569 /* Busca nas pastas indexadas para ver se há novas mensagens com a flag $FilteredMessage */ 570 cExecute ("$this.imap_functions.getFlaggedAlertMessages&folders="+fromRules, handlerMessageFilter); 571 } 572 checkAlarmsFilter = true; 513 573 if(data['msg_range_end']) 514 574 if(data['msg_range_end'] > 0) … … 523 583 524 584 if (data.length > 0){ 525 for(var i=0;i< data.length;i++){ 526 if (!onceOpenedHeadersMessages[current_folder]) 527 onceOpenedHeadersMessages[current_folder] = {}; 528 onceOpenedHeadersMessages[current_folder][data[i].msg_number] = data[i]; 529 } 585 for(var i=0;i< data.length;i++){ 586 if (!onceOpenedHeadersMessages[current_folder]) 587 onceOpenedHeadersMessages[current_folder] = {}; 588 onceOpenedHeadersMessages[current_folder][data[i].msg_number] = data[i]; 589 } 530 590 Element("table_message_header_box_"+numBox).emptyBody = false; 531 591 table_element = Element("table_box"); … … 708 768 }, 709 769 beforeSend: function( jqXHR, settings ){ 710 770 connector.showProgressBar(); 711 771 }, 712 713 connector.hideProgressBar();772 complete: function( jqXHR, settings ){ 773 connector.hideProgressBar(); 714 774 } 715 775 … … 1051 1111 if( data ) 1052 1112 show_msg( data ); 1053 }, 1054 beforeSend: function( jqXHR, settings ){ 1055 connector.showProgressBar(); 1056 }, 1057 complete: function( jqXHR, settings ){ 1058 1113 }, 1114 beforeSend: function( jqXHR, settings ){ 1115 connector.showProgressBar(); 1116 }, 1117 complete: function( jqXHR, settings ){ 1118 connector.hideProgressBar(); 1059 1119 } 1060 1120 }); … … 1143 1203 Element('tot_m').innerHTML = n_total_msg; 1144 1204 } 1145 1146 1205 refresh(); 1147 1206 } … … 1168 1227 1169 1228 // se a aba estiver aberta e selecionada, apenas a msg da aba é movida 1170 if(currentTab.toString().indexOf("_r") != -1 && currentTab == border_ID) 1229 if(currentTab.toString().indexOf("_r") != -1 && currentTab == border_ID) 1171 1230 { 1172 1231 //se a aba for aberta atraves de uma pesquisa … … 1178 1237 refresh(); 1179 1238 if (parseInt(msgs_number) > 0 || msgs_number.length > 0){ 1180 $.ajax({ 1239 // remove a flag $FilteredMessage da mensagem, depois move 1240 var handler_removeFlag = function(){ 1241 $.ajax({ 1181 1242 url: 'controller.php?' + $.param( {action: '$this.imap_functions.move_messages', 1182 1243 folder: folder, … … 1197 1258 if( data ) 1198 1259 handler_move_msgs( data ); 1199 }, 1200 beforeSend: function( jqXHR, settings ){ 1201 connector.showProgressBar(); 1202 }, 1203 complete: function( jqXHR, settings ){ 1204 connector.hideProgressBar(); 1205 } 1206 1207 }); 1260 }, 1261 beforeSend: function( jqXHR, settings ){ 1262 connector.showProgressBar(); 1263 }, 1264 complete: function( jqXHR, settings ){ 1265 connector.hideProgressBar(); 1266 } 1267 1268 }); 1269 } 1270 var hasFolder = false; 1271 $.each(fromRules, function(index, value) { 1272 if(value == folder){ 1273 hasFolder = true; 1274 cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&msg_number="+msgs_number, handler_removeFlag); 1275 return false; 1276 } 1277 }); 1278 if(!hasFolder){ 1279 handler_removeFlag(); 1280 } 1281 1208 1282 }else 1209 1283 write_msg(get_lang('No selected message.')); … … 1592 1666 { 1593 1667 return selected_messages_by_shortcuts; 1594 }*/ 1595 /*Se houver mais de uma mensagem selecionada por atalho*/ 1596 if (array_selected_messages_by_shortcuts.length > 1){ 1597 if (selected_messages == "") 1598 return selected_messages_by_shortcuts; 1599 else1600 return selected_messages + "," + selected_messages_by_shortcuts; 1601 } 1602 } 1668 }*/ 1669 /*Se houver mais de uma mensagem selecionada por atalho*/ 1670 if (array_selected_messages_by_shortcuts.length > 1){ 1671 if (selected_messages == "") 1672 return selected_messages_by_shortcuts; 1673 else 1674 return selected_messages + "," + selected_messages_by_shortcuts; 1675 } 1676 } 1603 1677 if (selected_messages == '') 1604 1678 return false; … … 1754 1828 case "reply_without_history": 1755 1829 RichTextEditor.replyController = true; //Seta o editor como modo reply 1756 content.find('[name="input_to"]').val(data.to); 1830 content.find('[name="input_to"]').val(data.to); 1831 1832 draw_reply_boxes_by_field("to", data.to, content); 1833 1757 1834 title = "Re: " + html_entities(data.subject); 1758 1835 content.find(".subject").val("Re: " + data.subject); … … 1771 1848 content.find(".subject").val("Re: " + data.subject); 1772 1849 content.find('[name="input_to"]').val(data.to); 1850 1851 draw_reply_boxes_by_field("to", data.to, content); 1852 1773 1853 content.find('[name="msg_reply_from"]').val($("#msg_number_" + border_ID).val()); 1774 1854 … … 1797 1877 content.find(".subject").val("Re: " + data.subject); 1798 1878 1799 if (data.to.indexOf(Element("user_email").value) > 0 ) 1879 if (data.to.indexOf(Element("user_email").value) > 0 ){ 1880 draw_reply_boxes_by_field("to", data.to_all, content); 1800 1881 content.find('[name="input_to"]').val(data.to_all); 1801 else 1882 }else{ 1883 draw_reply_boxes_by_field("to", data.to + ',' + data.to_all, content); 1802 1884 content.find('[name="input_to"]').val(data.to + ',' + data.to_all); 1803 1885 } 1886 1804 1887 if (data.cc){ 1805 1888 data.cc = new Array(); … … 1812 1895 if(data.cc != ""){ 1813 1896 content.find('[name="input_cc"]').val(data.cc); 1814 input_binds(content.find('[name="input_cc"]') , new_border_ID);1897 input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 1815 1898 content.find(".cc-tr").show();//cc-button 1816 1899 //document.getElementById("a_cc_link" + new_border_ID).value = data.cc; 1817 1900 content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 1818 1901 content.find(".cc-button").find("span").html("Remover CC"); 1819 content.find('[name="input_cc"]').elastic().unbind('blur'); 1820 content.find('[name="input_cc"]').trigger("update"); 1902 draw_reply_boxes_by_field("cc", data.cc, content); 1821 1903 } 1822 1904 } … … 1840 1922 else 1841 1923 data.to_all = ""; 1924 1842 1925 title = "Re: " + html_entities(data.subject); 1843 1926 1844 if (data.to.indexOf(Element("user_email").value) > 0 ) 1927 if (data.to.indexOf(Element("user_email").value) > 0 ){ 1928 draw_reply_boxes_by_field("to", data.to_all, content); 1845 1929 content.find('[name="input_to"]').val(data.to_all); 1846 else 1930 }else{ 1931 draw_reply_boxes_by_field("to", data.to + ',' + data.to_all, content); 1847 1932 content.find('[name="input_to"]').val(data.to + ',' + data.to_all); 1933 } 1934 1848 1935 if (data.cc){ 1849 1936 data.cc = new Array(); … … 1856 1943 if(data.cc != ""){ 1857 1944 content.find('[name="input_cc"]').val(data.cc); 1858 input_binds(content.find('[name="input_cc"]') , new_border_ID);1945 input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 1859 1946 content.find(".cc-tr").show(); 1860 1947 content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 1861 1948 content.find(".cc-button").find("span").html("Remover CC"); 1862 content.find('[name="input_cc"]').elastic().unbind('blur');1863 content.find('[name="input_cc"]').trigger("update");1949 1950 draw_reply_boxes_by_field("cc", data.cc, content); 1864 1951 } 1865 1952 } … … 1916 2003 } 1917 2004 content.find('[name="input_to"]').val(_to +','); 2005 draw_email_box(_to, content.find(".to").filter("input")); 1918 2006 Element('msg_number').value = ''; 1919 2007 } … … 1941 2029 } 1942 2030 2031 draw_reply_boxes_by_field("to", data.to, content); 2032 1943 2033 content.find('[name="input_to"]').val(data.to); 1944 2034 if (data.cc){ … … 1946 2036 data.cc = data.cc.replace(/>/gi,">"); 1947 2037 content.find('[name="input_cc"]').val(data.cc); 1948 input_binds(content.find('[name="input_cc"]') , new_border_ID);2038 input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 1949 2039 content.find(".cc-tr").show(); 1950 2040 content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 1951 2041 content.find(".cc-button").find("span").html(get_lang('Remove CC')); 1952 content.find('[name="input_cc"]').elastic().unbind('blur'); 1953 content.find('[name="input_cc"]').trigger("update"); 2042 draw_reply_boxes_by_field("cc", data.cc, content); 1954 2043 } 1955 2044 if (data.cco){ … … 1959 2048 content.find(".cco-button").toggleClass("expressomail-button-icon-ative"); 1960 2049 content.find(".cco-button").find("span").html(get_lang('Remove CCo')); 1961 content.find('[name="input_cco"]').elastic().unbind('blur');1962 content.find('[name="input_cco"]').trigger("update");2050 input_binds(content.find('[name="input_cco"]').parent(), new_border_ID); 2051 draw_reply_boxes_by_field("cco", data.cco, content); 1963 2052 } 1964 2053 } … … 2000 2089 resizeWindow(); 2001 2090 return new_border_ID; //Preciso retornar o ID da nova mensagem. 2091 } 2092 2093 //DESENHA OS RETANGULOS PARA OS E-MAIL NA OPÇÃO REPLY 2094 function draw_reply_boxes_by_field(field, value, context){ 2095 array = value.split(","); 2096 $.each(array, function(index, value){ 2097 draw_email_box(value, context.find("."+field).filter("input")); 2098 }); 2002 2099 } 2003 2100 … … 2235 2332 watch_changes_in_msg(ID); 2236 2333 2334 var content = $("#content_id_"+ID); 2237 2335 var sign = false; 2238 2336 var crypt = false; 2337 var reComplexEmail = /<([^<]*)>[\s]*$/; 2239 2338 if ((preferences.use_assinar_criptografar != '0') && (preferences.use_signature_digital_cripto != '0')){ 2240 2339 var checkSign = document.getElementById('return_digital_'+ID) … … 2275 2374 if(data && data.success == true ){ 2276 2375 // if send ok, set a flag as answered or forwarded 2277 var msg_number_replied = $("#content_id_" + ID).find('[name="msg_reply_from"]');2278 var msg_number_forwarded = $("#content_id_" + ID).find('[name="msg_forward_from"]');2376 var msg_number_replied = content.find('[name="msg_reply_from"]'); 2377 var msg_number_forwarded = content.find('[name="msg_forward_from"]'); 2279 2378 2280 2379 if (msg_number_replied.val()){ … … 2297 2396 } 2298 2397 } 2398 2399 $ 2400 //REFAZER ISTO COM UMA CHAMADA ASSINCRONA PARA REGISTRAR E ATUALIZAR A LISTA DOS NOVOS CONTATOS DINAMICOS 2299 2401 // If new dynamic contacts were added, update the autocomplete .... 2300 if(data.new_contacts){2402 /*if(data.new_contacts){ 2301 2403 var ar_contacts = data.new_contacts.split(',;'); 2302 2404 for(var j in ar_contacts){ … … 2306 2408 } 2307 2409 } 2308 delete_border(ID,'true'); 2410 var dynamicPersonalContacts = new Array(); 2411 var dynamicPersonalGroups = new Array(); 2412 var dynamicContacts = new Array(); 2413 var dynamicContactList = new Array(); 2414 2415 */ 2416 delete_border(ID,'true'); 2417 var arrayTo = content.find(".to-tr").find(".box").clone(); 2418 save_dynamic_contacts(arrayTo); 2419 var arrayCC = content.find(".cc-tr").find(".box").clone(); 2420 save_dynamic_contacts(arrayCC); 2421 var arrayCCo = content.find(".cco-tr").find(".box").clone(); 2422 save_dynamic_contacts(arrayCCo); 2423 cache = new Array(); 2309 2424 } 2310 2425 else{ 2311 2426 if(data == 'Post-Content-Length') 2312 2427 write_msg(get_lang('The size of this message has exceeded the limit (%1B).',Element('upload_max_filesize').value)); 2313 else if(data) 2428 else if(data){ 2429 var error_mail = $.trim(data.split(":")[data.split(":").length-1]); 2430 var array = content.find(".to-tr").find(".box"); 2431 //$(value).find("input").val() 2432 $.each(array, function(index, value){ 2433 if(error_mail == $(value).find("input").val().match(reComplexEmail)[1]) 2434 $(value).addClass("invalid-email-box"); 2435 }); 2436 if ( content.find('[name="input_cco"]').length){ 2437 if(content.find(".cco-tr").css("display") != "none"){ 2438 var array = content.find(".cco-tr").find(".box"); 2439 $.each(array, function(index, value){ 2440 if(error_mail == $(value).find("input").val().match(reComplexEmail)[1]) 2441 $(value).addClass("invalid-email-box"); 2442 }); 2443 } 2444 } 2445 if(content.find(".cc-tr").css("display") != "none") 2446 { 2447 var array = content.find(".cc-tr").find(".box"); 2448 $.each(array, function(index, value){ 2449 if(error_mail == $(value).find("input").val().match(reComplexEmail)[1]) 2450 $(value).addClass("invalid-email-box"); 2451 }); 2452 } 2314 2453 write_msg(data); 2315 else2454 }else 2316 2455 write_msg(get_lang("Connection failed with %1 Server. Try later.", "Web")); 2317 2456 … … 2323 2462 if(!expresso_offline) 2324 2463 connector.hideProgressBar(); 2464 } 2465 2466 /*Função que grava o destinatário nos contatos dinâmicos*/ 2467 function save_dynamic_contacts(array){ 2468 if(parseInt(preferences.use_dynamic_contacts)){ 2469 2470 $.each(array, function(i, value){ 2471 var stop = false; 2472 $.each(dynamicPersonalContacts, function(x, valuex){ 2473 if(valuex.email == $(value).find("input").val().match(reComplexEmail)[1]){ 2474 stop = true; 2475 return false; 2476 } 2477 }); 2478 if(!stop){ 2479 var exist = 0; 2480 $.each(dynamicContacts, function(x, valuex){ 2481 if(valuex.mail == $(value).find("input").val().match(reComplexEmail)[1]){ 2482 exist = valuex.id; 2483 return false; 2484 } 2485 }); 2486 if(exist){ 2487 REST.put("/dynamiccontact/"+exist, {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 2488 }else{ 2489 REST.post("/dynamiccontacts", {name: $(value).find("input").val().split('"')[1], mail:$(value).find("input").val().match(reComplexEmail)[1]}); 2490 } 2491 } 2492 }); 2493 updateDynamicContact(); 2494 } 2325 2495 } 2326 2496 … … 2518 2688 return; 2519 2689 } 2520 stringEmail = content.find('[name="input_to"]').val(); 2521 2522 if ( content.find('[name="input_cco"]').length) 2523 if(content.find(".cco-tr").css("display") != "none") 2524 stringEmail += content.find('[name="input_cco"]').val() =='' ? "":", "+content.find('[name="input_cco"]').val(); 2690 //stringEmail = content.find('[name="input_to"]').val(); 2691 var stringEmail = ""; 2692 var array = content.find(".to-tr").find(".box"); 2693 $.each(array, function(index, value){ 2694 stringEmail += $(value).find("input").val() + ","; 2695 }); 2696 content.find('[name="input_to"]').val(stringEmail); 2697 if ( content.find('[name="input_cco"]').length){ 2698 if(content.find(".cco-tr").css("display") != "none"){ 2699 var array = content.find(".cco-tr").find(".box"); 2700 $.each(array, function(index, value){ 2701 stringEmail += $(value).find("input").val() + ","; 2702 }); 2703 content.find('[name="input_cco"]').val(stringEmail); 2704 } 2705 } 2525 2706 2526 2707 if(content.find(".cc-tr").css("display") != "none") 2527 stringEmail += content.find('[name="input_cc"]').val() =='' ? "":", "+content.find('[name="input_cc"]').val(); 2708 { 2709 var array = content.find(".cc-tr").find(".box"); 2710 $.each(array, function(index, value){ 2711 stringEmail += $(value).find("input").val() + ","; 2712 }); 2713 content.find('[name="input_cc"]').val(stringEmail); 2714 } 2528 2715 2529 2716 if (expresso_offline) { … … 2601 2788 if( data ) 2602 2789 show_msg( data ); 2603 }, 2604 beforeSend: function( jqXHR, settings ){2605 connector.showProgressBar();2606 },2607 complete: function( jqXHR, settings ){2608 2790 }, 2791 beforeSend: function( jqXHR, settings ){ 2792 connector.showProgressBar(); 2793 }, 2794 complete: function( jqXHR, settings ){ 2795 connector.hideProgressBar(); 2609 2796 } 2610 2797 … … 2631 2818 autoSaveControl.status[border_id] = true; 2632 2819 /////////////////////////////////////////// 2633 2820 var content = $("#content_id_"+border_id); 2821 2822 var stringEmail = ""; 2823 var array = content.find(".to-tr").find(".box"); 2824 $.each(array, function(index, value){ 2825 stringEmail += $(value).find("input").val() + ","; 2826 }); 2827 content.find('[name="input_to"]').val(stringEmail); 2828 stringEmail = ""; 2829 if ( content.find('[name="input_cco"]').length){ 2830 if(content.find(".cco-tr").css("display") != "none"){ 2831 var array = content.find(".cco-tr").find(".box"); 2832 $.each(array, function(index, value){ 2833 stringEmail += $(value).find("input").val() + ","; 2834 }); 2835 content.find('[name="input_cco"]').val(stringEmail); 2836 } 2837 } 2838 2839 stringEmail = ""; 2840 if(content.find(".cc-tr").css("display") != "none") 2841 { 2842 var array = content.find(".cc-tr").find(".box"); 2843 $.each(array, function(index, value){ 2844 stringEmail += $(value).find("input").val() + ","; 2845 }); 2846 content.find('[name="input_cc"]').val(stringEmail); 2847 } 2848 2634 2849 var idJavascript = saveBorderError[border_id]; 2635 2850 … … 2809 3024 set_msg_as_read(results_search_messages, false, true); 2810 3025 Element("check_box_message_" + msgs_to_set[i]).checked = false; 3026 3027 // remove a flag $FilteredMessage da mensagem ao ser marcada como lida 3028 $.each(fromRules, function(index, value) { 3029 if(value == folder){ 3030 cExecute ("$this.imap_functions.removeFlagMessagesFilter&folder="+folder+"&msg_number="+msgs_to_set, function(){}); 3031 return false; 3032 } 3033 }); 3034 2811 3035 break; 2812 3036 case "flagged": … … 2833 3057 else 2834 3058 folder = Element("input_folder_"+msgs_to_set+"_r").value; 2835 3059 2836 3060 if (msgs_to_set) 2837 3061 $.ajax({ … … 2846 3070 if( data ) 2847 3071 handler_set_messages_flag( data ); 2848 }, 2849 beforeSend: function( jqXHR, settings ){ 2850 connector.showProgressBar(); 2851 }, 2852 complete: function( jqXHR, settings ){ 2853 3072 }, 3073 beforeSend: function( jqXHR, settings ){ 3074 connector.showProgressBar(); 3075 }, 3076 complete: function( jqXHR, settings ){ 3077 connector.hideProgressBar(); 2854 3078 } 2855 3079 … … 2912 3136 if( data ) 2913 3137 handler_set_messages_flag( data ); 2914 },2915 beforeSend: function( jqXHR, settings ){ 2916 connector.showProgressBar(); 2917 }, 2918 complete: function( jqXHR, settings ){ 2919 connector.hideProgressBar(); 2920 3138 }, 3139 beforeSend: function( jqXHR, settings ){ 3140 connector.showProgressBar(); 3141 }, 3142 complete: function( jqXHR, settings ){ 3143 connector.hideProgressBar(); 3144 } 2921 3145 2922 3146 }); … … 3008 3232 seekDot = (is_ie ? /width=24/gi : /width="24"/gi); 3009 3233 //thead = thead.replace(seekDot, "style='display:none'"); 3010 3234 var thead = "<tr class=\"message_header\"> <td width=\"3%\"></td><td width=\"2%\"></td><td width=\"1%\"></td><td width=\"1%\"></td><td width=\"1%\"></td><td width=\"1%\"></td><td width=\"2%\"></td><td width=\"2%\"></td><td width=\"2%\"></td><td id=\"message_header_SORTFROM_0\" class=\"th_resizable\" align=\"left\" width=\"20%\">De</td><td id=\"message_header_SORTSUBJECT_0\" class=\"th_resizable\" align=\"left\" width=\"*\">Assunto</td><td id=\"message_header_SORTARRIVAL_0\" class=\"th_resizable\" align=\"center\" width=\"11%\"><b>Data</b><img src=\"templates/default/images/arrow_descendant.gif\"></td><td id=\"message_header_SORTSIZE_0\" class=\"th_resizable\" align=\"left\" width=\"11%\">Tamanho</td></tr>"; 3011 3235 tbody = tbody.replace(seekDot, "style='display:none'"); 3012 3236 seekDot = (is_ie ? /width=16/gi : /width="16"/gi); … … 3812 4036 createDialog(data, true); 3813 4037 3814 }, 3815 beforeSend: function( jqXHR, settings ){ 3816 connector.showProgressBar(); 3817 }, 3818 complete: function( jqXHR, settings ){ 3819 connector.hideProgressBar(); 3820 } 4038 }, 4039 beforeSend: function( jqXHR, settings ){ 4040 connector.showProgressBar(); 4041 }, 4042 complete: function( jqXHR, settings ){ 4043 connector.hideProgressBar(); 4044 } 3821 4045 }); 3822 4046 3823 4047 } 3824 4048 else … … 3919 4143 } 3920 4144 cExecute("$this.imap_functions.get_folders_list&onload=true", update_menu); 3921 }, 3922 beforeSend: function( jqXHR, settings ){ 3923 connector.showProgressBar(); 3924 }, 3925 complete: function( jqXHR, settings ){ 3926 4145 }, 4146 beforeSend: function( jqXHR, settings ){ 4147 connector.showProgressBar(); 4148 }, 4149 complete: function( jqXHR, settings ){ 4150 connector.hideProgressBar(); 3927 4151 } 3928 4152 }); … … 4043 4267 }; 4044 4268 4269 function truncate(text, size){ 4270 var result = text; 4271 if(text.length > size){ 4272 result = text.substring(0,size) + '...'; 4273 } 4274 return result; 4275 } 4276 4045 4277 DataLayer.links('message'); 4046 4278 DataLayer.poll('message',30); -
branches/2.4/expressoMail1_2/js/messages_controller.js
r6472 r6754 88 88 if (msgs_number == 'selected') 89 89 msgs_number = get_selected_messages(); 90 90 91 if(currentTab != 0 && currentTab.indexOf("search_") >= 0){ 91 92 var content_search = document.getElementById('content_id_'+currentTab); -
branches/2.4/expressoMail1_2/js/rich_text_editor.js
r6716 r6754 200 200 201 201 $(".cke_editor").css("white-space", "normal"); 202 203 if(typeof(preferences.font_size_editor) !== 'undefined')204 $(editor.document.$.body).css("font-size",preferences.font_size_editor);205 if(typeof(preferences.font_family_editor) !== 'undefined')206 $(editor.document.$.body).css("font-family",preferences.font_family_editor);207 208 RichTextEditor.editorReady = true;209 }202 203 if(typeof(preferences.font_size_editor) !== 'undefined') 204 $(editor.document.$.body).css("font-size",preferences.font_size_editor); 205 if(typeof(preferences.font_family_editor) !== 'undefined') 206 $(editor.document.$.body).css("font-family",preferences.font_family_editor); 207 208 RichTextEditor.editorReady = true; 209 } 210 210 } 211 211 … … 220 220 height -= 330; 221 221 $('#body_'+id).height(height); 222 div.html($('#body_'+id).val()); 223 /*Remove as tags html, tabulações e quebras de linha quando for utilizado o editor de texto simples*/ 224 div.html($.trim(div.text().replace(/[\t]+/g, '').replace(/[\n]+/g, '\n'))); 225 /*Insere o texto sem formatação no textarea*/ 222 div.html($('#body_'+id).val()); 223 /*Remove as tags html, tabulações e quebras de linha quando for utilizado o editor de texto simples*/ 224 div.html($.trim(div.text().replace(/[\t]+/g, '').replace(/[\n]+/g, '\n'))); 225 /*Insere o texto sem formatação no textarea*/ 226 226 $('#body_'+id).val(div.text()); 227 227 228 228 $('#body_'+id).keydown(function(event) { 229 229 away = false; … … 237 237 else{ 238 238 RichTextEditor.active('body_'+id, id); 239 /*Insere somente quebras de linha para que o texto convertido não fique todo em uma linha só*/ 240 div.html($('#body_'+id).val().replace(/[\n]+/g, '<br>')); 241 $('#body_'+id).val(div.html()); 239 /*Insere somente quebras de linha para que o texto convertido não fique todo em uma linha só*/ 240 div.html($('#body_'+id).val().replace(/[\n]+/g, '<br>')); 241 $('#body_'+id).val(div.html()); 242 242 } 243 243 } … … 253 253 cRichTextEditor.prototype.setData = function (id,data){ 254 254 255 if(this.plain[id.replace('body_','')] === true) 256 $('#'+id).val(data); 257 else 258 CKEDITOR.instances[id].setData(data);255 if(this.plain[id.replace('body_','')] === true) 256 $('#'+id).val(data); 257 else 258 CKEDITOR.instances[id].setData(data); 259 259 } 260 260 cRichTextEditor.prototype.setInitData = function (id,data,reply,recursion, callback){ -
branches/2.4/expressoMail1_2/js/search.js
r6653 r6754 20 20 21 21 //Monta os forms dentro da janela; 22 searchE.prototype.showForms = function(value )22 searchE.prototype.showForms = function(value, data) 23 23 { 24 24 if( trim(value) != "" ) … … 39 39 var div = document.createElement("div"); 40 40 var args = null; 41 41 42 42 args = 43 43 { … … 63 63 "Old" : get_lang('Old'), 64 64 "Search_the_messages_in_these_folders" : get_lang('Search the messages in these folders'), 65 "In_all_the_folders" : get_lang('In all the folders') 66 } 67 65 "In_all_the_folders" : get_lang('In all the folders'), 66 "From_value" : (data != "undefined" ? data : "") 67 } 68 68 69 $(div).html(DataLayer.render("./templates/default/searchMails.ejs", args )); 69 70 div.setAttribute( "style","overflow:hidden"); … … 515 516 td.id = "td_message_answered_"+uid_msg; 516 517 if (aux.flag.match('X')) 517 td1 = '<img src=templates/'+template+'/images/forwarded. giftitle="'+get_lang('Forwarded')+'">';518 td1 = '<img src=templates/'+template+'/images/forwarded.png title="'+get_lang('Forwarded')+'">'; 518 519 else 519 520 if (aux.flag.match('A')) 520 td1 = '<img src=templates/'+template+'/images/answered. giftitle="'+get_lang('Answered')+'">';521 td1 = '<img src=templates/'+template+'/images/answered.png title="'+get_lang('Answered')+'">'; 521 522 else 522 523 td1 = ''; … … 585 586 586 587 if (fail) { 587 var isCurrentFolder = current_folder == mailbox ? '#td_message_followup_' + messageClickedId + ', ' : ''; 588 $(isCurrentFolder + 'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 589 MsgsCallbackFollowupflag[fail](); 590 return false; 588 589 var isCurrentFolder = current_folder == mailbox ? '#td_message_followup_' + messageClickedId + ', ' : ''; 590 $(isCurrentFolder + 'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC"); 591 MsgsCallbackFollowupflag[fail](); 592 return false; 591 593 } 592 594 … … 846 848 scrollSpeed: 100, 847 849 containment: "#divAppbox" 848 }).bind("contextmenu", function(event){ 850 }).bind("contextmenu", function(event){ 849 851 if(event.button == 2) 850 852 if($(this).find("input:checkbox").attr("checked") != "checked"){ … … 1741 1743 if( url.length ){ 1742 1744 xhr = $.ajax({ 1743 url: 'controller.php?action='+url.shift(),1744 async: true, 1745 success: function(data){ 1746 handler(data); 1747 }, 1748 beforeSend: function( jqXHR, settings ){ 1749 connector.showProgressBar(); 1750 }, 1751 complete: function( jqXHR, settings ){ 1752 connector.hideProgressBar(); 1753 } 1754 1745 url: 'controller.php?action='+url.shift(), 1746 async: true, 1747 success: function(data){ 1748 handler(data); 1749 }, 1750 beforeSend: function( jqXHR, settings ){ 1751 connector.showProgressBar(); 1752 }, 1753 complete: function( jqXHR, settings ){ 1754 connector.hideProgressBar(); 1755 } 1756 }); 1755 1757 }else{ 1756 1758 xhr = false; … … 1763 1765 url: 'controller.php?action='+url.shift(), 1764 1766 async: true, 1765 success: function(data){handler(data);}, 1766 beforeSend: function( jqXHR, settings ){ 1767 connector.showProgressBar(); 1768 }, 1769 complete: function( jqXHR, settings ){ 1770 connector.hideProgressBar(); 1771 } 1767 success: function(data){handler(data);}, 1768 beforeSend: function( jqXHR, settings ){ 1769 connector.showProgressBar(); 1770 }, 1771 complete: function( jqXHR, settings ){ 1772 connector.hideProgressBar(); 1773 } 1772 1774 }); 1773 1775 } -
branches/2.4/expressoMail1_2/js/sharemailbox.js
r6600 r6754 217 217 Element('em_input_sendAcl').disabled = true; 218 218 219 //$("#sharemailbox").empty();220 //$("#sharemailbox").dialog("destroy");221 $("#sharemailbox").parents().find(".ui-icon-closethick").trigger("click");219 //$("#sharemailbox").empty(); 220 //$("#sharemailbox").dialog("destroy"); 221 $("#sharemailbox").parents().find(".ui-icon-closethick").trigger("click"); 222 222 223 223 write_msg(get_lang('Shared options saved with success')); -
branches/2.4/expressoMail1_2/js/shortcut.js
r6727 r6754 327 327 shortcut.add('up', function(e) 328 328 { 329 329 330 var search_in_focus = false; 330 331 var search_win = document.getElementById( 'window_QuickCatalogSearch' ); … … 334 335 if ( !search_in_focus && currentTab == 0 ) 335 336 select_msg('null', 'up'); 336 // Ao usuario pressionar o 'up' em uma outra aba, não pode ser removido o 'up'. 337 else{} 338 // shortcut.remove('up');337 // Ao usuario pressionar o 'up' em uma outra aba, não pode ser removido o 'up'. 338 else{} 339 // shortcut.remove('up'); 339 340 e.stopPropagation(); 340 341 e.preventDefault(); … … 351 352 if ( !search_in_focus && currentTab == 0 ) 352 353 select_msg('null', 'down'); 353 // Ao usuario pressionar o 'down' em uma outra aba, não pode ser removido o 'down'.354 else{} 354 // Ao usuario pressionar o 'down' em uma outra aba, não pode ser removido o 'down'. 355 else{} 355 356 // shortcut.remove('down'); 356 357 e.stopPropagation(); … … 519 520 520 521 if (msg_number != 'null') { 521 522 522 523 if(Element(msg_number)){ 523 524 unselect_all_msgs(); 524 525 add_className(Element(msg_number), 'selected_shortcut_msg'); 525 526 } 526 527 } else{527 528 } else { 528 529 var scrollMain = Element('divScrollMain_0'); 529 530 var selection_size = parseInt(preferences.line_height) + 10; 530 if( keyboard_action == 'down') { 531 532 if(!Element("chk_box_select_all_messages").checked){ 533 534 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 535 536 if($(this).hasClass("selected_shortcut_msg") && $(this).next().length){ 537 $(this).next().addClass("selected_shortcut_msg"); 538 $(this).removeClass("selected_shortcut_msg"); 539 return false; 540 } 541 542 }); 543 544 } else { 545 546 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 547 548 if($(this).hasClass("current_selected") && $(this).next().length){ 549 $(this).removeClass("current_selected"); 550 $(this).removeClass("selected_shortcut_msg"); 551 $(this).next().addClass("current_selected"); 552 $(this).next().addClass("selected_shortcut_msg"); 553 return false; 554 } 555 556 }); 557 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 558 if(!$(this).hasClass("current_selected")) 559 $(this).removeClass("selected_shortcut_msg"); 560 }); 531 532 if( keyboard_action == 'down') { 533 534 if(!Element("chk_box_select_all_messages").checked){ 535 536 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 537 538 if($(this).hasClass("selected_shortcut_msg") && $(this).next().length){ 539 $(this).next().addClass("selected_shortcut_msg"); 540 $(this).removeClass("selected_shortcut_msg"); 541 return false; 542 } 543 544 }); 545 546 } else { 547 548 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 549 550 if($(this).hasClass("current_selected") && $(this).next().length){ 551 $(this).removeClass("current_selected"); 552 $(this).removeClass("selected_shortcut_msg"); 553 $(this).next().addClass("current_selected"); 554 $(this).next().addClass("selected_shortcut_msg"); 555 return false; 556 } 557 558 }); 559 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 560 if(!$(this).hasClass("current_selected")) 561 $(this).removeClass("selected_shortcut_msg"); 562 }); 561 563 } 562 564 563 } else if( keyboard_action == 'up') { 564 565 if(!Element("chk_box_select_all_messages").checked){ 566 567 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 568 569 if($(this).hasClass("selected_shortcut_msg") && $(this).prev().length){ 570 $(this).prev().addClass("selected_shortcut_msg"); 571 $(this).removeClass("selected_shortcut_msg"); 572 return false; 573 } 574 575 }); 576 577 } else { 578 579 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 580 581 if($(this).hasClass("current_selected") && $(this).prev().length){ 582 $(this).removeClass("current_selected"); 583 $(this).removeClass("selected_shortcut_msg"); 584 $(this).prev().addClass("current_selected"); 585 $(this).prev().addClass("selected_shortcut_msg"); 586 return false; 587 } 588 589 }); 590 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 591 if(!$(this).hasClass("current_selected")) 592 $(this).removeClass("selected_shortcut_msg"); 593 594 }565 } else if( keyboard_action == 'up') { 566 567 if(!Element("chk_box_select_all_messages").checked){ 568 569 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 570 571 if($(this).hasClass("selected_shortcut_msg") && $(this).prev().length){ 572 $(this).prev().addClass("selected_shortcut_msg"); 573 $(this).removeClass("selected_shortcut_msg"); 574 return false; 575 } 576 577 }); 578 579 } else { 580 581 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 582 583 if($(this).hasClass("current_selected") && $(this).prev().length){ 584 $(this).removeClass("current_selected"); 585 $(this).removeClass("selected_shortcut_msg"); 586 $(this).prev().addClass("current_selected"); 587 $(this).prev().addClass("selected_shortcut_msg"); 588 return false; 589 } 590 591 }); 592 $("#divScrollMain_0").find("#tbody_box").find("tr").each(function(){ 593 if(!$(this).hasClass("current_selected")) 594 $(this).removeClass("selected_shortcut_msg"); 595 }); 596 595 597 } 598 599 } 596 600 return true; 597 601 } -
branches/2.4/expressoMail1_2/setup/default_records.inc.php
r6672 r6754 1 1 <?php 2 /**************************************************************************\ 3 * eGroupWare - Setup * 4 * http://www.egroupware.org * 5 * -------------------------------------------- * 6 * This program is free software; you can redistribute it and/or modify it * 7 * under the terms of the GNU General Public License as published by the * 8 * Free Software Foundation; either version 2 of the License, or (at your * 9 * option) any later version. * 10 \**************************************************************************/ 11 2 12 $oProc->query("ALTER TABLE expressomail_message_followupflag ADD CONSTRAINT expressomail_message_followupflag_followupflag_id_fkey FOREIGN KEY (followupflag_id) REFERENCES expressomail_followupflag (id);"); 3 13 … … 11 21 /* Seta o valor padrão para a configuração de número máximo de marcadores */ 12 22 $oProc->query("INSERT INTO phpgw_config(config_app, config_name, config_value) VALUES ('expressoMail1_2', 'expressoMail_limit_labels', 20);"); 13 $oProc->query("INSERT INTO phpgw_config(config_app, config_name, config_value) VALUES ('expressoMail1_2', 'allow_hidden_copy', 'True');"); 14 23 $oProc->query("INSERT INTO phpgw_config(config_app, config_name, config_value) VALUES ('expressoMail1_2', 'allow_hidden_copy', 'True');"); 24 15 25 /* Registra o hook de validação do administrador*/ 16 26 $oProc->query("INSERT INTO phpgw_hooks( \"hook_appname\", \"hook_location\", \"hook_filename\") VALUES ('expressoMail1_2', 'config_validate', 'hook_config_validate.inc.php')"); 17 27 18 28 /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner */ 29 $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 19 30 ?> -
branches/2.4/expressoMail1_2/setup/phpgw_pt-br.lang
r6715 r6754 16 16 Add user into my IM expressoMail1_2 pt-br Adicionar no meu IM 17 17 After store email in your local computer delete it from server expressoMail1_2 pt-br Depois de guardar e-mail no seu computador local, excluí-lo do servidor 18 Alert message filter by sender expressoMail1_2 pt-br Alertar ao receber mensagens filtradas por remetente 18 19 all expressoMail1_2 pt-br Todas 19 20 All messages are successfully unarchived expressoMail1_2 pt-br Mensagens desarquivadas com sucesso … … 94 95 Contact added successfully. expressoMail1_2 pt-br Contato adicionado com sucesso. 95 96 Connection failed with %1 Server. Try later. expressoMail1_2 pt-br Ocorreu uma falha de comunicação com o servidor de %1. Tente mais tarde. 96 Convert this message into plain text can make parts of it are removed. Continue? expressoMail1_2 pt-br Converter esta mensagem para texto sem formatação pode fazer com que partes dela sejam removidas. Deseja continuar? 97 Convert this message into plain text can make parts of it are removed. Continue? expressoMail1_2 pt-br Converter esta mensagem para texto sem formatação pode fazer com que partes dela sejam removidas. Deseja continuar? 97 98 Couldn't verify if certificate was revoked.(CD-01) expressoMail1_2 pt-br A lista de certificados revogados não foi encontrada.(CD-01) 98 99 Couldn't verify if certificate was revoked.(CD-02) expressoMail1_2 pt-br Não foi possível verificar se o certificado está revogado.(CD-02) … … 562 563 There is not %1 folder, Expresso is creating it for you... Please, repeat your request later. expressoMail1_2 pt-br Pasta %1 inexistente, Expresso criará para você. Contudo por favor repita a operação em seguida. 563 564 There's an action processing. Do you want abort it? expressoMail1_2 pt-br Existe uma ação que ainda está sendo processada. Suspender ação? 565 The filter is active for alerts expressoMail1_2 pt-br O filtro está ativo para alertas 564 566 The results were found in the Global Catalog expressoMail1_2 pt-br Ocorrências encontradas no Catálogo Geral 565 567 The selected folder is empty. expressoMail1_2 pt-br A pasta selecionada está vazia. … … 901 903 will be removed. This action cannot be undone. Want to continue? expressoMail1_2 pt-br serão removidas. Essa ação não poderá ser desfeita. Deseja continuar? 902 904 Message size greateruler than allowed (Default rule) expressoMail1_2 pt-br Tamanho da mensagem excede o limite de tamanho configurado pelo administrador 905 You have an archived message: expressoMail1_2 pt-br Você tem uma mensagem arquivada: 906 You have %1 messages archived: expressoMail1_2 pt-br Você tem %1 mensagens arquivadas: 907 Filter by sender expressoMail1_2 pt-br Filtro por Remetente 908 Follow ups expressoMail1_2 pt-br Sinalizadas 909 Done expressoMail1_2 pt-br Concluídas 910 If more than one criterion for the filter, the "Meeting all the criteria" must be selected expressoMail1_2 pt-br Se houver mais que um critério para o filtro, a opção "Atender a todos os critérios" deve estar selecionada 911 The filter should be set as a criteria "Sender" and action "Archive folder" expressoMail1_2 pt-br O filtro deve ter como critério definido "Remetente" e ação "Arquivar na pasta" 912 Filter with alert expressoMail1_2 pt-br Filtro com alerta 913 Group contacts expressoMail1_2 pt-br Contatos do grupo 914 Remove recipient expressoMail1_2 pt-br Remover destinatário 915 Quick search of messages expressoMail1_2 pt-br Busca rápida de mensagens 916 Search messages of ... expressoMail1_2 pt-br Busca mensagens de ... 917 Telephone expressoMail1_2 pt-br Telefone 918 And more %1 contact expressoMail1_2 pt-br E mais %1 contato 919 Impossible editing this contact, but it's possible to remove it expressoMail1_2 pt-br Impossível editar este contato, mas é possível removê-lo 920 The contact was moved from recent contacts to personal contacts successful. expressoMail1_2 pt-br O Contato foi movido dos contatos recentes para os contatos pessoais com sucesso. -
branches/2.4/expressoMail1_2/setup/setup.inc.php
r6255 r6754 13 13 $setup_info['expressoMail1_2']['name'] = 'expressoMail1_2'; 14 14 $setup_info['expressoMail1_2']['title'] = 'Expresso Mail'; 15 $setup_info['expressoMail1_2']['version'] = '2.4. 7';15 $setup_info['expressoMail1_2']['version'] = '2.4.8'; 16 16 $setup_info['expressoMail1_2']['app_order'] = 2; 17 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressomail_contacts';18 17 $setup_info['expressoMail1_2']['tables'][] = 'phpgw_certificados'; 19 18 … … 22 21 $setup_info['expressoMail1_2']['tables'][] = 'expressomail_message_followupflag'; 23 22 $setup_info['expressoMail1_2']['tables'][] = 'expressomail_followupflag'; 23 $setup_info['expressoMail1_2']['tables'][] = 'expressomail_dynamic_contact'; 24 24 25 25 … … 48 48 'versions' => Array('2.4') 49 49 ); 50 51 $setup_info['expressoMail1_2']['depends'][] = array( 52 'appname' => 'rest', 53 'versions' => Array('1.0') 54 ); 55 50 56 ?> -
branches/2.4/expressoMail1_2/setup/tables_current.inc.php
r5981 r6754 10 10 \**************************************************************************/ 11 11 $phpgw_baseline = array( 12 ' phpgw_expressomail_contacts' => array(12 'expressomail_dynamic_contact' => array( 13 13 'fd' => array( 14 'id_owner' => array( 'type' => 'int', 'precision' => 8, 'nullable' => false), 15 'data' => array( 'type' => 'text') 14 'id' => array('type' => 'auto','nullable' => False), 15 'owner' => array('type' => 'int','precision' => '16','nullable' => False), 16 'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 17 'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 18 'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 19 'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 16 20 ), 17 'pk' => array('id _owner'),21 'pk' => array('id'), 18 22 'fk' => array(), 19 23 'ix' => array(), 20 24 'uc' => array() 21 25 ), 26 22 27 'phpgw_certificados' => array( 23 28 'fd' => array( -
branches/2.4/expressoMail1_2/setup/tables_update.inc.php
r6255 r6754 267 267 return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 268 268 } 269 269 270 $test[] = '2.4.7'; 271 function expressoMail1_2_upgrade2_4_7() { 272 $oProc = $GLOBALS['phpgw_setup']->oProc; 273 274 //Criando nova tabela de contatos dinamicos 275 $oProc->CreateTable('expressomail_dynamic_contact',array( 276 'fd' => array( 277 'id' => array('type' => 'auto','nullable' => False), 278 'owner' => array('type' => 'int','precision' => '16','nullable' => False), 279 'name' => array('type' => 'varchar','precision' => '100','nullable' => true), 280 'mail' => array('type' => 'varchar','precision' => '100','nullable' => False), 281 'number_of_messages' => array('type' => 'int','precision' => '16','nullable' => False), 282 'timestamp' => array('type' => 'int','precision' => '16','nullable' => False), 283 ), 284 'pk' => array('id'), 285 'fk' => array(), 286 'ix' => array(), 287 'uc' => array() 288 ) 289 ); 290 291 /* Cria um indice unico para um owner e mail para nao ocorrer duplicidade em e-mails para um mesmo owner */ 292 $oProc->query("ALTER TABLE expressomail_dynamic_contact ADD CONSTRAINT owner_mail UNIQUE (owner, mail)"); 293 294 //Migra dados antigos para nova tabela 295 $oProc->query('SELECT * FROM phpgw_expressomail_contacts'); 296 $return = array(); 297 while($oProc->next_record()) 298 $return[$oProc->f('id_owner')] = $oProc->f('data'); 299 300 foreach ($return as $owner => &$value) { 301 $contacts = unserialize($value); 302 foreach ($contacts as &$contact) { 303 $info = explode('#', $contact['email']); 304 $oProc->query("INSERT INTO expressomail_dynamic_contact (owner, name ,mail , number_of_messages ,timestamp) values ('".$owner."', '".$info[0]."', '".$info[1]."', 1, '".$contact['timestamp']."');"); 305 } 306 } 307 308 //Deleta tabela antiga 309 $oProc->DropTable('phpgw_expressomail_contacts'); 310 311 $GLOBALS['setup_info']['expressoMail1_2']['currentver'] = '2.4.8'; 312 return $GLOBALS['setup_info']['expressoMail1_2']['currentver']; 313 } 270 314 ?> -
branches/2.4/expressoMail1_2/templates/default/config.tpl
r5988 r6754 104 104 </td> 105 105 </tr> 106 <tr bgcolor="{row_o ff}">106 <tr bgcolor="{row_on}"> 107 107 <td>{lang_imap_max_folders}:</td> 108 108 <td> … … 110 110 </td> 111 111 </tr> 112 <tr bgcolor="{row_o n}">112 <tr bgcolor="{row_off}"> 113 113 <td>{lang_Max_attachment_size}</td> 114 114 <td> … … 118 118 </td> 119 119 </tr> 120 <tr bgcolor="{row_o ff}">120 <tr bgcolor="{row_on}"> 121 121 <td>{lang_allow_hidden_copy}</td> 122 122 <td> … … 133 133 </td> 134 134 </tr> 135 <tr bgcolor="{row_o ff}">135 <tr bgcolor="{row_on}"> 136 136 <td>{lang_gears_firefox_windows_url}</td> 137 137 <td> … … 139 139 </td> 140 140 </tr> 141 <tr bgcolor="{row_o n}">141 <tr bgcolor="{row_off}"> 142 142 <td>{lang_gears_firefox_linux_url}</td> 143 143 <td> … … 145 145 </td> 146 146 </tr> 147 <tr bgcolor="{row_o ff}">147 <tr bgcolor="{row_on}"> 148 148 <td>{lang_gears_ie_url}</td> 149 149 <td> … … 151 151 </td> 152 152 </tr> 153 <tr bgcolor="{row_o n}">153 <tr bgcolor="{row_off}"> 154 154 <td>{lang_Do_you_want_to_use_x_origin_in_source_menssage?}</td> 155 155 <td> … … 160 160 </td> 161 161 </tr> 162 <tr bgcolor="{row_o ff}">162 <tr bgcolor="{row_on}"> 163 163 <td>{lang_Number_max_of_labels}</td> 164 164 <td> … … 244 244 </td> 245 245 </tr> 246 247 <tr bgcolor="{th_bg}"> 248 <td colspan="2"> 249 250 </td> 251 </tr> 252 <tr bgcolor="{row_on}"> 253 <td colspan="2"> 254 <label style="font-weight:bold;">{lang_Identifier_of_the_recipient_of_a_message}</label> 255 </td> 256 </tr> 257 <tr bgcolor="{row_off}"> 258 <td>{lang_LDAP_attribute_used_to_replacement}</td> 259 <td> 260 <select id="identifier_recipient" name="newsettings[expressoMail_ldap_identifier_recipient]"> 261 {rows_ldap_identifier} 262 </select> 263 </td> 264 </tr> 265 266 <!-- <tr bgcolor="{row_off}"> 267 <td>{lang_LDAP_attribute_used_to_replacement}</td> 268 <td> 269 <input type="text" id="identifier_recipient " value="{value_expressoMail_ldap_identifier_recipient}" name="newsettings[expressoMail_ldap_identifier_recipient]" size=10 maxlength=10 /> 270 </td> 271 </tr> --> 246 272 <!--tr bgcolor="{row_on}"> 247 273 <td>{lang_Days_interval_to_show_balloon_for_user}</td> -
branches/2.4/expressoMail1_2/templates/default/index.tpl
r5878 r6754 211 211 <div id="sendFileMessages" style="display:none;"></div> 212 212 <div id="quickAddContact" style="display:none;"></div> 213 <div id="freeow" class="freeow freeow-bottom-right"></div> 213 214 <!-- END list --> -
branches/2.4/expressoMail1_2/templates/default/main.css
r6734 r6754 127 127 .context-menu-item.icon-normal { background-image: url(images/door.png); } 128 128 .context-menu-item.icon-followupflag { background-image: url(images/door.png); } 129 .context-menu-item.icon-quick-add { background-image: url(images/vcard_add.png); } 130 .context-menu-item.icon-delete-box{ background-image: url(images/user_delete.png); } 131 .context-menu-item.icon-quick-search-contact{ background-image: url(images/zoom.png); } 129 132 130 133 … … 700 703 } 701 704 .message_options_trash { 702 background-image: url( ../../../phpgwapi/templates/default/images/foldertree_trash.png);705 background-image: url(images/page_white_delete.png); 703 706 background-repeat: no-repeat; 704 707 background-position:left center; … … 1009 1012 } 1010 1013 1011 .qtip.qtip-blue.qtip-active ul { 1012 padding: 0; 1013 } 1014 1015 .qtip.qtip-blue.qtip-active li { 1016 width: 160px; 1017 list-style: none; 1018 } 1019 1020 .qtip.qtip-blue.qtip-active ul { 1021 padding: 0; 1022 } 1023 1024 .qtip.qtip-blue.qtip-active li { 1025 width: 160px; 1026 list-style: none; 1027 } 1014 .qtip.qtip-blue.qtip-active ul { 1015 padding: 0; 1016 } 1017 1018 .qtip.qtip-blue.qtip-active li { 1019 width: 160px; 1020 list-style: none; 1021 } 1028 1022 1029 1023 .new-event-win.active .fc-event-skin { … … 1064 1058 } 1065 1059 1066 div.new-event-win.active div.button-files-upload{ 1067 margin: 15px 0 0 0; 1068 } 1069 1070 div.new-event-win.active div.files-list{ 1071 margin: 45px 0 0 0; 1072 } 1073 1060 div.new-event-win.active div.button-files-upload{ 1061 margin: 15px 0 0 0; 1062 } 1063 1064 div.new-event-win.active div.files-list{ 1065 margin: 45px 0 0 0; 1066 } 1067 1074 1068 /*#divAppbox 1075 1069 { background: #fff url( ../images/bgBlockContent.jpg ) repeat-x; border-color: #9c9c9c; } … … 1282 1276 1283 1277 button.expressomail-button-icon-ative{color:#E17009 !important; border: 1px solid #E17009 !important;background: none repeat scroll 0 0 #FFE1CC !important;} 1278 1279 .outoffice 1280 { 1281 width: 295px; 1282 height: 50px; 1283 overflow: hidden; 1284 } 1285 1286 .title-outoffice 1287 { 1288 margin-left: 10px; 1289 font-family: verdana; 1290 font-size: 1.2em; 1291 } 1292 .outoffice span{ 1293 margin: 5px; 1294 } 1295 1296 #detalhes_contato img{ margin-bottom: -4px;} 1297 1298 button.expressomail-button-icon-ative{color:#E17009 !important; border: 1px solid #E17009 !important;background: none repeat scroll 0 0 #FFE1CC !important;} 1299 1300 .box{ 1301 background-color: #96B3D3; 1302 border-radius: 5px; 1303 -moz-border-radius: 5px; 1304 border: 1px solid #201b41; 1305 display: inline-block; 1306 cursor : pointer; 1307 margin-top : 1px; 1308 margin-right: 1px; 1309 outline : none; 1310 padding : 1px; 1311 } 1312 1313 1314 .box span{ 1315 font-family: Verdana, Arial, Helvetica, sans-serif; 1316 font-size: 13px; 1317 color : #201b41; 1318 outline : none; 1319 } 1320 1321 .invalid-email-box{ 1322 background-color: #F08080; 1323 border : 1px solid #540303 !important; 1324 } 1325 1326 .invalid-email-box span{ 1327 color: #540303; 1328 } 1329 1330 .out-office-box{ 1331 background-color: #dac407; 1332 border : 1px solid #837c3f !important; 1333 } 1334 1335 .out-office-box span{ 1336 color: #837c3f; 1337 } 1338 1339 .email-area{ 1340 border-radius: 5px; 1341 width: 98.5%; 1342 padding: 5px; 1343 border : 1px solid #BBBBBB; 1344 heigth : auto; 1345 max-height : 115px; 1346 overflow-y: auto; 1347 cursor: text; 1348 } 1349 .email-text{ 1350 outline:none; 1351 width:15px; 1352 border : none; 1353 font-family: Verdana, Arial, Helvetica, sans-serif; 1354 font-size: 13px; 1355 } 1356 1357 .box-input{ 1358 outline:none; 1359 border : none; 1360 font-family: Verdana, Arial, Helvetica, sans-serif; 1361 font-size: 13px; 1362 display : none; 1363 width: 40px; 1364 } 1365 1366 .box-selected{ 1367 background-color : #BBBBBB; 1368 } 1369 1370 .hidden { 1371 display : none; 1372 } 1373 1374 .loading { 1375 background: url(../../../prototype/modules/mail/img/loader.gif) !important; 1376 background-position: 0 0 !important; 1377 background-repeat : no-repeat !important; 1378 } 1379 1380 .line-separator{ 1381 background: url("images/linha.png") repeat-x scroll 0 8px transparent; 1382 clear : both; 1383 } 1384 1385 .box-draggable-hover{ 1386 border : 1px solid #474747; 1387 } 1388 1389 .box-loading{ 1390 background : url("../../../prototype/modules/mail/img/loading.gif") no-repeat !important; 1391 background-size: 17px auto !important; 1392 } 1393 1394 .box-info{ 1395 background : url("images/information.png") no-repeat !important; 1396 } 1397 1398 input.required-fail{ 1399 border-color : red; 1400 } -
branches/2.4/expressoMail1_2/templates/default/searchMails.ejs
r5751 r6754 3 3 4 4 <label><%=data.From%>:</label> 5 <input style="margin-left: 6px;" type="text" id="txt_de" size="20" />5 <input style="margin-left: 6px;" type="text" id="txt_de" size="20" value="<%=data.From_value%>"/> 6 6 <br style="margin-bottom:15px" /> 7 7
Note: See TracChangeset
for help on using the changeset viewer.