function importmatch()
 {
     $this->jsTrans['subscribers_import_match_confirmation_1'] = __('The selected value is already matched to another column.', WYSIJA);
     $this->jsTrans['subscribers_import_match_confirmation_2'] = __('Can you confirm that this column is corresponding to that field?', WYSIJA);
     $this->js[] = 'wysija-validator';
     wp_enqueue_script('jquery-matchColumn', WYSIJA_URL . 'js/jquery/jquery.matchColumn.js', array('jquery'), WYSIJA::get_version());
     $helper_numbers = WYSIJA::get('numbers', 'helper');
     $bytes = $helper_numbers->get_max_file_upload();
     if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > $bytes['maxbytes']) {
         if (isset($_FILES['importfile']['name']) && $_FILES['importfile']['name']) {
             $file_name = $_FILES['importfile']['name'];
         } else {
             $file_name = __('which you have pasted', WYSIJA);
         }
         $this->error(sprintf(__('Upload error, file %1$s is too large! (MAX:%2$s)', WYSIJA), $file_name, $bytes['maxmegas']), true);
         $this->redirect('admin.php?page=wysija_subscribers&action=import');
         return false;
     }
     $import = new WJ_Import();
     $this->data = $import->scan_csv_file();
     if ($this->data === false) {
         $this->redirect('admin.php?page=wysija_subscribers&action=import');
     }
     $this->viewObj->title = __('Import Subscribers', WYSIJA);
     $this->viewShow = 'importmatch';
 }
Exemple #2
0
 function importmatch()
 {
     $this->requireSecurity();
     $this->jsTrans['subscribers_import_match_confirmation_1'] = __('The selected value is already matched to another column.', WYSIJA);
     $this->jsTrans['subscribers_import_match_confirmation_2'] = __('Can you confirm that this column is corresponding to that field?', WYSIJA);
     $this->js[] = 'wysija-validator';
     $helper_numbers = WYSIJA::get('numbers', 'helper');
     $bytes = $helper_numbers->get_max_file_upload();
     if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > $bytes['maxbytes']) {
         if (isset($_FILES['importfile']['name']) && $_FILES['importfile']['name']) {
             $file_name = $_FILES['importfile']['name'];
         } else {
             $file_name = __('which you have pasted', WYSIJA);
         }
         $this->error(sprintf(__('Upload error, file %1$s is too large! (MAX:%2$s)', WYSIJA), $file_name, $bytes['maxmegas']), true);
         $this->redirect('admin.php?page=wysija_subscribers&action=import');
         return false;
     }
     $import = new WJ_Import();
     $this->data = $import->scan_csv_file();
     if ($this->data === false) {
         $this->redirect('admin.php?page=wysija_subscribers&action=import');
     }
     $model_config = WYSIJA::get('config', 'model');
     $this->jsTrans['userStatuses'] = array(-1 => __('Unsubscribed', WYSIJA), 0 => $model_config->getValue('confirm_dbleoptin') ? __('Unconfirmed', WYSIJA) : __('Subscribed', WYSIJA), 1 => __('Subscribed', WYSIJA));
     $this->js[] = 'wysija-import-match';
     $this->viewObj->title = __('Import Subscribers', WYSIJA);
     $this->viewShow = 'importmatch';
 }
Exemple #3
0
 function importmatch()
 {
     $this->js[] = 'wysija-validator';
     $helper_numbers = WYSIJA::get('numbers', 'helper');
     $bytes = $helper_numbers->get_max_file_upload();
     if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > $bytes['maxbytes']) {
         if (isset($_FILES['importfile']['name']) && $_FILES['importfile']['name']) {
             $file_name = $_FILES['importfile']['name'];
         } else {
             $file_name = __('which you have pasted', WYSIJA);
         }
         $this->error(sprintf(__('Upload error, file %1$s is too large! (MAX:%2$s)', WYSIJA), $file_name, $bytes['maxmegas']), true);
         $this->redirect('admin.php?page=wysija_subscribers&action=import');
         return false;
     }
     $import = new WJ_Import();
     $this->data = $import->scan_csv_file();
     if ($this->data === false) {
         $this->redirect('admin.php?page=wysija_subscribers&action=import');
     }
     $this->viewObj->title = __('Import Subscribers', WYSIJA);
     $this->viewShow = 'importmatch';
 }