editing function part of input document.

This commit is contained in:
safan
2010-12-22 11:44:15 +00:00
parent 9b925cbfe1
commit fb3db8169b
4 changed files with 114 additions and 41 deletions

View File

@@ -35,14 +35,3 @@ try
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
$rows = $oProcessMap->showExtDBConnList();
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result ) ;

View File

@@ -9,9 +9,20 @@ try
array_shift($rows);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result) ;
if (isset($_GET['INP_DOC_UID'])) {
require_once 'classes/model/InputDocument.php';
$oInputDocument = new InputDocument();
$rows = $oInputDocument->load($_GET['INP_DOC_UID']);
}
// $result['totalCount'] = count($rows);
// $result['data'] = $rows;
// print json_encode( $result) ;
$tmpData = json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
}
catch ( Exception $e ) {

View File

@@ -40,7 +40,7 @@ try {
if(isset($_POST['function']))
$sfunction =$_POST['function'];
else
$sfunction ='';
$sfunction =$_POST['functions'];
switch($sfunction){
case 'lookForNameInput':

View File

@@ -595,6 +595,32 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
}
});
var btnEdit = new Ext.Button({
id: 'btnEdit',
text: 'Edit',
iconCls: 'application_add',
handler: function (s) {
var selectedRow = inputDocGrid.getSelectionModel().getSelections();
var inputDocUID = selectedRow[0].data.INP_DOC_UID;
//Loading Task Details into the form
inputDocForm.form.load({
url:'proxyInputDocument.php?INP_DOC_UID=' +inputDocUID,
method:'GET',
waitMsg:'Loading',
success:function(form, action) {
//Ext.MessageBox.alert('Message', 'Loaded OK');
newIOWindow.show();
Ext.getCmp("INP_DOC_UID").setValue(inputDocUID);
},
failure:function(form, action) {
Ext.MessageBox.alert('Message', 'Load failed');
}
});
}
});
var inputDocForm = new Ext.FormPanel({
labelWidth: 100,
bodyStyle :'padding:5px 5px 0',
@@ -744,6 +770,10 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
//anchor:'15%'
}]
}]
},{
id : 'INP_DOC_UID',
xtype: 'hidden',
name : 'INP_DOC_UID'
}]
}]
});
@@ -773,7 +803,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
var tb = new Ext.Toolbar({
items: [btnAdd, btnRemove]
items: [btnAdd, btnRemove,btnEdit]
});
var inputDocGrid = new Ext.grid.GridPanel({
@@ -810,6 +840,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
buttonAlign: 'center'
});
var newIOWindow = new Ext.Window({
title: 'Input Document',
collapsible: false,
@@ -828,7 +859,8 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
handler: function(){
var getForm = inputDocForm.getForm().getValues();
var sDocType = getForm.INP_DOC_TITLE
var sDocUID = getForm.INP_DOC_UID;
var sDocTitle = getForm.INP_DOC_TITLE;
var sFormNeeded = getForm.INP_DOC_FORM_NEEDED;
var sOrig = getForm.INP_DOC_ORIGINAL;
if(sOrig == 'LEGAL COPY')
@@ -852,12 +884,26 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
var sDestPath = getForm.INP_DOC_DESTINATION_PATH;
var sTags = getForm.INP_DOC_TAGS;
if(sDocUID == "")
{
Ext.Ajax.request({
url : '../inputdocs/inputdocs_Save.php',
method: 'POST',
params:{
INP_DOC_TITLE :sDocType,
INP_DOC_UID : '',
functions : 'lookForNameInput',
NAMEINPUT : sDocTitle,
proUid : pro_uid
},
success: function(response) {
if(response.responseText == "1")
{
Ext.Ajax.request({
url : '../inputdocs/inputdocs_Save.php',
method: 'POST',
params:{
functions : '',
INP_DOC_TITLE : sDocTitle,
INP_DOC_UID : sDocUID,
PRO_UID : pro_uid,
INP_DOC_FORM_NEEDED : sFormNeeded,
INP_DOC_ORIGINAL : sOrig,
@@ -867,15 +913,40 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
},
success: function(response) {
Ext.MessageBox.alert ('Status','Input document has been created successfully.');
}
});
//var getData = getstore.data.items;
//taskExtObj.saveTaskUsers(getData);
newIOWindow.close();
inputDocStore.reload();
}
});
}
else
Ext.MessageBox.alert ('Status','There is an Input Document with the same name in this process. It is not saving');
}
})
}
else
{
Ext.Ajax.request({
url : '../inputdocs/inputdocs_Save.php',
method: 'POST',
params:{
functions : '',
INP_DOC_TITLE : sDocTitle,
INP_DOC_UID : sDocUID,
PRO_UID : pro_uid,
INP_DOC_FORM_NEEDED : sFormNeeded,
INP_DOC_ORIGINAL : sOrig,
INP_DOC_VERSIONING : sVers,
INP_DOC_TAGS : 'INPUT', //By Default
INP_DOC_DESCRIPTION : sDesc
},
success: function(response) {
Ext.MessageBox.alert ('Status','Input document has been updated successfully.');
newIOWindow.close();
inputDocStore.reload();
}
});
}
}
},{
text: 'Cancel',
handler: function(){
@@ -885,6 +956,7 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
}]
});
gridWindow.show();
}
@@ -985,6 +1057,7 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
var selectedRow = outputDocGrid.getSelectionModel().getSelections();
var outDocUID = selectedRow[0].data.OUT_DOC_UID;
}
});
var btnProperties = new Ext.Button({