rebuilt the branch
authorAndrew Hunt <andrew@aghstrategies.com>
Tue, 9 Apr 2013 21:35:38 +0000 (17:35 -0400)
committerAndrew Hunt <andrew@aghstrategies.com>
Tue, 9 Apr 2013 21:35:38 +0000 (17:35 -0400)
css/civicrm.css
templates/CRM/Activity/Form/Activity.tpl

index 253af570853f52a32806150f17316044c1b6dac2..15bd4c326814216a53e25d8463ac8a17984a34be 100644 (file)
@@ -2581,6 +2581,10 @@ div.grippie {
   background-position: -3px -161px;
 }
 
+.crm-container .swap-target-assignee-icon {
+  background-position: -82px -81px;
+}
+
 #crm-container .geotag {
   padding: 2px 0 2px 20px !important;
   background: url('../i/geotag_16.png') left center no-repeat;
index 31f3445c652dc81d69e7b1566d552daec581f232..e042071d74fe79700ffddb81c6fb944d96013339 100644 (file)
       </td>
     {/if}
   </tr>
+  
+  {if $action neq 4}
+    <tr class="crm-activity-form-block-swap_target_assignee">
+      <td class="label"></td>
+      <td>
+        <a class="button" id="swap_target_assignee">
+          <span>
+            <div class="icon swap-target-assignee-icon"></div>{ts}Swap Target and Assignee Contacts{/ts}
+          </span>
+        </div>
+      </td>
+    </tr>
+  {/if}
 
   <tr class="crm-activity-form-block-assignee_contact_id">
     {if $action eq 4}
               }
             });
           });
+          cj('#swap_target_assignee').click( function() {
+            var assignees = cj('input#assignee_contact_id').tokenInput("get");
+            var targets = cj('input#contact_1').tokenInput("get");
+            cj('#assignee_contact_id').tokenInput("clear");
+            cj('#contact_1').tokenInput("clear");
+            cj(assignees).each( function() {
+              cj('#contact_1').tokenInput("add", this);
+            });
+            cj(targets).each( function() {
+              cj('#assignee_contact_id').tokenInput("add", this);
+            });
+          });
         </script>
       {/literal}
     </td>