Set
mixed CFormStatus::Set( array fields, mixed status_id = false, string check_rights = "Y" )
The method Set adds a new status or modifies the existing one. Returns the ID of the modified or added status on success, or false otherwise.
Parameters
fields | Array of values which accept the following keys:
* - required. * - these arrays may have values of "0"which means the result creator. |
status_id | The ID of the modified status. Optional. False by default (adds a new status). |
check_rights | Flag specifying the current user permissions should be checked. One of
the following values is possible:
Optional. "Y" by default which means the permissions should be checked. |
See Also
Example
<? $FORM_ID = 4; // The web form ID $arFields = array( "FORM_ID" => $FORM_ID, // The web form ID "C_SORT" => 100, // sort order "ACTIVE" => "Y", // status is active "TITLE" => "Published", // status title "DESCRIPTION" => "Final status", // status description "CSS" => "statusgreen", // CSS class "HANDLER_OUT" => "", // handler "HANDLER_IN" => "", // handler "DEFAULT_VALUE" => "N", // not default "arPERMISSION_VIEW" => array(2), // view permission for all "arPERMISSION_MOVE" => array(), // move permission for admins only "arPERMISSION_EDIT" => array(), // edit permission for admins "arPERMISSION_DELETE" => array(), // delete permission for admins only ); $NEW_ID = CFormStatus::Set($arFields); if ($NEW_ID>0) echo "The ID=".$NEW_ID has been added; else // error { // display the error description global $strError; echo $strError; } ?>
© «Bitrix24», 2001-2024