/**
  * Overridden parent method to perform processing before form is build
  *
  * @access public
  */
 public function preProcess()
 {
     $this->ruleActionId = CRM_Utils_Request::retrieve('rule_action_id', 'Integer');
     $this->ruleAction = new CRM_Civirules_BAO_RuleAction();
     $this->ruleAction->id = $this->ruleActionId;
     $this->action = new CRM_Civirules_BAO_Action();
     $this->rule = new CRM_Civirules_BAO_Rule();
     $this->trigger = new CRM_Civirules_BAO_Trigger();
     if (!$this->ruleAction->find(true)) {
         throw new Exception('Civirules could not find ruleAction');
     }
     $this->action->id = $this->ruleAction->action_id;
     if (!$this->action->find(true)) {
         throw new Exception('Civirules could not find action');
     }
     $this->rule->id = $this->ruleAction->rule_id;
     if (!$this->rule->find(true)) {
         throw new Exception('Civirules could not find rule');
     }
     $this->trigger->id = $this->rule->trigger_id;
     if (!$this->trigger->find(true)) {
         throw new Exception('Civirules could not find trigger');
     }
     $this->triggerClass = CRM_Civirules_BAO_Trigger::getPostTriggerObjectByClassName($this->trigger->class_name, true);
     $this->triggerClass->setTriggerId($this->trigger->id);
     //set user context
     $session = CRM_Core_Session::singleton();
     $editUrl = CRM_Utils_System::url('civicrm/civirule/form/rule', 'action=update&id=' . $this->rule->id, TRUE);
     $session->pushUserContext($editUrl);
     parent::preProcess();
     $this->setFormTitle();
 }
Esempio n. 2
0
 /**
  * Function to set variables up before form is built
  * 
  * @param null
  * 
  * @return void
  * @access public
  */
 public function preProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         //check permission for action.
         if (!CRM_Core_Permission::checkActionPermission('CiviContribute', $this->_action)) {
             CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
         }
         $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
         $this->_title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_PCP', $this->_id, 'title');
         $this->assign('title', $this->_title);
         parent::preProcess();
     }
     if (!$this->_action) {
         $action = CRM_Utils_Array::value('action', $_GET);
         $id = CRM_Utils_Array::value('id', $_GET);
         switch ($action) {
             case 'delete':
                 require_once 'CRM/Contribute/BAO/PCP.php';
                 $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_PCP', $id, 'title');
                 CRM_Contribute_BAO_PCP::delete($id);
                 CRM_Core_Session::setStatus(ts("The Campaign Page '%1' has been deleted.", array(1 => $title)));
                 break;
             case 'disable':
                 require_once 'CRM/Contribute/BAO/PCP.php';
                 CRM_Contribute_BAO_PCP::setDisable($id, '0');
                 break;
             case 'enable':
                 require_once 'CRM/Contribute/BAO/PCP.php';
                 CRM_Contribute_BAO_PCP::setDisable($id, '1');
                 break;
         }
         $session =& CRM_Core_Session::singleton();
         CRM_Utils_System::redirect($session->popUserContext());
     }
 }
 /**
  * TODO: How many checks do we need to do? Should we check to make sure the
  * activity is the right type? That the cid and aid are associated? Seems like
  * if you are messing with URL params you are kind of asking for trouble...
  */
 function preProcess()
 {
     $this->_aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE);
     $this->_cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE);
     $this->_vid = CRM_Utils_Request::retrieve('vid', 'Positive', $this, FALSE);
     if (!CRM_Volunteer_Permission::checkProjectPerms(CRM_Core_Action::UPDATE, $this->_vid)) {
         CRM_Utils_System::permissionDenied();
     }
     if (!$this->_aid && !($this->_cid && $this->_vid)) {
         CRM_Core_Error::fatal("Form expects an activity ID or both a contact and a volunteer project ID.");
     }
     $check = array('Activity' => $this->_aid, 'Contact' => $this->_cid, 'VolunteerProject' => $this->_vid);
     $errors = array();
     foreach ($check as $entityType => $entityID) {
         if (!$this->entityExists($entityType, $entityID)) {
             $errors[] = "No {$entityType} with ID {$entityID} exists.";
         }
     }
     if (count($errors)) {
         CRM_Core_Error::fatal("Invalid parameter(s) passed to commendation form: " . implode(' ', $errors));
     }
     $contact_display_name = civicrm_api3('Contact', 'getvalue', array('id' => $this->_cid, 'return' => 'display_name'));
     CRM_Utils_System::setTitle(ts('Commend %1', array(1 => $contact_display_name, 'domain' => 'org.civicrm.volunteer')));
     parent::preProcess();
 }
 function preProcess()
 {
     parent::preProcess();
     $bao = $this->controller->getImportBAO();
     $this->assign('importId', $bao->getImportId());
     $this->assign('importSummary', $this->get('importSummary'));
 }
 public function preProcess()
 {
     // we do not want to display recently viewed items, so turn off
     $this->assign('displayRecent', FALSE);
     // component null in controller object - fix? dgg
     // $this->_component = $this->controller->get('component');
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this);
     $this->assign('component', $this->_component);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $this->_context);
     $this->_pageId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
     $title = ts('Setup a Personal Campaign Page - Step 2');
     if ($this->_pageId) {
         $title = ts('Edit Your Personal Campaign Page');
     }
     CRM_Utils_System::setTitle($title);
     //MV: to get the Custom Data preProcess
     if (CRM_Core_Permission::check('administer CiviCRM')) {
         $this->_cdType = 'PCP';
         $this->_customValueCount = 1;
         CRM_Custom_Form_CustomData::preProcess($this, NULL, NULL, 1, $this->_cdType, $this->_pageId, NULL);
     }
     //END
     parent::preProcess();
 }
