/**
  * _request_filesystem_credentials
  * if attempting to enable full logging, WordPress may require filesystem credentials for FTP or SSH depending on the server
  *
  * @access   protected
  * @param bool $show_errors
  * @return bool
  */
 protected function _request_filesystem_credentials($show_errors = TRUE)
 {
     require_once ABSPATH . 'wp-admin/includes/file.php';
     $url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'request_filesystem_credentials'), $this->_admin_base_url);
     $credentials = request_filesystem_credentials($url);
     if ($credentials == FALSE) {
         if ($show_errors) {
             EE_Error::get_notices(FALSE);
             EE_Error::reset_notices();
             EE_Error::add_error(__('Connection settings are missing or incorrect. Please verify that the connection settings below are correct.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
             add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false');
         }
         return FALSE;
     }
     // now we have some credentials, try to get the wp_filesystem running
     $WP_Filesystem = WP_Filesystem($credentials);
     if (!$WP_Filesystem) {
         if ($show_errors) {
             EE_Error::get_notices(FALSE);
             EE_Error::reset_notices();
             EE_Error::add_error(__('There was an error connecting to the server. Please verify that the connection settings below are correct.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
             add_filter('FHEE__General_Settings_Admin_Page___update_admin_option_settings__success', '__return_false');
         }
         // our credentials were no good, ask the user for them again
         request_filesystem_credentials($url);
         return FALSE;
     }
     EE_Registry::instance()->CFG->admin->use_full_logging = TRUE;
     return TRUE;
 }
 public function column_display_text(EE_Question $item)
 {
     $system_question = $item->is_system_question();
     $actions = array();
     if (!defined('REG_ADMIN_URL')) {
         define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
     }
     $edit_query_args = array('action' => 'edit_question', 'QST_ID' => $item->ID());
     $trash_query_args = array('action' => 'trash_question', 'QST_ID' => $item->ID());
     $restore_query_args = array('action' => 'restore_question', 'QST_ID' => $item->ID());
     $delete_query_args = array('action' => 'delete_questions', 'QST_ID' => $item->ID());
     $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
     $trash_link = EE_Admin_Page::add_query_args_and_nonce($trash_query_args, EE_FORMS_ADMIN_URL);
     $restore_link = EE_Admin_Page::add_query_args_and_nonce($restore_query_args, EE_FORMS_ADMIN_URL);
     $delete_link = EE_Admin_Page::add_query_args_and_nonce($delete_query_args, EE_FORMS_ADMIN_URL);
     if (EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID())) {
         $actions = array('edit' => '<a href="' . $edit_link . '" title="' . __('Edit Question', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>');
     }
     if (!$system_question && $this->_view != 'trash' && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_trash_question', $item->ID())) {
         $actions['delete'] = '<a href="' . $trash_link . '" title="' . __('Trash Question', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
     }
     if ($this->_view == 'trash') {
         if (EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_restore_question', $item->ID())) {
             $actions['restore'] = '<a href="' . $restore_link . '" title="' . __('Restore Question', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
         }
         if ($item->count_related('Answer') === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_question', 'espresso_registration_form_delete_questions', $item->ID())) {
             $actions['delete_permanently'] = '<a href="' . $delete_link . '" title="' . __('Delete Question Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
         }
     }
     $content = EE_Registry::instance()->CAP->current_user_can('ee_edit_question', 'espresso_registration_form_edit_question', $item->ID()) ? '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>' : $item->display_text();
     $content .= $this->row_actions($actions);
     return $content;
 }
 public function column_count($item)
 {
     $e_args = array('action' => 'default', 'category' => $item->get_first_related('Term')->ID());
     $e_link = EE_Admin_Page::add_query_args_and_nonce($e_args, EE_VENUES_ADMIN_URL);
     $content = '<a href="' . $e_link . '">' . $item->get('term_count') . '</a>';
     return $content;
 }
 function column_CHK_timestamp(EE_Checkin $item)
 {
     $actions = array();
     $delete_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'delete_checkin_row', 'DTT_ID' => $this->_req_data['DTT_ID'], '_REGID' => $this->_req_data['_REGID'], 'CHK_ID' => $item->ID()));
     $actions['delete_checkin'] = EE_Registry::instance()->CAP->current_user_can('ee_delete_checkins', 'espresso_registrations_delete_checkin_row') ? '<a href="' . $delete_url . '" title="' . esc_attr__('Click here to delete this check-in record', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>' : '';
     return sprintf('%1$s %2$s', $item->get_datetime('CHK_timestamp'), $this->row_actions($actions));
 }
 function column_ATT_fname($item)
 {
     //Build row actions
     $actions = array();
     // edit attendee link
     if (EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee')) {
         $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $item->ID()), REG_ADMIN_URL);
         $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('Edit Contact', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
     }
     if ($this->_view == 'in_use') {
         // trash attendee link
         if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) {
             $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_attendees', 'ATT_ID' => $item->ID()), REG_ADMIN_URL);
             $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Contact to Trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
         }
     } else {
         if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_restore_attendees')) {
             // restore attendee link
             $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'restore_attendees', 'ATT_ID' => $item->ID()), REG_ADMIN_URL);
             $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' . esc_attr__('Restore Contact', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
         }
     }
     $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $item->ID()), REG_ADMIN_URL);
     $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('Edit Contact', 'event_espresso') . '">' . $item->fname() . '</a>' : $item->fname();
     //Return the name contents
     return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions));
 }
 protected function _column_name_action_setup(EE_Event $item)
 {
     $export_query_args = array('action' => 'export_events', 'EVT_ID' => $item->ID());
     $export_event_link = EE_Admin_Page::add_query_args_and_nonce($export_query_args, EVENTS_ADMIN_URL);
     $actions = parent::_column_name_action_setup($item);
     //		$actions['export'] = '<a href="' . $export_event_link . '" title="' . __('Export Event', 'event_espresso') . '">' . __('Export', 'event_espresso') . '</a>';
     return $actions;
 }
