public function testAddIdentifier() { $this->assertFalse($this->listMapper->has('fooName')); $fieldDescription = $this->getFieldDescriptionMock('fooName', 'fooLabel'); $this->listMapper->addIdentifier($fieldDescription); $this->assertTrue($this->listMapper->has('fooName')); }
/** * @param \Sonata\AdminBundle\Datagrid\ListMapper $list */ public function configureListFields(ListMapper $list) { if (!$this->isChild()) { $list->addIdentifier('id')->addIdentifier('product', null, array('admin_code' => 'sonata.product.admin.product')); } $list->addIdentifier('code')->add('enabled')->add('perItem')->add('countryCode')->add('zone'); }
/** * {@inheritdoc} */ public function configureListFields(ListMapper $list) { if (!$this->isChild()) { $list->addIdentifier('id')->addIdentifier('product', null, array('admin_code' => 'sonata.product.admin.product')); } $list->addIdentifier('category'); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id')->add('getPeriod', null, array('format' => 'M. Y')); if (!$listMapper->getAdmin()->isChild()) { $listMapper->addIdentifier('employee'); } $listMapper->add('getPayoff')->add('createdAt')->add('_action', 'actions', array('actions' => array('show' => array(), 'edit' => array(), 'print' => array('template' => 'CRUD/list__action_print.html.twig')))); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id')->add('startDate', null, array('label' => 'first_day', 'format' => 'd. M. Y'))->add('endDate', null, array('label' => 'last_day', 'format' => 'd. M. Y')); if (!$listMapper->getAdmin()->isChild()) { $listMapper->addIdentifier('employee'); } $listMapper->add('days', null, array('label' => 'days'))->add('stateName', null, array('template' => 'CRUD/list_string_translated.html.twig'))->add('comment')->add('createdAt')->add('_action', 'actions', array('actions' => array('show' => array(), 'edit' => array(), 'print' => array('template' => 'CRUD/list__action_print.html.twig')))); }
/** * {@inheritdoc} */ public function configureListFields(ListMapper $list) { $currency = $this->currencyDetector->getCurrency()->getLabel(); $list->addIdentifier('id')->addIdentifier('reference'); if (!$list->getAdmin()->isChild()) { $list->addIdentifier('customer'); } $list->add('paymentMethod')->add('deliveryMethod')->add('locale')->add('status', 'string', array('template' => 'SonataOrderBundle:OrderAdmin:list_status.html.twig'))->add('deliveryStatus', 'string', array('template' => 'SonataOrderBundle:OrderAdmin:list_delivery_status.html.twig'))->add('paymentStatus', 'string', array('template' => 'SonataOrderBundle:OrderAdmin:list_payment_status.html.twig'))->add('validatedAt')->add('totalInc', 'currency', array('currency' => $currency))->add('totalExcl', 'currency', array('currency' => $currency)); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id'); $listMapper->addIdentifier('getSaleOrderNumber', null, array('label' => 'order_number')); $listMapper->add('orderDate', null, array('label' => 'date')); if (!$listMapper->getAdmin()->isChild()) { $listMapper->addIdentifier('partner', null, array('by_reference' => false, 'label' => 'customer', 'admin_code' => 'app.customer')); } $listMapper->add('amountUntaxed', 'money', array('label' => 'amount_untaxed', 'currency' => 'CHF'))->add('amountTotal', 'money', array('label' => 'amount_total', 'currency' => 'CHF'))->add('state', 'colored_choice', array('choices' => SaleOrder::getStateChoices(), 'colors' => SaleOrder::getStateColors(), 'catalogue' => 'messages'))->add('_action', 'actions', array('actions' => array('edit' => array()))); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('email')->add('groups')->add('facebookName', array(), array('label' => 'Fb Name'))->add('gender', array(), array('label' => 'Gender'))->add('locale', array(), array('label' => 'Language'))->add('biography', array(), array('label' => 'Biography'))->add('enabled', null, array('editable' => true)); if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { $listMapper->add('impersonating', 'string', array('template' => 'SonataUserBundle:Admin:Field/impersonating.html.twig')); } }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('email', null, array('footable' => array('attr' => array('data-breakpoints' => array('xs', 'sm')))))->add('enabled', null, array('editable' => true, 'footable' => array('attr' => array('data-breakpoints' => array('xs')))))->add('locked', null, array('editable' => true, 'footable' => array('attr' => array('data-breakpoints' => array('xs')))))->add('createdAt', null, array('footable' => array('attr' => array('data-breakpoints' => array('xs', 'sm', 'md'))))); if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { $listMapper->add('impersonating', 'string', array('template' => 'BrueryUserBundle:Admin:Field/impersonating.html.twig', 'footable' => array('attr' => array('data-breakpoints' => array('all'))))); } }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id'); $listMapper->add('type.name'); $listMapper->add('year.year'); $listMapper->add('comment'); }
protected function configureListFields(ListMapper $listMapper) { $listMapper ->addIdentifier('id', 'text') ->addIdentifier('title', 'text') ; }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id')->add('username')->add('email')->add('lastIp')->add('location')->add('groups')->add('_action', 'actions', array('actions' => array('edit' => array(), 'delete' => array()), "label" => 'actions')); if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { $listMapper->add('impersonating', 'string', array('template' => 'SonataAdminBundle:Admin:Field/impersonating.html.twig')); } }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('email')->add('groups')->add('enabled', null, array('editable' => true))->add('locked', null, array('editable' => true))->add('createdAt'); if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { $listMapper->add('impersonating', 'string', array('template' => 'SonataUserBundle:Admin:Field/impersonating.html.twig')); } }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('email')->add('groups')->add('enabled', null, array('editable' => true))->add('locked', null, array('editable' => true))->add('createdAt'); if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { $listMapper->add('impersonating'); } }
/** * {@inheritdoc} */ public function configureListFields(ListMapper $list) { $list->addIdentifier('id'); if (!$list->getAdmin()->isChild()) { $list->add('order'); } $list->add('productType')->add('getStatusName', 'trans', array('name' => 'status', 'catalogue' => 'SonataOrderBundle', 'sortable' => 'status'))->add('getDeliveryStatusName', 'trans', array('name' => 'deliveryStatus', 'catalogue' => 'SonataOrderBundle', 'sortable' => 'deliveryStatus'))->add('getTotalWithVat', 'currency', array('currency' => $this->currencyDetector->getCurrency()->getLabel()))->add('getTotal', 'currency', array('currency' => $this->currencyDetector->getCurrency()->getLabel())); }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('email')->add('groups')->add('enabled', null, array('editable' => true)); if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { $listMapper->add('impersonating', 'string', array('template' => 'NetworkingInitCmsBundle:Admin:Field/impersonating.html.twig')); } $listMapper->add('_action', 'actions', array('label' => ' ', 'actions' => array('edit' => array(), 'delete' => array()))); }
protected function configureListFields(ListMapper $listMapper) { if (!$this->hasParentFieldDescription()) { // this Admin is not embedded $listMapper->add('saleOrder'); } $listMapper->addIdentifier('productNumber', null, array('label' => 'product_number'))->add('shortName', null, array('label' => 'name'))->add('basePrice', null, array('label' => 'base_price'))->add('_action', 'actions', array('actions' => array('edit' => array()))); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('title', null, array('label' => 'Заголовок')); $listMapper->add('description', null, array('label' => 'Описание')); $listMapper->add('content', null, array('label' => 'Содержание')); $listMapper->add('createdAt', null, array('label' => 'Дата создания')); $listMapper->add('updatedAt', null, array('label' => 'Дата обновления')); }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id'); if (interface_exists('Sonata\\ClassificationBundle\\Model\\CategoryInterface')) { $listMapper->add('category'); } $listMapper->add('permalink', 'text')->add('numComments')->add('isCommentable', 'boolean', array('editable' => true)); }
/** * @param ListMapper $listMapper */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id')->add('rules')->add('description', 'html')->add('adressDelivery')->add('signDate')->add('expirationDate')->add('repPDF')->add('users', 'entity', array('class' => 'AMAPBundle:Account\\User', 'associated_property' => function ($amap) { return $amap->getUsername(); }))->add('amap', 'contracts_amap', array('class' => 'AMAPBundle:AMAP\\AMAP', 'associated_property' => function ($amap) { return $amap->getName(); }))->add('_action', null, array('actions' => array('show' => array(), 'edit' => array(), 'delete' => array()))); }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('name')->add('getStatusCode', 'text', array('label' => 'status_code', 'sortable' => 'status')); if (!$this->isChild()) { $listMapper->add('post'); } $listMapper->add('email')->add('url')->add('message'); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('title', null, array('label' => 'Заголовок')); $listMapper->add('slug', null, array('label' => 'Ссылка')); $listMapper->add('createdAt', null, array('label' => 'Дата создания')); $listMapper->add('updatedAt', null, array('label' => 'Дата обновления')); $listMapper->add('news', null, array('label' => 'Связанная новость')); }
protected function configureListFields(ListMapper $listMapper) { $locales = $this->container->getParameter('ao_translation.locales'); $listMapper->addIdentifier('id')->add('domain')->add('identification'); foreach ($locales as $locale => $label) { $listMapper->add($locale, null, array('template' => 'AOTranslationBundle:MessageAdmin:translation.html.twig', 'label' => $label, 'code' => 'getLocaleTranslation', 'parameters' => array($locale))); } $listMapper->add('_action', 'actions', array('actions' => array('edit' => array(), 'delete' => array()))); }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('title', null, array('label' => 'Заголовок'))->add('draft'); $listMapper->add('description', null, array('label' => 'Описание')); $listMapper->add('createdAt', null, array('label' => 'Дата создания')); $listMapper->add('updatedAt', null, array('label' => 'Дата обновления')); $listMapper->add('category', null, array('label' => 'Связанная категория')); $listMapper->add('slug', null, array('label' => 'Ссылка')); }
protected function configureListFields(ListMapper $mapper) { $mapper->addIdentifier('id', null, array('route' => array('name' => 'show'))); $mapper->add('action'); $mapper->add('objectId'); $mapper->add('objectClass'); $mapper->add('changeAt'); $mapper->add('username'); }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('firstname', null, array('label' => 'form.label_firstname'))->add('lastname', null, array('label' => 'form.label_lastname'))->add('email')->add('groups')->add('createdAt', 'date', array('template' => 'ApplicationSonataUserBundle:CRUD:list_created_at.html.twig'))->add('enabled'); // if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { // $listMapper // ->add('impersonating', 'string', array('template' => 'SonataUserBundle:Admin:Field/impersonating.html.twig')) // ; // } }
protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('id'); $listMapper->add('team1', 'sonata_type_model', array()); $listMapper->add('team2', 'sonata_type_model', array()); $listMapper->add('score1', 'text'); $listMapper->add('score2', 'text'); $listMapper->add('startTime', 'datetime'); }
/** * {@inheritdoc} */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('username')->add('createdAt'); // if ($this->isGranted('ROLE_ALLOWED_TO_SWITCH')) { // $listMapper // ->add('impersonating', 'string', array('template' => 'SonataUserBundle:Admin:Field/impersonating.html.twig')) // ; // } }
/** * @param ListMapper $listMapper */ protected function configureListFields(ListMapper $listMapper) { $container = $this->getConfigurationPool()->getContainer(); $roles = $container->getParameter('security.role_hierarchy.roles'); $rolesChoices = $this->roles->flattenRoles($roles); $listMapper->addIdentifier('name')->add('roles', 'choice', array('choices' => $rolesChoices, 'multiple' => true))->add('users', 'entity', array('class' => 'AMAPBundle:Account\\User', 'associated_property' => function ($amap) { return $amap->getUsername(); }))->add('_action', null, array('actions' => array('show' => array(), 'edit' => array(), 'delete' => array()))); }
/** * @param ListMapper $listMapper */ protected function configureListFields(ListMapper $listMapper) { $listMapper->addIdentifier('name')->add('phone')->add('adress')->add('description', 'html')->add('repIMG')->add('users', 'entity', array('class' => 'AMAPBundle:Account\\User', 'associated_property' => function ($amap) { return $amap->getUsername(); }))->add('news', 'entity', array('class' => 'AMAPBundle:Announcement\\News', 'associated_property' => function ($amap) { return $amap->getName(); }))->add('contracts_amap', 'entity', array('class' => 'AMAPBundle:Account\\Contract', 'associated_property' => function ($amap) { return $amap->getId(); }))->add('_action', null, array('actions' => array('show' => array(), 'edit' => array(), 'delete' => array()))); }