Esempio n. 6
0
 public function preProcess()
 {
     parent::preProcess();
     $this->_groupID = CRM_Utils_Request::retrieve('gid', 'Integer', $this, FALSE, NULL, 'REQUEST');
     // ensure that there is a destination, if not set the destination to the
     // referrer string
     if (!$this->controller->getDestination()) {
         $this->controller->setDestination(NULL, TRUE);
     }
     if ($this->_groupID) {
         $groupTypeCondition = CRM_Contact_BAO_Group::groupTypeCondition('Mailing');
         // make sure requested qroup is accessible and exists
         $query = "\nSELECT   title, description\n  FROM   civicrm_group\n WHERE   id={$this->_groupID}\n   AND   visibility != 'User and User Admin Only'\n   AND   {$groupTypeCondition}";
         $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
         if ($dao->fetch()) {
             $this->assign('groupName', $dao->title);
             CRM_Utils_System::setTitle(ts('Subscribe to Mailing List - %1', array(1 => $dao->title)));
         } else {
             CRM_Core_Error::statusBounce("The specified group is not configured for this action OR The group doesn't exist.");
         }
         $this->assign('single', TRUE);
     } else {
         $this->assign('single', FALSE);
         CRM_Utils_System::setTitle(ts('Mailing List Subscription'));
     }
 }
