Skip to content

Commit 1e4f4db

Browse files
author
magnussolution
committed
Brasil CNL
1 parent 29dd2f1 commit 1e4f4db

23 files changed

+462
-13
lines changed

app/model/ProviderCNL.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* Classe que define a model "ProviderCNL"
3+
*
4+
* =======================================
5+
* ###################################
6+
* MagnusBilling
7+
*
8+
* @package MagnusBilling
9+
* @author Adilson Leffa Magnus.
10+
* @copyright Copyright (C) 2005 - 2021 MagnusBilling. All rights reserved.
11+
* ###################################
12+
*
13+
* This software is released under the terms of the GNU Lesser General Public License v3
14+
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
15+
*
16+
* Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues
17+
* =======================================
18+
* Magnusbilling.com <[email protected]>
19+
* 16/07/2012
20+
*/
21+
Ext.define('MBilling.model.ProviderCNL', {
22+
extend: 'Ext.data.Model',
23+
fields: [{
24+
name: 'id',
25+
type: 'int'
26+
}, {
27+
name: 'id_provider',
28+
type: 'int'
29+
}, {
30+
name: 'cnl',
31+
type: 'int'
32+
}, {
33+
name: 'zone',
34+
type: 'string'
35+
}, {
36+
name: 'id_provider',
37+
type: 'int'
38+
}, 'idProviderprovider_name'],
39+
proxy: {
40+
type: 'uxproxy',
41+
module: 'providerCNL'
42+
}
43+
});

app/model/Sip.js

