-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.xml
103 lines (98 loc) · 5.01 KB
/
install.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="utf-8"?>
<dleplugin>
<name>DLE Billing</name>
<description>Автоматизируйте прием платежей на сайте с помощью модуля DLE Billing</description>
<icon>engine/skins/billing/icons/billing.png</icon>
<version>1.0.1</version>
<dleversion>13.0</dleversion>
<versioncompare>greater</versioncompare>
<upgradeurl>https://dle-billing.ru/update.json</upgradeurl>
<filedelete>1</filedelete>
<needplugin></needplugin>
<mnotice>1</mnotice>
<mysqlinstall><![CDATA[CREATE TABLE IF NOT EXISTS `{prefix}_billing_history`(
`history_id` int(11) NOT NULL AUTO_INCREMENT,
`history_plugin` varchar(21) NOT NULL,
`history_plugin_id` int(11) NOT NULL,
`history_user_name` varchar(40) NOT NULL,
`history_plus` decimal(10,2) NOT NULL,
`history_minus` decimal(10,2) NOT NULL,
`history_balance` decimal(10,2) NOT NULL,
`history_currency` varchar(100) NOT NULL,
`history_text` text NOT NULL,
`history_date` int(11) NOT NULL,
PRIMARY KEY (`history_id`)
) ENGINE={engine} DEFAULT CHARSET={charset} AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `{prefix}_billing_invoice` (
`invoice_id` int(11) NOT NULL AUTO_INCREMENT,
`invoice_paysys` varchar(21) NOT NULL,
`invoice_user_name` varchar(40) NOT NULL,
`invoice_get` decimal(10,2) NOT NULL,
`invoice_pay` decimal(10,2) NOT NULL,
`invoice_date_creat` int(11) NOT NULL,
`invoice_date_pay` int(11) NOT NULL,
`invoice_payer_requisites` varchar(40) NOT NULL,
`invoice_payer_info` text NOT NULL,
`invoice_handler` text NOT NULL,
PRIMARY KEY (`invoice_id`)
) ENGINE={engine} DEFAULT CHARSET={charset} AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `{prefix}_billing_refund` (
`refund_id` int(11) NOT NULL AUTO_INCREMENT,
`refund_date` int(11) NOT NULL,
`refund_user` varchar(40) NOT NULL,
`refund_summa` decimal(10,2) NOT NULL,
`refund_commission` decimal(10,2) NOT NULL,
`refund_requisites` text NOT NULL,
`refund_date_return` int(11) NOT NULL,
`refund_date_cancel` int(11) NOT NULL,
PRIMARY KEY (`refund_id`)
) ENGINE={engine} DEFAULT CHARSET={charset} AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS `{prefix}_billing_coupons` (
`coupon_id` int(11) NOT NULL AUTO_INCREMENT,
`coupon_use` varchar(40) NOT NULL,
`coupon_time_end` int(11) NOT NULL,
`coupon_type` int(11) NOT NULL,
`coupon_value` float NOT NULL,
`coupon_key` varchar(24) NOT NULL,
PRIMARY KEY (`coupon_id`)
) ENGINE={engine} DEFAULT CHARSET={charset} AUTO_INCREMENT=1;
ALTER TABLE `{prefix}_users` ADD `user_balance` decimal(10,2) NOT NULL;
INSERT INTO `{prefix}_static` (`name`, `descr`, `template`, `allow_br`, `allow_template`, `grouplevel`, `tpl`, `metadescr`, `metakeys`, `views`, `template_folder`, `date`, `metatitle`, `allow_count`, `sitemap`, `disable_index`) VALUES ('billing', 'Личный кабинет', 'billing/cabinet', 1, 1, 'all', 'billing', 'billing/cabinet', 'cabinet, billing', 0, '', unix_timestamp(), '', 1, 1, 1);]]></mysqlinstall>
<mysqlupgrade><![CDATA[]]></mysqlupgrade>
<mysqlenable><![CDATA[INSERT INTO `{prefix}_admin_sections` (`name`, `title`, `descr`, `icon`, `allow_groups`) VALUES ('billing', 'DLE Billing', 'Автоматизируйте прием платежей на сайте с помощью модуля DLE-Billing', 'engine/skins/billing/icons/billing.png', '1');]]></mysqlenable>
<mysqldisable><![CDATA[DELETE FROM `{prefix}_admin_sections` WHERE name = 'billing';]]></mysqldisable>
<mysqldelete><![CDATA[DROP TABLE IF EXISTS `{prefix}_billing_history`;
DROP TABLE IF EXISTS `{prefix}_billing_invoice`;
DROP TABLE IF EXISTS `{prefix}_billing_refund`;
DROP TABLE IF EXISTS `{prefix}_billing_coupons`;
DELETE FROM `{prefix}_admin_sections` WHERE name = 'billing';
ALTER TABLE `{prefix}_users` DROP COLUMN `user_balance`;
DELETE FROM `{prefix}_static` WHERE name = 'billing';]]></mysqldelete>
<phpinstall><![CDATA[]]></phpinstall>
<phpupgrade><![CDATA[]]></phpupgrade>
<phpenable><![CDATA[]]></phpenable>
<phpdisable><![CDATA[]]></phpdisable>
<phpdelete><![CDATA[@unlink(ROOT_DIR . "/engine/data/billing/config.php");]]></phpdelete>
<notice><![CDATA[]]></notice>
<file name="engine/classes/templates.class.php">
<operation action="before">
<searchcode><![CDATA[$this->_clear();]]></searchcode>
<replacecode><![CDATA[include( ENGINE_DIR . "/modules/billing/helpers/include.template.php" );]]></replacecode>
<enabled>1</enabled>
</operation>
</file>
<file name="engine/engine.php">
<operation action="before">
<searchcode><![CDATA[switch ( $do ) {]]></searchcode>
<replacecode><![CDATA[include( ENGINE_DIR . "/modules/billing/helpers/include.engine.php" );]]></replacecode>
<enabled>1</enabled>
</operation>
</file>
<file name="engine/modules/register.php">
<operation action="after">
<searchcode><![CDATA[$id = $db->insert_id();]]></searchcode>
<replacecode><![CDATA[require_once ENGINE_DIR . '/modules/billing/plugins/referrals/register.php';]]></replacecode>
<enabled>1</enabled>
</operation>
</file>
</dleplugin>