예제 #1
0
 /**
  * Handle activating pending activation from entry detail page.
  */
 public static function is_lead_pending_activation($lead)
 {
     global $wpdb;
     require_once self::get_base_path() . '/includes/pending_activations.php';
     return GFUserPendingActiviations::get_pending_activations($lead['form_id'], array('lead_id' => $lead['id'], 'get_total' => true)) > 0;
 }
 function prepare_items()
 {
     $items = array();
     $forms = array();
     $per_page = 10;
     $page = rgget('paged') ? rgget('paged') : 1;
     $pending_activations = GFUserPendingActiviations::get_pending_activations(rgget('form_id'), array('per_page' => $per_page, 'page' => $page));
     $total_pending = GFUserPendingActiviations::get_pending_activations(rgget('form_id'), array('per_page' => $per_page, 'page' => $page, 'get_total' => true));
     foreach ($pending_activations as $pending_activation) {
         $signup_meta = unserialize($pending_activation->meta);
         $lead = RGFormsModel::get_lead(rgar($signup_meta, 'lead_id'));
         //if(!$lead)
         //continue;
         $form_id = $lead['form_id'];
         $form = rgar($forms, $form_id) ? rgar($forms, $form_id) : RGFormsModel::get_form_meta($form_id);
         $forms[$form_id] = $form;
         $item = array();
         $item['form'] = $form['title'];
         $item['user_login'] = rgar($signup_meta, 'user_login');
         $item['email'] = rgar($signup_meta, 'email');
         $item['date'] = $lead['date_created'];
         // non-columns
         $item['lead_id'] = $lead['id'];
         $item['form_id'] = $form_id;
         $item['activation_key'] = $pending_activation->activation_key;
         array_push($this->items, $item);
     }
     $this->set_pagination_args(array('total_items' => $total_pending, 'per_page' => $per_page));
 }