Skip to content

Commit

Permalink
Rilis v2410.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vickyrolanda committed Oct 23, 2024
1 parent 038f1a9 commit b262ce2
Showing 166 changed files with 10,403 additions and 4,237 deletions.
4 changes: 3 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -79,10 +79,12 @@
->notPath('views/*')
->in([
__DIR__ . '/app',
__DIR__ . '/bootstrap',
__DIR__ . '/config',
__DIR__ . '/donjo-app',
__DIR__ . '/Modules',
])
->exclude([
__DIR__ . '/donjo-app/Modules',
__DIR__ . '/donjo-app/views',
__DIR__ . '/donjo-app/third_party/*/views',
__DIR__ . '/donjo-app/models/migrations',
39 changes: 37 additions & 2 deletions Modules/Analisis/Enums/TahapPedataanEnum.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
<?php

/*
*
* File ini bagian dari:
*
* OpenSID
*
* Sistem informasi desa sumber terbuka untuk memajukan desa
*
* Aplikasi dan source code ini dirilis berdasarkan lisensi GPL V3
*
* Hak Cipta 2009 - 2015 Combine Resource Institution (http://lumbungkomunitas.net/)
* Hak Cipta 2016 - 2024 Perkumpulan Desa Digital Terbuka (https://opendesa.id)
*
* Dengan ini diberikan izin, secara gratis, kepada siapa pun yang mendapatkan salinan
* dari perangkat lunak ini dan file dokumentasi terkait ("Aplikasi Ini"), untuk diperlakukan
* tanpa batasan, termasuk hak untuk menggunakan, menyalin, mengubah dan/atau mendistribusikan,
* asal tunduk pada syarat berikut:
*
* Pemberitahuan hak cipta di atas dan pemberitahuan izin ini harus disertakan dalam
* setiap salinan atau bagian penting Aplikasi Ini. Barang siapa yang menghapus atau menghilangkan
* pemberitahuan ini melanggar ketentuan lisensi Aplikasi Ini.
*
* PERANGKAT LUNAK INI DISEDIAKAN "SEBAGAIMANA ADANYA", TANPA JAMINAN APA PUN, BAIK TERSURAT MAUPUN
* TERSIRAT. PENULIS ATAU PEMEGANG HAK CIPTA SAMA SEKALI TIDAK BERTANGGUNG JAWAB ATAS KLAIM, KERUSAKAN ATAU
* KEWAJIBAN APAPUN ATAS PENGGUNAAN ATAU LAINNYA TERKAIT APLIKASI INI.
*
* @package OpenSID
* @author Tim Pengembang OpenDesa
* @copyright Hak Cipta 2009 - 2015 Combine Resource Institution (http://lumbungkomunitas.net/)
* @copyright Hak Cipta 2016 - 2024 Perkumpulan Desa Digital Terbuka (https://opendesa.id)
* @license http://www.gnu.org/licenses/gpl.html GPL V3
* @link https://github.com/OpenSID/OpenSID
*
*/

namespace Modules\Analisis\Enums;

use App\Enums\BaseEnum;
@@ -16,8 +51,8 @@ class TahapPedataanEnum extends BaseEnum
public static function all(): array
{
return [
self::BELUM_ENTRI => 'Belum Entri / Pedataan',
self::SEDANG_ENTRI => 'Sedang Dalam Pendataan',
self::BELUM_ENTRI => 'Belum Entri / Pedataan',
self::SEDANG_ENTRI => 'Sedang Dalam Pendataan',
self::SELESAI_ENTRI => 'Selesai Entri / Pedataan',
];
}
14 changes: 7 additions & 7 deletions Modules/Analisis/Enums/TipePertanyaanEnum.php
Original file line number Diff line number Diff line change
@@ -43,21 +43,21 @@

class TipePertanyaanEnum extends BaseEnum
{
public const PILIHAN_TUNGGAL = 1;
public const PILIHAN_GANDA = 2;
public const PILIHAN_TUNGGAL = 1;
public const PILIHAN_GANDA = 2;
public const ISIAN_JUMLAH = 3;
public const ISIAN_TEKS = 4;

/**
* Override method all()
*/
public static function all(): array
{
return [
self::PILIHAN_TUNGGAL => 'Pilihan (Tunggal)',
self::PILIHAN_GANDA => 'Pilihan (Ganda)',
self::ISIAN_JUMLAH => 'Isian angka',
self::ISIAN_TEKS => 'Isian Tulisan'
self::PILIHAN_TUNGGAL => 'Pilihan (Tunggal)',
self::PILIHAN_GANDA => 'Pilihan (Ganda)',
self::ISIAN_JUMLAH => 'Isian angka',
self::ISIAN_TEKS => 'Isian Tulisan',
];
}
}
38 changes: 19 additions & 19 deletions Modules/Analisis/Http/Controllers/Analisis_indikator.php
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ public function datatables($master)
->addIndexColumn()
->addColumn('aksi', static function ($row) use ($canUpdate, $canDelete, $analisisMaster): string {
$aksi = '';
if($analisisMaster->isLock()){
if ($analisisMaster->isLock()) {
return $aksi;
}
if ($canUpdate) {
@@ -117,17 +117,17 @@ public function datatables($master)
public function form($master, $id = null)
{
isCan('u');
$analisisMaster = $this->analisisMaster;
$data['list_kategori'] = AnalisisKategori::where(['id_master' => $master])->pluck('kategori', 'id');
$data['data_tabel'] = AnalisisIndikator::hubungan($analisisMaster->subjek_tipe);
$analisisMaster = $this->analisisMaster;
$data['list_kategori'] = AnalisisKategori::where(['id_master' => $master])->pluck('kategori', 'id');
$data['data_tabel'] = AnalisisIndikator::hubungan($analisisMaster->subjek_tipe);
if ($id) {
$data['action'] = 'Ubah';
$data['form_action'] = ci_route('analisis_indikator.'.$master.'.update', $id);
$data['form_action'] = ci_route('analisis_indikator.' . $master . '.update', $id);
$data['analisis_indikator'] = AnalisisIndikator::findOrFail($id);
$data['ubah'] = (AnalisisParameter::where('id_indikator', $id)->exists() && in_array($data['analisis_indikator']['id_tipe'], [1, 2])) ? false : true;
} else {
$data['action'] = 'Tambah';
$data['form_action'] = ci_route('analisis_indikator.'.$master.'.insert');
$data['form_action'] = ci_route('analisis_indikator.' . $master . '.insert');
$data['analisis_indikator'] = null;
$data['ubah'] = true;
}
@@ -139,49 +139,49 @@ public function insert($master): void
{
isCan('u');
$analisisMaster = $this->analisisMaster;
if($analisisMaster->isSystem()){
redirect_with('error', 'Analisis sistem tidak boleh dirubah', ci_route('analisis_indikator.'.$master));
if ($analisisMaster->isSystem()) {
redirect_with('error', 'Analisis sistem tidak boleh dirubah', ci_route('analisis_indikator.' . $master));
}
$dataInsert = static::validate($this->request);
$dataInsert['id_master'] = $master;
if (AnalisisIndikator::create($dataInsert)) {
redirect_with('success', 'Berhasil Tambah Data', ci_route('analisis_indikator.'.$master));
redirect_with('success', 'Berhasil Tambah Data', ci_route('analisis_indikator.' . $master));
}
redirect_with('error', 'Gagal Tambah Data', ci_route('analisis_indikator.'.$master));
redirect_with('error', 'Gagal Tambah Data', ci_route('analisis_indikator.' . $master));
}

public function update($master, $id = null): void
{
isCan('u');
$analisisMaster = $this->analisisMaster;
$dataUpdate = static::validate($this->request, $id);
if($analisisMaster->isSystem()){
if ($analisisMaster->isSystem()) {
// Hanya kolom yang boleh diubah untuk analisis sistem
$dataUpdate = ['is_publik' => $dataUpdate['is_publik']];
}
$data = AnalisisIndikator::findOrFail($id);

if ($data->update($dataUpdate)) {
redirect_with('success', 'Berhasil Ubah Data', ci_route('analisis_indikator.'.$master));
redirect_with('success', 'Berhasil Ubah Data', ci_route('analisis_indikator.' . $master));
}
redirect_with('error', 'Gagal Ubah Data', ci_route('analisis_indikator.'.$master));
redirect_with('error', 'Gagal Ubah Data', ci_route('analisis_indikator.' . $master));
}

public function delete($master, $id = null): void
{
isCan('h');
$analisisMaster = $this->analisisMaster;
if($analisisMaster->isSystem()){
redirect_with('error', 'Analisis sistem tidak boleh dihapus', ci_route('analisis_indikator.'.$master));
if ($analisisMaster->isSystem()) {
redirect_with('error', 'Analisis sistem tidak boleh dihapus', ci_route('analisis_indikator.' . $master));
}
$adaParameter = AnalisisIndikator::whereIn('id', $id ? [$id] : $this->request['id_cb'])->whereHas('parameter')->exists();
if($adaParameter){
redirect_with('error', 'Gagal hapus, masih ada parameter dalam indikator tersebut', ci_route('analisis_indikator.'.$master));
if ($adaParameter) {
redirect_with('error', 'Gagal hapus, masih ada parameter dalam indikator tersebut', ci_route('analisis_indikator.' . $master));
}
if (AnalisisIndikator::destroy($id ?? $this->request['id_cb']) !== 0) {
redirect_with('success', 'Berhasil Hapus Data', ci_route('analisis_indikator.'.$master));
redirect_with('success', 'Berhasil Hapus Data', ci_route('analisis_indikator.' . $master));
}
redirect_with('error', 'Gagal Hapus Data', ci_route('analisis_indikator.'.$master));
redirect_with('error', 'Gagal Hapus Data', ci_route('analisis_indikator.' . $master));
}

protected static function validate(array $request = []): array
10 changes: 5 additions & 5 deletions Modules/Analisis/Http/Controllers/Analisis_kategori.php
Original file line number Diff line number Diff line change
@@ -35,8 +35,8 @@
*
*/

use Modules\Analisis\Models\AnalisisMaster;
use Modules\Analisis\Models\AnalisisKategori;
use Modules\Analisis\Models\AnalisisMaster;

defined('BASEPATH') || exit('No direct script access allowed');

@@ -128,8 +128,8 @@ public function insert($master): void
public function update($master, $id = null): void
{
isCan('u');
$dataUpdate = static::validate($this->request, $id);
$data = AnalisisKategori::findOrFail($id);
$dataUpdate = static::validate($this->request, $id);
$data = AnalisisKategori::findOrFail($id);

if ($data->update($dataUpdate)) {
redirect_with('success', 'Berhasil Ubah Data', ci_route('analisis_kategori.' . $master));
@@ -141,7 +141,7 @@ public function delete($master, $id = null): void
{
isCan('h');
$ids = $id ? [$id] : $this->request['id_cb'];

foreach ($ids as $id) {
$this->prosesDelete($master, $id);
}
@@ -165,7 +165,7 @@ private function prosesDelete($mater, $id = null): void
protected static function validate(array $request = []): array
{
return [
'kategori' => htmlentities($request['kategori']),
'kategori' => htmlentities($request['kategori']),
];
}
}
7 changes: 4 additions & 3 deletions Modules/Analisis/Http/Controllers/Analisis_klasifikasi.php
Original file line number Diff line number Diff line change
@@ -68,8 +68,9 @@ public function index($master)
public function datatables($master)
{
if ($this->input->is_ajax_request()) {
$canUpdate = can('u');
$canDelete = can('h');
$canUpdate = can('u');
$canDelete = can('h');

return datatables()->of(AnalisisKlasifikasi::whereIdMaster($master))
->addColumn('ceklist', static function ($row) {
if (can('h')) {
@@ -82,7 +83,7 @@ public function datatables($master)
if ($canUpdate) {
$aksi .= '<a href="' . ci_route("analisis_klasifikasi.{$master}.form", $row->id) . '" class="btn bg-orange btn-sm" title="Ubah Data" data-remote="false" data-toggle="modal" data-target="#modalBox" data-title="Ubah Data"><i class="fa fa-edit"></i></a>';
}

if ($canDelete) {
$aksi .= ' <a href="#" data-href="' . ci_route("analisis_klasifikasi.{$master}.delete", $row->id) . '" class="btn bg-maroon btn-sm" title="Hapus Data" data-toggle="modal" data-target="#confirm-delete"><i class="fa fa-trash-o"></i></a>';
}
63 changes: 31 additions & 32 deletions Modules/Analisis/Http/Controllers/Analisis_laporan.php
Original file line number Diff line number Diff line change
@@ -84,17 +84,16 @@ public function index($master): void
'list_klasifikasi' => AnalisisKlasifikasi::where('id_master', $master)->get(),
'analisis_periode' => $this->periodeAktif->id,
'wilayah' => Wilayah::treeAccess(),
'namaPeriode' => $this->periodeAktif->nama
'namaPeriode' => $this->periodeAktif->nama,
];

view('analisis_laporan.index', $data);
}


public function datatables($master)
{
if ($this->input->is_ajax_request()) {
$sumberData = $this->sumberData();
$sumberData = $this->sumberData();

return datatables()->of($sumberData)
->addIndexColumn()
@@ -152,13 +151,13 @@ public function form($master, $idSubjek): void
{
$analisis = new Analisis();

$data['total'] = AnalisisResponHasil::where(['id_subjek' => $idSubjek, 'id_periode' => $this->periodeAktif->id])->first()->akumulasi ?? 0;
$data['subjek'] = $analisis->getSubjek($this->analisisMaster, $idSubjek) ?? show_404();
$data['list_jawab'] = $analisis->listIndikatorLaporan($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_bukti'] = $analisis->listBukti($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_anggota'] = $analisis->listAnggota($this->analisisMaster, $idSubjek);
$data['asubjek'] = $this->analisisMaster->subjek_tipe == AnalisisRefSubjekEnum::DESA ? ucwords(setting('sebutan_desa')) : AnalisisRefSubjekEnum::valueOf($this->analisisMaster->subjek_tipe);
$data['id'] = $idSubjek;
$data['total'] = AnalisisResponHasil::where(['id_subjek' => $idSubjek, 'id_periode' => $this->periodeAktif->id])->first()->akumulasi ?? 0;
$data['subjek'] = $analisis->getSubjek($this->analisisMaster, $idSubjek) ?? show_404();
$data['list_jawab'] = $analisis->listIndikatorLaporan($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_bukti'] = $analisis->listBukti($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_anggota'] = $analisis->listAnggota($this->analisisMaster, $idSubjek);
$data['asubjek'] = $this->analisisMaster->subjek_tipe == AnalisisRefSubjekEnum::DESA ? ucwords(setting('sebutan_desa')) : AnalisisRefSubjekEnum::valueOf($this->analisisMaster->subjek_tipe);
$data['id'] = $idSubjek;

view('analisis_laporan.form', $data);
}
@@ -174,14 +173,14 @@ public function dialog_kuisioner($master, $id, $aksi = ''): void
}

public function daftar($master, $idSubjek, $aksi = ''): void
{
$analisis = new Analisis();
$data['total'] = AnalisisResponHasil::where(['id_subjek' => $idSubjek, 'id_periode' => $this->periodeAktif->id])->first()->akumulasi ?? 0;
$data['subjek'] = $analisis->getSubjek($this->analisisMaster, $idSubjek) ?? show_404();
$data['list_jawab'] = $analisis->listIndikatorLaporan($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_bukti'] = $analisis->listBukti($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_anggota'] = $analisis->listAnggota($this->analisisMaster, $idSubjek);
$data['asubjek'] = $this->analisisMaster->subjek_tipe == AnalisisRefSubjekEnum::DESA ? ucwords(setting('sebutan_desa')) : AnalisisRefSubjekEnum::valueOf($this->analisisMaster->subjek_tipe);
{
$analisis = new Analisis();
$data['total'] = AnalisisResponHasil::where(['id_subjek' => $idSubjek, 'id_periode' => $this->periodeAktif->id])->first()->akumulasi ?? 0;
$data['subjek'] = $analisis->getSubjek($this->analisisMaster, $idSubjek) ?? show_404();
$data['list_jawab'] = $analisis->listIndikatorLaporan($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_bukti'] = $analisis->listBukti($this->analisisMaster, $this->periodeAktif->id, $idSubjek);
$data['list_anggota'] = $analisis->listAnggota($this->analisisMaster, $idSubjek);
$data['asubjek'] = $this->analisisMaster->subjek_tipe == AnalisisRefSubjekEnum::DESA ? ucwords(setting('sebutan_desa')) : AnalisisRefSubjekEnum::valueOf($this->analisisMaster->subjek_tipe);

$data['config'] = $this->header['desa'];
$data['pamong_ttd'] = Pamong::selectData()->where(['pamong_id' => $this->input->post('pamong_ttd')])->first()->toArray();
@@ -194,38 +193,38 @@ public function daftar($master, $idSubjek, $aksi = ''): void
// $aksi = cetak/unduh
public function dialog($master, $aksi = ''): void
{
// Simpan session lama
// Simpan session lama
$data = $this->modal_penandatangan();
$data['aksi'] = ucwords((string) $aksi);
$data['form_action'] = ci_route("analisis_laporan.{$master}.cetak.{$aksi}");
$data['form_action'] = ci_route("analisis_laporan.{$master}.cetak.{$aksi}");

view('analisis_laporan.ttd_pamong', $data);
}

public function cetak($master, $aksi = ''): void
{
{
$paramDatatable = json_decode((string) $this->input->post('params'), 1);
$_GET = $paramDatatable;
$query = $this->sumberData();

$query = $this->sumberData();

$data['pamong_ttd'] = Pamong::selectData()->where(['pamong_id' => $this->input->post('pamong_ttd')])->first()->toArray();
$data['pamong_ketahui'] = Pamong::selectData()->where(['pamong_id' => $this->input->post('pamong_ketahui')])->first()->toArray();
$data['aksi'] = $aksi;
$data['config'] = $this->header['desa'];
$data['aksi'] = $aksi;
$data['config'] = $this->header['desa'];
// $data['judul'] = Analisis::judul_subjek($this->analisisMaster->subjek_tipe);
$data['file'] = 'Laporan Hasil Analisis ' . AnalisisRefSubjekEnum::valueOf($this->analisisMaster->subjek_tipe);
$data['isi'] = 'analisis_laporan.table_print';
$data['main'] = $query->get();
$data['letak_ttd'] = ['2', '2', '1'];
$data['file'] = 'Laporan Hasil Analisis ' . AnalisisRefSubjekEnum::valueOf($this->analisisMaster->subjek_tipe);
$data['isi'] = 'analisis_laporan.table_print';
$data['main'] = $query->get();
$data['letak_ttd'] = ['2', '2', '1'];

view('admin.layouts.components.format_cetak', $data);
}

public function ajax_multi_jawab($master): void
{
$data['jawab'] = session('jawab') ?? '';
$data['main'] = (new Analisis)->multi_jawab($master);
$data['main'] = (new Analisis())->multi_jawab($master);
$data['form_action'] = ci_route("analisis_laporan.{$master}.multi_jawab_proses");

view('analisis_laporan.ajax_multi', $data);
@@ -245,7 +244,7 @@ public function multi_jawab_proses($master): void
}
set_session('jawab', $cb . '7777777');
$jawab = session('jawab');
set_session('jmkf', AnalisisParameter::selectRaw('DISTINCT(id_indikator) AS id_jmkf')->whereRaw('id in ('.$jawab.')')->count());
set_session('jmkf', AnalisisParameter::selectRaw('DISTINCT(id_indikator) AS id_jmkf')->whereRaw('id in (' . $jawab . ')')->count());
}

redirect(ci_route("analisis_laporan.{$master}"));
Loading
Oops, something went wrong.

0 comments on commit b262ce2

Please sign in to comment.