Skip to content

Commit

Permalink
Fixes missing template files in Magento Connect package, fixes a 404 …
Browse files Browse the repository at this point in the history
…error on the products page and cleans up some code.
  • Loading branch information
jayelkaake committed Nov 25, 2015
1 parent f25432d commit a328cc6
Show file tree
Hide file tree
Showing 7 changed files with 404 additions and 388 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Enhanced Admin Product Grid for Magento
=======================================

This Magento extension imrpoves the existing Magento admin product management grid. It adds some useful, customizable features to the admin product management grid including new columns and tools.
This Magento extension improves the existing Magento admin product management grid. It adds some useful, customizable features to the admin product management grid including new columns and tools.

From the makers of [Sweet Tooth Rewards](http://www.sweettoothrewards.com)

Expand Down
4 changes: 2 additions & 2 deletions app/code/community/TBT/Enhancedgrid/Block/Widget/Loyalty.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TBT_Enhancedgrid_Block_Widget_Loyalty extends Mage_Adminhtml_Block_Templat
public function _toHtml()
{
$html = <<<FEED
<!-- Visit http://www.sweettoothrewards.com/m for information about this frame. You can remove it if you want. -->
<!-- Visit https://www.wdca.ca/m for information about this frame. You can remove it if you want. -->
<iframe src="{$this->_getLoyaltyUrl()}" marginwidth="0" marginheight="0"
align="middle" frameborder="0"
scrolling="no" style="width: 500px; float: left; height: 22px;">
Expand Down Expand Up @@ -48,7 +48,7 @@ protected function _getLoyaltyUrl()

protected function _getBaseLoyaltyUrl()
{
$url = 'https://www.sweettoothrewards.com/m/';
$url = 'https://www.wdca.ca/m';

//@nelkaake: If the page is supposed to be HTTPS and the AJAX call is not HTTPS, add HTTPS
// if it's HTTP and the url returned HTTPS, remove HTTPS
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/TBT/Enhancedgrid/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<TBT_Enhancedgrid>
<version>1.3.4.2</version>
<version>1.3.4.3</version>
</TBT_Enhancedgrid>
</modules>
<admin>
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "jayelkaake/enhancedgrid",
"type": "magento-module",
"version": "1.3.4.2",
"version": "1.3.4.3",
"description":"Improves the existing Magento admin product management grid. It adds some useful, customizable features to the admin product management grid including new columns and tools.",
"authors":[
{
"name":"Jay El-Kaake (special thanks to evaldas.taroza@ufirstgroup.com to making the composer.json file)",
"name":"Jay El-Kaake",
"email":"jay@sweettoothhq.com",
"homepage": "http://www.sweettoothrewards.com",
"role": "Developer"
Expand Down Expand Up @@ -43,18 +43,18 @@
"path":"modules/TBT_Enhancedgrid.xml"
},
{
"type":"mage",
"type":"magedesign",
"structure":"file",
"path":"app/design/adminhtml/default/default/layout/tbt_enhancedgrid.xml"
"path":"adminhtml/default/default/layout/tbt_enhancedgrid.xml"
},
{
"type":"mage",
"structure":"folder",
"path":"app/design/adminhtml/default/default/template/tbt/enhancedgrid"
"type":"magedesign",
"structure":"dir",
"path":"adminhtml/default/default/template/tbt/enhancedgrid"
},
{
"type":"mage",
"structure":"folder",
"type":"mageweb",
"structure":"dir",
"path":"js/tbt/enhancedgrid"
}
]
Expand Down
134 changes: 67 additions & 67 deletions js/tbt/enhancedgrid/customfunctions/catalog_products.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trade Business Technology Corp.
* Sweet Tooth.
*
* NOTICE OF LICENSE
*
Expand All @@ -11,102 +11,102 @@
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @copyright Copyright (c) 2008-2009 Trade Business Technology Corp. (contact@tbtcorp.com)
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Sweet Tooth
*
* @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
function chooseWhatToRelateTo() {
var productids = window.prompt("Enter the id's for products you'd like to relate the currently selected products to.\n"
+"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n"
+"related to A and B, Y will be related to A and B, etc.\n"
+"Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
if (productids == "" || productids == null) {
return null
}
if (!window.confirm("Are you sure you'd like to one-way relate selected grid products to products ("+ productids +")")) {
return null
}
return productids;
var productids = window.prompt("Enter the id's for products you'd like to relate the currently selected products to.\n" + "For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n" + "related to A and B, Y will be related to A and B, etc.\n" + "Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
if (productids == "" || productids == null) {
return null
}
if (!window.confirm("Are you sure you'd like to one-way relate selected grid products to products (" + productids + ")")) {
return null
}
return productids;
}

function chooseWhatToCrossSellTo() {
var productids = window.prompt("Enter the id's for products you'd like to add as cross-sell to the currently selected products.\n"
+"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n"
+"cross-sold to A and B, Y will be cross-sold with A and with B, etc.\n"
+"Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
if (productids == "" || productids == null) {
return null
}
if (!window.confirm("Are you sure you'd like to one-way cross-sell products ("+ productids +") to selected grid products?")) {
return null
}
return productids;
var productids = window.prompt("Enter the id's for products you'd like to add as cross-sell to the currently selected products.\n" + "For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n" + "cross-sold to A and B, Y will be cross-sold with A and with B, etc.\n" + "Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
if (productids == "" || productids == null) {
return null
}
if (!window.confirm("Are you sure you'd like to one-way cross-sell products (" + productids + ") to selected grid products?")) {
return null
}
return productids;
}

function chooseWhatToUpSellTo() {
var productids = window.prompt("Enter the id's for products you'd like to add as up-sells to the currently selected products.\n"
+"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, A and B will be\n"
+"up-sells of X , A and B will be up-sells of Y, etc.\n"
+"Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
if (productids == "" || productids == null) {
return null
}
if (!window.confirm("Are you sure you'd like add products ("+ productids +") to selected grid products up-sell?")) {
return null
}
return productids;
var productids = window.prompt("Enter the id's for products you'd like to add as up-sells to the currently selected products.\n" + "For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, A and B will be\n" + "up-sells of X , A and B will be up-sells of Y, etc.\n" + "Separate multiple product ids by a comma as shown in the example above.", "<Enter product IDs (NOT SKUs!)>");
if (productids == "" || productids == null) {
return null
}
if (!window.confirm("Are you sure you'd like add products (" + productids + ") to selected grid products up-sell?")) {
return null
}
return productids;
}



function showSelectedImages(gridObj, checkedValues, imgTemplate) {
var matchCounter = 0;
gridObj.walkSelectedRows(function(ie){
ie.getElementsBySelector('a').each(function(a) {
if(a.id == "imageurl") {
matchCounter++;
a.innerHTML = imgTemplate.replace("{imgurl}", a.getAttribute('url'));
}
});
gridObj.walkSelectedRows(function(ie) {
ie.getElementsBySelector('a').each(function(a) {
if (a.id == "imageurl") {
matchCounter++;
a.innerHTML = imgTemplate.replace("{imgurl}", a.getAttribute('url'));
}
});
});
if(matchCounter == 0) {
alert("Either there was no image column, or the image column could not be found");
}
return null;
if (matchCounter == 0) {
alert("Either there was no image column, or the image column could not be found");
}
return null;

}

function hideSelectedImages(gridObj, checkedValues) {
var matchCounter = 0;
gridObj.walkSelectedRows(function(ie){
ie.getElementsBySelector('a').each(function(a) {
if(a.id == "imageurl") {
matchCounter++;
a.innerHTML = "@";
}
});
gridObj.walkSelectedRows(function(ie) {
ie.getElementsBySelector('a').each(function(a) {
if (a.id == "imageurl") {
matchCounter++;
a.innerHTML = "@";
}
});
});
if(matchCounter == 0) {
alert("Either there was no image column, or the image column could not be found");
}
return null;
if (matchCounter == 0) {
alert("Either there was no image column, or the image column could not be found");
}
return null;

}

function openAllImages(gridObj, checkedValues) {
gridObj.walkSelectedRows(function(ie){
ie.getElementsBySelector('a').each(function(a) {
if(a.id == "imageurl") {
window.open(a.getAttribute('url'));
}
});
gridObj.walkSelectedRows(function(ie) {
ie.getElementsBySelector('a').each(function(a) {
if (a.id == "imageurl") {
window.open(a.getAttribute('url'));
}
});
}, 30);
return null;
return null;

}

function openAll(gridObj, checkedValues) {
gridObj.walkSelectedRows(function(ie){
window.open(ie.id);
gridObj.walkSelectedRows(function(ie) {
window.open(ie.id);
}, 20);
return null;
return null;

}
71 changes: 38 additions & 33 deletions js/tbt/enhancedgrid/egsupplemental.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trade Business Technology Corp.
* Sweet Tooth.
*
* NOTICE OF LICENSE
*
Expand All @@ -11,63 +11,68 @@
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @copyright Copyright (c) 2008-2009 Trade Business Technology Corp. (contact@tbtcorp.com)
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Sweet Tooth
*
* @copyright Copyright (c) 2008-2011 Sweet Tooth (http://www.sweettoothrewards.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


//form tags to omit in NS6+:

var omitformtags=["input", "textarea", "select"]
//form tags to omit in NS6+:
var omitformtags = ["input", "textarea", "select"]

omitformtags=omitformtags.join("|")
omitformtags = omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
function disableselect(e) {
if (omitformtags.indexOf(e.target.tagName.toLowerCase()) == -1)
return false
}

function reEnable(){
return true
function reEnable() {
return true
}

var originalHighlighting = false;

function disableHighlighting() {
if (typeof document.onselectstart!="undefined") {
originalHighlighting = document.onselectstart;
document.onselectstart=new Function ("return false")
} else{
originalHighlighting = {
down: document.onmousedown,
up: document.onmouseup
if (typeof document.onselectstart != "undefined") {
originalHighlighting = document.onselectstart;
document.onselectstart = new Function("return false")
} else {
originalHighlighting = {
down: document.onmousedown,
up: document.onmouseup
}
document.onmousedown = disableselect
document.onmouseup = reEnable
}
document.onmousedown=disableselect
document.onmouseup=reEnable
}
}

function enableHighlighting() {
if (typeof document.onselectstart!="undefined") {
document.onselectstart = originalHighlighting;
} else{
document.onmousedown=originalHighlighting.down;
document.onmouseup=originalHighlighting.up;
}
if (typeof document.onselectstart != "undefined") {
document.onselectstart = originalHighlighting;
} else {
document.onmousedown = originalHighlighting.down;
document.onmouseup = originalHighlighting.up;
}
}

function keyWasPressed(e, targetKeyNum) {
var keychar;
var numcheck;
if(window.event) // IE

if (window.event) // IE
{
keynum = e.keyCode;
}
else if(e.which) // Netscape/Firefox/Opera
} else if (e.which) // Netscape/Firefox/Opera
{
keynum = e.which;
}
if(keynum == targetKeyNum) return true;
if (keynum == targetKeyNum) return true;
return false;
}
Loading

0 comments on commit a328cc6

Please sign in to comment.