Просмотр исходного кода

Ticket #363 - for the other content related modules.

AntonLV 9 лет назад
Родитель
Сommit
ec32bf56eb

+ 3 - 0
modules/boonex/albums/install/sql/disable.sql

@@ -33,6 +33,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_albums', 'bx_albums_
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_albums');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` IN ('bx_albums', 'bx_albums_media');
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_albums_administration', 'bx_albums_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_albums_administration', 'bx_albums_common');

+ 6 - 0
modules/boonex/albums/install/sql/enable.sql

@@ -363,6 +363,12 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_albums', 'bx_albums_administration', 'id', '', ''),
 ('bx_albums', 'bx_albums_common', 'id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_albums', '_bx_albums', 'bx_albums_albums', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', ''),
+('bx_albums_media', '_bx_albums_media', 'bx_albums_files', 'added', '', '', '', 1, @iMaxOrderCharts + 2, '', '');
+
 -- GRIDS: moderation tools
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_albums_administration', 'Sql', 'SELECT * FROM `bx_albums_albums` WHERE 1 ', 'bx_albums_albums', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxAlbumsGridAdministration', 'modules/boonex/albums/classes/BxAlbumsGridAdministration.php'),

+ 3 - 0
modules/boonex/events/install/sql/disable.sql

@@ -54,6 +54,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` = 'bx_events';
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_events');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_events';
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_events_administration', 'bx_events_moderation', 'bx_events_common', 'bx_events_fans');

+ 5 - 0
modules/boonex/events/install/sql/enable.sql

@@ -369,6 +369,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_events', 'bx_events_administration', 'td`.`id', '', ''),
 ('bx_events', 'bx_events_common', 'td`.`id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_events', '_bx_events', 'bx_events_data', 'added', '', '', '', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRID: connections
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_events_fans', 'Sql', 'SELECT `p`.`id`, `c`.`added`, `c`.`mutual` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) {join_connections}', 'sys_profiles', 'id', 'c`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 'BxEventsGridConnections', 'modules/boonex/events/classes/BxEventsGridConnections.php');

+ 3 - 0
modules/boonex/files/install/sql/disable.sql

@@ -36,6 +36,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_files', 'bx_files_cm
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_files');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_files';
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_files_administration', 'bx_files_common');

+ 5 - 0
modules/boonex/files/install/sql/enable.sql

@@ -338,6 +338,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_files', 'bx_files_administration', 'id', '', ''),
 ('bx_files', 'bx_files_common', 'id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_files', '_bx_files', 'bx_files_main', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRIDS: moderation tools
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_files_administration', 'Sql', 'SELECT * FROM `bx_files_main` WHERE 1 ', 'bx_files_main', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,desc', '', 'like', '', '', 192, 'BxFilesGridAdministration', 'modules/boonex/files/classes/BxFilesGridAdministration.php'),

+ 4 - 0
modules/boonex/forum/install/sql/disable.sql

@@ -77,6 +77,10 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN (@sName, 'bx_forum_cmts')
 DELETE FROM `sys_content_info_grids` WHERE `object` IN (@sName);
 
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = @sName;
+
+
 -- ALERTS
 SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = @sName LIMIT 1);
 DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;

+ 6 - 0
modules/boonex/forum/install/sql/enable.sql

