ET_Reviewnotify - Version 0.2.0

Version Notes

first community release

Download this release

Release Info

Developer Magento Core Team
Extension ET_Reviewnotify
Version 0.2.0
Comparing to
See all releases


Version 0.2.0

app/code/community/ET/ET_Reviewnotify_ChangeLog.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ =====================================
2
+ This file describes changes between versions of module ET_Reviewnotify for Magento.
3
+
4
+ Legend:
5
+ * bug fix
6
+ + added functionality
7
+ - removed functionality
8
+
9
+ =====================================
10
+
11
+ ver. 0.2.0
12
+ + added notification in admin standart notification toolbar
13
+ * send separate mails for each notification recipient
14
+
15
+ ver. 0.1.1
16
+ * added Helper (not worked - Transactional mails - add new template) - actual for Magento ver. 1.4.�
17
+
18
+ ver. 0.1.0
19
+ + stable relize
app/code/community/ET/ET_Reviewnotify_Description.txt ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ==== Description / Для чего этот модуль? ====
2
+
3
+ RU:
4
+ 1. При поступлении нового отзыва на товар отсылается сообщение владельцу магазина на е-майл.
5
+ 2. Если в системе есть отзывы, требующие проверки, то показывается стандартный тулбар оповещений в панели администрирования.
6
+ Спасибо за идею с тулбаром этому модулю
7
+ http://www.magentocommerce.com/magento-connect/clockworkgeek/extension/3853/clockworkgeek_reviewsnotification
8
+
9
+
10
+ EN:
11
+ 1. Store owner will recieve notification email after recieving new product review.
12
+ 2. If there is pending reviews - standart notification toolbar is shown in admin.
13
+ Thanks for idea with toolbar to module
14
+ http://www.magentocommerce.com/magento-connect/clockworkgeek/extension/3853/clockworkgeek_reviewsnotification
15
+
16
+
17
+ ====Features / Особенности модуля====
18
+
19
+ RU:
20
+ * Open Source
21
+ * Переводы в комплекте:
22
+ * en_EN
23
+ * ru_RU
24
+ * Настаривается в панели администрирования (System - Configuration - Catalog - Product Reviews)
25
+ * Включить/отключить оповещение на е-майл
26
+ * Включить/отключить тулбар оповещения
27
+ * Редактируемый шаблон письма-оповещения
28
+ * Оповещение по нескольким адресам е-майл
29
+
30
+ EN:
31
+ * Open Source
32
+ * Translations avalable:
33
+ * en_EN
34
+ * ru_RU
35
+ * All options are changable in admin (System - Configuration - Catalog - Product Reviews)
36
+ * Enable/Disable email notification
37
+ * Enable/Disable toolbar notification
38
+ * Notification email template can be changed
39
+ * Email notification to multiple recipients
40
+
41
+
42
+
43
+ ====Version Compatibility / Совместимость версий====
44
+ 1.3.х (tested in 1.3.2.4.)
45
+ 1.4.x (tested in 1.4.1.1.)
46
+ 1.5.x (tested in 1.5.0.1.)
47
+
48
+
49
+ ====Module tags:====
50
+ reviews, notification, mail, admin
51
+
52
+ отзывы, оповещения, е-майл, админка, панель администрирования
app/code/community/ET/ET_Reviewnotify_LICENSE.txt ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ http://opensource.org/licenses/afl-3.0.php
2
+
3
+ Academic Free License ("AFL") v. 3.0
4
+ This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
5
+
6
+ Licensed under the Academic Free License version 3.0
7
+
8
+ 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
9
+
10
+ a) to reproduce the Original Work in copies, either alone or as part of a collective work;
11
+
12
+ b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
13
+
14
+ c) to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
15
+
16
+ d) to perform the Original Work publicly; and
17
+
18
+ e) to display the Original Work publicly.
19
+
20
+ 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
21
+
22
+ 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
23
+
24
+ 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
25
+
26
+ 5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
27
+
28
+ 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
29
+
30
+ 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
31
+
32
+ 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
33
+
34
+ 9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
35
+
36
+ 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
37
+
38
+ 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
39
+
40
+ 12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
41
+
42
+ 13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
43
+
44
+ 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
45
+
46
+ 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
47
+
48
+ 16) Modification of This License. This License is Copyright � 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
app/code/community/ET/Reviewnotify/Block/Toolbar.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ET Web Solutions
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade to newer
12
+ * versions in the future.
13
+ *
14
+ * @category ET
15
+ * @package ET_Reviewnotify
16
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
17
+ * @contacts support@etwebsolutions.com
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ class ET_Reviewnotify_Block_Toolbar extends Mage_Adminhtml_Block_Template
22
+ {
23
+ /**
24
+ * Get pending reviews as a collection, might be none.
25
+ *
26
+ * @return Mage_Review_Model_Mysql4_Review_Product_Collection
27
+ */
28
+ public function getPending()
29
+ {
30
+ /* @var $model Mage_Review_Model_Review */
31
+ $model = Mage::getModel('review/review');
32
+ /* @var $collection Mage_Review_Model_Mysql4_Review_Product_Collection */
33
+ $collection = $model->getProductCollection()
34
+ ->addStatusFilter($model->getPendingStatus())
35
+ ->load();
36
+ return $collection;
37
+ }
38
+
39
+ /**
40
+ * Get edit URL for a product
41
+ *
42
+ * @param Mage_Catalog_Model_Product $product
43
+ * @return string
44
+ */
45
+ public function getEditUrl($product)
46
+ {
47
+ $params = array('id' => $product->getId());
48
+ return $this->getUrl('adminhtml/catalog_product/edit', $params);
49
+ }
50
+
51
+ /**
52
+ * Get edit URL for a product's review
53
+ *
54
+ * @param Mage_Catalog_Model_Product $product
55
+ * @return string
56
+ */
57
+ public function getReviewUrl($product)
58
+ {
59
+ $params = array('id'=>$product->getReviewId());
60
+ return $this->getUrl('*/catalog_product_review/edit', $params);
61
+ }
62
+
63
+ }
app/code/community/ET/Reviewnotify/Helper/Data.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ET Web Solutions
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade to newer
12
+ * versions in the future.
13
+ *
14
+ * @category ET
15
+ * @package ET_Reviewnotify
16
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
17
+ * @contacts support@etwebsolutions.com
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ class ET_Reviewnotify_Helper_Data extends Mage_Core_Helper_Abstract
22
+ {
23
+
24
+ }
app/code/community/ET/Reviewnotify/Model/Observer.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ET Web Solutions
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade to newer
12
+ * versions in the future.
13
+ *
14
+ * @category ET
15
+ * @package ET_Reviewnotify
16
+ * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
+ * @contacts support@etwebsolutions.com
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+
22
+ class ET_Reviewnotify_Model_Observer
23
+ {
24
+
25
+ public function __construct()
26
+ {
27
+ }
28
+
29
+ public function send_nofificatin_mail($observer)
30
+ {
31
+
32
+ $this->need_send = Mage::getStoreConfig('catalog/review/need_send');
33
+ $this->event_email = Mage::getStoreConfig('catalog/review/email_to');
34
+ $this->email_template = Mage::getStoreConfig('catalog/review/email_template');
35
+ $this->email_identity = Mage::getStoreConfig('catalog/review/email_identity');
36
+
37
+
38
+ if(($this->need_send)&(trim($this->event_email)))
39
+ {
40
+ $product=Mage::getModel('catalog/product')->load($observer->object->getEntityPkValue());
41
+ $emailTemplate = Mage::getModel('core/email_template');
42
+
43
+ $recipients = explode(",",$this->event_email);
44
+ foreach($recipients as $k => $recipient)
45
+ $sendresult=$emailTemplate->setDesignConfig(array('area' => 'backend'))
46
+ ->sendTransactional(
47
+ $this->email_template,
48
+ $this->email_identity,
49
+ trim($recipient),
50
+ trim($recipient),
51
+ array(
52
+ "product"=>$product->getName()." (sku: ".$product->getsku().")",
53
+ "title"=>$observer->object->getTitle(),
54
+ "nickname"=>$observer->object->getNickname(),
55
+ "details"=>$observer->object->getDetail(),
56
+ "id"=>$observer->object->getId(),
57
+ 'date' => Mage::app()->getLocale()->date(date("Y-m-d H:i:s"), Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM), null,true)
58
+ )
59
+ );
60
+
61
+ }
62
+
63
+ }
64
+
65
+ }
app/code/community/ET/Reviewnotify/Model/Review.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ET Web Solutions
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade to newer
12
+ * versions in the future.
13
+ *
14
+ * @category ET
15
+ * @package ET_Reviewnotify
16
+ * @copyright Copyright (c) 2010 ET Web Solutions (http://etwebsolutions.com)
17
+ * @contacts support@etwebsolutions.com
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ class ET_Reviewnotify_Model_Review extends Mage_Review_Model_Review
22
+ {
23
+ protected $_eventPrefix = 'review_review';
24
+ }
app/code/community/ET/Reviewnotify/etc/config.xml ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ET Web Solutions
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade to newer
13
+ * versions in the future.
14
+ *
15
+ * @category ET
16
+ * @package ET_Reviewnotify
17
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
18
+ * @contacts support@etwebsolutions.com
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ -->
22
+
23
+ <config>
24
+ <modules>
25
+ <ET_Reviewnotify>
26
+ <version>0.2.0</version>
27
+ <descr>
28
+ <ru_RU>
29
+ При поступлении нового отзыва на товар отсылается сообщение владельцу магазина на емайл.
30
+ Если есть необработанные отзывы - показывается напоминание в стандартном тулбаре оповещений в панели алминистрирования.
31
+ Настройки модуля в секции Каталог - Отзывы о товаре.
32
+ </ru_RU>
33
+ <en_US>
34
+ Store owner will recieve notification after recieving new product review.
35
+ If there is pending reviews - standart notification toolbar is shown in admin.
36
+ Settings in section Catalog - Product Reviews.
37
+ </en_US>
38
+ </descr>
39
+ </ET_Reviewnotify>
40
+ </modules>
41
+ <global>
42
+ <models>
43
+ <reviewnotify>
44
+ <class>ET_Reviewnotify_Model</class>
45
+ </reviewnotify>
46
+
47
+ <review>
48
+ <rewrite>
49
+ <review>ET_Reviewnotify_Model_Review</review>
50
+ </rewrite>
51
+ </review>
52
+
53
+ </models>
54
+ <helpers>
55
+ <reviewnotify>
56
+ <class>ET_Reviewnotify_Helper</class>
57
+ </reviewnotify>
58
+
59
+ </helpers>
60
+ <blocks>
61
+ <reviewnotify>
62
+ <class>ET_Reviewnotify_Block</class>
63
+ </reviewnotify>
64
+ </blocks>
65
+
66
+
67
+ <template>
68
+ <email>
69
+ <catalog_review_email_template translate="label" module="reviewnotify">
70
+ <label>Review notify email</label>
71
+ <file>et_reviewnotify.html</file>
72
+ <type>text</type>
73
+ </catalog_review_email_template>
74
+ </email>
75
+ </template>
76
+ </global>
77
+
78
+ <default>
79
+ <catalog>
80
+ <review>
81
+ <need_send>0</need_send>
82
+ <need_notify>1</need_notify>
83
+ </review>
84
+ </catalog>
85
+ </default>
86
+
87
+
88
+ <frontend>
89
+ <events>
90
+ <review_review_save_after>
91
+ <observers>
92
+ <et_reviewnotify_observer>
93
+ <type>singleton</type>
94
+ <class>reviewnotify/observer</class>
95
+ <method>send_nofificatin_mail</method>
96
+ </et_reviewnotify_observer>
97
+ </observers>
98
+ </review_review_save_after>
99
+ </events>
100
+ </frontend>
101
+
102
+ <adminhtml>
103
+ <layout>
104
+ <updates>
105
+ <reviewnotify>
106
+ <file>et_reviewnotify.xml</file>
107
+ </reviewnotify>
108
+ </updates>
109
+ </layout>
110
+ <translate>
111
+ <modules>
112
+ <ET_Reviewnotify>
113
+ <files>
114
+ <default>ET_Reviewnotify.csv</default>
115
+ </files>
116
+ </ET_Reviewnotify>
117
+ </modules>
118
+ </translate>
119
+ <acl>
120
+ <resources>
121
+ <admin>
122
+ <children>
123
+ <system>
124
+ <children>
125
+ <config>
126
+ <children>
127
+ <reviewnotify translate="title" module="reviewnotify">
128
+ <title>ET Review Notify</title>
129
+ <sort_order>400</sort_order>
130
+ </reviewnotify>
131
+ </children>
132
+ </config>
133
+ </children>
134
+ </system>
135
+ </children>
136
+ </admin>
137
+ </resources>
138
+ </acl>
139
+
140
+ </adminhtml>
141
+
142
+
143
+ </config>
app/code/community/ET/Reviewnotify/etc/system.xml ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ET Web Solutions
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade to newer
13
+ * versions in the future.
14
+ *
15
+ * @category ET
16
+ * @package ET_Reviewnotify
17
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
18
+ * @contacts support@etwebsolutions.com
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ -->
22
+
23
+ <config>
24
+ <tabs>
25
+ <etall translate="label">
26
+ <label>ET Extensions</label>
27
+ <sort_order>400</sort_order>
28
+ </etall>
29
+ </tabs>
30
+
31
+ <sections>
32
+ <reviewnotify translate="label" module="reviewnotify">
33
+ <label>Review Notify</label>
34
+ <tab>etall</tab>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>300</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <groups>
41
+ <info translate="label comment" module="reviewnotify">
42
+ <label>Review Notify Options</label>
43
+ <comment>Module options available in System -> Configuration -> Catalog -> Product Reviews</comment>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>10</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ </info>
50
+ </groups>
51
+ </reviewnotify>
52
+
53
+ <catalog>
54
+ <groups>
55
+ <review translate="label" module="reviewnotify">
56
+ <fields>
57
+
58
+ <need_send translate="label comment">
59
+ <label>Send notification</label>
60
+ <comment>Notification will be send to e-mail if new review is placed. Default: No</comment>
61
+ <frontend_type>select</frontend_type>
62
+ <source_model>adminhtml/system_config_source_yesno</source_model>
63
+ <sort_order>200</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ </need_send>
68
+
69
+ <email_to translate="label comment">
70
+ <label>Mail to</label>
71
+ <comment>You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com</comment>
72
+ <frontend_type>text</frontend_type>
73
+ <sort_order>300</sort_order>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>1</show_in_store>
77
+ </email_to>
78
+
79
+ <email_template translate="label">
80
+ <label>Mail Template</label>
81
+ <frontend_type>select</frontend_type>
82
+ <source_model>adminhtml/system_config_source_email_template</source_model>
83
+ <sort_order>501</sort_order>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </email_template>
88
+
89
+ <email_identity translate="label">
90
+ <label>Store email</label>
91
+ <frontend_type>select</frontend_type>
92
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
93
+ <sort_order>502</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ </email_identity>
98
+
99
+ <need_notify translate="label comment">
100
+ <label>Show notification</label>
101
+ <comment>Notification toolbar will be displayed if there is pending reviews. Default: Yes</comment>
102
+ <frontend_type>select</frontend_type>
103
+ <source_model>adminhtml/system_config_source_yesno</source_model>
104
+ <sort_order>700</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ </need_notify>
109
+
110
+ </fields>
111
+ </review>
112
+ </groups>
113
+ </catalog>
114
+ </sections>
115
+ </config>
app/design/adminhtml/default/default/layout/et_reviewnotify.xml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ET Web Solutions
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade to newer
13
+ * versions in the future.
14
+ *
15
+ * @category ET
16
+ * @package ET_Reviewnotify
17
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
18
+ * @contacts support@etwebsolutions.com
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ -->
22
+
23
+ <layout>
24
+
25
+ <default>
26
+ <!-- 1.4.x code -->
27
+ <reference name="notifications">
28
+ <block type="reviewnotify/toolbar" name="reviewnotify_toolbar" as="reviewnotify_toolbar" acl="catalog/reviews_ratings/reviews/pending" template="reviewnotify/toolbar.phtml" />
29
+ </reference>
30
+ <!-- 1.4.x code end -->
31
+
32
+ <!-- 1.3.x code -->
33
+ <reference name="root">
34
+ <block type="core/text_list" name="notification_toolbar" as="notification_toolbar">
35
+ <block type="adminhtml/notification_toolbar" name="notification_toolbarmain" as="notification_toolbarmain" acl="system/adminnotification/show_toolbar" template="notification/toolbar.phtml"></block>
36
+ <block type="reviewnotify/toolbar" name="reviewnotify_toolbar" as="reviewnotify_toolbar" acl="catalog/reviews_ratings/reviews/pending" template="reviewnotify/toolbar.phtml"></block>
37
+ </block>
38
+ </reference>
39
+ <!-- 1.3.x code end-->
40
+ </default>
41
+
42
+ <adminhtml_catalog_product_review_pending>
43
+ <!-- 1.4.x code -->
44
+ <reference name="notifications">
45
+ <remove name="reviewnotify_toolbarz"/>
46
+ </reference>
47
+ <!-- 1.4.x code end -->
48
+
49
+ <!-- 1.3.x code -->
50
+ <reference name="notification_toolbar">
51
+ <remove name="reviewnotify_toolbar"/>
52
+ </reference>
53
+ <!-- 1.3.x code end-->
54
+ </adminhtml_catalog_product_review_pending>
55
+
56
+ </layout>
57
+
app/design/adminhtml/default/default/template/reviewnotify/toolbar.phtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ET Web Solutions
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ *
9
+ * DISCLAIMER
10
+ *
11
+ * Do not edit or add to this file if you wish to upgrade to newer
12
+ * versions in the future.
13
+ *
14
+ * @category ET
15
+ * @package ET_Reviewnotify
16
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
17
+ * @contacts support@etwebsolutions.com
18
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
19
+ */
20
+
21
+ $config = Mage::getStoreConfig('catalog/review');
22
+ if ($config['need_notify'] == 1)
23
+ {
24
+ $_pending = $this->getPending();
25
+ $_count = count($_pending);
26
+ if ($_count > 0)
27
+ {
28
+ ?>
29
+ <div class="notification-global">
30
+ <span class="f-right"><a class="link-feed" href="<?php echo $this->getUrl('rss/catalog/review') ?>" style="background-position: 0 50%;"><?php echo $this->__('Pending Reviews RSS') ?></a></span>
31
+ <strong class="label"><?php echo $this->__('Pending Reviews') ?>:</strong>
32
+ <?php
33
+ if (count($_pending) > 1)
34
+ {
35
+ echo $this->__(
36
+ 'There are %d reviews waiting to be approved. Click here to see the %s.',
37
+ count($this->getPending()),
38
+ '<a href="'.$this->getUrl('adminhtml/catalog_product_review/pending').'">'.$this->__('Pending Reviews').'</a>'
39
+ );
40
+ } // end count > 1
41
+ elseif (count($_pending) == 1)
42
+ {
43
+ /* @var $_product Mage_Catalog_Model_Product */
44
+ $_product = $_pending->getFirstItem();
45
+ echo $this->__(
46
+ 'There is a review of %s waiting to be approved. Click here to read %s.',
47
+ '<a href="'.$this->getEditUrl($_product).'">'.$_product->getName().'</a>',
48
+ '<a href="'.$this->getReviewUrl($_product).'">'.$_product->getTitle().'</a>'
49
+ );
50
+ }
51
+ ?>
52
+ </div>
53
+ <?php
54
+ } // end count > 0
55
+ } // end enabled to show notification
56
+ ?>
app/etc/modules/ET_Reviewnotify.xml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * ET Web Solutions
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ *
10
+ * DISCLAIMER
11
+ *
12
+ * Do not edit or add to this file if you wish to upgrade to newer
13
+ * versions in the future.
14
+ *
15
+ * @category ET
16
+ * @package ET_Reviewnotify
17
+ * @copyright Copyright (c) 2011 ET Web Solutions (http://etwebsolutions.com)
18
+ * @contacts support@etwebsolutions.com
19
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
20
+ */
21
+ -->
22
+
23
+ <config>
24
+ <modules>
25
+ <ET_Reviewnotify>
26
+ <active>true</active>
27
+ <codePool>community</codePool>
28
+ <depends>
29
+ <Mage_Review/>
30
+ </depends>
31
+ </ET_Reviewnotify>
32
+ </modules>
33
+ </config>
app/locale/en_US/ET_Reviewnotify.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Pending Reviews","Pending Reviews"
2
+ "Pending Reviews RSS","Pending Reviews RSS"
3
+ "There are %d reviews waiting to be approved. Click here to see the %s.","There are %d reviews waiting to be approved. Click here to see the %s."
4
+ "There is a review of %s waiting to be approved. Click here to read %s.","There is a review of %s waiting to be approved. Click here to read %s."
5
+ "Show notification","Show notification"
6
+ "Send notification","Send notification"
7
+ "Mail to","Mail to"
8
+ "Mail Template","Email Template"
9
+ "Store email","Store email"
10
+ "Notification toolbar will be displayed if there is pending reviews. Default: Yes","Notification toolbar will be displayed if there is pending reviews. Default: Yes"
11
+ "You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com","You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com"
12
+ "Notification will be send to e-mail if new review is placed. Default: No","Notification will be send to e-mail if new review is placed. Default: No"
13
+ "Review Notify Options","Review Notify Options"
14
+ "Module options available in System -> Configuration -> Catalog -> Product Reviews","Module options available in System -> Configuration -> Catalog -> Product Reviews"
app/locale/en_US/template/email/et_reviewnotify.html ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject New product review @-->
2
+ Product: {{var product}}
3
+ Review id: {{var id}}
4
+
5
+ Title: {{var title}}
6
+ Nickname: {{var nickname}}
7
+ {{var details}}
8
+
9
+
10
+ time: {{var date}}
app/locale/ru_RU/ET_Reviewnotify.csv ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Pending Reviews","Отзывы, ожидающие проверки"
2
+ "Pending Reviews RSS","RSS неподтверждённых отзывов"
3
+ "There are %d reviews waiting to be approved. Click here to see the %s.","Отзывы, ожидающие проверки: %d шт. Просмотреть %s."
4
+ "There is a review of %s waiting to be approved. Click here to read %s.","Отзыв на товар %s ожидает проверки. Нажмите сюда для просмотра отзыва %s."
5
+ "Show notification","Показывать оповещения"
6
+ "Send notification","Посылать оповещения"
7
+ "Mail to","Email. Получатель"
8
+ "Mail Template","Email. Шаблон"
9
+ "Store email","Email. Отправитель"
10
+ "Notification toolbar will be displayed if there is pending reviews. Default: Yes","Будет отображаться тулбар оповещения, если есть необработанные отзывы. По умолчанию: Да"
11
+ "You can specify multiple recipients. Comma separated. For example: admin1@example.com, admin2@example.com","Можно указывать несколько получателей. Разделитель запятая. Например: admin1@example.com,admin2@example.com"
12
+ "Notification will be send to e-mail if new review is placed. Default: No","При поступлении нового отзыва будет отослано оповещение на емайл. По умолчанию: Нет"
13
+ "Review Notify Options","Параметры Review Notify"
14
+ "Module options available in System -> Configuration -> Catalog -> Product Reviews","Настроить модуль можно на странице Система -> Конфигурация -> Каталог -> Отзывы о товаре"
app/locale/ru_RU/template/email/et_reviewnotify.html ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject Новый отзыв о товаре @-->
2
+ Товар: {{var product}}
3
+ Идентификатор отзыва: {{var id}}
4
+
5
+ Заголовок: {{var title}}
6
+ Пользователь: {{var nickname}}
7
+ {{var details}}
8
+
9
+
10
+ время: {{var date}}
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>ET_Reviewnotify</name>
4
+ <version>0.2.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/afl-3.0.php">AFL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This module notify store owner about new product reviews.</summary>
10
+ <description>Review notify module notify store owner about new product reviews in two way:
11
+ 1. Store owner will recieve notification email after recieving new product review.
12
+ 2. If there is pending reviews - standart notification toolbar is shown in admin.</description>
13
+ <notes>first community release</notes>
14
+ <authors><author><name>Jurij</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author><author><name>Andrej</name><user>auto-converted</user><email>support@etwebsolutions.com</email></author></authors>
15
+ <date>2011-03-03</date>
16
+ <time>11:09:12</time>
17
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="et_reviewnotify.xml" hash="c374b2394ca0a2b7b1f137434288e9b2"/></dir><dir name="template"><dir name="reviewnotify"><file name="toolbar.phtml" hash="7a584818a45e4d263989b2841895c9d0"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="et_reviewnotify.html" hash="c3d8b0a804d721cb17271448ef7cf56b"/></dir></dir><file name="ET_Reviewnotify.csv" hash="3249708148a894114bf57b717f2ba763"/></dir><dir name="ru_RU"><dir name="template"><dir name="email"><file name="et_reviewnotify.html" hash="dc715adcb9e2d271d206c246af29920d"/></dir></dir><file name="ET_Reviewnotify.csv" hash="bf3e87ecca455c7543c18f98c11239c4"/></dir></target><target name="magecommunity"><dir name="ET"><dir name="Reviewnotify"><dir name="Block"><file name="Toolbar.php" hash="154c58580b58434602b1bc4da30f7cce"/></dir><dir name="etc"><file name="config.xml" hash="7f5a5de6d303d6eef5edcf7ad4fa9065"/><file name="system.xml" hash="848c67b1aa8eed12ef76b8468c87fedd"/></dir><dir name="Helper"><file name="Data.php" hash="be58e26c27d1bb60c4d22faae365ba7c"/></dir><dir name="Model"><file name="Observer.php" hash="c66ba95de4b978d42fe56e2a657be63c"/><file name="Review.php" hash="99a55e77f5fcf7e62766757a33a33cc1"/></dir></dir><file name="ET_Reviewnotify_ChangeLog.txt" hash="359ebfab7ef75ee69289bb9b558a172b"/><file name="ET_Reviewnotify_Description.txt" hash="23e370bb5afb5cf0f904d0a1d3b11a86"/><file name="ET_Reviewnotify_LICENSE.txt" hash="47734c0bfe298cff13472be9d25d97d6"/></dir></target><target name="mageetc"><dir name="modules"><file name="ET_Reviewnotify.xml" hash="7147aa924cbf49f74c30b5938fcf9e49"/></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies/>
20
+ </package>