TroopID_Connect - Version 1.2.0

Version Notes

Add a manual remove link for affiliation clearing.

Download this release

Release Info

Developer ID.me
Extension TroopID_Connect
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/community/TroopID/Connect/Block/Cart.php CHANGED
@@ -13,6 +13,10 @@ class TroopID_Connect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract {
13
  return Mage::getUrl("troopid/authorize/authorize");
14
  }
15
 
 
 
 
 
16
  public function hasAffiliation() {
17
  return $this->getQuote() && $this->getQuote()->getTroopidScope() !== null;
18
  }
13
  return Mage::getUrl("troopid/authorize/authorize");
14
  }
15
 
16
+ public function getRemoveUrl() {
17
+ return Mage::getUrl("troopid/authorize/remove");
18
+ }
19
+
20
  public function hasAffiliation() {
21
  return $this->getQuote() && $this->getQuote()->getTroopidScope() !== null;
22
  }
app/code/community/TroopID/Connect/Model/Cart/Observer.php CHANGED
@@ -15,6 +15,7 @@ class TroopID_Connect_Model_Cart_Observer {
15
  $cart->getQuote()->setTroopidAffiliation(NULL);
16
  $cart->getQuote()->save();
17
  }
 
18
  }
19
 
20
  }
15
  $cart->getQuote()->setTroopidAffiliation(NULL);
16
  $cart->getQuote()->save();
17
  }
18
+
19
  }
20
 
21
  }
app/code/community/TroopID/Connect/controllers/AuthorizeController.php CHANGED
@@ -17,6 +17,21 @@ class TroopID_Connect_AuthorizeController extends Mage_Core_Controller_Front_Act
17
  return Mage::getSingleton("checkout/cart");
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  public function authorizeAction() {
21
  $session = $this->getSession();
22
  $scope = $this->getRequest()->getParam("scope");
17
  return Mage::getSingleton("checkout/cart");
18
  }
19
 