コード例 #7
0
    /**
     * Checks that there is at least one active gateway. If not, add a notice
     */
    public function check_payment_gateway_setup()
    {
        $actives = EE_Config::instance()->gateway->active_gateways;
        if (!$actives || count($actives) < 1) {
            $url = EE_Admin_Page::add_query_args_and_nonce(array(), EE_PAYMENTS_ADMIN_URL);
            echo '<div class="error">
				 <p>' . sprintf(__("There are no Active Payment Methods setup for Event Espresso. Please %s activate at least one.%s", "event_espresso"), "<a href='{$url}'>", "</a>") . '</p>
			 </div>';
        }
    }
コード例 #8
0
    /**
     *	@ generates HTML for a file upload input and form
     *	@ access 	public
     * 	@param 	string 		$title - heading for the form
     * 	@param 	string 		$intro - additional text explaing what to do
     * 	@param 	string 		$page - EE Admin page to direct form to - in the form "espresso_{pageslug}"
     * 	@param 	string 		$action - EE Admin page route array "action" that form will direct to
     * 	@param 	string 		$type - type of file to import
     *	@ return 	string
     */
    public function upload_form($title, $intro, $form_url, $action, $type)
    {
        $form_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => $action), $form_url);
        ob_start();
        ?>
	<div class="ee-upload-form-dv">
		<h3><?php 
        echo $title;
        ?>
</h3>
		<p><?php 
        echo $intro;
        ?>
</p>

		<form action="<?php 
        echo $form_url;
        ?>
" method="post" enctype="multipart/form-data">
			<input type="hidden" name="csv_submitted" value="TRUE" id="<?php 
        echo time();
        ?>
">
			<input name="import" type="hidden" value="<?php 
        echo $type;
        ?>
" />
			<input type="file" name="file[]" size="90" >
			<input class="button-primary" type="submit" value="<?php 
        _e('Upload File', 'event_espresso');
        ?>
">
		</form>

		<p class="ee-attention">
			<b><?php 
        _e('Attention', 'event_espresso');
        ?>
</b><br/>
			<?php 
        echo sprintf(__('Accepts .%s file types only.', 'event_espresso'), $type);
        ?>
			<?php 
        echo __('Please only import CSV files exported from Event Espresso, or compatible 3rd-party software.', 'event_espresso');
        ?>
		</p>

	</div>