@@ -469,6 +469,12 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 (@sName, 'bx_forum_common', 'id', '', '');
 
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+(@sName, '_bx_forum', 'bx_forum_discussions', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', '');
+
+
 -- ALERTS
 INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
 (@sName, 'BxForumAlertsResponse', 'modules/boonex/forum/classes/BxForumAlertsResponse.php', '');

+ 3 - 0
modules/boonex/groups/install/sql/disable.sql

@@ -54,6 +54,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` = 'bx_groups';
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_groups');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_groups';
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_groups_administration', 'bx_groups_moderation', 'bx_groups_common', 'bx_groups_fans');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_groups_administration', 'bx_groups_moderation', 'bx_groups_common', 'bx_groups_fans');

+ 5 - 0
modules/boonex/groups/install/sql/enable.sql

@@ -354,6 +354,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_groups', 'bx_groups_administration', 'td`.`id', '', ''),
 ('bx_groups', 'bx_groups_common', 'td`.`id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_groups', '_bx_groups', 'bx_groups_data', 'added', '', '', '', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRID: connections
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_groups_fans', 'Sql', 'SELECT `p`.`id`, `c`.`added`, `c`.`mutual` FROM `sys_profiles` AS `p` INNER JOIN `sys_accounts` AS `a` ON (`a`.`id` = `p`.`account_id`) {join_connections}', 'sys_profiles', 'id', 'c`.`added', '', '', 10, NULL, 'start', '', 'name,email', '', 'auto', '', '', 2147483647, 'BxGroupsGridConnections', 'modules/boonex/groups/classes/BxGroupsGridConnections.php');

+ 2 - 0
modules/boonex/market/install/sql/disable.sql

@@ -39,6 +39,8 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_market', 'bx_market_
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_market');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_market';
 
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_market_administration', 'bx_market_common', 'bx_market_licenses');

+ 5 - 0
modules/boonex/market/install/sql/enable.sql

@@ -415,6 +415,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_market', 'bx_market_administration', 'id', '', ''),
 ('bx_market', 'bx_market_common', 'id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_market', '_bx_market', 'bx_market_products', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRIDS: moderation tools
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_market_administration', 'Sql', 'SELECT * FROM `bx_market_products` WHERE 1 ', 'bx_market_products', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxMarketGridAdministration', 'modules/boonex/market/classes/BxMarketGridAdministration.php'),

+ 3 - 0
modules/boonex/organizations/install/sql/disable.sql

@@ -48,6 +48,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` = 'bx_organizations';
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_organizations');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_organizations';
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_organizations_administration', 'bx_organizations_moderation', 'bx_organizations_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_organizations_administration', 'bx_organizations_moderation', 'bx_organizations_common');

+ 5 - 0
modules/boonex/organizations/install/sql/enable.sql

@@ -368,6 +368,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_organizations', 'bx_organizations_administration', 'td`.`id', '', ''),
 ('bx_organizations', 'bx_organizations_common', 'td`.`id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_organizations', '_bx_orgs', 'bx_organizations_data', 'added', '', '', '', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRIDS: administration
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_organizations_administration', 'Sql', 'SELECT `td`.*, `td`.`org_name` AS `fullname`, `ta`.`email` AS `account`, `ta`.`logged` AS `last_online`, `tp`.`status` AS `status` FROM `bx_organizations_data` AS `td` LEFT JOIN `sys_profiles` AS `tp` ON `td`.`id`=`tp`.`content_id` AND `tp`.`type`=''bx_organizations'' LEFT JOIN `sys_accounts` AS `ta` ON `tp`.`account_id`=`ta`.`id` WHERE 1 ', 'bx_organizations_data', 'id', 'last_online', 'status', '', 20, NULL, 'start', '', 'org_name', '', 'like', '', '', 192, 'BxOrgsGridAdministration', 'modules/boonex/organizations/classes/BxOrgsGridAdministration.php'),

+ 3 - 0
modules/boonex/persons/install/sql/disable.sql

@@ -45,6 +45,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` = 'bx_persons';
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_persons');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_persons';
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_persons_administration', 'bx_persons_common');

+ 4 - 0
modules/boonex/persons/install/sql/enable.sql

@@ -354,6 +354,10 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_persons', 'bx_persons_administration', 'td`.`id', '', ''),
 ('bx_persons', 'bx_persons_common', 'td`.`id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_persons', '_bx_persons', 'bx_persons_data', 'added', '', '', '', 1, @iMaxOrderCharts + 1, '', '');
 
 -- GRIDS: administration
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES

+ 3 - 0
modules/boonex/polls/install/sql/disable.sql

@@ -36,6 +36,9 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_polls', 'bx_polls_cm
 
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_polls');
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_polls';
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_polls_administration', 'bx_polls_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_polls_administration', 'bx_polls_common');

+ 5 - 0
modules/boonex/polls/install/sql/enable.sql

@@ -334,6 +334,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_polls', 'bx_polls_administration', 'id', '', ''),
 ('bx_polls', 'bx_polls_common', 'id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_polls', '_bx_polls', 'bx_polls_entries', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRIDS: moderation tools
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_polls_administration', 'Sql', 'SELECT * FROM `bx_polls_entries` WHERE 1 ', 'bx_polls_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'text', '', 'like', '', '', 192, 'BxPollsGridAdministration', 'modules/boonex/polls/classes/BxPollsGridAdministration.php'),

+ 4 - 0
modules/boonex/shopify/install/sql/disable.sql

@@ -45,6 +45,10 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_shopify', 'bx_shopif
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_shopify');
 
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_shopify';
+
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_shopify_administration', 'bx_shopify_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_shopify_administration', 'bx_shopify_common');

+ 6 - 0
modules/boonex/shopify/install/sql/enable.sql

@@ -317,6 +317,12 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_shopify', 'bx_shopify_common', 'id', '', '');
 
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_shopify', '_bx_shopify', 'bx_shopify_entries', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', '');
+
+
 -- GRIDS: moderation tools
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_shopify_administration', 'Sql', 'SELECT * FROM `bx_shopify_entries` WHERE 1 ', 'bx_shopify_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxShopifyGridAdministration', 'modules/boonex/shopify/classes/BxShopifyGridAdministration.php'),

+ 4 - 0
modules/boonex/snipcart/install/sql/disable.sql

@@ -45,6 +45,10 @@ DELETE FROM `sys_objects_content_info` WHERE `name` IN ('bx_snipcart', 'bx_snipc
 DELETE FROM `sys_content_info_grids` WHERE `object` IN ('bx_snipcart');
 
 
+-- CHARTS
+DELETE FROM `sys_objects_chart` WHERE `object` = 'bx_snipcart';
+
+
 -- GRIDS
 DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_snipcart_administration', 'bx_snipcart_common');
 DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_snipcart_administration', 'bx_snipcart_common');

+ 5 - 0
modules/boonex/snipcart/install/sql/enable.sql

@@ -318,6 +318,11 @@ INSERT INTO `sys_content_info_grids` (`object`, `grid_object`, `grid_field_id`,
 ('bx_snipcart', 'bx_snipcart_administration', 'id', '', ''),
 ('bx_snipcart', 'bx_snipcart_common', 'id', '', '');
 
+-- CHARTS
+SET @iMaxOrderCharts = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_objects_chart`);
+INSERT INTO `sys_objects_chart` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `query_status`, `active`, `order`, `class_name`, `class_file`) VALUES
+('bx_snipcart', '_bx_snipcart', 'bx_snipcart_entries', 'added', '', '', ' AND {table}.`status` = ''active'' AND {table}.`status_admin` = ''active''', 1, @iMaxOrderCharts + 1, '', '');
+
 -- GRIDS: moderation tools
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
 ('bx_snipcart_administration', 'Sql', 'SELECT * FROM `bx_snipcart_entries` WHERE 1 ', 'bx_snipcart_entries', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,text', '', 'like', '', '', 192, 'BxSnipcartGridAdministration', 'modules/boonex/snipcart/classes/BxSnipcartGridAdministration.php'),