I solved the issue PM-1582

This commit is contained in:
Paula V. Quispe
2015-02-18 15:35:50 -04:00
parent fa7f8290bd
commit d728c2f01d
6 changed files with 1343 additions and 1131 deletions

View File

@@ -53,6 +53,28 @@ class CaseScheduler extends BaseCaseScheduler
throw ($e);
}
$con->commit();
//Add Audit Log
switch ($aData['SCH_OPTION']) {
case '1':
$perform = 'Daily';
break;
case '2':
$perform = 'Weekly';
break;
case '3':
$perform = 'Monthly';
break;
case '4':
$perform = 'One time only';
break;
case '5':
$perform = 'Every';
break;
}
G::auditLog("CreateCaseScheduler", "Scheduler Name: ".$aData['SCH_NAME'].", Task: ".$aData['TAS_UID'].", Perform this task: ".$perform.", Start Date: ".$aData['SCH_START_DATE'].", End Date: ".$aData['SCH_END_DATE'].", Execution time : ".$aData['SCH_START_TIME']);
return $result;
} catch (Exception $e) {
$con->rollback();
@@ -70,6 +92,27 @@ class CaseScheduler extends BaseCaseScheduler
if ($this->validate()) {
$result = $this->save();
$con->commit();
//Add Audit Log
switch ($fields['SCH_OPTION']){
case '1':
$perform = 'Daily';
break;
case '2':
$perform = 'Weekly';
break;
case '3':
$perform = 'Monthly';
break;
case '4':
$perform = 'One time only';
break;
case '5':
$perform = 'Every';
break;
}
G::auditLog("UpdateCaseScheduler", "Scheduler Name: ".$fields['SCH_NAME'].", Task: ".$fields['TAS_UID'].", Perform this task: ".$perform.", Start Date: ".$fields['SCH_START_DATE'].", End Date: ".$fields['SCH_END_DATE'].", Execution time : ".$fields['SCH_START_TIME']);
return $result;
} else {
$con->rollback();
@@ -87,8 +130,12 @@ class CaseScheduler extends BaseCaseScheduler
try {
$oCaseScheduler = CaseSchedulerPeer::retrieveByPK( $SchUid );
if (! is_null( $oCaseScheduler )) {
$fields = $this->Load( $SchUid );
$iResult = $oCaseScheduler->delete();
$con->commit();
//Add Audit Log
G::auditLog("DeleteCaseScheduler", "Scheduler Name: ".$fields['SCH_NAME'].", Task: ".$fields['TAS_UID']);
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));

View File

@@ -141,6 +141,9 @@ class DbSource extends BaseDbSource
if ($this->validate()) {
$result = $this->save();
$con->commit();
//Add Audit Log
G::auditLog("UpdateDatabaseConnection", "Connection Uid: ".$fields['DBS_UID'].", Connection Engine: ".$fields['DBS_TYPE'].", Connection Encode: ".$fields['DBS_ENCODE'].", Connection Server: ".$fields['DBS_SERVER'].", Connection Database: ".$fields['DBS_DATABASE_NAME'].", Connection Port: ".$fields['DBS_PORT']);
return $result;
} else {
$con->rollback();
@@ -156,6 +159,7 @@ class DbSource extends BaseDbSource
{
$con = Propel::getConnection(DbSourcePeer::DATABASE_NAME);
try {
$fields = $this->load($DbsUid, $ProUID);
$con->begin();
$this->setDbsUid($DbsUid);
$this->setProUid($ProUID);
@@ -167,6 +171,9 @@ class DbSource extends BaseDbSource
}
$result = $this->delete();
$con->commit();
//Add Audit Log
G::auditLog("DeleteDatabaseConnection", "Connection Uid: ".$DbsUid.", Connection Engine: ".$fields['DBS_TYPE'].", Connection Database: ".$fields['DBS_DATABASE_NAME']);
return $result;
} catch (exception $e) {
$con->rollback();
@@ -196,6 +203,9 @@ class DbSource extends BaseDbSource
throw ($e);
}
$con->commit();
//Add Audit Log
G::auditLog("CreateDatabaseConnection", "Connection Uid: ".$aData['DBS_UID'].", Connection Engine: ".$aData['DBS_TYPE'].", Connection Encode: ".$aData['DBS_ENCODE'].", Connection Server: ".$aData['DBS_SERVER'].", Connection Database: ".$aData['DBS_DATABASE_NAME'].", Connection Port: ".$aData['DBS_PORT']);
return $this->getDbsUid();
} catch (exception $e) {
$con->rollback();

View File

@@ -126,6 +126,34 @@ class InputDocument extends BaseInputDocument
}
$iResult = $oInputDocument->save();
$oConnection->commit();
//Add Audit Log
switch ($aData['INP_DOC_FORM_NEEDED']){
case 'VIRTUAL':
$docType = 'Digital';
break;
case 'REAL':
$docType = 'Printed';
break;
case 'VREAL':
$docType = 'Digital/Printed';
break;
}
if(isset($aData['INP_DOC_VERSIONING']) && $aData['INP_DOC_VERSIONING'] == 1){
$enableVersion = 'Yes';
}else{
$enableVersion = 'No';
}
$description = "Input Document Title: ".$aData['INP_DOC_TITLE'].", Input Document Uid: ".$aData['INP_DOC_UID'].", Document Type: ".$docType;
if(!empty($aData['INP_DOC_DESCRIPTION'])){
$description .= ", Description: ".$aData['INP_DOC_DESCRIPTION'];
}
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
}
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'].", Maximum Input Document file size: ".$inputDocMaxFileSize;
G::auditLog("CreateInputDocument", $description);
return $aData['INP_DOC_UID'];
} else {
$sMessage = '';
@@ -165,6 +193,34 @@ class InputDocument extends BaseInputDocument
}
$iResult = $oInputDocument->save();
$oConnection->commit();
//Add Audit Log
switch ($aData['INP_DOC_FORM_NEEDED']){
case 'VIRTUAL':
$docType = 'Digital';
break;
case 'REAL':
$docType = 'Printed';
break;
case 'VREAL':
$docType = 'Digital/Printed';
break;
}
if(isset($aData['INP_DOC_VERSIONING']) && $aData['INP_DOC_VERSIONING'] == 1){
$enableVersion = 'Yes';
}else{
$enableVersion = 'No';
}
$description = "Input Document Title: ".$aData['INP_DOC_TITLE'].", Input Document Uid: ".$aData['INP_DOC_UID'].", Document Type: ".$docType;
if(!empty($aData['INP_DOC_DESCRIPTION'])){
$description .= ", Description: ".$aData['INP_DOC_DESCRIPTION'];
}
if(!empty($aData['INP_DOC_DESTINATION_PATH'])){
$description .= ", Destination Path: ".$aData['INP_DOC_DESTINATION_PATH'];
}
$inputDocMaxFileSize = $aData['INP_DOC_MAX_FILESIZE']? $aData['INP_DOC_MAX_FILESIZE'].' '.$aData['INP_DOC_MAX_FILESIZE_UNIT'] : "256 MB";
$description .= ", Extensions: ".$aData['INP_DOC_TYPE_FILE'].", Maximum Input Document file size: ".$inputDocMaxFileSize;
G::auditLog("UpdateInputDocument", $description);
return $iResult;
} else {
$sMessage = '';
@@ -196,11 +252,18 @@ class InputDocument extends BaseInputDocument
try {
$oInputDocument = InputDocumentPeer::retrieveByPK( $sInpDocUid );
if (! is_null( $oInputDocument )) {
$nameInput = $this->getInpDocTitle();
$descInput = $this->getInpDocDescription();
$oConnection->begin();
Content::removeContent( 'INP_DOC_TITLE', '', $oInputDocument->getInpDocUid() );
Content::removeContent( 'INP_DOC_DESCRIPTION', '', $oInputDocument->getInpDocUid() );
$iResult = $oInputDocument->delete();
$oConnection->commit();
//Add Audit Log
$nameInput = $this->getInpDocTitle();
$descInput = $this->getInpDocDescription();
G::auditLog("DeleteInputDocument", "Input Document Name: ".$nameInput.", Input Document Uid: ".$sInpDocUid.", Description: ".$descInput);
return $iResult;
} else {
throw (new Exception( 'This row doesn\'t exist!' ));

File diff suppressed because it is too large Load Diff

View File

@@ -155,7 +155,7 @@ class Triggers extends BaseTriggers
} else {
$this->setTriUid($aData['TRI_UID'] );
}
$triggerUid = $this->getTriUid();
$this->setProUid($aData['PRO_UID']);
$this->setTriType("SCRIPT");
@@ -183,6 +183,13 @@ class Triggers extends BaseTriggers
}
$result=$this->save();
$con->commit();
//Add Audit Log
$description = "Trigger Name: ".$aData['TRI_TITLE'].", Trigger Uid: ".$triggerUid;
if (isset ( $aData['TRI_DESCRIPTION'] )) {
$description .= ", Description: ".$aData['TRI_DESCRIPTION'];
}
G::auditLog("CreateTrigger", $description);
return $result;
} else {
$con->rollback();
@@ -233,10 +240,18 @@ class Triggers extends BaseTriggers
$con->begin();
$oTri = TriggersPeer::retrieveByPK( $TriUid );
if (!is_null($oTri)) {
$triggerName = $this->getTriTitle();
$triggerDesc = $this->getTriDescription();
Content::removeContent( 'TRI_TITLE', '', $this->getTriUid());
Content::removeContent( 'TRI_DESCRIPTION', '', $this->getTriUid());
$result = $oTri->delete();
$con->commit();
//Add Audit Log
$description = "Trigger Name: ".$triggerName.", Trigger Uid: ".$TriUid;
if (isset ( $triggerDesc )) {
$description .= ", Description: ".$triggerDesc;
}
G::auditLog("DeleteTrigger", $description);
}
return $result;
} catch (Exception $e) {

View File

@@ -101,15 +101,27 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
}
/*----------------------------------********---------------------------------*/
}
$swCreate = true;
if ($value['TRI_UID'] != '') {
$oTrigger->load( $value['TRI_UID'] );
} else {
$oTrigger->create( $value );
$value['TRI_UID'] = $oTrigger->getTriUid();
}
//print_r($_POST['form']);die;
$swCreate = false;
}
$oTrigger->update( $value );
if($swCreate){
//Add Audit Log
$fields = $oTrigger->load( $value['TRI_UID'] );
$description = "Trigger Name: ".$fields['TRI_TITLE'].", Trigger Uid: ".$value['TRI_UID'];
if (isset ( $fields['TRI_DESCRIPTION'] )) {
$description .= ", Description: ".$fields['TRI_DESCRIPTION'];
}
if (isset($value["TRI_WEBBOT"])) {
$description .= ", [EDIT CODE]";
}
G::auditLog("UpdateTrigger", $description);
}
//if (! isset( $_POST['mode'] )) {
// $oProcessMap->triggersList( $value['PRO_UID'] );