BUG 9937 PMFSendMessage way to not log in history... SOLVED

- The registration messages are displayed by default.
- was add in PMFSendMessage a feature in the last parameter.
This commit is contained in:
Marco Antonio Nina
2012-10-29 11:45:05 -04:00
parent b5288d2266
commit 530565f543
9 changed files with 89 additions and 18 deletions

View File

@@ -5481,7 +5481,8 @@ class Cases
'APP_MSG_BCC' => $aRow['APP_MSG_BCC'],
'APP_MSG_TEMPLATE' => $aRow['APP_MSG_TEMPLATE'],
'APP_MSG_STATUS' => $aRow['APP_MSG_STATUS'],
'APP_MSG_ATTACH' => $aRow['APP_MSG_ATTACH']
'APP_MSG_ATTACH' => $aRow['APP_MSG_ATTACH'],
'APP_MSG_SHOW_MESSAGE' => $aRow['APP_MSG_SHOW_MESSAGE']
);
$oDataset->next();
}

View File

@@ -796,7 +796,7 @@ function getEmailConfiguration ()
*
*/
//@param array | $aFields=array() | An associative array optional | Optional parameter. An associative array where the keys are the variable name and the values are the variable's value.
function PMFSendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields = array(), $aAttachment = array())
function PMFSendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields = array(), $aAttachment = array(), $showMessage = true)
{
global $oPMScript;
@@ -810,7 +810,7 @@ function PMFSendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTempla
G::LoadClass( 'wsBase' );
$ws = new wsBase();
$result = $ws->sendMessage( $caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields, $aAttachment );
$result = $ws->sendMessage( $caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $aFields, $aAttachment, $showMessage);
if ($result->status_code == 0) {
return 1;

View File

@@ -623,6 +623,7 @@ class spoolRun
$spool->setAppMsgTemplate( $db_spool['app_msg_template'] );
$spool->setAppMsgStatus( $db_spool['app_msg_status'] );
$spool->setAppMsgSendDate( date( 'Y-m-d H:i:s' ) ); // Add by Ankit
$spool->setAppMsgShowMessage( $db_spool['app_msg_show_message'] ); // Add by Ankit
if (! $spool->validate()) {

View File

@@ -730,7 +730,7 @@ class wsBase
* @param $appFields = null
* @return $result will return an object
*/
public function sendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null)
public function sendMessage ($caseId, $sFrom, $sTo, $sCc, $sBcc, $sSubject, $sTemplate, $appFields = null, $aAttachment = null, $showMessage = true)
{
try {
G::loadClass( 'system' );
@@ -781,8 +781,9 @@ class wsBase
if (! $hasEmailFrom || strpos( $sFrom, $aSetup['MESS_ACCOUNT'] ) === false) {
$sFrom = '"' . stripslashes( $sFrom ) . '" <' . $aSetup['MESS_ACCOUNT'] . ">";
}
$showMessage = ($showMessage) ? 1 : 0 ;
$messageArray = array ('msg_uid' => '','app_uid' => $caseId,'del_index' => 0,'app_msg_type' => 'TRIGGER','app_msg_subject' => $sSubject,'app_msg_from' => $sFrom,'app_msg_to' => $sTo,'app_msg_body' => $sBody,'app_msg_cc' => $sCc,'app_msg_bcc' => $sBcc,'app_msg_attach' => $aAttachment,'app_msg_template' => '','app_msg_status' => 'pending'
$messageArray = array ('msg_uid' => '','app_uid' => $caseId,'del_index' => 0,'app_msg_type' => 'TRIGGER','app_msg_subject' => $sSubject,'app_msg_from' => $sFrom,'app_msg_to' => $sTo,'app_msg_body' => $sBody,'app_msg_cc' => $sCc,'app_msg_bcc' => $sBcc,'app_msg_attach' => $aAttachment,'app_msg_template' => '','app_msg_status' => 'pending', 'app_msg_show_message' => $showMessage
);
$oSpool->create( $messageArray );

View File

@@ -97,6 +97,8 @@ class AppMessageMapBuilder
$tMap->addColumn('APP_MSG_SEND_DATE', 'AppMsgSendDate', 'int', CreoleTypes::TIMESTAMP, true, null);
$tMap->addColumn('APP_MSG_SHOW_MESSAGE', 'AppMsgShowMessage', 'int', CreoleTypes::TINYINT, true, null);
} // doBuild()
} // AppMessageMapBuilder

View File

@@ -123,6 +123,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
*/
protected $app_msg_send_date;
/**
* The value for the app_msg_show_message field.
* @var int
*/
protected $app_msg_show_message = 1;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
@@ -355,6 +361,17 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
}
}
/**
* Get the [app_msg_show_message] column value.
*
* @return int
*/
public function getAppMsgShowMessage()
{
return $this->app_msg_show_message;
}
/**
* Set the value of [app_msg_uid] column.
*
@@ -713,6 +730,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
} // setAppMsgSendDate()
/**
* Set the value of [app_msg_show_message] column.
*
* @param int $v new value
* @return void
*/
public function setAppMsgShowMessage($v)
{
// Since the native PHP type for this column is integer,
// we will cast the input value to an int (if it is not).
if ($v !== null && !is_int($v) && is_numeric($v)) {
$v = (int) $v;
}
if ($this->app_msg_show_message !== $v || $v === 1) {
$this->app_msg_show_message = $v;
$this->modifiedColumns[] = AppMessagePeer::APP_MSG_SHOW_MESSAGE;
}
} // setAppMsgShowMessage()
/**
* Hydrates (populates) the object variables with values from the database resultset.
*
@@ -762,12 +801,14 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$this->app_msg_send_date = $rs->getTimestamp($startcol + 15, null);
$this->app_msg_show_message = $rs->getInt($startcol + 16);
$this->resetModified();
$this->setNew(false);
// FIXME - using NUM_COLUMNS may be clearer.
return $startcol + 16; // 16 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 17; // 17 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating AppMessage object", $e);
@@ -1019,6 +1060,9 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
case 15:
return $this->getAppMsgSendDate();
break;
case 16:
return $this->getAppMsgShowMessage();
break;
default:
return null;
break;
@@ -1055,6 +1099,7 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$keys[13] => $this->getAppMsgStatus(),
$keys[14] => $this->getAppMsgAttach(),
$keys[15] => $this->getAppMsgSendDate(),
$keys[16] => $this->getAppMsgShowMessage(),
);
return $result;
}
@@ -1134,6 +1179,9 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
case 15:
$this->setAppMsgSendDate($value);
break;
case 16:
$this->setAppMsgShowMessage($value);
break;
} // switch()
}
@@ -1221,6 +1269,10 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$this->setAppMsgSendDate($arr[$keys[15]]);
}
if (array_key_exists($keys[16], $arr)) {
$this->setAppMsgShowMessage($arr[$keys[16]]);
}
}
/**
@@ -1296,6 +1348,10 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$criteria->add(AppMessagePeer::APP_MSG_SEND_DATE, $this->app_msg_send_date);
}
if ($this->isColumnModified(AppMessagePeer::APP_MSG_SHOW_MESSAGE)) {
$criteria->add(AppMessagePeer::APP_MSG_SHOW_MESSAGE, $this->app_msg_show_message);
}
return $criteria;
}
@@ -1380,6 +1436,8 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
$copyObj->setAppMsgSendDate($this->app_msg_send_date);
$copyObj->setAppMsgShowMessage($this->app_msg_show_message);
$copyObj->setNew(true);

View File

@@ -25,7 +25,7 @@ abstract class BaseAppMessagePeer
const CLASS_DEFAULT = 'classes.model.AppMessage';
/** The total number of columns. */
const NUM_COLUMNS = 16;
const NUM_COLUMNS = 17;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@@ -79,6 +79,9 @@ abstract class BaseAppMessagePeer
/** the column name for the APP_MSG_SEND_DATE field */
const APP_MSG_SEND_DATE = 'APP_MESSAGE.APP_MSG_SEND_DATE';
/** the column name for the APP_MSG_SHOW_MESSAGE field */
const APP_MSG_SHOW_MESSAGE = 'APP_MESSAGE.APP_MSG_SHOW_MESSAGE';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
@@ -90,10 +93,10 @@ abstract class BaseAppMessagePeer
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', ),
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, ),
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', 'AppMsgShowMessage', ),
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, AppMessagePeer::APP_MSG_SHOW_MESSAGE, ),
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', 'APP_MSG_SHOW_MESSAGE', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
);
/**
@@ -103,10 +106,10 @@ abstract class BaseAppMessagePeer
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, ),
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, ),
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, 'AppMsgShowMessage' => 16, ),
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, AppMessagePeer::APP_MSG_SHOW_MESSAGE => 16, ),
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, 'APP_MSG_SHOW_MESSAGE' => 16, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, )
);
/**
@@ -239,6 +242,8 @@ abstract class BaseAppMessagePeer
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SHOW_MESSAGE);
}
const COUNT = 'COUNT(APP_MESSAGE.APP_MSG_UID)';

View File

@@ -236,6 +236,7 @@
<column name="APP_MSG_STATUS" type="VARCHAR" size="20"/>
<column name="APP_MSG_ATTACH" type="LONGVARCHAR" required="false"/>
<column name="APP_MSG_SEND_DATE" type="TIMESTAMP" required="true"/>
<column name="APP_MSG_SHOW_MESSAGE" type="TINYINT" required="true" default="1"/>
</table>
<table name="APP_OWNER">
<vendor type="mysql">

View File

@@ -39,10 +39,12 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
$totalCount = 0;
foreach ($appMessageArray as $index => $value) {
if ($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1) {
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
$aProcesses[] = $appMessageArray[$index];
$totalCount ++;
}
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir );