Esempio n. 1
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $sekolah = $options['sekolahSrc'];
     $builder->add('sekolahSrc', 'hidden', ['data' => $options['sekolahSrc']])->add('tahunAkademikSrc', 'hidden', ['data' => $options['tahunAkademikSrc']])->add('kelasSrc', 'hidden', ['data' => $options['kelasSrc']])->add('perulanganSrc', 'hidden', ['data' => $options['perulanganSrc']])->add('requestUri', 'hidden', ['data' => $options['requestUri']])->add('mingguanHariKeSrc', 'hidden', ['data' => $options['mingguanHariKeSrc']])->add('bulananHariKeSrc', 'hidden', ['data' => $options['bulananHariKeSrc']])->add('tahunAkademik', 'entity', ['class' => 'LanggasSisdikBundle:TahunAkademik', 'label' => 'label.year.entry', 'multiple' => false, 'expanded' => false, 'property' => 'nama', 'required' => true, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('tahunAkademik')->where('tahunAkademik.sekolah = :sekolah')->orderBy('tahunAkademik.urutan', 'DESC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'medium selectyearduplicate'], 'label_render' => false, 'horizontal' => false])->add('kelas', 'entity', ['class' => 'LanggasSisdikBundle:Kelas', 'label' => 'label.class.entry', 'multiple' => false, 'expanded' => false, 'property' => 'nama', 'required' => true, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('kelas')->leftJoin('kelas.tingkat', 'tingkat')->where('kelas.sekolah = :sekolah')->orderBy('tingkat.urutan', 'ASC')->addOrderBy('kelas.urutan')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'medium selectclassduplicate'], 'label_render' => false, 'horizontal' => false])->add('perulangan', 'choice', ['choices' => JadwalKehadiran::getDaftarPerulangan(), 'label' => 'label.selectrepetition', 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => array('class' => 'small'), 'label_render' => false, 'horizontal' => false])->add('mingguanHariKe', 'choice', ['choices' => JadwalKehadiran::getNamaHari(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectweekday', 'attr' => array('class' => 'medium'), 'label_render' => false, 'horizontal' => false])->add('bulananHariKe', 'choice', ['choices' => JadwalKehadiran::getAngkaHariSebulan(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectmonthday', 'attr' => ['class' => 'medium'], 'label_render' => false, 'horizontal' => false]);
 }
 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::getDaftarLayananPeriodik()), 'required' => true, 'label' => 'label.layanansms.jenis'])->add('perulangan', 'choice', ['choices' => LayananSmsPeriodik::getDaftarPerulangan(), 'label' => 'label.perulangan', 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => ['class' => 'small']])->add('mingguanHariKe', 'choice', ['label' => 'label.day', 'choices' => JadwalKehadiran::getNamaHari(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectweekday', 'attr' => ['class' => 'medium'], 'help_block' => 'help.untuk.perulangan.mingguan'])->add('bulananHariKe', 'choice', ['label' => 'label.monthday', 'choices' => JadwalKehadiran::getAngkaHariSebulan(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectmonthday', 'attr' => ['class' => 'medium'], 'help_block' => 'help.untuk.perulangan.bulanan.atau.lebih.lama'])->add('bulanAwal', 'choice', ['label' => 'label.bulan.awal', 'choices' => LayananSmsPeriodik::getDaftarNamaBulan(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.pilih.bulan', 'attr' => ['class' => 'medium'], 'help_block' => 'help.untuk.perulangan.triwulan.atau.lebih.lama'])->add('smsJam', 'time', ['label' => 'label.kirim.sms.jam', 'required' => false, 'input' => 'string', 'widget' => 'single_text', 'with_seconds' => false, 'attr' => ['class' => 'mini']])->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']])->add('tingkat', 'entity', ['class' => 'LanggasSisdikBundle:Tingkat', 'label' => 'label.tingkat', 'required' => false, 'property' => 'optionLabel', 'placeholder' => 'label.pilih.tingkat', 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('tingkat')->where('tingkat.sekolah = :sekolah')->orderBy('tingkat.urutan', 'ASC')->setParameter('sekolah', $sekolah);
         return $qb;
     }])->add('aktif', 'checkbox', ['label' => 'label.active', 'required' => false, 'label_render' => true, 'widget_checkbox_label' => 'widget', 'horizontal_input_wrapper_class' => 'col-sm-offset-4 col-sm-8 col-md-offset-4 col-md-7 col-lg-offset-3 col-lg-9']);
 }
