adding member cloning ability
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 25 Feb 2019 19:03:55 +0000 (14:03 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 25 Feb 2019 19:03:55 +0000 (14:03 -0500)
models/admin/ajax/memberManagement.php
views/admin/manageDashboard/edit.html
views/admin/manageDashboard/index.html
views/admin/member/index.html
views/admin/member/memberInfo.html
views/admin/member/memberInfo/editCategory.html
views/admin/members/list.html

index b2cf49f..dd9cc52 100644 (file)
@@ -101,7 +101,7 @@ class GlmMembersAdmin_ajax_memberManagement extends glmMembersAdmin
             $data  = $this->controller( 'manageDashboard', 'members', false, true, true);
         }
 
-        if($_REQUEST['option'] == 'edit' || $_REQUEST['option'] == 'addNew'){
+        if($_REQUEST['option'] == 'edit' || $_REQUEST['option'] == 'addNew' || $_REQUEST['option'] == 'clone'){
             $data  = $this->controller( 'member', 'memberInfo',  false, true, true);
         }
 
index 46b6afa..a6419ae 100644 (file)
                 <td>
                     {if $settings.memb_info_location} {if $m.bad_lat_lon && !$m.has_no_map_data.value}<span class="glm-error">Bad Map Location</span>{/if} {/if}
           {if apply_filters('glm_members_permit_admin_member_index_clone_activate_info_version', true)}
-                    <a href="{$thisUrl}?page={$thisPage}&glm_action=memberInfo&member={$memberID}&memberInfo={$m.id}&option=clone" class="button button-secondary glm-button-small glm-right">Clone</a>&nbsp;
+                    <a data-member="{$memberID}" data-memberinfo="{$m.id}" href="{$thisUrl}?page={$thisPage}&glm_action=memberInfo&member={$memberID}&memberInfo={$m.id}&option=clone" class="button button-secondary glm-button-small glm-right glm-admin-clone-profile">Clone</a>&nbsp;
                     {if $m.status.name != 'Active'}<a href="{$thisUrl}?page={$thisPage}&glm_action=index&member={$memberID}&activateID={$m.id}" class="button button-secondary glm-button-small glm-right">Activate</a>{/if}
           {/if}
                 </td>
index e795827..24c2977 100644 (file)
             );
         });
 
+        $(document).on("click", ".glm-admin-clone-profile",function(e){
+            e.preventDefault();
+            editData.option     = "clone";
+            editData.member     = $(this).data("member"); 
+            editData.memberInfo = $(this).data("memberinfo");
+            Glma.manageMember(
+                editData,
+                function(complete) {},
+                function(success) {
+                    $(".edit-screen").html(success.searchData);
+                },
+                function(error) {
+                    console.log(error);
+                },
+                "POST"
+            );
+        });
         $(document).on("click", "#glm-edit-member-status", function(e){
             e.preventDefault();
         })
index 98f1c25..3913426 100644 (file)
                 <td>
                     {if $settings.memb_info_location} {if $m.bad_lat_lon && !$m.has_no_map_data.value}<span class="glm-error">Bad Map Location</span>{/if} {/if}
           {if apply_filters('glm_members_permit_admin_member_index_clone_activate_info_version', true)}
-                    <a href="{$thisUrl}?page={$thisPage}&glm_action=memberInfo&member={$memberID}&memberInfo={$m.id}&option=clone" class="button button-secondary glm-button-small glm-right">Clone</a>&nbsp;
+                    <a href="{$thisUrl}?page={$thisPage}&glm_action=memberInfo&member={$memberID}&memberInfo={$m.id}&option=clone" class="button button-secondary glm-button-small glm-right glm-admin-clone-profile">Clone</a>&nbsp;
                     {if $m.status.name != 'Active'}<a href="{$thisUrl}?page={$thisPage}&glm_action=index&member={$memberID}&activateID={$m.id}" class="button button-secondary glm-button-small glm-right">Activate</a>{/if}
           {/if}
                 </td>
index 19a0129..869c2c3 100755 (executable)
                 action      : window.Glma.defaultData.action,
                 glm_action  : window.Glma.defaultData.glm_action,
             }
-            $('select').formSelect();
+            // $('select').formSelect();
             /*
              * Edit area tabs
              */
index 8efbadf..d56a4a7 100644 (file)
     jQuery(document).ready(function($) {
 
          // Expand multi-select on hover
-         $('#filterCategories').multiselect();
+        //  $('#filterCategories').multiselect();
          $('#exportFilterCategories').multiselect();
 
     });
index fa55bf8..439e643 100644 (file)
              $('.ui-autocomplete').css('height','200px').css('overflow-y','scroll');
 
              // Expand multi-select on hover
-             $('#filterCategories').multiselect();
+            //  $('#filterCategories').multiselect();
              $('#exportFilterCategories').multiselect();