Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
16 civicrm/custom/php/CRM/IMAP/AJAX.php
@@ -146,6 +146,8 @@ public static function unifiedMessageInfo($email) {
146 146 'body' => $body,
147 147 'date_clean' => self::cleanDate($email->date,'short'),
148 148 'date_long' => self::cleanDate($email->date,'long'),
  149 + 'date_u' => self::cleanDate($email->date,'u'),
  150 +
149 151 'status' => $status,
150 152 );
151 153
@@ -256,6 +258,7 @@ public static function getUnmatchedMessages() {
256 258 'uid' => $header->uid,
257 259 'date' => $output['header']['date_clean'],
258 260 'date_long' => $output['header']['date_long'],
  261 + 'date_u' => $output['header']['date_u'],
259 262 'format' => $output['header']['format'],
260 263 'from_email' => $output['forwarded']['origin_email'],
261 264 'from_name' => $output['forwarded']['origin_name'],
@@ -380,6 +383,7 @@ public static function getMessageDetails() {
380 383 'origin_lookup' => $output['forwarded']['origin_lookup'],
381 384 'header_subject' => $output['header']['subject'],
382 385 'date' => $output['header']['date_clean'],
  386 + 'date_long' => $output['header']['date_long'],
383 387 'forwarder_time' => $output['forwarded']['date_clean']);
384 388 }else{
385 389 $returnMessage = array('code' => 'ERROR','message'=>"It's likely that message #{$id} has not be proccessed by the processMailboxes script, wait a few mins");
@@ -408,6 +412,8 @@ public static function cleanDate($date_string, $type){
408 412
409 413 // reformat the date to something standard here.
410 414 if($type=='long'){
  415 + return date("M d, Y h:i A", strtotime($date_string_short));
  416 + }if($type=='u'){
411 417 return date("U", strtotime($date_string_short));
412 418 }else{
413 419 // check if the message is from last year
@@ -876,6 +882,8 @@ public static function getMatchedMessages() {
876 882
877 883 $date = self::cleanDate($activity_node['activity_date_time'],'short');
878 884 $date_long = self::cleanDate($activity_node['activity_date_time'],'long');
  885 + $date_u = self::cleanDate($activity_node['activity_date_time'],'u');
  886 +
879 887 // message to return
880 888 if ($debug){
881 889 var_dump($activity_node);
@@ -895,7 +903,9 @@ public static function getMatchedMessages() {
895 903 'match_type' => $activity_node['is_auto'],
896 904 'original_id' => $activity_node['original_id'],
897 905 'date' => $date,
898   - 'date_long' => $date_long
  906 + 'date_long' => $date_long,
  907 + 'date_u' => $date_u
  908 +
899 909 );
900 910 }
901 911 $returnMessage['count'] = count($returnMessage);
@@ -937,6 +947,7 @@ public static function getActivityDetails() {
937 947 $forwarder_node = $forwarder['values'][$activity_node['source_contact_id']];
938 948
939 949 $date = self::cleanDate($activity_node['activity_date_time'],'short');
  950 + $date_long = self::cleanDate($activity_node['activity_date_time'],'long');
940 951
941 952 $returnMessage = array('uid' => $activitId,
942 953 'fromName' => $contact_node['display_name'],
@@ -949,7 +960,8 @@ public static function getActivityDetails() {
949 960 'match_type' => $activity_node['is_auto'],
950 961 'original_id' => $activity_node['original_id'],
951 962 'email_user' => self::$imap_accounts[0]['user'], // not ideal for the hardcoded 0
952   - 'date' => $date);
  963 + 'date' => $date,
  964 + 'date_long' =>$date_long);
953 965
954 966 echo json_encode($returnMessage);
955 967 CRM_Utils_System::civiExit();
1  civicrm/custom/templates/CRM/IMAP/Page/Activities.tpl
@@ -86,7 +86,6 @@
86 86 </div>
87 87 <div id="tagging-popup" title="Tagging" style="display:none;">
88 88 <div id="tagging-popup-header"> </div>
89   - <hr/>
90 89 <div id="tagging">
91 90 <ul>
92 91 <li><a href="#tab1">Tag Contact</a></li>
39 modules/nyss_imapper/nyss_imapper.css
@@ -74,13 +74,21 @@ a.tag-selected:hover { color: #fff!important; background-color: red; }
74 74 /* hide dialogues on page load */
75 75 #delete-confirm,#loading-popup{ display: none;}
76 76 .ui-dialog #find-match-popup.ui-dialog-content {padding:0; }
77   -#message_left {float:left; margin:10px 10px 0 10px ; }
  77 +#message_left {float:left; }
78 78 #message_left .debug_info {display: none; }
79 79 #message_left .debug_on,#message_left .debug_off {color: #336699!important; }
80   -.debug_sumit{ border:1px solid #ccc; background: #e1e1e1; padding: 4px; margin-bottom: 10px;}
81   -#message_left_header{ width:640px; height:100px; border-bottom: 1px solid #ccc; }
82   -#message_left_email{ width:640px; height:350px; overflow:auto; }
83   -#message_right{ width:270px; float:left; border-left: 1px solid #ccc; padding:0 0 0 10px; height:455px;}
  80 +.debug_sumit{ border:1px solid #e5e5e5; background: #f1f1f1; padding: 4px; margin-bottom: 10px;}
  81 +
  82 +#message_left_header{ padding:10px ; background: #f1f1f1; border-bottom: 1px solid #e5e5e5; height: 90px;line-height: 23px;width: 640px; }
  83 +
  84 +
  85 +
  86 +#message_left_header.crmdev,#message_left_header.crmtest{height: 110px;}
  87 +
  88 +#message_left_email{ padding:10px ;width:640px; height:340px; overflow:auto; }
  89 +
  90 +#message_left_email.crmdev,#message_left_email.crmtest{height: 320px;}
  91 +#message_right{ width:285px; float:left; border-left: 1px solid #ccc; padding:0 0 0 10px; height:455px;}
84 92 #find-match-popup .ui-tabs-panel { padding:0;}
85 93 /*.first_name,.last_name {width:46%;}*/
86 94 .hidden{display:none;}
@@ -92,7 +100,7 @@ a.tag-selected:hover { color: #fff!important; background-color: red; }
92 100 .imapper-contact-box {background-color: #f8f8f8;margin-bottom: 4px;padding: 4px 0;float:left;}
93 101 .imapper-contact-box:hover {cursor: pointer; background-color: #eeeeee}
94 102 .imapper-address-select-box {height: 16px;width: 20px;float: left;padding: 15px 0px;}
95   -.imapper-address-box {float: left;width: 215px;padding-left: 5px;}
  103 +.imapper-address-box {float: left;width: 230px;padding-left: 5px;}
96 104 .clear {clear: both;}
97 105 .emailbubble,.matchbubble {padding: 2px 4px;}
98 106 .marginL10 {margin-left: 10px;}
@@ -122,8 +130,19 @@ a.tag-selected:hover { color: #fff!important; background-color: red; }
122 130 }
123 131 .imapper-message-box td { vertical-align: middle!important; }
124 132 #message_right label{float: left;display: block;}
125   -.label_def{width: 95px;font-weight: bold;float: left;margin: 0.4em 0 0.02em;}
126   -#message_right label input {width: 150px; }
127   -#tagging #BBTreeContainer .BBTree, #BBDialog .BBTree{height: 200px;}
  133 +.label_def{width: 100px;font-weight: bold;float: left;margin: 0.4em 0 0.02em;}
  134 +#message_right label input {width: 165px; }
  135 +#tagging #BBTreeContainer .BBTree, #BBDialog .BBTree{height: 200px; width: 250px; float: left;}
128 136 .loading_message{ margin: 0px auto; background: #fff; padding:5px; width: 200px}
129   -
  137 +.popup_def{ color: #777777;
  138 + float: left;
  139 + margin: 0 10px 0 0;
  140 + text-align: right;
  141 + width: 100px;}
  142 +
  143 +.ui-tabs .ui-tabs-nav {background-color: #f8f8f8!important;}
  144 +.ui-tabs .ui-state-hover a{background-color: #bbcbdf!important;}
  145 +.ui-tabs .ui-state-active a{background-color: #d1deef!important;}
  146 +
  147 +#tagging-popup-header{ padding:10px 0; background: #f1f1f1; border-bottom: 1px solid #e5e5e5; height: 90px; line-height: 23px;width: 960px; }
  148 +#tagging-popup{ padding: 0; margin: 0;}
45 modules/nyss_imapper/nyss_imapper.js
@@ -546,21 +546,21 @@ cj(document).ready(function(){
546 546 success: function(data,status) {
547 547 cj("#loading-popup").dialog('close');
548 548 messages = cj.parseJSON(data);
549   - cj('#tagging-popup-header').append("<strong>From: </strong>"+messages.fromName +" <i>&lt;"+ messages.fromEmail+"&gt;</i><br/><strong>Subject: </strong>"+messages.subject+"<br/><strong>Date: </strong>"+messages.date+"<br/>");
  549 +
550 550
551   - cj('#tagging-popup-header').html('').append("<strong>From: </strong>"+messages.fromName +" <i>&lt;"+ messages.fromEmail+"&gt;</i><br/><strong>Subject: </strong>"+messages.subject+"<br/><strong>Date: </strong>"+messages.date+"<br/>");
  551 + cj('#tagging-popup-header').html('').append("<span class='popup_def'>From: </span>"+messages.fromName +" <span class='emailbubble'>"+ messages.fromEmail+"</span><br/><span class='popup_def'>Subject: </span>"+messages.subject+"<br/><span class='popup_def'>Date: </span>"+messages.date+"<br/>");
552 552 cj('#tagging-popup-header').append("<input class='hidden' type='hidden' id='activityId' value='"+activityId+"'><input class='hidden' type='hidden' id='contactId' value='"+contactId+"'>");
553 553
554 554 if ((messages.forwardedEmail != '')){
555   - cj('#tagging-popup-header').append("<strong>Forwarded by: </strong>"+messages.forwardedName+" <i>&lt;"+ messages.forwardedEmail+"&gt;</i><br/>");
556   - }
557   - if ((messages.fromAddress)){
558   - cj('#tagging-popup-header').append("<strong>Address by: </strong>"+messages.fromAddress);
  555 + cj('#tagging-popup-header').append("<span class='popup_def'>Forwarded by: </span>"+messages.forwardedName+" <span class='emailbubble'>"+ messages.forwardedEmail+"</span><br/>");
559 556 }
  557 + // if ((messages.fromAddress)){
  558 + // cj('#tagging-popup-header').append("<span class='popup_def'>Address by: </strong>"+messages.fromAddress);
  559 + // }
560 560
561 561 cj("#tagging-popup").dialog({ title: "Tagging: "+ short_subject(messages.subject,50) });
562 562 cj("#tagging-popup").dialog('open');
563   -
  563 + cj("#tagging").tabs();
564 564 },
565 565 error: function(){
566 566 alert('unable to find activity');
@@ -699,17 +699,20 @@ cj(document).ready(function(){
699 699 if(messages.attachmentname ){var name = messages.attachmentname}else{var name = messages.attachmentfilename};
700 700 icon = '<div class="ui-icon ui-icon-link attachment" title="'+name+'"></div>'
701 701 }
  702 + cj('#message_left_header').addClass(messages.email_user);
  703 + cj('#message_left_email').addClass(messages.email_user);
  704 +
702 705 cj('#message_left_header').html('');
703   - if(messages.fromName) cj('#message_left_header').append("<strong>From: </strong>"+messages.fromName +" ");
  706 + if(messages.fromName) cj('#message_left_header').append("<span class='popup_def'>From: </span>"+messages.fromName +" ");
704 707 if(messages.fromEmail) cj('#message_left_header').append("<span class='emailbubble'>"+short_subject(messages.fromEmail)+"</span>");
705   - cj('#message_left_header').append("<br/><strong>Subject: </strong>"+short_subject(messages.subject,70)+" "+ icon+"<br/><strong>Date: </strong>"+messages.date+"<br/>");
  708 + cj('#message_left_header').append("<br/><span class='popup_def'>Subject: </span>"+short_subject(messages.subject,70)+" "+ icon+"<br/><span class='popup_def'>Date: </span>"+messages.date_long+"<br/>");
706 709
707 710 if ((messages.forwardedEmail != '')){
708   - cj('#message_left_header').append("<strong>"+messages.status+" from: </strong>"+messages.forwardedName+" <i>&lt;"+ messages.forwardedEmail+"&gt;</i><br/>");
  711 + cj('#message_left_header').append("<span class='popup_def'>"+messages.status+" from: </span>"+messages.forwardedName+" <span class='emailbubble'>"+ messages.forwardedEmail+"</span><br/>");
709 712 }
710 713 // add some debug info to the message body on toggle
711 714 if(messages.email_user == 'crmdev' || messages.email_user == 'crmtest' ){
712   - var debugHTML ="<div class='debug_on'>Show Debug info</div><div class='debug_info'><div class='debug_remove'><i>UnMatched Message Header ("+messages.status+"):</i><br/><strong>Forwarder: </strong>"+messages.forwardedFull+"<br/><strong>Subject: </strong>"+messages.header_subject+"<br/><strong>Date: </strong>"+messages.date+"<br/><strong>Id: </strong>"+messages.uid+"<br/><strong>ImapId: </strong>"+messages.imapId+"<br/><strong>Format: </strong>"+messages.format+"<br/><strong>Mailbox: </strong>"+messages.email_user+"<br/><strong>Attachment Count: </strong>"+messages.attachment+"<br/>";
  715 + var debugHTML ="<span class='popup_def'>Dev & Test only</span><div class='debug_on'>Show Debug info</div><div class='debug_info'><div class='debug_remove'><i>UnMatched Message Header ("+messages.status+"):</i><br/><strong>Forwarder: </strong>"+messages.forwardedFull+"<br/><strong>Subject: </strong>"+messages.header_subject+"<br/><strong>Date: </strong>"+messages.date+"<br/><strong>Id: </strong>"+messages.uid+"<br/><strong>ImapId: </strong>"+messages.imapId+"<br/><strong>Format: </strong>"+messages.format+"<br/><strong>Mailbox: </strong>"+messages.email_user+"<br/><strong>Attachment Count: </strong>"+messages.attachment+"<br/>";
713 716 if(messages.status !== 'direct'){
714 717 debugHTML +="<br/><i>Parsed email body (origin):</i><br/><strong>Subject: </strong>"+messages.subject+"<br/><strong>Fristname: </strong>"+firstName+"<br/><strong>Lastname: </strong>"+lastName+"<br/><strong>Email: </strong>"+messages.fromEmail+"<br/><strong>Address lookup: </strong>"+messages.origin_lookup+"<br/><strong>Date: </strong>"+messages.forwarder_time+"";
715 718
@@ -767,18 +770,20 @@ cj(document).ready(function(){
767 770 cj("#loading-popup").dialog('close');
768 771 messages = cj.parseJSON(data);
769 772 cj('#message_left_header').html('');
770   - if(messages.fromName) cj('#message_left_header').html('').append("<strong>From: </strong>"+messages.fromName +" ");
771   - if(messages.fromEmail) cj('#message_left_header').append("<i>&lt;"+ messages.fromEmail+"&gt;</i>");
772   - cj('#message_left_header').append("<br/><strong>Subject: </strong>"+messages.subject+"<br/><strong>Date: </strong>"+messages.date+"<br/>");
  773 + if(messages.fromName) cj('#message_left_header').html('').append("<span class='popup_def'>From: </span>"+messages.fromName +" ");
  774 + if(messages.fromEmail) cj('#message_left_header').append("<span class='emailbubble '>"+ messages.fromEmail+"</span>");
  775 + cj('#message_left_header').append("<br/><span class='popup_def'>Subject: </span>"+short_subject(messages.subject,70) +"<br/><span class='popup_def'>Date: </span>"+messages.date_long+"<br/>");
773 776 cj('.email_address').val(messages.fromEmail);
774 777
775 778 if ((messages.forwardedEmail != '')){
776   - cj('#message_left_header').append("<strong>Forwarded by: </strong>"+messages.forwardedName+" <i>&lt;"+ messages.forwardedEmail+"&gt;</i><br/>");
  779 + cj('#message_left_header').append("<span class='popup_def'>Forwarded by: </span>"+messages.forwardedName+" <span class='emailbubble marginL5'>"+ messages.fromEmail+"</span><br/>");
777 780 }
778 781 // if we are on crmdev or crmtest show a debug window
  782 + cj('#message_left_header').addClass(messages.email_user);
  783 + cj('#message_left_email').addClass(messages.email_user);
779 784 if( messages.email_user == 'crmdev' || messages.email_user == 'crmtest' ){
780 785 var match_type = (messages.match_type == 0) ? "Manually matched by user" : "Process Mailbox Script " ;
781   - var debugHTML ="<div class='debug_on'>Show Debug info</div><div class='debug_info'><div class='debug_remove'><i>Matched Message Info:</i><br/><strong>Match Type: </strong>"+match_type+" ("+messages.match_type+")<br/><strong>Activty id: </strong>"+messages.uid+"<br/><strong>Assigned by: </strong>"+messages.forwardedName+"<br/><strong>Assigned To: </strong>"+messages.fromId+"<br/><strong>Created from message Id: </strong>"+messages.original_id+"<br/>";
  786 + var debugHTML ="<span class='popup_def'>Dev & Test only</span><div class='debug_on'>Show Debug info</div><div class='debug_info'><div class='debug_remove'><i>Matched Message Info:</i><br/><strong>Match Type: </strong>"+match_type+" ("+messages.match_type+")<br/><strong>Activty id: </strong>"+messages.uid+"<br/><strong>Assigned by: </strong>"+messages.forwardedName+"<br/><strong>Assigned To: </strong>"+messages.fromId+"<br/><strong>Created from message Id: </strong>"+messages.original_id+"<br/>";
782 787 debugHTML +="<span class='search_info'></span></div></div>";
783 788 cj('#message_left_header').append(debugHTML);
784 789 // we can create redmine issues with message details and assign to stefan from a url !
@@ -903,9 +908,7 @@ function makeListSortable(){
903 908 "bAutoWidth": false,
904 909 "bInfo": false,
905 910 });
906   - // unbind the sort on the checkbox and actions
907   - cj("th.checkbox").removeClass('sorting').unbind('click');
908   - cj("th.Actions").removeClass('sorting').unbind('click');
  911 +
909 912
910 913 checks();
911 914
@@ -969,7 +972,7 @@ function buildMessageList() {
969 972
970 973 // messagesHtml += '<td class="email"></td>';
971 974 messagesHtml += '<td class="subject">'+short_subject(value.subject,40) +' '+icon+'</td>';
972   - messagesHtml += '<td class="date"><span data="'+value.date_long+'">'+value.date +'</span></td>';
  975 + messagesHtml += '<td class="date"><span data="'+value.date_u+'">'+value.date +'</span></td>';
973 976
974 977 // check for direct messages & not empty forwarded messages
975 978 if((value.status == 'direct' ) && (value.forwarder_email != '')){
@@ -1018,7 +1021,7 @@ function buildActivitiesList() {
1018 1021 messagesHtml += '<span class="emailbubble marginL5">'+short_subject(value.fromEmail,14)+'</span>';
1019 1022 messagesHtml +='</td>';
1020 1023 messagesHtml += '<td class="subject">'+short_subject(value.subject,40) +'</td>';
1021   - messagesHtml += '<td class="date"><span data="'+value.date_long+'">'+value.date +'</span></td>';
  1024 + messagesHtml += '<td class="date"><span data="'+value.date_u+'">'+value.date +'</span></td>';
1022 1025 messagesHtml += '<td class="forwarder">'+short_subject(value.forwarder,14)+'</td>';
1023 1026 messagesHtml += '<td class="Actions"> <span class="edit_match"><a href="#">Edit</a></span> | <span class="add_tag"><a href="#">Tag</a></span> | <span class="clear_activity"><a href="#">Clear</a></span> | <span class="delete"><a href="#">Delete</a></span></td> </tr>';
1024 1027 }

No commit comments for this range

Something went wrong with that request. Please try again.