@@ -13,7 +13,7 @@ wn.core.Workflow = wn.ui.form.Controller.extend({ | |||||
}, | }, | ||||
load_document_type: function(doc) { | load_document_type: function(doc) { | ||||
var me = this; | var me = this; | ||||
if(!locals.DocType[doc.document_type]) { | |||||
if(doc.document_type && !locals.DocType[doc.document_type]) { | |||||
wn.model.with_doctype(doc.document_type, function() { | wn.model.with_doctype(doc.document_type, function() { | ||||
me.update_field_options(); | me.update_field_options(); | ||||
}); | }); | ||||
@@ -25,7 +25,7 @@ wn.core.Workflow = wn.ui.form.Controller.extend({ | |||||
fieldtype: ["not in", wn.model.no_value_type] | fieldtype: ["not in", wn.model.no_value_type] | ||||
}), | }), | ||||
function(d) { return d.fieldname; }); | function(d) { return d.fieldname; }); | ||||
wn.meta.get_docfield("Workflow Document State", "update_field").options | |||||
wn.meta.get_docfield("Workflow Document State", "update_field", this.frm.doc.name).options | |||||
= [""].concat(fields); | = [""].concat(fields); | ||||
} | } | ||||
}); | }); | ||||
@@ -372,6 +372,18 @@ div#freeze { | |||||
background-color: #e74c3c; | background-color: #e74c3c; | ||||
} | } | ||||
.comm-header { | |||||
font-weight: bold; | |||||
height: 20px; | |||||
overflow: hidden; | |||||
} | |||||
.comm-header > div { | |||||
text-overflow: ellipsis; | |||||
white-space: nowrap; | |||||
overflow: hidden; | |||||
} | |||||
/* alert */ | /* alert */ | ||||
@@ -11,6 +11,7 @@ wn.ui.form.Toolbar = Class.extend({ | |||||
this.appframe.set_views_for(this.frm.meta.name, "form"); | this.appframe.set_views_for(this.frm.meta.name, "form"); | ||||
}, | }, | ||||
make: function() { | make: function() { | ||||
this.appframe.set_title_right(); // clear | |||||
this.set_title(); | this.set_title(); | ||||
this.show_title_as_dirty(); | this.show_title_as_dirty(); | ||||
@@ -43,7 +44,6 @@ wn.ui.form.Toolbar = Class.extend({ | |||||
this.appframe.set_title(title + this.get_lock_status(), wn._(this.frm.docname)); | this.appframe.set_title(title + this.get_lock_status(), wn._(this.frm.docname)); | ||||
this.appframe.set_title_left('<i class="icon-angle-left"></i> ' + wn._(this.frm.doctype), | this.appframe.set_title_left('<i class="icon-angle-left"></i> ' + wn._(this.frm.doctype), | ||||
function() { wn.set_route("List", me.frm.doctype); }); | function() { wn.set_route("List", me.frm.doctype); }); | ||||
this.appframe.set_title_right(); | |||||
}, | }, | ||||
show_infobar: function() { | show_infobar: function() { | ||||
/* docs: | /* docs: | ||||
@@ -24,7 +24,7 @@ wn.ui.form.States = Class.extend({ | |||||
.empty() | .empty() | ||||
.removeClass("hide"); | .removeClass("hide"); | ||||
this.workflow_button = $('<button class="btn btn-default dropdown-toggle">\ | |||||
this.workflow_button = $('<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">\ | |||||
<i class="icon-small"></i> <span class="state-text"></span>\ | <i class="icon-small"></i> <span class="state-text"></span>\ | ||||
<span class="caret"></span></button>') | <span class="caret"></span></button>') | ||||
.appendTo(this.parent).dropdown(); | .appendTo(this.parent).dropdown(); | ||||
@@ -178,7 +178,7 @@ wn.ui.form.States = Class.extend({ | |||||
} | } | ||||
// hide dropdown | // hide dropdown | ||||
$(this).parents(".dropdown-menu:first").prev().dropdown('toggle'); | |||||
me.workflow_button.dropdown('toggle'); | |||||
return false; | return false; | ||||
}) | }) | ||||
@@ -57,6 +57,11 @@ $.extend(wn.model, { | |||||
cached_timestamp: cached_timestamp | cached_timestamp: cached_timestamp | ||||
}, | }, | ||||
callback: function(r) { | callback: function(r) { | ||||
if(r.exc) { | |||||
wn.msgprint(wn._("Unable to load") + ": " + wn._(doctype)); | |||||
throw "No doctype"; | |||||
return; | |||||
} | |||||
if(r.message=="use_cache") { | if(r.message=="use_cache") { | ||||
wn.model.sync(cached_doclist); | wn.model.sync(cached_doclist); | ||||
} else { | } else { | ||||
@@ -59,7 +59,7 @@ wn.ui.AppFrame = Class.extend({ | |||||
this.title_right = $("<a>") | this.title_right = $("<a>") | ||||
.html((icon ? '<i class="'+icon+'"></i> ' : "") + txt) | .html((icon ? '<i class="'+icon+'"></i> ' : "") + txt) | ||||
.click(click) | .click(click) | ||||
.appendTo($right); | |||||
.prependTo($right); | |||||
return this.title_right; | return this.title_right; | ||||
} else { | } else { | ||||
$right.empty(); | $right.empty(); | ||||
@@ -328,7 +328,8 @@ wn.ui.make_app_page = function(opts) { | |||||
</div>\ | </div>\ | ||||
</div>\ | </div>\ | ||||
<div class="appframe container">\ | <div class="appframe container">\ | ||||
<div class="workflow-button-area btn-group pull-right hide" style="margin-top: 9px;"></div>\ | |||||
<div class="appframe-timestamp hide"></div>\ | |||||
<div class="workflow-button-area btn-group pull-right hide"></div>\ | |||||
</div>\ | </div>\ | ||||
<div class="appframe-footer hide"></div>').appendTo($wrapper); | <div class="appframe-footer hide"></div>').appendTo($wrapper); | ||||
@@ -97,8 +97,7 @@ wn.views.CommunicationList = Class.extend({ | |||||
"SMS": "icon-mobile-phone", | "SMS": "icon-mobile-phone", | ||||
}[doc.communication_medium] || "icon-envelope"; | }[doc.communication_medium] || "icon-envelope"; | ||||
var comm = $(repl('<div class="list-group-item">\ | var comm = $(repl('<div class="list-group-item">\ | ||||
<div class="comm-header row" title="'+wn._('Click to Expand / Collapse')+'"\ | |||||
style="font-weight: bold; height: 20px; overflow: hidden;">\ | |||||
<div class="comm-header row" title="'+wn._('Click to Expand / Collapse')+'">\ | |||||
<div class="col-sm-3"><i class="%(icon)s"></i> %(_sender)s</div>\ | <div class="col-sm-3"><i class="%(icon)s"></i> %(_sender)s</div>\ | ||||
<div class="col-sm-6">%(subject)s</div>\ | <div class="col-sm-6">%(subject)s</div>\ | ||||
<div class="col-sm-3 text-right">%(when)s</div>\ | <div class="col-sm-3 text-right">%(when)s</div>\ | ||||