form toolbar ui fixes and added themes

This commit is contained in:
Rushabh Mehta
2012-09-28 16:11:57 +05:30
parent 534a7a92fe
commit b0d32b7a25
9 changed files with 112 additions and 9 deletions

View File

@@ -1,205 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* features setup "Dictionary", "Script"
Dictionary Format
'projects': {
'Sales Order': {
'fields':['project_name'],
'sales_order_details':['projected_qty']
},
'Purchase Order': {
'fields':['project_name']
}
}
// ====================================================================*/
pscript.feature_dict = {
'fs_projects': {
'BOM': {'fields':['project_name']},
'Delivery Note': {'fields':['project_name']},
'Purchase Invoice': {'entries':['project_name']},
'Production Order': {'fields':['project_name']},
'Purchase Order': {'po_details':['project_name']},
'Purchase Receipt': {'purchase_receipt_details':['project_name']},
'Sales Invoice': {'fields':['project_name']},
'Sales Order': {'fields':['project_name']},
'Stock Entry': {'fields':['project_name']},
'Timesheet': {'timesheet_details':['project_name']}
},
'fs_packing_details': {
//'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
//'Sales Order': {'fields':['packing_details']}
},
'fs_discounts': {
'Delivery Note': {'delivery_note_details':['adj_rate']},
'Quotation': {'quotation_details':['adj_rate']},
'Sales Invoice': {'entries':['adj_rate']},
'Sales Order': {'sales_order_details':['adj_rate','ref_rate']}
},
'fs_purchase_discounts': {
'Purchase Order': {'po_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
'Purchase Receipt': {'purchase_receipt_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
'Purchase Invoice': {'entries':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']}
},
'fs_brands': {
'Delivery Note': {'delivery_note_details':['brand']},
'Purchase Request': {'indent_details':['brand']},
'Item': {'fields':['brand']},
'Purchase Order': {'po_details':['brand']},
'Purchase Invoice': {'entries':['brand']},
'Quotation': {'quotation_details':['brand']},
'Sales Invoice': {'entries':['brand']},
'Sales BOM': {'fields':['new_item_brand']},
'Sales Order': {'sales_order_details':['brand']},
'Serial No': {'fields':['brand']}
},
'fs_after_sales_installations': {
'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}
},
'fs_item_batch_nos': {
'Delivery Note': {'delivery_note_details':['batch_no']},
'Item': {'fields':['has_batch_no']},
'Purchase Receipt': {'purchase_receipt_details':['batch_no']},
'Quality Inspection': {'fields':['batch_no']},
'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
'Sales Invoice': {'entries':['batch_no']},
'Stock Entry': {'mtn_details':['batch_no']},
'Stock Ledger Entry': {'fields':['batch_no']}
},
'fs_item_serial_nos': {
'Customer Issue': {'fields':['serial_no']},
'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']},
'Installation Note': {'installed_item_details':['serial_no']},
'Item': {'fields':['has_serial_no']},
'Maintenance Schedule': {'item_maintenance_detail':['serial_no'],'maintenance_schedule_detail':['serial_no']},
'Maintenance Visit': {'maintenance_visit_details':['serial_no']},
'Purchase Receipt': {'purchase_receipt_details':['serial_no']},
'Quality Inspection': {'fields':['item_serial_no']},
'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
'Sales Invoice': {'entries':['serial_no']},
'Stock Entry': {'mtn_details':['serial_no']},
'Stock Ledger Entry': {'fields':['serial_no']}
},
'fs_item_barcode': {
'Item': {'fields': ['barcode']},
'Delivery Note': {'delivery_note_details': ['barcode']},
'Sales Invoice': {'entries': ['barcode']}
},
'fs_item_group_in_details': {
'Delivery Note': {'delivery_note_details':['item_group']},
'Opportunity': {'enquiry_details':['item_group']},
'Purchase Request': {'indent_details':['item_group']},
'Item': {'fields':['item_group']},
'Global Defaults': {'fields':['default_item_group']},
'Purchase Order': {'po_details':['item_group']},
'Purchase Receipt': {'purchase_receipt_details':['item_group']},
'Purchase Voucher': {'entries':['item_group']},
'Quotation': {'quotation_details':['item_group']},
'Sales Invoice': {'entries':['item_group']},
'Sales BOM': {'fields':['serial_no']},
'Sales Order': {'sales_order_details':['item_group']},
'Serial No': {'fields':['item_group']},
'Sales Partner': {'partner_target_details':['item_group']},
'Sales Person': {'target_details':['item_group']},
'Territory': {'target_details':['item_group']}
},
'fs_page_break': {
'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']},
'Purchase Request': {'indent_details':['page_break']},
'Purchase Order': {'po_details':['page_break']},
'Purchase Receipt': {'purchase_receipt_details':['page_break']},
'Purchase Voucher': {'entries':['page_break']},
'Quotation': {'quotation_details':['page_break']},
'Sales Invoice': {'entries':['page_break']},
'Sales Order': {'sales_order_details':['page_break']}
},
'fs_exports': {
'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','amount','basic_rate']},
'POS Setting': {'fields':['conversion_rate','currency']},
'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','amount','basic_rate']},
'Sales Invoice': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','amount','basic_rate']},
'Item': {'ref_rate_details':['ref_currency']},
'Sales BOM': {'fields':['currency']},
'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','amount','basic_rate']}
},
'fs_imports': {
'Purchase Invoice': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['purchase_ref_rate', 'amount','rate']},
'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['purchase_ref_rate', 'amount','purchase_rate']},
'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['purchase_ref_rate','amount','purchase_rate']},
'Supplier Quotation': {'fields':['conversion_rate','currency']}
},
'fs_item_advanced': {
'Item': {'fields':['item_customer_details']}
},
'fs_sales_extras': {
'Address': {'fields':['sales_partner']},
'Contact': {'fields':['sales_partner']},
'Customer': {'fields':['sales_team']},
'Delivery Note': {'fields':['sales_team','Packing List']},
'Item': {'fields':['item_customer_details']},
'Sales Invoice': {'fields':['sales_team']},
'Sales Order': {'fields':['sales_team','Packing List']}
},
'fs_more_info': {
'Delivery Note': {'fields':['More Info']},
'Opportunity': {'fields':['More Info']},
'Purchase Request': {'fields':['More Info']},
'Lead': {'fields':['More Info']},
'Purchase Invoice': {'fields':['More Info']},
'Purchase Order': {'fields':['More Info']},
'Purchase Receipt': {'fields':['More Info']},
'Quotation': {'fields':['More Info']},
'Sales Invoice': {'fields':['More Info']},
'Sales Order': {'fields':['More Info']},
},
'fs_quality': {
'Item': {'fields':['Item Inspection Criteria','inspection_required']},
'Purchase Receipt': {'purchase_receipt_details':['qa_no']}
},
'fs_manufacturing': {
'Item': {'fields':['Manufacturing']}
},
'fs_pos': {
'Sales Invoice': {'fields':['is_pos']}
},
'fs_recurring_invoice': {
'Sales Invoice': {'fields': ['Recurring Invoice']}
}
}
$(document).bind('form_refresh', function() {
for(sys_feat in sys_defaults)
{
if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists
{
if(cur_frm.doc.doctype in pscript.feature_dict[sys_feat])
{
for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype])
{
if(fort=='fields')
hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
else if(cur_frm.fields_dict[fort])
{
for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
}
else
msgprint('Grid "'+fort+'" does not exists');
}
}
}
}
})

