Explorar el Código

Ticket #255 - Clean up: Market product.

AntonLV hace 10 años
padre
commit
c1e9af662e

+ 5 - 0
modules/boonex/market/classes/BxMarketModule.php

@@ -68,6 +68,11 @@ class BxMarketModule extends BxBaseModTextModule
         return $this->_serviceTemplateFunc ('entryInfo', $iContentId);
     }
 
+	public function serviceEntityInfoFull ($iContentId = 0)
+    {
+        return $this->_serviceTemplateFunc ('entryInfoFull', $iContentId);
+    }
+
     public function serviceEntityRating($iContentId = 0)
     {
     	return $this->_serviceTemplateFunc ('entryRating', $iContentId);

+ 12 - 2
modules/boonex/market/classes/BxMarketTemplate.php

@@ -28,7 +28,7 @@ class BxMarketTemplate extends BxBaseModTextTemplate
         $this->_aCurrency = $this->_oConfig->getCurrency();
     }
 
-    public function entryInfo($aData)
+    public function entryInfo($aData, $bFull = false)
     {
     	$aCategory = array();
     	$oCategory = BxTemplCategory::getObjectInstance('bx_market_cats');
@@ -47,10 +47,20 @@ class BxMarketTemplate extends BxBaseModTextTemplate
     		'category' => '',
     		'released' => bx_time_js($aData['added']),
 	    	'updated' => bx_time_js($aData['changed']),
-	    	'installs' => '?',
+	    	'bx_if:show_full' => array(
+    			'condition' => $bFull,
+    			'content' => array(
+    				'notes' => bx_process_output(nl2br($aData['notes']), BX_DATA_TEXT_MULTILINE)
+    			)
+    		),
     	));
     }
 
