worked on saving output document and editing part. SAve part completed

This commit is contained in:
safan
2010-12-15 14:40:05 +00:00
parent 9594455aff
commit 1a54f2e29c

View File

@@ -581,6 +581,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
labelWidth: 100, labelWidth: 100,
bodyStyle :'padding:5px 5px 0', bodyStyle :'padding:5px 5px 0',
width : 500, width : 500,
height : 380,
autoHeight: true, autoHeight: true,
items:[{ items:[{
xtype: 'fieldset', xtype: 'fieldset',
@@ -676,37 +677,33 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
{name : 'Yes', value: '1'}, {name : 'Yes', value: '1'},
]}) ]})
}, { }, {
xtype: 'fieldset', layout:'column',
layout:'column', border:false,
border:false, items:[{
width: 550, columnWidth:.6,
items:[{ layout: 'form',
columnWidth:.6, border:false,
layout: 'form', items: [{
border:false, xtype: 'textfield',
items: [{ fieldLabel: 'Destination Path',
xtype: 'textfield', name: 'INP_DOC_DESTINATION_PATH',
fieldLabel: 'Destination Path', anchor:'100%'
name: 'INP_DOC_DESTINATION_PATH', }]
anchor:'100%' },{
}] columnWidth:.4,
},{ layout: 'form',
columnWidth:.3, border:false,
layout: 'form', items: [{
border:false, xtype:'button',
items: [{ title: ' ',
xtype:'button', text: '@@',
title: ' ', name: 'selectorigin'
text: '@@', //anchor:'15%'
name: 'selectorigin'
//anchor:'15%'
}] }]
}] }]
},{ },{
xtype: 'fieldset',
layout:'column', layout:'column',
border:false, border:false,
width: 550,
items:[{ items:[{
columnWidth:.6, columnWidth:.6,
layout: 'form', layout: 'form',
@@ -718,7 +715,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
anchor:'100%' anchor:'100%'
}] }]
},{ },{
columnWidth:.3, columnWidth:.4,
layout: 'form', layout: 'form',
border:false, border:false,
items: [{ items: [{
@@ -735,6 +732,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
var inputDocColumns = new Ext.grid.ColumnModel({ var inputDocColumns = new Ext.grid.ColumnModel({
columns: [ columns: [
new Ext.grid.RowNumberer(),
{ {
id: 'INP_DOC_TITLE', id: 'INP_DOC_TITLE',
header: 'Title', header: 'Title',
@@ -799,7 +797,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
collapsible: false, collapsible: false,
maximizable: false, maximizable: false,
width: 550, width: 550,
height: 550, height: 400,
minWidth: 200, minWidth: 200,
minHeight: 150, minHeight: 150,
layout: 'fit', layout: 'fit',
@@ -960,13 +958,34 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
} }
}); });
var btnEdit = new Ext.Button({
id: 'btnEdit',
text: 'Edit',
iconCls: 'application_add',
handler: function (s) {
outputDocGrid.stopEditing();
var selectedRow = outputDocGrid.getSelectionModel().getSelections();
var outDocUID = selectedRow[0].data.OUT_DOC_UID;
}
});
var btnProperties = new Ext.Button({
id: 'btnProperties',
text: 'Properties',
iconCls: 'application_add',
handler: function (s) {
outputDocGrid.stopEditing();
var selectedRow = outputDocGrid.getSelectionModel().getSelections();
var outDocUID = selectedRow.data[0].OUT_DOC_UID;
}
});
var tb = new Ext.Toolbar({ var tb = new Ext.Toolbar({
items: [btnAdd, btnRemove] items: [btnAdd, btnRemove,btnEdit,btnProperties]
}); });
var outputDocColumns = new Ext.grid.ColumnModel({ var outputDocColumns = new Ext.grid.ColumnModel({
columns: [ columns: [
new Ext.grid.RowNumberer(),
{ {
id: 'OUT_DOC_TITLE', id: 'OUT_DOC_TITLE',
header: 'Title', header: 'Title',
@@ -977,13 +996,22 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
//allowBlank: false //allowBlank: false
}) })
}, },
{
id: 'OUT_DOC_TYPE',
header: 'Type',
dataIndex: 'OUT_DOC_TYPE',
editable: false,
editor: new Ext.form.TextField({
//allowBlank: false
})
}/*,
{ {
sortable: false, sortable: false,
renderer: function(val, meta, record) renderer: function(val, meta, record)
{ {
return String.format("<a href='../dynaforms/dynaforms_Editor?PRO_UID={0}&DYN_UID={1}'>Edit</a>",pro_uid,pro_uid); return String.format("<a href='../dynaforms/dynaforms_Editor?PRO_UID={0}&DYN_UID={1}'>Edit</a>",pro_uid,pro_uid);
} }
} }*/
] ]
}); });
@@ -1007,7 +1035,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
}); });
var outputDocForm = new Ext.FormPanel({ var outputDocForm = new Ext.FormPanel({
monitorValid :true,
labelWidth : 100, labelWidth : 100,
bodyStyle :'padding:5px 5px 0', bodyStyle :'padding:5px 5px 0',
defaults :{ autoScroll:true }, defaults :{ autoScroll:true },
@@ -1023,34 +1051,35 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
items :[{ items :[{
xtype : 'textfield', xtype : 'textfield',
fieldLabel : 'Title', fieldLabel : 'Title',
allowBlank : true, allowBlank : false,
blankText : 'Enter Title of Output Document',
name : 'OUT_DOC_TITLE' name : 'OUT_DOC_TITLE'
},{ },{
xtype: 'fieldset', //xtype: 'fieldset',
layout:'column', layout:'column',
border:false, border:false,
allowBlank: true,
width: 550,
items:[{ items:[{
columnWidth:.6, columnWidth:.6,
layout: 'form', layout: 'form',
border:false, border:false,
items: [{ items: [{
xtype: 'textfield', xtype : 'textfield',
fieldLabel: 'Filename generated', fieldLabel : 'Filename generated',
name: 'OUT_DOC_FILENAME', name : 'OUT_DOC_FILENAME',
anchor:'100%' allowBlank : false,
blankText : 'Select Filename generated',
anchor : '100%'
}] }]
},{ },{
columnWidth:.3, columnWidth:.4,
layout: 'form', layout: 'form',
border:false, border:false,
items: [{ items: [{
xtype:'button', xtype:'button',
title: ' ', title: ' ',
text: '@@', text: '@@',
name: 'selectorigin' name: 'selectorigin'
//anchor:'15%' //anchor:'95%'
}] }]
}] }]
},{ },{
@@ -1058,7 +1087,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
fieldLabel : 'Description', fieldLabel : 'Description',
name : 'OUT_DOC_DESCRIPTION', name : 'OUT_DOC_DESCRIPTION',
height : 120, height : 120,
width : 350 width : 280
},{ },{
width :150, width :150,
xtype :'combo', xtype :'combo',
@@ -1069,14 +1098,13 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
forceSelection : true, forceSelection : true,
name :'OUT_DOC_LANDSCAPE', name :'OUT_DOC_LANDSCAPE',
displayField :'name', displayField :'name',
value :'Digital', value :'Portrait',
valueField :'value', valueField :'value',
store :new Ext.data.JsonStore({ store :new Ext.data.JsonStore({
fields : ['name', 'value'], fields : ['name', 'value'],
data : [ data : [
{name : 'Portrait', value: '0'}, {name : 'Portrait', value: '0'},
{name : 'Landscape', value: '1'}]}) {name : 'Landscape', value: '1'}]})
},{ },{
width :150, width :150,
xtype :'combo', xtype :'combo',
@@ -1087,7 +1115,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
forceSelection : true, forceSelection : true,
name :'OUT_DOC_MEDIA', name :'OUT_DOC_MEDIA',
displayField :'name', displayField :'name',
value :'Digital', value :'Letter',
valueField :'value', valueField :'value',
store :new Ext.data.JsonStore({ store :new Ext.data.JsonStore({
fields : ['name', 'value'], fields : ['name', 'value'],
@@ -1111,28 +1139,25 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
{name : 'A10', value: 'A10'}, {name : 'A10', value: 'A10'},
{name : 'Screenshot640', value: 'Screenshot640'}, {name : 'Screenshot640', value: 'Screenshot640'},
{name : 'Screenshot800', value: 'Screenshot800'}, {name : 'Screenshot800', value: 'Screenshot800'},
{name : 'Screenshot1024', value: 'Screenshot1024'}]}) {name : 'Screenshot1024', value: 'Screenshot1024'}
]
})
},{ },{
xtype : 'textfield', xtype : 'numberfield',
fieldLabel : 'Left Margin', fieldLabel : 'Left Margin',
// allowBlank: true,
name : 'OUT_DOC_LEFT_MARGIN' name : 'OUT_DOC_LEFT_MARGIN'
},{ },{
xtype : 'textfield', xtype : 'numberfield',
fieldLabel : 'Right Margin', fieldLabel : 'Right Margin',
// allowBlank: true,
name : 'OUT_DOC_RIGHT_MARGIN' name : 'OUT_DOC_RIGHT_MARGIN'
},{ },{
xtype : 'textfield', xtype : 'numberfield',
fieldLabel : 'Top Margin', fieldLabel : 'Top Margin',
// allowBlank: true,
name : 'OUT_DOC_TOP_MARGIN' name : 'OUT_DOC_TOP_MARGIN'
},{ },{
xtype : 'textfield', xtype : 'numberfield',
fieldLabel: 'Bottom Margin', fieldLabel : 'Bottom Margin',
// allowBlank: true, name : 'OUT_DOC_BOTTOM_MARGIN'
name : 'OUT_DOC_BOTTOM_MARGIN'
},{ },{
width :150, width :150,
xtype :'combo', xtype :'combo',
@@ -1143,7 +1168,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
forceSelection :true, forceSelection :true,
name :'OUT_DOC_GENERATE', name :'OUT_DOC_GENERATE',
displayField :'name', displayField :'name',
value :'Digital', value :'Doc',
valueField :'value', valueField :'value',
store :new Ext.data.JsonStore({ store :new Ext.data.JsonStore({
fields :['name', 'value'], fields :['name', 'value'],
@@ -1161,7 +1186,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
forceSelection :true, forceSelection :true,
name :'OUT_DOC_VERSIONING', name :'OUT_DOC_VERSIONING',
displayField :'name', displayField :'name',
value :'Digital', value :'NO',
valueField :'value', valueField :'value',
store :new Ext.data.JsonStore({ store :new Ext.data.JsonStore({
fields : ['name', 'value'], fields : ['name', 'value'],
@@ -1169,81 +1194,60 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
{name : 'NO', value: '0'}, {name : 'NO', value: '0'},
{name : 'YES', value: '1'}]}) {name : 'YES', value: '1'}]})
},{ },{
xtype : 'fieldset',
layout :'column', layout :'column',
border :false, border :false,
allowBlank : true,
width : 550,
items :[{ items :[{
columnWidth :.6, columnWidth :.6,
layout : 'form', layout : 'form',
border :false, border :false,
items : [{ items : [{
xtype : 'textfield', xtype : 'textfield',
fieldLabel : 'Destination Path', fieldLabel : 'Destination Path',
name : 'OUT_DOC_DESTINATION_PATH', name : 'OUT_DOC_DESTINATION_PATH',
anchor :'100%' anchor :'100%'
}] }]
},{ },{
columnWidth :.3, columnWidth :.4,
layout : 'form', layout : 'form',
border :false, border :false,
items : [{ items : [{
xtype :'button', xtype :'button',
title : ' ', title : ' ',
text : '@@', text : '@@',
name : 'selectorigin' name : 'selectorigin'
//anchor :'15%' //anchor :'15%'
}] }]
}] }]
},{ },{
xtype : 'fieldset',
layout :'column', layout :'column',
border :false, border :false,
allowBlank : true,
width : 550,
items :[{ items :[{
columnWidth :.6, columnWidth :.6,
layout : 'form',
border :false,
items : [{
xtype : 'textfield',
fieldLabel : 'Tags',
name : 'OUT_DOC_TAGS',
anchor :'100%'
}]
},{
columnWidth :.3,
layout : 'form', layout : 'form',
border :false, border :false,
items : [{ items : [{
xtype :'button', xtype : 'textfield',
title : ' ', fieldLabel : 'Tags',
text : '@@', name : 'OUT_DOC_TAGS',
name : 'selectorigin' anchor :'100%'
//anchor :'15%' }]
},{
columnWidth :.4,
layout : 'form',
border :false,
items : [{
xtype :'button',
title : ' ',
text : '@@',
name : 'selectorigin'
//anchor :'15%'
}] }]
}] }]
}] }]
}] }],
}); buttons : [{
var newOPWindow = new Ext.Window({
title : 'Output Document',
collapsible : false,
maximizable : false,
width : 550,
defaults :{ autoScroll:true },
height : 550,
minWidth : 200,
minHeight : 150,
layout : 'fit',
plain : true,
bodyStyle : 'padding:5px;',
items : outputDocForm,
buttonAlign : 'center',
buttons : [{
text : 'Save', text : 'Save',
formBind :true,
handler : function(){ handler : function(){
var getForm = outputDocForm.getForm().getValues(); var getForm = outputDocForm.getForm().getValues();
@@ -1251,21 +1255,21 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
var sFilename = getForm.OUT_DOC_FILENAME; var sFilename = getForm.OUT_DOC_FILENAME;
var sDesc = getForm.OUT_DOC_DESCRIPTION; var sDesc = getForm.OUT_DOC_DESCRIPTION;
var sLandscape = getForm.OUT_DOC_LANDSCAPE; var sLandscape = getForm.OUT_DOC_LANDSCAPE;
if(getForm.OUT_DOC_LANDSCAPE == 'Portrait') if(getForm.OUT_DOC_LANDSCAPE == 'Portrait')
getForm.OUT_DOC_LANDSCAPE=0; sLandscape=0;
if(getForm.OUT_DOC_LANDSCAPE == 'Landscape') if(getForm.OUT_DOC_LANDSCAPE == 'Landscape')
getForm.OUT_DOC_LANDSCAPE=1; sLandscape=1;
var sMedia = getForm.OUT_DOC_MEDIA; var sMedia = getForm.OUT_DOC_MEDIA;
var sLeftMargin = getForm.OUT_DOC_LEFT_MARGIN; var sLeftMargin = getForm.OUT_DOC_LEFT_MARGIN;
var sRightMargin = getForm.OUT_DOC_RIGHT_MARGIN; var sRightMargin = getForm.OUT_DOC_RIGHT_MARGIN;
var sTopMargin = getForm.OUT_DOC_TOP_MARGIN; var sTopMargin = getForm.OUT_DOC_TOP_MARGIN;
var sBottomMargin = getForm.OUT_DOC_BOTTOM_MARGIN; var sBottomMargin = getForm.OUT_DOC_BOTTOM_MARGIN;
var sGenerated = getForm.OUT_DOC_GENERATE; var sGenerated = getForm.OUT_DOC_GENERATE;
var sVersioning = getForm.OUT_DOC_VERSIONING; var sVersioning = getForm.OUT_DOC_VERSIONING;
if(getForm.OUT_DOC_VERSIONING == 'No') if(getForm.OUT_DOC_VERSIONING == 'NO')
getForm.OUT_DOC_VERSIONING=0; sVersioning=0;
if(getForm.OUT_DOC_VERSIONING == 'Yes') if(getForm.OUT_DOC_VERSIONING == 'YES')
getForm.OUT_DOC_VERSIONING=1; sVersioning=1;
var sDestPath = getForm.OUT_DOC_DESTINATION_PATH; var sDestPath = getForm.OUT_DOC_DESTINATION_PATH;
var sTags = getForm.OUT_DOC_TAGS; var sTags = getForm.OUT_DOC_TAGS;
@@ -1284,6 +1288,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
url : '../outputdocs/outputdocs_Save.php', url : '../outputdocs/outputdocs_Save.php',
method: 'POST', method: 'POST',
params:{ params:{
functions : '',
OUT_DOC_UID : '', OUT_DOC_UID : '',
OUT_DOC_TITLE : sDocTitle, OUT_DOC_TITLE : sDocTitle,
OUT_DOC_FILENAME : sFilename, OUT_DOC_FILENAME : sFilename,
@@ -1302,25 +1307,39 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
}, },
success: function(response) { success: function(response) {
Ext.MessageBox.alert ('Status','Output document has been created successfully.'); Ext.MessageBox.alert ('Status','Output document has been created successfully.');
outputDocStore.reload();
newOPWindow.close();
} }
}); });
} }
else else
Ext.MessageBox.alert ('Status','Output document title exist with same name.'); Ext.MessageBox.alert ('Status','There is an Output Document with the same name in this process. It is not saving');
} }
}); });
}
newOPWindow.close();
outputDocStore.reload();
}
},{ },{
text: 'Cancel', text: 'Cancel',
handler: function(){ handler: function(){
// when this button clicked, // when this button clicked,
newOPWindow.close(); newOPWindow.close();
} }
}] }],
buttonAlign : 'center'
});
var newOPWindow = new Ext.Window({
title : 'Output Document',
width : 550,
defaults :{ autoScroll:true },
height : 450,
minWidth : 200,
minHeight : 150,
layout : 'fit',
plain : true,
bodyStyle : 'padding:5px;',
items : outputDocForm,
buttonAlign : 'center'
}); });
var gridWindow = new Ext.Window({ var gridWindow = new Ext.Window({