added todo
This commit is contained in:
parent
3966f1dc5d
commit
2886b95da0
@ -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"
|
||||
]
|
||||
},
|
||||
|
420
css/all-app.css
420
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 {
|
||||
|
@ -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)
|
||||
|
@ -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'
|
||||
},
|
||||
|
0
erpnext/utilities/page/calendar/__init__.py
Normal file
0
erpnext/utilities/page/calendar/__init__.py
Normal file
0
erpnext/utilities/page/calendar/calendar.css
Normal file
0
erpnext/utilities/page/calendar/calendar.css
Normal file
0
erpnext/utilities/page/calendar/calendar.html
Normal file
0
erpnext/utilities/page/calendar/calendar.html
Normal file
0
erpnext/utilities/page/calendar/calendar.js
Normal file
0
erpnext/utilities/page/calendar/calendar.js
Normal file
0
erpnext/utilities/page/calendar/calendar.py
Normal file
0
erpnext/utilities/page/calendar/calendar.py
Normal file
28
erpnext/utilities/page/calendar/calendar.txt
Normal file
28
erpnext/utilities/page/calendar/calendar.txt
Normal file
@ -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'
|
||||
}
|
||||
]
|
0
erpnext/utilities/page/messages/__init__.py
Normal file
0
erpnext/utilities/page/messages/__init__.py
Normal file
0
erpnext/utilities/page/messages/messages.css
Normal file
0
erpnext/utilities/page/messages/messages.css
Normal file
0
erpnext/utilities/page/messages/messages.html
Normal file
0
erpnext/utilities/page/messages/messages.html
Normal file
0
erpnext/utilities/page/messages/messages.js
Normal file
0
erpnext/utilities/page/messages/messages.js
Normal file
0
erpnext/utilities/page/messages/messages.py
Normal file
0
erpnext/utilities/page/messages/messages.py
Normal file
28
erpnext/utilities/page/messages/messages.txt
Normal file
28
erpnext/utilities/page/messages/messages.txt
Normal file
@ -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'
|
||||
}
|
||||
]
|
0
erpnext/utilities/page/todo/__init__.py
Normal file
0
erpnext/utilities/page/todo/__init__.py
Normal file
29
erpnext/utilities/page/todo/todo.css
Normal file
29
erpnext/utilities/page/todo/todo.css
Normal file
@ -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;
|
||||
}
|
10
erpnext/utilities/page/todo/todo.html
Normal file
10
erpnext/utilities/page/todo/todo.html
Normal file
@ -0,0 +1,10 @@
|
||||
<div class="layout-wrapper" style="min-height: 300px">
|
||||
<a class="close" onclick="window.history.back();">×</a>
|
||||
<h1>To Do</h1>
|
||||
<br>
|
||||
<div id="todo-list">
|
||||
</div>
|
||||
<div style="margin-top: 21px">
|
||||
<button id="add-todo" class="btn btn-small"><i class="icon-plus"></i> Add</button>
|
||||
</div>
|
||||
</div>
|
132
erpnext/utilities/page/todo/todo.js
Normal file
132
erpnext/utilities/page/todo/todo.js
Normal file
@ -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('<div class="help-box">Nothing to do :)</div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#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('<div class="todoitem">\
|
||||
<span class="description">\
|
||||
<span class="label %(labelclass)s">%(priority)s</span>\
|
||||
<span class="help" style="margin-right: 7px">%(userdate)s</span>\
|
||||
%(description)s</span>\
|
||||
<span class="ref_link">→\
|
||||
<a href="#!Form/%(reference_type)s/%(reference_name)s">\
|
||||
[%(reference_name)s]</a></span>\
|
||||
<a href="#" class="close">×</a>\
|
||||
</div>', 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();
|
||||
}
|
46
erpnext/utilities/page/todo/todo.py
Normal file
46
erpnext/utilities/page/todo/todo.py
Normal file
@ -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)
|
||||
|
28
erpnext/utilities/page/todo/todo.txt
Normal file
28
erpnext/utilities/page/todo/todo.txt
Normal file
@ -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'
|
||||
}
|
||||
]
|
@ -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('<div class="navbar navbar-fixed-top">\
|
||||
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('<div class="navbar navbar-fixed-top">\
|
||||
<div class="navbar-inner">\
|
||||
<div class="container">\
|
||||
<a class="brand"></a>\
|
||||
@ -1335,13 +1334,17 @@ this.make_options();this.make_tools();this.set_user_name();this.make_logout();$(
|
||||
</ul>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>');},make_home:function(){$('.navbar .nav:first').append('<li data-name="navbar-home"><a href="#'+home_page+'">Home</a></li>')},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('<li class="dropdown">\
|
||||
</div>');},make_home:function(){$('.navbar .nav:first').append('<li data-name="navbar-home">\
|
||||
<a href="#!'+home_page+'">Home</a></li>');$('.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('<li class="dropdown">\
|
||||
<a class="dropdown-toggle" href="#" data-toggle="dropdown"\
|
||||
onclick="return false;">Document<b class="caret"></b></a>\
|
||||
<ul class="dropdown-menu" id="toolbar-document">\
|
||||
<li><a href="#" onclick="return wn.ui.toolbar.new_dialog.show();">New</a></li>\
|
||||
<li><a href="#" onclick="return wn.ui.toolbar.search.show();">Search</a></li>\
|
||||
<li><a href="#" onclick="return wn.ui.toolbar.report.show();">Report</a></li>\
|
||||
<li><a href="#" onclick="return wn.ui.toolbar.new_dialog.show();">\
|
||||
<i class="icon-plus"></i> New</a></li>\
|
||||
<li><a href="#" onclick="return wn.ui.toolbar.search.show();">\
|
||||
<i class="icon-search"></i> Search</a></li>\
|
||||
<li><a href="#" onclick="return wn.ui.toolbar.report.show();">\
|
||||
<i class="icon-list"></i> Report</a></li>\
|
||||
</ul>\
|
||||
</li>');},make_tools:function(){$('.navbar .nav:first').append('<li class="dropdown">\
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" \
|
||||
@ -1353,13 +1356,16 @@ this.make_options();this.make_tools();this.set_user_name();this.make_logout();$(
|
||||
</ul>\
|
||||
</li>');if(has_common(user_roles,['Administrator','System Manager'])){$('#toolbar-tools').append('<li><a href="#" \
|
||||
onclick="return wn.ui.toolbar.download_backup();">\
|
||||
Download Backup</a></li>');}},make_options:function(){$('.navbar .nav:first').append('<li class="dropdown">\
|
||||
Download Backup</a></li>');}},make_apps:function(){$('.navbar .nav:first').append('<li class="dropdown">\
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" \
|
||||
href="#" onclick="return false;">Options<b class="caret"></b></a>\
|
||||
<ul class="dropdown-menu" id="toolbar-options">\
|
||||
href="#" onclick="return false;">Apps<b class="caret"></b></a>\
|
||||
<ul class="dropdown-menu">\
|
||||
<li><a href="#!messages">Messages</a></li>\
|
||||
<li><a href="#!todo">To Do</a></li>\
|
||||
<li><a href="#!calendar">Calendar</a></li>\
|
||||
<li><a href="#!questions">Knowledge Base</a></li>\
|
||||
</ul>\
|
||||
</li>');profile.start_items.sort(function(a,b){return(a[4]-b[4])});for(var i=0;i<profile.start_items.length;i++){var d=profile.start_items[i];var ispage=d[0]=='Page';$('#toolbar-options').append(repl('<li><a href="#%(type)s%(dt)s%(dn)s">\
|
||||
%(dn)s</a></li>',{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+'<b class="caret"></b>');},make_logout:function(){$('#toolbar-user').append('<li><a href="#" onclick="return logout();">Logout</a></li>');}});wn.ui.toolbar.clear_cache=function(){localStorage&&localStorage.clear();$c('webnotes.session_cache.clear',{},function(r,rt){show_alert(r.message);});return false;}
|
||||
</li>');},set_user_name:function(){var fn=user_fullname;if(fn.length>15)fn=fn.substr(0,12)+'...';$('#toolbar-user-link').html(fn+'<b class="caret"></b>');},make_logout:function(){$('#toolbar-user').append('<li><a href="#" onclick="return logout();">Logout</a></li>');}});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);}
|
||||
|
@ -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);}
|
||||
|
55
temp.py
Normal file
55
temp.py
Normal file
@ -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 <http://www.gnu.org/licenses/>."""
|
||||
|
||||
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
|
@ -1 +1 @@
|
||||
650
|
||||
662
|
Loading…
x
Reference in New Issue
Block a user