TroopID_Connect - Version 1.4.4

Version Notes

Add ID.me affiliation filtering for orders
Update button assets

Download this release

Release Info

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


Code changes from version 1.4.3 to 1.4.4

app/code/community/TroopID/Connect/Block/Adminhtml/Sales/Order/View/Tab/Affiliation.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- class TroopID_Connect_Block_Adminhtml_Sales_Order_View_Tab_Affiliation extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface {
4
 
5
  protected function _construct()
6
  {
1
  <?php
2
 
3
+ class TroopID_Connect_Block_Adminhtml_Sales_Order_View_Tab_Affiliation extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface {
4
 
5
  protected function _construct()
6
  {
app/code/community/TroopID/Connect/Block/Widget/Grid/Column/Filter/Scope.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TroopID_Connect_Block_Widget_Grid_Column_Filter_Scope extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select {
4
+
5
+ protected $options = array();
6
+
7
+ protected function _getOptions() {
8
+ if (empty($this->options)) {
9
+
10
+ $scopes = array(
11
+ array(
12
+ "value" => "",
13
+ "label" => ""
14
+ )
15
+ );
16
+
17
+ $groups = Mage::helper("troopid_connect")->getAffiliations();
18
+
19
+ foreach ($groups as $group) {
20
+ $scopes[] = array(
21
+ "value" => $group["scope"],
22
+ "label" => $group["name"]
23
+ );
24
+ }
25
+
26
+ $this->options = $scopes;
27
+ }
28
+
29
+ return $this->options;
30
+ }
31
+ }
app/code/community/TroopID/Connect/Block/Widget/Grid/Column/Renderer/Scope.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TroopID_Connect_Block_Widget_Grid_Column_Renderer_Scope extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
4
+
5
+ public function render(Varien_Object $row) {
6
+ $value = $this->_getValue($row);
7
+ $label = $this->_getLabel($value);
8
+
9
+ return isset($label) ? $label : $value;
10
+ }
11
+
12
+ private function _getLabel($value) {
13
+ return Mage::helper("troopid_connect")->getAffiliationByScope($value);
14
+ }
15
+
16
+ }
app/code/community/TroopID/Connect/Model/Order/Observer.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TroopID_Connect_Model_Order_Observer {
3
+
4
+ protected $options = array();
5
+
6
+ public function addCollection(Varien_Event_Observer $observer) {
7
+ $collection = $observer->getOrderGridCollection();
8
+
9
+ if (!isset($collection))
10
+ return;
11
+
12
+ $tablename = $collection->getTable("sales/order");
13
+
14
+ $select = $collection->getSelect();
15
+ $select->joinLeft(array("order" => $tablename), "order.entity_id = main_table.entity_id", array("troopid_scope"));
16
+ }
17
+
18
+ public function addColumn(Varien_Event_Observer $observer) {
19
+ $block = $observer->getBlock();
20
+
21
+ if (!isset($block))
22
+ return;
23
+
24
+ if ($block instanceof Mage_Adminhtml_Block_Sales_Order_Grid) {
25
+
26
+ $block->addColumnAfter(
27
+ "troopid_scope",
28
+ array(
29
+ "header" => "ID.me Affiliation",
30
+ "index" => "troopid_scope",
31
+ "type" => "options",
32
+ "filter" => "TroopID_Connect_Block_Widget_Grid_Column_Filter_Scope",
33
+ "renderer" => "TroopID_Connect_Block_Widget_Grid_Column_Renderer_Scope",
34
+ "filter_index" => "order.troopid_scope",
35
+ ),
36
+ "shipping_name"
37
+ );
38
+ }
39
+ }
40
+
41
+ }
app/code/community/TroopID/Connect/etc/config.xml CHANGED
@@ -28,10 +28,10 @@
28
  <events>
29
  <checkout_cart_save_before>
30
  <observers>
31
- <clear_troopid_affiliation>
32
- <class>troopid_connect/cart_observer</class>
33
  <method>clearAffiliation</method>
34
- </clear_troopid_affiliation>
35
  </observers>
36
  </checkout_cart_save_before>
37
  </events>
@@ -49,12 +49,30 @@
49
  <events>
50
  <salesrule_rule_condition_combine>
51
  <observers>
52
- <add_troopid_condition_to_sales_rule>
53
- <class>troopid_connect/rule_observer</class>
54
  <method>addCondition</method>
55
- </add_troopid_condition_to_sales_rule>
56
  </observers>
57
  </salesrule_rule_condition_combine>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  </events>
59
  </adminhtml>
60
 
28
  <events>
29
  <checkout_cart_save_before>
30
  <observers>
31
+ <troopid_connect>
32
+ <model>troopid_connect/cart_observer</model>
33
  <method>clearAffiliation</method>
34
+ </troopid_connect>
35
  </observers>
36
  </checkout_cart_save_before>
37
  </events>
49
  <events>
50
  <salesrule_rule_condition_combine>
51
  <observers>
52
+ <troopid_connect>
53
+ <model>troopid_connect/rule_observer</model>
54
  <method>addCondition</method>
55
+ </troopid_connect>
56
  </observers>
57
  </salesrule_rule_condition_combine>
58
+
59
+ <sales_order_grid_collection_load_before>
60
+ <observers>
61
+ <troopid_connect>
62
+ <model>troopid_connect/order_observer</model>
63
+ <method>addCollection</method>
64
+ </troopid_connect>
65
+ </observers>
66
+ </sales_order_grid_collection_load_before>
67
+
68
+ <core_block_abstract_prepare_layout_before>
69
+ <observers>
70
+ <troopid_connect>
71
+ <model>troopid_connect/order_observer</model>
72
+ <method>addColumn</method>
73
+ </troopid_connect>
74
+ </observers>
75
+ </core_block_abstract_prepare_layout_before>
76
  </events>
77
  </adminhtml>
78
 
app/code/community/TroopID/Connect/etc/system.xml CHANGED
@@ -44,9 +44,9 @@
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
  <developer_url><![CDATA[https://developer.id.me]]></developer_url>
47
- <apps_url><![CDATA[https://developer.id.me/applications]]></apps_url>
48
  <docs_url><![CDATA[https://developer.id.me/documentation]]></docs_url>
49
- <learn_more_url><![CDATA[https://www.id.me/partner-with-us]]></learn_more_url>
50
  </instructions>
51
  <enabled>
52
  <label>Enabled?</label>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
  <developer_url><![CDATA[https://developer.id.me]]></developer_url>
47
+ <apps_url><![CDATA[https://developer.id.me/organizations]]></apps_url>
48
  <docs_url><![CDATA[https://developer.id.me/documentation]]></docs_url>
49
+ <learn_more_url><![CDATA[https://business.id.me]]></learn_more_url>
50
  </instructions>
51
  <enabled>
52
  <label>Enabled?</label>
app/design/adminhtml/default/default/template/troopid/connect/affiliation.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <div class="box-left">
2
  <div class="entry-edit">
3
  <div class="entry-edit-head">
4
- <h4 class="icon-head head-account"><?php echo Mage::helper("troopid_connect")->__("ID.me Verified Affiliation") ?></h4>
5
  <div class="tools"></div>
6
  </div>
7
  <div class="fieldset">
@@ -17,7 +17,7 @@
17
  </tr>
18
  <tr>
19
  <td class="label">
20
- <label><?php echo Mage::helper("troopid_connect")->__("UID") ?></label>
21
  </td>
22
  <td class="value">
23
  <strong><?php echo $this->getUID() ?></strong>
@@ -25,7 +25,7 @@
25
  </tr>
26
  <tr>
27
  <td class="label">
28
- <label><?php echo Mage::helper("troopid_connect")->__("Scope") ?></label>
29
  </td>
30
  <td class="value">
31
  <strong><?php echo $this->getScope() ?></strong>
1
  <div class="box-left">
2
  <div class="entry-edit">
3
  <div class="entry-edit-head">
4
+ <h4 class="icon-head head-account"><?php echo Mage::helper("troopid_connect")->__("ID.me Wallet Affiliation") ?></h4>
5
  <div class="tools"></div>
6
  </div>
7
  <div class="fieldset">
17
  </tr>
18
  <tr>
19
  <td class="label">
20
+ <label><?php echo Mage::helper("troopid_connect")->__("UUID") ?></label>
21
  </td>
22
  <td class="value">
23
  <strong><?php echo $this->getUID() ?></strong>
25
  </tr>
26
  <tr>
27
  <td class="label">
28
+ <label><?php echo Mage::helper("troopid_connect")->__("Policy") ?></label>
29
  </td>
30
  <td class="value">
31
  <strong><?php echo $this->getScope() ?></strong>
app/design/frontend/base/default/template/troopid/connect/cart.phtml CHANGED
@@ -12,8 +12,7 @@
12
 
13
  <div class="idme-button">
14
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="military" title="<?php echo $this->__("Verify your military affiliation with ID.me") ?>">
15
- <img alt="Troop ID" src="https://s3.amazonaws.com/idme/assets/troop-id.png">
16
- TROOP ID
17
  </a>
18
  </div>
19
 
@@ -23,7 +22,7 @@
23
 
24
  <div class="idme-button">
25
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="student" title="<?php echo $this->__("Verify your student affiliation with ID.me") ?>">
26
- STUDENT ID
27
  </a>
28
  </div>
29
 
@@ -33,7 +32,7 @@
33
 
34
  <div class="idme-button">
35
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="teacher" title="<?php echo $this->__("Verify your teacher affiliation with ID.me") ?>">
36
- TEACHER ID
37
  </a>
38
  </div>
39
 
@@ -43,7 +42,7 @@
43
 
44
  <div class="idme-button">
45
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="responder" title="<?php echo $this->__("Verify your first responder affiliation with ID.me") ?>">
46
- FIRST RESPONDER ID
47
  </a>
48
  </div>
49
 
12
 
13
  <div class="idme-button">
14
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="military" title="<?php echo $this->__("Verify your military affiliation with ID.me") ?>">
15
+ <img src="https://s3.amazonaws.com/idme/developer/idme-buttons-2.0.1/assets/img/btn-primary-Troop.png" alt="Troop ID" border="0"/>
 
16
  </a>
17
  </div>
18
 
22
 
23
  <div class="idme-button">
24
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="student" title="<?php echo $this->__("Verify your student affiliation with ID.me") ?>">
25
+ <img src="https://s3.amazonaws.com/idme/developer/idme-buttons-2.0.1/assets/img/btn-primary-Student.png" alt="Student ID" border="0"/>
26
  </a>
27
  </div>
28
 
32
 
33
  <div class="idme-button">
34
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="teacher" title="<?php echo $this->__("Verify your teacher affiliation with ID.me") ?>">
35
+ <img src="https://s3.amazonaws.com/idme/developer/idme-buttons-2.0.1/assets/img/btn-primary-Teacher.png" alt="Teacher ID" border="0"/>
36
  </a>
37
  </div>
38
 
42
 
43
  <div class="idme-button">
44
  <a href="javascript:void(0);" class="idme-connect-trigger" data-scope="responder" title="<?php echo $this->__("Verify your first responder affiliation with ID.me") ?>">
45
+ <img src="https://s3.amazonaws.com/idme/developer/idme-buttons-2.0.1/assets/img/btn-primary-Responder.png" alt="First Responder ID" border="0"/>
46
  </a>
47
  </div>
48
 
package.xml CHANGED
@@ -1,19 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TroopID_Connect</name>
4
- <version>1.4.3</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>ID.me Integration</summary>
10
  <description>N/A</description>
11
- <notes>Fix issue with disabling extension&#xD;
12
- Fix OAuth credential handling</notes>
13
  <authors><author><name>ID.me</name><user>idme</user><email>support@id.me</email></author></authors>
14
- <date>2015-10-02</date>
15
- <time>16:38:34</time>
16
- <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="a723462553ee585ccf3c9ded256c2d55"/></dir></dir></dir><file name="Cart.php" hash="75f526c8e484328a45604c0c50bbf6a8"/></dir><dir name="Helper"><file name="Data.php" hash="72586f83d6d5b3b4208f242e410208db"/><file name="Oauth.php" hash="647c96311d574e8bec2d84099ea5b0d9"/></dir><dir name="Model"><dir name="Cart"><file name="Observer.php" hash="c837fb0c02ac02416200002d5e3b233c"/></dir><dir name="Rule"><file name="Condition.php" hash="6f3de19ed93753c5695cbeb9b48cb0b0"/><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="fa9f2560b2d04995091835935037cc2a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2bba51d29a0e9c444ff401a460a44142"/><file name="config.xml" hash="25effbb6c1487f4db22443f8a47f0af2"/><file name="system.xml" hash="22c0372a79c65417cf1239591fc37d64"/></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="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="troopid"><file name="idme.css" hash="950827f2031330fed931930c12b5fa88"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="troopid"><file name="idme.css" hash="57964a12675c76bca426475515160dcc"/><dir name="images"><file name="logo.png" hash="65421456771898d7cbced7b99d4b56ea"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TroopID_Connect.xml" hash="daae0990b13ba4071764efd4f9f674ec"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="760c7d73dcab51068a0db524699b354e"/></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="f83172a0eaea9b8c185f49f0864bf8cb"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="callback.phtml" hash="71b10af7408d6f50999529c08aa75dfb"/><file name="cart.phtml" hash="2df306654373065c7b0d5299b248379c"/><file name="script.phtml" hash="5e281cd246f5d02fae91ff9742ee9088"/></dir></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TroopID_Connect</name>
4
+ <version>1.4.4</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>ID.me Integration</summary>
10
  <description>N/A</description>
11
+ <notes>Add ID.me affiliation filtering for orders&#xD;
12
+ Update button assets</notes>
13
  <authors><author><name>ID.me</name><user>idme</user><email>support@id.me</email></author></authors>
14
+ <date>2016-01-20</date>
15
+ <time>20:07:12</time>
16
+ <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="5b38aa826f52b77a6357598b2361e23f"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Custom.php" hash="0f7f75b4b55edb638d241852a0220b3f"/><file name="Instructions.php" hash="a723462553ee585ccf3c9ded256c2d55"/></dir></dir></dir><file name="Cart.php" hash="75f526c8e484328a45604c0c50bbf6a8"/><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="Scope.php" hash="672fc40540585ee36e8677135f37bfba"/></dir><dir name="Renderer"><file name="Scope.php" hash="daac97b9a2c3b442fb4cdabb2013b89a"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="72586f83d6d5b3b4208f242e410208db"/><file name="Oauth.php" hash="647c96311d574e8bec2d84099ea5b0d9"/></dir><dir name="Model"><dir name="Cart"><file name="Observer.php" hash="c837fb0c02ac02416200002d5e3b233c"/></dir><dir name="Order"><file name="Observer.php" hash="fa61d9c3dd9a5e2de302b3ee4d56ecd4"/></dir><dir name="Rule"><file name="Condition.php" hash="6f3de19ed93753c5695cbeb9b48cb0b0"/><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="fa9f2560b2d04995091835935037cc2a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2bba51d29a0e9c444ff401a460a44142"/><file name="config.xml" hash="f3524e0e3f239e457d88f7a1c391aee7"/><file name="system.xml" hash="c066c7b80e5cf2e489b255d704cfc6c6"/></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="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="troopid"><file name="idme.css" hash="bc66179fc8bfe9f33d66be34929d964e"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="troopid"><file name="idme.css" hash="57964a12675c76bca426475515160dcc"/><dir name="images"><file name="logo.png" hash="65421456771898d7cbced7b99d4b56ea"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TroopID_Connect.xml" hash="daae0990b13ba4071764efd4f9f674ec"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="760c7d73dcab51068a0db524699b354e"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="affiliation.phtml" hash="8a02c93877c22287629f383f16bee34c"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="troopid_connect.xml" hash="f83172a0eaea9b8c185f49f0864bf8cb"/></dir><dir name="template"><dir name="troopid"><dir name="connect"><file name="callback.phtml" hash="71b10af7408d6f50999529c08aa75dfb"/><file name="cart.phtml" hash="41dc1e8dcbe61e48e7fd37deeaaedf35"/><file name="script.phtml" hash="5e281cd246f5d02fae91ff9742ee9088"/></dir></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
skin/frontend/base/default/troopid/idme.css CHANGED
@@ -26,27 +26,22 @@
26
  }
27
 
28
  .idme-connect .idme-button {
29
- margin: 10px 0 0 0;
30
  display: inline-block;
31
  }
32
 
 
 
 
 
33
  .idme-connect .idme-button a {
34
  display: inline-block;
35
- background: none repeat scroll 0% 0% rgb(255, 255, 255);
36
- font-family: Open Sans, Arial, sans-serif;
37
- font-size: 13px;
38
- font-weight: 600;
39
- color: rgb(39, 160, 227);
40
- border: 2px solid rgb(237, 240, 242);
41
- border-radius: 10px;
42
- padding: 8px 16px;
43
- text-decoration: none;
44
  }
45
 
46
  .idme-connect .idme-button a img {
47
- display: inline;
48
- vertical-align: middle;
49
- margin: 0 3px 2px 0;
50
  }
51
 
52
  .idme-connect .about {
26
  }
27
 
28
  .idme-connect .idme-button {
29
+ margin: 5px 0 0 5px;
30
  display: inline-block;
31
  }
32
 
33
+ .idme-connect .idme-button:first-child {
34
+ margin-left: 0;
35
+ }
36
+
37
  .idme-connect .idme-button a {
38
  display: inline-block;
39
+ margin: 0;
 
 
 
 
 
 
 
 
40
  }
41
 
42
  .idme-connect .idme-button a img {
43
+ height: 35px;
44
+ margin: 0;
 
45
  }
46
 
47
  .idme-connect .about {