diff --git a/app/model/User.js b/app/model/User.js index 4f9b7fd6..239d1eeb 100755 --- a/app/model/User.js +++ b/app/model/User.js @@ -131,6 +131,9 @@ Ext.define('MBilling.model.User', { }, { name: 'email', type: 'string' + }, { + name: 'email2', + type: 'string' }, { name: 'doc', type: 'string' diff --git a/build/MagnusBilling-current.tar.gz b/build/MagnusBilling-current.tar.gz index e23eff64..310fea52 100644 Binary files a/build/MagnusBilling-current.tar.gz and b/build/MagnusBilling-current.tar.gz differ diff --git a/classic/src/view/user/Form.js b/classic/src/view/user/Form.js index 16140cb5..f88528d3 100755 --- a/classic/src/view/user/Form.js +++ b/classic/src/view/user/Form.js @@ -238,18 +238,42 @@ Ext.define('MBilling.view.user.Form', { minLength: 8 }] }, { - name: 'email', - fieldLabel: t('Email'), - allowBlank: true - }, { - name: 'doc', - fieldLabel: t('DOC'), - allowBlank: true + xtype: 'fieldcontainer', + layout: 'hbox', + defaults: { + xtype: 'textfield', + labelAlign: 'right', + flex: 1 + }, + items: [{ + name: 'email', + fieldLabel: t('Email'), + allowBlank: true, + labelWidth: 145 + }, { + name: 'email2', + fieldLabel: t('Email') + ' 2', + allowBlank: true + }] }, { - name: 'vat', - fieldLabel: t('VAT'), - hidden: App.user.isClient, - allowBlank: true + xtype: 'fieldcontainer', + layout: 'hbox', + defaults: { + xtype: 'textfield', + labelAlign: 'right', + flex: 1 + }, + items: [{ + name: 'doc', + fieldLabel: t('DOC'), + allowBlank: true, + labelWidth: 145 + }, { + name: 'vat', + fieldLabel: t('VAT'), + hidden: App.user.isClient, + allowBlank: true + }] }, { xtype: 'moneyfield', name: 'contract_value', @@ -311,6 +335,27 @@ Ext.define('MBilling.view.user.Form', { allowBlank: true, flex: 3 }] + }, { + xtype: 'fieldcontainer', + layout: 'hbox', + defaults: { + xtype: 'textfield', + labelAlign: 'right', + labelWidth: 145, + flex: 1 + }, + items: [{ + xtype: 'yesnocombo', + name: 'email_services', + fieldLabel: t('Services email notification'), + flex: 2 + }, { + xtype: 'yesnocombo', + nname: 'email_did', + fieldLabel: t('DID email notification'), + labelWidth: 170, + flex: 3 + }] }, { xtype: 'fieldcontainer', layout: 'hbox', diff --git a/classic/src/view/user/List.js b/classic/src/view/user/List.js index b2bfcdc0..33a9d0f6 100755 --- a/classic/src/view/user/List.js +++ b/classic/src/view/user/List.js @@ -41,6 +41,12 @@ Ext.define('MBilling.view.user.List', { dataIndex: 'email', flex: 4, hidden: window.isTablet + }, { + header: t('Email') + ' 2', + dataIndex: 'email2', + flex: 4, + hidden: true, + hideable: !App.user.isClient && !App.user.isAgent }, { header: t('Credit'), dataIndex: 'credit', diff --git a/protected/commands/DidCheckCommand.php b/protected/commands/DidCheckCommand.php index e9f7bbdf..895da10c 100755 --- a/protected/commands/DidCheckCommand.php +++ b/protected/commands/DidCheckCommand.php @@ -91,7 +91,9 @@ public function run($args) $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, $didUse->idUser->credit - $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, -$didUse->idDid->fixrate); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } $sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null; } else { $description = Yii::t('zii', 'Monthly payment DID') . ' ' . $didUse->idDid->did; @@ -113,7 +115,9 @@ public function run($args) $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, $didUse->idUser->credit - $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, -$didUse->idDid->fixrate); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } $sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null; } } else { @@ -129,7 +133,9 @@ public function run($args) $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, number_format($didUse->idUser->credit, 2)); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } } } else { $log = $this->debug >= 1 ? MagnusLog::writeLog(LOGFILE, ' line:' . __LINE__ . " USER " . $didUse->idUser->username . " DONT HAVE ENOUGH CREDIT TO PAY FOR THE DID " . $didUse->idDid->did . " NOTIFY NOW ") : null; @@ -145,7 +151,9 @@ public function run($args) $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, number_format($didUse->idUser->credit, 2)); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } $sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null; } @@ -166,7 +174,9 @@ public function run($args) $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, $didUse->idUser->credit - $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, -$didUse->idDid->fixrate); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } $sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null; } else { $description = Yii::t('zii', 'Monthly payment DID') . ' ' . $didUse->idDid->did; @@ -188,7 +198,9 @@ public function run($args) $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, $didUse->idUser->credit - $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, -$didUse->idDid->fixrate); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } $sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null; } } else { @@ -226,7 +238,9 @@ public function run($args) $mail->replaceInEmail(Mail::$DID_NUMBER_KEY, $didUse->idDid->did); $mail->replaceInEmail(Mail::$DID_COST_KEY, $didUse->idDid->fixrate); $mail->replaceInEmail(Mail::$BALANCE_REMAINING_KEY, $didUse->idUser->credit); - $mail->send(); + if ($didUse->idUser->email_did == 1) { + $mail->send(); + } $mail->send($this->config['global']['admin_email']); $sendAdmin = $this->config['global']['admin_received_email'] == 1 ? $mail->send($this->config['global']['admin_email']) : null; } diff --git a/protected/commands/ServicesCheckCommand.php b/protected/commands/ServicesCheckCommand.php index 5d8ecc4d..69e88619 100755 --- a/protected/commands/ServicesCheckCommand.php +++ b/protected/commands/ServicesCheckCommand.php @@ -162,7 +162,10 @@ public function notifyUser($service, $type) $mail->replaceInEmail(Mail::$SERVICE_PRICE, $service->idServices->price); $mail->replaceInEmail(Mail::$SERVICE_PENDING_URL, $link); try { - @$mail->send(); + if ($service->idUser->email_services == 1) { + @$mail->send(); + } + } catch (Exception $e) { //error SMTP } diff --git a/protected/commands/UpdateMysqlCommand.php b/protected/commands/UpdateMysqlCommand.php index ff265974..7edcda44 100755 --- a/protected/commands/UpdateMysqlCommand.php +++ b/protected/commands/UpdateMysqlCommand.php @@ -292,8 +292,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2019-11-23 @@ -304,8 +303,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2019-12-04 @@ -322,8 +320,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.0.4') { @@ -331,8 +328,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-01-17 if ($version == '7.0.5') { @@ -340,8 +336,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-01-20 @@ -396,8 +391,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-01-23 @@ -430,8 +424,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); $sql = "ALTER TABLE `pkg_cdr` DROP `stoptime`;"; $this->executeDB($sql); @@ -443,8 +436,7 @@ public function run($args) $this->executeDB($sql); $version = '7.0.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.0.9') { @@ -452,8 +444,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.0') { @@ -461,8 +452,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.1') { @@ -470,8 +460,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.2') { @@ -479,8 +468,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.3') { @@ -493,8 +481,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); exec("echo '\n* * * * * php /var/www/html/mbilling/cron.php didwww' >> $CRONPATH"); } @@ -507,8 +494,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.5') { @@ -517,8 +503,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.6') { @@ -537,8 +522,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.7') { @@ -560,8 +544,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.8') { @@ -571,8 +554,7 @@ public function run($args) $this->executeDB($sql); $version = '7.1.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.1.9') { @@ -595,8 +577,7 @@ public function run($args) $this->executeDB($sql); $version = '7.2.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.2.0') { @@ -614,8 +595,7 @@ public function run($args) $this->executeDB($sql); $version = '7.2.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.2.1') { @@ -624,8 +604,7 @@ public function run($args) $this->executeDB($sql); $version = '7.2.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.2.2') { @@ -637,8 +616,7 @@ public function run($args) $this->executeDB($sql); $version = '7.2.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } if ($version == '7.2.3') { @@ -647,8 +625,7 @@ public function run($args) $this->executeDB($sql); $version = '7.2.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-06-08 if ($version == '7.2.4') { @@ -657,8 +634,7 @@ public function run($args) $this->executeDB($sql); $version = '7.2.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-06-15 @@ -748,8 +724,7 @@ public function run($args) $this->executeDB($sql); $version = '7.3.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-06-15 @@ -758,8 +733,7 @@ public function run($args) $this->executeDB($sql); $version = '7.3.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-11 @@ -771,8 +745,7 @@ public function run($args) $this->executeDB($sql); $version = '7.3.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-20 @@ -789,8 +762,7 @@ public function run($args) exec("echo '#include extensions_magnus_did.conf' >> /etc/asterisk/extensions.conf"); $version = '7.3.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-27 @@ -800,8 +772,7 @@ public function run($args) $this->executeDB($sql); $version = '7.3.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-11 @@ -817,16 +788,14 @@ public function run($args) $this->executeDB($sql); $version = '7.3.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-28 if ($version == '7.3.5') { $version = '7.3.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-28 @@ -880,8 +849,7 @@ public function run($args) } $version = '7.3.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-07-28 @@ -972,8 +940,7 @@ public function run($args) $this->executeDB($sql); $version = '7.3.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-14 @@ -983,8 +950,7 @@ public function run($args) $this->executeDB($sql); $version = '7.3.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-17 @@ -994,8 +960,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-18 @@ -1007,8 +972,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-18 @@ -1018,8 +982,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-19 if ($version == '7.4.2') { @@ -1029,8 +992,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-19 if ($version == '7.4.3') { @@ -1039,8 +1001,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-25 if ($version == '7.4.4') { @@ -1061,8 +1022,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-26 @@ -1075,8 +1035,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-08-26 @@ -1088,8 +1047,7 @@ public function run($args) $this->executeDB($sql); $version = '7.4.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-09-10 @@ -1114,8 +1072,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-09-21 @@ -1132,8 +1089,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-10-05 @@ -1143,8 +1099,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-10-08 @@ -1155,8 +1110,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-10-08 @@ -1167,8 +1121,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-12-01 @@ -1181,8 +1134,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-12-22 @@ -1210,8 +1162,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2020-12-26 @@ -1221,8 +1172,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-01-02 @@ -1232,8 +1182,7 @@ public function run($args) $this->executeDB($sql); $version = '7.5.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-01-03 @@ -1265,8 +1214,7 @@ public function run($args) exec("echo '\n*/5 * * * * php /var/www/html/mbilling/cron.php alarm' >> $CRONPATH"); $version = '7.5.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-01-03 @@ -1299,8 +1247,7 @@ public function run($args) $this->executeDB($sql); $version = '7.6.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-01-21 if ($version == '7.6.0') { @@ -1319,8 +1266,7 @@ public function run($args) $this->executeDB($sql); $version = '7.6.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-01-21 @@ -1330,8 +1276,7 @@ public function run($args) $this->executeDB($sql); $version = '7.6.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-01-21 @@ -1341,8 +1286,7 @@ public function run($args) $this->executeDB($sql); $version = '7.6.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-03-05 @@ -1353,8 +1297,7 @@ public function run($args) $this->executeDB($sql); $version = '7.6.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-03-18 @@ -1382,8 +1325,7 @@ public function run($args) exec("echo '\n* * * * * php /var/www/html/mbilling/cron.php TrunkSIPCodes' >> $CRONPATH"); $version = '7.6.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-03-18 @@ -1404,8 +1346,7 @@ public function run($args) } $version = '7.6.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-06-08 @@ -1414,8 +1355,7 @@ public function run($args) $this->executeDB($sql); $version = '7.6.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-06-18 @@ -1424,8 +1364,7 @@ public function run($args) $this->executeDB($sql); $version = '7.7.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-06-23 @@ -1434,8 +1373,7 @@ public function run($args) $this->executeDB($sql); $version = '7.7.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-07-28 @@ -1444,8 +1382,7 @@ public function run($args) $this->executeDB($sql); $version = '7.7.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-07-28 @@ -1454,8 +1391,7 @@ public function run($args) $this->executeDB($sql); $version = '7.7.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-07-28 @@ -1464,8 +1400,7 @@ public function run($args) $this->executeDB($sql); $version = '7.7.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-08-27 @@ -1474,8 +1409,7 @@ public function run($args) $this->executeDB($sql); $version = '7.7.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-08-27 @@ -1483,8 +1417,7 @@ public function run($args) $sql = " INSERT INTO `pkg_configuration` (`id`, `config_title`, `config_key`, `config_value`, `config_description`, `config_group_title`, `status`) VALUES (NULL, 'Delete CDR archived prior X month', 'delete_cdr_archived_prior_x_month', '0', 'Delete CDR archived prior X monthr', 'global', '1'),(NULL, 'Delete CDR failed archived prior X month', 'delete_cdr_failed_archived_prior_x_month', '0', 'Delete CDR failed archived prior X month', 'global', '1');"; $this->executeDB($sql); $version = '7.7.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-10-22 @@ -1504,8 +1437,7 @@ public function run($args) exec("echo '\n59 23 * * * php /var/www/html/mbilling/cron.php NotifyClientDaily' >> $CRONPATH"); $version = '7.7.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-10-24 @@ -1513,8 +1445,7 @@ public function run($args) $sql = " INSERT INTO `pkg_configuration` VALUES (NULL, 'Charge the DID if client have enough credit before the due date', 'charge_did_before_due_date', '1', 'Charge the DID if client have enough credit before the due date', 'global', '1');"; $this->executeDB($sql); $version = '7.7.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-10-26 @@ -1528,8 +1459,7 @@ public function run($args) $sql = "UPDATE pkg_configuration SET config_key = 'charge_did_services_before_due_date' WHERE config_key = 'charge_did_before_due_date'"; $this->executeDB($sql); $version = '7.7.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-12-06 @@ -1552,8 +1482,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2021-12-00 if ($version == '7.8.0.0') { @@ -1561,8 +1490,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-01-19 if ($version == '7.8.0.1') { @@ -1570,8 +1498,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-01-19 @@ -1580,8 +1507,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-02-14 @@ -1591,8 +1517,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-02-14 @@ -1601,8 +1526,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-02-17 @@ -1611,8 +1535,7 @@ public function run($args) Yii::app()->db->createCommand($sql)->execute(); $version = '7.8.0.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-02-18 @@ -1622,8 +1545,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-04-15 @@ -1639,8 +1561,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-04-21 @@ -1653,8 +1574,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.0.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-04-27 @@ -1664,8 +1584,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-05-05 @@ -1675,8 +1594,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-05-13 @@ -1685,8 +1603,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-05-23 @@ -1707,8 +1624,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-05-25 @@ -1724,8 +1640,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-05-25 @@ -1743,8 +1658,7 @@ public function run($args) } $version = '7.8.1.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-05-25 @@ -1762,8 +1676,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-07-15 @@ -1772,8 +1685,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-08-22 @@ -1782,8 +1694,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-08-29 @@ -1795,8 +1706,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.1.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-09-07 @@ -1805,8 +1715,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-09-26 @@ -1815,8 +1724,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-09-26 @@ -1828,8 +1736,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-10-07 @@ -1849,8 +1756,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.3'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-10-12 @@ -1859,8 +1765,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.4'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-11-05 @@ -1869,8 +1774,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.5'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-11-28 @@ -1901,8 +1805,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.6'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-12-13 @@ -1911,8 +1814,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.7'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-12-27 @@ -1921,8 +1823,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.8'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2022-12-28 if ($version == '7.8.2.8') { @@ -1933,8 +1834,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.2.9'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2023-01-10 @@ -1944,8 +1844,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.3.0'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2023-01-14 @@ -1954,8 +1853,7 @@ public function run($args) $this->executeDB($sql); $version = '7.8.3.1'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); } //2023-02-21 @@ -1964,8 +1862,34 @@ public function run($args) $this->executeDB($sql); $version = '7.8.3.2'; - $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; - Yii::app()->db->createCommand($sql)->execute(); + $this->update($version); + } + + //2023-03-14 + if ($version == '7.8.3.2') { + $sql = "ALTER TABLE `pkg_user` ADD `email2` VARCHAR(100) NOT NULL DEFAULT '' AFTER `email`; "; + $this->executeDB($sql); + + $sql = "ALTER TABLE `pkg_user` CHANGE `email` `email` VARCHAR(100) NOT NULL DEFAULT '';"; + $this->executeDB($sql); + + $version = '7.8.3.3'; + $this->update($version); + } + + //2023-03-14 + if ($version == '7.8.3.3') { + $sql = "ALTER TABLE `pkg_user` ADD `email_services` INT(11) NOT NULL DEFAULT '1' , ADD `email_did` INT(11) NOT NULL DEFAULT '1' AFTER `email_services`;"; + $this->executeDB($sql); + + $version = '7.8.3.4'; + $this->update($version); + } + + //2023-03-14 + if ($version == '7.8.3.4') { + $version = '7.8.3.5'; + $this->update($version); } } @@ -1978,4 +1902,10 @@ public function executeDB($sql) } } + public function update($version = '') + { + $sql = "UPDATE pkg_configuration SET config_value = '" . $version . "' WHERE config_key = 'version' "; + $this->executeDB($sql); + } + } diff --git a/protected/components/BaseController.php b/protected/components/BaseController.php index caa36669..341a6e36 100755 --- a/protected/components/BaseController.php +++ b/protected/components/BaseController.php @@ -76,6 +76,8 @@ class BaseController extends CController public $controllerAllowUpdateAll = array(); public $relationFilter = array(); public $fieldsInvisibleClient = array(); + public $fieldsNotUpdateClient = array(); + public $fieldsNotUpdateAgent = array(); public $config; public $addInCondition = []; public function init() @@ -1259,6 +1261,18 @@ public function getAttributesModels($models, $itemsExtras = array()) public function getAttributesRequest() { $arrPost = array_key_exists($this->nameRoot, $_POST) ? json_decode($_POST[$this->nameRoot], true) : $_POST; + if (isset(Yii::app()->session['isClient']) && Yii::app()->session['isClient']) { + $fields = array_merge($this->fieldsInvisibleClient, $this->fieldsNotUpdateClient); + foreach ($fields as $field) { + unset($arrPost[$field]); + } + } + if (isset(Yii::app()->session['isAgent']) && Yii::app()->session['isAgent']) { + $fields = array_merge($this->fieldsInvisibleAgent, $this->fieldsNotUpdateAgent); + foreach ($fields as $field) { + unset($arrPost[$field]); + } + } return $arrPost; } diff --git a/protected/components/Mail.php b/protected/components/Mail.php index f5d10d46..a37a7d0d 100755 --- a/protected/components/Mail.php +++ b/protected/components/Mail.php @@ -32,8 +32,10 @@ class Mail private $from_email = ''; private $from_name = ''; private $to_email = ''; + private $to_email2 = ''; private $language = ''; public $output; + public $type; public static $DESCRIPTION = '$description$'; @@ -161,7 +163,7 @@ public function __construct($type, $id_user = null, $id_agent = null, $msg = nul { if (!empty($type)) { - + $this->type = $type; $modelUser = User::model()->findByPk((int) $id_user); $modelConfig = Configuration::model()->find('config_key = "ip_servers"'); @@ -233,7 +235,8 @@ public function __construct($type, $id_user = null, $id_agent = null, $msg = nul $modelUser->password = isset($modelUser->password) ? $modelUser->password : null; $modelUser->credit_notification = isset($modelUser->credit_notification) ? $modelUser->credit_notification : null; - $this->to_email = isset($modelUser->email) ? $modelUser->email : null; + $this->to_email = isset($modelUser->email) ? $modelUser->email : null; + $this->to_email2 = isset($modelUser->email2) ? $modelUser->email2 : null; $this->replaceInEmail(self::$CUSTOMER_ID, $modelUser->id); $this->replaceInEmail(self::$USER_ID, $modelUser->id); $this->replaceInEmail(self::$CUSTOMER_CARDNUMBER_KEY, $modelUser->username); @@ -389,9 +392,12 @@ public function send($to_email = null) $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; $mail->MsgHTML($this->message); $mail->AddAddress($this->to_email); + $mail->AddAddress($this->to_email2); $mail->CharSet = 'utf-8'; ob_start(); @$mail->Send(); + + Yii::log('Email sent to ' . $this->to_email . ' ' . $this->to_email2 . '. Subject -> ' . $mail->Subject . '. Email type: ' . $this->type, 'error'); $this->output = ob_get_contents(); ob_end_clean(); return true; diff --git a/protected/components/SqlInject.php b/protected/components/SqlInject.php index c8134b57..669dabf9 100755 --- a/protected/components/SqlInject.php +++ b/protected/components/SqlInject.php @@ -23,19 +23,19 @@ class sqlInject public static function sanitize($src) { $codes = array( - 'UPDATE ', - 'SELECT ', + 'UPDATE', + 'SELECT', ' SET ', - ' TABLE ', + 'TABLE', 'DELETE FROM', - ' DATABASE ', + 'DATABASE', 'DROP TABLE', 'DROP DATABASE', 'SCHEMA', 'CONCAT', 'foreign_key', 'TRUNCATE ', - 'CREATE ', + 'CREATE', ); foreach ($src as $key => $value) { diff --git a/protected/controllers/DidController.php b/protected/controllers/DidController.php index 4f92d34a..6a8aeb39 100755 --- a/protected/controllers/DidController.php +++ b/protected/controllers/DidController.php @@ -80,15 +80,6 @@ public function extraFilterCustomAgent($filter) return $filter; } - public function applyFilterToLimitedAdmin() - { - - parent::applyFilterToLimitedAdmin(); - //allow admins with group limit see nonreserved DIDs. - $this->filter .= ' OR (activated = 1 AND reserved = 0)'; - - } - public function extraFilterCustomClient($filter) { diff --git a/protected/controllers/DidHistoryController.php b/protected/controllers/DidHistoryController.php index 622fbdbc..aa1328be 100755 --- a/protected/controllers/DidHistoryController.php +++ b/protected/controllers/DidHistoryController.php @@ -28,7 +28,7 @@ public function init() { $this->instanceModel = new DidHistory; $this->abstractModel = DidHistory::model(); - $this->titleReport = Yii::t('zii', 'DidHistory'); + $this->titleReport = Yii::t('zii', 'DID History'); parent::init(); } } diff --git a/protected/controllers/GerencianetController.php b/protected/controllers/GerencianetController.php index a1446086..c03599e3 100755 --- a/protected/controllers/GerencianetController.php +++ b/protected/controllers/GerencianetController.php @@ -139,7 +139,7 @@ public function actionIndex() echo "Cobrança cancelada pelo vendedor ou pelo pagador."; $description = "Boleto gerado, Status:Cobrança cancelada pelo vendedor ou pelo pagador, ID:" . $token; - $sql = "UPDATE pkg_refill SET description= '" . $description . "' WHERE id =" . $resultRefill[0]['id']; + $sql = "UPDATE pkg_refill SET description= :description WHERE id =" . $id; Yii::log(print_r($sql, true), 'error'); $command = Yii::app()->db->createCommand($sql); $command->bindValue(':id', $resultRefill[0]['id'], PDO::PARAM_INT); diff --git a/protected/controllers/SipController.php b/protected/controllers/SipController.php index e4e248b8..9c007cd5 100755 --- a/protected/controllers/SipController.php +++ b/protected/controllers/SipController.php @@ -46,6 +46,14 @@ class SipController extends Controller 'id_trunk_group', ); + public $fieldsNotUpdateClient = array( + 'context', + ); + + public $fieldsNotUpdateAgent = array( + 'context', + ); + public function init() { $this->instanceModel = new Sip; diff --git a/protected/controllers/UserController.php b/protected/controllers/UserController.php index 8eb28162..13ade7ba 100755 --- a/protected/controllers/UserController.php +++ b/protected/controllers/UserController.php @@ -60,6 +60,7 @@ class UserController extends Controller 'idGroupid_user_type', 'idPlanname', ); + public $fieldsInvisibleAgent = array( 'id_group', 'idGroupname', @@ -68,6 +69,30 @@ class UserController extends Controller 'loginkey', ); + public $fieldsNotUpdateClient = array( + 'credit', + 'id_plan', + 'id_user', + 'id_group_agent', + 'id_offer', + 'typepaid', + 'creditlimit', + 'calllimit', + 'restriction', + 'restriction_use', + ); + + public $fieldsNotUpdateAgent = array( + 'credit', + 'id_user', + 'id_group_agent', + 'typepaid', + 'creditlimit', + 'calllimit', + 'restriction', + 'restriction_use', + ); + public function init() { $this->instanceModel = new User; @@ -581,20 +606,19 @@ public function freeCallUsed($id_user, $id_offer, $billingtype, $startday) { $CLAUSE_DATE = $this->checkDaysPackage($startday, $billingtype); - $sql = "SELECT COUNT(*) AS status FROM pkg_offer_cdr " . "WHERE $CLAUSE_DATE AND id_user = '$id_user' AND id_offer = '$id_offer' LIMIT 1"; - $modelOfferCdr = Yii::app()->db->createCommand($sql)->queryAll(); + $sql = "SELECT COUNT(*) AS id FROM pkg_offer_cdr " . "WHERE $CLAUSE_DATE AND id_user = '$id_user' AND id_offer = '$id_offer' LIMIT 1"; + $modelOfferCdr = OfferCdr::model()->findBySql($sql); - return isset($modelOfferCdr[0]['status']) ? $modelOfferCdr[0]['status'] : 0; + return isset($modelOfferCdr->id) ? $modelOfferCdr->id : 0; } public function packageUsedSeconds($id_user, $id_offer, $billingtype, $startday) { - $CLAUSE_DATE = $this->checkDaysPackage($startday, $billingtype); - $sql = "SELECT sum(used_secondes) AS used_secondes FROM pkg_offer_cdr " . "WHERE $CLAUSE_DATE AND id_user = '$id_user' AND id_offer = '$id_offer' "; - - $modelOfferCdr = Yii::app()->db->createCommand($sql)->queryAll(); + $CLAUSE_DATE = $this->checkDaysPackage($startday, $billingtype); + $sql = "SELECT sum(used_secondes) AS used_secondes FROM pkg_offer_cdr " . "WHERE $CLAUSE_DATE AND id_user = '$id_user' AND id_offer = '$id_offer' "; + $modelOfferCdr = OfferCdr::model()->findBySql($sql); - return isset($modelOfferCdr[0]['used_secondes']) ? $modelOfferCdr[0]['used_secondes'] : 0; + return isset($modelOfferCdr->used_secondes) ? $modelOfferCdr->used_secondes : 0; } diff --git a/protected/models/Sip.php b/protected/models/Sip.php index 2144fb4e..9990418b 100755 --- a/protected/models/Sip.php +++ b/protected/models/Sip.php @@ -163,6 +163,10 @@ public function checksecret($attribute, $params) $this->addError($attribute, Yii::t('zii', 'No space allow in password')); } + if (preg_match('/\'|\"/', $this->secret)) { + $this->addError($attribute, Yii::t('zii', 'Not use \' or \" in password')); + } + if ($this->secret == '123456' || $this->secret == '12345678' || $this->secret == '012345') { $this->addError($attribute, Yii::t('zii', 'No use sequence in the password')); } diff --git a/protected/models/User.php b/protected/models/User.php index d0ea8cb3..b6054693 100755 --- a/protected/models/User.php +++ b/protected/models/User.php @@ -70,14 +70,14 @@ public function rules() transfer_bkash_profit,transfer_flexiload_profit,transfer_international_profit, transfer_dbbl_rocket,transfer_bkash,transfer_flexiload,transfer_international, transfer_bdservice_rate,transfer_show_selling_price,cpslimit, - restriction_use,credit_notification_daily + restriction_use,credit_notification_daily,email_services,email_did ', 'numerical', 'integerOnly' => true), array('language,mix_monitor_format,calllimit_error', 'length', 'max' => 5), array('zipcode, phone, mobile, vat', 'length', 'max' => 20), array('city, state, country, loginkey', 'length', 'max' => 40), array('lastname, firstname, redial, prefix_local,neighborhood', 'length', 'max' => 50), array('company_website, dist', 'length', 'max' => 100), - array('address, email, doc', 'length', 'max' => 100), + array('address, email,email2, doc', 'length', 'max' => 100), array('username', 'length', 'max' => 20), array('description', 'length', 'max' => 500), array('credit, contract_value', 'type', 'type' => 'double'), diff --git a/resources/help/help_en.js b/resources/help/help_en.js index ae546ba8..f5c96211 100755 --- a/resources/help/help_en.js +++ b/resources/help/help_en.js @@ -6,6 +6,8 @@ Help.load({ 'alarm.amount': ``, 'alarm.email': ``, 'alarm.status': ``, + 'alarm.subject': ``, + 'alarm.message': ``, //API 'api.id_user': `You need use the MagnusBilling API from https://github.com/magnussolution/magnusbilling-api-php. The username owner this API`, 'api.api_key': `This apy key will be necessary to execute the API`, @@ -272,6 +274,7 @@ Help.load({ 'did.workaudio': `Audio that will be executed when a call is received at the time interval.`, 'did.noworkaudio': `Audio that will be executed when a call is received out of the time interval.`, 'did.country': ``, + 'did.id_server': ``, //DID DESTINATION 'diddestination.id_did': `Select the DID that you want create new destination for.`, 'diddestination.id_user': `User that will be the owner of this DID.`, @@ -301,6 +304,12 @@ You should NOT set a name for the context because the name will be set automatic You may take a look at the context at /etc/asterisk/extensions_magnus_did.conf `, + //DID HISTORY + 'didhistory.did': ``, + 'didhistory.username': ``, + 'didhistory.month_payed': ``, + 'didhistory.reservationdate': ``, + 'didhistory.description': ``, //DIDS USE 'diduse.id_did': `DID Number`, 'diduse.month_payed': `The total month paid to this DID.`, @@ -873,6 +882,9 @@ Let's say you selected 3 trunks, and you want to send 1 call to the first trunk, 'user.transfer_dbbl_rocket': `This function is not avaible in Brazil. It's only used to mobile refills in some countries.`, 'user.transfer_dbbl_rocket_profit': `This function is not avaible in Brazil. It's only used to mobile refills in some countries.`, 'user.transfer_show_selling_price': `This function is not avaible in Brazil. It's only used to mobile refills in some countries.`, + 'user.email2': ``, + 'user.email_services': ``, + 'user.email_did': ``, //USER HISTORY 'userhistory.id_user': ``, 'userhistory.date': ``, diff --git a/resources/help/help_pt_BR.js b/resources/help/help_pt_BR.js index d77e1cc4..cc4cd46d 100755 --- a/resources/help/help_pt_BR.js +++ b/resources/help/help_pt_BR.js @@ -6,6 +6,8 @@ Help.load({ 'alarm.amount': ``, 'alarm.email': ``, 'alarm.status': ``, + 'alarm.subject': ``, + 'alarm.message': ``, //API 'api.id_user': `Usuário que poderá usar está API.||Para usar a API é necessário o uso do projeto MagnusBilling API PHP publicado no GITHUB. @@ -100,9 +102,9 @@ Para funcionar é necessário deixar o campo Fromuser no tronco em branco.`, 'callsummarydayuser.sumlucro': `Somatório do lucro.`, 'callsummarydayuser.sumnbcall': `Total de chamadas.`, //RESUMO POR MêS/DID - 'callsummarymonthdid.sumsessionbill': ``, - 'callsummarymonthdid.sumsessiontime': ``, - 'callsummarymonthdid.sumnbcall': ``, + 'callsummarymonthdid.sumsessionbill': `Somatório do preço de venda`, + 'callsummarymonthdid.sumsessiontime': `Somatório de minutos`, + 'callsummarymonthdid.sumnbcall': `Total de chamadas`, //RESUMO POR MêS/TRONCO 'callsummarymonthtrunk.sumsessiontime': `Somatorio de minutos chamadas.||É possível realizar filtros, por exemplo, filtrar os últimos 3 meses, ou de um tronco específico, neste caso. Este somatório mostrará somente os dados do filtro executado.`, 'callsummarymonthtrunk.sumsessionbill': `Somatório do preço de venda.`, @@ -142,7 +144,7 @@ Para funcionar é necessário deixar o campo Fromuser no tronco em branco.`, 'campaign.id_user': `Usuário dono da campanha.`, 'campaign.id_plan': `Que plano será usado para tarifar as chamadas desta campanha, pode ser um plano diferente do plano cadastrado na conta do cliente.`, 'campaign.name': `Nome para a campanha.`, - 'campaign.callerid': ``, + 'campaign.callerid': `Caller ID`, 'campaign.status': `Status da campanha.`, 'campaign.startingdate': `Data que a campanha será considerada ativa.`, 'campaign.expirationdate': `Data que a campanha não será mais considerada ativa, mesmo ser tiver números ativos.`, @@ -273,7 +275,7 @@ Estas opções será útil para ver os relatórios no menu Relatório de Enquete 'campaignpollinfo.resposta': `Opção votada.`, //NúMEROS RESTRITOS 'campaignrestrictphone.number': `Número a ser bloqueado. É necessário ativar a opção números bloqueados na campanha.`, - 'campaignrestrictphone.description': ``, + 'campaignrestrictphone.description': `Descrição`, //AJUSTES 'configuration.config_value': `Valor. Clique para ler sobre as opções deste menu.|https://wiki.magnusbilling.org/pt_BR/source/config.html.`, 'configuration.config_description': `Descrição. Clique para ler sobre as opções deste menu.|https://wiki.magnusbilling.org/pt_BR/source/config.html.`, @@ -342,7 +344,8 @@ E se todas as configurações estiverem corretas, o CallBack este executado e o 'did.TimeOfDay_sun': `Mesma regra só que para domingos.`, 'did.workaudio': `Áudio que será executado quando alguém ligar dentro do horário de atendimento.`, 'did.noworkaudio': `Áudio que será executado quando ligar fora do horário de atendimento.`, - 'did.country': ``, + 'did.country': `País`, + 'did.id_server': `Servidor. Somente usado quando você usa SIP PROXY.`, //DESTINO DE DIDS 'diddestination.id_did': `Selecione o DID para criar o novo destino.`, 'diddestination.id_user': `Usuário que será o dono deste DID.`, @@ -373,6 +376,12 @@ Você pode verificar o contexto no arquivo /etc/asterisk/extensions_magnus_did.c .`, + //HISTóRICO DOS DID + 'didhistory.did': `DID`, + 'didhistory.username': `Usuário`, + 'didhistory.month_payed': `Meses pagos`, + 'didhistory.reservationdate': `Data reservado`, + 'didhistory.description': `Descrição`, //USO DE DIDS 'diduse.id_did': `Número DID.`, 'diduse.month_payed': `Total de meses pagos.`, @@ -594,9 +603,9 @@ Você pode usar o botão processar para reativar os números que estão com stat 'provider.credit_control': `Se esta opção for ativada os troncos deste provedor serão desativados quando o crédito do provedor ficar em zero.`, 'provider.description': `Descrição para a agenda, somente para controle próprio.`, //PROVEDOR CNL - 'providercnl.id_provider': ``, - 'providercnl.cnl': ``, - 'providercnl.zone': ``, + 'providercnl.id_provider': `Provedor`, + 'providercnl.cnl': `Código CNL`, + 'providercnl.zone': `Zona`, //FILAS DE ESPERA 'queue.id_user': `Usuário dono da fila.`, 'queue.name': `Nome para a fila.`, @@ -714,10 +723,10 @@ Digamos que tenha 1 servidor MagnusBilling 3 servidores slaves, e você deseja e 'servicesuse.id_services': `Serviço.`, 'servicesuse.price': `Valor do serviço.`, 'servicesuse.method': `Forma de pagamento.`, - 'servicesuse.month_payed': ``, + 'servicesuse.month_payed': `Meses pagos`, 'servicesuse.reservationdate': `Dia que o serviço foi ativado.`, - 'servicesuse.contract_period': ``, - 'servicesuse.termination_date': ``, + 'servicesuse.contract_period': `Tempo de contrato`, + 'servicesuse.termination_date': `Termino do contrato`, //CONTAS SIP 'sip.id_user': `Usuário ao qual esta conta SIP está vinculada.`, 'sip.defaultuser': `Usuário que será usado para logar nos softphones ou qualquer dispositivo SIP.`, @@ -735,7 +744,7 @@ Também usado para capturar chamada com *8, deve ser configurada a opção picku 'sip.block_call_reg': `Bloquear chamadas usando REGEX. Para bloquear chamadas para celular é so colocar ^55\\d\\d9. Click para ir ao site que testa REGEX.|https://regex101.com.`, 'sip.record_call': `Grava as chamadas saintes desta conta SIP.`, 'sip.techprefix': `Opção útil para quando for necessário autenticar mais de um cliente via IP que usa o mesmo IP. Comum em BBX multi tenant.`, - 'sip.description': ``, + 'sip.description': `Descrição`, 'sip.nat': `O cliente está atrás de NAT? Clique para mais informaçōes|https://www.voip-info.org/asterisk-sip-nat/.`, 'sip.directmedia': `Se ativado, Asterisk vai tentar enviar a mídia RTP direto entre seu cliente e seu provedor. Precisa ativar no tronco também. Clique para mais informaçōes|https://www.voip-info.org/asterisk-sip-canreinvite/.`, 'sip.qualify': `Enviar pacote OPTION para verificar se o usuário está online.||Sintaxe: @@ -962,7 +971,7 @@ Regra 5 -> números que iniciam com qualquer valor e tem 11 dígitos, será adic 'user.email': `Email, é necessário para o envio de notificaçōes do sistema.`, 'user.doc': `Documento do cliente.`, 'user.vat': `Usado em alguns métodos de pagamento.`, - 'user.contract_value': ``, + 'user.contract_value': `Valor do contrato`, 'user.dist': ``, 'user.typepaid': `Cliente pós-pago poderá ficar com saldo negativo até o limite de crédito informado no campo abaixo.`, 'user.credit_notification_daily': `Se ativar esta opção o MagnusBilling vai enviar um email diariamente com o saldo do cliente. Você pode editar o email que será enviado no menu Configurações submenu Modelo de Emails.`, @@ -985,6 +994,9 @@ Regra 5 -> números que iniciam com qualquer valor e tem 11 dígitos, será adic 'user.transfer_dbbl_rocket': `Esta função não está disponível no Brasil. Somente usado para recarga de celulares em alguns países.`, 'user.transfer_dbbl_rocket_profit': `Esta função não está disponível no Brasil. Somente usado para recarga de celulares em alguns países.`, 'user.transfer_show_selling_price': `Esta função não está disponível no Brasil. Somente usado para recarga de celulares em alguns países.`, + 'user.email2': `Email 2`, + 'user.email_services': `Ativa ou não as notificaçōes por email dos serviços`, + 'user.email_did': `Ativa ou não as notificaçōes por email dos DIDs`, //HISTóRICO CLIENTES 'userhistory.id_user': ``, 'userhistory.date': ``, diff --git a/script/database.sql b/script/database.sql index de3a49c8..d1e5a307 100755 --- a/script/database.sql +++ b/script/database.sql @@ -1,6 +1,6 @@ -- MySQL dump 10.16 Distrib 10.1.48-MariaDB, for Linux (x86_64) -- --- Host: localhost Database: mbilling +-- Host: localhost Database: mbilling2 -- ------------------------------------------------------ -- Server version 10.1.37-MariaDB @@ -32,6 +32,9 @@ CREATE TABLE `pkg_alarm` ( `period` int(11) DEFAULT NULL, `id_plan` int(11) DEFAULT NULL, `email` varchar(100) DEFAULT NULL, + `last_notification` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `subject` varchar(200) NOT NULL DEFAULT 'MagnusBilling ALARM', + `message` varchar(1000) NOT NULL DEFAULT 'MagnusBilling ALARM email body, customize', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -141,9 +144,17 @@ CREATE TABLE `pkg_call_chart` ( `total` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `date` (`date`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `pkg_call_chart` +-- + +LOCK TABLES `pkg_call_chart` WRITE; +/*!40000 ALTER TABLE `pkg_call_chart` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_call_chart` ENABLE KEYS */; +UNLOCK TABLES; -- -- Table structure for table `pkg_call_online` @@ -554,6 +565,7 @@ DROP TABLE IF EXISTS `pkg_campaign_restrict_phone`; CREATE TABLE `pkg_campaign_restrict_phone` ( `id` int(11) NOT NULL AUTO_INCREMENT, `number` bigint(20) NOT NULL, + `description` varchar(100) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `number` (`number`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -1099,7 +1111,7 @@ CREATE TABLE `pkg_configuration` ( `config_group_title` varchar(64) NOT NULL, `status` int(10) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=310 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=311 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1108,7 +1120,7 @@ CREATE TABLE `pkg_configuration` ( LOCK TABLES `pkg_configuration` WRITE; /*!40000 ALTER TABLE `pkg_configuration` DISABLE KEYS */; -INSERT INTO `pkg_configuration` VALUES (1,'System Currency','base_currency','0','System Currency','global',1),(2,'Language','base_language','en','Allow \n en English \nes Espanhol \npt_BR Portugues','global',1),(3,'Version','version','7.8.0.0','MBilling Version','global',1),(4,'Licence','licence','free','MBilling Licence','global',0),(5,'Server IP','ip_servers','','Ip do servidor MBilling','global',1),(6,'Template','template','black-neptune','Allowed values:\ngreen, gray, blue, yellow, red, orange, purple','global',0),(7,'Country','base_country','','ISO CODE values\nUSA United States,\nBRL Brasil,\nARG Argentina,\nNLD Netherlands,\nESP Spanish','global',1),(8,'Desktop layout','layout','0','Active Desktop template, only to FULL version\n1 - Enable (Only to full version)\n0 - Disable','global',0),(9,'Wallpaper','wallpaper','Azul','Default Wallpaper, only FULL version.','global',0),(10,'SMTP Host','smtp_host','mail.magnusbilling.com','SMTP Hostname','global',0),(11,'SMTP UserName','smtp_username','billing@magnusbilling.com','SMTP server Username','global',0),(12,'SMTP Password','smtp_password','magnus','SMTP server Password','global',0),(13,'SMTP Encryption','smtp_encryption','null','SMTP Encryption: tls, ssl or blank','global',0),(14,'SMTP Port','smtp_port','587','SMTP Port','global',0),(15,'Admin Email','admin_email','info@magnusbilling.com','Email for receive notifications','global',1),(16,'Send email copy to admin','admin_received_email','1','Send copy for admin email','global',1),(19,'Days notification','delay_notifications','3','Number of days to generate low balance warning to customers','global',1),(20,'Rounding calls','bloc_time_call','1','Round the lead time as charging sales.\n1: Yes\n0: No','global',1),(21,'Days to pay offers','planbilling_daytopay','5','Set how many days before maturity you wanna collect the bid offers','global',1),(22,'Agent refill limit','agent_limit_refill','5','Limit to agent refill yours customers','global',1),(23,'Archive cdr','archive_call_prior_x_month','4','Calls to file before 10 months.','global',1),(25,'Decimal precision','decimal_precision','0000','Decimal precision.','global',1),(26,'Active paypal for new customer','paypal_new_user','0','Active paypal for new customer. \n\n0 - Disable (RECOMENDED )\n1 - Enable','global',1),(29,'Portabilidade Usuário','portabilidadeUsername','0','Usuário da portabilidade para consulta via WebService','global',0),(30,'Portabilidade Senha','portabilidadePassword','0','Senha da portabilidade para consulta via WebService','global',0),(31,'AGI 1 - Answer Call','answer_call','0','If enabled the MBilling answers the call that starts.\nDefault: 0','agi-conf1',1),(32,'AGI 1 - User DNID','use_dnid','1','If the client does not need active schedule again the number he wish to call after entering the PIN.\n\n1 - Enable (DEFAULT)\n0 - Disable','agi-conf1',1),(34,'AGI 1 - Intro Prompt','intro_prompt','','To specify a prompt to play at the beginning of the calls','agi-conf1',1),(37,'AGI 1 - International prefixes','international_prefixes','00,09','List the prefixes you want stripped off if the call number','agi-conf1',1),(38,'AGI 1 - Say sell price','say_rateinitial','0','Play the initial cost of the tariff.\n\n0 - No\n1 - Yes','agi-conf1',1),(39,'AGI 1 - Say Duration','say_timetocall','0','Play the amount of time that the user can call.\n\n0 - No\n1 - Yes','agi-conf1',1),(40,'AGI 1 - CallerID Authentication','cid_enable','0','Active CallerID Authentication.\n\n0 - Disable\n1 - Enable','agi-conf1',1),(41,'AGI 1 - FailOver LCR/LCD','failover_lc_prefix','1','If anable and have two hidden tariff in de plan, MBilling gonna get the cheaper','agi-conf1',1),(42,'AGI 1 - Dial Command Params','dialcommand_param',',60,L(%timeout%:61000:30000)','More info: http://voip-info.org/wiki-Asterisk+cmd+dial','agi-conf1',1),(43,'AGI 1 - Internal Call, Dial Command Params','dialcommand_param_sipiax_friend',',60,TtiL(3600000:61000:30000)','Dial paramater for call between users.\n\nby default (3600000 = 1HOUR MAX CALL).','agi-conf1',1),(44,'AGI 1 - DID Dial Command Params','dialcommand_param_call_2did',',45,TtiL(%timeout%:61000:30000)','Dial paramater to DID calls','agi-conf1',1),(45,'AGI 1 - Failover Retry Limit','failover_recursive_limit','5','Define how many time we want to authorize the research of the failover trunk when a call fails','agi-conf1',1),(46,'AGI 1 - Number of attempt','number_try','1','Number of attempts to dial the number\n Minimum value 1','agi-conf1',1),(47,'AGI 1 - Outbound Call','switchdialcommand','0','Define the order to make the outbound call
YES -> SIP/number@trunk - NO SIP/trunk/number
Both should work exactly the same but i experimented one case when gateway was supporting number@trunk, So in case of trouble, try it out.','agi-conf1',1),(48,'AGI 1 - Say Balance After Call','say_balance_after_call','0','Play the balance to the user after the call\n\n0 - No\n1 - Yes','agi-conf1',1),(85,'SIP Account for spy call','channel_spy','0','SIP Account for spy call','global',1),(142,'Username Auto Generate ','username_generate','1','Generate username automatically ','global',1),(143,'Username Prefix','generate_prefix','0','Prefix for username ','global',1),(144,'Username length','generate_length','5','Username Length','global',1),(145,'Answer Callback','answer_callback','0','Answer callback and play audio','global',1),(146,'Callback add Prefix','callback_add_prefix','','Add prefix in callerd in callback call','global',1),(147,'Callback remove Prefix','callback_remove_prefix','','Remove prefix in callerd in callback call','global',1),(233,'Menu color','color_menu','White','Menu color, Black or White','global',0),(234,'Menu color','color_menu','White','Menu color, Black or White','global',1),(235,'Charge Sip Call','charge_sip_call','0','Charge sip call between clients','global',1),(236,'URL to extra module','module_extra','index.php/extra/read','Url to extra module, default: index.php/extra/read','global',1),(237,'intra/inter Billing','intra-inter','0','Enable Intra-Inter Billing. If you enable this option, and you have another plan with the same name + Intra on the name Mbilling use the new plan to intra call','global',0),(238,'Enable Paypal on Softphone','paypal-softphone','0','Active Paypal on Android Softphones, valid only Softphone version 2.5. 0 - Disable 1 - Enable','global',1),(239,'Enable CallBack on Softphone','callback-softphone','0','Active Callback on Android Softphones, valid only Softphone version 2.5. 0 - Disable 1 - Enable','global',1),(240,'Invoice tax','invoice_tax','0','Tax to add in Invoice.','global',1),(241,'Log nivel','log','0','min 0 - max 5 ','global',0),(242,'Asterisk','asterisk_version','11','Set your Asterisk Version instaled. Default 1.8','global',0),(243,'Tts URL','tts_url','https://translate.google.com/translate_tts?ie=UTF-8&q=$name&tl=pt-BR&total=1&idx=0&textlen=25&client=t&tk=55786|34299.','Set here the URL to use in Massive Call. Use variable $name in the string field','global',1),(244,'fm.transfer-to.com username','fm_transfer_to_username',NULL,'Username in Transfer To','global',0),(245,'fm.transfer-to.com token','fm_transfer_to_ token',NULL,'Token to Transfer To API','global',0),(248,'Days to find in Summary per agent','summary_per_agent_days','7','Days to find when you open the menu Summary per Agent','global',1),(249,'MixMonitor Format','MixMonitor_format','gsm','see the availables extensions in http://www.voip-info.org/wiki/view/MixMonitor','global',1),(251,'fm.transfer-to.com print Header','fm_transfer_print_header','Change it in configuration menu','Description to print header','global',0),(252,'fm.transfer-to.com print Footer','fm_transfer_print_footer','Change it in configuration menu','Description to print footer','global',0),(253,'fm.transfer-to.com Currency','fm_transfer_currency','€','Set the transfer-to currency','global',0),(254,'Sip trunk short duration call','trunk_short_duration_call','3','SIP TRUNK short duration call','global',1),(255,'Sip trunk short total calls','trunk_short_total_calls','0','Sip trunk short total calls','global',1),(256,'Enable IAX','enable_izx','3','Enable IAX','global',0),(259,'BDService Url','BDService_url','https://req.ovinovo.net','Default https://req.ovinovo.net','global',0),(260,'Generate password automatically on Signup Form','signup_auto_pass','0','Set the number of caracter to password. EX: if you have pass with 10 digits, set it to 10. Minimo value 6','global',1),(261,'Social Media Network to show in customer panel','social_media_network','','Social Media Network to show in customer panel','global',1),(262,'Link to signup terms','accept_terms_link','','Set a link to signup terms','global',1),(263,'Auto gernerate user in Signup form','auto_generate_user_signup','1','Auto gernerate user in Signup form','global',1),(264,'Notificação de  Pagamento de serviços','service_daytopay','5','Total Dias anterior ao vencimento que o MagnusBilling avisara o cliente para pagar os serviços','global',1),(265,'Start User Call Limit','start_user_call_limit','-1','Default call limit for new user','global',0),(266,'CallingCard answer call','callingcard_answer','1','Answer call in CallingCard','agi-conf1',1),(267,'CallingCard enable CID authentication','callingcard_cid_enable','1','CID authentication in CallingCard','agi-conf1',1),(268,'CallingCard number try','callingcard_number_try','3','Number try call in CallingCard','agi-conf1',1),(269,'CallingCard say sall rate','callingcard_say_rateinitial','0','CallingCard say sall rate','agi-conf1',1),(270,'CallingCard say timecall','callingcard_say_timetocall','0','CallingCard say timecall','agi-conf1',1),(271,'reCaptchaKey sitekey','reCaptchaKey','','Generate your sitekey in https://www.google.com/recaptcha/admin#list','global',1),(272,'BDService Username','BDService_username','','BDService username','global',0),(273,'BDService token','BDService_token','','BDService token','global',0),(274,'BDService flexiload values','BDService_flexiload','10-1000','BDService flexiload values','global',0),(275,'BDService bkash values','BDService_bkash','50-2500','BDService bkash values','global',0),(276,'BDService currency translation','BDService_cambio','0.01','BDService currency translation','global',0),(277,'BDService DBBL/Rocket values','BDService_dbbl_rocket','10-1000','DBBL/Rocket flexiload values','global',0),(278,'BDService Credit','BDService_credit_provider','0','BDService Credit','global',0),(279,'Session timeout','session_timeout','3600','Time in seconds to close user session','global',1),(280,'Show Play icon on CDR','show_playicon_cdr','0','Show Play icon on CDR menu. Set to 1 for show the icon','global',1),(281,'Show fields help','show_filed_help','1','Show fields help','global',1),(282,'Authentication IP/tech length','ip_tech_length','6','Authentication IP/tech length 4, 5 or 6 digits','global',1),(283,'External URL to download records','external_record_link','','External URL to download records. Only used to download only one audio. Leave blank to no find audio in external link. URL EX: http://IP/record.php?username=%user%&audio=%number%.%uniqueid%.%audio_exten%','global',1),(284,'Campaign call limit to users','campaign_user_limit','1','Campaign call limit to users','global',1),(285,'Enable CallingCard','enable_callingcard','1','Enable CallingCard','global',1),(286,'Send email to admin when user signup from form','signup_admin_email','1','Send email to administrator email when creation new account from signup page\n 0 - Disable \n1 - Enable','global',1),(287,'Show Signup button on login page','show_signup_button','0','Show Signup button on login page\n 0 - Disable \n1 - Enable','global',1),(288,'reCaptchaKey secretkey','reCaptchaSecret','','Generate your secredt key in https://www.google.com/recaptcha/admin#list','global',1),(289,'Enable Signup Form','enable_signup','0','Enable Signup form','global',1),(290,'Background Color','backgroundColor','#1b1e23','Background Color','global',1),(291,'DIDWW APY KEY','didww_api_key','','DIDWW APY KEY','global',1),(292,'DIDWW APY URL','didww_url','https://api.didww.com/v3/','DIDWW APY URL','global',1),(293,'DIDWW PROFIT','didww_profit','0','DIDWW profit percentage. Integer value','global',1),(294,'URL to extra module2','module_extra2','','Url to extra module, default: index.php/extra2/read','global',1),(295,'URL to extra module3','module_extra3','','Url to extra module, default: index.php/extra3/read','global',1),(296,'DIDWW CURRENCY CONVERTER','didww_curreny_converter','0','DIDWW CURRENCY CONVERTER. Ex. 1 USD in your local currency is 3.25, so add here 3.25','global',1),(297,'Fixed CallerId to use on Signup','fixed_callerid_signup','','Fixed CallerId to use on Signup, Leave blank to use the user phone','global',1),(298,'Apply the local prefix rule on DID and Sip Call','apply_local_prefix_did_sip','0','Apply the local prefix rule on DID and Sip Call','global',1),(299,'Default Codecs','default_codeds','g729,gsm,opus,alaw,ulaw','Default Codecs','global',1),(300,'Signup: Allow multiples users with same DOC','signup_unique_doc','1','Signup: Allow multiples users with same DOC','global',1),(301,'Show Broadcasting DashBoard on User home panel','showMCDashBoard','0','Show the Campaign DashBoard to User','global',1),(302,'Incoming DID first Digit Removal','did_ignore_zero_on_did','0','0=Disable \n1=Enable Remove First Digit of Incoming DID','global',1),(303,'Enable IAX internal calls','use_sip_to_iax','0','Enable IAX internal calls','global',1),(304,'Login header','login_header','Log in','Login header','global',1),(305,'Record all calls','global_record_calls','0','0=Disable \n1=Enable\n Record all calls, the fields record calls will be hidden if this option is activated.','global',1),(306,'Default prefix rule','default_prefix_rule','','This rule will be used when you create a new user or on the Sign up form. More details about prefix rule on the bellow link https://www.magnusbilling.org/local_prefix','global',1),(307,'Delete CDR archived prior X month','delete_cdr_archived_prior_x_month','0','Delete CDR archived prior X monthr','global',1),(308,'Delete CDR failed archived prior X month','delete_cdr_failed_archived_prior_x_month','0','Delete CDR failed archived prior X month','global',1),(309,'Charge the DID/Services if client have enough credit before the due date','charge_did_services_before_due_date','1','Charge the DID/Services if client have enough credit before the due date','global',1); +INSERT INTO `pkg_configuration` VALUES (1,'System Currency','base_currency','0','System Currency','global',1),(2,'Language','base_language','en','Allow \n en English \nes Espanhol \npt_BR Portugues','global',1),(3,'Version','version','7.8.3.2','MBilling Version','global',1),(4,'Licence','licence','free','MBilling Licence','global',0),(5,'Server IP','ip_servers','','Ip do servidor MBilling','global',1),(6,'Template','template','black-neptune','Allowed values:\ngreen, gray, blue, yellow, red, orange, purple','global',0),(7,'Country','base_country','','ISO CODE values\nUSA United States,\nBRL Brasil,\nARG Argentina,\nNLD Netherlands,\nESP Spanish','global',1),(8,'Desktop layout','layout','0','Active Desktop template, only to FULL version\n1 - Enable (Only to full version)\n0 - Disable','global',0),(9,'Wallpaper','wallpaper','Azul','Default Wallpaper, only FULL version.','global',0),(10,'SMTP Host','smtp_host','mail.magnusbilling.com','SMTP Hostname','global',0),(11,'SMTP UserName','smtp_username','billing@magnusbilling.com','SMTP server Username','global',0),(12,'SMTP Password','smtp_password','magnus','SMTP server Password','global',0),(13,'SMTP Encryption','smtp_encryption','null','SMTP Encryption: tls, ssl or blank','global',0),(14,'SMTP Port','smtp_port','587','SMTP Port','global',0),(15,'Admin Email','admin_email','info@magnusbilling.com','Email for receive notifications','global',1),(16,'Send email copy to admin','admin_received_email','1','Send copy for admin email','global',1),(19,'Days notification','delay_notifications','3','Number of days to generate low balance warning to customers','global',1),(20,'Rounding calls','bloc_time_call','1','Round the lead time as charging sales.\n1: Yes\n0: No','global',1),(21,'Days to pay offers','planbilling_daytopay','5','Set how many days before maturity you wanna collect the bid offers','global',1),(22,'Agent refill limit','agent_limit_refill','5','Limit to agent refill yours customers','global',1),(23,'Archive cdr','archive_call_prior_x_month','4','Calls to file before 10 months.','global',1),(25,'Decimal precision','decimal_precision','0000','Decimal precision.','global',1),(26,'Active paypal for new customer','paypal_new_user','0','Active paypal for new customer. \n\n0 - Disable (RECOMENDED )\n1 - Enable','global',1),(29,'Portabilidade Usuário','portabilidadeUsername','0','Usuário da portabilidade para consulta via WebService','global',0),(30,'Portabilidade Senha','portabilidadePassword','0','Senha da portabilidade para consulta via WebService','global',0),(31,'AGI 1 - Answer Call','answer_call','0','If enabled the MBilling answers the call that starts.\nDefault: 0','agi-conf1',1),(32,'AGI 1 - User DNID','use_dnid','1','If the client does not need active schedule again the number he wish to call after entering the PIN.\n\n1 - Enable (DEFAULT)\n0 - Disable','agi-conf1',1),(34,'AGI 1 - Intro Prompt','intro_prompt','','To specify a prompt to play at the beginning of the calls','agi-conf1',1),(37,'AGI 1 - International prefixes','international_prefixes','00,09','List the prefixes you want stripped off if the call number','agi-conf1',1),(38,'AGI 1 - Say sell price','say_rateinitial','0','Play the initial cost of the tariff.\n\n0 - No\n1 - Yes','agi-conf1',1),(39,'AGI 1 - Say Duration','say_timetocall','0','Play the amount of time that the user can call.\n\n0 - No\n1 - Yes','agi-conf1',1),(40,'AGI 1 - CallerID Authentication','cid_enable','0','Active CallerID Authentication.\n\n0 - Disable\n1 - Enable','agi-conf1',1),(41,'AGI 1 - FailOver LCR/LCD','failover_lc_prefix','1','If anable and have two hidden tariff in de plan, MBilling gonna get the cheaper','agi-conf1',1),(42,'AGI 1 - Dial Command Params','dialcommand_param',',60,L(%timeout%:61000:30000)','More info: http://voip-info.org/wiki-Asterisk+cmd+dial','agi-conf1',1),(43,'AGI 1 - Internal Call, Dial Command Params','dialcommand_param_sipiax_friend',',60,TtiL(3600000:61000:30000)','Dial paramater for call between users.\n\nby default (3600000 = 1HOUR MAX CALL).','agi-conf1',1),(44,'AGI 1 - DID Dial Command Params','dialcommand_param_call_2did',',45,TtiL(%timeout%:61000:30000)','Dial paramater to DID calls','agi-conf1',1),(45,'AGI 1 - Failover Retry Limit','failover_recursive_limit','5','Define how many time we want to authorize the research of the failover trunk when a call fails','agi-conf1',1),(46,'AGI 1 - Number of attempt','number_try','1','Number of attempts to dial the number\n Minimum value 1','agi-conf1',1),(47,'AGI 1 - Outbound Call','switchdialcommand','0','Define the order to make the outbound call
YES -> SIP/number@trunk - NO SIP/trunk/number
Both should work exactly the same but i experimented one case when gateway was supporting number@trunk, So in case of trouble, try it out.','agi-conf1',1),(48,'AGI 1 - Say Balance After Call','say_balance_after_call','0','Play the balance to the user after the call\n\n0 - No\n1 - Yes','agi-conf1',1),(85,'SIP Account for spy call','channel_spy','0','SIP Account for spy call','global',1),(142,'Username Auto Generate ','username_generate','1','Generate username automatically ','global',1),(143,'Username Prefix','generate_prefix','0','Prefix for username ','global',1),(144,'Username length','generate_length','5','Username Length','global',1),(145,'Answer Callback','answer_callback','0','Answer callback and play audio','global',1),(146,'Callback add Prefix','callback_add_prefix','','Add prefix in callerd in callback call','global',1),(147,'Callback remove Prefix','callback_remove_prefix','','Remove prefix in callerd in callback call','global',1),(233,'Menu color','color_menu','White','Menu color, Black or White','global',0),(234,'Menu color','color_menu','White','Menu color, Black or White','global',1),(235,'Charge Sip Call','charge_sip_call','0','Charge sip call between clients','global',1),(236,'URL to extra module','module_extra','index.php/extra/read','Url to extra module, default: index.php/extra/read','global',1),(237,'intra/inter Billing','intra-inter','0','Enable Intra-Inter Billing. If you enable this option, and you have another plan with the same name + Intra on the name Mbilling use the new plan to intra call','global',0),(238,'Enable Paypal on Softphone','paypal-softphone','0','Active Paypal on Android Softphones, valid only Softphone version 2.5. 0 - Disable 1 - Enable','global',1),(239,'Enable CallBack on Softphone','callback-softphone','0','Active Callback on Android Softphones, valid only Softphone version 2.5. 0 - Disable 1 - Enable','global',1),(240,'Invoice tax','invoice_tax','0','Tax to add in Invoice.','global',1),(241,'Log nivel','log','0','min 0 - max 5 ','global',0),(242,'Asterisk','asterisk_version','11','Set your Asterisk Version instaled. Default 1.8','global',0),(243,'Tts URL','tts_url','https://translate.google.com/translate_tts?ie=UTF-8&q=$name&tl=pt-BR&total=1&idx=0&textlen=25&client=t&tk=55786|34299.','Set here the URL to use in Massive Call. Use variable $name in the string field','global',1),(244,'fm.transfer-to.com username','fm_transfer_to_username',NULL,'Username in Transfer To','global',0),(245,'fm.transfer-to.com token','fm_transfer_to_ token',NULL,'Token to Transfer To API','global',0),(248,'Days to find in Summary per agent','summary_per_agent_days','7','Days to find when you open the menu Summary per Agent','global',1),(249,'MixMonitor Format','MixMonitor_format','gsm','see the availables extensions in http://www.voip-info.org/wiki/view/MixMonitor','global',1),(251,'fm.transfer-to.com print Header','fm_transfer_print_header','Change it in configuration menu','Description to print header','global',0),(252,'fm.transfer-to.com print Footer','fm_transfer_print_footer','Change it in configuration menu','Description to print footer','global',0),(253,'fm.transfer-to.com Currency','fm_transfer_currency','€','Set the transfer-to currency','global',0),(254,'Sip trunk short duration call','trunk_short_duration_call','3','SIP TRUNK short duration call','global',1),(255,'Sip trunk short total calls','trunk_short_total_calls','0','Sip trunk short total calls','global',1),(256,'Enable IAX','enable_izx','3','Enable IAX','global',0),(259,'BDService Url','BDService_url','https://req.ovinovo.net','Default https://req.ovinovo.net','global',0),(260,'Generate password automatically on Signup Form','signup_auto_pass','0','Set the number of caracter to password. EX: if you have pass with 10 digits, set it to 10. Minimo value 6','global',1),(261,'Social Media Network to show in customer panel','social_media_network','','Social Media Network to show in customer panel','global',1),(262,'Link to signup terms','accept_terms_link','','Set a link to signup terms','global',1),(263,'Auto gernerate user in Signup form','auto_generate_user_signup','1','Auto gernerate user in Signup form','global',1),(264,'Notificação de  Pagamento de serviços','service_daytopay','5','Total Dias anterior ao vencimento que o MagnusBilling avisara o cliente para pagar os serviços','global',1),(265,'Start User Call Limit','start_user_call_limit','-1','Default call limit for new user','global',0),(266,'CallingCard answer call','callingcard_answer','1','Answer call in CallingCard','agi-conf1',1),(267,'CallingCard enable CID authentication','callingcard_cid_enable','1','CID authentication in CallingCard','agi-conf1',1),(268,'CallingCard number try','callingcard_number_try','3','Number try call in CallingCard','agi-conf1',1),(269,'CallingCard say sall rate','callingcard_say_rateinitial','0','CallingCard say sall rate','agi-conf1',1),(270,'CallingCard say timecall','callingcard_say_timetocall','0','CallingCard say timecall','agi-conf1',1),(271,'reCaptchaKey sitekey','reCaptchaKey','','Generate your sitekey in https://www.google.com/recaptcha/admin#list','global',1),(272,'BDService Username','BDService_username','','BDService username','global',0),(273,'BDService token','BDService_token','','BDService token','global',0),(274,'BDService flexiload values','BDService_flexiload','10-1000','BDService flexiload values','global',0),(275,'BDService bkash values','BDService_bkash','50-2500','BDService bkash values','global',0),(276,'BDService currency translation','BDService_cambio','0.01','BDService currency translation','global',0),(277,'BDService DBBL/Rocket values','BDService_dbbl_rocket','10-1000','DBBL/Rocket flexiload values','global',0),(278,'BDService Credit','BDService_credit_provider','0','BDService Credit','global',0),(279,'Session timeout','session_timeout','3600','Time in seconds to close user session','global',1),(280,'Show Play icon on CDR','show_playicon_cdr','0','Show Play icon on CDR menu. Set to 1 for show the icon','global',1),(281,'Show fields help','show_filed_help','1','Show fields help','global',1),(282,'Authentication IP/tech length','ip_tech_length','6','Authentication IP/tech length 4, 5 or 6 digits','global',1),(283,'External URL to download records','external_record_link','','External URL to download records. Only used to download only one audio. Leave blank to no find audio in external link. URL EX: http://IP/record.php?username=%user%&audio=%number%.%uniqueid%.%audio_exten%','global',1),(284,'Campaign call limit to users','campaign_user_limit','1','Campaign call limit to users','global',1),(285,'Enable CallingCard','enable_callingcard','1','Enable CallingCard','global',1),(286,'Send email to admin when user signup from form','signup_admin_email','1','Send email to administrator email when creation new account from signup page\n 0 - Disable \n1 - Enable','global',1),(287,'Show Signup button on login page','show_signup_button','0','Show Signup button on login page\n 0 - Disable \n1 - Enable','global',1),(288,'reCaptchaKey secretkey','reCaptchaSecret','','Generate your secredt key in https://www.google.com/recaptcha/admin#list','global',1),(289,'Enable Signup Form','enable_signup','0','Enable Signup form','global',1),(290,'Background Color','backgroundColor','#1b1e23','Background Color','global',1),(291,'DIDWW APY KEY','didww_api_key','','DIDWW APY KEY','global',1),(292,'DIDWW APY URL','didww_url','https://api.didww.com/v3/','DIDWW APY URL','global',1),(293,'DIDWW PROFIT','didww_profit','0','DIDWW profit percentage. Integer value','global',1),(294,'URL to extra module2','module_extra2','','Url to extra module, default: index.php/extra2/read','global',1),(295,'URL to extra module3','module_extra3','','Url to extra module, default: index.php/extra3/read','global',1),(296,'DIDWW CURRENCY CONVERTER','didww_curreny_converter','0','DIDWW CURRENCY CONVERTER. Ex. 1 USD in your local currency is 3.25, so add here 3.25','global',1),(297,'Fixed CallerId to use on Signup','fixed_callerid_signup','','Fixed CallerId to use on Signup, Leave blank to use the user phone','global',1),(298,'Apply the local prefix rule on DID and Sip Call','apply_local_prefix_did_sip','0','Apply the local prefix rule on DID and Sip Call','global',1),(299,'Default Codecs','default_codeds','g729,gsm,opus,alaw,ulaw','Default Codecs','global',1),(300,'Signup: Allow multiples users with same DOC','signup_unique_doc','1','Signup: Allow multiples users with same DOC','global',1),(301,'Show Broadcasting DashBoard on User home panel','showMCDashBoard','0','Show the Campaign DashBoard to User','global',1),(302,'Incoming DID first Digit Removal','did_ignore_zero_on_did','0','0=Disable \n1=Enable Remove First Digit of Incoming DID','global',1),(303,'Enable IAX internal calls','use_sip_to_iax','0','Enable IAX internal calls','global',1),(304,'Login header','login_header','Log in','Login header','global',1),(305,'Record all calls','global_record_calls','0','0=Disable \n1=Enable\n Record all calls, the fields record calls will be hidden if this option is activated.','global',1),(306,'Default prefix rule','default_prefix_rule','','This rule will be used when you create a new user or on the Sign up form. More details about prefix rule on the bellow link https://www.magnusbilling.org/local_prefix','global',1),(307,'Delete CDR archived prior X month','delete_cdr_archived_prior_x_month','0','Delete CDR archived prior X monthr','global',1),(308,'Delete CDR failed archived prior X month','delete_cdr_failed_archived_prior_x_month','0','Delete CDR failed archived prior X month','global',1),(309,'Charge the DID/Services if client have enough credit before the due date','charge_did_services_before_due_date','1','Charge the DID/Services if client have enough credit before the due date','global',1),(310,'Allow login on webpanel with SIP user and password','sipuser_login','1','Allow login on webpanel with SIP user and password','global',1); /*!40000 ALTER TABLE `pkg_configuration` ENABLE KEYS */; UNLOCK TABLES; @@ -1152,6 +1164,7 @@ DROP TABLE IF EXISTS `pkg_did`; CREATE TABLE `pkg_did` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_user` int(11) DEFAULT NULL, + `id_server` int(11) DEFAULT NULL, `activated` int(11) NOT NULL DEFAULT '1', `reserved` tinyint(11) DEFAULT '0', `did` char(50) NOT NULL, @@ -1167,9 +1180,11 @@ CREATE TABLE `pkg_did` ( `connection_charge` decimal(15,5) NOT NULL DEFAULT '0.00000', `expression_1` varchar(150) NOT NULL DEFAULT '*', `selling_rate_1` decimal(15,5) NOT NULL DEFAULT '0.00000', + `agent_client_rate_1` decimal(15,5) NOT NULL DEFAULT '0.00000', `buy_rate_1` decimal(15,5) NOT NULL DEFAULT '0.00000', `expression_2` varchar(150) NOT NULL DEFAULT '*', `selling_rate_2` decimal(15,5) NOT NULL DEFAULT '0.00000', + `agent_client_rate_2` decimal(15,5) NOT NULL DEFAULT '0.00000', `buy_rate_2` decimal(15,5) NOT NULL DEFAULT '0.00000', `connection_sell` decimal(15,5) NOT NULL DEFAULT '0.00000', `minimal_time_charge` int(11) NOT NULL DEFAULT '0', @@ -1186,6 +1201,7 @@ CREATE TABLE `pkg_did` ( `block_expression_2` smallint(2) NOT NULL DEFAULT '0', `expression_3` varchar(150) NOT NULL DEFAULT '*', `selling_rate_3` decimal(15,5) NOT NULL DEFAULT '0.00000', + `agent_client_rate_3` decimal(15,5) NOT NULL DEFAULT '0.00000', `buy_rate_3` decimal(15,5) NOT NULL DEFAULT '0.00000', `block_expression_3` smallint(2) NOT NULL DEFAULT '0', `charge_of` int(1) NOT NULL DEFAULT '1', @@ -1199,6 +1215,7 @@ CREATE TABLE `pkg_did` ( `noworkaudio` varchar(150) DEFAULT NULL, `calllimit` int(11) NOT NULL DEFAULT '-1', `record_call` int(11) NOT NULL DEFAULT '0', + `country` varchar(50) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `did` (`did`), KEY `fk_pkg_user_pkg_did` (`id_user`), @@ -1253,6 +1270,36 @@ LOCK TABLES `pkg_did_destination` WRITE; /*!40000 ALTER TABLE `pkg_did_destination` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `pkg_did_history` +-- + +DROP TABLE IF EXISTS `pkg_did_history`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pkg_did_history` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(50) DEFAULT NULL, + `did` varchar(50) DEFAULT NULL, + `reservationdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `releasedate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `month_payed` int(11) DEFAULT '0', + `description` varchar(500) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `username` (`username`), + KEY `did` (`did`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pkg_did_history` +-- + +LOCK TABLES `pkg_did_history` WRITE; +/*!40000 ALTER TABLE `pkg_did_history` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_did_history` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `pkg_did_use` -- @@ -1269,6 +1316,7 @@ CREATE TABLE `pkg_did_use` ( `status` int(11) DEFAULT '0', `month_payed` int(11) DEFAULT '0', `reminded` tinyint(4) NOT NULL DEFAULT '0', + `next_due_date` varchar(30) DEFAULT '', PRIMARY KEY (`id`), KEY `id_card` (`id_user`), KEY `id_did` (`id_did`) @@ -1364,7 +1412,7 @@ CREATE TABLE `pkg_group_module` ( LOCK TABLES `pkg_group_module` WRITE; /*!40000 ALTER TABLE `pkg_group_module` DISABLE KEYS */; -INSERT INTO `pkg_group_module` VALUES (1,1,'crud',1,0,0),(1,3,'crud',1,0,0),(1,4,'ru',1,0,0),(1,5,'crud',1,0,0),(1,6,'crud',1,0,0),(1,7,'crud',1,0,0),(1,8,'crud',1,0,0),(1,9,'crud',1,0,0),(1,10,'crud',1,0,0),(1,12,'crud',1,0,0),(1,13,'crud',1,0,0),(1,14,'crud',1,0,0),(1,15,'crud',1,1,1),(1,16,'crud',1,0,0),(1,17,'crud',1,1,1),(1,19,'crud',1,1,1),(1,20,'crud',1,0,0),(1,21,'crud',1,1,1),(1,22,'crud',1,0,0),(1,23,'crud',1,1,1),(1,25,'crud',1,0,0),(1,26,'crud',1,0,0),(1,27,'crud',1,0,0),(1,28,'crud',1,0,0),(1,29,'crud',1,1,1),(1,30,'rud',1,1,1),(1,31,'crud',1,0,0),(1,32,'crud',1,0,0),(1,33,'crud',1,0,0),(1,34,'crud',1,0,0),(1,36,'crud',1,0,0),(1,40,'crud',1,1,1),(1,41,'crud',1,0,0),(1,42,'crud',1,0,0),(1,43,'crud',1,0,0),(1,44,'crud',1,0,0),(1,45,'crud',1,0,0),(1,46,'crud',1,0,0),(1,48,'crud',1,0,0),(1,49,'crud',1,0,0),(1,50,'crud',1,0,0),(1,51,'crud',1,0,0),(1,53,'crud',1,0,0),(1,54,'crud',1,0,0),(1,56,'crud',1,0,0),(1,57,'crud',1,0,0),(1,58,'crud',1,0,0),(1,59,'crud',1,0,0),(1,60,'crud',1,1,0),(1,62,'crud',1,0,0),(1,63,'crud',1,1,1),(1,64,'r',1,1,1),(1,66,'crud',1,1,1),(1,67,'rud',1,1,1),(1,71,'r',0,1,1),(1,72,'crud',1,1,1),(1,77,'crud',1,1,1),(1,78,'r',1,1,1),(1,80,'r',1,1,1),(1,82,'crud',1,0,0),(1,83,'crud',1,1,1),(1,85,'crud',1,1,1),(1,86,'crud',1,1,1),(1,87,'crud',1,1,1),(1,89,'r',1,1,1),(1,90,'r',1,1,1),(1,91,'r',1,1,1),(1,92,'r',1,1,1),(1,93,'r',1,1,1),(1,94,'r',1,1,1),(1,95,'crud',1,1,1),(1,96,'crud',1,1,1),(1,97,'crud',1,1,1),(1,98,'crud',1,0,0),(1,102,'crud',1,1,1),(1,103,'crud',1,1,1),(1,104,'crud',1,1,1),(1,105,'crud',1,1,1),(1,106,'crud',1,1,1),(1,107,'crud',1,1,1),(1,108,'crud',1,1,1),(1,109,'crud',1,1,1),(2,1,'crud',1,0,0),(2,7,'crud',1,0,0),(2,8,'crud',1,0,0),(2,9,'crud',1,0,0),(2,15,'crud',1,1,1),(2,19,'crud',1,1,1),(2,20,'crud',1,0,0),(2,21,'r',1,1,1),(2,23,'crud',1,1,1),(2,25,'r',0,0,0),(2,28,'crud',1,0,0),(2,29,'crud',1,1,1),(2,30,'r',1,1,1),(2,33,'r',0,0,0),(2,51,'r',1,0,0),(2,53,'r',1,0,0),(2,61,'r',1,1,1),(3,1,'ru',1,0,0),(3,5,'r',1,0,0),(3,7,'r',1,0,0),(3,8,'r',1,0,0),(3,9,'r',1,0,0),(3,15,'ru',1,1,1),(3,19,'ru',1,0,0),(3,20,'crud',1,0,0),(3,21,'r',1,1,1),(3,22,'crud',1,0,0),(3,23,'r',1,1,1),(3,25,'r',0,0,0),(3,28,'r',0,0,0),(3,29,'r',1,1,1),(3,30,'r',1,1,1),(3,31,'r',1,0,0),(3,32,'crud',1,0,0),(3,33,'r',0,0,0),(3,34,'r',0,0,0),(3,61,'r',1,1,1),(3,80,'r',1,0,0),(3,90,'r',1,0,0),(3,93,'r',1,0,0); +INSERT INTO `pkg_group_module` VALUES (1,1,'crud',1,0,0),(1,3,'crud',1,0,0),(1,4,'ru',1,0,0),(1,5,'crud',1,0,0),(1,6,'crud',1,0,0),(1,7,'crud',1,0,0),(1,8,'crud',1,0,0),(1,9,'crud',1,0,0),(1,10,'crud',1,0,0),(1,12,'crud',1,0,0),(1,13,'crud',1,0,0),(1,14,'crud',1,0,0),(1,15,'crud',1,1,1),(1,16,'crud',1,0,0),(1,17,'crud',1,1,1),(1,19,'crud',1,1,1),(1,20,'crud',1,0,0),(1,21,'crud',1,1,1),(1,22,'crud',1,0,0),(1,23,'crud',1,1,1),(1,25,'crud',1,0,0),(1,26,'crud',1,0,0),(1,27,'crud',1,0,0),(1,28,'crud',1,0,0),(1,29,'crud',1,1,1),(1,30,'rud',1,1,1),(1,31,'crud',1,0,0),(1,32,'crud',1,0,0),(1,33,'crud',1,0,0),(1,34,'crud',1,0,0),(1,36,'crud',1,0,0),(1,40,'crud',1,1,1),(1,41,'crud',1,0,0),(1,42,'crud',1,0,0),(1,43,'crud',1,0,0),(1,44,'crud',1,0,0),(1,45,'crud',1,0,0),(1,46,'crud',1,0,0),(1,48,'crud',1,0,0),(1,49,'crud',1,0,0),(1,50,'crud',1,0,0),(1,51,'crud',1,0,0),(1,53,'crud',1,0,0),(1,54,'crud',1,0,0),(1,56,'crud',1,0,0),(1,57,'crud',1,0,0),(1,58,'crud',1,0,0),(1,59,'crud',1,0,0),(1,60,'crud',1,1,0),(1,62,'crud',1,0,0),(1,63,'crud',1,1,1),(1,64,'r',1,1,1),(1,66,'crud',1,1,1),(1,67,'rud',1,1,1),(1,71,'r',0,1,1),(1,72,'crud',1,1,1),(1,77,'crud',1,1,1),(1,78,'r',1,1,1),(1,80,'r',1,1,1),(1,82,'crud',1,0,0),(1,83,'crud',1,1,1),(1,85,'crud',1,1,1),(1,86,'crud',1,1,1),(1,87,'crud',1,1,1),(1,89,'r',1,1,1),(1,90,'r',1,1,1),(1,91,'r',1,1,1),(1,92,'r',1,1,1),(1,93,'r',1,1,1),(1,94,'r',1,1,1),(1,95,'crud',1,1,1),(1,96,'crud',1,1,1),(1,97,'crud',1,1,1),(1,98,'crud',1,0,0),(1,102,'crud',1,1,1),(1,103,'crud',1,1,1),(1,104,'crud',1,1,1),(1,105,'crud',1,1,1),(1,106,'crud',1,1,1),(1,107,'crud',1,1,1),(1,108,'crud',1,1,1),(1,109,'crud',1,1,1),(1,111,'crud',1,1,1),(1,112,'crud',1,1,1),(2,1,'crud',1,0,0),(2,7,'crud',1,0,0),(2,8,'crud',1,0,0),(2,9,'crud',1,0,0),(2,15,'crud',1,1,1),(2,19,'crud',1,1,1),(2,20,'crud',1,0,0),(2,21,'r',1,1,1),(2,23,'crud',1,1,1),(2,25,'r',0,0,0),(2,28,'crud',1,0,0),(2,29,'crud',1,1,1),(2,30,'r',1,1,1),(2,33,'r',0,0,0),(2,51,'r',1,0,0),(2,53,'r',1,0,0),(2,61,'r',1,1,1),(3,1,'ru',1,0,0),(3,5,'r',1,0,0),(3,7,'r',1,0,0),(3,8,'r',1,0,0),(3,9,'r',1,0,0),(3,15,'ru',1,1,1),(3,19,'ru',1,0,0),(3,20,'crud',1,0,0),(3,21,'r',1,1,1),(3,22,'crud',1,0,0),(3,23,'r',1,1,1),(3,25,'r',0,0,0),(3,28,'r',0,0,0),(3,29,'r',1,1,1),(3,30,'r',1,1,1),(3,31,'r',1,0,0),(3,32,'crud',1,0,0),(3,33,'r',0,0,0),(3,34,'r',0,0,0),(3,61,'r',1,1,1),(3,80,'r',1,0,0),(3,90,'r',1,0,0),(3,93,'r',1,0,0); /*!40000 ALTER TABLE `pkg_group_module` ENABLE KEYS */; UNLOCK TABLES; @@ -1381,6 +1429,7 @@ CREATE TABLE `pkg_group_user` ( `id_user_type` int(11) NOT NULL, `user_prefix` int(11) DEFAULT NULL, `hidden_prices` tinyint(1) NOT NULL DEFAULT '0', + `hidden_batch_update` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `pkg_user_type_pkg_group_user` (`id_user_type`), CONSTRAINT `pkg_user_type_pkg_group_user` FOREIGN KEY (`id_user_type`) REFERENCES `pkg_user_type` (`id`) @@ -1393,7 +1442,7 @@ CREATE TABLE `pkg_group_user` ( LOCK TABLES `pkg_group_user` WRITE; /*!40000 ALTER TABLE `pkg_group_user` DISABLE KEYS */; -INSERT INTO `pkg_group_user` VALUES (1,'Administrator',1,NULL,0),(2,'Agent',2,NULL,0),(3,'Client',3,NULL,0); +INSERT INTO `pkg_group_user` VALUES (1,'Administrator',1,NULL,0,0),(2,'Agent',2,NULL,0,0),(3,'Client',3,NULL,0,0); /*!40000 ALTER TABLE `pkg_group_user` ENABLE KEYS */; UNLOCK TABLES; @@ -1647,19 +1696,19 @@ CREATE TABLE `pkg_method_pay` ( `username` varchar(50) NOT NULL, `pagseguro_TOKEN` varchar(100) NOT NULL, `fee` tinyint(1) NOT NULL DEFAULT '0', - `boleto_convenio` varchar(50) NOT NULL, - `boleto_banco` varchar(50) NOT NULL, - `boleto_agencia` varchar(50) NOT NULL, - `boleto_conta_corrente` varchar(50) NOT NULL, - `boleto_inicio_nosso_numeroa` varchar(50) NOT NULL, - `boleto_carteira` varchar(50) NOT NULL, - `boleto_taxa` varchar(50) NOT NULL, - `boleto_instrucoes` varchar(50) NOT NULL, - `boleto_nome_emp` varchar(50) NOT NULL, - `boleto_end_emp` varchar(50) NOT NULL, - `boleto_cidade_emp` varchar(50) NOT NULL, - `boleto_estado_emp` varchar(50) NOT NULL, - `boleto_cpf_emp` varchar(50) NOT NULL, + `boleto_convenio` varchar(50) DEFAULT NULL, + `boleto_banco` varchar(50) DEFAULT NULL, + `boleto_agencia` varchar(50) DEFAULT NULL, + `boleto_conta_corrente` varchar(50) DEFAULT NULL, + `boleto_inicio_nosso_numeroa` varchar(50) DEFAULT NULL, + `boleto_carteira` varchar(50) DEFAULT NULL, + `boleto_taxa` varchar(50) DEFAULT NULL, + `boleto_instrucoes` varchar(50) DEFAULT NULL, + `boleto_nome_emp` varchar(50) DEFAULT NULL, + `boleto_end_emp` varchar(50) DEFAULT NULL, + `boleto_cidade_emp` varchar(50) DEFAULT NULL, + `boleto_estado_emp` varchar(50) DEFAULT NULL, + `boleto_cpf_emp` varchar(50) DEFAULT NULL, `P2P_CustomerSiteID` varchar(100) NOT NULL DEFAULT '', `P2P_KeyID` varchar(50) NOT NULL DEFAULT '', `P2P_Passphrase` varchar(50) NOT NULL DEFAULT '', @@ -1678,7 +1727,7 @@ CREATE TABLE `pkg_method_pay` ( PRIMARY KEY (`id`), KEY `fk_pkg_user_pkg_method_pay` (`id_user`), CONSTRAINT `fk_pkg_user_pkg_method_pay` FOREIGN KEY (`id_user`) REFERENCES `pkg_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1687,7 +1736,7 @@ CREATE TABLE `pkg_method_pay` ( LOCK TABLES `pkg_method_pay` WRITE; /*!40000 ALTER TABLE `pkg_method_pay` DISABLE KEYS */; -INSERT INTO `pkg_method_pay` VALUES (1,1,'Pagseguro','Pagseguro','Brasil',0,0,'','','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(3,1,'Moip','Moip','Brasil',0,0,'','https://www.moip.com.br/PagamentoMoIP.do','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,id_user,show_name,country,active,min,max,username,url'),(4,1,'Paypal','Paypal','Global',0,0,'','https://www.paypal.com/cgi-bin/webscr','your@paypal.email','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,500,'payment_method,show_name,id_user,country,active,min,max,username,url,fee'),(5,1,'CuentaDigital','PagoFacil o Rapipago','Argentina',0,0,'','http://www.cuentadigital.com/api.php','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,url'),(6,1,'DineroMail','Tarjeta de crédito, DineroMail','Brasil',0,0,'','https://argentina.dineromail.com/Shop/Shop_Ingreso.asp','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,min,max,username,url'),(7,1,'PlacetoPay','PlacetoPay','Brasil',0,0,'','','','',0,'','','','','','','','','','','','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,P2P_CustomerSiteID,P2P_KeyID,P2P_Passphrase,P2P_RecipientKeyID,P2P_tax_amount'),(8,1,'GerenciaNet','GerenciaNet','Brasil',0,0,'','','','',0,'','','','','','','','','','','','','','','','','','','','',NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,client_id,client_secret'),(9,1,'Pagseguro','Pagseguro','Brasil',0,0,'','','','',0,'','Banco do Brasil','','','','','','','','','','','','','','','','','','','','','',0,'',10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(10,1,'MercadoPago','MercadoPago','Brasil',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,20,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(11,1,'paghiper','Boleto Bancario paghiper','Brasil',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(12,1,'MercadoPago','MercadoPago','Brasil',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(13,1,'molpay','MoPay','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN,P2P_RecipientKeyID'),(14,1,'Sagepay','sagepay','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,P2P_KeyID,client_id'),(15,1,'Stripe','Stripe','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,client_id,client_secret'),(16,1,'Elavon','Elavon','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,client_id,client_secret'),(17,1,'cryptocurrency','BITCOIN','Global',1,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0','','',NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,client_id,client_secret'); +INSERT INTO `pkg_method_pay` VALUES (1,1,'Pagseguro','Pagseguro','Brasil',0,0,'','','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(3,1,'Moip','Moip','Brasil',0,0,'','https://www.moip.com.br/PagamentoMoIP.do','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,id_user,show_name,country,active,min,max,username,url'),(4,1,'Paypal','Paypal','Global',0,0,'','https://www.paypal.com/cgi-bin/webscr','your@paypal.email','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,500,'payment_method,show_name,id_user,country,active,min,max,username,url,fee'),(5,1,'CuentaDigital','PagoFacil o Rapipago','Argentina',0,0,'','http://www.cuentadigital.com/api.php','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,url'),(6,1,'DineroMail','Tarjeta de crédito, DineroMail','Brasil',0,0,'','https://argentina.dineromail.com/Shop/Shop_Ingreso.asp','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,min,max,username,url'),(7,1,'PlacetoPay','PlacetoPay','Brasil',0,0,'','','','',0,'','','','','','','','','','','','','','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,P2P_CustomerSiteID,P2P_KeyID,P2P_Passphrase,P2P_RecipientKeyID,P2P_tax_amount'),(8,1,'GerenciaNet','GerenciaNet','Brasil',0,0,'','','','',0,'','','','','','','','','','','','','','','','','','','','',NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,client_id,client_secret'),(9,1,'Pagseguro','Pagseguro','Brasil',0,0,'','','','',0,'','Banco do Brasil','','','','','','','','','','','','','','','','','','','','','',0,'',10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(10,1,'MercadoPago','MercadoPago','Brasil',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,20,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(11,1,'paghiper','Boleto Bancario paghiper','Brasil',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(12,1,'MercadoPago','MercadoPago','Brasil',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN'),(13,1,'molpay','MoPay','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,pagseguro_TOKEN,P2P_RecipientKeyID'),(14,1,'Sagepay','sagepay','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,P2P_KeyID,client_id'),(15,1,'Stripe','Stripe','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,client_id,client_secret'),(16,1,'Elavon','Elavon','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,client_id,client_secret'),(17,1,'cryptocurrency','BITCOIN','Global',1,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0','','',NULL,NULL,NULL,NULL,NULL,10,500,'payment_method,show_name,id_user,country,active,min,max,username,client_id,client_secret'),(18,1,'Custom','Custom Method','Global',0,0,NULL,'','','',0,'','','','','','','','','','','','','','','','','','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,10,'payment_method,show_name,id_user,country,active,min,max,min,max,username,url'); /*!40000 ALTER TABLE `pkg_method_pay` ENABLE KEYS */; UNLOCK TABLES; @@ -1708,7 +1757,7 @@ CREATE TABLE `pkg_module` ( PRIMARY KEY (`id`), KEY `fk_pkg_module_pkg_module` (`id_module`), CONSTRAINT `fk_pkg_module_pkg_module` FOREIGN KEY (`id_module`) REFERENCES `pkg_module` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=113 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1717,10 +1766,38 @@ CREATE TABLE `pkg_module` ( LOCK TABLES `pkg_module` WRITE; /*!40000 ALTER TABLE `pkg_module` DISABLE KEYS */; -INSERT INTO `pkg_module` VALUES (1,'t(\'Clients\')',NULL,'x-fa fa-arrow-right',NULL,1),(3,'t(\'Group Users\')','groupuser','x-fa fa-desktop',12,2),(4,'t(\'Menus\')','module','x-fa fa-desktop',12,1),(5,'t(\'DIDs\')',NULL,'x-fa fa-arrow-right',NULL,3),(6,'t(\'Configuration\')','configuration','x-fa fa-desktop',12,3),(7,'t(\'Billing\')',NULL,'x-fa fa-arrow-right',NULL,2),(8,'t(\'Rates\')',NULL,'x-fa fa-arrow-right',NULL,4),(9,'t(\'Reports\')',NULL,'x-fa fa-arrow-right',NULL,5),(10,'t(\'Routes\')',NULL,'x-fa fa-arrow-right',NULL,6),(12,'t(\'Settings\')',NULL,'x-fa fa-arrow-right',NULL,7),(13,'t(\'Voice Broadcasting\')',NULL,'x-fa fa-arrow-right',NULL,8),(14,'t(\'CallShop\')',NULL,'x-fa fa-arrow-right',NULL,9),(15,'t(\'Users\')','user','x-fa fa-desktop',1,1),(16,'t(\'Providers\')','provider','x-fa fa-desktop',10,1),(17,'t(\'Trunks\')','trunk','x-fa fa-desktop',10,2),(19,'t(\'SIP Users\')','sip','x-fa fa-desktop',1,2),(20,'t(\'ATA Linksys\')','sipuras','x-fa fa-desktop',1,5),(21,'t(\'Calls Online\')','callonline','x-fa fa-desktop',1,3),(22,'t(\'CallerID\')','callerid','x-fa fa-desktop',1,4),(23,'t(\'Refills\')','refill','x-fa fa-desktop',7,1),(25,'t(\'Payment Methods\')','methodpay','x-fa fa-desktop',7,2),(26,'t(\'Voucher\')','voucher','x-fa fa-desktop',7,3),(27,'t(\'Refill Providers\')','refillprovider','x-fa fa-desktop',7,4),(28,'t(\'Plans\')','plan','x-fa fa-desktop',8,1),(29,'t(\'Tariffs\')','rate','x-fa fa-desktop',8,2),(30,'t(\'CDR\')','call','x-fa fa-desktop',9,1),(31,'t(\'DIDs\')','did','x-fa fa-desktop',5,1),(32,'t(\'DID Destination\')','diddestination','x-fa fa-desktop',5,2),(33,'t(\'Prefixes\')','prefix','x-fa fa-desktop',8,3),(34,'t(\'Offers\')','offer','x-fa fa-desktop',8,5),(36,'t(\'DIDs Use\')','diduse','x-fa fa-desktop',5,3),(40,'t(\'Summary per Day\')','callsummaryperday','x-fa fa-desktop',9,3),(41,'t(\'Campaigns\')','campaign','x-fa fa-desktop',13,1),(42,'t(\'Polls\')','campaignpoll','x-fa fa-desktop',13,4),(43,'t(\'Phonebooks\')','phonebook','x-fa fa-desktop',13,2),(44,'t(\'Phonenumbers\')','phonenumber','x-fa fa-desktop',13,3),(45,'t(\'Offer CDR\')','offercdr','x-fa fa-desktop',8,6),(46,'t(\'Offer Use\')','offeruse','x-fa fa-desktop',8,7),(48,'t(\'Restricted Number\')','restrictedphonenumber','x-fa fa-desktop',1,6),(49,'t(\'SMS\')','sms','x-fa fa-desktop',13,7),(50,'t(\'Booths\')','callshop','x-fa fa-desktop',14,1),(51,'t(\'Booths Report\')','callshopcdr','x-fa fa-desktop',14,2),(53,'t(\'Booths Tariffs\')','ratecallshop','x-fa fa-desktop',14,3),(54,'t(\'Emails Templates\')','templatemail','x-fa fa-desktop',12,4),(55,'t(\'Callback\')','callback','x-fa fa-desktop',1,7),(56,'t(\'IVRs\')','ivr','x-fa fa-desktop',5,4),(57,'t(\'Polls Reports\')','campaignpollinfo','x-fa fa-desktop',13,5),(58,'t(\'Queues\')','queue','x-fa fa-desktop',5,5),(59,'t(\'Queues Members\')','queuemember','x-fa fa-desktop',5,6),(60,'t(\'Summary per Month\')','callsummarypermonth','x-fa fa-desktop',9,7),(61,'t(\'Buy Credit\')','buycredit','x-fa fa-desktop',1,8),(62,'t(\'Restrict Phone\')','campaignrestrictphone','x-fa fa-desktop',13,6),(63,'t(\'Quick Campaign\')','campaignsend','x-fa fa-desktop',13,8),(64,'t(\'Log Users\')','logusers','x-fa fa-desktop',12,5),(65,'t(\'Call per Minutes\')','campaignlog','x-fa fa-desktop',12,10),(66,'t(\'User Custom Rates\')','userrate','x-fa fa-desktop',8,4),(67,'t(\'CDR Failed\')','callfailed','x-fa fa-desktop',9,2),(68,'t(\'Buy DID\')','didbuy','x-fa fa-desktop',5,7),(69,'t(\'Extra\')','extra','x-fa fa-desktop',12,69),(71,'t(\'Dashboard\')','dashboard','x-fa fa-desktop',12,9),(72,'t(\'SMTP\')','smtps','x-fa fa-desktop',12,6),(73,'t(\'Summary per Day\')','callsummarycallshop','x-fa fa-desktop',14,4),(77,'t(\'Servers\')','servers','x-fa fa-desktop',10,5),(78,'t(\'Queue DashBoard\')','dashboardqueue','x-fa fa-desktop',5,8),(79,'t(\'Send Credit\')','transfertomobile','x-fa fa-desktop',1,11),(80,'t(\'Summary per User\')','callsummaryperuser','x-fa fa-desktop',9,10),(82,'t(\'Fail2ban\')','firewall','x-fa fa-desktop',12,7),(83,'t(\'Iax\')','iax','x-fa fa-desktop',1,9),(85,'t(\'Services\')',NULL,'x-fa fa-arrow-right',NULL,10),(86,'t(\'Services\')','services','x-fa fa-desktop',85,1),(87,'t(\'Services Use\')','servicesuse','x-fa fa-desktop',85,2),(88,'t(\'Send Credit Summary\')','sendcreditsummary','x-fa fa-desktop',9,13),(89,'t(\'Summary per Trunk\')','callsummarypertrunk','x-fa fa-desktop',9,11),(90,'t(\'Summary Day User\')','callsummarydayuser','x-fa fa-desktop',9,4),(91,'t(\'Summary Day Trunk\')','callsummarydaytrunk','x-fa fa-desktop',9,5),(92,'t(\'Summary Day Agent\')','callsummarydayagent','x-fa fa-desktop',9,6),(93,'t(\'Summary Month User\')','callsummarymonthuser','x-fa fa-desktop',9,8),(94,'t(\'Summary Month Trunk\')','callsummarymonthtrunk','x-fa fa-desktop',9,9),(95,'t(\'Call Archive\')','callarchive','x-fa fa-desktop',9,12),(96,'t(\'API\')','api','x-fa fa-desktop',12,8),(97,'t(\'Provider Rates\')','rateprovider','x-fa fa-desktop',10,4),(98,'t(\'Group to Admins\')','groupusergroup','x-fa fa-desktop',12,11),(99,'t(\'DIDww\')','didww','x-fa fa-desktop',5,10),(100,'t(\'Extra2\')','extra2','x-fa fa-desktop',12,10),(101,'t(\'Extra3\')','extra3','x-fa fa-desktop',12,11),(102,'t(\'Trunk Groups\')','trunkgroup','x-fa fa-desktop',10,3),(103,'t(\'Campaigns DashBoard\')','campaigndashboard','x-fa fa-desktop',13,11),(104,'t(\'Backup\')','backup','x-fa fa-desktop',12,15),(105,'t(\'Campaign Report\')','campaignreport','x-fa fa-desktop',13,12),(106,'t(\'Holidays\')','holidays','x-fa fa-desktop',5,11),(107,'t(\'Alarms\')','alarm','x-fa fa-desktop',12,16),(108,'t(\'Summary Month DID\')','callsummarymonthdid','x-fa fa-desktop',9,14),(109,'t(\'Trunk Errors\')','trunksipcodes','x-fa fa-desktop',10,7); +INSERT INTO `pkg_module` VALUES (1,'t(\'Clients\')',NULL,'x-fa fa-arrow-right',NULL,1),(3,'t(\'Group Users\')','groupuser','x-fa fa-desktop',12,2),(4,'t(\'Menus\')','module','x-fa fa-desktop',12,1),(5,'t(\'DIDs\')',NULL,'x-fa fa-arrow-right',NULL,3),(6,'t(\'Configuration\')','configuration','x-fa fa-desktop',12,3),(7,'t(\'Billing\')',NULL,'x-fa fa-arrow-right',NULL,2),(8,'t(\'Rates\')',NULL,'x-fa fa-arrow-right',NULL,4),(9,'t(\'Reports\')',NULL,'x-fa fa-arrow-right',NULL,5),(10,'t(\'Routes\')',NULL,'x-fa fa-arrow-right',NULL,6),(12,'t(\'Settings\')',NULL,'x-fa fa-arrow-right',NULL,7),(13,'t(\'Voice Broadcasting\')',NULL,'x-fa fa-arrow-right',NULL,8),(14,'t(\'CallShop\')',NULL,'x-fa fa-arrow-right',NULL,9),(15,'t(\'Users\')','user','x-fa fa-desktop',1,1),(16,'t(\'Providers\')','provider','x-fa fa-desktop',10,1),(17,'t(\'Trunks\')','trunk','x-fa fa-desktop',10,2),(19,'t(\'SIP Users\')','sip','x-fa fa-desktop',1,2),(20,'t(\'ATA Linksys\')','sipuras','x-fa fa-desktop',1,5),(21,'t(\'Calls Online\')','callonline','x-fa fa-desktop',1,3),(22,'t(\'CallerID\')','callerid','x-fa fa-desktop',1,4),(23,'t(\'Refills\')','refill','x-fa fa-desktop',7,1),(25,'t(\'Payment Methods\')','methodpay','x-fa fa-desktop',7,2),(26,'t(\'Voucher\')','voucher','x-fa fa-desktop',7,3),(27,'t(\'Refill Providers\')','refillprovider','x-fa fa-desktop',7,4),(28,'t(\'Plans\')','plan','x-fa fa-desktop',8,1),(29,'t(\'Tariffs\')','rate','x-fa fa-desktop',8,2),(30,'t(\'CDR\')','call','x-fa fa-desktop',9,1),(31,'t(\'DIDs\')','did','x-fa fa-desktop',5,1),(32,'t(\'DID Destination\')','diddestination','x-fa fa-desktop',5,2),(33,'t(\'Prefixes\')','prefix','x-fa fa-desktop',8,3),(34,'t(\'Offers\')','offer','x-fa fa-desktop',8,5),(36,'t(\'DIDs Use\')','diduse','x-fa fa-desktop',5,3),(40,'t(\'Summary per Day\')','callsummaryperday','x-fa fa-desktop',9,3),(41,'t(\'Campaigns\')','campaign','x-fa fa-desktop',13,1),(42,'t(\'Polls\')','campaignpoll','x-fa fa-desktop',13,4),(43,'t(\'Phonebooks\')','phonebook','x-fa fa-desktop',13,2),(44,'t(\'Phonenumbers\')','phonenumber','x-fa fa-desktop',13,3),(45,'t(\'Offer CDR\')','offercdr','x-fa fa-desktop',8,6),(46,'t(\'Offer Use\')','offeruse','x-fa fa-desktop',8,7),(48,'t(\'Restricted Number\')','restrictedphonenumber','x-fa fa-desktop',1,6),(49,'t(\'SMS\')','sms','x-fa fa-desktop',13,7),(50,'t(\'Booths\')','callshop','x-fa fa-desktop',14,1),(51,'t(\'Booths Report\')','callshopcdr','x-fa fa-desktop',14,2),(53,'t(\'Booths Tariffs\')','ratecallshop','x-fa fa-desktop',14,3),(54,'t(\'Emails Templates\')','templatemail','x-fa fa-desktop',12,4),(55,'t(\'Callback\')','callback','x-fa fa-desktop',1,7),(56,'t(\'IVRs\')','ivr','x-fa fa-desktop',5,4),(57,'t(\'Polls Reports\')','campaignpollinfo','x-fa fa-desktop',13,5),(58,'t(\'Queues\')','queue','x-fa fa-desktop',5,5),(59,'t(\'Queues Members\')','queuemember','x-fa fa-desktop',5,6),(60,'t(\'Summary per Month\')','callsummarypermonth','x-fa fa-desktop',9,7),(61,'t(\'Buy Credit\')','buycredit','x-fa fa-desktop',1,8),(62,'t(\'Restrict Phone\')','campaignrestrictphone','x-fa fa-desktop',13,6),(63,'t(\'Quick Campaign\')','campaignsend','x-fa fa-desktop',13,8),(64,'t(\'Log Users\')','logusers','x-fa fa-desktop',12,5),(65,'t(\'Call per Minutes\')','campaignlog','x-fa fa-desktop',12,10),(66,'t(\'User Custom Rates\')','userrate','x-fa fa-desktop',8,4),(67,'t(\'CDR Failed\')','callfailed','x-fa fa-desktop',9,2),(68,'t(\'Buy DID\')','didbuy','x-fa fa-desktop',5,7),(69,'t(\'Extra\')','extra','x-fa fa-desktop',12,69),(71,'t(\'Dashboard\')','dashboard','x-fa fa-desktop',12,9),(72,'t(\'SMTP\')','smtps','x-fa fa-desktop',12,6),(73,'t(\'Summary per Day\')','callsummarycallshop','x-fa fa-desktop',14,4),(77,'t(\'Servers\')','servers','x-fa fa-desktop',10,5),(78,'t(\'Queue DashBoard\')','dashboardqueue','x-fa fa-desktop',5,8),(79,'t(\'Send Credit\')','transfertomobile','x-fa fa-desktop',1,11),(80,'t(\'Summary per User\')','callsummaryperuser','x-fa fa-desktop',9,10),(82,'t(\'Fail2ban\')','firewall','x-fa fa-desktop',12,7),(83,'t(\'Iax\')','iax','x-fa fa-desktop',1,9),(85,'t(\'Services\')',NULL,'x-fa fa-arrow-right',NULL,10),(86,'t(\'Services\')','services','x-fa fa-desktop',85,1),(87,'t(\'Services Use\')','servicesuse','x-fa fa-desktop',85,2),(88,'t(\'Send Credit Summary\')','sendcreditsummary','x-fa fa-desktop',9,13),(89,'t(\'Summary per Trunk\')','callsummarypertrunk','x-fa fa-desktop',9,11),(90,'t(\'Summary Day User\')','callsummarydayuser','x-fa fa-desktop',9,4),(91,'t(\'Summary Day Trunk\')','callsummarydaytrunk','x-fa fa-desktop',9,5),(92,'t(\'Summary Day Agent\')','callsummarydayagent','x-fa fa-desktop',9,6),(93,'t(\'Summary Month User\')','callsummarymonthuser','x-fa fa-desktop',9,8),(94,'t(\'Summary Month Trunk\')','callsummarymonthtrunk','x-fa fa-desktop',9,9),(95,'t(\'Call Archive\')','callarchive','x-fa fa-desktop',9,12),(96,'t(\'API\')','api','x-fa fa-desktop',12,8),(97,'t(\'Provider Rates\')','rateprovider','x-fa fa-desktop',10,4),(98,'t(\'Group to Admins\')','groupusergroup','x-fa fa-desktop',12,11),(99,'t(\'DIDww\')','didww','x-fa fa-desktop',5,10),(100,'t(\'Extra2\')','extra2','x-fa fa-desktop',12,10),(101,'t(\'Extra3\')','extra3','x-fa fa-desktop',12,11),(102,'t(\'Trunk Groups\')','trunkgroup','x-fa fa-desktop',10,3),(103,'t(\'Campaigns DashBoard\')','campaigndashboard','x-fa fa-desktop',13,11),(104,'t(\'Backup\')','backup','x-fa fa-desktop',12,15),(105,'t(\'Campaign Report\')','campaignreport','x-fa fa-desktop',13,12),(106,'t(\'Holidays\')','holidays','x-fa fa-desktop',5,11),(107,'t(\'Alarms\')','alarm','x-fa fa-desktop',12,16),(108,'t(\'Summary Month DID\')','callsummarymonthdid','x-fa fa-desktop',9,14),(109,'t(\'Trunk Errors\')','trunksipcodes','x-fa fa-desktop',10,7),(110,'t(\'Provider CNL\')','providercnl','x-fa fa-desktop',10,7),(111,'t(\'User History\')','userhistory','x-fa fa-desktop',1,12),(112,'t(\'DID History\')','didhistory','x-fa fa-desktop',5,12); /*!40000 ALTER TABLE `pkg_module` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `pkg_module_extra` +-- + +DROP TABLE IF EXISTS `pkg_module_extra`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pkg_module_extra` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `id_module` int(11) NOT NULL, + `type` varchar(10) DEFAULT NULL, + `description` text NOT NULL, + PRIMARY KEY (`id`), + KEY `pkg_module_extra_id_module` (`id_module`), + KEY `type` (`type`), + CONSTRAINT `fk_pkg_module_pkg_module_extra` FOREIGN KEY (`id_module`) REFERENCES `pkg_module` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pkg_module_extra` +-- + +LOCK TABLES `pkg_module_extra` WRITE; +/*!40000 ALTER TABLE `pkg_module_extra` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_module_extra` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `pkg_offer` -- @@ -1730,6 +1807,7 @@ DROP TABLE IF EXISTS `pkg_offer`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `pkg_offer` ( `id` int(11) NOT NULL AUTO_INCREMENT, + `id_user` int(11) DEFAULT NULL, `creationdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `label` varchar(70) NOT NULL, `packagetype` int(11) NOT NULL, @@ -1740,7 +1818,9 @@ CREATE TABLE `pkg_offer` ( `initblock` int(11) NOT NULL DEFAULT '60', `billingblock` int(11) NOT NULL DEFAULT '60', `minimal_time_charge` int(2) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `fk_pkg_user_pkg_offer` (`id_user`), + CONSTRAINT `fk_pkg_user_pkg_offer` FOREIGN KEY (`id_user`) REFERENCES `pkg_user` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1997,6 +2077,34 @@ LOCK TABLES `pkg_provider` WRITE; /*!40000 ALTER TABLE `pkg_provider` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `pkg_provider_cnl` +-- + +DROP TABLE IF EXISTS `pkg_provider_cnl`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pkg_provider_cnl` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `id_provider` int(11) NOT NULL, + `cnl` int(11) NOT NULL, + `zone` varchar(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `id_provider` (`id_provider`), + KEY `cnl` (`cnl`), + CONSTRAINT `fk_pkg_provider_pkg_provider_cnl` FOREIGN KEY (`id_provider`) REFERENCES `pkg_provider` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pkg_provider_cnl` +-- + +LOCK TABLES `pkg_provider_cnl` WRITE; +/*!40000 ALTER TABLE `pkg_provider_cnl` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_provider_cnl` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `pkg_queue` -- @@ -2220,6 +2328,7 @@ CREATE TABLE `pkg_rate_agent` ( `initblock` int(11) NOT NULL DEFAULT '0', `billingblock` int(11) NOT NULL DEFAULT '0', `minimal_time_charge` smallint(2) NOT NULL DEFAULT '0', + `package_offer` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `fk_pkg_plan_pkg_rate_agent` (`id_plan`), KEY `fk_pkg_prefix_pkg_rate_agent` (`id_prefix`), @@ -2401,7 +2510,7 @@ DROP TABLE IF EXISTS `pkg_restrict_phone`; CREATE TABLE `pkg_restrict_phone` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_user` int(11) NOT NULL, - `number` bigint(20) NOT NULL, + `number` varchar(20) NOT NULL, `direction` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), KEY `fk_pkg_user_pkg_restricted_phonenumber` (`id_user`), @@ -2439,10 +2548,17 @@ CREATE TABLE `pkg_send_credit` ( `count` int(11) DEFAULT NULL, `confirmed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `pkg_send_credit` +-- +LOCK TABLES `pkg_send_credit` WRITE; +/*!40000 ALTER TABLE `pkg_send_credit` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_send_credit` ENABLE KEYS */; +UNLOCK TABLES; -- -- Table structure for table `pkg_servers` @@ -2579,10 +2695,13 @@ CREATE TABLE `pkg_services_use` ( `id_services` int(11) NOT NULL, `reservationdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `releasedate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `contract_period` datetime DEFAULT NULL, + `termination_date` date DEFAULT NULL, `status` int(11) DEFAULT '0', `month_payed` int(11) DEFAULT '0', `reminded` tinyint(4) NOT NULL DEFAULT '0', `id_method` int(11) DEFAULT NULL, + `next_due_date` varchar(30) DEFAULT '', PRIMARY KEY (`id`), KEY `fk_pkg_user_pkg_services_use` (`id_user`), KEY `fk_pkg_services_pkg_services_use` (`id_services`), @@ -2692,6 +2811,9 @@ CREATE TABLE `pkg_sip` ( `addparameter` varchar(50) NOT NULL DEFAULT '', `amd` int(11) NOT NULL DEFAULT '0', `sip_config` text, + `description` varchar(150) DEFAULT NULL, + `id_trunk_group` int(11) DEFAULT NULL, + `cnl` varchar(11) NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `techprefix` (`techprefix`), KEY `host` (`host`), @@ -2921,9 +3043,10 @@ CREATE TABLE `pkg_sms` ( `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `telephone` varchar(50) NOT NULL DEFAULT '', `sms` mediumtext NOT NULL, - `result` varchar(50) NOT NULL DEFAULT '', + `status` int(11) NOT NULL DEFAULT '0', `rate` decimal(15,5) NOT NULL DEFAULT '0.00000', `sms_from` varchar(16) DEFAULT NULL, + `result` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_pkg_user_pkg_sms` (`id_user`), KEY `prefix` (`prefix`), @@ -2993,11 +3116,17 @@ CREATE TABLE `pkg_status_system` ( `cps` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `date` (`date`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `pkg_status_system` +-- - +LOCK TABLES `pkg_status_system` WRITE; +/*!40000 ALTER TABLE `pkg_status_system` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_status_system` ENABLE KEYS */; +UNLOCK TABLES; -- -- Table structure for table `pkg_templatemail` @@ -3017,7 +3146,7 @@ CREATE TABLE `pkg_templatemail` ( `language` varchar(5) DEFAULT 'br', `status` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3081,6 +3210,9 @@ CREATE TABLE `pkg_trunk` ( `port` varchar(5) NOT NULL DEFAULT '5060', `sendrpid` varchar(10) NOT NULL DEFAULT 'no', `sip_config` text, + `cnl` int(11) NOT NULL DEFAULT '0', + `cid_add` varchar(11) NOT NULL DEFAULT '', + `cid_remove` varchar(11) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `fk_pkg_provider_pkg_trunk` (`id_provider`), KEY `fk_pkg_trunk_pkg_trunk` (`failover_trunk`), @@ -3136,6 +3268,7 @@ CREATE TABLE `pkg_trunk_group` ( `name` varchar(100) NOT NULL, `type` int(11) NOT NULL DEFAULT '1', `description` text, + `weight` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -3161,6 +3294,7 @@ CREATE TABLE `pkg_trunk_group_trunk` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_trunk_group` int(11) NOT NULL, `id_trunk` int(11) NOT NULL, + `weight` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `id_trunk_group` (`id_trunk_group`), KEY `id_trunk` (`id_trunk`), @@ -3211,14 +3345,14 @@ CREATE TABLE `pkg_user` ( `zipcode` varchar(20) DEFAULT '', `phone` varchar(50) NOT NULL DEFAULT '', `mobile` varchar(20) DEFAULT '', - `email` varchar(50) NOT NULL DEFAULT '', + `email` varchar(100) NOT NULL DEFAULT '', `vat` varchar(50) DEFAULT NULL, `company_name` varchar(100) DEFAULT NULL, `commercial_name` varchar(100) DEFAULT NULL, `company_website` varchar(60) DEFAULT NULL, `state_number` varchar(40) DEFAULT NULL, `dist` varchar(100) DEFAULT NULL, - `contract_value` int(11) DEFAULT '0', + `contract_value` float DEFAULT '0', `lastuse` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `typepaid` tinyint(1) DEFAULT '0', `creditlimit` int(11) NOT NULL DEFAULT '0', @@ -3237,7 +3371,7 @@ CREATE TABLE `pkg_user` ( `active_paypal` tinyint(1) NOT NULL DEFAULT '0', `boleto` tinyint(1) NOT NULL DEFAULT '0', `boleto_day` smallint(2) DEFAULT NULL, - `description` varchar(100) DEFAULT NULL, + `description` varchar(500) DEFAULT NULL, `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `googleAuthenticator_enable` tinyint(1) NOT NULL DEFAULT '0', `google_authenticator_key` varchar(50) NOT NULL DEFAULT '', @@ -3259,6 +3393,7 @@ CREATE TABLE `pkg_user` ( `transfer_bkash` tinyint(1) DEFAULT '0', `transfer_flexiload` tinyint(1) DEFAULT '0', `transfer_international` tinyint(1) DEFAULT '0', + `restriction_use` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `callingcard_pin` (`callingcard_pin`), KEY `fk_pkg_group_user_pkg_user` (`id_group`), @@ -3279,10 +3414,37 @@ CREATE TABLE `pkg_user` ( LOCK TABLES `pkg_user` WRITE; /*!40000 ALTER TABLE `pkg_user` DISABLE KEYS */; -INSERT INTO `pkg_user` VALUES (1,1,1,NULL,NULL,NULL,'root','9f4ca770b638615ac5c3e0d2da16b77c80c2f2c6',0.0000,1,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,'','','','',NULL,'','','','','','','0','',NULL,'',NULL,NULL,0,'0000-00-00 00:00:00',0,0,'en','','',NULL,10,0,0,534565,'21','0',1,0,0,0,0,'','0000-00-00 00:00:00',0,'',NULL,NULL,-1,-1,-1,-1,'503','gsm',0,0,0,0,0,0,0,0,0,0); +INSERT INTO `pkg_user` VALUES (1,1,1,NULL,NULL,NULL,'root','9f4ca770b638615ac5c3e0d2da16b77c80c2f2c6',0.0000,1,'0000-00-00 00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00',0,0,'','','','',NULL,'','','','','','','0','',NULL,'',NULL,NULL,0,'0000-00-00 00:00:00',0,0,'en','','',NULL,10,0,0,534565,'21','0',1,0,0,0,0,'','0000-00-00 00:00:00',0,'',NULL,NULL,-1,-1,-1,-1,'503','gsm',0,0,0,0,0,0,0,0,0,0,1); /*!40000 ALTER TABLE `pkg_user` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `pkg_user_history` +-- + +DROP TABLE IF EXISTS `pkg_user_history`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pkg_user_history` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `id_user` int(11) NOT NULL, + `description` mediumtext, + `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `fk_pkg_user_pkg_user_history` (`id_user`), + CONSTRAINT `fk_pkg_user_pkg_user_history` FOREIGN KEY (`id_user`) REFERENCES `pkg_user` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pkg_user_history` +-- + +LOCK TABLES `pkg_user_history` WRITE; +/*!40000 ALTER TABLE `pkg_user_history` DISABLE KEYS */; +/*!40000 ALTER TABLE `pkg_user_history` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `pkg_user_rate` -- @@ -3425,4 +3587,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-12-08 16:00:37 +-- Dump completed on 2023-03-14 11:24:11