<?php 
        $uploader = ob_get_clean();
        return $uploader;
    }
 public function column_display_text(EE_Question $item)
 {
     $system_question = $item->is_system_question();
     if (!defined('REG_ADMIN_URL')) {
         define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
     }
     $edit_query_args = array('action' => 'edit_question', 'QST_ID' => $item->ID());
     $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EE_FORMS_ADMIN_URL);
     $actions = array('edit' => '<a href="' . $edit_link . '" title="' . __('Edit Event', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>');
     $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->display_text() . '</a></strong>';
     $content .= $this->row_actions($actions);
     return $content;
 }
 /**
  * 		column_default
  */
 function column_DTT_EVT_start(EE_Registration $item)
 {
     $datetime_strings = array();
     $remove_defaults = array('default_where_conditions' => 'none');
     $ticket = $item->ticket();
     $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array();
     $query_args = array('action' => 'event_registrations', 'event_id' => $item->event_ID());
     foreach ($datetimes as $datetime) {
         $query_args['DTT_ID'] = $datetime->ID();
         $checkin_url = EE_Admin_Page::add_query_args_and_nonce($query_args, REG_ADMIN_URL);
         $datetime_strings[] = EE_Registry::instance()->CAP->current_user_can('ee_read_checkin', 'espresso_registrations_registration_checkins', $item->ID()) ? '<a href="' . $checkin_url . '" title="' . esc_attr__('View Checkins for this Event', 'event_espresso') . '">' . $datetime->get_i18n_datetime('DTT_EVT_start') . '</a>' : $datetime->get_i18n_datetime('DTT_EVT_start');
     }
     return implode("<br />", $datetime_strings);
 }
コード例 #11
0
    /**
     * Checks if we're in maintenance mode, and if so we notify the admin adn tell them how to take the site OUT of maintenance mode
     */
    public function check_maintenance_mode()
    {
        if (EE_Maintenance_Mode::instance()->level()) {
            $maintenance_page_url = EE_Admin_Page::add_query_args_and_nonce(array(), EE_MAINTENANCE_ADMIN_URL);
            switch (EE_Maintenance_Mode::instance()->level()) {
                case EE_Maintenance_Mode::level_1_frontend_only_maintenance:
                    echo '<div class="updated">
						<p>' . sprintf(__("Event Espresso is in Frontend-Only MAINTENANCE MODE. This means the front-end (ie, non-wp-admin pages) is disabled for ALL users except site admins. Visit the %s Maintenance Page %s to disable maintenance mode.", "event_espresso"), "<a href='{$maintenance_page_url}'>", "</a>") . '</div>';
                    break;
                case EE_Maintenance_Mode::level_2_complete_maintenance:
                    echo '<div class="error">
						<p>' . sprintf(__("As part of the process for updating Event Espresso, your database also\nneeds to be updated. Event Espresso is in COMPLETE MAINTENANCE MODE (both WordPress admin pages and front-end event registration pages are disabled) until you run the database update script. %s Visit the Maintenance Page to get started,%s it only takes a moment.", "event_espresso"), "<a href='{$maintenance_page_url}'>", "</a>") . '</div>';
                    break;
            }
        }
    }
コード例 #12
0
    /**
     * Checks that there is at least one active gateway. If not, add a notice
     */
    public function check_payment_gateway_setup()
    {
        //ONLY do this check if models can query
        //and avoid a bug where when we nuke EE4's data that this causes a fatal error
        //because the tables are deleted just before this request runs. see https://events.codebasehq.com/projects/event-espresso/tickets/7539
        if (!EE_Maintenance_Mode::instance()->models_can_query() || !EEH_Activation::table_exists(EEM_Payment_Method::instance()->table())) {
            return;
        }
        // ensure Payment_Method model is loaded
        EE_Registry::instance()->load_model('Payment_Method');
        $actives = EEM_Payment_Method::instance()->count_active(EEM_Payment_Method::scope_cart);
        if ($actives < 1) {
            $url = EE_Admin_Page::add_query_args_and_nonce(array(), EE_PAYMENTS_ADMIN_URL);
            echo '<div class="error">
				 <p>' . sprintf(__("There are no Active Payment Methods setup for Event Espresso. Please %s activate at least one.%s", "event_espresso"), "<a href='{$url}'>", "</a>") . '</p>
			 </div>';
        }
    }
コード例 #13
0
 function column_TKT_name($item)
 {
     //build row actions
     $actions = array();
     //trash links
     if ($item->ID() !== 1) {
         if ($this->_view == 'all') {
             $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL);
             $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
         } else {
             // restore price link
             $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'restore_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL);
             $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' . esc_attr__('Restore Ticket', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
             // delete price link
             $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'delete_ticket', 'TKT_ID' => $item->ID()), TICKETS_ADMIN_URL);
             $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
         }
     }
     return $item->get('TKT_name') . $this->row_actions($actions);
 }
