Compare commits
7 Commits
master
...
feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| b58f767db1 | |||
| 1a1262c286 | |||
| 97bdb1b7e7 | |||
| cacd817647 | |||
| 58d272bc38 | |||
| 80bbe04541 | |||
| 4c88640ed4 |
@@ -2118,5 +2118,27 @@
|
||||
"flexbox"
|
||||
],
|
||||
"requirePermission": true
|
||||
},
|
||||
"configurazione_linee": {
|
||||
"title": "Configurazione Linee",
|
||||
"pages": "configurazione_linee.php",
|
||||
"position": [],
|
||||
"children": [
|
||||
"ordini_utils",
|
||||
"modal_selezione_articoli",
|
||||
"modal_mrp"
|
||||
],
|
||||
"icon": "icon.png",
|
||||
"libs": [
|
||||
"std-pkg",
|
||||
"dataTables",
|
||||
"charts-graphic",
|
||||
"bootstrap-select",
|
||||
"jquery-dateRangePicker",
|
||||
"select2",
|
||||
"air-datepicker",
|
||||
"tooltip"
|
||||
],
|
||||
"requirePermission": true
|
||||
}
|
||||
}
|
||||
@@ -177,5 +177,21 @@
|
||||
"usergroups": [
|
||||
"2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "configurazione_linee",
|
||||
"group": "Produzione",
|
||||
"usergroups": [
|
||||
"2",
|
||||
"5",
|
||||
"11",
|
||||
"12",
|
||||
"9"
|
||||
],
|
||||
"users": [
|
||||
"PRODSECCO",
|
||||
"MAGAFORNO",
|
||||
"CMONOPOLI"
|
||||
]
|
||||
}
|
||||
]
|
||||
33
public_html/configurazione_linee.php
Normal file
33
public_html/configurazione_linee.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
session_start();
|
||||
include "functions.php";
|
||||
require_once "include_login.php";
|
||||
include "config.php";
|
||||
include "include/module.php";
|
||||
|
||||
include Controller::current_mainClasspath();
|
||||
include Controller::current_gestpath_include("ajax.php");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<!--html manifest="manifest.appcache"-->
|
||||
<html>
|
||||
<head>
|
||||
<?php include pvm_tagHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php include pvm_headerNavbar; ?>
|
||||
<div id="content">
|
||||
<div>
|
||||
<?php
|
||||
include pvm_navTab;
|
||||
if (!PVM\CurrentModule::isAuthorizedToCurrentUser()) {
|
||||
include pvm_unauthorized;
|
||||
} else {
|
||||
include Controller::current_gestpath_mainPage();
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include pvm_footerMinimal; ?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class ConfigurazioneLinee {
|
||||
public static function _moduleDatasource($filter) {
|
||||
$Ret = new Ret;
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
$retData = array(
|
||||
array("id" => "name", "data" => array()),
|
||||
);
|
||||
|
||||
$Ret->set_data($retData);
|
||||
}
|
||||
|
||||
return $Ret;
|
||||
}
|
||||
}
|
||||
1
public_html/gest-lib/configurazione_linee/css/main.css
Normal file
1
public_html/gest-lib/configurazione_linee/css/main.css
Normal file
@@ -0,0 +1 @@
|
||||
.sideNav{font-weight:bold;height:100%;position:fixed;z-index:1;top:0;left:0;background-color:#333;padding-top:60px;padding-bottom:40px;overflow-x:hidden}.sideNav>.nav-stacked>li+li{margin-top:0}input.value{height:34px}/*# sourceMappingURL=main.css.map */
|
||||
BIN
public_html/gest-lib/configurazione_linee/icon.png
Normal file
BIN
public_html/gest-lib/configurazione_linee/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
if (isset($_GET["popupOfferta"])) {
|
||||
$data = Utility::sanitizeB64JSON_parse($_GET["popupOfferta"]);
|
||||
include "popup-offerta.php";
|
||||
} else if (Controller::is_ajaxRequest()) {
|
||||
$Ret = new Ret;
|
||||
$Ret->set_errorCode(ErrorHandler::UNEXPECTED_AJAX_METHOD)->display();
|
||||
}
|
||||
96
public_html/gest-lib/configurazione_linee/include/main.php
Normal file
96
public_html/gest-lib/configurazione_linee/include/main.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
Utility::includeResourceModule("main.js", "impostazioni");
|
||||
|
||||
$ret = MonitoraggioLineeV2::get_listLinee();
|
||||
if ($ret->is_OK()) {
|
||||
$arr_linee = $ret->get_data();
|
||||
|
||||
if (count($arr_linee) > 0) {
|
||||
$codJfas = isset($_GET["linea"]) ? $_GET["linea"] : null;
|
||||
$lineaItem = empty($codJfas) ? $arr_linee : array_filter($arr_linee, function ($item) use ($codJfas) {
|
||||
return $item["cod_jfas"] == $codJfas;
|
||||
});
|
||||
$lineaItem = reset($lineaItem);
|
||||
$codJfas = $lineaItem["cod_jfas"];
|
||||
$descrizione = $lineaItem["descrizione"];
|
||||
?>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-1 sideNav noprint">
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<?php foreach ($arr_linee as $linea) { ?>
|
||||
<li class="<?= $linea["cod_jfas"] == $codJfas ? "active" : "" ?>"
|
||||
title="<?= $linea["descrizione"] ?>" data-toggle="tooltip" data-placement="right">
|
||||
<a href="<?= $_SERVER["PHP_SELF"] . "?linea={$linea["cod_jfas"]}" ?>"
|
||||
data-descr_linea="<?= $linea["cod_jfas"] ?>">
|
||||
<span><?= $linea["cod_jfas"] ?></span>
|
||||
<?php if ($linea["is_auto"]) { ?>
|
||||
<span class="label label-danger pull-right">A</span>
|
||||
<?php } else if (is_array($linea) && is_array($linea["settings"]) && array_key_exists("lineaType", $linea["settings"]) && $linea["settings"]["lineaType"] === "M") { ?>
|
||||
<span class="label label-success pull-right">M</span>
|
||||
<?php } ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-1 noprint"></div>
|
||||
<div class="col-xs-11">
|
||||
<ul class="nav nav-tabs nav-justified noprint">
|
||||
<li id="pillAnagraficaMacchinari" class="active" role="presentation">
|
||||
<a data-toggle="pill" href="#tab-anagraficaMacchinari">Anagrafica Macchinari</a>
|
||||
</li>
|
||||
<li id="pillImpostazioniGenerali" role="presentation">
|
||||
<a data-toggle="pill" href="#tab-impostazioniGenerali">Impostazioni generali</a>
|
||||
</li>
|
||||
<li id="pillImpostazioniMes" role="presentation">
|
||||
<a data-toggle="pill" href="#tab-impostazioniMes">Impostazioni MES</a>
|
||||
</li>
|
||||
<li id="pillMagazziniDiProssimita" role="presentation">
|
||||
<a data-toggle="pill" href="#tab-magazziniDiProssimita">Magazzini di prossimità</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content pt-20">
|
||||
<div id="tab-anagraficaMacchinari" class="tab-pane fade in active">
|
||||
</div>
|
||||
<div id="tab-impostazioniGenerali" class="tab-pane fade in">
|
||||
<table class="table table-striped table-hover table-text-middle mt-10 tableGestSetups">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 25%">Proprietà</th>
|
||||
<th style="width: 50%">Valore</th>
|
||||
<th style="min-width: 130px; width: 25%"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-impostazioniMes" class="tab-pane fade in">
|
||||
<table class="table table-striped table-hover table-text-middle mt-10 tableGestSetups">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 25%">Proprietà</th>
|
||||
<th style="width: 50%">Valore</th>
|
||||
<th style="min-width: 130px; width: 25%"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tab-magazziniDiProssimita" class="tab-pane fade in">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
$Alert = new BC\Alert;
|
||||
$Alert->warning("Nessuna linea di produzione disponibile");
|
||||
}
|
||||
} else {
|
||||
$ret->showErrorAlert();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
$Ret = new Ret;
|
||||
|
||||
if ($Ret->is_OK()) {
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<?php
|
||||
$html = Utility\Str::remove_multiple_spaces(ob_get_clean());
|
||||
$Ret->set_string($html);
|
||||
}
|
||||
|
||||
$Ret->display();
|
||||
81
public_html/gest-lib/configurazione_linee/js/main.js
Normal file
81
public_html/gest-lib/configurazione_linee/js/main.js
Normal file
@@ -0,0 +1,81 @@
|
||||
$(function () {
|
||||
_configurazioneLinee.init();
|
||||
});
|
||||
|
||||
const _configurazioneLinee = {
|
||||
module: undefined,
|
||||
codJfas: null,
|
||||
|
||||
init() {
|
||||
const self = this;
|
||||
|
||||
if (isset_urlParameter("linea")) {
|
||||
self.codJfas = get_urlParameter("linea");
|
||||
}
|
||||
|
||||
self.module = new Module();
|
||||
self.module
|
||||
.onLoad(function () {
|
||||
$("#pillImpostazioniGenerali").on("click", function () {
|
||||
const array = [{
|
||||
"gest_name": "MES",
|
||||
"section": "SETUP",
|
||||
"stb_gest_setup_det": "jtb_fasi",
|
||||
"cod_jfas": self.codJfas,
|
||||
}, {
|
||||
"gest_name": "PVM",
|
||||
"section": "MONITORAGGIO_LINEE_V2",
|
||||
"stb_gest_setup_det": "jtb_fasi",
|
||||
"cod_jfas": self.codJfas,
|
||||
}]
|
||||
|
||||
_configurazioneLinee.getMultipleGestSetups(array, "tab-impostazioniGenerali");
|
||||
});
|
||||
|
||||
$("#pillImpostazioniMes").on("click", function () {
|
||||
_configurazioneLinee.getGestSetups("PVM", "MONITORAGGIO_LINEE_V2", "tab-impostazioniMes");
|
||||
});
|
||||
|
||||
$("li.active").trigger("click");
|
||||
})
|
||||
.load();
|
||||
},
|
||||
|
||||
getMultipleGestSetups(setupsArray, idTabPane) {
|
||||
const $tabPane = $("#" + idTabPane);
|
||||
const gestSetups = [];
|
||||
|
||||
if (!$tabPane.hasClass("tabLoaded")) {
|
||||
_.each(setupsArray, async function (key) {
|
||||
const setups = await _configurazioneLinee.getGestSetups(key);
|
||||
gestSetups.push(setups);
|
||||
|
||||
console.log(setups);
|
||||
console.log(key);
|
||||
_.each(setups, function (gestSetup) {
|
||||
_impostazioni.buildGestSetup(gestSetup, key, $tabPane);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$tabPane.addClass("tabLoaded");
|
||||
|
||||
// _.each(gestSetups, function (gestSetup) {
|
||||
// _impostazioni.buildGestSetup(gestSetup, key, $tabPane)
|
||||
// });
|
||||
},
|
||||
|
||||
async getGestSetups(key) {
|
||||
const ret = await new Ajax()
|
||||
.post("getGestSetups")
|
||||
.data(key)
|
||||
.noticeAsModal()
|
||||
.module("impostazioni")
|
||||
.waitModal()
|
||||
.onSuccess(function (ret) {
|
||||
return ret.returnData;
|
||||
}).execute();
|
||||
|
||||
return ret.returnData;
|
||||
},
|
||||
};
|
||||
20
public_html/gest-lib/configurazione_linee/scss/main.scss
Normal file
20
public_html/gest-lib/configurazione_linee/scss/main.scss
Normal file
@@ -0,0 +1,20 @@
|
||||
.sideNav {
|
||||
font-weight: bold;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #333;
|
||||
padding-top: 60px;
|
||||
padding-bottom: 40px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.sideNav > .nav-stacked > li + li {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
input.value {
|
||||
height: 34px;
|
||||
}
|
||||
@@ -1091,11 +1091,14 @@ class DeliveryPlan {
|
||||
return $Ret;
|
||||
}
|
||||
$arr_ordini = $Ret->get_data();
|
||||
|
||||
if (!empty($arr_ordini)) {
|
||||
$Ret = self::completeDatiOrdini($arr_ordini, $day, $flagDataConsDaDoc);
|
||||
|
||||
if ($Ret->is_KO()) {
|
||||
return $Ret;
|
||||
}
|
||||
|
||||
$arr_ordini = $Ret->get_data();
|
||||
}
|
||||
|
||||
|
||||
@@ -626,18 +626,22 @@ class Impostazioni {
|
||||
public static function getGestSetups($data) {
|
||||
$gestName = $data["gest_name"];
|
||||
$section = $data["section"];
|
||||
$codJfas = array_get($data, "cod_jfas");
|
||||
$stbGestSetupDet = array_get($data, "stb_gest_setup_det");
|
||||
|
||||
$query = new Query;
|
||||
$query->importSqlFile("getGestSetups");
|
||||
$query->importSqlFile("getGestSetups")
|
||||
->where("gest_name", $gestName)
|
||||
->where("section", $section);
|
||||
|
||||
if (!self::is_administrator()) {
|
||||
$query->where("flag_user_view", "S");
|
||||
}
|
||||
|
||||
$ret = $query
|
||||
->where("gest_name", $gestName)
|
||||
->where("section", $section)
|
||||
->toRet()->execute();
|
||||
$query->setVar("cod_jfas", $codJfas . "%");
|
||||
$query->setVar("tipo_setup", $stbGestSetupDet);
|
||||
|
||||
$ret = $query->toRet()->execute();
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ const _impostazioni = {
|
||||
|
||||
$(".panel[data-section]").enableAll();
|
||||
|
||||
self.module = new Module();
|
||||
self.module = new Module("impostazioni");
|
||||
self.module.onLoad(async function () {
|
||||
self.initSearch();
|
||||
|
||||
@@ -211,6 +211,7 @@ const _impostazioni = {
|
||||
.$button($gestSetup.find(".btEditProp"))
|
||||
.$toDisable($gestSetup)
|
||||
.noticeAsModal()
|
||||
.module("impostazioni")
|
||||
.onSuccess(function (ret) {
|
||||
const propData = ret.returnData;
|
||||
const modalBox = new ModalBox();
|
||||
|
||||
@@ -6,6 +6,10 @@ input.hasDatepicker {
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
input.value {
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.panel.collapsed {
|
||||
.bt_addKeySection {
|
||||
display: none;
|
||||
|
||||
@@ -23,5 +23,6 @@ SELECT DISTINCT stb_gest_setup.gest_name,
|
||||
FROM stb_gest_setup
|
||||
LEFT OUTER JOIN stb_gest_setup_query
|
||||
ON stb_gest_setup.query_default = stb_gest_setup_query.cod_query
|
||||
WHERE 1 = 1
|
||||
WHERE (('[tipo_setup]' IS NULL OR tipo_setup = '[tipo_setup]')
|
||||
OR ('[cod_jfas]' IS NULL OR key_section LIKE '[cod_jfas]%'))
|
||||
ORDER BY section, key_section
|
||||
Reference in New Issue
Block a user