Exemplo n.º 1
0
 /**
  * Function to set variables up before form is built
  *
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     $unmet = CRM_Volunteer_Upgrader::checkExtensionDependencies();
     if (in_array('com.ginkgostreet.multiform', $unmet)) {
         $msg = CRM_Volunteer_Upgrader::getUnmetDependencyErrorMessage('com.ginkgostreet.multiform');
         $this->assign('msg', $msg);
     }
     $this->assign('isModulePermissionSupported', CRM_Core_Config::singleton()->userPermissionClass->isModulePermissionSupported());
 }
 /**
  * Ensure that, if the database is repopulated, CiviVolunteer's install
  * operations are run, adding custom option group, activity fields, etc. to
  * the testing db.
  *
  * @param type $perClass
  * @param type $object
  * @return boolean
  */
 protected static function _populateDB($perClass = FALSE, &$object = NULL)
 {
     if (!parent::_populateDB($perClass, $object)) {
         return FALSE;
     }
     // code adapted from CRM_Volunteer_Upgrader::install().
     $upgrader = new CRM_Volunteer_Upgrader('org.civicrm.volunteer', dirname(__FILE__) . '/../../');
     $activityTypeId = $upgrader->createActivityType(CRM_Volunteer_BAO_Assignment::CUSTOM_ACTIVITY_TYPE);
     $smarty = CRM_Core_Smarty::singleton();
     $smarty->assign('volunteer_custom_activity_type_name', CRM_Volunteer_BAO_Assignment::CUSTOM_ACTIVITY_TYPE);
     $smarty->assign('volunteer_custom_group_name', CRM_Volunteer_BAO_Assignment::CUSTOM_GROUP_NAME);
     $smarty->assign('volunteer_custom_option_group_name', CRM_Volunteer_BAO_Assignment::ROLE_OPTION_GROUP);
     $smarty->assign('volunteer_activity_type_id', $activityTypeId);
     $customIDs = $upgrader->findCustomGroupValueIDs();
     $smarty->assign('customIDs', $customIDs);
     $upgrader->executeCustomDataTemplateFile('volunteer-customdata.xml.tpl');
     $upgrader->createVolunteerActivityStatus();
     return TRUE;
 }
function _volunteer_prereqCheck()
{
    $unmet = CRM_Volunteer_Upgrader::checkExtensionDependencies();
    CRM_Volunteer_Upgrader::displayDependencyErrors($unmet);
}
Exemplo n.º 4
0
/**
 * Delegated implementation of hook_civicrm_alterTemplateFile
 *
 * Don't load the volunteer tab if Multiform prereq is missing.
 *
 * @param type $formName
 * @param type $form
 * @param type $context
 * @param string $tplName
 */
function _volunteer_civicrm_alterTemplateFile_CRM_Volunteer_Form_Volunteer($formName, &$form, $context, &$tplName)
{
    $unmet = CRM_Volunteer_Upgrader::checkExtensionDependencies();
    if (in_array('com.ginkgostreet.multiform', $unmet)) {
        $tplName = 'CRM/Volunteer/MissingDependency.tpl';
    }
}
Exemplo n.º 5
0
 /**
  * Display dependency error messages.
  * This upgrade-step counter should be incremented for each upgrade, not duplicated.
  *
  * @return boolean TRUE on success
  */
 public function upgrade_1402()
 {
     $this->ctx->log->info('Checking extension dependencies');
     $unmet = CRM_Volunteer_Upgrader::checkExtensionDependencies();
     self::displayDependencyErrors($unmet);
     return TRUE;
 }