/**
  * Build the form object.
  *
  * @param bool $check
  *
  * @return void
  */
 public function buildQuickForm($check = FALSE)
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_Job');
     $this->add('text', 'name', ts('Name'), $attributes['name'], TRUE);
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Job', $this->_id));
     $this->add('text', 'description', ts('Description'), $attributes['description']);
     $this->add('text', 'api_entity', ts('API Call Entity'), $attributes['api_entity'], TRUE);
     $this->add('text', 'api_action', ts('API Call Action'), $attributes['api_action'], TRUE);
     $this->add('select', 'run_frequency', ts('Run frequency'), CRM_Core_SelectValues::getJobFrequency());
     /************************************
      * begin com.klangsoft.flexiblejobs *
      ************************************/
     $this->addDateTime('schedule_at', ts(($this->_id ? 'Next' : 'First') . ' Run Date / Time'), FALSE, array('formatType' => 'activityDateTime'));
     $this->assign('schedule_at', $this->_id ? 'run next' : 'first be run');
     /**********************************
      * end com.klangsoft.flexiblejobs *
      **********************************/
     $this->add('textarea', 'parameters', ts('Command parameters'), "cols=50 rows=6");
     // is this job active ?
     $this->add('checkbox', 'is_active', ts('Is this Scheduled Job active?'));
     $this->addFormRule(array('CRM_Admin_Form_Job', 'formRule'));
 }
Beispiel #2
0
 /**
  * Function to build the form
  *
  * @param bool $check
  *
  * @return void
  * @access public
  */
 public function buildQuickForm($check = FALSE)
 {
     parent::buildQuickForm();
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_Job');
     $this->add('text', 'name', ts('Name'), $attributes['name'], TRUE);
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Core_DAO_Job', $this->_id));
     $this->add('text', 'description', ts('Description'), $attributes['description']);
     $this->add('text', 'api_entity', ts('API Call Entity'), $attributes['api_entity'], TRUE);
     $this->add('text', 'api_action', ts('API Call Action'), $attributes['api_action'], TRUE);
     $this->add('select', 'run_frequency', ts('Run frequency'), CRM_Core_SelectValues::getJobFrequency());
     $this->add('textarea', 'parameters', ts('Command parameters'), "cols=50 rows=6");
     // is this job active ?
     $this->add('checkbox', 'is_active', ts('Is this Scheduled Job active?'));
     $this->addFormRule(array('CRM_Admin_Form_Job', 'formRule'));
 }