コード例 #14
0
 function column_ATT_fname($item)
 {
     //Build row actions
     $actions = array();
     // edit attendee link
     $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $item->ID()), REG_ADMIN_URL);
     $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' . __('Edit Contact', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
     if ($this->_view == 'in_use') {
         // trash attendee link
         $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_attendees', 'ATT_ID' => $item->ID()), REG_ADMIN_URL);
         $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . __('Move Contact to Trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
     } else {
         // restore attendee link
         $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'restore_attendees', 'ATT_ID' => $item->ID()), REG_ADMIN_URL);
         $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' . __('Restore Contact', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
     }
     $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $item->ID()), REG_ADMIN_URL);
     $name_link = '<a href="' . $edit_lnk_url . '" title="' . __('Edit Contact', 'event_espresso') . '">' . $item->fname() . '</a>';
     //Return the name contents
     return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions));
 }
 public function _contact_list_report()
 {
     if (!defined('EE_USE_OLD_CSV_REPORT_CLASS')) {
         wp_redirect(EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_batch', 'batch' => 'file', 'job_handler' => urlencode('EventEspressoBatchRequest\\JobHandlers\\AttendeesReport'), 'return_url' => urlencode($this->_req_data['return_url']))));
     } else {
         EE_Registry::instance()->load_helper('File');
         if (is_readable(EE_CLASSES . 'EE_Export.class.php')) {
             require_once EE_CLASSES . 'EE_Export.class.php';
             $EE_Export = EE_Export::instance($this->_req_data);
             $EE_Export->report_attendees();
         }
     }
 }
 /**
  * Callback for FHEE__EE_Admin_List_Table__column_actions__event-espresso_page_espresso_messages action that allows for adding the content for the registered "action" column.
  *
  * @since 4.3.2
  *
  * @param EE_Base_Class
  * @param string $screen_id Unique screen id for the page
  *
  * @return string html content for the page.
  */
 public function custom_mtp_create_button_column($item, $screen_id)
 {
     if ($screen_id !== 'espresso_messages_default' || !EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template')) {
         return '';
     }
     //first we consider whether this template has override set.  If it does then that means no custom templates can be created from this template as a base.  So let's just skip the button creation.
     if ($item->get('MTP_is_override')) {
         return '';
     }
     $create_args = array('GRP_ID' => $item->ID(), 'messenger' => $item->messenger(), 'message_type' => $item->message_type(), 'action' => 'add_new_message_template');
     $create_link = EE_Admin_Page::add_query_args_and_nonce($create_args, EE_MSG_ADMIN_URL);
     echo sprintf('<a href="%s" class="button button-small">%s</a>', $create_link, __('Create Custom', 'event_espresso'));
 }
コード例 #17
0
 /**
  * _activate_payment_method_button
  *
  * @access protected
  * @param \EE_Payment_Method $payment_method
  * @return \EE_Form_Section_Proper
  */
 protected function _activate_payment_method_button(EE_Payment_Method $payment_method)
 {
     $link_text_and_title = sprintf(__('Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name());
     return new EE_Form_Section_Proper(array('name' => 'activate_' . $payment_method->slug() . '_settings_form', 'html_id' => 'activate_' . $payment_method->slug() . '_settings_form', 'action' => '#', 'layout_strategy' => new EE_Admin_Two_Column_Layout(), 'subsections' => apply_filters('FHEE__Payments_Admin_Page___activate_payment_method_button__form_subsections', array(new EE_Form_Section_HTML(EEH_HTML::tr(EEH_HTML::th(EEH_HTML::label(__('Click to Activate ', 'event_espresso'))) . EEH_HTML::td(EEH_HTML::link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'activate_payment_method', 'payment_method_type' => $payment_method->type()), EE_PAYMENTS_ADMIN_URL), $link_text_and_title, $link_text_and_title, 'activate_' . $payment_method->slug(), 'espresso-button-green button-primary'))))), $payment_method)));
 }
foreach ($most_recent_migration->get_errors() as $error) {
    ?>
	<li><?php 
    echo $error;
    ?>
</li>
<?php 
}
?>
</ul>
<h2><?php 
_e("Fill out the below form to automatically Send Event Espresso a Crash Report", "event_espresso");
?>
</h2>
<form action='<?php 
echo EE_Admin_Page::add_query_args_and_nonce(array('action' => 'send_migration_crash_report'), EE_MAINTENANCE_ADMIN_URL);
?>
' method='post'>
	<table class='widefat'>
		<tr><td><label for='from'><?php 
_e("From/Reply-To:", "event_espresso");
?>
</label></td><td><input name='from' id='from' type='text' style="width:200px"value='<?php 
echo get_bloginfo('admin_email', 'display');
?>
'></td></tr>
		<tr><td><label for='from_name'><?php 
_e("Your Name", "event_espresso");
?>
</label></td><td><input name='from_name' id='from_name' type='text' style="width:200px"value='<?php 
printf(__("Admin of %s", "event_espresso"), get_bloginfo('name', 'display'));
コード例 #19
0
 /**
  * @param $elements
  * @return array
  */
 public function dashboard_glance_items($elements)
 {
     $events = EEM_Event::instance()->count();
     $items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events'), admin_url('admin.php'));
     $items['events']['text'] = sprintf(_n('%s Event', '%s Events', $events), number_format_i18n($events));
     $items['events']['title'] = __('Click to view all Events', 'event_espresso');
     $registrations = EEM_Registration::instance()->count(array(array('STS_ID' => array('!=', EEM_Registration::status_id_incomplete))));
     $items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_registrations'), admin_url('admin.php'));
     $items['registrations']['text'] = sprintf(_n('%s Registration', '%s Registrations', $registrations), number_format_i18n($registrations));
     $items['registrations']['title'] = __('Click to view all registrations', 'event_espresso');
     $items = apply_filters('FHEE__EE_Admin__dashboard_glance_items__items', $items);
     foreach ($items as $type => $item_properties) {
         $elements[] = sprintf('<a class="ee-dashboard-link-' . $type . '" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text']);
     }
     return $elements;
 }
