BUG 0000 Case Notes Improvements
This commit is contained in:
@@ -945,3 +945,49 @@ antes funcionaba.
|
|||||||
.x-toolbar1 .x-btn-bl { background-position: 0 -3px; }
|
.x-toolbar1 .x-btn-bl { background-position: 0 -3px; }
|
||||||
.x-toolbar1 .x-btn-br { background-position: -3px -3px; }
|
.x-toolbar1 .x-btn-br { background-position: -3px -3px; }
|
||||||
.x-toolbar1 .x-btn-bc { background-position: 0 -15px; }
|
.x-toolbar1 .x-btn-bc { background-position: 0 -15px; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Case Notes styles */
|
||||||
|
|
||||||
|
.x-cnotes-source {
|
||||||
|
border: 1px solid #EDEDED;
|
||||||
|
background-color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-cnotes-view td {
|
||||||
|
font-family: verdana,arial,sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
td.x-cnotes-label {
|
||||||
|
/*background-color: #ddd;*/
|
||||||
|
border: 1px solid #EDEDED;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: right;
|
||||||
|
width: 40px;
|
||||||
|
padding: 0px 3px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-cnotes-over {
|
||||||
|
background-color:#EBEBEB;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.x-cnotes-selected {
|
||||||
|
background-color: #DFE8F6;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-from {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-message {
|
||||||
|
/* top rig top left */
|
||||||
|
padding: 5px 5px 5px 10px;
|
||||||
|
font: 11px arial,tahoma,helvetica,sans-serif;
|
||||||
|
color: #465070;
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
/* Case Notes - Start */
|
/* Case Notes - Start */
|
||||||
|
var newNoteAreaActive = false;
|
||||||
|
var caseNotesWindow;
|
||||||
|
|
||||||
function closeCaseNotesWindow(){
|
function closeCaseNotesWindow(){
|
||||||
if(Ext.get("caseNotesWindowPanel")){
|
if(Ext.get("caseNotesWindowPanel")){
|
||||||
@@ -6,7 +8,8 @@ function closeCaseNotesWindow(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openCaseNotesWindow(appUid,modalSw){
|
function openCaseNotesWindow(appUid,modalSw)
|
||||||
|
{
|
||||||
if(!appUid) appUid="";
|
if(!appUid) appUid="";
|
||||||
|
|
||||||
var startRecord=0;
|
var startRecord=0;
|
||||||
@@ -16,13 +19,16 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
url : '../appProxy/getNotesList?appUid='+appUid,
|
url : '../appProxy/getNotesList?appUid='+appUid,
|
||||||
root: 'notes',
|
root: 'notes',
|
||||||
totalProperty: 'totalCount',
|
totalProperty: 'totalCount',
|
||||||
fields: ['USR_USERNAME','USR_FIRSTNAME','USR_LASTNAME','USR_FULL_NAME','NOTE_DATE','NOTE_CONTENT'],
|
fields: ['USR_USERNAME','USR_FIRSTNAME','USR_LASTNAME','USR_FULL_NAME','NOTE_DATE','NOTE_CONTENT', 'USR_UID', 'user'],
|
||||||
baseParams:{
|
baseParams:{
|
||||||
start:startRecord,
|
start:startRecord,
|
||||||
limit:startRecord+loadSize
|
limit:startRecord+loadSize
|
||||||
},
|
},
|
||||||
listeners:{
|
listeners:{
|
||||||
load:function(){
|
load:function(){
|
||||||
|
|
||||||
|
caseNotesWindow.setTitle(_('ID_CASES_NOTES') + ' (' + storeNotes.data.items.length + ')');
|
||||||
|
|
||||||
if(storeNotes.getCount()<storeNotes.getTotalCount()){
|
if(storeNotes.getCount()<storeNotes.getTotalCount()){
|
||||||
Ext.getCmp('CASES_MORE_BUTTON').show();
|
Ext.getCmp('CASES_MORE_BUTTON').show();
|
||||||
}else{
|
}else{
|
||||||
@@ -33,43 +39,6 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
});
|
});
|
||||||
storeNotes.load();
|
storeNotes.load();
|
||||||
|
|
||||||
// note added by krlos pacha carlos-at-colosa.com
|
|
||||||
// code added to get info about the users' name configuration
|
|
||||||
// to can see the correct user name set into enviroment
|
|
||||||
|
|
||||||
var userName = '';
|
|
||||||
switch(FORMATS.FullNameFormat){
|
|
||||||
case '@lastName, @firstName (@userName)':
|
|
||||||
userName = '{USR_LASTNAME}, {USR_FIRSTNAME} ({USR_USERNAME})';break;
|
|
||||||
case '@firstName @lastName':
|
|
||||||
userName = '{USR_FIRSTNAME} {USR_LASTNAME}';break;
|
|
||||||
case '@firstName @lastName (@userName)':
|
|
||||||
userName = '{USR_FIRSTNAME} {USR_LASTNAME} ({USR_USERNAME})';break;
|
|
||||||
case '@userName':
|
|
||||||
userName = '{USR_USERNAME}';break;
|
|
||||||
case '@userName (@firstName @lastName)':
|
|
||||||
userName = '{USR_USERNAME} ({USR_FIRSTNAME} {USR_LASTNAME})';break;
|
|
||||||
case '@lastName @firstName':
|
|
||||||
userName = '{USR_LASTNAME} {USR_FIRSTNAME}';break;
|
|
||||||
case '@lastName, @firstName':
|
|
||||||
userName = '{USR_LASTNAME}, {USR_FIRSTNAME}';break;
|
|
||||||
case '@lastName, @firstName (@userName)':
|
|
||||||
userName = '{USR_LASTNAME}, {USR_FIRSTNAME} ({USR_USERNAME})';break;
|
|
||||||
}
|
|
||||||
var tplNotes = new Ext.XTemplate(
|
|
||||||
'<tpl for=".">',
|
|
||||||
'<div class="thumb-wrap">',
|
|
||||||
'<div class="thumb" >',
|
|
||||||
'<span class="x-editable"><b>'+userName+'</b></span><br>',
|
|
||||||
'<span class="x-editable">{NOTE_CONTENT}</span><br>',
|
|
||||||
'<span class="x-editable"><small><i>{NOTE_DATE}</i></small><hr /></span>',
|
|
||||||
'</div>',
|
|
||||||
'</div>',
|
|
||||||
'</tpl>',
|
|
||||||
'<div class="x-clear"></div>'
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
var panelNotes = new Ext.Panel({
|
var panelNotes = new Ext.Panel({
|
||||||
id:'notesPanel',
|
id:'notesPanel',
|
||||||
|
|
||||||
@@ -77,23 +46,37 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
autoWidth:true,
|
autoWidth:true,
|
||||||
autoHeight:true,
|
autoHeight:true,
|
||||||
collapsible:false,
|
collapsible:false,
|
||||||
items:[ new Ext.DataView({
|
items:[
|
||||||
|
new Ext.DataView({
|
||||||
store: storeNotes,
|
store: storeNotes,
|
||||||
tpl: tplNotes,
|
|
||||||
autoWidth:true,
|
|
||||||
loadingtext:_('ID_CASE_NOTES_LOADING'),
|
loadingtext:_('ID_CASE_NOTES_LOADING'),
|
||||||
autoScroll:true,
|
// autoScroll:true,
|
||||||
multiSelect: false,
|
|
||||||
overClass:'x-view-over',
|
|
||||||
itemSelector:'div.thumb-wrap',
|
|
||||||
emptyText: _('ID_CASE_NOTES_EMPTY'),
|
emptyText: _('ID_CASE_NOTES_EMPTY'),
|
||||||
|
cls: 'x-cnotes-view',
|
||||||
|
tpl: '<tpl for=".">' +
|
||||||
|
'<div class="x-cnotes-source"><table><tbody>' +
|
||||||
|
'<tr>' +
|
||||||
|
'<td class="x-cnotes-label"><img border="0" src="../users/users_ViewPhotoGrid?pUID={USR_UID}" width="40" height="40"/></td>' +
|
||||||
|
'<td class="x-cnotes-name">'+
|
||||||
|
'<p class="user-from">{user}</p>'+
|
||||||
|
'<p class="x-editable x-message">{NOTE_CONTENT}</p> '+
|
||||||
|
'<p class="x-editable"><small>'+_('ID_POSTED_AT')+'<i> {NOTE_DATE}</i></small></p>'+
|
||||||
|
'</td>' +
|
||||||
|
'</tr>' +
|
||||||
|
'</tbody></table></div>' +
|
||||||
|
'</tpl>',
|
||||||
|
itemSelector: 'div.x-cnotes-source',
|
||||||
|
overClass: 'x-cnotes-over',
|
||||||
|
selectedClass: 'x-cnotes-selected',
|
||||||
|
singleSelect: true,
|
||||||
|
|
||||||
prepareData: function(data){
|
prepareData: function(data){
|
||||||
//data.shortName = Ext.util.Format.ellipsis(data.name, 15);
|
//data.shortName = Ext.util.Format.ellipsis(data.name, 15);
|
||||||
//data.sizeString = Ext.util.Format.fileSize(data.size);
|
//data.sizeString = Ext.util.Format.fileSize(data.size);
|
||||||
//data.dateString = data.lastmod.format("m/d/Y g:i a");
|
//data.dateString = data.lastmod.format("m/d/Y g:i a");
|
||||||
//console.log(data);
|
|
||||||
|
data.user = _FNF(data.USR_USERNAME, data.USR_FIRSTNAME, data.USR_LASTNAME);
|
||||||
|
data.NOTE_CONTENT = data.NOTE_CONTENT.replace(/\n/g,' <br/>');
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -107,9 +90,6 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
},
|
},
|
||||||
click: {
|
click: {
|
||||||
fn: function(dv,nodes,a){
|
fn: function(dv,nodes,a){
|
||||||
//console.info("Click");
|
|
||||||
//console.log(dv);
|
|
||||||
//console.log(a);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -130,11 +110,76 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
var caseNotesWindow;
|
var tbar = [
|
||||||
caseNotesWindow = new Ext.Window({
|
{
|
||||||
|
//xtype:'textfield',
|
||||||
|
xtype : 'textarea',
|
||||||
|
id : 'caseNoteText',
|
||||||
|
name : 'caseNoteText',
|
||||||
|
hideLabel : true,
|
||||||
|
blankText : '...',
|
||||||
|
//anchor: '100%',
|
||||||
|
width : 248,
|
||||||
|
grow : true,
|
||||||
|
maxLenght : 150,
|
||||||
|
allowBlank:true,
|
||||||
|
selectOnFocus:true,
|
||||||
|
height : 40,
|
||||||
|
growMin: 39,
|
||||||
|
growMax: 80
|
||||||
|
},
|
||||||
|
' ',
|
||||||
|
{
|
||||||
|
cls: 'x-toolbar1',
|
||||||
|
text: _('ID_SEND'),
|
||||||
|
//iconCls: 'x-pm-notes-btn',
|
||||||
|
scale: 'large',
|
||||||
|
stype:'button',
|
||||||
|
iconAlign: 'top',
|
||||||
|
handler: function(){
|
||||||
|
var noteText = Ext.getCmp('caseNoteText').getValue();
|
||||||
|
|
||||||
|
if (noteText == "") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
newNoteHandler();
|
||||||
|
|
||||||
|
Ext.getCmp('caseNoteText').focus();
|
||||||
|
Ext.getCmp('caseNoteText').reset();
|
||||||
|
statusBarMessage( _('ID_CASES_NOTE_POSTING'), true);
|
||||||
|
Ext.Ajax.request({
|
||||||
|
url : '../appProxy/postNote' ,
|
||||||
|
params : {
|
||||||
|
appUid:appUid,
|
||||||
|
noteText:noteText
|
||||||
|
},
|
||||||
|
success: function ( result, request ) {
|
||||||
|
var data = Ext.util.JSON.decode(result.responseText);
|
||||||
|
if(data.success=="success"){
|
||||||
|
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
|
||||||
|
storeNotes.load();
|
||||||
|
}else{
|
||||||
|
statusBarMessage( _('ID_CASES_NOTE_POST_ERROR'), false,false);
|
||||||
|
Ext.MessageBox.alert(_('ID_CASES_NOTE_POST_ERROR'), data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
failure: function ( result, request) {
|
||||||
|
statusBarMessage( _('ID_CASES_NOTE_POST_FAILED'), false,false);
|
||||||
|
Ext.MessageBox.alert(_('ID_CASES_NOTE_POST_FAILED'), result.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
caseNotesWindow = new Ext.Window({
|
||||||
title: _('ID_CASES_NOTES'), //Title of the Window
|
title: _('ID_CASES_NOTES'), //Title of the Window
|
||||||
id: 'caseNotesWindowPanel', //ID of the Window Panel
|
id: 'caseNotesWindowPanel', //ID of the Window Panel
|
||||||
width:300, //Width of the Window
|
width:300, //Width of the Window
|
||||||
@@ -164,20 +209,22 @@ caseNotesWindow = new Ext.Window({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
tbar:tbar,
|
||||||
bbar:[
|
bbar:[
|
||||||
new Ext.ux.StatusBar({
|
new Ext.ux.StatusBar({
|
||||||
defaultText : _('ID_NOTES_READY'),
|
defaultText : _('ID_NOTES_READY'),
|
||||||
id : 'notesStatusPanel',
|
id : 'notesStatusPanel',
|
||||||
//defaultIconCls: 'ICON_CASES_NOTES',
|
//defaultIconCls: 'ICON_CASES_NOTES',
|
||||||
|
text: _('ID_NOTES_READY'), // values to set initially:
|
||||||
// values to set initially:
|
|
||||||
text: _('ID_NOTES_READY'),
|
|
||||||
//iconCls: 'ready-icon',
|
//iconCls: 'ready-icon',
|
||||||
statusAlign: 'left',
|
statusAlign: 'left',
|
||||||
// any standard Toolbar items:
|
items: [] // any standard Toolbar items:
|
||||||
items: []
|
}), '->',
|
||||||
}),
|
{
|
||||||
{xtype: 'tbfill'},
|
id: 'newNoteButton',
|
||||||
|
text: _('ID_NEW_NOTE'),
|
||||||
|
handler: newNoteHandler
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: _('ID_CANCEL'),
|
text: _('ID_CANCEL'),
|
||||||
handler: function()
|
handler: function()
|
||||||
@@ -186,78 +233,39 @@ caseNotesWindow = new Ext.Window({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
tbar:[{
|
listeners: {
|
||||||
//xtype:'textfield',
|
|
||||||
xtype:'textarea',
|
|
||||||
id:'caseNoteText',
|
|
||||||
name:'caseNoteText',
|
|
||||||
hideLabel: true,
|
|
||||||
blankText:_('ID_CASES_NOTES_POST'),
|
|
||||||
anchor: '100% -53',
|
|
||||||
width:200,
|
|
||||||
grow:true,
|
|
||||||
selectOnFocus:true,
|
|
||||||
maxLenght:150,
|
|
||||||
allowBlank:true
|
|
||||||
},
|
|
||||||
' ',
|
|
||||||
{
|
|
||||||
cls: 'x-toolbar1',
|
|
||||||
text: _('ID_SUBMIT_NOTE'),
|
|
||||||
iconCls: 'x-pm-notes-btn',
|
|
||||||
scale: 'large',
|
|
||||||
stype:'button',
|
|
||||||
iconAlign: 'top',
|
|
||||||
handler: function(){
|
|
||||||
var noteText = Ext.getCmp('caseNoteText').getValue();
|
|
||||||
|
|
||||||
if (noteText == "") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ext.getCmp('caseNoteText').focus();
|
|
||||||
Ext.getCmp('caseNoteText').reset();
|
|
||||||
statusBarMessage( _('ID_CASES_NOTE_POSTING'), true);
|
|
||||||
Ext.Ajax.request({
|
|
||||||
url : '../appProxy/postNote' ,
|
|
||||||
params : {
|
|
||||||
appUid:appUid,
|
|
||||||
noteText:noteText
|
|
||||||
},
|
|
||||||
success: function ( result, request ) {
|
|
||||||
var data = Ext.util.JSON.decode(result.responseText);
|
|
||||||
if(data.success=="success"){
|
|
||||||
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
|
|
||||||
storeNotes.load();
|
|
||||||
}else{
|
|
||||||
statusBarMessage( _('ID_CASES_NOTE_POST_ERROR'), false,false);
|
|
||||||
Ext.MessageBox.alert(_('ID_CASES_NOTE_POST_ERROR'), data.message);
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
failure: function ( result, request) {
|
|
||||||
statusBarMessage( _('ID_CASES_NOTE_POST_FAILED'), false,false);
|
|
||||||
Ext.MessageBox.alert(_('ID_CASES_NOTE_POST_FAILED'), result.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
listeners:{
|
|
||||||
show:function() {
|
show:function() {
|
||||||
this.loadMask = new Ext.LoadMask(this.body, {
|
this.loadMask = new Ext.LoadMask(this.body, {
|
||||||
msg:_('ID_LOADING')
|
msg:_('ID_LOADING')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
close:function(){
|
close:function(){
|
||||||
//console.log(Ext.get("caseNotes"));
|
if (Ext.get("caseNotes")) {
|
||||||
if(Ext.get("caseNotes")){
|
|
||||||
Ext.getCmp("caseNotes").toggle(false);
|
Ext.getCmp("caseNotes").toggle(false);
|
||||||
//Ext.getCmp('caseNotes').show();
|
//Ext.getCmp('caseNotes').show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
caseNotesWindow.show();
|
|
||||||
|
caseNotesWindow.getTopToolbar().hide();
|
||||||
|
caseNotesWindow.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
function newNoteHandler()
|
||||||
|
{
|
||||||
|
newNoteAreaActive = newNoteAreaActive ? false : true;
|
||||||
|
if (newNoteAreaActive) {
|
||||||
|
Ext.getCmp('newNoteButton').setText(_('ID_CANCEL_NEW_NOTE'));
|
||||||
|
caseNotesWindow.getTopToolbar().show();
|
||||||
|
Ext.getCmp('caseNoteText').focus();
|
||||||
|
Ext.getCmp('caseNoteText').reset();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Ext.getCmp('newNoteButton').setText(_('ID_NEW_NOTE'));
|
||||||
|
caseNotesWindow.getTopToolbar().hide();
|
||||||
|
}
|
||||||
|
caseNotesWindow.doLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusBarMessage( msg, isLoading, success ) {
|
function statusBarMessage( msg, isLoading, success ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user