html-admin-page-data.php
8 years ago
html-admin-page-exports.php
8 years ago
html-admin-page-import-core-settings.php
8 years ago
html-admin-page-import-donations.php
8 years ago
html-admin-page-imports.php
8 years ago
html-admin-page-system-info.php
7 years ago
html-admin-page-exports.php
258 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Exports |
| 4 | */ |
| 5 | |
| 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | exit; |
| 8 | } ?> |
| 9 | |
| 10 | <div id="poststuff"> |
| 11 | <div id="give-dashboard-widgets-wrap"> |
| 12 | <div id="post-body"> |
| 13 | <div id="post-body-content"> |
| 14 | |
| 15 | <?php |
| 16 | /** |
| 17 | * Fires before the reports export tab. |
| 18 | * |
| 19 | * @since 1.0 |
| 20 | */ |
| 21 | do_action( 'give_tools_tab_export_content_top' ); |
| 22 | ?> |
| 23 | |
| 24 | <table class="widefat export-options-table give-table striped"> |
| 25 | <thead> |
| 26 | <tr> |
| 27 | <th scope="col"><?php _e( 'Export Type', 'give' ); ?></th> |
| 28 | <th scope="col"><?php _e( 'Export Options', 'give' ); ?></th> |
| 29 | </tr> |
| 30 | </thead> |
| 31 | <tbody> |
| 32 | <?php |
| 33 | /** |
| 34 | * Fires in the reports export tab. |
| 35 | * |
| 36 | * Allows you to add new TR elements to the table before |
| 37 | * other elements. |
| 38 | * |
| 39 | * @since 1.0 |
| 40 | */ |
| 41 | do_action( 'give_tools_tab_export_table_top' ); |
| 42 | ?> |
| 43 | |
| 44 | <tr class="give-export-donations-history"> |
| 45 | <td scope="row" class="row-title"> |
| 46 | <h3> |
| 47 | <span><?php _e( 'Export Donation History', 'give' ); ?></span> |
| 48 | </h3> |
| 49 | <p><?php _e( 'Download a CSV of all donations recorded.', 'give' ); ?></p> |
| 50 | </td> |
| 51 | <td> |
| 52 | <a class="button" |
| 53 | href="<?php echo add_query_arg( array( 'type' => 'export_donations' ) ); ?>"> |
| 54 | <?php _e( 'Generate CSV', 'give' ); ?> |
| 55 | </a> |
| 56 | </td> |
| 57 | </tr> |
| 58 | |
| 59 | <tr class="give-export-pdf-sales-earnings"> |
| 60 | <td scope="row" class="row-title"> |
| 61 | <h3> |
| 62 | <span><?php _e( 'Export PDF of Donations and Income', 'give' ); ?></span> |
| 63 | </h3> |
| 64 | <p><?php _e( 'Download a PDF of Donations and Income reports for all forms for the current year.', 'give' ); ?></p> |
| 65 | </td> |
| 66 | <td> |
| 67 | <a class="button" |
| 68 | href="<?php echo wp_nonce_url( add_query_arg( array( 'give-action' => 'generate_pdf' ) ), 'give_generate_pdf' ); ?>"> |
| 69 | <?php _e( 'Generate PDF', 'give' ); ?> |
| 70 | </a> |
| 71 | </td> |
| 72 | </tr> |
| 73 | <tr class="give-export-sales-earnings"> |
| 74 | <td scope="row" class="row-title"> |
| 75 | <h3> |
| 76 | <span><?php _e( 'Export Income and Donation Stats', 'give' ); ?></span> |
| 77 | </h3> |
| 78 | <p><?php _e( 'Download a CSV of income and donations over time.', 'give' ); ?></p> |
| 79 | </td> |
| 80 | <td> |
| 81 | <form method="post"> |
| 82 | <?php |
| 83 | printf( |
| 84 | /* translators: 1: start date dropdown 2: end date dropdown */ |
| 85 | esc_html__( '%1$s to %2$s', 'give' ), |
| 86 | Give()->html->year_dropdown( 'start_year' ) . ' ' . Give()->html->month_dropdown( 'start_month' ), |
| 87 | Give()->html->year_dropdown( 'end_year' ) . ' ' . Give()->html->month_dropdown( 'end_month' ) |
| 88 | ); |
| 89 | ?> |
| 90 | <input type="hidden" name="give-action" |
| 91 | value="earnings_export"/> |
| 92 | <input type="submit" |
| 93 | value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" |
| 94 | class="button-secondary"/> |
| 95 | </form> |
| 96 | </td> |
| 97 | </tr> |
| 98 | |
| 99 | <tr class="give-export-donors"> |
| 100 | <td scope="row" class="row-title"> |
| 101 | <h3> |
| 102 | <span><?php _e( 'Export Donors', 'give' ); ?></span> |
| 103 | </h3> |
| 104 | <p><?php _e( 'Download a CSV of donors. Column values reflect totals across all donation forms by default, or a single donation form if selected.', 'give' ); ?></p> |
| 105 | </td> |
| 106 | <td> |
| 107 | <form method="post" id="give_donor_export" class="give-export-form"> |
| 108 | <?php |
| 109 | // Start Date form field for donors |
| 110 | echo Give()->html->date_field( array( |
| 111 | 'id' => 'give_donor_export_start_date', |
| 112 | 'name' => 'donor_export_start_date', |
| 113 | 'placeholder' => esc_attr__( 'Start date', 'give' ), |
| 114 | ) ); |
| 115 | |
| 116 | // End Date form field for donors |
| 117 | echo Give()->html->date_field( array( |
| 118 | 'id' => 'give_donor_export_end_date', |
| 119 | 'name' => 'donor_export_end_date', |
| 120 | 'placeholder' => esc_attr__( 'End date', 'give' ), |
| 121 | ) ); |
| 122 | |
| 123 | // Donation forms dropdown for donors export |
| 124 | echo Give()->html->forms_dropdown( array( |
| 125 | 'name' => 'forms', |
| 126 | 'id' => 'give_donor_export_form', |
| 127 | 'chosen' => true, |
| 128 | ) ); |
| 129 | ?> |
| 130 | <input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" |
| 131 | class="button-secondary"/> |
| 132 | |
| 133 | <div id="export-donor-options-wrap" |
| 134 | class="give-clearfix"> |
| 135 | <p><?php _e( 'Export Columns:', 'give' ); ?></p> |
| 136 | <ul id="give-export-option-ul"> |
| 137 | <li> |
| 138 | <label for="give-export-fullname"> |
| 139 | <input type="checkbox" checked |
| 140 | name="give_export_option[full_name]" |
| 141 | id="give-export-fullname"><?php _e( 'Name', 'give' ); ?> |
| 142 | </label> |
| 143 | </li> |
| 144 | <li> |
| 145 | <label for="give-export-email"> |
| 146 | <input type="checkbox" checked |
| 147 | name="give_export_option[email]" |
| 148 | id="give-export-email"><?php _e( 'Email', 'give' ); ?> |
| 149 | </label> |
| 150 | </li> |
| 151 | <li> |
| 152 | <label for="give-export-address"> |
| 153 | <input type="checkbox" checked |
| 154 | name="give_export_option[address]" |
| 155 | id="give-export-address"><?php _e( 'Address', 'give' ); ?> |
| 156 | </label> |
| 157 | </li> |
| 158 | <li> |
| 159 | <label for="give-export-userid"> |
| 160 | <input type="checkbox" checked |
| 161 | name="give_export_option[userid]" |
| 162 | id="give-export-userid"><?php _e( 'User ID', 'give' ); ?> |
| 163 | </label> |
| 164 | </li> |
| 165 | <li> |
| 166 | <label for="give-export-first-donation-date"> |
| 167 | <input type="checkbox" checked |
| 168 | name="give_export_option[donor_created_date]" |
| 169 | id="give-export-first-donation-date"><?php _e( 'Donor Created Date', 'give' ); ?> |
| 170 | </label> |
| 171 | </li> |
| 172 | <li> |
| 173 | <label for="give-export-donation-number"> |
| 174 | <input type="checkbox" checked |
| 175 | name="give_export_option[donations]" |
| 176 | id="give-export-donation-number"><?php _e( 'Number of Donations', 'give' ); ?> |
| 177 | </label> |
| 178 | </li> |
| 179 | <li> |
| 180 | <label for="give-export-donation-sum"> |
| 181 | <input type="checkbox" checked |
| 182 | name="give_export_option[donation_sum]" |
| 183 | id="give-export-donation-sum"><?php _e( 'Total Donated', 'give' ); ?> |
| 184 | </label> |
| 185 | </li> |
| 186 | </ul> |
| 187 | </div> |
| 188 | <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
| 189 | <input type="hidden" name="give-export-class" value="Give_Batch_Donors_Export"/> |
| 190 | <input type="hidden" name="give_export_option[query_id]" |
| 191 | value="<?php echo uniqid( 'give_' ); ?>"/> |
| 192 | </form> |
| 193 | </td> |
| 194 | </tr> |
| 195 | |
| 196 | <tr class="give-export-core-settings"> |
| 197 | <td scope="row" class="row-title"> |
| 198 | <h3> |
| 199 | <span><?php _e( 'Export Give Settings', 'give' ); ?></span> |
| 200 | </h3> |
| 201 | <p><?php _e( 'Download an export of Give\'s settings and import it in a new WordPress installation.', 'give' ); ?></p> |
| 202 | </td> |
| 203 | <td> |
| 204 | <form method="post"> |
| 205 | <?php |
| 206 | $export_excludes = apply_filters( 'settings_export_excludes', array() ); |
| 207 | if ( ! empty( $export_excludes ) ) { |
| 208 | ?> |
| 209 | <i class="settings-excludes-title"><?php echo __( 'Checked options from the list will not be exported.', 'give' ); ?></i> |
| 210 | <ul class="settings-excludes-list"> |
| 211 | <?php foreach ( $export_excludes as $option_key => $option_label ) { ?> |
| 212 | <li> |
| 213 | <label for="settings_export_excludes[<?php echo $option_key ?>]"> |
| 214 | <input |
| 215 | type="checkbox" checked |
| 216 | name="settings_export_excludes[<?php echo $option_key ?>]" |
| 217 | id="settings_export_excludes[<?php echo $option_key ?>]"><?php echo esc_html( $option_label ); ?> |
| 218 | </label> |
| 219 | </li> |
| 220 | <?php } ?> |
| 221 | </ul> |
| 222 | <?php } ?> |
| 223 | <input type="hidden" name="give-action" value="core_settings_export"/> |
| 224 | <input type="submit" value="<?php esc_attr_e( 'Export JSON', 'give' ); ?>" |
| 225 | class="button-secondary"/> |
| 226 | </form> |
| 227 | </td> |
| 228 | </tr> |
| 229 | <?php |
| 230 | /** |
| 231 | * Fires in the reports export tab. |
| 232 | * |
| 233 | * Allows you to add new TR elements to the table after |
| 234 | * other elements. |
| 235 | * |
| 236 | * @since 1.0 |
| 237 | */ |
| 238 | do_action( 'give_tools_tab_export_table_bottom' ); |
| 239 | ?> |
| 240 | </tbody> |
| 241 | </table> |
| 242 | |
| 243 | <?php |
| 244 | /** |
| 245 | * Fires after the reports export tab. |
| 246 | * |
| 247 | * @since 1.0 |
| 248 | */ |
| 249 | do_action( 'give_tools_tab_export_content_bottom' ); |
| 250 | ?> |
| 251 | |
| 252 | </div> |
| 253 | <!-- .post-body-content --> |
| 254 | </div> |
| 255 | <!-- .post-body --> |
| 256 | </div><!-- #give-dashboard-widgets-wrap --> |
| 257 | </div><!-- #poststuff --> |
| 258 |