Esempio n. 3
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('tahunAkademik', 'entity', ['class' => 'LanggasSisdikBundle:TahunAkademik', 'label' => 'label.year.entry', 'multiple' => false, 'expanded' => false, 'property' => 'nama', 'required' => true, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('tahunAkademik')->where('tahunAkademik.sekolah = :sekolah')->orderBy('tahunAkademik.urutan', 'DESC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'medium selectyear']])->add('kelas', 'entity', ['class' => 'LanggasSisdikBundle:Kelas', 'label' => 'label.class.entry', 'multiple' => false, 'expanded' => false, 'property' => 'nama', 'required' => true, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('kelas')->leftJoin('kelas.tingkat', 'tingkat')->where('kelas.sekolah = :sekolah')->orderBy('tingkat.urutan', 'ASC')->addOrderBy('kelas.urutan')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'large selectclass']])->add('statusKehadiran', 'choice', ['choices' => JadwalKehadiran::getDaftarStatusKehadiran(), 'label' => 'label.status.kehadiran', 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => ['class' => 'medium']])->add('perulangan', 'choice', ['choices' => JadwalKehadiran::getDaftarPerulangan(), 'label' => 'label.perulangan', 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => ['class' => 'small']])->add('mingguanHariKe', 'choice', ['label' => 'label.day', 'choices' => JadwalKehadiran::getNamaHari(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectweekday', 'attr' => ['class' => 'medium']])->add('bulananHariKe', 'choice', ['label' => 'label.monthday', 'choices' => JadwalKehadiran::getAngkaHariSebulan(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectmonthday', 'attr' => ['class' => 'medium']])->add('paramstatusDariJam', 'time', ['label' => 'label.paramstatusfrom', 'required' => false, 'input' => 'string', 'widget' => 'single_text', 'with_seconds' => false, 'attr' => ['class' => 'mini']])->add('paramstatusHinggaJam', 'time', ['label' => 'label.paramstatusto', 'required' => false, 'input' => 'string', 'widget' => 'single_text', 'with_seconds' => false, 'attr' => ['class' => 'mini']])->add('kirimSms', 'checkbox', ['label' => 'label.kirim.sms', 'required' => false, 'label_render' => true, 'widget_checkbox_label' => 'widget', 'horizontal_input_wrapper_class' => 'col-sm-offset-4 col-sm-8 col-md-offset-4 col-md-7 col-lg-offset-3 col-lg-9'])->add('smsJam', 'time', ['label' => 'label.kirim.sms.jam', 'required' => false, 'input' => 'string', 'widget' => 'single_text', 'with_seconds' => false, 'attr' => ['class' => 'mini']])->add('templatesms', 'entity', ['class' => 'LanggasSisdikBundle:Templatesms', 'label' => 'label.sms.template.entry', 'multiple' => false, 'expanded' => false, 'required' => false, 'property' => 'optionLabel', 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('template')->where('template.sekolah = :sekolah')->orderBy('template.nama', 'ASC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'xlarge'], 'placeholder' => 'label.pilih.template.sms'])->add('otomatisTerhubungMesin', 'checkbox', ['label' => 'label.otomatis.terhubung.mesin.kehadiran', 'required' => false, 'label_render' => true, 'widget_checkbox_label' => 'widget', 'horizontal_input_wrapper_class' => 'col-sm-offset-4 col-sm-8 col-md-offset-4 col-md-7 col-lg-offset-3 col-lg-9'])->add('permulaan', 'checkbox', ['label' => 'label.awal.kehadiran', 'required' => false, 'help_block' => 'help.awal.kehadiran', 'label_render' => true, 'widget_checkbox_label' => 'widget', 'horizontal_input_wrapper_class' => 'col-sm-offset-4 col-sm-8 col-md-offset-4 col-md-7 col-lg-offset-3 col-lg-9']);
 }
 /**
  * @param FormEvent $event
  */
 public function preSubmit(FormEvent $event)
 {
     $data = $event->getData();
     $form = $event->getForm();
     $form->add('perulangan', 'choice', ['choices' => JadwalKehadiran::getDaftarPerulangan(), 'label' => 'label.selectrepetition', 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => ['class' => 'medium pilih-perulangan'], 'label_render' => false, 'horizontal' => false]);
     if (array_key_exists('perulangan', $data)) {
         if ($data['perulangan'] == 'a-harian') {
             $form->add('mingguanHariKe', 'hidden');
             $form->add('bulananHariKe', 'hidden');
         } elseif ($data['perulangan'] == 'b-mingguan') {
             $form->add('bulananHariKe', 'hidden');
             $form->add('mingguanHariKe', 'choice', ['choices' => JadwalKehadiran::getNamaHari(), 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => ['class' => 'medium'], 'label_render' => false, 'horizontal' => false]);
         } elseif ($data['perulangan'] == 'c-bulanan') {
             $form->add('mingguanHariKe', 'hidden');
             $form->add('bulananHariKe', 'choice', ['choices' => JadwalKehadiran::getAngkaHariSebulan(), 'multiple' => false, 'expanded' => false, 'required' => true, 'attr' => ['class' => 'medium'], 'label_render' => false, 'horizontal' => false]);
         }
     }
 }
