1.) fixed deleting input and output doc and dynaform code
2.) Added saving function code for output doc
This commit is contained in:
@@ -34,7 +34,10 @@ require_once 'classes/model/CaseTrackerObject.php';
|
||||
In here we are deleting all datas about this Dynaform into DB
|
||||
*/
|
||||
|
||||
$sfunction =$_POST['function'];
|
||||
if(isset($_POST['function']))
|
||||
$sfunction =$_POST['function'];
|
||||
else
|
||||
$sfunction =$_POST['functions'];
|
||||
|
||||
switch($sfunction){
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ if (($RBAC_Response=$RBAC->userCanAccess("PM_FACTORY"))!=1) return $RBAC_Respons
|
||||
if(isset($aData['FIELDS']))
|
||||
{
|
||||
//$test = '{"1":{"TESTID":"1223","PRO_VARIABLE":"saaa"},"2":{"TESTID":"420","PRO_VARIABLE":"sas"}}';
|
||||
//$aData['FIELDS'] = (array)$oJSON->decode($test);
|
||||
$oData = $oJSON->decode($_POST['FIELDS']);
|
||||
$aData['FIELDS'] = '';
|
||||
for($i=0;$i<count($oData);$i++)
|
||||
|
||||
@@ -44,7 +44,10 @@ try {
|
||||
require_once 'classes/model/ObjectPermission.php';
|
||||
G::LoadClass( 'processMap' );
|
||||
|
||||
$sfunction =$_POST['function'];
|
||||
if(isset($_POST['function']))
|
||||
$sfunction =$_POST['function'];
|
||||
else
|
||||
$sfunction =$_POST['functions'];
|
||||
|
||||
switch($sfunction){
|
||||
case 'getRelationInfDoc':
|
||||
|
||||
@@ -37,12 +37,15 @@ try {
|
||||
break;
|
||||
}
|
||||
|
||||
if(isset($_POST['function']))
|
||||
$sfunction =$_POST['function'];
|
||||
else
|
||||
$sfunction =$_POST['functions'];
|
||||
|
||||
//$sfunction =$_POST['function'];
|
||||
//if(isset($_POST['function']) && $_POST['function']=='lookForNameOutput'){
|
||||
if($sfunction=='lookForNameOutput'){
|
||||
|
||||
if(isset($_POST['function']) && $_POST['function']=='lookForNameOutput'){
|
||||
|
||||
require_once('classes/model/Content.php');
|
||||
require_once('classes/model/Content.php');
|
||||
require_once ( "classes/model/OutputDocument.php" );
|
||||
|
||||
$snameInput=urldecode($_POST['NAMEOUTPUT']);
|
||||
@@ -80,28 +83,33 @@ try {
|
||||
|
||||
$oOutputDocument = new OutputDocument();
|
||||
|
||||
if ($_POST['form']['OUT_DOC_UID'] == '') {
|
||||
if ((isset($_POST['form']['OUT_DOC_TYPE']))&&( $_POST['form']['OUT_DOC_TYPE'] == 'JRXML' )) {
|
||||
$dynaformUid = $_POST['form']['DYN_UID'];
|
||||
if(isset($_POST['form']))
|
||||
$aData = $_POST['form']; //For old process map form
|
||||
else
|
||||
$aData = $_POST; //For Extjs (Since we are not using form in ExtJS)
|
||||
|
||||
$outDocUid = $oOutputDocument->create($_POST['form']);
|
||||
if ($aData['OUT_DOC_UID'] == '') {
|
||||
if ((isset($aData['OUT_DOC_TYPE']))&&( $aData['OUT_DOC_TYPE'] == 'JRXML' )) {
|
||||
$dynaformUid = $aData['DYN_UID'];
|
||||
|
||||
$outDocUid = $oOutputDocument->create($aData);
|
||||
G::LoadClass ('javaBridgePM');
|
||||
$jbpm = new JavaBridgePM ();
|
||||
print $jbpm->generateJrxmlFromDynaform ( $outDocUid, $dynaformUid, 'classic' );
|
||||
|
||||
}
|
||||
else {
|
||||
$outDocUid = $oOutputDocument->create($_POST['form']);
|
||||
$outDocUid = $oOutputDocument->create($aData);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$oOutputDocument->update($_POST['form']);
|
||||
$oOutputDocument->update($aData);
|
||||
}
|
||||
|
||||
if( isset($_POST['form']['PRO_UID']) ){
|
||||
if( isset($aData['PRO_UID']) ){
|
||||
//refresh dbarray with the last change in outputDocument
|
||||
$oMap = new processMap();
|
||||
$oCriteria = $oMap->getOutputDocumentsCriteria($_POST['form']['PRO_UID']);
|
||||
$oCriteria = $oMap->getOutputDocumentsCriteria($aData['PRO_UID']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,21 +52,59 @@ ProcessOptions.prototype.addDynaform= function(_5625)
|
||||
url : '../dynaforms/dynaforms_Delete.php',
|
||||
method: 'POST',
|
||||
params: {
|
||||
functions : 'getDynaformAssign',
|
||||
PRO_UID : pro_uid,
|
||||
DYN_UID : dynUID
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Dynaform has been removed successfully.');
|
||||
//First check whether selected Dynaform is assigned to a task steps or not.
|
||||
//If response.responseText == 1 i.e it is assigned, => it cannot be deleted
|
||||
if(response.responseText == "")
|
||||
{
|
||||
Ext.Ajax.request({
|
||||
url : '../dynaforms/dynaforms_Delete.php',
|
||||
method: 'POST',
|
||||
params: {
|
||||
functions : 'getRelationInfDynaform',
|
||||
DYN_UID : dynUID
|
||||
},
|
||||
success: function(response) {
|
||||
//Second check whether selected Dynaform is assigned to a processes supervisors or not.
|
||||
//If response.responseText == 1 i.e it is assigned, => it cannot be deleted
|
||||
if(response.responseText == "")
|
||||
{
|
||||
Ext.Ajax.request({
|
||||
url : '../dynaforms/dynaforms_Delete.php',
|
||||
method: 'POST',
|
||||
params: {
|
||||
functions : 'deleteDynaform',
|
||||
DYN_UID : dynUID
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Dynaform has been removed successfully.');
|
||||
//Secondly deleting from Grid
|
||||
taskDynaform.remove(r);
|
||||
//Reloading store after deleting dynaform
|
||||
taskDynaform.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
Ext.MessageBox.alert ('Status','Dynaform assigned to a process supervisors cannot be deleted.');
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
Ext.MessageBox.alert ('Status','Dynaform assigned to a task steps cannot be deleted.');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//Secondly deleting from Grid
|
||||
taskDynaform.remove(r);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var tb = new Ext.Toolbar({
|
||||
var tb = new Ext.Toolbar({
|
||||
items: [btnAdd, btnRemove]
|
||||
});
|
||||
|
||||
@@ -497,16 +535,35 @@ ProcessOptions.prototype.addInputDoc= function(_5625)
|
||||
url : '../inputdocs/inputdocs_Delete.php',
|
||||
method: 'POST',
|
||||
params: {
|
||||
functions : 'getRelationInfDoc',
|
||||
INP_DOC_UID : inputDocUID
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Input document has been removed successfully.');
|
||||
//First check whether selected input document is assigned to a process supervisor or not.
|
||||
//If response.responseText == 1 i.e it is assigned, => it cannot be deleted
|
||||
if(response.responseText == "")
|
||||
{
|
||||
Ext.Ajax.request({
|
||||
url : '../inputdocs/inputdocs_Delete.php',
|
||||
method: 'POST',
|
||||
params: {
|
||||
functions : 'deleteInputDocument',
|
||||
INP_DOC_UID : inputDocUID
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Input document has been removed successfully.');
|
||||
//Secondly deleting from Grid
|
||||
inputDocStore.remove(r);
|
||||
//reloading store after deleting input document
|
||||
inputDocStore.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
Ext.MessageBox.alert ('Status','Input document assigned to a process supervisors cannot be deleted.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Secondly deleting from Grid
|
||||
inputDocStore.remove(r);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -881,12 +938,14 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Output document has been removed successfully.');
|
||||
|
||||
//Secondly deleting from Grid
|
||||
outputDocStore.remove(r);
|
||||
//reloading store after deleting output document
|
||||
outputDocStore.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Secondly deleting from Grid
|
||||
outputDocStore.remove(r);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1214,24 +1273,43 @@ ProcessOptions.prototype.addOutputDoc= function(_5625)
|
||||
url : '../outputdocs/outputdocs_Save.php',
|
||||
method: 'POST',
|
||||
params:{
|
||||
OUT_DOC_TITLE :sDocTitle,
|
||||
OUT_DOC_FILENAME : sFilename,
|
||||
OUT_DOC_DESCRIPTION : sDesc,
|
||||
OUT_DOC_LANDSCAPE : sLandscape,
|
||||
OUT_DOC_MEDIA : sMedia,
|
||||
OUT_DOC_LEFT_MARGIN : sLeftMargin,
|
||||
OUT_DOC_RIGHT_MARGIN : sRightMargin,
|
||||
OUT_DOC_TOP_MARGIN : sTopMargin,
|
||||
OUT_DOC_BOTTOM_MARGIN : sBottomMargin,
|
||||
OUT_DOC_GENERATE : sGenerated,
|
||||
OUT_DOC_VERSIONING : sVersioning,
|
||||
OUT_DOC_DESTINATION_PATH : sDestPath,
|
||||
OUT_DOC_TAGS : sTags
|
||||
functions : 'lookForNameOutput',
|
||||
NAMEOUTPUT : sDocTitle,
|
||||
proUid : pro_uid
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Input document has been created successfully.');
|
||||
if(response.responseText == "1")
|
||||
{
|
||||
Ext.Ajax.request({
|
||||
url : '../outputdocs/outputdocs_Save.php',
|
||||
method: 'POST',
|
||||
params:{
|
||||
OUT_DOC_UID : '',
|
||||
OUT_DOC_TITLE : sDocTitle,
|
||||
OUT_DOC_FILENAME : sFilename,
|
||||
OUT_DOC_DESCRIPTION : sDesc,
|
||||
OUT_DOC_LANDSCAPE : sLandscape,
|
||||
OUT_DOC_MEDIA : sMedia,
|
||||
OUT_DOC_LEFT_MARGIN : sLeftMargin,
|
||||
OUT_DOC_RIGHT_MARGIN : sRightMargin,
|
||||
OUT_DOC_TOP_MARGIN : sTopMargin,
|
||||
OUT_DOC_BOTTOM_MARGIN : sBottomMargin,
|
||||
OUT_DOC_GENERATE : sGenerated,
|
||||
OUT_DOC_VERSIONING : sVersioning,
|
||||
OUT_DOC_DESTINATION_PATH : sDestPath,
|
||||
OUT_DOC_TAGS : sTags,
|
||||
PRO_UID : pro_uid
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Output document has been created successfully.');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
else
|
||||
Ext.MessageBox.alert ('Status','Output document title exist with same name.');
|
||||
}
|
||||
});
|
||||
|
||||
newOPWindow.close();
|
||||
outputDocStore.reload();
|
||||
|
||||
@@ -101,14 +101,15 @@ TaskContext.prototype.editTaskSteps = function(_3252){
|
||||
},
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Step has been removed successfully.');
|
||||
//Secondly deleting from Grid
|
||||
taskSteps.remove(r);
|
||||
//Reloading store after removing steps
|
||||
availableSteps.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Secondly deleting from Grid
|
||||
taskSteps.remove(r);
|
||||
//Reloading store after removing steps
|
||||
availableSteps.reload();
|
||||
else
|
||||
taskSteps.remove(r);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -524,14 +525,16 @@ TaskContext.prototype.editUsers= function(_5625)
|
||||
},*/
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','User has been removed successfully.');
|
||||
//Secondly deleting from Grid
|
||||
taskUsers.remove(r);
|
||||
|
||||
//Reloading available user store
|
||||
storeUsers.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
//Secondly deleting from Grid
|
||||
taskUsers.remove(r);
|
||||
|
||||
//Reloading available user store
|
||||
storeUsers.reload();
|
||||
else
|
||||
taskUsers.remove(r);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1547,14 +1550,16 @@ TaskContext.prototype.stepTriggers = function(_5625)
|
||||
url : '../steps/steps_Ajax.php' + urlparams,
|
||||
success: function(response) {
|
||||
Ext.MessageBox.alert ('Status','Trigger has been removed successfully.');
|
||||
|
||||
//Secondly deleting from Grid
|
||||
stepsTriggers.remove(r);
|
||||
|
||||
availableTriggers.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Secondly deleting from Grid
|
||||
stepsTriggers.remove(r);
|
||||
|
||||
availableTriggers.reload();
|
||||
else
|
||||
stepsTriggers.remove(r);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user