Статьи
05.08.2014
AddEventHandler("main", "OnAdminTabControlBegin", "orderCanselReason");
function orderCanselReason(&$form)
{
if ($GLOBALS["APPLICATION"]->GetCurPage() == "/bitrix/admin/sale_order_detail.php")
{
CJSCore::Init('jquery');
//echo "<pre>"; print_r($form); echo "</pre>";
$form->arFields['ORDER_CANCELED']['custom_html'] .= '<script>
function reasoncheck(e)
{
if ($("#FORM_REASON_CANCELED").val() == "")
{
e.preventDefault();
if (e.stopPropagation)
{
e.stopPropagation();
}
else
{
window.event.cancelBubble = true;
}
alert("Пожалуйста, введите причину отмены!");
}
}
$(document).ready(function() {
$(".adm-detail-content-cell-r").delegate(".adm-btn-wrap", "click", function() {
$(".popup-window-button-text").each(function() {
if ($(this).html() == "Сохранить") $(this).attr("onclick", "reasoncheck(event);");
});
});
});
</script>';
}
}
function orderCanselReason(&$form)
{
if ($GLOBALS["APPLICATION"]->GetCurPage() == "/bitrix/admin/sale_order_detail.php")
{
CJSCore::Init('jquery');
//echo "<pre>"; print_r($form); echo "</pre>";
$form->arFields['ORDER_CANCELED']['custom_html'] .= '<script>
function reasoncheck(e)
{
if ($("#FORM_REASON_CANCELED").val() == "")
{
e.preventDefault();
if (e.stopPropagation)
{
e.stopPropagation();
}
else
{
window.event.cancelBubble = true;
}
alert("Пожалуйста, введите причину отмены!");
}
}
$(document).ready(function() {
$(".adm-detail-content-cell-r").delegate(".adm-btn-wrap", "click", function() {
$(".popup-window-button-text").each(function() {
if ($(this).html() == "Сохранить") $(this).attr("onclick", "reasoncheck(event);");
});
});
});
</script>';
}
}
Облако тегов
Последние комментарии
Наши клиенты
Контакты
ООО "Парнас"
420111
г. Казань, ул. Пушкина 18
Телефон :
8-843-236-6001
8-499-550-6001
Почта :
mail@parnas-it.com