Esempio n. 7
0
 /**
  * Function to set variables up before form is built
  *
  * @return void
  * @access public
  */
 public function preProcess()
 {
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0, 'REQUEST');
     $this->_isTemplate = (bool) CRM_Utils_Request::retrieve('template', 'Integer', $this);
     $this->_jobPosition = CRM_Core_DAO::getFieldValue('CRM_HRRecruitment_DAO_HRVacancy', $this->_id, 'position');
     parent::preProcess();
 }
 /**
  * Overridden parent method to perform processing before form is build
  *
  * @access public
  */
 public function preProcess()
 {
     $this->ruleConditionId = CRM_Utils_Request::retrieve('rule_condition_id', 'Integer');
     $this->ruleCondition = new CRM_Civirules_BAO_RuleCondition();
     $this->ruleCondition->id = $this->ruleConditionId;
     $this->condition = new CRM_Civirules_BAO_Condition();
     $this->rule = new CRM_Civirules_BAO_Rule();
     $this->event = new CRM_Civirules_BAO_Event();
     if (!$this->ruleCondition->find(true)) {
         throw new Exception('Civirules could not find ruleCondition');
     }
     $this->condition->id = $this->ruleCondition->condition_id;
     if (!$this->condition->find(true)) {
         throw new Exception('Civirules could not find condition');
     }
     $this->rule->id = $this->ruleCondition->rule_id;
     if (!$this->rule->find(true)) {
         throw new Exception('Civirules could not find rule');
     }
     $this->event->id = $this->rule->event_id;
     if (!$this->event->find(true)) {
         throw new Exception('Civirules could not find event');
     }
     $this->eventClass = CRM_Civirules_BAO_Event::getPostEventObjectByClassName($this->event->class_name, true);
     $this->eventClass->setEventId($this->event->id);
     parent::preProcess();
 }
Esempio n. 9
0
 public function preProcess()
 {
     if (!CRM_Core_Permission::check('access CiviCRM') || !CRM_Core_Permission::check('administer CiviCRM')) {
         CRM_Utils_System::permissionDenied();
         exit;
     }
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false);
     $this->_object = CRM_Utils_Request::retrieve('object', 'String', $this, true);
     $isObjectID = true;
     if ($this->_action & CRM_Core_Action::ADD) {
         $isObjectID = false;
     }
     $this->_objectID = CRM_Utils_Request::retrieve('objectID', 'Integer', $this, $isObjectID);
     $this->_customFields = array();
     $this->assign('object', $this->_object);
     if ($this->_object == 'fee') {
         $this->_tableName = 'civicrm_value_extended_care_fee_tracker';
         CRM_Utils_System::setTitle(ts('Configure Fee Entry'));
         $this->_customFields = array('entity_id', 'fee_type', 'category', 'description', 'fee_date', 'total_blocks');
     } else {
         $this->_tableName = 'civicrm_value_extended_care_signout';
         CRM_Utils_System::setTitle(ts('Configure Activity block'));
         $this->_customFields = array('entity_id', 'pickup_person_name', 'signin_time', 'signout_time', 'class', 'is_morning', 'at_school_meeting');
     }
     $this->assign('fields', $this->_customFields);
     parent::preProcess();
 }
 function preProcess()
 {
     //$source = CRM_Utils_Request::retrieve('source', 'String', $this, true);
     //$id = CRM_Utils_Request::retrieve('id', 'Int', $this, true);
     //$this->loadItem($source, $id);
     CRM_Utils_System::setTitle('Import');
     parent::preProcess();
 }
Esempio n. 11
0
 function preProcess()
 {
     parent::preProcess();
     $this->_startDate = CRM_Utils_Request::retrieve('startDate', 'String', $this, false, date('Y-m-d', time() - 7 * 24 * 60 * 60));
     $this->_endDate = CRM_Utils_Request::retrieve('endDate', 'String', $this, false, date('Y-m-d'));
     $this->_includeMorning = CRM_Utils_Request::retrieve('includeMorning', 'Integer', $this, false, 1);
     $this->_showDetails = CRM_Utils_Request::retrieve('showDetails', 'Integer', $this, false, 1);
     $this->_notSignedOut = CRM_Utils_Request::retrieve('notSignedOut', 'Integer', $this, false, 0);
 }
 function preProcess()
 {
     parent::preProcess();
     $result = civicrm_api3('Setting', 'getfields');
     $this->_settingsMetadata = $result['count'] > 0 ? $result['values'] : array();
     $currentDomainId = civicrm_api3('Domain', 'getvalue', array('return' => 'id', 'current_domain' => 1));
     $setting = civicrm_api3('Setting', 'get');
     $this->_settings = $setting['values'][$currentDomainId];
 }
Esempio n. 13
0
 function preProcess()
 {
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Settings - Booking Preferences Configuration'));
     $configValue = CRM_Booking_BAO_BookingConfig::getConfig();
     $this->_config = $configValue;
     // load up javascript, css
     self::registerScripts();
 }
