Removed cloud subscription logic

This commit is contained in:
Anand Doshi 2014-03-14 15:24:24 +05:30
parent 9d1e8640ef
commit 2134d24b36
5 changed files with 2 additions and 74 deletions

View File

@ -6,7 +6,6 @@
"public/js/website_utils.js"
],
"js/erpnext.min.js": [
"public/js/startup.js",
"public/js/conf.js",
"public/js/toolbar.js",
"public/js/feature_setup.js",

View File

@ -1,41 +1,7 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
var current_module;
frappe.provide('erpnext.startup');
erpnext.startup.start = function() {
console.log(frappe._('Starting up...'));
$('#startup_div').html('Starting up...').toggle(true);
erpnext.toolbar.setup();
if(frappe.boot.expires_on && in_list(user_roles, 'System Manager')) {
erpnext.startup.show_expiry_banner();
}
}
erpnext.startup.show_expiry_banner = function() {
var today = dateutil.str_to_obj(frappe.boot.server_date);
var expires_on = dateutil.str_to_obj(frappe.boot.expires_on);
var diff = dateutil.get_diff(expires_on, today);
var payment_link = "<a href=\"https://erpnext.com/modes-of-payment.html\" target=\"_blank\">"+
frappe._("Click here to buy subscription.")+"</a>";
var msg = "";
if (0 <= diff && diff <= 10) {
var expiry_string = diff==0 ? "today" : repl("in %(diff)s day(s)", { diff: diff });
msg = repl(frappe._('Your ERPNext subscription will')+' <b>expire %(expiry_string)s</b>. %(payment_link)s',
{ expiry_string: expiry_string, payment_link: payment_link });
} else if (diff < 0) {
msg = repl(frappe._('This ERPNext subscription')+'<b>'+frappe._('has expired')+'</b>. %(payment_link)s', {payment_link: payment_link});
}
if(msg) frappe.ui.toolbar.show_banner(msg);
}
// start
$(document).bind('startup', function() {
erpnext.startup.start();
$(document).on('startup', function() {
console.log(frappe._('Starting up...'));
});

View File

@ -1,26 +0,0 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
/* toolbar settings */
frappe.provide('erpnext.toolbar');
erpnext.toolbar.setup = function() {
// user
var $user = $('#toolbar-user');
$user.append('<li><a href="#Form/User/'+user+'"><i class="icon-fixed-width icon-user"></i> '
+frappe._("My Settings")+'...</a></li>');
$user.append('<li class="divider"></li>');
$user.append('<li><a href="https://erpnext.com/manual" target="_blank">\
<i class="icon-fixed-width icon-file"></i> '+frappe._('Documentation')+'</a></li>');
$user.append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
<i class="icon-fixed-width icon-quote-left"></i> '+frappe._('Forum')+'</a></li>');
if(frappe.boot.expires_on || frappe.boot.commercial_support) {
$user.append('<li>\
<a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
<i class="icon-fixed-width icon-comments"></i> '+frappe._('Live Chat')+'</a></li>');
}
$("#toolbar-tools").append('<li><a href="https://github.com/frappe/erpnext/releases" target="_blank">\
<i class="icon-fixed-width icon-rss"></i> Latest Updates</li>');
}

View File

@ -477,11 +477,6 @@ def send():
from frappe.utils import getdate
now_date = now_datetime().date()
from frappe import conf
if "expires_on" in conf and now_date > getdate(conf.expires_on):
# do not send email digests to expired accounts
return
for ed in frappe.db.sql("""select name from `tabEmail Digest`
where enabled=1 and docstatus<2""", as_list=1):
ed_obj = get_obj('Email Digest', ed[0])

View File

@ -29,12 +29,6 @@ def boot_session(bootinfo):
bootinfo['setup_complete'] = frappe.db.sql("""select name from
tabCompany limit 1""") and 'Yes' or 'No'
# load subscription info
from frappe import conf
for key in ['max_users', 'expires_on', 'max_space', 'status', 'commercial_support']:
if key in conf: bootinfo[key] = conf.get(key)
bootinfo['docs'] += frappe.db.sql("""select name, default_currency, cost_center
from `tabCompany`""", as_dict=1, update={"doctype":":Company"})