@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux www.thesweb.ru 4.19.0-22-amd64 #1 SMP Debian 4.19.260-1 (2022-09-29) x86_64
Current Path :
/
var
/
www
/
www-root
/
data
/
www
/
new.labinform.ru
/
sci_lite20
/
Path :
Upload File :
New :
File
Dir
/var/www/www-root/data/www/new.labinform.ru/sci_lite20/rubricators.js
var ThesRubricator = { rubdes_usedformparam: '', saveSeletedRow: function (grid) { var sel0 = $(grid).datagrid('getSelected'); if (sel0) $(grid).datagrid('options').saveSelectedRow = $(grid).datagrid('getRowIndex', sel0); else $(grid).datagrid('options').saveSelectedRow = 0; }, submit_rubriceditform: function (callback) { $('#rubriceditform').form({ success:function(data){ try { var s = eval('(' + data + ')'); data = s; } catch (err) { data = {errno: 10000, error: data }; } if (data.errno == 0) { $.messager.show({ title:'Сообщение', msg: 'Данные сохранены', border:'thin', cls:'c4', timeout: 4000, showType:'slide' }); if (callback) callback(); } else { $.messager.show({ title:'Ошибка!', msg: data.error, border:'thin', cls:'c5', timeout: 10000, showType:'slide' }); } }, error: function(data) { $.messager.show({ title:'Ошибка!', msg: data, border:'thin', cls:'c5', timeout: 10000, showType:'slide' }); }, }).submit(); }, rubr_filter_change: function (filtername, fld, newValue) { var gr = $('#rubrics'); if ($(filtername).textbox('getText') != newValue) return false; var d = gr.datagrid('getRows'); for (var i = 0; i < d.length; i++) { if (d[i][fld].indexOf(newValue) > -1) { gr.datagrid('selectRow', i); return true; } } return true; }, load_rubrics: function () { if ($(this).datagrid('options').disjgrid) $($(this).datagrid('options').disjgrid).datagrid('loadData', {"total":0,"rows":[]}); else $('#disjs').datagrid('loadData', {"total":0,"rows":[]}); //r = $('#rubrics').datagrid('options').saveSelectedRow; //$('#rubrics').datagrid('selectRow', r ? r : 0); r = $(this).datagrid('options').saveSelectedRow; $(this).datagrid('selectRow', r ? r : 0); }, select_rubric: function (index,row) { if ($(this).datagrid('options').disjgrid) $($(this).datagrid('options').disjgrid).datagrid('load', 'json/getjson.php?type=disjs&rubricid=' + row.rubricid + '&rubricatorid=' + row.rubricatorid); else $('#disjs').datagrid('load', 'json/getjson.php?type=disjs&rubricid=' + row.rubricid + '&rubricatorid=' + row.rubricatorid); }, //****** rubr_add *****/ rubr_add: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Добавление рубрики', resizable:true, width: 600, height: 410, closed: false, cache: false, border:'thin',cls:'c6', href: 'rubr_one.php?action=add_rubric&rubricatorid=' + rubricatorid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_rubriceditform(function() { $('#dd').dialog('close'); ThesRubricator.saveSeletedRow('#rubrics'); $('#rubrics').datagrid('reload'); }) } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $('#dd').dialog('close'); } }] }); $('#dd').dialog('center'); }, //****** rubr_edit *****/ rubr_edit: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика для редактирования', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Редактирование рубрики', resizable:true, width: 600, height: 410, closed: false, cache: false, border:'thin',cls:'c6', href: 'rubr_one.php?action=edit_rubric&rubricatorid=' + rubricatorid + '&rubricid=' + rubricid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_rubriceditform(function() { $('#dd').dialog('close'); ThesRubricator.saveSeletedRow('#rubrics'); $('#rubrics').datagrid('reload'); }) } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $('#dd').dialog('close'); } }] }); $('#dd').dialog('center'); }, //****** rubr_del *****/ rubr_del: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } if (!$('#rubrics').datagrid('getSelected')) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика для удаления', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; $.messager.confirm({ cls: 'c5', width: 420, title: 'Подтверждение', msg: 'Вы действительно хотите удалить выбранную <b>рубрику</b> со всеми ее данными?', fn: function(r) { if (r) { var url = 'rubr_one.php?action=del_rubr&rubricid=' + rubricid + '&rubricatorid=' + rubricatorid; $.ajax( { type: "GET", url: url, }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Рубрика удалена', border:'thin', cls:'c4', timeout: 10000, showType:'slide' }); $('#rubrics').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }) ; } }}); }, //****** load_disj *****/ load_disj: function () { if ($(this).datagrid('options').conjgrid) $($(this).datagrid('options').conjgrid).datagrid('loadData', {"total":0,"rows":[]}); else $('#conjs').datagrid('loadData', {"total":0,"rows":[]}); r = $(this).datagrid('options').saveSelectedRow; $(this).datagrid('selectRow', r ? r : 0); }, //****** select_disj *****/ select_disj: function (index,row) { if ($(this).datagrid('options').conjgrid) $($(this).datagrid('options').conjgrid).datagrid('load', 'json/getjson.php?type=conjs&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&rubricatorid=' + row.rubricatorid); else $('#conjs').datagrid('load', 'json/getjson.php?type=conjs&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&rubricatorid=' + row.rubricatorid); }, //****** disj_add *****/ disj_add: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика для редактирования', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Добавление дизъюнкта', resizable:true, width: 600, height: 350, closed: false, cache: false, border:'thin',cls:'c6', href: 'rubr_one.php?action=add_disj&rubricatorid=' + rubricatorid + '&rubricid=' + rubricid + '&disjunctid=' + -1, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_rubriceditform(function() { $('#dd').dialog('close'); ThesRubricator.saveSeletedRow('#disjs'); $('#disjs').datagrid('reload'); }) } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $('#dd').dialog('close'); } }] }); $('#dd').dialog('center'); }, //****** disj_edit *****/ disj_edit: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } disjunctid = $('#disjs').datagrid('getSelected').disjunctid; if (!disjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран дизъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Редактирование дизъюнкта', resizable:true, width: 600, height: 350, closed: false, cache: false, border:'thin',cls:'c6', href: 'rubr_one.php?action=edit_disj&rubricatorid=' + rubricatorid + '&rubricid=' + rubricid + '&disjunctid=' + disjunctid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_rubriceditform(function() { $('#dd').dialog('close'); ThesRubricator.saveSeletedRow('#disjs'); $('#disjs').datagrid('reload'); }) } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $('#dd').dialog('close'); } }] }); $('#dd').dialog('center'); }, //****** disj_del *****/ disj_del: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } if (!$('#disjs').datagrid('getSelected')) { $.messager.show({ title: 'Внимание!', msg:'Не выбран дизъюнкт для удаления', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } disjunctid = $('#disjs').datagrid('getSelected').disjunctid; $.messager.confirm({ cls: 'c5', width: 420, title: 'Подтверждение', msg: 'Вы действительно хотите удалить выбранный <b>дизъюнкт</b> со всеми его данными?', fn: function(r) { if (r) { var url = 'rubr_one.php?action=del_disj&disjunctid=' + disjunctid + '&rubricatorid=' + rubricatorid; $.ajax( { type: "GET", url: url, }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись удалена', border:'thin', cls:'c4', timeout: 10000, showType:'slide' }); $('#disjs').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }) ; } }}); }, //****** load_conj *****/ load_conj: function () { if ($(this).datagrid('options').rubdesgrid) $($(this).datagrid('options').rubdesgrid).datagrid('loadData', {"total":0,"rows":[]}); else { $('#revry').datagrid('loadData', {"total":0,"rows":[]}); $('#rubdes').datagrid('loadData', {"total":0,"rows":[]}); } r = $(this).datagrid('options').saveSelectedRow; $(this).datagrid('selectRow', r?r:0); }, //****** select_conj *****/ select_conj: function (index,row) { if ($(this).datagrid('options').rubdesgrid) $($(this).datagrid('options').rubdesgrid).datagrid('load', 'json/getjson.php?type=rubdes&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&conjunctid=' + row.conjunctid + '&rubricatorid=' + row.rubricatorid); else { $('#rubdes').datagrid('load', 'json/getjson.php?type=rubdes&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&conjunctid=' + row.conjunctid + '&rubricatorid=' + row.rubricatorid); $('#revry').datagrid('load', 'json/getjson.php?type=revry&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&conjunctid=' + row.conjunctid + '&rubricatorid=' + row.rubricatorid + (($('#revry4what').prop('checked') || ($('#rubdes').datagrid('getSelected') == null)) ? '' : '&rubdesid=' + $('#rubdes').datagrid('getSelected').rubdesid)); } //$('#revry').datagrid('load', 'json/getjson.php?type=revry&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&conjunctid=' + row.conjunctid + '&rubricatorid=' + row.rubricatorid); }, //****** conj_add *****/ conj_add: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } disjunctid = $('#disjs').datagrid('getSelected').disjunctid; if (!disjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран дизъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Добавление конъюнкта', resizable:true, width: 600, height: 400, closed: false, cache: false, border:'thin',cls:'c6', href: 'rubr_one.php?action=add_conj&rubricatorid=' + rubricatorid + '&rubricid=' + rubricid + '&disjunctid=' + disjunctid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_rubriceditform(function() { $('#dd').dialog('close'); ThesRubricator.saveSeletedRow('#conjs'); $('#conjs').datagrid('reload'); }) } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $('#dd').dialog('close'); } }] }); $('#dd').dialog('center'); }, //****** conj_edit *****/ conj_edit: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } disjunctid = $('#disjs').datagrid('getSelected').disjunctid; if (!disjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран дизъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } conjunctid = $('#conjs').datagrid('getSelected').conjunctid; if (!conjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран конъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Редактирование конъюнкта', resizable:true, width: 600, height: 400, closed: false, cache: false, border:'thin',cls:'c6', href: 'rubr_one.php?action=edit_conj&rubricatorid=' + rubricatorid + '&rubricid=' + rubricid + '&disjunctid=' + disjunctid + '&conjunctid=' + conjunctid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_rubriceditform(function() { $('#dd').dialog('close'); ThesRubricator.saveSeletedRow('#conjs'); $('#conjs').datagrid('reload');}) } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $('#dd').dialog('close'); } }] }); $('#dd').dialog('center'); }, //****** conj_del *****/ conj_del: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } if (!$('#conjs').datagrid('getSelected')) { $.messager.show({ title: 'Внимание!', msg:'Не выбран конъюнкт для удаления', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } conjunctid = $('#conjs').datagrid('getSelected').conjunctid; $.messager.confirm({ cls: 'c5', width: 420, title: 'Подтверждение', msg: 'Вы действительно хотите удалить выбранный <b>конъюнкт</b> со всеми его данными?', fn: function(r) { if (r) { var url = 'rubr_one.php?action=del_conj&conjunctid=' + conjunctid + '&rubricatorid=' + rubricatorid; $.ajax( { type: "GET", url: url, }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись удалена', border:'thin', cls:'c4', timeout: 10000, showType:'slide' }); $('#conjs').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }) ; } }}); }, //****** select_rubdes *****/ select_rubdes: function () { var row = $('#conjs').datagrid('getSelected') if ((!$('#revry4what').prop('checked')) && (row)) $('#revry').datagrid('load', 'json/getjson.php?type=revry&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&conjunctid=' + row.conjunctid + '&rubricatorid=' + row.rubricatorid + (($('#revry4what').prop('checked') || ($('#rubdes').datagrid('getSelected') == null)) ? '' : '&rubdesid=' + $('#rubdes').datagrid('getSelected').rubdesid)); }, //****** select_revry *****/ select_revry: function () {}, change_rubcator: function (newValue, oldValue) { if ($(this).combobox('options').rubrgrid) $($(this).combobox('options').rubrgrid).datagrid('load', 'json/getjson.php?type=rubrics&rubricatorid=' + newValue); else $('#rubrics').datagrid('load', 'json/getjson.php?type=rubrics&rubricatorid=' + newValue); }, rubricFormatter: function (value, row, index){ return '<span style="padding-left: ' + (row.nlevel * 20) + 'px">' + value + '</span>'; // return value; // alert('!'); }, rubdes_add: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } disjunctid = $('#disjs').datagrid('getSelected').disjunctid; if (!disjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран дизъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } conjunctid = $('#conjs').datagrid('getSelected').conjunctid; if (!conjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран конъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } $('#dd').dialog({ title: 'Редатирование приписки :: <b style="color: #fbff73">' + $('#rubrics').datagrid('getSelected').rubricstr + '</b>', resizable: true, width: '90%', height: '90%', closed: false, cache: false, border:'thin',cls:'c6', href: 'rubdes.php?rubricatorid=' + rubricatorid + '&rubricid=' + rubricid + '&disjunctid=' + disjunctid + '&conjunctid=' + conjunctid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { $('#dd').dialog('close'); $('#revry').datagrid('reload'); $('#rubdes').datagrid('reload'); } }] }); $('#dd').dialog('center'); }, rubdes_add_conc: function () { var cid = $('#rubdesconcepts').datagrid('getSelected'); if (!cid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран концепт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } var url = 'rubdes.php?action=addrubdes' + ThesRubricator.rubdes_usedformparam; var data = { conceptid: cid.conceptid, concrubrtypeid: $('#rubdes_concrubrtype').combobox('getValue'), expandtype: $('#rubdes_expandtype').combobox('getValue'), confirmid: $('#rubdes_confirm').combobox('getValue'), }; $.ajax( { type: "POST", url: url, data: jQuery.param(data), }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись добавлена', border:'thin', cls:'c4', timeout: 1000, showType:'slide' }); $('#rubdes_rubdes').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка добавления: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }) ; }, rubdes_del_conc: function () { var cid = $('#rubdes_rubdes').datagrid('getSelected'); if (!cid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран концепт', timeout: 5000, showType:'slide' }); return false; } $.messager.confirm({ cls: 'c5', width: 420, title: 'Подтверждение', msg: 'Вы действительно хотите удалить выбранный <b>концепт</b> со всеми его данными?', fn: function(r) { if (r) { var data = { rubdesid: cid.rubdesid }; var url = 'rubdes.php?action=delrubdes' + ThesRubricator.rubdes_usedformparam; $.ajax( { type: "POST", url: url, data: jQuery.param(data), }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись удалена', border:'thin', cls:'c4', timeout: 1000, showType:'slide' }); $('#rubdes_rubdes').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }) ; } }}); }, rubdes_edit_conc: function (data) { var d = data; var cid = $('#rubdes_rubdes').datagrid('getSelected'); if (!cid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран концепт для редактирования', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } d['rubdesid'] = cid.rubdesid; var url = 'rubdes.php?action=addrubdes' + ThesRubricator.rubdes_usedformparam; $.ajax( { type: "POST", url: url, data: jQuery.param(d), }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись изменена', border:'thin', cls:'c4', timeout: 1000, showType:'slide' }); $('#rubdes_rubdes').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }) ; }, revry_recalc: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } rubricid = $('#rubrics').datagrid('getSelected').rubricid; if (!rubricid) { $.messager.show({ title: 'Внимание!', msg:'Не выбрана рубрика', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } disjunctid = $('#disjs').datagrid('getSelected').disjunctid; if (!disjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран дизъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } conjunctid = $('#conjs').datagrid('getSelected').conjunctid; if (!conjunctid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран конъюнкт', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } msgtitle = 'Пересчет приписки конъюнкта'; msgtext = 'Производится пересчет приписки'; $.messager.progress({ title: msgtitle, msg: msgtext, text: '', interval: 1000}); $.ajax({url: 'rubdes.php?action=calcrevry&rubricatorid=' + rubricatorid + '&conjunctid=' + conjunctid, type: 'GET', cache: false, }).done(function(data) { $.messager.progress('close'); $('#revry').datagrid('reload'); if (data.errno == 0) { $.messager.show({ title:'Сообщение', msg: 'Произведен пересчет.', border:'thin', cls:'c4', timeout: 3000, showType:'slide' }); if (data.debug.log.indexOf('Error') > -1) $.messager.alert({title: 'Ошибки перестройки', height: 460, width: 400, border:'thin',cls:'c5', msg: '<textarea class="easyui-textbox" multiline="true" style="height: 300px; width: 100%">' + data.debug.log + '"</textarea>', icon: 'warning'}); } else { $.messager.alert({title: 'Ошибка операции!', msg: data.error.replace(/\n/g, '<br>'), border:'thin', cls:'c5', icon: 'error'}); } }).fail(function(data) { $('#revry').datagrid('reload'); $.messager.progress('close'); $.messager.show({ title:'Ошибка!', msg: 'Ошибка на сервере!\n' + data, border:'thin', cls:'c5', timeout: 10000, showType:'slide' }); }); }, revry_2_rubdes_nminus: function () { var cid = $('#revry').datagrid('getSelected'); if (!cid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран концепт приписки', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } var url = 'rubdes.php?action=addrubdes' + '&rubricid=' + cid.rubricid + '&disjunctid=' + cid.disjunctid + '&conjunctid=' + cid.conjunctid + '&rubricatorid=' + cid.rubricatorid; var data = { conceptid: cid.conceptid, concrubrtypeid: 2, expandtype: $('#revry_to_rubdes_nminus_type').combobox('getValue'), confirmid: 3, }; $.messager.confirm({ cls: 'c5', width: 420, title: 'Подтверждение', msg: 'Вы действительно хотите переместить концепт в Опорные со знаком минус?', fn: function(r) { if (r) { $.ajax( { type: "POST", url: url, data: jQuery.param(data), }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 5000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись добавлена', border:'thin', cls:'c4', timeout: 1000, showType:'slide' }); $('#rubdes').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка добавления: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }); } }}); }, change_revry4what: function () { var row = $('#conjs').datagrid('getSelected') if (row) $('#revry').datagrid('load', 'json/getjson.php?type=revry&rubricid=' + row.rubricid + '&disjunctid=' + row.disjunctid + '&conjunctid=' + row.conjunctid + '&rubricatorid=' + row.rubricatorid + (($('#revry4what').prop('checked') || ($('#rubdes').datagrid('getSelected') == null)) ? '' : '&rubdesid=' + $('#rubdes').datagrid('getSelected').rubdesid)); else $('#revry').datagrid('loadData', { total: 0, rows:[] }); }, revry_recalc_rubricator: function () { rubricatorid = $('#rubricators').combobox('getValue'); if (!rubricatorid) { $.messager.show({ title: 'Внимание!', msg:'Не выбран рубрикатор', timeout: 5000, cls: 'c5', border:'thin', showType:'slide' }); return false; } msgtitle = 'Пересчет приписки рубрикатора'; msgtext = 'Производится пересчет приписки'; $.messager.progress({ title: msgtitle, msg: msgtext, text: '', interval: 1000}); $.ajax({url: 'rubdes.php?action=calcrevry&rubricatorid=' + rubricatorid, type: 'GET', cache: false, }).done(function(data) { $.messager.progress('close'); $('#revry').datagrid('reload'); if (data.errno == 0) { $.messager.show({ title:'Сообщение', msg: 'Произведен пересчет.', border:'thin', cls:'c4', timeout: 3000, showType:'slide' }); if (data.debug.log.indexOf('Error') > -1) $.messager.alert({title: 'Ошибки перестройки', height: 460, width: 400, border:'thin',cls:'c5', msg: '<textarea class="easyui-textbox" multiline="true" style="height: 300px; width: 100%">' + data.debug.log + '"</textarea>', icon: 'warning'}); } else { $.messager.alert({title: 'Ошибка операции!', msg: data.error.replace(/\n/g, '<br>'), border:'thin', cls:'c5', icon: 'error'}); } }).fail(function(data) { $('#revry').datagrid('reload'); $.messager.progress('close'); $.messager.show({ title:'Ошибка!', msg: 'Ошибка на сервере!\n' + data, border:'thin', cls:'c5', timeout: 10000, showType:'slide' }); }); }, rubdes_copy_fromconj: function() { var rubricatorid = $('#rubricators').combobox('getValue'); var win = '#dd11'; if (!$(win).length) $('body').append('<div id="' + win.substr(1) + '"></div>'); $(win).dialog({ title: 'Перенос приписки из другой рубрики', resizable:true, width: '90%', height: '90%', closed: false, cache: false, border:'thin',cls:'c6', href: 'find_rubdes.php?rubricatorid=' + rubricatorid, modal: true, buttons: [{ text:'OK', width: 100, iconCls:'icon-ok', handler: function() { ThesRubricator.submit_copy_fromconj(function() { $(win).dialog('close'); //ThesRubricator.saveSeletedRow('#conjs'); //$('#conjs').datagrid('reload'); }); } },{ text:'Cancel', iconCls:'icon-cancel', width: 100, handler: function(){ $(win).dialog('close'); } }] }); $(win).dialog('center'); }, submit_copy_fromconj: function(callback) { var ch = $('#rubdes_find_rubdes').datagrid('getChecked'); console.log(ch); if (ch.length) { ch.forEach(function(it) { var url = 'rubdes.php?action=addrubdes' + ThesRubricator.rubdes_usedformparam; var data = { conceptid: it.conceptid, concrubrtypeid: it.concrubrtypeid, expandtype: it.expandtype, confirmid: it.confirmid, }; $.ajax( { type: "POST", url: url, data: jQuery.param(data), async: false }).done(function(data) { if (data.errno !== 0) $.messager.show({title:'Ошибка', msg: data.error, border:'thin', cls:'c3', timeout: 10000, showType:'slide' }); else { $.messager.show({ title:'Успешно', msg: 'Запись добавлена', border:'thin', cls:'c4', timeout: 1000, showType:'slide' }); $('#rubdes_rubdes').datagrid('reload'); } }).fail(function(data) { $.messager.alert({ title:'Ошибка!', msg:'Ошибка добавления: ' + data.responseText, timeout: 0, border:'thin', showType:'slide' }); }); }); callback(); } else $.messager.show({ title:'Внимание!', msg: 'Не выбран ни один концепт для копирования приписки!', border:'thin', cls:'c5', timeout: 10000, showType:'slide' }); }, change_disj_type: function(newVal, oldVal) { var cb = $(this); if (newVal) { cb.combobox('options').nofactname = $('#edit_name').textbox('getText'); $('#edit_name').textbox('disable'); $('#edit_name').textbox('setText', ''); } else { $('#edit_name').textbox('enable'); $('#edit_name').textbox('setText', cb.combobox('options').nofactname); } } }