コード例 #20
0
 protected function _parser($shortcode)
 {
     EE_Registry::instance()->load_helper('Template');
     if (!$this->_data->txn instanceof EE_Transaction) {
         return '';
     }
     switch ($shortcode) {
         case '[TXN_ID]':
             return $this->_data->txn->ID();
             break;
         case '[PAYMENT_URL]':
             $payment_url = $this->_data->txn->payment_overview_url();
             return empty($payment_url) ? __('http://dummypaymenturlforpreview.com', 'event_espresso') : $payment_url;
             break;
         case '[INVOICE_LINK]':
             $invoice_url = $this->_data->txn->invoice_url();
             $invoice_url = empty($invoice_url) ? 'http://dummyinvoicelinksforpreview.com' : $invoice_url;
             return sprintf(__('%sClick here for Invoice%s', 'event_espresso'), '<a href="' . $invoice_url . '">', '</a>');
             break;
             /**/
         /**/
         case '[INVOICE_URL]':
             $invoice_url = $this->_data->txn->invoice_url();
             return empty($invoice_url) ? 'http://dummyinvoicelinksforpreview.com' : $invoice_url;
             break;
         case "[TOTAL_COST]":
             $total = $this->_data->txn->total();
             return !empty($total) ? EEH_Template::format_currency($total) : '';
             break;
         case "[PAYMENT_STATUS]":
             $status = $this->_data->txn->pretty_status();
             return !empty($status) ? $status : __('Unknown', 'event_espresso');
             break;
             /**/
         /**/
         case "[PAYMENT_GATEWAY]":
             return $this->_get_payment_gateway();
             break;
         case "[AMOUNT_PAID]":
             $amount = isset($this->_data->payment) && is_object($this->_data->payment) ? $this->_data->payment->amount() : 0;
             return EEH_Template::format_currency($amount);
             break;
         case "[TOTAL_OWING]":
             $total_owing = isset($this->_data->txn) && is_object($this->_data->txn) ? $this->_data->txn->remaining() : $this->_data->txn->total();
             return EEH_Template::format_currency($total_owing);
             break;
         case "[TKT_QTY_PURCHASED]":
             return $this->_data->total_ticket_count;
             break;
         case "[TRANSACTION_ADMIN_URL]":
             require_once EE_CORE . 'admin/EE_Admin_Page.core.php';
             $query_args = array('page' => 'espresso_transactions', 'action' => 'view_transaction', 'TXN_ID' => $this->_data->txn->ID());
             $url = EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php'));
             return $url;
             break;
     }
     return '';
 }
    public function messages_metabox($event, $callback_args)
    {
        //let's get the active messengers (b/c messenger objects have the active message templates)
        //convert 'evt_id' to 'EVT_ID'
        $this->_req_data['EVT_ID'] = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL;
        $this->_req_data['EVT_ID'] = isset($this->_req_data['post']) && empty($this->_req_data['EVT_ID']) ? $this->_req_data['post'] : $this->_req_data['EVT_ID'];
        $this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID']) && isset($this->_req_data['evt_id']) ? $this->_req_data['evt_id'] : $this->_req_data['EVT_ID'];
        $EEM_controller = new EE_messages();
        $active_messengers = $EEM_controller->get_active_messengers();
        $tabs = array();
        //empty messengers?
        //Note message types will always have at least one available because every messenger has a default message type associated with it (payment) if no other message types are selected.
        if (empty($active_messengers)) {
            $msg_activate_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'settings'), EE_MSG_ADMIN_URL);
            $error_msg = sprintf(__('There are no active messengers. So no notifications will go out for <strong>any</strong> events.  You will want to %sActivate a Messenger%s.', 'event_espresso'), '<a href="' . $msg_activate_url . '">', '</a>');
            $error_content = '<div class="error"><p>' . $error_msg . '</p></div>';
            $internal_content = '<div id="messages-error"><p>' . $error_msg . '</p></div>';
            echo $error_content;
            echo $internal_content;
            return;
        }
        $event_id = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL;
        //get content for active messengers
        foreach ($active_messengers as $name => $messenger) {
            //first check if there are any active message types for this messenger.
            $active_mts = $EEM_controller->get_active_message_types_per_messenger($name);
            if (empty($active_mts)) {
                continue;
            }
            $tcont = $messenger->get_messenger_admin_page_content('events', 'edit', array('event' => $event_id));
            if (!empty($tcont)) {
                $tabs[$name] = $tcont;
            }
        }
        EE_Registry::instance()->load_helper('Tabbed_Content');
        //we want this to be tabbed content so let's use the EEH_Tabbed_Content::display helper.
        $tabbed_content = EEH_Tabbed_Content::display($tabs);
        if (is_wp_error($tabbed_content)) {
            $tabbed_content = $tabbed_content->get_error_message();
        }
        $notices = '<div id="espresso-ajax-loading" class="ajax-loader-grey">
				<span class="ee-spinner ee-spin"></span><span class="hidden">' . __('loading...', 'event_espresso') . '</span>
			</div><div class="ee-notices"></div>';
        if (defined('DOING_AJAX')) {
            return $tabbed_content;
        }
        do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content');
        echo $notices . '<div class="messages-tabs-content">' . $tabbed_content . '</div>';
        do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content');
    }
