diff --git a/build.json b/build.json
index 24e9d4559c..ebe4589ef0 100644
--- a/build.json
+++ b/build.json
@@ -69,6 +69,8 @@
"lib/css/bootstrap/navbar.css",
"lib/css/bootstrap/dropdown.css",
"lib/css/bootstrap/tooltip.css",
+ "lib/css/bootstrap/label.css",
+ "lib/css/bootstrap/icons.css",
"erpnext/startup/startup.css"
]
},
diff --git a/css/all-app.css b/css/all-app.css
index 53b33d2801..8ebc41eb93 100644
--- a/css/all-app.css
+++ b/css/all-app.css
@@ -2786,6 +2786,426 @@ button.btn.small, input[type="submit"].btn.small {
.popover-content p, .popover-content ul, .popover-content ol {
margin-bottom: 0;
}
+/*
+ * lib/css/bootstrap/label.css
+ */.label {
+ padding: 2px 4px 3px;
+ font-size: 11.049999999999999px;
+ font-weight: bold;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+ background-color: #999999;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+.label:hover {
+ color: #ffffff;
+ text-decoration: none;
+}
+.label-important {
+ background-color: #b94a48;
+}
+.label-important:hover {
+ background-color: #953b39;
+}
+.label-warning {
+ background-color: #f89406;
+}
+.label-warning:hover {
+ background-color: #c67605;
+}
+.label-success {
+ background-color: #468847;
+}
+.label-success:hover {
+ background-color: #356635;
+}
+.label-info {
+ background-color: #3a87ad;
+}
+.label-info:hover {
+ background-color: #2d6987;
+}
+/*
+ * lib/css/bootstrap/icons.css
+ */[class^="icon-"], [class*=" icon-"] {
+ display: inline-block;
+ width: 14px;
+ height: 14px;
+ line-height: 14px;
+ vertical-align: text-top;
+ background-image: url("../lib/images/icons/glyphicons-halflings.png");
+ background-position: 14px 14px;
+ background-repeat: no-repeat;
+ *margin-right: .3em;
+}
+[class^="icon-"]:last-child, [class*=" icon-"]:last-child {
+ *margin-left: 0;
+}
+.icon-white {
+ background-image: url("../lib/images/icons/glyphicons-halflings-white.png");
+}
+.icon-glass {
+ background-position: 0 0;
+}
+.icon-music {
+ background-position: -24px 0;
+}
+.icon-search {
+ background-position: -48px 0;
+}
+.icon-envelope {
+ background-position: -72px 0;
+}
+.icon-heart {
+ background-position: -96px 0;
+}
+.icon-star {
+ background-position: -120px 0;
+}
+.icon-star-empty {
+ background-position: -144px 0;
+}
+.icon-user {
+ background-position: -168px 0;
+}
+.icon-film {
+ background-position: -192px 0;
+}
+.icon-th-large {
+ background-position: -216px 0;
+}
+.icon-th {
+ background-position: -240px 0;
+}
+.icon-th-list {
+ background-position: -264px 0;
+}
+.icon-ok {
+ background-position: -288px 0;
+}
+.icon-remove {
+ background-position: -312px 0;
+}
+.icon-zoom-in {
+ background-position: -336px 0;
+}
+.icon-zoom-out {
+ background-position: -360px 0;
+}
+.icon-off {
+ background-position: -384px 0;
+}
+.icon-signal {
+ background-position: -408px 0;
+}
+.icon-cog {
+ background-position: -432px 0;
+}
+.icon-trash {
+ background-position: -456px 0;
+}
+.icon-home {
+ background-position: 0 -24px;
+}
+.icon-file {
+ background-position: -24px -24px;
+}
+.icon-time {
+ background-position: -48px -24px;
+}
+.icon-road {
+ background-position: -72px -24px;
+}
+.icon-download-alt {
+ background-position: -96px -24px;
+}
+.icon-download {
+ background-position: -120px -24px;
+}
+.icon-upload {
+ background-position: -144px -24px;
+}
+.icon-inbox {
+ background-position: -168px -24px;
+}
+.icon-play-circle {
+ background-position: -192px -24px;
+}
+.icon-repeat {
+ background-position: -216px -24px;
+}
+.icon-refresh {
+ background-position: -240px -24px;
+}
+.icon-list-alt {
+ background-position: -264px -24px;
+}
+.icon-lock {
+ background-position: -287px -24px;
+}
+.icon-flag {
+ background-position: -312px -24px;
+}
+.icon-headphones {
+ background-position: -336px -24px;
+}
+.icon-volume-off {
+ background-position: -360px -24px;
+}
+.icon-volume-down {
+ background-position: -384px -24px;
+}
+.icon-volume-up {
+ background-position: -408px -24px;
+}
+.icon-qrcode {
+ background-position: -432px -24px;
+}
+.icon-barcode {
+ background-position: -456px -24px;
+}
+.icon-tag {
+ background-position: 0 -48px;
+}
+.icon-tags {
+ background-position: -25px -48px;
+}
+.icon-book {
+ background-position: -48px -48px;
+}
+.icon-bookmark {
+ background-position: -72px -48px;
+}
+.icon-print {
+ background-position: -96px -48px;
+}
+.icon-camera {
+ background-position: -120px -48px;
+}
+.icon-font {
+ background-position: -144px -48px;
+}
+.icon-bold {
+ background-position: -167px -48px;
+}
+.icon-italic {
+ background-position: -192px -48px;
+}
+.icon-text-height {
+ background-position: -216px -48px;
+}
+.icon-text-width {
+ background-position: -240px -48px;
+}
+.icon-align-left {
+ background-position: -264px -48px;
+}
+.icon-align-center {
+ background-position: -288px -48px;
+}
+.icon-align-right {
+ background-position: -312px -48px;
+}
+.icon-align-justify {
+ background-position: -336px -48px;
+}
+.icon-list {
+ background-position: -360px -48px;
+}
+.icon-indent-left {
+ background-position: -384px -48px;
+}
+.icon-indent-right {
+ background-position: -408px -48px;
+}
+.icon-facetime-video {
+ background-position: -432px -48px;
+}
+.icon-picture {
+ background-position: -456px -48px;
+}
+.icon-pencil {
+ background-position: 0 -72px;
+}
+.icon-map-marker {
+ background-position: -24px -72px;
+}
+.icon-adjust {
+ background-position: -48px -72px;
+}
+.icon-tint {
+ background-position: -72px -72px;
+}
+.icon-edit {
+ background-position: -96px -72px;
+}
+.icon-share {
+ background-position: -120px -72px;
+}
+.icon-check {
+ background-position: -144px -72px;
+}
+.icon-move {
+ background-position: -168px -72px;
+}
+.icon-step-backward {
+ background-position: -192px -72px;
+}
+.icon-fast-backward {
+ background-position: -216px -72px;
+}
+.icon-backward {
+ background-position: -240px -72px;
+}
+.icon-play {
+ background-position: -264px -72px;
+}
+.icon-pause {
+ background-position: -288px -72px;
+}
+.icon-stop {
+ background-position: -312px -72px;
+}
+.icon-forward {
+ background-position: -336px -72px;
+}
+.icon-fast-forward {
+ background-position: -360px -72px;
+}
+.icon-step-forward {
+ background-position: -384px -72px;
+}
+.icon-eject {
+ background-position: -408px -72px;
+}
+.icon-chevron-left {
+ background-position: -432px -72px;
+}
+.icon-chevron-right {
+ background-position: -456px -72px;
+}
+.icon-plus-sign {
+ background-position: 0 -96px;
+}
+.icon-minus-sign {
+ background-position: -24px -96px;
+}
+.icon-remove-sign {
+ background-position: -48px -96px;
+}
+.icon-ok-sign {
+ background-position: -72px -96px;
+}
+.icon-question-sign {
+ background-position: -96px -96px;
+}
+.icon-info-sign {
+ background-position: -120px -96px;
+}
+.icon-screenshot {
+ background-position: -144px -96px;
+}
+.icon-remove-circle {
+ background-position: -168px -96px;
+}
+.icon-ok-circle {
+ background-position: -192px -96px;
+}
+.icon-ban-circle {
+ background-position: -216px -96px;
+}
+.icon-arrow-left {
+ background-position: -240px -96px;
+}
+.icon-arrow-right {
+ background-position: -264px -96px;
+}
+.icon-arrow-up {
+ background-position: -289px -96px;
+}
+.icon-arrow-down {
+ background-position: -312px -96px;
+}
+.icon-share-alt {
+ background-position: -336px -96px;
+}
+.icon-resize-full {
+ background-position: -360px -96px;
+}
+.icon-resize-small {
+ background-position: -384px -96px;
+}
+.icon-plus {
+ background-position: -408px -96px;
+}
+.icon-minus {
+ background-position: -433px -96px;
+}
+.icon-asterisk {
+ background-position: -456px -96px;
+}
+.icon-exclamation-sign {
+ background-position: 0 -120px;
+}
+.icon-gift {
+ background-position: -24px -120px;
+}
+.icon-leaf {
+ background-position: -48px -120px;
+}
+.icon-fire {
+ background-position: -72px -120px;
+}
+.icon-eye-open {
+ background-position: -96px -120px;
+}
+.icon-eye-close {
+ background-position: -120px -120px;
+}
+.icon-warning-sign {
+ background-position: -144px -120px;
+}
+.icon-plane {
+ background-position: -168px -120px;
+}
+.icon-calendar {
+ background-position: -192px -120px;
+}
+.icon-random {
+ background-position: -216px -120px;
+}
+.icon-comment {
+ background-position: -240px -120px;
+}
+.icon-magnet {
+ background-position: -264px -120px;
+}
+.icon-chevron-up {
+ background-position: -288px -120px;
+}
+.icon-chevron-down {
+ background-position: -313px -119px;
+}
+.icon-retweet {
+ background-position: -336px -120px;
+}
+.icon-shopping-cart {
+ background-position: -360px -120px;
+}
+.icon-folder-close {
+ background-position: -384px -120px;
+}
+.icon-folder-open {
+ background-position: -408px -120px;
+}
+.icon-resize-vertical {
+ background-position: -432px -119px;
+}
+.icon-resize-horizontal {
+ background-position: -456px -118px;
+}
/*
* erpnext/startup/startup.css
*/h1, h2, h3, h4, h5 {
diff --git a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
index 8415da4cf9..4671143a3a 100644
--- a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
+++ b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
@@ -47,7 +47,7 @@ def patch_primary_contact():
GROUP BY sales_partner HAVING SUM(IFNULL(is_primary_contact, 0))=0
)
""", as_list=1)
- names = ", ".join(['"' + str(r[0]) + '"' for r in res if r])
+ names = ", ".join(['"' + unicode(r[0]) + '"' for r in res if r])
if names: webnotes.conn.sql("UPDATE `tabContact` SET is_primary_contact=1 WHERE name IN (%s)" % names)
def patch_primary_address():
@@ -70,5 +70,5 @@ def patch_primary_address():
AND SUM(IFNULL(is_shipping_address, 0))=0
)
""", as_list=1)
- names = ", ".join(['"' + str(r[0]) + '"' for r in res if r])
+ names = ", ".join(['"' + unicode(r[0]) + '"' for r in res if r])
if names: webnotes.conn.sql("UPDATE `tabAddress` SET is_primary_address=1 WHERE name IN (%s)" % names)
diff --git a/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt b/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt
index fe1e6e57c1..f63b2cc822 100644
--- a/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt
+++ b/erpnext/selling/search_criteria/customer_address_contact/customer_address_contact.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-02-22 15:45:49',
+ 'creation': '2012-02-23 14:18:56',
'docstatus': 0,
- 'modified': '2012-02-22 15:45:49',
+ 'modified': '2012-02-23 14:18:56',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
diff --git a/erpnext/utilities/page/calendar/__init__.py b/erpnext/utilities/page/calendar/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/calendar/calendar.css b/erpnext/utilities/page/calendar/calendar.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/calendar/calendar.html b/erpnext/utilities/page/calendar/calendar.html
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/calendar/calendar.js b/erpnext/utilities/page/calendar/calendar.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/calendar/calendar.py b/erpnext/utilities/page/calendar/calendar.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/calendar/calendar.txt b/erpnext/utilities/page/calendar/calendar.txt
new file mode 100644
index 0000000000..668c909295
--- /dev/null
+++ b/erpnext/utilities/page/calendar/calendar.txt
@@ -0,0 +1,28 @@
+# Page, calendar
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-02-24 11:24:12',
+ 'docstatus': 0,
+ 'modified': '2012-02-24 11:24:12',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
+ },
+
+ # These values are common for all Page
+ {
+ 'doctype': 'Page',
+ 'module': u'Utilities',
+ 'name': '__common__',
+ 'page_name': u'calendar',
+ 'standard': u'Yes',
+ 'title': u'Calendar'
+ },
+
+ # Page, calendar
+ {
+ 'doctype': 'Page',
+ 'name': u'calendar'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/utilities/page/messages/__init__.py b/erpnext/utilities/page/messages/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/messages/messages.css b/erpnext/utilities/page/messages/messages.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/messages/messages.html b/erpnext/utilities/page/messages/messages.html
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/messages/messages.js b/erpnext/utilities/page/messages/messages.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/messages/messages.py b/erpnext/utilities/page/messages/messages.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/messages/messages.txt b/erpnext/utilities/page/messages/messages.txt
new file mode 100644
index 0000000000..4ea71b2793
--- /dev/null
+++ b/erpnext/utilities/page/messages/messages.txt
@@ -0,0 +1,28 @@
+# Page, messages
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-02-24 11:21:57',
+ 'docstatus': 0,
+ 'modified': '2012-02-24 11:21:57',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
+ },
+
+ # These values are common for all Page
+ {
+ 'doctype': 'Page',
+ 'module': u'Utilities',
+ 'name': '__common__',
+ 'page_name': u'messages',
+ 'standard': u'Yes',
+ 'title': u'Messages'
+ },
+
+ # Page, messages
+ {
+ 'doctype': 'Page',
+ 'name': u'messages'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/utilities/page/todo/__init__.py b/erpnext/utilities/page/todo/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/erpnext/utilities/page/todo/todo.css b/erpnext/utilities/page/todo/todo.css
new file mode 100644
index 0000000000..9f15852674
--- /dev/null
+++ b/erpnext/utilities/page/todo/todo.css
@@ -0,0 +1,29 @@
+.todoitem {
+ margin-bottom: 11px;
+ height: 14px;
+}
+
+.todoitem .label {
+ width: 50px;
+ display: inline-block;
+ text-align: center;
+ margin-right: 7px;
+}
+
+.todoitem .close {
+ margin-left: 14px;
+ font-size: 14px;
+ float: left;
+}
+
+.todoitem .ref_link {
+ float: left;
+ margin-left: 14px;
+ display: inline-block;
+ line-height: 18px;
+}
+
+.todoitem .description {
+ cursor: pointer;
+ float: left;
+}
\ No newline at end of file
diff --git a/erpnext/utilities/page/todo/todo.html b/erpnext/utilities/page/todo/todo.html
new file mode 100644
index 0000000000..aa46d97a19
--- /dev/null
+++ b/erpnext/utilities/page/todo/todo.html
@@ -0,0 +1,10 @@
+
+
×
+
To Do
+
+
+
+
+ Add
+
+
\ No newline at end of file
diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js
new file mode 100644
index 0000000000..26919120ec
--- /dev/null
+++ b/erpnext/utilities/page/todo/todo.js
@@ -0,0 +1,132 @@
+wn.provide('erpnext.todo');
+
+erpnext.todo.refresh = function() {
+ wn.call({
+ method: 'utilities.page.todo.todo.get',
+ callback: function(r,rt) {
+ $('#todo-list').empty();
+ if(r.message) {
+ for(var i in r.message) {
+ new erpnext.todo.ToDoItem(r.message[i]);
+ }
+ } else {
+ $('#todo-list').html('Nothing to do :)
');
+ }
+ }
+ });
+
+ $('#add-todo').click(function() {
+ erpnext.todo.make_dialog({
+ date:get_today(), priority:'Medium', checked:0, description:''});
+ })
+}
+
+erpnext.todo.ToDoItem = Class.extend({
+ init: function(todo) {
+ label_map = {
+ 'High': 'label-important',
+ 'Medium': 'label-info',
+ 'Low':''
+ }
+ todo.labelclass = label_map[todo.priority];
+ todo.userdate = dateutil.str_to_user(todo.date);
+ $('#todo-list').append(repl('', todo));
+ $todo = $('div.todoitem:last');
+
+ if(todo.checked) {
+ $todo.find('.description').css('text-decoration', 'line-through');
+ }
+
+ if(!todo.reference_name)
+ $todo.find('.ref_link').toggle(false);
+
+ $todo.find('.description')
+ .data('todo', todo)
+ .click(function() {
+ erpnext.todo.make_dialog($(this).data('todo'));
+ return false;
+ });
+
+ $todo.find('.close')
+ .data('name', todo.name)
+ .click(function() {
+ $(this).parent().css('opacity', 0.5);
+ wn.call({
+ method:'utilities.page.todo.todo.delete',
+ args: {name: $(this).data('name')},
+ callback: function() {
+ erpnext.todo.refresh();
+ }
+ });
+ return false;
+ })
+ }
+});
+
+erpnext.todo.make_dialog = function(det) {
+ if(!erpnext.todo.dialog) {
+ var dialog = new wn.widgets.Dialog();
+ dialog.make({
+ width: 480,
+ title: 'To Do',
+ fields: [
+ {fieldtype:'Date', fieldname:'date', label:'Event Date', reqd:1},
+ {fieldtype:'Text', fieldname:'description', label:'Description', reqd:1},
+ {fieldtype:'Check', fieldname:'checked', label:'Completed'},
+ {fieldtype:'Select', fieldname:'priority', label:'Priority', reqd:1, 'options':['Medium','High','Low'].join('\n')},
+ {fieldtype:'Button', fieldname:'save', label:'Save'}
+ ]
+ });
+
+ dialog.fields_dict.save.input.onclick = function() {
+ erpnext.todo.save(this);
+ }
+ erpnext.todo.dialog = dialog;
+ }
+
+ if(det) {
+ erpnext.todo.dialog.set_values({
+ date: det.date,
+ priority: det.priority,
+ description: det.description,
+ checked: det.checked
+ });
+ erpnext.todo.dialog.det = det;
+ }
+ erpnext.todo.dialog.show();
+
+}
+
+erpnext.todo.save = function(btn) {
+ var d = erpnext.todo.dialog;
+ var det = d.get_values();
+
+ if(!det) {
+ return;
+ }
+
+ det.name = d.det.name || '';
+ wn.call({
+ method:'utilities.page.todo.todo.edit',
+ args: det,
+ btn: btn,
+ callback: function() {
+ erpnext.todo.dialog.hide();
+ erpnext.todo.refresh();
+ }
+ });
+}
+
+pscript.onload_todo = function() {
+ // load todos
+ erpnext.todo.refresh();
+}
\ No newline at end of file
diff --git a/erpnext/utilities/page/todo/todo.py b/erpnext/utilities/page/todo/todo.py
new file mode 100644
index 0000000000..c10809e8bf
--- /dev/null
+++ b/erpnext/utilities/page/todo/todo.py
@@ -0,0 +1,46 @@
+import webnotes
+from webnotes.model.doc import Document
+
+@webnotes.whitelist()
+def get(arg=None):
+ """get todo list"""
+ return webnotes.conn.sql("""select name, owner, description, date,
+ priority, checked, reference_type, reference_name, assigned_by
+ from `tabToDo Item` where owner=%s
+ order by field(priority, 'High', 'Medium', 'Low') asc, date asc""",
+ webnotes.session['user'], as_dict=1)
+
+@webnotes.whitelist()
+def edit(arg=None):
+ args = webnotes.form_dict
+
+ d = Document('ToDo Item', args.get('name') or None)
+ d.description = args['description']
+ d.date = args['date']
+ d.priority = args['priority']
+ d.checked = args.get('checked', 0)
+ d.owner = webnotes.session['user']
+ d.save(not args.get('name') and 1 or 0)
+
+ if args.get('name') and d.checked:
+ notify_assignment(d)
+
+ return d.name
+
+@webnotes.whitelist()
+def delete(arg=None):
+ name = webnotes.form_dict['name']
+ d = Document('ToDo Item', name)
+ if d and d.name:
+ notify_assignment(d)
+ webnotes.conn.sql("delete from `tabToDo Item` where name = %s", name)
+
+def notify_assignment(d):
+ doc_type = d.reference_type
+ doc_name = d.reference_name
+ assigned_by = d.assigned_by
+
+ if doc_type and doc_name and assigned_by:
+ from webnotes.widgets.form import assign_to
+ assign_to.notify_assignment(assigned_by, d.owner, doc_type, doc_name)
+
\ No newline at end of file
diff --git a/erpnext/utilities/page/todo/todo.txt b/erpnext/utilities/page/todo/todo.txt
new file mode 100644
index 0000000000..73109064bf
--- /dev/null
+++ b/erpnext/utilities/page/todo/todo.txt
@@ -0,0 +1,28 @@
+# Page, todo
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-02-23 13:59:03',
+ 'docstatus': 0,
+ 'modified': '2012-02-23 13:59:03',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
+ },
+
+ # These values are common for all Page
+ {
+ 'doctype': 'Page',
+ 'module': u'Utilities',
+ 'name': '__common__',
+ 'page_name': u'todo',
+ 'standard': u'Yes',
+ 'title': u'To Do'
+ },
+
+ # Page, todo
+ {
+ 'doctype': 'Page',
+ 'name': u'todo'
+ }
+]
\ No newline at end of file
diff --git a/js/all-app.js b/js/all-app.js
index f0bed4f1f3..655ac39e43 100644
--- a/js/all-app.js
+++ b/js/all-app.js
@@ -446,7 +446,7 @@ function $c_obj(doclist,method,arg,call_back,no_spinner,freeze_msg,btn){var args
if(typeof doclist=='string')args.doctype=doclist;else args.docs=compress_doclist(doclist)
$c('runserverobj',args,call_back,null,no_spinner,freeze_msg,btn);}
function $c_page(module,page,method,arg,call_back,no_spinner,freeze_msg,btn){if(arg&&!arg.substr)arg=JSON.stringify(arg);$c(module+'.page.'+page+'.'+page+'.'+method,{'arg':arg},call_back,null,no_spinner,freeze_msg,btn);}
-wn.call=function(args){if(args.module&&args.page){$c_page(args.module,args.page,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else if(args.docs){$c_obj(args.doc,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else{$c(args.method,args.args,args.callback,false,args.no_spinner,false,args.btn);}}
+wn.call=function(args){if(!args.args)args.args={};if(args.module&&args.page){$c_page(args.module,args.page,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else if(args.docs){$c_obj(args.doc,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else{$c(args.method,args.args,args.callback,false,args.no_spinner,false,args.btn);}}
function $c_obj_csv(doclist,method,arg){var args={}
args.cmd='runserverobj';args.as_csv=1;args.method=method;args.arg=arg;if(doclist.substr)
args.doctype=doclist;else
@@ -1317,8 +1317,7 @@ if(rd[1]){var dt=rd[0];var dn=rd[1];this.add(dt,dn,0);}}}});
/*
* lib/js/wn/ui/toolbar/toolbar.js
*/
-wn.ui.toolbar.Toolbar=Class.extend({init:function(){this.make();this.make_home();this.make_document();wn.ui.toolbar.recent=new wn.ui.toolbar.RecentDocs();if(in_list(user_roles,'Administrator'))
-this.make_options();this.make_tools();this.set_user_name();this.make_logout();$('.dropdown-toggle').dropdown();$(document).trigger('toolbar_setup');},make:function(){$('header').append('\
+wn.ui.toolbar.Toolbar=Class.extend({init:function(){this.make();this.make_home();this.make_document();this.make_apps();wn.ui.toolbar.recent=new wn.ui.toolbar.RecentDocs();this.make_tools();this.set_user_name();this.make_logout();$('.dropdown-toggle').dropdown();$(document).trigger('toolbar_setup');},make:function(){$('header').append('
\
\
\
\
@@ -1335,13 +1334,17 @@ this.make_options();this.make_tools();this.set_user_name();this.make_logout();$(
\
\
\
-
');},make_home:function(){$('.navbar .nav:first').append('
Home ')},make_document:function(){wn.ui.toolbar.new_dialog=new wn.ui.toolbar.NewDialog();wn.ui.toolbar.search=new wn.ui.toolbar.Search();wn.ui.toolbar.report=new wn.ui.toolbar.Report();$('.navbar .nav:first').append('
\
+ ');},make_home:function(){$('.navbar .nav:first').append('\
+ Home ');$('.navbar .brand').attr('href',"#!"+home_page);},make_document:function(){wn.ui.toolbar.new_dialog=new wn.ui.toolbar.NewDialog();wn.ui.toolbar.search=new wn.ui.toolbar.Search();wn.ui.toolbar.report=new wn.ui.toolbar.Report();$('.navbar .nav:first').append('\
Document \
\
');},make_tools:function(){$('.navbar .nav:first').append('\
\
');if(has_common(user_roles,['Administrator','System Manager'])){$('#toolbar-tools').append('\
- Download Backup ');}},make_options:function(){$('.navbar .nav:first').append('\
+ Download Backup ');}},make_apps:function(){$('.navbar .nav:first').append('\
Options \
- ');profile.start_items.sort(function(a,b){return(a[4]-b[4])});for(var i=0;i\
- %(dn)s ',{type:(ispage?'':'Form/'),dt:(ispage?'':(d[0]+'/')),dn:d[5]||d[1]}));}},set_user_name:function(){var fn=user_fullname;if(fn.length>15)fn=fn.substr(0,12)+'...';$('#toolbar-user-link').html(fn+' ');},make_logout:function(){$('#toolbar-user').append('Logout ');}});wn.ui.toolbar.clear_cache=function(){localStorage&&localStorage.clear();$c('webnotes.session_cache.clear',{},function(r,rt){show_alert(r.message);});return false;}
+ ');},set_user_name:function(){var fn=user_fullname;if(fn.length>15)fn=fn.substr(0,12)+'...';$('#toolbar-user-link').html(fn+' ');},make_logout:function(){$('#toolbar-user').append('Logout ');}});wn.ui.toolbar.clear_cache=function(){localStorage&&localStorage.clear();$c('webnotes.session_cache.clear',{},function(r,rt){show_alert(r.message);});return false;}
wn.ui.toolbar.download_backup=function(){$c('webnotes.utils.backups.get_backup',{},function(r,rt){});return false;}
wn.ui.toolbar.show_about=function(){try{wn.require('lib/js/wn/misc/about.js');wn.ui.misc.about();}catch(e){console.log(e);}
return false;}
@@ -2155,7 +2161,7 @@ me.dialog.clear();me.dialog.show();}});
/*
* lib/js/legacy/app.js
*/
-var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;profile.start_items=r.start_items;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
+var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
wn.control_panel=r.control_panel;}
var setup_history=function(r){rename_observers.push(nav_obj);}
diff --git a/js/all-web.js b/js/all-web.js
index 01e80f6def..fdf5b652bd 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -372,7 +372,7 @@ function $c_obj(doclist,method,arg,call_back,no_spinner,freeze_msg,btn){var args
if(typeof doclist=='string')args.doctype=doclist;else args.docs=compress_doclist(doclist)
$c('runserverobj',args,call_back,null,no_spinner,freeze_msg,btn);}
function $c_page(module,page,method,arg,call_back,no_spinner,freeze_msg,btn){if(arg&&!arg.substr)arg=JSON.stringify(arg);$c(module+'.page.'+page+'.'+page+'.'+method,{'arg':arg},call_back,null,no_spinner,freeze_msg,btn);}
-wn.call=function(args){if(args.module&&args.page){$c_page(args.module,args.page,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else if(args.docs){$c_obj(args.doc,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else{$c(args.method,args.args,args.callback,false,args.no_spinner,false,args.btn);}}
+wn.call=function(args){if(!args.args)args.args={};if(args.module&&args.page){$c_page(args.module,args.page,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else if(args.docs){$c_obj(args.doc,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else{$c(args.method,args.args,args.callback,false,args.no_spinner,false,args.btn);}}
function $c_obj_csv(doclist,method,arg){var args={}
args.cmd='runserverobj';args.as_csv=1;args.method=method;args.arg=arg;if(doclist.substr)
args.doctype=doclist;else
@@ -1000,7 +1000,7 @@ this.setup();}
/*
* lib/js/legacy/app.js
*/
-var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;profile.start_items=r.start_items;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
+var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=profile.first_name+(r.profile.last_name?(' '+r.profile.last_name):'');user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
wn.control_panel=r.control_panel;}
var setup_history=function(r){rename_observers.push(nav_obj);}
diff --git a/temp.py b/temp.py
new file mode 100644
index 0000000000..cdbd4b0c44
--- /dev/null
+++ b/temp.py
@@ -0,0 +1,55 @@
+license = """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 ."""
+
+license2 = """Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
+
+MIT License (MIT)
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"""
+
+
+if __name__=='__main__':
+ import os
+ clicense = '\n'.join([('# ' + l) for l in license2.split('\n')])
+
+ for wt in os.walk('lib/py/build/'):
+ for fname in wt[2]:
+ if fname.endswith('.py'):
+ path = os.path.join(wt[0], fname)
+ with open(path, 'r') as codefile:
+ codetxt = codefile.read()
+
+ if codetxt.strip():
+ with open(path, 'w') as codefile:
+ codefile.write(clicense + '\n\n' + codetxt)
+
+ print 'updated in ' + path
\ No newline at end of file
diff --git a/version.num b/version.num
index 4aeea8c347..f95076e1d6 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-650
\ No newline at end of file
+662
\ No newline at end of file