More updates to import
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 5 May 2015 23:13:10 +0000 (19:13 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 5 May 2015 23:13:10 +0000 (19:13 -0400)
classes/glmMemberImportFromConnections.php
views/admin/configure/development.html

index 0fa9d87..009b218 100644 (file)
@@ -111,8 +111,38 @@ class GlmMemberImportFromConnections
         while (list($k, $v) = each($list)) {
 
             // Addresses
-            $addrArray = unserialize($v['addresses']);
-            $list[$k]['addresses'] = $addrArray;
+            $a = unserialize($v['addresses']);
+            $list[$k]['addresses'] = $a;
+
+            // Phone Numbers
+            $a = unserialize($v['phone_numbers']);
+            $list[$k]['phone_numbers'] = $a;
+
+            // E-Mail
+            $a = unserialize($v['email']);
+            $list[$k]['email'] = $a;
+
+            // Social Meida
+            $a = unserialize($v['social']);
+            $list[$k]['social_media'] = $a;
+
+            // Links
+            $a = unserialize($v['links']);
+            $list[$k]['links'] = $a;
+
+            // Dates
+            $a = unserialize($v['dates']);
+            $list[$k]['dates'] = $a;
+
+            // Options
+            $a = unserialize($v['options']);
+            $list[$k]['options'] = $a;
+
+
+
+
+
+
 
         }
         return $list;
index 60bbcd3..35be617 100644 (file)
     {/foreach}
 {/if}
 {if $importData.haveMembers}
-                    <table class="wp-list-table widefat fixed posts glm-admin-table">
-                        <thead>
-                            <tr>
-                                <th>Name</th>
-                                <th>Addr Line 1</th>
-                                <th>Addr Line 2</th>
-                                <th>Addr Line 3</th>
-                                <th>City</th>
-                                <th>State</th>
-                                <th>ZIP</th>
-                                <th>Country</th>
-                                <th>Lat/Lon</th>
-                            </tr>
-                        </thead>
-                        <tbody>
-    {foreach $importData.members as $m}
-                            <tr class="alternate">
-                                <td>{$m.organization}</td>
-        {assign var="i" value="0"}                        
-        {foreach $m.addresses as $a}
-            {if $i++ gt 1}
-                            <tr>
-                                <td>&nbsp;</td>
-            {/if}                                
-                                <td>{$a.line_1}</td>
-                                <td>{$a.line_2}</td>
-                                <td>{$a.line_3}</td>
-                                <td>{$a.city}</td>
-                                <td>{$a.state}</td>
-                                <td>{$a.zipcode}</td>
-                                <td>{$a.country}</td>
-                                <td>{$a.latitude|number_format:3:".":","}/{$a.longitude|number_format:3:".":","}</td>
-                            </tr>
-        {/foreach}
-    {/foreach}               
-                        </tbody>         
-                    </table>
+                    <h3>Please review list of members that will be imported.</h3>
+                    <p>
+                        <span id="skipAll" class="button-primary">Skip All</span>&nbsp;&nbsp;
+                        <span id="skipNone" class="button-primary">Import All</span>
+                    </p>
+                    <form action="{$thisURL}?page={$thisPage}&glm_action=development&option=import_commit" method="post">
+                        <table class="wp-list-table widefat fixed posts glm-admin-table">
+                            <thead>
+                                <tr>
+                                    <th>Skip</th>
+                                    <th>Name</th>
+                                    <th>Addr Line 1</th>
+                                    <th>Addr Line 2</th>
+                                    <th>Addr Line 3</th>
+                                    <th>City</th>
+                                    <th>State</th>
+                                    <th>ZIP</th>
+                                    <th>Country</th>
+                                    <th>Lat/Lon</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+        {foreach $importData.members as $m}
+                                <tr class="alternate">
+                                    <td><input type="checkbox" value="{$m.id}" class="skip"></td>
+                                    <td>{$m.organization}</td>
+            {assign var="i" value="0"}                        
+            {foreach $m.addresses as $a}
+                {if $i++ gt 1}
+                                <tr>
+                                    <td>&nbsp;</td>
+                                    <td>&nbsp;</td>
+                {/if}                                
+                                    <td>{$a.line_1}</td>
+                                    <td>{$a.line_2}</td>
+                                    <td>{$a.line_3}</td>
+                                    <td>{$a.city}</td>
+                                    <td>{$a.state}</td>
+                                    <td>{$a.zipcode}</td>
+                                    <td>{$a.country}</td>
+                                    <td>{$a.latitude|number_format:3:".":","}/{$a.longitude|number_format:3:".":","}</td>
+                                </tr>
+            {/foreach}
+        {/foreach}               
+                            </tbody>         
+                        </table>
+                    </form>
 {/if}
                 </li>
             </ul>
     </div>
 {/if}    
     
+{if $importData.haveMembers}
+    <script type="text/javascript">
+        jQuery(document).ready(function($) {
+
+               $('#skipAll').click(function(event) {
+                   $('.skip').each(function() { //loop through each checkbox
+                       this.checked = true;  //select all checkboxes with class "checkbox1"              
+                   });
+                   return false;
+           });
+               
+            $('#skipNone').click(function(event) {
+                $('.skip').each(function() { //loop through each checkbox
+                    this.checked = false;  //select all checkboxes with class "checkbox1"              
+                });
+                return false;
+            });
+               
+        });
+    </script>
+{/if}            
+    
+    
 {include file='admin/footer.html'}