View File

@@ -1,124 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.provide('erpnext.module_page');
erpnext.module_page.setup_page = function(module, wrapper) {
erpnext.module_page.hide_links(wrapper);
erpnext.module_page.make_list(module, wrapper);
$(wrapper).find("a[title]").tooltip({
delay: { show: 500, hide: 100 }
});
}
// hide list links where the user does
// not have read permissions
erpnext.module_page.hide_links = function(wrapper) {
function replace_link(link) {
var txt = $(link).text();
$(link).parent().css('color', '#999');
$(link).replaceWith('<span title="No read permission">'
+txt+'</span>');
}
// lists
$(wrapper).find('[href*="List/"]').each(function() {
var href = $(this).attr('href');
var dt = href.split('/')[1];
if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) {
replace_link(this);
}
});
// reports
$(wrapper).find('[data-doctype]').each(function() {
var dt = $(this).attr('data-doctype');
if(wn.boot.profile.all_read.indexOf(dt)==-1) {
replace_link(this);
}
});
// single (forms)
$(wrapper).find('[href*="Form/"]').each(function() {
var href = $(this).attr('href');
var dt = href.split('/')[1];
if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) {
replace_link(this);
}
});
// pages
$(wrapper).find('[data-role]').each(function() {
if(!has_common(user_roles, [$(this).attr("data-role"), "System Manager"])) {
var html = $(this).html();
$(this).parent().css('color', '#999');
$(this).replaceWith('<span title="Only accessible by Roles: '+
$(this).attr("data-role")
+' and System Manager">'+html+'</span>');
}
});
}
// make list of reports
erpnext.module_page.make_list = function(module, wrapper) {
// make project listing
var $w = $(wrapper).find('.reports-list');
var $parent1 = $('<div style="width: 45%; float: left; margin-right: 4.5%"></div>').appendTo($w);
var $parent2 = $('<div style="width: 45%; float: left;"></div>').appendTo($w);
wrapper.list1 = new wn.ui.Listing({
parent: $parent1,
method: 'utilities.get_sc_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,
callback: function(r) {
erpnext.module_page.hide_links($parent1)
}
});
wrapper.list1.run();
wrapper.list2 = new wn.ui.Listing({
parent: $parent2,
method: 'utilities.get_report_list',
render_row: function(row, data) {
$(row).html(repl('<a href="#!Report2/%(ref_doctype)s/%(name)s" \
data-doctype="%(ref_doctype)s">\
%(name)s</a>', data))
},
args: { module: module },
no_refresh: true,
callback: function(r) {
erpnext.module_page.hide_links($parent2)
}
});
wrapper.list2.run();
// show link to all reports
$parent1.find('.list-toolbar-wrapper')
.prepend("<div class=\"show-all-reports\">\
<a href=\"#List/Search Criteria\"> [ List Of All Reports ]</a></div>");
$parent2.find('.list-toolbar-wrapper')
.prepend("<div class=\"show-all-reports\">\
<a href=\"#List/Report\"> [ List Of All Reports (New) ]</a></div>");
}

