Skip to content

Commit

Permalink
Merge pull request #9658 from eileenmcnaughton/comments
Browse files Browse the repository at this point in the history
Comments
  • Loading branch information
eileenmcnaughton authored Jan 10, 2017
2 parents fbc6bb9 + f3f0065 commit c1cc524
Show file tree
Hide file tree
Showing 69 changed files with 477 additions and 64 deletions.
2 changes: 1 addition & 1 deletion CRM/ACL/Form/WordPress/Permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function postProcess() {
// Get the permissions into a format that matches what we get from WP
$allWarningPermissions = CRM_Core_Permission::getAnonymousPermissionsWarnings();
foreach ($allWarningPermissions as $key => $permission) {
$allWarningPermissions[$key] = CRM_utils_String::munge(strtolower($permission));
$allWarningPermissions[$key] = CRM_Utils_String::munge(strtolower($permission));
}
$warningPermissions = array_intersect($allWarningPermissions, array_keys($rolePermissions));
$warningPermissionNames = array();
Expand Down
5 changes: 5 additions & 0 deletions CRM/Activity/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ public static function _convertToCaseActivity($params) {
return (array('error_msg' => $error_msg, 'newId' => $mainActivity->id));
}

/**
* Get activities for the contact.
*
* @return array
*/
public static function getContactActivity() {
$requiredParameters = array(
'cid' => 'Integer',
Expand Down
3 changes: 3 additions & 0 deletions CRM/Activity/Tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
*/
class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {

/**
* CRM_Activity_Tokens constructor.
*/
public function __construct() {
parent::__construct('activity', array(
'activity_id' => ts('Activity ID'),
Expand Down
3 changes: 2 additions & 1 deletion CRM/Admin/Form/Setting/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ public function postProcess() {
}

/**
* @param $dsn
* Load case sample data.
*
* @param string $fileName
* @param bool $lineMode
*/
Expand Down
15 changes: 15 additions & 0 deletions CRM/Admin/Form/Setting/Localization.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public static function formRule($fields) {
return empty($errors) ? TRUE : $errors;
}

/**
* Set the default values for the form.
*
* @return array
*/
public function setDefaultValues() {
parent::setDefaultValues();

Expand Down Expand Up @@ -277,6 +282,8 @@ public static function getAvailableCountries() {
}

/**
* Get the default locale options.
*
* @return array
*/
public static function getDefaultLocaleOptions() {
Expand Down Expand Up @@ -319,6 +326,14 @@ public static function getCurrencySymbols() {
return $_currencySymbols;
}

/**
* Update session and uf_match table when the locale is updated.
*
* @param string $oldLocale
* @param string $newLocale
* @param array $metadata
* @param int $domainID
*/
public static function onChangeLcMessages($oldLocale, $newLocale, $metadata, $domainID) {
if ($oldLocale == $newLocale) {
return;
Expand Down
4 changes: 3 additions & 1 deletion CRM/Batch/Form/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public function preProcess() {
}

/**
* Used in test to set Batch ID
* Set Batch ID.
*
* @param int $id
*/
public function setBatchID($id) {
$this->_batchId = $id;
Expand Down
6 changes: 5 additions & 1 deletion CRM/Campaign/Form/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ public function preProcess() {
CRM_Utils_System::setTitle(ts('Find Respondents To %1', array(1 => ucfirst($this->_operation))));
}

/**
* Load the default survey for all actions.
*
* @return array
*/
public function setDefaultValues() {
//load the default survey for all actions.
if (empty($this->_defaults)) {
$defaultSurveyId = key(CRM_Campaign_BAO_Survey::getSurveys(TRUE, TRUE));
if ($defaultSurveyId) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static function formRule($fields, $files, $self) {
return TRUE;
}

return parent::formrule($fields, $files, $self);
return parent::formRule($fields, $files, $self);
}

/**
Expand Down
5 changes: 5 additions & 0 deletions CRM/Case/Form/Task/PDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public function preProcess() {
CRM_Contact_Form_Task_PDFLetterCommon::preProcess($this);
}

/**
* Set defaults for the pdf.
*
* @return array
*/
public function setDefaultValues() {
return CRM_Contact_Form_Task_PDFLetterCommon::setDefaultValues();
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Case/Form/Task/Print.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CRM_Case_Form_Task_Print extends CRM_Case_Form_Task {
* Build all the data structures needed to build the form.
*/
public function preProcess() {
parent::preprocess();
parent::preProcess();

// set print view, so that print templates are called
$this->controller->setPrint(1);
Expand Down
5 changes: 5 additions & 0 deletions CRM/Contact/Form/DedupeFind.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public function buildQuickForm() {
);
}

/**
* Set the default values for the form.
*
* @return array
*/
public function setDefaultValues() {
$this->_defaults['limit'] = Civi::settings()->get('dedupe_default_limit');
return $this->_defaults;
Expand Down
2 changes: 2 additions & 0 deletions CRM/Contact/Form/Task/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public function buildQuickForm() {

/**
* Common Function to build Mailing Label Form.
*
* @param CRM_Core_Form $form
*/
public static function buildLabelForm($form) {
CRM_Utils_System::setTitle(ts('Make Mailing Labels'));
Expand Down
7 changes: 7 additions & 0 deletions CRM/Core/BAO/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ public static function defaultCurrencySymbol($defaultCurrency = NULL) {
return $cachedSymbol;
}

/**
* Get the default currency symbol.
*
* @param string $k Unused variable
*
* @return string
*/
public static function getDefaultCurrencySymbol($k = NULL) {
$config = CRM_Core_Config::singleton();
return $config->defaultCurrencySymbol(Civi::settings()->get('defaultCurrency'));
Expand Down
10 changes: 10 additions & 0 deletions CRM/Core/BAO/PrevNextCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ public static function deletePair($id1, $id2, $cacheKey = NULL, $isViceVersa = F
CRM_Core_DAO::executeQuery($sql, $params);
}

/**
* Mark contacts as being in conflict.
*
* @param int $id1
* @param int $id2
* @param string $cacheKey
* @param array $conflicts
*
* @return bool
*/
public static function markConflict($id1, $id2, $cacheKey, $conflicts) {
if (empty($cacheKey) || empty($conflicts)) {
return FALSE;
Expand Down
5 changes: 3 additions & 2 deletions CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,7 @@ public static function findContact(&$params, $id = NULL, $contactType = 'Individ
}

/**
* Given a contact id and a field set, return the values from the db
* for this contact
* Given a contact id and a field set, return the values from the db.
*
* @param int $cid
* @param array $fields
Expand All @@ -958,6 +957,8 @@ public static function findContact(&$params, $id = NULL, $contactType = 'Individ
* @param bool $absolute
* Return urls in absolute form (useful when sending an email).
* @param null $additionalWhereClause
*
* @return null|array
*/
public static function getValues(
$cid, &$fields, &$values,
Expand Down
10 changes: 10 additions & 0 deletions CRM/Core/CodeGen/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function needsUpdate() {
$this->getRaw());
}

/**
* Run generator.
*/
public function run() {
echo "Generating {$this->name} as " . $this->getRelFileName() . "\n";

Expand Down Expand Up @@ -78,11 +81,18 @@ public function getRaw() {
return $this->raw;
}

/**
* Get relative file name.
*
* @return string
*/
public function getRelFileName() {
return $this->tables[$this->name]['fileName'];
}

/**
* Get the absolute file name.
*
* @return string
*/
public function getAbsFileName() {
Expand Down
10 changes: 10 additions & 0 deletions CRM/Core/CodeGen/Reflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function needsUpdate() {
}


/**
* Run generator.
*/
public function run() {
echo "Generating table list\n";
$template = new CRM_Core_CodeGen_Util_Template('php');
Expand All @@ -55,12 +58,19 @@ public function getRaw() {
}

/**
* Get absolute file name.
*
* @return string
*/
protected function getAbsFileName() {
return $this->config->CoreDAOCodePath . "AllCoreTables.data.php";
}

/**
* Get the checksum for the schema.
*
* @return string
*/
protected function getSchemaChecksum() {
if (!$this->checksum) {
CRM_Utils_Array::flatten($this->tables, $flat);
Expand Down
4 changes: 4 additions & 0 deletions CRM/Core/CodeGen/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
* Create SQL files to create and populate a new schema.
*/
class CRM_Core_CodeGen_Schema extends CRM_Core_CodeGen_BaseTask {

/**
* CRM_Core_CodeGen_Schema constructor.
*
* @param \CRM_Core_CodeGen_Main $config
*/
public function __construct($config) {
parent::__construct($config);
Expand Down
9 changes: 9 additions & 0 deletions CRM/Core/CodeGen/Util/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function runConcat($inputs, $outpath) {
}

/**
* Run template generator.
*
* @param string $infile
* Filename of the template, without a path.
* @param string $outpath
Expand All @@ -68,6 +70,13 @@ public function run($infile, $outpath) {
}
}

/**
* Fetch via Smarty.
*
* @param string $infile
*
* @return string
*/
public function fetch($infile) {
return $this->smarty->fetch($infile);
}
Expand Down
39 changes: 39 additions & 0 deletions CRM/Core/Config/MagicMerge.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ class CRM_Core_Config_MagicMerge {

private $cache = array();

/**
* CRM_Core_Config_MagicMerge constructor.
*/
public function __construct() {
$this->map = self::getPropertyMap();
}

/**
* Set the map to the property map.
*/
public function __wakeup() {
$this->map = self::getPropertyMap();
}
Expand Down Expand Up @@ -204,6 +210,14 @@ public static function getPropertyMap() {
);
}

/**
* Get value.
*
* @param string $k
*
* @return mixed
* @throws \CRM_Core_Exception
*/
public function __get($k) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot read unrecognized property CRM_Core_Config::\${$k}.");
Expand Down Expand Up @@ -281,6 +295,14 @@ public function __get($k) {
}
}

/**
* Set value.
*
* @param string $k
* @param mixed $v
*
* @throws \CRM_Core_Exception
*/
public function __set($k, $v) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot set unrecognized property CRM_Core_Config::\${$k}");
Expand Down Expand Up @@ -311,10 +333,24 @@ public function __set($k, $v) {
}
}

/**
* Is value set.
*
* @param string $k
*
* @return bool
*/
public function __isset($k) {
return isset($this->map[$k]);
}

/**
* Unset value.
*
* @param string $k
*
* @throws \CRM_Core_Exception
*/
public function __unset($k) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot unset unrecognized property CRM_Core_Config::\${$k}");
Expand Down Expand Up @@ -358,6 +394,9 @@ protected function getSettings() {
return $this->settings;
}

/**
* Initialise local settings.
*/
private function initLocals() {
if ($this->locals === NULL) {
$this->locals = array(
Expand Down
5 changes: 5 additions & 0 deletions CRM/Core/Config/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ public function initialize($loadFromDB = TRUE) {
$this->initialized = 1;
}

/**
* Exit processing after a fatal event, outputting the message.
*
* @param string $message
*/
private function fatal($message) {
echo $message;
exit();
Expand Down
Loading

0 comments on commit c1cc524

Please sign in to comment.