?> <tr> <td><?php echo GetMessage("RATING_RULE_EDIT_FRM_ACTIVE"); ?> </td> <td><?php echo InputType("checkbox", "ACTIVE", "Y", $str_ACTIVE); ?> </td> </tr> <? $tabControl->EndCustomField("ACTIVE"); $tabControl->BeginCustomField("ENTITY_TYPE_ID", GetMessage('RATING_RULE_EDIT_FRM_TYPE_ID'), true); $arObjects = CRatingRule::GetRatingRuleObjects(); ?> <tr style="<?php echo count($arObjects) > 1 ? '' : 'display:none'; ?> " class="adm-detail-required-field"> <td><?php echo GetMessage("RATING_RULE_EDIT_FRM_TYPE_ID"); ?> </td> <td><?php echo SelectBoxFromArray("ENTITY_TYPE_ID", array('reference_id' => $arObjects, 'reference' => $arObjects), $str_ENTITY_TYPE_ID, "", "onChange=\"jsTypeChanged('rating_rule_form')\""); ?> </td> </tr> <?
public static function __CheckFields($arFields) { $aMsg = array(); if (is_set($arFields, "NAME") && trim($arFields["NAME"]) == "") { $aMsg[] = array("id" => "NAME", "text" => GetMessage("RR_GENERAL_ERR_NAME")); } if (is_set($arFields, "ACTIVE") && !($arFields["ACTIVE"] == 'Y' || $arFields["ACTIVE"] == 'N')) { $aMsg[] = array("id" => "ACTIVE", "text" => GetMessage("RR_GENERAL_ERR_ACTIVE")); } if (is_set($arFields, "ENTITY_TYPE_ID")) { $arObjects = CRatingRule::GetRatingRuleObjects(); if (!in_array($arFields['ENTITY_TYPE_ID'], $arObjects)) { $aMsg[] = array("id" => "ENTITY_TYPE_ID", "text" => GetMessage("RR_GENERAL_ERR_ENTITY_TYPE_ID")); } } if (is_set($arFields, "CONDITION_NAME") && trim($arFields["CONDITION_NAME"]) == "") { $aMsg[] = array("id" => "CONDITION_NAME", "text" => GetMessage("RR_GENERAL_ERR_CONDITION_NAME")); } if (is_set($arFields, "ACTION_NAME") && trim($arFields["ACTION_NAME"]) == "") { $aMsg[] = array("id" => "ACTION_NAME", "text" => GetMessage("RR_GENERAL_ERR_ACTION_NAME")); } if (!empty($aMsg)) { $e = new CAdminException($aMsg); $GLOBALS["APPLICATION"]->ThrowException($e); return false; } return true; }