コード例 #1
0
 /**
  * Set default values for the form.
  */
 public function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     if ($this->_id) {
         $params = array('id' => $this->_id);
         CRM_Contribute_BAO_ManagePremiums::retrieve($params, $tempDefaults);
         $imageUrl = isset($tempDefaults['image']) ? $tempDefaults['image'] : "";
         if (isset($tempDefaults['image']) && isset($tempDefaults['thumbnail'])) {
             $defaults['imageUrl'] = $tempDefaults['image'];
             $defaults['thumbnailUrl'] = $tempDefaults['thumbnail'];
             $defaults['imageOption'] = 'thumbnail';
             // assign thumbnailUrl to template so we can display current image in update mode
             $this->assign('thumbnailUrl', $defaults['thumbnailUrl']);
         } else {
             $defaults['imageOption'] = 'noImage';
         }
         if (isset($tempDefaults['thumbnail']) && isset($tempDefaults['image'])) {
             $this->assign('thumbURL', $tempDefaults['thumbnail']);
             $this->assign('imageURL', $tempDefaults['image']);
         }
         if (isset($tempDefaults['period_type'])) {
             $this->assign('showSubscriptions', TRUE);
         }
     }
     return $defaults;
 }
コード例 #2
0
 /**
  * This function sets the default values for the form. Manage Premiums that in edit/view mode
  * the default values are retrieved from the database
  * 
  * @access public
  * @return None
  */
 function setDefaultValues()
 {
     require_once 'CRM/Utils/Rule.php';
     $defaults = parent::setDefaultValues();
     if ($this->_id) {
         $params = array('id' => $this->_id);
         CRM_Contribute_BAO_ManagePremiums::retrieve($params, $tempDefaults);
         $imageUrl = $tempDefaults['image'];
         if ($tempDefaults['image'] && $tempDefaults['thumbnail']) {
             $defaults['imageUrl'] = $tempDefaults['image'];
             $defaults['thumbnailUrl'] = $tempDefaults['thumbnail'];
             $defaults['imageOption'] = 'thumbnail';
             // assign thumbnailUrl to template so we can display current image in update mode
             $this->assign('thumbnailUrl', $defaults['thumbnailUrl']);
         } else {
             $defaults['imageOption'] = 'noImage';
         }
         if ($tempDefaults['thumbnail'] && $tempDefaults['image']) {
             $this->assign('thumbURL', $tempDefaults['thumbnail']);
             $this->assign('imageURL', $tempDefaults['image']);
         }
         if ($tempDefaults['period_type']) {
             $this->assign("showSubscriptions", true);
         }
     }
     return $defaults;
 }
コード例 #3
0
 /**
  * Set default values for the form.
  * the default values are retrieved from the database
  *
  *
  * @return void
  */
 public function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     if ($this->_action & CRM_Core_Action::ADD) {
         $defaults['contact_id'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'contact_id');
     }
     return $defaults;
 }
コード例 #4
0
 /**
  * Set default values for the form. Note that in edit/view mode
  * the default values are retrieved from the database
  *
  *
  * @return void
  */
 public function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     if ($this->_id) {
         $this->assign('modified_date', $defaults['modified_date']);
         $this->assign('created_date', $defaults['created_date']);
     } else {
         // set batch name default
         $defaults['title'] = CRM_Batch_BAO_Batch::generateBatchName();
     }
     return $defaults;
 }
コード例 #5
0
 /**
  * Set default values for the form.
  * the default values are retrieved from the database.
  */
 public function setDefaultValues()
 {
     $defaults = parent::setDefaultValues();
     if ($this->_action & CRM_Core_Action::ADD) {
         $defaults['contact_id'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), 'contact_id');
         $defaults['opening_balance'] = $defaults['current_period_opening_balance'] = '0.00';
     }
     return $defaults;
 }