예제 #1
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $sekolah = $this->getSekolah();
     $builder->addEventSubscriber(new SekolahSubscriber($sekolah));
     $builder->add('sekolah', 'sisdik_entityhidden', ['required' => true, 'class' => 'LanggasSisdikBundle:Sekolah', 'data' => $sekolah->getId()])->add('jenisLayanan', 'choice', ['choices' => array_merge(PilihanLayananSms::getDaftarLayananPendaftaran(), PilihanLayananSms::getDaftarLayananBiayaSekaliBayar(), PilihanLayananSms::getDaftarLayananBiayaRutin()), 'required' => true, 'label' => 'label.layanansms.jenis'])->add('templatesms', 'entity', ['class' => 'LanggasSisdikBundle:Templatesms', 'label' => 'label.sms.template.entry', 'multiple' => false, 'expanded' => false, 'required' => true, 'property' => 'optionLabel', 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('templateSms')->where('templateSms.sekolah = :sekolah')->orderBy('templateSms.nama', 'ASC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'xlarge']]);
 }
예제 #2
0
 /**
  * @Route("/{id}", name="layanan_sms_show")
  * @Method("GET")
  * @Template()
  */
 public function showAction($id)
 {
     $this->setCurrentMenu();
     $em = $this->getDoctrine()->getManager();
     $entity = $em->getRepository('LanggasSisdikBundle:LayananSms')->find($id);
     if (!$entity) {
         throw $this->createNotFoundException('Entity LayananSms tak ditemukan.');
     }
     if ($this->get('security.authorization_checker')->isGranted('view', $entity) === false) {
         throw new AccessDeniedException($this->get('translator')->trans('akses.ditolak'));
     }
     $deleteForm = $this->createDeleteForm($id);
     return ['entity' => $entity, 'delete_form' => $deleteForm->createView(), 'daftarJenisLayanan' => array_merge(PilihanLayananSms::getDaftarLayananPendaftaran(), PilihanLayananSms::getDaftarLayananBiayaSekaliBayar(), PilihanLayananSms::getDaftarLayananBiayaRutin())];
 }
 /**
  * @Route("/{id}", name="layanansms_show")
  * @Method("GET")
  * @Template()
  */
 public function showAction($id)
 {
     $this->setCurrentMenu();
     $em = $this->getDoctrine()->getManager();
     $entity = $em->getRepository('LanggasSisdikBundle:PilihanLayananSms')->find($id);
     if (!$entity) {
         throw $this->createNotFoundException('Entity PilihanLayananSms tak ditemukan.');
     }
     $deleteForm = $this->createDeleteForm($id);
     return ['entity' => $entity, 'delete_form' => $deleteForm->createView(), 'daftarJenisLayanan' => array_merge(PilihanLayananSms::getDaftarLayananPendaftaran(), PilihanLayananSms::getDaftarLayananLaporan(), PilihanLayananSms::getDaftarLayananKehadiran(), PilihanLayananSms::getDaftarLayananKepulangan(), PilihanLayananSms::getDaftarLayananBiayaSekaliBayar(), PilihanLayananSms::getDaftarLayananBiayaRutin(), PilihanLayananSms::getDaftarLayananLain(), PilihanLayananSms::getDaftarLayananPeriodik())];
 }
 private function buildServiceChoices()
 {
     $choices = array_merge(['' => 'label.semua.layanan'], PilihanLayananSms::getDaftarLayananPendaftaran(), PilihanLayananSms::getDaftarLayananLaporan(), PilihanLayananSms::getDaftarLayananKehadiran(), PilihanLayananSms::getDaftarLayananKepulangan(), PilihanLayananSms::getDaftarLayananBiayaSekaliBayar(), PilihanLayananSms::getDaftarLayananBiayaRutin(), PilihanLayananSms::getDaftarLayananLain(), PilihanLayananSms::getDaftarLayananPeriodik());
     return $choices;
 }