Esempio n. 14
0
 public function preProcess()
 {
     $this->_indexID = CRM_Utils_Request::retrieve('id', 'Integer', $this, FALSE);
     $this->_config = CRM_Utils_Request::retrieve('config', 'Integer', $this, 0);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/tplstrings', 'reset=1'));
     CRM_Utils_System::setTitle(ts('DB Template Strings'));
     parent::preProcess();
 }
Esempio n. 15
0
 function preProcess()
 {
     CRM_Core_Resources::singleton()->addScriptFile('com.zyxware.civiwci', 'js/createwidget.js');
     parent::preProcess();
     if (isset($_REQUEST['id'])) {
         $this->assign('emb_id', $_REQUEST['id']);
     }
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'REQUEST');
     $this->_colorFields = array('color_title' => array(ts('Title Text Color'), 'text', FALSE, '#BF0F0F'), 'color_title_bg' => array(ts('Title background color'), 'text', FALSE, '#FFFFFF'), 'color_bar' => array(ts('Progress Bar Color'), 'text', FALSE, '#BF0F0F'), 'color_bar_bg' => array(ts('Progress Bar Background Color'), 'text', FALSE, '#FFFFFF'), 'color_widget_bg' => array(ts('Background color'), 'text', FALSE, '#FFFFFF'), 'color_description' => array(ts('Description color'), 'text', FALSE, '#000000'), 'color_border' => array(ts('Border color'), 'text', FALSE, '#BF0F0F'), 'color_button' => array(ts('Button text color'), 'text', FALSE, '#FFFFFF'), 'color_button_bg' => array(ts('Button background color'), 'text', FALSE, '#BF0F0F'), 'color_btn_newsletter' => array(ts('Newsletter Button text color'), 'text', FALSE, '#FFFFFF'), 'color_btn_newsletter_bg' => array(ts('Newsletter Button color'), 'text', FALSE, '#BF0F0F'), 'newsletter_text' => array(ts('Newsletter text'), 'text', FALSE, 'Get the monthly newsletter'), 'color_newsletter_text' => array(ts('Newsletter text color'), 'text', FALSE, '#BF0F0F'));
 }
 /**
  * set variables up before form is built
  *
  * @access public
  */
 public function preProcess()
 {
     parent::preProcess();
     //Set the Backend Service in use currently.
     $this->backend_service_class = CRM_Core_BAO_Setting::getItem("securefiles", "securefiles_backend_service", null, "CRM_Securefiles_AmazonS3");
     $this->backend_service = CRM_Securefiles_Backend::getBackendService();
     if (!$this->backend_service) {
         CRM_Core_Session::setStatus(ts('We were unable to find the requested backend service: %1', array(1 => $this->backend_service_class)), "Error", "error");
     }
 }
Esempio n. 17
0
 /**
  * Function to set variables up before form is built
  *
  * @param null
  *
  * @return void
  * @access public
  */
 public function preProcess()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         //check permission for action.
         if (!CRM_Core_Permission::checkActionPermission('CiviEvent', $this->_action)) {
             CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
         }
         $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
         $this->_title = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $this->_id, 'title');
         $this->assign('title', $this->_title);
         parent::preProcess();
     }
     if (!$this->_action) {
         $this->_action = CRM_Utils_Array::value('action', $_GET);
         $this->_id = CRM_Utils_Array::value('id', $_GET);
     } else {
         $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     }
     //give the context.
     if (!isset($this->_context)) {
         $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     }
     $this->assign('context', $this->_context);
     $session = CRM_Core_Session::singleton();
     $context = $session->popUserContext();
     $userID = $session->get('userID');
     //do not allow destructive actions without permissions
     $permission = FALSE;
     if (CRM_Core_Permission::check('administer CiviCRM') || $userID && CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $this->_id, 'contact_id') == $userID) {
         $permission = TRUE;
     }
     if ($permission && $this->_id) {
         $this->_title = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $this->_id, 'title');
         switch ($this->_action) {
             case CRM_Core_Action::DELETE:
             case 'delete':
                 CRM_PCP_BAO_PCP::deleteById($this->_id);
                 CRM_Core_Session::setStatus(ts("The Campaign Page '%1' has been deleted.", array(1 => $this->_title)), ts('Page Deleted'), 'success');
                 break;
             case CRM_Core_Action::DISABLE:
             case 'disable':
                 CRM_PCP_BAO_PCP::setDisable($this->_id, '0');
                 CRM_Core_Session::setStatus(ts("The Campaign Page '%1' has been disabled.", array(1 => $this->_title)), ts('Page Disabled'), 'success');
                 break;
             case CRM_Core_Action::ENABLE:
             case 'enable':
                 CRM_PCP_BAO_PCP::setDisable($this->_id, '1');
                 CRM_Core_Session::setStatus(ts("The Campaign Page '%1' has been enabled.", array(1 => $this->_title)), ts('Page Enabled'), 'success');
                 break;
         }
         if ($context) {
             CRM_Utils_System::redirect($context);
         }
     }
 }
