added selling-home
This commit is contained in:
parent
3f29b85f5d
commit
09a897afe4
@ -234,10 +234,15 @@ div.std-footer-item {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.layout-wrapper-background {
|
||||
background-color: #f2f2f2 !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.layout-main-section {
|
||||
width: 68%;
|
||||
float: left;
|
||||
padding: 13px;
|
||||
padding: 15px;
|
||||
background-color: #FFF;
|
||||
min-height: 450px;
|
||||
}
|
||||
@ -245,10 +250,9 @@ div.std-footer-item {
|
||||
.layout-side-section {
|
||||
width: 24%;
|
||||
float: right;
|
||||
margin-right: 15px;
|
||||
color: #606060;
|
||||
overflow-x: hidden;
|
||||
padding: 13px;
|
||||
padding: 15px;
|
||||
min-height: 450px;
|
||||
}
|
||||
|
||||
@ -1619,46 +1623,39 @@ ul.box_tabs li.box_tab_selected a {
|
||||
|
||||
/*
|
||||
* lib/css/legacy/sidebar.css
|
||||
*/div.psidebar-wrapper {
|
||||
margin: 0px 8px;
|
||||
*/div.psidebar {
|
||||
}
|
||||
|
||||
div.psidebar-head {
|
||||
div.psidebar div.head {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
div.psidebar-section {
|
||||
div.psidebar div.section {
|
||||
margin-bottom: 11px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.psidebar-section-head {
|
||||
div.psidebar div.section-head {
|
||||
font-size: 12px;
|
||||
padding: 5px 11px;
|
||||
border-bottom: 2px solid #444;
|
||||
}
|
||||
|
||||
div.psidebar-section-body {
|
||||
div.psidebar div.section-body {
|
||||
margin: 7px 11px 11px 11px;
|
||||
}
|
||||
|
||||
div.psidebar-section-item {
|
||||
div.psidebar div.section-item {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
|
||||
.psidebar-section-link {
|
||||
div.psidebar .section-link {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
div.follower-list {
|
||||
color: #666;
|
||||
margin-top: 7px;
|
||||
font-size: 11px;
|
||||
}
|
||||
/*
|
||||
* lib/css/bootstrap/bootstrap-buttons.css
|
||||
*/.btn.danger,
|
||||
|
@ -234,10 +234,15 @@ div.std-footer-item {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.layout-wrapper-background {
|
||||
background-color: #f2f2f2 !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.layout-main-section {
|
||||
width: 68%;
|
||||
float: left;
|
||||
padding: 13px;
|
||||
padding: 15px;
|
||||
background-color: #FFF;
|
||||
min-height: 450px;
|
||||
}
|
||||
@ -245,10 +250,9 @@ div.std-footer-item {
|
||||
.layout-side-section {
|
||||
width: 24%;
|
||||
float: right;
|
||||
margin-right: 15px;
|
||||
color: #606060;
|
||||
overflow-x: hidden;
|
||||
padding: 13px;
|
||||
padding: 15px;
|
||||
min-height: 450px;
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,7 @@ pscript.home_make_body = function() {
|
||||
var wrapper = page_body.pages['Event Updates'];
|
||||
|
||||
// body
|
||||
$(wrapper).addClass('layout-wrapper')
|
||||
.css('background-color', wn.sidebar_background).css('padding', '0px');
|
||||
wrapper.style.backgroud
|
||||
$(wrapper).addClass('layout-wrapper').addClass('layout-wrapper-background')
|
||||
|
||||
wrapper.body = $a(wrapper, 'div', 'layout-main-section');
|
||||
wrapper.head = $a(wrapper.body, 'div');
|
||||
|
@ -5,164 +5,84 @@
|
||||
{
|
||||
'creation': '2010-08-08 17:08:54',
|
||||
'docstatus': 0,
|
||||
'modified': '2010-09-20 14:06:57',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
'modified': '2012-02-20 18:06:32',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': u'1326102553',
|
||||
'allow_trash': 1,
|
||||
'autoname': 'field:campaign_name',
|
||||
'colour': 'White:FFF',
|
||||
'autoname': u'field:campaign_name',
|
||||
'colour': u'White:FFF',
|
||||
'default_print_format': u'Standard',
|
||||
'doctype': 'DocType',
|
||||
'document_type': 'Master',
|
||||
'module': 'Selling',
|
||||
'document_type': u'Master',
|
||||
'module': u'Selling',
|
||||
'name': '__common__',
|
||||
'section_style': 'Simple',
|
||||
'server_code_error': ' ',
|
||||
'section_style': u'Simple',
|
||||
'server_code_error': u' ',
|
||||
'show_in_menu': 0,
|
||||
'version': 6
|
||||
'version': 7
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': 'Campaign',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType'
|
||||
},
|
||||
|
||||
# These values are common for all DocPerm
|
||||
{
|
||||
'amend': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': 'Campaign',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'read': 1,
|
||||
'submit': 0
|
||||
'parent': u'Campaign',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
|
||||
# DocType, Campaign
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': 'Campaign'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 1,
|
||||
'permlevel': 1,
|
||||
'role': 'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 2,
|
||||
'permlevel': 0,
|
||||
'role': 'Sales Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 3,
|
||||
'permlevel': 1,
|
||||
'role': 'Sales Master Manager',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 4,
|
||||
'permlevel': 1,
|
||||
'role': 'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 0,
|
||||
'create': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 5,
|
||||
'permlevel': 0,
|
||||
'role': 'Sales User',
|
||||
'write': 0
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
{
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'doctype': 'DocPerm',
|
||||
'idx': 6,
|
||||
'permlevel': 0,
|
||||
'role': 'Sales Master Manager',
|
||||
'write': 1
|
||||
'name': u'Campaign'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'trash_reason',
|
||||
'fieldtype': 'Small Text',
|
||||
'idx': 1,
|
||||
'label': 'Trash Reason',
|
||||
'oldfieldname': 'trash_reason',
|
||||
'oldfieldtype': 'Small Text',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'trash_reason',
|
||||
'fieldtype': u'Small Text',
|
||||
'label': u'Trash Reason',
|
||||
'oldfieldname': u'trash_reason',
|
||||
'oldfieldtype': u'Small Text',
|
||||
'permlevel': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'idx': 2,
|
||||
'label': 'Campaign',
|
||||
'oldfieldtype': 'Section Break',
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Campaign',
|
||||
'oldfieldtype': u'Section Break',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'campaign_name',
|
||||
'fieldtype': 'Data',
|
||||
'idx': 3,
|
||||
'label': 'Campaign Name',
|
||||
'oldfieldname': 'campaign_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'campaign_name',
|
||||
'fieldtype': u'Data',
|
||||
'label': u'Campaign Name',
|
||||
'oldfieldname': u'campaign_name',
|
||||
'oldfieldtype': u'Data',
|
||||
'permlevel': 0,
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'description',
|
||||
'fieldtype': 'Text',
|
||||
'idx': 4,
|
||||
'label': 'Description',
|
||||
'oldfieldname': 'description',
|
||||
'oldfieldtype': 'Text',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'description',
|
||||
'fieldtype': u'Text',
|
||||
'label': u'Description',
|
||||
'oldfieldname': u'description',
|
||||
'oldfieldtype': u'Text',
|
||||
'permlevel': 0,
|
||||
'width': '300px'
|
||||
'width': u'300px'
|
||||
}
|
||||
]
|
12
erpnext/selling/page/selling_home/__init__.py
Normal file
12
erpnext/selling/page/selling_home/__init__.py
Normal file
@ -0,0 +1,12 @@
|
||||
import webnotes
|
||||
|
||||
@webnotes.whitelist()
|
||||
def get_report_list(arg=None):
|
||||
"""return list of reports for this module"""
|
||||
webnotes.response['values'] = webnotes.conn.sql("""select
|
||||
distinct criteria_name, doc_type, parent_doc_type
|
||||
from `tabSearch Criteria`
|
||||
where module='Selling'
|
||||
and docstatus in (0, NULL)
|
||||
order by criteria_name
|
||||
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)
|
65
erpnext/selling/page/selling_home/selling_home.html
Normal file
65
erpnext/selling/page/selling_home/selling_home.html
Normal file
@ -0,0 +1,65 @@
|
||||
<div class="layout-wrapper layout-wrapper-background" id="page-selling-home">
|
||||
<div class="layout-main-section">
|
||||
<h1>Selling</h1>
|
||||
<hr>
|
||||
<div style="width: 48%; float: left;">
|
||||
<h4><a href="#!List/Lead">Lead</a></h4>
|
||||
<p class="help">Prospective customers</p>
|
||||
<h4><a href="#!List/Enquiry">Enquiry</a></h4>
|
||||
<p class="help">Business opportunities</p>
|
||||
<h4><a href="#!List/Quotation">Quotation</a></h4>
|
||||
<p class="help">Quotes sent to Leads / Customers</p>
|
||||
<h4><a href="#!List/Sales Order">Sales Order</a></h4>
|
||||
<p class="help">Confirmed orders from Customers</p>
|
||||
</div>
|
||||
<div style="width: 48%; float: right;">
|
||||
<h4><a href="#!List/Customer">Customer</a></h4>
|
||||
<p class="help">Customer Master</p>
|
||||
<h4><a href="#!List/Item">Item</a></h4>
|
||||
<p class="help">Item Master</p>
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
<hr>
|
||||
<h3>Reports</h3>
|
||||
<div class="reports-list"></div>
|
||||
</div>
|
||||
<div class="layout-side-section">
|
||||
<div class="psidebar">
|
||||
<div class="section">
|
||||
<div class="section-head">Setup</div>
|
||||
<div class="section-body">
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Price List">Price List</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Sales BOM">Sales BOM</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Customer Group">Customer Group</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Territory">Territory</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Sales Person">Sales Person</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Sales Partner">Sales Partner</a>
|
||||
</div>
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!List/Campaign">Campaign</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="section-head">Tools</div>
|
||||
<div class="section-body">
|
||||
<div class="section-item">
|
||||
<a class="section-link" href="#!Sales Dashboard">Sales Dashboard</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
40
erpnext/selling/page/selling_home/selling_home.js
Normal file
40
erpnext/selling/page/selling_home/selling_home.js
Normal file
@ -0,0 +1,40 @@
|
||||
pscript['onload_selling-home'] = function(wrapper) {
|
||||
erpnext.module_page.hide_links(wrapper);
|
||||
erpnext.module_page.make_list('Selling', wrapper);
|
||||
}
|
||||
|
||||
wn.provide('erpnext.module_page');
|
||||
|
||||
// hide list links where the user does
|
||||
// not have read permissions
|
||||
|
||||
erpnext.module_page.hide_links = function(wrapper) {
|
||||
$(wrapper).find('[href*="List/"]').each(function() {
|
||||
var href = $(this).attr('href');
|
||||
var dt = href.split('/')[1];
|
||||
if(wn.boot.profile.can_read.indexOf(dt)==-1) {
|
||||
$(this).toggle(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// make list of reports
|
||||
|
||||
erpnext.module_page.make_list = function(module, wrapper) {
|
||||
// make project listing
|
||||
wrapper.list = new wn.widgets.Listing({
|
||||
parent: $(wrapper).find('.reports-list').get(0),
|
||||
method: 'selling.page.selling_home.get_report_list',
|
||||
render_row: function(row, data) {
|
||||
if(!data.parent_doc_type) data.parent_doc_type = data.doc_type;
|
||||
$(row).html(repl('<a href="#!Report/%(doc_type)s/%(criteria_name)s" \
|
||||
data-doctype="%(parent_doc_type)s">\
|
||||
%(criteria_name)s</a>', data))
|
||||
},
|
||||
args: {
|
||||
module: module
|
||||
},
|
||||
no_refresh: true
|
||||
});
|
||||
wrapper.list.run();
|
||||
}
|
43
erpnext/selling/page/selling_home/selling_home.txt
Normal file
43
erpnext/selling/page/selling_home/selling_home.txt
Normal file
@ -0,0 +1,43 @@
|
||||
# Page, selling-home
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-02-20 15:46:39',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-02-20 15:46:57',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Page
|
||||
{
|
||||
'doctype': 'Page',
|
||||
'module': u'Selling',
|
||||
'name': '__common__',
|
||||
'page_name': u'selling-home',
|
||||
'standard': u'Yes',
|
||||
'title': u'Selling Home'
|
||||
},
|
||||
|
||||
# These values are common for all Page Role
|
||||
{
|
||||
'doctype': u'Page Role',
|
||||
'name': '__common__',
|
||||
'parent': u'selling-home',
|
||||
'parentfield': u'roles',
|
||||
'parenttype': u'Page',
|
||||
'role': u'All'
|
||||
},
|
||||
|
||||
# Page, selling-home
|
||||
{
|
||||
'doctype': 'Page',
|
||||
'name': u'selling-home'
|
||||
},
|
||||
|
||||
# Page Role
|
||||
{
|
||||
'doctype': u'Page Role'
|
||||
}
|
||||
]
|
@ -861,7 +861,7 @@ Listing.prototype.std_cell=function(cell,ri,ci,d){var has_headrow=this.colnames?
|
||||
*/
|
||||
wn.widgets.Listing=function(opts){this.opts=opts;this.page_length=20;this.btns={};this.start=0;var me=this;this.make=function(opts){this.wrapper=$a(this.opts.parent,'div');this.filters_area=$a(this.wrapper,'div','listing-filters');this.toolbar_area=$a(this.wrapper,'div','listing-toolbar');this.results_area=$a(this.wrapper,'div','listing-results');this.more_button_area=$a(this.wrapper,'div','listing-more');this.no_results_area=$a(this.wrapper,'div','help_box',{display:'none'},(this.opts.no_result_message?this.opts.no_result_message:'No results'));if(opts)this.opts=opts;this.page_length=this.opts.page_length?this.opts.page_length:this.page_length;this.make_toolbar();this.make_filters();this.make_more_button();}
|
||||
this.make_filters=function(){if(this.opts.filters){$ds(this.filters_area);this.filters=new wn.widgets.FieldGroup(this.filters_area,this.opts.fields);}}
|
||||
this.make_toolbar=function(){if(!this.opts.hide_refresh){this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.loading_img=$a(this.toolbar_area,'img','lib/images/ui/button-load.gif',{display:'none',marginLeft:'3px',marginBottom:'-2px'});}
|
||||
if(this.opts.new_doctype){this.new_btn=$btn(this.toolbar_area,'New '+get_doctype_label(this.opts.new_doctype),function(){newdoc(me.opts.new_doctype,me.opts.new_doc_onload,me.opts.new_doc_indialog,me.opts.new_doc_onsave);},{marginLeft:'7px'});}}
|
||||
this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
|
||||
@ -873,8 +873,9 @@ if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
|
||||
this.add_row=function(){return $a(this.results_area,'div','',(opts.cell_style?opts.cell_style:{padding:'3px 0px'}));}
|
||||
this.run=function(callback,append){if(callback)
|
||||
this.onrun=callback;if(!append)
|
||||
this.start=0;this.query=this.opts.get_query?this.opts.get_query():this.opts.query;this.add_limits();args={query_max:this.query_max||this.opts.query_max||''}
|
||||
args.simple_query=this.query;args.as_dict=1;if(this.loading_img)$di(this.loading_img);wn.call({method:'webnotes.widgets.query_builder.runquery',args:args,callback:function(r,rt){me.make_results(r,rt)},no_spinner:this.opts.no_loading,btn:this.opts.run_btn});}
|
||||
this.start=0;if(!this.opts.method){this.query=this.opts.get_query?this.opts.get_query():this.opts.query;this.add_limits();var args={query_max:this.query_max||this.opts.query_max||'',as_dict:1}
|
||||
args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
|
||||
if(this.loading_img)$di(this.loading_img);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:args,callback:function(r,rt){me.make_results(r,rt)},no_spinner:this.opts.no_loading,btn:this.opts.run_btn});}
|
||||
this.refresh=this.run;this.add_limits=function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}
|
||||
if(opts)this.make();}
|
||||
/*
|
||||
@ -1161,21 +1162,21 @@ $c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(
|
||||
/*
|
||||
* lib/js/legacy/wn/page_layout.js
|
||||
*/
|
||||
wn.sidebar_background='#f2f2f2';wn.PageLayout=function(args){$.extend(this,args)
|
||||
this.wrapper=$a(this.parent,'div','layout-wrapper',{backgroundColor:wn.sidebar_background,padding:'0px'});this.main=$a(this.wrapper,'div','layout-main-section');this.sidebar_area=$a(this.wrapper,'div','layout-side-section');$a(this.wrapper,'div','',{clear:'both'});this.head=$a(this.main,'div');this.toolbar_area=$a(this.main,'div');this.body=$a(this.main,'div');this.footer=$a(this.main,'div');if(this.heading){this.page_head=new PageHeader(this.head,this.heading);}}
|
||||
wn.PageLayout=function(args){$.extend(this,args)
|
||||
this.wrapper=$a(this.parent,'div','layout-wrapper layout-wrapper-background');this.main=$a(this.wrapper,'div','layout-main-section');this.sidebar_area=$a(this.wrapper,'div','layout-side-section');$a(this.wrapper,'div','',{clear:'both'});this.head=$a(this.main,'div');this.toolbar_area=$a(this.main,'div');this.body=$a(this.main,'div');this.footer=$a(this.main,'div');if(this.heading){this.page_head=new PageHeader(this.head,this.heading);}}
|
||||
/*
|
||||
* lib/js/legacy/wn/widgets/page_sidebar.js
|
||||
*/
|
||||
wn.widgets.PageSidebar=function(parent,opts){this.opts=opts
|
||||
this.sections={}
|
||||
this.wrapper=$a(parent,'div','psidebar-wrapper')
|
||||
this.wrapper=$a(parent,'div','psidebar')
|
||||
this.refresh=function(){this.wrapper.innerHTML=''
|
||||
if(this.opts.title)
|
||||
this.make_head();for(var i=0;i<this.opts.sections.length;i++){var section=this.opts.sections[i];if((section.display&§ion.display())||!section.display){this.sections[section.title]=new wn.widgets.PageSidebarSection(this,section);}}
|
||||
if(this.opts.onrefresh){this.opts.onrefresh(this)}}
|
||||
this.make_head=function(){this.head=$a(this.wrapper,'div','psidebar-head','',this.opts.title);}
|
||||
this.make_head=function(){this.head=$a(this.wrapper,'div','head','',this.opts.title);}
|
||||
this.refresh();}
|
||||
wn.widgets.PageSidebarSection=function(sidebar,opts){this.items=[];this.sidebar=sidebar;this.wrapper=$a(sidebar.wrapper,'div','psidebar-section');this.head=$a(this.wrapper,'div','psidebar-section-head','',opts.title);this.body=$a(this.wrapper,'div','psidebar-section-body');$br(this.wrapper,'5px');this.opts=opts;this.make_items=function(){for(var i=0;i<this.opts.items.length;i++){var item=this.opts.items[i];if((item.display&&item.display())||!item.display){var div=$a(this.body,'div','psidebar-section-item');this.make_one_item(item,div);}}}
|
||||
wn.widgets.PageSidebarSection=function(sidebar,opts){this.items=[];this.sidebar=sidebar;this.wrapper=$a(sidebar.wrapper,'div','section');this.head=$a(this.wrapper,'div','section-head','',opts.title);this.body=$a(this.wrapper,'div','section-body');$br(this.wrapper,'5px');this.opts=opts;this.make_items=function(){for(var i=0;i<this.opts.items.length;i++){var item=this.opts.items[i];if((item.display&&item.display())||!item.display){var div=$a(this.body,'div','section-item');this.make_one_item(item,div);}}}
|
||||
this.make_one_item=function(item,div){if(item.type.toLowerCase()=='link')
|
||||
this.items[item.label]=new wn.widgets.PageSidebarLink(this,item,div);else if(item.type.toLowerCase()=='button')
|
||||
this.items[item.label]=new wn.widgets.PageSidebarButton(this,this.opts.items[i],div);else if(item.type.toLowerCase()=='html')
|
||||
@ -1186,7 +1187,7 @@ else
|
||||
this.make_items();}
|
||||
this.refresh();}
|
||||
wn.widgets.PageSidebarLink=function(section,opts,wrapper){this.wrapper=wrapper;this.section=section;this.opts=opts;var me=this;if(opts.icon){section.add_icon(this.wrapper,opts.icon);}
|
||||
this.ln=$a(this.wrapper,'span','link_type psidebar-section-link',opts.style,opts.label);this.ln.onclick=function(){me.opts.onclick(me)};}
|
||||
this.ln=$a(this.wrapper,'span','link_type section-link',opts.style,opts.label);this.ln.onclick=function(){me.opts.onclick(me)};}
|
||||
wn.widgets.PageSidebarButton=function(section,opts,wrapper){this.wrapper=wrapper;this.section=section;this.opts=opts;var me=this;this.btn=$btn(this.wrapper,opts.label,opts.onclick,opts.style,opts.color);}
|
||||
wn.widgets.PageSidebarHTML=function(section,opts,wrapper){wrapper.innerHTML=opts.content}
|
||||
/*
|
||||
|
@ -676,7 +676,7 @@ this.widgets[d[1]]=b;}}
|
||||
*/
|
||||
wn.widgets.Listing=function(opts){this.opts=opts;this.page_length=20;this.btns={};this.start=0;var me=this;this.make=function(opts){this.wrapper=$a(this.opts.parent,'div');this.filters_area=$a(this.wrapper,'div','listing-filters');this.toolbar_area=$a(this.wrapper,'div','listing-toolbar');this.results_area=$a(this.wrapper,'div','listing-results');this.more_button_area=$a(this.wrapper,'div','listing-more');this.no_results_area=$a(this.wrapper,'div','help_box',{display:'none'},(this.opts.no_result_message?this.opts.no_result_message:'No results'));if(opts)this.opts=opts;this.page_length=this.opts.page_length?this.opts.page_length:this.page_length;this.make_toolbar();this.make_filters();this.make_more_button();}
|
||||
this.make_filters=function(){if(this.opts.filters){$ds(this.filters_area);this.filters=new wn.widgets.FieldGroup(this.filters_area,this.opts.fields);}}
|
||||
this.make_toolbar=function(){if(!this.opts.hide_refresh){this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
|
||||
this.loading_img=$a(this.toolbar_area,'img','lib/images/ui/button-load.gif',{display:'none',marginLeft:'3px',marginBottom:'-2px'});}
|
||||
if(this.opts.new_doctype){this.new_btn=$btn(this.toolbar_area,'New '+get_doctype_label(this.opts.new_doctype),function(){newdoc(me.opts.new_doctype,me.opts.new_doc_onload,me.opts.new_doc_indialog,me.opts.new_doc_onsave);},{marginLeft:'7px'});}}
|
||||
this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
|
||||
@ -688,8 +688,9 @@ if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
|
||||
this.add_row=function(){return $a(this.results_area,'div','',(opts.cell_style?opts.cell_style:{padding:'3px 0px'}));}
|
||||
this.run=function(callback,append){if(callback)
|
||||
this.onrun=callback;if(!append)
|
||||
this.start=0;this.query=this.opts.get_query?this.opts.get_query():this.opts.query;this.add_limits();args={query_max:this.query_max||this.opts.query_max||''}
|
||||
args.simple_query=this.query;args.as_dict=1;if(this.loading_img)$di(this.loading_img);wn.call({method:'webnotes.widgets.query_builder.runquery',args:args,callback:function(r,rt){me.make_results(r,rt)},no_spinner:this.opts.no_loading,btn:this.opts.run_btn});}
|
||||
this.start=0;if(!this.opts.method){this.query=this.opts.get_query?this.opts.get_query():this.opts.query;this.add_limits();var args={query_max:this.query_max||this.opts.query_max||'',as_dict:1}
|
||||
args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
|
||||
if(this.loading_img)$di(this.loading_img);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:args,callback:function(r,rt){me.make_results(r,rt)},no_spinner:this.opts.no_loading,btn:this.opts.run_btn});}
|
||||
this.refresh=this.run;this.add_limits=function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}
|
||||
if(opts)this.make();}
|
||||
/*
|
||||
@ -884,8 +885,8 @@ $c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(
|
||||
/*
|
||||
* lib/js/legacy/wn/page_layout.js
|
||||
*/
|
||||
wn.sidebar_background='#f2f2f2';wn.PageLayout=function(args){$.extend(this,args)
|
||||
this.wrapper=$a(this.parent,'div','layout-wrapper',{backgroundColor:wn.sidebar_background,padding:'0px'});this.main=$a(this.wrapper,'div','layout-main-section');this.sidebar_area=$a(this.wrapper,'div','layout-side-section');$a(this.wrapper,'div','',{clear:'both'});this.head=$a(this.main,'div');this.toolbar_area=$a(this.main,'div');this.body=$a(this.main,'div');this.footer=$a(this.main,'div');if(this.heading){this.page_head=new PageHeader(this.head,this.heading);}}
|
||||
wn.PageLayout=function(args){$.extend(this,args)
|
||||
this.wrapper=$a(this.parent,'div','layout-wrapper layout-wrapper-background');this.main=$a(this.wrapper,'div','layout-main-section');this.sidebar_area=$a(this.wrapper,'div','layout-side-section');$a(this.wrapper,'div','',{clear:'both'});this.head=$a(this.main,'div');this.toolbar_area=$a(this.main,'div');this.body=$a(this.main,'div');this.footer=$a(this.main,'div');if(this.heading){this.page_head=new PageHeader(this.head,this.heading);}}
|
||||
/*
|
||||
* lib/js/legacy/wn/widgets/footer.js
|
||||
*/
|
||||
|
@ -1 +1 @@
|
||||
513
|
||||
525
|
Loading…
x
Reference in New Issue
Block a user