Skip to content
This repository
Browse code

Merge branch 'dev' of github.com:nysenate/Bluebird-CRM into dev

  • Loading branch information...
commit 8becea9f88f1c4a60b0c17550b0b88a537c2ac8c 2 parents 4882a3b + d28db97
Brian Shaughnessy authored April 17, 2014
3  civicrm/custom/php/CRM/IMAP/AJAX.php
@@ -241,8 +241,7 @@ public static function UnmatchedDetails() {
241 241
             $patterns = array('/\r\n|\r|\n/i', '/\<p(\s*)?\/?\>/i', '/\<br(\s*)?\/?\>/i', '/<div[^>]*>/','/<\/div>/' ,'/\//');
242 242
             $search = preg_replace('/&lt;|&gt;|&quot;|&amp;/i', '###', $search );
243 243
             $search = preg_replace($patterns, "\n ",  $output['body']);
244  
-
245  
-            // Find Possible Email Addresses
  244
+             // Find Possible Email Addresses
246 245
             foreach(preg_split('/[, ;]/', $search) as $token) {
247 246
               $email = filter_var(filter_var($token, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL);
248 247
               if ($email !== false) {
2  civicrm/custom/templates/CRM/IMAP/Page/Activities.tpl
@@ -65,7 +65,7 @@
65 65
     <div id="message_right">
66 66
       <div id="tabs">
67 67
         <ul>
68  
-          <li><a href="#tab1">ReAssign </a></li>
  68
+          <li id="tab1"><a href="#tab1">ReAssign </a></li>
69 69
           <li><a href="#tab2">Tag</a></li>
70 70
           <li><a href="#tab3">Edit Activity</a></li>
71 71
         </ul>
4  modules/nyss_imapper/nyss_imapper.css
@@ -207,8 +207,8 @@ thead .sorting_asc{background-color:#f1f1f1!important;}
207 207
 /* Email toggle for multi tag */
208 208
 .hidden_email{margin:0 0 10px 0; height:30px; overflow: hidden; width: 580px; cursor:pointer; cursor:hand}
209 209
 .shown_email{margin: 0 0 10px 0; height: auto; background: #fff; border-bottom:1px solid #ccc; width: 580px;}
210  
-.info.hidden_email_info{height: 20px; background: #e1e1e1; float: left; padding: 5px 10px; width: 580px;}
211  
-.info.shown_email_info{height: 20px; background: #e1e1e1; float: left; padding: 5px 10px; width: 580px;}
  210
+.info.hidden_email_info{height: 20px; background: #e1e1e1; float: left; padding: 5px 10px; width: 570px;}
  211
+.info.shown_email_info{height: 20px; background: #e1e1e1; float: left; padding: 5px 10px; width: 570px;}
212 212
 .info:hover{background: #ccc; }
213 213
 .add_email{width:450px !important; padding: 5px 10px;}
214 214
 
20  modules/nyss_imapper/nyss_imapper.js
@@ -576,7 +576,7 @@ cj(document).ready(function(){
576 576
       cj('#contact_tag, #contact_position, #activity_tag, #contact_name, #activity_date, #contact_position_name').val('');
577 577
       cj('.token-input-dropdown-facebook').html('').remove();
578 578
       cj('.token-input-list-facebook').html('').remove();
579  
-      cj('#contact-issue-codes').html('');
  579
+      cj('#contact-issue-codes,#message_left_header,#message_left_email,#imapper-contacts-list').html('');
580 580
 
581 581
       // load the message
582 582
       // build one list of singular processing
@@ -584,8 +584,9 @@ cj(document).ready(function(){
584 584
       activityIds = activityId.split(',');
585 585
       contactIds = contactId.split(',');
586 586
       if(activityIds.length == 1){
587  
-        cj('#message_left_header').show();
  587
+        cj('#message_left_header,#tab1').show();
588 588
         cj('#message_left_email').removeClass('multi');
  589
+        cj('#ui-id-1').click();
589 590
         cj.ajax({
590 591
           url: '/civicrm/imap/ajax/matched/details',
591 592
           data: {id: messageId, contact: contactId },
@@ -596,8 +597,6 @@ cj(document).ready(function(){
596 597
               cj("#loading-popup").dialog('close');
597 598
               if(message.clear =='true')   removeRow(messageId);
598 599
             }else{
599  
-              cj('#message_left_header').html('');
600  
-
601 600
               if(message.sender_name || message.sender_email) cj('#message_left_header').html('').append("<span class='popup_def'>From: </span>");
602 601
               if(message.sender_name) cj('#message_left_header').append(message.sender_name +"  ");
603 602
               if(message.sender_email) cj('#message_left_header').append("<span class='emailbubble'>"+ message.sender_email+"</span>");
@@ -609,9 +608,7 @@ cj(document).ready(function(){
609 608
               }else{
610 609
                 cj('#message_left_header').append("<span class='popup_def'>&nbsp;</span>No forwarded content found<br/>");
611 610
               }
612  
-
613 611
               cj('#message_left_email').html(message.body+"<hr/>");
614  
-
615 612
               cj.each(message.attachments, function(key, value) {
616 613
                 if((!value.rejection) || (value.rejection == '')){
617 614
                   cj('#message_left_email').append(value.fileName+" ("+((value.size / 1024) / 1024).toFixed(2)+" MB)<br/>");
@@ -619,12 +616,10 @@ cj(document).ready(function(){
619 616
                   cj('#message_left_email').append("<span class='rejected'>"+value.fileName+" was rejected ("+value.rejection+")</span><br/>");
620 617
                 }
621 618
               });
622  
-
623 619
               cj("#loading-popup").dialog('close');
624 620
               cj("#assign-popup").dialog({
625 621
                 title:  "Processing "+shortenString(message.subject,55),
626 622
               });
627  
-
628 623
               cj('#imapper-contacts-list').html('').append("<strong>currently matched to : </strong><br/>           "+'<a href="/civicrm/contact/view?reset=1&cid='+message.matched_to+'" title="'+message.sender_name+'">'+shortenString(message.sender_name,35)+'</a>'+" <br/><i>&lt;"+ message.sender_email+"&gt;</i> <br/>"+ cj('.dob').val()+"<br/> "+ cj('.phone').val()+"<br/> "+  cj('.street_address').val()+"<br/> "+  cj('.city').val()+"<br/>");
629 624
             }
630 625
           },
@@ -636,24 +631,21 @@ cj(document).ready(function(){
636 631
       }else if (activityIds.length > 1){
637 632
         // here is the view for multiple messages
638 633
         cj('#message_left_email').addClass('multi');
639  
-        cj('#message_left_header').hide();
640  
-
  634
+        cj('#message_left_header,#tab1').hide();
  635
+        cj('#ui-id-2').click();
641 636
         cj.each(messageIds, function(key, messageId) {
642  
-          console.log("messageId : "+messageId+' - activityId :'+activityIds[key]+" - key : "+key+" - Contact : "+contactIds[key]);
  637
+          // console.log("messageId : "+messageId+' - activityId :'+activityIds[key]+" - key : "+key+" - Contact : "+contactIds[key]);
643 638
           cj.ajax({
644 639
             url: '/civicrm/imap/ajax/matched/details',
645 640
             data: {id: messageId, contact: contactIds[key] },
646 641
             success: function(data,status) {
647  
-
648 642
               cj("#loading-popup").dialog('close');
649 643
               message = cj.parseJSON(data);
650  
-              console.log(message);
651 644
               if(message.code == 'ERROR'){
652 645
                 if(message.clear =='true') removeRow(messageId);
653 646
                 CRM.alert('Unable to load Message : '+ message.message, '', 'error');
654 647
                 return false;
655 648
               }else{
656  
-                console.log('working');
657 649
                 cj('#message_left_email').append("<div id='header_"+messageId+"' data-id='"+messageId+"' class='message_left_header_tags'><span class='popup_def'>From: </span>"+message.sender_name +"  <span class='emailbubble'>"+ message.sender_email+"</span><br/><span class='popup_def'>Subject: </span>"+shortenString(message.subject,55)+"<br/><span class='popup_def'>Date Forwarded: </span>"+message.date_long+"<br/></div><div id='email_"+messageId+"' class='hidden_email' data-id='"+messageId+"'></div>");
658 650
                 if ((message.forwarder != message.sender_email)){
659 651
                   cj('#header_'+messageId).append("<span class='popup_def'>Forwarded by: </span><span class='emailbubble'>"+ message.forwarder+"</span> @"+ message.updated_long+ "<br/>");

0 notes on commit 8becea9

Please sign in to comment.
Something went wrong with that request. Please try again.