View File

@@ -1,109 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/* toolbar settings */
wn.provide('erpnext.toolbar');
erpnext.toolbar.setup = function() {
// modules
erpnext.toolbar.add_modules();
// profile
$('#toolbar-user').append('<li><a href="#!profile-settings">Profile Settings</a></li>');
$('.navbar .pull-right').append('\
<li><a href="#!messages" title="Unread Messages"><span class="navbar-new-comments"></span></a></li>');
// help
$('.navbar .pull-right').prepend('<li class="dropdown">\
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \
onclick="return false;">Help<b class="caret"></b></a>\
<ul class="dropdown-menu" id="toolbar-help">\
</ul></li>')
$('#toolbar-help').append('<li><a href="https://erpnext.com/manual" target="_blank">\
Documentation</a></li>')
$('#toolbar-help').append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
Forum</a></li>')
$('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
Live Chat (Office Hours)</a></li>')
erpnext.toolbar.set_new_comments();
}
erpnext.toolbar.add_modules = function() {
$('<li class="dropdown">\
<a class="dropdown-toggle" data-toggle="dropdown" href="#"\
onclick="return false;">Modules<b class="caret"></b></a>\
<ul class="dropdown-menu modules">\
</ul>\
</li>').prependTo('.navbar .nav:first');
// if no modules list then show all
if(wn.boot.modules_list && typeof(wn.boot.modules_list) == 'string') {
wn.boot.modules_list = JSON.parse(wn.boot.modules_list);
}
else
wn.boot.modules_list = keys(erpnext.modules).sort();
// add to dropdown
for(var i in wn.boot.modules_list) {
var m = wn.boot.modules_list[i]
if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) {
args = {
module: m,
module_page: erpnext.modules[m],
module_label: m=='HR' ? 'Human Resources' : m
}
$('.navbar .modules').append(repl('<li><a href="#!%(module_page)s" \
data-module="%(module)s">%(module_label)s</a></li>', args));
}
}
// dasboard for accounts system manager
if(user_roles.indexOf("Accounts Manager")!=-1) {
$('.navbar .modules').append('<li><a href="#!dashboard" \
data-module="Dashboard">Dashboard</a></li>');
}
// setup for system manager
if(user_roles.indexOf("System Manager")!=-1) {
$('.navbar .modules').append('<li class="divider"></li>\
<li><a href="#!Setup" data-module="Setup">Setup</a></li>');
}
}
erpnext.toolbar.set_new_comments = function(new_comments) {
var navbar_nc = $('.navbar-new-comments');
if(new_comments && new_comments.length>0) {
navbar_nc.text(new_comments.length);
navbar_nc.addClass('navbar-new-comments-true')
$.each(new_comments, function(i, v) {
var msg = 'New Message: ' + (v[1].length<=100 ? v[1] : (v[1].substr(0, 100) + "..."));
var id = v[0].replace('/', '-');
if(!$('#' + id)[0]) { show_alert(msg, id); }
})
} else {
navbar_nc.removeClass('navbar-new-comments-true');
navbar_nc.text(0);
}
}

