* @param string $fileName
* @param bool $lineMode
*/
- public static function loadCaseSampleData($dsn, $fileName, $lineMode = FALSE) {
- $db = &DB::connect($dsn);
- if (PEAR::isError($db)) {
- die("Cannot open $dsn: " . $db->getMessage());
- }
+ public static function loadCaseSampleData($fileName, $lineMode = FALSE) {
+ $dao = new CRM_Core_DAO();
+ $db = $dao->getDatabaseConnection();
$domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
(!$oldValue || !in_array('CiviCase', $oldValue))
) {
$pathToCaseSampleTpl = __DIR__ . '/xml/configuration.sample/';
- $config = CRM_Core_Config::singleton();
- CRM_Admin_Form_Setting_Component::loadCaseSampleData($config->dsn, $pathToCaseSampleTpl . 'case_sample.mysql.tpl');
+ CRM_Admin_Form_Setting_Component::loadCaseSampleData($pathToCaseSampleTpl . 'case_sample.mysql.tpl');
if (!CRM_Case_BAO_Case::createCaseViews()) {
$msg = ts("Could not create the MySQL views for CiviCase. Your mysql user needs to have the 'CREATE VIEW' permission");
CRM_Core_Error::fatal($msg);