Set
Description and parameters
int CTicket::Set( array arFields, int &MESSAGE_ID, int TICKET_ID="", char(1) CHECK_RIGHTS="Y" );
Method creates a new message, or modifies an existing message in case message ID is indicated in the second parameter. Returns ID for created message or modified query ID. Non-static method.
Method parameters
Parameter | Description | Available from version |
---|---|---|
arFields | Array with query parameters. The following indexes are available in the array:
** - this field is used only when modifying existing queries. |
|
MESSAGE_ID | Added message ID. Optional parameter. | |
TICKET_ID | Modified query ID. | |
CHECK_RIGHTS | Flag for required user access permission check: "Y" - check access permissions for current user that creates or modifies a query; "N" - crate and modify queries independently from current user access permissions. Optional parameter. Default value - "Y". | |
MID | Pass message ID when editing the query in the variable; when message is added, writes created query ID to the variable | |
EMAIL_NOTIFY | Optional parameter. Default value - "Y". Deleted from version 3.3.11 | |
SEND_EMAIL_TO_AUTHOR | Optional parameter. Default value - "Y". | |
SEND_EMAIL_TO_TECHSUPPORT | Optional parameter. Default value - "Y". |
Example
Example of code that adds a new message to technical support, received by email, or that adds a new message into query if $TICKET_ID is specified: <? require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); CModule::IncludeModule("support"); $arFields = array( "CREATED_MODULE_NAME" => "mail", "MODIFIED_MODULE_NAME" => "mail", "OWNER_SID" => "user@mail.com", "SOURCE_SID" => "email", "MESSAGE_AUTHOR_SID" => "user@mail.com", "MESSAGE_SOURCE_SID" => "email", "TITLE" => "title", "MESSAGE" => "message" ); //$TICKET_ID = 866; $NEW_TICKET_ID = CTicket::Set($arFields, $MESSAGE_ID, $TICKET_ID, "N"); echo "MESSAGE_ID = ".$MESSAGE_ID; ?>
© «Bitrix24», 2001-2024