timestamps, comments
diff --git a/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt
index f7c9f84..70a6206 100644
--- a/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt
+++ b/accounts/search_criteria/lease_agreement_list/lease_agreement_list.txt
@@ -3,9 +3,15 @@
# These values are common in all dictionaries
{
+<<<<<<< HEAD
+ 'creation': '2011-07-27 16:17:04',
+ 'docstatus': 0,
+ 'modified': '2011-07-27 16:17:04',
+=======
'creation': '2011-07-26 17:01:34',
'docstatus': 0,
'modified': '2011-07-28 12:55:50',
+>>>>>>> d075a6c53dc2c832a363409cd4b32ff5a6482e5a
'modified_by': 'Administrator',
'owner': 'Administrator'
},
diff --git a/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt b/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt
index a531bb9..bbb62bb 100644
--- a/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt
+++ b/accounts/search_criteria/lease_monthly_future_installment_inflows/lease_monthly_future_installment_inflows.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-07-27 13:14:29',
+ 'creation': '2011-07-27 16:17:04',
'docstatus': 0,
- 'modified': '2011-07-27 13:14:29',
+ 'modified': '2011-07-27 16:17:04',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
diff --git a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt
index dcd0f94..3c63377 100644
--- a/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt
+++ b/accounts/search_criteria/lease_overdue_age_wise/lease_overdue_age_wise.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-07-27 13:14:29',
+ 'creation': '2011-07-27 16:17:04',
'docstatus': 0,
- 'modified': '2011-07-27 13:14:29',
+ 'modified': '2011-07-27 16:17:04',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
diff --git a/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt
index 6e1b266..5a671fe 100644
--- a/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt
+++ b/accounts/search_criteria/lease_receipt_summary_month_wise/lease_receipt_summary_month_wise.txt
@@ -3,9 +3,15 @@
# These values are common in all dictionaries
{
+<<<<<<< HEAD
+ 'creation': '2011-07-27 16:17:04',
+ 'docstatus': 0,
+ 'modified': '2011-07-27 16:17:04',
+=======
'creation': '2011-07-27 18:48:29',
'docstatus': 0,
'modified': '2011-07-28 12:56:35',
+>>>>>>> d075a6c53dc2c832a363409cd4b32ff5a6482e5a
'modified_by': 'Administrator',
'owner': 'Administrator'
},
diff --git a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt
index 26c0ff7..21463ab 100644
--- a/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt
+++ b/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.txt
@@ -3,9 +3,15 @@
# These values are common in all dictionaries
{
+<<<<<<< HEAD
+ 'creation': '2011-07-27 16:17:04',
+ 'docstatus': 0,
+ 'modified': '2011-07-27 16:17:04',
+=======
'creation': '2011-07-28 12:13:41',
'docstatus': 0,
'modified': '2011-07-28 12:56:47',
+>>>>>>> d075a6c53dc2c832a363409cd4b32ff5a6482e5a
'modified_by': 'Administrator',
'owner': 'Administrator'
},
diff --git a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt
index aa52224..c64be0a 100644
--- a/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt
+++ b/accounts/search_criteria/lease_yearly_future_installment_inflows/lease_yearly_future_installment_inflows.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-07-27 13:14:29',
+ 'creation': '2011-07-27 16:17:04',
'docstatus': 0,
- 'modified': '2011-07-27 13:14:29',
+ 'modified': '2011-07-27 16:17:04',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
diff --git a/home/doctype/company_control/company_control.py b/home/doctype/company_control/company_control.py
index cab8e7c..c789a57 100644
--- a/home/doctype/company_control/company_control.py
+++ b/home/doctype/company_control/company_control.py
@@ -63,10 +63,6 @@
p.fields[k] = arg[k]
p.save()
- def update_profile_image(self, fid, fname):
- sql("update tabProfile set file_list = '%s,%s' where name='%s'" % (fname, fid, session['user']))
-
-
def get_login_url(self):
return session['data']['login_from']
diff --git a/home/page/profile_settings/profile_settings.js b/home/page/profile_settings/profile_settings.js
index 10b06d4..425626b 100644
--- a/home/page/profile_settings/profile_settings.js
+++ b/home/page/profile_settings/profile_settings.js
@@ -97,7 +97,7 @@
]);
var w = d.widgets['wrapper'];
- me.uploader = new Uploader(w, {thumbnail:'80px', server_obj:'Company Control', method:'update_profile_image'}, pscript.user_image_upload)
+ me.uploader = new Uploader(w, {cmd:'home.page.profile_settings.profile_settings.set_user_image'}, pscript.user_image_upload, 1)
me.change_dialog = d;
}
me.change_dialog.show();
diff --git a/home/page/profile_settings/profile_settings.py b/home/page/profile_settings/profile_settings.py
index f9124b6..624feed 100644
--- a/home/page/profile_settings/profile_settings.py
+++ b/home/page/profile_settings/profile_settings.py
@@ -2,7 +2,6 @@
from webnotes.utils import load_json, cint, nowdate
-
def change_password(arg):
"""
Change password
@@ -21,15 +20,40 @@
webnotes.msgprint('Password Updated');
def get_user_details(arg=None):
- "Returns user first name, last name and bio"
-
+ """
+ Returns user first name, last name and bio
+ """
return webnotes.conn.sql("select first_name, last_name, bio from tabProfile where name=%s", webnotes.user.name, as_dict=1)[0]
def set_user_details(arg=None):
- "updates user details given in argument"
+ """
+ updates user details given in argument
+ """
from webnotes.model.doc import Document
p = Document('Profile', webnotes.user.name)
p.fields.update(load_json(arg))
p.save()
webnotes.msgprint('Updated')
+
+def set_user_image(arg=None):
+ """
+ Set uploaded image as user image
+ """
+ from webnotes.utils.upload_handler import UploadHandler
+
+ uh = UploadHandler()
+ if not uh.file_name:
+ # do nothing - no file found
+ return
+ else:
+ # save the file
+ from webnotes.utils.file_manager import FileAttachments
+
+ fa = FileAttachments('Profile', webnotes.session['user'])
+ fa.delete_all()
+ fa.add(uh.file_name, uh.content)
+ fa.save()
+
+ uh.set_callback('window.parent.upload_callback("%s", "%s")' \
+ % (webnotes.form_dict['uploader_id'], fa.get_fid(0)))
\ No newline at end of file
diff --git a/setup/doctype/email_digest/__init__.py b/setup/doctype/email_digest/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/setup/doctype/email_digest/__init__.py
diff --git a/setup/doctype/email_digest/email_digest.coffee b/setup/doctype/email_digest/email_digest.coffee
new file mode 100644
index 0000000..1b17d5b
--- /dev/null
+++ b/setup/doctype/email_digest/email_digest.coffee
@@ -0,0 +1,101 @@
+content_items = ['Sales','Expenses','Bank Balance','Activity']
+
+# make a grid with items and columns of checkboxes
+# Parameters:
+# parent
+# label (main heading)
+# items = [] (rows)
+# columns = [] (columns of checks)
+# widths
+# description
+
+class CheckGrid
+ constructor: (@args) ->
+ $.extend @, args
+ @wrapper = $a @parent, 'div', 'check-grid round'
+ @render()
+
+ render: ->
+ $a @wrapper, 'h3', 'check-grid-title', null, @label
+
+ if @description
+ $a @wrapper, 'div', 'help-box', null, @description
+
+ @tab = make_table @wrapper, @items.length + 1, @columns.length, '100%', @widths
+ @checks = {}
+
+ # render heads
+ for i in [0..@columns.length-1]
+ $($td(@tab, 0, i))
+ .addClass('check-grid-head gradient')
+ .html @columns[i]
+
+ @render_rows()
+
+ render_rows: ->
+ # render rows
+ for i in [0..@items.length-1]
+ $td(@tab, i+1, 0).innerHTML = @items[i]
+
+ # render checkboxes for this row
+ @checks[@items[i]] = {}
+ for c in [1..@columns.length-1]
+ check = $a_input $td(@tab, i+1, c), 'checkbox'
+
+ # tag keys to checkbox
+ check.item = @items[i]
+ check.column = @columns[c]
+
+ # add in my checks
+ @checks[@items[i]][@columns[c]] = check
+
+ # get the values of the checkbox in a double dict
+ get: =>
+ val = {}
+ for item in keys @checks
+ for column in keys @checks[item]
+ check = @checks[item][column]
+ val[check.item] or= {}
+ val[check.item][check.column] = if check.checked then 1 else 0
+ val
+
+ # set the values of the grid
+ set: (val) =>
+ for item in keys @checks
+ for column in keys @checks[item]
+ if val[item][column]
+ @checks[item][column] .checked = val[item][column]
+ return
+
+# attach it to onload
+cx = cur_frm.cscript
+cx.onload = (doc, dt, dn) ->
+
+ # make the content grid
+ cx.content_grid = new CheckGrid
+ parent: cur_frm.fields_dict.Body.wrapper
+ label: 'Email Settings'
+ items: content_items
+ columns: ['Item','Daily','Weekly']
+ widths: ['60%', '20%', '20%']
+ description: 'Select items to be compiled for Email Digest'
+
+ # make the email grid
+ cx.email_grid = new CheckGrid
+ parent: cur_frm.fields_dict.Body.wrapper
+ label: 'Send To'
+ items: ['test1@erpnext', 'test2@erpnext']
+ columns: ['Email','Daily','Weekly']
+ widths: ['60%', '20%', '20%']
+ description: 'Select who gets daily and weekly mails'
+
+ cx.content_grid.set JSON.parse doc.content_config if doc.content_config
+ cx.email_grid.set JSON.parse doc.email_config if doc.email_config
+
+ return
+
+# update the data before sending
+cx.validate = (doc, dt, dn) ->
+ doc.content_config = JSON.stringify cx.content_grid.get()
+ doc.email_config = JSON.stringify cx.email_grid.get()
+
\ No newline at end of file
diff --git a/setup/doctype/email_digest/email_digest.css b/setup/doctype/email_digest/email_digest.css
new file mode 100644
index 0000000..f61dacc
--- /dev/null
+++ b/setup/doctype/email_digest/email_digest.css
@@ -0,0 +1,18 @@
+
+div.check-grid {
+ margin: 17px;
+}
+
+div.check-grid table {
+ border-collapse: collapse;
+}
+
+div.check-grid table td {
+ padding: 3px;
+ border: 1px solid #aaa;
+}
+
+td.check-grid-head {
+ font-weight: bold;
+ text-align: center;
+}
\ No newline at end of file
diff --git a/setup/doctype/email_digest/email_digest.js b/setup/doctype/email_digest/email_digest.js
new file mode 100644
index 0000000..ddb13f4
--- /dev/null
+++ b/setup/doctype/email_digest/email_digest.js
@@ -0,0 +1,108 @@
+(function() {
+ var CheckGrid, content_items, cx;
+ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+ content_items = ['Sales', 'Expenses', 'Bank Balance', 'Activity'];
+ CheckGrid = (function() {
+ function CheckGrid(args) {
+ this.args = args;
+ this.set = __bind(this.set, this);
+ this.get = __bind(this.get, this);
+ $.extend(this, args);
+ this.wrapper = $a(this.parent, 'div', 'check-grid round');
+ this.render();
+ }
+ CheckGrid.prototype.render = function() {
+ var i, _ref;
+ $a(this.wrapper, 'h3', 'check-grid-title', null, this.label);
+ if (this.description) {
+ $a(this.wrapper, 'div', 'help-box', null, this.description);
+ }
+ this.tab = make_table(this.wrapper, this.items.length + 1, this.columns.length, '100%', this.widths);
+ this.checks = {};
+ for (i = 0, _ref = this.columns.length - 1; 0 <= _ref ? i <= _ref : i >= _ref; 0 <= _ref ? i++ : i--) {
+ $($td(this.tab, 0, i)).addClass('check-grid-head gradient').html(this.columns[i]);
+ }
+ return this.render_rows();
+ };
+ CheckGrid.prototype.render_rows = function() {
+ var c, check, i, _ref, _results;
+ _results = [];
+ for (i = 0, _ref = this.items.length - 1; 0 <= _ref ? i <= _ref : i >= _ref; 0 <= _ref ? i++ : i--) {
+ $td(this.tab, i + 1, 0).innerHTML = this.items[i];
+ this.checks[this.items[i]] = {};
+ _results.push((function() {
+ var _ref2, _results2;
+ _results2 = [];
+ for (c = 1, _ref2 = this.columns.length - 1; 1 <= _ref2 ? c <= _ref2 : c >= _ref2; 1 <= _ref2 ? c++ : c--) {
+ check = $a_input($td(this.tab, i + 1, c), 'checkbox');
+ check.item = this.items[i];
+ check.column = this.columns[c];
+ _results2.push(this.checks[this.items[i]][this.columns[c]] = check);
+ }
+ return _results2;
+ }).call(this));
+ }
+ return _results;
+ };
+ CheckGrid.prototype.get = function() {
+ var check, column, item, val, _i, _j, _len, _len2, _name, _ref, _ref2;
+ val = {};
+ _ref = keys(this.checks);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ item = _ref[_i];
+ _ref2 = keys(this.checks[item]);
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ column = _ref2[_j];
+ check = this.checks[item][column];
+ val[_name = check.item] || (val[_name] = {});
+ val[check.item][check.column] = check.checked ? 1 : 0;
+ }
+ }
+ return val;
+ };
+ CheckGrid.prototype.set = function(val) {
+ var column, item, _i, _j, _len, _len2, _ref, _ref2;
+ _ref = keys(this.checks);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ item = _ref[_i];
+ _ref2 = keys(this.checks[item]);
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ column = _ref2[_j];
+ if (val[item][column]) {
+ this.checks[item][column].checked = val[item][column];
+ }
+ }
+ }
+ };
+ return CheckGrid;
+ })();
+ cx = cur_frm.cscript;
+ cx.onload = function(doc, dt, dn) {
+ cx.content_grid = new CheckGrid({
+ parent: cur_frm.fields_dict.Body.wrapper,
+ label: 'Email Settings',
+ items: content_items,
+ columns: ['Item', 'Daily', 'Weekly'],
+ widths: ['60%', '20%', '20%'],
+ description: 'Select items to be compiled for Email Digest'
+ });
+ cx.email_grid = new CheckGrid({
+ parent: cur_frm.fields_dict.Body.wrapper,
+ label: 'Send To',
+ items: ['test1@erpnext', 'test2@erpnext'],
+ columns: ['Email', 'Daily', 'Weekly'],
+ widths: ['60%', '20%', '20%'],
+ description: 'Select who gets daily and weekly mails'
+ });
+ if (doc.content_config) {
+ cx.content_grid.set(JSON.parse(doc.content_config));
+ }
+ if (doc.email_config) {
+ cx.email_grid.set(JSON.parse(doc.email_config));
+ }
+ };
+ cx.validate = function(doc, dt, dn) {
+ doc.content_config = JSON.stringify(cx.content_grid.get());
+ return doc.email_config = JSON.stringify(cx.email_grid.get());
+ };
+}).call(this);
diff --git a/setup/doctype/email_digest/email_digest.txt b/setup/doctype/email_digest/email_digest.txt
new file mode 100644
index 0000000..026caa7
--- /dev/null
+++ b/setup/doctype/email_digest/email_digest.txt
@@ -0,0 +1,89 @@
+# DocType, Email Digest
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2011-07-27 14:23:09',
+ 'docstatus': 0,
+ 'modified': '2011-07-27 17:32:27',
+ 'modified_by': 'Administrator',
+ 'owner': 'Administrator'
+ },
+
+ # These values are common for all DocType
+ {
+ '_last_update': '1311760331',
+ 'colour': 'White:FFF',
+ 'doctype': 'DocType',
+ 'issingle': 1,
+ 'module': 'Setup',
+ 'name': '__common__',
+ 'section_style': 'Simple',
+ 'show_in_menu': 0,
+ 'version': 4
+ },
+
+ # These values are common for all DocField
+ {
+ 'doctype': 'DocField',
+ 'name': '__common__',
+ 'parent': 'Email Digest',
+ 'parentfield': 'fields',
+ 'parenttype': 'DocType',
+ 'permlevel': 0
+ },
+
+ # These values are common for all DocPerm
+ {
+ 'create': 1,
+ 'doctype': 'DocPerm',
+ 'idx': 1,
+ 'name': '__common__',
+ 'parent': 'Email Digest',
+ 'parentfield': 'permissions',
+ 'parenttype': 'DocType',
+ 'permlevel': 0,
+ 'read': 1,
+ 'role': 'Administrator',
+ 'write': 1
+ },
+
+ # DocType, Email Digest
+ {
+ 'doctype': 'DocType',
+ 'name': 'Email Digest'
+ },
+
+ # DocPerm
+ {
+ 'doctype': 'DocPerm'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldtype': 'HTML',
+ 'idx': 1,
+ 'label': 'Body'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'content_config',
+ 'fieldtype': 'Text',
+ 'hidden': 1,
+ 'idx': 2,
+ 'label': 'Content Config'
+ },
+
+ # DocField
+ {
+ 'doctype': 'DocField',
+ 'fieldname': 'email_config',
+ 'fieldtype': 'Text',
+ 'hidden': 1,
+ 'idx': 3,
+ 'label': 'Email Config'
+ }
+]
\ No newline at end of file
diff --git a/startup/__init__.py b/startup/__init__.py
index 5fd6ccd..bdbde16 100644
--- a/startup/__init__.py
+++ b/startup/__init__.py
@@ -9,6 +9,7 @@
body, span, div, td, input, textarea, button, select {
font-family: Verdana, Arial, Sans Serif;
+ font-size: 12px
}
</style>