Creativestyle_Sare - Version 1.0.2

Version Notes

Initial upload

Download this release

Release Info

Developer creativestyle GmbH
Extension Creativestyle_Sare
Version 1.0.2
Comparing to
See all releases


Version 1.0.2

Files changed (46) hide show
  1. app/code/community/Creativestyle/Sare/Block/Abandonedcartitems.php +16 -0
  2. app/code/community/Creativestyle/Sare/Block/Adminhtml/Abandonedcarts.php +16 -0
  3. app/code/community/Creativestyle/Sare/Block/Adminhtml/Dashboard.php +26 -0
  4. app/code/community/Creativestyle/Sare/Block/Adminhtml/Dashboard/Grids.php +22 -0
  5. app/code/community/Creativestyle/Sare/Block/Adminhtml/Dashboard/Grids/Subscribers.php +135 -0
  6. app/code/community/Creativestyle/Sare/Block/Adminhtml/Infoblock.php +11 -0
  7. app/code/community/Creativestyle/Sare/Block/Adminhtml/Targetinginfoblock.php +16 -0
  8. app/code/community/Creativestyle/Sare/Helper/Data.php +50 -0
  9. app/code/community/Creativestyle/Sare/Model/AdminNotification/Feed.php +24 -0
  10. app/code/community/Creativestyle/Sare/Model/Customer.php +385 -0
  11. app/code/community/Creativestyle/Sare/Model/Email.php +16 -0
  12. app/code/community/Creativestyle/Sare/Model/Mysql4/Email.php +7 -0
  13. app/code/community/Creativestyle/Sare/Model/Mysql4/Email/Collection.php +7 -0
  14. app/code/community/Creativestyle/Sare/Model/Observer.php +152 -0
  15. app/code/community/Creativestyle/Sare/Model/Response.php +26 -0
  16. app/code/community/Creativestyle/Sare/Model/Sare.php +200 -0
  17. app/code/community/Creativestyle/Sare/Model/Status.php +17 -0
  18. app/code/community/Creativestyle/Sare/controllers/Adminhtml/IndexController.php +153 -0
  19. app/code/community/Creativestyle/Sare/controllers/IndexController.php +51 -0
  20. app/code/community/Creativestyle/Sare/etc/adminhtml.xml +32 -0
  21. app/code/community/Creativestyle/Sare/etc/config.xml +194 -0
  22. app/code/community/Creativestyle/Sare/etc/sarescripts/fetchAbandonedCartsUsers.txt +22 -0
  23. app/code/community/Creativestyle/Sare/etc/system.xml +375 -0
  24. app/code/community/Creativestyle/Sare/sql/creativestyle_sare_setup/mysql4-install-0.1.0.php +27 -0
  25. app/code/community/Creativestyle/Sare/sql/creativestyle_sare_setup/mysql4-upgrade-1.0.0-1.0.1.php +11 -0
  26. app/design/adminhtml/default/default/layout/sare.xml +13 -0
  27. app/design/adminhtml/default/default/template/sare/abandonedcarts.phtml +13 -0
  28. app/design/adminhtml/default/default/template/sare/dashboard.phtml +16 -0
  29. app/design/adminhtml/default/default/template/sare/infoblock.phtml +22 -0
  30. app/design/adminhtml/default/default/template/sare/targeting.phtml +37 -0
  31. app/design/frontend/base/default/template/sare/abandonedcarts.phtml +20 -0
  32. app/design/frontend/base/default/template/sare/problemnotification.phtml +72 -0
  33. app/etc/modules/Creativestyle_Sare.xml +12 -0
  34. app/locale/pl_PL/sare.csv +131 -0
  35. js/sare/jquery-1.10.2.min.js +9 -0
  36. js/sare/synchro.js +20 -0
  37. package.xml +26 -0
  38. skin/adminhtml/base/default/css/sare.css +237 -0
  39. skin/adminhtml/default/default/images/sare/icon_add.png +0 -0
  40. skin/adminhtml/default/default/images/sare/icon_info.png +0 -0
  41. skin/adminhtml/default/default/images/sare/icon_remove.png +0 -0
  42. skin/adminhtml/default/default/images/sare/icon_success.png +0 -0
  43. skin/adminhtml/default/default/images/sare/icon_user.png +0 -0
  44. skin/adminhtml/default/default/images/sare/sare-baner.jpg +0 -0
  45. skin/adminhtml/default/default/images/sare/sare.png +0 -0
  46. skin/adminhtml/default/default/images/sare/transfer.png +0 -0