20
+ public function removeAction() {
21
+ $cart = $this->getCart();
22
+ $quote = $cart->getQuote();
23
+
24
+ $quote->setTroopidUid(NULL);
25
+ $quote->setTroopidScope(NULL);
26
+ $quote->setTroopidAffiliation(NULL);
27
+ $quote->save();
28
+
29
+ $this->_redirectUrl($_SERVER['HTTP_REFERER']);
30
+ $this->setFlag("", self::FLAG_NO_DISPATCH, true);
31
+
32
+ return $this;
33
+ }
34
+
35
  public function authorizeAction() {
36
  $session = $this->getSession();
37
  $scope = $this->getRequest()->getParam("scope");
app/design/frontend/base/default/template/troopid/connect/cart.phtml CHANGED
@@ -41,6 +41,11 @@
41
  <?php endif ?>
42
  <div class="about">
43
  <a href="javascript:void(0);" id="troopid-modal-trigger"><?php echo $this->__("What is this?") ?></a>
 
 
 
 
 
44
  </div>
45
 
46
  <div id="troopid-modal" style="display: none;"></div>
41
  <?php endif ?>
42
  <div class="about">
43
  <a href="javascript:void(0);" id="troopid-modal-trigger"><?php echo $this->__("What is this?") ?></a>
44
+ <?php if ($this->hasAffiliation()): ?>
45
+ | <a href="<?php echo $this->getRemoveUrl() ?>" title="<?php echo $this->__("Remove your verified affiliation") ?>">
46
+ <?php echo $this->__("Remove") ?>
47
+ </a>
48
+ <?php endif ?>
49
  </div>
50
 
51
  <div id="troopid-modal" style="display: none;"></div>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TroopID_Connect</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>TroopID Connect integration.</summary>
10
  <description>N/A</description>
11
- <notes>Clear ID.me affiliation related info when cart i cleared.</notes>
12
  <authors><author><name>ID.me</name><user>idme</user><email>support@id.me</email></author></authors>
13
- <date>2013-10-16</date>
14
- <time>13:56:15</time>
15
- <contents><target name="magecommunity"><dir name="TroopID"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Affiliation.php" hash="d2f7b9f00585fc7d2b558096c31f5de1"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Custom.php" hash="0f7f75b4b55edb638d241852a0220b3f"/><file name="Instructions.php" hash="8672b12ef38027e844bcccf5835d6a30"/></dir></dir></dir><file name="Cart.php" hash="c521e18c2ffeaa45e8a90fe0de3875e5"/></dir><dir name="Helper"><file name="Data.php" hash="886ce8d80a634443a7935aac81e9dddb"/><file name="Oauth.php" hash="9089fd8f96397a3c0fa5231b5709b8dd"/></dir><dir name="Model"><dir name="Cart"><file name="Observer.php" hash="1c3243fb721e0e1a689686831011b5f3"/></dir><dir name="Rule"><file name="Condition.php" hash="345e7992da8bd7d543e9d25ed92e1d66"/><file name="Observer.php" hash="ff3a6cc43e4d46401a4bbb37262f4f56"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Enabled.php" hash="103e4776ee228d313fcb63c0eefcb0db"/></dir></dir></dir></dir><dir name="controllers"><file name="AuthorizeController.php" hash="bcd7c53ccd2637029d98c4e33ccf64f3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2bba51d29a0e9c444ff401a460a44142"/><file name="config.xml" hash="78c268c1d011e229e9e7fde686f584e7"/><file name="system.xml" hash="0699caf80b40f5f4d45f08c170582fa1"/></dir><dir name="sql"><dir name="troopid_connect_setup"><file name="mysql4-install-0.1.0.php" hash="2ed9e5f82407c756477d7fc2d3cd20ff"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="6160551e6951f91ab7ef18e887ea73a9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="b5c1ab02bb09e99d59465add1182e5e0"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="affiliation.phtml" hash="69c74c5b4d78f1f6822be88d1a3bd928"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="2252d9dd57d061eeaca3577190fb67c2"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="callback.phtml" hash="71b10af7408d6f50999529c08aa75dfb"/><file name="cart.phtml" hash="bed13a8be8e9dfa01cd3ae7db95537e0"/><file name="script.phtml" hash="09ce30b067bd81d04503a1b9a58e16e4"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TroopID_Connect.xml" hash="daae0990b13ba4071764efd4f9f674ec"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="troopid"><dir name="images"><file name="logo.png" hash="65421456771898d7cbced7b99d4b56ea"/></dir><file name="troopid.css" hash="57964a12675c76bca426475515160dcc"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="troopid"><file name="troopid.css" hash="05c691747e19934f56d4f9f9f777d440"/></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="troopid"><file name="troopid.css" hash="4bba21e6846610c2acc9f50207292a1c"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TroopID_Connect</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>TroopID Connect integration.</summary>
10
  <description>N/A</description>
11
+ <notes>Add a manual remove link for affiliation clearing.</notes>
12
  <authors><author><name>ID.me</name><user>idme</user><email>support@id.me</email></author></authors>
13
+ <date>2013-10-17</date>
14
+ <time>11:55:56</time>
15
+ <contents><target name="magecommunity"><dir name="TroopID"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Affiliation.php" hash="d2f7b9f00585fc7d2b558096c31f5de1"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Custom.php" hash="0f7f75b4b55edb638d241852a0220b3f"/><file name="Instructions.php" hash="8672b12ef38027e844bcccf5835d6a30"/></dir></dir></dir><file name="Cart.php" hash="749846d467e503c705818897f57ed7f9"/></dir><dir name="Helper"><file name="Data.php" hash="886ce8d80a634443a7935aac81e9dddb"/><file name="Oauth.php" hash="9089fd8f96397a3c0fa5231b5709b8dd"/></dir><dir name="Model"><dir name="Cart"><file name="Observer.php" hash="c837fb0c02ac02416200002d5e3b233c"/></dir><dir name="Rule"><file name="Condition.php" hash="345e7992da8bd7d543e9d25ed92e1d66"/><file name="Observer.php" hash="ff3a6cc43e4d46401a4bbb37262f4f56"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Enabled.php" hash="103e4776ee228d313fcb63c0eefcb0db"/></dir></dir></dir></dir><dir name="controllers"><file name="AuthorizeController.php" hash="1e27d7e0f7f6f10e0fc8ac69a5b35f3d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2bba51d29a0e9c444ff401a460a44142"/><file name="config.xml" hash="78c268c1d011e229e9e7fde686f584e7"/><file name="system.xml" hash="0699caf80b40f5f4d45f08c170582fa1"/></dir><dir name="sql"><dir name="troopid_connect_setup"><file name="mysql4-install-0.1.0.php" hash="2ed9e5f82407c756477d7fc2d3cd20ff"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="6160551e6951f91ab7ef18e887ea73a9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="b5c1ab02bb09e99d59465add1182e5e0"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="affiliation.phtml" hash="69c74c5b4d78f1f6822be88d1a3bd928"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="2252d9dd57d061eeaca3577190fb67c2"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="callback.phtml" hash="71b10af7408d6f50999529c08aa75dfb"/><file name="cart.phtml" hash="f40229b1de9e439af9dd79a38dd072f7"/><file name="script.phtml" hash="09ce30b067bd81d04503a1b9a58e16e4"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TroopID_Connect.xml" hash="daae0990b13ba4071764efd4f9f674ec"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="troopid"><dir name="images"><file name="logo.png" hash="65421456771898d7cbced7b99d4b56ea"/></dir><file name="troopid.css" hash="57964a12675c76bca426475515160dcc"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="troopid"><file name="troopid.css" hash="05c691747e19934f56d4f9f9f777d440"/></dir></dir></dir><dir name="enterprise"><dir name="default"><dir name="troopid"><file name="troopid.css" hash="4bba21e6846610c2acc9f50207292a1c"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>