erp_products 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/GPL-3-LICENSE +674 -0
- data/README.rdoc +2 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/erp_products/application.js +9 -0
- data/app/assets/stylesheets/erp_products/application.css +7 -0
- data/app/controllers/erp_products/erp_app/desktop/product_manager/base_controller.rb +233 -0
- data/app/helpers/erp_products/application_helper.rb +4 -0
- data/app/models/prod_availability_status_type.rb +5 -0
- data/app/models/prod_instance_reln.rb +14 -0
- data/app/models/prod_instance_reln_type.rb +4 -0
- data/app/models/prod_instance_role_type.rb +4 -0
- data/app/models/prod_type_reln.rb +15 -0
- data/app/models/prod_type_reln_type.rb +4 -0
- data/app/models/prod_type_role_type.rb +4 -0
- data/app/models/product_instance.rb +21 -0
- data/app/models/product_offer.rb +11 -0
- data/app/models/product_package.rb +7 -0
- data/app/models/product_type.rb +37 -0
- data/app/models/simple_product_offer.rb +4 -0
- data/app/views/layouts/erp_products/application.html.erb +14 -0
- data/config/routes.rb +4 -0
- data/db/data_migrations/20110324010232_product_role_types.rb +23 -0
- data/db/data_migrations/20110527160807_add_default_prod_avail_types.rb +26 -0
- data/db/data_migrations/20110728201730_create_desktop_app_product_manager.rb +25 -0
- data/db/migrate/20080805000040_base_products.rb +232 -0
- data/db/migrate/20080805000041_base_products_indexes.rb +58 -0
- data/lib/erp_products/engine.rb +16 -0
- data/lib/erp_products/extensions/active_record/acts_as_product_instance.rb +50 -0
- data/lib/erp_products/extensions/active_record/acts_as_product_offer.rb +52 -0
- data/lib/erp_products/extensions/active_record/acts_as_product_type.rb +59 -0
- data/lib/erp_products/extensions.rb +3 -0
- data/lib/erp_products/version.rb +3 -0
- data/lib/erp_products.rb +5 -0
- data/lib/tasks/erp_products_tasks.rake +4 -0
- data/public/javascripts/erp_app/desktop/applications/product_manager/module.js +799 -0
- data/public/javascripts/erp_app/desktop/applications/product_manager/product_list_panel.js +141 -0
- data/public/stylesheets/erp_app/desktop/applications/product_manager/style.css +71 -0
- metadata +119 -0
@@ -0,0 +1,141 @@
|
|
1
|
+
Ext.define("Compass.ErpApp.Desktop.Applications.ProductManager.ProductsPanel",{
|
2
|
+
extend:"Ext.panel.Panel",
|
3
|
+
alias:'widget.productmanagement_productspanel',
|
4
|
+
loadProducts : function(){
|
5
|
+
this.productsDataView.getStore().load();
|
6
|
+
},
|
7
|
+
|
8
|
+
deleteProduct : function(id){
|
9
|
+
var self = this;
|
10
|
+
Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete this product?', function(btn){
|
11
|
+
if(btn == 'no'){
|
12
|
+
return false;
|
13
|
+
}
|
14
|
+
else
|
15
|
+
{
|
16
|
+
var conn = new Ext.data.Connection();
|
17
|
+
conn.request({
|
18
|
+
url: '/erp_products/erp_app/desktop/product_manager/delete/'+id,
|
19
|
+
success: function(response) {
|
20
|
+
var obj = Ext.decode(response.responseText);
|
21
|
+
if(obj.success){
|
22
|
+
self.productsDataView.getStore().load();
|
23
|
+
}
|
24
|
+
else{
|
25
|
+
Ext.Msg.alert('Error', 'Error deleting product.');
|
26
|
+
}
|
27
|
+
},
|
28
|
+
failure: function(response) {
|
29
|
+
Ext.Msg.alert('Error', 'Error deleting product.');
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}
|
33
|
+
});
|
34
|
+
},
|
35
|
+
|
36
|
+
initComponent: function() {
|
37
|
+
Compass.ErpApp.Desktop.Applications.ProductManager.ProductsPanel.superclass.initComponent.call(this, arguments);
|
38
|
+
},
|
39
|
+
|
40
|
+
constructor : function(config) {
|
41
|
+
var self = this;
|
42
|
+
|
43
|
+
this.productsDataView = Ext.create("Ext.view.View",{
|
44
|
+
autoDestroy:true,
|
45
|
+
itemSelector: 'tr.product-wrap',
|
46
|
+
style:'overflow:auto',
|
47
|
+
store: Ext.create("Ext.data.Store",{
|
48
|
+
autoLoad: true,
|
49
|
+
proxy:{
|
50
|
+
type:'ajax',
|
51
|
+
url: '/erp_products/erp_app/desktop/product_manager/',
|
52
|
+
reader:{
|
53
|
+
root: 'products',
|
54
|
+
type:'json'
|
55
|
+
}
|
56
|
+
},
|
57
|
+
fields:['imageUrl', 'id', 'title', 'available', 'sold','price','sku']
|
58
|
+
}),
|
59
|
+
tpl: new Ext.XTemplate(
|
60
|
+
'<table id="products-view">',
|
61
|
+
'<thead>',
|
62
|
+
'<tr>',
|
63
|
+
'<td>Product</td>',
|
64
|
+
'<td># Available</td>',
|
65
|
+
'<td># Sold</td>',
|
66
|
+
'</tr>',
|
67
|
+
'</thead>',
|
68
|
+
'<tbody>',
|
69
|
+
'<tpl for=".">',
|
70
|
+
'<tr class="product-wrap" style="cursor:pointer;">',
|
71
|
+
'<td>',
|
72
|
+
'<div><img src="{imageUrl}" /></div>',
|
73
|
+
'<div>',
|
74
|
+
'<span>{title}</span><br/>',
|
75
|
+
'<span>{price}</span><br/>',
|
76
|
+
'<span>SKU # {sku}</span>',
|
77
|
+
'</div>',
|
78
|
+
'</td>',
|
79
|
+
'<td>{available}</td>',
|
80
|
+
'<td>{sold}</td>',
|
81
|
+
'</tr>',
|
82
|
+
'</tpl>',
|
83
|
+
'</tbody>',
|
84
|
+
'</table>'
|
85
|
+
),
|
86
|
+
listeners:{
|
87
|
+
'itemcontextmenu':function(view, record, htmlitem, index, e, options){
|
88
|
+
e.stopEvent();
|
89
|
+
var contextMenu = Ext.create("Ext.menu.Menu",{
|
90
|
+
items:[
|
91
|
+
{
|
92
|
+
text:'Delete',
|
93
|
+
iconCls:'icon-delete',
|
94
|
+
handler:function(btn){
|
95
|
+
var id = self.productsDataView.getStore().getAt(index).get('id');
|
96
|
+
self.deleteProduct(id);
|
97
|
+
}
|
98
|
+
}
|
99
|
+
]
|
100
|
+
});
|
101
|
+
contextMenu.showAt(e.xy);
|
102
|
+
},
|
103
|
+
'itemclick':function(view, record, htmlitem, index, e, options){
|
104
|
+
e.stopEvent();
|
105
|
+
var id = self.productsDataView.getStore().getAt(index).get('id');
|
106
|
+
var win = Ext.create("Compass.ErpApp.Desktop.Applications.ProductManager.UpdateProductWindow",{
|
107
|
+
productTypeId:id
|
108
|
+
});
|
109
|
+
win.show();
|
110
|
+
}
|
111
|
+
}
|
112
|
+
});
|
113
|
+
|
114
|
+
config = Ext.apply({
|
115
|
+
id:'productListPanel',
|
116
|
+
border:false,
|
117
|
+
autoDestroy:true,
|
118
|
+
margins: '5 5 5 0',
|
119
|
+
autoScroll:true,
|
120
|
+
layout:'fit',
|
121
|
+
items:[this.productsDataView],
|
122
|
+
tbar:{
|
123
|
+
items:[
|
124
|
+
{
|
125
|
+
text:'Add Product',
|
126
|
+
iconCls:'icon-add',
|
127
|
+
handler:function(btn){
|
128
|
+
var window = Ext.create("Compass.ErpApp.Desktop.Applications.ProductManager.AddProductWindow",{
|
129
|
+
productListPanel:self
|
130
|
+
});
|
131
|
+
window.show();
|
132
|
+
}
|
133
|
+
}
|
134
|
+
]
|
135
|
+
}
|
136
|
+
}, config);
|
137
|
+
|
138
|
+
Compass.ErpApp.Desktop.Applications.ProductManager.ProductsPanel.superclass.constructor.call(this, config);
|
139
|
+
}
|
140
|
+
|
141
|
+
});
|
@@ -0,0 +1,71 @@
|
|
1
|
+
#products-view {
|
2
|
+
font-family:'Lucida Grande','Lucida Sans Unicode',sans-serif;
|
3
|
+
text-align:center;
|
4
|
+
font-size:14px;
|
5
|
+
width:100%;
|
6
|
+
border-collapse: collapse;
|
7
|
+
}
|
8
|
+
|
9
|
+
#products-view a {
|
10
|
+
text-decoration:none;
|
11
|
+
}
|
12
|
+
|
13
|
+
#products-view img {
|
14
|
+
height:60px;
|
15
|
+
width:65px;
|
16
|
+
padding-right:15px;
|
17
|
+
}
|
18
|
+
|
19
|
+
#products-view div
|
20
|
+
{
|
21
|
+
float:left;
|
22
|
+
text-align:left;
|
23
|
+
}
|
24
|
+
|
25
|
+
#products-view th {
|
26
|
+
padding: 0 0.5em;
|
27
|
+
}
|
28
|
+
|
29
|
+
#products-view thead td{
|
30
|
+
background-color:#EEE;
|
31
|
+
}
|
32
|
+
|
33
|
+
#products-view td
|
34
|
+
{
|
35
|
+
border-bottom:solid 2px #CCC;
|
36
|
+
}
|
37
|
+
|
38
|
+
#products-view tr:hover
|
39
|
+
{
|
40
|
+
background-color:#FFFFEE;
|
41
|
+
}
|
42
|
+
|
43
|
+
#products-view td+td {
|
44
|
+
border-left: 1px solid #CCC;
|
45
|
+
text-align: center;
|
46
|
+
}
|
47
|
+
|
48
|
+
#product-image-assets .thumb img {
|
49
|
+
border: 1px solid white;
|
50
|
+
height: 60px;
|
51
|
+
width: 90px;
|
52
|
+
}
|
53
|
+
|
54
|
+
#product-image-assets .thumb-wrap {
|
55
|
+
float: left;
|
56
|
+
margin: 4px 0 4px 4px;
|
57
|
+
padding: 5px;
|
58
|
+
cursor: pointer;
|
59
|
+
}
|
60
|
+
|
61
|
+
#product-image-assets .thumb {
|
62
|
+
background: none repeat scroll 0 0 #DDDDDD;
|
63
|
+
padding: 3px;
|
64
|
+
}
|
65
|
+
|
66
|
+
#product-images-assets .thumb-wrap span {
|
67
|
+
display: block;
|
68
|
+
overflow: hidden;
|
69
|
+
text-align: center;
|
70
|
+
width: 80px;
|
71
|
+
}
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: erp_products
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rick Koloski, Russell Holmes
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-01-06 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: erp_app
|
16
|
+
requirement: &2161006380 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2161006380
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: erp_agreements
|
27
|
+
requirement: &2161005800 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2161005800
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: erp_dev_svcs
|
38
|
+
requirement: &2161005120 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2161005120
|
47
|
+
description: ! 'The Products Engine implements ProductType and ProductInstance, as
|
48
|
+
well as a number of classes to support product catalog-type functions and search/shopping
|
49
|
+
scenarios. '
|
50
|
+
email:
|
51
|
+
- russonrails@gmail.com
|
52
|
+
executables: []
|
53
|
+
extensions: []
|
54
|
+
extra_rdoc_files: []
|
55
|
+
files:
|
56
|
+
- public/javascripts/erp_app/desktop/applications/product_manager/module.js
|
57
|
+
- public/javascripts/erp_app/desktop/applications/product_manager/product_list_panel.js
|
58
|
+
- public/stylesheets/erp_app/desktop/applications/product_manager/style.css
|
59
|
+
- app/assets/javascripts/erp_products/application.js
|
60
|
+
- app/assets/stylesheets/erp_products/application.css
|
61
|
+
- app/controllers/erp_products/erp_app/desktop/product_manager/base_controller.rb
|
62
|
+
- app/helpers/erp_products/application_helper.rb
|
63
|
+
- app/models/prod_availability_status_type.rb
|
64
|
+
- app/models/prod_instance_reln.rb
|
65
|
+
- app/models/prod_instance_reln_type.rb
|
66
|
+
- app/models/prod_instance_role_type.rb
|
67
|
+
- app/models/prod_type_reln.rb
|
68
|
+
- app/models/prod_type_reln_type.rb
|
69
|
+
- app/models/prod_type_role_type.rb
|
70
|
+
- app/models/product_instance.rb
|
71
|
+
- app/models/product_offer.rb
|
72
|
+
- app/models/product_package.rb
|
73
|
+
- app/models/product_type.rb
|
74
|
+
- app/models/simple_product_offer.rb
|
75
|
+
- app/views/layouts/erp_products/application.html.erb
|
76
|
+
- config/routes.rb
|
77
|
+
- db/data_migrations/20110324010232_product_role_types.rb
|
78
|
+
- db/data_migrations/20110527160807_add_default_prod_avail_types.rb
|
79
|
+
- db/data_migrations/20110728201730_create_desktop_app_product_manager.rb
|
80
|
+
- db/migrate/20080805000040_base_products.rb
|
81
|
+
- db/migrate/20080805000041_base_products_indexes.rb
|
82
|
+
- lib/erp_products/engine.rb
|
83
|
+
- lib/erp_products/extensions/active_record/acts_as_product_instance.rb
|
84
|
+
- lib/erp_products/extensions/active_record/acts_as_product_offer.rb
|
85
|
+
- lib/erp_products/extensions/active_record/acts_as_product_type.rb
|
86
|
+
- lib/erp_products/extensions.rb
|
87
|
+
- lib/erp_products/version.rb
|
88
|
+
- lib/erp_products.rb
|
89
|
+
- lib/tasks/erp_products_tasks.rake
|
90
|
+
- GPL-3-LICENSE
|
91
|
+
- Rakefile
|
92
|
+
- README.rdoc
|
93
|
+
homepage: http://development.compassagile.com
|
94
|
+
licenses: []
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 1.8.10
|
114
|
+
signing_key:
|
115
|
+
specification_version: 3
|
116
|
+
summary: The Products Engine implements ProductType and ProductInstance, as well as
|
117
|
+
a number of classes to support product catalog-type functions and search/shopping
|
118
|
+
scenarios.
|
119
|
+
test_files: []
|