<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright (C) 2011 Marty Wright |
| Licensed to CiviCRM under the Academic Free License version 3.0. |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
*/
protected $_group = NULL;
- function preProcess() {
+ public function preProcess() {
$this->_id = $this->get('id');
$this->_group = CRM_Utils_Request::retrieve('group', 'String', $this, FALSE, 'label_format');
$this->_values = array();
* Build the form object
*
* @return void
- * @access public
*/
public function buildQuickForm() {
parent::buildQuickForm();
// currently we support only mailing label creation, hence comment below code
/*
$options = array(
- 'label_format' => ts('Mailing Label'),
- 'name_badge' => ts('Name Badge'),
+ 'label_format' => ts('Mailing Label'),
+ 'name_badge' => ts('Name Badge'),
);
$labelType = $this->addRadio('label_type', ts('Used For'), $options, null, ' ');
if ($this->_action != CRM_Core_Action::ADD) {
- $labelType->freeze();
+ $labelType->freeze();
}
- */
+ */
$this->add('select', 'paper_size', ts('Sheet Size'),
array(
- 0 => ts('- default -')
+ 0 => ts('- default -'),
) + CRM_Core_BAO_PaperSize::getList(TRUE), FALSE,
array(
- 'onChange' => "selectPaper( this.value );"
+ 'onChange' => "selectPaper( this.value );",
) + $disabled
);
$this->add('static', 'paper_dimensions', NULL, ts('Sheet Size (w x h)'));
$this->add('select', 'orientation', ts('Orientation'), CRM_Core_BAO_LabelFormat::getPageOrientations(), FALSE,
array(
- 'onChange' => "updatePaperDimensions();"
+ 'onChange' => "updatePaperDimensions();",
) + $disabled
);
$this->add('select', 'font_name', ts('Font Name'), CRM_Core_BAO_LabelFormat::getFontNames($this->_group));
$this->add('text', 'SpaceY', ts('Vertical Spacing'), array('size' => 8, 'maxlength' => 8) + $disabled, $required);
$this->add('text', 'lPadding', ts('Left Padding'), array('size' => 8, 'maxlength' => 8), $required);
$this->add('text', 'tPadding', ts('Top Padding'), array('size' => 8, 'maxlength' => 8), $required);
- $this->add('text', 'weight', ts('Weight'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_LabelFormat', 'weight'), TRUE);
+ $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_BAO_LabelFormat', 'weight'), TRUE);
$this->addRule('label', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Core_BAO_LabelFormat',
- $this->_id
+ $this->_id,
));
$this->addRule('NX', ts('Must be an integer'), 'integer');
$this->addRule('NY', ts('Must be an integer'), 'integer');
$this->addRule('tPadding', ts('Must be numeric'), 'numeric');
$this->addRule('width', ts('Must be numeric'), 'numeric');
$this->addRule('height', ts('Must be numeric'), 'numeric');
- $this->addRule('weight', ts('Weight must be integer'), 'integer');
+ $this->addRule('weight', ts('Must be integer'), 'integer');
}
/**
* @return int
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
if ($this->_action & CRM_Core_Action::ADD) {
$defaults['weight'] = CRM_Utils_Array::value('weight', CRM_Core_BAO_LabelFormat::getDefaultValues($this->_group), 0);
}
/**
* Process the form submission
*
- * @access public
*
* @return void
*/
}
CRM_Core_Session::setStatus($status, ts('Saved'), 'success');
}
+
}