Skip to content
Browse files

Merge branch 'bootstrap' of github.com:ten24/Slatwall into bootstrap

  • Loading branch information...
2 parents c9226c5 + c7c0e55 commit 8c739138e0a913373a042573622898dbfd24488f @simonfree simonfree committed May 10, 2012
View
42 admin/controllers/ajax.cfc
@@ -38,7 +38,13 @@ Notes:
*/
component extends="BaseController" persistent="false" accessors="true" output="false" {
-
+ property name="productService" type="any";
+ property name="brandService" type="any";
+ property name="promotionService" type="any";
+ property name="orderService" type="any";
+ property name="accountService" type="any";
+ property name="vendorService" type="any";
+ property name="vendorOrderService" type="any";
public void function default(required struct rc) {
getFW().redirect(action="admin:account.listaccount");
@@ -78,8 +84,40 @@ component extends="BaseController" persistent="false" accessors="true" output="f
public void function updateGlobalSearchResults(required struct rc) {
+ var smartLists = {};
+ smartLists['product'] = getProductService().getProductSmartList(data=rc);
+ smartLists['productType'] = getProductService().getProductTypeSmartList(data=rc);
+ smartLists['brand'] = getBrandService().getBrandSmartList(data=rc);
+ smartLists['promotion'] = getPromotionService().getPromotionSmartList(data=rc);
+ smartLists['order'] = getOrderService().getOrderSmartList(data=rc);
+ smartLists['account'] = getAccountService().getAccountSmartList(data=rc);
+ smartLists['vendorOrder'] = getVendorOrderService().getVendorOrderSmartList(data=rc);
+ smartLists['vendor'] = getVendorService().getVendorSmartList(data=rc);
-
+ for(var key in smartLists) {
+ rc[ key ] = {};
+ rc[ key ][ 'records' ] = [];
+ rc[ key ][ 'recordCount' ] = smartLists[key].getRecordsCount();
+
+ for(var i=1; i<=arrayLen(smartLists[key].getPageRecords()); i++) {
+ var thisRecord = {};
+ thisRecord['value'] = smartLists[key].getPageRecords()[i].getPrimaryIDValue();
+ thisRecord['name'] = smartLists[key].getPageRecords()[i].getSimpleRepresentation();
+
+ arrayAppend(rc[ key ][ 'records' ], thisRecord);
+ }
+ }
}
}
+
+
+
+
+
+
+
+
+
+
+
View
61 admin/layouts/default.cfm
@@ -142,38 +142,53 @@ Notes:
<div id="search-results" class="search-results">
<div class="container-fluid">
<div class="row-fluid">
- <div class="span12">
- <a class="close search-close"><span class="text">Close</span> &times;</a>
- </div>
- </div>
- <div class="row-fluid">
- <div class="span3">
- <h4>Products</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.product_plural')#</h4>
+ <ul class="nav" id="golbalsr-product">
+ <li><a href="##">Test Product</a></li>
+ </ul>
</div>
- <div class="span3 account-search">
- <h4>Product Types</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.productType_plural')#</h4>
+ <ul class="nav" id="golbalsr-productType">
+ </ul>
</div>
- <div class="span3 order-search">
- <h4>Brands</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.brand_plural')#</h4>
+ <ul class="nav" id="golbalsr-brand">
+ </ul>
</div>
- <div class="span3 brand-search">
- <h4>Promotions</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.promotion_plural')#</h4>
+ <ul class="nav" id="golbalsr-promotion">
+ </ul>
</div>
</div>
- <br />
- <br />
<div class="row-fluid">
- <div class="span3">
- <h4>Orders</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.order_plural')#</h4>
+ <ul class="nav" id="golbalsr-order">
+ </ul>
</div>
- <div class="span3 account-search">
- <h4>Account</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.account_plural')#</h4>
+ <ul class="nav" id="golbalsr-account">
+ </ul>
</div>
- <div class="span3 order-search">
- <h4>Vendor Orders</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.vendorOrder_plural')#</h4>
+ <ul class="nav" id="golbalsr-vendorOrder">
+ </ul>
</div>
- <div class="span3 brand-search">
- <h4>Vendors</h4>
+ <div class="span3 result-bucket">
+ <h4>#$.slatwall.rbKey('entity.vendor_plural')#</h4>
+ <ul class="nav" id="golbalsr-vendor">
+ </ul>
+ </div>
+ </div>
+ <div class="row-fluid">
+ <div class="span12">
+ <a class="close search-close"><span class="text">Close</span> &times;</a>
</div>
</div>
</div>
View
1 admin/views/product/listbrand.cfm
@@ -45,6 +45,7 @@ Notes:
<cf_SlatwallListingDisplay smartList="#rc.brandSmartList#" recordEditAction="admin:product.editbrand">
<cf_SlatwallListingColumn tdclass="primary" propertyIdentifier="brandName" search="true" />
<cf_SlatwallListingColumn propertyIdentifier="brandWebsite" sort="false" search="true" />
+ <cf_SlatwallListingColumn propertyIdentifier="activeFlag" filter="true" />
</cf_SlatwallListingDisplay>
</cfoutput>
View
22 assets/css/global.less
@@ -37,20 +37,24 @@ body {
#search-results {
position:relative;
width:100%;
- height:400px;
background-color:#F5F5F5;
- margin-bottom:20px;
- margin-top:-410px;
- padding-top:50px;
-}
-.search-close {
- margin-bottom:10px;
- .text {
- font-size:12px;
+ margin-bottom:30px;
+ margin-top:-500px;
+ padding-top:60px;
+ padding-bottom:0px;
+ .result-bucket {
+ height:220px;
+ }
+ .search-close {
+ margin-bottom:10px;
+ .text {
+ font-size:12px;
+ }
}
}
+
.table {
th, td {
white-space:nowrap;
View
52 assets/js/global.js
@@ -28,6 +28,10 @@ jQuery(document).ready(function() {
jQuery('input[tabindex=1]').focus();
}
+ if(jQuery('#global-search').val() != '') {
+ jQuery('#global-search').keyup();
+ }
+
});
function initUIElements( scopeSelector ) {
@@ -102,8 +106,9 @@ function setupEventHandlers() {
}
} else {
jQuery('#search-results').animate({
- 'margin-top': '-410px'
+ 'margin-top': '-500px'
}, 150);
+ jQuery('#search-results .result-bucket .nav').html('');
}
});
jQuery('body').on('click', '.search-close', function(e){
@@ -591,7 +596,50 @@ function tableExpandClick( toggleLink ) {
}
function updateGlobalSearchResults() {
- console.log('got here!');
+
+ var data = {
+ slatAction: 'admin:ajax.updateGlobalSearchResults',
+ keywords: jQuery('#global-search').val()
+ };
+
+ jQuery.ajax({
+ url: '/plugins/Slatwall/',
+ method: 'post',
+ data: data,
+ dataType: 'json',
+ contentType: 'application/json',
+ error: function(result) {
+ console.log(r);
+ alert('Error Loading Global Search');
+ },
+ success: function(result) {
+ var buckets = {
+ product: {primaryIDProperty:'productID', listAction:'admin:product.listproduct', detailAction:'admin:product.detailproduct'},
+ productType: {primaryIDProperty:'productTypeID', listAction:'admin:product.listproducttype', detailAction:'admin:product.detailproducttype'},
+ brand: {primaryIDProperty:'brandID', listAction:'admin:product.listbrand', detailAction:'admin:product.detailbrand'},
+ promotion: {primaryIDProperty:'promotionID', listAction:'admin:pricing.listpromotion', detailAction:'admin:pricing.detailpromotion'},
+ order: {primaryIDProperty:'orderID', listAction:'admin:order.listorder', detailAction:'admin:order.detailorder'},
+ account: {primaryIDProperty:'accountID', listAction:'admin:account.listaccount', detailAction:'admin:account.detailaccount'},
+ vendorOrder: {primaryIDProperty:'vendorOrderID', listAction:'admin:order.listvendororder', detailAction:'admin:order.detailvendororder'},
+ vendor: {primaryIDProperty:'vendorID', listAction:'admin:vendor.listvendor', detailAction:'admin:vendor.detailvendor'}
+ };
+ for (var key in buckets) {
+ jQuery('#golbalsr-' + key).html('');
+ var records = result[key]['records'];
+ for(var r=0; r < records.length; r++) {
+ jQuery('#golbalsr-' + key).append('<li><a href="/plugins/Slatwall/?slatAction=' + buckets[key]['detailAction'] + '&' + buckets[key]['primaryIDProperty'] + '=' + records[r]['value'] + '">' + records[r]['name'] + '</a></li>');
+ }
+ if(result[key]['recordCount'] > 10) {
+ jQuery('#golbalsr-' + key).append('<li><a href="/plugins/Slatwall/?slatAction=' + buckets[key]['detailAction'] + '&keywords=' + jQuery('#global-search').val() + '">...</a></li>');
+ } else if (result[key]['recordCount'] == 0) {
+ jQuery('#golbalsr-' + key).append('<li><em>none</em></li>');
+ }
+ }
+ }
+
+ });
+
+
}
View
14 com/entity/Order.cfc
@@ -517,6 +517,20 @@ component displayname="Order" entityname="SlatwallOrder" table="SlatwallOrder" p
return "orderNumber";
}
+ public string function getSimpleRepresentation() {
+ if(!isNull(getOrderNumber()) && len(getOrderNumber())) {
+ var representation = getOrderNumber();
+ } else {
+ var representation = rbKey('define.cart');
+ }
+
+ if(!isNull(getAccount())) {
+ representation &= " - #getAccount().getFullname()#";
+ }
+
+ return representation;
+ }
+
// ================== END: Overridden Methods ========================
// =================== START: ORM Event Hooks =========================
View
23 com/service/SubscriptionService.cfc
@@ -79,16 +79,23 @@ component extends="BaseService" persistent="false" accessors="true" output="fals
public any function createSubscriptionUsageBenefitAccountBySubscriptionUsageBenefit(required any subscriptionUsageBenefit, any account) {
if(arguments.subscriptionUsageBenefit.getAvailableUseCount() GT 0) {
- var subscriptionUsageBenefitAccount = this.newSubscriptionUsageBenefitAccount();
- subscriptionUsageBenefitAccount.setSubscriptionUsageBenefit(arguments.subscriptionUsageBenefit);
- this.saveSubscriptionUsageBenefitAccount(subscriptionUsageBenefitAccount);
- // if account is passed then set the account to this benefit else create an access record to be used for account creation
+ // if account is passed then get this benefit account else create a new benefit account
if(structKeyExists(arguments,"account")) {
- subscriptionUsageBenefitAccount.setAccount(arguments.account);
+ var subscriptionUsageBenefitAccount = this.getSubscriptionUsageBenefitAccount({subscriptionUsageBenefit=arguments.subscriptionUsageBenefit,account=arguments.account},true);
} else {
- var access = getAccessService().newAccess();
- access.setSubscriptionUsageBenefitAccount(subscriptionUsageBenefitAccount);
- getAccessService().saveAccess(access);
+ var subscriptionUsageBenefitAccount = this.newSubscriptionUsageBenefitAccount();
+ }
+ if(subscriptionUsageBenefitAccount.isNew()) {
+ subscriptionUsageBenefitAccount.setSubscriptionUsageBenefit(arguments.subscriptionUsageBenefit);
+ this.saveSubscriptionUsageBenefitAccount(subscriptionUsageBenefitAccount);
+ // if account is passed then set the account to this benefit else create an access record to be used for account creation
+ if(structKeyExists(arguments,"account")) {
+ subscriptionUsageBenefitAccount.setAccount(arguments.account);
+ } else {
+ var access = getAccessService().newAccess();
+ access.setSubscriptionUsageBenefitAccount(subscriptionUsageBenefitAccount);
+ getAccessService().saveAccess(access);
+ }
}
return subscriptionUsageBenefitAccount;
}
View
54 resourceBundles/en.properties
@@ -120,6 +120,10 @@ admin.product.createproductimage_nav=Add Product Image
admin.product.createsubscriptionproduct_nav=New Subscription Product
admin.product.createsubscriptionproducttype_nav=New Subscription Product Type
admin.product.optiongrouptabs.options=Options
+admin.product.processoption_nav=Add Option
+admin.product.processoptiongroup_nav=Add Option Group
+admin.product.processproduct.processOption.option=Option
+admin.product.processproduct.processOption.optionGroup=Option Group
admin.product.processproduct.processOption.skuPrice=New Price
admin.product.processproduct_nav=Update Price
admin.product.producttabs.alternateimages=Alternate Images
@@ -202,6 +206,9 @@ admin.setting.updateslatwall_nav=Update Slatwall
admin.setting.updateslatwall_success=Slatwall updated successfully
admin.setting_nav=Settings
admin.vendor=Vendor Manager
+admin.vendor.processVendorOrder_nav=Process Vendor Orders
+admin.vendor.processvendororder.processOption.cost=Cost
+admin.vendor.processvendororder.processOption.quantity=Quantity
admin.vendor.vendorordertabs.items=Order Items
admin.vendor.vendorordertabs.products=Products
admin.vendor.vendorordertabs.stockreceivers=Stock Receivers
@@ -210,6 +217,10 @@ admin.vendor.vendortabs.vendorbrands=Brands
admin.vendor.vendortabs.vendororders=Orders
admin.vendor_nav=Vendors
admin.warehouse=Warehouse Manager
+admin.warehouse.processStockAdjustment_actions=Process Stock Adjustment
+admin.warehouse.processStockAdjustment_nav=Add Stock Adjustment Items
+admin.warehouse.processstockadjustment.processOption.quantity=Quantity
+admin.warehouse.stockadjustments.products=Products
admin.warehouse_nav=Warehouse
defaultMessage_Boolean={1} must be a valid boolean.
defaultMessage_CollectionSize_Between={1} size is not between {2} and {3}.
@@ -304,6 +315,7 @@ define.autoIncrement=Auto Increment
define.backtolist=Back To List
define.both=Both
define.cancel=Cancel
+define.cart=Cart
define.comments=Comments
define.confirm=Confirm
define.contentAccess=Content Access
@@ -378,6 +390,7 @@ entity.CreditCardTransaction.providerTransactionID=Provider Transaction ID
entity.CreditCardTransaction.statusCode=Status Code
entity.CreditCardTransaction.transactionType=Transaction Type
entity.CreditCardTransaction_plural=Credit Card Transactions
+entity.Option_plural=Options
entity.Order.fulfillmentTotal=Delivery Charges
entity.Order.fulfillmenttotal=Fulfillment Amount
entity.Order.orderTota=Order Total
@@ -439,6 +452,9 @@ entity.ShippingMethodRate.shippingintegrationmethod=Service Provider Method
entity.ShippingMethod_plural=Shipping Methods
entity.Sku.priceGroupRates=Price Group Rates
entity.StockAdjustment.stockAdjustmentType=Type
+entity.StockAdjustmentItem_plural=Stock Adjustment Items
+entity.StockReceiverVendorOrder_plural=Stock Receivers
+entity.SubscriptionTerm.autoPayFlag=Auto Pay
entity.Task.TaskUrl=Task URL
entity.Task.nextRunDateTime=Next Run
entity.Task.notificationEmails=Notification Emails
@@ -463,6 +479,8 @@ entity.UpdatePrice=Price
entity.Vendor.brands=Brands Offered
entity.Vendor.emailAddress=Email Address
entity.VendorEmailAddress.emailAddress=Email Address
+entity.VendorOrderItem=Order Item
+entity.VendorOrderItem_plural=Order Items
entity.account=Account
entity.account.accountEmails=Account Emails
entity.account.accountID=Account ID
@@ -885,6 +903,8 @@ entity.product.shippingWeight=Shipping Weight
entity.product.shippingWeightUnitCode=Shipping Weight Unit of Measurement
entity.product.shippingWeight_hint=Weight (in lbs) to be used to calculate shipping charges.
entity.product.skus=skus
+entity.product.subscriptionbenifitsrequired=Subscription Benefits are Required
+entity.product.subscriptiontermsrequired=Subscription Terms are Required
entity.product.template=Design Template
entity.product.title=Product Title
entity.product.trackinventoryflag=Track Inventory
@@ -1102,6 +1122,7 @@ entity.stockadjustment.stockAdjustmentItems=stockAdjustmentItems
entity.stockadjustment.toLocation=To Location
entity.stockadjustment.type=Type
entity.stockadjustment_plural=Stock Adjustments
+entity.stockadjustmentitem=Stock Adjustment Items
entity.stockadjustmentitem.adjustmentQuantity=Adjustment Qty.
entity.stockadjustmentitem.newQuantity=New Qty.
entity.stockadjustmentitem.stock=Stock
@@ -1121,8 +1142,8 @@ entity.subscriptionBenefit.priceGroups=Price Groups
entity.subscriptionBenefit.promotions=Promotions
entity.subscriptionBenefit.subscriptionBenefitName=Subscription Benefit Name
entity.subscriptionTerm.allowProrateFlag=Allow Prorate
-entity.subscriptionTerm.autoRenewFlag=Auto Renew
entity.subscriptionTerm.autoPayFlag=Auto Pay
+entity.subscriptionTerm.autoRenewFlag=Auto Renew
entity.subscriptionTerm.autoRetryPaymentDays=Auto Retry After Days
entity.subscriptionTerm.billedOnDayOfMonth=Bill On Day of Month
entity.subscriptionTerm.gracePeriodTerm=Grace Period Term
@@ -1133,8 +1154,8 @@ entity.subscriptionTerm.subscriptionTermName=Subscription Term Name
entity.subscriptionUsage=Subscription Usage
entity.subscriptionUsage.accountPaymentMethod=Account Payment Method
entity.subscriptionUsage.allowProrateFlag=Allow Prorate
-entity.subscriptionUsage.autoRenewFlag=Auto Renew
entity.subscriptionUsage.autoPayFlag=Auto Pay
+entity.subscriptionUsage.autoRenewFlag=Auto Renew
entity.subscriptionUsage.currentStatusType=Current Status
entity.subscriptionUsage.expirationDate=Expiration Date
entity.subscriptionUsage.nextBillDate=Next Bill Date
@@ -1587,32 +1608,3 @@ validator.uppercase={objectValue} must be upper case.
validator.url={objectValue} is an invalid URL.
validator.uuid={objectValue} is an invalid UUID.
validator.zipCode={objectValue} is an invalid zip code.
-entity.Option_plural=Options
-entity.UpdatePrice=Price
-admin.product.updatePrice_nav=Update Price
-admin.product.skutabs.priceGroups=Price Groups
-admin.product.SelectPricegroupRate_nav=Select Price Group
-admin.product.processproduct_nav=Update Price
-admin.product.processproduct.processOption.skuPrice=New Price
-entity.Sku.priceGroupRates=Price Group Rates
-entity.PriceGroupRate.DisplayName=Name
-admin.product.skutabs.options=Options
-admin.product.processoptiongroup_nav=Add Option Group
-admin.product.processoption_nav=Add Option
-admin.product.processproduct.processOption.optionGroup=Option Group
-admin.product.processproduct.processOption.option=Option
-entity.VendorOrderItem_plural=Order Items
-entity.StockReceiverVendorOrder_plural=Stock Receivers
-admin.warehouse.stockadjustments.products=Products
-entity.VendorOrderItem=Order Item
-entity.product.subscriptiontermsrequired=Subscription Terms are Required
-entity.product.subscriptionbenifitsrequired=Subscription Benefits are Required
-entity.SubscriptionTerm.autoPayFlag=Auto Pay
-admin.vendor.processvendororder.processOption.quantity=Quantity
-admin.vendor.processvendororder.processOption.cost=Cost
-admin.vendor.processVendorOrder_nav=Process Vendor Orders
-entity.StockAdjustmentItem_plural=Stock Adjustment Items
-admin.warehouse.processStockAdjustment_nav=Add Stock Adjustment Items
-admin.warehouse.processstockadjustment.processOption.quantity=Quantity
-entity.stockadjustmentitem=Stock Adjustment Items
-admin.warehouse.processStockAdjustment_actions=Process Stock Adjustment

0 comments on commit 8c73913

Please sign in to comment.
Something went wrong with that request. Please try again.