Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment Fixes for CRM/Profile directory #9351

Merged
merged 1 commit into from
Nov 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions CRM/Profile/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/

Expand Down Expand Up @@ -122,7 +121,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
protected $_isPermissionedChecksum = FALSE;

/**
* THe context from which we came from, allows us to go there if redirect not set
* THe context from which we came from, allows us to go there if redirect not set.
*
* @var string
*/
Expand All @@ -137,7 +136,7 @@ class CRM_Profile_Form extends CRM_Core_Form {

/**
* Store profile ids if multiple profile ids are passed using comma separated.
* Currently lets implement this functionality only for dialog mode
* Currently lets implement this functionality only for dialog mode.
*/
protected $_profileIds = array();

Expand All @@ -161,7 +160,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
protected $_recordId = NULL;

/**
* Action for multi record profile (create/edit/delete)
* Action for multi record profile (create/edit/delete).
*
* @var string
*/
Expand Down Expand Up @@ -191,10 +190,6 @@ public function getDefaultEntity() {
* Pre processing work done here.
*
* gets session variables for table name, id of entity in table, type of entity and stores them.
*
* @param
*
* @return void
*/
public function preProcess() {
$this->_id = $this->get('id');
Expand Down Expand Up @@ -268,7 +263,7 @@ public function preProcess() {
}
$this->_isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($this->_gid);

//get values for ufGroupName, captch and dupe update.
//get values for ufGroupName, captcha and dupe update.
if ($this->_gid) {
$dao = new CRM_Core_DAO_UFGroup();
$dao->id = $this->_gid;
Expand All @@ -289,7 +284,7 @@ public function preProcess() {

$gids = empty($this->_profileIds) ? $this->_gid : $this->_profileIds;

// if we dont have a gid use the default, else just use that specific gid
// if we don't have a gid use the default, else just use that specific gid
if (($this->_mode == self::MODE_REGISTER || $this->_mode == self::MODE_CREATE) && !$this->_gid) {
$this->_ctype = CRM_Utils_Request::retrieve('ctype', 'String', $this, FALSE, 'Individual', 'REQUEST');
$this->_fields = CRM_Core_BAO_UFGroup::getRegistrationFields($this->_action, $this->_mode, $this->_ctype);
Expand All @@ -313,7 +308,7 @@ public function preProcess() {
($this->_action == CRM_Core_Action::ADD) ? CRM_Core_Permission::CREATE : CRM_Core_Permission::EDIT
);
$multiRecordFieldListing = FALSE;
//using selector for listing of multirecord fields
//using selector for listing of multi-record fields
if ($this->_mode == self::MODE_EDIT && $this->_gid) {
CRM_Core_BAO_UFGroup::shiftMultiRecordFields($this->_fields, $this->_multiRecordFields);

Expand Down Expand Up @@ -376,7 +371,7 @@ public function preProcess() {
)))
) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
//multirecord listing page
//multi-record listing page
$multiRecordFieldListing = TRUE;
$page = new CRM_Profile_Page_MultipleRecordFieldsListing();
$cs = $this->get('cs');
Expand Down Expand Up @@ -428,8 +423,6 @@ public function preProcess() {
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
*
* @return void
*/
public function setDefaultsValues() {
$this->_defaults = array();
Expand Down Expand Up @@ -595,7 +588,6 @@ public function setDefaultsValues() {
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm() {
$this->add('hidden', 'gid', $this->_gid);
Expand Down Expand Up @@ -707,7 +699,7 @@ public function buildQuickForm() {
$admin = TRUE;
if ($this->_mode == self::MODE_EDIT) {
$admin = FALSE;
// show all fields that are visibile:
// show all fields that are visible:
// if we are a admin OR the same user OR acl-user with access to the profile
// or we have checksum access to this contact (i.e. the user without a login) - CRM-5909
if (
Expand Down Expand Up @@ -914,7 +906,7 @@ public static function formRule($fields, $files, $form) {
$register = TRUE;
}

// dont check for duplicates during registration validation: CRM-375
// don't check for duplicates during registration validation: CRM-375
if (!$register && empty($fields['_qf_Edit_upload_duplicate'])) {
// fix for CRM-3240
if (!empty($fields['email-Primary'])) {
Expand Down Expand Up @@ -1076,8 +1068,6 @@ public static function formRule($fields, $files, $form) {
/**
* Process the user submitted custom data values.
*
*
* @return void
*/
public function postProcess() {
$params = $this->controller->exportValues($this->_name);
Expand Down Expand Up @@ -1365,9 +1355,6 @@ public function checkTemplateFileExists($suffix = NULL) {
*
* @return string
*/
/**
* @return string
*/
public function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
Expand All @@ -1379,9 +1366,6 @@ public function getTemplateFileName() {
*
* @return string
*/
/**
* @return string
*/
public function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
Expand Down
6 changes: 0 additions & 6 deletions CRM/Profile/Form/Dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/

Expand All @@ -48,7 +47,6 @@ class CRM_Profile_Form_Dynamic extends CRM_Profile_Form {
*
* @param
*
* @return void
*/
public function preProcess() {
if ($this->get('register')) {
Expand All @@ -71,7 +69,6 @@ public function preProcess() {
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm() {
$this->addButtons(array(
Expand Down Expand Up @@ -115,9 +112,6 @@ public static function formRule($fields, $files, $form) {

/**
* Process the user submitted custom data values.
*
*
* @return void
*/
public function postProcess() {
parent::postProcess();
Expand Down
5 changes: 0 additions & 5 deletions CRM/Profile/Form/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/

Expand All @@ -55,7 +54,6 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form {
*
* @param
*
* @return void
*/
public function preProcess() {
$this->_mode = CRM_Profile_Form::MODE_CREATE;
Expand Down Expand Up @@ -153,7 +151,6 @@ public function preProcess() {
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm() {
if (empty($this->_ufGroup['id'])) {
Expand Down Expand Up @@ -257,8 +254,6 @@ public function buildQuickForm() {
/**
* Process the user submitted custom data values.
*
*
* @return void
*/
public function postProcess() {
parent::postProcess();
Expand Down
9 changes: 0 additions & 9 deletions CRM/Profile/Page/Dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/

/**
Expand Down Expand Up @@ -177,7 +175,6 @@ public function &actionLinks() {
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
* @return void
*/
public function run() {
$template = CRM_Core_Smarty::singleton();
Expand Down Expand Up @@ -416,9 +413,6 @@ public function checkTemplateFileExists($suffix = '') {
*
* @return string
*/
/**
* @return string
*/
public function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
Expand All @@ -430,9 +424,6 @@ public function getTemplateFileName() {
*
* @return string
*/
/**
* @return string
*/
public function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
Expand Down
27 changes: 9 additions & 18 deletions CRM/Profile/Page/Listings.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,54 +29,53 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/

/**
* This implements the profile page for all contacts. It uses a selector
* object to do the actual dispay. The fields displayd are controlled by
* the admin
* the admin.
*/
class CRM_Profile_Page_Listings extends CRM_Core_Page {

/**
* All the fields that are listings related
* All the fields that are listings related.
*
* @var array
*/
protected $_fields;

/**
* The custom fields for this domain
* The custom fields for this domain.
*
* @var array
*/
protected $_customFields;

/**
* The input params from the request
* The input params from the request.
*
* @var array
*/
protected $_params;

/**
* The group id that we are editing
* The group id that we are editing.
*
* @var int
*/
protected $_gid;

/**
* State whether to display search form or not
* State whether to display search form or not.
*
* @var int
*/
protected $_search;

/**
* Should we display a map
* Should we display a map.
*
* @var int
*/
Expand All @@ -92,7 +91,6 @@ class CRM_Profile_Page_Listings extends CRM_Core_Page {
* Extracts the parameters from the request and constructs information for
* the selector object to do a query
*
* @return void
*/
public function preProcess() {

Expand Down Expand Up @@ -230,7 +228,7 @@ public function preProcess() {
if (in_array($customField['html_type'],
array('Multi-Select', 'CheckBox', 'Multi-Select State/Province', 'Multi-Select Country', 'Radio', 'Select')
)) {
// only reset on a POST submission if we dont see any value
// only reset on a POST submission if we don't see any value
$value = NULL;
$this->set($name, $value);
}
Expand Down Expand Up @@ -282,7 +280,6 @@ public function preProcess() {
/**
* Run this page (figure out the action needed and perform it).
*
* @return void
*/
public function run() {
$this->preProcess();
Expand Down Expand Up @@ -396,7 +393,7 @@ public function run() {
$controller->run();
}

//CRM-6862 -run form cotroller after
//CRM-6862 -run form controller after
//selector, since it erase $_POST
$formController->run();

Expand Down Expand Up @@ -492,9 +489,6 @@ public function checkTemplateFileExists($suffix = '') {
*
* @return string
*/
/**
* @return string
*/
public function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
Expand All @@ -506,9 +500,6 @@ public function getTemplateFileName() {
*
* @return string
*/
/**
* @return string
*/
public function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
Expand Down
5 changes: 1 addition & 4 deletions CRM/Profile/Page/MultipleRecordFieldsListing.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2016
* $Id$
*
*/
class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
Expand Down Expand Up @@ -137,7 +136,6 @@ public function &links() {
* of action and executes that action. Finally it calls the parent's run
* method.
*
* @return void
*/
public function run() {
// get the requested action, default to 'browse'
Expand Down Expand Up @@ -166,7 +164,6 @@ public function run() {
/**
* Browse the listing.
*
* @return void
*/
public function browse() {
$dateFields = NULL;
Expand Down Expand Up @@ -288,7 +285,7 @@ public function browse() {
$customGroupInfo = CRM_Core_BAO_CustomGroup::getGroupTitles($fieldInput);
$this->_customGroupTitle = $customGroupInfo[$fieldIdInput]['groupTitle'];
}
// $cgcount is defined before 'if' condition as enitiy may have no record
// $cgcount is defined before 'if' condition as entity may have no record
// and $cgcount is used to build new record url
$cgcount = 1;
if ($result && !empty($result)) {
Expand Down
Loading