BUG 5073 Extra features for Case Notes
Load 10 by 10 notes
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
function closeCaseNotesWindow(){
|
function closeCaseNotesWindow(){
|
||||||
if(Ext.get("caseNotesWindowPanel")){
|
if(Ext.get("caseNotesWindowPanel")){
|
||||||
Ext.get("caseNotesWindowPanel").destroy();
|
Ext.get("caseNotesWindowPanel").destroy();
|
||||||
@@ -9,14 +7,27 @@ function closeCaseNotesWindow(){
|
|||||||
function openCaseNotesWindow(appUid,modalSw){
|
function openCaseNotesWindow(appUid,modalSw){
|
||||||
|
|
||||||
if(!appUid) appUid="";
|
if(!appUid) appUid="";
|
||||||
|
|
||||||
|
var startRecord=0;
|
||||||
|
var loadSize=10;
|
||||||
|
|
||||||
var storeNotes = new Ext.data.JsonStore({
|
var storeNotes = new Ext.data.JsonStore({
|
||||||
url : 'caseNotesAjax.php?action=getNotesList&appUid='+appUid,
|
url : 'caseNotesAjax.php?action=getNotesList&appUid='+appUid,
|
||||||
root: 'notes',
|
root: 'notes',
|
||||||
totalProperty: 'totalCount',
|
totalProperty: 'totalCount',
|
||||||
fields: ['USR_USERNAME','NOTE_DATE','NOTE_CONTENT'],
|
fields: ['USR_USERNAME','NOTE_DATE','NOTE_CONTENT'],
|
||||||
baseParams:{
|
baseParams:{
|
||||||
start:0,
|
start:startRecord,
|
||||||
limit:10
|
limit:startRecord+loadSize
|
||||||
|
},
|
||||||
|
listeners:{
|
||||||
|
load:function(){
|
||||||
|
if(storeNotes.getCount()<storeNotes.getTotalCount()){
|
||||||
|
Ext.getCmp('CASES_MORE_BUTTON').show();
|
||||||
|
}else{
|
||||||
|
Ext.getCmp('CASES_MORE_BUTTON').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
storeNotes.load();
|
storeNotes.load();
|
||||||
@@ -30,8 +41,6 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
'<span class="x-editable"><small><i>{NOTE_DATE}</i></small><hr /></span>',
|
'<span class="x-editable"><small><i>{NOTE_DATE}</i></small><hr /></span>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
|
|
||||||
|
|
||||||
'</tpl>',
|
'</tpl>',
|
||||||
'<div class="x-clear"></div>'
|
'<div class="x-clear"></div>'
|
||||||
);
|
);
|
||||||
@@ -40,17 +49,15 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
var panelNotes = new Ext.Panel({
|
var panelNotes = new Ext.Panel({
|
||||||
id:'notesPanel',
|
id:'notesPanel',
|
||||||
|
|
||||||
frame:false,
|
frame:true,
|
||||||
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,
|
tpl: tplNotes,
|
||||||
autoWidth:true,
|
autoWidth:true,
|
||||||
//autoHeight:true,
|
loadingtext:_('ID_CASE_NOTES_LOADING'),
|
||||||
autoScroll:true,
|
autoScroll:true,
|
||||||
multiSelect: false,
|
multiSelect: false,
|
||||||
overClass:'x-view-over',
|
overClass:'x-view-over',
|
||||||
@@ -58,7 +65,6 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
emptyText: _('ID_CASE_NOTES_EMPTY'),
|
emptyText: _('ID_CASE_NOTES_EMPTY'),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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);
|
||||||
@@ -72,7 +78,7 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
fn: function(dv,nodes){
|
fn: function(dv,nodes){
|
||||||
var l = nodes.length;
|
var l = nodes.length;
|
||||||
var s = l != 1 ? 's' : '';
|
var s = l != 1 ? 's' : '';
|
||||||
panelNotes.setTitle('Process ('+l+' item'+s+' selected)');
|
//panelNotes.setTitle('Process ('+l+' item'+s+' selected)');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
click: {
|
click: {
|
||||||
@@ -85,10 +91,19 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
}
|
}
|
||||||
}),{
|
}),{
|
||||||
xtype:'button',
|
xtype:'button',
|
||||||
|
id:'CASES_MORE_BUTTON',
|
||||||
|
hidden:true,
|
||||||
text:_('ID_CASE_NOTES_MORE'),
|
text:_('ID_CASE_NOTES_MORE'),
|
||||||
align:'center',
|
align:'center',
|
||||||
handler:function() {
|
handler:function() {
|
||||||
storeNotes.loadNext();
|
startRecord=startRecord+loadSize;
|
||||||
|
limitRecord=startRecord+loadSize;
|
||||||
|
storeNotes.load({
|
||||||
|
params:{
|
||||||
|
start:0,
|
||||||
|
limit:startRecord+loadSize
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
@@ -103,9 +118,7 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
closable: true, //Hide close button of the Window
|
closable: true, //Hide close button of the Window
|
||||||
modal: modalSw, //When modal:true it make the window modal and mask everything behind it when displayed
|
modal: modalSw, //When modal:true it make the window modal and mask everything behind it when displayed
|
||||||
iconCls: 'ICON_CASES_NOTES',
|
iconCls: 'ICON_CASES_NOTES',
|
||||||
|
|
||||||
autoCreate: true,
|
autoCreate: true,
|
||||||
|
|
||||||
height:400,
|
height:400,
|
||||||
shadow:true,
|
shadow:true,
|
||||||
minWidth:300,
|
minWidth:300,
|
||||||
@@ -129,12 +142,12 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
],
|
],
|
||||||
bbar:[
|
bbar:[
|
||||||
new Ext.ux.StatusBar({
|
new Ext.ux.StatusBar({
|
||||||
defaultText : _('ID_READY'),
|
defaultText : _('ID_NOTES_READY'),
|
||||||
id : 'notesStatusPanel',
|
id : 'notesStatusPanel',
|
||||||
defaultIconCls: 'ICON_CASES_NOTES',
|
defaultIconCls: 'ICON_CASES_NOTES',
|
||||||
|
|
||||||
// values to set initially:
|
// values to set initially:
|
||||||
text: _('ID_READY'),
|
text: _('ID_NOTES_READY'),
|
||||||
iconCls: 'ready-icon',
|
iconCls: 'ready-icon',
|
||||||
statusAlign: 'left',
|
statusAlign: 'left',
|
||||||
|
|
||||||
@@ -152,7 +165,7 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
blankText:_('ID_CASES_NOTES_POST'),
|
blankText:_('ID_CASES_NOTES_POST'),
|
||||||
//anchor:'95%',
|
//anchor:'95%',
|
||||||
anchor: '100% -53',
|
anchor: '100% -53',
|
||||||
width:250,
|
width:200,
|
||||||
//autoWidth:true,
|
//autoWidth:true,
|
||||||
grow:true,
|
grow:true,
|
||||||
selectOnFocus:true,
|
selectOnFocus:true,
|
||||||
@@ -212,6 +225,7 @@ function openCaseNotesWindow(appUid,modalSw){
|
|||||||
});
|
});
|
||||||
caseNotesWindow.show();
|
caseNotesWindow.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function statusBarMessage( msg, isLoading, success ) {
|
function statusBarMessage( msg, isLoading, success ) {
|
||||||
// console.log("Status Bar needed");
|
// console.log("Status Bar needed");
|
||||||
// console.log(msg);
|
// console.log(msg);
|
||||||
@@ -230,17 +244,12 @@ function statusBarMessage( msg, isLoading, success ) {
|
|||||||
iconCls: 'success',
|
iconCls: 'success',
|
||||||
clear: true
|
clear: true
|
||||||
});
|
});
|
||||||
//Ext.msgBoxSlider.msg('', msg );
|
|
||||||
} else {
|
} else {
|
||||||
statusBar.setStatus({
|
statusBar.setStatus({
|
||||||
text: 'Error: ' + msg,
|
text: 'Error: ' + msg,
|
||||||
iconCls: 'error',
|
iconCls: 'error',
|
||||||
clear: true
|
clear: true
|
||||||
});
|
});
|
||||||
//Ext.msgBoxSlider.msg('Error', msg );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user