View File

@@ -1,64 +0,0 @@
h1, h2, h3, h4, h5 {
font-family: Arial, Helvetica, sans-serif;
margin-top: 0.2em;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
}
span, div, td, input, textarea, button, select {
font-family: inherit;
}
.small {
font-size: 11.5px;
}
.erpnext-footer {
margin: 11px auto;
text-align: center;
}
.navbar-new-comments {
margin: -3px 0px;
padding: 2px;
min-width: 20px;
text-align: center;
display: inline-block;
border-radius: 2px;
color: #999999;
background-color: #333131;
}
.navbar-new-comments:hover,
.navbar-new-comments:active,
.navbar-new-comments:focus {
color: #fff;
}
.navbar-new-comments-true {
color: #fff;
background-color: #B00D07;
}
/*extra size menus for recent*/
.dropdown-menu#toolbar-recent, .dropdown-menu#toolbar-options, .dropdown-menu#toolbar-help{
min-width: 160px !important;
max-width: 260px !important;
}
.expiry-info {
margin-top: 40px;
margin-bottom: -40px;
text-align: center;
background-color: rgb(255, 255, 204);
padding: 7px;
z-index: 1;
}
.show-all-reports {
margin-top: 5px;
font-size: 11px;
}

View File

@@ -1,208 +0,0 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
var current_module;
var is_system_manager = 0;
wn.provide('erpnext.startup');
erpnext.modules = {
'Selling': 'selling-home',
'Accounts': 'accounts-home',
'Stock': 'stock-home',
'Buying': 'buying-home',
'Support': 'support-home',
'Projects': 'projects-home',
'Production': 'production-home',
'Website': 'website-home',
'HR': 'hr-home',
'Setup': 'Setup',
'Activity': 'activity',
'To Do': 'todo',
'Calendar': 'calendar',
'Messages': 'messages',
'Knowledge Base': 'questions',
'Dashboard': 'dashboard'
}
// wn.modules is used in breadcrumbs for getting module home page
wn.provide('wn.modules');
$.extend(wn.modules, erpnext.modules);
wn.modules['Core'] = 'Setup';
erpnext.startup.set_globals = function() {
if(inList(user_roles,'System Manager')) is_system_manager = 1;
}
erpnext.startup.start = function() {
console.log('Starting up...');
$('#startup_div').html('Starting up...').toggle(true);
erpnext.startup.set_globals();
if(user != 'Guest'){
if(wn.boot.user_background) {
erpnext.set_user_background(wn.boot.user_background);
}
// always allow apps
wn.boot.profile.allow_modules = wn.boot.profile.allow_modules.concat(
['To Do', 'Knowledge Base', 'Calendar', 'Activity', 'Messages'])
// setup toolbar
erpnext.toolbar.setup();
// set interval for updates
erpnext.startup.set_periodic_updates();
// border to the body
// ------------------
$('footer').html('<div class="web-footer erpnext-footer">\
<a href="#!attributions">ERPNext | Attributions and License</a></div>');
// complete registration
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
wn.require("app/js/complete_setup.js");
erpnext.complete_setup.show();
}
if(wn.boot.expires_on && in_list(user_roles, 'System Manager')) {
var today = dateutil.str_to_obj(dateutil.get_today());
var expires_on = dateutil.str_to_obj(wn.boot.expires_on);
var diff = dateutil.get_diff(expires_on, today);
if (0 <= diff && diff <= 15) {
var expiry_string = diff==0 ? "today" : repl("in %(diff)s day(s)", { diff: diff });
$('header').append(repl('<div class="expiry-info"> \
Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
Please renew your subscription to continue using ERPNext \
(and remove this annoying banner). \
</div>', { expiry_string: expiry_string }));
} else if (diff < 0) {
$('header').append(repl('<div class="expiry-info"> \
This ERPNext subscription <b>has expired</b>. \
</div>', { expiry_string: expiry_string }));
}
}
erpnext.set_about();
if(wn.control_panel.custom_startup_code)
eval(wn.control_panel.custom_startup_code);
}
}
// ========== Update Messages ============
erpnext.update_messages = function(reset) {
// Updates Team Messages
if(inList(['Guest'], user) || !wn.session_alive) { return; }
if(!reset) {
var set_messages = function(r) {
if(!r.exc) {
// This function is defined in toolbar.js
erpnext.toolbar.set_new_comments(r.message.unread_messages);
var show_in_circle = function(parent_id, msg) {
var parent = $('#'+parent_id);
if(parent) {
if(msg) {
parent.find('span:first').text(msg);
parent.toggle(true);
} else {
parent.toggle(false);
}
}
}
show_in_circle('unread_messages', r.message.unread_messages.length);
show_in_circle('open_support_tickets', r.message.open_support_tickets);
show_in_circle('things_todo', r.message.things_todo);
show_in_circle('todays_events', r.message.todays_events);
show_in_circle('open_tasks', r.message.open_tasks);
show_in_circle('unanswered_questions', r.message.unanswered_questions);
} else {
clearInterval(wn.updates.id);
}
}
wn.call({
method: 'startup.startup.get_global_status_messages',
callback: set_messages
});
} else {
erpnext.toolbar.set_new_comments(0);
$('#unread_messages').toggle(false);
}
}
erpnext.startup.set_periodic_updates = function() {
// Set interval for periodic updates of team messages
wn.updates = {};
if(wn.updates.id) {
clearInterval(wn.updates.id);
}
wn.updates.id = setInterval(erpnext.update_messages, 60000);
}
erpnext.set_user_background = function(src) {
set_style(repl('#body_div { background: url("files/%(src)s") repeat;}', {src:src}))
}
// start
$(document).bind('startup', function() {
erpnext.startup.start();
});
// subject, sender, description
erpnext.send_message = function(opts) {
if(opts.btn) {
$(opts.btn).start_working();
}
wn.call({
method: 'website.send_message',
args: opts,
callback: function(r) {
if(opts.btn) {
$(opts.btn).done_working();
}
if(opts.callback)opts.callback(r)
}
});
}
erpnext.hide_naming_series = function() {
if(cur_frm.fields_dict.naming_series) {
hide_field('naming_series');
if(cur_frm.doc.__islocal) {
unhide_field('naming_series');
}
}
}
Mousetrap.bind(["command+g", "ctrl+g"], function() {
wn.ui.toolbar.search.show();
return false;
});
Mousetrap.bind(["command+s", "ctrl+s"], function() {
if(cur_frm)
cur_frm.save();
return false;
});