app/code/community/Creativestyle/Sare/Block/Abandonedcartitems.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Block_Abandonedcartitems extends Mage_Core_Block_Template
3
+ {
4
+ public function __construct(){
5
+ $this->setTemplate("sare/abandonedcarts.phtml");
6
+ }
7
+
8
+ public function getItems(){
9
+ $customerId = $this->getRequest()->getParam('customer_id');
10
+ $collection = Mage::getResourceModel('reports/quote_collection');
11
+ $collection->prepareForAbandonedReport($this->_storeIds)->addFieldToFilter('customer_id', array('eq'=>$customerId));
12
+ $this->collection = $collection;
13
+
14
+ return $collection;
15
+ }
16
+ }
app/code/community/Creativestyle/Sare/Block/Adminhtml/Abandonedcarts.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Block_Adminhtml_Abandonedcarts extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ public function __construct(){
5
+ $this->setTemplate("sare/abandonedcarts.phtml");
6
+ }
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element){
9
+ return $this->toHtml();
10
+ }
11
+
12
+ public function getInterfaceUrl(){
13
+ $url = Mage::getUrl('sare/index/abandonedcarts', array('key'=>Mage::getStoreConfig('sare/settings/key')));
14
+ return $url;
15
+ }
16
+ }
app/code/community/Creativestyle/Sare/Block/Adminhtml/Dashboard.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Block_Adminhtml_Dashboard extends Mage_Adminhtml_Block_Abstract
3
+ {
4
+ public function __construct(){
5
+ $this->setTemplate("sare/dashboard.phtml");
6
+ }
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element){
9
+ return Mage::app()->getLayout()->createBlock('Mage_Core_Block_Template', 'Sare_Infoblock', array('template' => 'sare/infoblock.phtml'))->toHtml();
10
+ }
11
+
12
+ public function getSubscribedCount(){
13
+ $collection = Mage::getModel('newsletter/subscriber')->getCollection()->addFieldToFilter('subscriber_status', array('eq'=>Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED));
14
+ return $collection->getSize();
15
+ }
16
+
17
+ public function getNonActivated(){
18
+ $collection = Mage::getModel('newsletter/subscriber')->getCollection()->addFieldToFilter('subscriber_status', array('eq'=>Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE));
19
+ return $collection->getSize();
20
+ }
21
+
22
+ public function getUnsubscribedCount(){
23
+ $collection = Mage::getModel('newsletter/subscriber')->getCollection()->addFieldToFilter('subscriber_status', array('eq'=>Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED));
24
+ return $collection->getSize();
25
+ }
26
+ }
app/code/community/Creativestyle/Sare/Block/Adminhtml/Dashboard/Grids.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: Adam
5
+ * Date: 10.09.13
6
+ * Time: 08:57
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+ class Creativestyle_Sare_Block_Adminhtml_Dashboard_Grids extends Mage_Adminhtml_Block_Dashboard_Grids {
10
+
11
+ public function _prepareLayout(){
12
+ parent::_prepareLayout();
13
+
14
+ $this->addTab('subscribers', array(
15
+ 'label' => $this->__('Recent subscribers'),
16
+ 'url' => $this->getUrl('sare/adminhtml_index/subscribersgrid', array('_current'=>true)),
17
+ 'class' => 'ajax'
18
+ ));
19
+
20
+ return parent::_prepareLayout();
21
+ }
22
+ }
app/code/community/Creativestyle/Sare/Block/Adminhtml/Dashboard/Grids/Subscribers.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Creativestyle_Sare_Block_Adminhtml_Dashboard_Grids_Subscribers extends Mage_Adminhtml_Block_Dashboard_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('subscribers');
9
+ $this->setDefaultSort('subscriber_id', 'desc');
10
+ $this->setDefaultLimit(10);
11
+ }
12
+
13
+ /**
14
+ * Prepare collection for grid
15
+ *
16
+ * @return Mage_Adminhtml_Block_Widget_Grid
17
+ */
18
+ protected function _prepareCollection()
19
+ {
20
+ $collection = Mage::getResourceSingleton('newsletter/subscriber_collection');
21
+ /* @var $collection Mage_Newsletter_Model_Mysql4_Subscriber_Collection */
22
+ $collection
23
+ ->showCustomerInfo(true)
24
+ ->addSubscriberTypeField()
25
+ ->showStoreInfo();
26
+
27
+ if($this->getRequest()->getParam('queue', false)) {
28
+ $collection->useQueue(Mage::getModel('newsletter/queue')
29
+ ->load($this->getRequest()->getParam('queue')));
30
+ }
31
+
32
+ $this->setCollection($collection);
33
+
34
+ return parent::_prepareCollection();
35
+ }
36
+
37
+ protected function _prepareColumns()
38
+ {
39
+
40
+ $this->addColumn('subscriber_id', array(
41
+ 'header' => Mage::helper('newsletter')->__('ID'),
42
+ 'index' => 'subscriber_id',
43
+ 'sortable' => false
44
+ ));
45
+
46
+ $this->addColumn('email', array(
47
+ 'header' => Mage::helper('newsletter')->__('Email'),
48
+ 'index' => 'subscriber_email',
49
+ 'sortable' => false
50
+ ));
51
+
52
+ $this->addColumn('type', array(
53
+ 'header' => Mage::helper('newsletter')->__('Type'),
54
+ 'index' => 'type',
55
+ 'sortable' => false,
56
+ 'type' => 'options',
57
+ 'options' => array(
58
+ 1 => Mage::helper('newsletter')->__('Guest'),
59
+ 2 => Mage::helper('newsletter')->__('Customer')
60
+ )
61
+ ));
62
+
63
+ $this->addColumn('firstname', array(
64
+ 'header' => Mage::helper('newsletter')->__('Customer First Name'),
65
+ 'index' => 'customer_firstname',
66
+ 'default' => '----'
67
+ ));
68
+
69
+ $this->addColumn('lastname', array(
70
+ 'header' => Mage::helper('newsletter')->__('Customer Last Name'),
71
+ 'index' => 'customer_lastname',
72
+ 'default' => '----'
73
+ ));
74
+
75
+ $this->addColumn('status', array(
76
+ 'header' => Mage::helper('newsletter')->__('Status'),
77
+ 'index' => 'subscriber_status',
78
+ 'sortable' => false,
79
+ 'type' => 'options',
80
+ 'options' => array(
81
+ Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE => Mage::helper('newsletter')->__('Not Activated'),
82
+ Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED => Mage::helper('newsletter')->__('Subscribed'),
83
+ Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED => Mage::helper('newsletter')->__('Unsubscribed'),
84
+ Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED => Mage::helper('newsletter')->__('Unconfirmed'),
85
+ )
86
+ ));
87
+
88
+ return parent::_prepareColumns();
89
+ }
90
+
91
+ /**
92
+ * Convert OptionsValue array to Options array
93
+ *
94
+ * @param array $optionsArray
95
+ * @return array
96
+ */
97
+ protected function _getOptions($optionsArray)
98
+ {
99
+ $options = array();
100
+ foreach ($optionsArray as $option) {
101
+ $options[$option['value']] = $option['label'];
102
+ }
103
+ return $options;
104
+ }
105
+
106
+ /**
107
+ * Retrieve Website Options array
108
+ *
109
+ * @return array
110
+ */
111
+ protected function _getWebsiteOptions()
112
+ {
113
+ return Mage::getModel('adminhtml/system_store')->getWebsiteOptionHash();
114
+ }
115
+
116
+ /**
117
+ * Retrieve Store Group Options array
118
+ *
119
+ * @return array
120
+ */
121
+ protected function _getStoreGroupOptions()
122
+ {
123
+ return Mage::getModel('adminhtml/system_store')->getStoreGroupOptionHash();
124
+ }
125
+
126
+ /**
127
+ * Retrieve Store Options array
128
+ *
129
+ * @return array
130
+ */
131
+ protected function _getStoreOptions()
132
+ {
133
+ return Mage::getModel('adminhtml/system_store')->getStoreOptionHash();
134
+ }
135
+ }
app/code/community/Creativestyle/Sare/Block/Adminhtml/Infoblock.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Block_Adminhtml_Infoblock extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ public function __construct(){
5
+ $this->setTemplate("sare/infoblock.phtml");
6
+ }
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element){
9
+ return Mage::app()->getLayout()->createBlock('Mage_Core_Block_Template', 'Sare_Infoblock', array('template' => 'sare/infoblock.phtml'))->toHtml();
10
+ }
11
+ }
app/code/community/Creativestyle/Sare/Block/Adminhtml/Targetinginfoblock.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Block_Adminhtml_Targetinginfoblock extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
3
+ {
4
+ public function __construct(){
5
+ $this->setTemplate("sare/targeting.phtml");
6
+ }
7
+
8
+ public function render(Varien_Data_Form_Element_Abstract $element){
9
+ return $this->toHtml();
10
+ }
11
+
12
+ public function getList(){
13
+ $model = new Creativestyle_Sare_Model_Customer();
14
+ return $model->labels;
15
+ }
16
+ }
app/code/community/Creativestyle/Sare/Helper/Data.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Author: Adam Karnowka <adam.karnowka@creativestyle.pl>
4
+ * Date: 23.06.13 Time: 11:33
5
+ * For questions, issues - please visit: http://www.creativestyle.de/email-marketing.html
6
+ */
7
+
8
+ class Creativestyle_Sare_Helper_Data extends Mage_Core_Helper_Abstract {
9
+
10
+ /**
11
+ * Sends notification mail to addresses defined in backend.
12
+ *
13
+ * @param string $title
14
+ * @param string $description
15
+ * @param array $modelData
16
+ * @param string $apiUrl
17
+ */
18
+
19
+ public function sendProblemNotification($title, $description, $modelData, $apiUrl){
20
+ Mage::getDesign()->setArea('frontend');
21
+ $dynamicContent = array(
22
+ '%TITLE%'=> Mage::helper('sare')->__($title),
23
+ '%MESSAGE%'=> Mage::helper('sare')->__($description),
24
+ '%REQUEST%'=> $modelData,
25
+ '%FOOTER%'=>Mage::helper('sare')->__('You receive these emails, because your address was entered in Magento configuration panel. You can disable them in Magento backend - Newsletter / SARE integration / Settings. <br/><br/>Have a nice day!<br/>SARE team.'),
26
+ '%API_URL%'=>trim($apiUrl)
27
+ );
28
+
29
+ $htmlBlock = Mage::app()->getLayout()->createBlock('core/template')->setTemplate('sare/problemnotification.phtml')->toHtml();
30
+ foreach($dynamicContent as $placeholder=>$text){
31
+ if(is_array($text)){
32
+ $text = ltrim(print_r($text, true));
33
+ }
34
+ $htmlBlock = str_replace($placeholder, $text, $htmlBlock);
35
+ }
36
+
37
+ $email = Mage::getModel('core/email_template');
38
+ $email->setSenderEmail(Mage::getStoreConfig('sare/settings/notification_senderemail'));
39
+ $email->setSenderName(Mage::getStoreConfig('sare/settings/notification_sendername'));
40
+ $email->setTemplateSubject(Mage::helper('sare')->__('SARE integration problem notification'));
41
+ $email->setTemplateText(str_replace(" ","",$htmlBlock));
42
+
43
+ $receivers = explode(",", Mage::getStoreConfig('sare/settings/exceptions_sent_to'));
44
+ foreach($receivers as $receiver){
45
+ $name = Mage::getStoreConfig('trans_email/'.$receiver.'/name');
46
+ $emailAddress = Mage::getStoreConfig('trans_email/'.$receiver.'/email');
47
+ $email->send($emailAddress, $name);
48
+ }
49
+ }
50
+ }
app/code/community/Creativestyle/Sare/Model/AdminNotification/Feed.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Creativestyle_Sare_Model_AdminNotification_Feed extends Mage_AdminNotification_Model_Feed {
4
+
5
+ /**
6
+ * Returns feed URL
7
+ * @return string URL where feed is located under
8
+ */
9
+
10
+ public function getFeedUrl() {
11
+ $url = Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://www.creativestyle.de/email-marketing/feed.rss';
12
+ return $url;
13
+ }
14
+
15
+
16
+ /**
17
+ * Performs feed update
18
+ */
19
+ public function observe() {
20
+ $this->checkUpdate();
21
+ }
22
+ }
23
+
24
+
app/code/community/Creativestyle/Sare/Model/Customer.php ADDED
@@ -0,0 +1,385 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Customer extends Mage_Core_Model_Abstract{
3
+
4
+ public $_attributes = array('customer_id', 'store_id', 'website_id', 'last_logged_in', 'registered_on', 'firstname', 'lastname', 'last_order_at', 'last_order_value', 'total_orders_count', 'total_orders_value', 'average_sale','city', 'postcode', 'customer_group_id','company', 'country_id','last_bought_products','last_order_at_unix','telephone','fax','dob','gender','wishlist_items', 'unsubscription_link','data_last_updated_at');
5
+ public $labels = array();
6
+
7
+ public function __construct(){
8
+ $this->labels = array(
9
+ 'customer_id'=>array('label'=>Mage::helper('sare')->__('Magento internal customer_id (entity_id)'), 'description'=>Mage::helper('sare')->__('')),
10
+ 'store_id'=>array('label'=>Mage::helper('sare')->__('Store ID in which customer registered in'), 'description'=>Mage::helper('sare')->__('')),
11
+ 'registered_on'=>array('label'=>Mage::helper('sare')->__('Register datetime'), 'description'=>Mage::helper('sare')->__('Holds date and time when customer has registered.')),
12
+ 'last_logged_in'=>array('label'=>Mage::helper('sare')->__('Last login date'), 'description'=>Mage::helper('sare')->__('Holds data when customer was logged in webshop.')),
13
+ 'unsubscription_link'=>array('label'=>Mage::helper('sare')->__('Unsubscribe URL'), 'description'=>Mage::helper('sare')->__('Contains unsubscribe URL, this field is required.')),
14
+ 'firstname'=>array('label'=>Mage::helper('sare')->__('Customer\'s firstname'), 'description'=>Mage::helper('sare')->__('Customer\'s firstname.')),
15
+ 'lastname'=>array('label'=>Mage::helper('sare')->__('Customer\'s lastname'), 'description'=>Mage::helper('sare')->__('Customer\'s lastname.')),
16
+ 'dob'=>array('label'=>Mage::helper('sare')->__('Date of birth'), 'description'=>Mage::helper('sare')->__('')),
17
+ 'gender'=>array('label'=>Mage::helper('sare')->__('Customer\'s gender'), 'description'=>Mage::helper('sare')->__('')),
18
+ 'company'=>array('label'=>Mage::helper('sare')->__('Customer\'s company'), 'description'=>Mage::helper('sare')->__('')),
19
+ 'postcode'=>array('label'=>Mage::helper('sare')->__('Customer\'s postcode (billing address)'), 'description'=>Mage::helper('sare')->__('')),
20
+ 'city'=>array('label'=>Mage::helper('sare')->__('Customer\'s city (billing address)'), 'description'=>Mage::helper('sare')->__('')),
21
+ 'telephone'=>array('label'=>Mage::helper('sare')->__('Customer\'s telephone number (billing address)'), 'description'=>Mage::helper('sare')->__('')),
22
+ 'fax'=>array('label'=>Mage::helper('sare')->__('Customer\'s fax number (billing address)'), 'description'=>Mage::helper('sare')->__('')),
23
+ 'country_id'=>array('label'=>Mage::helper('sare')->__('Customer\'s country id (f.e: DE, PL)'), 'description'=>Mage::helper('sare')->__('')),
24
+ 'customer_group_id'=>array('label'=>Mage::helper('sare')->__('Customer\'s group id'), 'description'=>Mage::helper('sare')->__('')),
25
+ 'last_order_at'=>array('label'=>Mage::helper('sare')->__('Last order datetime'), 'description'=>Mage::helper('sare')->__('Customer\'s lastname.')),
26
+ 'last_order_value'=>array('label'=>Mage::helper('sare')->__('Last order value (grand total)'), 'description'=>Mage::helper('sare')->__('Customer\'s last order value (grand total, incl. shipment, tax, dicount, etc)')),
27
+ 'total_orders_count'=>array('label'=>Mage::helper('sare')->__('Total orders count'), 'description'=>Mage::helper('sare')->__('')),
28
+ 'total_orders_value'=>array('label'=>Mage::helper('sare')->__('Total orders value'), 'description'=>Mage::helper('sare')->__('')),
29
+ 'average_sale'=>array('label'=>Mage::helper('sare')->__('Customer\'s average order value'), 'description'=>Mage::helper('sare')->__('')),
30
+ 'last_bought_products'=>array('label'=>Mage::helper('sare')->__('List of last bought items (sku1, sku2, ...)'), 'description'=>Mage::helper('sare')->__('')),
31
+ 'wishlist_items'=>array('label'=>Mage::helper('sare')->__('Products put in customer\'s wishlist (sku1, sku2, etc)'), 'description'=>Mage::helper('sare')->__('')),
32
+ 'data_last_updated_at'=>array('label'=>Mage::helper('sare')->__('Timestamp of last datachange'), 'description'=>Mage::helper('sare')->__('')),
33
+ );
34
+ }
35
+
36
+ /**
37
+ * Populates customer data and returns it in associative array
38
+ * @param $customer Customer object for which data is populated
39
+ * @return array Consumer's data array
40
+ */
41
+ public function populateCustomerData($customer){
42
+ $data = array();
43
+ foreach($this->_attributes as $attribute){
44
+ if(is_object($customer)&&$customer->getId()){
45
+ if($value = call_user_func(array($this, $attribute), $customer)){
46
+ $data[$attribute] = $value;
47
+ } else {
48
+ // Well, nothing :)
49
+ }
50
+ } else {
51
+ $data[$attribute] = call_user_func('Creativestyle_Sare_Model_Customer::'.$attribute, Mage::getModel('customer/customer'));
52
+ }
53
+ }
54
+ // Zend_Debug::dump($data);die();
55
+ return $data;
56
+ }
57
+
58
+ /**
59
+ * Returns customer's unsubsubcription URL
60
+ * @param Mage_Customer_Model_Customer $customer
61
+ * @return string $unsubscroptionLink
62
+ */
63
+ static function unsubscription_link($customer){
64
+ return Mage::getModel('newsletter/subscriber')->loadByEmail($customer->getEmail())->getUnsubscriptionLink();
65
+ }
66
+
67
+ /**
68
+ * Returns last login date. If not logged in yet- retuns actual time
69
+ * @param $customer
70
+ * @return string
71
+ */
72
+
73
+ static function last_logged_in($customer){
74
+ $version = Mage::getVersionInfo();
75
+
76
+ $logCustomer = Mage::getModel('log/customer')->load($customer->getId(), 'customer_id');
77
+ $lastVisited = $logCustomer->getLoginAtTimestamp();
78
+ if(empty($lastVisited)){
79
+ // Not logged in yet
80
+ $lastVisited = Mage::getModel('core/date')->date('Y-m-d H:i:s');
81
+ } else {
82
+ if($version['minor']<6){
83
+ $lastVisited = Mage::getModel('core/date')->date('Y-m-d H:i:s', $lastVisited);
84
+ } else {
85
+ $lastVisited = date('Y-m-d H:i:s', $lastVisited);
86
+ }
87
+ }
88
+ return $lastVisited;
89
+ }
90
+
91
+ /**
92
+ * @param Mage_Customer_Model_Customer $customer
93
+ * @return datetime Datetime of last user login (Y-m-d H:i:s)
94
+ */
95
+ static function data_last_updated_at($customer){
96
+ $now = Mage::getModel('core/date')->timestamp(time());
97
+ return date('Y-m-d H:i:s', $now);
98
+ }
99
+
100
+ /**
101
+ * Return customer's ID (entity_id)
102
+ * @param Mage_Customer_Model_Customer $customer
103
+ * @return int customer_id
104
+ */
105
+ static function customer_id($customer){
106
+ return $customer->getId();
107
+ }
108
+
109
+ /**
110
+ * Returns customer's firstname
111
+ * @param Mage_Customer_Model_Customer $customer
112
+ * @return string firstname
113
+ */
114
+ static function firstname($customer){
115
+ return $customer->getFirstname();
116
+ }
117
+
118
+ /**
119
+ * Returns customer's lastname
120
+ * @param Mage_Customer_Model_Customer $customer
121
+ * @return string lastname
122
+ */
123
+ static function lastname($customer){
124
+ return $customer->getLastname();
125
+ }
126
+
127
+ /**
128
+ * Returns customer's date-of-birth
129
+ * @param Mage_Customer_Model_Customer $customer
130
+ * @return string firstname
131
+ */
132
+ static function dob($customer){
133
+ return $customer->getDob();
134
+ }
135
+
136
+ /**
137
+ * @param Mage_Customer_Model_Customer $customer
138
+ * @return mixed Customer's gender or empty if nothing specified
139
+ */
140
+ static function gender($customer){
141
+ if($customer->getGender()){
142
+ return $customer->getGender();
143
+ } else {
144
+ return "";
145
+ }
146
+ }
147
+
148
+ /**
149
+ * Returns collction of orders for specified customer
150
+ * @param Mage_Customer_Model_Customer $customer
151
+ * @return Mage_Sales_Order_Collection $orders
152
+ */
153
+ static function getAllOrders($customer){
154
+ $orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', array('eq'=>$customer->getId()))->setOrder('created_at');
155
+ return $orders;
156
+ }
157
+
158
+ /**
159
+ * Returns last placed order or null (in case there are no order for this customer yet)
160
+ * @param Mage_Customer_Model_Customer $customer
161
+ * @return mixed datetime or null
162
+ */
163
+ static function getLastOrder($customer){
164
+ $orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id', array('eq'=>$customer->getId()))->setOrder('created_at');
165
+ $order = $orders->getFirstItem();
166
+ if($order->getId()){
167
+ return $order;
168
+ }
169
+ return false;
170
+ }
171
+
172
+ /**
173
+ * Returns datetime of last order for specified customer
174
+ * @param Mage_Customer_Model_Customer $customer
175
+ * @return datetime
176
+ */
177
+ static function last_order_at($customer){
178
+ $order = self::getLastOrder($customer);
179
+ if($order&&$order->getId()){
180
+ $sTime = Mage::app()
181
+ ->getLocale()
182
+ ->date(strtotime($order->getCreatedAtStoreDate()), null, null, false)
183
+ ->toString('YYYY-MM-dd H:m:s');
184
+
185
+ return $sTime;
186
+ }
187
+ return '';
188
+ }
189
+
190
+ /**
191
+ * Fetches list of SKUs for products placed in customer's wishlist.
192
+ * @param Mage_Customer_Model_Customer$customer
193
+ * @return string skus (separated by ,)
194
+ */
195
+ static function wishlist_items($customer){
196
+ $wishList = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer);
197
+ $wishListItemCollection = $wishList->getItemCollection();
198
+ $arrProductSkus = array();
199
+ if (count($wishListItemCollection)) {
200
+ foreach ($wishListItemCollection as $item) {
201
+ $product = $item->getProduct();
202
+ $arrProductSkus[] = $product->getSku();
203
+ }
204
+ }
205
+ return implode(',', $arrProductSkus);
206
+ }
207
+
208
+ /**
209
+ * Returns last order's datetima as timestamp
210
+ * @param $customer
211
+ * @return int|string
212
+ */
213
+ static function last_order_at_unix($customer){
214
+ $lastOrderAr = self::last_order_at($customer);
215
+ if($lastOrderAr!=''){
216
+ return strtotime($lastOrderAr);
217
+ }
218
+ return '';
219
+ }
220
+
221
+ /**
222
+ * Returns last order value (grand total)
223
+ * @param $customer
224
+ * @return float order value (grand total)
225
+ */
226
+ static function last_order_value($customer){
227
+ $order = self::getLastOrder($customer);
228
+ if($order&&$order->getId()){
229
+ return (float)$order->getGrandTotal();
230
+ }
231
+ return '';
232
+ }
233
+
234
+ /**
235
+ * Returns customer registration datetime
236
+ * @param Mage_Customer_Model_Customer $customer
237
+ * @return mixed
238
+ */
239
+ static function registered_on($customer){
240
+ $sTime = Mage::app()
241
+ ->getLocale()
242
+ ->date(strtotime($customer->getCreatedAt()), null, null, false)
243
+ ->toString('YYYY-MM-dd H:m:s');
244
+ return $sTime;
245
+ }
246
+
247
+ /**
248
+ * Returns customer city (using default billing address)
249
+ * @param Mage_Customer_Model_Customer $customer
250
+ * @return string
251
+ */
252
+ static function city($customer){
253
+ if(is_object($customer->getDefaultBillingAddress())){
254
+ return $customer->getDefaultBillingAddress()->getCity();
255
+ }
256
+ return '';
257
+ }
258
+
259
+ /**
260
+ * Returns storeID where customer has registered in
261
+ * @param $customer
262
+ * @return mixed
263
+ */
264
+ static function store_id($customer){
265
+ return $customer->getStoreId();
266
+ }
267
+
268
+ /**
269
+ * Returns websiteID where customer has registered in
270
+ * @param $customer
271
+ * @return mixed
272
+ */
273
+ static function website_id($customer){
274
+ return $customer->getWebsiteId();
275
+ }
276
+
277
+ static function company($customer){
278
+ if(is_object($customer->getDefaultBillingAddress())){
279
+ return $customer->getDefaultBillingAddress()->getCompany();
280
+ }
281
+ return '';
282
+ }
283
+
284
+ /**
285
+ * Returns customer's telephone number
286
+ * @param $customer
287
+ * @return string
288
+ */
289
+
290
+ static function telephone($customer){
291
+ if(is_object($customer->getDefaultBillingAddress())){
292
+ return $customer->getDefaultBillingAddress()->getTelephone();
293
+ }
294
+ return '';
295
+ }
296
+
297
+ /***
298
+ * Returns customer's fax number
299
+ * @param $customer
300
+ * @return string
301
+ */
302
+ static function fax($customer){
303
+ if(is_object($customer->getDefaultBillingAddress())){
304
+ return $customer->getDefaultBillingAddress()->getFax();
305
+ }
306
+ return '';
307
+ }
308
+
309
+ /**
310
+ * Returns customer's group ID
311
+ * @param $customer
312
+ * @return mixed
313
+ */
314
+ static function customer_group_id($customer){
315
+ return $customer->getGroupId();
316
+ }
317
+
318
+ /**
319
+ * Returns list of last bought products as comma separated list of SKUs
320
+ * @param $customer
321
+ * @return string
322
+ */
323
+ static function last_bought_products($customer){
324
+ $orders = self::getAllOrders($customer);
325
+ $items = array();
326
+ foreach($orders as $order){
327
+ foreach($order->getAllItems() as $item){
328
+ $items[] = $item->getSku();
329
+ }
330
+ }
331
+
332
+ return implode(',', $items);
333
+ }
334
+
335
+ /**
336
+ * Returns customer's postcody (billing address)
337
+ * @param $customer
338
+ * @return string
339
+ */
340
+ static function postcode($customer){
341
+ if(is_object($customer->getDefaultBillingAddress())){
342
+ return $customer->getDefaultBillingAddress()->getPostcode();
343
+ }
344
+ return '';
345
+ }
346
+
347
+ /**
348
+ * @param $customer
349
+ * @return string
350
+ */
351
+ static function country_id($customer){
352
+ if(is_object($customer->getDefaultBillingAddress())){
353
+ return $customer->getDefaultBillingAddress()->getCountryId();
354
+ }
355
+ return '';
356
+ }
357
+
358
+ static function total_orders_count($customer){
359
+ $orders = self::getAllOrders($customer);
360
+ return $orders->getSize();
361
+ }
362
+
363
+ static function total_orders_value($customer){
364
+ $orders = self::getAllOrders($customer);
365
+ $value = 0;
366
+ foreach($orders as $order){
367
+ $value += $order->getGrandTotal();
368
+ }
369
+ return $value;
370
+ }
371
+
372
+ static function average_sale($customer){
373
+ $orders = self::getAllOrders($customer);
374
+ $value = 0;
375
+ $count = 0;
376
+ foreach($orders as $order){
377
+ $value += $order->getGrandTotal();
378
+ $count ++;
379
+ }
380
+ if($count>0){
381
+ return round($value/$count,2);
382
+ }
383
+ return 0;
384
+ }
385
+ }
app/code/community/Creativestyle/Sare/Model/Email.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Email extends Mage_Core_Model_Abstract
3
+ {
4
+ public function __construct() {
5
+ $this->_init('sare/email', 'id');
6
+ }
7
+
8
+ public function loadByAttribute($attributeValue, $attributeCode){
9
+ $collection = Mage::getModel('creativestyle_sare/email')->getCollection()->addFieldToFilter($attributeCode, array('eq'=>$attributeValue));
10
+
11
+ if($collection->getSize()>0){
12
+ return $collection->getFirstItem();
13
+ }
14
+ return false;
15
+ }
16
+ }
app/code/community/Creativestyle/Sare/Model/Mysql4/Email.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Mysql4_Email extends Mage_Core_Model_Mysql4_Abstract {
3
+
4
+ protected function _construct() {
5
+ $this->_init('sare/email', 'id');
6
+ }
7
+ }
app/code/community/Creativestyle/Sare/Model/Mysql4/Email/Collection.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Mysql4_Email_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
3
+
4
+ public function _construct() {
5
+ parent::_construct();
6
+ }
7
+ }
app/code/community/Creativestyle/Sare/Model/Observer.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Observer{
3
+
4
+
5
+ public function newsletterSubscriberSaveCommitAfter(Varien_Event_Observer $observer)
6
+ {
7
+ if(!Mage::getStoreConfig('sare/settings/enabled')){
8
+ return $this;
9
+ }
10
+
11
+ $event = $observer->getEvent();
12
+ $subscriber = $event->getDataObject();
13
+
14
+ $statusChange = $subscriber->getIsStatusChanged();
15
+
16
+ if($subscriber->getCustomerId()==0){
17
+ // This is guest subscriber, check if we should synchro them
18
+ if(!Mage::getStoreConfig('sare/guest_settings/synchro_enabled')){
19
+ return false;
20
+ }
21
+ } else {
22
+ // Customer subscriber, again - need to check if we can save him/her
23
+ if(!Mage::getStoreConfig('sare/customer_settings/synchro_enabled')){
24
+ return false;
25
+ }
26
+ }
27
+
28
+ // Trigger if user is now subscribed and there has been a status change:
29
+ if ($statusChange == true) {
30
+ if($subscriber->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED) {
31
+ Mage::getModel('creativestyle_sare/sare')->subscribe($subscriber->getEmail(), $subscriber->getCustomerId(), $subscriber->getUnsubscriptionLink());
32
+
33
+
34
+ } elseif($subscriber->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED) {
35
+ Mage::getModel('creativestyle_sare/sare')->unsubscribe($subscriber->getEmail(), $subscriber->getCustomerId());
36
+ }
37
+ } else {
38
+ // Seems to be Magento bug - when unsubscribing, flag: isStatusChanged is false - should be true?
39
+ // Therefore we need to check if action == unsubscribe
40
+ $moduleName = Mage::app()->getRequest()->getModuleName();
41
+ $actionName = Mage::app()->getRequest()->getActionName();
42
+
43
+ if($moduleName=='newsletter'&&$actionName=='unsubscribe'){
44
+ Mage::getModel('creativestyle_sare/sare')->unsubscribe($subscriber->getEmail());
45
+ }
46
+ }
47
+ return $observer;
48
+ }
49
+
50
+ public function test($event){
51
+ $customerId = $event->getCustomerAddress()->getCustomerId();
52
+ $customer = Mage::getModel('customer/customer')->load($customerId);
53
+ $this->updateCustomerData($event, $customer);
54
+ }
55
+
56
+
57
+ public function customerDeletedAction(Varien_Event_Observer $observer) {
58
+ $subscriber = $observer->getEvent()->getSubscriber();
59
+ Mage::getModel('creativestyle_sare/sare')->unsubscribe($subscriber->getEmail(), $subscriber->getCustomerId());
60
+ }
61
+
62
+ public function updateCustomerDataAfterOrder($observer){
63
+ if(!Mage::getStoreConfig('sare/settings/enabled')){
64
+ return $this;
65
+ }
66
+
67
+ $order = $observer->getOrder();
68
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
69
+ $subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($customer->getEmail());
70
+
71
+ if(!$subscriberModel->isSubscribed()){
72
+ return false;
73
+ }
74
+
75
+ $sareSubscriberModel = Mage::getModel('creativestyle_sare/email')->loadByAttribute($customer->getEmail(), 'email');
76
+
77
+ // Now we know we have customer already subscribed in SARE as well (we have valid mkey!)
78
+ $customerData = Mage::getModel('creativestyle_sare/customer')->populateCustomerData($customer);
79
+ Mage::getModel('creativestyle_sare/sare')->updateCustomerData($customer, $customerData, $sareSubscriberModel->getMkey());
80
+ }
81
+
82
+ public function updateCustomerData($observer, $customer = null){
83
+
84
+ if(!Mage::getStoreConfig('sare/settings/enabled')){
85
+ return $this;
86
+ }
87
+
88
+ if(!$customer){
89
+ $customer = $observer->getCustomer();
90
+ }
91
+
92
+ // First, check if customer is subscribed in Magento NL
93
+ $subscriberModel = Mage::getModel('newsletter/subscriber')->loadByEmail($customer->getEmail());
94
+
95
+ if(!$subscriberModel->isSubscribed()){
96
+ // When someone is now unsubscribed, we will not update data, to be fair.
97
+
98
+ return false;
99
+ }
100
+
101
+
102
+
103
+ // Now check if we have mkey for this email address
104
+ $sareSubscriberModel = Mage::getModel('creativestyle_sare/email')->loadByAttribute($customer->getEmail(), 'email');
105
+
106
+ // Now we know we have customer already subscribed in SARE as well (we have valid mkey!)
107
+ // Let's populate customer data
108
+ $customerData = Mage::getModel('creativestyle_sare/customer')->populateCustomerData($customer);
109
+
110
+ // Update customer data at SARE side
111
+ Mage::getModel('creativestyle_sare/sare')->updateCustomerData($customer, $customerData, $sareSubscriberModel->getMkey());
112
+ }
113
+
114
+ // This is ugly hack for getting into dashboard blocks
115
+ // Alan Storm allowed it, so blame him!
116
+ public function coreBlockAbstractPrepareLayoutAfter(Varien_Event_Observer $observer)
117
+ {
118
+ if(!Mage::getStoreConfig('sare/settings/enabled')){
119
+ return $this;
120
+ }
121
+ if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
122
+ {
123
+ $block = $observer->getBlock();
124
+ if ($block->getNameInLayout() === 'dashboard')
125
+ {
126
+ $block->getChild('lastOrders')->setUseAsDashboardHook(true);
127
+ }
128
+ }
129
+ }
130
+
131
+ // This is ugly hack for getting into dashboard blocks
132
+ // Alan Storm allowed it, so blame him!
133
+ public function coreBlockAbstractToHtmlAfter(Varien_Event_Observer $observer)
134
+ {
135
+ if(!Mage::getStoreConfig('sare/settings/enabled')){
136
+ return $this;
137
+ }
138
+
139
+ if (Mage::app()->getFrontController()->getAction()->getFullActionName() === 'adminhtml_dashboard_index')
140
+ {
141
+ if ($observer->getBlock()->getUseAsDashboardHook())
142
+ {
143
+ $html = $observer->getTransport()->getHtml();
144
+ $myBlock = $observer->getBlock()->getLayout()
145
+ ->createBlock('sare/adminhtml_dashboard')
146
+ ->setTheValuesAndTemplateYouNeed('HA!');
147
+ $html .= $myBlock->toHtml();
148
+ $observer->getTransport()->setHtml($html);
149
+ }
150
+ }
151
+ }
152
+ }
app/code/community/Creativestyle/Sare/Model/Response.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Response{
3
+
4
+ public $ERROR_CODES = array();
5
+
6
+ public function __construct(){
7
+ $this->ERROR_CODES = array(1=>Mage::helper('sare')->__('Address added successfully.'),
8
+ 4=>Mage::helper('sare')->__('Address already exists, but has not been confirmed yet.'),
9
+ 7=>Mage::helper('sare')->__('Address already exists, but it is blocked by SARE operator.'),
10
+ 8=>Mage::helper('sare')->__('Address already exists, and it is confirmed already.'),
11
+ -1=>Mage::helper('sare')->__('One the required parameters is missing.'),
12
+ -2=>Mage::helper('sare')->__('E-mail address is not formed correctly.'),
13
+ -3=>Mage::helper('sare')->__('UID number is not formed correctly.'),
14
+ -4=>Mage::helper('sare')->__('Wrong integration key.'),
15
+ -5=>Mage::helper('sare')->__('GSM number is not formed correctly.'),
16
+ -97=>Mage::helper('sare')->__('API limit is set.'),
17
+ -98=>Mage::helper('sare')->__('Wrong UID.'),
18
+ -99=>Mage::helper('sare')->__('Database connection error.'),
19
+ );
20
+ }
21
+
22
+ public function getErrorDescription($errorCode){
23
+ return isset($this->ERROR_CODES[$errorCode]) ? $this->ERROR_CODES[$errorCode] : Mage::helper('sare')->__('Unknown error.');
24
+ }
25
+
26
+ }
app/code/community/Creativestyle/Sare/Model/Sare.php ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Sare{
3
+
4
+ private $_requestParams = array();
5
+ private $_apiEndPoint = '';
6
+ private $_method = '';
7
+ private $_currentApiUrl = '';
8
+
9
+ public $_responseCode = null;
10
+
11
+ const SARE_API_SUBSCRIBE_METHOD = 'acq.php';
12
+ const SARE_API_UNSUBSCRIBE_METHOD = 'rm.php';
13
+ const SARE_API_UPDATE_METHOD = 'upd.php';
14
+
15
+ const SETTINGS_KEY_CUSTOMER = 'customer';
16
+ const SETTINGS_KEY_GUEST = 'customer';
17
+
18
+
19
+ private function validateSettings(){
20
+ if(!Mage::getStoreConfig('sare/settings/uid') || !Mage::getStoreConfig('sare/settings/key')){
21
+ Mage::log('Wrong settings, cannot do anything...', Zend_Debug::ALERT, 'sare.log');
22
+ return false;
23
+ }
24
+ return true;
25
+ }
26
+
27
+ private function buildDefaultParamsForRemoval(){
28
+ $this->_requestParams['u'] = Mage::getStoreConfig('sare/settings/uid');
29
+ $this->_requestParams['key'] = Mage::getStoreConfig('sare/settings/key');
30
+ $this->_apiEndPoint = Mage::getStoreConfig('sare/settings/sare_endpoint_url');
31
+ }
32
+
33
+ private function buildDefaultParams(){
34
+ $now = Mage::getModel('core/date')->timestamp(time());
35
+
36
+ $this->_requestParams['s_uid'] = Mage::getStoreConfig('sare/settings/uid');
37
+ $this->_requestParams['s_key'] = Mage::getStoreConfig('sare/settings/key');
38
+ $this->_requestParams['s_rv'] = 1; // This one will force numerical response from SARE side
39
+ $this->_requestParams['s_status'] = Mage::getStoreConfig('sare/settings/save_as');
40
+ $this->_requestParams['s_cust_data_last_updated_at'] = date('Y-m-d H:i:s', $now);
41
+
42
+ $this->_apiEndPoint = Mage::getStoreConfig('sare/settings/sare_endpoint_url');
43
+
44
+ if(!Mage::getStoreConfig('sare/settings/send_confirmation_email')){
45
+ // s_no_send = 1 will not trigger default confirmation emails
46
+ $this->_requestParams['s_no_send'] = 1;
47
+ }
48
+ }
49
+
50
+ private function send(){
51
+ $url = $this->_apiEndPoint.$this->_method;
52
+ $pairs = array();
53
+ foreach($this->_requestParams as $key => $value){
54
+ $pairs[] = $key.'='.urlencode($value);
55
+ }
56
+
57
+ $url .= '?'.implode('&', $pairs);
58
+
59
+ $this->_currentApiUrl = $url;
60
+
61
+ Mage::log(' Sent request / : '.$this->_method.' - '.$url,1,'sare.log');
62
+ try{
63
+ $response = file_get_contents($url);
64
+ } catch (Exception $e){
65
+ Mage::log('Fatal exception: '.$e->getMessage(),null, 'sare.log');
66
+ return false;
67
+ }
68
+ return $this->processResponse($response);
69
+ }
70
+
71
+
72
+ private function processResponse($response, $email = null){
73
+ if(is_numeric($response)){
74
+ $this->_responseCode = $response;
75
+ }
76
+
77
+ $keyArr = explode('=', $response);
78
+ if($this->_method==self::SARE_API_SUBSCRIBE_METHOD){
79
+ if(count($keyArr)==2){
80
+ $model = Mage::getModel('creativestyle_sare/email');
81
+ $collection = $model->getCollection()->addFieldToFilter('email', array('eq'=>$this->_requestParams['s_email']));
82
+ foreach($collection as $item){
83
+ $modeItem = Mage::getModel('creativestyle_sare/email')->load($item->getId());
84
+ $modeItem->delete();
85
+ }
86
+ $model->setId(NULL)->setEmail($this->_requestParams['s_email'])->setCreatedAt(date('Y-m-d H:i:s'))->setMkey($keyArr[1])->save();
87
+ Mage::log(' -> Got acq response: '.$keyArr[1].' / '.$this->_requestParams['s_email'],Zend_Log::INFO,'sare.log');
88
+
89
+ // Populate customer data
90
+ $customersCollection = Mage::getModel('customer/customer')->getCollection()->addFieldToFilter('email', array('eq'=>$this->_requestParams['s_email']));
91
+ foreach($customersCollection as $customerModel){
92
+ $customerData = Mage::getModel('creativestyle_sare/customer')->populateCustomerData(Mage::getModel('customer/customer')->load($customerModel->getId()));
93
+ Mage::getModel('creativestyle_sare/sare')->updateCustomerData($customerModel, $customerData, $keyArr[1]);
94
+ }
95
+
96
+
97
+
98
+
99
+
100
+
101
+ return $keyArr[1];
102
+ } else {
103
+
104
+ if(is_numeric($response)){
105
+ Mage::log(' --> System returned problem: #'.$response, null, 'sare.log');
106
+ $this->_responseCode = $response;
107
+ }
108
+ Mage::helper('sare')->sendProblemNotification('Subscribe problem', Mage::getModel('creativestyle_sare/response')->getErrorDescription($this->_responseCode).' ('.$this->_responseCode.')', $this->_requestParams, $this->_currentApiUrl);
109
+ return false;
110
+ }
111
+ }
112
+ if($this->_method==self::SARE_API_UPDATE_METHOD){
113
+ if(trim($response)=="1"){
114
+ Mage::log(' -> Got upd response: '.$response, Zend_Log::INFO, 'sare.log');
115
+ return true;
116
+ } else {
117
+ Mage::helper('sare')->sendProblemNotification('Update problem', Mage::getModel('creativestyle_sare/response')->getErrorDescription($this->_responseCode).' ('.$this->_responseCode.')', $this->_requestParams, $this->_currentApiUrl);
118
+ Mage::log(' -> Got upd response (failed): '.$response, Zend_Log::ALERT,'sare.log');
119
+ return false;
120
+ }
121
+ }
122
+ if($this->_method==self::SARE_API_UNSUBSCRIBE_METHOD){
123
+ if(!empty($this->_requestParams['mkey'])){
124
+ $model = Mage::getModel('creativestyle_sare/email')->loadByAttribute($this->_requestParams['mkey'], 'mkey');
125
+ $fullModel = Mage::getModel('creativestyle_sare/email')->load($model->getId());
126
+
127
+ $fullModel->delete();
128
+ Mage::log(' -> Got rm.php response: '.htmlentities(nl2br($response)), Zend_Log::ALERT, 'sare.log');
129
+ return false;
130
+ }
131
+
132
+ // We're just gonna assume it was ok
133
+ return true;
134
+ }
135
+ }
136
+
137
+ public function subscribe($email, $customerId, $unsubscriptionUrl){
138
+ if(!$this->validateSettings()){
139
+ return false;
140
+ }
141
+
142
+ if($customerId==0){
143
+ // Guest subscriber
144
+ $settingsKey = self::SETTINGS_KEY_GUEST;
145
+ } else {
146
+ // Customer subscriber
147
+ $settingsKey = self::SETTINGS_KEY_CUSTOMER;
148
+ }
149
+
150
+ $this->buildDefaultParams();
151
+ $this->_requestParams['s_email'] = $email;
152
+ $this->_requestParams['s_cust_unsubscription_link'] = $unsubscriptionUrl; // Unsubscription link MUST BE always sent!
153
+
154
+ $targetGroups = explode(',', Mage::getStoreConfig('sare/'.$settingsKey.'_settings/group_id'));
155
+ foreach($targetGroups as $targetGroup){
156
+ $this->_requestParams['s_group_'.$targetGroup] = 1;
157
+ }
158
+
159
+ $this->_method = self::SARE_API_SUBSCRIBE_METHOD;
160
+ return $this->send();
161
+ }
162
+
163
+ public function unsubscribe($email){
164
+ if(!$this->validateSettings()){
165
+ return false;
166
+ }
167
+
168
+ $this->buildDefaultParamsForRemoval();
169
+
170
+ $emailsCollection = Mage::getModel('creativestyle_sare/email')->getCollection()->addFieldToFilter('email', array('eq'=>$email));
171
+ $emailObject = $emailsCollection->getFirstItem();
172
+
173
+ $this->_requestParams['mkey'] = $emailObject->getMkey();
174
+ $this->_requestParams['s_status'] = 7;
175
+ $this->_method = self::SARE_API_UNSUBSCRIBE_METHOD;
176
+
177
+ if(empty($this->_requestParams['mkey'])){
178
+ if(!empty($email)){
179
+ Mage::log(Mage::helper('sare')->__('Cant unsubscribe this address: %s, missing mkey!', $email), null, 'sare.log');
180
+ return false;
181
+ }
182
+ }
183
+ return $this->send();
184
+ }
185
+
186
+ public function updateCustomerData($customer, $customerData, $key){
187
+ if(!$this->validateSettings()){
188
+ return false;
189
+ }
190
+
191
+ $this->buildDefaultParams();
192
+ $this->_method = self::SARE_API_UPDATE_METHOD;
193
+ $this->_requestParams['s_mkey'] = $key;
194
+ foreach($customerData as $key=>$value){
195
+ $this->_requestParams['s_cust_'.$key] = $value;
196
+ }
197
+
198
+ $this->send();
199
+ }
200
+ }
app/code/community/Creativestyle/Sare/Model/Status.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_Model_Status{
3
+ public function toOptionArray()
4
+ {
5
+ // This is list of statuses available in SARE with corresponding labels
6
+ // Source: http://dev.sare.pl/sare-api/rest-api/aneks/
7
+ return array(
8
+ 2=>Mage::helper('sare')->__('Removed by SARE operator'),
9
+ 3=>Mage::helper('sare')->__('Willing to sign off'),
10
+ 4=>Mage::helper('sare')->__('Willing to sign off (by link)'),
11
+ 5=>Mage::helper('sare')->__('Not confirmed, confirmation email not sent'),
12
+ 6=>Mage::helper('sare')->__('Saved, waiting to be confirmed'),
13
+ 7=>Mage::helper('sare')->__('Subscriber blocked'),
14
+ 8=>Mage::helper('sare')->__('Saved and confirmed')
15
+ );
16
+ }
17
+ }
app/code/community/Creativestyle/Sare/controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Creativestyle_Sare_Adminhtml_IndexController
4
+ extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ private $_fieldSeparator = ";";
7
+ private $_lineSeparator = "\n";
8
+
9
+ /**
10
+ * @deprecated This is not needed now...
11
+ */
12
+ public function csvAction(){
13
+ return $this;
14
+ $collection = Mage::getResourceSingleton('newsletter/subscriber_collection');
15
+ $collection->showCustomerInfo(true)
16
+ ->addSubscriberTypeField()
17
+ ->showStoreInfo();
18
+
19
+ $csv = '';
20
+ $csvArr = array();
21
+ $subscribersArr = $collection->toArray();
22
+
23
+ foreach($subscribersArr['items'] as $subscriberArray){
24
+ $csvArr[] = implode($this->_fieldSeparator, $subscriberArray);
25
+ }
26
+
27
+ $csvContent = implode($this->_lineSeparator, $csvArr);
28
+
29
+ $this->getResponse()
30
+ ->clearHeaders()
31
+ ->setHeader('Content-Disposition', 'attachment; filename=sare_subscribers.csv')
32
+ ->setHeader('Content-Type', 'text/csv')
33
+ ->setBody($csvContent);
34
+ }
35
+
36
+ /**
37
+ * This one is used for generating last-added subscribers in dashboard grid.
38
+ */
39
+ public function subscribersgridAction(){
40
+ $this->loadLayout();
41
+ $this->renderLayout();
42
+ }
43
+
44
+ /**
45
+ * View used for displaying logs in nicely formatted view.
46
+ */
47
+ public function logsAction(){
48
+ $logContent = file_get_contents(getcwd().DS.'var'.DS.'log'.DS.'sare.log');
49
+ echo '<link rel="stylesheet" type="text/css" media="screen" href="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'/adminhtml/base/default/css/sare.css" />';
50
+ $logEntries = explode("\n", $logContent);
51
+ foreach($logEntries as $logEntry){
52
+ echo '<div class="logEntry">'.$logEntry.'</div>';
53
+ }
54
+ die();
55
+ }
56
+
57
+ public function synchroAction(){
58
+ $processMode = $this->getRequest()->getParam('process');
59
+ if($processMode==1){
60
+ $subscriberId = $this->getRequest()->getParam('subscriber_id');
61
+ $responseArr = array();
62
+
63
+ // Logic for subscribe
64
+ $collection = Mage::getResourceSingleton('newsletter/subscriber_collection');
65
+ $collection->showCustomerInfo(true)
66
+ ->addSubscriberTypeField()
67
+ ->showStoreInfo();
68
+
69
+ $collection->getSelect()->order('subscriber_id ASC');
70
+ $collection->addFieldToFilter('subscriber_id', array('gt'=>$subscriberId));
71
+ $currentSubscriber = $collection->getFirstItem();
72
+ if(!$currentSubscriber->getId()){
73
+ echo json_encode($responseArr);
74
+ Mage::log('Batch process finished!', null, 'sare.log');
75
+ return false;
76
+ }
77
+ $responseArr['messages'][] = array('text'=>$this->__('Processing: %s', $currentSubscriber->getSubscriberEmail()), 'class'=>'user');
78
+
79
+ if($currentSubscriber->getSubscriberStatus()==Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED){
80
+ // Should be subscriber
81
+ $responseArr['messages'][] = array('text'=>$this->__('<b>%s</b> should be subscribed...', $currentSubscriber->getSubscriberEmail()), 'class'=>'info');
82
+ $sare = Mage::getModel('creativestyle_sare/sare');
83
+ $mkey = $sare->subscribe($currentSubscriber->getEmail(), $currentSubscriber->getCustomerId());
84
+ if($mkey){
85
+ $responseArr['messages'][] = array('text'=> $this->__('Subscribed with mkey = %s', $mkey), 'class'=>'success');
86
+ if($currentSubscriber->getCustomerId()>0){
87
+ // This is existing customer, let's generate his data!
88
+ $customerData = Mage::getModel('creativestyle_sare/customer')->populateCustomerData(Mage::getModel('customer/customer')->load($currentSubscriber->getCustomerId()));
89
+ Mage::getModel('creativestyle_sare/sare')->updateCustomerData(Mage::getModel('customer/customer')->load($currentSubscriber->getCustomerId()), $customerData, $mkey);
90
+ $responseArr['messages'][] = array('text'=>$this->__('Populated detailed customer data and sent to SARE'), 'class'=>'success');
91
+ }
92
+ $responseArr['class'] = 'success';
93
+
94
+ } else {
95
+ if($sare->_responseCode){
96
+ $responseArr['messages'][] = array('text'=> $this->__('Failed to subscribe - SARE returned error %s (%s)', $sare->_responseCode, Mage::getModel('creativestyle_sare/response')->getErrorDescription($sare->_responseCode)), 'class'=>'error');
97
+ } else {
98
+ $responseArr['messages'][] = array('text'=> $this->__('Failed to subscribe - check logs!'), 'class'=>'error');
99
+ }
100
+ }
101
+ } else {
102
+ // Should be unsubscribed
103
+ $responseArr['messages'][] = array('text'=>$this->__('<b>%s</b> should be unsubscribed...', $currentSubscriber->getSubscriberEmail()), 'class'=>'remove');
104
+ if(Mage::getModel('creativestyle_sare/sare')->unsubscribe($currentSubscriber->getEmail())){
105
+ $responseArr['messages'][] = array('text'=>$this->__('%s has been unsubscribed successfully', $currentSubscriber->getSubscriberEmail()), 'class'=>'success');
106
+ $responseArr['class'] = 'success';
107
+ } else {
108
+ $responseArr['messages'][] = array('text'=>$this->__('Failed to unsubscribe - check logs!'), 'class'=>'error');
109
+ $responseArr['class'] = 'error';
110
+ }
111
+ }
112
+ $responseArr['subscriber_id'] = $currentSubscriber->getSubscriberId();
113
+
114
+ echo json_encode($responseArr);
115
+ die();
116
+ } else {
117
+
118
+ $html = '<script type="text/javascript" src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'sare/synchro.js"></script>';
119
+ $html .= '<script type="text/javascript" src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS).'sare/jquery-1.10.2.min.js"></script>';
120
+
121
+ $html .= '<link rel="stylesheet" type="text/css" media="screen" href="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN).'/adminhtml/base/default/css/sare.css" />';
122
+ $html .= '<style>* {font-family: Helvetica, "Tahoma", courier;font-size:12px;} </style>';
123
+
124
+ $html .= '<div id="wrapper">';
125
+ $collection = Mage::getResourceSingleton('newsletter/subscriber_collection');
126
+ $collection->showCustomerInfo(true)
127
+ ->addSubscriberTypeField()
128
+ ->showStoreInfo();
129
+
130
+ $html .= '<div class="transfer"><div class="saretext"><b>'.$this->__('Whats going on?').'</b><ul class="sare-batch">
131
+ <li>'.$this->__('every confirmed subscriber is added to SARE').'</li>
132
+ <li>'.$this->__('if subscriber is not confirmed - appropriate status is set in SARE').'</li>
133
+ <li>'.$this->__('if subscriber is a customer - detailed data is populated and sent to SARE').'</li>
134
+ </ul>
135
+ <br/>'.$this->__('<b>NOTE:</b> Do not close this window.').'
136
+ </div></div>';
137
+ $html .= '<div class="row">'.$this->__('Started mass synchro...').'</div>';
138
+ $html .= '<div class="row">'.$this->__('Subscribers to process: <b>%s</b>', $collection->getSize()).'</div>';
139
+
140
+ $collection->getSelect()->order('subscriber_id ASC');
141
+ $subscriber = $collection->getFirstItem();
142
+
143
+ if($collection->getSize()>0){
144
+ $html.= '<script type="text/javascript">
145
+ finalMessage = "'.$this->__("<div class='row complete'>All done! <a href='https://ww0.enewsletter.pl/index2.php'>Login to SARE panel</a> now</div>").'";
146
+ currentUrl = "'.Mage::helper('core/url')->getCurrentUrl().'";sareProcessSubscriber("0");</script>';
147
+ }
148
+
149
+ $html .= '</div>';
150
+ echo $html;
151
+ }
152
+ }
153
+ }
app/code/community/Creativestyle/Sare/controllers/IndexController.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Creativestyle_Sare_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function abandonedcartsAction(){
5
+ $key = $this->getRequest()->getParam('key');
6
+ if($key!=Mage::getStoreConfig('sare/settings/key')){
7
+ die('Wrong key!');
8
+ }
9
+
10
+ $collection = Mage::getResourceModel('reports/quote_collection');
11
+ $collection->prepareForAbandonedReport($this->_storeIds);
12
+
13
+ $items= array();
14
+ foreach($collection as $order){
15
+
16
+ $updatedAt = $order->getUpdatedAt();
17
+ $item = array('updated_at'=>$updatedAt,
18
+ 'created_at'=>$order->getCreatedAt(),
19
+ 'grand_total'=>$order->getGrandTotal(),
20
+ 'customer_name'=>$order->getCustomerName(),
21
+ 'customer_id'=>$order->getCustomerId(),
22
+ 'customer_email'=>$order->getCustomerEmail(),
23
+ );
24
+
25
+ $productItems = '';
26
+ foreach($order->getAllVisibleItems() as $quoteItem){
27
+ $productItems = implode('|', array('sku'=>$quoteItem->getSku(),
28
+ 'name'=>$quoteItem->getName(),
29
+ 'qty'=>$quoteItem->getQty(),
30
+ 'price'=>$quoteItem->getPrice()
31
+ ));
32
+ }
33
+
34
+ $item['items'] = $productItems;
35
+ $items[] = $item;
36
+ }
37
+ echo serialize($items);
38
+ die();
39
+ }
40
+
41
+ public function getcartAction(){
42
+ $key = $this->getRequest()->getParam('key');
43
+ if($key!=Mage::getStoreConfig('sare/settings/key')){
44
+ die('Wrong key!');
45
+ }
46
+
47
+ $block = Mage::app()->getLayout()->createBlock('Creativestyle_Sare_Block_Abandonedcartitems', 'Sare_ACItems', array('template' => 'sare/abandonedcarts.phtml'));
48
+ echo $block->toHtml();
49
+ die();
50
+ }
51
+ }
app/code/community/Creativestyle/Sare/etc/adminhtml.xml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <menu>
4
+ <newsletter translate="title" module="sare">
5
+ <children>
6
+ <sare translate="title" module="sare">
7
+ <title>SARE integration</title>
8
+ <action>adminhtml/system_config/edit/section/sare/</action>
9
+ </sare>
10
+ </children>
11
+ </newsletter>
12
+ </menu>
13
+ <acl>
14
+ <resources>
15
+ <admin>
16
+ <children>
17
+ <system>
18
+ <children>
19
+ <config>
20
+ <children>
21
+ <sare translate="title" module="sare">
22
+ <title>SARE integration</title>
23
+ </sare>
24
+ </children>
25
+ </config>
26
+ </children>
27
+ </system>
28
+ </children>
29
+ </admin>
30
+ </resources>
31
+ </acl>
32
+ </config>
app/code/community/Creativestyle/Sare/etc/config.xml ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Creativestyle_Sare>
5
+ <version>1.0.2</version>
6
+ </Creativestyle_Sare>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <creativestyle_sare>
11
+ <class>Creativestyle_Sare_Model</class>
12
+ </creativestyle_sare>
13
+ <sare>
14
+ <class>Creativestyle_Sare_Model</class>
15
+ <resourceModel>sare_mysql4</resourceModel>
16
+ </sare>
17
+ <sare_mysql4>
18
+ <class>Creativestyle_Sare_Model_Mysql4</class>
19
+ <entities>
20
+ <email>
21
+ <table>cs_sare_email</table>
22
+ </email>
23
+ </entities>
24
+ </sare_mysql4>
25
+ <adminnotification>
26
+ <rewrite>
27
+ <feed>Creativestyle_Sare_Model_AdminNotification_Feed</feed>
28
+ </rewrite>
29
+ </adminnotification>
30
+ </models>
31
+ <blocks>
32
+ <sare>
33
+ <class>Creativestyle_Sare_Block</class>
34
+ </sare>
35
+ <adminhtml>
36
+ <rewrite>
37
+ <dashboard_grids>Creativestyle_Sare_Block_Adminhtml_Dashboard_Grids</dashboard_grids>
38
+ </rewrite>
39
+ </adminhtml>
40
+ </blocks>
41
+ <helpers>
42
+ <sare>
43
+ <class>Creativestyle_Sare_Helper</class>
44
+ </sare>
45
+ </helpers>
46
+ <resources>
47
+ <creativestyle_sare_setup>
48
+ <setup>
49
+ <module>Creativestyle_Sare</module>
50
+ </setup>
51
+ </creativestyle_sare_setup>
52
+ </resources>
53
+ <events>
54
+ <customer_address_save_after>
55
+ <observers>
56
+ <your_unique_event_name>
57
+ <class>creativestyle_sare/observer</class>
58
+ <method>test</method>
59
+ </your_unique_event_name>
60
+ </observers>
61
+ </customer_address_save_after>
62
+ <newsletter_subscriber_save_commit_after>
63
+ <observers>
64
+ <your_unique_event_name>
65
+ <class>creativestyle_sare/observer</class>
66
+ <method>newsletterSubscriberSaveCommitAfter</method>
67
+ </your_unique_event_name>
68
+ </observers>
69
+ </newsletter_subscriber_save_commit_after>
70
+ <newsletter_subscriber_delete_after>
71
+ <observers>
72
+ <when_subscriber_model_is_deleted>
73
+ <class>creativestyle_sare/observer</class>
74
+ <method>customerDeletedAction</method>
75
+ </when_subscriber_model_is_deleted>
76
+ </observers>
77
+ </newsletter_subscriber_delete_after>
78
+ <customer_login>
79
+ <observers>
80
+ <update_customer_data>
81
+ <class>creativestyle_sare/observer</class>
82
+ <method>updateCustomerData</method>
83
+ </update_customer_data>
84
+ </observers>
85
+ </customer_login>
86
+ <sales_order_place_after>
87
+ <observers>
88
+ <update_customer_data_after_order>
89
+ <class>creativestyle_sare/observer</class>
90
+ <method>updateCustomerDataAfterOrder</method>
91
+ </update_customer_data_after_order>
92
+ </observers>
93
+ </sales_order_place_after>
94
+ <core_block_abstract_prepare_layout_after>
95
+ <observers>
96
+ <your_module>
97
+ <class>creativestyle_sare/observer</class>
98
+ <method>coreBlockAbstractPrepareLayoutAfter</method>
99
+ </your_module>
100
+ </observers>
101
+ </core_block_abstract_prepare_layout_after>
102
+ <core_block_abstract_to_html_after>
103
+ <observers>
104
+ <your_module>
105
+ <class>creativestyle_sare/observer</class>
106
+ <method>coreBlockAbstractToHtmlAfter</method>
107
+ </your_module>
108
+ </observers>
109
+ </core_block_abstract_to_html_after>
110
+ <controller_action_predispatch>
111
+ <observers>
112
+ <meanbee_notification>
113
+ <type>singleton</type>
114
+ <class>creativestyle_sare/AdminNotification_feed</class>
115
+ <method>observe</method>
116
+ </meanbee_notification>
117
+ </observers>
118
+ </controller_action_predispatch>
119
+ </events>
120
+ </global>
121
+ <admin>
122
+ <routers>
123
+ <sare>
124
+ <use>admin</use>
125
+ <args>
126
+ <module>Creativestyle_Sare</module>
127
+ <frontName>sare</frontName>
128
+ </args>
129
+ </sare>
130
+ </routers>
131
+ </admin>
132
+ <adminhtml>
133
+ <acl>
134
+ <resources>
135
+ <all>
136
+ <title>Allow Everything</title>
137
+ </all>
138
+ <admin>
139
+ <children>
140
+ <system>
141
+ <children>
142
+ <config>
143
+ <children>
144
+ <sare>
145
+ <title>SARE integration settings</title>
146
+ </sare>
147
+ </children>
148
+ </config>
149
+ </children>
150
+ </system>
151
+ </children>
152
+ </admin>
153
+ </resources>
154
+ </acl>
155
+ <layout>
156
+ <updates>
157
+ <sare>
158
+ <file>sare.xml</file>
159
+ </sare>
160
+ </updates>
161
+ </layout>
162
+ <translate>
163
+ <modules>
164
+ <creativestyle_sare>
165
+ <files>
166
+ <default>sare.csv</default>
167
+ </files>
168
+ </creativestyle_sare>
169
+ </modules>
170
+ </translate>
171
+ </adminhtml>
172
+ <default>
173
+ <sare>
174
+ <settings>
175
+ <sare_endpoint_url>http://s.enewsletter.pl/</sare_endpoint_url>
176
+ <group_id>0</group_id>
177
+ <send_confirmation_email>0</send_confirmation_email>
178
+ <save_as>8</save_as>
179
+ <notification_senderemail>notifications@example.com</notification_senderemail>
180
+ <notification_sendername>SARE integrator</notification_sendername>
181
+ </settings>
182
+ </sare>
183
+ <trans_email>
184
+ <email_manager>
185
+ <name>E-mail marketing manager name</name>
186
+ <email>custom@custom.com</email>
187
+ </email_manager>
188
+ <website_developer>
189
+ <name>Website developer</name>
190
+ <email>custom@custom.com</email>
191
+ </website_developer>
192
+ </trans_email>
193
+ </default>
194
+ </config>
app/code/community/Creativestyle/Sare/etc/sarescripts/fetchAbandonedCartsUsers.txt ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ##################################################################################
2
+ # #
3
+ # This sarescript will connect to your Magento and fetch list #
4
+ # of all users which should get abandoned cart notification. #
5
+ # Make sure you update $url variable to match your abandoned carts interface. #
6
+ # Required big registry called "abandonedCartUsers" #
7
+ # Datasource: none #
8
+ # #
9
+ ##################################################################################
10
+
11
+ bigregistry_set('abandonedCartUsers', "a:0:{}");
12
+ $currentRegistryValues = unserialize(bigregistry_get('abandonedCartUsers'));
13
+
14
+ $url = "http://premium-club.fanorakel.de/test.html";
15
+ $serialized = get_url($url);
16
+ $arr = unserialize($serialized);
17
+ for($i=0 to count($arr)-1){
18
+ $tmpArr = $arr[$i];
19
+ $customerId = $tmpArr['customer_id'];
20
+ $currentRegistryValues[count($currentRegistryValues)] = $customerId;
21
+ }
22
+ bigregistry_set('abandonedCartUsers', serialize($currentRegistryValues));
app/code/community/Creativestyle/Sare/etc/system.xml ADDED
@@ -0,0 +1,375 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <tabs>
3
+ <creativestyle translate="label" module="sare">
4
+ <label>Creativestyle</label>
5
+ <sort_order>100</sort_order>
6
+ </creativestyle>
7
+ </tabs>
8
+ <sections>
9
+ <trans_email>
10
+ <groups>
11
+ <website_developer translate="label">
12
+ <label>Website developer</label>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>100</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <fields>
19
+ <email translate="label">
20
+ <label>Sender Email</label>
21
+ <frontend_type>text</frontend_type>
22
+ <validate>validate-email</validate>
23
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
24
+ <sort_order>2</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ </email>
29
+ <name translate="label">
30
+ <label>Sender Name</label>
31
+ <frontend_type>text</frontend_type>
32
+ <backend_model>adminhtml/system_config_backend_email_sender</backend_model>
33
+ <validate>validate-emailSender</validate>
34
+ <sort_order>1</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </name>
39
+ </fields>
40
+ </website_developer>
41
+ </groups>
42
+
43
+ <groups>
44
+ <email_manager translate="label">
45
+ <label>E-mail marketing manager</label>
46
+ <frontend_type>text</frontend_type>
47
+ <sort_order>99</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ <fields>
52
+ <email translate="label">
53
+ <label>Sender Email</label>
54
+ <frontend_type>text</frontend_type>
55
+ <validate>validate-email</validate>
56
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
57
+ <sort_order>2</sort_order>
58
+ <show_in_default>1</show_in_default>
59
+ <show_in_website>1</show_in_website>
60
+ <show_in_store>1</show_in_store>
61
+ </email>
62
+ <name translate="label">
63
+ <label>Sender Name</label>
64
+ <frontend_type>text</frontend_type>
65
+ <backend_model>adminhtml/system_config_backend_email_sender</backend_model>
66
+ <validate>validate-emailSender</validate>
67
+ <sort_order>1</sort_order>
68
+ <show_in_default>1</show_in_default>
69
+ <show_in_website>1</show_in_website>
70
+ <show_in_store>1</show_in_store>
71
+ </name>
72
+ </fields>
73
+ </email_manager>
74
+
75
+ </groups>
76
+ </trans_email>
77
+ <sare translate="label" module="sare">
78
+ <label><![CDATA[<div class="sare-settings-headline"> integration</div>]]></label>
79
+ <tab>creativestyle</tab>
80
+ <frontend_type>text</frontend_type>
81
+ <sort_order>140</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ <groups>
86
+ <settings translate="label">
87
+ <label>General settings</label>
88
+ <frontend_type>text</frontend_type>
89
+ <sort_order>-1</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ <fields>
94
+ <info translate="label">
95
+ <label></label>
96
+ <frontend_type>text</frontend_type>
97
+ <frontend_model>sare/adminhtml_infoblock</frontend_model>
98
+ <sort_order>-1</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </info>
103
+ <enabled>
104
+ <label>Integration enabled</label>
105
+ <frontend_type>select</frontend_type>
106
+ <comment>If no - everything is back do Magento default process.</comment>
107
+ <source_model>adminhtml/system_config_source_yesno</source_model>
108
+ <sort_order>-15</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ </enabled>
113
+ <uid translate="label">
114
+ <label>Your account ID</label>
115
+ <validate>validate-number</validate>
116
+ <sort_order>-1</sort_order>
117
+ <show_in_default>1</show_in_default>
118
+ <show_in_website>1</show_in_website>
119
+ <show_in_store>1</show_in_store>
120
+ </uid>
121
+ <key>
122
+ <label>Your account key</label>
123
+ <tooltip>Unique and random string, which you have defined in your SARE account.</tooltip>
124
+ <validate>required-entry</validate>
125
+ <sort_order>60</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ </key>
130
+ <sare_endpoint_url>
131
+ <label>API endpoint URL</label>
132
+ <tooltip>Do not change, unless asked to</tooltip>
133
+ <sort_order>270</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ <frontend_class>sare-api-disabled</frontend_class>
138
+ <validate>validate-url</validate>
139
+ </sare_endpoint_url>
140
+ <send_confirmation_email>
141
+ <label>Send confirmation email from SARE</label>
142
+ <frontend_type>select</frontend_type>
143
+ <tooltip>If you manage double opt-in by Magento - set this to no (recommended)</tooltip>
144
+ <source_model>adminhtml/system_config_source_yesno</source_model>
145
+ <sort_order>149</sort_order>
146
+ <show_in_default>1</show_in_default>
147
+ <show_in_website>1</show_in_website>
148
+ <show_in_store>1</show_in_store>
149
+ <tooltip>Please select correct setting here. It is really important that your addresses are double opt-in. You can either use Magento default workflow (recommended) or use SARE for sending confirmation emails - in this case - you need to setup subscription scenario at SARE side.</tooltip>
150
+ </send_confirmation_email>
151
+ <send_problem_mails>
152
+ <label>Send problem notifications emails</label>
153
+ <frontend_type>select</frontend_type>
154
+ <source_model>adminhtml/system_config_source_yesno</source_model>
155
+ <sort_order>150</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ </send_problem_mails>
160
+ <exceptions_sent_to>
161
+ <label>Problem notifications sent to</label>
162
+ <frontend_type>multiselect</frontend_type>
163
+ <source_model>adminhtml/system_config_source_email_identity</source_model>
164
+ <sort_order>152</sort_order>
165
+ <comment>Hold CTRL to select more than one</comment>
166
+ <show_in_default>1</show_in_default>
167
+ <show_in_website>1</show_in_website>
168
+ <show_in_store>1</show_in_store>
169
+ <depends><send_problem_mails>1</send_problem_mails></depends>
170
+ </exceptions_sent_to>
171
+ <notification_senderemail>
172
+ <depends>
173
+ <send_problem_mails>1</send_problem_mails>
174
+ </depends>
175
+ <label>E-mail sender email</label>
176
+ <sort_order>159</sort_order>
177
+ <validate>validate-email</validate>
178
+ <show_in_default>1</show_in_default>
179
+ <show_in_website>1</show_in_website>
180
+ <show_in_store>1</show_in_store>
181
+ </notification_senderemail>
182
+ <notification_sendername>
183
+ <depends><send_problem_mails>1</send_problem_mails></depends>
184
+ <label>E-mail sender name</label>
185
+ <sort_order>158</sort_order>
186
+ <show_in_default>1</show_in_default>
187
+ <show_in_website>1</show_in_website>
188
+ <show_in_store>1</show_in_store>
189
+ </notification_sendername>
190
+ <save_as>
191
+ <label>Save new subscribers with state</label>
192
+ <frontend_type>select</frontend_type>
193
+ <tooltip>Make sure your subscribers are 100% confirmed!</tooltip>
194
+ <source_model>creativestyle_sare/status</source_model>
195
+ <sort_order>160</sort_order>
196
+ <show_in_default>1</show_in_default>
197
+ <show_in_website>1</show_in_website>
198
+ <show_in_store>1</show_in_store>
199
+ </save_as>
200
+ <logging_enabled translate="label">
201
+ <label>Logging all requests to file</label>
202
+ <frontend_type>select</frontend_type>
203
+ <tooltip>find in /var/log/sare.log (make sure you have logging enabled at system level)</tooltip>
204
+ <source_model>adminhtml/system_config_source_yesno</source_model>
205
+ <sort_order>1000</sort_order>
206
+ <show_in_default>1</show_in_default>
207
+ <show_in_website>1</show_in_website>
208
+ <show_in_store>1</show_in_store>
209
+ </logging_enabled>
210
+ </fields>
211
+ </settings>
212
+ <guest_settings>
213
+ <label>Guest subscribers settings</label>
214
+ <frontend_type>text</frontend_type>
215
+ <sort_order>2</sort_order>
216
+ <show_in_default>1</show_in_default>
217
+ <show_in_website>1</show_in_website>
218
+ <show_in_store>1</show_in_store>
219
+ <fields>
220
+ <synchro_enabled translate="label">
221
+ <label>Synchronize guest subscribers</label>
222
+ <frontend_type>select</frontend_type>
223
+ <tooltip>Guest subscriber means that email address is not assigned to registered customer</tooltip>
224
+ <source_model>adminhtml/system_config_source_yesno</source_model>
225
+ <sort_order>10</sort_order>
226
+ <show_in_default>1</show_in_default>
227
+ <show_in_website>1</show_in_website>
228
+ <show_in_store>1</show_in_store>
229
+ </synchro_enabled>
230
+ <group_id translate="label">
231
+ <label>New guest subscribers should be added to group:</label>
232
+ <depends>
233
+ <synchro_enabled>1</synchro_enabled>
234
+ </depends>
235
+ <comment>Select group (1-31) or 0 for no group</comment>
236
+ <sort_order>70</sort_order>
237
+ <show_in_default>1</show_in_default>
238
+ <show_in_website>1</show_in_website>
239
+ <show_in_store>1</show_in_store>
240
+
241
+ </group_id>
242
+ </fields>
243
+ </guest_settings>
244
+ <customer_settings translate="label">
245
+ <label>Customer subscribers settings</label>
246
+ <frontend_type>text</frontend_type>
247
+ <sort_order>2</sort_order>
248
+ <show_in_default>1</show_in_default>
249
+ <show_in_website>1</show_in_website>
250
+ <show_in_store>1</show_in_store>
251
+ <fields>
252
+ <synchro_enabled translate="label">
253
+ <label>Synchronize customer subscribers</label>
254
+ <tooltip>Customer subscribers are those registered clients who subscribed to newsletter.</tooltip>
255
+ <frontend_type>select</frontend_type>
256
+ <source_model>adminhtml/system_config_source_yesno</source_model>
257
+ <sort_order>10</sort_order>
258
+ <show_in_default>1</show_in_default>
259
+ <show_in_website>1</show_in_website>
260
+ <show_in_store>1</show_in_store>
261
+ </synchro_enabled>
262
+ <group_id>
263
+ <label>New customer subscribers should be added to group:</label>
264
+ <tooltip>Guest subscribers guests who subscribed to newsletter. You don't have any data about them (address, name, etc.)</tooltip>
265
+ <depends><synchro_enabled>1</synchro_enabled></depends>
266
+ <comment>Select group (1-31) or 0 for no group</comment>
267
+ <sort_order>70</sort_order>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>1</show_in_store>
271
+ </group_id>
272
+ </fields>
273
+ </customer_settings>
274
+ <targeting_settings>
275
+ <label>Advanced targeting options</label>
276
+ <frontend_type>text</frontend_type>
277
+ <sort_order>2</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ <fields>
282
+ <info translate="label">
283
+ <label>HTML block</label>
284
+ <frontend_type>text</frontend_type>
285
+ <frontend_model>sare/adminhtml_targetinginfoblock</frontend_model>
286
+ <sort_order>-1</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ </info>
291
+ <enabled translate="label">
292
+ <label>Enable customer data synchro</label>
293
+ <frontend_type>select</frontend_type>
294
+ <source_model>adminhtml/system_config_source_yesno</source_model>
295
+ <sort_order>1</sort_order>
296
+ <show_in_default>1</show_in_default>
297
+ <show_in_website>1</show_in_website>
298
+ <show_in_store>1</show_in_store>
299
+ </enabled>
300
+ <enabled_login translate="label">
301
+ <label>Update on login</label>
302
+ <depends><enabled>1</enabled></depends>
303
+ <frontend_type>select</frontend_type>
304
+ <source_model>adminhtml/system_config_source_yesno</source_model>
305
+ <sort_order>10</sort_order>
306
+ <show_in_default>1</show_in_default>
307
+ <show_in_website>1</show_in_website>
308
+ <show_in_store>1</show_in_store>
309
+ <tooltip>Data at SARE side will be updated when customer logs in</tooltip>
310
+ </enabled_login>
311
+ <enabled_afterorder translate="label">
312
+ <label>Update after order is placed</label>
313
+ <depends><enabled>1</enabled></depends>
314
+ <frontend_type>select</frontend_type>
315
+ <source_model>adminhtml/system_config_source_yesno</source_model>
316
+ <sort_order>10</sort_order>
317
+ <show_in_default>1</show_in_default>
318
+ <show_in_website>1</show_in_website>
319
+ <show_in_store>1</show_in_store>
320
+ <tooltip>Data at SARE side will be updated after order is placed</tooltip>
321
+ </enabled_afterorder>
322
+ <enabled_addresschange translate="label">
323
+ <label>Update on address change</label>
324
+ <depends><enabled>1</enabled></depends>
325
+ <frontend_type>select</frontend_type>
326
+ <source_model>adminhtml/system_config_source_yesno</source_model>
327
+ <sort_order>10</sort_order>
328
+ <show_in_default>1</show_in_default>
329
+ <show_in_website>1</show_in_website>
330
+ <show_in_store>1</show_in_store>
331
+ <tooltip>Data at SARE side will be updated after customer changes his address</tooltip>
332
+ </enabled_addresschange>
333
+ </fields>
334
+ </targeting_settings>
335
+ <!--<abandonedcarts_settings>
336
+ <label>Abandoned carts interface</label>
337
+ <frontend_type>text</frontend_type>
338
+ <sort_order>2</sort_order>
339
+ <show_in_default>1</show_in_default>
340
+ <show_in_website>1</show_in_website>
341
+ <show_in_store>1</show_in_store>
342
+ <fields>
343
+ <info translate="label">
344
+ <label>HTML block</label>
345
+ <frontend_type>text</frontend_type>
346
+ <frontend_model>sare/adminhtml_abandonedcarts</frontend_model>
347
+ <sort_order>-1</sort_order>
348
+ <show_in_default>1</show_in_default>
349
+ <show_in_website>1</show_in_website>
350
+ <show_in_store>1</show_in_store>
351
+ </info>
352
+ <enabled translate="label">
353
+ <label>Enable abandoned carts interface</label>
354
+ <frontend_type>select</frontend_type>
355
+ <source_model>adminhtml/system_config_source_yesno</source_model>
356
+ <sort_order>10</sort_order>
357
+ <show_in_default>1</show_in_default>
358
+ <show_in_website>1</show_in_website>
359
+ <show_in_store>1</show_in_store>
360
+ </enabled>
361
+ <timeout>
362
+ <label>Treat quote as abandoned when it hasn't been updated for</label>
363
+ <comment>in hours</comment>
364
+ <depends><enabled>1</enabled></depends>
365
+ <sort_order>75</sort_order>
366
+ <show_in_default>1</show_in_default>
367
+ <show_in_website>1</show_in_website>
368
+ <show_in_store>1</show_in_store>
369
+ </timeout>
370
+ </fields>
371
+ </abandonedcarts_settings>-->
372
+ </groups>
373
+ </sare>
374
+ </sections>
375
+ </config>
app/code/community/Creativestyle/Sare/sql/creativestyle_sare_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by JetBrains PhpStorm.
4
+ * User: Adam
5
+ * Date: 15.06.13
6
+ * Time: 13:38
7
+ * To change this template use File | Settings | File Templates.
8
+ */
9
+ /* @var $installer Mage_Core_Model_Resource_Setup */
10
+ $installer = $this;
11
+ $installer->startSetup();
12
+
13
+ $sql = 'CREATE TABLE '. $this->getTable('cs_sare_email').'(
14
+ `id` BIGINT UNSIGNED NOT NULL,
15
+ `email` VARCHAR(255) NOT NULL,
16
+ `created_at` DATETIME NOT NULL,
17
+ PRIMARY KEY (`id`),
18
+ INDEX `email` (`id`)
19
+ ) COMMENT= "Table responsible for holding email / key at SARE"
20
+ COLLATE="latin1_swedish_ci"
21
+ ENGINE=InnoDB;';
22
+
23
+ $installer->run($sql);
24
+ $installer->run('ALTER TABLE '.$this->getTable('cs_sare_email').' CHANGE `id` `id` INT(32) UNSIGNED AUTO_INCREMENT');
25
+ $installer->run('ALTER TABLE '.$this->getTable('cs_sare_email').' ADD COLUMN `mkey` VARCHAR(32) NULL AFTER `email`;');
26
+
27
+ $installer->endSetup();
app/code/community/Creativestyle/Sare/sql/creativestyle_sare_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $installer = $this;
3
+
4
+ $installer->startSetup();
5
+
6
+
7
+ $sql = "INSERT INTO ".$this->getTable('core_translate')." (`string`, `store_id`, `translate`, `locale`) VALUES ('Mage_Adminhtml::<div class=\"sare-settings-headline\"> integration</div>', 0, '<div class=\"sare-settings-headline\"> integracja</div>', 'pl_PL');";
8
+
9
+ $installer->run($sql);
10
+
11
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/sare.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <layout version="0.1.0">
2
+ <default>
3
+ <reference name="head">
4
+ <action method="addCss"><name>css/sare.css</name></action>
5
+ </reference>
6
+ </default>
7
+ <sare_adminhtml_index_subscribersgrid>
8
+ <block type="core/text_list" name="root" output="toHtml">
9
+ <block type="sare/adminhtml_dashboard_grids_subscribers" name="adminhtml.dashboard.tab.customers.most"/>
10
+ </block>
11
+ </sare_adminhtml_index_subscribersgrid>
12
+ </layout>
13
+
app/design/adminhtml/default/default/template/sare/abandonedcarts.phtml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="block-abandoned-carts">
2
+ <div style="min-height:85px;margin-bottom:12px;">
3
+ <div class="inside">
4
+ <?php echo $this->__('Abandoned carts interface allows you to get list of abandoned carts which you can import to SARE and use in your email markting actions.') ?><br/>
5
+ <?php echo $this->__('Read more <a href=\"#\">here</a>.') ?>
6
+ &nbsp;<b><?php echo $this->__('Interface URL:') ?></b><br/>
7
+ <div class="url">
8
+ <a style="color: black;text-decoration: none;" href="<?php echo $this->getInterfaceUrl();?>"><?php echo $this->getInterfaceUrl();?></a>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </div>
13
+
app/design/adminhtml/default/default/template/sare/dashboard.phtml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ </fieldset></div>
2
+ <div class="entry-edit">
3
+ <div class="entry-edit-head"><h4><?php echo $this->__('SARE statistics');?></h4></div>
4
+ <fieldset class="np">
5
+ <table id="dashboard-sare" cellspacing="5">
6
+ <tr>
7
+ <th><?php echo $this->__('Subscribed');?></th>
8
+ <th><?php echo $this->__('Unsubscribed');?></th>
9
+ <th><?php echo $this->__('Not activated');?></th>
10
+ </tr>
11
+ <tr>
12
+ <td class="val subscribed"><?php echo $this->getSubscribedCount();?></td>
13
+ <td class="val unsubscribed"><?php echo $this->getUnsubscribedCount();?></td>
14
+ <td class="val nonactivated"><?php echo $this->getNonActivated();?></td>
15
+ </tr>
16
+ </table>
app/design/adminhtml/default/default/template/sare/infoblock.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $url = '#';?>
2
+ <div id="block-infoblock">
3
+ <div class="inside" style="height:80px;background: white url(<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);?>/adminhtml/default/default/images/sare/sare-baner.jpg) no-repeat top right;margin-bottom:12px;">
4
+ <div style="margin-bottom:12px;">
5
+ <?php echo $this->__('Configure your SARE integration details. Click <a href=\'%s\'>here</a> to read instructions.', $url);?>
6
+ <br/>
7
+ <?php echo $this->__('Contact: Adam Karnowka / <a href=\'mailto: adam.karnowka@creativestyle.pl?subject=[SARE] Support (Magento: %s)\'>adam.karnowka@creativestyle.pl</a>', Mage::getVersion());?>.
8
+ </div>
9
+ <button class="scalable add" onclick="window.location='<?php echo Mage::helper("adminhtml")->getUrl('sare/adminhtml_index/synchro');?>';return false;"><span><span><?php echo $this->__('Synchronize list');?></span></span></button>
10
+ <button class="scalable save" onclick="window.location='https://ww0.enewsletter.pl/index2.php';return false;"><span><span><?php echo $this->__('Login to SARE panel');?></span></span></button>
11
+ <button class="scalable show-hide" onclick="window.location='<?php echo Mage::helper("adminhtml")->getUrl('sare/adminhtml_index/logs');?>';return false;"><span><span><?php echo $this->__('Review logs');?></span></span></button>
12
+ <div class="creativestyle">
13
+ <div class="cs-logo">
14
+ <a href="http://www.creativestyle.de/" target="_blank">
15
+ <img height="20" src="http://www.creativestyle.pl/email-marketing/logo.php"/>
16
+ </a>
17
+ </div>
18
+ <?php echo $this->__('Created by <a href="http://www.creativestyle.de" target="_blank">creativestyle</a> | Support: ');?> <a href="mailto: emailmarketing@creativestyle.de">emailmarketing@creativestyle.de</a>
19
+ </div>
20
+ </div>
21
+ </div>
22
+
app/design/adminhtml/default/default/template/sare/targeting.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div id="block-targeting">
3
+ <div class="inside">
4
+ <div>
5
+ <?php echo $this->__("Advanced targeting options allow you to update your recipents list with always up to date customers' data, for instance: last order grand total value, average basket value, number of logins.") ?><br/>
6
+ <?php echo $this->__('You can later use this data to segment and filter recipents groups. <a href=\"#\">Read more here</a>.') ?><br/>
7
+ <button id="sare-toggler" class="scalable add" onclick="$('sare-labels').toggle();return false;"><span><span><?php echo $this->__('Needed properties...') ?></span></span></button>
8
+ </div>
9
+ </div>
10
+
11
+
12
+ <?php $labels = $this->getList();?>
13
+
14
+ <div class="labels" id="sare-labels">
15
+ <div class="smaller-text">
16
+ <?php echo $this->__('These are required features you need add in your database structure.');?><br/>
17
+ <?php echo $this->__('You must create them before you start using integration. Otherwise - extended customer data will not be saved at SARE side.');?>
18
+ </div>
19
+
20
+ <?php foreach($labels as $key=>$label){?>
21
+ <div class="row">
22
+ <div class="sare-key"><?php echo $key;?></div>
23
+ <div class="sare-label"><?php echo $label['label'];?></div>
24
+ </div>
25
+ <?php } ?>
26
+ </div>
27
+
28
+ </div>
29
+
30
+ <script type="text/javascript">
31
+ document.observe("dom:loaded", function() {
32
+ // initially hide all containers for tab content
33
+ $('sare-labels').toggle();
34
+ });
35
+ </script>
36
+
37
+
app/design/frontend/base/default/template/sare/abandonedcarts.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $items = $this->getItems();?>
2
+ <?php if(count($items)>0){?>
3
+ <br/>
4
+ <table cellspacing="0" cellpadding="0" width="570">
5
+ <?php $c = 0;?>
6
+ <?php foreach($items as $item){?>
7
+
8
+ <?php foreach($item->getAllVisibleItems() as $quoteItem){ ?>
9
+ <?php $c++;?>
10
+ <tr>
11
+ <td height="90" width="90" style="<?php if($c%2==1)echo 'background-color: #FAFAFA;'; ?>border-bottom: 1px solid #F7F7F7;" align="center"><img style="border:1px solid #F0F0F0;" src="<?php echo Mage::Helper('catalog/image')->init(Mage::getModel('catalog/product')->load($quoteItem->getProductId()),'image')->resize(75,75);?>" width="75" height="75"/></td>
12
+ <td style="<?php if($c%2==1)echo 'background-color: #FAFAFA;'; ?>border-bottom: 1px solid #F0F0F0;width:290px;font-family: Calibri, Verdana, Arial;font-size:13px;color: #232323;"><a href="<?php echo Mage::getModel('catalog/product')->load($quoteItem->getProductId())->getProductUrl();?>" style="color: #121212;"><?php echo $quoteItem->getName();?></a></td>
13
+ <td style="<?php if($c%2==1)echo 'background-color: #FAFAFA;'; ?>border-bottom: 1px solid #F0F0F0;width:25px;font-family: Calibri, Verdana, Arial;font-size:17px;color: #232323;"><?php echo round($quoteItem->getQty(),0);?></td>
14
+ <td style="<?php if($c%2==1)echo 'background-color: #FAFAFA;'; ?>border-bottom: 1px solid #F0F0F0;width:40px;font-family: Calibri, Verdana, Arial;font-size:15px;color: #232323;"><?php echo Mage::helper('core')->currency($quoteItem->getRowTotal());?></td>
15
+ </tr>
16
+ <?php } ?>
17
+
18
+ <?php } ?>
19
+ </table>
20
+ <?php } ?>
app/design/frontend/base/default/template/sare/problemnotification.phtml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table width="720" align="center" bgcolor="#EEEEEE" cellpadding="0" cellspacing="0" style="border:1px solid #DEDEDE;">
2
+ <tr>
3
+ <td width="15"></td>
4
+ <td height="10"></td>
5
+ <td width="15"></td>
6
+ </tr>
7
+ <tr>
8
+ <td width="15"></td>
9
+ <td height="20" style="font-family: Trebuchet, Arial, sans-serif;font-size: 14px;font-weight: bold;">
10
+ %TITLE%
11
+ </td>
12
+ <td width="15"></td>
13
+ </tr>
14
+ <tr>
15
+
16
+ <td width="15" height="2" style="line-height:0;">&nbsp;</td>
17
+ <td height="2" width="690" style="line-height:0;border-bottom:2px solid #098364;width:690px;">&nbsp;</td>
18
+ <td height="2" width="15" style="line-height:5px;">&nbsp;</td>
19
+
20
+ </tr>
21
+ <tr>
22
+ <td width="15"></td>
23
+ <td style="font-family: Trebuchet, Arial, sans-serif;font-size: 14px;font-weight: normal;">
24
+ <br/>%MESSAGE%<br/><br/>
25
+ <table cellpadding="0" cellspacing="0" width="640" align="center">
26
+ <tr>
27
+ <td style="background-color:#FEFEFE;border:1px solid #CCC;">
28
+ <table>
29
+ <tr>
30
+ <td width="10"></td>
31
+ <td style="font-family: Courier New, Courier;font-size:11px;font-weight: normal;">
32
+ <pre style="font-size:11px;">
33
+ %REQUEST%
34
+
35
+ API: %API_URL%
36
+ </pre>
37
+
38
+ </td>
39
+ <td width="10"></td>
40
+ </tr>
41
+ </table>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td style="background-color:#EEEEEE;height:10px;"></td>
46
+ </tr>
47
+ </table>
48
+ </td>
49
+ <td width="15"></td>
50
+ </tr>
51
+ <tr>
52
+
53
+ <td width="15" height="2" style="line-height:0;">&nbsp;</td>
54
+ <td height="2" width="690" style="line-height:0;border-bottom:2px solid #098364;width:690px;">&nbsp;</td>
55
+ <td height="2" width="15" style="line-height:5px;">&nbsp;</td>
56
+
57
+ </tr>
58
+ <tr>
59
+
60
+ <td width="15" height="2" style="line-height:0;">&nbsp;</td>
61
+ <td height="2" width="690" style="line-height:0;width:690px;">&nbsp;</td>
62
+ <td height="2" width="15" style="line-height:15px;">&nbsp;</td>
63
+
64
+ </tr>
65
+ </table>
66
+ <table width="690" align="center" style="font-size:10px; font-family: Trebuchet MS, Trebuchet, Arial">
67
+ <tr>
68
+ <td>
69
+ %FOOTER%
70
+ </td>
71
+ </tr>
72
+ </table>
app/etc/modules/Creativestyle_Sare.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Creativestyle_Sare>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Newsletter></Mage_Newsletter>
9
+ </depends>
10
+ </Creativestyle_Sare>
11
+ </modules>
12
+ </config>
app/locale/pl_PL/sare.csv ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Removed by SARE operator", "Wypisany ręcznie przez operatora systemu SARE"
2
+ "Willing to sign off", "Status nadawany przez operatora po wyrażeniu chęci wypisania się przez odbiorcę"
3
+ "Willing to sign off (by link)", "Odbiorca zgłasza chęd wypisania, np. przez kliknięcie w link wypisujący"
4
+ "Not confirmed, confirmation email not sent", "Adres nie został w żaden sposób potwierdzony, nie wysłano maila administracyjnego"
5
+ "Saved, waiting to be confirmed", "Adres zapisany w bazie i oczekujący na potwierdzenie, wysłano mail administracyjny"
6
+ "Subscriber blocked", "Adres zablokowany przez operatora"
7
+ "Saved and confirmed", "Adres zapisany i potwierdzony"
8
+ "Integration enabled","Integracja włączona"
9
+ "Your account ID", "Twój UID"
10
+ "Your account key", "Twój klucz integracji"
11
+ "Problem notifications sent to", "Raporty z problemami wysyłaj do"
12
+ "Send confirmation email from SARE","Wysyłaj prośbę o potwierdzenia adresu ze strony SARE"
13
+ "Save new subscribers with state", "Zapisuj nowych subskrybentów ze statusem"
14
+ "API endpoint URL","Lokalizacja punktu API"
15
+ "Logging all requests to file", "Zapisuj wywołania do plików logowania"
16
+ "Advanced targeting options","Zaawansowane ustawienia eksportu"
17
+ "Enable customer data synchro","Synchronizacja danych klienta włączona"
18
+ "Update on address change", "Aktualizacja przy zmianie danych adresowych"
19
+ "Update on login", "Aktualizacja podczas logowania"
20
+ "Update after order is placed", "Aktualizacja po złożeniu zamówienia"
21
+ "Customer subscribers settings","Ustawienia synchronizacji klientów"
22
+ "Guest subscribers settings","Ustawienia synchronizacji gości"
23
+ "Synchronize customer subscribers", "Synchronizuj nowych klientów"
24
+ "Synchronize guest subscribers","Synchronizuj subskrybentów - gości"
25
+ "Subscribed","Zapisanych i potwierdzonych"
26
+ "Unsubscribed", "Niezapisanych"
27
+ "Not activated", "Niepotwierdzonych"
28
+ "SARE statistics","SARE - statystyki subskrybentów"
29
+ "Configure your SARE integration details. Click <a href='%s'>here</a> to read instructions.", "Skonfiguruj swoje ustawienia. Kliknij <a href='%s'>tutaj</a>, by uzyskać pomoc. "
30
+ "Contact: Adam Karnowka / <a href='mailto: adam.karnowka@creativestyle.pl?subject=[SARE] Support (Magento: %s)'>adam.karnowka@creativestyle.pl</a>", "Kontakt: Adam Karnowka / <a href='mailto: adam.karnowka@creativestyle.pl?subject=[SARE] Support (Magento: %s)'>adam.karnowka@creativestyle.pl</a>"
31
+ "Synchronize list", "Synchronizacja list"
32
+ "Login to SARE panel", "Logowanie w panelu SARE"
33
+ "Review logs", "Podgląd logów"
34
+ "Yes", "Tak"
35
+ "No","Nie"
36
+ "Needed properties...", "Wymagane cechy..."
37
+ "Customer//'s gender", "Płeć klienta"
38
+ "Date of birth","Data urodzenia"
39
+ "Unsubscribe URL","URL wypisu (Magento)"
40
+ "Register datetime","Czas rejestracji"
41
+ "Data at SARE side will be updated after customer changes his address","Dane po stronie SARE będą aktualizowane w momencie, gdy klient zmieni swoje dane adresowe"
42
+ "Do not change, unless asked to", "To pole nie powinno zostać zmienianie, chyba, że na polecenie operatora SARE"
43
+ "find in /var/log/sare.log (make sure you have logging enabled at system level)", "Plik znajduje się w /var/log/sare.log. Upewnij się, że logowanie jest włączone na poziomie systemowym."
44
+ "General settings","Ustawienia ogólne"
45
+ " integration", "integracja"
46
+ "If no - everything is back do Magento default process.","Jeżeli wyłączysz integrację, używany będzie domyślny proces Magento."
47
+ "Abandoned carts interface","Interfejs porzuconych koszyków"
48
+ "Make sure your subscribers are 100% confirmed!", "Upewnij się, że Twoi subskrybenci potwierdzili chęć otrzymywania wiadomości."
49
+ "If you manage double opt-in by Magento - set this to no (recommended)", "Jeżeli obsługa procesu double opt-in odbywa się poprzez Magento, zaznacz tę opcję jako 'Nie'."
50
+ "Unique and random string, which you have defined in your SARE account.", "Unikalny klucz wymiany danych, który znajdziesz w zakładce Preferencje / Ogólne w panelu SARE."
51
+ "Data at SARE side will be updated after order is placed","Dane po stronie SARE będą aktualizowane po złożeniu zamówienia."
52
+ "Data at SARE side will be updated when customer logs in","Dane po stronie SARE będą aktualizowane po zalogowaniu użytkownika."
53
+ "Last login date","Data i godzina ostatniego logowania"
54
+ "Magento internal customer_id (entity_id)", "ID klienta (entity_id)"
55
+ "Hold CTRL to select more than one","Przytrzymaj klawisz CTRL, by zaznaczyć więcej niż jedną opcję."
56
+ "SARE integration", "SARE - integracja"
57
+ "<![CDATA[<div class='sare-headline'>SARE integration</div>]]>","<![CDATA[<div class='sare-headline'>SARE - integracja</div>]]>"
58
+ '<div class="sare-headline">SARE integration</div>","<div class="sare-headline">SARE - integracja</div>'
59
+ "Abandoned carts interface allows you to get list of abandoned carts which you can import to SARE and use in your email markting actions.", "Interfejs porzuconych koszyków pozwala uzyskać listę porzuconych koszyków, która może zostać zaimportowana do SARE i wykorzystana w działaniach e-mail marketingowych."
60
+ "Read more <a href=\"#\">here</a>.", "Więcej informacji <a href=\"#\">tutaj</a>."
61
+ "Interface URL:", "URL interfejsu:"
62
+ "Advanced targeting options allow you to update your recipents list with always up to date customers' data, for instance: last order grand total value, average basket value, number of logins.", "Zaawansawony eksport danych umożliwia eksportowanie szczegółowych danych klientów do bazy SARE, na przykład - łączna wartość zakupów, czas ostatniego logowania, produkty w liście życzeń, itp."
63
+ "You can later use this data to segment and filter recipents groups. <a href=\"#\">Read more here</a>.", "Dane te można później wykorzystać przy segmentacji klientów, filtrowaniu i innych działaniach e-mail marketingowych."
64
+ "Customer's firstname","Imię klienta"
65
+ "Customer's lastname","Nazwisko klienta"
66
+ "Customer's company","Firma klienta"
67
+ "Customer's postcode (billing address)", "Kod pocztowy klienta (adres faktury)"
68
+ "Customer's city (billing address)", "Miasto klienta (adres faktury)"
69
+ "Customer's telephone number (billing address)", "Nr telefonu klienta (adres faktury)"
70
+ "Customer's fax number (billing address)","Nr faksu klienta (adres fakury)"
71
+ "Customer's country id (f.e: DE, PL)","Kod kraju klienta (np. DE, PL)"
72
+ "Customer's group id","ID grupy klienta (customer_group_id)"
73
+ "Last order datetime","Data i czas ostatniego zamówienia"
74
+ "Last order value (grand total)", "Wartość ostatniego zamówienia (grand total)"
75
+ "Total orders count","Łączna ilość zamówień"
76
+ "Total orders value","Łaczna wartość wszystkich zamówień"
77
+ "Customer's average order value","Średnia wartość zamówienia klienta"
78
+ "List of last bought items (sku1, sku2, ...)","Lista ostatnio zakupionych produktów (sku1, sku2, ...)"
79
+ "Products put in customer's wishlist (sku1, sku2, etc)","Lista produktów z listy życzeń (sku1, sku2, ...)"
80
+ "Timestamp of last datachange","Czas ostatniej aktualizacji danych"
81
+ "Customer's gender","Płeć klienta"
82
+ "Select group (1-31) or 0 for no group","Wybierz ID grupy (1-31) lub 0 - bez grupy"
83
+ "Populated detailed customer data and sent to SARE","Zebrano dane klienta i wysłano do SARE"
84
+ "Subscribed with mkey = %s","Pomyślnie zapisano adres w SARE (mkey = %s)"
85
+ "<b>%s</b> should be unsubscribed...","Adres <b>%s</b> powinien zostać wypisany z SARE"
86
+ "<b>%s</b> should be subscribed...","Adres <b>%s</b> powinien zostać zapisany w SARE"
87
+ "Processing: %s","Przetwarzany adres: %s"
88
+ "Started mass synchro...","Rozpoczęto proces przetwarzania wsadowego"
89
+ "Subscribers to process: <b>%s</b>","Ilość adresów do przetworzenia: <b>%s</b>"
90
+ "Whats going on?","Co się teraz dzieje?"
91
+ "every confirmed subscriber is added to SARE","każdy potwierdzony adres zostanie dodany do SARE"
92
+ "if subscriber is not confirmed - appropriate status is set in SARE","jeśli subskrybent jest niepotwierdzony, adres otrzyma odpowiedni status w SARE"
93
+ "if subscriber is a customer - detailed data is populated and sent to SARE","jeśli subskrybent jest klientem, szczegółowe dane zostanę zebrane i wysłane do SARE"
94
+ "<b>NOTE:</b> Do not close this window.","<b>UWAGA:</b> Proszę nie zamykać tego okna zanim proces nie zostanie ukończony."
95
+ "<div class='row complete'>All done! <a href='https://ww0.enewsletter.pl/index2.php'>Login to SARE panel</a> now</div>","<div class='row complete'>Proces zakończony! <a href='https://ww0.enewsletter.pl/index2.php'>Zaloguj się do panelu SARE</a>.</div>"
96
+ "Failed to unsubscribe - check logs!", "Nieudane wypisanie z bazy - sprawdź logi"
97
+ "Failed to subscribe - check logs!", "Nieudane dopisanie do bazy - sprawdź logi"
98
+ "These are required features you need add in your database structure.", "Poniżej znajduje się lista cech, które muszą zostać utworzone w strukturze Twojej bazy."
99
+ "You must create them before you start using integration. Otherwise - extended customer data will not be saved at SARE side.", "Musisz utworzyć te cechy zanim rozpoczniesz synchronizację. W przeciwnym razie, rozszerzone dane klientów <b>nie zostaną</b> zapisane po stronie SARE."
100
+ "in hours","w godzinach"
101
+ "Enable abandoned carts interface","Interfejs porzuconych koszyków włączony"
102
+ "Treat quote as abandoned when it hasn't been updated for","Traktuj koszyk jako porzucony gdy minęło więcej niz..."
103
+ "New customer subscribers should be added to group:","Nowi klienci powinni być dodawani do grupy:"
104
+ "New guest subscribers should be added to group:","Nowi goście powinni być dodawani do grupy:"
105
+ "Address added successfully.", "Adres dopisany pomyślnie"
106
+ "Address already exists, but has not been confirmed yet.", "Adres istnieje w bazie, ale nie został potwierdzony"
107
+ "Address already exists, but it is blocked by SARE operator.", "Adres istnieje w bazie, ale jest zablokowany przez operatora"
108
+ "Address already exists, and it is confirmed already.", "Adres istnieje w bazie i jest już potwierdzony"
109
+ "One the required parameters is missing.", "Brak któregoś z wymaganych parametrów"
110
+ "E-mail address is not formed correctly.", "Adres e-mail niepoprawny składniowo"
111
+ "UID number is not formed correctly.", "Numer UID niepoprawny składniowo"
112
+ "Wrong integration key.", "Niepoprawny klucz do dopisywania"
113
+ "GSM number is not formed correctly.","Numer GSM niepoprawny składniowo"
114
+ "API limit is set.","Ustawiony limit API"
115
+ "Wrong UID.","Niewłaściwy UID"
116
+ "Database connection error.","Błąd połączenia z bazą danych"
117
+ "Unknown error.", "Nieznany błąd."
118
+ "Recent subscribers","Ostatnio dodani subskrybenci"
119
+ "Please select correct setting here. It is really important that your addresses are double opt-in. You can either use Magento default workflow (recommended) or use SARE for sending confirmation emails - in this case - you need to setup subscription scenario at SARE side.", "Proszę wybrać odpowiednią opcję. To naprawdę ważne, by adresy przeszły procedurę double opt-in. Można wykorzystać podstawowy mechanizm Magento (zalecane) lub wykorzystać scenariusze subskrypcji po stronie SARE. <br/><br/><b>W razie wątpliwości - skonsultuj się ze swoim konsultantem.</b>"
120
+ "Guest subscriber means that email address is not assigned to registered customer", "Subskrybenci goście to adresy dodane do newslettera, które nie są adressami zarejestrowanych klientów."
121
+ "New guest subscribers should be added to group:","Nowi sybskrybenci-goście powinni być dodawani do grup:"
122
+ "Select group (1-31) or 0 for no group", "Podaj numery ID grup (rozdzielone przecinkiem) lub 0 - bez grupy"
123
+ "Customer subscribers are those registered clients who subscribed to newsletter.","Subskrybenci klienci - do zarejestrowani klienci, którzy zapisali się do newslettera."
124
+ "Created by <a href=""http://www.creativestyle.de"" target=""_blank"">creativestyle Gmbh</a> | Support: ", "Wykonanie: <a href=""http://www.creativestyle.de"" target=""_blank"">creativestyle</a> | Support: "
125
+ "Subscribe problem","Problem z dopisaniem do bazy"
126
+ "SARE integration problem notification","SARE integracja - komunikat błędu"
127
+ "You receive these emails, because your address was entered in Magento configuration panel. You can disable them in Magento backend - Newsletter / SARE integration / Settings. <br/><br/>Have a nice day!<br/>SARE team.","Otrzymujesz te wiadomości, ponieważ Twój adres został podany w Magento. Aby nie otrzymywać więcej takich wiadomości, wyłącz powiadamianie o błędach w System / Konfiguracja / SARE<br/><br/>Życzymy miłego dnia<br/>Załoga SARE."
128
+ "SARE integration","SARE - integracja"
129
+ "E-mail sender email","Adres e-mail nadawcy e-maila"
130
+ "E-mail sender name", "Nazwa nadawcy e-maila"
131
+ "Send problem notifications emails","Wysyłaj powiadomienia o błędach"
js/sare/jquery-1.10.2.min.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
2
+ //@ sourceMappingURL=jquery-1.10.2.min.map
3
+ */
4
+ (function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
5
+ }({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
6
+ u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
7
+
8
+
9
+
js/sare/synchro.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function sareProcessSubscriber(subscriber_id){
2
+ $.ajax({
3
+ dataType: "json",
4
+ url: currentUrl+'process/1/subscriber_id/'+subscriber_id,
5
+ data: null,
6
+ success: function(msg){
7
+ if(msg.subscriber_id){
8
+ $.each(msg.messages, function(i, item) {
9
+ $('#wrapper').append('<div class="row '+item.class+'">'+item.text+'</div>');
10
+ });
11
+ sareProcessSubscriber(msg.subscriber_id);
12
+ } else {
13
+ $('#wrapper').append(finalMessage);
14
+ }
15
+ },
16
+ error: function(msg){
17
+ alert(msg);
18
+ }
19
+ });
20
+ }
package.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Creativestyle_Sare</name>
4
+ <version>1.0.2</version>
5
+ <stability>stable</stability>
6
+ <license>GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Easily integrate SARE email marketing software with Magento. Synchronize newsletter subscribers, bought items and sales figures for ultimate control over your email marketing campaigns.</summary>
10
+ <description>Easily integrate SARE email marketing software with Magento. Synchronize newsletter subscribers, bought items and sales figures for ultimate control over your email marketing campaigns.&#xD;
11
+ &#xD;
12
+ This extensions synchronizes your subscribers with SARE email marketing software as well as detailed consumer's details. &#xD;
13
+ Using SAREscript you are able to create complex email marketing campaigns, segment customers and perform highly personlized and automated campaigns.&#xD;
14
+ &#xD;
15
+ Quick integration&#xD;
16
+ &#xD;
17
+ All you need to do is input your UID and integration key to get you going. If you don't have SARE account yet, you can request free test account here.&#xD;
18
+ </description>
19
+ <notes>Initial upload</notes>
20
+ <authors><author><name>creativestyle</name><user>creativestyle</user><email>j.fojcik@creativestyle.de</email></author></authors>
21
+ <date>2014-01-07</date>
22
+ <time>14:12:50</time>
23
+ <contents><target name="magecommunity"><dir name="Creativestyle"><dir name="Sare"><dir name="Block"><file name="Abandonedcartitems.php" hash="83487729dcf5c7a0b7494ffc292f2d2f"/><dir name="Adminhtml"><file name="Abandonedcarts.php" hash="0bf7dda7546d406e29641d9f5ce9e6bb"/><dir name="Dashboard"><dir name="Grids"><file name="Subscribers.php" hash="e42658f87a3717ae78614a243c753840"/></dir><file name="Grids.php" hash="78b4e891c7e5318da8c121fe2f2621ab"/></dir><file name="Dashboard.php" hash="c355901f132e1bc4d431dddf3fb99f40"/><file name="Infoblock.php" hash="4cd3f11b74fc15a264ce0e8786407407"/><file name="Targetinginfoblock.php" hash="633015040b14dd676a698e24b3203a60"/></dir></dir><dir name="Helper"><file name="Data.php" hash="506157571e7967170afc453191278967"/></dir><dir name="Model"><dir name="AdminNotification"><file name="Feed.php" hash="9423fdeab9dcc1c3705247b171fd8b1e"/></dir><file name="Customer.php" hash="63f5ae8bc922398d4af9c8c3c29a3147"/><file name="Email.php" hash="e41ea542e84dcc7a716d3c181b232de4"/><dir name="Mysql4"><dir name="Email"><file name="Collection.php" hash="12055539f8a029a3687542d2d64634a3"/></dir><file name="Email.php" hash="e4dd51f3c7ae1995df0881aadcf90bbe"/></dir><file name="Observer.php" hash="e7069b428307a068301ccd4580902460"/><file name="Response.php" hash="385c859dd7b6e7a0a10ce06bfdf7cbc1"/><file name="Sare.php" hash="68818eb916dfa0c5e0bbd9b74df9372d"/><file name="Status.php" hash="d3682a21418ae267e0ae8a36120d0887"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="26b9ff09fa39121d444c5449d76120fd"/></dir><file name="IndexController.php" hash="dcba6f8588b05aabd057d172cfd1b248"/></dir><dir name="etc"><file name="adminhtml.xml" hash="adbe7e50c1bf01d10047faf3e345de6c"/><file name="config.xml" hash="c5bc9a2e62b30cdc31343e08782e5018"/><dir name="sarescripts"><file name="fetchAbandonedCartsUsers.txt" hash="7a2029e493483f9f6e70bb3cbc605e09"/></dir><file name="system.xml" hash="aa4ed6a653ed6390a1b0c04b3f03bb39"/></dir><dir name="sql"><dir name="creativestyle_sare_setup"><file name="mysql4-install-0.1.0.php" hash="dc814e259cb60b8072f3baa1cc227469"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="2000893748f23030478fd3bd098ad0e6"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="pl_PL"><file name="sare.csv" hash="5f959f4a1867e48f74a9d944e749c5e3"/></dir></target><target name="mage"><dir name="js"><dir name="sare"><file name="jquery-1.10.2.min.js" hash="6ac17d34088a77cc8ddd528f7ac21fa3"/><file name="synchro.js" hash="14f1fabe5837876e5ff332fd959abdfa"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="css"><file name="sare.css" hash="311b016a99ba725c90b94fbfdc5a0bc9"/></dir></dir></dir><dir name="default"><dir name="default"><dir name="images"><dir name="sare"><file name="icon_add.png" hash="cdd116fa6d274e27810134c878b4bc55"/><file name="icon_info.png" hash="43bfbec584cffa85e0406f2308dad69b"/><file name="icon_remove.png" hash="7d7f814263c715b2ee3751e2c6d371f0"/><file name="icon_success.png" hash="74f7903b97f4dd3c86095b773fdef881"/><file name="icon_user.png" hash="889b240dc8b07e9e472de32af8edd590"/><file name="sare-baner.jpg" hash="22df2d8d0643f1c373719af8c9017aa8"/><file name="sare.png" hash="2aa48c65176945f07081286e29fb59ea"/><file name="transfer.png" hash="79d7f2feb92e7e328ba3a9327ad53008"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creativestyle_Sare.xml" hash="dae4e0ec266fbfa1e47bfb8f0e8f979e"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="sare.xml" hash="5e1897f07cb0d9feb8289484a73084a4"/></dir><dir name="template"><dir name="sare"><file name="abandonedcarts.phtml" hash="3e9c27bc4a6ad18dd00e6e7855bb63a0"/><file name="dashboard.phtml" hash="87d6116adf51619e0a2983ffe0753794"/><file name="infoblock.phtml" hash="77718956aa3a0810461f87d0f1e45aff"/><file name="targeting.phtml" hash="8c198eab64740d4da769c18f8153bfcb"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sare"><file name="abandonedcarts.phtml" hash="3ea4700e6f348507ae1d2adfb84fa527"/><file name="problemnotification.phtml" hash="63e1a698ccc4644fae4a80e4a0b91ac2"/></dir></dir></dir></dir></dir></target></contents>
24
+ <compatible/>
25
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
26
+ </package>
skin/adminhtml/base/default/css/sare.css ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .logEntry{
2
+ width:98%;
3
+ font-family: Courier New, Courier;
4
+ font-size:11px;
5
+ margin-bottom:3px;
6
+ padding:3px;
7
+ background-color: #FFFFB8;
8
+ border:1px solid #FFEC42;
9
+ }
10
+
11
+ ul.sare-batch {
12
+ padding:0;
13
+ padding-top:6px;
14
+ padding-left:18px;
15
+ margin:0;
16
+ }
17
+
18
+ #sare-toggler{
19
+ margin-top:10px;
20
+ }
21
+ ul.sare-batch li{
22
+ text-shadow: white 1px 1px;
23
+ }
24
+
25
+ div.saretext{
26
+ padding-top:5px;
27
+ padding-left:10px;
28
+
29
+
30
+ }
31
+
32
+ div.transfer {
33
+ border: 1px solid #EEE;
34
+ padding: 2px;
35
+ margin-bottom: 4px;
36
+ height:118px;
37
+ width:650px;
38
+ border-color: #B8DBC0;
39
+ background-color: white;
40
+ background: white url('../../../default/default/images/sare/transfer.png') no-repeat top right;
41
+ }
42
+
43
+ .sare-settings-headline{
44
+ background: transparent url(../../../default/default/images/sare/sare.png) no-repeat top left;
45
+ padding-left: 75px;
46
+ padding-top: 2px;
47
+ padding-bottom: 2px;
48
+ }
49
+ div.row{
50
+ padding:2px;
51
+ border:1px solid #fff47c;
52
+ background-color: #fffede;
53
+ width:650px;
54
+ height:16px;
55
+ margin-bottom:3px;
56
+ }
57
+
58
+ div.cs-logo{
59
+ float: right;
60
+ }
61
+
62
+ div.creativestyle a{
63
+ color: #81251D;
64
+ text-decoration: none;
65
+ font-weight: bold;
66
+ }
67
+
68
+ #sare-labels{
69
+ clear: both;
70
+ }
71
+ div.labels div.row{
72
+ width: 580px;
73
+
74
+ }
75
+
76
+ #sare_targeting_settings-head{
77
+ /*background: transparent url('../../../default/default/images/sare/icon_user.png') no-repeat top left;
78
+ text-indent: 20px;*/
79
+ }
80
+
81
+ div.sare-key{
82
+ font-family: Courier new, Courier, Arial, sans-serif;
83
+ width:200px;
84
+ float: left;
85
+ }
86
+
87
+ div.user{
88
+ background: transparent url('../../../default/default/images/sare/icon_user.png') no-repeat top left;
89
+ text-indent:22px;
90
+ }
91
+
92
+ div.remove {
93
+ width:620px;
94
+ background: #fffede url('../../../default/default/images/sare/icon_remove.png') no-repeat 24px 0px;
95
+ padding-left:30px;
96
+ text-indent:22px;
97
+ }
98
+
99
+ input.sare-api-disabled{
100
+ background-color: #fffae1 !important;
101
+ }
102
+
103
+ #sare_settings_save_as option[value="8"]{
104
+ background-color: #e7fedb;
105
+ color: #111;
106
+ }
107
+
108
+ #block-abandoned-carts .inside{
109
+ margin-bottom:12px;
110
+ padding-right:12px;
111
+ }
112
+
113
+ div.creativestyle{
114
+ padding-top: 5px;
115
+ border-top: 1px solid #CCC;
116
+ margin-top: 16px;
117
+ }
118
+
119
+ #block-abandoned-carts .inside .url{
120
+ margin-top:5px;
121
+ margin-bottom:5px;
122
+ font-family: Courier,Courier New,Arial;
123
+ width:100%;
124
+ text-align:center;
125
+ padding:5px;
126
+ border:1px solid #e8e3eb;
127
+ background-color: #f2f4ee;
128
+ }
129
+
130
+ .labels .smaller-text{
131
+ font-size:10px;
132
+ padding:4px;
133
+ padding-left: 0px;
134
+ margin-bottom:5px;
135
+ line-height:12px;
136
+ }
137
+
138
+ #block-infoblock{
139
+ padding:5px;
140
+ width:590px;
141
+ height:110px;
142
+ background-color: white;
143
+ border:1px solid #DDD;
144
+ margin-bottom:20px;
145
+ }
146
+
147
+ #block-abandoned-carts{
148
+ padding:5px;width:590px;height:91px;background-color: #FFFFEF;border:1px solid #DDD;margin-bottom:20px;
149
+ }
150
+
151
+ #block-targeting{
152
+ padding:5px;width:590px;min-height:94px;background-color: white;border:1px solid #DDD;margin-bottom:20px;
153
+ background-color: #FFFFEF;
154
+ }
155
+
156
+ #block-targeting .inside{
157
+ height:100px;
158
+ margin-bottom:12px;
159
+
160
+ }
161
+
162
+ button.scalable span span{
163
+ background-image: none;
164
+ }
165
+
166
+ div.info{
167
+ width:620px;
168
+ background: #fffede url('../../../default/default/images/sare/icon_add.png') no-repeat 24px 0px;
169
+ padding-left:30px;
170
+ text-indent:22px;
171
+ }
172
+
173
+ div.complete{
174
+ width:620px;
175
+ background: #fffede url('../../../default/default/images/sare/icon_info.png') no-repeat 24px 0px;
176
+ padding-left:30px;
177
+ text-indent:22px;
178
+ }
179
+
180
+ div.success{
181
+ width:620px;
182
+ border-color: #B8DBC0;
183
+ background-color: #DDEBE0;
184
+ background: #DDEBE0 url('../../../default/default/images/sare/icon_success.png') no-repeat 24px 0px;
185
+ text-indent:22px;
186
+ padding-left:30px;
187
+ }
188
+
189
+ div.error{
190
+ width:620px;
191
+ border-color: #ffb0bf;
192
+ background-color: #ffdfdf;
193
+ background: #ffdfdf url('../../../default/default/images/sare/icon_remove.png') no-repeat 24px 0px;
194
+ text-indent:22px;
195
+ padding-left:30px;
196
+ }
197
+
198
+
199
+ #dashboard-sare{
200
+ width: 95%;
201
+ margin-left: 2.5%;
202
+ margin-bottom:20px;
203
+ margin-top: 20px;
204
+ border:0px solid #CCC;
205
+ }
206
+
207
+ #dashboard-sare th{
208
+ font-weight: bold;
209
+ padding: 3px;
210
+ text-align: center;
211
+ width: 30%;
212
+ }
213
+
214
+ #dashboard-sare td.val{
215
+ font-size: 40px;
216
+ text-align: center;
217
+ padding-top: 20px;
218
+ border:1px solid #CCC;
219
+ height: 40px;
220
+ }
221
+
222
+ #dashboard-sare td.val:hover{
223
+ background-color: white;
224
+ cursor: hand;
225
+ }
226
+
227
+ #dashboard-sare .subscribed{
228
+ background-color: #ecffed;
229
+ }
230
+
231
+ #dashboard-sare .unsubscribed{
232
+ background-color: #ffeee9;
233
+ }
234
+
235
+ #dashboard-sare .nonactivated{
236
+ background-color: #fcffec;
237
+ }
skin/adminhtml/default/default/images/sare/icon_add.png ADDED
Binary file
skin/adminhtml/default/default/images/sare/icon_info.png ADDED
Binary file
skin/adminhtml/default/default/images/sare/icon_remove.png ADDED
Binary file
skin/adminhtml/default/default/images/sare/icon_success.png ADDED
Binary file
skin/adminhtml/default/default/images/sare/icon_user.png ADDED
Binary file
skin/adminhtml/default/default/images/sare/sare-baner.jpg ADDED
Binary file
skin/adminhtml/default/default/images/sare/sare.png ADDED
Binary file
skin/adminhtml/default/default/images/sare/transfer.png ADDED
Binary file