public static function getSkipCountMessageContentByModelClassName($skipCount, $modelClassName)
 {
     if ($skipCount > 0) {
         return $skipCount . ' ' . LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName($skipCount, $modelClassName) . ' ' . Zurmo::t('ZurmoModule', 'skipped because you do not have sufficient permissions.');
     }
     throw new NotSupportedException();
 }
Esempio n. 2
0
 public function testGetUncapitalizedModelLabelByCountAndModelClassName()
 {
     $content = LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName(1, 'A');
     $this->assertEquals($content, 'a');
     $content = LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName(4, 'A');
     $this->assertEquals($content, 'as');
     $content = LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName(0, 'A');
     $this->assertEquals($content, 'as');
 }
 /**
  * @return string
  */
 protected function renderControlEditable()
 {
     assert('$this->model instanceof ProductTemplate || $this->model instanceof Product');
     $cClipWidget = new CClipWidget();
     $cClipWidget->beginClip("ModelElement");
     $cClipWidget->widget('application.core.widgets.MultiSelectAutoComplete', array('name' => $this->getNameForIdField(), 'id' => $this->getIdForIdField(), 'jsonEncodedIdsAndLabels' => CJSON::encode($this->getExistingProductCategoriesRelationsIdsAndLabels()), 'sourceUrl' => Yii::app()->createUrl('productTemplates/default/autoCompleteAllProductCategoriesForMultiSelectAutoComplete'), 'htmlOptions' => array('disabled' => $this->getDisabledValue()), 'hintText' => Zurmo::t('ProductTemplatesModule', 'Type a ' . LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName(1, 'ProductCategory'), LabelUtil::getTranslationParamsForAllModules())));
     $cClipWidget->endClip();
     $content = $cClipWidget->getController()->clips['ModelElement'];
     return $content;
 }
 protected function getWidgetHintText()
 {
     return Zurmo::t('ProductTemplatesModule', 'Type a ' . LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName(1, 'ProductCategory'), LabelUtil::getTranslationParamsForAllModules());
 }
 protected function getCompleteMessage()
 {
     $content = $this->totalRecordCount . ' ' . LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName($this->totalRecordCount, 'User') . ' ' . $this->getCompleteMessageSuffix() . '.';
     return $content;
 }