# coding: utf-8 """ """ import json from ru.curs.celesta.showcase.utils import XMLJSONConverter from common.htmlhints.htmlHint import htmlHintElement from gridsettings.functions.gridSettings import toolbar_button_panel def datapanel(context, main=None, session=None): data = {"datapanel": { "tab": []}} tab1 = { "@id": 1, "@name": u"Заявки на программы", "element": []} certificateFilter = { "@id": "certificateFilter", "@type": "xforms", "@proc": "edu.xform.certificateFilter.cardData.celesta", "@template": "certificateFilter.xml", "@hideOnLoad": "false", 'proc': { '@id': 'proc', '@name': 'edu.xform.certificateFilter.cardDataSave.celesta', '@type': 'SAVE'}} accredCycleRequestsGrid = { "@id": "certificationMethodGrid", "@type": "grid", "@subtype": "JS_PAGE_GRID", "@plugin": "pageDGrid", "@proc":"medstaff.grid.certificationGrid.gridData.celesta", "@hideOnLoad": "false", "proc": [ {"@id": "proc1", "@name":'medstaff.grid.certificationGrid.gridMeta.celesta', "@type": "METADATA"}, {"@id":'certificatesEduGridDownload', "@name":"medstaff.grid.certificationGrid.certificateDownload.celesta", "@type":"DOWNLOAD"}, {"@id": "proc2", "@name":"medstaff.grid.certificationGrid.gridToolBar.celesta", "@type": "TOOLBAR"}]} certificateEditCard = { '@id': 'certificateEditCard', '@type': 'xforms', '@proc': 'medstaff.xform.downloadCertificateCard.cardData.celesta', '@template': 'downloadCertificateCard.xml', '@hideOnLoad': 'true', 'proc': { '@id': 'save', '@name': 'medstaff.xform.downloadCertificateCard.cardDataSave.celesta', '@type': 'SAVE'}, 'related': { '@id': 'certificationMethodGrid'}} certificateMassChangeStatusCard = { "@id": "certificateMassChangeStatusCard", "@type": "xforms", "@proc": "edu.xform.certificateMassChangeStatusCard.cardData.celesta", "@template": "certificateMassChangeStatusCard.xml", "@hideOnLoad": "true", "proc": { "@id": "save", "@name": "edu.xform.certificateMassChangeStatusCard.cardSave.celesta", "@type": "SAVE"}, "related": { "@id": "certificationMethodGrid"}} changeCertificateStatusCard = { "@id": "changeCertificateStatusCard", "@type": "xforms", "@proc": "edu.xform.changeCertificateStatusCard.cardData.celesta", "@template": "changeStatusStandardCardWithComment.xml", "proc": { "@id": "changeCertificateStatusCardSave", "@name": "edu.xform.changeCertificateStatusCard.cardSave.celesta", "@type": "SAVE"}, "@hideOnLoad": "true", "related": {"@id": "certificationMethodGrid"}} tab1['element'].append(htmlHintElement('edu_certificate')) tab1['element'].append(toolbar_button_panel()) tab1["element"].append(certificateFilter) tab1["element"].append(accredCycleRequestsGrid) tab1["element"].append(certificateEditCard) tab1["element"].append(certificateMassChangeStatusCard) tab1["element"].append(changeCertificateStatusCard) data["datapanel"]["tab"].extend([tab1]) return XMLJSONConverter.jsonToXml(json.dumps(data))