Exemple #1
0
 /**
  * This adds the tab referred to as Title and Format, rendered through Instance.tpl.
  *
  * @todo call this tab into the report template in the same way as OrderBy etc, ie
  * by adding a description of the tab to $this->tabs, causing the tab to be added in
  * Criteria.tpl.
  */
 public function buildInstanceAndButtons()
 {
     CRM_Report_Form_Instance::buildForm($this);
     $label = $this->_id ? ts('Update Report') : ts('Create Report');
     $this->addElement('submit', $this->_instanceButtonName, $label);
     $this->addElement('submit', $this->_printButtonName, ts('Print Report'));
     $this->addElement('submit', $this->_pdfButtonName, ts('PDF'));
     if ($this->_id) {
         $this->addElement('submit', $this->_createNewButtonName, ts('Save a Copy') . '...');
     }
     $this->assign('instanceForm', $this->_instanceForm);
     $label = $this->_id ? ts('Print Report') : ts('Print Preview');
     $this->addElement('submit', $this->_printButtonName, $label);
     $label = $this->_id ? ts('PDF') : ts('Preview PDF');
     $this->addElement('submit', $this->_pdfButtonName, $label);
     $label = $this->_id ? ts('Export to CSV') : ts('Preview CSV');
     if ($this->_csvSupported) {
         $this->addElement('submit', $this->_csvButtonName, $label);
     }
     // CRM-16274 Determine if user has 'edit all contacts' or equivalent
     $permission = CRM_Core_Permission::getPermission();
     if ($permission == CRM_Core_Permission::EDIT && $this->_add2groupSupported) {
         $this->addElement('select', 'groups', ts('Group'), array('' => ts('Add Contacts to Group')) + CRM_Core_PseudoConstant::nestedGroup(), array('class' => 'crm-select2 crm-action-menu fa-plus huge'));
         $this->assign('group', TRUE);
     }
     $this->addElement('submit', $this->_groupButtonName, '', array('style' => 'display: none;'));
     $this->addChartOptions();
     $this->addButtons(array(array('type' => 'submit', 'name' => ts('Preview Report'), 'isDefault' => TRUE)));
 }
  /**
   * Function is over-ridden to support multiple add to groups
   */
  function buildInstanceAndButtons() {
    CRM_Report_Form_Instance::buildForm($this);

    $label = $this->_id ? ts('Update Report') : ts('Create Report');

    $this->addElement('submit', $this->_instanceButtonName, $label);
    $this->addElement('submit', $this->_printButtonName, ts('Print Report'));
    $this->addElement('submit', $this->_pdfButtonName, ts('PDF'));

    if ($this->_id) {
      $this->addElement('submit', $this->_createNewButtonName, ts('Save a Copy') . '...');
    }
    if ($this->_instanceForm) {
      $this->assign('instanceForm', TRUE);
    }

    $label = $this->_id ? ts('Print Report') : ts('Print Preview');
    $this->addElement('submit', $this->_printButtonName, $label);

    $label = $this->_id ? ts('PDF') : ts('Preview PDF');
    $this->addElement('submit', $this->_pdfButtonName, $label);

    $label = $this->_id ? ts('Export to CSV') : ts('Preview CSV');

    if ($this->_csvSupported) {
      $this->addElement('submit', $this->_csvButtonName, $label);
    }

    if (CRM_Core_Permission::check('administer Reports') && $this->_add2groupSupported) {
      $this->addElement('select', 'groups', ts('Group'),
        array('' => ts('- select group -')) + CRM_Core_PseudoConstant::staticGroup()
      );
      if (!empty($this->_add2GroupcontactTables) && is_array($this->_add2GroupcontactTables) && count($this->_add2GroupcontactTables > 1)) {
        $this->addElement('select', 'btn_group_contact', ts('Contact to Add'),
          array('' => ts('- choose contact -')) + $this->_add2GroupcontactTables
        );
      }
      $this->assign('group', TRUE);
    }

    $label = ts('Add these Contacts to Group');
    $this->addElement('submit', $this->_groupButtonName, $label, array('onclick' => 'return checkGroup();'));

    $this->addChartOptions();
    $this->addButtons(array(
        array(
          'type' => 'submit',
          'name' => ts('Preview Report'),
          'isDefault' => TRUE,
        ),
      )
    );
  }
Exemple #3
0
 /**
  * This adds the tab referred to as Title and Format, rendered through Instance.tpl.
  *
  * @todo call this tab into the report template in the same way as OrderBy etc, ie
  * by adding a description of the tab to $this->tabs, causing the tab to be added in
  * Criteria.tpl.
  */
 public function buildInstanceAndButtons()
 {
     CRM_Report_Form_Instance::buildForm($this);
     $this->_actionButtonName = $this->getButtonName('submit');
     $this->addTaskMenu($this->getActions($this->_id));
     $this->assign('instanceForm', $this->_instanceForm);
     // CRM-16274 Determine if user has 'edit all contacts' or equivalent
     $permission = CRM_Core_Permission::getPermission();
     if ($permission == CRM_Core_Permission::EDIT && $this->_add2groupSupported) {
         $this->addElement('select', 'groups', ts('Group'), array('' => ts('Add Contacts to Group')) + CRM_Core_PseudoConstant::nestedGroup(), array('class' => 'crm-select2 crm-action-menu fa-plus huge'));
         $this->assign('group', TRUE);
     }
     $this->addElement('submit', $this->_groupButtonName, '', array('style' => 'display: none;'));
     $this->addChartOptions();
     $showResultsLabel = $this->getResultsLabel();
     $this->addButtons(array(array('type' => 'submit', 'name' => $showResultsLabel, 'isDefault' => TRUE)));
 }
Exemple #4
0
 function buildInstanceAndButtons()
 {
     require_once 'CRM/Report/Form/Instance.php';
     CRM_Report_Form_Instance::buildForm($this);
     $label = $this->_id ? ts('Update Report') : ts('Create Report');
     $this->addElement('submit', $this->_instanceButtonName, $label);
     $this->addElement('submit', $this->_printButtonName, ts('Print Report'));
     $this->addElement('submit', $this->_pdfButtonName, ts('PDF'));
     if ($this->_instanceForm) {
         $this->assign('instanceForm', true);
     }
     $label = $this->_id ? ts('Print Report') : ts('Print Preview');
     $this->addElement('submit', $this->_printButtonName, $label);
     $label = $this->_id ? ts('PDF') : ts('Preview PDF');
     $this->addElement('submit', $this->_pdfButtonName, $label);
     $label = $this->_id ? ts('Export to CSV') : ts('Preview CSV');
     if ($this->_csvSupported) {
         $this->addElement('submit', $this->_csvButtonName, $label);
     }
     if (CRM_Core_Permission::check('administer Reports') && $this->_add2groupSupported) {
         $this->addElement('select', 'groups', ts('Group'), array('' => ts('- select group -')) + CRM_Core_PseudoConstant::staticGroup());
         $this->assign('group', true);
     }
     //$this->addElement('select', 'select_add_to_group_id', ts('Group'), $groupList);
     $label = ts('Add these Contacts to Group');
     $this->addElement('submit', $this->_groupButtonName, $label, array('onclick' => 'return checkGroup();'));
     $this->addChartOptions();
     $this->addButtons(array(array('type' => 'submit', 'name' => ts('Preview Report'), 'isDefault' => true)));
 }