FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openstamanager/controller.php at master · devcode-it/openstamanager · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
devcode-it
/
openstamanager
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
86
Star
148
Code
Issues
180
Pull requests
30
Actions
Projects
Security and quality
18
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openstamanager
/
controller.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
147 lines (119 loc) · 4.65 KB
Breadcrumbs
openstamanager
/
controller.php
Copy path
File metadata and controls
executable file
·
147 lines (119 loc) · 4.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.r.l.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use
Models
\
Plugin
;
include_once
__DIR__
.
'
/core.php
'
;
if
(!
empty
(
$
id_record
) && !
empty
(
$
id_module
)) {
redirect_url
(
base_path_osm
().
'
/editor.php?id_module=
'
.
$
id_module
.
'
&id_record=
'
.
$
id_record
);
}
elseif
(
empty
(
$
id_module
)) {
redirect_url
(
base_path_osm
().
'
/index.php
'
);
}
include_once
App::
filepath
(
'
include|custom|
'
,
'
top.php
'
);
// Inclusione gli elementi fondamentali
include_once
base_dir
().
'
/actions.php
'
;
// Widget in alto
echo
'
{( "name": "widgets", "id_module": "
'
.
prepareToField
(
$
id_module
).
'
", "position": "top", "place": "controller" )}
'
;
// Recupera gli id dei segmenti tramite Eloquent per evitare query raw
$
segmenti
= \
Modules
\
Segmenti
\Segmento::
where
(
'
id_module
'
,
$
id_module
)->
pluck
(
'
id
'
)->
toArray
();
if
(!
empty
(
$
segmenti
)) {
$
segmenti
= Modules::
getSegments
(
$
id_module
);
if
(
empty
(
$
segmenti
)) {
echo
'
<div class="alert alert-warning">
<i class="fa fa-warning-circle"></i>
'
.
tr
(
'
Questo gruppo di utenti non ha i permessi per visualizzare nessun segmento di questo modulo
'
).
'
.
</div>
'
;
}
}
// Lettura eventuali plugins modulo da inserire come tab
echo
'
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>
<i class="
'
.
$
structure
[
'
icon
'
].
'
"></i>
'
.
$
structure
->
getTranslation
(
'
title
'
);
// Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup
if
(
$
structure
->
hasAddFile
() &&
$
structure
->
permission
==
'
rw
'
) {
echo
'
<button type="button" class="btn btn-primary" data-widget="modal" data-title="
'
.
tr
(
'
Aggiungi
'
).
'
..." data-href="add.php?id_module=
'
.
$
id_module
.
'
&id_plugin=
'
.
$
id_plugin
.
'
"><i class="fa fa-plus"></i></button>
'
;
}
// Pulsante per il tour guidato (se esiste il file tour nel modulo)
$
guide_file
=
base_dir
().
'
/modules/
'
.
$
structure
->
directory
.
'
/js/
'
.
$
structure
->
directory
.
'
-guide.js
'
;
if
(
file_exists
(
$
guide_file
)) {
$
guide_function
=
'
show
'
.
ucfirst
(
$
structure
->
directory
).
'
Guide()
'
;
echo
'
<button type="button" class="btn btn-info btn-md" onclick="
'
.
$
guide_function
.
'
" title="Avvia tour guidato">
<i class="fa fa-question-circle"></i>
</button>
'
;
}
echo
'
</h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="
'
.
$
rootdir
.
'
/">Home</a></li>
<li class="breadcrumb-item active">
'
.
$
structure
->
getTranslation
(
'
title
'
).
'
</li>
</ol>
</div>
</div>
</div>
</section>
<div class="tab-content">
<div id="tab_0" class="tab-pane active">
'
;
include
base_dir
().
'
/include/manager.php
'
;
echo
'
</div>
'
;
// Plugins
$
plugins
= Plugin::
where
(
'
id_module_to
'
,
$
id_module
)->
where
(
'
position
'
,
'
tab_main
'
)->
where
(
'
enabled
'
,
1
)->
get
();
$
record
=
$
record
?? [];
$
module_record
=
$
record
;
foreach
(
$
plugins
as
$
plugin
) {
$
record
=
$
module_record
;
echo
'
<div id="tab_
'
.
$
plugin
->
id
.
'
" class="tab-pane">
'
;
$
id_plugin
=
$
plugin
->
id
;
include
base_dir
().
'
/include/manager.php
'
;
echo
'
</div>
'
;
}
$
record
=
$
module_record
;
redirectOperation
(
$
id_module
, !
empty
(
$
id_parent
) ?
$
id_parent
:
$
id_record
);
// Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore)
if
(
$
user
->
is_admin
&&
string_contains
(
$
module
[
'
option
'
],
'
|select|
'
)) {
echo
'
<br>
<div class="row">
<div class="col-md-12 text-right">
<a class="btn btn-xs btn-default " style="margin-top: -1.25rem;" onclick="modificaColonne(this)">
<i class="fa fa-th-list"></i>
'
.
tr
(
'
Modifica colonne
'
).
'
</a>
</div>
</div>
<div class="clearfix" >
</div>
<script>
function modificaColonne(button) {
openModal("
'
.
tr
(
'
Modifica colonne
'
).
'
", globals.rootdir + "/actions.php?id_module=" + globals.id_module + "&op=aggiorna_colonne")
}
</script>
'
;
}
echo
'
</div>
'
;
// Widget in basso
echo
'
{( "name": "widgets", "id_module": "
'
.
$
id_module
.
'
", "position": "right", "place": "controller" )}
'
;
include_once
App::
filepath
(
'
include|custom|
'
,
'
bottom.php
'
);
Back
|
FazBrowse Home
|
New Git URL