コード例 #22
0
 /**
  * 		display_country_states
  *
  * 		@access 	public
  * 		@param 	string 		$CNT_ISO
  * 		@return 		string
  */
 public function display_country_states($CNT_ISO = '')
 {
     $CNT_ISO = isset($this->_req_data['country']) ? sanitize_text_field($this->_req_data['country']) : $CNT_ISO;
     if (!$CNT_ISO) {
         return '';
     }
     // for ajax
     remove_all_filters('FHEE__EEH_Form_Fields__label_html');
     remove_all_filters('FHEE__EEH_Form_Fields__input_html');
     add_filter('FHEE__EEH_Form_Fields__label_html', array($this, 'state_form_field_label_wrap'), 10, 2);
     add_filter('FHEE__EEH_Form_Fields__input_html', array($this, 'state_form_field_input__wrap'), 10, 2);
     $states = EEM_State::instance()->get_all_states_for_these_countries(array($CNT_ISO => $CNT_ISO));
     //			echo '<h4>$CNT_ISO : ' . $CNT_ISO . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
     //			global $wpdb;
     //			echo '<h4>' . $wpdb->last_query . '  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h4>';
     //			EEH_Debug_Tools::printr( $states, '$states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
     if ($states) {
         foreach ($states as $STA_ID => $state) {
             if ($state instanceof EE_State) {
                 //STA_abbrev 	STA_name 	STA_active
                 $state_input_types = array('STA_abbrev' => array('type' => 'TEXT', 'input_name' => 'states[' . $STA_ID . ']', 'class' => 'mid-text'), 'STA_name' => array('type' => 'TEXT', 'input_name' => 'states[' . $STA_ID . ']', 'class' => 'regular-text'), 'STA_active' => array('type' => 'RADIO_BTN', 'input_name' => 'states[' . $STA_ID . ']', 'options' => $this->_yes_no_values, 'use_desc_4_label' => true));
                 $this->_template_args['states'][$STA_ID]['inputs'] = EE_Question_Form_Input::generate_question_form_inputs_for_object($state, $state_input_types);
                 $query_args = array('action' => 'delete_state', 'STA_ID' => $STA_ID, 'CNT_ISO' => $CNT_ISO, 'STA_abbrev' => $state->abbrev());
                 $this->_template_args['states'][$STA_ID]['delete_state_url'] = EE_Admin_Page::add_query_args_and_nonce($query_args, GEN_SET_ADMIN_URL);
             }
         }
     } else {
         $this->_template_args['states'] = FALSE;
     }
     //		EEH_Debug_Tools::printr( $this->_template_args['states'], 'states  <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' );
     $this->_template_args['add_new_state_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'add_new_state'), GEN_SET_ADMIN_URL);
     $state_details_settings = EEH_Template::display_template(GEN_SET_TEMPLATE_PATH . 'state_details_settings.template.php', $this->_template_args, TRUE);
     if (defined('DOING_AJAX')) {
         $notices = EE_Error::get_notices(FALSE, FALSE, FALSE);
         echo json_encode(array('return_data' => $state_details_settings, 'success' => $notices['success'], 'errors' => $notices['errors']));
         die;
     } else {
         return $state_details_settings;
     }
 }
 function column_PER_lname($item)
 {
     //Build row actions
     $actions = array();
     // edit person link
     if (EE_Registry::instance()->CAP->current_user_can('ee_edit_people', 'eea-people-addon_edit_people', $item->ID())) {
         $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $item->ID()), EEA_PEOPLE_ADDON_ADMIN_URL);
         $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' . __('Edit Person', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
     }
     if ($this->_view == 'publish' || $this->_view == 'all' || $this->_view == 'draft') {
         // trash person link
         if (EE_Registry::instance()->CAP->current_user_can('ee_delete_people', 'eea-people-addon_trash_people', $item->ID())) {
             $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_person', 'PER_ID' => $item->ID()), EEA_PEOPLE_ADDON_ADMIN_URL);
             $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . __('Move Person to Trash', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>';
         }
     } else {
         if (EE_Registry::instance()->CAP->current_user_can('ee_delete_people', 'eea-people-addon_restore_people', $item->ID())) {
             // restore person link
             $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'restore_person', 'PER_ID' => $item->ID()), EEA_PEOPLE_ADDON_ADMIN_URL);
             $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' . __('Restore Person', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
             $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'delete_person', 'PER_ID' => $item->ID()), EEA_PEOPLE_ADDON_ADMIN_URL);
             $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' . __('Delete Permanently This Person.', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
         }
     }
     $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $item->ID()), EEA_PEOPLE_ADDON_ADMIN_URL);
     $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_people', 'eea-people-addon_edit_people', $item->ID()) ? '<a href="' . $edit_lnk_url . '" title="' . __('Edit Person', 'event_espresso') . '">' . $item->full_name() . '</a>' : $item->full_name();
     $name_link .= '<br>' . '<a href="mailto:' . $item->email() . '">' . $item->email() . '</a>';
     $name_link .= $item->phone() ? '<br>' . sprintf(__('Phone: %s', 'event_espresso'), $item->phone()) : '';
     //Return the name contents
     return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions));
 }