Esempio n. 5
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $sekolah = $this->getSekolah();
     $builder->add('tahun', 'entity', ['class' => 'LanggasSisdikBundle:Tahun', 'label' => 'label.year.entry', 'multiple' => false, 'expanded' => false, 'property' => 'tahun', 'placeholder' => false, 'required' => true, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('tahun')->where('tahun.sekolah = :sekolah')->orderBy('tahun.tahun', 'DESC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'small'], 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false, 'horizontal_input_wrapper_class' => 'col-sm-4 col-md-3 col-lg-2'])->add('penjurusan', 'entity', ['class' => 'LanggasSisdikBundle:Penjurusan', 'label' => 'label.placement.study', 'multiple' => false, 'expanded' => false, 'property' => 'optionLabel', 'placeholder' => 'label.semua.penjurusan.studi', 'required' => false, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('penjurusan')->where('penjurusan.sekolah = :sekolah')->orderBy('penjurusan.root', 'ASC')->addOrderBy('penjurusan.lft', 'ASC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'xlarge'], 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false])->add('jenisbiaya', 'entity', ['class' => 'LanggasSisdikBundle:Jenisbiaya', 'label' => 'label.fee.type.entry', 'multiple' => false, 'expanded' => false, 'property' => 'nama', 'placeholder' => false, 'required' => true, 'query_builder' => function (EntityRepository $repository) use($sekolah) {
         $qb = $repository->createQueryBuilder('jenisbiaya')->where('jenisbiaya.sekolah = :sekolah')->orderBy('jenisbiaya.nama', 'ASC')->setParameter('sekolah', $sekolah);
         return $qb;
     }, 'attr' => ['class' => 'xlarge'], 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false])->add('nominal', 'money', ['currency' => 'IDR', 'required' => true, 'precision' => 0, 'grouping' => 3, 'attr' => ['class' => 'large'], 'horizontal_input_wrapper_class' => 'col-sm-6 col-md-5 col-lg-4'])->add('perulangan', 'choice', ['choices' => BiayaRutin::getDaftarPerulangan(), 'preferred_choices' => ['c-bulanan'], 'required' => true, 'multiple' => false, 'expanded' => false, 'attr' => ['class' => 'medium'], 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false])->add('mingguanHariKe', 'choice', ['label' => 'label.day', 'choices' => JadwalKehadiran::getNamaHari(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectweekday', 'attr' => ['class' => 'medium'], 'help_block' => 'help.untuk.perulangan.mingguan', 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false])->add('bulananHariKe', 'choice', ['label' => 'label.monthday', 'choices' => JadwalKehadiran::getAngkaHariSebulan(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.selectmonthday', 'attr' => ['class' => 'medium'], 'help_block' => 'help.untuk.perulangan.bulanan.atau.lebih.lama', 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false])->add('bulanAwal', 'choice', ['label' => 'label.bulan.awal', 'choices' => LayananSmsPeriodik::getDaftarNamaBulan(), 'multiple' => false, 'expanded' => false, 'required' => false, 'placeholder' => 'label.pilih.bulan', 'attr' => ['class' => 'medium'], 'help_block' => 'help.untuk.perulangan.triwulan.atau.lebih.lama', 'read_only' => $options['mode'] == 'edit' ? true : false, 'disabled' => $options['mode'] == 'edit' ? true : false])->add('urutan', 'choice', ['choices' => $this->buildOrderChoices(), 'required' => true, 'multiple' => false, 'expanded' => false, 'attr' => ['class' => 'small'], 'horizontal_input_wrapper_class' => 'col-sm-3 col-md-2 col-lg-1']);
     if ($options['mode'] == 'edit') {
         $builder->add('nominalSebelumnya', 'hidden', ['required' => false, 'data' => $options['nominal']]);
     }
     if ($options['nominal'] !== null) {
         $builder->add('captcha', 'captcha', ['attr' => ['class' => 'medium', 'placeholder' => 'help.type.captcha', 'autocomplete' => 'off'], 'as_url' => true, 'reload' => true, 'help_block' => 'help.captcha.penjelasan.ubah.biaya', 'horizontal_input_wrapper_class' => 'col-sm-6 col-md-5 col-lg-4']);
     }
 }