Esempio n. 18
0
 function preProcess()
 {
     $this->_PBSource_block = CRM_Utils_Request::retrieve('PBSource_block', 'Positive', $this, FALSE, NULL, 'REQUEST');
     $this->_rem_ids = CRM_Utils_Request::retrieve('rem_ids', 'String', $this, FALSE, NULL, 'REQUEST');
     $this->_PBblockId = CRM_Utils_Request::retrieve('PBblockId', 'Positive', $this, FALSE, NULL, 'REQUEST');
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, NULL, 'REQUEST');
     $this->assign('PBblockId', $this->_PBblockId);
     $this->assign('PBSource_block', $this->_PBSource_block);
     CRM_Core_Resources::singleton()->addScriptFile('com.zyxware.civiwci', 'js/addmore.js');
     parent::preProcess();
 }
Esempio n. 19
0
 /**
  * Set variables up before form is built.
  *
  * @return void
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_paymentProcessorID = CRM_Utils_Request::retrieve('processor_id', 'Integer', CRM_Core_DAO::$_nullObject, TRUE);
     $this->assignBillingType();
     // @todo - round about way to load it - just load as an object using civi\payment\system::getByProcessor
     $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($this->_paymentProcessorID, 'unused');
     CRM_Core_Payment_ProcessorForm::preProcess($this);
     self::addCreditCardJs();
     $this->assign('paymentProcessorID', $this->_paymentProcessorID);
 }
Esempio n. 20
0
 /**
  * Set variables up before form is built.
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_paymentProcessorID = CRM_Utils_Request::retrieve('processor_id', 'Integer', CRM_Core_DAO::$_nullObject, TRUE);
     $this->assignBillingType();
     $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($this->_paymentProcessorID);
     CRM_Core_Payment_ProcessorForm::preProcess($this);
     self::addCreditCardJs();
     $this->assign('paymentProcessorID', $this->_paymentProcessorID);
     $this->assign('suppressForm', TRUE);
 }
Esempio n. 21
0
 public function preProcess()
 {
     // we do not want to display recently viewed items, so turn off
     $this->assign('displayRecent', false);
     $this->_pageId = CRM_Utils_Request::retrieve('id', 'Positive', $this, false);
     $title = ts('Setup a Personal Campaign Page - Step 2');
     if ($this->_pageId) {
         $title = ts('Edit Your Personal Campaign Page');
     }
     CRM_Utils_System::setTitle($title);
     parent::preProcess();
 }
Esempio n. 22
0
 function preProcess()
 {
     parent::preProcess();
     $this->_date = CRM_Utils_Request::retrieve('date', 'String', $this, false, date('Y-m-d'));
     $this->_time = CRM_Utils_Request::retrieve('time', 'String', $this, false, date('G:i'));
     $this->_signOut = CRM_Utils_Request::retrieve('signOut', 'Integer', $this, false, 0);
     // get the dayOfWeek from the date
     $this->_dayOfWeek = date('l', strtotime($this->_date));
     $this->assign('displayDate', date('l - F d, Y', strtotime($this->_date)));
     $this->assign('dayOfWeek', $this->_dayOfWeek);
     $this->assign('date', $this->_date);
     $this->assign('time', $this->_time);
     $this->assign('signOut', $this->_signOut);
 }
Esempio n. 23
0
 /**
  * Set variables up before form is built.
  */
 public function preProcess()
 {
     parent::preProcess();
     $this->_values['custom_pre_id'] = CRM_Utils_Request::retrieve('pre_profile_id', 'Integer', $this);
     $this->_paymentProcessorID = CRM_Utils_Request::retrieve('processor_id', 'Integer', CRM_Core_DAO::$_nullObject, TRUE);
     $this->currency = CRM_Utils_Request::retrieve('currency', 'String', CRM_Core_DAO::$_nullObject, TRUE);
     $this->assignBillingType();
     $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($this->_paymentProcessorID);
     CRM_Core_Payment_ProcessorForm::preProcess($this);
     self::addCreditCardJs();
     $this->assign('paymentProcessorID', $this->_paymentProcessorID);
     $this->assign('currency', $this->currency);
     $this->assign('suppressForm', TRUE);
     $this->controller->_generateQFKey = FALSE;
 }