+    public function entryInfoFull($aData)
+    {
+    	return $this->entryInfo($aData, true);
+    }
+
     public function entryRating($aData)
     {
         $CNF = &BxDolModule::getInstance($this->MODULE)->_oConfig->CNF;

+ 8 - 0
modules/boonex/market/install/langs/en.xml

@@ -49,6 +49,8 @@
 	<string name="_bx_market_form_entry_input_sys_text"><![CDATA[Text]]></string>
 	<string name="_bx_market_form_entry_input_text"><![CDATA[Text]]></string>
 	<string name="_bx_market_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string>
+	<string name="_bx_market_form_entry_input_sys_notes"><![CDATA[Notes]]></string>
+	<string name="_bx_market_form_entry_input_notes"><![CDATA[Notes]]></string>
 	<string name="_bx_market_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
 	<string name="_bx_market_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this product]]></string>
 	<string name="_bx_market_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
@@ -115,6 +117,7 @@
     <string name="_bx_market_page_block_title_entry_comments_link"><![CDATA[Reviews to <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_market_page_block_title_entry_comments_n"><![CDATA[Reviews ({0})]]></string>
     <string name="_bx_market_page_block_title_entry_info"><![CDATA[Info]]></string>
+    <string name="_bx_market_page_block_title_entry_info_link"><![CDATA[<a href="{entry_link}">{title}</a> Info]]></string>
     <string name="_bx_market_page_block_title_entry_location"><![CDATA[Location]]></string>
     <string name="_bx_market_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
     <string name="_bx_market_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
@@ -129,6 +132,8 @@
     <string name="_bx_market_page_block_title_updated_entries"><![CDATA[Updated Products]]></string>
     <string name="_bx_market_page_title_sys_view_entry_comments"><![CDATA[Product Reviews]]></string>
     <string name="_bx_market_page_title_view_entry_comments"><![CDATA[Reviews to {title}]]></string>
+    <string name="_bx_market_page_title_sys_view_entry_info"><![CDATA[Product Info]]></string>
+    <string name="_bx_market_page_title_view_entry_info"><![CDATA[{title} Info]]></string>
     <string name="_bx_market_page_title_sys_entries_of_author"><![CDATA[Products of author]]></string>
     <string name="_bx_market_page_title_entries_of_author"><![CDATA[Products by {display_name}]]></string>
     <string name="_bx_market_page_block_title_entries_of_author"><![CDATA[Products by <a href="{profile_link}">{display_name}</a>]]></string>
@@ -183,6 +188,8 @@
     <string name="_bx_market_menu_item_title_view_entry_submenu_entry"><![CDATA[Overview]]></string>
     <string name="_bx_market_menu_item_title_system_view_entry_submenu_comments"><![CDATA[Reviews]]></string>
     <string name="_bx_market_menu_item_title_view_entry_submenu_comments"><![CDATA[Reviews]]></string>
+    <string name="_bx_market_menu_item_title_system_view_entry_submenu_info"><![CDATA[Info]]></string>
+    <string name="_bx_market_menu_item_title_view_entry_submenu_info"><![CDATA[Info]]></string>
     <string name="_bx_market_menu_item_title_system_view_entries_author"><![CDATA[Products]]></string>
     <string name="_bx_market_menu_item_title_view_entries_author"><![CDATA[Products]]></string>
     <string name="_bx_market_menu_title_entries_my"><![CDATA[My Products Action Menu]]></string>
@@ -288,6 +295,7 @@
 
     <string name="_bx_market_txt_all_entries_by"><![CDATA[<a href="{0}">All Products by {1} ({2})</a>]]></string>
     <string name="_bx_market_txt_category"><![CDATA[Category:]]></string>
+    <string name="_bx_market_txt_notes"><![CDATA[Notes:]]></string>
     <string name="_bx_market_txt_most_current_version"><![CDATA[The most current version]]></string>
     <string name="_bx_market_txt_released"><![CDATA[Released:]]></string>
     <string name="_bx_market_txt_sample_single"><![CDATA[product]]></string>

+ 11 - 2
modules/boonex/market/install/sql/enable.sql

@@ -59,10 +59,10 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 2),
 ('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 3),
 ('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 4),
+('bx_market_view_entry', 2, 'bx_market', '', '_bx_market_page_block_title_entry_author_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:22:\"entity_author_entities\";}', 0, 0, 1, 5),
 ('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 0),
 ('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_rating', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:13:\"entity_rating\";}', 0, 0, 1, 1),
 ('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 2),
-('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_author_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:22:\"entity_author_entities\";}', 0, 0, 1, 3),
 ('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 4),
 ('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:9:\"bx_market\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 5),
 ('bx_market_view_entry', 3, 'bx_market', '', '_bx_market_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 0, 6);
@@ -77,6 +77,14 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_market_view_entry_comments', 1, 'bx_market', '_bx_market_page_block_title_entry_comments', '_bx_market_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
 
 
+-- PAGE: view entry info
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_market_view_entry_info', '_bx_market_page_title_sys_view_entry_info', '_bx_market_page_title_view_entry_info', 'bx_market', 5, 2147483647, 1, 'view-product-info', '', '', '', '', 0, 1, 0, 'BxMarketPageEntry', 'modules/boonex/market/classes/BxMarketPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_market_view_entry_info', 1, 'bx_market', '_bx_market_page_block_title_entry_info', '_bx_market_page_block_title_entry_info_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_market\";s:6:\"method\";s:16:\"entity_info_full\";}', 0, 0, 1);
+
+
 -- PAGE: categories
 INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
 ('bx_market_categories', '_bx_market_page_title_sys_entries_categories', '_bx_market_page_title_entries_categories', 'bx_market', 1, 2147483647, 1, 'products-categories', 'page.php?i=products-categories', '', '', '', 0, 1, 0, 'BxMarketPageBrowse', 'modules/boonex/market/classes/BxMarketPageBrowse.php');
@@ -220,7 +228,8 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_market_view_submenu', 'bx_market', 'view-product', '_bx_market_menu_item_title_system_view_entry_submenu_entry', '_bx_market_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-product&id={content_id}', '', '', '', '', 2147483647, 1, 0, 1),
-('bx_market_view_submenu', 'bx_market', 'view-product-comments', '_bx_market_menu_item_title_system_view_entry_submenu_comments', '_bx_market_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-product-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2);
+('bx_market_view_submenu', 'bx_market', 'view-product-comments', '_bx_market_menu_item_title_system_view_entry_submenu_comments', '_bx_market_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-product-comments&id={content_id}', '', '', '', '', 2147483647, 1, 0, 2),
+('bx_market_view_submenu', 'bx_market', 'view-product-info', '_bx_market_menu_item_title_system_view_entry_submenu_info', '_bx_market_menu_item_title_view_entry_submenu_info', 'page.php?i=view-product-info&id={content_id}', '', '', '', '', 2147483647, 1, 0, 3);
 
 -- MENU: profile stats
 SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);

+ 11 - 5
modules/boonex/market/install/sql/install.sql

@@ -11,6 +11,7 @@ CREATE TABLE IF NOT EXISTS `bx_market_products` (
   `name` varchar(255) NOT NULL,
   `title` varchar(255) NOT NULL,
   `text` text NOT NULL,
+  `notes` text NOT NULL,
   `cat` int(11) NOT NULL,
   `price_single` float NOT NULL default '0',
   `price_recurring` float NOT NULL default '0',
@@ -253,6 +254,7 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_market', 'bx_market', 'pictures', 'a:1:{i:0;s:15:"bx_market_html5";}', 'a:2:{s:16:"bx_market_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_market_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_market_form_entry_input_sys_pictures', '_bx_market_form_entry_input_pictures', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_market', 'bx_market', 'files', 'a:1:{i:0;s:15:"bx_market_html5";}', 'a:2:{s:16:"bx_market_simple";s:26:"_sys_uploader_simple_title";s:15:"bx_market_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_market_form_entry_input_sys_files', '_bx_market_form_entry_input_files', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
 ('bx_market', 'bx_market', 'text', '', '', 0, 'textarea', '_bx_market_form_entry_input_sys_text', '_bx_market_form_entry_input_text', '', 1, 0, 2, '', '', '', 'Avail', '', '_bx_market_form_entry_input_text_err', 'XssHtml', '', 1, 0),
+('bx_market', 'bx_market', 'notes', '', '', 0, 'textarea', '_bx_market_form_entry_input_sys_notes', '_bx_market_form_entry_input_notes', '', 0, 0, 0, '', '', '', '', '', '', 'Xss', '', 1, 0),
 ('bx_market', 'bx_market', 'title', '', '', 0, 'text', '_bx_market_form_entry_input_sys_title', '_bx_market_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_market_form_entry_input_title_err', 'Xss', '', 1, 0),
 ('bx_market', 'bx_market', 'name', '', '', 0, 'text', '_bx_market_form_entry_input_sys_name', '_bx_market_form_entry_input_name', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_market_form_entry_input_name_err', 'Xss', '', 1, 0),
 ('bx_market', 'bx_market', 'cat', '', '#!bx_market_cats', 0, 'select', '_bx_market_form_entry_input_sys_cat', '_bx_market_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_market_form_entry_input_cat_err', 'Xss', '', 1, 0),
@@ -288,9 +290,11 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_market_entry_add', 'allow_comment_to', 2147483647, 1, 18),
 ('bx_market_entry_add', 'allow_vote_to', 2147483647, 1, 19),
 ('bx_market_entry_add', 'header_end_privacy', 2147483647, 1, 20),
-('bx_market_entry_add', 'location', 2147483647, 1, 21),
-('bx_market_entry_add', 'do_submit', 2147483647, 0, 22),
-('bx_market_entry_add', 'do_publish', 2147483647, 1, 23),
+('bx_market_entry_add', 'notes', 2147483647, 1, 21),
+('bx_market_entry_add', 'location', 2147483647, 1, 22),
+('bx_market_entry_add', 'do_submit', 2147483647, 0, 23),
+('bx_market_entry_add', 'do_publish', 2147483647, 1, 24),
+('bx_market_entry_delete', 'notes', 2147483647, 0, 0),
 ('bx_market_entry_delete', 'location', 2147483647, 0, 0),
 ('bx_market_entry_delete', 'cat', 2147483647, 0, 0),
 ('bx_market_entry_delete', 'header_beg_single', 2147483647, 0, 0),
@@ -335,8 +339,10 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_market_entry_edit', 'allow_comment_to', 2147483647, 1, 19),
 ('bx_market_entry_edit', 'allow_vote_to', 2147483647, 1, 20),
 ('bx_market_entry_edit', 'header_end_privacy', 2147483647, 1, 21),
-('bx_market_entry_edit', 'location', 2147483647, 1, 22),
-('bx_market_entry_edit', 'do_submit', 2147483647, 1, 23),
+('bx_market_entry_edit', 'notes', 2147483647, 1, 22),
+('bx_market_entry_edit', 'location', 2147483647, 1, 23),
+('bx_market_entry_edit', 'do_submit', 2147483647, 1, 24),
+('bx_market_entry_view', 'notes', 2147483647, 0, 0),
 ('bx_market_entry_view', 'location', 2147483647, 0, 0),
 ('bx_market_entry_view', 'cat', 2147483647, 0, 0),
 ('bx_market_entry_view', 'header_beg_single', 2147483647, 0, 0),

+ 3 - 0
modules/boonex/market/template/entry-info.html

@@ -4,4 +4,7 @@
     </bx_if:show_category>
     <p><span class="bx-def-font-grayed"><bx_text:_bx_market_txt_released /></span> __released__</p>
     <p><span class="bx-def-font-grayed"><bx_text:_bx_market_txt_updated /></span> __updated__</p>
+    <bx_if:show_full>
+    	<p><span class="bx-def-font-grayed"><bx_text:_bx_market_txt_notes /></span> __notes__</p>
+    </bx_if:show_full>
 </div>

+ 8 - 0
modules/boonex/russian/data/langs/bx_market/ru.xml

@@ -49,6 +49,8 @@
 	<string name="_bx_market_form_entry_input_sys_text"><![CDATA[Текст]]></string>
 	<string name="_bx_market_form_entry_input_text"><![CDATA[Текст]]></string>
 	<string name="_bx_market_form_entry_input_text_err"><![CDATA[Поле для Текста не может быть пустым]]></string>
+	<string name="_bx_market_form_entry_input_sys_notes"><![CDATA[Примечания]]></string>
+	<string name="_bx_market_form_entry_input_notes"><![CDATA[Примечания]]></string>
 	<string name="_bx_market_form_entry_input_sys_delete_confirm"><![CDATA[Удалить подтверждение]]></string>
 	<string name="_bx_market_form_entry_input_delete_confirm"><![CDATA[Я уверен(а), что хочу удалить этот продукт]]></string>
 	<string name="_bx_market_form_entry_input_delete_confirm_info"><![CDATA[Это действие не может быть отменено]]></string>
@@ -115,6 +117,7 @@
     <string name="_bx_market_page_block_title_entry_comments_link"><![CDATA[Обзоры к <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_market_page_block_title_entry_comments_n"><![CDATA[Обзоры ({0})]]></string>
     <string name="_bx_market_page_block_title_entry_info"><![CDATA[Информация]]></string>
+    <string name="_bx_market_page_block_title_entry_info_link"><![CDATA[Информация к <a href="{entry_link}">{title}</a>]]></string>
     <string name="_bx_market_page_block_title_entry_location"><![CDATA[Расположение]]></string>
     <string name="_bx_market_page_block_title_entry_attachments"><![CDATA[Прикрепления]]></string>
     <string name="_bx_market_page_block_title_entry_all_actions"><![CDATA[Все Действия]]></string>
@@ -129,6 +132,8 @@
     <string name="_bx_market_page_block_title_updated_entries"><![CDATA[Обновленные Продукты]]></string>
     <string name="_bx_market_page_title_sys_view_entry_comments"><![CDATA[Обзоры к продукту]]></string>
     <string name="_bx_market_page_title_view_entry_comments"><![CDATA[Обзоры к {title}]]></string>
+    <string name="_bx_market_page_title_sys_view_entry_info"><![CDATA[Информация к продукту]]></string>
+    <string name="_bx_market_page_title_view_entry_info"><![CDATA[Информация к {title}]]></string>
     <string name="_bx_market_page_title_sys_entries_of_author"><![CDATA[Продукты автора]]></string>
     <string name="_bx_market_page_title_entries_of_author"><![CDATA[{display_name} - Продукты]]></string>
     <string name="_bx_market_page_block_title_entries_of_author"><![CDATA[<a href="{profile_link}">{display_name}</a> - Продукты]]></string>   
@@ -182,6 +187,8 @@
     <string name="_bx_market_menu_item_title_view_entry_submenu_entry"><![CDATA[Обзор]]></string>
     <string name="_bx_market_menu_item_title_system_view_entry_submenu_comments"><![CDATA[Рецензии]]></string>
     <string name="_bx_market_menu_item_title_view_entry_submenu_comments"><![CDATA[Рецензии]]></string>    
+    <string name="_bx_market_menu_item_title_system_view_entry_submenu_info"><![CDATA[Информация]]></string>
+    <string name="_bx_market_menu_item_title_view_entry_submenu_info"><![CDATA[Информация]]></string>
     <string name="_bx_market_menu_item_title_system_view_entries_author"><![CDATA[Продукты]]></string>
     <string name="_bx_market_menu_item_title_view_entries_author"><![CDATA[Продукты]]></string>
     <string name="_bx_market_menu_title_entries_my"><![CDATA[Мои продукты - Меню действий]]></string>
@@ -284,6 +291,7 @@
 
     <string name="_bx_market_txt_all_entries_by"><![CDATA[<a href="{0}">Все продукты от {1} ({2})</a>]]></string>
     <string name="_bx_market_txt_category"><![CDATA[Категория:]]></string>
+    <string name="_bx_market_txt_notes"><![CDATA[Примечания:]]></string>
     <string name="_bx_market_txt_most_current_version"><![CDATA[Самая новая версия]]></string>
     <string name="_bx_market_txt_released"><![CDATA[Дата выпуска:]]></string>
     <string name="_bx_market_txt_sample_single"><![CDATA[продукт]]></string>