+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
/**
- * The action links that we need to display for the browse screen
+ * The action links that we need to display for the browse screen.
*
* @var array
- * @static
*/
static $_links = NULL;
protected $_contactType = NULL;
/**
- * Get BAO Name
+ * Get BAO Name.
*
- * @return string Classname of BAO.
+ * @return string
+ * Classname of BAO.
*/
public function getBAOName() {
return '';
}
/**
- * Get action Links
+ * Get action Links.
*
- * @return array (reference) of action links
+ * @return array
+ * (reference) of action links
*/
public function &links() {
if (!(self::$_links[$this->_pageViewType])) {
// names and titles
$links[CRM_Core_Action::VIEW] = array(
'name' => ts('View'),
- 'title' => ts('View %1', array( 1 => $this->_customGroupTitle . ' record')),
+ 'title' => ts('View %1', array(1 => $this->_customGroupTitle . ' record')),
);
$links[CRM_Core_Action::UPDATE] = array(
'name' => ts('Edit'),
- 'title' => ts('Edit %1', array( 1 => $this->_customGroupTitle . ' record')),
+ 'title' => ts('Edit %1', array(1 => $this->_customGroupTitle . ' record')),
);
$links[CRM_Core_Action::DELETE] = array(
'name' => ts('Delete'),
- 'title' => ts('Delete %1', array( 1 => $this->_customGroupTitle . ' record')),
+ 'title' => ts('Delete %1', array(1 => $this->_customGroupTitle . ' record')),
);
// urls and queryStrings
// copy action
$links[CRM_Core_Action::COPY] = array(
'name' => ts('Copy'),
- 'title' => ts('Copy %1', array( 1 => $this->_customGroupTitle . ' record')),
+ 'title' => ts('Copy %1', array(1 => $this->_customGroupTitle . ' record')),
'url' => 'civicrm/contact/view/cd/edit',
- 'qs' => 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%newCgCount%%&multiRecordDisplay=single©ValueId=%%cgcount%%&mode=copy'
+ 'qs' => 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%newCgCount%%&multiRecordDisplay=single©ValueId=%%cgcount%%&mode=copy',
);
}
}
/**
- * Run the page
+ * Run the page.
*
* This method is called after the page is created. It checks for the type
* 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'
}
/**
- * Browse the listing
+ * Browse the listing.
*
* @return void
*/
NULL,
CRM_Core_Permission::EDIT
);
- $multiRecordFields = array( );
+ $multiRecordFields = array();
$fieldIDs = NULL;
$result = NULL;
$multiRecordFieldsWithSummaryListing = CRM_Core_BAO_UFGroup::shiftMultiRecordFields($fields, $multiRecordFields, TRUE);
$this->_customGroupTitle = $groupDetail[$customGroupId]['title'];
}
if ($fieldIDs && !empty($fieldIDs) && $this->_contactId) {
- $options = array( );
- $returnProperities = array('html_type', 'data_type', 'date_format', 'time_format', 'default_value', 'is_required');
+ $options = array();
+ $returnProperities = array(
+ 'html_type',
+ 'data_type',
+ 'date_format',
+ 'time_format',
+ 'default_value',
+ 'is_required',
+ );
foreach ($fieldIDs as $key => $fieldID) {
$fieldIDs[$key] = !is_numeric($fieldID) ? CRM_Core_BAO_CustomField::getKeyID($fieldID) : $fieldID;
$param = array('id' => $fieldIDs[$key]);
- $returnValues = array( );
+ $returnValues = array();
CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_CustomField', $param, $returnValues, $returnProperities);
if ($returnValues['data_type'] == 'Date') {
$dateFields[$fieldIDs[$key]] = 1;
$options[$fieldIDs[$key]]['attributes']['is_required'] = !empty($returnValues['is_required']);
$options[$fieldIDs[$key]]['attributes']['default_value'] = CRM_Utils_Array::value('default_value', $returnValues);
- $options[$fieldIDs[$key]]['attributes']['format'] =
- $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
+ $options[$fieldIDs[$key]]['attributes']['format']
+ = $options[$fieldIDs[$key]]['attributes']['date_format'] = CRM_Utils_Array::value('date_format', $returnValues);
$options[$fieldIDs[$key]]['attributes']['time_format'] = CRM_Utils_Array::value('time_format', $returnValues);
}
$singleField = CRM_Core_BAO_CustomField::getKeyID($nonListingFieldIds[0]);
$fieldIdInput = $singleField;
$singleField = array($singleField);
- $fieldInput = $singleField;
+ $fieldInput = $singleField;
}
$customGroupInfo = CRM_Core_BAO_CustomGroup::getGroupTitles($fieldInput);
$this->_customGroupTitle = $customGroupInfo[$fieldIdInput]['groupTitle'];
$supportedDataTypes = array('Float', 'String', 'Int');
$editable = in_array($spec['data_type'], $supportedDataTypes);
break;
+
case 'TextArea':
$editable = TRUE;
$fieldAttributes['data-type'] = 'textarea';
break;
+
case 'Radio':
case 'Select':
case 'Select Country':
$op = NULL;
if ($this->_pageViewType == 'profileDataView') {
- $actionParams = array('recordId' => $recId, 'gid' => $this->_profileId,
- 'id' => $this->_contactId);
+ $actionParams = array(
+ 'recordId' => $recId,
+ 'gid' => $this->_profileId,
+ 'id' => $this->_contactId,
+ );
$op = 'profile.multiValue.row';
}
else {
'key' => CRM_Core_Key::get('civicrm/ajax/customvalue'),
);
$links[CRM_Core_Action::DELETE]['url'] = '#';
- $links[CRM_Core_Action::DELETE]['extra'] = ' data-delete_params="'. htmlspecialchars(json_encode($deleteData)) .'"';
+ $links[CRM_Core_Action::DELETE]['extra'] = ' data-delete_params="' . htmlspecialchars(json_encode($deleteData)) . '"';
$links[CRM_Core_Action::DELETE]['class'] = 'delete-custom-row';
}
if (!empty($pageCheckSum)) {
}
}
- $headers = array( );
+ $headers = array();
if (!empty($fieldIDs)) {
foreach ($fieldIDs as $fieldID) {
$headers[$fieldID] = ($this->_pageViewType == 'profileDataView') ? $customGroupInfo[$fieldID]['fieldLabel'] : $fieldLabels[$fieldID]['label'];
}
}
$this->assign('dateFields', $dateFields);
- $this->assign('dateFieldsVals',$dateFieldsVals);
+ $this->assign('dateFieldsVals', $dateFieldsVals);
$this->assign('cgcount', $cgcount);
$this->assign('customGroupTitle', $this->_customGroupTitle);
$this->assign('headers', $headers);
}
/**
- * Get name of edit form
+ * Get name of edit form.
*
- * @return string classname of edit form
+ * @return string
+ * classname of edit form
*/
public function editForm() {
return '';
}
/**
- * Get edit form name
+ * Get edit form name.
*
- * @return string name of this page
+ * @return string
+ * name of this page
*/
public function editName() {
return '';
}
/**
- * Get user context
+ * Get user context.
*
* @param null $mode
*
- * @return string user context
+ * @return string
+ * user context
*/
public function userContext($mode = NULL) {
return '';
}
+
}