static $_signupActType = NULL;
+ /**
+ * class constructor
+ *
+ * @access public
+ * @return \CRM_Member_DAO_Membership
+ */
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
return $membesrshipPayment;
}
+ /**
+ * @param $form
+ * @param null $membershipTypeID
+ *
+ * @return array
+ */
static function &buildMembershipTypeValues(&$form, $membershipTypeID = NULL) {
$whereClause = " WHERE domain_id = ". CRM_Core_Config::domainID();
return $membershipLog->delete();
}
+ /**
+ * @param $contactID
+ */
static function resetModifiedID($contactID) {
$query = "
UPDATE civicrm_membership_log
}
+ /**
+ * @param $params
+ * @param $ids
+ * @param $previousID
+ * @param $membershipTypeId
+ */
public static function createMembershipPriceField($params, $ids, $previousID, $membershipTypeId) {
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', 'default_membership_type_amount', 'id', 'name');
*/
class CRM_Member_BAO_Query {
+ /**
+ * @return array
+ */
static function &getFields() {
$fields = CRM_Member_BAO_Membership::exportableFields();
return $fields;
}
}
+ /**
+ * @param $query
+ */
static function where(&$query) {
$grouping = NULL;
foreach (array_keys($query->_params) as $id) {
}
}
+ /**
+ * @param $values
+ * @param $query
+ */
static function whereClauseSingle(&$values, &$query) {
list($name, $op, $value, $grouping, $wildcard) = $values;
switch ($name) {
}
}
+ /**
+ * @param $name
+ * @param $mode
+ * @param $side
+ *
+ * @return null|string
+ */
static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
return $from;
}
+ /**
+ * @param $mode
+ * @param bool $includeCustomFields
+ *
+ * @return array|null
+ */
static function defaultReturnProperties($mode,
$includeCustomFields = TRUE
) {
return $properties;
}
+ /**
+ * @param $form
+ */
static function buildSearchForm(&$form) {
foreach (CRM_Member_PseudoConstant::membershipType() as $id => $Name) {
$form->_membershipType = &$form->addElement('checkbox', "member_membership_type_id[$id]", NULL, $Name);
$form->setDefaults(array('member_test' => 0));
}
+ /**
+ * @param $row
+ * @param $id
+ */
static function searchAction(&$row, $id) {}
+ /**
+ * @param $tables
+ */
static function tableNames(&$tables) {
//add membership table
if (!empty($tables['civicrm_membership_log']) || !empty($tables['civicrm_membership_status']) || CRM_Utils_Array::value('civicrm_membership_type', $tables)) {
*
* @access public
*
- * @return void
+ * @return array defaults
*/
function setDefaultValues() {
$defaults = array();
* - contact_id
* - soft_credit_contact_id
*/
+ /**
+ * @param $formValues
+ */
function storeContactFields($formValues){
// in a 'standalone form' (contact id not in the url) the contact will be in the form values
if (!empty($formValues['contact_id'])) {
* @return void
*/
public function setDefaultValues() {
- $defaults = array();
$defaults = parent::setDefaultValues();
//finding default weight to be put
}
}
+ /**
+ * @param $previousID
+ * @param $priceSetId
+ * @param $membershipTypeId
+ * @param $optionsIds
+ */
public static function checkPreviousPriceField($previousID, $priceSetId, $membershipTypeId, &$optionsIds) {
if ($previousID) {
$editedFieldParams = array(
self::preProcessCommon($this);
}
+ /**
+ * @param $form
+ * @param bool $useTable
+ */
static function preProcessCommon(&$form, $useTable = FALSE) {
$form->_memberIds = array();
*/
public $_value;
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ */
function __construct($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
$this->_name = $name;
$this->_title = $title;
$this->_value = $value;
}
+ /**
+ * @return bool
+ */
function validate() {
if (CRM_Utils_System::isNull($this->_value)) {
public function preProcess() {
// set the error message path to display
- $errorFile = $this->assign('errorFile', $this->get('errorFile'));
+ $this->assign('errorFile', $this->get('errorFile'));
$totalRowCount = $this->get('totalRowCount');
$relatedCount = $this->get('relatedCount');
*/
protected $_haveColumnHeader;
+ /**
+ * @param $fileName
+ * @param string $seperator
+ * @param $mapper
+ * @param bool $skipColumnHeader
+ * @param int $mode
+ * @param int $contactType
+ * @param int $onDuplicate
+ *
+ * @return mixed
+ * @throws Exception
+ */
function run($fileName,
$seperator = ',',
&$mapper,
return $params;
}
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ */
function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
if (empty($name)) {
$this->_fields['doNotImport'] = new CRM_Member_Import_Field($name, $title, $type, $headerPattern, $dataPattern);
protected $keyword = 'member';
// docs inherited from interface
+ /**
+ * Provides base information about the component.
+ * Needs to be implemented in component's information
+ * class.
+ *
+ * @return array collection of required component settings
+ * @access public
+ *
+ */
+ /**
+ * @return array
+ */
public function getInfo() {
return array(
'name' => 'CiviMember',
// docs inherited from interface
+ /**
+ * Provides permissions that are used by component.
+ * Needs to be implemented in component's information
+ * class.
+ *
+ * NOTE: if using conditionally permission return,
+ * implementation of $getAllUnconditionally is required.
+ *
+ * @param bool $getAllUnconditionally
+ *
+ * @return array|null collection of permissions, null if none
+ * @access public
+ */
+ /**
+ * @param bool $getAllUnconditionally
+ *
+ * @return array|null
+ */
public function getPermissions($getAllUnconditionally = FALSE) {
return array(
'access CiviMember',
}
// docs inherited from interface
+ /**
+ * Provides information about user dashboard element
+ * offered by this component.
+ *
+ * @return array|null collection of required dashboard settings,
+ * null if no element offered
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function getUserDashboardElement() {
return array('name' => ts('Memberships'),
'title' => ts('Your Membership(s)'),
}
// docs inherited from interface
+ /**
+ * Provides information about user dashboard element
+ * offered by this component.
+ *
+ * @return array|null collection of required dashboard settings,
+ * null if no element offered
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function registerTab() {
return array('title' => ts('Memberships'),
'url' => 'membership',
}
// docs inherited from interface
+ /**
+ * Provides information about advanced search pane
+ * offered by this component.
+ *
+ * @return array|null collection of required pane settings,
+ * null if no element offered
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function registerAdvancedSearchPane() {
return array('title' => ts('Memberships'),
'weight' => 30,
}
// docs inherited from interface
+ /**
+ * Provides potential activity types that this
+ * component might want to register in activity history.
+ * Needs to be implemented in component's information
+ * class.
+ *
+ * @return array|null collection of activity types
+ * @access public
+ *
+ */
+ /**
+ * @return array|null
+ */
public function getActivityTypes() {
return NULL;
}
// add shortcut to Create New
+ /**
+ * @param $shortCuts
+ * @param $newCredit
+ */
public function creatNewShortcut(&$shortCuts, $newCredit) {
if (CRM_Core_Permission::check('access CiviMember') &&
CRM_Core_Permission::check('edit memberships')
return parent::run();
}
+ /**
+ * @param $form
+ * @param null $contactId
+ */
public static function setContext(&$form, $contactId = NULL) {
$context = CRM_Utils_Request::retrieve('context', 'String', $form, FALSE, 'search' );
return self::$_columnHeaders;
}
+ /**
+ * @return mixed
+ */
function alphabetQuery() {
return $this->_query->searchQuery(NULL, NULL, NULL, FALSE, FALSE, TRUE);
}
+ /**
+ * @return string
+ */
function &getQuery() {
return $this->_query;
}
}
}
+ /**
+ * @return string
+ */
function getDefaultBlockLocation() {
return 'left';
}
+ /**
+ * @return string
+ */
function getVersion() {
return 'Unknown';
}
* @param integer $ufID User ID in CMS
* @param string $ufName User name
*/
+ /**
+ * @param $ufID
+ * @param $ufName
+ */
function updateCMSName($ufID, $ufName) {
// CRM-5555
if (function_exists('user_load')) {
* @return string $destination destination value for URL
*
*/
+ /**
+ * @param $form
+ *
+ * @return null|string
+ */
function getLoginDestination(&$form) {
$args = NULL;
/*
* Load user into session
*/
+ /**
+ * @param $username
+ *
+ * @return bool
+ */
function loadUser($username) {
global $user;
drupal_set_message($message);
}
+ /**
+ * @return mixed
+ */
function logout() {
module_load_include('inc', 'user', 'user.pages');
return user_logout();
return CRM_Core_I18n_PseudoConstant::longForShort(substr($language->language, 0, 2));
}
+ /**
+ * @return string
+ */
function getVersion() {
return defined('VERSION') ? VERSION : 'Unknown';
}
* @param integer $ufID User ID in CMS
* @param string $ufName User name
*/
+ /**
+ * @param $ufID
+ * @param $ufName
+ */
function updateCMSName($ufID, $ufName) {
// CRM-5555
if (function_exists('user_load')) {
return CRM_Core_I18n_PseudoConstant::longForShort(substr($language->language, 0, 2));
}
+ /**
+ * @return string
+ */
function getVersion() {
return defined('VERSION') ? VERSION : 'Unknown';
}
* Drupal specific stuff goes here
*/
abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
+ /**
+ *
+ */
function __construct() {
$this->is_drupal = TRUE;
$this->supports_form_extensions = TRUE;
* Joomla specific stuff goes here
*/
class CRM_Utils_System_Joomla extends CRM_Utils_System_Base {
+ /**
+ *
+ */
function __construct() {
$this->is_drupal = FALSE;
}
return;
}
+ /**
+ * @param $user
+ *
+ * @return bool
+ */
function loadUser($user) {
return TRUE;
}
return NULL;
}
+ /**
+ * @return string
+ */
function getVersion() {
if (class_exists('JVersion')) {
$version = new JVersion;
return $loginURL;
}
+ /**
+ * @param $form
+ */
public function getLoginDestination(&$form) {
return;
}
* Helper authentication class for unit tests
*/
class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
+ /**
+ *
+ */
function __construct() {
$this->is_drupal = FALSE;
$this->supports_form_extensions = False;
}
+ /**
+ * sets the title of the page
+ *
+ * @param string $title
+ * @param null $pageTitle
+ *
+ * @paqram string $pageTitle
+ *
+ * @return void
+ * @access public
+ */
+ /**
+ * @param string $title
+ * @param null $pageTitle
+ */
function setTitle($title, $pageTitle = NULL) {
return;
}
+ /**
+ * Authenticate the user against the drupal db
+ *
+ * @param string $name the user name
+ * @param string $password the password for the above user name
+ * @param boolean $loadCMSBootstrap load cms bootstrap?
+ * @param NULL|string $realPath filename of script
+ *
+ * @return mixed false if no auth
+ * array(
+ * contactID, ufID, unique string ) if success
+ * @access public
+ */
+ /**
+ * @param string $name
+ * @param string $password
+ * @param bool $loadCMSBootstrap
+ * @param null|string $realPath
+ *
+ * @return mixed
+ */
static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) {
$retVal = array(1, 1, 12345);
return $retVal;
}
+ /**
+ * Append an additional breadcrumb tag to the existing breadcrumb
+ *
+ * @param $breadCrumbs
+ *
+ * @internal param string $title
+ * @internal param string $url
+ *
+ * @return void
+ * @access public
+ */
+ /**
+ * @param $breadCrumbs
+ */
function appendBreadCrumb($breadCrumbs) {
return;
}
return;
}
+ /**
+ * Append a string to the head of the html file
+ *
+ * @param string $header the new string to be appended
+ *
+ * @return void
+ * @access public
+ */
+ /**
+ * @param string $head
+ */
function addHTMLHead($head) {
return;
}
$base_url = str_replace('http://', 'https://', $base_url);
}
+ /**
+ * figure out the post url for the form
+ *
+ * @param mix $action the default action if one is pre-specified
+ *
+ * @return string the url to post the form
+ * @access public
+ */
+ /**
+ * @param mix $action
+ *
+ * @return string
+ */
function postURL($action) {
return;
}
+ /**
+ * Generate an internal CiviCRM URL (copied from DRUPAL/includes/common.inc#url)
+ *
+ * @param $path string The path being linked to, such as "civicrm/add"
+ * @param $query string A query string to append to the link.
+ * @param $absolute boolean Whether to force the output to be an absolute link (beginning with http:).
+ * Useful for links that will be displayed outside the site, such as in an
+ * RSS feed.
+ * @param $fragment string A fragment identifier (named anchor) to append to the link.
+ * @param $htmlize boolean whether to convert to html eqivalant
+ * @param $frontend boolean a gross joomla hack
+ * @param $forceBackend boolean a gross joomla hack
+ *
+ * @return string an HTML string containing a link to the given path.
+ * @access public
+ *
+ */
+ /**
+ * @param null|string $path
+ * @param null|string $query
+ * @param bool $absolute
+ * @param null|string $fragment
+ * @param bool $htmlize
+ * @param bool $frontend
+ * @param bool $forceBackend
+ *
+ * @return string
+ */
function url($path = NULL, $query = NULL, $absolute = FALSE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
}
}
+ /**
+ * @param $user
+ */
function getUserID($user) {
//FIXME: look here a bit closer when testing UFMatch
CRM_Core_BAO_UFMatch::synchronize($user, TRUE, 'Standalone', 'Individual');
}
+ /**
+ * @param $user
+ *
+ * @return bool
+ */
function getAllowedToLogin($user) {
return TRUE;
}
+ /**
+ * Set a message in the UF to display to a user
+ *
+ * @param string $message the message to set
+ *
+ * @access public
+ */
+ /**
+ * @param string $message
+ */
function setMessage($message) {
return;
}
header("Location:index.php");
}
+ /**
+ * Get the locale set in the hosting CMS
+ *
+ * @return string with the locale or null for none
+ */
+ /**
+ * @return string
+ */
function getUFLocale() {
return NULL;
}
+ /**
+ * Get a list of all installed modules, including enabled and disabled ones
+ *
+ * @return array CRM_Core_Module
+ */
+ /**
+ * @return array
+ */
function getModules() {
return array();
}
* WordPress specific stuff goes here
*/
class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
+ /**
+ *
+ */
function __construct() {
$this->is_drupal = FALSE;
}
return $base . '?' . implode($separator, $queryParts) . $fragment;
}
+ /**
+ * @param $absolute
+ * @param $frontend
+ * @param $forceBackend
+ *
+ * @return mixed|null|string
+ */
private function getBaseUrl($absolute, $frontend, $forceBackend) {
$config = CRM_Core_Config::singleton();
function setMessage($message) {
}
+ /**
+ * @param $user
+ *
+ * @return bool
+ */
function loadUser( $user ) {
return true;
}
return true;
}
+ /**
+ * @param $dir
+ *
+ * @return bool
+ */
function validInstallDir($dir) {
$includePath = "$dir/wp-includes";
if (
return FALSE;
}
+ /**
+ * Determine the location of the CMS root.
+ *
+ * @return string|NULL local file system path to CMS root, or NULL if it cannot be determined
+ */
+ /**
+ * @return NULL|string
+ */
function cmsRootPath() {
$cmsRoot = $valid = NULL;
if (defined('CIVICRM_CMSDIR')) {
return ($valid) ? $cmsRoot : NULL;
}
+ /**
+ * @param $params
+ * @param $mail
+ *
+ * @return mixed
+ */
function createUser(&$params, $mail) {
$user_data = array(
'ID' => '',
}
}
+ /**
+ * @param $params
+ * @param $errors
+ * @param string $emailName
+ */
function checkUserNameEmailExists(&$params, &$errors, $emailName = 'email') {
$config = CRM_Core_Config::singleton();
return $isloggedIn;
}
+ /**
+ * @return mixed
+ */
function getLoggedInUserObject() {
if (function_exists('is_user_logged_in') &&
is_user_logged_in()) {
return $loginURL;
}
+ /**
+ * @param $form
+ */
public function getLoginDestination(&$form) {
return;
}
*
* Modified and improved upon by CiviCRM LLC (c) 2007
*/
+
+/**
+ * Class CRM_Widget_Widget
+ */
class CRM_Widget_Widget {
static $_methodTable;