🧹 code cleanup

This commit is contained in:
Marc Michalsky forumZFD 2021-03-18 15:54:49 +01:00
parent 1e6feda923
commit 55f7977c79
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 21 additions and 22 deletions

View file

@ -163,10 +163,9 @@ class CRM_TwingleCampaign_BAO_TwingleCampaign {
// UI, log an error and delete this TwingleCampaign // UI, log an error and delete this TwingleCampaign
else { else {
CRM_Core_Session::setStatus( CRM_Core_Session::setStatus(
ts("Could not determine parent TwingleProject URL. This URL is ts("Could not determine parent TwingleProject URL. This URL is needed to create the TwingleEvent URL. Please check the logs."),
needed to create the TwingleEvent URL. Please check the logs."),
ts('Parent project URL missing'), ts('Parent project URL missing'),
'alert' 'error'
); );
Civi::log()->error( Civi::log()->error(
E::LONG_NAME . E::LONG_NAME .

View file

@ -147,13 +147,13 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
public function enable() { public function enable() {
// Enable cron job // Enable cron job
try { try {
$jobId = civicrm_api3('Job', 'getsingle', [ $jobId = civicrm_api3('Job', 'getsingle', [
'name' => "TwingleSync", 'name' => "TwingleSync",
])['id']; ])['id'];
civicrm_api3('Job', 'create', [ civicrm_api3('Job', 'create', [
'id' => $jobId, 'id' => $jobId,
'is_active' => 1, 'is_active' => 1,
]); ]);
} catch (CiviCRM_API3_Exception $e) { } catch (CiviCRM_API3_Exception $e) {
Civi::log()->error( Civi::log()->error(
E::LONG_NAME . E::LONG_NAME .
@ -200,18 +200,18 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
} }
/** /**
* Example: Run a couple simple queries. * Example: Run a couple simple queries.
* *
* @return TRUE on success * @return TRUE on success
* @throws Exception * @throws Exception
* *
* public function upgrade_4200() { * public function upgrade_4200() {
* $this->ctx->log->info('Applying update 4200'); * $this->ctx->log->info('Applying update 4200');
* CRM_Core_DAO::executeQuery('UPDATE foo SET bar = "whiz"'); * CRM_Core_DAO::executeQuery('UPDATE foo SET bar = "whiz"');
* CRM_Core_DAO::executeQuery('DELETE FROM bang WHERE willy = wonka(2)'); * CRM_Core_DAO::executeQuery('DELETE FROM bang WHERE willy = wonka(2)');
* return TRUE; * return TRUE;
* } // */ * } // */
/** /**