Auguria_Sponsorship - Version 1.3.2

Version Notes

- Fixed adding point when purchasing a dynamic product bundle
- Change the automatic status of coupon module when used
- Improved display configuration
- Improved auto-fill data (surname, name, email) when godson incrit for the first time on the site
- Sending an email when requesting exchange cash (also sending an email to the manager)
- Remove the overhead of sending emails
- Display / camouflage configuration options depending on the mode of the module
- Ability to disable checking Company number
- Added english templates for sending email
- User Manual in French

Download this release

Release Info

Developer Auguria
Extension Auguria_Sponsorship
Version 1.3.2
Comparing to
See all releases


Code changes from version 1.2.9 to 1.3.2

Files changed (46) hide show
  1. app/code/community/Auguria/Sponsorship/Block/Customer/Account/PointsDetail.php +49 -31
  2. app/code/community/Auguria/Sponsorship/Block/Customer/Widget/Name.php +1 -1
  3. app/code/community/Auguria/Sponsorship/Block/Openinviter.php +1 -1
  4. app/code/community/Auguria/Sponsorship/Helper/Config.php +25 -21
  5. app/code/community/Auguria/Sponsorship/Helper/Mail.php +253 -268
  6. app/code/community/Auguria/Sponsorship/Lib/Html2Text.php +0 -397
  7. app/code/community/Auguria/Sponsorship/Lib/OpenInviter/config.php +2 -2
  8. app/code/community/Auguria/Sponsorship/Model/Core/Email/Template.php +35 -50
  9. app/code/community/Auguria/Sponsorship/Model/Observer.php +828 -783
  10. app/code/community/Auguria/Sponsorship/Model/Openinviter.php +2 -2
  11. app/code/community/Auguria/Sponsorship/controllers/OpeninviterController.php +2 -2
  12. app/code/community/Auguria/Sponsorship/controllers/PointsController.php +185 -108
  13. app/code/community/Auguria/Sponsorship/controllers/PointsController.php~ +471 -0
  14. app/code/community/Auguria/Sponsorship/etc/config.xml +19 -3
  15. app/code/community/Auguria/Sponsorship/etc/system.xml +421 -250
  16. app/code/community/Auguria/Sponsorship/sql/auguria_sponsorship_setup/mysql4-upgrade-1.3.0-1.3.1.php +19 -0
  17. app/code/community/Auguria/Sponsorship/sql/auguria_sponsorship_setup/mysql4-upgrade-1.3.1-1.3.2.php +33 -0
  18. app/design/adminhtml/default/default/layout/auguria/sponsorship.xml +6 -1
  19. app/design/adminhtml/default/default/template/auguria/sponsorship/customer/tabs/sponsorship.phtml +12 -0
  20. app/design/frontend/base/default/layout/auguria/sponsorship.xml +1 -10
  21. app/design/frontend/base/default/template/auguria/sponsorship/customer/account/fidelitypointsdetail.phtml +6 -1
  22. app/design/frontend/base/default/template/auguria/sponsorship/customer/form/edit.phtml +1 -0
  23. app/design/frontend/base/default/template/auguria/sponsorship/customer/form/register.phtml +0 -203
  24. app/design/frontend/base/default/template/auguria/sponsorship/customer/widget/name.phtml +142 -121
  25. app/design/frontend/base/default/template/auguria/sponsorship/customer/widget/virement.phtml +26 -3
  26. app/design/frontend/base/default/template/auguria/sponsorship/openinviter.phtml +1 -1
  27. app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_cash.html +62 -0
  28. app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_coupon.html +76 -0
  29. app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_invitation.html +60 -0
  30. app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_notification.html +73 -0
  31. app/locale/en_US/template/email/auguria/sponsorship/sponsorship_cash.html +62 -0
  32. app/locale/en_US/template/email/auguria/sponsorship/sponsorship_coupon.html +76 -0
  33. app/locale/en_US/template/email/auguria/sponsorship/sponsorship_invitation.html +60 -0
  34. app/locale/en_US/template/email/auguria/sponsorship/sponsorship_notification.html +73 -0
  35. app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_cash.html +62 -0
  36. app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_coupon.html +76 -0
  37. app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_invitation.html +60 -0
  38. app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_notification.html +73 -0
  39. app/locale/fr_FR/Auguria_Sponsorship.csv +10 -2
  40. app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_cash.html +62 -0
  41. app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_coupon.html +0 -12
  42. app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_invitation.html +0 -6
  43. app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_notification.html +0 -10
  44. js/auguria/sponsorship/admin.js +107 -0
  45. media/sponsorship/openinviter/logo_auguria.png +0 -0
  46. package.xml +19 -26
app/code/community/Auguria/Sponsorship/Block/Customer/Account/PointsDetail.php CHANGED
@@ -72,6 +72,12 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
72
  return $fidelity_points_to_cash;
73
  }
74
 
 
 
 
 
 
 
75
  /**
76
  * Sponsorship configuration
77
  */
@@ -132,6 +138,12 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
132
  return $sponsor_points_to_cash;
133
  }
134
 
 
 
 
 
 
 
135
  /**
136
  * Accumulated configuration
137
  */
@@ -192,6 +204,12 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
192
  return $accumulated_points_to_cash;
193
  }
194
 
 
 
 
 
 
 
195
 
196
 
197
 
@@ -206,10 +224,10 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
206
 
207
  public function getParrainages() {
208
  $parrains = Mage::getModel("customer/customer")
209
- ->getCollection()
210
- ->addNameToSelect()
211
- ->addAttributeToSort('created_at', 'desc')
212
- ->addAttributeToFilter('sponsor', $this->getUserId());
213
  $parrains = $parrains->getData();
214
  return $parrains;
215
  }
@@ -217,20 +235,20 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
217
  public function getNbParrainages ($customerId)
218
  {
219
  $sponsor = Mage::getModel("customer/customer")
220
- ->getCollection()
221
- ->addFilter('e.is_active', 1)
222
- ->addAttributeToFilter('sponsor', $customerId)
223
- ->count();
224
  return $sponsor;
225
  }
226
 
227
  public function getDateDernCde ($customerId)
228
  {
229
  $commande = Mage::getModel("sales/order")
230
- ->getCollection()
231
- ->addAttributeToFilter('customer_id',$customerId)
232
- ->addAttributeToSort('created_at', 'asc')
233
- ->getLastItem();
234
  if ($commande) {
235
  return $commande['created_at'];
236
  }
@@ -242,10 +260,10 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
242
  public function getCommandes()
243
  {
244
  $commandes = Mage::getModel("sales/order")
245
- ->getCollection()
246
- ->addAttributeToFilter('customer_id',$this->getUserId())
247
- ->addAttributeToSort('created_at', 'desc')
248
- ->setPageSize(5);
249
  return $commandes->getData();
250
  }
251
 
@@ -325,10 +343,10 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
325
  public function hasChange($module)
326
  {
327
  $changes = mage::getModel("auguria_sponsorship/change")
328
- ->getCollection()
329
- ->addAttributeToFilter("module", $module)
330
- ->addAttributeToFilter("customer_id", $this->getUserId())
331
- ->count();
332
  if ($changes)
333
  {
334
  return true;
@@ -437,18 +455,18 @@ class Auguria_Sponsorship_Block_Customer_Account_PointsDetail extends Mage_Custo
437
  $read = $resource->getConnection('core_read');
438
  $datetime = Mage::getModel('core/date')->gmtDate();
439
  $select = $read->select()
440
- ->from(Array("s"=>$resource->getTableName('auguria_sponsorship/sponsorship')),array("*"=>"s.*"))
441
- ->where('s.parent_id=?', $this->getUserId())
442
- ->where('TO_DAYS("'.$datetime.'") - TO_DAYS(s.datetime) <= ?', Mage::getStoreConfig('auguria_sponsorship/invitation/sponsor_invitation_validity'))
443
- ->where('s.child_mail NOT IN ?',
444
- new Zend_Db_Expr('(select ce.email from '.$resource->getTableName('customer_entity').' ce
445
- LEFT JOIN '.$resource->getTableName('eav_attribute').' AS ea ON ce.entity_type_id = ea.entity_type_id AND ea.backend_type = "int" AND ea.attribute_code = "sponsor"
446
- LEFT JOIN '.$resource->getTableName('customer_entity_int').' AS cev ON ce.entity_id = cev.entity_id AND ea.attribute_id = cev.attribute_id
447
- WHERE cev.value IS NOT NULL)'))
448
- ->where('s.datetime = ?',
449
  new Zend_Db_Expr('(select max(sp.datetime) from '.$resource->getTableName('auguria_sponsorship/sponsorship').' sp where sp.parent_id=s.parent_id and sp.child_mail = s.child_mail)'))
450
- ->order('datetime_boost')
451
- ->order('datetime');
452
  return $read->fetchAll($select);
453
  }
454
  }
72
  return $fidelity_points_to_cash;
73
  }
74
 
75
+ public function getFidelityEnableSiretConfig ()
76
+ {
77
+ $enableSiret = Mage::getStoreConfig('auguria_sponsorship/fidelity/enable_check_company_number');
78
+ return $enableSiret;
79
+ }
80
+
81
  /**
82
  * Sponsorship configuration
83
  */
138
  return $sponsor_points_to_cash;
139
  }
140
 
141
+ public function getSponsorEnableSiretConfig ()
142
+ {
143
+ $enableSiret = Mage::getStoreConfig('auguria_sponsorship/sponsor/enable_check_company_number');
144
+ return $enableSiret;
145
+ }
146
+
147
  /**
148
  * Accumulated configuration
149
  */
204
  return $accumulated_points_to_cash;
205
  }
206
 
207
+ public function getAccumulatedEnableSiretConfig ()
208
+ {
209
+ $enableSiret = Mage::getStoreConfig('auguria_sponsorship/accumulated/enable_check_company_number');
210
+ return $enableSiret;
211
+ }
212
+
213
 
214
 
215
 
224
 
225
  public function getParrainages() {
226
  $parrains = Mage::getModel("customer/customer")
227
+ ->getCollection()
228
+ ->addNameToSelect()
229
+ ->addAttributeToSort('created_at', 'desc')
230
+ ->addAttributeToFilter('sponsor', $this->getUserId());
231
  $parrains = $parrains->getData();
232
  return $parrains;
233
  }
235
  public function getNbParrainages ($customerId)
236
  {
237
  $sponsor = Mage::getModel("customer/customer")
238
+ ->getCollection()
239
+ ->addFilter('e.is_active', 1)
240
+ ->addAttributeToFilter('sponsor', $customerId)
241
+ ->count();
242
  return $sponsor;
243
  }
244
 
245
  public function getDateDernCde ($customerId)
246
  {
247
  $commande = Mage::getModel("sales/order")
248
+ ->getCollection()
249
+ ->addAttributeToFilter('customer_id',$customerId)
250
+ ->addAttributeToSort('created_at', 'asc')
251
+ ->getLastItem();
252
  if ($commande) {
253
  return $commande['created_at'];
254
  }
260
  public function getCommandes()
261
  {
262
  $commandes = Mage::getModel("sales/order")
263
+ ->getCollection()
264
+ ->addAttributeToFilter('customer_id',$this->getUserId())
265
+ ->addAttributeToSort('created_at', 'desc');
266
+ //->setPageSize(5);
267
  return $commandes->getData();
268
  }
269
 
343
  public function hasChange($module)
344
  {
345
  $changes = mage::getModel("auguria_sponsorship/change")
346
+ ->getCollection()
347
+ ->addAttributeToFilter("module", $module)
348
+ ->addAttributeToFilter("customer_id", $this->getUserId())
349
+ ->count();
350
  if ($changes)
351
  {
352
  return true;
455
  $read = $resource->getConnection('core_read');
456
  $datetime = Mage::getModel('core/date')->gmtDate();
457
  $select = $read->select()
458
+ ->from(Array("s"=>$resource->getTableName('auguria_sponsorship/sponsorship')),array("*"=>"s.*"))
459
+ ->where('s.parent_id=?', $this->getUserId())
460
+ ->where('TO_DAYS("'.$datetime.'") - TO_DAYS(s.datetime) <= ?', Mage::getStoreConfig('auguria_sponsorship/invitation/sponsor_invitation_validity'))
461
+ ->where('s.child_mail NOT IN ?',
462
+ new Zend_Db_Expr('(select ce.email from '.$resource->getTableName('customer_entity').' ce
463
+ LEFT JOIN '.$resource->getTableName('eav_attribute').' AS ea ON ce.entity_type_id = ea.entity_type_id AND ea.backend_type = "int" AND ea.attribute_code = "sponsor"
464
+ LEFT JOIN '.$resource->getTableName('customer_entity_int').' AS cev ON ce.entity_id = cev.entity_id AND ea.attribute_id = cev.attribute_id
465
+ WHERE cev.value IS NOT NULL)'))
466
+ ->where('s.datetime = ?',
467
  new Zend_Db_Expr('(select max(sp.datetime) from '.$resource->getTableName('auguria_sponsorship/sponsorship').' sp where sp.parent_id=s.parent_id and sp.child_mail = s.child_mail)'))
468
+ ->order('datetime_boost')
469
+ ->order('datetime');
470
  return $read->fetchAll($select);
471
  }
472
  }
app/code/community/Auguria/Sponsorship/Block/Customer/Widget/Name.php CHANGED
@@ -15,7 +15,7 @@ class Auguria_Sponsorship_Block_Customer_Widget_Name extends Mage_Customer_Block
15
  $this->setTemplate('auguria/sponsorship/customer/widget/name.phtml');
16
  }
17
 
18
- public function getInvit ($param)
19
  {
20
  $value = '';
21
  $cookie = new Mage_Core_Model_Cookie;
15
  $this->setTemplate('auguria/sponsorship/customer/widget/name.phtml');
16
  }
17
 
18
+ public function getInvit($param)
19
  {
20
  $value = '';
21
  $cookie = new Mage_Core_Model_Cookie;
app/code/community/Auguria/Sponsorship/Block/Openinviter.php CHANGED
@@ -23,7 +23,7 @@ class Auguria_Sponsorship_Block_Openinviter extends Mage_Core_Block_Template
23
  return 'get_contacts';
24
  }
25
 
26
- public function getOpenIniviterPlugins()
27
  {
28
  $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
29
  if (isset($form['plugins']))
23
  return 'get_contacts';
24
  }
25
 
26
+ public function getOpenInviterPlugins()
27
  {
28
  $form = Mage::getSingleton('customer/session')->getData('openinviter_form');
29
  if (isset($form['plugins']))
app/code/community/Auguria/Sponsorship/Helper/Config.php CHANGED
@@ -40,7 +40,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
40
  {
41
  $mode = $this->getModuleMode();
42
  if($mode=='fidelity'
43
- || $mode=='separated') {
44
  return true;
45
  }
46
  return false;
@@ -54,7 +54,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
54
  {
55
  $mode = $this->getModuleMode();
56
  if($mode=='sponsorship'
57
- || $mode=='separated') {
58
  return true;
59
  }
60
  return false;
@@ -90,11 +90,11 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
90
  }
91
  else {
92
  if($mode=='separated'
93
- || $mode=='fidelity') {
94
  $config['fidelity'] = Mage::getStoreConfig('auguria_sponsorship/fidelity/points_validity');
95
  }
96
  if($mode=='separated'
97
- || $mode=='sponsorship') {
98
  $config['sponsorship'] = Mage::getStoreConfig('auguria_sponsorship/sponsor/points_validity');
99
  }
100
  }
@@ -111,7 +111,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
111
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/points_validity');
112
  }
113
  elseif ($mode=='separated'
114
- || $mode=='fidelity') {
115
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/points_validity');
116
  }
117
  return 0;
@@ -127,7 +127,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
127
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/points_validity');
128
  }
129
  elseif ($mode=='separated'
130
- || $mode=='sponsorship') {
131
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/points_validity');
132
  }
133
  return 0;
@@ -150,11 +150,11 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
150
  }
151
  else {
152
  if($mode=='separated'
153
- || $mode=='fidelity') {
154
  $config['fidelity'] = Mage::getStoreConfig('auguria_sponsorship/fidelity/fidelity_points_to_cash');
155
  }
156
  if($mode=='separated'
157
- || $mode=='sponsorship') {
158
  $config['sponsorship'] = Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_points_to_cash');
159
  }
160
  }
@@ -177,11 +177,11 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
177
  }
178
  else {
179
  if($mode=='separated'
180
- || $mode=='fidelity') {
181
  $activated['fidelity'] = Mage::getStoreConfig('auguria_sponsorship/fidelity/fidelity_cart');
182
  }
183
  if($mode=='separated'
184
- || $mode=='sponsorship') {
185
  $activated['sponsorship'] = Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_cart');
186
  }
187
  }
@@ -198,7 +198,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
198
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/optional_order');
199
  }
200
  elseif ($mode=='sponsorship'
201
- || $mode=='separated') {
202
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_optional_order');
203
  }
204
  return 0;
@@ -219,7 +219,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
219
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/sponsor_percent');
220
  }
221
  elseif ($mode=='sponsorship'
222
- || $mode=='separated') {
223
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_percent');
224
  }
225
  return 0;
@@ -241,7 +241,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
241
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/allow_invit_registred_users');
242
  }
243
  elseif ($mode=='sponsorship'
244
- || $mode=='separated') {
245
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/allow_invit_registred_users');
246
  }
247
  return 0;
@@ -262,7 +262,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
262
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/newsletter_points');
263
  }
264
  elseif ($mode=='fidelity'
265
- || $mode=='separated') {
266
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/newsletter_points');
267
  }
268
  return 0;
@@ -283,7 +283,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
283
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/first_order_points');
284
  }
285
  elseif ($mode=='fidelity'
286
- || $mode=='separated') {
287
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/first_order_points');
288
  }
289
  return 0;
@@ -304,7 +304,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
304
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/godson_first_order_points');
305
  }
306
  elseif ($mode=='sponsorship'
307
- || $mode=='separated') {
308
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/godson_first_order_points');
309
  }
310
  return 0;
@@ -326,7 +326,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
326
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/sponsor_levels');
327
  }
328
  elseif ($mode=='sponsorship'
329
- || $mode=='separated') {
330
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_levels');
331
  }
332
  return 0;
@@ -349,7 +349,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
349
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/notification_enabled');
350
  }
351
  elseif ($mode=='sponsorship'
352
- || $mode=='separated') {
353
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/notification_enabled');
354
  }
355
  return false;
@@ -370,7 +370,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
370
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/notification');
371
  }
372
  elseif ($mode=='sponsorship'
373
- || $mode=='separated') {
374
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/notification');
375
  }
376
  return false;
@@ -397,7 +397,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
397
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/cancel_earned_points');
398
  }
399
  elseif ($mode=='fidelity'
400
- || $mode=='separated') {
401
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/cancel_earned_points');
402
  }
403
  return false;
@@ -414,7 +414,7 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
414
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/cancel_earned_points');
415
  }
416
  elseif ($mode=='sponsorship'
417
- || $mode=='separated') {
418
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/cancel_earned_points');
419
  }
420
  return false;
@@ -435,4 +435,8 @@ class Auguria_Sponsorship_Helper_Config extends Mage_Core_Helper_Abstract
435
  return false;
436
 
437
  }
 
 
 
 
438
  }
40
  {
41
  $mode = $this->getModuleMode();
42
  if($mode=='fidelity'
43
+ || $mode=='separated') {
44
  return true;
45
  }
46
  return false;
54
  {
55
  $mode = $this->getModuleMode();
56
  if($mode=='sponsorship'
57
+ || $mode=='separated') {
58
  return true;
59
  }
60
  return false;
90
  }
91
  else {
92
  if($mode=='separated'
93
+ || $mode=='fidelity') {
94
  $config['fidelity'] = Mage::getStoreConfig('auguria_sponsorship/fidelity/points_validity');
95
  }
96
  if($mode=='separated'
97
+ || $mode=='sponsorship') {
98
  $config['sponsorship'] = Mage::getStoreConfig('auguria_sponsorship/sponsor/points_validity');
99
  }
100
  }
111
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/points_validity');
112
  }
113
  elseif ($mode=='separated'
114
+ || $mode=='fidelity') {
115
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/points_validity');
116
  }
117
  return 0;
127
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/points_validity');
128
  }
129
  elseif ($mode=='separated'
130
+ || $mode=='sponsorship') {
131
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/points_validity');
132
  }
133
  return 0;
150
  }
151
  else {
152
  if($mode=='separated'
153
+ || $mode=='fidelity') {
154
  $config['fidelity'] = Mage::getStoreConfig('auguria_sponsorship/fidelity/fidelity_points_to_cash');
155
  }
156
  if($mode=='separated'
157
+ || $mode=='sponsorship') {
158
  $config['sponsorship'] = Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_points_to_cash');
159
  }
160
  }
177
  }
178
  else {
179
  if($mode=='separated'
180
+ || $mode=='fidelity') {
181
  $activated['fidelity'] = Mage::getStoreConfig('auguria_sponsorship/fidelity/fidelity_cart');
182
  }
183
  if($mode=='separated'
184
+ || $mode=='sponsorship') {
185
  $activated['sponsorship'] = Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_cart');
186
  }
187
  }
198
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/optional_order');
199
  }
200
  elseif ($mode=='sponsorship'
201
+ || $mode=='separated') {
202
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_optional_order');
203
  }
204
  return 0;
219
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/sponsor_percent');
220
  }
221
  elseif ($mode=='sponsorship'
222
+ || $mode=='separated') {
223
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_percent');
224
  }
225
  return 0;
241
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/allow_invit_registred_users');
242
  }
243
  elseif ($mode=='sponsorship'
244
+ || $mode=='separated') {
245
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/allow_invit_registred_users');
246
  }
247
  return 0;
262
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/newsletter_points');
263
  }
264
  elseif ($mode=='fidelity'
265
+ || $mode=='separated') {
266
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/newsletter_points');
267
  }
268
  return 0;
283
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/first_order_points');
284
  }
285
  elseif ($mode=='fidelity'
286
+ || $mode=='separated') {
287
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/first_order_points');
288
  }
289
  return 0;
304
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/godson_first_order_points');
305
  }
306
  elseif ($mode=='sponsorship'
307
+ || $mode=='separated') {
308
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/godson_first_order_points');
309
  }
310
  return 0;
326
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/sponsor_levels');
327
  }
328
  elseif ($mode=='sponsorship'
329
+ || $mode=='separated') {
330
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/sponsor_levels');
331
  }
332
  return 0;
349
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/notification_enabled');
350
  }
351
  elseif ($mode=='sponsorship'
352
+ || $mode=='separated') {
353
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/notification_enabled');
354
  }
355
  return false;
370
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/notification');
371
  }
372
  elseif ($mode=='sponsorship'
373
+ || $mode=='separated') {
374
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/notification');
375
  }
376
  return false;
397
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/cancel_earned_points');
398
  }
399
  elseif ($mode=='fidelity'
400
+ || $mode=='separated') {
401
  return Mage::getStoreConfig('auguria_sponsorship/fidelity/cancel_earned_points');
402
  }
403
  return false;
414
  return Mage::getStoreConfig('auguria_sponsorship/accumulated/cancel_earned_points');
415
  }
416
  elseif ($mode=='sponsorship'
417
+ || $mode=='separated') {
418
  return Mage::getStoreConfig('auguria_sponsorship/sponsor/cancel_earned_points');
419
  }
420
  return false;
435
  return false;
436
 
437
  }
438
+
439
+ public function getAdministratorEmail(){
440
+ return Mage::getStoreConfig('auguria_sponsorship/cash/administrator_email');
441
+ }
442
  }
app/code/community/Auguria/Sponsorship/Helper/Mail.php CHANGED
@@ -7,278 +7,263 @@
7
  */
8
  class Auguria_Sponsorship_Helper_Mail extends Mage_Core_Helper_Abstract
9
  {
10
- public function getStoreName()
11
- {
12
- return Mage::app()->getGroup()->getName();
13
- }
14
-
15
- public function getSubject ()
16
- {
17
- return $this->__("Invitation to %s",$this->getStoreName());
18
- }
19
-
20
- public function getHeaderMessage ($prenom, $nom)
21
- {
22
- return $this->__('Dear %s %s,',$prenom, $nom);
23
- }
24
-
25
- public function getMessage ()
26
- {
27
- return $this->__('You should visit this website. It offers interesting products.');
28
- }
29
-
30
- public function getSponsorUrl ($id, $prenom, $nom, $email)
31
- {
32
- return Mage::getUrl('sponsorship/sponsor',Array ('sponsor_id'=> $id, 'nom'=>$nom , 'prenom'=>$prenom, 'email'=>$email));
33
-
34
- }
35
-
36
- public function getFooterMessage ($id='',$prenom='', $nom='', $email='')
37
- {
38
- $url = $this->getSponsorUrl($id, $prenom, $nom, $email);
39
- return $this->__("<a href='%s'>%s</a>", $url, $this->getUrlWtHttp());
40
- }
41
 
42
  public function getUrlWtHttp()
43
- {
44
- $patterns = array();
45
  $patterns[0] = '/^http:\/\//i';
46
  $patterns[1] = '/index.php\/*/';
47
  $patterns[2] = '/\/$/';
48
- $url = preg_replace($patterns, "", Mage::getUrl());
49
- return $url;
50
- }
51
-
52
- public function htmlToText ($html)
53
- {
54
- $h2t = new Auguria_Sponsorship_Lib_Html2Text($html);
55
- return $h2t->get_text();
56
- }
57
-
58
- public function recipientMailIsCustomer($mail)
59
- {
60
- //check if email is registred
61
- $customer = mage::getModel("customer/customer")
62
- ->getCollection()
63
- ->addAttributeToFilter("email",$mail);
64
- if (count($customer)==1)
65
- {
66
- //check if recipient is already a sponsor
67
- //check if we can invit registred user
68
- if (Mage::getStoreConfig('auguria_sponsorship/sponsor/allow_invit_registred_users')) {
69
- //check if registred user has already ordered
70
- if (Mage::helper('auguria_sponsorship')->haveOrder($customer->getFirstItem()->getId())) {
71
- return true;
72
- }
73
- //check if registred user has godchild
74
- elseif(Mage::helper('auguria_sponsorship')->isASponsor($customer->getFirstItem()->getId())) {
75
- return true;
76
- }
77
- }
78
- else {
79
- return true;
80
- }
81
- }
82
- return false;
83
- }
84
-
85
- public function processMail($post)
86
- {
87
- //recupération des données fixes pour tous les mails
88
- //sender
89
- $sender_name = ucwords(strtolower($post["sender"]["name"]));
90
- $sender_email = $post['sender']['email'];
91
- $sender_id = $post['sender']['id'];
92
-
93
- //message
94
- $subject = $post['message']['subject'];
95
- $body = $post['message']['body'];
96
-
97
- $date = now();
98
-
99
- //Boucle pour traiter les champs, les valider et les intégrer dans tableau mail
100
- $i = 0;
101
- $mails = Array();
102
- $valid = true;
103
- if (isset($post['recipient']['email']))
104
- foreach ($post['recipient']['email'] as $recipient_email)
105
- {
106
- $mails[$i]["sender_name"] = $sender_name;
107
- $mails[$i]["sender_email"] = $sender_email;
108
- $mails[$i]["sender_id"] = $sender_id;
109
-
110
- $recipient_firstname = ucwords(strtolower($post['recipient']['firstname'][$i]));
111
- $recipient_lastname = ucwords(strtolower($post['recipient']['lastname'][$i]));
112
- $mails[$i]["recipient_firstname"] = $recipient_firstname;
113
- $mails[$i]["recipient_lastname"] = $recipient_lastname;
114
- $mails[$i]["recipient_email"] = $recipient_email;
115
-
116
- //si header indiqué : construction du header et intégration au message
117
- $mails[$i]["subject"] = $subject;
118
- $htmlMessage = "";
119
- //si un id est envoyé : c'est une modification
120
- if (isset ($post['sponsorship_id']))
121
- {
122
- $mails[$i]["sponsorship_id"] = $post['sponsorship_id'];
123
- $htmlMessage = $body;
124
- $mails[$i]["datetime_boost"] = $date;
125
- }
126
- else //creation
127
- {
128
- $mails[$i]["datetime"] = $date;
129
- $header = $this->getHeaderMessage ($recipient_firstname, $recipient_lastname);
130
- $htmlMessage = $header."<br/><br/>".$body;
131
- }
132
-
133
- $textMessage = $this->htmlToText($htmlMessage);
134
- $mails[$i]["html_message"] = $htmlMessage;
135
- $mails[$i]["text_message"] = $textMessage;
136
- $htmlFooter = $this->getFooterMessage($sender_id, $recipient_firstname, $recipient_lastname, $recipient_email);
137
- $mails[$i]["sponsorship_url"] = $this->getSponsorUrl($sender_id, $recipient_firstname, $recipient_lastname, $recipient_email);
138
- $textFooter = $this->htmlToText($htmlFooter);
139
- $mails[$i]["html_footer"] = $htmlFooter;
140
- $mails[$i]["text_footer"] = $textFooter;
141
-
142
- $i++;
143
- }
144
- return $mails;
145
- }
146
- public function validateMail($mails)
147
- {
148
- $valid = true;
149
- foreach ($mails as $mail)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  {
151
- //Sender
152
- $sender_name = $mail['sender_name'];
153
- $sender_email = $mail['sender_email'];
154
-
155
- //Recipient
156
- $recipient_email = $mail['recipient_email'];
157
- $recipient_firstname = $mail['recipient_firstname'];
158
- $recipient_lastname = $mail['recipient_lastname'];
159
-
160
- //Message
161
- $textMessage = $mail['text_message'];
162
- $subject = $mail['subject'];
163
-
164
- if (!Zend_Validate::is(trim($sender_name) , 'NotEmpty')) {
165
- $valid = false;
166
- }
167
-
168
- if (!Zend_Validate::is(trim($sender_email) , 'NotEmpty')) {
169
- $valid = false;
170
- }
171
-
172
- if (!Zend_Validate::is(trim($sender_email), 'EmailAddress')) {
173
- $valid = false;
174
- }
175
-
176
- if (!Zend_Validate::is(trim($textMessage) , 'NotEmpty')) {
177
- $valid = false;
178
- }
179
-
180
- if (!Zend_Validate::is(trim($subject) , 'NotEmpty')) {
181
- $valid = false;
182
- }
183
-
184
- if (!Zend_Validate::is(trim($recipient_email), 'EmailAddress')) {
185
- $valid = false;
186
- }
187
-
188
- if (!Zend_Validate::is(trim($recipient_firstname) , 'NotEmpty')) {
189
-
190
- $valid = false;
191
- }
192
-
193
- if (!Zend_Validate::is(trim($recipient_lastname) , 'NotEmpty')) {
194
-
195
- $valid = false;
196
- }
197
- }
198
- return $valid;
199
- }
200
-
201
- public function saveMail($mail)
202
- {
203
- try
204
- {
205
- $invit = "";
206
- $data = Array();
207
- //si sponsorship_id est envoyé : c'est un update
208
- if (isset ($mail['sponsorship_id']))
209
- {
210
- $invit = mage::getModel("auguria_sponsorship/sponsorship")->load($mail["sponsorship_id"]);
211
- $data = $invit->getData();
212
- $data["datetime_boost"] = $mail['datetime_boost'];
213
- }
214
- else
215
- {
216
- $invit = mage::getModel("auguria_sponsorship/sponsorship");
217
- $data["datetime"] = $mail['datetime'];
218
- }
219
- $data["parent_id"] = $mail["sender_id"];
220
- $data["child_mail"] = $mail["recipient_email"];
221
- $data["child_firstname"] = $mail["recipient_firstname"];
222
- $data["child_lastname"] = $mail["recipient_lastname"];
223
- $data["message"] = $mail["text_message"];
224
- $data["parent_mail"] = $mail["sender_email"];
225
- $data["parent_name"] = $mail["sender_name"];
226
- $data["subject"] = $mail["subject"];
227
-
228
- $invit->setData($data);
229
- $invit->save();
230
- return true;
231
- }
232
- catch (Exception $e)
233
- {
234
- return false;
235
- }
236
- }
237
-
238
- public function sendMail($mail)
239
- {
240
- //generation du message en texte
241
- $htmlMessage = $mail["html_message"];
242
- $textMessage = $mail["text_message"];
243
- $htmlFooter = $mail["html_footer"];
244
- $textFooter = $mail["text_footer"];
245
- $sender_name = $mail["sender_name"];
246
- $sender_email = $mail["sender_email"];
247
- $sender = array("name"=>$sender_name, "email"=>$sender_email);
248
- $recipient_email = $mail["recipient_email"];
249
- $recipient = $mail["recipient_firstname"]." ".$mail["recipient_lastname"];
250
-
251
- $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
252
-
253
- $postObject = new Varien_Object();
254
- $postObject->setData(Array ("sender_name" => $sender_name,
255
- "sender_email" => $sender_email,
256
- "subject" => $mail["subject"],
257
- "html_message" => $htmlMessage,
258
- "text_message" => $textMessage,
259
- "html_footer" => $htmlFooter,
260
- "text_footer" => $textFooter,
261
- "recipient_email" => $recipient_email,
262
- "sponsorship_url" => $mail["sponsorship_url"]
263
- ));
264
-
265
- $mailTemplate->setDesignConfig(array('area' => 'fronted'))
266
- ->setReplyTo($sender_email)
267
- ->setReturnPath($sender_email)
268
- ->sendTransactional(
269
- Mage::getStoreConfig('auguria_sponsorship/invitation/template'),
270
- $sender,
271
- $recipient_email,
272
- $recipient,
273
- array('data' => $postObject
274
- ));
275
- if ($mailTemplate->getSentSuccess())
276
- {
277
- return true;
278
- }
279
- else
280
- {
281
- return false;
282
- }
283
- }
284
  }
7
  */
8
  class Auguria_Sponsorship_Helper_Mail extends Mage_Core_Helper_Abstract
9
  {
10
+ public function getStoreName()
11
+ {
12
+ return Mage::app()->getGroup()->getName();
13
+ }
14
+
15
+ public function getSubject ()
16
+ {
17
+ return $this->__("Invitation to %s",$this->getStoreName());
18
+ }
19
+
20
+ public function getHeaderMessage ($prenom, $nom)
21
+ {
22
+ return $this->__('Dear %s %s,',$prenom, $nom);
23
+ }
24
+
25
+ public function getMessage ()
26
+ {
27
+ return $this->__('You should visit this website. It offers interesting products.');
28
+ }
29
+
30
+ public function getSponsorUrl ($id, $prenom, $nom, $email)
31
+ {
32
+ return Mage::getUrl('sponsorship/sponsor',Array ('sponsor_id'=> $id, 'nom'=>$nom , 'prenom'=>$prenom, 'email'=>$email));
33
+
34
+ }
35
+
36
+ public function getFooterMessage ($id='',$prenom='', $nom='', $email='')
37
+ {
38
+ $url = $this->getSponsorUrl($id, $prenom, $nom, $email);
39
+ return $this->__("<a href='%s'>%s</a>", $url, $this->getUrlWtHttp());
40
+ }
41
 
42
  public function getUrlWtHttp()
43
+ {
44
+ $patterns = array();
45
  $patterns[0] = '/^http:\/\//i';
46
  $patterns[1] = '/index.php\/*/';
47
  $patterns[2] = '/\/$/';
48
+ $url = preg_replace($patterns, "", Mage::getUrl());
49
+ return $url;
50
+ }
51
+
52
+ public function recipientMailIsCustomer($mail)
53
+ {
54
+ //check if email is registred
55
+ $customer = mage::getModel("customer/customer")
56
+ ->getCollection()
57
+ ->addAttributeToFilter("email",$mail);
58
+ if (count($customer)==1)
59
+ {
60
+ //check if recipient is already a sponsor
61
+ //check if we can invit registred user
62
+ if (Mage::getStoreConfig('auguria_sponsorship/sponsor/allow_invit_registred_users')) {
63
+ //check if registred user has already ordered
64
+ if (Mage::helper('auguria_sponsorship')->haveOrder($customer->getFirstItem()->getId())) {
65
+ return true;
66
+ }
67
+ //check if registred user has godchild
68
+ elseif(Mage::helper('auguria_sponsorship')->isASponsor($customer->getFirstItem()->getId())) {
69
+ return true;
70
+ }
71
+ }
72
+ else {
73
+ return true;
74
+ }
75
+ }
76
+ return false;
77
+ }
78
+
79
+ public function processMail($post)
80
+ {
81
+ //recupération des données fixes pour tous les mails
82
+ //sender
83
+ $sender_name = ucwords(strtolower($post["sender"]["name"]));
84
+ $sender_email = $post['sender']['email'];
85
+ $sender_id = $post['sender']['id'];
86
+
87
+ //message
88
+ $subject = $post['message']['subject'];
89
+ $body = $post['message']['body'];
90
+
91
+ $date = now();
92
+
93
+ //Boucle pour traiter les champs, les valider et les intégrer dans tableau mail
94
+ $i = 0;
95
+ $mails = Array();
96
+ $valid = true;
97
+ if (isset($post['recipient']['email']))
98
+ foreach ($post['recipient']['email'] as $recipient_email)
99
+ {
100
+ $mails[$i]["sender_name"] = $sender_name;
101
+ $mails[$i]["sender_email"] = $sender_email;
102
+ $mails[$i]["sender_id"] = $sender_id;
103
+
104
+ $recipient_firstname = ucwords(strtolower($post['recipient']['firstname'][$i]));
105
+ $recipient_lastname = ucwords(strtolower($post['recipient']['lastname'][$i]));
106
+ $mails[$i]["recipient_firstname"] = $recipient_firstname;
107
+ $mails[$i]["recipient_lastname"] = $recipient_lastname;
108
+ $mails[$i]["recipient_email"] = $recipient_email;
109
+
110
+ //si header indiqué : construction du header et intégration au message
111
+ $mails[$i]["subject"] = $subject;
112
+ $htmlMessage = "";
113
+ //si un id est envoyé : c'est une modification
114
+ if (isset ($post['sponsorship_id']))
115
+ {
116
+ $mails[$i]["sponsorship_id"] = $post['sponsorship_id'];
117
+ $htmlMessage = $body;
118
+ $mails[$i]["datetime_boost"] = $date;
119
+ }
120
+ else //creation
121
+ {
122
+ $mails[$i]["datetime"] = $date;
123
+ $header = $this->getHeaderMessage ($recipient_firstname, $recipient_lastname);
124
+ $htmlMessage = $header."<br/><br/>".$body;
125
+ }
126
+
127
+ $mails[$i]["html_message"] = $htmlMessage;
128
+ $htmlFooter = $this->getFooterMessage($sender_id, $recipient_firstname, $recipient_lastname, $recipient_email);
129
+ $mails[$i]["sponsorship_url"] = $this->getSponsorUrl($sender_id, $recipient_firstname, $recipient_lastname, $recipient_email);
130
+ $mails[$i]["html_footer"] = $htmlFooter;
131
+
132
+ $i++;
133
+ }
134
+ return $mails;
135
+ }
136
+ public function validateMail($mails)
137
+ {
138
+ $valid = true;
139
+ foreach ($mails as $mail)
140
+ {
141
+ //Sender
142
+ $sender_name = $mail['sender_name'];
143
+ $sender_email = $mail['sender_email'];
144
+
145
+ //Recipient
146
+ $recipient_email = $mail['recipient_email'];
147
+ $recipient_firstname = $mail['recipient_firstname'];
148
+ $recipient_lastname = $mail['recipient_lastname'];
149
+
150
+ //Message
151
+ $htmlMessage = $mail['html_message'];
152
+ $subject = $mail['subject'];
153
+
154
+ if (!Zend_Validate::is(trim($sender_name) , 'NotEmpty')) {
155
+ $valid = false;
156
+ }
157
+
158
+ if (!Zend_Validate::is(trim($sender_email) , 'NotEmpty')) {
159
+ $valid = false;
160
+ }
161
+
162
+ if (!Zend_Validate::is(trim($sender_email), 'EmailAddress')) {
163
+ $valid = false;
164
+ }
165
+
166
+ if (!Zend_Validate::is(trim($htmlMessage) , 'NotEmpty')) {
167
+ $valid = false;
168
+ }
169
+
170
+ if (!Zend_Validate::is(trim($subject) , 'NotEmpty')) {
171
+ $valid = false;
172
+ }
173
+
174
+ if (!Zend_Validate::is(trim($recipient_email), 'EmailAddress')) {
175
+ $valid = false;
176
+ }
177
+
178
+ if (!Zend_Validate::is(trim($recipient_firstname) , 'NotEmpty')) {
179
+
180
+ $valid = false;
181
+ }
182
+
183
+ if (!Zend_Validate::is(trim($recipient_lastname) , 'NotEmpty')) {
184
+
185
+ $valid = false;
186
+ }
187
+ }
188
+ return $valid;
189
+ }
190
+
191
+ public function saveMail($mail)
192
+ {
193
+ try
194
+ {
195
+ $invit = "";
196
+ $data = Array();
197
+ //si sponsorship_id est envoyé : c'est un update
198
+ if (isset ($mail['sponsorship_id']))
199
+ {
200
+ $invit = mage::getModel("auguria_sponsorship/sponsorship")->load($mail["sponsorship_id"]);
201
+ $data = $invit->getData();
202
+ $data["datetime_boost"] = $mail['datetime_boost'];
203
+ }
204
+ else
205
+ {
206
+ $invit = mage::getModel("auguria_sponsorship/sponsorship");
207
+ $data["datetime"] = $mail['datetime'];
208
+ }
209
+ $data["parent_id"] = $mail["sender_id"];
210
+ $data["child_mail"] = $mail["recipient_email"];
211
+ $data["child_firstname"] = $mail["recipient_firstname"];
212
+ $data["child_lastname"] = $mail["recipient_lastname"];
213
+ $data["message"] = $mail["html_message"];
214
+ $data["parent_mail"] = $mail["sender_email"];
215
+ $data["parent_name"] = $mail["sender_name"];
216
+ $data["subject"] = $mail["subject"];
217
+
218
+ $invit->setData($data);
219
+ $invit->save();
220
+ return true;
221
+ }
222
+ catch (Exception $e)
223
+ {
224
+ return false;
225
+ }
226
+ }
227
+
228
+ public function sendMail($mail)
229
  {
230
+ //generation du message en texte
231
+ $htmlMessage = $mail["html_message"];
232
+ $htmlFooter = $mail["html_footer"];
233
+ $sender_name = $mail["sender_name"];
234
+ $sender_email = $mail["sender_email"];
235
+ $sender = array("name"=>$sender_name, "email"=>$sender_email);
236
+ $recipient_email = $mail["recipient_email"];
237
+ $recipient = $mail["recipient_firstname"]." ".$mail["recipient_lastname"];
238
+
239
+ $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
240
+
241
+ $postObject = new Varien_Object();
242
+ $postObject->setData(Array ("sender_name" => $sender_name,
243
+ "sender_email" => $sender_email,
244
+ "subject" => $mail["subject"],
245
+ "html_message" => $htmlMessage,
246
+ "html_footer" => $htmlFooter,
247
+ "recipient_email" => $recipient_email,
248
+ "sponsorship_url" => $mail["sponsorship_url"]
249
+ ));
250
+ $mailTemplate->setDesignConfig(array('area' => 'fronted'))
251
+ ->setReplyTo($sender_email)
252
+ ->setReturnPath($sender_email)
253
+ ->sendTransactional(
254
+ Mage::getStoreConfig('auguria_sponsorship/invitation/template'),
255
+ $sender,
256
+ $recipient_email,
257
+ $recipient,
258
+ array('data' => $postObject
259
+ ));
260
+ if ($mailTemplate->getSentSuccess())
261
+ {
262
+ return true;
263
+ }
264
+ else
265
+ {
266
+ return false;
267
+ }
268
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  }
app/code/community/Auguria/Sponsorship/Lib/Html2Text.php DELETED
@@ -1,397 +0,0 @@
1
- <?php
2
- /*************************************************************************
3
- * *
4
- * class.html2text.inc *
5
- * *
6
- *************************************************************************
7
- * *
8
- * Converts HTML to formatted plain text *
9
- * *
10
- * Copyright (c) 2005-2007 Jon Abernathy <jon@chuggnutt.com> *
11
- * All rights reserved. *
12
- * *
13
- * This script is free software; you can redistribute it and/or modify *
14
- * it under the terms of the GNU General Public License as published by *
15
- * the Free Software Foundation; either version 2 of the License, or *
16
- * (at your option) any later version. *
17
- * *
18
- * The GNU General Public License can be found at *
19
- * http://www.gnu.org/copyleft/gpl.html. *
20
- * *
21
- * This script is distributed in the hope that it will be useful, *
22
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
23
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
24
- * GNU General Public License for more details. *
25
- * *
26
- * Author(s): Jon Abernathy <jon@chuggnutt.com> *
27
- * *
28
- * Last modified: 08/08/07 *
29
- * *
30
- *************************************************************************/
31
-
32
-
33
- /**
34
- * Takes HTML and converts it to formatted, plain text.
35
- *
36
- * Thanks to Alexander Krug (http://www.krugar.de/) to pointing out and
37
- * correcting an error in the regexp search array. Fixed 7/30/03.
38
- *
39
- * Updated set_html() function's file reading mechanism, 9/25/03.
40
- *
41
- * Thanks to Joss Sanglier (http://www.dancingbear.co.uk/) for adding
42
- * several more HTML entity codes to the $search and $replace arrays.
43
- * Updated 11/7/03.
44
- *
45
- * Thanks to Darius Kasperavicius (http://www.dar.dar.lt/) for
46
- * suggesting the addition of $allowed_tags and its supporting function
47
- * (which I slightly modified). Updated 3/12/04.
48
- *
49
- * Thanks to Justin Dearing for pointing out that a replacement for the
50
- * <TH> tag was missing, and suggesting an appropriate fix.
51
- * Updated 8/25/04.
52
- *
53
- * Thanks to Mathieu Collas (http://www.myefarm.com/) for finding a
54
- * display/formatting bug in the _build_link_list() function: email
55
- * readers would show the left bracket and number ("[1") as part of the
56
- * rendered email address.
57
- * Updated 12/16/04.
58
- *
59
- * Thanks to Wojciech Bajon (http://histeria.pl/) for submitting code
60
- * to handle relative links, which I hadn't considered. I modified his
61
- * code a bit to handle normal HTTP links and MAILTO links. Also for
62
- * suggesting three additional HTML entity codes to search for.
63
- * Updated 03/02/05.
64
- *
65
- * Thanks to Jacob Chandler for pointing out another link condition
66
- * for the _build_link_list() function: "https".
67
- * Updated 04/06/05.
68
- *
69
- * Thanks to Marc Bertrand (http://www.dresdensky.com/) for
70
- * suggesting a revision to the word wrapping functionality; if you
71
- * specify a $width of 0 or less, word wrapping will be ignored.
72
- * Updated 11/02/06.
73
- *
74
- * *** Big housecleaning updates below:
75
- *
76
- * Thanks to Colin Brown (http://www.sparkdriver.co.uk/) for
77
- * suggesting the fix to handle </li> and blank lines (whitespace).
78
- * Christian Basedau (http://www.movetheweb.de/) also suggested the
79
- * blank lines fix.
80
- *
81
- * Special thanks to Marcus Bointon (http://www.synchromedia.co.uk/),
82
- * Christian Basedau, Norbert Laposa (http://ln5.co.uk/),
83
- * Bas van de Weijer, and Marijn van Butselaar
84
- * for pointing out my glaring error in the <th> handling. Marcus also
85
- * supplied a host of fixes.
86
- *
87
- * Thanks to Jeffrey Silverman (http://www.newtnotes.com/) for pointing
88
- * out that extra spaces should be compressed--a problem addressed with
89
- * Marcus Bointon's fixes but that I had not yet incorporated.
90
- *
91
- * Thanks to Daniel Schledermann (http://www.typoconsult.dk/) for
92
- * suggesting a valuable fix with <a> tag handling.
93
- *
94
- * Thanks to Wojciech Bajon (again!) for suggesting fixes and additions,
95
- * including the <a> tag handling that Daniel Schledermann pointed
96
- * out but that I had not yet incorporated. I haven't (yet)
97
- * incorporated all of Wojciech's changes, though I may at some
98
- * future time.
99
- *
100
- * *** End of the housecleaning updates. Updated 08/08/07.
101
- *
102
- * @author Jon Abernathy <jon@chuggnutt.com>
103
- * @version 1.0.0
104
- * @since PHP 4.0.2
105
- */
106
- class Auguria_Sponsorship_Lib_Html2Text
107
- {
108
-
109
- var $html;
110
- var $text;
111
- var $width = 70;
112
- var $search = array(
113
- "/\r/", // Non-legal carriage return
114
- "/[\n\t]+/", // Newlines and tabs
115
- '/[ ]{2,}/', // Runs of spaces, pre-handling
116
- '/<script[^>]*>.*?<\/script>/i', // <script>s -- which strip_tags supposedly has problems with
117
- '/<style[^>]*>.*?<\/style>/i', // <style>s -- which strip_tags supposedly has problems with
118
- //'/<!-- .* -->/', // Comments -- which strip_tags might have problem a with
119
- '/<h[123][^>]*>(.*?)<\/h[123]>/ie', // H1 - H3
120
- '/<h[456][^>]*>(.*?)<\/h[456]>/ie', // H4 - H6
121
- '/<p[^>]*>/i', // <P>
122
- '/<br[^>]*>/i', // <br>
123
- '/<b[^>]*>(.*?)<\/b>/ie', // <b>
124
- '/<strong[^>]*>(.*?)<\/strong>/ie', // <strong>
125
- '/<i[^>]*>(.*?)<\/i>/i', // <i>
126
- '/<em[^>]*>(.*?)<\/em>/i', // <em>
127
- '/(<ul[^>]*>|<\/ul>)/i', // <ul> and </ul>
128
- '/(<ol[^>]*>|<\/ol>)/i', // <ol> and </ol>
129
- '/<li[^>]*>(.*?)<\/li>/i', // <li> and </li>
130
- '/<li[^>]*>/i', // <li>
131
- '/<a [^>]*href="([^"]+)"[^>]*>(.*?)<\/a>/ie',
132
- // <a href="">
133
- '/<hr[^>]*>/i', // <hr>
134
- '/(<table[^>]*>|<\/table>)/i', // <table> and </table>
135
- '/(<tr[^>]*>|<\/tr>)/i', // <tr> and </tr>
136
- '/<td[^>]*>(.*?)<\/td>/i', // <td> and </td>
137
- '/<th[^>]*>(.*?)<\/th>/ie', // <th> and </th>
138
- '/&(nbsp|#160);/i', // Non-breaking space
139
- '/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i',
140
- // Double quotes
141
- '/&(apos|rsquo|lsquo|#8216|#8217);/i', // Single quotes
142
- '/&gt;/i', // Greater-than
143
- '/&lt;/i', // Less-than
144
- '/&(amp|#38);/i', // Ampersand
145
- '/&(copy|#169);/i', // Copyright
146
- '/&(trade|#8482|#153);/i', // Trademark
147
- '/&(reg|#174);/i', // Registered
148
- '/&(mdash|#151|#8212);/i', // mdash
149
- '/&(ndash|minus|#8211|#8722);/i', // ndash
150
- '/&(bull|#149|#8226);/i', // Bullet
151
- '/&(pound|#163);/i', // Pound sign
152
- '/&(euro|#8364);/i', // Euro sign
153
- '/&[^&;]+;/i', // Unknown/unhandled entities
154
- '/[ ]{2,}/' // Runs of spaces, post-handling
155
- );
156
-
157
- var $replace = array(
158
- '', // Non-legal carriage return
159
- ' ', // Newlines and tabs
160
- ' ', // Runs of spaces, pre-handling
161
- '', // <script>s -- which strip_tags supposedly has problems with
162
- '', // <style>s -- which strip_tags supposedly has problems with
163
- //'', // Comments -- which strip_tags might have problem a with
164
- "strtoupper(\"\n\n\\1\n\n\")", // H1 - H3
165
- "ucwords(\"\n\n\\1\n\n\")", // H4 - H6
166
- "\n\n\t", // <P>
167
- "\n", // <br>
168
- 'strtoupper("\\1")', // <b>
169
- 'strtoupper("\\1")', // <strong>
170
- '_\\1_', // <i>
171
- '_\\1_', // <em>
172
- "\n\n", // <ul> and </ul>
173
- "\n\n", // <ol> and </ol>
174
- "\t* \\1\n", // <li> and </li>
175
- "\n\t* ", // <li>
176
- '$this->_build_link_list("\\1", "\\2")',
177
- // <a href="">
178
- "\n-------------------------\n", // <hr>
179
- "\n\n", // <table> and </table>
180
- "\n", // <tr> and </tr>
181
- "\t\t\\1\n", // <td> and </td>
182
- "strtoupper(\"\t\t\\1\n\")", // <th> and </th>
183
- ' ', // Non-breaking space
184
- '"', // Double quotes
185
- "'", // Single quotes
186
- '>',
187
- '<',
188
- '&',
189
- '(c)',
190
- '(tm)',
191
- '(R)',
192
- '--',
193
- '-',
194
- '*',
195
- '£',
196
- 'EUR', // Euro sign. € ?
197
- '', // Unknown/unhandled entities
198
- ' ' // Runs of spaces, post-handling
199
- );
200
-
201
- var $allowed_tags = '';
202
- var $url;
203
- var $_converted = false;
204
- var $_link_list = '';
205
- var $_link_count = 0;
206
-
207
- function Auguria_Sponsorship_Lib_Html2Text( $source = '', $from_file = false )
208
- {
209
- if ( !empty($source) ) {
210
- $this->set_html($source, $from_file);
211
- }
212
- $this->set_base_url();
213
- }
214
-
215
- /**
216
- * Loads source HTML into memory, either from $source string or a file.
217
- *
218
- * @param string $source HTML content
219
- * @param boolean $from_file Indicates $source is a file to pull content from
220
- * @access public
221
- * @return void
222
- */
223
- function set_html( $source, $from_file = false )
224
- {
225
- $this->html = $source;
226
-
227
- if ( $from_file && file_exists($source) ) {
228
- $fp = fopen($source, 'r');
229
- $this->html = fread($fp, filesize($source));
230
- fclose($fp);
231
- }
232
-
233
- $this->_converted = false;
234
- }
235
-
236
- /**
237
- * Returns the text, converted from HTML.
238
- *
239
- * @access public
240
- * @return string
241
- */
242
- function get_text()
243
- {
244
- if ( !$this->_converted ) {
245
- $this->_convert();
246
- }
247
-
248
- return $this->text;
249
- }
250
-
251
- /**
252
- * Prints the text, converted from HTML.
253
- *
254
- * @access public
255
- * @return void
256
- */
257
- function print_text()
258
- {
259
- print $this->get_text();
260
- }
261
-
262
- /**
263
- * Alias to print_text(), operates identically.
264
- *
265
- * @access public
266
- * @return void
267
- * @see print_text()
268
- */
269
- function p()
270
- {
271
- print $this->get_text();
272
- }
273
-
274
- /**
275
- * Sets the allowed HTML tags to pass through to the resulting text.
276
- *
277
- * Tags should be in the form "<p>", with no corresponding closing tag.
278
- *
279
- * @access public
280
- * @return void
281
- */
282
- function set_allowed_tags( $allowed_tags = '' )
283
- {
284
- if ( !empty($allowed_tags) ) {
285
- $this->allowed_tags = $allowed_tags;
286
- }
287
- }
288
-
289
- /**
290
- * Sets a base URL to handle relative links.
291
- *
292
- * @access public
293
- * @return void
294
- */
295
- function set_base_url( $url = '' )
296
- {
297
- if ( empty($url) ) {
298
- if ( !empty($_SERVER['HTTP_HOST']) ) {
299
- $this->url = 'http://' . $_SERVER['HTTP_HOST'];
300
- } else {
301
- $this->url = '';
302
- }
303
- } else {
304
- // Strip any trailing slashes for consistency (relative
305
- // URLs may already start with a slash like "/file.html")
306
- if ( substr($url, -1) == '/' ) {
307
- $url = substr($url, 0, -1);
308
- }
309
- $this->url = $url;
310
- }
311
- }
312
-
313
- /**
314
- * Workhorse function that does actual conversion.
315
- *
316
- * First performs custom tag replacement specified by $search and
317
- * $replace arrays. Then strips any remaining HTML tags, reduces whitespace
318
- * and newlines to a readable format, and word wraps the text to
319
- * $width characters.
320
- *
321
- * @access private
322
- * @return void
323
- */
324
- function _convert()
325
- {
326
- // Variables used for building the link list
327
- $this->_link_count = 0;
328
- $this->_link_list = '';
329
-
330
- $text = trim(stripslashes($this->html));
331
-
332
- // Run our defined search-and-replace
333
- $text = preg_replace($this->search, $this->replace, $text);
334
-
335
- // Strip any other HTML tags
336
- $text = strip_tags($text, $this->allowed_tags);
337
-
338
- // Bring down number of empty lines to 2 max
339
- $text = preg_replace("/\n\s+\n/", "\n\n", $text);
340
- $text = preg_replace("/[\n]{3,}/", "\n\n", $text);
341
-
342
- // Add link list
343
- if ( !empty($this->_link_list) ) {
344
- $text .= "\n\nLinks:\n------\n" . $this->_link_list;
345
- }
346
-
347
- // Wrap the text to a readable format
348
- // for PHP versions >= 4.0.2. Default width is 75
349
- // If width is 0 or less, don't wrap the text.
350
- if ( $this->width > 0 ) {
351
- $text = wordwrap($text, $this->width);
352
- }
353
-
354
- $this->text = $text;
355
-
356
- $this->_converted = true;
357
- }
358
-
359
- /**
360
- * Helper function called by preg_replace() on link replacement.
361
- *
362
- * Maintains an internal list of links to be displayed at the end of the
363
- * text, with numeric indices to the original point in the text they
364
- * appeared. Also makes an effort at identifying and handling absolute
365
- * and relative links.
366
- *
367
- * @param string $link URL of the link
368
- * @param string $display Part of the text to associate number with
369
- * @access private
370
- * @return string
371
- */
372
- function _build_link_list( $link, $display )
373
- {
374
- if ( substr($link, 0, 7) == 'http://' || substr($link, 0, 8) == 'https://' ||
375
- substr($link, 0, 7) == 'mailto:' ) {
376
- $this->_link_count++;
377
- $this->_link_list .= "[" . $this->_link_count . "] $link\n";
378
- $additional = ' [' . $this->_link_count . ']';
379
- } elseif ( substr($link, 0, 11) == 'javascript:' ) {
380
- // Don't count the link; ignore it
381
- $additional = '';
382
- // what about href="#anchor" ?
383
- } else {
384
- $this->_link_count++;
385
- $this->_link_list .= "[" . $this->_link_count . "] " . $this->url;
386
- if ( substr($link, 0, 1) != '/' ) {
387
- $this->_link_list .= '/';
388
- }
389
- $this->_link_list .= "$link\n";
390
- $additional = ' [' . $this->_link_count . ']';
391
- }
392
-
393
- return $display . $additional;
394
- }
395
-
396
- }
397
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Auguria/Sponsorship/Lib/OpenInviter/config.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
  $openinviter_settings=array(
4
- "username"=>"",
5
- "private_key"=>"",
6
  "cookie_path"=>"/tmp",
7
  "transport"=>"curl",
8
  "local_debug"=>"on_error",
1
  <?php
2
 
3
  $openinviter_settings=array(
4
+ "username"=>"johnny",
5
+ "private_key"=>"994fafc203f167ca337b947eb01a5e3d",
6
  "cookie_path"=>"/tmp",
7
  "transport"=>"curl",
8
  "local_debug"=>"on_error",
app/code/community/Auguria/Sponsorship/Model/Core/Email/Template.php CHANGED
@@ -7,64 +7,49 @@
7
  */
8
  class Auguria_Sponsorship_Model_Core_Email_Template extends Mage_Core_Model_Email_Template
9
  {
10
- public function send($email, $name=null, array $variables = array())
11
- {
12
- if(!$this->isValidForSend()) {
13
- return false;
14
- }
15
-
16
- if (is_null($name)) {
17
- $name = substr($email, 0, strpos($email, '@'));
18
- }
19
-
20
- $variables['email'] = $email;
21
- $variables['name'] = $name;
22
-
23
- ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
24
- ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));
25
 
26
- $mail = $this->getMail();
27
- if (is_array($email)) {
28
- foreach ($email as $emailOne) {
29
- $mail->addTo($emailOne, $name);
30
- }
31
- } else {
32
- $mail->addTo($email, '=?utf-8?B?'.base64_encode($name).'?=');
33
- }
34
 
35
- $this->setUseAbsoluteLinks(true);
36
- $text = $this->getProcessedTemplate($variables, true);
37
 
38
- $boundary = '--BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP';
 
39
 
40
- $boundary_location = strpos($text, $boundary);
41
- if ($boundary_location) {
42
- $stext = substr($text, 0, strpos($text, $boundary));
43
- $shtml = str_replace($boundary, '', substr($text, $boundary_location));
44
- $mail->setBodyText($stext);
45
- $mail->setBodyHTML($shtml);
46
  } else {
47
- if($this->isPlain()) {
48
- $mail->setBodyText($text);
49
- } else {
50
- $mail->setBodyHTML($text);
51
- }
52
  }
53
 
 
 
 
 
54
 
55
- $mail->setSubject('=?utf-8?B?'.base64_encode($this->getProcessedTemplateSubject($variables)).'?=');
56
- $mail->setFrom($this->getSenderEmail(), $this->getSenderName());
57
 
58
- try {
59
- $mail->send(); // Zend_Mail warning..
60
- $this->_mail = null;
61
- }
62
- catch (Exception $e)
63
- {
64
- Mage::log('An error occured while sending mail : '.$e->getMessage());
65
- return false;
66
- }
67
 
68
- return true;
69
- }
70
  }
7
  */
8
  class Auguria_Sponsorship_Model_Core_Email_Template extends Mage_Core_Model_Email_Template
9
  {
10
+ public function send($email, $name=null, array $variables = array())
11
+ {
12
+ if(!$this->isValidForSend()) {
13
+ return false;
14
+ }
 
 
 
 
 
 
 
 
 
 
15
 
16
+ if (is_null($name)) {
17
+ $name = substr($email, 0, strpos($email, '@'));
18
+ }
 
 
 
 
 
19
 
20
+ $variables['email'] = $email;
21
+ $variables['name'] = $name;
22
 
23
+ ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
24
+ ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));
25
 
26
+ $mail = $this->getMail();
27
+ if (is_array($email)) {
28
+ foreach ($email as $emailOne) {
29
+ $mail->addTo($emailOne, $name);
30
+ }
 
31
  } else {
32
+ $mail->addTo($email, '=?utf-8?B?'.base64_encode($name).'?=');
 
 
 
 
33
  }
34
 
35
+ $this->setUseAbsoluteLinks(true);
36
+
37
+ $html = $this->getProcessedTemplate($variables, true);
38
+ $mail->setBodyHTML($html);
39
 
40
+ $mail->setSubject('=?utf-8?B?'.base64_encode($this->getProcessedTemplateSubject($variables)).'?=');
41
+ $mail->setFrom($this->getSenderEmail(), $this->getSenderName());
42
 
43
+ try {
44
+ $mail->send(); // Zend_Mail warning..
45
+ $this->_mail = null;
46
+ }
47
+ catch (Exception $e)
48
+ {
49
+ Mage::log('An error occured while sending mail : '.$e->getMessage());
50
+ return false;
51
+ }
52
 
53
+ return true;
54
+ }
55
  }
app/code/community/Auguria/Sponsorship/Model/Observer.php CHANGED
@@ -5,95 +5,128 @@
5
  * @author Auguria
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
  */
 
8
  class Auguria_Sponsorship_Model_Observer
9
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  /**
11
  * Calcul total order points on sales_order_payment_pay event
12
  * @param Varien_Event_Observer $observer
13
  */
14
- public function calcPoints($observer)
15
- {
16
- /**
17
- * @TODO : retrancher du total les points offerts
18
- */
19
- try {
20
- //modules actifs
21
- $moduleFidelity = Mage::helper('auguria_sponsorship/config')->isFidelityEnabled();
22
- $moduleSponsor = Mage::helper('auguria_sponsorship/config')->isSponsorshipEnabled();
23
- $moduleAccumulated = Mage::helper('auguria_sponsorship/config')->isAccumulatedEnabled();
24
 
25
  if ($moduleFidelity==1||$moduleSponsor==1||$moduleAccumulated==1)
26
  {
27
- //récupération de la commande et des articles
28
- $order = $observer->getInvoice()->getOrder();
29
- $orderDate = $order->getUpdatedAt();
30
- $orderId = $order->getEntityId();
31
 
32
- //définition du client
33
- $cId = $order->getCustomerId();
34
 
35
- //definition du websiteid
36
- $wId = $order->getStore()->getWebsiteId();
37
 
38
- //definition du groupe du client
39
- $customer = Mage::getModel('customer/customer')->load($cId);
40
- $gId = $customer->getGroupId();
41
 
42
  //definition du sponsor de premier niveau
43
  $sponsorId = (int)$customer->getSponsor();
44
  $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
45
  $special_rate = (int)$sponsor->getData('special_rate');
46
 
47
- //variable de points
48
- $tCatalogFidelityPoints=0;
49
- $tCatalogSponsorPoints=0;
50
- $tCartFidelityPoints=0;
51
- $tCartSponsorPoints=0;
52
-
53
- //calcul des points catalogue et mise à jour de lacommande pour chaque ligne
54
- foreach ($order->getAllItems() as $item)
55
- {
56
- //Add points only if product have no parent
57
- if (!$item->getParentItemId())
58
- {
59
- $date = $item->getData('updated_at');
60
- $pId = $item->getData('product_id');
61
- $qte = $item->getData('qty_ordered');
62
- $data = $item->getData();
63
-
64
- if ($moduleFidelity==1 || $moduleAccumulated==1)
65
- {
66
- //récupération et affectation des points catalog pour chaque article commandé
67
- $catalogFidelityPoints = (float)$this->getRulePoints($date, $wId, $gId, $pId,'fidelity');
68
- //multiplication des points par la quantité
69
- $catalogFidelityPoints = $catalogFidelityPoints*$qte;
70
- //ajout des points aux items de commande
71
- $data['catalog_fidelity_points'] = $catalogFidelityPoints;
72
-
73
- //calcul du total de points catalogue
74
- $tCatalogFidelityPoints = $tCatalogFidelityPoints+$catalogFidelityPoints;
75
-
76
- //calcul du total de points panier
77
- $tCartFidelityPoints = $tCartFidelityPoints+(float)$item->getCartFidelityPoints();
78
- }
79
-
80
- if (($moduleAccumulated==1 || $moduleSponsor==1) && $special_rate==0)
81
- {
82
- //récupération et affectation des points catalog pour chaque article commandé
83
- $catalogSponsorPoints = $this->getRulePoints($date, $wId, $gId, $pId, 'sponsor');
84
-
85
- //multiplication des points par la quantité
86
- $catalogSponsorPoints = $catalogSponsorPoints*$qte;
87
-
88
- //ajout des points aux items de commande
89
- $data['catalog_sponsor_points'] = $catalogSponsorPoints;
90
- //calcul du total de points catalogue
91
- $tCatalogSponsorPoints = $tCatalogSponsorPoints+$catalogSponsorPoints;
92
-
93
- //calcul du total de points panier
94
- $tCartSponsorPoints = $tCartSponsorPoints+$item->getCartSponsorPoints();
95
- }
96
- //si un taux spécial est défini pour le parrain direct
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  elseif (($moduleAccumulated==1 || $moduleSponsor==1) && $special_rate!=0)
98
  {
99
  //Redéfinition du taux à appliquer dans la commande
@@ -105,464 +138,476 @@ class Auguria_Sponsorship_Model_Observer
105
 
106
  $item->setData($data);
107
  $item->save();
108
- }
109
- }
110
-
111
- $order->save();
112
-
113
- //Ajout du total des points fidelite
114
- if ($tCatalogFidelityPoints != 0 || $tCartFidelityPoints != 0 ) {
115
- $this->_addFidelityPoints($customer, $tCatalogFidelityPoints+$tCartFidelityPoints, 'order', $orderId, $orderDate);
116
- $customer->save();
117
- }
118
-
119
- //Ajout du total des points de parrainage si le parrain n'a pas de taux spécial
120
- if (($tCatalogSponsorPoints != 0 || $tCartSponsorPoints != 0) && $special_rate==0) {
121
- $this->_addSponsorPoints($sponsor, $customer, $tCatalogSponsorPoints+$tCartSponsorPoints, 'order', $orderId, $orderDate);
122
- }
123
- //Ajout des points à partir du taux spécial au parrain direct uniquement
124
- elseif ($special_rate!=null && ($moduleSponsor==1 || $moduleAccumulated==1)) {
125
- $this->_addSponsorSpecialPoints($sponsor, $customer, $specialratepoints, 'order', $orderId, $orderDate);
126
- }
127
  }
128
- return $this;
129
- }
130
- catch (Exception $e) {
131
- Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while saving points : %s",$e->getMessage()));
132
- }
133
- }
134
-
135
- /**
136
- * Get catalog fidelity or sponsor points depends on $type
137
- * @param date $date
138
- * @param integer $wId
139
- * @param integer $gId
140
- * @param integer $pId
141
- * @param String $type
142
- */
143
- public function getRulePoints($date, $wId, $gId, $pId, $type)
144
- {
145
- $resource = Mage::getSingleton('core/resource');
146
  $read= $resource->getConnection('core_read');
147
  $userTable = $resource->getTableName('auguria_sponsorship/catalog'.$type.'point');
148
  $select = $read->select()
149
- ->from($resource->getTableName('auguria_sponsorship/catalog'.$type.'point'), 'rule_point')
150
- ->where('rule_date=?', $this->formatDate($date))
151
- ->where('website_id=?', $wId)
152
- ->where('customer_group_id=?', $gId)
153
- ->where('product_id=?', $pId);
154
- return $read->fetchOne($select);
155
- }
156
-
157
- public function formatDate ($date)
158
- {
159
- $date = strtotime($date);
160
- return date('Y-m-d', $date);
161
- }
162
-
163
- /**
164
- * Add fidelity points to customer
165
- * @param Mage_Customer_Model_Customer $customer
166
- * @param float $tFPoints
167
- * @param String $recordType
168
- * @param Int $recordId
169
- * @param Datetime $datetime
170
- */
171
- protected function _addFidelityPoints($customer, $fidelityPoints, $recordType='order', $recordId=0, $datetime=null)
172
- {
173
- $customer = Mage::helper('auguria_sponsorship')->addFidelityPoints($customer, $fidelityPoints);
174
- //enregistrement dans les logs
175
- $data = array(
176
- 'customer_id' => $customer->getId(),
177
- 'record_id' => $recordId,
178
- 'record_type' => $recordType,
179
- 'datetime' => $datetime,
180
- 'points' => $fidelityPoints
181
- );
182
  $this->_addAuguriaSponsorshipLog($data);
183
- }
184
-
185
- /**
186
- * Add sponsor points to sponsors
187
- * @param Mage_Customer_Model_Customer $sponsor
188
- * @param Mage_Customer_Model_Customer $godson
189
- * @param float $SPoints
190
- * @param String $recordType
191
- * @param Int $recordId
192
- * @param Datetime $datetime
193
- */
194
- protected function _addSponsorPoints($sponsor, $godson, $SPoints, $recordType='order', $recordId=0, $datetime=null)
195
- {
196
- $ratio = Mage::helper('auguria_sponsorship/config')->getSponsorPercent();
197
- $maxLevel = Mage::helper('auguria_sponsorship/config')->getSponsorLevels();
198
- $sponsorId = -1;
199
- $godsonId = $godson->getId();
200
-
201
- //Ajout des points tant que le niveau maximum n'est pas atteint et qu'un parrain est défini
202
- for ($level = 0; $level<$maxLevel AND $sponsorId!=0 AND round($SPoints,4)>0; $level++)
203
- {
204
- //définition du parrain
205
- if ($sponsorId>0) {
206
- $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
207
- }
208
- else {
209
- $sponsorId = $sponsor->getId();
210
- }
211
- $special_rate = (int)$sponsor->getData('special_rate');
212
-
213
- //si parrain a un taux special : on met fin à la boucle
214
- if ($special_rate != 0) {
215
- $SPoints = 0;//mise à 0 des points de parrainage pour arrêter la boucle
216
- $sponsorId = 0;
217
- }
218
- else {
219
- $sponsor = Mage::helper('auguria_sponsorship')->addSponsorshipPoints($sponsor, $SPoints);
220
  $sponsor->save();
221
 
222
- //Save operation in logs table
223
- $data = array(
224
- 'godson_id' => $godsonId,
225
- 'sponsor_id' => $sponsorId,
226
- 'record_id' => $recordId,
227
- 'record_type' => $recordType,
228
- 'datetime' => $datetime,
229
- 'points' => $SPoints
230
- );
231
- $this->_addAuguriaSponsorshipLog($data);
232
-
233
- //Send notification
234
- $this->_sendSponsorNotification($sponsor, $godsonId, $SPoints, Mage::helper('auguria_sponsorship')->getSponsorshipPoints($sponsor));
235
-
236
- //incrémentation des points à ajouter
237
- $SPoints = ($SPoints*$ratio)/100;
238
- //le parrain devient le filleul
239
- $godsonId = $sponsorId;
240
- //définition du parrain du parrain
241
- $sponsorId = (int)$sponsor->getSponsor();
242
- }
243
- }
244
- }
245
-
246
- /**
247
- * Link customer with his sponsor on customer_save_before
248
- * @param Array $observer
249
- */
250
- public function setSponsorOnRegister($observer)
251
- {
252
- try
253
- {
254
- $customer = $observer->getCustomer();
255
- //if no get id : it's a creation
256
- if (!$customer->getId())
257
- {
258
- $this->_setSponsor($customer);
259
- }
260
- }
261
- catch (Exception $e)
262
- {
263
- Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while linking sponsor : %s",$e->getMessage()));
264
- }
265
- }
266
-
267
- /**
268
- * Link customer with his sponsor and update sponsor's sponsorship points validity
269
- * @param Mage_Customer_Model_Customer $customer
270
- */
271
- protected function _setSponsor($customer)
272
- {
273
- $sponsorId = (int)Mage::helper("auguria_sponsorship")->searchSponsorId($customer->getEmail());
274
- if ($sponsorId != 0)
275
- {
276
- //link
277
- $customer->setData('sponsor',$sponsorId);
278
- $cookie = Mage::getModel('core/cookie');
279
- //remove cookie
280
- if ($cookie->get('sponsorship_id'))
281
- {
282
- $cookie->delete('sponsorship_id');
283
- $cookie->delete('sponsorship_email');
284
- $cookie->delete('sponsorship_firstname');
285
- $cookie->delete('sponsorship_lastname');
286
- }
287
-
288
- //update sponsor points validity
289
- $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
290
- $validityType = '';
291
- if (Mage::helper('auguria_sponsorship/config')->isAccumulatedEnabled()) {
292
- $validityType = 'points_validity';
293
- }
294
- else {
295
- $validityType = 'sponsor_points_validity';
296
- }
297
- $validity = Mage::helper('auguria_sponsorship')->getPointsValidity('sponsorship');
298
- if(isset($validity['sponsorship'])) {
299
- $sponsor->setData($validityType,$validity['sponsorship']);
300
- $sponsor->save();
301
- }
302
- }
303
- }
304
-
305
- /**
306
- * Link customer with his sponsor on checkout_submit_all_after
307
- * @param Array $observer
308
- */
309
- public function setSponsorOnOrder($observer)
310
- {
311
- //checkout_type_onepage_save_order_after
312
- $quote = $observer['quote'];
313
- $order = $observer['order'];
314
-
315
- if ($order) {
316
- //if it's a new customer or if we allow to sponsor a registred user
317
  if ($quote->getData('checkout_method') == Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER
318
- || Mage::helper('auguria_sponsorship/config')->isRegistredUsersInvitationAllowed() == 1) {
319
-
320
- $customerId = $order->getCustomerId();
321
- if ($customerId != '')
322
- {
323
- $customer = Mage::getModel("customer/customer")->load($customerId);
324
- //check godchild has no order
325
- //check godchild is not a sponsor
326
- //check godchild has no sponsor
327
- if (!Mage::helper('auguria_sponsorship')->haveOrder($customerId)
328
- && !Mage::helper('auguria_sponsorship')->isASponsor($customerId)
329
- && ((int)$customer->getSponsor()!=0)) {
330
- $this->_setSponsor($customer);
331
- $customer->save();
332
- }
333
- }
334
- }
335
- }
336
- }
337
-
338
- /**
339
- * Add sponsor points for a sponsor with special rate
340
- */
341
- protected function _addSponsorSpecialPoints($sponsor, $godson, $specialratepoints, $recordType='order', $recordId=0, $datetime=null)
342
- {
343
- //recalcul de la commande & maj items de la commande
344
- try {
345
- $sponsor = Mage::helper('auguria_sponsorship')->addSponsorshipPoints($sponsor, $specialratepoints);
346
- $sponsor->save();
347
-
348
- //save operation in logs
349
- $data = array(
350
- 'godson_id' => $godson->getId(),
351
- 'sponsor_id' => $sponsor->getId(),
352
- 'record_id' => $recordId,
353
- 'record_type' => $recordType,
354
- 'datetime' => $datetime,
355
- 'points' => (float)$specialratepoints
356
- );
357
- $this->_addAuguriaSponsorshipLog($data);
358
-
359
- //Send notification to sponsor
360
- $this->_sendSponsorNotification($sponsor, $godsonId, $pointsToAdd, $tSPoints);
361
- }
362
- catch (Exception $e) {
363
- Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while saving special points : %s",$e->getMessage()));
364
- }
365
-
366
- }
367
-
368
- /**
369
- * Create cookie to link customer with his sponsor
370
- * @param Array() $observer
371
- */
372
- public function affiliate($observer)
373
- {
374
- $controller = $observer['controller_action'];
375
- /*
376
- * Transmission de l'id du parrain + nom + prenom dans l'url
377
- * base url / module / controller / action / parametres
378
- * http://www.inkonso.com/cms/index/index/sponsor_id/x/nom/xxx/prenom/xxx/email/xxx
379
- */
380
- $sponsorId = $controller->getRequest()->getParam('sponsor_id');
381
- if ($sponsorId!='')
382
- {
383
- $nom = $controller->getRequest()->getParam('nom');
384
- $prenom = $controller->getRequest()->getParam('prenom');
385
- $email = $controller->getRequest()->getParam('email');
386
-
387
- //stockage des variables dans la session
388
- $session = Mage::getSingleton('core/session');
389
- $session->setData('sponsor_id',$sponsorId);
390
- $session->setData('firstname',$prenom);
391
- $session->setData('lastname',$nom);
392
- $session->setData('email',$email);
393
-
394
- //stockage de l'id du parrain dans un cookie
395
- $sponsorInvitationValidity = Mage::helper('auguria_sponsorship/config')->getInvitationValidity();
396
- $period =3600*24*$sponsorInvitationValidity;
397
-
398
- $cookie = Mage::getModel('core/cookie');
399
- $cookie->set('sponsorship_id', $sponsorId, $period);
400
- $cookie->set('sponsorship_firstname', $prenom, $period);
401
- $cookie->set('sponsorship_lastname', $nom, $period);
402
- $cookie->set('sponsorship_email', $email, $period);
403
-
404
- $controller->getRequest()->setParam('sponsor_id', null);
405
- }
406
- }
407
-
408
- /**
409
- *
410
- * Add fidelity points if customer subscribe to newletter while registration
411
- * @param Varien_Event_Observer $observer
412
- */
413
- public function addNewsletterPoints($observer)
414
- {
415
- try
416
- {
417
- $newsletterPoints = (int)Mage::helper('auguria_sponsorship/config')->getFidelityNewsletterPoints();
418
- //Check if we must add points
419
- if ($newsletterPoints > 0)
420
- {
421
- //Check if it's an account creation
422
- $customer = $observer->getCustomer();
423
- if (!$customer->getId())
424
- {
425
- //Check if he is subscribing to the newsletter
426
- if ($customer->getIsSubscribed() == 1)
427
- {
428
- $this->_addFidelityPoints($customer, $newsletterPoints, 'newsletter');
429
- }
430
- }
431
- }
432
- }
433
- catch (Exception $e)
434
- {
435
- Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while adding news letter points : %s",$e->getMessage()));
436
- }
437
- }
438
-
439
- /**
440
- *
441
- * Add fidelity points to customer and sponsorship points to sponsor on first order
442
- * @param Varien_Event_Observer $observer
443
- */
444
- public function addFirstOrderPoints($observer)
445
- {
446
- try
447
- {
448
- $godsonFirstOrderPoints = Mage::helper('auguria_sponsorship/config')->getFidelityFirstOrderPoints();
449
- $sponsorFirstOrderPoints = Mage::helper('auguria_sponsorship/config')->getGodsonFirstOrderPoints();
450
-
451
- //Check if we have to add points on first order
452
- if ($godsonFirstOrderPoints>0 || $sponsorFirstOrderPoints>0)
453
- {
454
- $invoice = $observer->getInvoice();
455
- $customerId = $invoice->getCustomerId();
456
-
457
- //Get customer paid invoices
458
- $invoices = Mage::getResourceModel('sales/order_invoice_collection');
459
- $invoices->getSelect()->join(array('o'=>$invoices->getTable('sales/order')), 'main_table.order_id = o.entity_id','o.customer_id');
460
-
461
- $invoices->addAttributeToSelect('state')
462
- ->addAttributeToFilter('o.customer_id', $customerId)
463
- ->addAttributeToFilter('main_table.state', Mage_Sales_Model_Order_Invoice::STATE_PAID);
464
-
465
- if ($invoices->count() == 0)
466
- {
467
- $customer = Mage::getModel('customer/customer')->load($customerId);
468
-
469
- //Add fidelity points to customer
470
- if ($godsonFirstOrderPoints >0)
471
- {
472
- $this->_addFidelityPoints($customer, $godsonFirstOrderPoints, 'first', $invoice->getOrderId());
473
- $customer->save();
474
- }
475
-
476
- //Add sponsorship points
477
- $sponsorId = $customer->getSponsor();
478
- if (isset($sponsorId) && $sponsorId>0 && $sponsorFirstOrderPoints>0)
479
- {
480
- $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
481
- $this->_addSponsorPoints($sponsor, $customer, $sponsorFirstOrderPoints, 'first', $invoice->getOrderId());
482
-
483
- }
484
- }
485
- }
486
- }
487
- catch (Exception $e)
488
- {
489
- Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while adding first order points :".$e->getMessage()));
490
- }
491
- }
492
-
493
- /**
494
- * Update sponsorship tab customer fields from adminhtml customer form on customer_save_before
495
- * @param Varien_Event_Observer $observer
496
- */
497
- public function adminUpdateSponsorshipFields($observer)
498
- {
499
- //@TODO check each parameters
500
- $form = Mage::app()->getRequest()->getParam('sponsorship');
501
- if (is_array($form) && !empty($form)) {
502
- foreach ($form as $key=>$value) {
503
- $observer->getCustomer()->setData($key, $value);
504
- }
505
- }
506
- return $observer;
507
- }
508
-
509
- /**
510
- * Insert log if points are modified on customer_save_after
511
- * @param Varien_Event_Observer $observer
512
- */
513
- public function adminUpdatePoints($observer)
514
- {
515
- if (Mage::app()->getRequest()->getControllerName()=='customer') {
516
- $customer = $observer->getCustomer();
517
- if ($customer->hasDataChanges()) {
518
- $keys = Array('accumulated_points','sponsor_points','fidelity_points');
519
- foreach ($keys as $key) {
520
- if ($customer->dataHasChangedFor($key)) {
521
- $points = (float)$customer->getData($key) - (float)$customer->getOrigData($key);
522
- $data = Array('points'=>$points,
523
- 'customer_id'=>$customer->getId(),
524
- 'record_type'=>'admin');
525
- $this->_addAuguriaSponsorshipLog($data);
526
- }
527
- }
528
- }
529
- }
530
- }
531
 
532
  /**
533
- * Update sponsorship fields from frontend customer form on customer_save_before
534
- * @param Varien_Event_Observer $observer
535
- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  public function frontUpdateSponsorshipFields($observer)
537
  {
538
  $iban = Mage::app()->getRequest()->getParam('iban');
 
539
  $siret = Mage::app()->getRequest()->getParam('siret');
540
  $customer = $observer->getCustomer();
541
  /*Edit action*/
542
  if ($customer->getId()) {
543
  if (isset($iban)) {
544
- $customerIban = str_replace(CHR(32),"",$iban);
545
- $customerIban = str_replace("-","",$customerIban);
546
  if (Zend_Validate::is( trim($iban) , 'NotEmpty')) {
547
- if (!Zend_Validate::is( trim($iban) , 'Iban')) {
548
- Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid IBAN code "%s"', $iban));
549
- }
550
  }
551
- $customer->setData('iban', $customerIban);
552
- }
553
- if (isset($siret)) {
554
- $customerSiret = str_replace(CHR(32),"",$siret);
555
- $customerSiret = str_replace("-","",$customerSiret);
556
- /*desactivated for internationalization
557
- if (!Mage::helper('auguria_sponsorship')->isSiret(trim($siret))) {
558
- Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid SIRET code "%s"', $siret));
 
 
 
 
 
 
 
 
 
 
 
559
  }
560
  */
561
  $customer->setData('siret', $customerSiret);
562
- }
563
- }
564
  /*Create action*/
565
- else {
566
  if ($sponsorId = Mage::helper("auguria_sponsorship")->searchSponsorId($customer->getEmail())) {
567
  $customer->setData('sponsor',$sponsorId);
568
  $cookie = Mage::getSingleton('core/cookie');
@@ -573,7 +618,7 @@ class Auguria_Sponsorship_Model_Observer
573
  $cookie->delete('sponsorship_lastname');
574
  }
575
  }
576
- }
577
  return $observer;
578
  }
579
 
@@ -600,24 +645,24 @@ class Auguria_Sponsorship_Model_Observer
600
 
601
  $postObject = new Varien_Object();
602
  $postObject->setData(Array ("sender_name" => $sender_name,
603
- "sender_email" => $sender_email,
604
- "recipient_firstname" => $sponsor->getFirstname(),
605
- "recipient_lastname" => $sponsor->getLastname(),
606
- "subject" => $subject,
607
- "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName(),
608
- "godchild_firstname" =>$godchild->getFirstname(),
609
- "godchild_lastname" =>$godchild->getLastname(),
610
- "added_points" =>$addedPoints,
611
- "total_points" =>$totalPoints
612
- ));
613
  $mailTemplate->setDesignConfig(array('area' => 'frontend'))
614
- ->setReplyTo($sender_email)
615
- ->sendTransactional(
616
- Mage::helper('auguria_sponsorship/config')->getSponsorshipNotificationTemplate(),
617
- $sender,
618
- $recipient_email,
619
- $sponsor->getFirstname().' '.$sponsor->getLastname(),
620
- array('data' => $postObject));
621
  if (!$mailTemplate->getSentSuccess())
622
  {
623
  Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while sending sponsor notification email."));
@@ -635,86 +680,86 @@ class Auguria_Sponsorship_Model_Observer
635
  $order = $observer['order'];
636
  if ($order) {
637
  if ((float)$order->getAuguriaSponsorshipDiscountAmount()<0) {
638
- $customerId = $order->getCustomerId();
639
- if ($customerId != '')
640
- {
641
- $pointsToCash = Mage::helper('auguria_sponsorship/config')->getPointsToCash();
642
- $orderAccumulated = 0;
643
- $orderFidelity = 0;
644
- $orderSponsor = 0;
645
- if (isset($pointsToCash['accumulated']) && (float)$pointsToCash['accumulated']>0) {
646
- $orderAccumulated = (float)$order->getAuguriaSponsorshipAccumulatedPointsUsed()/(float)$pointsToCash['accumulated'];
647
- }
648
- if (isset($pointsToCash['fidelity']) && (float)$pointsToCash['fidelity']>0) {
649
- $orderFidelity = (float)$order->getAuguriaSponsorshipFidelityPointsUsed()/(float)$pointsToCash['fidelity'];
650
- }
651
- if (isset($pointsToCash['sponsorship']) && (float)$pointsToCash['sponsorship']>0) {
652
- $orderSponsor = (float)$order->getAuguriaSponsorshipSponsorPointsUsed()/(float)$pointsToCash['sponsorship'];
653
- }
654
- $type = Array();
655
-
656
- if ((float)$orderAccumulated > 0
657
- ||(float)$orderSponsor > 0
658
- ||(float)$orderFidelity > 0) {
659
- $customer = Mage::getModel("customer/customer")->load($customerId);
660
- $usedPoints = 0;
661
- if ((float)$orderAccumulated > 0) {
662
- $points = (float)$customer->getAccumulatedPoints();
663
- $usedPoints += (float)$orderAccumulated;
664
- $points = $points - $usedPoints;
665
- $points = max(0,$points);
666
- $customer->setAccumulatedPoints($points);
667
- $type['accumulated'] = $usedPoints;
668
- }
669
- else {
670
- if ((float)$orderSponsor > 0) {
671
- $points = (float)$customer->getSponsorPoints();
672
- $usedPoints += (float)$orderSponsor;
673
- $points = $points - $usedPoints;
674
- $points = max(0,$points);
675
- $customer->setSponsorPoints($points);
676
- $type['sponsor'] = $usedPoints;
677
- }
678
- if ((float)$orderFidelity > 0) {
679
- $points = (float)$customer->getFidelityPoints();
680
- $usedPoints += (float)$orderFidelity;
681
- $points = $points - $usedPoints;
682
- $points = max(0,$points);
683
- $customer->setFidelityPoints($points);
684
- $type['fidelity'] = $usedPoints;
685
- }
686
- }
687
- $customer->save();
688
-
689
- if ($usedPoints>0) {
690
- $data = Array('points'=>-$usedPoints,
691
- 'customer_id'=>$customerId,
692
- 'record_type'=>'cart',
693
- 'record_id'=>$order->getId(),
694
- 'datetime'=>$order->getUpdatedAt());
695
- $this->_addAuguriaSponsorshipLog($data);
696
-
697
- if (count($type)>0) {
698
- foreach($type as $key=>$points) {
699
- $echange = Mage::getModel('auguria_sponsorship/change');
700
- $mode = Mage::helper('auguria_sponsorship/config')->getModuleMode();
701
- $type = Mage::helper('auguria_sponsorship/config')->getPointsTypes($mode);
702
  $row = array(
703
- 'customer_id' => $customerId,
704
- 'type' => 'cart',
705
- 'module' => $key,
706
- 'statut' => 'waiting',
707
- 'datetime' => Mage::getModel('core/date')->gmtDate(),
708
- 'points' => $points,
709
- 'value' => $order->getBaseAuguriaSponsorshipDiscountAmount()
710
  );
711
  $echange->setData($row);
712
  $echange->save();
713
- }
714
- }
715
- }
716
- }
717
- }
718
  }
719
  }
720
  }
@@ -741,13 +786,13 @@ class Auguria_Sponsorship_Model_Observer
741
  /**
742
  * Add Auguria_Sponsorship points in quote according to defined rules on salesrule_validator_process event
743
  * @param array(
744
- 'rule' => $rule,
745
- 'item' => $item,
746
- 'address' => $address,
747
- 'quote' => $quote,
748
- 'qty' => $qty,
749
- 'result' => $result,
750
- ) $observer
751
  */
752
  public function validatorPointsCalculationProcess($observer)
753
  {
@@ -758,75 +803,75 @@ class Auguria_Sponsorship_Model_Observer
758
  $qty = $observer['qty'];
759
 
760
  $rulePercent = min(100, $rule->getDiscountAmount());
761
- $price = $item->getDiscountCalculationPrice();
762
- $baseItemPrice = ($price !== null) ? $item->getBaseDiscountCalculationPrice() : $item->getBaseCalculationPrice();
763
-
764
- $cartFidelityPoints = 0;
765
- $cartSponsorPoints = 0;
766
-
767
- switch ($rule->getSimpleAction()) {
768
- case 'fidelity_points_by_fixed':
769
- if ($step = $rule->getDiscountStep()) {
770
- $qty = floor($qty/$step)*$step;
771
- }
772
- $cartFidelityPoints = $qty*$rule->getDiscountAmount();
773
- break;
774
-
775
- case 'fidelity_points_by_percent':
776
- if ($step = $rule->getDiscountStep()) {
777
- $qty = floor($qty/$step)*$step;
778
- }
779
- $cartFidelityPoints = ($qty*$baseItemPrice - $item->getBaseDiscountAmount()) * $rulePercent/100;
780
- break;
781
-
782
- case 'fidelity_points_cart_fixed':
783
- /** @TODO : prevent applying whole cart discount for every shipping order, but only for first order */
784
- $cartRules = $address->getCartFixedRules();
785
- if (!isset($cartRules[$rule->getId()])) {
786
- $cartRules[$rule->getId()] = $rule->getDiscountAmount();
787
- }
788
- if ($cartRules[$rule->getId()] > 0) {
789
- $cartFidelityPoints = $rule->getDiscountAmount();
790
- }
791
- $address->setCartFixedRules($cartRules);
792
- break;
793
- //sponsor
794
- case 'sponsor_points_by_fixed':
795
- if ($step = $rule->getDiscountStep()) {
796
- $qty = floor($qty/$step)*$step;
797
- }
798
- $cartSponsorPoints = $qty*$rule->getDiscountAmount();
799
- break;
800
-
801
- case 'sponsor_points_by_percent':
802
- if ($step = $rule->getDiscountStep()) {
803
- $qty = floor($qty/$step)*$step;
804
- }
805
- $cartSponsorPoints = ($qty*$baseItemPrice - $item->getBaseDiscountAmount()) * $rulePercent/100;
806
- break;
807
-
808
- case 'sponsor_points_cart_fixed':
809
- /** @TODO : prevent applying whole cart discount for every shipping order, but only for first order */
810
- $cartRules = $address->getCartFixedRules();
811
- if (!isset($cartRules[$rule->getId()])) {
812
- $cartRules[$rule->getId()] = $rule->getDiscountAmount();
813
- }
814
- if ($cartRules[$rule->getId()] > 0) {
815
- $cartSponsorPoints = $rule->getDiscountAmount();
816
- }
817
- $address->setCartFixedRules($cartRules);
818
- break;
819
- }
820
- $result->setData('cart_fidelity_points',$cartFidelityPoints);
821
- $result->setData('cart_sponsor_points',$cartSponsorPoints);
822
-
823
- $cartFidelityPoints = max((float)$item->getCartFidelityPoints(), (float)$cartFidelityPoints);
824
- $cartSponsorPoints = max((float)$item->getCartSponsorPoints(), (float)$cartSponsorPoints);
825
-
826
- $item->setCartFidelityPoints($cartFidelityPoints);
827
- $item->setCartSponsorPoints($cartSponsorPoints);
828
-
829
- return $this;
830
  }
831
 
832
  /**
@@ -838,8 +883,8 @@ class Auguria_Sponsorship_Model_Observer
838
  $creditmemo = $observer['creditmemo'];
839
  //if it is a credit memo creation
840
  if ((int)$creditmemo->getId()==0
841
- && (Mage::helper('auguria_sponsorship/config')->cancelFidelityEarnedPointsOnCreditMemo()
842
- || Mage::helper('auguria_sponsorship/config')->cancelSponsorshipEarnedPointsOnCreditMemo())
843
  ) {
844
  $order = $creditmemo->getOrder();
845
 
@@ -890,10 +935,10 @@ class Auguria_Sponsorship_Model_Observer
890
  Mage::helper('auguria_sponsorship')->setFidelityPoints($customer, $points);
891
  $customer->save();
892
  $data = array(
893
- 'customer_id' => $order->getCustomerId(),
894
- 'record_id' => $order->getId(),
895
- 'record_type' => 'order',
896
- 'points' => -$backFidelityPoints
897
  );
898
  $this->_addAuguriaSponsorshipLog($data);
899
  }
@@ -902,8 +947,8 @@ class Auguria_Sponsorship_Model_Observer
902
  //remove sponsorship points according to logs and applying ratio
903
  if (Mage::helper('auguria_sponsorship/config')->cancelSponsorshipEarnedPointsOnCreditMemo()){
904
  $collection = Mage::getResourceModel('auguria_sponsorship/log_collection')
905
- ->addFieldToFilter('record_type', 'order')
906
- ->addFieldToFilter('record_id', $order->getId());
907
  if ($collection->count()>0){
908
  foreach ($collection as $log) {
909
  $points = 0;
@@ -918,11 +963,11 @@ class Auguria_Sponsorship_Model_Observer
918
 
919
  if ($points>0) {
920
  $data = array(
921
- 'godson_id' => $log->getGodsonId(),
922
- 'sponsor_id' => $log->getSponsorId(),
923
- 'record_id' => $order->getId(),
924
- 'record_type' => 'order',
925
- 'points' => -(float)$log->getPoints()*$ratio
926
  );
927
  $this->_addAuguriaSponsorshipLog($data);
928
  }
@@ -942,7 +987,7 @@ class Auguria_Sponsorship_Model_Observer
942
  $order = $observer['order'];
943
  //Check status passed from any to canceled
944
  if ($order->getStatus()=='canceled'
945
- && $order->getOrigData('status')!='canceled') {
946
  $this->_cancelUsedPoints($order);
947
  }
948
  }
@@ -988,10 +1033,10 @@ class Auguria_Sponsorship_Model_Observer
988
  if ($toAdd>0) {
989
  $customer->save();
990
  $data = array(
991
- 'customer_id' => $customer->getId(),
992
- 'record_id' => $order->getId(),
993
- 'record_type' => 'cart',
994
- 'points' => $toAdd
995
  );
996
  $this->_addAuguriaSponsorshipLog($data);
997
  }
@@ -1004,102 +1049,102 @@ class Auguria_Sponsorship_Model_Observer
1004
  public function salesRulesAddAction($observer)
1005
  {
1006
  $field = $observer->getForm()->getElement('simple_action');
1007
- $options = $field->getValues();
1008
- $customOptions = Array(
1009
- Array('value'=>'fidelity_points_by_percent','label'=>Mage::helper('auguria_sponsorship')->__('Fidelity points by percentage of the original price')),
1010
- Array('value'=>'fidelity_points_by_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Fidelity points by fixed amount')),
1011
- Array('value'=>'fidelity_points_cart_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Fidelity points by fixed amount for whole cart')),
1012
- Array('value'=>'sponsor_points_by_percent','label'=>Mage::helper('auguria_sponsorship')->__('Sponsorship points by percentage of the original price')),
1013
- Array('value'=>'sponsor_points_by_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Sponsorship points by fixed amount')),
1014
- Array('value'=>'sponsor_points_cart_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Sponsorship points by fixed amount for whole cart'))
1015
- );
1016
- $allOptions = array_merge($options, $customOptions);
1017
- $field->setValues($allOptions);
1018
  }
1019
-
1020
  /**
1021
  * Update paypal cart
1022
- *
1023
  * @event paypal_prepare_line_items
1024
  * @param Varien_Event_Observer $observer
1025
  */
1026
- public function updatePaypal($observer)
1027
- {
1028
- //récupération de la structure passée en paramètre par Paypal
1029
- $event = $observer->getEvent();
1030
- //récupération du panier Paypal
1031
- $panierPaypal = $event->getPaypalCart();
1032
- if ($panierPaypal)
1033
- {
1034
- //récupération de l'objet nécessaire pour les ventes
1035
- $entity = $panierPaypal->getSalesEntity();
1036
- if ($entity)
1037
- {
1038
- //tentative de récupération du montant Auguria
1039
- $douRemisePointsFidelite = $entity->getAuguriaSponsorshipDiscountAmount();
1040
- //si montant trouvé, on met à jour le total
1041
- if ($douRemisePointsFidelite)
1042
  $panierPaypal->updateTotal(Mage_Paypal_Model_Cart::TOTAL_DISCOUNT, abs($douRemisePointsFidelite));
1043
- }
1044
- }
1045
- }
1046
-
1047
- /**
1048
- * Refill point when payment is canceled
1049
- * @event sales_order_payment_cancel
1050
- * @param Varien_Event_Observer $observer
1051
- */
1052
  public function paymentCanceled($observer)
1053
- {
1054
- //récupération de la structure passée en paramètre par Paypal
1055
- $event = $observer->getEvent();
1056
- //récupération de la commande associée
1057
- $order = $event->getPayment()->getOrder();
1058
- //action sur le compte fidélité (code dérivé de la fonction _cancelUsedPoints)
1059
-
1060
- $customerId = $order->getCustomerId();
1061
- $customer = Mage::getModel('customer/customer')->load($customerId);
1062
-
1063
- $pointsToCash = Mage::helper('auguria_sponsorship/config')->getPointsToCash();
1064
-
1065
- $usedPoints = array();
1066
- $usedPoints['accumulated'] = $order->getAuguriaSponsorshipAccumulatedPointsUsed();
1067
- $usedPoints['sponsorship'] = $order->getAuguriaSponsorshipSponsorPointsUsed();
1068
- $usedPoints['fidelity'] = $order->getAuguriaSponsorshipFidelityPointsUsed();
1069
- $toAdd = 0;
1070
- //Add used points
1071
- foreach ($usedPoints as $type=>$points) {
1072
- if ($points>0) {
1073
- //conversion en nombre de points
1074
- $douTaux = 1;
1075
- if (isset($pointsToCash[$type]) && (float)$pointsToCash[$type]>0){
1076
- $douTaux = (float)$pointsToCash[$type];
1077
- }
1078
- //correction
1079
- $haveUsedPoints = true;
1080
- if ($type=='accumulated') {
1081
- $toAdd += $points/$douTaux;
1082
- $customer->setAccumulatedPoints($customer->getAccumulatedPoints()+$points/$douTaux);
1083
- }
1084
- elseif ($type=='sponsorship') {
1085
- $toAdd += $points/$douTaux;
1086
- $customer->setSponsorPoints($customer->getSponsorPoints()+$points/$douTaux);
1087
- }
1088
- elseif ($type=='fidelity') {
1089
- $toAdd += $points/$douTaux;
1090
- $customer->setFidelityPoints($customer->getFidelityPoints()+$points/$douTaux);
1091
- }
1092
- }
1093
- }
1094
- if ($toAdd>0) {
1095
- $customer->save();
1096
- $data = array(
1097
- 'customer_id' => $customer->getId(),
1098
- 'record_id' => $order->getId(),
1099
- 'record_type' => 'cart',
1100
- 'points' => $toAdd
1101
- );
1102
- $this->_addAuguriaSponsorshipLog($data);
1103
- }
1104
- }
1105
  }
5
  * @author Auguria
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
  */
8
+
9
  class Auguria_Sponsorship_Model_Observer
10
  {
11
+
12
+ /**
13
+ * @param Varien_Event_Observer $observer
14
+ */
15
+ public function setCouponCode(Varien_Event_Observer $observer){
16
+ if ($quote = $observer['quote']) {
17
+ if($coupon_code = $quote->getData('coupon_code')){
18
+ $change = Mage::getModel('auguria_sponsorship/change')->getCollection()->addAttributeToFilter('coupon_code', $coupon_code);
19
+ if($coupon = $change->getFirstItem()){
20
+ $coupon->setData('statut', 'solved');
21
+ $coupon->save();
22
+ }
23
+ }
24
+ }
25
+ }
26
+
27
  /**
28
  * Calcul total order points on sales_order_payment_pay event
29
  * @param Varien_Event_Observer $observer
30
  */
31
+ public function calcPoints($observer)
32
+ {
33
+ /**
34
+ * @TODO : retrancher du total les points offerts
35
+ */
36
+ try {
37
+ //modules actifs
38
+ $moduleFidelity = Mage::helper('auguria_sponsorship/config')->isFidelityEnabled();
39
+ $moduleSponsor = Mage::helper('auguria_sponsorship/config')->isSponsorshipEnabled();
40
+ $moduleAccumulated = Mage::helper('auguria_sponsorship/config')->isAccumulatedEnabled();
41
 
42
  if ($moduleFidelity==1||$moduleSponsor==1||$moduleAccumulated==1)
43
  {
44
+ //récupération de la commande et des articles
45
+ $order = $observer->getInvoice()->getOrder();
46
+ $orderDate = $order->getUpdatedAt();
47
+ $orderId = $order->getEntityId();
48
 
49
+ //définition du client
50
+ $cId = $order->getCustomerId();
51
 
52
+ //definition du websiteid
53
+ $wId = $order->getStore()->getWebsiteId();
54
 
55
+ //definition du groupe du client
56
+ $customer = Mage::getModel('customer/customer')->load($cId);
57
+ $gId = $customer->getGroupId();
58
 
59
  //definition du sponsor de premier niveau
60
  $sponsorId = (int)$customer->getSponsor();
61
  $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
62
  $special_rate = (int)$sponsor->getData('special_rate');
63
 
64
+ //variable de points
65
+ $tCatalogFidelityPoints=0;
66
+ $tCatalogSponsorPoints=0;
67
+ $tCartFidelityPoints=0;
68
+ $tCartSponsorPoints=0;
69
+
70
+ //calcul des points catalogue et mise à jour de la commande pour chaque ligne
71
+ foreach ($order->getAllItems() as $item)
72
+ {
73
+
74
+ /* Bug Correction for dynamic bundle - october 2013 */
75
+ $isDynamicBundle = false;
76
+ if($parentItemId = $item->getParentItemId())
77
+ {
78
+ $parentItem = $item->getParentItem();
79
+ $parentProduct = $parentItem->getProduct();
80
+ $isBundle = ($parentProduct->getData('type_id') == "bundle") ? true : false;
81
+ $isDynamicPrice = (!$parentProduct->getData('price_type')) ? true : false;
82
+ // $parentProduct->getData('price_type') -> 0 for dynamic and 1 for static
83
+ $isDynamicBundle = ($isBundle && $isDynamicPrice) ? true : false;
84
+ }
85
+ /* ! Bug Correction */
86
+
87
+ //Add points only if product have no parent
88
+ if (!$parentItemId || $isDynamicBundle)
89
+ {
90
+
91
+ $date = $item->getData('updated_at');
92
+ $pId = $item->getData('product_id');
93
+ $qte = $item->getData('qty_ordered');
94
+ $data = $item->getData();
95
+
96
+ if ($moduleFidelity==1 || $moduleAccumulated==1)
97
+ {
98
+ //récupération et affectation des points catalog pour chaque article commandé
99
+ $catalogFidelityPoints = (float)$this->getRulePoints($date, $wId, $gId, $pId,'fidelity');
100
+ //multiplication des points par la quantité
101
+ $catalogFidelityPoints = $catalogFidelityPoints*$qte;
102
+ //ajout des points aux items de commande
103
+ $data['catalog_fidelity_points'] = $catalogFidelityPoints;
104
+
105
+ //calcul du total de points catalogue
106
+ $tCatalogFidelityPoints = $tCatalogFidelityPoints+$catalogFidelityPoints;
107
+
108
+ //calcul du total de points panier
109
+ $tCartFidelityPoints = $tCartFidelityPoints+(float)$item->getCartFidelityPoints();
110
+
111
+ }
112
+
113
+ if (($moduleAccumulated==1 || $moduleSponsor==1) && $special_rate==0)
114
+ {
115
+ //récupération et affectation des points catalog pour chaque article commandé
116
+ $catalogSponsorPoints = $this->getRulePoints($date, $wId, $gId, $pId, 'sponsor');
117
+
118
+ //multiplication des points par la quantité
119
+ $catalogSponsorPoints = $catalogSponsorPoints*$qte;
120
+
121
+ //ajout des points aux items de commande
122
+ $data['catalog_sponsor_points'] = $catalogSponsorPoints;
123
+ //calcul du total de points catalogue
124
+ $tCatalogSponsorPoints = $tCatalogSponsorPoints+$catalogSponsorPoints;
125
+
126
+ //calcul du total de points panier
127
+ $tCartSponsorPoints = $tCartSponsorPoints+$item->getCartSponsorPoints();
128
+ }
129
+ //si un taux spécial est défini pour le parrain direct
130
  elseif (($moduleAccumulated==1 || $moduleSponsor==1) && $special_rate!=0)
131
  {
132
  //Redéfinition du taux à appliquer dans la commande
138
 
139
  $item->setData($data);
140
  $item->save();
141
+ }
142
+ }
143
+ //exit();
144
+ $order->save();
145
+
146
+ //Ajout du total des points fidelite
147
+ if ($tCatalogFidelityPoints != 0 || $tCartFidelityPoints != 0 ) {
148
+ $this->_addFidelityPoints($customer, $tCatalogFidelityPoints+$tCartFidelityPoints, 'order', $orderId, $orderDate);
149
+ $customer->save();
150
+ }
151
+
152
+ //Ajout du total des points de parrainage si le parrain n'a pas de taux spécial
153
+ if (($tCatalogSponsorPoints != 0 || $tCartSponsorPoints != 0) && $special_rate==0) {
154
+ $this->_addSponsorPoints($sponsor, $customer, $tCatalogSponsorPoints+$tCartSponsorPoints, 'order', $orderId, $orderDate);
155
+ }
156
+ //Ajout des points à partir du taux spécial au parrain direct uniquement
157
+ elseif ($special_rate!=null && ($moduleSponsor==1 || $moduleAccumulated==1)) {
158
+ $this->_addSponsorSpecialPoints($sponsor, $customer, $specialratepoints, 'order', $orderId, $orderDate);
159
+ }
160
  }
161
+ return $this;
162
+ }
163
+ catch (Exception $e) {
164
+ Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while saving points : %s",$e->getMessage()));
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Get catalog fidelity or sponsor points depends on $type
170
+ * @param date $date
171
+ * @param integer $wId
172
+ * @param integer $gId
173
+ * @param integer $pId
174
+ * @param String $type
175
+ */
176
+ public function getRulePoints($date, $wId, $gId, $pId, $type)
177
+ {
178
+ $resource = Mage::getSingleton('core/resource');
179
  $read= $resource->getConnection('core_read');
180
  $userTable = $resource->getTableName('auguria_sponsorship/catalog'.$type.'point');
181
  $select = $read->select()
182
+ ->from($resource->getTableName('auguria_sponsorship/catalog'.$type.'point'), 'rule_point')
183
+ ->where('rule_date=?', $this->formatDate($date))
184
+ ->where('website_id=?', $wId)
185
+ ->where('customer_group_id=?', $gId)
186
+ ->where('product_id=?', $pId);
187
+ return $read->fetchOne($select);
188
+ }
189
+
190
+ public function formatDate ($date)
191
+ {
192
+ $date = strtotime($date);
193
+ return date('Y-m-d', $date);
194
+ }
195
+
196
+ /**
197
+ * Add fidelity points to customer
198
+ * @param Mage_Customer_Model_Customer $customer
199
+ * @param float $tFPoints
200
+ * @param String $recordType
201
+ * @param Int $recordId
202
+ * @param Datetime $datetime
203
+ */
204
+ protected function _addFidelityPoints($customer, $fidelityPoints, $recordType='order', $recordId=0, $datetime=null)
205
+ {
206
+ $customer = Mage::helper('auguria_sponsorship')->addFidelityPoints($customer, $fidelityPoints);
207
+ //enregistrement dans les logs
208
+ $data = array(
209
+ 'customer_id' => $customer->getId(),
210
+ 'record_id' => $recordId,
211
+ 'record_type' => $recordType,
212
+ 'datetime' => $datetime,
213
+ 'points' => $fidelityPoints
214
+ );
215
  $this->_addAuguriaSponsorshipLog($data);
216
+ }
217
+
218
+ /**
219
+ * Add sponsor points to sponsors
220
+ * @param Mage_Customer_Model_Customer $sponsor
221
+ * @param Mage_Customer_Model_Customer $godson
222
+ * @param float $SPoints
223
+ * @param String $recordType
224
+ * @param Int $recordId
225
+ * @param Datetime $datetime
226
+ */
227
+ protected function _addSponsorPoints($sponsor, $godson, $SPoints, $recordType='order', $recordId=0, $datetime=null)
228
+ {
229
+ $ratio = Mage::helper('auguria_sponsorship/config')->getSponsorPercent();
230
+ $maxLevel = Mage::helper('auguria_sponsorship/config')->getSponsorLevels();
231
+ $sponsorId = -1;
232
+ $godsonId = $godson->getId();
233
+
234
+ //Ajout des points tant que le niveau maximum n'est pas atteint et qu'un parrain est défini
235
+ for ($level = 0; $level<$maxLevel AND $sponsorId!=0 AND round($SPoints,4)>0; $level++)
236
+ {
237
+ //définition du parrain
238
+ if ($sponsorId>0) {
239
+ $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
240
+ }
241
+ else {
242
+ $sponsorId = $sponsor->getId();
243
+ }
244
+ $special_rate = (int)$sponsor->getData('special_rate');
245
+
246
+ //si parrain a un taux special : on met fin à la boucle
247
+ if ($special_rate != 0) {
248
+ $SPoints = 0;//mise à 0 des points de parrainage pour arrêter la boucle
249
+ $sponsorId = 0;
250
+ }
251
+ else {
252
+ $sponsor = Mage::helper('auguria_sponsorship')->addSponsorshipPoints($sponsor, $SPoints);
253
  $sponsor->save();
254
 
255
+ //Save operation in logs table
256
+ $data = array(
257
+ 'godson_id' => $godsonId,
258
+ 'sponsor_id' => $sponsorId,
259
+ 'record_id' => $recordId,
260
+ 'record_type' => $recordType,
261
+ 'datetime' => $datetime,
262
+ 'points' => $SPoints
263
+ );
264
+ $this->_addAuguriaSponsorshipLog($data);
265
+
266
+ //Send notification
267
+ $this->_sendSponsorNotification($sponsor, $godsonId, $SPoints, Mage::helper('auguria_sponsorship')->getSponsorshipPoints($sponsor));
268
+
269
+ //incrémentation des points à ajouter
270
+ $SPoints = ($SPoints*$ratio)/100;
271
+ //le parrain devient le filleul
272
+ $godsonId = $sponsorId;
273
+ //définition du parrain du parrain
274
+ $sponsorId = (int)$sponsor->getSponsor();
275
+ }
276
+ }
277
+ }
278
+
279
+ /**
280
+ * Link customer with his sponsor on customer_save_before
281
+ * @param Array $observer
282
+ */
283
+ public function setSponsorOnRegister($observer)
284
+ {
285
+ try
286
+ {
287
+ $customer = $observer->getCustomer();
288
+ //if no get id : it's a creation
289
+ if (!$customer->getId())
290
+ {
291
+ $this->_setSponsor($customer);
292
+ }
293
+ }
294
+ catch (Exception $e)
295
+ {
296
+ Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while linking sponsor : %s",$e->getMessage()));
297
+ }
298
+ }
299
+
300
+ /**
301
+ * Link customer with his sponsor and update sponsor's sponsorship points validity
302
+ * @param Mage_Customer_Model_Customer $customer
303
+ */
304
+ protected function _setSponsor($customer)
305
+ {
306
+ $sponsorId = (int)Mage::helper("auguria_sponsorship")->searchSponsorId($customer->getEmail());
307
+ if ($sponsorId != 0)
308
+ {
309
+ //link
310
+ $customer->setData('sponsor',$sponsorId);
311
+ $cookie = Mage::getModel('core/cookie');
312
+ //remove cookie
313
+ if ($cookie->get('sponsorship_id'))
314
+ {
315
+ $cookie->delete('sponsorship_id');
316
+ $cookie->delete('sponsorship_email');
317
+ $cookie->delete('sponsorship_firstname');
318
+ $cookie->delete('sponsorship_lastname');
319
+ }
320
+
321
+ //update sponsor points validity
322
+ $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
323
+ $validityType = '';
324
+ if (Mage::helper('auguria_sponsorship/config')->isAccumulatedEnabled()) {
325
+ $validityType = 'points_validity';
326
+ }
327
+ else {
328
+ $validityType = 'sponsor_points_validity';
329
+ }
330
+ $validity = Mage::helper('auguria_sponsorship')->getPointsValidity('sponsorship');
331
+ if(isset($validity['sponsorship'])) {
332
+ $sponsor->setData($validityType,$validity['sponsorship']);
333
+ $sponsor->save();
334
+ }
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Link customer with his sponsor on checkout_submit_all_after
340
+ * @param Array $observer
341
+ */
342
+ public function setSponsorOnOrder($observer)
343
+ {
344
+ //checkout_type_onepage_save_order_after
345
+ $quote = $observer['quote'];
346
+ $order = $observer['order'];
347
+
348
+ if ($order) {
349
+ //if it's a new customer or if we allow to sponsor a registred user
350
  if ($quote->getData('checkout_method') == Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER
351
+ || Mage::helper('auguria_sponsorship/config')->isRegistredUsersInvitationAllowed() == 1) {
352
+
353
+ $customerId = $order->getCustomerId();
354
+ if ($customerId != '')
355
+ {
356
+ $customer = Mage::getModel("customer/customer")->load($customerId);
357
+ //check godchild has no order
358
+ //check godchild is not a sponsor
359
+ //check godchild has no sponsor
360
+ if (!Mage::helper('auguria_sponsorship')->haveOrder($customerId)
361
+ && !Mage::helper('auguria_sponsorship')->isASponsor($customerId)
362
+ && ((int)$customer->getSponsor()!=0)) {
363
+ $this->_setSponsor($customer);
364
+ $customer->save();
365
+ }
366
+ }
367
+ }
368
+ }
369
+ }
370
+
371
+ /**
372
+ * Add sponsor points for a sponsor with special rate
373
+ */
374
+ protected function _addSponsorSpecialPoints($sponsor, $godson, $specialratepoints, $recordType='order', $recordId=0, $datetime=null)
375
+ {
376
+ //recalcul de la commande & maj items de la commande
377
+ try {
378
+ $sponsor = Mage::helper('auguria_sponsorship')->addSponsorshipPoints($sponsor, $specialratepoints);
379
+ $sponsor->save();
380
+
381
+ //save operation in logs
382
+ $data = array(
383
+ 'godson_id' => $godson->getId(),
384
+ 'sponsor_id' => $sponsor->getId(),
385
+ 'record_id' => $recordId,
386
+ 'record_type' => $recordType,
387
+ 'datetime' => $datetime,
388
+ 'points' => (float)$specialratepoints
389
+ );
390
+ $this->_addAuguriaSponsorshipLog($data);
391
+
392
+ //Send notification to sponsor
393
+ $this->_sendSponsorNotification($sponsor, $godsonId, $pointsToAdd, $tSPoints);
394
+ }
395
+ catch (Exception $e) {
396
+ Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while saving special points : %s",$e->getMessage()));
397
+ }
398
+
399
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
 
401
  /**
402
+ * Create cookie to link customer with his sponsor
403
+ * @param Array() $observer
404
+ */
405
+ public function affiliate($observer)
406
+ {
407
+ $controller = $observer['controller_action'];
408
+ /*
409
+ * Transmission de l'id du parrain + nom + prenom dans l'url
410
+ * base url / module / controller / action / parametres
411
+ * http://www.inkonso.com/cms/index/index/sponsor_id/x/nom/xxx/prenom/xxx/email/xxx
412
+ */
413
+ $sponsorId = $controller->getRequest()->getParam('sponsor_id');
414
+ if ($sponsorId!='')
415
+ {
416
+ $nom = $controller->getRequest()->getParam('nom');
417
+ $prenom = $controller->getRequest()->getParam('prenom');
418
+ $email = $controller->getRequest()->getParam('email');
419
+
420
+ //stockage des variables dans la session
421
+ $session = Mage::getSingleton('core/session');
422
+ $session->setData('sponsor_id',$sponsorId);
423
+ $session->setData('firstname',$prenom);
424
+ $session->setData('lastname',$nom);
425
+ $session->setData('email',$email);
426
+
427
+ //stockage de l'id du parrain dans un cookie
428
+ $sponsorInvitationValidity = Mage::helper('auguria_sponsorship/config')->getInvitationValidity();
429
+ $period =3600*24*$sponsorInvitationValidity;
430
+
431
+ $cookie = Mage::getModel('core/cookie');
432
+ $cookie->set('sponsorship_id', $sponsorId, $period);
433
+ $cookie->set('sponsorship_firstname', $prenom, $period);
434
+ $cookie->set('sponsorship_lastname', $nom, $period);
435
+ $cookie->set('sponsorship_email', $email, $period);
436
+
437
+ $controller->getRequest()->setParam('sponsor_id', null);
438
+ }
439
+ }
440
+
441
+ /**
442
+ *
443
+ * Add fidelity points if customer subscribe to newletter while registration
444
+ * @param Varien_Event_Observer $observer
445
+ */
446
+ public function addNewsletterPoints($observer)
447
+ {
448
+ try
449
+ {
450
+ $newsletterPoints = (int)Mage::helper('auguria_sponsorship/config')->getFidelityNewsletterPoints();
451
+ //Check if we must add points
452
+ if ($newsletterPoints > 0)
453
+ {
454
+ //Check if it's an account creation
455
+ $customer = $observer->getCustomer();
456
+ if (!$customer->getId())
457
+ {
458
+ //Check if he is subscribing to the newsletter
459
+ if ($customer->getIsSubscribed() == 1)
460
+ {
461
+ $this->_addFidelityPoints($customer, $newsletterPoints, 'newsletter');
462
+ }
463
+ }
464
+ }
465
+ }
466
+ catch (Exception $e)
467
+ {
468
+ Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while adding news letter points : %s",$e->getMessage()));
469
+ }
470
+ }
471
+
472
+ /**
473
+ *
474
+ * Add fidelity points to customer and sponsorship points to sponsor on first order
475
+ * @param Varien_Event_Observer $observer
476
+ */
477
+ public function addFirstOrderPoints($observer)
478
+ {
479
+ try
480
+ {
481
+ $godsonFirstOrderPoints = Mage::helper('auguria_sponsorship/config')->getFidelityFirstOrderPoints();
482
+ $sponsorFirstOrderPoints = Mage::helper('auguria_sponsorship/config')->getGodsonFirstOrderPoints();
483
+
484
+ //Check if we have to add points on first order
485
+ if ($godsonFirstOrderPoints>0 || $sponsorFirstOrderPoints>0)
486
+ {
487
+ $invoice = $observer->getInvoice();
488
+ $customerId = $invoice->getCustomerId();
489
+
490
+ //Get customer paid invoices
491
+ $invoices = Mage::getResourceModel('sales/order_invoice_collection');
492
+ $invoices->getSelect()->join(array('o'=>$invoices->getTable('sales/order')), 'main_table.order_id = o.entity_id','o.customer_id');
493
+
494
+ $invoices->addAttributeToSelect('state')
495
+ ->addAttributeToFilter('o.customer_id', $customerId)
496
+ ->addAttributeToFilter('main_table.state', Mage_Sales_Model_Order_Invoice::STATE_PAID);
497
+
498
+ if ($invoices->count() == 0)
499
+ {
500
+ $customer = Mage::getModel('customer/customer')->load($customerId);
501
+
502
+ //Add fidelity points to customer
503
+ if ($godsonFirstOrderPoints >0)
504
+ {
505
+ $this->_addFidelityPoints($customer, $godsonFirstOrderPoints, 'first', $invoice->getOrderId());
506
+ $customer->save();
507
+ }
508
+
509
+ //Add sponsorship points
510
+ $sponsorId = $customer->getSponsor();
511
+ if (isset($sponsorId) && $sponsorId>0 && $sponsorFirstOrderPoints>0)
512
+ {
513
+ $sponsor = Mage::getModel('customer/customer')->load($sponsorId);
514
+ $this->_addSponsorPoints($sponsor, $customer, $sponsorFirstOrderPoints, 'first', $invoice->getOrderId());
515
+
516
+ }
517
+ }
518
+ }
519
+ }
520
+ catch (Exception $e)
521
+ {
522
+ Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while adding first order points :".$e->getMessage()));
523
+ }
524
+ }
525
+
526
+ /**
527
+ * Update sponsorship tab customer fields from adminhtml customer form on customer_save_before
528
+ * @param Varien_Event_Observer $observer
529
+ */
530
+ public function adminUpdateSponsorshipFields($observer)
531
+ {
532
+ //@TODO check each parameters
533
+ $form = Mage::app()->getRequest()->getParam('sponsorship');
534
+ if (is_array($form) && !empty($form)) {
535
+ foreach ($form as $key=>$value) {
536
+ $observer->getCustomer()->setData($key, $value);
537
+ }
538
+ }
539
+ return $observer;
540
+ }
541
+
542
+ /**
543
+ * Insert log if points are modified on customer_save_after
544
+ * @param Varien_Event_Observer $observer
545
+ */
546
+ public function adminUpdatePoints($observer)
547
+ {
548
+ if (Mage::app()->getRequest()->getControllerName()=='customer') {
549
+ $customer = $observer->getCustomer();
550
+ if ($customer->hasDataChanges()) {
551
+ $keys = Array('accumulated_points','sponsor_points','fidelity_points');
552
+ foreach ($keys as $key) {
553
+ if ($customer->dataHasChangedFor($key)) {
554
+ $points = (float)$customer->getData($key) - (float)$customer->getOrigData($key);
555
+ $data = Array('points'=>$points,
556
+ 'customer_id'=>$customer->getId(),
557
+ 'record_type'=>'admin');
558
+ $this->_addAuguriaSponsorshipLog($data);
559
+ }
560
+ }
561
+ }
562
+ }
563
+ }
564
+
565
+ /**
566
+ * Update sponsorship fields from frontend customer form on customer_save_before
567
+ * @param Varien_Event_Observer $observer
568
+ */
569
  public function frontUpdateSponsorshipFields($observer)
570
  {
571
  $iban = Mage::app()->getRequest()->getParam('iban');
572
+ $bic = Mage::app()->getRequest()->getParam('bic');
573
  $siret = Mage::app()->getRequest()->getParam('siret');
574
  $customer = $observer->getCustomer();
575
  /*Edit action*/
576
  if ($customer->getId()) {
577
  if (isset($iban)) {
578
+ $customerIban = str_replace(CHR(32),"",$iban);
579
+ $customerIban = str_replace("-","",$customerIban);
580
  if (Zend_Validate::is( trim($iban) , 'NotEmpty')) {
581
+ if (!Zend_Validate::is( trim($iban) , 'Iban')) {
582
+ Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid IBAN code "%s"', $iban));
583
+ }
584
  }
585
+ $customer->setData('iban', $customerIban);
586
+ }
587
+
588
+ if (isset($bic)) {
589
+ $customerBic = str_replace(CHR(32),"", $bic);
590
+ $customerBic = str_replace("-","", $customerBic);
591
+ $validator = new Zend_Validate_Regex(array('pattern' => '/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/'));
592
+ if(!$validator->isValid($customerBic) && !empty($customerBic)){
593
+ Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid BIC code "%s"', $bic));
594
+ }
595
+ $customer->setData('bic', $customerBic);
596
+ }
597
+
598
+ if (isset($siret)) {
599
+ $customerSiret = str_replace(CHR(32),"",$siret);
600
+ $customerSiret = str_replace("-","",$customerSiret);
601
+ /*desactivated for internationalization
602
+ if (!Mage::helper('auguria_sponsorship')->isSiret(trim($siret))) {
603
+ Mage::throwException(Mage::helper('auguria_sponsorship')->__('Invalid SIRET code "%s"', $siret));
604
  }
605
  */
606
  $customer->setData('siret', $customerSiret);
607
+ }
608
+ }
609
  /*Create action*/
610
+ else {
611
  if ($sponsorId = Mage::helper("auguria_sponsorship")->searchSponsorId($customer->getEmail())) {
612
  $customer->setData('sponsor',$sponsorId);
613
  $cookie = Mage::getSingleton('core/cookie');
618
  $cookie->delete('sponsorship_lastname');
619
  }
620
  }
621
+ }
622
  return $observer;
623
  }
624
 
645
 
646
  $postObject = new Varien_Object();
647
  $postObject->setData(Array ("sender_name" => $sender_name,
648
+ "sender_email" => $sender_email,
649
+ "recipient_firstname" => $sponsor->getFirstname(),
650
+ "recipient_lastname" => $sponsor->getLastname(),
651
+ "subject" => $subject,
652
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName(),
653
+ "godchild_firstname" =>$godchild->getFirstname(),
654
+ "godchild_lastname" =>$godchild->getLastname(),
655
+ "added_points" =>$addedPoints,
656
+ "total_points" =>$totalPoints
657
+ ));
658
  $mailTemplate->setDesignConfig(array('area' => 'frontend'))
659
+ ->setReplyTo($sender_email)
660
+ ->sendTransactional(
661
+ Mage::helper('auguria_sponsorship/config')->getSponsorshipNotificationTemplate(),
662
+ $sender,
663
+ $recipient_email,
664
+ $sponsor->getFirstname().' '.$sponsor->getLastname(),
665
+ array('data' => $postObject));
666
  if (!$mailTemplate->getSentSuccess())
667
  {
668
  Mage::log(Mage::helper('auguria_sponsorship')->__("An error occured while sending sponsor notification email."));
680
  $order = $observer['order'];
681
  if ($order) {
682
  if ((float)$order->getAuguriaSponsorshipDiscountAmount()<0) {
683
+ $customerId = $order->getCustomerId();
684
+ if ($customerId != '')
685
+ {
686
+ $pointsToCash = Mage::helper('auguria_sponsorship/config')->getPointsToCash();
687
+ $orderAccumulated = 0;
688
+ $orderFidelity = 0;
689
+ $orderSponsor = 0;
690
+ if (isset($pointsToCash['accumulated']) && (float)$pointsToCash['accumulated']>0) {
691
+ $orderAccumulated = (float)$order->getAuguriaSponsorshipAccumulatedPointsUsed()/(float)$pointsToCash['accumulated'];
692
+ }
693
+ if (isset($pointsToCash['fidelity']) && (float)$pointsToCash['fidelity']>0) {
694
+ $orderFidelity = (float)$order->getAuguriaSponsorshipFidelityPointsUsed()/(float)$pointsToCash['fidelity'];
695
+ }
696
+ if (isset($pointsToCash['sponsorship']) && (float)$pointsToCash['sponsorship']>0) {
697
+ $orderSponsor = (float)$order->getAuguriaSponsorshipSponsorPointsUsed()/(float)$pointsToCash['sponsorship'];
698
+ }
699
+ $type = Array();
700
+
701
+ if ((float)$orderAccumulated > 0
702
+ ||(float)$orderSponsor > 0
703
+ ||(float)$orderFidelity > 0) {
704
+ $customer = Mage::getModel("customer/customer")->load($customerId);
705
+ $usedPoints = 0;
706
+ if ((float)$orderAccumulated > 0) {
707
+ $points = (float)$customer->getAccumulatedPoints();
708
+ $usedPoints += (float)$orderAccumulated;
709
+ $points = $points - $usedPoints;
710
+ $points = max(0,$points);
711
+ $customer->setAccumulatedPoints($points);
712
+ $type['accumulated'] = $usedPoints;
713
+ }
714
+ else {
715
+ if ((float)$orderSponsor > 0) {
716
+ $points = (float)$customer->getSponsorPoints();
717
+ $usedPoints += (float)$orderSponsor;
718
+ $points = $points - $usedPoints;
719
+ $points = max(0,$points);
720
+ $customer->setSponsorPoints($points);
721
+ $type['sponsor'] = $usedPoints;
722
+ }
723
+ if ((float)$orderFidelity > 0) {
724
+ $points = (float)$customer->getFidelityPoints();
725
+ $usedPoints += (float)$orderFidelity;
726
+ $points = $points - $usedPoints;
727
+ $points = max(0,$points);
728
+ $customer->setFidelityPoints($points);
729
+ $type['fidelity'] = $usedPoints;
730
+ }
731
+ }
732
+ $customer->save();
733
+
734
+ if ($usedPoints>0) {
735
+ $data = Array('points'=>-$usedPoints,
736
+ 'customer_id'=>$customerId,
737
+ 'record_type'=>'cart',
738
+ 'record_id'=>$order->getId(),
739
+ 'datetime'=>$order->getUpdatedAt());
740
+ $this->_addAuguriaSponsorshipLog($data);
741
+
742
+ if (count($type)>0) {
743
+ foreach($type as $key=>$points) {
744
+ $echange = Mage::getModel('auguria_sponsorship/change');
745
+ $mode = Mage::helper('auguria_sponsorship/config')->getModuleMode();
746
+ $type = Mage::helper('auguria_sponsorship/config')->getPointsTypes($mode);
747
  $row = array(
748
+ 'customer_id' => $customerId,
749
+ 'type' => 'cart',
750
+ 'module' => $key,
751
+ 'statut' => 'waiting',
752
+ 'datetime' => Mage::getModel('core/date')->gmtDate(),
753
+ 'points' => $points,
754
+ 'value' => $order->getBaseAuguriaSponsorshipDiscountAmount()
755
  );
756
  $echange->setData($row);
757
  $echange->save();
758
+ }
759
+ }
760
+ }
761
+ }
762
+ }
763
  }
764
  }
765
  }
786
  /**
787
  * Add Auguria_Sponsorship points in quote according to defined rules on salesrule_validator_process event
788
  * @param array(
789
+ 'rule' => $rule,
790
+ 'item' => $item,
791
+ 'address' => $address,
792
+ 'quote' => $quote,
793
+ 'qty' => $qty,
794
+ 'result' => $result,
795
+ ) $observer
796
  */
797
  public function validatorPointsCalculationProcess($observer)
798
  {
803
  $qty = $observer['qty'];
804
 
805
  $rulePercent = min(100, $rule->getDiscountAmount());
806
+ $price = $item->getDiscountCalculationPrice();
807
+ $baseItemPrice = ($price !== null) ? $item->getBaseDiscountCalculationPrice() : $item->getBaseCalculationPrice();
808
+
809
+ $cartFidelityPoints = 0;
810
+ $cartSponsorPoints = 0;
811
+
812
+ switch ($rule->getSimpleAction()) {
813
+ case 'fidelity_points_by_fixed':
814
+ if ($step = $rule->getDiscountStep()) {
815
+ $qty = floor($qty/$step)*$step;
816
+ }
817
+ $cartFidelityPoints = $qty*$rule->getDiscountAmount();
818
+ break;
819
+
820
+ case 'fidelity_points_by_percent':
821
+ if ($step = $rule->getDiscountStep()) {
822
+ $qty = floor($qty/$step)*$step;
823
+ }
824
+ $cartFidelityPoints = ($qty*$baseItemPrice - $item->getBaseDiscountAmount()) * $rulePercent/100;
825
+ break;
826
+
827
+ case 'fidelity_points_cart_fixed':
828
+ /** @TODO : prevent applying whole cart discount for every shipping order, but only for first order */
829
+ $cartRules = $address->getCartFixedRules();
830
+ if (!isset($cartRules[$rule->getId()])) {
831
+ $cartRules[$rule->getId()] = $rule->getDiscountAmount();
832
+ }
833
+ if ($cartRules[$rule->getId()] > 0) {
834
+ $cartFidelityPoints = $rule->getDiscountAmount();
835
+ }
836
+ $address->setCartFixedRules($cartRules);
837
+ break;
838
+ //sponsor
839
+ case 'sponsor_points_by_fixed':
840
+ if ($step = $rule->getDiscountStep()) {
841
+ $qty = floor($qty/$step)*$step;
842
+ }
843
+ $cartSponsorPoints = $qty*$rule->getDiscountAmount();
844
+ break;
845
+
846
+ case 'sponsor_points_by_percent':
847
+ if ($step = $rule->getDiscountStep()) {
848
+ $qty = floor($qty/$step)*$step;
849
+ }
850
+ $cartSponsorPoints = ($qty*$baseItemPrice - $item->getBaseDiscountAmount()) * $rulePercent/100;
851
+ break;
852
+
853
+ case 'sponsor_points_cart_fixed':
854
+ /** @TODO : prevent applying whole cart discount for every shipping order, but only for first order */
855
+ $cartRules = $address->getCartFixedRules();
856
+ if (!isset($cartRules[$rule->getId()])) {
857
+ $cartRules[$rule->getId()] = $rule->getDiscountAmount();
858
+ }
859
+ if ($cartRules[$rule->getId()] > 0) {
860
+ $cartSponsorPoints = $rule->getDiscountAmount();
861
+ }
862
+ $address->setCartFixedRules($cartRules);
863
+ break;
864
+ }
865
+ $result->setData('cart_fidelity_points',$cartFidelityPoints);
866
+ $result->setData('cart_sponsor_points',$cartSponsorPoints);
867
+
868
+ $cartFidelityPoints = max((float)$item->getCartFidelityPoints(), (float)$cartFidelityPoints);
869
+ $cartSponsorPoints = max((float)$item->getCartSponsorPoints(), (float)$cartSponsorPoints);
870
+
871
+ $item->setCartFidelityPoints($cartFidelityPoints);
872
+ $item->setCartSponsorPoints($cartSponsorPoints);
873
+
874
+ return $this;
875
  }
876
 
877
  /**
883
  $creditmemo = $observer['creditmemo'];
884
  //if it is a credit memo creation
885
  if ((int)$creditmemo->getId()==0
886
+ && (Mage::helper('auguria_sponsorship/config')->cancelFidelityEarnedPointsOnCreditMemo()
887
+ || Mage::helper('auguria_sponsorship/config')->cancelSponsorshipEarnedPointsOnCreditMemo())
888
  ) {
889
  $order = $creditmemo->getOrder();
890
 
935
  Mage::helper('auguria_sponsorship')->setFidelityPoints($customer, $points);
936
  $customer->save();
937
  $data = array(
938
+ 'customer_id' => $order->getCustomerId(),
939
+ 'record_id' => $order->getId(),
940
+ 'record_type' => 'order',
941
+ 'points' => -$backFidelityPoints
942
  );
943
  $this->_addAuguriaSponsorshipLog($data);
944
  }
947
  //remove sponsorship points according to logs and applying ratio
948
  if (Mage::helper('auguria_sponsorship/config')->cancelSponsorshipEarnedPointsOnCreditMemo()){
949
  $collection = Mage::getResourceModel('auguria_sponsorship/log_collection')
950
+ ->addFieldToFilter('record_type', 'order')
951
+ ->addFieldToFilter('record_id', $order->getId());
952
  if ($collection->count()>0){
953
  foreach ($collection as $log) {
954
  $points = 0;
963
 
964
  if ($points>0) {
965
  $data = array(
966
+ 'godson_id' => $log->getGodsonId(),
967
+ 'sponsor_id' => $log->getSponsorId(),
968
+ 'record_id' => $order->getId(),
969
+ 'record_type' => 'order',
970
+ 'points' => -(float)$log->getPoints()*$ratio
971
  );
972
  $this->_addAuguriaSponsorshipLog($data);
973
  }
987
  $order = $observer['order'];
988
  //Check status passed from any to canceled
989
  if ($order->getStatus()=='canceled'
990
+ && $order->getOrigData('status')!='canceled') {
991
  $this->_cancelUsedPoints($order);
992
  }
993
  }
1033
  if ($toAdd>0) {
1034
  $customer->save();
1035
  $data = array(
1036
+ 'customer_id' => $customer->getId(),
1037
+ 'record_id' => $order->getId(),
1038
+ 'record_type' => 'cart',
1039
+ 'points' => $toAdd
1040
  );
1041
  $this->_addAuguriaSponsorshipLog($data);
1042
  }
1049
  public function salesRulesAddAction($observer)
1050
  {
1051
  $field = $observer->getForm()->getElement('simple_action');
1052
+ $options = $field->getValues();
1053
+ $customOptions = Array(
1054
+ Array('value'=>'fidelity_points_by_percent','label'=>Mage::helper('auguria_sponsorship')->__('Fidelity points by percentage of the original price')),
1055
+ Array('value'=>'fidelity_points_by_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Fidelity points by fixed amount')),
1056
+ Array('value'=>'fidelity_points_cart_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Fidelity points by fixed amount for whole cart')),
1057
+ Array('value'=>'sponsor_points_by_percent','label'=>Mage::helper('auguria_sponsorship')->__('Sponsorship points by percentage of the original price')),
1058
+ Array('value'=>'sponsor_points_by_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Sponsorship points by fixed amount')),
1059
+ Array('value'=>'sponsor_points_cart_fixed','label'=>Mage::helper('auguria_sponsorship')->__('Sponsorship points by fixed amount for whole cart'))
1060
+ );
1061
+ $allOptions = array_merge($options, $customOptions);
1062
+ $field->setValues($allOptions);
1063
  }
1064
+
1065
  /**
1066
  * Update paypal cart
1067
+ *
1068
  * @event paypal_prepare_line_items
1069
  * @param Varien_Event_Observer $observer
1070
  */
1071
+ public function updatePaypal($observer)
1072
+ {
1073
+ //récupération de la structure passée en paramètre par Paypal
1074
+ $event = $observer->getEvent();
1075
+ //récupération du panier Paypal
1076
+ $panierPaypal = $event->getPaypalCart();
1077
+ if ($panierPaypal)
1078
+ {
1079
+ //récupération de l'objet nécessaire pour les ventes
1080
+ $entity = $panierPaypal->getSalesEntity();
1081
+ if ($entity)
1082
+ {
1083
+ //tentative de récupération du montant Auguria
1084
+ $douRemisePointsFidelite = $entity->getAuguriaSponsorshipDiscountAmount();
1085
+ //si montant trouvé, on met à jour le total
1086
+ if ($douRemisePointsFidelite)
1087
  $panierPaypal->updateTotal(Mage_Paypal_Model_Cart::TOTAL_DISCOUNT, abs($douRemisePointsFidelite));
1088
+ }
1089
+ }
1090
+ }
1091
+
1092
+ /**
1093
+ * Refill point when payment is canceled
1094
+ * @event sales_order_payment_cancel
1095
+ * @param Varien_Event_Observer $observer
1096
+ */
1097
  public function paymentCanceled($observer)
1098
+ {
1099
+ //récupération de la structure passée en paramètre par Paypal
1100
+ $event = $observer->getEvent();
1101
+ //récupération de la commande associée
1102
+ $order = $event->getPayment()->getOrder();
1103
+ //action sur le compte fidélité (code dérivé de la fonction _cancelUsedPoints)
1104
+
1105
+ $customerId = $order->getCustomerId();
1106
+ $customer = Mage::getModel('customer/customer')->load($customerId);
1107
+
1108
+ $pointsToCash = Mage::helper('auguria_sponsorship/config')->getPointsToCash();
1109
+
1110
+ $usedPoints = array();
1111
+ $usedPoints['accumulated'] = $order->getAuguriaSponsorshipAccumulatedPointsUsed();
1112
+ $usedPoints['sponsorship'] = $order->getAuguriaSponsorshipSponsorPointsUsed();
1113
+ $usedPoints['fidelity'] = $order->getAuguriaSponsorshipFidelityPointsUsed();
1114
+ $toAdd = 0;
1115
+ //Add used points
1116
+ foreach ($usedPoints as $type=>$points) {
1117
+ if ($points>0) {
1118
+ //conversion en nombre de points
1119
+ $douTaux = 1;
1120
+ if (isset($pointsToCash[$type]) && (float)$pointsToCash[$type]>0){
1121
+ $douTaux = (float)$pointsToCash[$type];
1122
+ }
1123
+ //correction
1124
+ $haveUsedPoints = true;
1125
+ if ($type=='accumulated') {
1126
+ $toAdd += $points/$douTaux;
1127
+ $customer->setAccumulatedPoints($customer->getAccumulatedPoints()+$points/$douTaux);
1128
+ }
1129
+ elseif ($type=='sponsorship') {
1130
+ $toAdd += $points/$douTaux;
1131
+ $customer->setSponsorPoints($customer->getSponsorPoints()+$points/$douTaux);
1132
+ }
1133
+ elseif ($type=='fidelity') {
1134
+ $toAdd += $points/$douTaux;
1135
+ $customer->setFidelityPoints($customer->getFidelityPoints()+$points/$douTaux);
1136
+ }
1137
+ }
1138
+ }
1139
+ if ($toAdd>0) {
1140
+ $customer->save();
1141
+ $data = array(
1142
+ 'customer_id' => $customer->getId(),
1143
+ 'record_id' => $order->getId(),
1144
+ 'record_type' => 'cart',
1145
+ 'points' => $toAdd
1146
+ );
1147
+ $this->_addAuguriaSponsorshipLog($data);
1148
+ }
1149
+ }
1150
  }
app/code/community/Auguria/Sponsorship/Model/Openinviter.php CHANGED
@@ -15,7 +15,7 @@ class Auguria_Sponsorship_Model_Openinviter
15
  $this->inviter = new OpenInviter();
16
  }
17
 
18
- public function getOpenIniviterPlugins()
19
  {
20
  return $this->inviter->getPlugins();
21
  }
@@ -52,7 +52,7 @@ class Auguria_Sponsorship_Model_Openinviter
52
 
53
  public function getPluginsArray()
54
  {
55
- $plugins = $this->getOpenIniviterPlugins();
56
  $array = Array();
57
  if (count($plugins))
58
  {
15
  $this->inviter = new OpenInviter();
16
  }
17
 
18
+ public function getOpenInviterPlugins()
19
  {
20
  return $this->inviter->getPlugins();
21
  }
52
 
53
  public function getPluginsArray()
54
  {
55
+ $plugins = $this->getOpenInviterPlugins();
56
  $array = Array();
57
  if (count($plugins))
58
  {
app/code/community/Auguria/Sponsorship/controllers/OpeninviterController.php CHANGED
@@ -37,7 +37,7 @@ class Auguria_Sponsorship_OpeninviterController extends Mage_Core_Controller_Fro
37
  $old_form = array();
38
 
39
  $new_form = array (
40
- 'plugins'=>$inviter->getOpenIniviterPlugins(),
41
  'types'=>$inviter->getOpenInviterTypes(),
42
  'step'=>'get_contacts'
43
  );
@@ -85,7 +85,7 @@ class Auguria_Sponsorship_OpeninviterController extends Mage_Core_Controller_Fro
85
  if (!count($errors))
86
  {
87
  $inviter = Mage::getModel('auguria_sponsorship/openinviter');
88
- $inviter->getOpenIniviterPlugins();
89
  include_once (Mage::getModuleDir('', 'Auguria_Sponsorship').'/Lib/OpenInviter/plugins/'.$post['provider_box'].'.plg.php');
90
  $result = $inviter->startPlugin($post['provider_box']);
91
  $contacts;
37
  $old_form = array();
38
 
39
  $new_form = array (
40
+ 'plugins'=>$inviter->getOpenInviterPlugins(),
41
  'types'=>$inviter->getOpenInviterTypes(),
42
  'step'=>'get_contacts'
43
  );
85
  if (!count($errors))
86
  {
87
  $inviter = Mage::getModel('auguria_sponsorship/openinviter');
88
+ $inviter->getOpenInviterPlugins();
89
  include_once (Mage::getModuleDir('', 'Auguria_Sponsorship').'/Lib/OpenInviter/plugins/'.$post['provider_box'].'.plg.php');
90
  $result = $inviter->startPlugin($post['provider_box']);
91
  $contacts;
app/code/community/Auguria/Sponsorship/controllers/PointsController.php CHANGED
@@ -7,6 +7,9 @@
7
  */
8
  class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Action
9
  {
 
 
 
10
  public function preDispatch()
11
  {
12
  parent::preDispatch();
@@ -72,10 +75,10 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
72
  {
73
  $module = $this->getRequest()->getParam('module');
74
  $type = $this->getRequest()->getParam('type');
75
-
76
  //Set used module in session on change action for recover in checkout
77
  Mage::getSingleton('customer/session')->setData('auguria_sponsorship_change_module', $module);
78
-
79
  $resultValidate = $this->_validateChange($module, $type);
80
  if ($resultValidate == 'valide' )
81
  {
@@ -106,7 +109,9 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
106
  $module = $this->getRequest()->getPost('module');
107
  $type = $this->getRequest()->getPost('type');
108
  $points = $this->getRequest()->getPost('points');
 
109
  $resultValidate = $this->_validateChange($module, $type, $points);
 
110
  $value = $this->_getValue($points, $type, $module);
111
 
112
  if ($resultValidate == 'valide' )
@@ -124,20 +129,22 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
124
  $newPoints = $cPoints - $points;
125
  $customer->$setdatapoints($newPoints);
126
  $customer->save();
127
-
128
  $dateTime = Mage::getModel('core/date')->gmtDate();
129
  $statut = "waiting";
130
 
131
  //inscription de l'opération dans la table des echanges
132
  $echange = Mage::getModel('auguria_sponsorship/change');
 
133
  $row = array(
134
- 'customer_id' => $customerId,
135
- 'type' => $type,
136
- 'module' => $module,
137
- 'statut' => $statut,
138
- 'datetime' => $dateTime,
139
- 'points' => $points,
140
- 'value' => $value
 
141
  );
142
  $echange->setData($row);
143
  $echange->save();
@@ -146,22 +153,21 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
146
  //inscription dans les logs
147
  $log = Mage::getModel('auguria_sponsorship/log');
148
  $data = array(
149
- 'customer_id' => $customerId,
150
- 'record_id' => $echangeId,
151
- 'record_type' => $type,
152
- 'datetime' => $dateTime,
153
- 'points' => -$points
154
- );
155
  $log->setData($data);
156
  $log->save();
157
-
158
  Mage::getSingleton('customer/session')->addSuccess(Mage::helper('auguria_sponsorship')->__('Your request has been submitted, you will soon receive an email confirmation.'));
159
  if ($module=='sponsor') {
160
  $module = 'sponsorship';
161
  }
162
  $this->_redirect('*/*/'.$module);
163
  }
164
-
165
  catch (Exception $e) {
166
  Mage::log($e->getMessage());
167
  Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("An error occurred while saving your request."));
@@ -192,13 +198,13 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
192
  {
193
  $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
194
  $session = Mage::getSingleton('customer/session');
195
-
196
  $Module = ucfirst($module);
197
  $Type = ucfirst($type);
198
-
199
  $changeEnabled = 'get'.$Module.$Type.'Config';
200
  $moduleEnabled = 'get'.$Module.'EnabledConfig';
201
-
202
  if (($options->$moduleEnabled()==1 && $options->$changeEnabled()==1))
203
  {
204
  $validate = '_validate'.$Type;
@@ -242,31 +248,32 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
242
  $websiteId = $customer->getWebsiteId();
243
  $data = array
244
  (
245
- "name" => $name,
246
- "description" => $description,
247
- "from_date" => $date,
248
- "coupon_code" => $couponCode,
249
- "coupon_type" => 2,
250
- "uses_per_coupon" => 1,
251
  //"uses_per_customer" => 1,
252
- "customer_group_ids" => Array(0 => $customerGroupId),//get customer group
253
- "is_active" => 1,
254
- "conditions_serialized" => 'a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}',
255
- "actions_serialized" => 'a:6:{s:4:"type";s:40:"salesrule/rule_condition_product_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}',
256
- "stop_rules_processing" => 0,
257
- "is_advanced" => 1,
258
- "sort_order" => 0,
259
- "simple_action" => "cart_fixed",
260
- "discount_amount" => $discountAmount,
261
- "discount_qty" => 1.0000,
262
- "discount_step" => 0,
263
- "simple_free_shipping" => 0,
264
- "times_used" => 0,
265
- "is_rss" => 1,
266
- "website_ids" => Array(0 => $websiteId)//get website id
267
  );
268
  $srModel->setData($data);
269
  $srModel->save();
 
270
  //envoi du mail--------------------------------------------------------------
271
  //construction du message
272
  $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
@@ -281,24 +288,24 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
281
 
282
  $postObject = new Varien_Object();
283
  $postObject->setData(Array ("sender_name" => $sender_name,
284
- "sender_email" => $sender_email,
285
- "recipient_firstname" => $customer->getFirstname(),
286
- "recipient_lastname" => $customer->getLastname(),
287
- "discount_amount" => $discountAmount,
288
- "subject" => $subject,
289
- "coupon_code" => $couponCode,
290
- "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
291
  ));
292
 
293
  $mailTemplate->setDesignConfig(array('area' => 'frontend'))
294
  ->setReplyTo($sender_email)
295
  //->setReturnPath($sender_email)
296
  ->sendTransactional(
297
- Mage::getStoreConfig('auguria_sponsorship/coupon/template'),
298
- $sender,
299
- $recipient_email,
300
- $customer->getFirstname().' '.$customer->getLastname(),
301
- array('data' => $postObject)
302
  );
303
  if (!$mailTemplate->getSentSuccess())
304
  {
@@ -319,64 +326,134 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
319
  {
320
  $validate = 'valide';
321
  $customerId = Mage::getSingleton('customer/session')->getId();
322
- $maxCash = "";
323
- $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
324
-
325
  //Validation qu'un Iban est renseigné
326
  $customer = Mage::getModel("customer/customer")->load($customerId);
327
-
328
- if (!$customer->getIban()) {
329
- Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__('To change your points into cash, you must indicate your IBAN.'));
330
- $validate = 'account';
331
- }
332
-
333
- //Validation qu'un Siret est renseigné si le max de cash pour un particulier est atteint
334
- if ($module=='sponsor') {
335
- $maxCash = $options->getSponsorMaxCashConfig ();
336
- $timeMaxCash = $options->getSponsorTimeMaxCashConfig ();
337
- }
338
- elseif ($module=='fidelity') {
339
- $maxCash = $options->getFidelityMaxCashConfig ();
340
- $timeMaxCash = $options->getFidelityTimeMaxCashConfig ();
341
- }
342
- elseif ($module=='accumulated') {
343
- $maxCash = $options->getAccumulatedMaxCashConfig ();
344
- $timeMaxCash = $options->getAccumulatedTimeMaxCashConfig ();
345
- }
346
- $resource = Mage::getSingleton('core/resource');
347
- $read = $resource->getConnection('core_read');
348
- $datetime = Mage::getModel('core/date')->gmtDate();
349
- $select = $read->select()
350
- ->from($resource->getTableName('auguria_sponsorship/change'), 'SUM(points)')
351
- ->where('customer_id=?', $customerId)
352
- ->where('module=?', $module)
353
- ->where('type=?', 'cash')
354
- ->where('statut!=?', 'canceled')
355
- ->where('TO_DAYS("'.$datetime.'") - TO_DAYS(datetime) <=?', $timeMaxCash);
356
-
357
- $cashPoints = $read->fetchOne($select);
358
-
359
- //Addition des points déjà changés avec les points demandés
360
- $cashPoints = $points+$cashPoints;
361
-
362
- //vérification que le total ne dépasse pas le maximum autorisé
363
- if ($cashPoints >= $maxCash) {
364
- if (!$customer->getSiret())
365
- {
366
- Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__('To change more cash, you must specify a company number.'));
367
  $validate = 'account';
368
  }
369
- }
370
 
371
- //vérification que les points à changer sonts inférieurs aux points du client
372
- if ($points != '')
373
- {
374
- $data = 'get'.ucfirst($module).'Points';
375
- $cPoints = $customer->$data();
376
- if ($points>$cPoints)
377
- {
378
- Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("You do not have as many points."));
379
- $validate = 'points';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  }
381
  }
382
  return $validate;
@@ -392,4 +469,4 @@ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Ac
392
  $value = round($points*$PointsToCash,2);
393
  return $value;
394
  }
395
- }
7
  */
8
  class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Action
9
  {
10
+
11
+ protected $_couponCode = NULL;
12
+
13
  public function preDispatch()
14
  {
15
  parent::preDispatch();
75
  {
76
  $module = $this->getRequest()->getParam('module');
77
  $type = $this->getRequest()->getParam('type');
78
+
79
  //Set used module in session on change action for recover in checkout
80
  Mage::getSingleton('customer/session')->setData('auguria_sponsorship_change_module', $module);
81
+
82
  $resultValidate = $this->_validateChange($module, $type);
83
  if ($resultValidate == 'valide' )
84
  {
109
  $module = $this->getRequest()->getPost('module');
110
  $type = $this->getRequest()->getPost('type');
111
  $points = $this->getRequest()->getPost('points');
112
+
113
  $resultValidate = $this->_validateChange($module, $type, $points);
114
+
115
  $value = $this->_getValue($points, $type, $module);
116
 
117
  if ($resultValidate == 'valide' )
129
  $newPoints = $cPoints - $points;
130
  $customer->$setdatapoints($newPoints);
131
  $customer->save();
132
+
133
  $dateTime = Mage::getModel('core/date')->gmtDate();
134
  $statut = "waiting";
135
 
136
  //inscription de l'opération dans la table des echanges
137
  $echange = Mage::getModel('auguria_sponsorship/change');
138
+
139
  $row = array(
140
+ 'customer_id' => $customerId,
141
+ 'type' => $type,
142
+ 'module' => $module,
143
+ 'statut' => $statut,
144
+ 'datetime' => $dateTime,
145
+ 'points' => $points,
146
+ 'value' => $value,
147
+ 'coupon_code' => $this->_couponCode
148
  );
149
  $echange->setData($row);
150
  $echange->save();
153
  //inscription dans les logs
154
  $log = Mage::getModel('auguria_sponsorship/log');
155
  $data = array(
156
+ 'customer_id' => $customerId,
157
+ 'record_id' => $echangeId,
158
+ 'record_type' => $type,
159
+ 'datetime' => $dateTime,
160
+ 'points' => -$points
161
+ );
162
  $log->setData($data);
163
  $log->save();
 
164
  Mage::getSingleton('customer/session')->addSuccess(Mage::helper('auguria_sponsorship')->__('Your request has been submitted, you will soon receive an email confirmation.'));
165
  if ($module=='sponsor') {
166
  $module = 'sponsorship';
167
  }
168
  $this->_redirect('*/*/'.$module);
169
  }
170
+
171
  catch (Exception $e) {
172
  Mage::log($e->getMessage());
173
  Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("An error occurred while saving your request."));
198
  {
199
  $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
200
  $session = Mage::getSingleton('customer/session');
201
+
202
  $Module = ucfirst($module);
203
  $Type = ucfirst($type);
204
+
205
  $changeEnabled = 'get'.$Module.$Type.'Config';
206
  $moduleEnabled = 'get'.$Module.'EnabledConfig';
207
+
208
  if (($options->$moduleEnabled()==1 && $options->$changeEnabled()==1))
209
  {
210
  $validate = '_validate'.$Type;
248
  $websiteId = $customer->getWebsiteId();
249
  $data = array
250
  (
251
+ "name" => $name,
252
+ "description" => $description,
253
+ "from_date" => $date,
254
+ "coupon_code" => $couponCode,
255
+ "coupon_type" => 2,
256
+ "uses_per_coupon" => 1,
257
  //"uses_per_customer" => 1,
258
+ "customer_group_ids" => Array(0 => $customerGroupId),//get customer group
259
+ "is_active" => 1,
260
+ "conditions_serialized" => 'a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}',
261
+ "actions_serialized" => 'a:6:{s:4:"type";s:40:"salesrule/rule_condition_product_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}',
262
+ "stop_rules_processing" => 0,
263
+ "is_advanced" => 1,
264
+ "sort_order" => 0,
265
+ "simple_action" => "cart_fixed",
266
+ "discount_amount" => $discountAmount,
267
+ "discount_qty" => 1.0000,
268
+ "discount_step" => 0,
269
+ "simple_free_shipping" => 0,
270
+ "times_used" => 0,
271
+ "is_rss" => 1,
272
+ "website_ids" => Array(0 => $websiteId)//get website id
273
  );
274
  $srModel->setData($data);
275
  $srModel->save();
276
+ $this->_couponCode = $srModel->getData('coupon_code');
277
  //envoi du mail--------------------------------------------------------------
278
  //construction du message
279
  $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
288
 
289
  $postObject = new Varien_Object();
290
  $postObject->setData(Array ("sender_name" => $sender_name,
291
+ "sender_email" => $sender_email,
292
+ "recipient_firstname" => $customer->getFirstname(),
293
+ "recipient_lastname" => $customer->getLastname(),
294
+ "discount_amount" => $discountAmount,
295
+ "subject" => $subject,
296
+ "coupon_code" => $couponCode,
297
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
298
  ));
299
 
300
  $mailTemplate->setDesignConfig(array('area' => 'frontend'))
301
  ->setReplyTo($sender_email)
302
  //->setReturnPath($sender_email)
303
  ->sendTransactional(
304
+ Mage::getStoreConfig('auguria_sponsorship/coupon/template'),
305
+ $sender,
306
+ $recipient_email,
307
+ $customer->getFirstname().' '.$customer->getLastname(),
308
+ array('data' => $postObject)
309
  );
310
  if (!$mailTemplate->getSentSuccess())
311
  {
326
  {
327
  $validate = 'valide';
328
  $customerId = Mage::getSingleton('customer/session')->getId();
 
 
 
329
  //Validation qu'un Iban est renseigné
330
  $customer = Mage::getModel("customer/customer")->load($customerId);
331
+
332
+ if ($points != 0)
333
+ {
334
+ $maxCash = "";
335
+ $enableSiretChecking = true;
336
+ $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
337
+
338
+ if (!$customer->getIban() || !$customer->getBic()) {
339
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__('To change your points into cash, you must indicate your IBAN and BIC.'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  $validate = 'account';
341
  }
 
342
 
343
+ //Validation qu'un Siret est renseigné si le max de cash pour un particulier est atteint
344
+ if ($module=='sponsor') {
345
+ $maxCash = $options->getSponsorMaxCashConfig ();
346
+ $enableSiretChecking = $options->getSponsorEnableSiretConfig ();
347
+ $timeMaxCash = $options->getSponsorTimeMaxCashConfig ();
348
+ }
349
+ elseif ($module=='fidelity') {
350
+ $maxCash = $options->getFidelityMaxCashConfig ();
351
+ $enableSiretChecking = $options->getFidelityEnableSiretConfig ();
352
+ $timeMaxCash = $options->getFidelityTimeMaxCashConfig ();
353
+ }
354
+ elseif ($module=='accumulated') {
355
+ $maxCash = $options->getAccumulatedMaxCashConfig ();
356
+ $enableSiretChecking = $options->getAccumulatedEnableSiretConfig ();
357
+ $timeMaxCash = $options->getAccumulatedTimeMaxCashConfig ();
358
+ }
359
+ $resource = Mage::getSingleton('core/resource');
360
+ $read = $resource->getConnection('core_read');
361
+ $datetime = Mage::getModel('core/date')->gmtDate();
362
+ $select = $read->select()
363
+ ->from($resource->getTableName('auguria_sponsorship/change'), 'SUM(points)')
364
+ ->where('customer_id=?', $customerId)
365
+ ->where('module=?', $module)
366
+ ->where('type=?', 'cash')
367
+ ->where('statut!=?', 'canceled')
368
+ ->where('TO_DAYS("'.$datetime.'") - TO_DAYS(datetime) <=?', $timeMaxCash);
369
+
370
+ $cashPoints = $read->fetchOne($select);
371
+
372
+ //Addition des points déjà changés avec les points demandés
373
+ $cashPoints = $points+$cashPoints;
374
+
375
+ //vérification que le total ne dépasse pas le maximum autorisé
376
+ if ($enableSiretChecking && ($cashPoints >= $maxCash)) {
377
+ if (!$customer->getSiret())
378
+ {
379
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__('To change more cash, you must specify a company number.'));
380
+ $validate = 'account';
381
+ }
382
+ }else{
383
+
384
+ //vérification que les points à changer sonts inférieurs aux points du client
385
+ if ($points != '')
386
+ {
387
+ $data = 'get'.ucfirst($module).'Points';
388
+ $cPoints = $customer->$data();
389
+ if ($points>$cPoints)
390
+ {
391
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("You do not have as many points."));
392
+ $validate = 'points';
393
+ }
394
+ else {
395
+
396
+ //envoi du mail--------------------------------------------------------------
397
+ //construction du message
398
+ $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
399
+
400
+ $sender_name = Mage::getStoreConfig('trans_email/ident_sales/name');
401
+ $sender_email = Mage::getStoreConfig('trans_email/ident_sales/email');
402
+ $subject = $this->__('%s cash exchange', Mage::helper('auguria_sponsorship/mail')->getStoreName());
403
+
404
+ $sender = array("name"=>$sender_name, "email"=>$sender_email);
405
+ $recipient_email = $customer->getData('email');
406
+
407
+ $postObject = new Varien_Object();
408
+ $postObject->setData(Array ("sender_name" => $sender_name,
409
+ "sender_email" => $sender_email,
410
+ "recipient_firstname" => $customer->getFirstname(),
411
+ "recipient_lastname" => $customer->getLastname(),
412
+ "discount_amount" => $points,
413
+ "subject" => $subject,
414
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
415
+ ));
416
+
417
+ $mailTemplate->setDesignConfig(array('area' => 'frontend'))
418
+ ->setReplyTo($sender_email)
419
+ ->sendTransactional(
420
+ Mage::getStoreConfig('auguria_sponsorship/cash/template'),
421
+ $sender,
422
+ $recipient_email,
423
+ $customer->getFirstname().' '.$customer->getLastname(),
424
+ array('data' => $postObject)
425
+ );
426
+ if (!$mailTemplate->getSentSuccess())
427
+ {
428
+ $validate = "mail";
429
+ }
430
+ /* envoi de l'email a l'administration */
431
+ $subject = $this->__('A customer wants to exchange %s Euros', $points);
432
+
433
+ $adminEmail = Mage::helper('auguria_sponsorship/config')->getAdministratorEmail();
434
+ if($adminEmail){
435
+ $administratorPostObject = new Varien_Object();
436
+ $administratorPostObject->setData(Array ("sender_name" => $sender_name,
437
+ "sender_email" => $sender_email,
438
+ "recipient_firstname" => $customer->getFirstname(),
439
+ "recipient_lastname" => $customer->getLastname(),
440
+ "discount_amount" => $points,
441
+ "subject" => $subject,
442
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
443
+ ));
444
+
445
+ $mailTemplate->setDesignConfig(array('area' => 'frontend'))
446
+ ->setReplyTo($sender_email)
447
+ ->sendTransactional(
448
+ Mage::getStoreConfig('auguria_sponsorship/cash/template'),
449
+ $sender,
450
+ $adminEmail,
451
+ $customer->getFirstname().' '.$customer->getLastname(),
452
+ array('data' => $administratorPostObject)
453
+ );
454
+ }
455
+ }
456
+ }
457
  }
458
  }
459
  return $validate;
469
  $value = round($points*$PointsToCash,2);
470
  return $value;
471
  }
472
+ }
app/code/community/Auguria/Sponsorship/controllers/PointsController.php~ ADDED
@@ -0,0 +1,471 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ class Auguria_Sponsorship_PointsController extends Mage_Core_Controller_Front_Action
9
+ {
10
+
11
+ protected $_couponCode = NULL;
12
+
13
+ public function preDispatch()
14
+ {
15
+ parent::preDispatch();
16
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
17
+ $this->_redirectUrl(Mage::helper('customer')->getAccountUrl());
18
+ }
19
+ }
20
+
21
+
22
+ public function indexAction()
23
+ {
24
+ $mode = Mage::helper('auguria_sponsorship/config')->getModuleMode();
25
+ if ($mode=='accumulated') {
26
+ $this->_redirect('*/*/accumulated');
27
+ }
28
+ elseif ($mode=='separated') {
29
+ $this->_redirect('*/*/sponsorship');
30
+ }
31
+ elseif ($mode=='sponsorship') {
32
+ $this->_redirect('*/*/sponsorship');
33
+ }
34
+ elseif ($mode=='fidelity') {
35
+ $this->_redirect('*/*/fidelity');
36
+ }
37
+ else {
38
+ $this->_redirectUrl(Mage::helper('customer')->getAccountUrl());
39
+ }
40
+ }
41
+
42
+ public function accumulatedAction()
43
+ {
44
+ $this->loadLayout();
45
+ $this->getLayout()->getBlock('customer');
46
+ $this->_initLayoutMessages('customer/session');
47
+ $this->_initLayoutMessages('catalog/session');
48
+ $this->renderLayout();
49
+ }
50
+
51
+ public function sponsorshipAction()
52
+ {
53
+ $this->loadLayout();
54
+ $this->getLayout()->getBlock('customer');
55
+ $this->_initLayoutMessages('customer/session');
56
+ $this->_initLayoutMessages('catalog/session');
57
+ $this->renderLayout();
58
+ }
59
+
60
+ public function fidelityAction()
61
+ {
62
+ $this->loadLayout();
63
+ $this->getLayout()->getBlock('customer');
64
+ $this->_initLayoutMessages('customer/session');
65
+ $this->_initLayoutMessages('catalog/session');
66
+ $this->renderLayout();
67
+ }
68
+
69
+ /**
70
+ * @TODO changeAccumulated + changeFidelityAction + changeSponsorshipAction
71
+ *
72
+ */
73
+
74
+ public function changeAction()
75
+ {
76
+ $module = $this->getRequest()->getParam('module');
77
+ $type = $this->getRequest()->getParam('type');
78
+
79
+ //Set used module in session on change action for recover in checkout
80
+ Mage::getSingleton('customer/session')->setData('auguria_sponsorship_change_module', $module);
81
+
82
+ $resultValidate = $this->_validateChange($module, $type);
83
+ if ($resultValidate == 'valide' )
84
+ {
85
+ $this->loadLayout();
86
+ $block = $this->getLayout()->getBlock('customer_pointschange_'.$type);
87
+ $this->getLayout()->getBlock('content')->append($block);
88
+ $this->_initLayoutMessages('customer/session');
89
+ $this->_initLayoutMessages('catalog/session');
90
+ $this->renderLayout();
91
+ }
92
+ elseif ($resultValidate == 'inactif' )
93
+ {
94
+ $this->_redirect('*/*/');
95
+ }
96
+ elseif ($resultValidate == 'account' )
97
+ {
98
+ $this->_redirectUrl(Mage::helper('customer')->getAccountUrl().'edit');
99
+ }
100
+ }
101
+
102
+ public function saveAction()
103
+ {
104
+ if (!$this->_validateFormKey()) {
105
+ return $this->_redirect('*/*');
106
+ }
107
+ else
108
+ {
109
+ $module = $this->getRequest()->getPost('module');
110
+ $type = $this->getRequest()->getPost('type');
111
+ $points = $this->getRequest()->getPost('points');
112
+
113
+ $resultValidate = $this->_validateChange($module, $type, $points);
114
+
115
+ $value = $this->_getValue($points, $type, $module);
116
+
117
+ if ($resultValidate == 'valide' )
118
+ {
119
+ try
120
+ {
121
+ $customerId = Mage::getSingleton('customer/session')->getId();
122
+ $customer = Mage::getModel("customer/customer")->load($customerId);
123
+
124
+ //récupération des points clients
125
+ $getdatapoints = 'get'.ucfirst($module).'Points';
126
+ $cPoints = $customer->$getdatapoints();
127
+ //décrémentation des points du client
128
+ $setdatapoints = 'set'.ucfirst($module).'Points';
129
+ $newPoints = $cPoints - $points;
130
+ $customer->$setdatapoints($newPoints);
131
+ $customer->save();
132
+
133
+ $dateTime = Mage::getModel('core/date')->gmtDate();
134
+ $statut = "waiting";
135
+
136
+ //inscription de l'opération dans la table des echanges
137
+ $echange = Mage::getModel('auguria_sponsorship/change');
138
+
139
+ $row = array(
140
+ 'customer_id' => $customerId,
141
+ 'type' => $type,
142
+ 'module' => $module,
143
+ 'statut' => $statut,
144
+ 'datetime' => $dateTime,
145
+ 'points' => $points,
146
+ 'value' => $value,
147
+ 'coupon_code' => $this->_couponCode
148
+ );
149
+ $echange->setData($row);
150
+ $echange->save();
151
+ $echangeId = $echange->getId();
152
+
153
+ //inscription dans les logs
154
+ $log = Mage::getModel('auguria_sponsorship/log');
155
+ $data = array(
156
+ 'customer_id' => $customerId,
157
+ 'record_id' => $echangeId,
158
+ 'record_type' => $type,
159
+ 'datetime' => $dateTime,
160
+ 'points' => -$points
161
+ );
162
+ $log->setData($data);
163
+ $log->save();
164
+ Mage::getSingleton('customer/session')->addSuccess(Mage::helper('auguria_sponsorship')->__('Your request has been submitted, you will soon receive an email confirmation.'));
165
+ if ($module=='sponsor') {
166
+ $module = 'sponsorship';
167
+ }
168
+ $this->_redirect('*/*/'.$module);
169
+ }
170
+
171
+ catch (Exception $e) {
172
+ Mage::log($e->getMessage());
173
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("An error occurred while saving your request."));
174
+ $this->_redirect('*/*/');
175
+ }
176
+ }
177
+ elseif ($resultValidate == 'inactif' )
178
+ {
179
+ $this->_redirect('*/*/');
180
+ }
181
+ elseif ($resultValidate == 'account' )
182
+ {
183
+ $this->_redirectUrl(Mage::helper('customer')->getAccountUrl().'edit');
184
+ }
185
+ elseif ($resultValidate == 'points' )
186
+ {
187
+ $this->_redirect('*/*/change', Array('module'=>$module, 'type'=>$type));
188
+ }
189
+ elseif ($resultValidate == 'mail' )
190
+ {
191
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("An error occurred while sending mail."));
192
+ $this->_redirect('*/*/change', Array('module'=>$module, 'type'=>$type));
193
+ }
194
+ }
195
+ }
196
+
197
+ protected function _validateChange($module, $type, $points='')
198
+ {
199
+ $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
200
+ $session = Mage::getSingleton('customer/session');
201
+
202
+ $Module = ucfirst($module);
203
+ $Type = ucfirst($type);
204
+
205
+ $changeEnabled = 'get'.$Module.$Type.'Config';
206
+ $moduleEnabled = 'get'.$Module.'EnabledConfig';
207
+
208
+ if (($options->$moduleEnabled()==1 && $options->$changeEnabled()==1))
209
+ {
210
+ $validate = '_validate'.$Type;
211
+ return $this->$validate($module,$points);
212
+ }
213
+ else
214
+ {
215
+ $session->addError(Mage::helper('auguria_sponsorship')->__('The exchange of %s points in %s is disabled.',$this->__($module),$this->__($type)));
216
+ return 'inactif';
217
+ }
218
+ }
219
+ protected function _validateCoupon ($module, $points='')
220
+ {
221
+ $validate = 'valide';
222
+ $customerId = Mage::getSingleton('customer/session')->getId();
223
+ $customer = Mage::getModel("customer/customer")->load($customerId);
224
+
225
+ //vérification que les points à changer sonts inférieurs aux points du client
226
+ if ($points != '')
227
+ {
228
+ $data = 'get'.ucfirst($module).'Points';
229
+ $cPoints = $customer->$data();
230
+ if ($points>$cPoints)
231
+ {
232
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("You do not have as many points."));
233
+ $validate = 'points';
234
+ }
235
+ else
236
+ {
237
+ //création de la règle panier---------------------------------------------------
238
+ $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
239
+ $srModel = Mage::getModel('salesrule/rule');
240
+ $date = Mage::getModel('core/date')->gmtDate();
241
+ $chars = array("-", ":", " ");
242
+ $simpledate = str_replace($chars, "", $date);
243
+ $couponCode = $customerId."-".$points.$simpledate;//idClient-date-module-somme
244
+ $name = $this->__("%s points exchange for customer (%s)", $this->__($module), $customerId);
245
+ $description = $name;
246
+ $customerGroupId = $customer->getGroupId();
247
+ $discountAmount = $this->_getValue ($points, "coupon", $module);
248
+ $websiteId = $customer->getWebsiteId();
249
+ $data = array
250
+ (
251
+ "name" => $name,
252
+ "description" => $description,
253
+ "from_date" => $date,
254
+ "coupon_code" => $couponCode,
255
+ "coupon_type" => 2,
256
+ "uses_per_coupon" => 1,
257
+ //"uses_per_customer" => 1,
258
+ "customer_group_ids" => Array(0 => $customerGroupId),//get customer group
259
+ "is_active" => 1,
260
+ "conditions_serialized" => 'a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}',
261
+ "actions_serialized" => 'a:6:{s:4:"type";s:40:"salesrule/rule_condition_product_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}',
262
+ "stop_rules_processing" => 0,
263
+ "is_advanced" => 1,
264
+ "sort_order" => 0,
265
+ "simple_action" => "cart_fixed",
266
+ "discount_amount" => $discountAmount,
267
+ "discount_qty" => 1.0000,
268
+ "discount_step" => 0,
269
+ "simple_free_shipping" => 0,
270
+ "times_used" => 0,
271
+ "is_rss" => 1,
272
+ "website_ids" => Array(0 => $websiteId)//get website id
273
+ );
274
+ $srModel->setData($data);
275
+ $srModel->save();
276
+ $this->_couponCode = $srModel->getData('coupon_code');
277
+ //envoi du mail--------------------------------------------------------------
278
+ //construction du message
279
+ $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
280
+
281
+ $sender_name = Mage::getStoreConfig('trans_email/ident_sales/name');
282
+ $sender_email = Mage::getStoreConfig('trans_email/ident_sales/email');
283
+
284
+ $subject = $this->__('%s vouchers points exchange', Mage::helper('auguria_sponsorship/mail')->getStoreName());
285
+
286
+ $sender = array("name"=>$sender_name, "email"=>$sender_email);
287
+ $recipient_email = $customer->getData('email');
288
+
289
+ $postObject = new Varien_Object();
290
+ $postObject->setData(Array ("sender_name" => $sender_name,
291
+ "sender_email" => $sender_email,
292
+ "recipient_firstname" => $customer->getFirstname(),
293
+ "recipient_lastname" => $customer->getLastname(),
294
+ "discount_amount" => $discountAmount,
295
+ "subject" => $subject,
296
+ "coupon_code" => $couponCode,
297
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
298
+ ));
299
+
300
+ $mailTemplate->setDesignConfig(array('area' => 'frontend'))
301
+ ->setReplyTo($sender_email)
302
+ //->setReturnPath($sender_email)
303
+ ->sendTransactional(
304
+ Mage::getStoreConfig('auguria_sponsorship/coupon/template'),
305
+ $sender,
306
+ $recipient_email,
307
+ $customer->getFirstname().' '.$customer->getLastname(),
308
+ array('data' => $postObject)
309
+ );
310
+ if (!$mailTemplate->getSentSuccess())
311
+ {
312
+ $validate = "mail";
313
+ }
314
+
315
+ }
316
+ }
317
+ return $validate;
318
+ }
319
+
320
+ protected function _validateGift ($module, $points='')
321
+ {
322
+ return 'valide';
323
+ }
324
+
325
+ protected function _validateCash ($module, $points=0)
326
+ {
327
+ $validate = 'valide';
328
+ $customerId = Mage::getSingleton('customer/session')->getId();
329
+ //Validation qu'un Iban est renseigné
330
+ $customer = Mage::getModel("customer/customer")->load($customerId);
331
+
332
+ if ($points != 0)
333
+ {
334
+ $maxCash = "";
335
+ $enableSiretChecking = true;
336
+ $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
337
+
338
+ if (!$customer->getIban() || !$customer->getBic()) {
339
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__('To change your points into cash, you must indicate your IBAN and BIC.'));
340
+ $validate = 'account';
341
+ }
342
+
343
+ //Validation qu'un Siret est renseigné si le max de cash pour un particulier est atteint
344
+ if ($module=='sponsor') {
345
+ $maxCash = $options->getSponsorMaxCashConfig ();
346
+ $enableSiretChecking = $options->getSponsorEnableSiretConfig ();
347
+ $timeMaxCash = $options->getSponsorTimeMaxCashConfig ();
348
+ }
349
+ elseif ($module=='fidelity') {
350
+ $maxCash = $options->getFidelityMaxCashConfig ();
351
+ $enableSiretChecking = $options->getFidelityEnableSiretConfig ();
352
+ $timeMaxCash = $options->getFidelityTimeMaxCashConfig ();
353
+ }
354
+ elseif ($module=='accumulated') {
355
+ $maxCash = $options->getAccumulatedMaxCashConfig ();
356
+ $enableSiretChecking = $options->getAccumulatedEnableSiretConfig ();
357
+ $timeMaxCash = $options->getAccumulatedTimeMaxCashConfig ();
358
+ }
359
+ $resource = Mage::getSingleton('core/resource');
360
+ $read = $resource->getConnection('core_read');
361
+ $datetime = Mage::getModel('core/date')->gmtDate();
362
+ $select = $read->select()
363
+ ->from($resource->getTableName('auguria_sponsorship/change'), 'SUM(points)')
364
+ ->where('customer_id=?', $customerId)
365
+ ->where('module=?', $module)
366
+ ->where('type=?', 'cash')
367
+ ->where('statut!=?', 'canceled')
368
+ ->where('TO_DAYS("'.$datetime.'") - TO_DAYS(datetime) <=?', $timeMaxCash);
369
+
370
+ $cashPoints = $read->fetchOne($select);
371
+
372
+ //Addition des points déjà changés avec les points demandés
373
+ $cashPoints = $points+$cashPoints;
374
+
375
+ //vérification que le total ne dépasse pas le maximum autorisé
376
+ if ($enableSiretChecking && ($cashPoints >= $maxCash)) {
377
+ if (!$customer->getSiret())
378
+ {
379
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__('To change more cash, you must specify a company number.'));
380
+ $validate = 'account';
381
+ }
382
+ }else{
383
+
384
+ //vérification que les points à changer sonts inférieurs aux points du client
385
+ if ($points != '')
386
+ {
387
+ $data = 'get'.ucfirst($module).'Points';
388
+ $cPoints = $customer->$data();
389
+ if ($points>$cPoints)
390
+ {
391
+ Mage::getSingleton('customer/session')->addError(Mage::helper('auguria_sponsorship')->__("You do not have as many points."));
392
+ $validate = 'points';
393
+ }
394
+ } else {
395
+
396
+ //envoi du mail--------------------------------------------------------------
397
+ //construction du message
398
+ $mailTemplate = Mage::getModel('auguria_sponsorship/Core_Email_Template');
399
+
400
+ $sender_name = Mage::getStoreConfig('trans_email/ident_sales/name');
401
+ $sender_email = Mage::getStoreConfig('trans_email/ident_sales/email');
402
+ $subject = $this->__('%s cash exchange', Mage::helper('auguria_sponsorship/mail')->getStoreName());
403
+
404
+ $sender = array("name"=>$sender_name, "email"=>$sender_email);
405
+ $recipient_email = $customer->getData('email');
406
+
407
+ $postObject = new Varien_Object();
408
+ $postObject->setData(Array ("sender_name" => $sender_name,
409
+ "sender_email" => $sender_email,
410
+ "recipient_firstname" => $customer->getFirstname(),
411
+ "recipient_lastname" => $customer->getLastname(),
412
+ "discount_amount" => $points,
413
+ "subject" => $subject,
414
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
415
+ ));
416
+
417
+ $mailTemplate->setDesignConfig(array('area' => 'frontend'))
418
+ ->setReplyTo($sender_email)
419
+ ->sendTransactional(
420
+ Mage::getStoreConfig('auguria_sponsorship/cash/template'),
421
+ $sender,
422
+ $recipient_email,
423
+ $customer->getFirstname().' '.$customer->getLastname(),
424
+ array('data' => $postObject)
425
+ );
426
+ if (!$mailTemplate->getSentSuccess())
427
+ {
428
+ $validate = "mail";
429
+ }
430
+ /* envoi de l'email a l'administration */
431
+ $subject = $this->__('A customer wants to exchange %s Euros', $points);
432
+
433
+ $adminEmail = Mage::helper('auguria_sponsorship/config')->getAdministratorEmail();
434
+ if($adminEmail){
435
+ $administratorPostObject = new Varien_Object();
436
+ $administratorPostObject->setData(Array ("sender_name" => $sender_name,
437
+ "sender_email" => $sender_email,
438
+ "recipient_firstname" => $customer->getFirstname(),
439
+ "recipient_lastname" => $customer->getLastname(),
440
+ "discount_amount" => $points,
441
+ "subject" => $subject,
442
+ "store_name" => Mage::helper('auguria_sponsorship/mail')->getStoreName()
443
+ ));
444
+
445
+ $mailTemplate->setDesignConfig(array('area' => 'frontend'))
446
+ ->setReplyTo($sender_email)
447
+ ->sendTransactional(
448
+ Mage::getStoreConfig('auguria_sponsorship/cash/template'),
449
+ $sender,
450
+ $adminEmail,
451
+ $customer->getFirstname().' '.$customer->getLastname(),
452
+ array('data' => $administratorPostObject)
453
+ );
454
+ }
455
+ }
456
+ }
457
+ }
458
+ return $validate;
459
+ }
460
+
461
+ protected function _getValue ($points, $type, $module)
462
+ {
463
+ //if ($type == 'cash')
464
+ //recuperation du taux de conversion
465
+ $options = Mage::getBlockSingleton('auguria_sponsorship/customer_account_pointsDetail');
466
+ $getPointsToCash = 'get'.ucfirst($module).'PointsToCashConfig';
467
+ $PointsToCash = $options->$getPointsToCash();
468
+ $value = round($points*$PointsToCash,2);
469
+ return $value;
470
+ }
471
+ }
app/code/community/Auguria/Sponsorship/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Auguria_Sponsorship>
13
- <version>1.2.8</version>
14
  </Auguria_Sponsorship>
15
  </modules>
16
  <frontend>
@@ -54,6 +54,11 @@
54
  <class>Auguria_Sponsorship_Model_Observer</class>
55
  <method>setSponsorOnOrder</method>
56
  </auguria_sponsorship_set_sponsorship>
 
 
 
 
 
57
  <!-- Remove points in customer accounts if auguria_sponsorship_discount is set, log and insert in change -->
58
  <auguria_sponsorship_remove_cart_points_exchange>
59
  <type>singleton</type>
@@ -340,7 +345,7 @@
340
  <to_shipment>*</to_shipment>
341
  <to_cm>*</to_cm>
342
  </auguria_sponsorship_discount_amount>
343
- </sales_convert_order>
344
  </fieldsets>
345
  <models>
346
  <catalogrule_mysql4>
@@ -436,6 +441,11 @@
436
  </helpers>
437
  <template>
438
  <email>
 
 
 
 
 
439
  <auguria_sponsorship_coupon_template translate="label" module="auguria_sponsorship">
440
  <label>Sponsorship coupon</label>
441
  <file>auguria/sponsorship/sponsorship_coupon.html</file>
@@ -503,6 +513,7 @@
503
  <coupon>1</coupon>
504
  <cart>0</cart>
505
  <gift>0</gift>
 
506
  <max_cash>350</max_cash>
507
  <time_max_cash>90</time_max_cash>
508
  <points_to_cash>1</points_to_cash>
@@ -526,6 +537,7 @@
526
  <sponsor_coupon>1</sponsor_coupon>
527
  <sponsor_cart>0</sponsor_cart>
528
  <sponsor_gift>0</sponsor_gift>
 
529
  <sponsor_max_cash>350</sponsor_max_cash>
530
  <sponsor_time_max_cash>90</sponsor_time_max_cash>
531
  <sponsor_points_to_cash>1</sponsor_points_to_cash>
@@ -546,7 +558,8 @@
546
  <fidelity_cash>1</fidelity_cash>
547
  <fidelity_coupon>1</fidelity_coupon>
548
  <fidelity_cart>0</fidelity_cart>
549
- <fidelity_gift>0</fidelity_gift>
 
550
  <fidelity_max_cash>350</fidelity_max_cash>
551
  <fidelity_time_max_cash>90</fidelity_time_max_cash>
552
  <fidelity_points_to_cash>1</fidelity_points_to_cash>
@@ -564,6 +577,9 @@
564
  <coupon>
565
  <template>auguria_sponsorship_coupon_template</template>
566
  </coupon>
 
 
 
567
  <open_inviter>
568
  <open_inviter_enabled>0</open_inviter_enabled>
569
  <username></username>
10
  <config>
11
  <modules>
12
  <Auguria_Sponsorship>
13
+ <version>1.3.2</version>
14
  </Auguria_Sponsorship>
15
  </modules>
16
  <frontend>
54
  <class>Auguria_Sponsorship_Model_Observer</class>
55
  <method>setSponsorOnOrder</method>
56
  </auguria_sponsorship_set_sponsorship>
57
+ <auguria_sponsorship_set_coupon_code>
58
+ <type>singleton</type>
59
+ <class>Auguria_Sponsorship_Model_Observer</class>
60
+ <method>setCouponCode</method>
61
+ </auguria_sponsorship_set_coupon_code>
62
  <!-- Remove points in customer accounts if auguria_sponsorship_discount is set, log and insert in change -->
63
  <auguria_sponsorship_remove_cart_points_exchange>
64
  <type>singleton</type>
345
  <to_shipment>*</to_shipment>
346
  <to_cm>*</to_cm>
347
  </auguria_sponsorship_discount_amount>
348
+ </sales_convert_order>
349
  </fieldsets>
350
  <models>
351
  <catalogrule_mysql4>
441
  </helpers>
442
  <template>
443
  <email>
444
+ <auguria_sponsorship_cash_template translate="label" module="auguria_sponsorship">
445
+ <label>Sponsorship cash</label>
446
+ <file>auguria/sponsorship/sponsorship_cash.html</file>
447
+ <type>html</type>
448
+ </auguria_sponsorship_cash_template>
449
  <auguria_sponsorship_coupon_template translate="label" module="auguria_sponsorship">
450
  <label>Sponsorship coupon</label>
451
  <file>auguria/sponsorship/sponsorship_coupon.html</file>
513
  <coupon>1</coupon>
514
  <cart>0</cart>
515
  <gift>0</gift>
516
+ <enable_check_company_number>1</enable_check_company_number>
517
  <max_cash>350</max_cash>
518
  <time_max_cash>90</time_max_cash>
519
  <points_to_cash>1</points_to_cash>
537
  <sponsor_coupon>1</sponsor_coupon>
538
  <sponsor_cart>0</sponsor_cart>
539
  <sponsor_gift>0</sponsor_gift>
540
+ <enable_check_company_number>1</enable_check_company_number>
541
  <sponsor_max_cash>350</sponsor_max_cash>
542
  <sponsor_time_max_cash>90</sponsor_time_max_cash>
543
  <sponsor_points_to_cash>1</sponsor_points_to_cash>
558
  <fidelity_cash>1</fidelity_cash>
559
  <fidelity_coupon>1</fidelity_coupon>
560
  <fidelity_cart>0</fidelity_cart>
561
+ <fidelity_gift>0</fidelity_gift>
562
+ <enable_check_company_number>1</enable_check_company_number>
563
  <fidelity_max_cash>350</fidelity_max_cash>
564
  <fidelity_time_max_cash>90</fidelity_time_max_cash>
565
  <fidelity_points_to_cash>1</fidelity_points_to_cash>
577
  <coupon>
578
  <template>auguria_sponsorship_coupon_template</template>
579
  </coupon>
580
+ <cash>
581
+ <template>auguria_sponsorship_cash_template</template>
582
+ </cash>
583
  <open_inviter>
584
  <open_inviter_enabled>0</open_inviter_enabled>
585
  <username></username>
app/code/community/Auguria/Sponsorship/etc/system.xml CHANGED
@@ -45,10 +45,13 @@
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
47
  <fields>
 
 
 
48
  <heading_calculation translate="label">
49
  <label>Points calculation</label>
50
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
51
- <sort_order>100</sort_order>
52
  <show_in_default>1</show_in_default>
53
  <show_in_website>1</show_in_website>
54
  <show_in_store>1</show_in_store>
@@ -57,7 +60,7 @@
57
  <label>Points validity in days(0 for unlimited)</label>
58
  <frontend_type>text</frontend_type>
59
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
60
- <sort_order>101</sort_order>
61
  <show_in_default>1</show_in_default>
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>1</show_in_store>
@@ -66,107 +69,111 @@
66
  <label>Cancel earned points on credit memo creation</label>
67
  <frontend_type>select</frontend_type>
68
  <source_model>adminhtml/system_config_source_yesno</source_model>
69
- <sort_order>104</sort_order>
70
  <show_in_default>1</show_in_default>
71
  <show_in_website>1</show_in_website>
72
  <show_in_store>1</show_in_store>
73
  </cancel_earned_points>
74
  <points_to_cash>
75
- <label>Conversion rate of points in currency</label>
76
- <frontend_type>text</frontend_type>
77
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
78
- <sort_order>107</sort_order>
79
- <show_in_default>1</show_in_default>
80
- <show_in_website>1</show_in_website>
81
- <show_in_store>1</show_in_store>
82
  </points_to_cash>
83
  <newsletter_points>
84
- <label>Amount of winning points when subscribe to newsletter on account creation</label>
85
- <frontend_type>text</frontend_type>
86
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
87
- <sort_order>108</sort_order>
88
- <show_in_default>1</show_in_default>
89
- <show_in_website>1</show_in_website>
90
- <show_in_store>1</show_in_store>
91
  </newsletter_points>
92
  <first_order_points>
93
- <label>Amount of winning points for first order</label>
94
- <frontend_type>text</frontend_type>
95
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
96
- <sort_order>109</sort_order>
97
- <show_in_default>1</show_in_default>
98
- <show_in_website>1</show_in_website>
99
- <show_in_store>1</show_in_store>
100
  </first_order_points>
101
 
102
 
103
 
104
-
105
-
106
  <heading_cash translate="label">
107
  <label>Cash exchange</label>
108
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
109
- <sort_order>200</sort_order>
110
  <show_in_default>1</show_in_default>
111
  <show_in_website>1</show_in_website>
112
  </heading_cash>
113
  <cash>
114
- <label>Cash exchange enabled</label>
115
- <frontend_type>select</frontend_type>
116
- <source_model>adminhtml/system_config_source_yesno</source_model>
117
- <sort_order>201</sort_order>
118
- <show_in_default>1</show_in_default>
119
- <show_in_website>1</show_in_website>
120
- <show_in_store>1</show_in_store>
121
  </cash>
 
 
 
 
 
 
 
 
 
 
122
  <max_cash>
123
- <label>Maximum amount permitted without company number</label>
124
- <frontend_type>text</frontend_type>
125
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
126
- <sort_order>205</sort_order>
127
- <show_in_default>1</show_in_default>
128
- <show_in_website>1</show_in_website>
129
- <show_in_store>1</show_in_store>
130
  </max_cash>
131
  <time_max_cash>
132
- <label>Calculation period of the maximum allowed for an individual (days)</label>
133
- <frontend_type>text</frontend_type>
134
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
135
- <sort_order>206</sort_order>
136
- <show_in_default>1</show_in_default>
137
- <show_in_website>1</show_in_website>
138
- <show_in_store>1</show_in_store>
139
  </time_max_cash>
140
 
141
 
142
 
143
-
144
  <heading_coupon translate="label">
145
  <label>Coupon exchange</label>
146
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
147
- <sort_order>300</sort_order>
148
  <show_in_default>1</show_in_default>
149
  <show_in_website>1</show_in_website>
150
  </heading_coupon>
151
  <coupon>
152
- <label>Voucher exchange enabled</label>
153
- <frontend_type>select</frontend_type>
154
- <source_model>adminhtml/system_config_source_yesno</source_model>
155
- <sort_order>301</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
  </coupon>
160
 
161
 
162
 
163
-
164
-
165
-
166
  <heading_cart translate="label">
167
  <label>Cart exchange</label>
168
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
169
- <sort_order>400</sort_order>
170
  <show_in_default>1</show_in_default>
171
  <show_in_website>1</show_in_website>
172
  <show_in_store>1</show_in_store>
@@ -175,7 +182,7 @@
175
  <label>Automatic discount in cart</label>
176
  <frontend_type>select</frontend_type>
177
  <source_model>adminhtml/system_config_source_yesno</source_model>
178
- <sort_order>401</sort_order>
179
  <show_in_default>1</show_in_default>
180
  <show_in_website>1</show_in_website>
181
  <show_in_store>1</show_in_store>
@@ -184,7 +191,7 @@
184
  <label>Cancel the use of points on credit memo creation</label>
185
  <frontend_type>select</frontend_type>
186
  <source_model>adminhtml/system_config_source_yesno</source_model>
187
- <sort_order>411</sort_order>
188
  <show_in_default>1</show_in_default>
189
  <show_in_website>1</show_in_website>
190
  <show_in_store>1</show_in_store>
@@ -192,23 +199,22 @@
192
 
193
 
194
 
195
-
196
  <heading_gift translate="label">
197
  <label>Gift exchange</label>
198
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
199
- <sort_order>500</sort_order>
200
  <show_in_default>1</show_in_default>
201
  <show_in_website>1</show_in_website>
202
  <show_in_store>1</show_in_store>
203
  </heading_gift>
204
  <gift>
205
- <label>Gift exchange enabled</label>
206
- <frontend_type>select</frontend_type>
207
- <source_model>adminhtml/system_config_source_yesno</source_model>
208
- <sort_order>501</sort_order>
209
- <show_in_default>1</show_in_default>
210
- <show_in_website>1</show_in_website>
211
- <show_in_store>1</show_in_store>
212
  </gift>
213
 
214
 
@@ -216,85 +222,84 @@
216
  <heading_sponsorship translate="label">
217
  <label>Sponsorship</label>
218
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
219
- <sort_order>600</sort_order>
220
  <show_in_default>1</show_in_default>
221
  <show_in_website>1</show_in_website>
222
  <show_in_store>1</show_in_store>
223
  </heading_sponsorship>
224
  <optional_order>
225
- <label>Allow customers who have never ordered to send sponsorship invitations</label>
226
- <frontend_type>select</frontend_type>
227
- <source_model>adminhtml/system_config_source_yesno</source_model>
228
- <sort_order>601</sort_order>
229
- <show_in_default>1</show_in_default>
230
- <show_in_website>1</show_in_website>
231
- <show_in_store>1</show_in_store>
232
  </optional_order>
233
  <allow_invit_registred_users>
234
- <label>Allow to sponsor registred customers (but never ordered)</label>
235
- <frontend_type>select</frontend_type>
236
- <source_model>adminhtml/system_config_source_yesno</source_model>
237
- <sort_order>602</sort_order>
238
- <show_in_default>1</show_in_default>
239
- <show_in_website>1</show_in_website>
240
- <show_in_store>1</show_in_store>
241
  </allow_invit_registred_users>
242
- <notification_enabled>
243
- <label>Send notification to sponsor when godchild make him earn points</label>
244
- <frontend_type>select</frontend_type>
245
- <source_model>adminhtml/system_config_source_yesno</source_model>
246
- <sort_order>615</sort_order>
247
- <show_in_default>1</show_in_default>
248
- <show_in_website>1</show_in_website>
249
- <show_in_store>1</show_in_store>
250
- </notification_enabled>
251
- <notification>
252
- <label>Notification Email Template</label>
253
- <frontend_type>select</frontend_type>
254
- <source_model>adminhtml/system_config_source_email_template</source_model>
255
- <sort_order>630</sort_order>
256
- <show_in_default>1</show_in_default>
257
- <show_in_website>1</show_in_website>
258
- <show_in_store>1</show_in_store>
259
- </notification>
260
-
261
  <sponsor_link_validity>
262
- <label>Inactivity time before removal of the sponsorship link (days)</label>
263
- <frontend_type>text</frontend_type>
264
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
265
- <comment>Needs to active cron jobs.</comment>
266
- <sort_order>610</sort_order>
267
- <show_in_default>1</show_in_default>
268
- <show_in_website>1</show_in_website>
269
- <show_in_store>1</show_in_store>
270
  </sponsor_link_validity>
271
  <sponsor_levels>
272
- <label>Maximum levels of sponsorship</label>
273
- <frontend_type>text</frontend_type>
274
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
275
- <sort_order>611</sort_order>
276
- <show_in_default>1</show_in_default>
277
- <show_in_website>1</show_in_website>
278
- <show_in_store>1</show_in_store>
279
  </sponsor_levels>
280
  <sponsor_percent>
281
- <label>Ratio applied from level 2 to calculate the points of the sponsor (in percentage)</label>
282
- <frontend_type>text</frontend_type>
283
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
284
- <sort_order>612</sort_order>
285
- <show_in_default>1</show_in_default>
286
- <show_in_website>1</show_in_website>
287
- <show_in_store>1</show_in_store>
288
  </sponsor_percent>
289
  <godson_first_order_points>
290
- <label>Amount of winning points for the first godson order</label>
291
- <frontend_type>text</frontend_type>
292
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
293
- <sort_order>613</sort_order>
294
- <show_in_default>1</show_in_default>
295
- <show_in_website>1</show_in_website>
296
- <show_in_store>1</show_in_store>
297
  </godson_first_order_points>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  </fields>
299
  </accumulated>
300
  <sponsor translate="label">
@@ -305,11 +310,22 @@
305
  <show_in_website>1</show_in_website>
306
  <show_in_store>1</show_in_store>
307
  <fields>
 
 
 
 
 
 
 
 
 
 
 
308
  <points_validity>
309
  <label>Points validity in days(0 for unlimited)</label>
310
  <frontend_type>text</frontend_type>
311
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
312
- <sort_order>0</sort_order>
313
  <show_in_default>1</show_in_default>
314
  <show_in_website>1</show_in_website>
315
  <show_in_store>1</show_in_store>
@@ -318,88 +334,152 @@
318
  <label>Cancel earned points on credit memo creation</label>
319
  <frontend_type>select</frontend_type>
320
  <source_model>adminhtml/system_config_source_yesno</source_model>
321
- <sort_order>10</sort_order>
322
  <show_in_default>1</show_in_default>
323
  <show_in_website>1</show_in_website>
324
  <show_in_store>1</show_in_store>
325
  </cancel_earned_points>
326
- <sponsor_cash translate="label">
327
- <label>Cash exchange enabled</label>
328
- <frontend_type>select</frontend_type>
329
- <source_model>adminhtml/system_config_source_yesno</source_model>
330
- <sort_order>20</sort_order>
331
  <show_in_default>1</show_in_default>
332
  <show_in_website>1</show_in_website>
333
- <show_in_store>1</show_in_store>
334
- </sponsor_cash>
335
- <sponsor_coupon translate="label">
336
- <label>Voucher exchange enabled</label>
337
- <frontend_type>select</frontend_type>
338
- <source_model>adminhtml/system_config_source_yesno</source_model>
339
- <sort_order>30</sort_order>
 
 
340
  <show_in_default>1</show_in_default>
341
  <show_in_website>1</show_in_website>
342
- <show_in_store>1</show_in_store>
343
- </sponsor_coupon>
344
- <sponsor_cart>
345
- <label>Automatic discount in cart</label>
346
- <frontend_type>select</frontend_type>
347
- <source_model>adminhtml/system_config_source_yesno</source_model>
348
- <sort_order>40</sort_order>
349
- <show_in_default>1</show_in_default>
350
- <show_in_website>1</show_in_website>
351
- <show_in_store>1</show_in_store>
352
- </sponsor_cart>
353
- <cancel_cart_points>
354
- <label>Cancel the use of points on credit memo creation</label>
355
  <frontend_type>select</frontend_type>
356
  <source_model>adminhtml/system_config_source_yesno</source_model>
357
- <sort_order>45</sort_order>
358
  <show_in_default>1</show_in_default>
359
  <show_in_website>1</show_in_website>
360
- <show_in_store>1</show_in_store>
361
- </cancel_cart_points>
362
- <sponsor_gift translate="label">
363
- <label>Gift exchange enabled</label>
364
  <frontend_type>select</frontend_type>
365
  <source_model>adminhtml/system_config_source_yesno</source_model>
366
- <sort_order>50</sort_order>
 
367
  <show_in_default>1</show_in_default>
368
  <show_in_website>1</show_in_website>
369
  <show_in_store>1</show_in_store>
370
- </sponsor_gift>
371
  <sponsor_max_cash translate="label">
372
  <label>Maximum amount permitted without company number</label>
373
  <frontend_type>text</frontend_type>
374
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
375
- <sort_order>60</sort_order>
376
  <show_in_default>1</show_in_default>
377
  <show_in_website>1</show_in_website>
378
  <show_in_store>1</show_in_store>
379
  </sponsor_max_cash>
 
380
  <sponsor_time_max_cash translate="label">
381
  <label>Calculation period of the maximum allowed for an individual (days)</label>
382
  <frontend_type>text</frontend_type>
383
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
384
- <sort_order>70</sort_order>
385
  <show_in_default>1</show_in_default>
386
  <show_in_website>1</show_in_website>
387
  <show_in_store>1</show_in_store>
388
  </sponsor_time_max_cash>
389
- <sponsor_points_to_cash translate="label">
390
- <label>Conversion rate of points in currency</label>
391
- <frontend_type>text</frontend_type>
392
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
393
- <sort_order>80</sort_order>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
  <show_in_default>1</show_in_default>
395
  <show_in_website>1</show_in_website>
396
  <show_in_store>1</show_in_store>
397
- </sponsor_points_to_cash>
398
- <sponsor_optional_order translate="label">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  <label>Allow customers who have never ordered to send invitations</label>
400
  <frontend_type>select</frontend_type>
401
  <source_model>adminhtml/system_config_source_yesno</source_model>
402
- <sort_order>90</sort_order>
403
  <show_in_default>1</show_in_default>
404
  <show_in_website>1</show_in_website>
405
  <show_in_store>1</show_in_store>
@@ -408,7 +488,7 @@
408
  <label>Allow to sponsor registred customers (but never ordered)</label>
409
  <frontend_type>select</frontend_type>
410
  <source_model>adminhtml/system_config_source_yesno</source_model>
411
- <sort_order>100</sort_order>
412
  <show_in_default>1</show_in_default>
413
  <show_in_website>1</show_in_website>
414
  <show_in_store>1</show_in_store>
@@ -417,7 +497,7 @@
417
  <label>Inactivity time before removal of the sponsorship link (days)</label>
418
  <frontend_type>text</frontend_type>
419
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
420
- <sort_order>110</sort_order>
421
  <show_in_default>1</show_in_default>
422
  <show_in_website>1</show_in_website>
423
  <show_in_store>1</show_in_store>
@@ -426,7 +506,7 @@
426
  <label>Maximum levels of sponsorship</label>
427
  <frontend_type>text</frontend_type>
428
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
429
- <sort_order>120</sort_order>
430
  <show_in_default>1</show_in_default>
431
  <show_in_website>1</show_in_website>
432
  <show_in_store>1</show_in_store>
@@ -435,38 +515,38 @@
435
  <label>Ratio applied from level 2 to calculate the points of the sponsor (in percentage)</label>
436
  <frontend_type>text</frontend_type>
437
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
438
- <sort_order>130</sort_order>
439
  <show_in_default>1</show_in_default>
440
  <show_in_website>1</show_in_website>
441
  <show_in_store>1</show_in_store>
442
  </sponsor_percent>
443
- <godson_first_order_points>
444
  <label>Amount of winning points for the first godson order</label>
445
  <frontend_type>text</frontend_type>
446
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
447
- <sort_order>140</sort_order>
448
  <show_in_default>1</show_in_default>
449
  <show_in_website>1</show_in_website>
450
  <show_in_store>1</show_in_store>
451
- </godson_first_order_points>
452
- <notification_enabled>
453
  <label>Send notification to sponsor when godchild make him earn points</label>
454
  <frontend_type>select</frontend_type>
455
  <source_model>adminhtml/system_config_source_yesno</source_model>
456
- <sort_order>150</sort_order>
457
  <show_in_default>1</show_in_default>
458
  <show_in_website>1</show_in_website>
459
  <show_in_store>1</show_in_store>
460
- </notification_enabled>
461
  <notification translate="label">
462
- <label>Notification Email Template</label>
463
- <frontend_type>select</frontend_type>
464
  <source_model>adminhtml/system_config_source_email_template</source_model>
465
- <sort_order>160</sort_order>
466
  <show_in_default>1</show_in_default>
467
  <show_in_website>1</show_in_website>
468
  <show_in_store>1</show_in_store>
469
- </notification>
470
  </fields>
471
  </sponsor>
472
  <fidelity translate="label">
@@ -477,11 +557,22 @@
477
  <show_in_website>1</show_in_website>
478
  <show_in_store>1</show_in_store>
479
  <fields>
 
 
 
 
 
 
 
 
 
 
 
480
  <points_validity>
481
  <label>Points validity in days(0 for unlimited)</label>
482
  <frontend_type>text</frontend_type>
483
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
484
- <sort_order>0</sort_order>
485
  <show_in_default>1</show_in_default>
486
  <show_in_website>1</show_in_website>
487
  <show_in_store>1</show_in_store>
@@ -490,61 +581,72 @@
490
  <label>Cancel earned points on credit memo creation</label>
491
  <frontend_type>select</frontend_type>
492
  <source_model>adminhtml/system_config_source_yesno</source_model>
493
- <sort_order>10</sort_order>
494
  <show_in_default>1</show_in_default>
495
  <show_in_website>1</show_in_website>
496
  <show_in_store>1</show_in_store>
497
  </cancel_earned_points>
498
- <fidelity_cash translate="label">
499
- <label>Cash exchange enabled</label>
500
- <frontend_type>select</frontend_type>
501
- <source_model>adminhtml/system_config_source_yesno</source_model>
502
- <sort_order>20</sort_order>
503
  <show_in_default>1</show_in_default>
504
  <show_in_website>1</show_in_website>
505
  <show_in_store>1</show_in_store>
506
- </fidelity_cash>
507
- <fidelity_coupon translate="label">
508
- <label>Voucher exchange enabled</label>
509
- <frontend_type>select</frontend_type>
510
- <source_model>adminhtml/system_config_source_yesno</source_model>
511
- <sort_order>30</sort_order>
512
  <show_in_default>1</show_in_default>
513
  <show_in_website>1</show_in_website>
514
  <show_in_store>1</show_in_store>
515
- </fidelity_coupon>
516
- <fidelity_cart>
517
- <label>Automatic discount in cart</label>
518
- <frontend_type>select</frontend_type>
519
- <source_model>adminhtml/system_config_source_yesno</source_model>
520
- <sort_order>40</sort_order>
521
  <show_in_default>1</show_in_default>
522
  <show_in_website>1</show_in_website>
523
  <show_in_store>1</show_in_store>
524
- </fidelity_cart>
525
- <cancel_cart_points>
526
- <label>Cancel the use of points on credit memo creation</label>
 
 
 
 
 
 
 
 
 
 
527
  <frontend_type>select</frontend_type>
528
  <source_model>adminhtml/system_config_source_yesno</source_model>
529
- <sort_order>45</sort_order>
530
  <show_in_default>1</show_in_default>
531
  <show_in_website>1</show_in_website>
532
  <show_in_store>1</show_in_store>
533
- </cancel_cart_points>
534
- <fidelity_gift translate="label">
535
- <label>Gift exchange enabled</label>
536
  <frontend_type>select</frontend_type>
537
  <source_model>adminhtml/system_config_source_yesno</source_model>
538
- <sort_order>50</sort_order>
 
539
  <show_in_default>1</show_in_default>
540
  <show_in_website>1</show_in_website>
541
  <show_in_store>1</show_in_store>
542
- </fidelity_gift>
543
- <fidelity_max_cash>
544
  <label>Maximum amount permitted without company number</label>
545
  <frontend_type>text</frontend_type>
546
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
547
- <sort_order>60</sort_order>
548
  <show_in_default>1</show_in_default>
549
  <show_in_website>1</show_in_website>
550
  <show_in_store>1</show_in_store>
@@ -553,38 +655,79 @@
553
  <label>Calculation period of the maximum allowed for an individual (days)</label>
554
  <frontend_type>text</frontend_type>
555
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
556
- <sort_order>70</sort_order>
557
  <show_in_default>1</show_in_default>
558
  <show_in_website>1</show_in_website>
559
  <show_in_store>1</show_in_store>
560
  </fidelity_time_max_cash>
561
- <fidelity_points_to_cash>
562
- <label>Conversion rate of points in currency</label>
563
- <frontend_type>text</frontend_type>
564
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
565
- <sort_order>80</sort_order>
 
 
 
 
 
 
 
 
 
 
566
  <show_in_default>1</show_in_default>
567
  <show_in_website>1</show_in_website>
568
  <show_in_store>1</show_in_store>
569
- </fidelity_points_to_cash>
570
- <newsletter_points>
571
- <label>Amount of winning points when subscribe to newsletter on account creation</label>
572
- <frontend_type>text</frontend_type>
573
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
574
- <sort_order>90</sort_order>
 
 
575
  <show_in_default>1</show_in_default>
576
  <show_in_website>1</show_in_website>
577
  <show_in_store>1</show_in_store>
578
- </newsletter_points>
579
- <first_order_points>
580
- <label>Amount of winning points for first order</label>
581
- <frontend_type>text</frontend_type>
582
- <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
583
- <sort_order>100</sort_order>
584
  <show_in_default>1</show_in_default>
585
  <show_in_website>1</show_in_website>
586
  <show_in_store>1</show_in_store>
587
- </first_order_points>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
588
  </fields>
589
  </fidelity>
590
  <invitation translate="label">
@@ -599,7 +742,7 @@
599
  <label>Time validity invitations (days)</label>
600
  <frontend_type>text</frontend_type>
601
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
602
- <sort_order>1</sort_order>
603
  <show_in_default>1</show_in_default>
604
  <show_in_website>1</show_in_website>
605
  <show_in_store>1</show_in_store>
@@ -608,7 +751,7 @@
608
  <label>Time to send it automatically (days)</label>
609
  <frontend_type>text</frontend_type>
610
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
611
- <sort_order>5</sort_order>
612
  <show_in_default>1</show_in_default>
613
  <show_in_website>1</show_in_website>
614
  <show_in_store>1</show_in_store>
@@ -617,7 +760,7 @@
617
  <label>Max invitations</label>
618
  <frontend_type>text</frontend_type>
619
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
620
- <sort_order>10</sort_order>
621
  <show_in_default>1</show_in_default>
622
  <show_in_website>1</show_in_website>
623
  <show_in_store>1</show_in_store>
@@ -626,7 +769,7 @@
626
  <label>Invitation Email Template</label>
627
  <frontend_type>select</frontend_type>
628
  <source_model>adminhtml/system_config_source_email_template</source_model>
629
- <sort_order>20</sort_order>
630
  <show_in_default>1</show_in_default>
631
  <show_in_website>1</show_in_website>
632
  <show_in_store>1</show_in_store>
@@ -645,13 +788,41 @@
645
  <label>Coupon Email Template</label>
646
  <frontend_type>select</frontend_type>
647
  <source_model>adminhtml/system_config_source_email_template</source_model>
648
- <sort_order>1</sort_order>
649
  <show_in_default>1</show_in_default>
650
  <show_in_website>1</show_in_website>
651
  <show_in_store>1</show_in_store>
652
  </template>
653
  </fields>
654
  </coupon>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  <open_inviter translate="label comment">
656
  <label>Open Inviter options</label>
657
  <sort_order>7</sort_order>
@@ -664,7 +835,7 @@
664
  <label>Activated</label>
665
  <frontend_type>select</frontend_type>
666
  <source_model>adminhtml/system_config_source_yesno</source_model>
667
- <sort_order>1</sort_order>
668
  <show_in_default>1</show_in_default>
669
  <show_in_website>1</show_in_website>
670
  <show_in_store>1</show_in_store>
@@ -673,7 +844,7 @@
673
  <label>Username</label>
674
  <frontend_type>text</frontend_type>
675
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_openinviter</backend_model>
676
- <sort_order>2</sort_order>
677
  <show_in_default>1</show_in_default>
678
  <show_in_website>1</show_in_website>
679
  <show_in_store>1</show_in_store>
@@ -681,7 +852,7 @@
681
  <private_key>
682
  <label>Private Key</label>
683
  <frontend_type>text</frontend_type>
684
- <sort_order>3</sort_order>
685
  <show_in_default>1</show_in_default>
686
  <show_in_website>1</show_in_website>
687
  <show_in_store>1</show_in_store>
45
  <show_in_website>1</show_in_website>
46
  <show_in_store>1</show_in_store>
47
  <fields>
48
+
49
+
50
+
51
  <heading_calculation translate="label">
52
  <label>Points calculation</label>
53
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
54
+ <sort_order>0</sort_order>
55
  <show_in_default>1</show_in_default>
56
  <show_in_website>1</show_in_website>
57
  <show_in_store>1</show_in_store>
60
  <label>Points validity in days(0 for unlimited)</label>
61
  <frontend_type>text</frontend_type>
62
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
63
+ <sort_order>10</sort_order>
64
  <show_in_default>1</show_in_default>
65
  <show_in_website>1</show_in_website>
66
  <show_in_store>1</show_in_store>
69
  <label>Cancel earned points on credit memo creation</label>
70
  <frontend_type>select</frontend_type>
71
  <source_model>adminhtml/system_config_source_yesno</source_model>
72
+ <sort_order>20</sort_order>
73
  <show_in_default>1</show_in_default>
74
  <show_in_website>1</show_in_website>
75
  <show_in_store>1</show_in_store>
76
  </cancel_earned_points>
77
  <points_to_cash>
78
+ <label>Conversion rate of points in currency</label>
79
+ <frontend_type>text</frontend_type>
80
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
81
+ <sort_order>30</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
  </points_to_cash>
86
  <newsletter_points>
87
+ <label>Amount of winning points when subscribe to newsletter on account creation</label>
88
+ <frontend_type>text</frontend_type>
89
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
90
+ <sort_order>40</sort_order>
91
+ <show_in_default>1</show_in_default>
92
+ <show_in_website>1</show_in_website>
93
+ <show_in_store>1</show_in_store>
94
  </newsletter_points>
95
  <first_order_points>
96
+ <label>Amount of winning points for first order</label>
97
+ <frontend_type>text</frontend_type>
98
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
99
+ <sort_order>50</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
  </first_order_points>
104
 
105
 
106
 
 
 
107
  <heading_cash translate="label">
108
  <label>Cash exchange</label>
109
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
110
+ <sort_order>60</sort_order>
111
  <show_in_default>1</show_in_default>
112
  <show_in_website>1</show_in_website>
113
  </heading_cash>
114
  <cash>
115
+ <label>Cash exchange enabled</label>
116
+ <frontend_type>select</frontend_type>
117
+ <source_model>adminhtml/system_config_source_yesno</source_model>
118
+ <sort_order>70</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>1</show_in_store>
122
  </cash>
123
+ <enable_check_company_number>
124
+ <label>Enable checking company number</label>
125
+ <frontend_type>select</frontend_type>
126
+ <source_model>adminhtml/system_config_source_yesno</source_model>
127
+ <comment>If you uncheck this option, the option 'Maximum amount permitted without company number' will not be activated</comment>
128
+ <sort_order>80</sort_order>
129
+ <show_in_default>1</show_in_default>
130
+ <show_in_website>1</show_in_website>
131
+ <show_in_store>1</show_in_store>
132
+ </enable_check_company_number>
133
  <max_cash>
134
+ <label>Maximum amount permitted without company number</label>
135
+ <frontend_type>text</frontend_type>
136
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
137
+ <sort_order>90</sort_order>
138
+ <show_in_default>1</show_in_default>
139
+ <show_in_website>1</show_in_website>
140
+ <show_in_store>1</show_in_store>
141
  </max_cash>
142
  <time_max_cash>
143
+ <label>Calculation period of the maximum allowed for an individual (days)</label>
144
+ <frontend_type>text</frontend_type>
145
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
146
+ <sort_order>100</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
  </time_max_cash>
151
 
152
 
153
 
 
154
  <heading_coupon translate="label">
155
  <label>Coupon exchange</label>
156
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
157
+ <sort_order>110</sort_order>
158
  <show_in_default>1</show_in_default>
159
  <show_in_website>1</show_in_website>
160
  </heading_coupon>
161
  <coupon>
162
+ <label>Voucher exchange enabled</label>
163
+ <frontend_type>select</frontend_type>
164
+ <source_model>adminhtml/system_config_source_yesno</source_model>
165
+ <sort_order>120</sort_order>
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
  </coupon>
170
 
171
 
172
 
 
 
 
173
  <heading_cart translate="label">
174
  <label>Cart exchange</label>
175
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
176
+ <sort_order>130</sort_order>
177
  <show_in_default>1</show_in_default>
178
  <show_in_website>1</show_in_website>
179
  <show_in_store>1</show_in_store>
182
  <label>Automatic discount in cart</label>
183
  <frontend_type>select</frontend_type>
184
  <source_model>adminhtml/system_config_source_yesno</source_model>
185
+ <sort_order>140</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>
191
  <label>Cancel the use of points on credit memo creation</label>
192
  <frontend_type>select</frontend_type>
193
  <source_model>adminhtml/system_config_source_yesno</source_model>
194
+ <sort_order>150</sort_order>
195
  <show_in_default>1</show_in_default>
196
  <show_in_website>1</show_in_website>
197
  <show_in_store>1</show_in_store>
199
 
200
 
201
 
 
202
  <heading_gift translate="label">
203
  <label>Gift exchange</label>
204
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
205
+ <sort_order>160</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
  </heading_gift>
210
  <gift>
211
+ <label>Gift exchange enabled</label>
212
+ <frontend_type>select</frontend_type>
213
+ <source_model>adminhtml/system_config_source_yesno</source_model>
214
+ <sort_order>170</sort_order>
215
+ <show_in_default>1</show_in_default>
216
+ <show_in_website>1</show_in_website>
217
+ <show_in_store>1</show_in_store>
218
  </gift>
219
 
220
 
222
  <heading_sponsorship translate="label">
223
  <label>Sponsorship</label>
224
  <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
225
+ <sort_order>180</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
  </heading_sponsorship>
230
  <optional_order>
231
+ <label>Allow customers who have never ordered to send sponsorship invitations</label>
232
+ <frontend_type>select</frontend_type>
233
+ <source_model>adminhtml/system_config_source_yesno</source_model>
234
+ <sort_order>190</sort_order>
235
+ <show_in_default>1</show_in_default>
236
+ <show_in_website>1</show_in_website>
237
+ <show_in_store>1</show_in_store>
238
  </optional_order>
239
  <allow_invit_registred_users>
240
+ <label>Allow to sponsor registred customers (but never ordered)</label>
241
+ <frontend_type>select</frontend_type>
242
+ <source_model>adminhtml/system_config_source_yesno</source_model>
243
+ <sort_order>200</sort_order>
244
+ <show_in_default>1</show_in_default>
245
+ <show_in_website>1</show_in_website>
246
+ <show_in_store>1</show_in_store>
247
  </allow_invit_registred_users>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  <sponsor_link_validity>
249
+ <label>Inactivity time before removal of the sponsorship link (days)</label>
250
+ <frontend_type>text</frontend_type>
251
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
252
+ <comment>Needs to active cron jobs.</comment>
253
+ <sort_order>210</sort_order>
254
+ <show_in_default>1</show_in_default>
255
+ <show_in_website>1</show_in_website>
256
+ <show_in_store>1</show_in_store>
257
  </sponsor_link_validity>
258
  <sponsor_levels>
259
+ <label>Maximum levels of sponsorship</label>
260
+ <frontend_type>text</frontend_type>
261
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
262
+ <sort_order>220</sort_order>
263
+ <show_in_default>1</show_in_default>
264
+ <show_in_website>1</show_in_website>
265
+ <show_in_store>1</show_in_store>
266
  </sponsor_levels>
267
  <sponsor_percent>
268
+ <label>Ratio applied from level 2 to calculate the points of the sponsor (in percentage)</label>
269
+ <frontend_type>text</frontend_type>
270
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
271
+ <sort_order>230</sort_order>
272
+ <show_in_default>1</show_in_default>
273
+ <show_in_website>1</show_in_website>
274
+ <show_in_store>1</show_in_store>
275
  </sponsor_percent>
276
  <godson_first_order_points>
277
+ <label>Amount of winning points for the first godson order</label>
278
+ <frontend_type>text</frontend_type>
279
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
280
+ <sort_order>240</sort_order>
281
+ <show_in_default>1</show_in_default>
282
+ <show_in_website>1</show_in_website>
283
+ <show_in_store>1</show_in_store>
284
  </godson_first_order_points>
285
+ <notification_enabled>
286
+ <label>Send notification to sponsor when godchild make him earn points</label>
287
+ <frontend_type>select</frontend_type>
288
+ <source_model>adminhtml/system_config_source_yesno</source_model>
289
+ <sort_order>250</sort_order>
290
+ <show_in_default>1</show_in_default>
291
+ <show_in_website>1</show_in_website>
292
+ <show_in_store>1</show_in_store>
293
+ </notification_enabled>
294
+ <notification>
295
+ <label>Notification Email Template</label>
296
+ <frontend_type>select</frontend_type>
297
+ <source_model>adminhtml/system_config_source_email_template</source_model>
298
+ <sort_order>260</sort_order>
299
+ <show_in_default>1</show_in_default>
300
+ <show_in_website>1</show_in_website>
301
+ <show_in_store>1</show_in_store>
302
+ </notification>
303
  </fields>
304
  </accumulated>
305
  <sponsor translate="label">
310
  <show_in_website>1</show_in_website>
311
  <show_in_store>1</show_in_store>
312
  <fields>
313
+
314
+
315
+
316
+ <heading_calculation translate="label">
317
+ <label>Points calculation</label>
318
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
319
+ <sort_order>0</sort_order>
320
+ <show_in_default>1</show_in_default>
321
+ <show_in_website>1</show_in_website>
322
+ <show_in_store>1</show_in_store>
323
+ </heading_calculation>
324
  <points_validity>
325
  <label>Points validity in days(0 for unlimited)</label>
326
  <frontend_type>text</frontend_type>
327
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
328
+ <sort_order>10</sort_order>
329
  <show_in_default>1</show_in_default>
330
  <show_in_website>1</show_in_website>
331
  <show_in_store>1</show_in_store>
334
  <label>Cancel earned points on credit memo creation</label>
335
  <frontend_type>select</frontend_type>
336
  <source_model>adminhtml/system_config_source_yesno</source_model>
337
+ <sort_order>20</sort_order>
338
  <show_in_default>1</show_in_default>
339
  <show_in_website>1</show_in_website>
340
  <show_in_store>1</show_in_store>
341
  </cancel_earned_points>
342
+ <sponsor_points_to_cash translate="label">
343
+ <label>Conversion rate of points in currency</label>
344
+ <frontend_type>text</frontend_type>
345
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
346
+ <sort_order>30</sort_order>
347
  <show_in_default>1</show_in_default>
348
  <show_in_website>1</show_in_website>
349
+ <show_in_store>1</show_in_store>
350
+ </sponsor_points_to_cash>
351
+
352
+
353
+
354
+ <heading_cash translate="label">
355
+ <label>Cash exchange</label>
356
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
357
+ <sort_order>40</sort_order>
358
  <show_in_default>1</show_in_default>
359
  <show_in_website>1</show_in_website>
360
+ </heading_cash>
361
+ <sponsor_cash translate="label">
362
+ <label>Cash exchange enabled</label>
 
 
 
 
 
 
 
 
 
 
363
  <frontend_type>select</frontend_type>
364
  <source_model>adminhtml/system_config_source_yesno</source_model>
365
+ <sort_order>50</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
+ </sponsor_cash>
370
+ <enable_check_company_number>
371
+ <label>Enable checking company number</label>
372
  <frontend_type>select</frontend_type>
373
  <source_model>adminhtml/system_config_source_yesno</source_model>
374
+ <comment>If you uncheck this option, the option 'Maximum amount permitted without company number' will not be activated</comment>
375
+ <sort_order>60</sort_order>
376
  <show_in_default>1</show_in_default>
377
  <show_in_website>1</show_in_website>
378
  <show_in_store>1</show_in_store>
379
+ </enable_check_company_number>
380
  <sponsor_max_cash translate="label">
381
  <label>Maximum amount permitted without company number</label>
382
  <frontend_type>text</frontend_type>
383
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
384
+ <sort_order>70</sort_order>
385
  <show_in_default>1</show_in_default>
386
  <show_in_website>1</show_in_website>
387
  <show_in_store>1</show_in_store>
388
  </sponsor_max_cash>
389
+
390
  <sponsor_time_max_cash translate="label">
391
  <label>Calculation period of the maximum allowed for an individual (days)</label>
392
  <frontend_type>text</frontend_type>
393
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
394
+ <sort_order>80</sort_order>
395
  <show_in_default>1</show_in_default>
396
  <show_in_website>1</show_in_website>
397
  <show_in_store>1</show_in_store>
398
  </sponsor_time_max_cash>
399
+
400
+
401
+
402
+ <heading_coupon translate="label">
403
+ <label>Coupon exchange</label>
404
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
405
+ <sort_order>90</sort_order>
406
+ <show_in_default>1</show_in_default>
407
+ <show_in_website>1</show_in_website>
408
+ </heading_coupon>
409
+ <sponsor_coupon translate="label">
410
+ <label>Voucher exchange enabled</label>
411
+ <frontend_type>select</frontend_type>
412
+ <source_model>adminhtml/system_config_source_yesno</source_model>
413
+ <sort_order>100</sort_order>
414
+ <show_in_default>1</show_in_default>
415
+ <show_in_website>1</show_in_website>
416
+ <show_in_store>1</show_in_store>
417
+ </sponsor_coupon>
418
+
419
+
420
+
421
+ <heading_cart translate="label">
422
+ <label>Cart exchange</label>
423
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
424
+ <sort_order>110</sort_order>
425
  <show_in_default>1</show_in_default>
426
  <show_in_website>1</show_in_website>
427
  <show_in_store>1</show_in_store>
428
+ </heading_cart>
429
+ <sponsor_cart>
430
+ <label>Automatic discount in cart</label>
431
+ <frontend_type>select</frontend_type>
432
+ <source_model>adminhtml/system_config_source_yesno</source_model>
433
+ <sort_order>120</sort_order>
434
+ <show_in_default>1</show_in_default>
435
+ <show_in_website>1</show_in_website>
436
+ <show_in_store>1</show_in_store>
437
+ </sponsor_cart>
438
+ <cancel_cart_points>
439
+ <label>Cancel the use of points on credit memo creation</label>
440
+ <frontend_type>select</frontend_type>
441
+ <source_model>adminhtml/system_config_source_yesno</source_model>
442
+ <sort_order>130</sort_order>
443
+ <show_in_default>1</show_in_default>
444
+ <show_in_website>1</show_in_website>
445
+ <show_in_store>1</show_in_store>
446
+ </cancel_cart_points>
447
+
448
+
449
+
450
+ <heading_gift translate="label">
451
+ <label>Gift exchange</label>
452
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
453
+ <sort_order>140</sort_order>
454
+ <show_in_default>1</show_in_default>
455
+ <show_in_website>1</show_in_website>
456
+ <show_in_store>1</show_in_store>
457
+ </heading_gift>
458
+ <sponsor_gift translate="label">
459
+ <label>Gift exchange enabled</label>
460
+ <frontend_type>select</frontend_type>
461
+ <source_model>adminhtml/system_config_source_yesno</source_model>
462
+ <sort_order>150</sort_order>
463
+ <show_in_default>1</show_in_default>
464
+ <show_in_website>1</show_in_website>
465
+ <show_in_store>1</show_in_store>
466
+ </sponsor_gift>
467
+
468
+
469
+
470
+ <heading_sponsorship translate="label">
471
+ <label>Sponsorship</label>
472
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
473
+ <sort_order>160</sort_order>
474
+ <show_in_default>1</show_in_default>
475
+ <show_in_website>1</show_in_website>
476
+ <show_in_store>1</show_in_store>
477
+ </heading_sponsorship>
478
+ <sponsor_optional_order translate="label">
479
  <label>Allow customers who have never ordered to send invitations</label>
480
  <frontend_type>select</frontend_type>
481
  <source_model>adminhtml/system_config_source_yesno</source_model>
482
+ <sort_order>170</sort_order>
483
  <show_in_default>1</show_in_default>
484
  <show_in_website>1</show_in_website>
485
  <show_in_store>1</show_in_store>
488
  <label>Allow to sponsor registred customers (but never ordered)</label>
489
  <frontend_type>select</frontend_type>
490
  <source_model>adminhtml/system_config_source_yesno</source_model>
491
+ <sort_order>180</sort_order>
492
  <show_in_default>1</show_in_default>
493
  <show_in_website>1</show_in_website>
494
  <show_in_store>1</show_in_store>
497
  <label>Inactivity time before removal of the sponsorship link (days)</label>
498
  <frontend_type>text</frontend_type>
499
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
500
+ <sort_order>190</sort_order>
501
  <show_in_default>1</show_in_default>
502
  <show_in_website>1</show_in_website>
503
  <show_in_store>1</show_in_store>
506
  <label>Maximum levels of sponsorship</label>
507
  <frontend_type>text</frontend_type>
508
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
509
+ <sort_order>200</sort_order>
510
  <show_in_default>1</show_in_default>
511
  <show_in_website>1</show_in_website>
512
  <show_in_store>1</show_in_store>
515
  <label>Ratio applied from level 2 to calculate the points of the sponsor (in percentage)</label>
516
  <frontend_type>text</frontend_type>
517
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
518
+ <sort_order>210</sort_order>
519
  <show_in_default>1</show_in_default>
520
  <show_in_website>1</show_in_website>
521
  <show_in_store>1</show_in_store>
522
  </sponsor_percent>
523
+ <godson_first_order_points>
524
  <label>Amount of winning points for the first godson order</label>
525
  <frontend_type>text</frontend_type>
526
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
527
+ <sort_order>220</sort_order>
528
  <show_in_default>1</show_in_default>
529
  <show_in_website>1</show_in_website>
530
  <show_in_store>1</show_in_store>
531
+ </godson_first_order_points>
532
+ <notification_enabled>
533
  <label>Send notification to sponsor when godchild make him earn points</label>
534
  <frontend_type>select</frontend_type>
535
  <source_model>adminhtml/system_config_source_yesno</source_model>
536
+ <sort_order>230</sort_order>
537
  <show_in_default>1</show_in_default>
538
  <show_in_website>1</show_in_website>
539
  <show_in_store>1</show_in_store>
540
+ </notification_enabled>
541
  <notification translate="label">
542
+ <label>Notification Email Template</label>
543
+ <frontend_type>select</frontend_type>
544
  <source_model>adminhtml/system_config_source_email_template</source_model>
545
+ <sort_order>240</sort_order>
546
  <show_in_default>1</show_in_default>
547
  <show_in_website>1</show_in_website>
548
  <show_in_store>1</show_in_store>
549
+ </notification>
550
  </fields>
551
  </sponsor>
552
  <fidelity translate="label">
557
  <show_in_website>1</show_in_website>
558
  <show_in_store>1</show_in_store>
559
  <fields>
560
+
561
+
562
+
563
+ <heading_calculation translate="label">
564
+ <label>Points calculation</label>
565
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
566
+ <sort_order>0</sort_order>
567
+ <show_in_default>1</show_in_default>
568
+ <show_in_website>1</show_in_website>
569
+ <show_in_store>1</show_in_store>
570
+ </heading_calculation>
571
  <points_validity>
572
  <label>Points validity in days(0 for unlimited)</label>
573
  <frontend_type>text</frontend_type>
574
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
575
+ <sort_order>10</sort_order>
576
  <show_in_default>1</show_in_default>
577
  <show_in_website>1</show_in_website>
578
  <show_in_store>1</show_in_store>
581
  <label>Cancel earned points on credit memo creation</label>
582
  <frontend_type>select</frontend_type>
583
  <source_model>adminhtml/system_config_source_yesno</source_model>
584
+ <sort_order>20</sort_order>
585
  <show_in_default>1</show_in_default>
586
  <show_in_website>1</show_in_website>
587
  <show_in_store>1</show_in_store>
588
  </cancel_earned_points>
589
+ <fidelity_points_to_cash>
590
+ <label>Conversion rate of points in currency</label>
591
+ <frontend_type>text</frontend_type>
592
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
593
+ <sort_order>30</sort_order>
594
  <show_in_default>1</show_in_default>
595
  <show_in_website>1</show_in_website>
596
  <show_in_store>1</show_in_store>
597
+ </fidelity_points_to_cash>
598
+ <newsletter_points>
599
+ <label>Amount of winning points when subscribe to newsletter on account creation</label>
600
+ <frontend_type>text</frontend_type>
601
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
602
+ <sort_order>40</sort_order>
603
  <show_in_default>1</show_in_default>
604
  <show_in_website>1</show_in_website>
605
  <show_in_store>1</show_in_store>
606
+ </newsletter_points>
607
+ <first_order_points>
608
+ <label>Amount of winning points for first order</label>
609
+ <frontend_type>text</frontend_type>
610
+ <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_naturalNumber</backend_model>
611
+ <sort_order>50</sort_order>
612
  <show_in_default>1</show_in_default>
613
  <show_in_website>1</show_in_website>
614
  <show_in_store>1</show_in_store>
615
+ </first_order_points>
616
+
617
+
618
+
619
+ <heading_cash translate="label">
620
+ <label>Cash exchange</label>
621
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
622
+ <sort_order>60</sort_order>
623
+ <show_in_default>1</show_in_default>
624
+ <show_in_website>1</show_in_website>
625
+ </heading_cash>
626
+ <fidelity_cash translate="label">
627
+ <label>Cash exchange enabled</label>
628
  <frontend_type>select</frontend_type>
629
  <source_model>adminhtml/system_config_source_yesno</source_model>
630
+ <sort_order>70</sort_order>
631
  <show_in_default>1</show_in_default>
632
  <show_in_website>1</show_in_website>
633
  <show_in_store>1</show_in_store>
634
+ </fidelity_cash>
635
+ <enable_check_company_number>
636
+ <label>Enable checking company number</label>
637
  <frontend_type>select</frontend_type>
638
  <source_model>adminhtml/system_config_source_yesno</source_model>
639
+ <comment>If you uncheck this option, the option 'Maximum amount permitted without company number' will not be activated</comment>
640
+ <sort_order>80</sort_order>
641
  <show_in_default>1</show_in_default>
642
  <show_in_website>1</show_in_website>
643
  <show_in_store>1</show_in_store>
644
+ </enable_check_company_number>
645
+ <fidelity_max_cash>
646
  <label>Maximum amount permitted without company number</label>
647
  <frontend_type>text</frontend_type>
648
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_float</backend_model>
649
+ <sort_order>90</sort_order>
650
  <show_in_default>1</show_in_default>
651
  <show_in_website>1</show_in_website>
652
  <show_in_store>1</show_in_store>
655
  <label>Calculation period of the maximum allowed for an individual (days)</label>
656
  <frontend_type>text</frontend_type>
657
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
658
+ <sort_order>100</sort_order>
659
  <show_in_default>1</show_in_default>
660
  <show_in_website>1</show_in_website>
661
  <show_in_store>1</show_in_store>
662
  </fidelity_time_max_cash>
663
+
664
+
665
+
666
+ <heading_coupon translate="label">
667
+ <label>Coupon exchange</label>
668
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
669
+ <sort_order>110</sort_order>
670
+ <show_in_default>1</show_in_default>
671
+ <show_in_website>1</show_in_website>
672
+ </heading_coupon>
673
+ <fidelity_coupon translate="label">
674
+ <label>Voucher exchange enabled</label>
675
+ <frontend_type>select</frontend_type>
676
+ <source_model>adminhtml/system_config_source_yesno</source_model>
677
+ <sort_order>120</sort_order>
678
  <show_in_default>1</show_in_default>
679
  <show_in_website>1</show_in_website>
680
  <show_in_store>1</show_in_store>
681
+ </fidelity_coupon>
682
+
683
+
684
+
685
+ <heading_cart translate="label">
686
+ <label>Cart exchange</label>
687
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
688
+ <sort_order>130</sort_order>
689
  <show_in_default>1</show_in_default>
690
  <show_in_website>1</show_in_website>
691
  <show_in_store>1</show_in_store>
692
+ </heading_cart>
693
+ <fidelity_cart>
694
+ <label>Automatic discount in cart</label>
695
+ <frontend_type>select</frontend_type>
696
+ <source_model>adminhtml/system_config_source_yesno</source_model>
697
+ <sort_order>140</sort_order>
698
  <show_in_default>1</show_in_default>
699
  <show_in_website>1</show_in_website>
700
  <show_in_store>1</show_in_store>
701
+ </fidelity_cart>
702
+ <cancel_cart_points>
703
+ <label>Cancel the use of points on credit memo creation</label>
704
+ <frontend_type>select</frontend_type>
705
+ <source_model>adminhtml/system_config_source_yesno</source_model>
706
+ <sort_order>150</sort_order>
707
+ <show_in_default>1</show_in_default>
708
+ <show_in_website>1</show_in_website>
709
+ <show_in_store>1</show_in_store>
710
+ </cancel_cart_points>
711
+
712
+
713
+
714
+ <heading_gift translate="label">
715
+ <label>Gift exchange</label>
716
+ <frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
717
+ <sort_order>160</sort_order>
718
+ <show_in_default>1</show_in_default>
719
+ <show_in_website>1</show_in_website>
720
+ <show_in_store>1</show_in_store>
721
+ </heading_gift>
722
+ <fidelity_gift translate="label">
723
+ <label>Gift exchange enabled</label>
724
+ <frontend_type>select</frontend_type>
725
+ <source_model>adminhtml/system_config_source_yesno</source_model>
726
+ <sort_order>170</sort_order>
727
+ <show_in_default>1</show_in_default>
728
+ <show_in_website>1</show_in_website>
729
+ <show_in_store>1</show_in_store>
730
+ </fidelity_gift>
731
  </fields>
732
  </fidelity>
733
  <invitation translate="label">
742
  <label>Time validity invitations (days)</label>
743
  <frontend_type>text</frontend_type>
744
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
745
+ <sort_order>0</sort_order>
746
  <show_in_default>1</show_in_default>
747
  <show_in_website>1</show_in_website>
748
  <show_in_store>1</show_in_store>
751
  <label>Time to send it automatically (days)</label>
752
  <frontend_type>text</frontend_type>
753
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
754
+ <sort_order>10</sort_order>
755
  <show_in_default>1</show_in_default>
756
  <show_in_website>1</show_in_website>
757
  <show_in_store>1</show_in_store>
760
  <label>Max invitations</label>
761
  <frontend_type>text</frontend_type>
762
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_entier</backend_model>
763
+ <sort_order>20</sort_order>
764
  <show_in_default>1</show_in_default>
765
  <show_in_website>1</show_in_website>
766
  <show_in_store>1</show_in_store>
769
  <label>Invitation Email Template</label>
770
  <frontend_type>select</frontend_type>
771
  <source_model>adminhtml/system_config_source_email_template</source_model>
772
+ <sort_order>30</sort_order>
773
  <show_in_default>1</show_in_default>
774
  <show_in_website>1</show_in_website>
775
  <show_in_store>1</show_in_store>
788
  <label>Coupon Email Template</label>
789
  <frontend_type>select</frontend_type>
790
  <source_model>adminhtml/system_config_source_email_template</source_model>
791
+ <sort_order>0</sort_order>
792
  <show_in_default>1</show_in_default>
793
  <show_in_website>1</show_in_website>
794
  <show_in_store>1</show_in_store>
795
  </template>
796
  </fields>
797
  </coupon>
798
+ <cash translate="label">
799
+ <label>Cash exchange mail options</label>
800
+ <frontend_type>text</frontend_type>
801
+ <sort_order>6</sort_order>
802
+ <show_in_default>1</show_in_default>
803
+ <show_in_website>1</show_in_website>
804
+ <show_in_store>1</show_in_store>
805
+ <fields>
806
+ <template translate="label">
807
+ <label>Cash Email Template</label>
808
+ <frontend_type>select</frontend_type>
809
+ <source_model>adminhtml/system_config_source_email_template</source_model>
810
+ <sort_order>0</sort_order>
811
+ <show_in_default>1</show_in_default>
812
+ <show_in_website>1</show_in_website>
813
+ <show_in_store>1</show_in_store>
814
+ </template>
815
+ <administrator_email translate="label">
816
+ <label>Administrator email</label>
817
+ <frontend_type>text</frontend_type>
818
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
819
+ <sort_order>10</sort_order>
820
+ <show_in_default>1</show_in_default>
821
+ <show_in_website>1</show_in_website>
822
+ <show_in_store>1</show_in_store>
823
+ </administrator_email>
824
+ </fields>
825
+ </cash>
826
  <open_inviter translate="label comment">
827
  <label>Open Inviter options</label>
828
  <sort_order>7</sort_order>
835
  <label>Activated</label>
836
  <frontend_type>select</frontend_type>
837
  <source_model>adminhtml/system_config_source_yesno</source_model>
838
+ <sort_order>0</sort_order>
839
  <show_in_default>1</show_in_default>
840
  <show_in_website>1</show_in_website>
841
  <show_in_store>1</show_in_store>
844
  <label>Username</label>
845
  <frontend_type>text</frontend_type>
846
  <backend_model>auguria_sponsorship/adminhtml_system_config_backend_sponsorship_openinviter</backend_model>
847
+ <sort_order>10</sort_order>
848
  <show_in_default>1</show_in_default>
849
  <show_in_website>1</show_in_website>
850
  <show_in_store>1</show_in_store>
852
  <private_key>
853
  <label>Private Key</label>
854
  <frontend_type>text</frontend_type>
855
+ <sort_order>20</sort_order>
856
  <show_in_default>1</show_in_default>
857
  <show_in_website>1</show_in_website>
858
  <show_in_store>1</show_in_store>
app/code/community/Auguria/Sponsorship/sql/auguria_sponsorship_setup/mysql4-upgrade-1.3.0-1.3.1.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $installer = $this;
9
+
10
+ $installer->getConnection()->addColumn($this->getTable('auguria_sponsorship_change'), 'coupon_code', 'TEXT NULL');
11
+
12
+
13
+ $installer->getConnection()->addIndex(
14
+ $installer->getTable('salesrule/coupon'),
15
+ $installer->getIdxName('salesrule/coupon', array('coupon_code')),
16
+ array('code')
17
+ );
18
+
19
+ $installer->endSetup();
app/code/community/Auguria/Sponsorship/sql/auguria_sponsorship_setup/mysql4-upgrade-1.3.1-1.3.2.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Auguria
4
+ * @package Auguria_Sponsorship
5
+ * @author Auguria
6
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
+ $setup = $this;
9
+ $setup->startSetup();
10
+
11
+ $setup->addAttribute('customer', 'bic', array(
12
+ 'type' => 'varchar',
13
+ 'backend' => '',
14
+ 'frontend' => '',
15
+ 'label' => 'Bic',
16
+ 'input' => 'text',
17
+ 'class' => '',
18
+ 'source' => '',
19
+ 'visible' => true,
20
+ 'required' => false,
21
+ 'user_defined' => true,
22
+ 'default' => '',
23
+ 'searchable' => false,
24
+ 'filterable' => false,
25
+ 'comparable' => false,
26
+ 'visible_on_front' => true,
27
+ 'unique' => false,
28
+ 'used_in_forms' => array('adminhtml_customer'),
29
+ 'group' => 'Default',
30
+ 'sort_order' => 312
31
+ ));
32
+
33
+ $setup->endSetup();
app/design/adminhtml/default/default/layout/auguria/sponsorship.xml CHANGED
@@ -34,5 +34,10 @@
34
  <reference name="customer_edit_tabs">
35
  <action method="addTab"><name>customer_edit_tab_sponsorship</name><block>auguria_sponsorship/adminhtml_customer_tabs_sponsorship</block></action>
36
  </reference>
37
- </adminhtml_customer_edit>
 
 
 
 
 
38
  </layout>
34
  <reference name="customer_edit_tabs">
35
  <action method="addTab"><name>customer_edit_tab_sponsorship</name><block>auguria_sponsorship/adminhtml_customer_tabs_sponsorship</block></action>
36
  </reference>
37
+ </adminhtml_customer_edit>
38
+ <adminhtml_system_config_edit>
39
+ <reference name="head">
40
+ <action method="addJs"><name>auguria/sponsorship/admin.js</name></action>
41
+ </reference>
42
+ </adminhtml_system_config_edit>
43
  </layout>
app/design/adminhtml/default/default/template/auguria/sponsorship/customer/tabs/sponsorship.phtml CHANGED
@@ -160,6 +160,18 @@
160
  <td class="scope-label"><span class="nobr"></span>
161
  </td>
162
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
163
  <tr>
164
  <td class="label"><?php echo $this->__('SIRET'); ?>
165
  </td>
160
  <td class="scope-label"><span class="nobr"></span>
161
  </td>
162
  </tr>
163
+ <tr>
164
+ <td class="label"><?php echo $this->__('BIC'); ?>
165
+ </td>
166
+ <td class="value">
167
+ <input id="sponsorship_iban" class=" input-text validate-alphanum"
168
+ type="text"
169
+ value="<?php echo $this->getCustomer()->getBic(); ?>"
170
+ name="sponsorship[iban]"/>
171
+ </td>
172
+ <td class="scope-label"><span class="nobr"></span>
173
+ </td>
174
+ </tr>
175
  <tr>
176
  <td class="label"><?php echo $this->__('SIRET'); ?>
177
  </td>
app/design/frontend/base/default/layout/auguria/sponsorship.xml CHANGED
@@ -113,7 +113,7 @@
113
  </reference>
114
  </customer_account_index>
115
 
116
- <!-- Remplacement de edit.phtml pour ajout champ Iban dans les informations du compte -->
117
  <customer_account_edit>
118
  <reference name="customer_edit">
119
  <action method="setTemplate">
@@ -130,13 +130,4 @@
130
  <action ifconfig="auguria_sponsorship/accumulated/accumulated_enabled" method="addLink" translate="label" module="auguria_sponsorship"><name>accumulated_points</name><path>auguria_sponsorship/points/accumulated</path><label>Fidelity points and sponsorship management</label></action>
131
  </reference>
132
  </customer_account>
133
-
134
- <!-- Remplacement de register.phtml pour afficher email de la session -->
135
- <customer_account_create>
136
- <reference name="customer_form_register">
137
- <action method="setTemplate">
138
- <template>auguria/sponsorship/customer/form/register.phtml</template>
139
- </action>
140
- </reference>
141
- </customer_account_create>
142
  </layout>
113
  </reference>
114
  </customer_account_index>
115
 
116
+ <!-- Remplacement de edit.phtml pour ajout champ Iban et Bic dans les informations du compte -->
117
  <customer_account_edit>
118
  <reference name="customer_edit">
119
  <action method="setTemplate">
130
  <action ifconfig="auguria_sponsorship/accumulated/accumulated_enabled" method="addLink" translate="label" module="auguria_sponsorship"><name>accumulated_points</name><path>auguria_sponsorship/points/accumulated</path><label>Fidelity points and sponsorship management</label></action>
131
  </reference>
132
  </customer_account>
 
 
 
 
 
 
 
 
 
133
  </layout>
app/design/frontend/base/default/template/auguria/sponsorship/customer/account/fidelitypointsdetail.phtml CHANGED
@@ -4,8 +4,12 @@
4
  * @package Auguria_Sponsorship
5
  * @author Auguria
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
- */
8
  -->
 
 
 
 
9
  <div class="std">
10
  <div class="page-title">
11
  <h1>
@@ -19,6 +23,7 @@
19
 
20
  //si il y eu des commandes
21
  $_items = $this->getCommandes();
 
22
  if ($_items):
23
  $tableId = 'lastOrdersTable';
24
  ?>
4
  * @package Auguria_Sponsorship
5
  * @author Auguria
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+ */
8
  -->
9
+ <?php
10
+ /* @var $this Auguria_Sponsorship_Block_Customer_Account_PointsDetail */
11
+ ?>
12
+
13
  <div class="std">
14
  <div class="page-title">
15
  <h1>
23
 
24
  //si il y eu des commandes
25
  $_items = $this->getCommandes();
26
+ //Zend_Debug::dump($_items);
27
  if ($_items):
28
  $tableId = 'lastOrdersTable';
29
  ?>
app/design/frontend/base/default/template/auguria/sponsorship/customer/form/edit.phtml CHANGED
@@ -62,6 +62,7 @@
62
  if ($_virement->isEnabled()): ?>
63
  <li><?php echo $_virement->setIban($this->getCustomer()->getIban())
64
  ->setSiret($this->getCustomer()->getSiret())
 
65
  ->toHtml(); ?></li>
66
  <?php
67
  endif
62
  if ($_virement->isEnabled()): ?>
63
  <li><?php echo $_virement->setIban($this->getCustomer()->getIban())
64
  ->setSiret($this->getCustomer()->getSiret())
65
+ ->setBic($this->getCustomer()->getBic())
66
  ->toHtml(); ?></li>
67
  <?php
68
  endif
app/design/frontend/base/default/template/auguria/sponsorship/customer/form/register.phtml DELETED
@@ -1,203 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
-
26
- * @category Auguria
27
- * @package Auguria_Sponsorship
28
- * @author Auguria
29
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
30
- */
31
- ?>
32
- <?php
33
- /**
34
- * Create account form template
35
- *
36
- * @see Mage_Customer_Block_Form_Register
37
- */
38
- ?>
39
- <div class="account-create">
40
- <div class="page-title">
41
- <h1><?php echo $this->__('Create an Account') ?></h1>
42
- </div>
43
- <?php echo $this->getChildHtml('form_fields_before')?>
44
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
45
- <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
46
- <div class="fieldset">
47
- <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
48
- <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
49
- <h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
50
- <ul class="form-list">
51
- <li class="fields">
52
- <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->toHtml() ?>
53
- </li>
54
- <li>
55
- <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
56
- <div class="input-box">
57
- <input type="text" name="email" id="email_address" value="<?php
58
- /**
59
- * Start custom Auguria_Sponsorhsip to display sponsorized email
60
- */
61
- if ($this->htmlEscape($this->getFormData()->getEmail())=='')
62
- {
63
- echo $this->htmlEscape(Mage::getBlockSingleton('auguria_sponsorship/customer_widget_name')-> getInvit('email'));
64
- }
65
- else
66
- {
67
- echo $this->htmlEscape($this->getFormData()->getEmail());
68
- }
69
- /**
70
- * End custom Auguria_Sponsorship
71
- */
72
- ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
73
- </div>
74
- </li>
75
- <?php if ($this->isNewsletterEnabled()): ?>
76
- <li class="control">
77
- <div class="input-box">
78
- <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
79
- </div>
80
- <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
81
- </li>
82
- <?php endif ?>
83
- <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
84
- <?php if ($_dob->isEnabled()): ?>
85
- <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
86
- <?php endif ?>
87
- <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
88
- <?php if ($_taxvat->isEnabled()): ?>
89
- <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
90
- <?php endif ?>
91
- <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
92
- <?php if ($_gender->isEnabled()): ?>
93
- <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
94
- <?php endif ?>
95
- </ul>
96
- </div>
97
- <?php if($this->getShowAddressFields()): ?>
98
- <div class="fieldset">
99
- <input type="hidden" name="create_address" value="1" />
100
- <h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
101
- <ul class="form-list">
102
- <li class="fields">
103
- <div class="field">
104
- <label for="company"><?php echo $this->__('Company') ?></label>
105
- <div class="input-box">
106
- <input type="text" name="company" id="company" value="<?php echo $this->htmlEscape($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text" />
107
- </div>
108
- </div>
109
- <div class="field">
110
- <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
111
- <div class="input-box">
112
- <input type="text" name="telephone" id="telephone" value="<?php echo $this->htmlEscape($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text required-entry" />
113
- </div>
114
- </div>
115
- </li>
116
- <li class="wide">
117
- <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
118
- <div class="input-box">
119
- <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text required-entry" />
120
- </div>
121
- </li>
122
- <?php for ($_i=2, $_n=$this->helper('customer/address')->getStreetLines(); $_i<=$_n; $_i++): ?>
123
- <li class="wide">
124
- <div class="input-box">
125
- <input type="text" name="street[]" value="<?php echo $this->htmlEscape($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i?>" class="input-text" />
126
- </div>
127
- </li>
128
- <?php endfor ?>
129
- <li class="fields">
130
- <div class="field">
131
- <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
132
- <div class="input-box">
133
- <input type="text" name="city" value="<?php echo $this->htmlEscape($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text required-entry" id="city" />
134
- </div>
135
- </div>
136
- <div class="field">
137
- <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
138
- <div class="input-box">
139
- <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
140
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
141
- </select>
142
- <script type="text/javascript">
143
- //<![CDATA[
144
- $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
145
- //]]>
146
- </script>
147
- <input type="text" id="region" name="region" value="<?php echo $this->htmlEscape($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text" style="display:none;" />
148
- </div>
149
- </div>
150
- </li>
151
- <li class="fields">
152
- <div class="field">
153
- <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
154
- <div class="input-box">
155
- <input type="text" name="postcode" value="<?php echo $this->htmlEscape($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international required-entry" />
156
- </div>
157
- </div>
158
- <div class="field">
159
- <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
160
- <div class="input-box">
161
- <?php echo $this->getCountryHtmlSelect() ?>
162
- </div>
163
- </div>
164
- </li>
165
- </ul>
166
- <input type="hidden" name="default_billing" value="1" />
167
- <input type="hidden" name="default_shipping" value="1" />
168
- </div>
169
- <?php endif; ?>
170
- <div class="fieldset">
171
- <h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
172
- <ul class="form-list">
173
- <li class="fields">
174
- <div class="field">
175
- <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
176
- <div class="input-box">
177
- <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
178
- </div>
179
- </div>
180
- <div class="field">
181
- <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
182
- <div class="input-box">
183
- <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
184
- </div>
185
- </div>
186
- </li>
187
- </ul>
188
- </div>
189
- <div class="buttons-set">
190
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
191
- <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
192
- <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
193
- </div>
194
- </form>
195
- <script type="text/javascript">
196
- //<![CDATA[
197
- var dataForm = new VarienForm('form-validate', true);
198
- <?php if($this->getShowAddressFields()): ?>
199
- new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
200
- <?php endif; ?>
201
- //]]>
202
- </script>
203
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/auguria/sponsorship/customer/widget/name.phtml CHANGED
@@ -1,129 +1,150 @@
1
  <?php
2
  /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package base_default
23
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
-
27
- /**
28
- USAGE:
29
 
30
- Simple:
31
 
32
- <?php echo $this->getLayout()->createBlock('customer/widget_name')
33
- ->setObject($this->getAddress())
34
- ->toHtml() ?>
35
 
36
- For checkout/onepage/shipping.phtml:
37
 
38
- <?php echo $this->getLayout()->createBlock('customer/widget_name')
39
- ->setObject($this->getAddress())
40
- ->setFieldIdFormat('shipping:%s')
41
- ->setFieldNameFormat('shipping[%s]')
42
- ->setFieldParams('onchange="shipping.setSameAsBilling(false);"')
43
- ->toHtml() ?>
44
- */
 
45
  ?>
46
  <div class="<?php echo $this->getContainerClassName()?>">
47
- <?php if ($this->showPrefix()): ?>
48
- <div class="field name-prefix">
49
- <label for="<?php echo $this->getFieldId('prefix')?>"<?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?><?php echo $this->__('Prefix') ?></label>
50
- <div class="input-box">
51
- <?php if ($this->getPrefixOptions()===false): ?>
52
- <input type="text" id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" value="<?php echo $this->htmlEscape($this->getObject()->getPrefix()) ?>" title="<?php echo $this->__('Prefix') ?>" class="input-text<?php if ($this->isPrefixRequired()):?> required-entry<?php endif; ?>" <?php echo $this->getFieldParams() ?> />
53
- <?php else: ?>
54
- <select id="<?php echo $this->getFieldId('prefix')?>" name="<?php echo $this->getFieldName('prefix')?>" title="<?php echo $this->__('Prefix') ?>"<?php if ($this->isPrefixRequired()):?> class="required-entry"<?php endif; ?> <?php echo $this->getFieldParams() ?>>
55
- <?php foreach ($this->getPrefixOptions() as $_option): ?>
56
- <option value="<?php echo $_option?>"<?php if ($this->getObject()->getPrefix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
57
- <?php endforeach ?>
58
- </select>
59
- <?php endif; ?>
60
- </div>
61
- </div>
62
- <?php endif; ?>
63
- <div class="field name-firstname">
64
- <label for="<?php echo $this->getFieldId('firstname')?>" class="required"><em>*</em><?php echo $this->__('First Name') ?></label>
65
- <div class="input-box">
66
- <input type="text" id="<?php echo $this->getFieldId('firstname')?>" name="<?php echo $this->getFieldName('firstname')?>" value="<?php
67
- /**
68
- * Start custom Auguria_Sponsorhsip to display sponsorized firstname
69
- */
70
- if ($this->htmlEscape($this->getObject()->getFirstname())=='')
71
- {
72
- echo $this->htmlEscape($this->getInvit('firstname'));
73
- }
74
- else
75
- {
76
- echo $this->htmlEscape($this->getObject()->getFirstname());
77
- }
78
- /**
79
- * End custom Auguria_Sponsorship
80
- */
81
- ?>" title="<?php echo $this->__('First Name') ?>" class="input-text required-entry" <?php echo $this->getFieldParams() ?> />
82
- </div>
83
- </div>
84
- <?php if ($this->showMiddlename()): ?>
85
- <div class="field name-middlename">
86
- <label for="<?php echo $this->getFieldId('middlename')?>"><?php echo $this->__('M.I.') ?></label>
87
- <div class="input-box">
88
- <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->htmlEscape($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->__('M.I.') ?>" class="input-text" <?php echo $this->getFieldParams() ?> />
89
- </div>
90
- </div>
91
- <?php endif; ?>
92
- <div class="field name-lastname">
93
- <label for="<?php echo $this->getFieldId('lastname')?>" class="required"><em>*</em><?php echo $this->__('Last Name') ?></label>
94
- <div class="input-box">
95
- <input type="text" id="<?php echo $this->getFieldId('lastname')?>" name="<?php echo $this->getFieldName('lastname')?>" value="<?php
96
- /**
97
- * Start custom Auguria_Sponsorhsip to display sponsorized lastname
98
- */
99
- if ($this->htmlEscape($this->getObject()->getLastname())=='')
100
- {
101
- echo $this->htmlEscape($this->getInvit('lastname'));
102
- }
103
- else
104
- {
105
- echo $this->htmlEscape($this->getObject()->getLastname());
106
- }
107
- /**
108
- * End custom Auguria_Sponsorship
109
- */
110
- ?>" title="<?php echo $this->__('Last Name') ?>" class="input-text required-entry" <?php echo $this->getFieldParams() ?> />
111
- </div>
112
- </div>
113
- <?php if ($this->showSuffix()): ?>
114
- <div class="field name-suffix">
115
- <label for="<?php echo $this->getFieldId('suffix')?>"<?php if ($this->isSuffixRequired()) echo ' class="required"' ?>><?php if ($this->isSuffixRequired()) echo '<em>*</em>' ?><?php echo $this->__('Suffix') ?></label>
116
- <div class="input-box">
117
- <?php if ($this->getSuffixOptions()===false): ?>
118
- <input type="text" id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" value="<?php echo $this->htmlEscape($this->getObject()->getSuffix()) ?>" title="<?php echo $this->__('Suffix') ?>" class="input-text<?php if ($this->isSuffixRequired()):?> required-entry<?php endif; ?>" <?php echo $this->getFieldParams() ?> />
119
- <?php else: ?>
120
- <select id="<?php echo $this->getFieldId('suffix')?>" name="<?php echo $this->getFieldName('suffix')?>" title="<?php echo $this->__('Suffix') ?>"<?php if ($this->isSuffixRequired()):?> class="required-entry"<?php endif; ?> <?php echo $this->getFieldParams() ?>>
121
- <?php foreach ($this->getSuffixOptions() as $_option): ?>
122
- <option value="<?php echo $_option?>"<?php if ($this->getObject()->getSuffix()==$_option):?> selected="selected"<?php endif; ?>><?php echo $this->__($_option)?></option>
123
- <?php endforeach ?>
124
- </select>
125
- <?php endif; ?>
126
- </div>
127
- </div>
128
- <?php endif; ?>
129
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /**
3
+ USAGE:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ Simple:
6
 
7
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')
8
+ ->setObject($this->getAddress())
9
+ ->toHtml() ?>
10
 
11
+ For checkout/onepage/shipping.phtml:
12
 
13
+ <?php echo $this->getLayout()->createBlock('customer/widget_name')
14
+ ->setObject($this->getAddress())
15
+ ->setFieldIdFormat('shipping:%s')
16
+ ->setFieldNameFormat('shipping[%s]')
17
+ ->setFieldParams('onchange="shipping.setSameAsBilling(false);"')
18
+ ->toHtml() ?>
19
+ */
20
+ /* @var $this Mage_Customer_Block_Widget_Name */
21
  ?>
22
  <div class="<?php echo $this->getContainerClassName()?>">
23
+ <?php if ($this->showPrefix()): ?>
24
+ <div class="field name-prefix">
25
+ <label for="<?php echo $this->getFieldId('prefix')?>"
26
+ <?php if ($this->isPrefixRequired()) echo ' class="required"' ?>><?php if ($this->isPrefixRequired()) echo '<em>*</em>' ?>
27
+ <?php echo $this->getStoreLabel('prefix') ?> </label>
28
+ <div class="input-box">
29
+ <?php if ($this->getPrefixOptions() === false): ?>
30
+ <input type="text" id="<?php echo $this->getFieldId('prefix')?>"
31
+ name="<?php echo $this->getFieldName('prefix')?>"
32
+ value="<?php echo $this->escapeHtml($this->getObject()->getPrefix()) ?>"
33
+ title="<?php echo $this->getStoreLabel('prefix') ?>"
34
+ class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>"
35
+ <?php echo $this->getFieldParams() ?> />
36
+ <?php else: ?>
37
+ <select id="<?php echo $this->getFieldId('prefix')?>"
38
+ name="<?php echo $this->getFieldName('prefix')?>"
39
+ title="<?php echo $this->getStoreLabel('prefix') ?>"
40
+ class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('prefix') ?>"
41
+ <?php echo $this->getFieldParams() ?>>
42
+ <?php foreach ($this->getPrefixOptions() as $_option): ?>
43
+ <option value="<?php echo $_option?>"
44
+ <?php if ($this->getObject()->getPrefix()==$_option):?>
45
+ selected="selected" <?php endif; ?>>
46
+ <?php echo $this->__($_option)?>
47
+ </option>
48
+ <?php endforeach; ?>
49
+ </select>
50
+ <?php endif; ?>
51
+ </div>
52
+ </div>
53
+ <?php endif; ?>
54
+ <div class="field name-firstname">
55
+ <label for="<?php echo $this->getFieldId('firstname')?>"
56
+ class="required"><em>*</em> <?php echo $this->getStoreLabel('firstname') ?>
57
+ </label>
58
+ <div class="input-box">
59
+ <input type="text" id="<?php echo $this->getFieldId('firstname')?>"
60
+ name="<?php echo $this->getFieldName('firstname')?>"
61
+ value="<?php echo $this->escapeHtml($this->getObject()->getFirstname()) ?>"
62
+ title="<?php echo $this->getStoreLabel('firstname') ?>"
63
+ maxlength="255"
64
+ class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('firstname') ?>"
65
+ <?php echo $this->getFieldParams() ?> />
66
+ </div>
67
+ </div>
68
+ <?php if ($this->showMiddlename()): ?>
69
+ <?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?>
70
+ <div class="field name-middlename">
71
+ <label for="<?php echo $this->getFieldId('middlename')?>"
72
+ <?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?>
73
+ <?php echo $this->getStoreLabel('middlename') ?> </label>
74
+ <div class="input-box">
75
+ <input type="text" id="<?php echo $this->getFieldId('middlename')?>"
76
+ name="<?php echo $this->getFieldName('middlename')?>"
77
+ value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>"
78
+ title="<?php echo $this->getStoreLabel('middlename') ?>"
79
+ class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('middlename') ?>"
80
+ <?php echo $this->getFieldParams() ?> />
81
+ </div>
82
+ </div>
83
+ <?php endif; ?>
84
+ <div class="field name-lastname">
85
+ <label for="<?php echo $this->getFieldId('lastname')?>"
86
+ class="required"><em>*</em> <?php echo $this->getStoreLabel('lastname') ?>
87
+ </label>
88
+ <div class="input-box">
89
+ <input type="text" id="<?php echo $this->getFieldId('lastname')?>"
90
+ name="<?php echo $this->getFieldName('lastname')?>"
91
+ value="<?php echo $this->escapeHtml($this->getObject()->getLastname()) ?>"
92
+ title="<?php echo $this->getStoreLabel('lastname') ?>"
93
+ maxlength="255"
94
+ class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('lastname') ?>"
95
+ <?php echo $this->getFieldParams() ?> />
96
+ </div>
97
+ </div>
98
+ <?php if ($this->showSuffix()): ?>
99
+ <div class="field name-suffix">
100
+ <label for="<?php echo $this->getFieldId('suffix')?>"
101
+ <?php if ($this->isSuffixRequired()) echo ' class="required"' ?>><?php if ($this->isSuffixRequired()) echo '<em>*</em>' ?>
102
+ <?php echo $this->getStoreLabel('suffix') ?> </label>
103
+ <div class="input-box">
104
+ <?php if ($this->getSuffixOptions() === false): ?>
105
+ <input type="text" id="<?php echo $this->getFieldId('suffix')?>"
106
+ name="<?php echo $this->getFieldName('suffix')?>"
107
+ value="<?php echo $this->escapeHtml($this->getObject()->getSuffix()) ?>"
108
+ title="<?php echo $this->getStoreLabel('suffix') ?>"
109
+ class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('suffix') ?>"
110
+ <?php echo $this->getFieldParams() ?> />
111
+ <?php else: ?>
112
+ <select id="<?php echo $this->getFieldId('suffix')?>"
113
+ name="<?php echo $this->getFieldName('suffix')?>"
114
+ title="<?php echo $this->getStoreLabel('suffix') ?>"
115
+ class="<?php echo $this->helper('customer/address')->getAttributeValidationClass('suffix') ?>"
116
+ <?php echo $this->getFieldParams() ?>>
117
+ <?php foreach ($this->getSuffixOptions() as $_option): ?>
118
+ <option value="<?php echo $_option?>"
119
+ <?php if ($this->getObject()->getSuffix()==$_option):?>
120
+ selected="selected" <?php endif; ?>>
121
+ <?php echo $this->__($_option)?>
122
+ </option>
123
+ <?php endforeach; ?>
124
+ </select>
125
+ <?php endif; ?>
126
+ </div>
127
+ </div>
128
+ <?php endif; ?>
129
+ </div>
130
+
131
+ <?php
132
+ /* AUGURIA SPONSORSHIP */
133
+ ?>
134
+ <script>
135
+ Event.observe(window, 'load', function() {
136
+ var prenom_parrainage = "<?php echo $this->getInvit('firstname'); ?>";
137
+ var nom_parrainage = "<?php echo $this->getInvit('lastname'); ?>";
138
+ var email_parrainage = "<?php echo $this->getInvit('email'); ?>";
139
+
140
+ if(prenom_parrainage && $('firstname')){
141
+ $('firstname').setValue(prenom_parrainage);
142
+ }
143
+ if(nom_parrainage && $('lastname')){
144
+ $('lastname').setValue(nom_parrainage);
145
+ }
146
+ if(email_parrainage && $('email_address')){
147
+ $('email_address').setValue(email_parrainage);
148
+ }
149
+ });
150
+ </script>
app/design/frontend/base/default/template/auguria/sponsorship/customer/widget/virement.phtml CHANGED
@@ -6,7 +6,6 @@
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
  */
8
  -->
9
-
10
  <label for="<?php echo $this->getFieldId('iban')?>">
11
  <?php echo $this->__('IBAN') ?>
12
  </label>
@@ -18,8 +17,21 @@
18
  class="input-text"
19
  <?php echo $this->getFieldParams() ?> />
20
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  <label for="<?php echo $this->getFieldId('siret')?>">
22
- <?php echo $this->__('Campany number') ?>
23
  </label>
24
  <div class="input-box" >
25
  <input type="text"
@@ -28,4 +40,15 @@
28
  value="<?php echo $this->htmlEscape($this->getSiret()) ?>"
29
  class="input-text"
30
  <?php echo $this->getFieldParams() ?> />
31
- </div>
 
 
 
 
 
 
 
 
 
 
 
6
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
  */
8
  -->
 
9
  <label for="<?php echo $this->getFieldId('iban')?>">
10
  <?php echo $this->__('IBAN') ?>
11
  </label>
17
  class="input-text"
18
  <?php echo $this->getFieldParams() ?> />
19
  </div>
20
+
21
+ <label for="<?php echo $this->getFieldId('bic')?>">
22
+ <?php echo $this->__('BIC') ?>
23
+ </label>
24
+ <div class="input-box" >
25
+ <input type="text"
26
+ id="<?php echo $this->getFieldId('bic')?>"
27
+ name="<?php echo $this->getFieldName('bic')?>"
28
+ value="<?php echo $this->htmlEscape($this->getBic()) ?>"
29
+ class="input-text validate-bic"
30
+ <?php echo $this->getFieldParams() ?> />
31
+ </div>
32
+
33
  <label for="<?php echo $this->getFieldId('siret')?>">
34
+ <?php echo $this->__('Company number'); // SIRET ?>
35
  </label>
36
  <div class="input-box" >
37
  <input type="text"
40
  value="<?php echo $this->htmlEscape($this->getSiret()) ?>"
41
  class="input-text"
42
  <?php echo $this->getFieldParams() ?> />
43
+ </div>
44
+
45
+ <script type="text/javascript">
46
+ //<![CDATA[
47
+ // var theForm = new VarienForm('theForm', true);
48
+ Validation.add('validate-bic','Enter a valid BIC!', function(the_field_value){
49
+ var regSWIFT = /^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/;
50
+ if(the_field_value.empty()) return true;
51
+ return regSWIFT.test(the_field_value);
52
+ });
53
+ //]]>
54
+ </script>
app/design/frontend/base/default/template/auguria/sponsorship/openinviter.phtml CHANGED
@@ -16,7 +16,7 @@
16
  <h2 class="legend"><?php echo $this->__('Select your provider and sign in:') ?></h2>
17
  <?php
18
  $step = $this->getOpenInviterStep();
19
- $oi_services = $this->getOpenIniviterPlugins();
20
  $oi_types = $this->getOpenInviterTypes();
21
  if ($step=='get_contacts')
22
  {
16
  <h2 class="legend"><?php echo $this->__('Select your provider and sign in:') ?></h2>
17
  <?php
18
  $step = $this->getOpenInviterStep();
19
+ $oi_services = $this->getOpenInviterPlugins();
20
  $oi_types = $this->getOpenInviterTypes();
21
  if ($step=='get_contacts')
22
  {
app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_cash.html ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+
21
+ <style type="text/css">
22
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
23
+ </style>
24
+
25
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
26
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
27
+ <tr>
28
+ <td align="center" valign="top">
29
+ <!-- [ header starts here] -->
30
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
31
+ <tr>
32
+ <td valign="top">
33
+ <a href="{{store url=""}}">
34
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
35
+ </a>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td align="center" valign="top">
44
+ <!-- [ middle starts here] -->
45
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
46
+ <tr>
47
+ <td valign="top">
48
+ <p><strong>Sehr geehrte {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
49
+ <p>Sie Ihre Austausch von Bargeld wurde gespeichert.</p>
50
+ <p>Der Wert (<strong>{{var data.discount_amount}} euros</strong>) dieses Austausches werden Ihrem Konto Effektive Validierung durch unsere übertragen werden.</p>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td valign="top">
55
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ </div>
app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_coupon.html ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+ coupon_code
19
+
20
+ *}<!--@subject {{var data.subject}} @-->
21
+
22
+ Hallo {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
+
24
+ Ihre Punkte wurden erfolgreich in einen Gutschein umgewandelt.
25
+
26
+ Sie verfügen ab sofort über ein Guthaben von {{var data.discount_amount}} Euro, welches Sie über die Eingabe folgenden Codes im Zuge Ihrer nächsten Bestellung einlösen können:
27
+
28
+ {{var data.coupon_code}}
29
+
30
+ {{store url=""}}
31
+
32
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
33
+
34
+ <style type="text/css">
35
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
36
+ </style>
37
+
38
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
39
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
40
+ <tr>
41
+ <td align="center" valign="top">
42
+ <!-- [ header starts here] -->
43
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
44
+ <tr>
45
+ <td valign="top">
46
+ <a href="{{store url=""}}">
47
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
48
+ </a>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td align="center" valign="top">
57
+ <!-- [ middle starts here] -->
58
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
59
+ <tr>
60
+ <td valign="top">
61
+ <p><strong>Hallo {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
62
+ <p>Ihre Punkte wurden erfolgreich in einen Gutschein umgewandelt.</p>
63
+ <p>Sie verfügen ab sofort über ein Guthaben von <strong>{{var data.discount_amount}} Euro</strong>, welches Sie über die Eingabe folgenden Codes im Zuge Ihrer nächsten Bestellung einlösen können:</p>
64
+ <h1 align="center">{{var data.coupon_code}}</h1>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <td valign="top">
69
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_invitation.html ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ data.sender_name
10
+ data.sender_email
11
+ data.subject
12
+ data.html_message
13
+ data.text_message
14
+ data.html_footer
15
+ data.text_footer
16
+ data.recipient_email
17
+ data.sponsorship_url
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+ {{var data.text_message}}
21
+ {{var data.text_footer}}
22
+
23
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
24
+
25
+ <style type="text/css">
26
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
27
+ </style>
28
+
29
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
30
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
31
+ <tr>
32
+ <td align="center" valign="top">
33
+ <!-- [ header starts here] -->
34
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
35
+ <tr>
36
+ <td valign="top">
37
+ <a href="{{var data.sponsorship_url}}">
38
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var order.getStoreGroupName()}}" style="margin-bottom:10px;" border="0"/>
39
+ </a>
40
+ </td>
41
+ </tr>
42
+ </table>
43
+
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td align="center" valign="top">
48
+ <!-- [ middle starts here] -->
49
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
50
+ <tr>
51
+ <td valign="top">
52
+ <pre>{{var data.html_message}}</pre>
53
+ <pre>{{var data.html_footer}}</pre>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+ </td>
58
+ </tr>
59
+ </table>
60
+ </div>
app/locale/de_DE/template/email/auguria/sponsorship/sponsorship_notification.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_name
11
+ sender_email
12
+ recipient_firstname
13
+ recipient_lastname
14
+ store_name
15
+ godchild_firstname
16
+ godchild_lastname
17
+ added_points
18
+ total_points
19
+
20
+ *}<!--@subject {{var data.subject}} @-->
21
+
22
+ Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
+
24
+ Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner {{var data.added_points}} points.
25
+
26
+ Vous disposez maintenant de {{var data.total_points}} points.
27
+
28
+ {{store url=""}}
29
+
30
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
31
+
32
+ <style type="text/css">
33
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
34
+ </style>
35
+
36
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
37
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
38
+ <tr>
39
+ <td align="center" valign="top">
40
+ <!-- [ header starts here] -->
41
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
42
+ <tr>
43
+ <td valign="top">
44
+ <a href="{{store url=""}}">
45
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
46
+ </a>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td align="center" valign="top">
55
+ <!-- [ middle starts here] -->
56
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
57
+ <tr>
58
+ <td valign="top">
59
+ <p><strong>Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
60
+ <p>Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner <strong>{{var data.added_points}}</strong> points.</p>
61
+ <p>Vous disposez maintenant de <strong>{{var data.total_points}}</strong> points.</p>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top">
66
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
67
+ </td>
68
+ </tr>
69
+ </table>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </div>
app/locale/en_US/template/email/auguria/sponsorship/sponsorship_cash.html ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+
21
+ <style type="text/css">
22
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
23
+ </style>
24
+
25
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
26
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
27
+ <tr>
28
+ <td align="center" valign="top">
29
+ <!-- [ header starts here] -->
30
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
31
+ <tr>
32
+ <td valign="top">
33
+ <a href="{{store url=""}}">
34
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
35
+ </a>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td align="center" valign="top">
44
+ <!-- [ middle starts here] -->
45
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
46
+ <tr>
47
+ <td valign="top">
48
+ <p><strong>Dear {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
49
+ <p>Your Exchange of cash has been saved.</p>
50
+ <p>The value (<strong>{{var data.discount_amount}} euros</strong>) of this exchange will be transferred to your account after validation by our</p>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td valign="top">
55
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ </div>
app/locale/en_US/template/email/auguria/sponsorship/sponsorship_coupon.html ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+ coupon_code
19
+
20
+ *}<!--@subject {{var data.subject}} @-->
21
+
22
+ Dear {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
+
24
+ Your vouchers points exchange has been successfully registred.
25
+
26
+ You can now receive your discount voucher worth {{var data.discount_amount}} euros, indicating the following code discounts:
27
+
28
+ {{var data.coupon_code}}
29
+
30
+ {{store url=""}}
31
+
32
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
33
+
34
+ <style type="text/css">
35
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
36
+ </style>
37
+
38
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
39
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
40
+ <tr>
41
+ <td align="center" valign="top">
42
+ <!-- [ header starts here] -->
43
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
44
+ <tr>
45
+ <td valign="top">
46
+ <a href="{{store url=""}}">
47
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
48
+ </a>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td align="center" valign="top">
57
+ <!-- [ middle starts here] -->
58
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
59
+ <tr>
60
+ <td valign="top">
61
+ <p><strong>Dear {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
62
+ <p>Your vouchers points exchange has been successfully registred.</p>
63
+ <p>You can now receive your discount voucher worth <strong>{{var data.discount_amount}} euros</strong>, indicating the following code discounts:</p>
64
+ <h1 align="center">{{var data.coupon_code}}</h1>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <td valign="top">
69
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
app/locale/en_US/template/email/auguria/sponsorship/sponsorship_invitation.html ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ data.sender_name
10
+ data.sender_email
11
+ data.subject
12
+ data.html_message
13
+ data.text_message
14
+ data.html_footer
15
+ data.text_footer
16
+ data.recipient_email
17
+ data.sponsorship_url
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+ {{var data.text_message}}
21
+ {{var data.text_footer}}
22
+
23
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
24
+
25
+ <style type="text/css">
26
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
27
+ </style>
28
+
29
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
30
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
31
+ <tr>
32
+ <td align="center" valign="top">
33
+ <!-- [ header starts here] -->
34
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
35
+ <tr>
36
+ <td valign="top">
37
+ <a href="{{var data.sponsorship_url}}">
38
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var order.getStoreGroupName()}}" style="margin-bottom:10px;" border="0"/>
39
+ </a>
40
+ </td>
41
+ </tr>
42
+ </table>
43
+
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td align="center" valign="top">
48
+ <!-- [ middle starts here] -->
49
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
50
+ <tr>
51
+ <td valign="top">
52
+ <pre>{{var data.html_message}}</pre>
53
+ <pre>{{var data.html_footer}}</pre>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+ </td>
58
+ </tr>
59
+ </table>
60
+ </div>
app/locale/en_US/template/email/auguria/sponsorship/sponsorship_notification.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_name
11
+ sender_email
12
+ recipient_firstname
13
+ recipient_lastname
14
+ store_name
15
+ godchild_firstname
16
+ godchild_lastname
17
+ added_points
18
+ total_points
19
+
20
+ *}<!--@subject {{var data.subject}} @-->
21
+
22
+ Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
+
24
+ Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner {{var data.added_points}} points.
25
+
26
+ Vous disposez maintenant de {{var data.total_points}} points.
27
+
28
+ {{store url=""}}
29
+
30
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
31
+
32
+ <style type="text/css">
33
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
34
+ </style>
35
+
36
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
37
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
38
+ <tr>
39
+ <td align="center" valign="top">
40
+ <!-- [ header starts here] -->
41
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
42
+ <tr>
43
+ <td valign="top">
44
+ <a href="{{store url=""}}">
45
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
46
+ </a>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td align="center" valign="top">
55
+ <!-- [ middle starts here] -->
56
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
57
+ <tr>
58
+ <td valign="top">
59
+ <p><strong>Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
60
+ <p>Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner <strong>{{var data.added_points}}</strong> points.</p>
61
+ <p>Vous disposez maintenant de <strong>{{var data.total_points}}</strong> points.</p>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top">
66
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
67
+ </td>
68
+ </tr>
69
+ </table>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </div>
app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_cash.html ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+
21
+ <style type="text/css">
22
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
23
+ </style>
24
+
25
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
26
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
27
+ <tr>
28
+ <td align="center" valign="top">
29
+ <!-- [ header starts here] -->
30
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
31
+ <tr>
32
+ <td valign="top">
33
+ <a href="{{store url=""}}">
34
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
35
+ </a>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td align="center" valign="top">
44
+ <!-- [ middle starts here] -->
45
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
46
+ <tr>
47
+ <td valign="top">
48
+ <p><strong>Hola {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
49
+ <p>Cambie dinero se ha guardado.</p>
50
+ <p>Valors(<strong>{{var data.discount_amount}} euros</strong>) de este intercambio será transferido a su cuenta después de validación por nuestro servicio.</p>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td valign="top">
55
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ </div>
app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_coupon.html ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+ coupon_code
19
+
20
+ *}<!--@subject {{var data.subject}} @-->
21
+
22
+ Estimado {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
+
24
+ Sus bonos de intercambio de puntos han sido registrados con éxito.
25
+
26
+ Ahora puede recibir su descuento por valor de {{var data.discount_amount}} euros, indicando el siguiente código de descuento:
27
+
28
+ {{var data.coupon_code}}
29
+
30
+ {{store url=""}}
31
+
32
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
33
+
34
+ <style type="text/css">
35
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
36
+ </style>
37
+
38
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
39
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
40
+ <tr>
41
+ <td align="center" valign="top">
42
+ <!-- [ header starts here] -->
43
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
44
+ <tr>
45
+ <td valign="top">
46
+ <a href="{{store url=""}}">
47
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
48
+ </a>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td align="center" valign="top">
57
+ <!-- [ middle starts here] -->
58
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
59
+ <tr>
60
+ <td valign="top">
61
+ <p><strong>Estimado {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
62
+ <p>Sus bonos de intercambio de puntos han sido registrados con éxito.</p>
63
+ <p>Ahora puede recibir su descuento por valor de <strong>{{var data.discount_amount}} euros</strong>, indicando el siguiente código de descuento:</p>
64
+ <h1 align="center">{{var data.coupon_code}}</h1>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <td valign="top">
69
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </td>
74
+ </tr>
75
+ </table>
76
+ </div>
app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_invitation.html ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ data.sender_name
10
+ data.sender_email
11
+ data.subject
12
+ data.html_message
13
+ data.text_message
14
+ data.html_footer
15
+ data.text_footer
16
+ data.recipient_email
17
+ data.sponsorship_url
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+ {{var data.text_message}}
21
+ {{var data.text_footer}}
22
+
23
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
24
+
25
+ <style type="text/css">
26
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
27
+ </style>
28
+
29
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
30
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
31
+ <tr>
32
+ <td align="center" valign="top">
33
+ <!-- [ header starts here] -->
34
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
35
+ <tr>
36
+ <td valign="top">
37
+ <a href="{{var data.sponsorship_url}}">
38
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var order.getStoreGroupName()}}" style="margin-bottom:10px;" border="0"/>
39
+ </a>
40
+ </td>
41
+ </tr>
42
+ </table>
43
+
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <td align="center" valign="top">
48
+ <!-- [ middle starts here] -->
49
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
50
+ <tr>
51
+ <td valign="top">
52
+ <pre>{{var data.html_message}}</pre>
53
+ <pre>{{var data.html_footer}}</pre>
54
+ </td>
55
+ </tr>
56
+ </table>
57
+ </td>
58
+ </tr>
59
+ </table>
60
+ </div>
app/locale/es_ES/template/email/auguria/sponsorship/sponsorship_notification.html ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_name
11
+ sender_email
12
+ recipient_firstname
13
+ recipient_lastname
14
+ store_name
15
+ godchild_firstname
16
+ godchild_lastname
17
+ added_points
18
+ total_points
19
+
20
+ *}<!--@subject {{var data.subject}} @-->
21
+
22
+ Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
+
24
+ Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner {{var data.added_points}} points.
25
+
26
+ Vous disposez maintenant de {{var data.total_points}} points.
27
+
28
+ {{store url=""}}
29
+
30
+ --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
31
+
32
+ <style type="text/css">
33
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
34
+ </style>
35
+
36
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
37
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
38
+ <tr>
39
+ <td align="center" valign="top">
40
+ <!-- [ header starts here] -->
41
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
42
+ <tr>
43
+ <td valign="top">
44
+ <a href="{{store url=""}}">
45
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
46
+ </a>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td align="center" valign="top">
55
+ <!-- [ middle starts here] -->
56
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
57
+ <tr>
58
+ <td valign="top">
59
+ <p><strong>Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
60
+ <p>Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner <strong>{{var data.added_points}}</strong> points.</p>
61
+ <p>Vous disposez maintenant de <strong>{{var data.total_points}}</strong> points.</p>
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top">
66
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
67
+ </td>
68
+ </tr>
69
+ </table>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </div>
app/locale/fr_FR/Auguria_Sponsorship.csv CHANGED
@@ -7,6 +7,7 @@ Action,Action
7
  %s is already an email to our customers,%s est déjà l'email d'un de nos clients
8
  %s points,%s points
9
  %s points exchange for customer (%s),Échange de points %s pour le client (%s)
 
10
  %s sponsor points,Points de parrainage %s
11
  %s vouchers points exchange,%s échange de points en bon de réduction
12
  <a href='%s'>%s</a>,<a href='%s'>%s</a>
@@ -22,6 +23,7 @@ Add Recipient,Ajouter un destinataire
22
  Add recipients,Ajoutez les destinataires.
23
  Add recipients.,Ajoutez les destinataires.
24
  Address book provider:,Fournisseur de carnet d'adresse :
 
25
  Allow customers who have never ordered to send invitations,Autoriser les clients n'ayant jamais commandé à envoyer des invitations
26
  Allow customers who have never ordered to send sponsorship invitations,Autoriser les clients n'ayant jamais commandé à envoyer des invitations
27
  Allow to sponsor registred customers (but never ordered),Autoriser le parainage de clients déjà enregistrés (mais n'ayant jamais commandé)
@@ -43,13 +45,14 @@ But it could not be saved.,Mais il n'a pas pu être enregistré.
43
  Buying,Achat
44
  Buying cancellation,Annulation d'achat
45
  Calculation period of the maximum allowed for an individual (days),Période de calcul du maximum autorisé pour un particulier (jours)
46
- Campany number,SIRET
47
  Cancel earned points on credit memo creation,Annuler les points gagnés lors de la création d'un avoir
48
  Cancel the use of points on credit memo creation,Annuler l'utilisation des points lors de la création d'un avoir
49
  Canceled,Annulé
50
  Cart exchange,Échange panier
51
  Cash,Cash
52
  cash,cash
 
53
  Cash exchange,Échange en cash
54
  Cash exchange,Échange de cash
55
  Cash exchange cancellation,Annulation échange de cash
@@ -82,6 +85,7 @@ Email Address:,Email :
82
  Email missing !,Il manque l'email !
83
  Email Providers,Fournisseurs de mails
84
  Email:,Email :
 
85
  Enter the cash you want.,Indiquez le cash que vous souhaitez obtenir.
86
  Enter the points you want to convert.,Indiquez les points que vous voulez convertir.
87
  Entries Per Page:,Nombre par page :
@@ -125,10 +129,12 @@ Guest mail,Email invité
125
  Guest name,Nom invité
126
  IBAN,IBAN
127
  ID,ID
 
128
  Import Contacts,Importer contacts
129
  Import selected contacts,Importer les contacts sélectionnés
130
  Inactivity time before removal of the sponsorship link (days),Temps d'inactivité avant suppression du lien de parrainage (jours)
131
  "Invalid IBAN code ""%s""","Le code IBAN ""%s"" est invalide"
 
132
  Invitation detail,Détail de l'invitation
133
  Invitation does not exist,L'invitation n'existe pas
134
  Invitation Email Template,Gabarit du mail d'invitation
@@ -236,7 +242,7 @@ This sponsorship doesn't exist,Ce parrainage n'existe pas
236
  Time to send it automatically (days),Temps avant la relance automatique (jours)
237
  Time validity invitations (days),Temps de validité des invitations (jours)
238
  "To change more cash, you must specify a company number.","Pour changer plus de cash, vous devez indiquer un numéro SIRET."
239
- "To change your points into cash, you must indicate your IBAN.","Pour changer vos points en cash, vous devez indiquer votre code IBAN."
240
  Type,Type
241
  Unable to find change to save,Impossible de trouver l'échange à enregistrer
242
  Unable to find invitation to save,Impossible de trouver l'invitation à enregistrer
@@ -258,6 +264,8 @@ Vouchers:,Bons de réduction :
258
  Waiting,En attente
259
  Winning,Points gagnés
260
  worth %s,soit %s
 
 
261
  You can't send an invitation to yourself,Vous ne pouvez pas vous envoyer une invitation à vous même.
262
  You do not have active godson.,Vous n'avez pas de filleul actif.
263
  You do not have as many points.,Vous ne disposez pas d'autant de points.
7
  %s is already an email to our customers,%s est déjà l'email d'un de nos clients
8
  %s points,%s points
9
  %s points exchange for customer (%s),Échange de points %s pour le client (%s)
10
+ %s cash exchange,%s Échange d'argent
11
  %s sponsor points,Points de parrainage %s
12
  %s vouchers points exchange,%s échange de points en bon de réduction
13
  <a href='%s'>%s</a>,<a href='%s'>%s</a>
23
  Add recipients,Ajoutez les destinataires.
24
  Add recipients.,Ajoutez les destinataires.
25
  Address book provider:,Fournisseur de carnet d'adresse :
26
+ Administrator email,Email de l'administrateur
27
  Allow customers who have never ordered to send invitations,Autoriser les clients n'ayant jamais commandé à envoyer des invitations
28
  Allow customers who have never ordered to send sponsorship invitations,Autoriser les clients n'ayant jamais commandé à envoyer des invitations
29
  Allow to sponsor registred customers (but never ordered),Autoriser le parainage de clients déjà enregistrés (mais n'ayant jamais commandé)
45
  Buying,Achat
46
  Buying cancellation,Annulation d'achat
47
  Calculation period of the maximum allowed for an individual (days),Période de calcul du maximum autorisé pour un particulier (jours)
48
+ Company number,SIRET
49
  Cancel earned points on credit memo creation,Annuler les points gagnés lors de la création d'un avoir
50
  Cancel the use of points on credit memo creation,Annuler l'utilisation des points lors de la création d'un avoir
51
  Canceled,Annulé
52
  Cart exchange,Échange panier
53
  Cash,Cash
54
  cash,cash
55
+ Cash Email Template, Gabarit du mail de l'échange de cash
56
  Cash exchange,Échange en cash
57
  Cash exchange,Échange de cash
58
  Cash exchange cancellation,Annulation échange de cash
85
  Email missing !,Il manque l'email !
86
  Email Providers,Fournisseurs de mails
87
  Email:,Email :
88
+ Enable checking company number, Activer la vérification du SIRET
89
  Enter the cash you want.,Indiquez le cash que vous souhaitez obtenir.
90
  Enter the points you want to convert.,Indiquez les points que vous voulez convertir.
91
  Entries Per Page:,Nombre par page :
129
  Guest name,Nom invité
130
  IBAN,IBAN
131
  ID,ID
132
+ "If you uncheck this option, the option 'Maximum amount permitted without company number' will not be activated", "Si vous désactivez l'option, l'option 'Montant maximum autorisé sans SIRET' ne fonctionnera pas"
133
  Import Contacts,Importer contacts
134
  Import selected contacts,Importer les contacts sélectionnés
135
  Inactivity time before removal of the sponsorship link (days),Temps d'inactivité avant suppression du lien de parrainage (jours)
136
  "Invalid IBAN code ""%s""","Le code IBAN ""%s"" est invalide"
137
+ "Invalid BIC code ""%s""","Le code BIC ""%s"" est invalide"
138
  Invitation detail,Détail de l'invitation
139
  Invitation does not exist,L'invitation n'existe pas
140
  Invitation Email Template,Gabarit du mail d'invitation
242
  Time to send it automatically (days),Temps avant la relance automatique (jours)
243
  Time validity invitations (days),Temps de validité des invitations (jours)
244
  "To change more cash, you must specify a company number.","Pour changer plus de cash, vous devez indiquer un numéro SIRET."
245
+ "To change your points into cash, you must indicate your IBAN and BIC.","Pour changer vos points en cash, vous devez indiquer votre code IBAN et BIC."
246
  Type,Type
247
  Unable to find change to save,Impossible de trouver l'échange à enregistrer
248
  Unable to find invitation to save,Impossible de trouver l'invitation à enregistrer
264
  Waiting,En attente
265
  Winning,Points gagnés
266
  worth %s,soit %s
267
+ Cash exchange mail options,Options des mails d'échange de cash
268
+ A customer wants to exchange %s Euros,Un client souhaite échanger %s Euros
269
  You can't send an invitation to yourself,Vous ne pouvez pas vous envoyer une invitation à vous même.
270
  You do not have active godson.,Vous n'avez pas de filleul actif.
271
  You do not have as many points.,Vous ne disposez pas d'autant de points.
app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_cash.html ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {* This is a comment block
2
+
3
+ @category Auguria
4
+ @package Auguria_Sponsorship
5
+ @author Auguria
6
+ @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
7
+
8
+ Available vars in sponsorship template:
9
+ subject
10
+ sender_id
11
+ sender_name
12
+ sender_email
13
+ sender_name
14
+ sender_email
15
+ recipient_firstname
16
+ recipient_lastname
17
+ discount_amount
18
+
19
+ *}<!--@subject {{var data.subject}} @-->
20
+
21
+ <style type="text/css">
22
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
23
+ </style>
24
+
25
+ <div style="font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;">
26
+ <table cellspacing="0" cellpadding="0" border="0" width="98%" style="margin-top:10px; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; margin-bottom:10px;">
27
+ <tr>
28
+ <td align="center" valign="top">
29
+ <!-- [ header starts here] -->
30
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
31
+ <tr>
32
+ <td valign="top">
33
+ <a href="{{store url=""}}">
34
+ <img src="{{skin url="images/logo_email.gif" _area='frontend'}}" alt="{{var data.store_name}}" style="margin-bottom:10px;" border="0"/>
35
+ </a>
36
+ </td>
37
+ </tr>
38
+ </table>
39
+
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td align="center" valign="top">
44
+ <!-- [ middle starts here] -->
45
+ <table cellspacing="0" cellpadding="0" border="0" width="650">
46
+ <tr>
47
+ <td valign="top">
48
+ <p><strong>Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}}</strong>,</p>
49
+ <p>Votre échange de cash a bien été enregistré.</p>
50
+ <p>La valeur (<strong>{{var data.discount_amount}} euros</strong>) de cet échange sera viré sur votre compte dès validation par notre service</p>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td valign="top">
55
+ <a href="{{store url=""}}">{{var data.store_name}}</a>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ </div>
app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_coupon.html CHANGED
@@ -19,18 +19,6 @@ coupon_code
19
 
20
  *}<!--@subject {{var data.subject}} @-->
21
 
22
- Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
-
24
- Votre échange de points en bon de réduction a bien été enregistré.
25
-
26
- Vous pouvez dès maintenant bénéficier de votre bon de réduction d'une valeur de {{var data.discount_amount}} euros, en indiquant le code de remises suivant :
27
-
28
- {{var data.coupon_code}}
29
-
30
- {{store url=""}}
31
-
32
- --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
33
-
34
  <style type="text/css">
35
  body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
36
  </style>
19
 
20
  *}<!--@subject {{var data.subject}} @-->
21
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  <style type="text/css">
23
  body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
24
  </style>
app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_invitation.html CHANGED
@@ -10,17 +10,11 @@ data.sender_name
10
  data.sender_email
11
  data.subject
12
  data.html_message
13
- data.text_message
14
  data.html_footer
15
- data.text_footer
16
  data.recipient_email
17
  data.sponsorship_url
18
 
19
  *}<!--@subject {{var data.subject}} @-->
20
- {{var data.text_message}}
21
- {{var data.text_footer}}
22
-
23
- --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
24
 
25
  <style type="text/css">
26
  body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
10
  data.sender_email
11
  data.subject
12
  data.html_message
 
13
  data.html_footer
 
14
  data.recipient_email
15
  data.sponsorship_url
16
 
17
  *}<!--@subject {{var data.subject}} @-->
 
 
 
 
18
 
19
  <style type="text/css">
20
  body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
app/locale/fr_FR/template/email/auguria/sponsorship/sponsorship_notification.html CHANGED
@@ -19,16 +19,6 @@ total_points
19
 
20
  *}<!--@subject {{var data.subject}} @-->
21
 
22
- Bonjour {{var data.recipient_firstname}} {{var data.recipient_lastname}},
23
-
24
- Votre filleul {{var data.godchild_firstname}} {{var data.godchild_lastname}} vous a fait gagner {{var data.added_points}} points.
25
-
26
- Vous disposez maintenant de {{var data.total_points}} points.
27
-
28
- {{store url=""}}
29
-
30
- --BOUNDARY_TEXT_OF_CHOICE_FOR_AUGURIA_SPONSORSHIP
31
-
32
  <style type="text/css">
33
  body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
34
  </style>
19
 
20
  *}<!--@subject {{var data.subject}} @-->
21
 
 
 
 
 
 
 
 
 
 
 
22
  <style type="text/css">
23
  body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
24
  </style>
js/auguria/sponsorship/admin.js ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //CONSTANTES
2
+ var FIDELITY = "fidelity";
3
+ var SPONSORSHIP = "sponsorship";
4
+ var SEPARATED = "separated";
5
+ var ACCUMULATED = "accumulated";
6
+
7
+ Event.observe(window, 'load', function() {
8
+ changeTab();
9
+ Event.observe($('auguria_sponsorship_general_module_mode'), 'change', function() {
10
+ changeTab();
11
+ });
12
+ });
13
+
14
+ function changeTab(){
15
+
16
+ var mode = $('auguria_sponsorship_general_module_mode').getValue();
17
+
18
+ switch(mode){
19
+ case FIDELITY: // Mode Fidélité
20
+
21
+ // SHOW Fidélité
22
+ if($('auguria_sponsorship_fidelity-head').up('.section-config')) {
23
+ $('auguria_sponsorship_fidelity-head').up('.section-config').addClassName('active').show();
24
+ }
25
+ $('auguria_sponsorship_fidelity').show();
26
+
27
+ // HIDE Parrainage
28
+ if($('auguria_sponsorship_sponsor-head').up('.section-config')) {
29
+ $('auguria_sponsorship_sponsor-head').up('.section-config').removeClassName('active').hide();
30
+ }
31
+ $('auguria_sponsorship_sponsor').hide();
32
+
33
+ // HIDE Accumulé
34
+ if($('auguria_sponsorship_accumulated-head').up('.section-config')) {
35
+ $('auguria_sponsorship_accumulated-head').up('.section-config').removeClassName('active').hide();
36
+ }
37
+ $('auguria_sponsorship_accumulated').hide();
38
+
39
+ break;
40
+ case SPONSORSHIP: // Mode Parrainage
41
+
42
+ // HIDE Fidélité
43
+ if($('auguria_sponsorship_fidelity-head').up('.section-config')) {
44
+ $('auguria_sponsorship_fidelity-head').up('.section-config').removeClassName('active').hide();
45
+ }
46
+ $('auguria_sponsorship_fidelity').hide();
47
+
48
+ // SHOW Parrainage
49
+ if($('auguria_sponsorship_sponsor-head').up('.section-config')) {
50
+ $('auguria_sponsorship_sponsor-head').up('.section-config').addClassName('active').show();
51
+ }
52
+ $('auguria_sponsorship_sponsor').show();
53
+
54
+ // HIDE Accumulé
55
+ if($('auguria_sponsorship_accumulated-head').up('.section-config')) {
56
+ $('auguria_sponsorship_accumulated-head').up('.section-config').removeClassName('active').hide();
57
+ }
58
+ $('auguria_sponsorship_accumulated').hide();
59
+
60
+ break;
61
+ case SEPARATED: // Fidélité et parrainage (séparé)
62
+
63
+ // SHOW Fidélité
64
+ if($('auguria_sponsorship_fidelity-head').up('.section-config')) {
65
+ $('auguria_sponsorship_fidelity-head').up('.section-config').addClassName('active').show();
66
+ }
67
+ $('auguria_sponsorship_fidelity').show();
68
+
69
+ // SHOW Parrainage
70
+ if($('auguria_sponsorship_sponsor-head').up('.section-config')) {
71
+ $('auguria_sponsorship_sponsor-head').up('.section-config').addClassName('active').show();
72
+ }
73
+ $('auguria_sponsorship_sponsor').show();
74
+
75
+ // HIDE Accumulé
76
+ if($('auguria_sponsorship_accumulated-head').up('.section-config')) {
77
+ $('auguria_sponsorship_accumulated-head').up('.section-config').removeClassName('active').hide();
78
+ }
79
+ $('auguria_sponsorship_accumulated').hide();
80
+
81
+ break;
82
+ case ACCUMULATED: // Fidélité et parrainage (accumulé)
83
+
84
+ // HIDE Fidélité
85
+ if($('auguria_sponsorship_fidelity-head').up('.section-config')) {
86
+ $('auguria_sponsorship_fidelity-head').up('.section-config').removeClassName('active').hide();
87
+ }
88
+ $('auguria_sponsorship_fidelity').hide();
89
+
90
+ // HIDE Parrainage
91
+ if($('auguria_sponsorship_sponsor-head').up('.section-config')) {
92
+ $('auguria_sponsorship_sponsor-head').up('.section-config').removeClassName('active').hide();
93
+ }
94
+ $('auguria_sponsorship_sponsor').hide();
95
+
96
+ // SHOW Accumulé
97
+ if($('auguria_sponsorship_accumulated-head').up('.section-config')) {
98
+ $('auguria_sponsorship_accumulated-head').up('.section-config').addClassName('active').show();
99
+ }
100
+ $('auguria_sponsorship_accumulated').show();
101
+
102
+ break;
103
+ default:
104
+ mode = "ACCUMULATED";
105
+ break;
106
+ }
107
+ }
media/sponsorship/openinviter/logo_auguria.png DELETED
Binary file
package.xml CHANGED
@@ -1,50 +1,43 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auguria_Sponsorship</name>
4
- <version>1.2.9</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>This module allows customers to earn fidelity and sponsorship points.&#xD;
10
- &#xD;
11
- Customers can invit friends on your site and when their friends buy products, they earn sponsorship points. If a godchild sponsor a person, the sponsor will earn a percentage too.&#xD;
12
- &#xD;
13
- When customers buy, they can win fidelity points. &#xD;
14
- &#xD;
15
- These points can then be exchanged against cash, discounts or gifts (not yet implemented).</summary>
16
  <description>The module consists of :&#xD;
17
- &#xD;
18
  - A form to send invitations: when an invitation is sent, the guest mail is registered , and the customer id too.&#xD;
19
- &#xD;
20
  - A system of affiliation: The link sent through invitations refer to a controller that will create a cookie and a session to identify a person invited. We can equally put such links on third party sites.&#xD;
21
- &#xD;
22
  - Account creation: When creating an account, it checks whether an invitation was sent to the email used for registration. If this is not the case, we check if a session cookie or affiliation exists. If there is a link, the user who registers become the godson of the customer who invits him.&#xD;
23
- &#xD;
24
  - A monitoring points for the client: the client have an interface for monitoring points in his account. He can see his godson. He can ask for trade his points.&#xD;
25
- &#xD;
26
  - Increment of points: Fidelity points and sponsorship points are inserted in the command, at the checkout cart. Upon payment of the command, points are awarded to customers.&#xD;
27
- &#xD;
28
  - Definition of rules: the management of points can be made through the catalog rules prices or cart rules prices.&#xD;
29
- &#xD;
30
  - Module configuration: The administration interface allows you to enable or disable fidelity points or sponsorship points. Enabling or no exchange of cash, gift or coupon. You can also define the max cash without siret number, the period of calcul of the max cash, if an order is required to sponsor, the period of validity for an invitation, the period of validity of a sponsorship whithout an order, number of levels for sponsorship calculation points, the percentage on indirect sponsorship sales, the maximum number of invitations that you can send per hour, the header message, the body message and the footer message.&#xD;
31
- &#xD;
32
  - An administration interface: allows to see the list of invitations sent, monitor requests for trade of points.&#xD;
33
  &#xD;
34
- &#xD;
35
- &#xD;
36
  Once installed, you must:&#xD;
37
- &#xD;
38
  - Create one or several catalog or cart rules for increment fidelity and sponsorship points&#xD;
39
- &#xD;
40
  - Edit CMS Page on sponsorship information&#xD;
41
- &#xD;
42
  - If you enable automatic sponsorship recall, activate magento cron</description>
43
- <notes>If you have ideas for improvements or find bugs, please send them to Franck Charpentier at www.auguria.net, with Auguria LastReviews as part of the subject line.</notes>
 
 
 
 
 
 
 
 
 
44
  <authors><author><name>Auguria</name><user>Auguria</user><email>magento@auguria.net</email></author></authors>
45
- <date>2013-03-07</date>
46
- <time>16:26:47</time>
47
- <contents><target name="magecommunity"><dir name="Auguria"><dir name="Sponsorship"><dir name="Block"><dir name="Adminhtml"><dir name="Change"><dir name="Edit"><file name="Form.php" hash="ae7412b583874b8fffc05cc3897f1a2b"/><dir name="Tab"><file name="Form.php" hash="7271b9c47190cdff0b2af24968c4e155"/></dir><file name="Tabs.php" hash="2c8257d215289d5ae86c985f42721650"/></dir><file name="Edit.php" hash="856fb2d016982d1c1f47c462195e7f39"/><file name="Grid.php" hash="39bae596eb7cd73879a5e769d82c00db"/></dir><file name="Change.php" hash="b9046a8e50dceaacc6d248471275a9ca"/><dir name="Customer"><dir name="Tabs"><file name="Sponsorship.php" hash="a32d0d1979be05d6a37bb928820b6e04"/></dir></dir><dir name="Link"><dir name="Edit"><file name="Form.php" hash="e6e087ae96b24d4edbe9e1f578e7a55a"/><dir name="Tab"><file name="Form.php" hash="89cf7a2479cd6b5606884a73d9122d4a"/></dir><file name="Tabs.php" hash="fd3d95a2cfe3e194d26ba94c45353bf1"/></dir><file name="Edit.php" hash="4ecef8c6e59c6642a6b3348ae24d5ab8"/><file name="Grid.php" hash="17bb23c2a473542e44d3e2878c61af58"/></dir><file name="Link.php" hash="4c9673d016652b74338b8e5ed49b5240"/><dir name="Openinviter"><dir name="Edit"><file name="Form.php" hash="b4bdc64549563f0117f65c66f97d0fb8"/><dir name="Tab"><file name="Form.php" hash="a0f4530da07ba12f9d4aa53c612cca09"/></dir><file name="Tabs.php" hash="a7595c7aab4bb62da7a55674bac936e8"/></dir><file name="Edit.php" hash="79c8c3b6ca7d0e07e9a9cb8ddc18a9c5"/><file name="Grid.php" hash="7c323452ac344c6bb446d90f7c42e11c"/></dir><file name="Openinviter.php" hash="2fbf061ee8aaff7ee34a9f5b723d84c0"/><dir name="Sales"><dir name="Order"><dir name="Invoice"><file name="Totals.php" hash="292697b2443939616b7db683ecfe64d0"/></dir><file name="Totals.php" hash="e174624626a3d4952b257f4a9481f471"/></dir></dir><dir name="Sponsorship"><dir name="Edit"><file name="Form.php" hash="a3a2352db1c72663af0caa289287a9d2"/><dir name="Tab"><file name="Form.php" hash="ac62217927d4092f047b8fb8b849668f"/></dir><file name="Tabs.php" hash="88eb68796c7de324dc1cdea77deaa4ae"/></dir><file name="Edit.php" hash="7ae0b40486d27042caa70bf42c747383"/><file name="Grid.php" hash="a10dd155e32fea5c218880211573832d"/></dir><file name="Sponsorship.php" hash="6d133ec629d775d5e23b7967bb7bcc78"/><dir name="Widget"><dir name="Grid"><file name="Renderer.php" hash="35c8a336e1a0e2dcc8d48b558cee9253"/></dir></dir></dir><dir name="Customer"><dir name="Account"><file name="PointsDetail.php" hash="b34450ac151dee1d1bf61d1648094a40"/></dir><dir name="Form"><file name="Boost.php" hash="18c1f531695bc529103af1bc4c3394d6"/><file name="PointsChange.php" hash="db26c8991b5ba182662424f94f020cd2"/></dir><dir name="Widget"><file name="Name.php" hash="886513495ba42430c77a640a2f7af42f"/><file name="Virement.php" hash="cafde77d6d5504ae64c63fc9732a3461"/></dir></dir><file name="Openinviter.php" hash="3051e44a791ccab457a37cef01357bd5"/><dir name="Promo"><dir name="Catalog"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="f5926196fd291cb45c13b5a8e1c018b6"/></dir></dir></dir><dir name="Quote"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="4ff4de9b5e4d5200111d602625f91362"/></dir></dir></dir></dir><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="da373c7bfc6dadefa78f38ac96a0e7c4"/></dir></dir><file name="Sponsorship.php" hash="b38d23fea90cf387b00508c264da736c"/></dir><dir name="Helper"><file name="Config.php" hash="7a5cd1b95ce1ff10959c811d8c4e5c30"/><file name="Data.php" hash="ab6aad8d2d024aceb0530f2a3f2dd42f"/><file name="Mail.php" hash="e4c1942582ae354bde08e462c9df888a"/></dir><dir name="Lib"><file name="Html2Text.php" hash="4bd5cf3bd59121ffa9d15b9a60a56ca4"/><dir name="OpenInviter"><file name="LICENSE.txt" hash="277c3d400c7488e54746141297a952cb"/><file name="POLICY.txt" hash="6262372bc84e172c7fd89d9ac61f9794"/><file name="autoupdate.php" hash="df781d645e37271f23432bb82b3360a2"/><dir name="conf"><file name="_hosted.conf" hash="1d09309103e660729b492433acda9822"/><file name="abv.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="aol.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="apropo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="atlas.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="aussiemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="azet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="badoo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bebo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bigstring.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="bookcrossing.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bordermail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="brazencareerist.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="canoe.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="care2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="clevergo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="cyworld.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="doramail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="eons.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="evite.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="facebook.conf" hash="12cfb187449596c39774c4ac193295cc"/><file name="faces.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="famiva.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="fastmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="fdcareer.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flickr.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flingr.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flixster.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="fm5.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="freemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="friendfeed.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="friendster.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="gawab.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="gmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="gmx_net.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="graffiti.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hi5.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="hotmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hushmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hyves.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="inbox.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="india.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="indiatimes.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="inet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="interia.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="katamail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="kids.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="kincafe.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="konnects.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="koolro.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lastfm.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="libero.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="linkedin.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="livejournal.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lovento.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lycos.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail2world.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_com.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_in.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_ru.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="meinvz.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="meta.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mevio.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="motortopia.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="msn.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="multiply.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mycatspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mydogspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mynet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="myspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="netaddress.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="netlog.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="ning.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="nz11.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="o2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="operamail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="orkut.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="perfspot.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plaxo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plazes.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plurk.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="pochta.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="popstarmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="rambler.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="rediff.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="sapo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="skyrock.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="tagged.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="techemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="terra.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="twitter.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="uk2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="vimeo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="virgilio.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="vkontakte.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="walla.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="web_de.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="wpl.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="xanga.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="xing.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="xuqa.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="yahoo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="yandex.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="youtube.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="zapak.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/></dir><file name="config.php" hash="6c16534afd6e50dfda0c5be417bd6fe7"/><dir name="images"><file name="ers.gif" hash="cccdfd4ed0795b767d2a01f531781c10"/><file name="oks.gif" hash="6b4b170c9f10a0fa4b25307dd8f47e5b"/></dir><file name="notifier.php" hash="88e3be687de995aae52a8ce248c49bce"/><file name="openinviter.php" hash="d2c0237f86cd7c21dadc2c441e73abb1"/><dir name="plugins"><file name="_base.php" hash="79459bef6fcea96f6a7d4a584add9052"/><file name="_hosted.plg.php" hash="69514e56e1833df16884b6762bc620ce"/><file name="abv.plg.php" hash="1685755eae909c468055b9b36c915822"/><file name="aol.plg.php" hash="dd3522033c2cafeb62fd0beed5949bcf"/><file name="apropo.plg.php" hash="4426f976c1953383cf9d1f892aa9576e"/><file name="atlas.plg.php" hash="0b8e4237970ae54ff20187f5e861f972"/><file name="aussiemail.plg.php" hash="d40188b33455b3fd2e88cbde25f61709"/><file name="azet.plg.php" hash="e4a7c19450ca1ad84783a06ae3b1d61f"/><file name="badoo.plg.php" hash="b1d4863a173a80fc9d77331f1e60f2df"/><file name="bebo.plg.php" hash="2d7db898c660380ee74963667bec6bae"/><file name="bigstring.plg.php" hash="7de7a5516a8f0c71580970d8da4121eb"/><file name="bookcrossing.plg.php" hash="212a53a3a95659c56e15d6848549e25e"/><file name="bordermail.plg.php" hash="30190fa3da58d63ddd7e30e6ab0190dc"/><file name="brazencareerist.plg.php" hash="c68f39b6d7a07550abd63ed044ad85c2"/><file name="canoe.plg.php" hash="7737d89b163689cb793f0f37f6028efb"/><file name="care2.plg.php" hash="c066e81973194cca90036c37c7740937"/><file name="clevergo.plg.php" hash="9bd12fea0eb7f60043bcdca9116cb1bc"/><file name="cyworld.plg.php" hash="588dfdddcc2bc9ab2ff26c4616e0a42c"/><file name="doramail.plg.php" hash="81037085958f90a05111ad030c5a72f8"/><file name="eons.plg.php" hash="35009d6e25ae5584c554808b50145a19"/><file name="evite.plg.php" hash="d6c8acf7c24c2848eccedb269928d6eb"/><file name="facebook.plg.php" hash="6a1cfdc0dfc76b3dc3781aa2327ee833"/><file name="faces.plg.php" hash="d0affdf4e73ff6134acfaae5fda29323"/><file name="famiva.plg.php" hash="eee1c0a9a6d645baf014245ca2e9c3e9"/><file name="fastmail.plg.php" hash="da86fea25210ed40258ae2a107dcfe8f"/><file name="fdcareer.plg.php" hash="aad3d525fe09269de056f8ec03e43104"/><file name="flickr.plg.php" hash="055d1e64f116113379e3192b23dc84fc"/><file name="flingr.plg.php" hash="c2b415851babadb8048609874b411979"/><file name="flixster.plg.php" hash="773fad1c2c1775fcb74fb33f51d1fa24"/><file name="fm5.plg.php" hash="0576df91534edaab3d6b333d1968781a"/><file name="freemail.plg.php" hash="142951e9c20ce4447f44c6db7e5cc2e8"/><file name="friendfeed.plg.php" hash="399c987766110735fdd301979997fe48"/><file name="friendster.plg.php" hash="8b3402876a73bf91a84d3a6d8dbb1951"/><file name="gawab.plg.php" hash="c4cb42d893a99b370d9597f20da5c01e"/><file name="gmail.plg.php" hash="83d92f7f75e048210aec2fdecdbd67e0"/><file name="gmx_net.plg.php" hash="218b73370a1367455aeee09695bc4e2a"/><file name="graffiti.plg.php" hash="36f6a6f03fceb9b0e008c1a281a17eb2"/><file name="hi5.plg.php" hash="ba133ae4e865c10f6ce3ddc738751374"/><file name="hotmail.plg.php" hash="ef3241a0a43020412162d8f6dd9dd206"/><file name="hushmail.plg.php" hash="d3f9f339ac03c8aa2426f7a2fe4f2606"/><file name="hyves.plg.php" hash="4dca8f35b17070c42bd16fd86352baf3"/><file name="inbox.plg.php" hash="34066ac6458b6506921e11dde302e3c2"/><file name="india.plg.php" hash="cdd4e86f5b21122b2ebf898eb78b0311"/><file name="indiatimes.plg.php" hash="bbbda190c92579f469f0b4712ba9806f"/><file name="inet.plg.php" hash="6bc3da45b492ba41012b25e501c05273"/><file name="interia.plg.php" hash="3fb3cb41913d12228f162ac32539a848"/><file name="katamail.plg.php" hash="2c2c85f1cab23f236295e5340da10511"/><file name="kids.plg.php" hash="5fae2d825799b0793e2b131162ec8e07"/><file name="kincafe.plg.php" hash="39f0d662293f3db3bd9b0bb9e57b8e27"/><file name="konnects.plg.php" hash="0fd4bc3f8361fb7e5f04d277b4f7f121"/><file name="koolro.plg.php" hash="ebc1936657a99eb8b96ee178d9b7e15c"/><file name="lastfm.plg.php" hash="a293d4bde8a36b1868ddc432e1f201e6"/><file name="libero.plg.php" hash="29cbf372f39d77fd0b62d0777ded4317"/><file name="linkedin.plg.php" hash="a705475d12bb2458d9bad14497211a14"/><file name="livejournal.plg.php" hash="c9c4bd30963d28eee5038841a7d7c788"/><file name="lovento.plg.php" hash="e26c7fe712efdd69fe3788b02ebf514b"/><file name="lycos.plg.php" hash="41a133d41ef4627b353b0f33149629c0"/><file name="mail2world.plg.php" hash="5737b208425e9d03988303d1c20baac6"/><file name="mail_com.plg.php" hash="5d2c20c61d5ba58c4e4c4fc6e162cb20"/><file name="mail_in.plg.php" hash="bf443e42022a368819bcbb788baaa095"/><file name="mail_ru.plg.php" hash="64b7d2daef963b4fd7e72dd969a04cd2"/><file name="meinvz.plg.php" hash="409380a6ca5c70f8f7ae998d37195115"/><file name="meta.plg.php" hash="17bd2e282a8509a14c2d440ea02d8961"/><file name="mevio.plg.php" hash="d175cd50dc07d749e7118a3a3b836800"/><file name="motortopia.plg.php" hash="507c050bb6e0cc73884c427d4745c7a0"/><file name="msn.plg.php" hash="2a205b0556aa7b8908dca3b15017db4f"/><file name="multiply.plg.php" hash="22e5d241084c259a79330eebff508d95"/><file name="mycatspace.plg.php" hash="1282b9619ddfcba5d924c0e31ea74cc7"/><file name="mydogspace.plg.php" hash="be44672096adbe4e2532d0a9df027b5f"/><file name="mynet.plg.php" hash="a2a38a688707957e216d3868c8b1741e"/><file name="myspace.plg.php" hash="bfcabb115825937a9ed4f9745f52ca7e"/><file name="netaddress.plg.php" hash="8e2ccf82123f831b2616c8d3a80f579f"/><file name="netlog.plg.php" hash="246411cc237ef587d31003c03c61b05b"/><file name="ning.plg.php" hash="e59cb73b203a22978ead363c49e48d3d"/><file name="nz11.plg.php" hash="b94995c177198c061b628ddc82d4c7fc"/><file name="o2.plg.php" hash="8e44c5027c493fff7be428ff034f0466"/><file name="operamail.plg.php" hash="5e3a90f0be46b03bcde54eebd76371c9"/><file name="orkut.plg.php" hash="1a291548a82889b36f976bd091260aa5"/><file name="perfspot.plg.php" hash="9d4a9b33f8cf809e5c73bfc517af53db"/><file name="plaxo.plg.php" hash="d640845713388d7c87a206b3f51060f2"/><file name="plazes.plg.php" hash="f6d71432926c126d7f165e6c83a16854"/><file name="plurk.plg.php" hash="e780f5cdd31029cc1b153a1c5b14a965"/><file name="pochta.plg.php" hash="b5732832c05bf982a5950fa32ee4d62a"/><file name="popstarmail.plg.php" hash="a36517a17fa2a461ab890861a4c452fd"/><file name="rambler.plg.php" hash="148cfdfa5b4e5eb2479692dd9f1533a7"/><file name="rediff.plg.php" hash="5679b17973310ecf1ba8b097d3acffaa"/><file name="sapo.plg.php" hash="2bd76d540c454da5f014eba59074e835"/><file name="skyrock.plg.php" hash="1d6113c0c726f48c250160bcc7826aa2"/><file name="tagged.plg.php" hash="1a88811dfd57937db6aece3026f7f99a"/><file name="techemail.plg.php" hash="9894baf3c22e835dbcf62796327d9f99"/><file name="terra.plg.php" hash="094ae4ab8e63dd0f075a860c9aba2094"/><file name="twitter.plg.php" hash="a385725eb41c3cc003c52429295d1355"/><file name="uk2.plg.php" hash="ca5238d090e6a65709302a149caf5ffb"/><file name="vimeo.plg.php" hash="de5ab46f0cc5919b242c5b200f0ef724"/><file name="virgilio.plg.php" hash="38df3729142bd2b40792b7a1793446b7"/><file name="vkontakte.plg.php" hash="7db9b7a03e8f4ee2d2d7f5192ec18912"/><file name="walla.plg.php" hash="5340dda0d54849d2e313ab97015db215"/><file name="web_de.plg.php" hash="d3ed9a0c556f08bc5c67f978c7be4727"/><file name="wpl.plg.php" hash="b151407c39c360f49ffb9ca9fd73b32b"/><file name="xanga.plg.php" hash="89b5c2c3db98e735e4d1f19fb1c81786"/><file name="xing.plg.php" hash="4f89f01bb8bcbc856441cb6ecb2fbe60"/><file name="xuqa.plg.php" hash="1219e94f6ef0919025b2c93741e55fbd"/><file name="yahoo.plg.php" hash="f2953a803d0d61ffce2c9136d1706758"/><file name="yandex.plg.php" hash="2c211df8b0511fb8c832a00976f2cee1"/><file name="youtube.plg.php" hash="fc05c436e6c2dd1c6c8fa336e7e893c5"/><file name="zapak.plg.php" hash="2274bd725d3bda8df0ae9d45d3ce1470"/></dir><file name="stats.php" hash="5af8362ab3e9f89f5e8560b2623f767a"/></dir></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Sponsorship"><file name="Entier.php" hash="cf171a4ec5debf707f182bd0ec09e3a2"/><file name="Float.php" hash="ff5bc3a5019785a1d87bfe9e9e85eeec"/><file name="Mode.php" hash="6fbdbd370813976837cb77369cc36f60"/><file name="NaturalNumber.php" hash="383c3f35a56c6d00d7a23c2c0080481e"/><file name="Openinviter.php" hash="b4ac237d528a505bb389f9b29d2ec486"/></dir></dir><dir name="Source"><file name="Mode.php" hash="79b02420ae291a2a0bfbd3b7b4dbe4c6"/></dir></dir></dir></dir><file name="ApplyValidity.php" hash="79ffbe31be02b062e2649a33e61d68be"/><file name="AutoBoost.php" hash="a8f27a827bc1eaeadb80e78d77df5c6b"/><file name="Change.php" hash="b2c4962c0eba8a8e661fe7231bdea130"/><file name="Changestatut.php" hash="11e5d285ee8ab8d6dce81fd47df89947"/><dir name="Core"><dir name="Email"><file name="Template.php" hash="9394636054f6709f0a41bec9f471b577"/></dir></dir><dir name="Eav"><dir name="Entity"><file name="Setup.php" hash="94056f3946824a5f37fa32efc97a8836"/></dir></dir><file name="Log.php" hash="0fb2fa51dd96857c1b75aa88ffd51d84"/><dir name="Mysql4"><dir name="CatalogFidelityPoint"><file name="Collection.php" hash="c868af7749d3f4bb3613c24b910a0a01"/></dir><file name="CatalogFidelityPoint.php" hash="972dc679be4e776e655ee91da788bfa9"/><dir name="CatalogSponsorPoint"><file name="Collection.php" hash="a7641c2909bc1bb6709e1fdde41bf3a3"/></dir><file name="CatalogSponsorPoint.php" hash="600b57d8ca471c97338961937aa6d551"/><dir name="Change"><file name="Collection.php" hash="bdc69d01c3e5d5ef56aa2b4fb895473b"/></dir><file name="Change.php" hash="756d869c8993f7bf582964876cdf0bab"/><dir name="Log"><file name="Collection.php" hash="bdaf560e27eae80a47e17b86b69cc5be"/></dir><file name="Log.php" hash="39c4dfcddd04caa6b1d7665eaa8a0ec3"/><file name="Rule.php" hash="afb4dce6ff602c44d69f506ec76c0383"/><dir name="Sponsorship"><file name="Collection.php" hash="4308184c9423622b51ea3cb6ce901eb7"/></dir><file name="Sponsorship.php" hash="23332641f0e4330e44a3f103d8903490"/><dir name="Sponsorshipopeninviter"><file name="Collection.php" hash="92e554ef5e4e989607dc2ce398271aa2"/></dir><file name="Sponsorshipopeninviter.php" hash="151e51e1ac5091f33df564408d3920a8"/></dir><file name="Observer.php" hash="ccabf055e2b30735252cf3d3537f0a2a"/><file name="Openinviter.php" hash="51957bc2f051988ca17538aa0dae2fc8"/><dir name="SocialBookmarking"><file name="Urls.php" hash="8507b7302d5aa76c9b6bc8e1e92e0598"/></dir><file name="Sponsorship.php" hash="8d8097f19381b803b7e8c9f6a9a4bc4c"/><file name="Sponsorshipopeninviter.php" hash="9552a5df39edcd97f682bf0fb97c48c0"/><file name="Status.php" hash="ad7199148cba19358874c50216c4dfde"/><dir name="Total"><dir name="Creditmemo"><file name="Discount.php" hash="be82cd179cbda9a7121ec8bf8a5451aa"/></dir><dir name="Invoice"><file name="Discount.php" hash="b0b7dd8c49ce237e9d7eb384170dc118"/></dir><dir name="Quote"><file name="Discount.php" hash="0edf8b85e88860452648885d33d3065e"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChangeController.php" hash="6963b3313b4ac5ddb8600bcde4d465b2"/><file name="LinkController.php" hash="ab8ac9481d252a01768a7a6073ad056f"/><file name="OpeninviterController.php" hash="bbe5124ae5c6eb41f3694a54a52691f8"/><file name="SponsorshipController.php" hash="28c9468f489e1f9762ab7d2d5c15954a"/></dir><file name="BoostController.php" hash="d65930c627d96b7640bd1e218c59eafb"/><file name="IndexController.php" hash="cd0c664a1dbf9781affed72c7a3a892e"/><file name="OpeninviterController.php" hash="4fdf8ac078f8c996e129943aa43d35d8"/><file name="PointsController.php" hash="2e5de58a63703573c8a23703ab8c6de9"/><file name="SponsorController.php" hash="b81147d898f8903d5167ab0eed14a8ed"/></dir><dir name="etc"><file name="config.xml" hash="d9f2ae7d796b0438d9a18c626e25f0cb"/><file name="system.xml" hash="7ea9d901d496fd485c91d683f8eb9a71"/></dir><dir name="sql"><dir name="auguria_sponsorship_setup"><file name="mysql4-install-0.1.0.php" hash="097cbb4d980ca504738458bbc621205e"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="209b1d59555704d1d203d4f6f345d216"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="93b2f00355c4c524753d57b7d2942bc6"/><file name="mysql4-upgrade-0.1.10-0.1.11.php" hash="d783dd639aa5f388bfd2c30309fbd95d"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="2b031075865307fa65725d9960a7f9d0"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="1d3a1e2e4f4801ec8c1e89f85a308bc9"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="d6ed18d5dfd6e32d802b94907395ebab"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="548b1dcadfb413c949bb8aba2d4f94b7"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="84853debcd7a5334b862d520b1f55e47"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="5040300b9109aef301f080d1b41e4d80"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="d8dbde5d26e4c4ceccb6321dabc2b742"/><file name="mysql4-upgrade-1.0.10-1.1.0.php" hash="e580abc4c388017c77e469f18092da9c"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="47a47f9b34313bc487f49a8be35c1429"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="869fd3f0b144c67d81df7a79644a2885"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="40ce669e7abbeeda11754ad21b099d1c"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="05a79302810930b42b45707af6a2af03"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="fd17577efce7d682cc238d04c6b3db75"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="f63e39c3d9372830942cae2757b1944c"/><file name="mysql4-upgrade-1.1.3-1.1.4.php" hash="5b746c9b0b10c55896a920a82ca16f87"/><file name="mysql4-upgrade-1.1.4-1.1.5.php" hash="f0d2bc8f465e6d79555e4eedc1763b24"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="f95981f2ba8c69c1f5da030e22c4e334"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="8ae766daa9638512d717e312b6dca41c"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="8cd04c3921e305484edc60bd3a2087ac"/><file name="mysql4-upgrade-1.1.8-1.1.9.php" hash="7dfc00ec719161b356e7906c7472dd8b"/><file name="mysql4-upgrade-1.1.9-1.2.0.php" hash="447ca4ba43020737475ed29e354bd600"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="auguria"><file name="sponsorship.xml" hash="371c2611330cb1009d144f8982e1fc7d"/></dir></dir><dir name="template"><dir name="auguria"><dir name="sponsorship"><dir name="customer"><dir name="tabs"><file name="sponsorship.phtml" hash="aab9cbcfd31154d203782aabe46c6082"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="auguria"><file name="sponsorship.xml" hash="d8f8ebff559cb6082997bae6dcd63f5c"/></dir></dir><dir name="template"><dir name="auguria"><dir name="sponsorship"><dir name="customer"><dir name="account"><file name="accumulatedpointsdetail.phtml" hash="137fd22f7e3faba820d77a0d022d4be3"/><dir name="dashboard"><file name="accumulated_points.phtml" hash="4fa4eff30def3f87b229ce0b312268de"/><file name="fidelity_points.phtml" hash="91bd2ce632a8e17b76aaf67d4dce2fa8"/><file name="points.phtml" hash="c779f3966c372a40d77d433d78fcf4eb"/><file name="sponsor_points.phtml" hash="d87849c128855339c696589ecbb0e1d1"/></dir><file name="fidelitypointsdetail.phtml" hash="4f7a0a2261a3ecd482120fe509e67ed4"/><file name="sponsorpointsdetail.phtml" hash="525a267858d23e4843f341552c00b40e"/></dir><dir name="form"><file name="boost.phtml" hash="e5c4a698f08480c262279891cf3b1a65"/><file name="edit.phtml" hash="0cd4878bb98a0de294ebc72dc90e86a6"/><dir name="pointschange"><file name="pointschange_cash.phtml" hash="58adf546a6e8aa93b340a2d1aab50e73"/><file name="pointschange_coupon.phtml" hash="c9704825166c4766471a73e058509409"/><file name="pointschange_gift.phtml" hash="29a244c931252894b98e1a9bf1c40fc4"/></dir><file name="pointschange.phtml" hash="83ef04108e63b4bce003316b6b9cdb18"/><file name="register.phtml" hash="2a9577cee680a5ca8eebd3e2b35d73d5"/></dir><dir name="widget"><file name="name.phtml" hash="bfb8c2e90a4e5af55a6479cc122d67b1"/><file name="virement.phtml" hash="74b9c05d0242aa06b6cc35a9abc23751"/></dir></dir><file name="openinviter.phtml" hash="efec6be43ae79a1abb37b7cbd81be4aa"/><file name="openinviterimport.phtml" hash="8a81b13bf5aaa6b033926fa71736bed0"/><file name="sponsorship.phtml" hash="cc7737d96f469058472e80824cef0caa"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Auguria_Sponsorship.xml" hash="2ace21d88c17b2636514543e866169eb"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Auguria_Sponsorship.csv" hash="e21fae9f6b851432c39ee656e8a4f5c9"/><dir name="template"><dir name="email"><dir name="auguria"><dir name="sponsorship"><file name="sponsorship_coupon.html" hash="265d0d49f825eeb40b6c6c3d74ac4dab"/><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/><file name="sponsorship_notification.html" hash="fc9958622daabadb1edf728eac927097"/></dir></dir></dir></dir></dir><dir name="en_US"><file name="Auguria_Sponsorship.csv" hash="fbb67ec0b525bb2576544d82d4cee7f1"/></dir><dir name="de_DE"><file name="Auguria_Sponsorship.csv" hash="db9b02ed8a00479a96bb83a0a5b9f293"/></dir><dir name="es_ES"><file name="Auguria_Sponsorship.csv" hash="e060bf41dc40cafa679e324a530dfa0d"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="auguria"><dir name="sponsorship"><file name="sorter.css" hash="f46615a19ca05b5e9bbd84d479773de2"/></dir></dir></dir><dir name="images"><dir name="auguria"><dir name="sponsorship"><dir name="sorter"><file name="asc.gif" hash="58e5329314e6a12f494990ce04867020"/><file name="desc.gif" hash="7e396735fb1e84edcb688e7df472855b"/><file name="first.gif" hash="491e4cb4e5a66671d6a59abf7af1f597"/><file name="last.gif" hash="501077205048ae683c0ef6b4158e9320"/><file name="next.gif" hash="ed4d6640624c2b6edeab4c212314bd6d"/><file name="previous.gif" hash="75973b020105dccbaf34e49d7852552d"/><file name="sorter.gif" hash="e3153c533d1a71bcc71c641b64cdf676"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="auguria"><dir name="sponsorship"><file name="sorter.js" hash="aeedb979ceafb91f876525e5a392220d"/></dir></dir></dir></target><target name="magemedia"><dir name="sponsorship"><dir name="openinviter"><file name="logo_auguria.png" hash="cdbd00ab6efa0ff8e3ce6eaaa07c53ce"/></dir></dir></target></contents>
48
  <compatible/>
49
- <dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php><extension><name>PDO</name><min></min><max></max></extension></required></dependencies>
50
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Auguria_Sponsorship</name>
4
+ <version>1.3.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Add possibility to :&#xD;
10
+ - Add fidelity points to the customer if customer subscribe to the newletter on registration&#xD;
11
+ - Add fidelity points on first order payment&#xD;
12
+ -Add sponso points on first godson order payment</summary>
 
 
 
13
  <description>The module consists of :&#xD;
 
14
  - A form to send invitations: when an invitation is sent, the guest mail is registered , and the customer id too.&#xD;
 
15
  - A system of affiliation: The link sent through invitations refer to a controller that will create a cookie and a session to identify a person invited. We can equally put such links on third party sites.&#xD;
 
16
  - Account creation: When creating an account, it checks whether an invitation was sent to the email used for registration. If this is not the case, we check if a session cookie or affiliation exists. If there is a link, the user who registers become the godson of the customer who invits him.&#xD;
 
17
  - A monitoring points for the client: the client have an interface for monitoring points in his account. He can see his godson. He can ask for trade his points.&#xD;
 
18
  - Increment of points: Fidelity points and sponsorship points are inserted in the command, at the checkout cart. Upon payment of the command, points are awarded to customers.&#xD;
 
19
  - Definition of rules: the management of points can be made through the catalog rules prices or cart rules prices.&#xD;
 
20
  - Module configuration: The administration interface allows you to enable or disable fidelity points or sponsorship points. Enabling or no exchange of cash, gift or coupon. You can also define the max cash without siret number, the period of calcul of the max cash, if an order is required to sponsor, the period of validity for an invitation, the period of validity of a sponsorship whithout an order, number of levels for sponsorship calculation points, the percentage on indirect sponsorship sales, the maximum number of invitations that you can send per hour, the header message, the body message and the footer message.&#xD;
 
21
  - An administration interface: allows to see the list of invitations sent, monitor requests for trade of points.&#xD;
22
  &#xD;
 
 
23
  Once installed, you must:&#xD;
 
24
  - Create one or several catalog or cart rules for increment fidelity and sponsorship points&#xD;
 
25
  - Edit CMS Page on sponsorship information&#xD;
 
26
  - If you enable automatic sponsorship recall, activate magento cron</description>
27
+ <notes>- Fixed adding point when purchasing a dynamic product bundle&#xD;
28
+ - Change the automatic status of coupon module when used&#xD;
29
+ - Improved display configuration&#xD;
30
+ - Improved auto-fill data (surname, name, email) when godson incrit for the first time on the site&#xD;
31
+ - Sending an email when requesting exchange cash (also sending an email to the manager)&#xD;
32
+ - Remove the overhead of sending emails&#xD;
33
+ - Display / camouflage configuration options depending on the mode of the module&#xD;
34
+ - Ability to disable checking Company number&#xD;
35
+ - Added english templates for sending email&#xD;
36
+ - User Manual in French</notes>
37
  <authors><author><name>Auguria</name><user>Auguria</user><email>magento@auguria.net</email></author></authors>
38
+ <date>2013-10-02</date>
39
+ <time>15:21:24</time>
40
+ <contents><target name="magecommunity"><dir name="Auguria"><dir name="Sponsorship"><dir name="Block"><dir name="Adminhtml"><dir name="Change"><dir name="Edit"><file name="Form.php" hash="ae7412b583874b8fffc05cc3897f1a2b"/><dir name="Tab"><file name="Form.php" hash="7271b9c47190cdff0b2af24968c4e155"/></dir><file name="Tabs.php" hash="2c8257d215289d5ae86c985f42721650"/></dir><file name="Edit.php" hash="856fb2d016982d1c1f47c462195e7f39"/><file name="Grid.php" hash="39bae596eb7cd73879a5e769d82c00db"/></dir><file name="Change.php" hash="b9046a8e50dceaacc6d248471275a9ca"/><dir name="Customer"><dir name="Tabs"><file name="Sponsorship.php" hash="a32d0d1979be05d6a37bb928820b6e04"/></dir></dir><dir name="Link"><dir name="Edit"><file name="Form.php" hash="e6e087ae96b24d4edbe9e1f578e7a55a"/><dir name="Tab"><file name="Form.php" hash="89cf7a2479cd6b5606884a73d9122d4a"/></dir><file name="Tabs.php" hash="fd3d95a2cfe3e194d26ba94c45353bf1"/></dir><file name="Edit.php" hash="4ecef8c6e59c6642a6b3348ae24d5ab8"/><file name="Grid.php" hash="17bb23c2a473542e44d3e2878c61af58"/></dir><file name="Link.php" hash="4c9673d016652b74338b8e5ed49b5240"/><dir name="Openinviter"><dir name="Edit"><file name="Form.php" hash="b4bdc64549563f0117f65c66f97d0fb8"/><dir name="Tab"><file name="Form.php" hash="a0f4530da07ba12f9d4aa53c612cca09"/></dir><file name="Tabs.php" hash="a7595c7aab4bb62da7a55674bac936e8"/></dir><file name="Edit.php" hash="79c8c3b6ca7d0e07e9a9cb8ddc18a9c5"/><file name="Grid.php" hash="7c323452ac344c6bb446d90f7c42e11c"/></dir><file name="Openinviter.php" hash="2fbf061ee8aaff7ee34a9f5b723d84c0"/><dir name="Sales"><dir name="Order"><dir name="Invoice"><file name="Totals.php" hash="292697b2443939616b7db683ecfe64d0"/></dir><file name="Totals.php" hash="e174624626a3d4952b257f4a9481f471"/></dir></dir><dir name="Sponsorship"><dir name="Edit"><file name="Form.php" hash="a3a2352db1c72663af0caa289287a9d2"/><dir name="Tab"><file name="Form.php" hash="ac62217927d4092f047b8fb8b849668f"/></dir><file name="Tabs.php" hash="88eb68796c7de324dc1cdea77deaa4ae"/></dir><file name="Edit.php" hash="7ae0b40486d27042caa70bf42c747383"/><file name="Grid.php" hash="a10dd155e32fea5c218880211573832d"/></dir><file name="Sponsorship.php" hash="6d133ec629d775d5e23b7967bb7bcc78"/><dir name="Widget"><dir name="Grid"><file name="Renderer.php" hash="35c8a336e1a0e2dcc8d48b558cee9253"/></dir></dir></dir><dir name="Customer"><dir name="Account"><file name="PointsDetail.php" hash="21feb78a8244d90a0acfe920f89eab3c"/></dir><dir name="Form"><file name="Boost.php" hash="18c1f531695bc529103af1bc4c3394d6"/><file name="PointsChange.php" hash="db26c8991b5ba182662424f94f020cd2"/></dir><dir name="Widget"><file name="Name.php" hash="3c3bef20f3c1875748efbe0a932a0800"/><file name="Virement.php" hash="cafde77d6d5504ae64c63fc9732a3461"/></dir></dir><file name="Openinviter.php" hash="21ef404cb6b1d609cfd75d67274efc1c"/><dir name="Promo"><dir name="Catalog"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="f5926196fd291cb45c13b5a8e1c018b6"/></dir></dir></dir><dir name="Quote"><dir name="Edit"><dir name="Tab"><file name="Actions.php" hash="4ff4de9b5e4d5200111d602625f91362"/></dir></dir></dir></dir><dir name="Sales"><dir name="Order"><file name="Totals.php" hash="da373c7bfc6dadefa78f38ac96a0e7c4"/></dir></dir><file name="Sponsorship.php" hash="b38d23fea90cf387b00508c264da736c"/></dir><dir name="Helper"><file name="Config.php" hash="c8b156ac74a6117bc99a0cef16d675da"/><file name="Data.php" hash="ab6aad8d2d024aceb0530f2a3f2dd42f"/><file name="Mail.php" hash="cf14e468758d6ce250ffc8b60533fed4"/></dir><dir name="Lib"><dir name="OpenInviter"><file name="LICENSE.txt" hash="277c3d400c7488e54746141297a952cb"/><file name="POLICY.txt" hash="6262372bc84e172c7fd89d9ac61f9794"/><file name="autoupdate.php" hash="df781d645e37271f23432bb82b3360a2"/><dir name="conf"><file name="_hosted.conf" hash="1d09309103e660729b492433acda9822"/><file name="abv.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="aol.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="apropo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="atlas.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="aussiemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="azet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="badoo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bebo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bigstring.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="bookcrossing.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="bordermail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="brazencareerist.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="canoe.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="care2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="clevergo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="cyworld.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="doramail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="eons.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="evite.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="facebook.conf" hash="12cfb187449596c39774c4ac193295cc"/><file name="faces.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="famiva.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="fastmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="fdcareer.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flickr.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flingr.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="flixster.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="fm5.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="freemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="friendfeed.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="friendster.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="gawab.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="gmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="gmx_net.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="graffiti.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hi5.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="hotmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hushmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="hyves.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="inbox.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="india.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="indiatimes.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="inet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="interia.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="katamail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="kids.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="kincafe.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="konnects.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="koolro.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lastfm.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="libero.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="linkedin.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="livejournal.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lovento.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="lycos.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail2world.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_com.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_in.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mail_ru.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="meinvz.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="meta.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="mevio.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="motortopia.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="msn.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="multiply.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mycatspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mydogspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="mynet.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="myspace.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="netaddress.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="netlog.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="ning.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="nz11.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="o2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="operamail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="orkut.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="perfspot.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plaxo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plazes.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="plurk.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="pochta.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="popstarmail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="rambler.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="rediff.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="sapo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="skyrock.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="tagged.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="techemail.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="terra.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="twitter.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="uk2.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="vimeo.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="virgilio.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="vkontakte.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="walla.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="web_de.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="wpl.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="xanga.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="xing.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="xuqa.conf" hash="6e2fad3c6d126d7da250cb8976a9ad4f"/><file name="yahoo.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="yandex.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="youtube.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/><file name="zapak.conf" hash="42ed0b97cb6919d0cd402831bccc1ea3"/></dir><file name="config.php" hash="5d26c1c274de93252c6d076c11fd5a4f"/><dir name="images"><file name="ers.gif" hash="cccdfd4ed0795b767d2a01f531781c10"/><file name="oks.gif" hash="6b4b170c9f10a0fa4b25307dd8f47e5b"/></dir><file name="notifier.php" hash="88e3be687de995aae52a8ce248c49bce"/><file name="openinviter.php" hash="d2c0237f86cd7c21dadc2c441e73abb1"/><dir name="plugins"><file name="_base.php" hash="79459bef6fcea96f6a7d4a584add9052"/><file name="_hosted.plg.php" hash="69514e56e1833df16884b6762bc620ce"/><file name="abv.plg.php" hash="1685755eae909c468055b9b36c915822"/><file name="aol.plg.php" hash="dd3522033c2cafeb62fd0beed5949bcf"/><file name="apropo.plg.php" hash="4426f976c1953383cf9d1f892aa9576e"/><file name="atlas.plg.php" hash="0b8e4237970ae54ff20187f5e861f972"/><file name="aussiemail.plg.php" hash="d40188b33455b3fd2e88cbde25f61709"/><file name="azet.plg.php" hash="e4a7c19450ca1ad84783a06ae3b1d61f"/><file name="badoo.plg.php" hash="b1d4863a173a80fc9d77331f1e60f2df"/><file name="bebo.plg.php" hash="2d7db898c660380ee74963667bec6bae"/><file name="bigstring.plg.php" hash="7de7a5516a8f0c71580970d8da4121eb"/><file name="bookcrossing.plg.php" hash="212a53a3a95659c56e15d6848549e25e"/><file name="bordermail.plg.php" hash="30190fa3da58d63ddd7e30e6ab0190dc"/><file name="brazencareerist.plg.php" hash="c68f39b6d7a07550abd63ed044ad85c2"/><file name="canoe.plg.php" hash="7737d89b163689cb793f0f37f6028efb"/><file name="care2.plg.php" hash="c066e81973194cca90036c37c7740937"/><file name="clevergo.plg.php" hash="9bd12fea0eb7f60043bcdca9116cb1bc"/><file name="cyworld.plg.php" hash="588dfdddcc2bc9ab2ff26c4616e0a42c"/><file name="doramail.plg.php" hash="81037085958f90a05111ad030c5a72f8"/><file name="eons.plg.php" hash="35009d6e25ae5584c554808b50145a19"/><file name="evite.plg.php" hash="d6c8acf7c24c2848eccedb269928d6eb"/><file name="facebook.plg.php" hash="6a1cfdc0dfc76b3dc3781aa2327ee833"/><file name="faces.plg.php" hash="d0affdf4e73ff6134acfaae5fda29323"/><file name="famiva.plg.php" hash="eee1c0a9a6d645baf014245ca2e9c3e9"/><file name="fastmail.plg.php" hash="da86fea25210ed40258ae2a107dcfe8f"/><file name="fdcareer.plg.php" hash="aad3d525fe09269de056f8ec03e43104"/><file name="flickr.plg.php" hash="055d1e64f116113379e3192b23dc84fc"/><file name="flingr.plg.php" hash="c2b415851babadb8048609874b411979"/><file name="flixster.plg.php" hash="773fad1c2c1775fcb74fb33f51d1fa24"/><file name="fm5.plg.php" hash="0576df91534edaab3d6b333d1968781a"/><file name="freemail.plg.php" hash="142951e9c20ce4447f44c6db7e5cc2e8"/><file name="friendfeed.plg.php" hash="399c987766110735fdd301979997fe48"/><file name="friendster.plg.php" hash="8b3402876a73bf91a84d3a6d8dbb1951"/><file name="gawab.plg.php" hash="c4cb42d893a99b370d9597f20da5c01e"/><file name="gmail.plg.php" hash="83d92f7f75e048210aec2fdecdbd67e0"/><file name="gmx_net.plg.php" hash="218b73370a1367455aeee09695bc4e2a"/><file name="graffiti.plg.php" hash="36f6a6f03fceb9b0e008c1a281a17eb2"/><file name="hi5.plg.php" hash="ba133ae4e865c10f6ce3ddc738751374"/><file name="hotmail.plg.php" hash="ef3241a0a43020412162d8f6dd9dd206"/><file name="hushmail.plg.php" hash="d3f9f339ac03c8aa2426f7a2fe4f2606"/><file name="hyves.plg.php" hash="4dca8f35b17070c42bd16fd86352baf3"/><file name="inbox.plg.php" hash="34066ac6458b6506921e11dde302e3c2"/><file name="india.plg.php" hash="cdd4e86f5b21122b2ebf898eb78b0311"/><file name="indiatimes.plg.php" hash="bbbda190c92579f469f0b4712ba9806f"/><file name="inet.plg.php" hash="6bc3da45b492ba41012b25e501c05273"/><file name="interia.plg.php" hash="3fb3cb41913d12228f162ac32539a848"/><file name="katamail.plg.php" hash="2c2c85f1cab23f236295e5340da10511"/><file name="kids.plg.php" hash="5fae2d825799b0793e2b131162ec8e07"/><file name="kincafe.plg.php" hash="39f0d662293f3db3bd9b0bb9e57b8e27"/><file name="konnects.plg.php" hash="0fd4bc3f8361fb7e5f04d277b4f7f121"/><file name="koolro.plg.php" hash="ebc1936657a99eb8b96ee178d9b7e15c"/><file name="lastfm.plg.php" hash="a293d4bde8a36b1868ddc432e1f201e6"/><file name="libero.plg.php" hash="29cbf372f39d77fd0b62d0777ded4317"/><file name="linkedin.plg.php" hash="a705475d12bb2458d9bad14497211a14"/><file name="livejournal.plg.php" hash="c9c4bd30963d28eee5038841a7d7c788"/><file name="lovento.plg.php" hash="e26c7fe712efdd69fe3788b02ebf514b"/><file name="lycos.plg.php" hash="41a133d41ef4627b353b0f33149629c0"/><file name="mail2world.plg.php" hash="5737b208425e9d03988303d1c20baac6"/><file name="mail_com.plg.php" hash="5d2c20c61d5ba58c4e4c4fc6e162cb20"/><file name="mail_in.plg.php" hash="bf443e42022a368819bcbb788baaa095"/><file name="mail_ru.plg.php" hash="64b7d2daef963b4fd7e72dd969a04cd2"/><file name="meinvz.plg.php" hash="409380a6ca5c70f8f7ae998d37195115"/><file name="meta.plg.php" hash="17bd2e282a8509a14c2d440ea02d8961"/><file name="mevio.plg.php" hash="d175cd50dc07d749e7118a3a3b836800"/><file name="motortopia.plg.php" hash="507c050bb6e0cc73884c427d4745c7a0"/><file name="msn.plg.php" hash="2a205b0556aa7b8908dca3b15017db4f"/><file name="multiply.plg.php" hash="22e5d241084c259a79330eebff508d95"/><file name="mycatspace.plg.php" hash="1282b9619ddfcba5d924c0e31ea74cc7"/><file name="mydogspace.plg.php" hash="be44672096adbe4e2532d0a9df027b5f"/><file name="mynet.plg.php" hash="a2a38a688707957e216d3868c8b1741e"/><file name="myspace.plg.php" hash="bfcabb115825937a9ed4f9745f52ca7e"/><file name="netaddress.plg.php" hash="8e2ccf82123f831b2616c8d3a80f579f"/><file name="netlog.plg.php" hash="246411cc237ef587d31003c03c61b05b"/><file name="ning.plg.php" hash="e59cb73b203a22978ead363c49e48d3d"/><file name="nz11.plg.php" hash="b94995c177198c061b628ddc82d4c7fc"/><file name="o2.plg.php" hash="8e44c5027c493fff7be428ff034f0466"/><file name="operamail.plg.php" hash="5e3a90f0be46b03bcde54eebd76371c9"/><file name="orkut.plg.php" hash="1a291548a82889b36f976bd091260aa5"/><file name="perfspot.plg.php" hash="9d4a9b33f8cf809e5c73bfc517af53db"/><file name="plaxo.plg.php" hash="d640845713388d7c87a206b3f51060f2"/><file name="plazes.plg.php" hash="f6d71432926c126d7f165e6c83a16854"/><file name="plurk.plg.php" hash="e780f5cdd31029cc1b153a1c5b14a965"/><file name="pochta.plg.php" hash="b5732832c05bf982a5950fa32ee4d62a"/><file name="popstarmail.plg.php" hash="a36517a17fa2a461ab890861a4c452fd"/><file name="rambler.plg.php" hash="148cfdfa5b4e5eb2479692dd9f1533a7"/><file name="rediff.plg.php" hash="5679b17973310ecf1ba8b097d3acffaa"/><file name="sapo.plg.php" hash="2bd76d540c454da5f014eba59074e835"/><file name="skyrock.plg.php" hash="1d6113c0c726f48c250160bcc7826aa2"/><file name="tagged.plg.php" hash="1a88811dfd57937db6aece3026f7f99a"/><file name="techemail.plg.php" hash="9894baf3c22e835dbcf62796327d9f99"/><file name="terra.plg.php" hash="094ae4ab8e63dd0f075a860c9aba2094"/><file name="twitter.plg.php" hash="a385725eb41c3cc003c52429295d1355"/><file name="uk2.plg.php" hash="ca5238d090e6a65709302a149caf5ffb"/><file name="vimeo.plg.php" hash="de5ab46f0cc5919b242c5b200f0ef724"/><file name="virgilio.plg.php" hash="38df3729142bd2b40792b7a1793446b7"/><file name="vkontakte.plg.php" hash="7db9b7a03e8f4ee2d2d7f5192ec18912"/><file name="walla.plg.php" hash="5340dda0d54849d2e313ab97015db215"/><file name="web_de.plg.php" hash="d3ed9a0c556f08bc5c67f978c7be4727"/><file name="wpl.plg.php" hash="b151407c39c360f49ffb9ca9fd73b32b"/><file name="xanga.plg.php" hash="89b5c2c3db98e735e4d1f19fb1c81786"/><file name="xing.plg.php" hash="4f89f01bb8bcbc856441cb6ecb2fbe60"/><file name="xuqa.plg.php" hash="1219e94f6ef0919025b2c93741e55fbd"/><file name="yahoo.plg.php" hash="f2953a803d0d61ffce2c9136d1706758"/><file name="yandex.plg.php" hash="2c211df8b0511fb8c832a00976f2cee1"/><file name="youtube.plg.php" hash="fc05c436e6c2dd1c6c8fa336e7e893c5"/><file name="zapak.plg.php" hash="2274bd725d3bda8df0ae9d45d3ce1470"/></dir><file name="stats.php" hash="5af8362ab3e9f89f5e8560b2623f767a"/></dir></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Sponsorship"><file name="Entier.php" hash="cf171a4ec5debf707f182bd0ec09e3a2"/><file name="Float.php" hash="ff5bc3a5019785a1d87bfe9e9e85eeec"/><file name="Mode.php" hash="6fbdbd370813976837cb77369cc36f60"/><file name="NaturalNumber.php" hash="383c3f35a56c6d00d7a23c2c0080481e"/><file name="Openinviter.php" hash="b4ac237d528a505bb389f9b29d2ec486"/></dir></dir><dir name="Source"><file name="Mode.php" hash="79b02420ae291a2a0bfbd3b7b4dbe4c6"/></dir></dir></dir></dir><file name="ApplyValidity.php" hash="79ffbe31be02b062e2649a33e61d68be"/><file name="AutoBoost.php" hash="a8f27a827bc1eaeadb80e78d77df5c6b"/><file name="Change.php" hash="b2c4962c0eba8a8e661fe7231bdea130"/><file name="Changestatut.php" hash="11e5d285ee8ab8d6dce81fd47df89947"/><dir name="Core"><dir name="Email"><file name="Template.php" hash="f0cee8df7fae1cbd7d00cfa1a99baa1e"/></dir></dir><dir name="Eav"><dir name="Entity"><file name="Setup.php" hash="94056f3946824a5f37fa32efc97a8836"/></dir></dir><file name="Log.php" hash="0fb2fa51dd96857c1b75aa88ffd51d84"/><dir name="Mysql4"><dir name="CatalogFidelityPoint"><file name="Collection.php" hash="c868af7749d3f4bb3613c24b910a0a01"/></dir><file name="CatalogFidelityPoint.php" hash="972dc679be4e776e655ee91da788bfa9"/><dir name="CatalogSponsorPoint"><file name="Collection.php" hash="a7641c2909bc1bb6709e1fdde41bf3a3"/></dir><file name="CatalogSponsorPoint.php" hash="600b57d8ca471c97338961937aa6d551"/><dir name="Change"><file name="Collection.php" hash="bdc69d01c3e5d5ef56aa2b4fb895473b"/></dir><file name="Change.php" hash="756d869c8993f7bf582964876cdf0bab"/><dir name="Log"><file name="Collection.php" hash="bdaf560e27eae80a47e17b86b69cc5be"/></dir><file name="Log.php" hash="39c4dfcddd04caa6b1d7665eaa8a0ec3"/><file name="Rule.php" hash="afb4dce6ff602c44d69f506ec76c0383"/><dir name="Sponsorship"><file name="Collection.php" hash="4308184c9423622b51ea3cb6ce901eb7"/></dir><file name="Sponsorship.php" hash="23332641f0e4330e44a3f103d8903490"/><dir name="Sponsorshipopeninviter"><file name="Collection.php" hash="92e554ef5e4e989607dc2ce398271aa2"/></dir><file name="Sponsorshipopeninviter.php" hash="151e51e1ac5091f33df564408d3920a8"/></dir><file name="Observer.php" hash="0090c67ab3b076fa71df9724286031e3"/><file name="Openinviter.php" hash="fefd02e022771fc0738c89cb188456c2"/><dir name="SocialBookmarking"><file name="Urls.php" hash="8507b7302d5aa76c9b6bc8e1e92e0598"/></dir><file name="Sponsorship.php" hash="8d8097f19381b803b7e8c9f6a9a4bc4c"/><file name="Sponsorshipopeninviter.php" hash="9552a5df39edcd97f682bf0fb97c48c0"/><file name="Status.php" hash="ad7199148cba19358874c50216c4dfde"/><dir name="Total"><dir name="Creditmemo"><file name="Discount.php" hash="be82cd179cbda9a7121ec8bf8a5451aa"/></dir><dir name="Invoice"><file name="Discount.php" hash="b0b7dd8c49ce237e9d7eb384170dc118"/></dir><dir name="Quote"><file name="Discount.php" hash="0edf8b85e88860452648885d33d3065e"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ChangeController.php" hash="6963b3313b4ac5ddb8600bcde4d465b2"/><file name="LinkController.php" hash="ab8ac9481d252a01768a7a6073ad056f"/><file name="OpeninviterController.php" hash="bbe5124ae5c6eb41f3694a54a52691f8"/><file name="SponsorshipController.php" hash="28c9468f489e1f9762ab7d2d5c15954a"/></dir><file name="BoostController.php" hash="d65930c627d96b7640bd1e218c59eafb"/><file name="IndexController.php" hash="cd0c664a1dbf9781affed72c7a3a892e"/><file name="OpeninviterController.php" hash="0484d949bd6f6725133d7cff812650dd"/><file name="PointsController.php" hash="11a0ad42b150c39c9f5a40b778ba93e7"/><file name="PointsController.php~" hash="b60689e1ee6047a38370c7dfc92d4dfb"/><file name="SponsorController.php" hash="b81147d898f8903d5167ab0eed14a8ed"/></dir><dir name="etc"><file name="config.xml" hash="60b7389d1e8a1bb6d159f188390c5a64"/><file name="system.xml" hash="78383561b59a43a8cac257574c4cae63"/></dir><dir name="sql"><dir name="auguria_sponsorship_setup"><file name="mysql4-install-0.1.0.php" hash="097cbb4d980ca504738458bbc621205e"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="209b1d59555704d1d203d4f6f345d216"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="93b2f00355c4c524753d57b7d2942bc6"/><file name="mysql4-upgrade-0.1.10-0.1.11.php" hash="d783dd639aa5f388bfd2c30309fbd95d"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="2b031075865307fa65725d9960a7f9d0"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="1d3a1e2e4f4801ec8c1e89f85a308bc9"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="d6ed18d5dfd6e32d802b94907395ebab"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="548b1dcadfb413c949bb8aba2d4f94b7"/><file name="mysql4-upgrade-0.1.6-0.1.7.php" hash="84853debcd7a5334b862d520b1f55e47"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="5040300b9109aef301f080d1b41e4d80"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="d8dbde5d26e4c4ceccb6321dabc2b742"/><file name="mysql4-upgrade-1.0.10-1.1.0.php" hash="e580abc4c388017c77e469f18092da9c"/><file name="mysql4-upgrade-1.0.3-1.0.4.php" hash="47a47f9b34313bc487f49a8be35c1429"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="869fd3f0b144c67d81df7a79644a2885"/><file name="mysql4-upgrade-1.0.8-1.0.9.php" hash="40ce669e7abbeeda11754ad21b099d1c"/><file name="mysql4-upgrade-1.1.0-1.1.1.php" hash="05a79302810930b42b45707af6a2af03"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="fd17577efce7d682cc238d04c6b3db75"/><file name="mysql4-upgrade-1.1.2-1.1.3.php" hash="f63e39c3d9372830942cae2757b1944c"/><file name="mysql4-upgrade-1.1.3-1.1.4.php" hash="5b746c9b0b10c55896a920a82ca16f87"/><file name="mysql4-upgrade-1.1.4-1.1.5.php" hash="f0d2bc8f465e6d79555e4eedc1763b24"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="f95981f2ba8c69c1f5da030e22c4e334"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="8ae766daa9638512d717e312b6dca41c"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="8cd04c3921e305484edc60bd3a2087ac"/><file name="mysql4-upgrade-1.1.8-1.1.9.php" hash="7dfc00ec719161b356e7906c7472dd8b"/><file name="mysql4-upgrade-1.1.9-1.2.0.php" hash="447ca4ba43020737475ed29e354bd600"/><file name="mysql4-upgrade-1.3.0-1.3.1.php" hash="1e1010fa12f4aff6c6c4bea8218c5e27"/><file name="mysql4-upgrade-1.3.1-1.3.2.php" hash="57839bcd4a36fc76611b7ad12d72e461"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="auguria"><file name="sponsorship.xml" hash="da2e6256da1bb58b56d92d67167caa80"/></dir></dir><dir name="template"><dir name="auguria"><dir name="sponsorship"><dir name="customer"><dir name="tabs"><file name="sponsorship.phtml" hash="8a50d044a4f529f1113925adeff7c673"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="auguria"><file name="sponsorship.xml" hash="9c46c3e6ce0e96d3dec64a459544f098"/></dir></dir><dir name="template"><dir name="auguria"><dir name="sponsorship"><dir name="customer"><dir name="account"><file name="accumulatedpointsdetail.phtml" hash="137fd22f7e3faba820d77a0d022d4be3"/><dir name="dashboard"><file name="accumulated_points.phtml" hash="4fa4eff30def3f87b229ce0b312268de"/><file name="fidelity_points.phtml" hash="91bd2ce632a8e17b76aaf67d4dce2fa8"/><file name="points.phtml" hash="c779f3966c372a40d77d433d78fcf4eb"/><file name="sponsor_points.phtml" hash="d87849c128855339c696589ecbb0e1d1"/></dir><file name="fidelitypointsdetail.phtml" hash="aa127f85191922581148bb64abd670a4"/><file name="sponsorpointsdetail.phtml" hash="525a267858d23e4843f341552c00b40e"/></dir><dir name="form"><file name="boost.phtml" hash="e5c4a698f08480c262279891cf3b1a65"/><file name="edit.phtml" hash="50a7d4826f68baf95754c7f1cae554a6"/><dir name="pointschange"><file name="pointschange_cash.phtml" hash="58adf546a6e8aa93b340a2d1aab50e73"/><file name="pointschange_coupon.phtml" hash="c9704825166c4766471a73e058509409"/><file name="pointschange_gift.phtml" hash="29a244c931252894b98e1a9bf1c40fc4"/></dir><file name="pointschange.phtml" hash="83ef04108e63b4bce003316b6b9cdb18"/></dir><dir name="widget"><file name="name.phtml" hash="989b5c16ae01673372bf596ee185dacf"/><file name="virement.phtml" hash="8b4692454e7c86ce949e70c7813886a5"/></dir></dir><file name="openinviter.phtml" hash="fe76f00f45dd2e26be07b9d52eec2971"/><file name="openinviterimport.phtml" hash="8a81b13bf5aaa6b033926fa71736bed0"/><file name="sponsorship.phtml" hash="cc7737d96f469058472e80824cef0caa"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Auguria_Sponsorship.xml" hash="2ace21d88c17b2636514543e866169eb"/></dir></dir></dir><dir name="js"><dir name="auguria"><dir name="sponsorship"><file name="admin.js" hash="8a55dbcd832c6fb18bff3c9f423ce7a8"/><file name="sorter.js" hash="aeedb979ceafb91f876525e5a392220d"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="auguria"><dir name="sponsorship"><file name="sorter.css" hash="f46615a19ca05b5e9bbd84d479773de2"/></dir></dir></dir><dir name="images"><dir name="auguria"><dir name="sponsorship"><dir name="sorter"><file name="asc.gif" hash="58e5329314e6a12f494990ce04867020"/><file name="desc.gif" hash="7e396735fb1e84edcb688e7df472855b"/><file name="first.gif" hash="491e4cb4e5a66671d6a59abf7af1f597"/><file name="last.gif" hash="501077205048ae683c0ef6b4158e9320"/><file name="next.gif" hash="ed4d6640624c2b6edeab4c212314bd6d"/><file name="previous.gif" hash="75973b020105dccbaf34e49d7852552d"/><file name="sorter.gif" hash="e3153c533d1a71bcc71c641b64cdf676"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Auguria_Sponsorship.csv" hash="53c358af2da3b98623a8562d4dc48bf6"/><dir name="template"><dir name="email"><dir name="auguria"><dir name="sponsorship"><file name="sponsorship_invitation.html" hash="9919cbb62cc7489a863883f06e45e974"/><file name="sponsorship_cash.html" hash="2482dc079cb57efb26fa97647f9a52c0"/><file name="sponsorship_notification.html" hash="159712c9ab2e26ca210a5d6eeb8217f8"/><file name="sponsorship_coupon.html" hash="f1642eb0cef04b1bdacaf2b8ed8e69ad"/></dir></dir></dir></dir></dir><dir name="en_US"><file name="Auguria_Sponsorship.csv" hash="fbb67ec0b525bb2576544d82d4cee7f1"/><dir name="template"><dir name="email"><dir name="auguria"><dir name="sponsorship"><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/><file name="sponsorship_cash.html" hash="3b7a0b9562401aa058b811ac45fdedec"/><file name="sponsorship_notification.html" hash="fc9958622daabadb1edf728eac927097"/><file name="sponsorship_coupon.html" hash="0ca5d0c23070e0a6a9f9822ad9612678"/></dir></dir></dir></dir></dir><dir name="es_ES"><file name="Auguria_Sponsorship.csv" hash="e060bf41dc40cafa679e324a530dfa0d"/><dir name="template"><dir name="email"><dir name="auguria"><dir name="sponsorship"><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/><file name="sponsorship_cash.html" hash="bb116860a8a840849049a1c5eb7deaeb"/><file name="sponsorship_coupon.html" hash="5918b7eba6d7cdeb8f410de14e7f2329"/><file name="sponsorship_notification.html" hash="fc9958622daabadb1edf728eac927097"/></dir></dir></dir></dir></dir><dir name="de_DE"><file name="Auguria_Sponsorship.csv" hash="db9b02ed8a00479a96bb83a0a5b9f293"/><dir name="template"><dir name="email"><dir name="auguria"><dir name="sponsorship"><file name="sponsorship_invitation.html" hash="30fe91c3b83ee223f6bffb3dd779dd26"/><file name="sponsorship_cash.html" hash="37e57b2cb046f4e2a9c03a237fb0dee2"/><file name="sponsorship_coupon.html" hash="087a9a72f7f7c63d4136ff498730382f"/><file name="sponsorship_notification.html" hash="fc9958622daabadb1edf728eac927097"/></dir></dir></dir></dir></dir></target></contents>
41
  <compatible/>
42
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
43
  </package>