X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FProfile%2FForm.php;h=c0dee2b655c79c8c05d7d89e94dbaf0f35a40b95;hb=ef10e0b52408ba266239a859756d757a10348228;hp=c8b0633ce1ac76bde34e1a66cc477e662ed6d909;hpb=6a118abdc9e6b8d476cf2e429c814bb6b30124d4;p=civicrm-core.git diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index c8b0633ce1..c0dee2b655 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -1,7 +1,7 @@ _id = $this->get('id'); $this->_profileIds = $this->get('profileIds'); $this->_grid = CRM_Utils_Request::retrieve('grid', 'Integer', $this); @@ -357,7 +356,7 @@ class CRM_Profile_Form extends CRM_Core_Form { } elseif (!empty($this->_multiRecordFields) && (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)) )) { - CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); + CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header'); //multirecord listing page $multiRecordFieldListing = TRUE; $page = new CRM_Profile_Page_MultipleRecordFieldsListing(); @@ -406,14 +405,13 @@ class CRM_Profile_Form extends CRM_Core_Form { } /** - * This function sets the default values for the form. Note that in edit/view mode + * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @access public * * @return void */ - function setDefaultsValues() { + public function setDefaultsValues() { $this->_defaults = array(); if ($this->_multiRecordProfile && ($this->_multiRecord == CRM_Core_Action::DELETE)) { return; @@ -579,10 +577,9 @@ class CRM_Profile_Form extends CRM_Core_Form { } /** - * Function to actually build the form + * Build the form object * * @return void - * @access public */ public function buildQuickForm() { $this->add('hidden', 'gid', $this->_gid); @@ -826,22 +823,16 @@ class CRM_Profile_Form extends CRM_Core_Form { } } - /* - * Function to validate profile and provided activity Id - * - * @params Integer $activityId Activity Id - * @params Integer $gid Profile Id - * - * @return Array $errors Errors ( if any ). - */ /** - * @param $activityId - * @param $contactId - * @param $gid + * Validate profile and provided activity Id + * + * @param int $activityId + * @param int $contactId + * @param int $gid * * @return array */ - static function validateContactActivityProfile($activityId, $contactId, $gid) { + public static function validateContactActivityProfile($activityId, $contactId, $gid) { $errors = array(); if (!$activityId) { $errors[] = 'Profile is using one or more activity fields, and is missing the activity Id (aid) in the URL.'; @@ -873,17 +864,16 @@ class CRM_Profile_Form extends CRM_Core_Form { } /** - * global form rule + * Global form rule * * @param array $fields the input form values * @param array $files the uploaded files if any - * @param object $form the form object + * @param CRM_Core_Form $form the form object * * @return true if no errors, else array of errors - * @access public * @static */ - static function formRule($fields, $files, $form) { + public static function formRule($fields, $files, $form) { CRM_Utils_Hook::validateProfile($form->_ufGroup['name']); $errors = array(); @@ -1055,7 +1045,6 @@ class CRM_Profile_Form extends CRM_Core_Form { /** * Process the user submitted custom data values. * - * @access public * * @return void */ @@ -1319,7 +1308,7 @@ class CRM_Profile_Form extends CRM_Core_Form { * * @return null|string */ - function checkTemplateFileExists($suffix = NULL) { + public function checkTemplateFileExists($suffix = NULL) { if ($this->_gid) { $templateFile = "CRM/Profile/Form/{$this->_gid}/{$this->_name}.{$suffix}tpl"; $template = CRM_Core_Form::getTemplate(); @@ -1343,12 +1332,11 @@ class CRM_Profile_Form extends CRM_Core_Form { * Use the form name to create the tpl file name * * @return string - * @access public */ /** * @return string */ - function getTemplateFileName() { + public function getTemplateFileName() { $fileName = $this->checkTemplateFileExists(); return $fileName ? $fileName : parent::getTemplateFileName(); } @@ -1358,14 +1346,12 @@ class CRM_Profile_Form extends CRM_Core_Form { * i.e. we dont override * * @return string - * @access public */ /** * @return string */ - function overrideExtraTemplateFileName() { + public function overrideExtraTemplateFileName() { $fileName = $this->checkTemplateFileExists('extra.'); return $fileName ? $fileName : parent::overrideExtraTemplateFileName(); } } -