CAdvContract :: CheckFields: Bitrix method

      
<?php 
//  CAdvContract :: CheckFields()
//  /dist/bitrix/modules/advertising/classes/general/advertising.php:626

    
public static function CheckFields($arFields$CONTRACT_ID$CHECK_RIGHTS="Y")
    {
        global 
$strError;
        
$str "";
        
$arrPERM false;
        if (
$CHECK_RIGHTS=="Y")
        {
            
$arrPERM CAdvContract::GetUserPermissions($CONTRACT_ID);
            
$arrPERM $arrPERM[$CONTRACT_ID];
        }
        if (
$CHECK_RIGHTS!="Y" || (is_array($arrPERM) && in_array("EDIT"$arrPERM)))
        {
            if (
strlen($arFields["DATE_SHOW_FROM"])>0)
            {
                if (!
CheckDateTime($arFields["DATE_SHOW_FROM"]))
                    
$str.= GetMessage("AD_ERROR_WRONG_DATE_SHOW_FROM_CONTRACT")."<br>";
            }
            if (
strlen($arFields["DATE_SHOW_TO"])>0)
            {
                if (!
CheckDateTime($arFields["DATE_SHOW_TO"]))
                    
$str .= GetMessage("AD_ERROR_WRONG_DATE_SHOW_TO_CONTRACT")."<br>";
            }
        }
        else
        {
            if (
$CONTRACT_ID>0)
                
$str .= GetMessage("AD_ERROR_NOT_ENOUGH_PERMISSIONS_CONTRACT")."<br>";
            else
                
$str .= GetMessage("AD_ERROR_NOT_ENOUGH_PERMISSIONS_FOR_NEW_CONTRACT")."<br>";
        }

        
$strError .= $str;
        if (
strlen($str)>0)
            return 
false;
        else
            return 
true;
    }