コード例 #24
0
 function column_name($item)
 {
     //Build row actions
     $actions = array();
     // edit price link
     if (EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price', 'pricing_edit_price', $item->ID())) {
         $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_price', 'id' => $item->ID()), PRICING_ADMIN_URL);
         $actions['edit'] = '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('Edit Price', 'event_espresso') . '">' . __('Edit', 'event_espresso') . '</a>';
     }
     $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price', 'edit_price', $item->ID()) ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('Edit Price', 'event_espresso') . '">' . stripslashes($item->name()) . '</a>' : $item->name();
     if ($item->type_obj()->base_type() !== 1) {
         if ($this->_view == 'all') {
             // trash price link
             if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_trash_price', $item->ID())) {
                 $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_price', 'id' => $item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL);
                 $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Move Price to Trash', 'event_espresso') . '">' . __('Move to Trash', 'event_espresso') . '</a>';
             }
         } else {
             if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_restore_price', $item->ID())) {
                 // restore price link
                 $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'restore_price', 'id' => $item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL);
                 $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' . esc_attr__('Restore Price', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>';
             }
             // delete price link
             if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_delete_price', $item->ID())) {
                 $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'delete_price', 'id' => $item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL);
                 $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' . esc_attr__('Delete Price Permanently', 'event_espresso') . '">' . __('Delete Permanently', 'event_espresso') . '</a>';
             }
         }
     }
     //Return the name contents
     return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s', $name_link, $item->ID(), $this->row_actions($actions));
 }
コード例 #25
0
 protected function _category_details($view)
 {
     //load formatter helper
     EE_Registry::instance()->load_helper('Formatter');
     //load field generator helper
     EE_Registry::instance()->load_helper('Form_Fields');
     $route = $view == 'edit' ? 'update_category' : 'insert_category';
     $this->_set_add_edit_form_tags($route);
     $this->_set_category_object();
     $id = !empty($this->_category->id) ? $this->_category->id : '';
     $delete_action = 'delete_category';
     $redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'category_list'), $this->_admin_base_url);
     $this->_set_publish_post_box_vars('VEN_CAT_ID', $id, $delete_action, $redirect);
     //take care of contents
     $this->_template_args['admin_page_content'] = $this->_category_details_content();
     $this->display_admin_page_with_sidebar();
 }
コード例 #26
0
 public function column_actions($item)
 {
     //todo: remove when attendees is active
     if (!defined('REG_ADMIN_URL')) {
         define('REG_ADMIN_URL', EVENTS_ADMIN_URL);
     }
     $actionlinks = array();
     $edit_query_args = array('action' => 'edit', 'post' => $item->ID());
     $attendees_query_args = array('action' => 'default', 'event_id' => $item->ID());
     $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL);
     $view_link = get_permalink($item->ID());
     $attendees_link = EE_Admin_Page::add_query_args_and_nonce($attendees_query_args, REG_ADMIN_URL);
     $actionlinks[] = '<a href="' . $view_link . '" title="' . __('View Event', 'event_espresso') . '" target="_blank">';
     $actionlinks[] = '<div class="dashicons dashicons-search"></div></a>';
     $actionlinks[] = '<a href="' . $edit_link . '" title="' . __('Edit Event', 'event_espresso') . '"><div class="ee-icon ee-icon-calendar-edit"></div></a>';
     $actionlinks[] = '<a href="' . $attendees_link . '" title="' . __('View Registrants', 'event_espresso') . '"><div class="dashicons dashicons-groups"></div></a>';
     $actionlinks = apply_filters('FHEE__Events_Admin_List_Table__column_actions__action_links', $actionlinks, $item);
     $content = '<div style="width:100%;">' . "\n\t";
     $content .= implode("\n\t", $actionlinks);
     //todo: we need to put back in a email attendees link via the new messages system
     $content .= "\n" . '</div>' . "\n";
     return $content;
 }
