ravinderk /
Give
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * View Donation Details |
||
| 4 | * |
||
| 5 | * @package Give |
||
| 6 | * @subpackage Admin/Payments |
||
| 7 | * @copyright Copyright (c) 2016, WordImpress |
||
| 8 | * @license https://opensource.org/licenses/gpl-license GNU Public License |
||
| 9 | * @since 1.0 |
||
| 10 | */ |
||
| 11 | |||
| 12 | // Exit if accessed directly. |
||
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
||
| 14 | exit; |
||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * View Order Details Page |
||
| 19 | * |
||
| 20 | * @since 1.0 |
||
| 21 | * @return void |
||
| 22 | */ |
||
| 23 | if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
||
| 24 | wp_die( esc_html__( 'Donation ID not supplied. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
||
| 25 | } |
||
| 26 | |||
| 27 | // Setup the variables |
||
| 28 | $payment_id = absint( $_GET['id'] ); |
||
| 29 | $payment = new Give_Payment( $payment_id ); |
||
| 30 | |||
| 31 | // Sanity check... fail if donation ID is invalid |
||
| 32 | $payment_exists = $payment->ID; |
||
| 33 | if ( empty( $payment_exists ) ) { |
||
| 34 | wp_die( esc_html__( 'The specified ID does not belong to a donation. Please try again.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 400 ) ); |
||
| 35 | } |
||
| 36 | |||
| 37 | $number = $payment->number; |
||
| 38 | $payment_meta = $payment->get_meta(); |
||
| 39 | $transaction_id = esc_attr( $payment->transaction_id ); |
||
| 40 | $user_id = $payment->user_id; |
||
| 41 | $customer_id = $payment->customer_id; |
||
| 42 | $payment_date = strtotime( $payment->date ); |
||
| 43 | $user_info = give_get_payment_meta_user_info( $payment_id ); |
||
| 44 | $address = $payment->address; |
||
|
0 ignored issues
–
show
|
|||
| 45 | $currency_code = $payment->currency; |
||
| 46 | $gateway = $payment->gateway; |
||
| 47 | $currency_code = $payment->currency; |
||
| 48 | $payment_mode = $payment->mode; |
||
| 49 | ?> |
||
| 50 | <div class="wrap give-wrap"> |
||
| 51 | |||
| 52 | <h1 id="transaction-details-heading"><?php |
||
| 53 | printf( |
||
| 54 | /* translators: %s: donation number */ |
||
| 55 | esc_html__( 'Donation %s', 'give' ), |
||
| 56 | $number |
||
| 57 | ); |
||
| 58 | if ( $payment_mode == 'test' ) { |
||
| 59 | echo '<span id="test-payment-label" class="give-item-label give-item-label-orange" data-tooltip="' . esc_attr__( 'This donation was made in test mode.', 'give' ) . '" data-tooltip-my-position="center left" data-tooltip-target-position="center right">' . esc_html__( 'Test Donation', 'give' ) . '</span>'; |
||
| 60 | } |
||
| 61 | ?></h1> |
||
| 62 | |||
| 63 | <?php |
||
| 64 | /** |
||
| 65 | * Fires in order details page, before the order form. |
||
| 66 | * |
||
| 67 | * @since 1.0 |
||
| 68 | * |
||
| 69 | * @param int $payment_id Payment id. |
||
| 70 | */ |
||
| 71 | do_action( 'give_view_order_details_before', $payment_id ); |
||
| 72 | ?> |
||
| 73 | <form id="give-edit-order-form" method="post"> |
||
| 74 | <?php |
||
| 75 | /** |
||
| 76 | * Fires in order details page, in the form before the order details. |
||
| 77 | * |
||
| 78 | * @since 1.0 |
||
| 79 | * |
||
| 80 | * @param int $payment_id Payment id. |
||
| 81 | */ |
||
| 82 | do_action( 'give_view_order_details_form_top', $payment_id ); |
||
| 83 | ?> |
||
| 84 | <div id="poststuff"> |
||
| 85 | <div id="give-dashboard-widgets-wrap"> |
||
| 86 | <div id="post-body" class="metabox-holder columns-2"> |
||
| 87 | <div id="postbox-container-1" class="postbox-container"> |
||
| 88 | <div id="side-sortables" class="meta-box-sortables ui-sortable"> |
||
| 89 | |||
| 90 | <?php |
||
| 91 | /** |
||
| 92 | * Fires in order details page, before the sidebar. |
||
| 93 | * |
||
| 94 | * @since 1.0 |
||
| 95 | * |
||
| 96 | * @param int $payment_id Payment id. |
||
| 97 | */ |
||
| 98 | do_action( 'give_view_order_details_sidebar_before', $payment_id ); |
||
| 99 | ?> |
||
| 100 | |||
| 101 | <div id="give-order-update" class="postbox give-order-data"> |
||
| 102 | |||
| 103 | <h3 class="hndle"><?php esc_html_e( 'Update Donation', 'give' ); ?></h3> |
||
| 104 | |||
| 105 | <div class="inside"> |
||
| 106 | <div class="give-admin-box"> |
||
| 107 | |||
| 108 | <?php |
||
| 109 | /** |
||
| 110 | * Fires in order details page, before the sidebar update-payment metabox. |
||
| 111 | * |
||
| 112 | * @since 1.0 |
||
| 113 | * |
||
| 114 | * @param int $payment_id Payment id. |
||
| 115 | */ |
||
| 116 | do_action( 'give_view_order_details_totals_before', $payment_id ); |
||
| 117 | ?> |
||
| 118 | |||
| 119 | <div class="give-admin-box-inside"> |
||
| 120 | <p> |
||
| 121 | <label for="give-payment-status" class="strong"><?php esc_html_e( 'Status:', 'give' ); ?></label> |
||
| 122 | <select id="give-payment-status" name="give-payment-status" class="medium-text"> |
||
| 123 | <?php foreach ( give_get_payment_statuses() as $key => $status ) : ?> |
||
| 124 | <option value="<?php echo esc_attr( $key ); ?>"<?php selected( $payment->status, $key, true ); ?>><?php echo esc_html( $status ); ?></option> |
||
| 125 | <?php endforeach; ?> |
||
| 126 | </select> |
||
| 127 | <span class="give-donation-status status-<?php echo sanitize_title( $payment->status ); ?>"><span class="give-donation-status-icon"></span></span> |
||
| 128 | </p> |
||
| 129 | </div> |
||
| 130 | |||
| 131 | <div class="give-admin-box-inside"> |
||
| 132 | <p> |
||
| 133 | <label for="give-payment-date" class="strong"><?php esc_html_e( 'Date:', 'give' ); ?></label> |
||
| 134 | <input type="text" id="give-payment-date" name="give-payment-date" value="<?php echo esc_attr( date( 'm/d/Y', $payment_date ) ); ?>" class="medium-text give_datepicker"/> |
||
| 135 | </p> |
||
| 136 | </div> |
||
| 137 | |||
| 138 | <div class="give-admin-box-inside"> |
||
| 139 | <p> |
||
| 140 | <label for="give-payment-time-hour" class="strong"><?php esc_html_e( 'Time:', 'give' ); ?></label> |
||
| 141 | <input type="number" step="1" max="24" id="give-payment-time-hour" name="give-payment-time-hour" value="<?php echo esc_attr( date_i18n( 'H', $payment_date ) ); ?>" class="small-text give-payment-time-hour"/> : |
||
| 142 | <input type="number" step="1" max="59" id="give-payment-time-min" name="give-payment-time-min" value="<?php echo esc_attr( date( 'i', $payment_date ) ); ?>" class="small-text give-payment-time-min"/> |
||
| 143 | </p> |
||
| 144 | </div> |
||
| 145 | |||
| 146 | <?php |
||
| 147 | /** |
||
| 148 | * Fires in order details page, in the sidebar update-payment metabox. |
||
| 149 | * |
||
| 150 | * Allows you to add new inner items. |
||
| 151 | * |
||
| 152 | * @since 1.0 |
||
| 153 | * |
||
| 154 | * @param int $payment_id Payment id. |
||
| 155 | */ |
||
| 156 | do_action( 'give_view_order_details_update_inner', $payment_id ); |
||
| 157 | |||
| 158 | // @TODO: Fees |
||
| 159 | $fees = give_get_payment_fees( $payment_id ); |
||
| 160 | if ( ! empty( $fees ) ) : ?> |
||
| 161 | <div class="give-order-fees give-admin-box-inside"> |
||
| 162 | <p class="strong"><?php esc_html_e( 'Fees:', 'give' ); ?></p> |
||
| 163 | <ul class="give-payment-fees"> |
||
| 164 | <?php foreach ( $fees as $fee ) : ?> |
||
| 165 | <li> |
||
| 166 | <span class="fee-label"><?php echo $fee['label']; ?>:</span> |
||
| 167 | <span class="fee-amount" data-fee="<?php echo esc_attr( $fee['amount'] ); ?>"><?php echo give_currency_filter( $fee['amount'], $currency_code ); ?></span> |
||
| 168 | </li> |
||
| 169 | <?php endforeach; ?> |
||
| 170 | </ul> |
||
| 171 | </div> |
||
| 172 | <?php endif; ?> |
||
| 173 | |||
| 174 | <div class="give-order-payment give-admin-box-inside"> |
||
| 175 | <p> |
||
| 176 | <label for="give-payment-total" class="strong"><?php esc_html_e( 'Total Donation:', 'give' ); ?></label> |
||
| 177 | <?php echo give_currency_symbol( $payment->currency ); ?> |
||
| 178 | <input id="give-payment-total" name="give-payment-total" type="text" class="small-text give-price-field" value="<?php echo esc_attr( give_format_decimal( give_get_payment_amount( $payment_id ) ) ); ?>"/> |
||
| 179 | </p> |
||
| 180 | </div> |
||
| 181 | |||
| 182 | <?php |
||
| 183 | /** |
||
| 184 | * Fires in order details page, after the sidebar update-donation metabox. |
||
| 185 | * |
||
| 186 | * @since 1.0 |
||
| 187 | * |
||
| 188 | * @param int $payment_id Payment id. |
||
| 189 | */ |
||
| 190 | do_action( 'give_view_order_details_totals_after', $payment_id ); |
||
| 191 | ?> |
||
| 192 | |||
| 193 | </div> |
||
| 194 | <!-- /.give-admin-box --> |
||
| 195 | |||
| 196 | </div> |
||
| 197 | <!-- /.inside --> |
||
| 198 | |||
| 199 | <div class="give-order-update-box give-admin-box"> |
||
| 200 | <?php |
||
| 201 | /** |
||
| 202 | * Fires in order details page, before the sidebar update-peyment metabox actions buttons. |
||
| 203 | * |
||
| 204 | * @since 1.0 |
||
| 205 | * |
||
| 206 | * @param int $payment_id Payment id. |
||
| 207 | */ |
||
| 208 | do_action( 'give_view_order_details_update_before', $payment_id ); |
||
| 209 | ?> |
||
| 210 | |||
| 211 | <div id="major-publishing-actions"> |
||
| 212 | <div id="publishing-action"> |
||
| 213 | <input type="submit" class="button button-primary right" value="<?php esc_attr_e( 'Save Donation', 'give' ); ?>"/> |
||
| 214 | <?php if ( give_is_payment_complete( $payment_id ) ) : ?> |
||
| 215 | <a href="<?php echo esc_url( add_query_arg( array( |
||
| 216 | 'give-action' => 'email_links', |
||
| 217 | 'purchase_id' => $payment_id, |
||
| 218 | ) ) ); ?>" id="give-resend-receipt" class="button-secondary right"><?php esc_html_e( 'Resend Receipt', 'give' ); ?></a> |
||
| 219 | <?php endif; ?> |
||
| 220 | </div> |
||
| 221 | <div class="clear"></div> |
||
| 222 | </div> |
||
| 223 | |||
| 224 | <?php |
||
| 225 | /** |
||
| 226 | * Fires in order details page, after the sidebar update-peyment metabox actions buttons. |
||
| 227 | * |
||
| 228 | * @since 1.0 |
||
| 229 | * |
||
| 230 | * @param int $payment_id Payment id. |
||
| 231 | */ |
||
| 232 | do_action( 'give_view_order_details_update_after', $payment_id ); |
||
| 233 | ?> |
||
| 234 | |||
| 235 | </div> |
||
| 236 | <!-- /.give-order-update-box --> |
||
| 237 | |||
| 238 | </div> |
||
| 239 | <!-- /#give-order-data --> |
||
| 240 | |||
| 241 | <div id="give-order-details" class="postbox give-order-data"> |
||
| 242 | |||
| 243 | <h3 class="hndle"><?php esc_html_e( 'Donation Meta', 'give' ); ?></h3> |
||
| 244 | |||
| 245 | <div class="inside"> |
||
| 246 | <div class="give-admin-box"> |
||
| 247 | |||
| 248 | <?php |
||
| 249 | /** |
||
| 250 | * Fires in order details page, before the donation-meta metabox. |
||
| 251 | * |
||
| 252 | * @since 1.0 |
||
| 253 | * |
||
| 254 | * @param int $payment_id Payment id. |
||
| 255 | */ |
||
| 256 | do_action( 'give_view_order_details_payment_meta_before', $payment_id ); |
||
| 257 | |||
| 258 | $gateway = give_get_payment_gateway( $payment_id ); |
||
| 259 | if ( $gateway ) : ?> |
||
| 260 | <div class="give-order-gateway give-admin-box-inside"> |
||
| 261 | <p> |
||
| 262 | <strong><?php esc_html_e( 'Gateway:', 'give' ); ?></strong> |
||
| 263 | <?php echo give_get_gateway_admin_label( $gateway ); ?> |
||
| 264 | </p> |
||
| 265 | </div> |
||
| 266 | <?php endif; ?> |
||
| 267 | |||
| 268 | <div class="give-order-payment-key give-admin-box-inside"> |
||
| 269 | <p> |
||
| 270 | <strong><?php esc_html_e( 'Key:', 'give' ); ?></strong> |
||
| 271 | <?php echo give_get_payment_key( $payment_id ); ?> |
||
| 272 | </p> |
||
| 273 | </div> |
||
| 274 | |||
| 275 | <div class="give-order-ip give-admin-box-inside"> |
||
| 276 | <p> |
||
| 277 | <strong><?php esc_html_e( 'IP:', 'give' ); ?></strong> |
||
| 278 | <?php echo esc_html( give_get_payment_user_ip( $payment_id ) ); ?> |
||
| 279 | </p> |
||
| 280 | </div> |
||
| 281 | |||
| 282 | <?php if ( $transaction_id ) : ?> |
||
| 283 | <div class="give-order-tx-id give-admin-box-inside"> |
||
| 284 | <p> |
||
| 285 | <strong><?php esc_html_e( 'Donation ID:', 'give' ); ?></strong> |
||
| 286 | <?php echo apply_filters( "give_payment_details_transaction_id-{$gateway}", $transaction_id, $payment_id ); ?> |
||
| 287 | </p> |
||
| 288 | </div> |
||
| 289 | <?php endif; ?> |
||
| 290 | |||
| 291 | <div class="give-admin-box-inside"> |
||
| 292 | <p><?php $purchase_url = admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( esc_attr( give_get_payment_user_email( $payment_id ) ) ) ); ?> |
||
| 293 | <a href="<?php echo $purchase_url; ?>"><?php esc_html_e( 'View all donations for this donor »', 'give' ); ?></a> |
||
| 294 | </p> |
||
| 295 | </div> |
||
| 296 | |||
| 297 | <?php |
||
| 298 | /** |
||
| 299 | * Fires in order details page, after the donation-meta metabox. |
||
| 300 | * |
||
| 301 | * @since 1.0 |
||
| 302 | * |
||
| 303 | * @param int $payment_id Payment id. |
||
| 304 | */ |
||
| 305 | do_action( 'give_view_order_details_payment_meta_after', $payment_id ); |
||
| 306 | ?> |
||
| 307 | |||
| 308 | </div> |
||
| 309 | <!-- /.column-container --> |
||
| 310 | |||
| 311 | </div> |
||
| 312 | <!-- /.inside --> |
||
| 313 | |||
| 314 | </div> |
||
| 315 | <!-- /#give-order-data --> |
||
| 316 | |||
| 317 | <?php |
||
| 318 | /** |
||
| 319 | * Fires in order details page, after the sidebar. |
||
| 320 | * |
||
| 321 | * @since 1.0 |
||
| 322 | * |
||
| 323 | * @param int $payment_id Payment id. |
||
| 324 | */ |
||
| 325 | do_action( 'give_view_order_details_sidebar_after', $payment_id ); |
||
| 326 | ?> |
||
| 327 | |||
| 328 | </div> |
||
| 329 | <!-- /#side-sortables --> |
||
| 330 | </div> |
||
| 331 | <!-- /#postbox-container-1 --> |
||
| 332 | |||
| 333 | <div id="postbox-container-2" class="postbox-container"> |
||
| 334 | |||
| 335 | <div id="normal-sortables" class="meta-box-sortables ui-sortable"> |
||
| 336 | |||
| 337 | <?php |
||
| 338 | /** |
||
| 339 | * Fires in order details page, before the main area. |
||
| 340 | * |
||
| 341 | * @since 1.0 |
||
| 342 | * |
||
| 343 | * @param int $payment_id Payment id. |
||
| 344 | */ |
||
| 345 | do_action( 'give_view_order_details_main_before', $payment_id ); |
||
| 346 | ?> |
||
| 347 | |||
| 348 | <?php $column_count = 'columns-3'; ?> |
||
| 349 | <div id="give-donation-overview" class="postbox <?php echo $column_count; ?>"> |
||
| 350 | <h3 class="hndle"><?php esc_html_e( 'Donation Information', 'give' ); ?></h3> |
||
| 351 | |||
| 352 | <div class="inside"> |
||
| 353 | |||
| 354 | <div class="column-container"> |
||
| 355 | <div class="column"> |
||
| 356 | <p> |
||
| 357 | <strong><?php esc_html_e( 'Donation Form ID:', 'give' ); ?></strong><br> |
||
| 358 | <?php |
||
| 359 | if ( $payment_meta['form_id'] ) : |
||
| 360 | printf( |
||
| 361 | '<a href="%1$s" target="_blank">#%2$s</a>', |
||
| 362 | admin_url( 'post.php?action=edit&post=' . $payment_meta['form_id'] ), |
||
| 363 | $payment_meta['form_id'] |
||
| 364 | ); |
||
| 365 | endif; |
||
| 366 | ?> |
||
| 367 | </p> |
||
| 368 | <p> |
||
| 369 | <strong><?php esc_html_e( 'Donation Form Title:', 'give' ); ?></strong><br> |
||
| 370 | <?php give_get_form_dropdown( array( |
||
| 371 | 'id' => $payment_meta['form_id'], |
||
| 372 | 'selected' => $payment_meta['form_id'], |
||
| 373 | 'chosen' => true, |
||
| 374 | ), true ); ?> |
||
| 375 | </p> |
||
| 376 | </div> |
||
| 377 | <div class="column"> |
||
| 378 | <p> |
||
| 379 | <strong><?php esc_html_e( 'Donation Date:', 'give' ); ?></strong><br> |
||
| 380 | <?php echo date_i18n( give_date_format(), $payment_date ); ?> |
||
| 381 | </p> |
||
| 382 | <p> |
||
| 383 | <strong><?php esc_html_e( 'Donation Level:', 'give' ); ?></strong><br> |
||
| 384 | <span class="give-donation-level"> |
||
| 385 | <?php |
||
| 386 | $var_prices = give_has_variable_prices( $payment_meta['form_id'] ); |
||
| 387 | if ( empty( $var_prices ) ) { |
||
| 388 | esc_html_e( 'n/a', 'give' ); |
||
| 389 | } else { |
||
| 390 | $prices_atts = ''; |
||
| 391 | if( $variable_prices = give_get_variable_prices( $payment_meta['form_id'] ) ) { |
||
| 392 | foreach ( $variable_prices as $variable_price ) { |
||
| 393 | $prices_atts[$variable_price['_give_id']['level_id']] = give_format_amount( $variable_price['_give_amount'] ); |
||
| 394 | } |
||
| 395 | } |
||
| 396 | // Variable price dropdown options. |
||
| 397 | $variable_price_dropdown_option = array( |
||
| 398 | 'id' => $payment_meta['form_id'], |
||
| 399 | 'name' => 'give-variable-price', |
||
| 400 | 'chosen' => true, |
||
| 401 | 'show_option_all' => '', |
||
| 402 | 'show_option_none' => '', |
||
| 403 | 'select_atts' => 'data-prices=' . esc_attr( json_encode( $prices_atts ) ), |
||
| 404 | 'selected' => $payment_meta['price_id'], |
||
| 405 | ); |
||
| 406 | // Render variable prices select tag html. |
||
| 407 | give_get_form_variable_price_dropdown( $variable_price_dropdown_option, true ); |
||
| 408 | } |
||
| 409 | ?> |
||
| 410 | </span> |
||
| 411 | </p> |
||
| 412 | </div> |
||
| 413 | <div class="column"> |
||
| 414 | <p> |
||
| 415 | <strong><?php esc_html_e( 'Total Donation:', 'give' ); ?></strong><br> |
||
| 416 | <?php echo esc_html( give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) ) ); ?> |
||
| 417 | </p> |
||
| 418 | <p> |
||
| 419 | <?php |
||
| 420 | /** |
||
| 421 | * Fires in order details page, in the donation-information metabox, before the head elements. |
||
| 422 | * |
||
| 423 | * Allows you to add new TH elements at the beginning. |
||
| 424 | * |
||
| 425 | * @since 1.0 |
||
| 426 | * |
||
| 427 | * @param int $payment_id Payment id. |
||
| 428 | */ |
||
| 429 | do_action( 'give_donation_details_thead_before', $payment_id ); |
||
| 430 | |||
| 431 | |||
| 432 | /** |
||
| 433 | * Fires in order details page, in the donation-information metabox, after the head elements. |
||
| 434 | * |
||
| 435 | * Allows you to add new TH elements at the end. |
||
| 436 | * |
||
| 437 | * @since 1.0 |
||
| 438 | * |
||
| 439 | * @param int $payment_id Payment id. |
||
| 440 | */ |
||
| 441 | do_action( 'give_donation_details_thead_after', $payment_id ); |
||
| 442 | |||
| 443 | /** |
||
| 444 | * Fires in order details page, in the donation-information metabox, before the body elements. |
||
| 445 | * |
||
| 446 | * Allows you to add new TD elements at the beginning. |
||
| 447 | * |
||
| 448 | * @since 1.0 |
||
| 449 | * |
||
| 450 | * @param int $payment_id Payment id. |
||
| 451 | */ |
||
| 452 | do_action( 'give_donation_details_tbody_before', $payment_id ); |
||
| 453 | |||
| 454 | /** |
||
| 455 | * Fires in order details page, in the donation-information metabox, after the body elements. |
||
| 456 | * |
||
| 457 | * Allows you to add new TD elements at the end. |
||
| 458 | * |
||
| 459 | * @since 1.0 |
||
| 460 | * |
||
| 461 | * @param int $payment_id Payment id. |
||
| 462 | */ |
||
| 463 | do_action( 'give_donation_details_tbody_after', $payment_id ); |
||
| 464 | ?> |
||
| 465 | </p> |
||
| 466 | </div> |
||
| 467 | </div> |
||
| 468 | |||
| 469 | </div> |
||
| 470 | <!-- /.inside --> |
||
| 471 | |||
| 472 | </div> |
||
| 473 | <!-- /#give-donation-overview --> |
||
| 474 | |||
| 475 | <?php |
||
| 476 | /** |
||
| 477 | * Fires in order details page, after the files metabox. |
||
| 478 | * |
||
| 479 | * @since 1.0 |
||
| 480 | * |
||
| 481 | * @param int $payment_id Payment id. |
||
| 482 | */ |
||
| 483 | do_action( 'give_view_order_details_files_after', $payment_id ); |
||
| 484 | ?> |
||
| 485 | |||
| 486 | <div id="give-donor-details" class="postbox"> |
||
| 487 | <h3 class="hndle"><?php esc_html_e( 'Donor Details', 'give' ); ?></h3> |
||
| 488 | |||
| 489 | <div class="inside"> |
||
| 490 | |||
| 491 | <?php $customer = new Give_Customer( $customer_id ); ?> |
||
| 492 | |||
| 493 | <div class="column-container customer-info"> |
||
| 494 | <div class="column"> |
||
| 495 | <p> |
||
| 496 | <strong><?php esc_html_e( 'Donor ID:', 'give' ); ?></strong><br> |
||
| 497 | <?php |
||
| 498 | if ( ! empty( $customer->id ) ) { |
||
| 499 | printf( |
||
| 500 | '<a href="%1$s" target="_blank">#%2$s</a>', |
||
| 501 | admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer->id ), |
||
| 502 | $customer->id |
||
| 503 | ); |
||
| 504 | } |
||
| 505 | ?> |
||
| 506 | </p> |
||
| 507 | <p> |
||
| 508 | <strong><?php esc_html_e( 'Donor Since:', 'give' ); ?></strong><br> |
||
| 509 | <?php echo date_i18n( give_date_format(), strtotime( $customer->date_created ) ) ?> |
||
| 510 | </p> |
||
| 511 | </div> |
||
| 512 | <div class="column"> |
||
| 513 | <p> |
||
| 514 | <strong><?php esc_html_e( 'Donor Name:', 'give' ); ?></strong><br> |
||
| 515 | <?php echo $customer->name; ?> |
||
| 516 | </p> |
||
| 517 | <p> |
||
| 518 | <strong><?php esc_html_e( 'Donor Email:', 'give' ); ?></strong><br> |
||
| 519 | <?php echo $customer->email; ?> |
||
| 520 | </p> |
||
| 521 | </div> |
||
| 522 | <div class="column"> |
||
| 523 | <p> |
||
| 524 | <strong><?php esc_html_e( 'Change Donor:', 'give' ); ?></strong><br> |
||
| 525 | <?php |
||
| 526 | echo Give()->html->donor_dropdown( array( |
||
| 527 | 'selected' => $customer->id, |
||
| 528 | 'name' => 'customer-id', |
||
| 529 | ) ); |
||
| 530 | ?> |
||
| 531 | </p> |
||
| 532 | <p> |
||
| 533 | <a href="#new" class="give-payment-new-customer"><?php esc_html_e( 'Create New Donor', 'give' ); ?></a> |
||
| 534 | </p> |
||
| 535 | </div> |
||
| 536 | </div> |
||
| 537 | |||
| 538 | <div class="column-container new-customer" style="display: none"> |
||
| 539 | <div class="column"> |
||
| 540 | <p> |
||
| 541 | <label for="give-new-customer-name"><?php esc_html_e( 'New Donor Name:', 'give' ); ?></label> |
||
| 542 | <input id="give-new-customer-name" type="text" name="give-new-customer-name" value="" class="medium-text"/> |
||
| 543 | </p> |
||
| 544 | </div> |
||
| 545 | <div class="column"> |
||
| 546 | <p> |
||
| 547 | <label for="give-new-customer-email"><?php esc_html_e( 'New Donor Email:', 'give' ); ?></label> |
||
| 548 | <input id="give-new-customer-email" type="email" name="give-new-customer-email" value="" class="medium-text"/> |
||
| 549 | </p> |
||
| 550 | </div> |
||
| 551 | <div class="column"> |
||
| 552 | <p> |
||
| 553 | <input type="hidden" name="give-current-customer" value="<?php echo $customer->id; ?>"/> |
||
| 554 | <input type="hidden" id="give-new-customer" name="give-new-customer" value="0"/> |
||
| 555 | <a href="#cancel" class="give-payment-new-customer-cancel give-delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
||
| 556 | <br> |
||
| 557 | <em><?php esc_html_e( 'Click "Save Donation" to create new donor.', 'give' ); ?></em> |
||
| 558 | </p> |
||
| 559 | </div> |
||
| 560 | </div> |
||
| 561 | |||
| 562 | <?php |
||
| 563 | /** |
||
| 564 | * Fires in order details page, in the donor-details metabox. |
||
| 565 | * |
||
| 566 | * The hook is left here for backwards compatibility. |
||
| 567 | * |
||
| 568 | * @since 1.7 |
||
| 569 | * |
||
| 570 | * @param array $payment_meta Payment meta. |
||
| 571 | * @param array $user_info User information. |
||
| 572 | */ |
||
| 573 | do_action( 'give_payment_personal_details_list', $payment_meta, $user_info ); |
||
| 574 | |||
| 575 | /** |
||
| 576 | * Fires in order details page, in the donor-details metabox. |
||
| 577 | * |
||
| 578 | * @since 1.7 |
||
| 579 | * |
||
| 580 | * @param int $payment_id Payment id. |
||
| 581 | */ |
||
| 582 | do_action( 'give_payment_view_details', $payment_id ); |
||
| 583 | ?> |
||
| 584 | |||
| 585 | </div> |
||
| 586 | <!-- /.inside --> |
||
| 587 | </div> |
||
| 588 | <!-- /#give-donor-details --> |
||
| 589 | |||
| 590 | <?php |
||
| 591 | /** |
||
| 592 | * Fires in order details page, before the billing metabox. |
||
| 593 | * |
||
| 594 | * @since 1.0 |
||
| 595 | * |
||
| 596 | * @param int $payment_id Payment id. |
||
| 597 | */ |
||
| 598 | do_action( 'give_view_order_details_billing_before', $payment_id ); |
||
| 599 | ?> |
||
| 600 | |||
| 601 | <div id="give-billing-details" class="postbox"> |
||
| 602 | <h3 class="hndle"><?php esc_html_e( 'Billing Address', 'give' ); ?></h3> |
||
| 603 | |||
| 604 | <div class="inside"> |
||
| 605 | |||
| 606 | <div id="give-order-address"> |
||
| 607 | |||
| 608 | <div class="order-data-address"> |
||
| 609 | <div class="data column-container"> |
||
| 610 | <div class="column"> |
||
| 611 | <div class="give-wrap-address-line1"> |
||
| 612 | <label for="give-payment-address-line1" class="order-data-address"><?php esc_html_e( 'Address 1:', 'give' ); ?></label> |
||
| 613 | <input id="give-payment-address-line1" type="text" name="give-payment-address[0][line1]" value="<?php echo esc_attr( $address['line1'] ); ?>" class="medium-text"/> |
||
| 614 | </div> |
||
| 615 | <div class="give-wrap-address-line2"> |
||
| 616 | <label for="give-payment-address-line2" class="order-data-address-line"><?php esc_html_e( 'Address 2:', 'give' ); ?></label> |
||
| 617 | <input id="give-payment-address-line2" type="text" name="give-payment-address[0][line2]" value="<?php echo esc_attr( $address['line2'] ); ?>" class="medium-text"/> |
||
| 618 | </div> |
||
| 619 | </div> |
||
| 620 | <div class="column"> |
||
| 621 | <div class="give-wrap-address-city"> |
||
| 622 | <label for="give-payment-address-city" class="order-data-address-line"><?php esc_html_e( 'City:', 'give' ); ?></label> |
||
| 623 | <input id="give-payment-address-city" type="text" name="give-payment-address[0][city]" value="<?php echo esc_attr( $address['city'] ); ?>" class="medium-text"/> |
||
| 624 | </div> |
||
| 625 | <div class="give-wrap-address-zip"> |
||
| 626 | <label for="give-payment-address-zip" class="order-data-address-line"><?php esc_html_e( 'Zip / Postal Code:', 'give' ); ?></label> |
||
| 627 | <input id="give-payment-address-zip" type="text" name="give-payment-address[0][zip]" value="<?php echo esc_attr( $address['zip'] ); ?>" class="medium-text"/> |
||
| 628 | |||
| 629 | </div> |
||
| 630 | </div> |
||
| 631 | <div class="column"> |
||
| 632 | <div id="give-order-address-country-wrap"> |
||
| 633 | <label class="order-data-address-line"><?php esc_html_e( 'Country:', 'give' ); ?></label> |
||
| 634 | <?php |
||
| 635 | echo Give()->html->select( array( |
||
| 636 | 'options' => give_get_country_list(), |
||
| 637 | 'name' => 'give-payment-address[0][country]', |
||
| 638 | 'selected' => $address['country'], |
||
| 639 | 'show_option_all' => false, |
||
| 640 | 'show_option_none' => false, |
||
| 641 | 'chosen' => true, |
||
| 642 | 'placeholder' => esc_attr__( 'Select a country', 'give' ), |
||
| 643 | ) ); |
||
| 644 | ?> |
||
| 645 | </div> |
||
| 646 | <div id="give-order-address-state-wrap"> |
||
| 647 | <label for="give-payment-address-state" class="order-data-address-line"><?php esc_html_e( 'State / Province:', 'give' ); ?></label> |
||
| 648 | <?php |
||
| 649 | $states = give_get_states( $address['country'] ); |
||
| 650 | if ( ! empty( $states ) ) { |
||
| 651 | echo Give()->html->select( array( |
||
| 652 | 'options' => $states, |
||
| 653 | 'name' => 'give-payment-address[0][state]', |
||
| 654 | 'selected' => $address['state'], |
||
| 655 | 'show_option_all' => false, |
||
| 656 | 'show_option_none' => false, |
||
| 657 | 'chosen' => true, |
||
| 658 | 'placeholder' => esc_attr__( 'Select a state', 'give' ), |
||
| 659 | ) ); |
||
| 660 | } else { |
||
| 661 | ?> |
||
| 662 | <input id="give-payment-address-state" type="text" name="give-payment-address[0][state]" value="<?php echo esc_attr( $address['state'] ); ?>" class="medium-text"/> |
||
| 663 | <?php |
||
| 664 | } ?> |
||
| 665 | </div> |
||
| 666 | </div> |
||
| 667 | </div> |
||
| 668 | </div> |
||
| 669 | </div> |
||
| 670 | <!-- /#give-order-address --> |
||
| 671 | |||
| 672 | <?php |
||
| 673 | /** |
||
| 674 | * Fires in order details page, in the billing metabox, after all the fields. |
||
| 675 | * |
||
| 676 | * Allows you to insert new billing address fields. |
||
| 677 | * |
||
| 678 | * @since 1.7 |
||
| 679 | * |
||
| 680 | * @param int $payment_id Payment id. |
||
| 681 | */ |
||
| 682 | do_action( 'give_payment_billing_details', $payment_id ); |
||
| 683 | ?> |
||
| 684 | |||
| 685 | </div> |
||
| 686 | <!-- /.inside --> |
||
| 687 | </div> |
||
| 688 | <!-- /#give-billing-details --> |
||
| 689 | |||
| 690 | <?php |
||
| 691 | /** |
||
| 692 | * Fires in order details page, after the billing metabox. |
||
| 693 | * |
||
| 694 | * @since 1.0 |
||
| 695 | * |
||
| 696 | * @param int $payment_id Payment id. |
||
| 697 | */ |
||
| 698 | do_action( 'give_view_order_details_billing_after', $payment_id ); |
||
| 699 | ?> |
||
| 700 | |||
| 701 | <div id="give-payment-notes" class="postbox"> |
||
| 702 | <h3 class="hndle"><?php esc_html_e( 'Donation Notes', 'give' ); ?></h3> |
||
| 703 | |||
| 704 | <div class="inside"> |
||
| 705 | <div id="give-payment-notes-inner"> |
||
| 706 | <?php |
||
| 707 | $notes = give_get_payment_notes( $payment_id ); |
||
| 708 | if ( ! empty( $notes ) ) { |
||
| 709 | $no_notes_display = ' style="display:none;"'; |
||
| 710 | foreach ( $notes as $note ) : |
||
| 711 | |||
| 712 | echo give_get_payment_note_html( $note, $payment_id ); |
||
| 713 | |||
| 714 | endforeach; |
||
| 715 | } else { |
||
| 716 | $no_notes_display = ''; |
||
| 717 | } |
||
| 718 | echo '<p class="give-no-payment-notes"' . $no_notes_display . '>' . esc_html__( 'No donation notes.', 'give' ) . '</p>'; ?> |
||
| 719 | </div> |
||
| 720 | <textarea name="give-payment-note" id="give-payment-note" class="large-text"></textarea> |
||
| 721 | |||
| 722 | <div class="give-clearfix"> |
||
| 723 | <button id="give-add-payment-note" class="button button-secondary button-small" data-payment-id="<?php echo absint( $payment_id ); ?>"><?php esc_html_e( 'Add Note', 'give' ); ?></button> |
||
| 724 | </div> |
||
| 725 | |||
| 726 | </div> |
||
| 727 | <!-- /.inside --> |
||
| 728 | </div> |
||
| 729 | <!-- /#give-payment-notes --> |
||
| 730 | |||
| 731 | <?php |
||
| 732 | /** |
||
| 733 | * Fires in order details page, after the main area. |
||
| 734 | * |
||
| 735 | * @since 1.0 |
||
| 736 | * |
||
| 737 | * @param int $payment_id Payment id. |
||
| 738 | */ |
||
| 739 | do_action( 'give_view_order_details_main_after', $payment_id ); |
||
| 740 | ?> |
||
| 741 | |||
| 742 | </div> |
||
| 743 | <!-- /#normal-sortables --> |
||
| 744 | </div> |
||
| 745 | <!-- #postbox-container-2 --> |
||
| 746 | </div> |
||
| 747 | <!-- /#post-body --> |
||
| 748 | </div> |
||
| 749 | <!-- #give-dashboard-widgets-wrap --> |
||
| 750 | </div> |
||
| 751 | <!-- /#post-stuff --> |
||
| 752 | |||
| 753 | <?php |
||
| 754 | /** |
||
| 755 | * Fires in order details page, in the form after the order details. |
||
| 756 | * |
||
| 757 | * @since 1.0 |
||
| 758 | * |
||
| 759 | * @param int $payment_id Payment id. |
||
| 760 | */ |
||
| 761 | do_action( 'give_view_order_details_form_bottom', $payment_id ); |
||
| 762 | |||
| 763 | wp_nonce_field( 'give_update_payment_details_nonce' ); |
||
| 764 | ?> |
||
| 765 | <input type="hidden" name="give_payment_id" value="<?php echo esc_attr( $payment_id ); ?>"/> |
||
| 766 | <input type="hidden" name="give_action" value="update_payment_details"/> |
||
| 767 | </form> |
||
| 768 | <?php |
||
| 769 | /** |
||
| 770 | * Fires in order details page, after the order form. |
||
| 771 | * |
||
| 772 | * @since 1.0 |
||
| 773 | * |
||
| 774 | * @param int $payment_id Payment id. |
||
| 775 | */ |
||
| 776 | do_action( 'give_view_order_details_after', $payment_id ); |
||
| 777 | ?> |
||
| 778 | </div><!-- /.wrap --> |
||
| 779 |
Since your code implements the magic setter
_set, this function will be called for any write access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.