Beispiel #1
0
 /**
  * @param User $user
  * @param InfoPaket $infoPaket
  * @param ArrayCollection $dokumen
  * @return Paket
  */
 public static function create(User $user, InfoPaket $infoPaket, ArrayCollection $dokumen)
 {
     $paket = new Paket();
     $paket->setCreatedAt(new \DateTime());
     $paket->user = $user;
     $paket->infoPaket = $infoPaket;
     $paket->dokumen = $dokumen;
     $paket->status = 'pelayanan';
     return $paket;
 }
Beispiel #2
0
 public static function verifikasi(Paket $paket)
 {
     $status = $paket->getStatus();
     switch ($status) {
         case 'pelayanan':
             $paket->setStatus('distribusi');
             break;
         case 'distribusi':
             $paket->setStatus('kaupt');
             break;
         case 'kaupt':
             $paket->setStatus('pokja');
             break;
         case 'pokja':
             $paket->setStatus('ok');
             break;
     }
 }
Beispiel #3
0
 /**
  * @Given Mempunyai satu paket dengan status :status
  */
 public function mempunyaiSatuPaket($status)
 {
     $this->paket = Paket::create($this->user, new InfoPaket(), new ArrayCollection());
     $this->paket->setStatus($status);
 }
Beispiel #4
0
 public function it_can_verify_paket_with_status_pelayanan(Paket $paket)
 {
     $paket->getStatus()->willReturn('pelayanan');
     $paket->setStatus('distribusi')->shouldBeCalled();
     $this::verifikasi($paket);
 }
Beispiel #5
0
 /**
  * @param Request $request
  * @return mixed
  */
 public function skpdAction(Request $request)
 {
     $skpdForm = new SkpdForm();
     $formBuilder = $this->app['form.factory']->create($skpdForm, $skpdForm);
     if ($request->getMethod() === 'GET') {
         return $this->app['twig']->render('skpd.twig', ['form' => $formBuilder->createView()]);
     }
     $formBuilder->handleRequest($request);
     if (!$formBuilder->isValid()) {
         return $this->app['twig']->render('skpd.twig', ['form' => $formBuilder->createView()]);
     }
     $infoPaket = new InfoPaket();
     $infoPaket->setNamaPaket($skpdForm->getNamaPaket());
     $infoPaket->setSumberDana($skpdForm->getSumberDana());
     $infoPaket->setTahunAggaran($skpdForm->getTahunAnggaran());
     $infoPaket->setPaguAnggaran($skpdForm->getPaguAnggraran());
     $infoPaket->setKodeRekening($skpdForm->getKodeRekening());
     $infoPaket->setKodeRup($skpdForm->getKodeRup());
     $infoPaket->setJenisPembayaran($skpdForm->getJenisPembayaran());
     /**
      * @var User
      */
     $user = $this->app['user.repository']->findByUsername($this->app['session']->get('username')['value']);
     $files = new ArrayCollection();
     $paket = Paket::create($user, $infoPaket, $files);
     $files->add(Dokumen::create('Surat Permintaan Lelang dan SKPD', $skpdForm->getDokumenSuratPermintaanLelang(), $paket));
     $files->add(Dokumen::create('Hasil Perkiraan Sendiri', $skpdForm->getDokumenHasilPerkiraanSendiri(), $paket));
     $files->add(Dokumen::create('Cetak RUP', $skpdForm->getDokumenCetakRup(), $paket));
     $files->add(Dokumen::create('Kerangka Acuan Kerja', $skpdForm->getDokumenKerangkaAcuanKerja(), $paket));
     $files->add(Dokumen::create('Daftar Kuantitas', $skpdForm->getDokumenDaftarKuantitas(), $paket));
     $files->add(Dokumen::create('Spesifikasi Teknis', $skpdForm->getDokumenSpesifikasiTeknis(), $paket));
     $files->add(Dokumen::create('Gambar', $skpdForm->getDokumenGambar(), $paket));
     $files->add(Dokumen::create('Rancangan Kontrak', $skpdForm->getDokumenRancanganKontrak(), $paket));
     $files->add(Dokumen::create('Syarat-Syarat Umum Kontrak', $skpdForm->getDokumenSyaratSyaratUmumKontrak(), $paket));
     $files->add(Dokumen::create('Syarat-Sayarat Khusus Kontrak', $skpdForm->getDokumenSyaratSyaratKhususKontrak(), $paket));
     $files->add(Dokumen::create('Dokumen Pendukung Lain', $skpdForm->getDokumenPendukungLain(), $paket));
     $paket->setDokumen($files);
     $this->app['orm.em']->persist($paket);
     $this->app['orm.em']->flush();
     /**
      * move uploaded file
      */
     $dirName = $this->app['dokumen.path'] . '/' . $paket->getId();
     mkdir($dirName, 0755);
     foreach ($files as $dokumen) {
         /**
          * @var Dokumen $dokumen
          */
         $dokumen->getFile()->move($dirName, $dokumen->getFilename());
     }
     $this->app['session']->getFlashBag()->add('message_success', 'Sukses Mengajukan Paket');
     return $this->app['twig']->render('skpd.twig', ['form' => $formBuilder->createView()]);
 }
 /**
  * {@inheritDoc}
  */
 public function addLog(\Jowy\P2bj\Domain\Entity\Log $log)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'addLog', array($log));
     return parent::addLog($log);
 }