feat: implement admin modules for RT log, document revisions, ferrit logs, and NCR creator, and add centralized common settings page
This commit is contained in:
@@ -1,51 +1,57 @@
|
||||
<?php function datagrid_scripts() {
|
||||
<?php function datagrid_scripts()
|
||||
{
|
||||
?>
|
||||
<!-- DevExtreme CSS -->
|
||||
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/23.1.5/css/dx-diagram.css" />
|
||||
|
||||
<!-- DevExtreme Diagram JavaScript -->
|
||||
<script src="https://cdn3.devexpress.com/jslib/23.1.5/js/dx-diagram.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.0/polyfill.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.1.1/exceljs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.2/FileSaver.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.0.0/jspdf.umd.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn3.devexpress.com/jslib/23.1.5/css/<?php echo setting("DevExpress_Theme", false,"dx.light.compact") ?>.css">
|
||||
<!-- Quill CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.quilljs.com/1.3.7/quill.snow.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.4.0/polyfill.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.1.1/exceljs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.2/FileSaver.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.0.0/jspdf.umd.min.js"></script>
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn3.devexpress.com/jslib/23.1.5/css/<?php echo setting("DevExpress_Theme", false, "dx.light.compact") ?>">
|
||||
<!-- Quill CSS -->
|
||||
<link rel=" stylesheet" href="https://cdn.quilljs.com/1.3.7/quill.snow.css">
|
||||
|
||||
<!-- Quill JS -->
|
||||
<script src="https://cdn.quilljs.com/1.3.7/quill.min.js"></script>
|
||||
<!-- Quill JS -->
|
||||
<script src="https://cdn.quilljs.com/1.3.7/quill.min.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript" src="https://cdn3.devexpress.com/jslib/23.1.5/js/dx.all.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.0.0/jspdf.umd.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn3.devexpress.com/jslib/23.1.5/js/dx.all.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.0.0/jspdf.umd.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.dx-datagrid tr:nth-child(odd) {
|
||||
background-color:#e8e8e8;
|
||||
}
|
||||
#dataGrid {
|
||||
<style>
|
||||
.dx-datagrid tr:nth-child(odd) {
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
|
||||
#dataGrid {
|
||||
height: calc(100vh - 220px);
|
||||
}
|
||||
}
|
||||
|
||||
.dx-datagrid .dx-row > td, .dx-datagrid .dx-row > tr > td {
|
||||
.dx-datagrid .dx-row>td,
|
||||
.dx-datagrid .dx-row>tr>td {
|
||||
padding: 5px !important;
|
||||
}
|
||||
.dx-editor-cell .dx-texteditor .dx-texteditor-input {
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.dx-datagrid .dx-row-lines > td {
|
||||
.dx-editor-cell .dx-texteditor .dx-texteditor-input {
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.dx-datagrid .dx-row-lines>td {
|
||||
border-bottom: 1px solid #d2d2d2;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
<?php function datagrid_configurations() {
|
||||
<?php function datagrid_configurations()
|
||||
{
|
||||
?>
|
||||
toolbar: {
|
||||
items: [
|
||||
@@ -171,108 +177,18 @@
|
||||
if(e.columnIndex != selectedColIndex) {
|
||||
Swal.fire("<?php echo e2("Wrong") ?>", "<?php echo e2("Please copy using the same columns.") ?>", "error");
|
||||
} else {
|
||||
for(var rowIndex = selectedRowIndex + 1; rowIndex<=e.rowIndex; rowIndex++) {
|
||||
e.component.cellValue(rowIndex, e.columnIndex, copyData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@endif
|
||||
}
|
||||
},
|
||||
|
||||
onEditingStart(e) {
|
||||
var focusedSelector = $("td.dx-focused");
|
||||
var rowIndex = dataGrid.option("focusedRowIndex");
|
||||
var colIndex = dataGrid.option("focusedColumnIndex");
|
||||
try {
|
||||
var dataField = e.column.dataField;
|
||||
var allEntries = JSON.parse(localStorage.getItem("originalData" + rowIndex + colIndex)) || [];
|
||||
allEntries.push(e.data[dataField]);
|
||||
localStorage.setItem("originalData" + rowIndex + colIndex, JSON.stringify(allEntries));
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
onInitNewRow(e) {
|
||||
|
||||
if(selectedData) {
|
||||
e.data = selectedData;
|
||||
selectedData = null;
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
onRowInserting(e) {
|
||||
logEvent('RowInserting');
|
||||
console.log(e);
|
||||
},
|
||||
|
||||
onRowInserted() {
|
||||
// logEvent('RowInserted');
|
||||
},
|
||||
onRowUpdating() {
|
||||
},
|
||||
onRowUpdated() {
|
||||
// logEvent('RowUpdated');
|
||||
},
|
||||
onRowRemoving() {
|
||||
// logEvent('RowRemoving');
|
||||
},
|
||||
onRowRemoved() {
|
||||
// logEvent('RowRemoved');
|
||||
},
|
||||
onSaving() {
|
||||
|
||||
},
|
||||
onInitialized() {
|
||||
|
||||
$("#dataGrid td").on("click", function() {
|
||||
logEvent("#dataGrid td");
|
||||
});
|
||||
},
|
||||
onRowClick: function(e) {
|
||||
|
||||
/*
|
||||
console.log("onRowClick");
|
||||
console.log(e);
|
||||
selectedData = e.data;
|
||||
selectedData.id = null;
|
||||
if(e.rowType === "data") {
|
||||
e.component.editRow(e.rowIndex);
|
||||
}
|
||||
|
||||
*/
|
||||
},
|
||||
onSaved() {
|
||||
|
||||
logEvent('Saving Success');
|
||||
},
|
||||
onEditCanceling() {
|
||||
// logEvent('EditCanceling');
|
||||
},
|
||||
onEditCanceled() {
|
||||
// logEvent('EditCanceled');
|
||||
},
|
||||
onFocusedRowChanging(e) {
|
||||
// console.log(e);
|
||||
},
|
||||
|
||||
|
||||
sorting: {
|
||||
mode: "multiple" // or "multiple" | "none"
|
||||
},
|
||||
|
||||
|
||||
<?php
|
||||
for(var rowIndex = selectedRowIndex + 1; rowIndex<=e.rowIndex; rowIndex++) { e.component.cellValue(rowIndex,
|
||||
e.columnIndex, copyData); } } } }); @endif } }, onEditingStart(e) { var focusedSelector=$("td.dx-focused"); var
|
||||
rowIndex=dataGrid.option("focusedRowIndex"); var colIndex=dataGrid.option("focusedColumnIndex"); try { var
|
||||
dataField=e.column.dataField; var allEntries=JSON.parse(localStorage.getItem("originalData" + rowIndex + colIndex)) ||
|
||||
[]; allEntries.push(e.data[dataField]); localStorage.setItem("originalData" + rowIndex + colIndex,
|
||||
JSON.stringify(allEntries)); } catch (error) { } }, onInitNewRow(e) { if(selectedData) { e.data=selectedData;
|
||||
selectedData=null; } }, onRowInserting(e) { logEvent('RowInserting'); console.log(e); }, onRowInserted() { //
|
||||
logEvent('RowInserted'); }, onRowUpdating() { }, onRowUpdated() { // logEvent('RowUpdated'); }, onRowRemoving() { //
|
||||
logEvent('RowRemoving'); }, onRowRemoved() { // logEvent('RowRemoved'); }, onSaving() { }, onInitialized() {
|
||||
$("#dataGrid td").on("click", function() { logEvent("#dataGrid td"); }); }, onRowClick: function(e) { /*
|
||||
console.log("onRowClick"); console.log(e); selectedData=e.data; selectedData.id=null; if(e.rowType==="data" ) {
|
||||
e.component.editRow(e.rowIndex); } */ }, onSaved() { logEvent('Saving Success'); }, onEditCanceling() { //
|
||||
logEvent('EditCanceling'); }, onEditCanceled() { // logEvent('EditCanceled'); }, onFocusedRowChanging(e) { //
|
||||
console.log(e); }, sorting: { mode: "multiple" // or "multiple" | "none" }, <?php
|
||||
} ?>
|
||||
@@ -185,7 +185,7 @@ $topButtons = [
|
||||
|
||||
<script>
|
||||
function editorPreparing(e, dataRow) {
|
||||
<?php echo dxAutocomplete("subcontructer", "subcontractors", "company_name_en", ['job_description' => 'Montaj']); ?>
|
||||
// <?php echo dxAutocomplete("subcontructer", "subcontractors", "company_name_en", ['job_description' => 'Montaj']); ?>
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
@@ -16,7 +16,7 @@ $relationDatas = [
|
||||
'html' => '<i class="fa fa-pdf"></i>'
|
||||
],
|
||||
'ferrite_result' => [
|
||||
'datas' => db("results")->get(),
|
||||
'datas' => [],
|
||||
'pattern' => '{title}',
|
||||
'type' => 'select-dropdown'
|
||||
],
|
||||
|
||||
@@ -8,9 +8,9 @@ $outputFileName = "ncr_no";
|
||||
$numberColumn = "ncr_no";
|
||||
|
||||
$relationDatas = [
|
||||
'subcontractor' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
|
||||
'thirdparty' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
|
||||
'contractor' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
|
||||
'subcontractor' => [],
|
||||
'thirdparty' => [],
|
||||
'contractor' => [],
|
||||
'itp' => db("i_t_p_s")->groupBy("itp_no")->get()->pluck("itp_no")->toArray(),
|
||||
];
|
||||
?>
|
||||
|
||||
@@ -16,7 +16,7 @@ $relationDatas = [
|
||||
'html' => '<i class="fa fa-pdf"></i>'
|
||||
],
|
||||
'rt_result' => [
|
||||
'datas' => db("results")->get(),
|
||||
'datas' => [],
|
||||
'pattern' => '{title}',
|
||||
'type' => 'select-dropdown'
|
||||
],
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<?php
|
||||
if(getisset("update")) {
|
||||
if (getisset("update")) {
|
||||
// Wrap all updates in a single transaction to prevent deadlocks
|
||||
DB::transaction(function() {
|
||||
foreach($_POST AS $key => $value) {
|
||||
DB::transaction(function () {
|
||||
foreach ($_POST as $key => $value) {
|
||||
// Skip CSRF token and other non-setting fields
|
||||
if($key === '_token' || $key === 'update') {
|
||||
if ($key === '_token' || $key === 'update') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Handle array values (like multi-select)
|
||||
if(is_array($value)) {
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
}
|
||||
|
||||
firstOrUpdate([
|
||||
'title' => $key,
|
||||
'html' => $value
|
||||
],"settings",[
|
||||
], "settings", [
|
||||
'title' => $key
|
||||
]);
|
||||
}
|
||||
@@ -39,103 +39,24 @@ if(getisset("update")) {
|
||||
<input type="text" name="company_code" value="{{setting('company_code')}}" class="form-control" id="">
|
||||
{{e2("Default Table Row Count Per Page")}}:
|
||||
<input type="number" name="row_count" value="{{setting('row_count')}}" class="form-control" id="">
|
||||
{{e2("Register Creator Max Selection")}}:
|
||||
<input type="number" name="register_creator_max_selection" value="{{setting('register_creator_max_selection', 50)}}" class="form-control" id="">
|
||||
|
||||
{{e2("Summary Mails")}} <small>{{e2("Virgüllerle ayırın")}}</small>:
|
||||
<input type="text" name="summary_mails" value="{{setting('summary_mails')}}" class="form-control" id="">
|
||||
{{e2("Register Creator File Name Pattern")}} :
|
||||
<input type="text" name="register_creator_file_name_pattern" value="{{setting('register_creator_file_name_pattern')}}" class="form-control" id="">
|
||||
|
||||
{{e2("Register Creator Repeat Row")}} :
|
||||
<input type="text" name="register_creator_start_row" value="{{setting('register_creator_start_row')}}" class="form-control" id="">
|
||||
{{e2("Register Creator Path")}} :
|
||||
<input type="text" name="register_creator_path" value="{{setting('register_creator_path')}}" class="form-control" id="">
|
||||
{{e2("Register Creator Column Based")}} :
|
||||
<select name="register_creator_column_based" id="" class="form-control select2">
|
||||
<?php $weldLogsColumns = table_columns("weld_logs");
|
||||
$registerColumnBased = setting('register_creator_column_based');
|
||||
?>
|
||||
<option value="">Select</option>
|
||||
@foreach($weldLogsColumns AS $weldLogsColumn)
|
||||
<option value="{{$weldLogsColumn}}" @if($registerColumnBased == $weldLogsColumn) selected @endif>{{e2($weldLogsColumn)}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
{{e2("Hand Over Zone Column")}} :
|
||||
<select name="hand_over_zone_column" id="" class="form-control select2">
|
||||
<?php $weldLogsColumns = table_columns("weld_logs");
|
||||
$handOverZoneColumn = setting('hand_over_zone_column');
|
||||
?>
|
||||
<option value="">Select</option>
|
||||
@foreach($weldLogsColumns AS $weldLogsColumn)
|
||||
<option value="{{$weldLogsColumn}}" @if($handOverZoneColumn == $weldLogsColumn) selected @endif>{{e2($weldLogsColumn)}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
{{e2("TP Register Creator Path")}} :
|
||||
<input type="text" name="tp_register_creator_path" value="{{setting('tp_register_creator_path')}}" class="form-control" id="">
|
||||
{{e2("Main Subcontractor")}}:
|
||||
<select name="main_subcontractor" id="" class="form-control">
|
||||
<option value="">{{e2("Select")}}</option>
|
||||
|
||||
<?php $ste = db("subcontractors")->get();
|
||||
$selected = setting("main_subcontractor");
|
||||
foreach($ste AS $s) {
|
||||
?>
|
||||
<option value="{{$s->company_name_en}}" {{$selected == $s->company_name_en ? "selected" : ""}}>{{$s->company_name_en}}</option>
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
{{e2("Cron Job Batch Process Count")}}:
|
||||
<input type="number" name="cron_job_batch_process_count" value="{{setting('cron_job_batch_process_count')}}" class="form-control" id="">
|
||||
<input type="number" name="cron_job_batch_process_count" value="{{setting('cron_job_batch_process_count')}}"
|
||||
class="form-control" id="">
|
||||
{{e2("Cron Job Period Minute")}}:
|
||||
<input type="number" name="cron_job_period" value="{{setting('cron_job_period')}}" class="form-control" id="">
|
||||
{{e2("Repair Table Target Rate %")}}:
|
||||
<input type="number" name="repair_table_target_rate" value="{{setting('repair_table_target_rate')}}" class="form-control" id="">
|
||||
<div class="p-3 my-3 bg-light border rounded">
|
||||
<h5 class="mb-1">{{e2("Backlog Thresholds")}}</h5>
|
||||
<p class="text-muted small mb-3">{{e2("Define the maximum allowed backlog counts for NDT and Repair processes.")}}</p>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{{e2("NDT Backlog Max Limit")}}:
|
||||
<input type="number" name="ndt_limit" value="{{setting('ndt_limit')}}" class="form-control" id="">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{{e2("NDT WDI Scope")}}:
|
||||
<input type="number" name="ndt_wdi" value="{{setting('ndt_wdi')}}" class="form-control" id="">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{{e2("Repair Backlog Max Limit")}}:
|
||||
<input type="number" name="repair_limit" value="{{setting('repair_limit')}}" class="form-control" id="">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{{e2("Repair WDI Scope")}}:
|
||||
<input type="number" name="repair_wdi" value="{{setting('repair_wdi')}}" class="form-control" id="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{e2("Welder Qualitification Status Expired Date")}}:
|
||||
<input type="number" name="WelderQualitificationStatusExpiredDate" value="{{setting('WelderQualitificationStatusExpiredDate')}}" class="form-control" id="">
|
||||
{{e2("Welder Qualitification Status Remaining Days")}}:
|
||||
<input type="number" name="WelderQualitificationStatusRemaningDays" value="{{setting('WelderQualitificationStatusRemaningDays')}}" class="form-control" id="">
|
||||
|
||||
{{e2("NDT Date Validation")}}
|
||||
: <span class="" data-toggle="popover" title="NDT Date Validation Info" data-content="Enables or disables the logical date validation sequence (e.g., VT Date > Welding Date). When active, it prevents entering dates that violate the NDT process order." data-trigger="hover" data-placement="top"><i class="fa fa-question-circle"></i></span>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<select name="ndt_date_validation_active" class="form-control select2">
|
||||
<option value="Active" {{setting('ndt_date_validation_active') == 'Active' ? 'selected' : ''}}>{{e2("Active")}}</option>
|
||||
<option value="Disable" {{setting('ndt_date_validation_active') == 'Disable' ? 'selected' : ''}}>{{e2("Disable")}}</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
{{e2("Gemini API Key")}}:
|
||||
<input type="text" name="gemini_api_key" value="{{setting('gemini_api_key')}}" class="form-control" id="">
|
||||
{{e2("Header Color")}}:
|
||||
<?php
|
||||
$selectedColor = setting('header_color');
|
||||
$colorThemes = [
|
||||
$colorThemes = [
|
||||
// Default Theme
|
||||
'bg-primary-lighter',
|
||||
'bg-primary-light',
|
||||
@@ -198,12 +119,12 @@ if(getisset("update")) {
|
||||
'bg-gd-leaf',
|
||||
'bg-gd-lake',
|
||||
'bg-gd-sun'
|
||||
];
|
||||
];
|
||||
?>
|
||||
<div class="form-group">
|
||||
<select name="header_color" id="header_color_select" class="form-control select2">
|
||||
<option value="">{{e2("Select")}}</option>
|
||||
<?php foreach($colorThemes as $class) { ?>
|
||||
<?php foreach ($colorThemes as $class) { ?>
|
||||
<option value="<?php echo $class; ?>" <?php echo ($selectedColor == $class) ? 'selected' : ''; ?>>
|
||||
<?php echo $class; ?>
|
||||
</option>
|
||||
@@ -213,10 +134,12 @@ if(getisset("update")) {
|
||||
|
||||
<!-- Renk Önizleme -->
|
||||
<div class="row mb-3 p-3">
|
||||
<?php foreach($colorThemes as $class) { ?>
|
||||
<?php foreach ($colorThemes as $class) { ?>
|
||||
<div class="col-md-3 mb-2">
|
||||
<div class="d-flex align-items-center" onclick="selectHeaderColor('<?php echo $class; ?>')" style="cursor: pointer;">
|
||||
<div style="width: 30px; height: 30px; margin-right: 10px;" class="<?php echo $class; ?> border rounded"></div>
|
||||
<div class="d-flex align-items-center" onclick="selectHeaderColor('<?php echo $class; ?>')"
|
||||
style="cursor: pointer;">
|
||||
<div style="width: 30px; height: 30px; margin-right: 10px;"
|
||||
class="<?php echo $class; ?> border rounded"></div>
|
||||
<div>
|
||||
<small><?php echo $class; ?></small>
|
||||
</div>
|
||||
@@ -251,7 +174,7 @@ if(getisset("update")) {
|
||||
}
|
||||
|
||||
// Sayfa yüklendiğinde mevcut rengi uygula
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var currentColor = '<?php echo $selectedColor; ?>';
|
||||
if (currentColor) {
|
||||
selectHeaderColor(currentColor);
|
||||
@@ -265,9 +188,9 @@ if(getisset("update")) {
|
||||
{{e2("DevExpress Theme ")}}:
|
||||
<?php
|
||||
$selectedTheme = setting('DevExpress_Theme');
|
||||
echo $selectedTheme;
|
||||
echo $selectedTheme;
|
||||
|
||||
$themes = explode("\n","dx.light.css
|
||||
$themes = explode("\n", "dx.light.css
|
||||
dx.dark.css
|
||||
dx.carmine.css
|
||||
dx.softblue.css
|
||||
@@ -305,7 +228,7 @@ if(getisset("update")) {
|
||||
dx.material.teal.dark.compact.css");
|
||||
?>
|
||||
<select name="DevExpress_Theme" id="" class="form-control select2">
|
||||
<?php foreach($themes AS $theme) {
|
||||
<?php foreach ($themes as $theme) {
|
||||
$theme = trim($theme);
|
||||
?>
|
||||
<option value="{{$theme}}" {{($theme == $selectedTheme) ? "selected" : ""}}>{{$theme}}</option>
|
||||
@@ -316,7 +239,7 @@ if(getisset("update")) {
|
||||
{{e2("Handover Control Count")}}:
|
||||
<?php $handoverControlCount = setting('handover_control_count', 3); ?>
|
||||
<select name="handover_control_count" class="form-control select2">
|
||||
@for($i=1;$i<=10;$i++)
|
||||
@for($i = 1; $i <= 10; $i++)
|
||||
<option value="{{$i}}" {{$handoverControlCount == $i ? 'selected' : ''}}>{{$i}}</option>
|
||||
@endfor
|
||||
</select>
|
||||
@@ -324,23 +247,23 @@ if(getisset("update")) {
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Prevent multiple form submissions
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Prevent multiple form submissions
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const form = document.querySelector('form[action*="update"]');
|
||||
const submitBtn = document.getElementById('updateSettingsBtn');
|
||||
|
||||
if(form && submitBtn) {
|
||||
form.addEventListener('submit', function(e) {
|
||||
if (form && submitBtn) {
|
||||
form.addEventListener('submit', function (e) {
|
||||
// Disable button and show loading state
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.innerHTML = '<i class="fa fa-spinner fa-spin"></i> ' + '{{e2("Updating...")}}';
|
||||
|
||||
// Re-enable after 5 seconds as a fallback
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
submitBtn.disabled = false;
|
||||
submitBtn.innerHTML = '{{e2("Update")}}';
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -12,21 +12,9 @@ var options = e.editorOptions;
|
||||
if (e.parentType == 'dataRow' && e.editorName == 'dxTextBox') {
|
||||
|
||||
|
||||
if(e.dataField.indexOf("_result") !== -1) {
|
||||
e.editorName = 'dxSelectBox';
|
||||
e.editorOptions.dataSource = <?php echo json_encode_tr(
|
||||
db("results")
|
||||
->get()
|
||||
->pluck("title")
|
||||
->toArray()
|
||||
) ?>;
|
||||
|
||||
} else {
|
||||
options.onValueChanged = function(selectData) {
|
||||
<?php $except = [
|
||||
'languages',
|
||||
'subcontractor',
|
||||
'work-permit-personel-list',
|
||||
]; ?>
|
||||
|
||||
@if(!in_array($id, $except))
|
||||
@@ -35,7 +23,6 @@ if (e.parentType == 'dataRow' && e.editorName == 'dxTextBox') {
|
||||
e.setValue(selectData.value.trim());
|
||||
@endif
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user