+3
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ Ext.define('MBilling.model.Sip', {
225225
}, {
226226
name: 'amd',
227227
type: 'int'
228+
}, {
229+
name: 'cnl',
230+
type: 'string'
228231
}, {
229232
name: 'id_trunk_group',
230233
type: 'int'

app/model/Trunk.js

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ Ext.define('MBilling.model.Trunk', {
135135
}, {
136136
name: 'sendrpid',
137137
type: 'string'
138+
}, {
139+
name: 'cnl',
140+
type: 'int'
138141
}],
139142
proxy: {
140143
type: 'uxproxy',

app/store/ProviderCNL.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Classe que define o store "ProviderCNL"
3+
*
4+
* =======================================
5+
* ###################################
6+
* MagnusBilling
7+
*
8+
* @package MagnusBilling
9+
* @author Adilson Leffa Magnus.
10+
* @copyright Copyright (C) 2005 - 2021 MagnusBilling. All rights reserved.
11+
* ###################################
12+
*
13+
* This software is released under the terms of the GNU Lesser General Public License v3
14+
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
15+
*
16+
* Please submit bug reports, patches, etc to https://github.com/magnusbilling/mbilling/issues
17+
* =======================================
18+
* Magnusbilling.com <[email protected]>
19+
* 25/06/2012
20+
*/
21+
Ext.define('MBilling.store.ProviderCNL', {
22+
extend: 'Ext.data.Store',
23+
model: 'MBilling.model.ProviderCNL'
24+
});

build/MagnusBilling-current.tar.gz

5.77 KB
Binary file not shown.

classic/src/Application.js

+2-2
Large diffs are not rendered by default.
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Classe que define a lista de "CallShopCdr"
3+
*
4+
* =======================================
5+
* ###################################
6+
* MagnusBilling
7+
*
8+
* @package MagnusBilling
9+
* @author Adilson Leffa Magnus.
10+
* @copyright Copyright (C) 2005 - 2021 MagnusBilling. All rights reserved.
11+
* ###################################
12+
*
13+
* This software is released under the terms of the GNU Lesser General Public License v3
14+
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
15+
*
16+
* Please submit bug reports, patches, etc to https://github.com/magnussolution/magnusbilling7/issues
17+
* =======================================
18+
* Magnusbilling.org <[email protected]>
19+
* 01/10/2013
20+
*/
21+
Ext.define('MBilling.view.providerCNL.Controller', {
22+
extend: 'Ext.ux.app.ViewController',
23+
alias: 'controller.providercnl'
24+
});

classic/src/view/providerCNL/Form.js

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Classe que define o form de "Admin"
3+
*
4+
* =======================================
5+
* ###################################
6+
* MagnusBilling
7+
*
8+
* @package MagnusBilling
9+
* @author Adilson Leffa Magnus.
10+
* @copyright Copyright (C) 2005 - 2021 MagnusBilling. All rights reserved.
11+
* ###################################
12+
*
13+
* This software is released under the terms of the GNU Lesser General Public License v3
14+
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
15+
*
16+
* Please submit bug reports, patches, etc to https://github.com/magnussolution/magnusbilling7/issues
17+
* =======================================
18+
* Magnusbilling.org <[email protected]>
19+
* 25/06/2012
20+
*/
21+
Ext.define('MBilling.view.providerCNL.Form', {
22+
extend: 'Ext.ux.form.Panel',
23+
alias: 'widget.providercnlform',
24+
initComponent: function() {
25+
var me = this;
26+
me.items = [{
27+
xtype: 'providerlookup',
28+
ownerForm: me,
29+
name: 'id_provider',
30+
fieldLabel: t('Provider')
31+
}, {
32+
name: 'cnl',
33+
fieldLabel: t('CNL')
34+
}, {
35+
name: 'zone',
36+
fieldLabel: t('Zone')
37+
}];
38+
me.callParent(arguments);
39+
}
40+
});
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Classe que define a window import csv de "Rate"
3+
*
4+
* =======================================
5+
* ###################################
6+
* MagnusBilling
7+
*
8+
* @package MagnusBilling
9+
* @author Adilson Leffa Magnus.
10+
* @copyright Todos os direitos reservados.
11+
* ###################################
12+
* =======================================
13+
* MagnusSolution.com <[email protected]>
14+
* 08/11/2012
15+
*/
16+
Ext.define('MBilling.view.providerCNL.ImportCsv', {
17+
extend: 'Ext.ux.window.ImportCsv',
18+
alias: 'widget.providercnlimportcsv',
19+
htmlTipInfo: '<br>cnl,zone<br>' + "11098, CVA<br>" + "11123, CVA</b>",
20+
fieldsImport: [{
21+
xtype: 'providercombo',
22+
width: 350
23+
}]
24+
});

classic/src/view/providerCNL/List.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* Classe que define a lista de "Provider"
3+
*
4+
* =======================================
5+
* ###################################
6+
* MagnusBilling
7+
*
8+
* @package MagnusBilling
9+
* @author Adilson Leffa Magnus.
10+
* @copyright Copyright (C) 2005 - 2021 MagnusBilling. All rights reserved.
11+
* ###################################
12+
*
13+
* This software is released under the terms of the GNU Lesser General Public License v3
14+
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
15+
*
16+
* Please submit bug reports, patches, etc to https://github.com/magnussolution/magnusbilling7/issues
17+
* =======================================
18+
* Magnusbilling.org <[email protected]>
19+
* 25/06/2012
20+
*/
21+
Ext.define('MBilling.view.providerCNL.List', {
22+
extend: 'Ext.ux.grid.Panel',
23+
alias: 'widget.providercnllist',
24+
store: 'ProviderCNL',
25+
buttonImportCsv: true,
26+
buttonUpdateLot: false,
27+
initComponent: function() {
28+
var me = this;
29+
me.columns = me.columns || [{
30+
header: t('ID'),
31+
dataIndex: 'id',
32+
flex: 1,
33+
hidden: true,
34+
hideable: App.user.isAdmin
35+
}, {
36+
xtype: 'templatecolumn',
37+
tpl: '{idProviderprovider_name}',
38+
header: t('Provider'),
39+
dataIndex: 'id_provider',
40+
comboFilter: 'providercombo',
41+
flex: 2
42+
}, {
43+
header: t('CNL'),
44+
dataIndex: 'cnl',
45+
flex: 2
46+
}, {
47+
header: t('Zone'),
48+
dataIndex: 'zone',
49+
flex: 2
50+
}];
51+
me.callParent(arguments);
52+
}
53+
});
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Classe que define o panel de "Provider"
3+
*
4+
* MagnusSolution.com <[email protected]>
5+
* 18/04/2012
6+
*/
7+
Ext.define('MBilling.view.providerCNL.Module', {
8+
extend: 'Ext.ux.panel.Module',
9+
alias: 'widget.providercnlmodule',
10+
controller: 'providercnl'
11+
});

classic/src/view/sip/Form.js

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ Ext.define('MBilling.view.sip.Form', {
193193
hidden: !App.user.isAdmin,
194194
allowBlank: true,
195195
maxLength: 6
196+
}, {
197+
name: 'cnl',
198+
fieldLabel: t('CNL zone'),
199+
allowBlank: true,
200+
hidden: !App.user.isAdmin || App.user.language != 'pt_BR'
196201
}, {
197202
xtype: 'textareafield',
198203
allowBlank: true,

classic/src/view/sip/List.js

+12
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ Ext.define('MBilling.view.sip.List', {
154154
flex: 3,
155155
hidden: true,
156156
hideable: App.user.isAdmin
157+
}, {
158+
header: t('Alias'),
159+
dataIndex: 'alias',
160+
hidden: true,
161+
hideable: App.user.isAdmin,
162+
flex: 2
163+
}, {
164+
header: t('CNL zone'),
165+
dataIndex: 'cnl',
166+
hidden: true,
167+
hideable: App.user.isAdmin && App.user.language == 'pt_BR',
168+
flex: 2
157169
}, {
158170
header: t('AMD'),
159171
dataIndex: 'amd',

classic/src/view/trunk/Form.js

+5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ Ext.define('MBilling.view.trunk.Form', {
153153
fieldLabel: t('Register string'),
154154
allowBlank: true,
155155
hidden: true
156+
}, {
157+
xtype: 'noyescombo',
158+
name: 'cnl',
159+
fieldLabel: t('Enable CNL'),
160+
hidden: App.user.language != 'pt_BR'
156161
}]
157162
}, {
158163
title: t('Supplementary info'),

classic/src/view/user/Lookup.js

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ Ext.define('MBilling.view.user.Lookup', {
2525
}, {
2626
header: t('Last name'),
2727
dataIndex: 'lastname',
28+
hidden: window.isTablet,
29+
flex: 2
30+
}, {
31+
header: t('First name'),
32+
dataIndex: 'firstname',
33+
hidden: window.isTablet,
2834
flex: 2
2935
}, {
3036
header: t('Credit'),

protected/commands/UpdateMysqlCommand.php

+39
Original file line numberDiff line numberDiff line change
@@ -1689,6 +1689,45 @@ public function run($args)
16891689
Yii::app()->db->createCommand($sql)->execute();
16901690
}
16911691

1692+
//2022-05-23
1693+
if ($version == '7.8.1.2') {
1694+
$sql = " CREATE TABLE IF NOT EXISTS `pkg_provider_cnl` (
1695+
`id` int(11) NOT NULL AUTO_INCREMENT,
1696+
`id_provider` int(11) NOT NULL,
1697+
`cnl` int(11) NOT NULL,
1698+
`zone` VARCHAR(11) NOT NULL,
1699+
PRIMARY KEY (`id`),
1700+
KEY `id_provider` (`id_provider`),
1701+
KEY `cnl` (`cnl`),
1702+
CONSTRAINT `fk_pkg_provider_pkg_provider_cnl` FOREIGN KEY (`id_provider`) REFERENCES `pkg_provider` (`id`) ON DELETE CASCADE
1703+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
1704+
$this->executeDB($sql);
1705+
1706+
$sql = "ALTER TABLE `pkg_sip` ADD `cnl` VARCHAR(11) NOT NULL DEFAULT '' ;";
1707+
$this->executeDB($sql);
1708+
1709+
$version = '7.8.1.3';
1710+
$sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' ";
1711+
Yii::app()->db->createCommand($sql)->execute();
1712+
}
1713+
1714+
//2022-05-25
1715+
if ($version == '7.8.1.3') {
1716+
$sql = "SELECT * FROM pkg_module WHERE module = 'providercnl'";
1717+
$result = Yii::app()->db->createCommand($sql)->queryAll();
1718+
if (!isset($result[0]['id'])) {
1719+
$sql = "INSERT INTO pkg_module VALUES (NULL, 't(''Provider CNL'')', 'providercnl', 'x-fa fa-desktop', 10,7)";
1720+
$this->executeDB($sql);
1721+
}
1722+
1723+
$sql = "ALTER TABLE `pkg_trunk` ADD `cnl` INT(11) NOT NULL DEFAULT '0' ;";
1724+
$this->executeDB($sql);
1725+
1726+
$version = '7.8.1.4';
1727+
$sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' ";
1728+
Yii::app()->db->createCommand($sql)->execute();
1729+
}
1730+
16921731
}
16931732

16941733
public function executeDB($sql)

protected/components/Report.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,12 @@ public function bodyExtra()
178178
if (!$this->recordsDetails) {
179179
return;
180180
}
181-
if (isset($this->firstListTitle)) {
181+
if (isset($this->secondListTitle)) {
182182
$this->Ln(15);
183183
$this->SetFont($this->fontFamily, 'B', $this->fontSize);
184-
$this->Cell(0, 5, utf8_decode($this->firstListTitle), 0, 0, 'C');
184+
$this->Cell(0, 5, utf8_decode($this->secondListTitle), 0, 0, 'C');
185185
$this->Ln(10);
186186
}
187-
188187
$this->SetFont($this->fontFamily, 'B', $this->fontSize);
189188
$this->SetTextColor(255, 255, 255);
190189
$widthContent = $this->orientation === 'P' ? 189 : 276;

0 commit comments

Comments
 (0)