|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* Qui Bundle */ |
|
4
|
|
|
//namespace Fi\DemoBundle\Controller; |
|
5
|
|
|
|
|
6
|
|
|
namespace Fi\CoreBundle\Controller; |
|
7
|
|
|
|
|
8
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* OpzioniTabella controller. |
|
12
|
|
|
*/ |
|
13
|
|
|
class OpzioniTabellaController extends FiCoreController |
|
14
|
|
|
{ |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Lists all opzioniTabella entities. |
|
18
|
|
|
*/ |
|
19
|
|
|
public function indexAction(Request $request) |
|
20
|
|
|
{ |
|
21
|
|
|
/* @var $em \Doctrine\ORM\EntityManager */ |
|
22
|
|
|
$this->setup($request); |
|
23
|
|
|
$namespace = $this->getNamespace(); |
|
|
|
|
|
|
24
|
|
|
$bundle = $this->getBundle(); |
|
|
|
|
|
|
25
|
|
|
$controller = $this->getController(); |
|
26
|
|
|
$container = $this->container; |
|
|
|
|
|
|
27
|
|
|
|
|
28
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
|
29
|
|
|
|
|
30
|
|
|
$dettaglij = array( |
|
31
|
|
|
'descrizione' => array( |
|
32
|
|
|
array( |
|
33
|
|
|
'nomecampo' => 'descrizione', |
|
34
|
|
|
'lunghezza' => '400', |
|
35
|
|
|
'descrizione' => 'Descrizione', |
|
36
|
|
|
'tipo' => 'text',),), |
|
37
|
|
|
'parametro' => array( |
|
38
|
|
|
array( |
|
39
|
|
|
'nomecampo' => 'parametro', |
|
40
|
|
|
'lunghezza' => '300', |
|
41
|
|
|
'descrizione' => 'Parametro', |
|
42
|
|
|
'tipo' => 'text',),), |
|
43
|
|
|
'valore' => array( |
|
44
|
|
|
array( |
|
45
|
|
|
'nomecampo' => 'valore', |
|
46
|
|
|
'lunghezza' => '300', |
|
47
|
|
|
'descrizione' => 'Valore', |
|
48
|
|
|
'tipo' => 'text',),), |
|
49
|
|
|
'tabelle_id' => array( |
|
50
|
|
|
array( |
|
51
|
|
|
'nomecampo' => 'tabelle.nometabella', |
|
52
|
|
|
'lunghezza' => '400', |
|
53
|
|
|
'descrizione' => 'Tabella', |
|
54
|
|
|
'tipo' => 'text',), |
|
55
|
|
|
), |
|
56
|
|
|
); |
|
57
|
|
|
|
|
58
|
|
|
$escludi = array(); |
|
|
|
|
|
|
59
|
|
|
$paricevuti = array( |
|
60
|
|
|
'nomebundle' => $nomebundle, |
|
61
|
|
|
'nometabella' => $controller, |
|
62
|
|
|
'dettaglij' => $dettaglij, |
|
63
|
|
|
'escludere' => $escludi, |
|
64
|
|
|
'container' => $container, |
|
65
|
|
|
); |
|
66
|
|
|
|
|
67
|
|
|
$testatagriglia = Griglia::testataPerGriglia($paricevuti); |
|
68
|
|
|
|
|
69
|
|
|
$testatagriglia['multisearch'] = 1; |
|
70
|
|
|
$testatagriglia['showconfig'] = 1; |
|
|
|
|
|
|
71
|
|
|
$testatagriglia['showadd'] = 1; |
|
|
|
|
|
|
72
|
|
|
$testatagriglia['showedit'] = 1; |
|
|
|
|
|
|
73
|
|
|
$testatagriglia['showdel'] = 1; |
|
|
|
|
|
|
74
|
|
|
$testatagriglia['editinline'] = 0; |
|
|
|
|
|
|
75
|
|
|
|
|
76
|
|
|
$testatagriglia['parametritesta'] = json_encode($paricevuti); |
|
77
|
|
|
$this->setParametriGriglia(array('request' => $request)); |
|
78
|
|
|
$testatagriglia['parametrigriglia'] = json_encode(self::$parametrigriglia); |
|
79
|
|
|
|
|
80
|
|
|
$testata = json_encode($testatagriglia); |
|
|
|
|
|
|
81
|
|
|
$twigparms = array( |
|
82
|
|
|
'nomecontroller' => $controller, |
|
83
|
|
|
'testata' => $testata, |
|
84
|
|
|
); |
|
85
|
|
|
|
|
86
|
|
|
return $this->render($nomebundle . ':' . $controller . ':index.html.twig', $twigparms); |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function setParametriGriglia($prepar = array()) |
|
90
|
|
|
{ |
|
91
|
|
|
$this->setup($prepar['request']); |
|
92
|
|
|
$namespace = $this->getNamespace(); |
|
|
|
|
|
|
93
|
|
|
$bundle = $this->getBundle(); |
|
|
|
|
|
|
94
|
|
|
$controller = $this->getController(); |
|
95
|
|
|
|
|
96
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
|
|
|
|
|
|
97
|
|
|
$escludi = array(); |
|
|
|
|
|
|
98
|
|
|
$tabellej = array(); |
|
|
|
|
|
|
99
|
|
|
$tabellej['tabelle_id'] = array('tabella' => 'tabelle', 'campi' => array('nometabella')); |
|
100
|
|
|
|
|
101
|
|
|
$paricevuti = array( |
|
102
|
|
|
'container' => $this->container, |
|
103
|
|
|
'nomebundle' => $nomebundle, |
|
104
|
|
|
'tabellej' => $tabellej, |
|
105
|
|
|
'nometabella' => $controller, |
|
106
|
|
|
'escludere' => $escludi,); |
|
107
|
|
|
|
|
108
|
|
|
if (! empty($prepar)) { |
|
109
|
|
|
$paricevuti = array_merge($paricevuti, $prepar); |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
self::$parametrigriglia = $paricevuti; |
|
113
|
|
|
} |
|
114
|
|
|
} |
|
115
|
|
|
|
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.