Adding option to the member export for check and uncheck all.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 13 Sep 2017 19:59:37 +0000 (15:59 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 13 Sep 2017 19:59:37 +0000 (15:59 -0400)
This may help clients who want only member name and reporting like click
through and detail reports.

views/admin/members/list.html

index bfb3bd4..10ea1bb 100644 (file)
                     <td>
                         <table padding="3">
                             <tr>
-                                <td>
+                                <td colspan="2"><a id="selectAllExportFields">Check All</a> / <a id="unselectAllExportFields">Uncheck All</a></td>
+                            </tr>
+                            <tr>
+                                <td class="exportFieldsTd">
                                     <input type="checkbox" name="exportId"> {$terms.term_member_cap} ID<br>
                                     <input type="checkbox" name="exportOldId"> Old {$terms.term_member_cap} ID<br>
                                     <input type="checkbox" name="exportMember" checked> {$terms.term_member_cap} Name<br>
                                     <input type="checkbox" name="exportCounty" checked> County <br>
                                     <input type="checkbox" name="exportRegion" checked> Region <br>
                                 </td>
-                                <td>
+                                <td class="exportFieldsTd">
                                     <input type="checkbox" name="exportPhone" checked> Phone #<br>
                                     <input type="checkbox" name="exportTollFree" checked> Toll Free<br>
                                     <input type="checkbox" name="exportEmail" checked> Main E-Mail<br>
     <script type="text/javascript">
         jQuery(document).ready(function($) {
 
-               $('.monthPicker').datepicker( {
-                   changeMonth: true,
-                   changeYear: true,
-                   showButtonPanel: true,
-                   dateFormat: 'MM yy',
-                   onClose: function(dateText, inst) {
-                       var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
-                       var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
-                       $(this).datepicker('setDate', new Date(year, month, 1));
-                   },
-                   beforeShow: function (input, inst) {
-                       var $this = $(this),
-                           // For the simplicity we suppose the dateFormat will be always without the day part, so we
-                           // manually add it since the $.datepicker.parseDate will throw if the date string doesn't contain the day part
-                           dateFormat = 'd ' + $this.datepicker('option', 'dateFormat'),
-                           date;
-
-                       try {
-                           date = $.datepicker.parseDate(dateFormat, '1 ' + $this.val());
-                       } catch (ex) {
-                           return;
-                       }
-
-                       $this.datepicker('option', 'defaultDate', date);
-                       $this.datepicker('setDate', date);
-
-                       inst.dpDiv.addClass('datepicker-month-year');
-                   }
-               });
-
-               $("#exportMembersDialog").dialog({
+            $('#selectAllExportFields').click(function(){
+                $('.exportFieldsTd input[type="checkbox"]').each(function(){
+                    $(this).prop('checked', true);
+                });
+            });
+            $('#unselectAllExportFields').click(function(){
+                $('.exportFieldsTd input[type="checkbox"]').each(function(){
+                    $(this).prop('checked', false);
+                });
+            });
+
+            $('.monthPicker').datepicker( {
+                changeMonth: true,
+                changeYear: true,
+                showButtonPanel: true,
+                dateFormat: 'MM yy',
+                onClose: function(dateText, inst) {
+                    var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
+                    var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
+                    $(this).datepicker('setDate', new Date(year, month, 1));
+                },
+                beforeShow: function (input, inst) {
+                    var $this = $(this),
+                        // For the simplicity we suppose the dateFormat will be always without the day part, so we
+                        // manually add it since the $.datepicker.parseDate will throw if the date string doesn't contain the day part
+                        dateFormat = 'd ' + $this.datepicker('option', 'dateFormat'),
+                        date;
+
+                    try {
+                        date = $.datepicker.parseDate(dateFormat, '1 ' + $this.val());
+                    } catch (ex) {
+                        return;
+                    }
+
+                    $this.datepicker('option', 'defaultDate', date);
+                    $this.datepicker('setDate', date);
+
+                    inst.dpDiv.addClass('datepicker-month-year');
+                }
+            });
+
+            $("#exportMembersDialog").dialog({
                 autoOpen: false,
                 minWidth: 700,
                 dialogClass: "glm-dialog-no-close"