PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.7
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.7
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / includes / admin / views / donations-page / export-form.php

export-form.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.7, at includes/admin/views/donations-page/export-form.php

97 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Display the export button in the donation filters box.
4 *
5 * @author WP Charitable LLC
6 * @package Charitable/Admin View/Donations Page
7 * @since 1.0.0
8 * @version 1.6.39
9 */
10
11 /**
12 * Filter the class to use for the modal window.
13 *
14 * @since 1.0.0
15 *
16 * @param string $class The class name.
17 */
18 $modal_class = apply_filters( 'charitable_modal_window_class', 'charitable-modal' );
19
20 $start_date = isset( $_GET['start_date'] ) ? sanitize_text_field( $_GET['start_date'] ) : null;
21 $end_date = isset( $_GET['end_date'] ) ? sanitize_text_field( $_GET['end_date'] ) : null;
22 $post_status = isset( $_GET['post_status'] ) ? $_GET['post_status'] : 'all';
23 $report_type = isset( $_GET['report_type'] ) ? $_GET['report_type'] : 'donations';
24
25 $campaigns = get_posts(
26 array(
27 'post_type' => 'campaign',
28 'post_status' => array( 'draft', 'pending', 'private', 'publish' ),
29 'perm' => 'readable',
30 'posts_per_page' => -1,
31 )
32 );
33
34 /**
35 * Filter the type of exportable report types.
36 *
37 * @since 1.6.0
38 *
39 * @param array $types Types of reports.
40 */
41 $report_types = apply_filters(
42 'charitable_donation_export_report_types',
43 array(
44 'donations' => __( 'Donations', 'charitable' ),
45 )
46 );
47 ?>
48 <div id="charitable-donations-export-modal" style="display: none;" class="charitable-donations-modal <?php echo esc_attr( $modal_class ); ?>" tabindex="0">
49 <a class="modal-close"></a>
50 <h3><?php _e( 'Export Donations', 'charitable' ); ?></h3>
51 <form class="charitable-donations-modal-form charitable-modal-form" method="get" action="<?php echo admin_url( 'admin.php' ); ?>">
52 <?php wp_nonce_field( 'charitable_export_donations', '_charitable_export_nonce' ); ?>
53 <input type="hidden" name="charitable_action" value="export_donations" />
54 <input type="hidden" name="page" value="charitable-donations-table" />
55 <fieldset>
56 <legend><?php _e( 'Filter by Date', 'charitable' ); ?></legend>
57 <input type="text" id="charitable-export-start_date" name="start_date" class="charitable-datepicker" autocomplete="off" value="<?php echo $start_date; ?>" placeholder="<?php esc_attr_e( 'From:', 'charitable' ); ?>" />
58 <input type="text" id="charitable-export-end_date" name="end_date" class="charitable-datepicker" autocomplete="off" value="<?php echo $end_date; ?>" placeholder="<?php esc_attr_e( 'To:', 'charitable' ); ?>" />
59 </fieldset>
60 <label for="charitable-donations-export-status"><?php _e( 'Filter by Status', 'charitable' ); ?></label>
61 <select id="charitable-donations-export-status" name="post_status">
62 <option value="all" <?php selected( $post_status, 'all' ); ?>><?php _e( 'All', 'charitable' ); ?></option>
63 <?php foreach ( charitable_get_valid_donation_statuses() as $key => $status ) : ?>
64 <option value="<?php echo esc_attr( $key ); ?>" <?php selected( $post_status, $key ); ?>><?php echo $status; ?></option>
65 <?php endforeach ?>
66 </select>
67 <label for="charitable-donations-export-campaign"><?php _e( 'Filter by Campaign', 'charitable' ); ?></label>
68 <select id="charitable-donations-export-campaign" name="campaign_id">
69 <option value="all"><?php _e( 'All Campaigns', 'charitable' ); ?></option>
70 <?php
71 foreach ( $campaigns as $campaign ) :
72 ?>
73 <option value="<?php echo $campaign->ID; ?>"><?php echo get_the_title( $campaign->ID ); ?></option>
74 <?php endforeach ?>
75 </select>
76 <?php if ( count( $report_types ) > 1 ) : ?>
77 <label for="charitable-donations-export-report-type"><?php _e( 'Type of Report', 'charitable' ); ?></label>
78 <select id="charitable-donations-export-report-type" name="report_type">
79 <?php foreach ( $report_types as $key => $report_label ) : ?>
80 <option value="<?php echo esc_attr( $key ); ?>"><?php echo $report_label; ?></option>
81 <?php endforeach; ?>
82 </select>
83 <?php else : ?>
84 <input type="hidden" name="report_type" value="<?php echo esc_attr( key( $report_types ) ); ?>" />
85 <?php endif ?>
86 <?php
87 /**
88 * Add additional fields to the end of the donations export form.
89 *
90 * @since 1.4.0
91 */
92 do_action( 'charitable_export_donations_form' );
93 ?>
94 <button name="charitable-export-donations" class="button button-primary"><?php _e( 'Export', 'charitable' ); ?></button>
95 </form>
96 </div>
97