Esempio n. 1
0
 /**
  * returns all the column names of this table
  *
  * @access public
  * @return array
  */
 function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'required' => true), 'product_name' => array('name' => 'name', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Product Name'), 'required' => true, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'export' => true, 'where' => 'civicrm_product.name', 'headerPattern' => '', 'dataPattern' => ''), 'description' => array('name' => 'description', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Description')), 'sku' => array('name' => 'sku', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('SKU'), 'maxlength' => 50, 'size' => CRM_Utils_Type::BIG, 'export' => true, 'where' => 'civicrm_product.sku', 'headerPattern' => '', 'dataPattern' => ''), 'options' => array('name' => 'options', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Options')), 'image' => array('name' => 'image', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Image'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE), 'thumbnail' => array('name' => 'thumbnail', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Thumbnail'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE), 'price' => array('name' => 'price', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Price')), 'currency' => array('name' => 'currency', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Currency'), 'maxlength' => 3, 'size' => CRM_Utils_Type::FOUR, 'default' => 'UL'), 'min_contribution' => array('name' => 'min_contribution', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Minimum Contribution')), 'cost' => array('name' => 'cost', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Cost')), 'is_active' => array('name' => 'is_active', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Active'), 'required' => true), 'period_type' => array('name' => 'period_type', 'type' => CRM_Utils_Type::T_ENUM, 'title' => ts('Period Type'), 'default' => 'rolling', 'enumValues' => 'rolling,fixed'), 'fixed_period_start_day' => array('name' => 'fixed_period_start_day', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Fixed Period Start Day'), 'default' => '10'), 'duration_unit' => array('name' => 'duration_unit', 'type' => CRM_Utils_Type::T_ENUM, 'title' => ts('Duration Unit'), 'default' => 'year', 'enumValues' => 'day,month,week,year'), 'duration_interval' => array('name' => 'duration_interval', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Duration Interval')), 'frequency_unit' => array('name' => 'frequency_unit', 'type' => CRM_Utils_Type::T_ENUM, 'title' => ts('Frequency Unit'), 'default' => 'month', 'enumValues' => 'day,month,week,year'), 'frequency_interval' => array('name' => 'frequency_interval', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Frequency Interval')));
     }
     return self::$_fields;
 }
Esempio n. 2
0
 /**
  * Returns all the column names of this table
  *
  * @return array
  */
 static function &fields()
 {
     if (!self::$_fields) {
         self::$_fields = array('id' => array('name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Product ID'), 'required' => true), 'product_name' => array('name' => 'name', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Product Name'), 'description' => 'Required product/premium name', 'required' => true, 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'export' => true, 'where' => 'civicrm_product.name', 'headerPattern' => '', 'dataPattern' => ''), 'description' => array('name' => 'description', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Description'), 'description' => 'Optional description of the product/premium.'), 'sku' => array('name' => 'sku', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('SKU'), 'description' => 'Optional product sku or code.', 'maxlength' => 50, 'size' => CRM_Utils_Type::BIG, 'export' => true, 'where' => 'civicrm_product.sku', 'headerPattern' => '', 'dataPattern' => ''), 'options' => array('name' => 'options', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Options'), 'description' => 'Store comma-delimited list of color, size, etc. options for the product.'), 'image' => array('name' => 'image', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Image'), 'description' => 'Full or relative URL to uploaded image - fullsize.', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE), 'thumbnail' => array('name' => 'thumbnail', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Thumbnail'), 'description' => 'Full or relative URL to image thumbnail.', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE), 'price' => array('name' => 'price', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Price'), 'description' => 'Sell price or market value for premiums. For tax-deductible contributions, this will be stored as non_deductible_amount in the contribution record.', 'precision' => array(20, 2)), 'currency' => array('name' => 'currency', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Currency'), 'description' => '3 character string, value from config setting or input via user.', 'maxlength' => 3, 'size' => CRM_Utils_Type::FOUR, 'default' => 'NULL', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('table' => 'civicrm_currency', 'keyColumn' => 'name', 'labelColumn' => 'full_name', 'nameColumn' => 'numeric_code')), 'financial_type_id' => array('name' => 'financial_type_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Financial Type'), 'description' => 'FK to Financial Type.', 'default' => 'NULL', 'FKClassName' => 'CRM_Financial_DAO_FinancialType', 'pseudoconstant' => array('table' => 'civicrm_financial_type', 'keyColumn' => 'id', 'labelColumn' => 'name')), 'min_contribution' => array('name' => 'min_contribution', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Minimum Contribution'), 'description' => 'Minimum contribution required to be eligible to select this premium.', 'precision' => array(20, 2)), 'cost' => array('name' => 'cost', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Cost'), 'description' => 'Actual cost of this product. Useful to determine net return from sale or using this as an incentive.', 'precision' => array(20, 2)), 'is_active' => array('name' => 'is_active', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Active'), 'description' => 'Disabling premium removes it from the premiums_premium join table below.', 'required' => true), 'period_type' => array('name' => 'period_type', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Period Type'), 'description' => 'Rolling means we set start/end based on current day, fixed means we set start/end for current year or month
   (e.g. 1 year + fixed -> we would set start/end for 1/1/06 thru 12/31/06 for any premium chosen in 2006) ', 'maxlength' => 8, 'size' => CRM_Utils_Type::EIGHT, 'default' => 'rolling', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('callback' => 'CRM_Core_SelectValues::periodType')), 'fixed_period_start_day' => array('name' => 'fixed_period_start_day', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Fixed Period Start Day'), 'description' => 'Month and day (MMDD) that fixed period type subscription or membership starts.', 'default' => '0101'), 'duration_unit' => array('name' => 'duration_unit', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Duration Unit'), 'maxlength' => 8, 'size' => CRM_Utils_Type::EIGHT, 'default' => 'year', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('callback' => 'CRM_Core_SelectValues::getPremiumUnits')), 'duration_interval' => array('name' => 'duration_interval', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Duration Interval'), 'description' => 'Number of units for total duration of subscription, service, membership (e.g. 12 Months).'), 'frequency_unit' => array('name' => 'frequency_unit', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Frequency Unit'), 'description' => 'Frequency unit and interval allow option to store actual delivery frequency for a subscription or service.', 'maxlength' => 8, 'size' => CRM_Utils_Type::EIGHT, 'default' => 'month', 'html' => array('type' => 'Select'), 'pseudoconstant' => array('callback' => 'CRM_Core_SelectValues::getPremiumUnits')), 'frequency_interval' => array('name' => 'frequency_interval', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Frequency Interval'), 'description' => 'Number of units for delivery frequency of subscription, service, membership (e.g. every 3 Months).'));
     }
     return self::$_fields;
 }