parent::__construct($title, $modal);
-
$this->_stateMachine = new CRM_PCP_StateMachine_PCP($this, $action);
// create and instantiate the pages
}
$attrib = array('rows' => 8, 'cols' => 60);
- $this->add('textarea', 'page_text', ts('Your Message'), null, false );
+ $this->add('textarea', 'page_text', ts('Your Message'), NULL, FALSE );
$maxAttachments = 1;
CRM_Core_BAO_File::buildAttachment($this, 'civicrm_pcp', $this->_pageId, $maxAttachments);
$pcp = CRM_PCP_BAO_PCP::add($params, FALSE);
-
// add attachments as needed
CRM_Core_BAO_File::formatAttachment($params,
$params,
$supporterName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $pcp->contact_id, 'display_name');
$this->assign('supporterName', $supporterName);
-
if ($this->_component == 'contribute') {
$pageUrl = CRM_Utils_System::url('civicrm/contribute/transact',
"reset=1&id={$pcpBlock->entity_id}",
$defaults = array();
if (isset($this->_id)) {
- $title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'title');
- CRM_Utils_System::setTitle(ts('Personal Campaign Page Settings (%1)', array(1 => $title)));
+ $title = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'title');
+ CRM_Utils_System::setTitle(ts('Personal Campaign Page Settings (%1)', array(1 => $title)));
$params = array('entity_id' => $this->_id, 'entity_table' => 'civicrm_event');
CRM_Core_DAO::commonRetrieve('CRM_PCP_DAO_PCPBlock', $params, $defaults);
$this->assign('context', $this->_context);
-
$session = CRM_Core_Session::singleton();
$context = $session->popUserContext();
$userID = $session->get('userID');
* @return array list of errors to be posted back to the form
* @static
*/
- public static function formRule($fields, $files, $form) {}
+ public static function formRule($fields, $files, $form) {
+ }
/**
* Process the form
class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
/**
- *Variable defined for Contribution Page Id
+ * Variable defined for Contribution Page Id
*
*/
}
}
-
if ($this->_component == 'contribute') {
$this->assign('campaignName', CRM_Contribute_PseudoConstant::contributionPage($this->_pageId));
}
if ($this->_single) {
$button = array(
- array('type' => 'next',
+ array(
+ 'type' => 'next',
'name' => ts('Save'),
'spacing' => ' ',
'isDefault' => TRUE,
'extra' => 'onclick = "return confirm(\'' . $deleteExtra . '\');"',
'title' => ts('Delete Personal Campaign Page'),
),
- CRM_Core_Action::ENABLE => array('name' => ts('Enable'),
+ CRM_Core_Action::ENABLE => array(
+ 'name' => ts('Enable'),
'url' => 'civicrm/admin/pcp',
'qs' => 'action=enable&id=%%id%%',
'title' => ts('Enable'),
),
- CRM_Core_Action::DISABLE => array('name' => ts('Disable'),
+ CRM_Core_Action::DISABLE => array(
+ 'name' => ts('Disable'),
'url' => 'civicrm/admin/pcp',
'qs' => 'action=disable&id=%%id%%',
'title' => ts('Disable'),
$this->_sortByCharacter = '';
}
-
$status = CRM_PCP_BAO_PCP::buildOptions('status_id', 'create');
$pcpSummary = $params = array();
$hints = array(
CRM_Core_Action::UPDATE => ts('Change the content and appearance of your page'),
CRM_Core_Action::DETACH => ts('Send emails inviting your friends to support your campaign!'),
- CRM_Core_Action::VIEW => ts('Copy this link to share directly with your network!'),
+ CRM_Core_Action::VIEW => ts('Copy this link to share directly with your network!'),
CRM_Core_Action::BROWSE => ts('Update your personal contact information'),
CRM_Core_Action::DISABLE => ts('De-activate the page (you can re-activate it later)'),
CRM_Core_Action::ENABLE => ts('Activate the page (you can de-activate it later)'),
$totalAmount = CRM_PCP_BAO_PCP::thermoMeter($this->_id);
$achieved = round($totalAmount / $pcpInfo['goal_amount'] * 100, 2);
-
if ($pcpBlock->is_active == 1) {
$linkTextUrl = CRM_Utils_System::url('civicrm/contribute/campaign',
"action=add&reset=1&pageId={$pcpInfo['page_id']}&component={$pcpInfo['page_type']}",
$endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('end_date', $pageInfo));
}
-
$now = time();
$validDate = TRUE;
if ($startDate && $startDate >= $now) {
$this->assign('parentURL', $parentUrl);
-
if ($validDate) {
$contributionText = ts('Contribute Now');