@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | <table id="admin-primary-mbox-txn-details-tbl" class="form-table"> |
4 | 4 | <tbody> |
5 | - <?php foreach ( $txn_details as $key => $txn_detail ) : ?> |
|
5 | + <?php foreach ($txn_details as $key => $txn_detail) : ?> |
|
6 | 6 | <tr> |
7 | 7 | <th> |
8 | - <label for="<?php echo $key;?>"><?php echo $txn_detail['label'];?></label> |
|
8 | + <label for="<?php echo $key; ?>"><?php echo $txn_detail['label']; ?></label> |
|
9 | 9 | </th> |
10 | 10 | <td> |
11 | - <?php echo $txn_detail['value'];?> |
|
11 | + <?php echo $txn_detail['value']; ?> |
|
12 | 12 | </td> |
13 | 13 | </tr> |
14 | 14 | <?php endforeach; // $txn_details?> |
@@ -1,19 +1,19 @@ |
||
1 | 1 | |
2 | 2 | <ul class="subsubsub"> |
3 | - <li class="all"><a class="current" href="<?php echo $view_all_url;?>">View All <span class="count">(<?php echo $table_rows; ?>)</span></a></li> |
|
3 | + <li class="all"><a class="current" href="<?php echo $view_all_url; ?>">View All <span class="count">(<?php echo $table_rows; ?>)</span></a></li> |
|
4 | 4 | </ul> |
5 | 5 | |
6 | 6 | <div id="txn-filters-dv"> |
7 | - <form id="txn-filters-frm" action="<?php echo $txn_overview_url;?>" method="post" name="txn-filters-frm"> |
|
8 | - <label for="txn-filter-start-date"><?php _e( 'Display Transactions from ', 'event_espresso' ); ?></label> |
|
7 | + <form id="txn-filters-frm" action="<?php echo $txn_overview_url; ?>" method="post" name="txn-filters-frm"> |
|
8 | + <label for="txn-filter-start-date"><?php _e('Display Transactions from ', 'event_espresso'); ?></label> |
|
9 | 9 | <input id="txn-filter-start-date" class="datepicker" type="text" value="<?php echo $start_date; ?>" name="txn-filter-start-date" size="15"/> |
10 | - <label for="txn-filter-end-date"> <?php _e( 'until', 'event_espresso' ); ?> </label> |
|
10 | + <label for="txn-filter-end-date"> <?php _e('until', 'event_espresso'); ?> </label> |
|
11 | 11 | <input id="txn-filter-end-date" class="datepicker" type="text" value="<?php echo $end_date; ?>" name="txn-filter-end-date" size="15"/> |
12 | 12 | <input id="submit-txn-filters-sbmt" class="button-secondary" type="submit" value="Filter Months"> |
13 | 13 | </form> |
14 | 14 | </div> |
15 | 15 | |
16 | - <form id="transactions-overview-frm" action="<?php echo $txn_overview_url;?>" method="get"> |
|
16 | + <form id="transactions-overview-frm" action="<?php echo $txn_overview_url; ?>" method="get"> |
|
17 | 17 | <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" /> |
18 | 18 | <input type="hidden" id="per_page" name="per_page" value="" /> |
19 | 19 | <?php echo $list_table->display(); ?> |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <div class="wrap"> |
2 | 2 | |
3 | - <h2><?php esc_attr_e( 'Event Espresso', 'event_espresso' ); ?> - <?php esc_attr_e( $admin_page_title, 'event_espresso' ); ?></h2> |
|
3 | + <h2><?php esc_attr_e('Event Espresso', 'event_espresso'); ?> - <?php esc_attr_e($admin_page_title, 'event_espresso'); ?></h2> |
|
4 | 4 | |
5 | 5 | <h2 class="nav-tab-wrapper"> |
6 | 6 | <a class="nav-tab<?php echo $tab_active_overview; ?>" href="<?php echo $tab_url_overview; ?>"><?php echo $tab_lnk_overview; ?></a> |
7 | - <?php if ( $tab_details ) : ?> |
|
7 | + <?php if ($tab_details) : ?> |
|
8 | 8 | <a class="nav-tab<?php echo $tab_active_details; ?>" href="<?php echo $tab_url_details; ?>"><?php echo $tab_lnk_details; ?></a> |
9 | 9 | <?php endif; ?> |
10 | 10 | <a class="nav-tab<?php echo $tab_active_reports; ?>" href="<?php echo $tab_url_reports; ?>"><?php echo $tab_lnk_reports; ?></a> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | - public function __construct( $routing = TRUE ) { |
|
36 | - parent::__construct( $routing ); |
|
37 | - define( 'EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'about/templates/' ); |
|
35 | + public function __construct($routing = TRUE) { |
|
36 | + parent::__construct($routing); |
|
37 | + define('EE_ABOUT_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'about/templates/'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | 42 | protected function _extend_page_config() { |
43 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'about'; |
|
43 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'about'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | protected function _set_page_routes() { |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | protected function _whats_new() { |
90 | 90 | $steps = EE_Maintenance_Mode::instance()->level() != EE_Maintenance_Mode::level_2_complete_maintenance ? $this->_get_started_steps() : FALSE; |
91 | 91 | $steps = $steps !== FALSE ? $steps : ''; |
92 | - $this->_admin_page_title = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
|
92 | + $this->_admin_page_title = sprintf(__('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION); |
|
93 | 93 | $settings_message = $steps; |
94 | - $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'). $settings_message ; |
|
95 | - $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH . 'whats_new.template.php'; |
|
96 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
94 | + $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso').$settings_message; |
|
95 | + $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH.'whats_new.template.php' : EE_ABOUT_TEMPLATE_PATH.'whats_new.template.php'; |
|
96 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
97 | 97 | $this->display_about_admin_page(); |
98 | 98 | } |
99 | 99 | |
@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | protected function _overview() { |
102 | 102 | $this->_admin_page_title = __('About Event Espresso', 'event_espresso'); |
103 | 103 | $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'); |
104 | - $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH . 'ee4-overview.template.php' : EE_ABOUT_TEMPLATE_PATH . 'ee4-overview.template.php'; |
|
105 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
104 | + $template = is_readable(EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php') ? EE_ABOUT_CAF_TEMPLATE_PATH.'ee4-overview.template.php' : EE_ABOUT_TEMPLATE_PATH.'ee4-overview.template.php'; |
|
105 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
106 | 106 | $this->display_about_admin_page(); |
107 | 107 | } |
108 | 108 | |
109 | 109 | protected function _credits() { |
110 | 110 | // $this->_template_args['admin_page_title'] = sprintf( __('Welcome to Event Espresso %s', 'event_espresso'), EVENT_ESPRESSO_VERSION ); |
111 | 111 | $this->_template_args['admin_page_subtitle'] = __('Thank you for choosing Event Espresso, the most powerful Event Management plugin for WordPress.', 'event_espresso'); |
112 | - $template = EE_ABOUT_TEMPLATE_PATH . 'credits.template.php'; |
|
113 | - $this->_template_args['about_admin_page_content'] = EEH_Template::display_template( $template, $this->_template_args, TRUE ); |
|
112 | + $template = EE_ABOUT_TEMPLATE_PATH.'credits.template.php'; |
|
113 | + $this->_template_args['about_admin_page_content'] = EEH_Template::display_template($template, $this->_template_args, TRUE); |
|
114 | 114 | $this->display_about_admin_page(); |
115 | 115 | } |
116 | 116 | } |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,25 +1,25 @@ |
||
1 | 1 | <div class="changelog point-releases"> |
2 | - <!-- <h3><?php echo _n( 'Minor Release Information', 'Minor Releases', 1 ); ?></h3> --> |
|
3 | - <h3><?php echo _n( 'Major Release Information', 'Major Releases', 1 ); ?></h3> |
|
2 | + <!-- <h3><?php echo _n('Minor Release Information', 'Minor Releases', 1); ?></h3> --> |
|
3 | + <h3><?php echo _n('Major Release Information', 'Major Releases', 1); ?></h3> |
|
4 | 4 | <?php //$type = 'minor'; ?> |
5 | 5 | <?php $type = 'major'; ?> |
6 | - <p><?php printf( __( '<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type ); ?> |
|
6 | + <p><?php printf(__('<strong>Version %1$s</strong> is a %2$s release.', 'event_espresso'), EVENT_ESPRESSO_VERSION, $type); ?> |
|
7 | 7 | <?php |
8 | - $ver = explode( '.', EVENT_ESPRESSO_VERSION ); |
|
9 | - array_pop( $ver ); |
|
10 | - $ver = implode( '.', $ver ); |
|
8 | + $ver = explode('.', EVENT_ESPRESSO_VERSION); |
|
9 | + array_pop($ver); |
|
10 | + $ver = implode('.', $ver); |
|
11 | 11 | ?> |
12 | - <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://eventespresso.com/wiki/ee4-changelog/#' . $ver ); ?> |
|
12 | + <?php printf(__('For more information, see <a href="%s">the release notes</a>.'), 'http://eventespresso.com/wiki/ee4-changelog/#'.$ver); ?> |
|
13 | 13 | </p> |
14 | 14 | </div> |
15 | 15 | |
16 | 16 | <div class="changelog"> |
17 | 17 | <?php |
18 | 18 | //maintenance mode on? |
19 | - if ( EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance ) { |
|
19 | + if (EE_Maintenance_Mode::instance()->level() == EE_Maintenance_Mode::level_2_complete_maintenance) { |
|
20 | 20 | ?> |
21 | 21 | <div class="ee-attention"> |
22 | - <h2 class="ee-maintenance-mode-callout"><?php _e('Event Espresso is in full maintenance mode.' , 'event_espresso'); ?></h2> |
|
22 | + <h2 class="ee-maintenance-mode-callout"><?php _e('Event Espresso is in full maintenance mode.', 'event_espresso'); ?></h2> |
|
23 | 23 | <p> |
24 | 24 | <?php |
25 | 25 | printf( |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file contains the Caffeinated version of the Event List Table. |
|
4 | - * @package Event Espresso |
|
5 | - * @subpackage admin |
|
6 | - * @since 4.4.9 |
|
7 | - */ |
|
3 | + * This file contains the Caffeinated version of the Event List Table. |
|
4 | + * @package Event Espresso |
|
5 | + * @subpackage admin |
|
6 | + * @since 4.4.9 |
|
7 | + */ |
|
8 | 8 | if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
9 | 9 | |
10 | 10 | /** |
@@ -17,14 +17,14 @@ |
||
17 | 17 | */ |
18 | 18 | class Extend_Events_Admin_List_Table extends Events_Admin_List_Table { |
19 | 19 | |
20 | - protected function _column_name_action_setup( EE_Event $item ) { |
|
20 | + protected function _column_name_action_setup(EE_Event $item) { |
|
21 | 21 | $export_query_args = array( |
22 | 22 | 'action' => 'export_events', |
23 | 23 | 'EVT_ID' => $item->ID() |
24 | 24 | ); |
25 | - $export_event_link = EE_Admin_Page::add_query_args_and_nonce( $export_query_args, EVENTS_ADMIN_URL ); |
|
25 | + $export_event_link = EE_Admin_Page::add_query_args_and_nonce($export_query_args, EVENTS_ADMIN_URL); |
|
26 | 26 | |
27 | - $actions = parent::_column_name_action_setup( $item ); |
|
27 | + $actions = parent::_column_name_action_setup($item); |
|
28 | 28 | // $actions['export'] = '<a href="' . $export_event_link . '" title="' . __('Export Event', 'event_espresso') . '">' . __('Export', 'event_espresso') . '</a>'; |
29 | 29 | return $actions; |
30 | 30 | } |
@@ -5,7 +5,9 @@ |
||
5 | 5 | * @subpackage plugin api, messages |
6 | 6 | * @since 4.5.0 |
7 | 7 | */ |
8 | -if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
8 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
9 | + exit('No direct script access allowed'); |
|
10 | +} |
|
9 | 11 | |
10 | 12 | /** |
11 | 13 | * Use this to register or deregister a new message template pack variation for the EE messages system. |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -435,8 +436,9 @@ discard block |
||
435 | 436 | //k we've got EVT_ID so let's use that to get the event we'll duplicate |
436 | 437 | $orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] ); |
437 | 438 | |
438 | - if ( ! $orig_event instanceof EE_Event ) |
|
439 | - throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) ); |
|
439 | + if ( ! $orig_event instanceof EE_Event ) { |
|
440 | + throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) ); |
|
441 | + } |
|
440 | 442 | |
441 | 443 | //k now let's clone the $orig_event before getting relations |
442 | 444 | $new_event = clone $orig_event; |
@@ -510,8 +512,9 @@ discard block |
||
510 | 512 | //now let's get the ticket relations setup. |
511 | 513 | foreach ( (array) $orig_tkts as $orig_tkt ) { |
512 | 514 | //it's possible a datetime will have no tickets so let's verify we HAVE a ticket first. |
513 | - if ( ! $orig_tkt instanceof EE_Ticket ) |
|
514 | - continue; |
|
515 | + if ( ! $orig_tkt instanceof EE_Ticket ) { |
|
516 | + continue; |
|
517 | + } |
|
515 | 518 | |
516 | 519 | //is this ticket archived? If it is then let's skip |
517 | 520 | if ( $orig_tkt->get( 'TKT_deleted' ) ) { |
@@ -620,9 +623,9 @@ discard block |
||
620 | 623 | protected function _events_export() { |
621 | 624 | if(isset($this->_req_data['EVT_ID'])){ |
622 | 625 | $event_ids = $this->_req_data['EVT_ID']; |
623 | - }elseif(isset($this->_req_data['EVT_IDs'])){ |
|
626 | + } elseif(isset($this->_req_data['EVT_IDs'])){ |
|
624 | 627 | $event_ids = $this->_req_data['EVT_IDs']; |
625 | - }else{ |
|
628 | + } else{ |
|
626 | 629 | $event_ids = NULL; |
627 | 630 | } |
628 | 631 | //todo: I don't like doing this but it'll do until we modify EE_Export Class. |
@@ -811,8 +814,9 @@ discard block |
||
811 | 814 | |
812 | 815 | extract( wp_parse_args($args, $defaults), EXTR_SKIP ); |
813 | 816 | |
814 | - if ( empty($walker) || !is_a($walker, 'Walker') ) |
|
815 | - $walker = new Walker_Radio_Checklist; |
|
817 | + if ( empty($walker) || !is_a($walker, 'Walker') ) { |
|
818 | + $walker = new Walker_Radio_Checklist; |
|
819 | + } |
|
816 | 820 | |
817 | 821 | $descendants_and_self = (int) $descendants_and_self; |
818 | 822 | |
@@ -821,17 +825,19 @@ discard block |
||
821 | 825 | $tax = get_taxonomy($taxonomy); |
822 | 826 | $args['disabled'] = !current_user_can($tax->cap->assign_terms); |
823 | 827 | |
824 | - if ( is_array( $selected_cats ) ) |
|
825 | - $args['selected_cats'] = $selected_cats; |
|
826 | - elseif ( $post_id ) |
|
827 | - $args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids'))); |
|
828 | - else |
|
829 | - $args['selected_cats'] = array(); |
|
828 | + if ( is_array( $selected_cats ) ) { |
|
829 | + $args['selected_cats'] = $selected_cats; |
|
830 | + } elseif ( $post_id ) { |
|
831 | + $args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids'))); |
|
832 | + } else { |
|
833 | + $args['selected_cats'] = array(); |
|
834 | + } |
|
830 | 835 | |
831 | - if ( is_array( $popular_cats ) ) |
|
832 | - $args['popular_cats'] = $popular_cats; |
|
833 | - else |
|
834 | - $args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); |
|
836 | + if ( is_array( $popular_cats ) ) { |
|
837 | + $args['popular_cats'] = $popular_cats; |
|
838 | + } else { |
|
839 | + $args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); |
|
840 | + } |
|
835 | 841 | |
836 | 842 | if ( $descendants_and_self ) { |
837 | 843 | $categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) ); |
@@ -884,8 +890,9 @@ discard block |
||
884 | 890 | $status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL; |
885 | 891 | |
886 | 892 | //active status dropdown |
887 | - if ( $status !== 'draft' ) |
|
888 | - $filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' ); |
|
893 | + if ( $status !== 'draft' ) { |
|
894 | + $filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' ); |
|
895 | + } |
|
889 | 896 | |
890 | 897 | //category filter |
891 | 898 | $filters[] = $this->category_dropdown(); |
@@ -1064,7 +1071,7 @@ discard block |
||
1064 | 1071 | |
1065 | 1072 | if($count){ |
1066 | 1073 | return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where)); |
1067 | - }else{ |
|
1074 | + } else{ |
|
1068 | 1075 | return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params); |
1069 | 1076 | } |
1070 | 1077 | |
@@ -1087,11 +1094,13 @@ discard block |
||
1087 | 1094 | //cycle thru the boxes |
1088 | 1095 | while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
1089 | 1096 | if ( $trash ) { |
1090 | - if ( ! $TKT->delete_by_ID( $TKT_ID ) ) |
|
1091 | - $success = 0; |
|
1097 | + if ( ! $TKT->delete_by_ID( $TKT_ID ) ) { |
|
1098 | + $success = 0; |
|
1099 | + } |
|
1092 | 1100 | } else { |
1093 | - if ( ! $TKT->restore_by_ID( $TKT_ID ) ) |
|
1094 | - $success = 0; |
|
1101 | + if ( ! $TKT->restore_by_ID( $TKT_ID ) ) { |
|
1102 | + $success = 0; |
|
1103 | + } |
|
1095 | 1104 | } |
1096 | 1105 | } |
1097 | 1106 | } else { |
@@ -1099,11 +1108,13 @@ discard block |
||
1099 | 1108 | $TKT_ID = absint( $this->_req_data['TKT_ID'] ); |
1100 | 1109 | |
1101 | 1110 | if ( $trash ) { |
1102 | - if ( ! $TKT->delete_by_ID( $TKT_ID ) ) |
|
1103 | - $success = 0; |
|
1111 | + if ( ! $TKT->delete_by_ID( $TKT_ID ) ) { |
|
1112 | + $success = 0; |
|
1113 | + } |
|
1104 | 1114 | } else { |
1105 | - if ( ! $TKT->restore_by_ID( $TKT_ID ) ) |
|
1106 | - $success = 0; |
|
1115 | + if ( ! $TKT->restore_by_ID( $TKT_ID ) ) { |
|
1116 | + $success = 0; |
|
1117 | + } |
|
1107 | 1118 | } |
1108 | 1119 | } |
1109 | 1120 | |
@@ -1151,8 +1162,9 @@ discard block |
||
1151 | 1162 | ); |
1152 | 1163 | |
1153 | 1164 | //failsafe. If the default ticket count === 1 then we need to redirect to event overview. |
1154 | - if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) ) |
|
1155 | - $query_args = array(); |
|
1165 | + if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) ) { |
|
1166 | + $query_args = array(); |
|
1167 | + } |
|
1156 | 1168 | $this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args ); |
1157 | 1169 | } |
1158 | 1170 | |
@@ -1176,13 +1188,15 @@ discard block |
||
1176 | 1188 | |
1177 | 1189 | function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { |
1178 | 1190 | extract($args); |
1179 | - if ( empty($taxonomy) ) |
|
1180 | - $taxonomy = 'category'; |
|
1191 | + if ( empty($taxonomy) ) { |
|
1192 | + $taxonomy = 'category'; |
|
1193 | + } |
|
1181 | 1194 | |
1182 | - if ( $taxonomy == 'category' ) |
|
1183 | - $name = 'post_category'; |
|
1184 | - else |
|
1185 | - $name = 'tax_input['.$taxonomy.']'; |
|
1195 | + if ( $taxonomy == 'category' ) { |
|
1196 | + $name = 'post_category'; |
|
1197 | + } else { |
|
1198 | + $name = 'tax_input['.$taxonomy.']'; |
|
1199 | + } |
|
1186 | 1200 | |
1187 | 1201 | $class = ''; |
1188 | 1202 | $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="radio" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>'; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -30,25 +30,25 @@ discard block |
||
30 | 30 | class Extend_Events_Admin_Page extends Events_Admin_Page { |
31 | 31 | |
32 | 32 | |
33 | - public function __construct( $routing = TRUE ) { |
|
34 | - parent::__construct( $routing ); |
|
35 | - define( 'EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'events/templates/'); |
|
36 | - define( 'EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'events/assets/'); |
|
37 | - define( 'EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'events/assets/'); |
|
33 | + public function __construct($routing = TRUE) { |
|
34 | + parent::__construct($routing); |
|
35 | + define('EVENTS_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'events/templates/'); |
|
36 | + define('EVENTS_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'events/assets/'); |
|
37 | + define('EVENTS_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'events/assets/'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | protected function _extend_page_config() { |
42 | 42 | |
43 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'events'; |
|
43 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'events'; |
|
44 | 44 | $default_espresso_boxes = $this->_default_espresso_metaboxes; |
45 | 45 | |
46 | 46 | //is there a evt_id in the request? |
47 | - $evt_id = ! empty( $this->_req_data['EVT_ID'] ) && ! is_array( $this->_req_data['EVT_ID'] ) ? $this->_req_data['EVT_ID'] : 0; |
|
48 | - $evt_id = ! empty( $this->_req_data['post'] ) ? $this->_req_data['post'] : $evt_id; |
|
47 | + $evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : 0; |
|
48 | + $evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id; |
|
49 | 49 | |
50 | 50 | //tkt_id? |
51 | - $tkt_id = !empty( $this->_req_data['TKT_ID'] ) && ! is_array( $this->_req_data['TKT_ID'] ) ? $this->_req_data['TKT_ID'] : 0; |
|
51 | + $tkt_id = ! empty($this->_req_data['TKT_ID']) && ! is_array($this->_req_data['TKT_ID']) ? $this->_req_data['TKT_ID'] : 0; |
|
52 | 52 | |
53 | 53 | $new_page_routes = array( |
54 | 54 | 'duplicate_event' => array( |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | 'capability' => 'ee_delete_default_ticket', |
67 | 67 | 'obj_id' => $tkt_id, |
68 | 68 | 'noheader' => TRUE, |
69 | - 'args' => array( 'trash' => TRUE ) |
|
69 | + 'args' => array('trash' => TRUE) |
|
70 | 70 | ), |
71 | 71 | 'trash_tickets' => array( |
72 | 72 | 'func' => '_trash_or_restore_ticket', |
73 | 73 | 'capability' => 'ee_delete_default_tickets', |
74 | 74 | 'noheader' => TRUE, |
75 | - 'args' => array( 'trash' => TRUE ) |
|
75 | + 'args' => array('trash' => TRUE) |
|
76 | 76 | ), |
77 | 77 | 'restore_ticket' => array( |
78 | 78 | 'func' => '_trash_or_restore_ticket', |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ) |
133 | 133 | ); |
134 | 134 | |
135 | - $this->_page_routes = array_merge( $this->_page_routes, $new_page_routes ); |
|
135 | + $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
136 | 136 | |
137 | 137 | |
138 | 138 | //partial route/config override |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | $this->_page_config['default']['list_table'] = 'Extend_Events_Admin_List_Table'; |
145 | 145 | |
146 | 146 | //add tickets tab but only if there are more than one default ticket! |
147 | - $tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array( array('TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ); |
|
148 | - if ( $tkt_count > 1 ) { |
|
147 | + $tkt_count = EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE); |
|
148 | + if ($tkt_count > 1) { |
|
149 | 149 | $new_page_config = array( |
150 | 150 | 'ticket_list_table' => array( |
151 | 151 | 'nav' => array( |
@@ -164,14 +164,14 @@ discard block |
||
164 | 164 | 'label' => __('Templates'), |
165 | 165 | 'order' => 30 |
166 | 166 | ), |
167 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ), |
|
167 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
168 | 168 | 'help_tabs' => array( |
169 | 169 | 'general_settings_templates_help_tab' => array( |
170 | 170 | 'title' => __('Templates', 'event_espresso'), |
171 | 171 | 'filename' => 'general_settings_templates' |
172 | 172 | ) |
173 | 173 | ), |
174 | - 'help_tour' => array( 'Templates_Help_Tour' ), |
|
174 | + 'help_tour' => array('Templates_Help_Tour'), |
|
175 | 175 | 'require_nonce' => FALSE |
176 | 176 | ); |
177 | 177 | |
@@ -190,24 +190,24 @@ discard block |
||
190 | 190 | // 'metaboxes' => $default_espresso_boxes, |
191 | 191 | // 'require_nonce' => FALSE |
192 | 192 | // ); |
193 | - $this->_page_config = array_merge( $this->_page_config, $new_page_config ); |
|
193 | + $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
194 | 194 | |
195 | 195 | //add filters and actions |
196 | 196 | //modifying _views |
197 | - add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array( $this, 'add_additional_datetime_button' ), 10, 2 ); |
|
198 | - add_filter('FHEE_event_datetime_metabox_clone_button_template', array( $this, 'add_datetime_clone_button' ), 10, 2 ); |
|
199 | - add_filter('FHEE_event_datetime_metabox_timezones_template', array( $this, 'datetime_timezones_template'), 10, 2 ); |
|
197 | + add_filter('FHEE_event_datetime_metabox_add_additional_date_time_template', array($this, 'add_additional_datetime_button'), 10, 2); |
|
198 | + add_filter('FHEE_event_datetime_metabox_clone_button_template', array($this, 'add_datetime_clone_button'), 10, 2); |
|
199 | + add_filter('FHEE_event_datetime_metabox_timezones_template', array($this, 'datetime_timezones_template'), 10, 2); |
|
200 | 200 | |
201 | 201 | |
202 | 202 | //filters for event list table |
203 | - add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array( $this, 'list_table_filters'), 10, 2); |
|
204 | - add_filter('FHEE__Extend_Events_Admin_List_Table__column_actions__action_links', array( $this, 'extra_list_table_actions'), 10, 2 ); |
|
203 | + add_filter('FHEE__Extend_Events_Admin_List_Table__filters', array($this, 'list_table_filters'), 10, 2); |
|
204 | + add_filter('FHEE__Extend_Events_Admin_List_Table__column_actions__action_links', array($this, 'extra_list_table_actions'), 10, 2); |
|
205 | 205 | |
206 | 206 | //legend item |
207 | - add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array( $this, 'additional_legend_items') ); |
|
207 | + add_filter('FHEE__Events_Admin_Page___event_legend_items__items', array($this, 'additional_legend_items')); |
|
208 | 208 | |
209 | 209 | //heartbeat stuff |
210 | - add_filter( 'heartbeat_received', array( $this, 'heartbeat_response' ), 10, 2 ); |
|
210 | + add_filter('heartbeat_received', array($this, 'heartbeat_response'), 10, 2); |
|
211 | 211 | |
212 | 212 | } |
213 | 213 | |
@@ -221,12 +221,12 @@ discard block |
||
221 | 221 | * |
222 | 222 | * @return array possibly appended response. |
223 | 223 | */ |
224 | - public function heartbeat_response( $response, $data ) { |
|
224 | + public function heartbeat_response($response, $data) { |
|
225 | 225 | /** |
226 | 226 | * check whether count of tickets is approaching the potential |
227 | 227 | * limits for the server. |
228 | 228 | */ |
229 | - if ( ! empty( $data['input_count'] ) ) { |
|
229 | + if ( ! empty($data['input_count'])) { |
|
230 | 230 | $response['max_input_vars_check'] = EE_Registry::instance()->CFG->environment->max_input_vars_limit_check($data['input_count']); |
231 | 231 | } |
232 | 232 | |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | |
242 | 242 | |
243 | 243 | |
244 | - public function extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ) { |
|
245 | - $return = parent::extra_permalink_field_buttons( $return, $id, $new_title, $new_slug ); |
|
244 | + public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug) { |
|
245 | + $return = parent::extra_permalink_field_buttons($return, $id, $new_title, $new_slug); |
|
246 | 246 | //make sure this is only when editing |
247 | - if ( !empty( $id ) ) { |
|
248 | - $href = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url ); |
|
247 | + if ( ! empty($id)) { |
|
248 | + $href = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_event', 'EVT_ID' => $id), $this->_admin_base_url); |
|
249 | 249 | $title = esc_attr__('Duplicate Event', 'event_espresso'); |
250 | - $return .= '<a href="' . $href . '" title="' . $title . '" id="ee-duplicate-event-button" class="button button-small" value="duplicate_event">' . $title . '</button>'; |
|
250 | + $return .= '<a href="'.$href.'" title="'.$title.'" id="ee-duplicate-event-button" class="button button-small" value="duplicate_event">'.$title.'</button>'; |
|
251 | 251 | } |
252 | 252 | return $return; |
253 | 253 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | 'label' => __('Trash', 'event_espresso'), |
271 | 271 | 'count' => 0, |
272 | 272 | 'bulk_action' => array( |
273 | - 'restore_tickets' => __('Restore from Trash' , 'event_espresso'), |
|
273 | + 'restore_tickets' => __('Restore from Trash', 'event_espresso'), |
|
274 | 274 | 'delete_tickets' => __('Delete Permanently', 'event_espresso') |
275 | 275 | ) |
276 | 276 | ) |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | |
282 | 282 | public function load_scripts_styles_edit() { |
283 | - wp_register_script( 'ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL . 'event-editor-heartbeat.js', array( 'ee_admin_js', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
283 | + wp_register_script('ee-event-editor-heartbeat', EVENTS_CAF_ASSETS_URL.'event-editor-heartbeat.js', array('ee_admin_js', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE); |
|
284 | 284 | |
285 | 285 | /** |
286 | 286 | * load accounting js. |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | 'event_clone_dt_msg' => __('Clone this Event Date and Time', 'event_espresso'), |
301 | 301 | 'remove_event_dt_msg' => __('Remove this Event Time', 'event_espresso') |
302 | 302 | ); |
303 | - EE_Registry::$i18n_js_strings = array_merge( EE_Registry::$i18n_js_strings, $new_strings); |
|
303 | + EE_Registry::$i18n_js_strings = array_merge(EE_Registry::$i18n_js_strings, $new_strings); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | |
@@ -308,20 +308,20 @@ discard block |
||
308 | 308 | |
309 | 309 | |
310 | 310 | |
311 | - public function add_additional_datetime_button( $template, $template_args ) { |
|
312 | - return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_add_additional_time.template.php', $template_args, TRUE); |
|
311 | + public function add_additional_datetime_button($template, $template_args) { |
|
312 | + return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_add_additional_time.template.php', $template_args, TRUE); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | |
316 | 316 | |
317 | - public function add_datetime_clone_button( $template, $template_args ) { |
|
318 | - return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_metabox_clone_button.template.php', $template_args, TRUE ); |
|
317 | + public function add_datetime_clone_button($template, $template_args) { |
|
318 | + return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_metabox_clone_button.template.php', $template_args, TRUE); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | |
322 | 322 | |
323 | - public function datetime_timezones_template( $template, $template_args ) { |
|
324 | - return EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'event_datetime_timezones.template.php', $template_args, TRUE ); |
|
323 | + public function datetime_timezones_template($template, $template_args) { |
|
324 | + return EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'event_datetime_timezones.template.php', $template_args, TRUE); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | |
@@ -330,11 +330,11 @@ discard block |
||
330 | 330 | protected function _set_list_table_views_default() { |
331 | 331 | parent::_set_list_table_views_default(); |
332 | 332 | $export_label = __('Export Events', 'event_espresso'); |
333 | - if ( EE_Registry::instance()->CAP->current_user_can( 'export', 'espresso_events_export' ) ) { |
|
333 | + if (EE_Registry::instance()->CAP->current_user_can('export', 'espresso_events_export')) { |
|
334 | 334 | // $this->_views['all']['bulk_action']['export_events'] = $export_label; |
335 | 335 | // $this->_views['draft']['bulk_action']['export_events'] = $export_label; |
336 | 336 | |
337 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_events', 'espresso_events_trash_events' ) ) { |
|
337 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) { |
|
338 | 338 | // $this->_views['trash']['bulk_action']['export_events'] = $export_label; |
339 | 339 | } |
340 | 340 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | ) |
361 | 361 | ); |
362 | 362 | |
363 | - $this->_views = array_merge( $this->_views, $new_views); |
|
363 | + $this->_views = array_merge($this->_views, $new_views); |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | |
@@ -374,14 +374,14 @@ discard block |
||
374 | 374 | |
375 | 375 | |
376 | 376 | |
377 | - public function extra_list_table_actions( $actionlinks, $event ) { |
|
378 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports', $event->ID() ) ) { |
|
377 | + public function extra_list_table_actions($actionlinks, $event) { |
|
378 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports', $event->ID())) { |
|
379 | 379 | $reports_query_args = array( |
380 | 380 | 'action' => 'reports', |
381 | 381 | 'EVT_ID' => $event->ID() |
382 | 382 | ); |
383 | - $reports_link = EE_Admin_Page::add_query_args_and_nonce( $reports_query_args, REG_ADMIN_URL ); |
|
384 | - $actionlinks[] = '<a href="' . $reports_link . '" title="' . esc_attr__('View Report', 'event_espresso') . '"><div class="dashicons dashicons-chart-bar"></div></a>' . "\n\t"; |
|
383 | + $reports_link = EE_Admin_Page::add_query_args_and_nonce($reports_query_args, REG_ADMIN_URL); |
|
384 | + $actionlinks[] = '<a href="'.$reports_link.'" title="'.esc_attr__('View Report', 'event_espresso').'"><div class="dashicons dashicons-chart-bar"></div></a>'."\n\t"; |
|
385 | 385 | } |
386 | 386 | return $actionlinks; |
387 | 387 | } |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | |
391 | 391 | public function additional_legend_items($items) { |
392 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_registrations', 'espresso_registrations_reports' ) ) { |
|
392 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_registrations', 'espresso_registrations_reports')) { |
|
393 | 393 | $items['reports'] = array( |
394 | 394 | 'class' => 'dashicons dashicons-chart-bar', |
395 | 395 | 'desc' => __('Event Reports', 'event_espresso') |
@@ -414,17 +414,17 @@ discard block |
||
414 | 414 | */ |
415 | 415 | protected function _duplicate_event() { |
416 | 416 | //first make sure the ID for the event is in the request. If it isnt' then we need to bail and redirect back to overview list table (cause how did we get here?) |
417 | - if ( !isset( $this->_req_data['EVT_ID'] ) ) { |
|
418 | - EE_Error::add_error( __('In order to duplicate an event an Event ID is required. None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
419 | - $this->_redirect_after_action( FALSE, '', '', array(), TRUE ); |
|
417 | + if ( ! isset($this->_req_data['EVT_ID'])) { |
|
418 | + EE_Error::add_error(__('In order to duplicate an event an Event ID is required. None was given.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
419 | + $this->_redirect_after_action(FALSE, '', '', array(), TRUE); |
|
420 | 420 | return; |
421 | 421 | } |
422 | 422 | |
423 | 423 | //k we've got EVT_ID so let's use that to get the event we'll duplicate |
424 | - $orig_event = EEM_Event::instance()->get_one_by_ID( $this->_req_data['EVT_ID'] ); |
|
424 | + $orig_event = EEM_Event::instance()->get_one_by_ID($this->_req_data['EVT_ID']); |
|
425 | 425 | |
426 | - if ( ! $orig_event instanceof EE_Event ) |
|
427 | - throw new EE_Error( sprintf( __('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'] ) ); |
|
426 | + if ( ! $orig_event instanceof EE_Event) |
|
427 | + throw new EE_Error(sprintf(__('An EE_Event object could not be retrieved for the given ID (%s)', 'event_espresso '), $this->_req_data['EVT_ID'])); |
|
428 | 428 | |
429 | 429 | //k now let's clone the $orig_event before getting relations |
430 | 430 | $new_event = clone $orig_event; |
@@ -437,43 +437,43 @@ discard block |
||
437 | 437 | |
438 | 438 | |
439 | 439 | //reset the ID and modify other details to make it clear this is a dupe |
440 | - $new_event->set( 'EVT_ID', 0 ); |
|
441 | - $new_name = $new_event->name() . ' ' . __('**DUPLICATE**', 'event_espresso'); |
|
442 | - $new_event->set( 'EVT_name', $new_name ); |
|
443 | - $new_event->set( 'EVT_slug', sanitize_title_with_dashes( $new_name ) ); |
|
444 | - $new_event->set( 'status', 'draft' ); |
|
440 | + $new_event->set('EVT_ID', 0); |
|
441 | + $new_name = $new_event->name().' '.__('**DUPLICATE**', 'event_espresso'); |
|
442 | + $new_event->set('EVT_name', $new_name); |
|
443 | + $new_event->set('EVT_slug', sanitize_title_with_dashes($new_name)); |
|
444 | + $new_event->set('status', 'draft'); |
|
445 | 445 | |
446 | 446 | //duplicate discussion settings |
447 | - $new_event->set( 'comment_status', $orig_event->get('comment_status') ); |
|
448 | - $new_event->set( 'ping_status', $orig_event->get( 'ping_status' ) ); |
|
447 | + $new_event->set('comment_status', $orig_event->get('comment_status')); |
|
448 | + $new_event->set('ping_status', $orig_event->get('ping_status')); |
|
449 | 449 | |
450 | 450 | //save the new event |
451 | 451 | $new_event->save(); |
452 | 452 | |
453 | 453 | //venues |
454 | - foreach( $orig_ven as $ven ) { |
|
455 | - $new_event->_add_relation_to( $ven, 'Venue' ); |
|
454 | + foreach ($orig_ven as $ven) { |
|
455 | + $new_event->_add_relation_to($ven, 'Venue'); |
|
456 | 456 | } |
457 | 457 | $new_event->save(); |
458 | 458 | |
459 | 459 | |
460 | 460 | //now we need to get the question group relations and handle that |
461 | 461 | //first primary question groups |
462 | - $orig_primary_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 1 ) ) ); |
|
463 | - if ( !empty( $orig_primary_qgs ) ) { |
|
464 | - foreach ( $orig_primary_qgs as $id => $obj ) { |
|
465 | - if ( $obj instanceof EE_Question_Group ) { |
|
466 | - $new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 1 ) ); |
|
462 | + $orig_primary_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 1))); |
|
463 | + if ( ! empty($orig_primary_qgs)) { |
|
464 | + foreach ($orig_primary_qgs as $id => $obj) { |
|
465 | + if ($obj instanceof EE_Question_Group) { |
|
466 | + $new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 1)); |
|
467 | 467 | } |
468 | 468 | } |
469 | 469 | } |
470 | 470 | |
471 | 471 | //next additional attendee question groups |
472 | - $orig_additional_qgs = $orig_event->get_many_related('Question_Group', array( array('Event_Question_Group.EQG_primary' => 0 ) ) ); |
|
473 | - if ( !empty( $orig_additional_qgs ) ) { |
|
474 | - foreach ( $orig_additional_qgs as $id => $obj ) { |
|
475 | - if ( $obj instanceof EE_Question_Group ) { |
|
476 | - $new_event->_add_relation_to( $obj, 'Question_Group', array( 'EQG_primary' => 0 ) ); |
|
472 | + $orig_additional_qgs = $orig_event->get_many_related('Question_Group', array(array('Event_Question_Group.EQG_primary' => 0))); |
|
473 | + if ( ! empty($orig_additional_qgs)) { |
|
474 | + foreach ($orig_additional_qgs as $id => $obj) { |
|
475 | + if ($obj instanceof EE_Question_Group) { |
|
476 | + $new_event->_add_relation_to($obj, 'Question_Group', array('EQG_primary' => 0)); |
|
477 | 477 | } |
478 | 478 | } |
479 | 479 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | |
485 | 485 | //k now that we have the new event saved we can loop through the datetimes and start adding relations. |
486 | 486 | $cloned_tickets = array(); |
487 | - foreach ( $orig_datetimes as $orig_dtt ) { |
|
487 | + foreach ($orig_datetimes as $orig_dtt) { |
|
488 | 488 | $new_dtt = clone $orig_dtt; |
489 | 489 | $orig_tkts = $orig_dtt->tickets(); |
490 | 490 | |
@@ -492,22 +492,22 @@ discard block |
||
492 | 492 | $new_dtt->set('DTT_ID', 0); |
493 | 493 | $new_dtt->set('DTT_sold', 0); |
494 | 494 | $new_dtt->save(); |
495 | - $new_event->_add_relation_to( $new_dtt, 'Datetime'); |
|
495 | + $new_event->_add_relation_to($new_dtt, 'Datetime'); |
|
496 | 496 | $new_event->save(); |
497 | 497 | |
498 | 498 | //now let's get the ticket relations setup. |
499 | - foreach ( (array) $orig_tkts as $orig_tkt ) { |
|
499 | + foreach ((array) $orig_tkts as $orig_tkt) { |
|
500 | 500 | //it's possible a datetime will have no tickets so let's verify we HAVE a ticket first. |
501 | - if ( ! $orig_tkt instanceof EE_Ticket ) |
|
501 | + if ( ! $orig_tkt instanceof EE_Ticket) |
|
502 | 502 | continue; |
503 | 503 | |
504 | 504 | //is this ticket archived? If it is then let's skip |
505 | - if ( $orig_tkt->get( 'TKT_deleted' ) ) { |
|
505 | + if ($orig_tkt->get('TKT_deleted')) { |
|
506 | 506 | continue; |
507 | 507 | } |
508 | 508 | |
509 | 509 | //does this original ticket already exist in the clone_tickets cache? If so we'll just use the new ticket from it. |
510 | - if ( isset( $cloned_tickets[$orig_tkt->ID()] ) ) { |
|
510 | + if (isset($cloned_tickets[$orig_tkt->ID()])) { |
|
511 | 511 | $new_tkt = $cloned_tickets[$orig_tkt->ID()]; |
512 | 512 | } else { |
513 | 513 | $new_tkt = clone $orig_tkt; |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $new_tkt->save(); //make sure new ticket has ID. |
520 | 520 | |
521 | 521 | //price relations on new ticket need to be setup. |
522 | - foreach ( $orig_prices as $orig_price ) { |
|
522 | + foreach ($orig_prices as $orig_price) { |
|
523 | 523 | $new_price = clone $orig_price; |
524 | 524 | $new_price->set('PRC_ID', 0); |
525 | 525 | $new_price->save(); |
@@ -536,39 +536,39 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | //clone taxonomy information |
539 | - $taxonomies_to_clone_with = apply_filters( 'FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array( 'espresso_event_categories', 'espresso_event_type', 'post_tag' ) ); |
|
539 | + $taxonomies_to_clone_with = apply_filters('FHEE__Extend_Events_Admin_Page___duplicate_event__taxonomies_to_clone', array('espresso_event_categories', 'espresso_event_type', 'post_tag')); |
|
540 | 540 | |
541 | 541 | //get terms for original event (notice) |
542 | - $orig_terms = wp_get_object_terms( $orig_event->ID(), $taxonomies_to_clone_with ); |
|
542 | + $orig_terms = wp_get_object_terms($orig_event->ID(), $taxonomies_to_clone_with); |
|
543 | 543 | |
544 | 544 | //loop through terms and add them to new event. |
545 | - foreach ( $orig_terms as $term ) { |
|
546 | - wp_set_object_terms( $new_event->ID(), $term->term_id, $term->taxonomy, true ); |
|
545 | + foreach ($orig_terms as $term) { |
|
546 | + wp_set_object_terms($new_event->ID(), $term->term_id, $term->taxonomy, true); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | |
550 | - do_action( 'AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event ); |
|
550 | + do_action('AHEE__Extend_Events_Admin_Page___duplicate_event__after', $new_event, $orig_event); |
|
551 | 551 | |
552 | 552 | //now let's redirect to the edit page for this duplicated event if we have a new event id. |
553 | - if ( $new_event->ID() ) { |
|
553 | + if ($new_event->ID()) { |
|
554 | 554 | $redirect_args = array( |
555 | 555 | 'post' => $new_event->ID(), |
556 | 556 | 'action' => 'edit' |
557 | 557 | ); |
558 | - EE_Error::add_success( __('Event successfully duplicated. Please review the details below and make any necessary edits', 'event_espresso') ); |
|
558 | + EE_Error::add_success(__('Event successfully duplicated. Please review the details below and make any necessary edits', 'event_espresso')); |
|
559 | 559 | } else { |
560 | 560 | $redirect_args = array( |
561 | 561 | 'action' => 'default' |
562 | 562 | ); |
563 | - EE_Error::add_error( __('Not able to duplicate event. Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
563 | + EE_Error::add_error(__('Not able to duplicate event. Something went wrong.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
564 | 564 | } |
565 | 565 | |
566 | - $this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE ); |
|
566 | + $this->_redirect_after_action(FALSE, '', '', $redirect_args, TRUE); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | |
570 | 570 | |
571 | - protected function _import_page(){ |
|
571 | + protected function _import_page() { |
|
572 | 572 | |
573 | 573 | $title = __('Import', 'event_espresso'); |
574 | 574 | $intro = __('If you have a previously exported Event Espresso 4 information in a Comma Separated Value (CSV) file format, you can upload the file here: ', 'event_espresso'); |
@@ -576,8 +576,8 @@ discard block |
||
576 | 576 | $action = 'import_events'; |
577 | 577 | $type = 'csv'; |
578 | 578 | $this->_template_args['form'] = EE_Import::instance()->upload_form($title, $intro, $form_url, $action, $type); |
579 | - $this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'),$this->_admin_base_url); |
|
580 | - $content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH . 'import_page.template.php',$this->_template_args,true); |
|
579 | + $this->_template_args['sample_file_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'sample_export_file'), $this->_admin_base_url); |
|
580 | + $content = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'import_page.template.php', $this->_template_args, true); |
|
581 | 581 | |
582 | 582 | |
583 | 583 | $this->_template_args['admin_page_content'] = $content; |
@@ -590,9 +590,9 @@ discard block |
||
590 | 590 | * @return string html |
591 | 591 | */ |
592 | 592 | protected function _import_events() { |
593 | - require_once(EE_CLASSES . 'EE_Import.class.php'); |
|
593 | + require_once(EE_CLASSES.'EE_Import.class.php'); |
|
594 | 594 | $success = EE_Import::instance()->import(); |
595 | - $this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'),true); |
|
595 | + $this->_redirect_after_action($success, 'Import File', 'ran', array('action' => 'import_page'), true); |
|
596 | 596 | |
597 | 597 | } |
598 | 598 | |
@@ -606,24 +606,24 @@ discard block |
||
606 | 606 | * @return file |
607 | 607 | */ |
608 | 608 | protected function _events_export() { |
609 | - if(isset($this->_req_data['EVT_ID'])){ |
|
609 | + if (isset($this->_req_data['EVT_ID'])) { |
|
610 | 610 | $event_ids = $this->_req_data['EVT_ID']; |
611 | - }elseif(isset($this->_req_data['EVT_IDs'])){ |
|
611 | + }elseif (isset($this->_req_data['EVT_IDs'])) { |
|
612 | 612 | $event_ids = $this->_req_data['EVT_IDs']; |
613 | - }else{ |
|
613 | + } else { |
|
614 | 614 | $event_ids = NULL; |
615 | 615 | } |
616 | 616 | //todo: I don't like doing this but it'll do until we modify EE_Export Class. |
617 | 617 | $new_request_args = array( |
618 | 618 | 'export' => 'report', |
619 | 619 | 'action' => 'all_event_data', |
620 | - 'EVT_ID' => $event_ids , |
|
620 | + 'EVT_ID' => $event_ids, |
|
621 | 621 | ); |
622 | 622 | $this->_req_data = array_merge($this->_req_data, $new_request_args); |
623 | 623 | |
624 | - EE_Registry::instance()->load_helper( 'File' ); |
|
625 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
626 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
624 | + EE_Registry::instance()->load_helper('File'); |
|
625 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
626 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
627 | 627 | $EE_Export = EE_Export::instance($this->_req_data); |
628 | 628 | $EE_Export->export(); |
629 | 629 | } |
@@ -645,12 +645,12 @@ discard block |
||
645 | 645 | 'category_ids' => $this->_req_data['EVT_CAT_ID'] |
646 | 646 | ); |
647 | 647 | |
648 | - $this->_req_data = array_merge( $this->_req_data, $new_request_args ); |
|
648 | + $this->_req_data = array_merge($this->_req_data, $new_request_args); |
|
649 | 649 | |
650 | - EE_Registry::instance()->load_helper( 'File' ); |
|
651 | - if ( is_readable( EE_CLASSES . 'EE_Export.class.php') ) { |
|
652 | - require_once( EE_CLASSES . 'EE_Export.class.php'); |
|
653 | - $EE_Export = EE_Export::instance( $this->_req_data ); |
|
650 | + EE_Registry::instance()->load_helper('File'); |
|
651 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
652 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
653 | + $EE_Export = EE_Export::instance($this->_req_data); |
|
654 | 654 | $EE_Export->export(); |
655 | 655 | } |
656 | 656 | |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | /** |
662 | 662 | * Creates a sample CSV file for importing |
663 | 663 | */ |
664 | - protected function _sample_export_file(){ |
|
664 | + protected function _sample_export_file() { |
|
665 | 665 | // require_once(EE_CLASSES . 'EE_Export.class.php'); |
666 | 666 | EE_Export::instance()->export_sample(); |
667 | 667 | } |
@@ -678,10 +678,10 @@ discard block |
||
678 | 678 | * Note leaving this filter in for backward compatibility this was moved in 4.6.x |
679 | 679 | * from General_Settings_Admin_Page to here. |
680 | 680 | */ |
681 | - $this->_template_args = apply_filters( 'FHEE__General_Settings_Admin_Page__template_settings__template_args', $this->_template_args ); |
|
682 | - $this->_set_add_edit_form_tags( 'update_template_settings' ); |
|
683 | - $this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
|
684 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( EVENTS_CAF_TEMPLATE_PATH . 'template_settings.template.php', $this->_template_args, TRUE ); |
|
681 | + $this->_template_args = apply_filters('FHEE__General_Settings_Admin_Page__template_settings__template_args', $this->_template_args); |
|
682 | + $this->_set_add_edit_form_tags('update_template_settings'); |
|
683 | + $this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE); |
|
684 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(EVENTS_CAF_TEMPLATE_PATH.'template_settings.template.php', $this->_template_args, TRUE); |
|
685 | 685 | $this->display_admin_page_with_sidebar(); |
686 | 686 | } |
687 | 687 | |
@@ -693,24 +693,24 @@ discard block |
||
693 | 693 | * Note leaving this filter in for backward compatibility this was moved in 4.6.x |
694 | 694 | * from General_Settings_Admin_Page to here. |
695 | 695 | */ |
696 | - EE_Registry::instance()->CFG->template_settings = apply_filters( 'FHEE__General_Settings_Admin_Page__update_template_settings__data', EE_Registry::instance()->CFG->template_settings, $this->_req_data ); |
|
696 | + EE_Registry::instance()->CFG->template_settings = apply_filters('FHEE__General_Settings_Admin_Page__update_template_settings__data', EE_Registry::instance()->CFG->template_settings, $this->_req_data); |
|
697 | 697 | |
698 | 698 | |
699 | 699 | //update custom post type slugs and detect if we need to flush rewrite rules |
700 | 700 | $old_slug = EE_Registry::instance()->CFG->core->event_cpt_slug; |
701 | - EE_Registry::instance()->CFG->core->event_cpt_slug = empty( $this->_req_data['event_cpt_slug'] ) ? EE_Registry::instance()->CFG->core->event_cpt_slug : sanitize_title_with_dashes( $this->_req_data['event_cpt_slug'] ); |
|
701 | + EE_Registry::instance()->CFG->core->event_cpt_slug = empty($this->_req_data['event_cpt_slug']) ? EE_Registry::instance()->CFG->core->event_cpt_slug : sanitize_title_with_dashes($this->_req_data['event_cpt_slug']); |
|
702 | 702 | |
703 | 703 | |
704 | 704 | $what = 'Template Settings'; |
705 | - $success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG->template_settings, __FILE__, __FUNCTION__, __LINE__ ); |
|
705 | + $success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG->template_settings, __FILE__, __FUNCTION__, __LINE__); |
|
706 | 706 | |
707 | 707 | |
708 | - if ( EE_Registry::instance()->CFG->core->event_cpt_slug != $old_slug ) { |
|
709 | - update_option( 'ee_flush_rewrite_rules', true ); |
|
708 | + if (EE_Registry::instance()->CFG->core->event_cpt_slug != $old_slug) { |
|
709 | + update_option('ee_flush_rewrite_rules', true); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | |
713 | - $this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'template_settings' ) ); |
|
713 | + $this->_redirect_after_action($success, $what, 'updated', array('action' => 'template_settings')); |
|
714 | 714 | |
715 | 715 | } |
716 | 716 | |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | |
729 | 729 | $this->verify_cpt_object(); |
730 | 730 | |
731 | - add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array( $this, 'registration_options_meta_box' ), $this->page_slug, 'side', 'core'); |
|
731 | + add_meta_box('espresso_event_editor_event_options', __('Event Registration Options', 'event_espresso'), array($this, 'registration_options_meta_box'), $this->page_slug, 'side', 'core'); |
|
732 | 732 | //add_meta_box('espresso_event_types', __('Event Type', 'event_espresso'), array( $this, 'event_type_meta_box' ), $this->page_slug, 'side', 'default' ); //add this back in when the feature is ready. |
733 | 733 | |
734 | 734 | //todo feature in progress |
@@ -752,16 +752,16 @@ discard block |
||
752 | 752 | array('id' => true, 'text' => __('Yes', 'event_espresso')), |
753 | 753 | array('id' => false, 'text' => __('No', 'event_espresso')) |
754 | 754 | ); |
755 | - $default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete ), TRUE); |
|
755 | + $default_reg_status_values = EEM_Registration::reg_status_array(array(EEM_Registration::status_id_cancelled, EEM_Registration::status_id_declined, EEM_Registration::status_id_incomplete), TRUE); |
|
756 | 756 | $template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(FALSE); |
757 | 757 | $template_args['_event'] = $this->_cpt_model_obj; |
758 | 758 | $template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit(); |
759 | 759 | $template_args['default_registration_status'] = EEH_Form_Fields::select_input('default_reg_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status()); |
760 | 760 | $template_args['display_description'] = EEH_Form_Fields::select_input('display_desc', $yes_no_values, $this->_cpt_model_obj->display_description()); |
761 | 761 | $template_args['display_ticket_selector'] = EEH_Form_Fields::select_input('display_ticket_selector', $yes_no_values, $this->_cpt_model_obj->display_ticket_selector(), '', '', false); |
762 | - $template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status() ); |
|
763 | - $template_args['additional_registration_options'] = apply_filters( 'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values ); |
|
764 | - $templatepath = EVENTS_CAF_TEMPLATE_PATH . 'event_registration_options.template.php'; |
|
762 | + $template_args['EVT_default_registration_status'] = EEH_Form_Fields::select_input('EVT_default_registration_status', $default_reg_status_values, $this->_cpt_model_obj->default_registration_status()); |
|
763 | + $template_args['additional_registration_options'] = apply_filters('FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options', '', $template_args, $yes_no_values, $default_reg_status_values); |
|
764 | + $templatepath = EVENTS_CAF_TEMPLATE_PATH.'event_registration_options.template.php'; |
|
765 | 765 | EEH_Template::display_template($templatepath, $template_args); |
766 | 766 | } |
767 | 767 | |
@@ -774,9 +774,9 @@ discard block |
||
774 | 774 | * @param array $box metabox args |
775 | 775 | * @return string metabox contents |
776 | 776 | */ |
777 | - public function event_type_meta_box( $post, $box ) { |
|
778 | - $template_args['radio_list'] = $this->wp_terms_radio($post->ID, array( 'taxonomy' => 'espresso_event_type' ) ); |
|
779 | - $template = EVENTS_CAF_TEMPLATE_PATH . 'event_type_metabox_contents.template.php'; |
|
777 | + public function event_type_meta_box($post, $box) { |
|
778 | + $template_args['radio_list'] = $this->wp_terms_radio($post->ID, array('taxonomy' => 'espresso_event_type')); |
|
779 | + $template = EVENTS_CAF_TEMPLATE_PATH.'event_type_metabox_contents.template.php'; |
|
780 | 780 | EEH_Template::display_template($template, $template_args); |
781 | 781 | } |
782 | 782 | |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | |
787 | 787 | |
788 | 788 | |
789 | - public function wp_terms_radio( $post_id = 0, $args = array() ) { |
|
789 | + public function wp_terms_radio($post_id = 0, $args = array()) { |
|
790 | 790 | $defaults = array( |
791 | 791 | 'descendants_and_self' => 0, |
792 | 792 | 'selected_cats' => false, |
@@ -795,11 +795,11 @@ discard block |
||
795 | 795 | 'taxonomy' => 'category', |
796 | 796 | 'checked_ontop' => true |
797 | 797 | ); |
798 | - $args = apply_filters( 'wp_terms_checklist_args', $args, $post_id ); |
|
798 | + $args = apply_filters('wp_terms_checklist_args', $args, $post_id); |
|
799 | 799 | |
800 | - extract( wp_parse_args($args, $defaults), EXTR_SKIP ); |
|
800 | + extract(wp_parse_args($args, $defaults), EXTR_SKIP); |
|
801 | 801 | |
802 | - if ( empty($walker) || !is_a($walker, 'Walker') ) |
|
802 | + if (empty($walker) || ! is_a($walker, 'Walker')) |
|
803 | 803 | $walker = new Walker_Radio_Checklist; |
804 | 804 | |
805 | 805 | $descendants_and_self = (int) $descendants_and_self; |
@@ -807,37 +807,37 @@ discard block |
||
807 | 807 | $args = array('taxonomy' => $taxonomy); |
808 | 808 | |
809 | 809 | $tax = get_taxonomy($taxonomy); |
810 | - $args['disabled'] = !current_user_can($tax->cap->assign_terms); |
|
810 | + $args['disabled'] = ! current_user_can($tax->cap->assign_terms); |
|
811 | 811 | |
812 | - if ( is_array( $selected_cats ) ) |
|
812 | + if (is_array($selected_cats)) |
|
813 | 813 | $args['selected_cats'] = $selected_cats; |
814 | - elseif ( $post_id ) |
|
814 | + elseif ($post_id) |
|
815 | 815 | $args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids'))); |
816 | 816 | else |
817 | 817 | $args['selected_cats'] = array(); |
818 | 818 | |
819 | - if ( is_array( $popular_cats ) ) |
|
819 | + if (is_array($popular_cats)) |
|
820 | 820 | $args['popular_cats'] = $popular_cats; |
821 | 821 | else |
822 | - $args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); |
|
822 | + $args['popular_cats'] = get_terms($taxonomy, array('fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false)); |
|
823 | 823 | |
824 | - if ( $descendants_and_self ) { |
|
825 | - $categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) ); |
|
826 | - $self = get_term( $descendants_and_self, $taxonomy ); |
|
827 | - array_unshift( $categories, $self ); |
|
824 | + if ($descendants_and_self) { |
|
825 | + $categories = (array) get_terms($taxonomy, array('child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0)); |
|
826 | + $self = get_term($descendants_and_self, $taxonomy); |
|
827 | + array_unshift($categories, $self); |
|
828 | 828 | } else { |
829 | 829 | $categories = (array) get_terms($taxonomy, array('get' => 'all')); |
830 | 830 | } |
831 | 831 | |
832 | - if ( $checked_ontop ) { |
|
832 | + if ($checked_ontop) { |
|
833 | 833 | // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache) |
834 | 834 | $checked_categories = array(); |
835 | - $keys = array_keys( $categories ); |
|
835 | + $keys = array_keys($categories); |
|
836 | 836 | |
837 | - foreach( $keys as $k ) { |
|
838 | - if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) { |
|
837 | + foreach ($keys as $k) { |
|
838 | + if (in_array($categories[$k]->term_id, $args['selected_cats'])) { |
|
839 | 839 | $checked_categories[] = $categories[$k]; |
840 | - unset( $categories[$k] ); |
|
840 | + unset($categories[$k]); |
|
841 | 841 | } |
842 | 842 | } |
843 | 843 | |
@@ -862,18 +862,18 @@ discard block |
||
862 | 862 | * @param array $list_table_obj the list table object |
863 | 863 | * @return array new filters |
864 | 864 | */ |
865 | - public function list_table_filters( $oldfilters, $list_table_obj ) { |
|
865 | + public function list_table_filters($oldfilters, $list_table_obj) { |
|
866 | 866 | $filters = array(); |
867 | 867 | |
868 | 868 | //first month/year filters |
869 | 869 | $filters[] = $this->espresso_event_months_dropdown(); |
870 | 870 | |
871 | 871 | |
872 | - $status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL; |
|
872 | + $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL; |
|
873 | 873 | |
874 | 874 | //active status dropdown |
875 | - if ( $status !== 'draft' ) |
|
876 | - $filter[] = $this->active_status_dropdown( isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : '' ); |
|
875 | + if ($status !== 'draft') |
|
876 | + $filter[] = $this->active_status_dropdown(isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : ''); |
|
877 | 877 | |
878 | 878 | //category filter |
879 | 879 | $filters[] = $this->category_dropdown(); |
@@ -895,17 +895,17 @@ discard block |
||
895 | 895 | */ |
896 | 896 | public function espresso_event_months_dropdown() { |
897 | 897 | //what we need to do is get all PRIMARY datetimes for all events to filter on. Note we need to include any other filters that are set! |
898 | - $status = isset( $this->_req_data['status'] ) ? $this->_req_data['status'] : NULL; |
|
898 | + $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : NULL; |
|
899 | 899 | |
900 | 900 | //categories? |
901 | - $category = isset( $this->_req_data['EVT_CAT'] ) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL; |
|
901 | + $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0 ? $this->_req_data['EVT_CAT'] : NULL; |
|
902 | 902 | |
903 | 903 | //active status? |
904 | - $active_status = isset( $this->_req_data['active_status'] ) ? $this->_req_data['active_status'] : NULL; |
|
904 | + $active_status = isset($this->_req_data['active_status']) ? $this->_req_data['active_status'] : NULL; |
|
905 | 905 | |
906 | 906 | $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : ''; |
907 | 907 | |
908 | - return EEH_Form_Fields::generate_event_months_dropdown( $cur_date, $status, $category, $active_status ); |
|
908 | + return EEH_Form_Fields::generate_event_months_dropdown($cur_date, $status, $category, $active_status); |
|
909 | 909 | } |
910 | 910 | |
911 | 911 | |
@@ -916,12 +916,12 @@ discard block |
||
916 | 916 | * @param string $current_value whatever the ucrrent active status is |
917 | 917 | * @return string html dropdown. |
918 | 918 | */ |
919 | - public function active_status_dropdown( $current_value = '' ) { |
|
919 | + public function active_status_dropdown($current_value = '') { |
|
920 | 920 | $select_name = 'active_status'; |
921 | - $values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso') ); |
|
921 | + $values = array('none' => __('Show Active/Inactive', 'event_espresso'), 'active' => __('Active', 'event_espresso'), 'upcoming' => __('Upcoming', 'event_espresso'), 'expired' => __('Expired', 'event_espresso'), 'inactive' => __('Inactive', 'event_espresso')); |
|
922 | 922 | $id = 'id="espresso-active-status-dropdown-filter"'; |
923 | 923 | $class = 'wide'; |
924 | - echo EEH_Form_Fields::select_input( $select_name, $values, $current_value, $id, $class ); |
|
924 | + echo EEH_Form_Fields::select_input($select_name, $values, $current_value, $id, $class); |
|
925 | 925 | } |
926 | 926 | |
927 | 927 | |
@@ -933,9 +933,9 @@ discard block |
||
933 | 933 | * @return string html |
934 | 934 | */ |
935 | 935 | public function category_dropdown() { |
936 | - $cur_cat = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1; |
|
936 | + $cur_cat = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1; |
|
937 | 937 | |
938 | - return EEH_Form_Fields::generate_event_category_dropdown( $cur_cat ); |
|
938 | + return EEH_Form_Fields::generate_event_category_dropdown($cur_cat); |
|
939 | 939 | } |
940 | 940 | |
941 | 941 | |
@@ -951,10 +951,10 @@ discard block |
||
951 | 951 | $end = ' 23:59:59'; |
952 | 952 | |
953 | 953 | $where = array( |
954 | - 'Datetime.DTT_EVT_start' => array( 'BETWEEN', array(strtotime(date('Y-m-d') . $start), strtotime(date('Y-m-d') . $end) ) ) |
|
954 | + 'Datetime.DTT_EVT_start' => array('BETWEEN', array(strtotime(date('Y-m-d').$start), strtotime(date('Y-m-d').$end))) |
|
955 | 955 | ); |
956 | 956 | |
957 | - $count = EEM_Event::instance()->count( array( $where ), 'EVT_ID' ); |
|
957 | + $count = EEM_Event::instance()->count(array($where), 'EVT_ID'); |
|
958 | 958 | return $count; |
959 | 959 | } |
960 | 960 | |
@@ -973,10 +973,10 @@ discard block |
||
973 | 973 | $end = ' 23:59:59'; |
974 | 974 | |
975 | 975 | $where = array( |
976 | - 'Datetime.DTT_EVT_start' => array( 'BETWEEN', array(strtotime($this_year_r . '-' . $this_month_r . '-01' . $start), strtotime($this_year_r . '-' . $this_month_r . '-' . $days_this_month . $end) ) ) |
|
976 | + 'Datetime.DTT_EVT_start' => array('BETWEEN', array(strtotime($this_year_r.'-'.$this_month_r.'-01'.$start), strtotime($this_year_r.'-'.$this_month_r.'-'.$days_this_month.$end))) |
|
977 | 977 | ); |
978 | 978 | |
979 | - $count = EEM_Event::instance()->count( array( $where ), 'EVT_ID', TRUE ); |
|
979 | + $count = EEM_Event::instance()->count(array($where), 'EVT_ID', TRUE); |
|
980 | 980 | return $count; |
981 | 981 | } |
982 | 982 | |
@@ -993,53 +993,53 @@ discard block |
||
993 | 993 | |
994 | 994 | |
995 | 995 | |
996 | - public function get_default_tickets( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
|
996 | + public function get_default_tickets($per_page = 10, $count = FALSE, $trashed = FALSE) { |
|
997 | 997 | |
998 | - $orderby= empty( $this->_req_data['orderby'] ) ? 'TKT_name' : $this->_req_data['orderby']; |
|
999 | - $order = empty( $this->_req_data['order'] ) ? 'ASC' : $this->_req_data['order']; |
|
998 | + $orderby = empty($this->_req_data['orderby']) ? 'TKT_name' : $this->_req_data['orderby']; |
|
999 | + $order = empty($this->_req_data['order']) ? 'ASC' : $this->_req_data['order']; |
|
1000 | 1000 | |
1001 | - switch ( $orderby ) { |
|
1001 | + switch ($orderby) { |
|
1002 | 1002 | case 'TKT_name' : |
1003 | - $orderby = array( 'TKT_name' => $order ); |
|
1003 | + $orderby = array('TKT_name' => $order); |
|
1004 | 1004 | break; |
1005 | 1005 | |
1006 | 1006 | case 'TKT_price' : |
1007 | - $orderby = array( 'TKT_price' => $order ); |
|
1007 | + $orderby = array('TKT_price' => $order); |
|
1008 | 1008 | break; |
1009 | 1009 | |
1010 | 1010 | case 'TKT_uses' : |
1011 | - $orderby = array( 'TKT_uses' => $order ); |
|
1011 | + $orderby = array('TKT_uses' => $order); |
|
1012 | 1012 | break; |
1013 | 1013 | |
1014 | 1014 | case 'TKT_min' : |
1015 | - $orderby = array( 'TKT_min' => $order ); |
|
1015 | + $orderby = array('TKT_min' => $order); |
|
1016 | 1016 | break; |
1017 | 1017 | |
1018 | 1018 | case 'TKT_max' : |
1019 | - $orderby = array( 'TKT_max' => $order ); |
|
1019 | + $orderby = array('TKT_max' => $order); |
|
1020 | 1020 | break; |
1021 | 1021 | |
1022 | 1022 | case 'TKT_qty' : |
1023 | - $orderby = array( 'TKT_qty' => $order ); |
|
1023 | + $orderby = array('TKT_qty' => $order); |
|
1024 | 1024 | break; |
1025 | 1025 | } |
1026 | 1026 | |
1027 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
1028 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
1027 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
1028 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
1029 | 1029 | |
1030 | 1030 | $_where = array( |
1031 | 1031 | 'TKT_is_default' => 1, |
1032 | 1032 | 'TKT_deleted' => $trashed |
1033 | 1033 | ); |
1034 | 1034 | |
1035 | - $offset = ($current_page-1)*$per_page; |
|
1036 | - $limit = array( $offset, $per_page ); |
|
1035 | + $offset = ($current_page - 1) * $per_page; |
|
1036 | + $limit = array($offset, $per_page); |
|
1037 | 1037 | |
1038 | - if ( isset( $this->_req_data['s'] ) ) { |
|
1039 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
1038 | + if (isset($this->_req_data['s'])) { |
|
1039 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1040 | 1040 | $_where['OR'] = array( |
1041 | - 'TKT_name' => array('LIKE',$sstr ), |
|
1042 | - 'TKT_description' => array('LIKE',$sstr ) |
|
1041 | + 'TKT_name' => array('LIKE', $sstr), |
|
1042 | + 'TKT_description' => array('LIKE', $sstr) |
|
1043 | 1043 | ); |
1044 | 1044 | } |
1045 | 1045 | |
@@ -1050,9 +1050,9 @@ discard block |
||
1050 | 1050 | 'group_by'=>'TKT_ID' |
1051 | 1051 | ); |
1052 | 1052 | |
1053 | - if($count){ |
|
1053 | + if ($count) { |
|
1054 | 1054 | return EEM_Ticket::instance()->count_deleted_and_undeleted(array($_where)); |
1055 | - }else{ |
|
1055 | + } else { |
|
1056 | 1056 | return EEM_Ticket::instance()->get_all_deleted_and_undeleted($query_params); |
1057 | 1057 | } |
1058 | 1058 | |
@@ -1062,35 +1062,35 @@ discard block |
||
1062 | 1062 | |
1063 | 1063 | |
1064 | 1064 | |
1065 | - protected function _trash_or_restore_ticket( $trash = FALSE ) { |
|
1065 | + protected function _trash_or_restore_ticket($trash = FALSE) { |
|
1066 | 1066 | $success = 1; |
1067 | 1067 | |
1068 | 1068 | $TKT = EEM_Ticket::instance(); |
1069 | 1069 | |
1070 | 1070 | //checkboxes? |
1071 | - if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { |
|
1071 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1072 | 1072 | //if array has more than one element then success message should be plural |
1073 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
1073 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1074 | 1074 | |
1075 | 1075 | //cycle thru the boxes |
1076 | - while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
|
1077 | - if ( $trash ) { |
|
1078 | - if ( ! $TKT->delete_by_ID( $TKT_ID ) ) |
|
1076 | + while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
1077 | + if ($trash) { |
|
1078 | + if ( ! $TKT->delete_by_ID($TKT_ID)) |
|
1079 | 1079 | $success = 0; |
1080 | 1080 | } else { |
1081 | - if ( ! $TKT->restore_by_ID( $TKT_ID ) ) |
|
1081 | + if ( ! $TKT->restore_by_ID($TKT_ID)) |
|
1082 | 1082 | $success = 0; |
1083 | 1083 | } |
1084 | 1084 | } |
1085 | 1085 | } else { |
1086 | 1086 | //grab single id and trash |
1087 | - $TKT_ID = absint( $this->_req_data['TKT_ID'] ); |
|
1087 | + $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
1088 | 1088 | |
1089 | - if ( $trash ) { |
|
1090 | - if ( ! $TKT->delete_by_ID( $TKT_ID ) ) |
|
1089 | + if ($trash) { |
|
1090 | + if ( ! $TKT->delete_by_ID($TKT_ID)) |
|
1091 | 1091 | $success = 0; |
1092 | 1092 | } else { |
1093 | - if ( ! $TKT->restore_by_ID( $TKT_ID ) ) |
|
1093 | + if ( ! $TKT->restore_by_ID($TKT_ID)) |
|
1094 | 1094 | $success = 0; |
1095 | 1095 | } |
1096 | 1096 | } |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | 'action' => 'ticket_list_table', |
1101 | 1101 | 'status' => $trash ? '' : 'trashed' |
1102 | 1102 | ); |
1103 | - $this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args ); |
|
1103 | + $this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args); |
|
1104 | 1104 | } |
1105 | 1105 | |
1106 | 1106 | |
@@ -1113,21 +1113,21 @@ discard block |
||
1113 | 1113 | $TKT = EEM_Ticket::instance(); |
1114 | 1114 | |
1115 | 1115 | //checkboxes? |
1116 | - if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { |
|
1116 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1117 | 1117 | //if array has more than one element then success message should be plural |
1118 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
1118 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1119 | 1119 | |
1120 | 1120 | //cycle thru the boxes |
1121 | - while ( list( $TKT_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
|
1121 | + while (list($TKT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
1122 | 1122 | //delete |
1123 | - if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { |
|
1123 | + if ( ! $this->_delete_the_ticket($TKT_ID)) { |
|
1124 | 1124 | $success = 0; |
1125 | 1125 | } |
1126 | 1126 | } |
1127 | 1127 | } else { |
1128 | 1128 | //grab single id and trash |
1129 | - $TKT_ID = absint( $this->_req_data['TKT_ID'] ); |
|
1130 | - if ( ! $this->_delete_the_ticket( $TKT_ID ) ) { |
|
1129 | + $TKT_ID = absint($this->_req_data['TKT_ID']); |
|
1130 | + if ( ! $this->_delete_the_ticket($TKT_ID)) { |
|
1131 | 1131 | $success = 0; |
1132 | 1132 | } |
1133 | 1133 | } |
@@ -1139,16 +1139,16 @@ discard block |
||
1139 | 1139 | ); |
1140 | 1140 | |
1141 | 1141 | //failsafe. If the default ticket count === 1 then we need to redirect to event overview. |
1142 | - if ( EEM_Ticket::instance()->count_deleted_and_undeleted( array( array( 'TKT_is_default' => 1 ) ), 'TKT_ID', TRUE ) ) |
|
1142 | + if (EEM_Ticket::instance()->count_deleted_and_undeleted(array(array('TKT_is_default' => 1)), 'TKT_ID', TRUE)) |
|
1143 | 1143 | $query_args = array(); |
1144 | - $this->_redirect_after_action( $success, 'Tickets', $action_desc, $query_args ); |
|
1144 | + $this->_redirect_after_action($success, 'Tickets', $action_desc, $query_args); |
|
1145 | 1145 | } |
1146 | 1146 | |
1147 | 1147 | |
1148 | 1148 | |
1149 | 1149 | |
1150 | - protected function _delete_the_ticket( $TKT_ID ) { |
|
1151 | - $tkt = EEM_Ticket::instance()->get_one_by_ID( $TKT_ID ); |
|
1150 | + protected function _delete_the_ticket($TKT_ID) { |
|
1151 | + $tkt = EEM_Ticket::instance()->get_one_by_ID($TKT_ID); |
|
1152 | 1152 | $tkt->_remove_relations('Datetime'); |
1153 | 1153 | //delete all related prices first |
1154 | 1154 | $tkt->delete_related_permanently('Price'); |
@@ -1159,20 +1159,20 @@ discard block |
||
1159 | 1159 | |
1160 | 1160 | } //end class Events_Admin_Page |
1161 | 1161 | |
1162 | -require_once ABSPATH . 'wp-admin/includes/template.php'; |
|
1162 | +require_once ABSPATH.'wp-admin/includes/template.php'; |
|
1163 | 1163 | class Walker_Radio_Checklist extends Walker_Category_Checklist { |
1164 | 1164 | |
1165 | - function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { |
|
1165 | + function start_el(&$output, $category, $depth = 0, $args = array(), $id = 0) { |
|
1166 | 1166 | extract($args); |
1167 | - if ( empty($taxonomy) ) |
|
1167 | + if (empty($taxonomy)) |
|
1168 | 1168 | $taxonomy = 'category'; |
1169 | 1169 | |
1170 | - if ( $taxonomy == 'category' ) |
|
1170 | + if ($taxonomy == 'category') |
|
1171 | 1171 | $name = 'post_category'; |
1172 | 1172 | else |
1173 | 1173 | $name = 'tax_input['.$taxonomy.']'; |
1174 | 1174 | |
1175 | 1175 | $class = ''; |
1176 | - $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="radio" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>'; |
|
1176 | + $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>".'<label class="selectit"><input value="'.$category->term_id.'" type="radio" name="'.$name.'[]" id="in-'.$taxonomy.'-'.$category->term_id.'"'.checked(in_array($category->term_id, $selected_cats), true, false).disabled(empty($args['disabled']), false, false).' /> '.esc_html(apply_filters('the_category', $category->name)).'</label>'; |
|
1177 | 1177 | } |
1178 | 1178 | } |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | |
32 | 32 | protected function _setup_data() { |
33 | 33 | $trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE; |
34 | - $this->_data = $this->_admin_page->get_default_tickets( $this->_per_page, FALSE, $trashed ); |
|
35 | - $this->_all_data_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, FALSE ); |
|
36 | - $this->_trashed_count = $this->_admin_page->get_default_tickets( $this->_per_page, TRUE, TRUE ); |
|
34 | + $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, FALSE, $trashed); |
|
35 | + $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, FALSE); |
|
36 | + $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, TRUE, TRUE); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | |
62 | 62 | $this->_sortable_columns = array( |
63 | 63 | // TRUE means its already sorted |
64 | - 'TKT_name' => array( 'TKT_name' => TRUE ), |
|
65 | - 'TKT_description' => array( 'TKT_description' => FALSE ), |
|
66 | - 'TKT_qty' => array( 'TKT_qty' => FALSE ), |
|
67 | - 'TKT_uses' => array( 'TKT_uses' => FALSE ), |
|
68 | - 'TKT_min' => array( 'TKT_min' => FALSE ), |
|
69 | - 'TKT_max' => array( 'TKT_max' => FALSE ), |
|
70 | - 'TKT_price' => array( 'TKT_price' => FALSE ) |
|
64 | + 'TKT_name' => array('TKT_name' => TRUE), |
|
65 | + 'TKT_description' => array('TKT_description' => FALSE), |
|
66 | + 'TKT_qty' => array('TKT_qty' => FALSE), |
|
67 | + 'TKT_uses' => array('TKT_uses' => FALSE), |
|
68 | + 'TKT_min' => array('TKT_min' => FALSE), |
|
69 | + 'TKT_max' => array('TKT_max' => FALSE), |
|
70 | + 'TKT_price' => array('TKT_price' => FALSE) |
|
71 | 71 | ); |
72 | 72 | |
73 | 73 | $this->_hidden_columns = array( |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | |
95 | 95 | function column_cb($item) { |
96 | - return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
96 | + return $item->ID() === 1 ? '<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID()); |
|
97 | 97 | |
98 | 98 | } |
99 | 99 | |
@@ -104,21 +104,21 @@ discard block |
||
104 | 104 | $actions = array(); |
105 | 105 | |
106 | 106 | //trash links |
107 | - if ( $item->ID() !== 1 ) { |
|
108 | - if ( $this->_view == 'all' ) { |
|
109 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'trash_ticket', 'TKT_ID' => $item->ID() ), EVENTS_ADMIN_URL ); |
|
110 | - $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
107 | + if ($item->ID() !== 1) { |
|
108 | + if ($this->_view == 'all') { |
|
109 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_ticket', 'TKT_ID' => $item->ID()), EVENTS_ADMIN_URL); |
|
110 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Ticket to trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
111 | 111 | } else { |
112 | 112 | // restore price link |
113 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_ticket', 'TKT_ID'=>$item->ID() ), EVENTS_ADMIN_URL ); |
|
114 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Ticket', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
113 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_ticket', 'TKT_ID'=>$item->ID()), EVENTS_ADMIN_URL); |
|
114 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Ticket', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
115 | 115 | // delete price link |
116 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_ticket', 'TKT_ID'=>$item->ID() ), EVENTS_ADMIN_URL ); |
|
117 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Ticket Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>'; |
|
116 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_ticket', 'TKT_ID'=>$item->ID()), EVENTS_ADMIN_URL); |
|
117 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Ticket Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
121 | - return $item->get('TKT_name') . $this->row_actions( $actions ); |
|
121 | + return $item->get('TKT_name').$this->row_actions($actions); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | |
132 | 132 | |
133 | 133 | function column_TKT_qty($item) { |
134 | - return $item->get_pretty('TKT_qty','text'); |
|
134 | + return $item->get_pretty('TKT_qty', 'text'); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | |
138 | 138 | |
139 | 139 | function column_TKT_uses($item) { |
140 | - return $item->get_pretty('TKT_uses','text'); |
|
140 | + return $item->get_pretty('TKT_uses', 'text'); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | |
150 | 150 | function column_TKT_max($item) { |
151 | - return $item->get_pretty('TKT_max','text'); |
|
151 | + return $item->get_pretty('TKT_max', 'text'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'TKT_taxable' => __('Taxable', 'event_espresso') |
60 | 60 | ); |
61 | 61 | |
62 | - $this->_sortable_columns = array( |
|
62 | + $this->_sortable_columns = array( |
|
63 | 63 | // TRUE means its already sorted |
64 | 64 | 'TKT_name' => array( 'TKT_name', TRUE ), |
65 | 65 | 'TKT_description' => array( 'TKT_description', FALSE ), |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | 'TKT_min' => array( 'TKT_min', FALSE ), |
69 | 69 | 'TKT_max' => array( 'TKT_max', FALSE ), |
70 | 70 | 'TKT_price' => array( 'TKT_price', FALSE ) |
71 | - ); |
|
71 | + ); |
|
72 | 72 | |
73 | - $this->_hidden_columns = array( |
|
73 | + $this->_hidden_columns = array( |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -2,19 +2,19 @@ |
||
2 | 2 | <p> |
3 | 3 | <?php _e('The importer can be used to import event information into Event Espresso using a CSV file.', 'event_espresso'); ?> |
4 | 4 | </p> |
5 | -<h3><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso');?></h3> |
|
5 | +<h3><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso'); ?></h3> |
|
6 | 6 | <p> |
7 | 7 | <?php _e('To import Event Espresso data from another Event Espresso 4 install, export a CSV file from the admin Events overview page, or anywhere you can generate a CSV export file from. Then upload that file here (regardless of what type of information was exported).', 'event_espresso'); ?> |
8 | 8 | </p> |
9 | 9 | <p> |
10 | 10 | <?php _e('Note: its possible that data from the other site have the same IDs as data in this site. The importer recognizes that this data is from a different database and inserts new items for each item in the CSV file, regardless of whether its ID matches that of an item in this site\'s database or not. However, the importer also remembers the mapping from the old site\'s database to this site\'s database, and on subsequent CSV importers from that site, the data in this database will be updated instead of re-inserting new items.', 'event_espresso'); ?> |
11 | 11 | </p> |
12 | -<h3><?php _e("Importing from this Site", 'event_espresso');?></h3> |
|
13 | -<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso');?></p> |
|
12 | +<h3><?php _e("Importing from this Site", 'event_espresso'); ?></h3> |
|
13 | +<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso'); ?></p> |
|
14 | 14 | |
15 | - <h3><?php _e("Notes about Generating your own CSV Import Files", "event_espresso");?></h3> |
|
16 | - <p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso");?></p> |
|
17 | - <p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso");?></p> |
|
15 | + <h3><?php _e("Notes about Generating your own CSV Import Files", "event_espresso"); ?></h3> |
|
16 | + <p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso"); ?></p> |
|
17 | + <p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso"); ?></p> |
|
18 | 18 | <p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, |
19 | - if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso");?></p> |
|
20 | - <p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso");?></p> |
|
21 | 19 | \ No newline at end of file |
20 | + if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso"); ?></p> |
|
21 | + <p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso"); ?></p> |
|
22 | 22 | \ No newline at end of file |