コード例 #27
0
 protected function _output_details($view, $taxonomy = 'espresso_people_categories')
 {
     //load formatter helper
     EE_Registry::instance()->load_helper('Formatter');
     //load field generator helper
     EE_Registry::instance()->load_helper('Form_Fields');
     $slug = $taxonomy == 'espresso_people_categories' ? 'category' : 'type';
     $route = $view == 'edit' ? 'update_' . $slug : 'insert_' . $slug;
     $this->_set_add_edit_form_tags($route);
     $this->_set_term_object($taxonomy);
     $id = !empty($this->_term_object->id) ? $this->_term_object->id : '';
     $delete_action = 'delete_' . $slug;
     //custom redirect
     $redirect = EE_Admin_Page::add_query_args_and_nonce(array('action' => $slug . '_list'), $this->_admin_base_url);
     $id_ident = $taxonomy == 'espresso_people_categories' ? 'PER_CAT_ID' : 'PER_TYPE_ID';
     $this->_set_publish_post_box_vars($id_ident, $id, $delete_action, $redirect);
     //take care of contents
     $this->_template_args['admin_page_content'] = $this->_term_object_details_content($taxonomy);
     $this->display_admin_page_with_sidebar();
 }
 /**
  * This is the default last stop for all tours that is displayed at the end of a tour OR when a tour is exited for the first time. 
  * @return string
  */
 protected function _end()
 {
     $query_args = array('action' => 'admin_option_settings', 'page' => 'espresso_general_settings');
     return '<p>' . sprintf(__('That\'s it for the tour!  At any time you can restart a tour by clicking on this help dropdown and then clicking one of the Tour buttons.  There are help tours available on all Event Espresso Admin pages.  If you want to turn off help tours for all pages, %sgo here%s. All the best with your events!', 'event_espresso'), '<a href="' . EE_Admin_Page::add_query_args_and_nonce($query_args, admin_url('admin.php')) . '">', '</a>') . '</p>';
 }
					<?php 
    $event_url = add_query_arg(array('action' => 'edit', 'post' => $registration->event_ID()), admin_url('admin.php?page=espresso_events'));
    echo EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'espresso_events_edit', $registration->event_ID()) ? '<a href="' . $event_url . '"  title="' . esc_attr__('Edit Event', 'event_espresso') . '">' . $registration->event_name() . '</a>' : $registration->event_name();
    ?>
					</td>
					<td class="jst-left">
					<?php 
    $reg_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $registration->ID()), REG_ADMIN_URL);
    echo EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? '
							<a href="' . $reg_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' . sprintf(__('
								View Registration ', 'event_espresso'), $registration->ID()) . '</a>' : '';
    ?>
					</td>
					<td class="jst-left">
					<?php 
    $txn_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $registration->transaction_ID()), TXN_ADMIN_URL);
    echo EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '
						<a href="' . $txn_url . '" title="' . esc_attr__('View Transaction Details', 'event_espresso') . '">
							View Transaction ' . $registration->transaction_ID() . '
						</a>' : '';
    ?>
					</td>
					<td class="jst-left"><?php 
    echo $registration->reg_code();
    ?>
</td>
					<td class="jst-rght"><?php 
    echo EEH_Template::format_currency($registration->final_price());
    ?>
</td>
				</tr>
コード例 #30
0
 /**
  * txn_registrant_side_meta_box
  * generates HTML for the Edit Transaction side meta box
  *
  * @access public
  * @throws \EE_Error
  * @return void
  */
 public function txn_registrant_side_meta_box()
 {
     $primary_att = $this->_transaction->primary_registration() instanceof EE_Registration ? $this->_transaction->primary_registration()->get_first_related('Attendee') : null;
     if (!$primary_att instanceof EE_Attendee) {
         $this->_template_args['no_attendee_message'] = __('There is no attached contact for this transaction.  The transaction either failed due to an error or was abandoned.', 'event_espresso');
         $primary_att = EEM_Attendee::instance()->create_default_object();
     }
     $this->_template_args['ATT_ID'] = $primary_att->ID();
     $this->_template_args['prime_reg_fname'] = $primary_att->fname();
     $this->_template_args['prime_reg_lname'] = $primary_att->lname();
     $this->_template_args['prime_reg_email'] = $primary_att->email();
     $this->_template_args['prime_reg_phone'] = $primary_att->phone();
     $this->_template_args['edit_attendee_url'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $primary_att->ID()), REG_ADMIN_URL);
     // get formatted address for registrant
     EE_Registry::instance()->load_helper('Formatter');
     $this->_template_args['formatted_address'] = EEH_Address::format($primary_att);
     echo EEH_Template::display_template(TXN_TEMPLATE_PATH . 'txn_admin_details_side_meta_box_registrant.template.php', $this->_template_args, TRUE);
 }