Skip to content

Commit

Permalink
Merge pull request #12517 from eileenmcnaughton/case_export_fail
Browse files Browse the repository at this point in the history
Fix regression on case export from recent export fix
  • Loading branch information
eileenmcnaughton authored Jul 20, 2018
2 parents a74efcf + d5fd18f commit 08013f5
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CRM/Case/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function tasks() {
self::TASK_EXPORT => array(
'title' => ts('Export cases'),
'class' => array(
'CRM_Export_Form_Select',
'CRM_Export_Form_Select_Case',
'CRM_Export_Form_Map',
),
'result' => FALSE,
Expand Down
7 changes: 6 additions & 1 deletion CRM/Core/Form/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ abstract class CRM_Core_Form_Task extends CRM_Core_Form {
*/
protected $_componentIds;

/**
* @var int
*/
protected $queryMode;

/**
* The array that holds all the case ids
*
Expand Down Expand Up @@ -210,7 +215,7 @@ public function addDefaultButtons($title, $nextType = 'next', $backType = 'back'
* @return int
*/
public function getQueryMode() {
return CRM_Contact_BAO_Query::MODE_CONTACTS;
return $this->queryMode ?: CRM_Contact_BAO_Query::MODE_CONTACTS;
}

}
2 changes: 1 addition & 1 deletion CRM/Export/Form/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public static function getGreetingOptions() {
* @return int
*/
public function getQueryMode() {
return (int) $this->controller->get('component_mode');
return (int) ($this->queryMode ?: $this->controller->get('component_mode'));
}

}
53 changes: 53 additions & 0 deletions CRM/Export/Form/Select/Case.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License and the CiviCRM Licensing Exception along |
| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/

/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2018
*/

/**
* This class gets the name of the file to upload
*/
class CRM_Export_Form_Select_Case extends CRM_Export_Form_Select {

/**
* @var int
*/
protected $queryMode = CRM_Contact_BAO_Query::MODE_CASE;

/**
* Use the form name to create the tpl file name.
*
* @return string
*/
public function getTemplateFileName() {
return 'CRM/Export/Form/Select.tpl';
}

}

0 comments on commit 08013f5

Please sign in to comment.