Esempio n. 24
0
 function preProcess()
 {
     parent::preProcess();
     CRM_Utils_System::setTitle(ts('Rebook', array('domain' => 'de.systopia.donrec')));
     $admin = CRM_Core_Permission::check('edit contributions');
     if (!$admin) {
         CRM_Core_Error::fatal(ts('You do not have the permissions required to access this page.', array('domain' => 'de.systopia.donrec')));
         CRM_Utils_System::redirect();
     }
     if (empty($_REQUEST['contributionIds'])) {
         die(ts("You need to specifiy a contribution to rebook.", array('domain' => 'de.systopia.donrec')));
     }
     $this->contribution_ids = array((int) $_REQUEST['contributionIds']);
     // check if the contributions are all from the same contact
     CRM_Donrec_Form_Task_Rebook::checkSameContact($this->contribution_ids);
 }
 /**
  * Set variables up before form is built.
  *
  * @return void
  */
 public function preProcess()
 {
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/web-tracking-report-form.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/main.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/components/flex-grid.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/components/dashboard.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/components/titles.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/components/active-users.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/components/view-selector.css');
     CRM_Core_Resources::singleton()->addStyleFile('org.civicrm.webtracking', 'css/EmbedAPI/components/date-range-selector.css');
     CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.webtracking', 'js/Report/GaApiMain.js', 6, 'page-body');
     CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.webtracking', 'js/Report/ActiveUsers.js', 7, 'page-body');
     CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.webtracking', 'js/Report/DateRangeSelector.js', 8, 'page-body');
     CRM_Core_Resources::singleton()->addScriptFile('org.civicrm.webtracking', 'js/Report/Dashboard.js', 9, 'page-body');
     parent::preProcess();
 }
Esempio n. 26
0
 public function preProcess()
 {
     // we do not want to display recently viewed items, so turn off
     $this->assign('displayRecent', FALSE);
     // component null in controller object - fix? dgg
     // $this->_component = $this->controller->get('component');
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this);
     $this->assign('component', $this->_component);
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $this->_context);
     $this->_pageId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
     $title = ts('Setup a Personal Campaign Page - Step 2');
     if ($this->_pageId) {
         $title = ts('Edit Your Personal Campaign Page');
     }
     CRM_Utils_System::setTitle($title);
     parent::preProcess();
 }
