Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Code cleanup, fixes and updates for current versions of CiviCRM #188

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions CRM/Admin/Form/AdhocChargesItem.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use CRM_Booking_ExtensionUtil as E;
use CRM_Booking_ExtensionUtil as E;
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
Expand Down Expand Up @@ -38,7 +38,7 @@
*
*/
class CRM_Admin_Form_AdhocChargesItem extends CRM_Admin_Form {
protected $_id = NULL;
public $_id = NULL;

function preProcess() {
parent::preProcess();
Expand Down
8 changes: 4 additions & 4 deletions CRM/Admin/Form/Resource.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use CRM_Booking_ExtensionUtil as E;
use CRM_Booking_ExtensionUtil as E;
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
Expand Down Expand Up @@ -38,7 +38,7 @@
*
*/
class CRM_Admin_Form_Resource extends CRM_Admin_Form {
protected $_id = NULL;
public $_id = NULL;

function preProcess() {
parent::preProcess();
Expand Down Expand Up @@ -88,13 +88,13 @@ public function buildQuickForm($check = FALSE) {
foreach ($activeSets['values'] as $key => $set) {
$configSets[$key] = $set['title'];
}

$resource = civicrm_api3('Resource', 'getsingle', array(
'sequential' => 1,
'id' => $this->_id,
));
}
catch (CiviCRM_API3_Exception $e) {}
catch (CiviCRM_API3_Exception $e) {}

//allow state changes only when there is enabled config set
if(!empty($resource['set_id']) && !in_array($resource['set_id'], array_keys($activeSets['values']))){
Expand Down
4 changes: 2 additions & 2 deletions CRM/Admin/Form/ResourceConfigOption.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use CRM_Booking_ExtensionUtil as E;
use CRM_Booking_ExtensionUtil as E;
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
Expand Down Expand Up @@ -38,7 +38,7 @@
*
*/
class CRM_Admin_Form_ResourceConfigOption extends CRM_Admin_Form {
protected $_id = NULL;
public $_id = NULL;
protected $_sid = NULL;

function preProcess() {
Expand Down
8 changes: 4 additions & 4 deletions CRM/Admin/Form/ResourceConfigSet.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use CRM_Booking_ExtensionUtil as E;
use CRM_Booking_ExtensionUtil as E;
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
Expand Down Expand Up @@ -38,7 +38,7 @@
*
*/
class CRM_Admin_Form_ResourceConfigSet extends CRM_Admin_Form {
protected $_id = NULL;
public $_id = NULL;

function preProcess() {
parent::preProcess();
Expand All @@ -61,13 +61,13 @@ public function buildQuickForm($check = FALSE) {
$this->add('text', 'title', E::ts('Title'), array('size' => 50, 'maxlength' => 255), TRUE);
$this->add('text', 'weight', E::ts('Weight'), CRM_Core_DAO::getAttribute('CRM_Booking_DAO_ResourceConfigSet', 'weight'), TRUE);
$statusCheckbox = $this->add('checkbox', 'is_active', E::ts('Enabled?'));

//allow state changes and delete only when there are no enabled resources
$resourceDao = new CRM_Booking_DAO_Resource();
$resourceDao->set_id = $this->_id;
$resourceDao->is_deleted = FALSE;
$resourceDao->is_active = TRUE;

if($resourceDao->count() > 0){
$statusCheckbox->setAttribute('disabled', 'disabled');
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Booking/BAO/Query.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use CRM_Booking_ExtensionUtil as E;
use CRM_Booking_ExtensionUtil as E;

/*
+--------------------------------------------------------------------+
Expand Down
Loading