|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* Copyright (C) 2021 Joe Nilson <[email protected]> |
|
4
|
|
|
* |
|
5
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
6
|
|
|
* it under the terms of the GNU Lesser General Public License as |
|
7
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
8
|
|
|
* License, or (at your option) any later version. |
|
9
|
|
|
* |
|
10
|
|
|
* This program is distributed in the hope that it will be useful, |
|
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13
|
|
|
* GNU Lesser General Public License for more details. |
|
14
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
|
15
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16
|
|
|
*/ |
|
17
|
|
|
require_once 'plugins/residentes/extras/residentes_controller.php'; |
|
18
|
|
|
|
|
19
|
|
|
class seguridad_documentos extends residentes_controller |
|
20
|
|
|
{ |
|
21
|
|
|
public function __construct() |
|
22
|
|
|
{ |
|
23
|
|
|
parent::__construct(__CLASS__, 'Seguridad Documentos', 'admin', true, false, false); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
protected function private_core() |
|
27
|
|
|
{ |
|
28
|
|
|
$this->shared_extensions(); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
private function shared_extensions() |
|
32
|
|
|
{ |
|
33
|
|
|
$extensiones = array( |
|
34
|
|
|
array( |
|
35
|
|
|
'name' => '001_seguridad_doc_venta_js', |
|
36
|
|
|
'page_from' => __CLASS__, |
|
37
|
|
|
'page_to' => 'ventas_factura', |
|
38
|
|
|
'type' => 'head', |
|
39
|
|
|
'text' => '<script src="'.FS_PATH.'plugins/residentes/view/js/seguridad_documentos.js?cod='. |
|
|
|
|
|
|
40
|
|
|
rand(1000,10000).'" type="text/javascript"></script>', |
|
41
|
|
|
'params' => '' |
|
42
|
|
|
), |
|
43
|
|
|
array( |
|
44
|
|
|
'name' => '002_seguridad_doc_compra_js', |
|
45
|
|
|
'page_from' => __CLASS__, |
|
46
|
|
|
'page_to' => 'compras_factura', |
|
47
|
|
|
'type' => 'head', |
|
48
|
|
|
'text' => '<script src="'.FS_PATH.'plugins/residentes/view/js/seguridad_documentos.js?cod='. |
|
49
|
|
|
rand(1000,10000).'" type="text/javascript"></script>', |
|
50
|
|
|
'params' => '' |
|
51
|
|
|
), |
|
52
|
|
|
); |
|
53
|
|
|
|
|
54
|
|
|
foreach($extensiones as $del){ |
|
55
|
|
|
$fext = new fs_extension($del); |
|
56
|
|
|
if(!$fext->save()){ |
|
57
|
|
|
$this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
|
|
|
|
|
58
|
|
|
} |
|
59
|
|
|
} |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
} |