Esempio n. 27
0
 public function preProcess()
 {
     if (!CRM_Core_Permission::check('access CiviCRM')) {
         CRM_Utils_System::permissionDenied();
         exit;
     }
     $this->_indexID = CRM_Utils_Request::retrieve('id', 'Integer', $this, false);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, false);
     if ($this->_action & (CRM_Core_Action::DISABLE | CRM_Core_Action::ENABLE)) {
         return;
     }
     // table fields, fieldname => type
     $this->_customFields = array('term' => 'String', 'session' => 'String', 'name' => 'String', 'day_of_week' => 'String', 'min_grade' => 'Integer', 'max_grade' => 'Integer', 'start_date' => 'Timestamp', 'end_date' => 'Timestamp', 'instructor' => 'String', 'fee_block' => 'Float', 'total_fee_block' => 'Float', 'max_participants' => 'Integer', 'location' => 'String', 'url' => 'String', 'additional_rows' => 'Integer');
     if ($this->_action & CRM_Core_Action::ADD) {
         $this->_customFields['is_active'] = 'Integer';
     }
     parent::preProcess();
 }
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     //check for permission to view contributions
     if (!CRM_Core_Permission::check('access CiviContribute')) {
         CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
     }
     parent::preProcess();
     $contributionId = CRM_Utils_Array::value('id', $_GET);
     $contactId = CRM_Utils_Array::value('cid', $_GET);
     if (isset($contributionId) && isset($contactId)) {
         $this->set('contribution_id', $contributionId);
         $this->set('contact_id', $contactId);
     } else {
         $contributionId = $this->get('contribution_id');
         $contactId = $this->get('contact_id');
     }
     // might be callback to retrieve the downloadable PDF file
     $download = CRM_Utils_Array::value('download', $_GET);
     if ($download == 1) {
         $this->sendFile($contributionId, $contactId);
         // exits
     }
     list($issuedOn, $receiptId) = cdntaxreceipts_issued_on($contributionId);
     if (isset($receiptId)) {
         $existingReceipt = cdntaxreceipts_load_receipt($receiptId);
         $this->_reissue = 1;
         $this->_receipt = $existingReceipt;
     } else {
         $this->_reissue = 0;
     }
     list($method, $email) = cdntaxreceipts_sendMethodForContact($contactId);
     $this->_method = $method;
     if ($method == 'email') {
         $this->_sendTarget = $email;
     }
     // may need to offer a PDF file for download, if returning from form submission.
     // this sets up the form with proper JS to download the file, it doesn't actually send the file.
     // see ?download=1 for sending the file.
     $pdfDownload = CRM_Utils_Array::value('file', $_GET);
     if ($pdfDownload == 1) {
         $this->_pdfFile = 1;
     }
 }
Esempio n. 29
0
 /**
  * Function to set variables up before form is built
  *
  * @param null
  *
  * @return void
  * @access public
  */
 public function preProcess()
 {
     //CRM_Workflow_hook::testHook();
     // current set id
     $this->_wid = CRM_Utils_Request::retrieve('wid', 'Positive', $this, false, 0);
     // setting title for html page
     $title = ts('New Workflow');
     if ($this->_wid) {
         $title = CRM_Workflow_BAO_Workflow::getName($this->_wid);
     }
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $title = ts('Edit %1', array(1 => $title));
     } elseif ($this->_action & CRM_Core_Action::VIEW) {
         $title = ts('Preview %1', array(1 => $title));
     }
     CRM_Utils_System::setTitle($title);
     $this->set('BAOName', 'CRM_Workflow_BAO_Workflow');
     parent::preProcess();
 }
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     $group_name = "UK Direct Debit";
     $sql = " SELECT id ";
     $sql .= " ,      name ";
     $sql .= " ,      value ";
     $sql .= " FROM civicrm_setting ";
     $sql .= " WHERE group_name = %1 ";
     $params = array(1 => array($group_name, 'String'));
     $dao = CRM_Core_DAO::executeQuery($sql, $params);
     $directDebitArray = array();
     while ($dao->fetch()) {
         $directDebitArray[$dao->id]['id'] = $dao->id;
         $directDebitArray[$dao->id]['name'] = $dao->name;
         $directDebitArray[$dao->id]['value'] = unserialize($dao->value);
     }
     $this->assign('directDebitArray', $directDebitArray);
     parent::preProcess();
     return false;
 }