コード例 #1
0
 /**
  * Gets full calendar item data.
  * @return string
  */
 public function getCalendarItemData()
 {
     $name = $this->name;
     $quantity = $this->quantity;
     $priceFrequency = ProductTemplatePriceFrequencyDropDownElement::renderNonEditableStringContent($this->priceFrequency);
     $currencyValueModel = $this->sellPrice;
     $sellPrice = Yii::app()->numberFormatter->formatCurrency((double) $currencyValueModel->value, $currencyValueModel->currency->code);
     $language = Yii::app()->languageHelper->getForCurrentUser();
     $translatedAttributeLabels = self::translatedAttributeLabels($language);
     return array(Zurmo::t('Core', 'Name', array(), null, $language) => $name, Zurmo::t('Core', 'Quantity', array(), null, $language) => $quantity, $translatedAttributeLabels['priceFrequency'] => $priceFrequency, $translatedAttributeLabels['sellPrice'] => $sellPrice);
 }
コード例 #2
0
 public function testGetProductTemplatePriceFrequencyDisplayedGridValue()
 {
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     $productTemplate = ProductTemplateTestHelper::createProductTemplateByName('My Product Template 2');
     $id = $productTemplate->id;
     $productTemplate->forget();
     unset($productTemplate);
     $productTemplate = ProductTemplate::getById($id);
     $priceFrequency = ProductTemplatePriceFrequencyDropDownElement::renderNonEditableStringContent($productTemplate->priceFrequency);
     $this->assertEquals($priceFrequency, "Monthly");
 }
コード例 #3
0
 public static function getProductTemplatePriceFrequencyDisplayedGridValue($data)
 {
     return ProductTemplatePriceFrequencyDropDownElement::renderNonEditableStringContent($data->priceFrequency);
 }