Place confirmation dialog for delete icons
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 7 Jun 2018 15:58:53 +0000 (11:58 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 7 Jun 2018 15:58:53 +0000 (11:58 -0400)
Placing confirmation dialog for delete icons on contacts and notes.

models/admin/travel/index.php
views/admin/ajax/contacts/list.html
views/admin/ajax/notes/list.html
views/admin/travel/header.html
views/admin/travel/index.html
views/admin/travel/members.html

index 140cb73..bf5a22b 100644 (file)
@@ -382,6 +382,7 @@ class GlmMembersAdmin_travel_index extends GlmDataTravelLeads
             'updating_error'  => $updating_error,
             'inserting'       => $inserting,
             'inserting_error' => $inserting_error,
+            'assetsUrl'       => GLM_MEMBERS_TRAVEL_PLUGIN_URL . 'assets',
         );
 
 
index fe5ecd6..44a2f85 100644 (file)
         </tbody>
     </table>
 </div>
+<script>
+jQuery(function($){
+    $('.tsNote').click(function(){
+        var dataId = $(this).data('id');
+        // Show the edit form
+        $('#edit-log-' + dataId).show();
+        // Hide the tsLog output
+        $('#show-log-' + dataId).hide();
+    });
+    $('.tlDelete').click(function(){
+        return confirm('This will delete this note entry! Are you sure?');
+    });
+});
+</script>
index c1c5255..d7a2e3e 100644 (file)
             <div id="show-log-{$n.id}" class="tsLog">
                 <h2>{$n.updated.datetime}</h2>
                 <p class="tsNote" data-id="{$n.id}">{$n.notes|nl2br}</p>
-                <a class="tlDelete" href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=travelNotes&option=delete&id={$lead_id}&note_id={$n.id}" title="Delete this entry">Delete</a>
+                <a
+                    class="tlDelete"
+                    href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=travelNotes&option=delete&id={$lead_id}&note_id={$n.id}"
+                    title="Delete this entry">Delete</a>
             </div>
             <form action="{$ajaxUrl}">
                 <input type="hidden" name="action" value="glm_members_admin_ajax" />
@@ -38,7 +41,9 @@ jQuery(function($){
         $('#edit-log-' + dataId).show();
         // Hide the tsLog output
         $('#show-log-' + dataId).hide();
-
+    });
+    $('.tlDelete').click(function(){
+        return confirm('This will delete this note entry! Are you sure?');
     });
 });
 </script>
index 22c856e..6905e5b 100644 (file)
@@ -1,3 +1,3 @@
 <div id="wrap">
     <h1>Travel Leads</h1>
-    <div id="glm-admin-content-container" style="max-width: 720px;">
+    <div id="glm-admin-content-container" style="max-width: 950px;">
index bbfb9a1..20d50e5 100644 (file)
@@ -3,6 +3,38 @@
 {include file='admin/travel/searchForm.html'}
 
 {if $lead}
+    {* Download all in PDF Button *}
+    <form action="{$ajaxUrl}">
+        <input type="hidden" name="action" value="glm_members_admin_ajax" />
+        <input type="hidden" name="glm_action" value="leadPdfExport" />
+        {if isset($smarty.request.company)}<input type="hidden" name="company" value="{$smarty.request.company}">{/if}
+        {if isset($smarty.request.contact)}<input type="hidden" name="contact" value="{$smarty.request.contact}">{/if}
+        {if isset($smarty.request.from_date)}<input type="hidden" name="from_date" value="{$smarty.request.from_date}">{/if}
+        {if isset($smarty.request.to_date)}<input type="hidden" name="to_date" value="{$smarty.request.to_date}">{/if}
+        {if $smarty.request.state}
+            {foreach $smarty.request.state as $state}
+                <input type="hidden" name="state[]" value="{$state}">
+            {/foreach}
+        {/if}
+        <input type="submit" value="Download all in PDF file">
+    </form>
+    {* Download all in CSV Button *}
+    <form action="{$ajaxUrl}">
+        <input type="hidden" name="action" value="glm_members_admin_ajax" />
+        <input type="hidden" name="glm_action" value="leadCsvExport" />
+        {if isset($smarty.request.company)}<input type="hidden" name="company" value="{$smarty.request.company}">{/if}
+        {if isset($smarty.request.contact)}<input type="hidden" name="contact" value="{$smarty.request.contact}">{/if}
+        {if isset($smarty.request.from_date)}<input type="hidden" name="from_date" value="{$smarty.request.from_date}">{/if}
+        {if isset($smarty.request.to_date)}<input type="hidden" name="to_date" value="{$smarty.request.to_date}">{/if}
+        {if $smarty.request.state}
+            {foreach $smarty.request.state as $state}
+                <input type="hidden" name="state[]" value="{$state}">
+            {/foreach}
+        {/if}
+        <input type="submit" value="Download all in CSV file">
+    </form>
+
+
     <form action="{$thisUrl}">
         <input type="hidden" name="page" value="{$thisPage}" />
         <input type="hidden" name="glm_action" value="index" />
@@ -28,6 +60,8 @@
                 <th> Last Name </th>
                 <th> Updated </th>
                 <th> Status </th>
+                <th> PDF </th>
+                <th> CSV </th>
             </tr>
         </thead>
         <tbody>
                 <td> {$e.lname} </td>
                 <td> {$e.updated.datetime} </td>
                 <td> <b>{$e.status.name}</b> </td>
+                <td>
+                    <a href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=leadPdfExport&lead_id={$e.id}">
+                        <img src="{$assetsUrl}/pdf.png">
+                    </a>
+                </td>
+                <td>
+                    <a href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=leadCsvExport&lead_id={$e.id}">
+                        <img src="{$assetsUrl}/csv.png">
+                    </a>
+                </td>
             </tr>
             {/foreach}
         </tbody>
index 7e61c65..a09fc07 100644 (file)
@@ -6,6 +6,7 @@
 <div id="travel-admin2">
 {if $lead && $searching}
 
+    {* Download all in PDF Button *}
     <form action="{$ajaxUrl}">
         <input type="hidden" name="action" value="glm_members_admin_ajax" />
         <input type="hidden" name="glm_action" value="leadPdfExport" />
@@ -20,6 +21,7 @@
         {/if}
         <input type="submit" value="Download all in PDF file">
     </form>
+    {* Download all in CSV Button *}
     <form action="{$ajaxUrl}">
         <input type="hidden" name="action" value="glm_members_admin_ajax" />
         <input type="hidden" name="glm_action" value="leadCsvExport" />