Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define("AlphaConcertProgram1Page", ["ProcessModuleUtilities"], function(ProcessModuleUtilities) {
- return {
- entitySchemaName: "AlphaConcertProgram",
- attributes: {},
- modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
- messages: {
- "RunProcessGeneratePerformances": {
- mode: Terrasoft.MessageMode.PTP,
- direction: Terrasoft.MessageDirectionType.PUBLISH
- }
- },
- details: /**SCHEMA_DETAILS*/{
- "Files": {
- "schemaName": "FileDetailV2",
- "entitySchemaName": "AlphaConcertProgramFile",
- "filter": {
- "masterColumn": "Id",
- "detailColumn": "AlphaConcertProgram"
- }
- },
- "AlphaSchema1Detail039e48aa": {
- "schemaName": "AlphaSchema1Detail",
- "entitySchemaName": "AlphaPerformance",
- "filter": {
- "detailColumn": "AlphaConcertProgram",
- "masterColumn": "Id"
- }
- }
- }/**SCHEMA_DETAILS*/,
- businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
- methods: {
- getActions: function() {
- var defaultMenuItems = this.callParent(arguments);
- var actionMenuItems = Ext.create("Terrasoft.BaseViewModelCollection");
- actionMenuItems.addItem(this.getButtonMenuItem({
- "Tag": "runPerformances",
- "Caption": this.get("Resources.Strings.SchemaLocalizableString1"),
- "Enabled": true
- }));
- defaultMenuItems.each(function(item) {
- actionMenuItems.addItem(item);
- });
- return actionMenuItems;
- },
- runPerformances: function()
- {
- if(Ext.isEmpty(this.get("AlphaPeriod")))
- {
- this.showInformationDialog(this.get("Resources.Strings.SchemaLocalizableString4"));
- return;
- }
- this.save({isSilent: true});
- var arg = {
- sysProcessName: "AlphaGeneratePerformances",
- parameters: {
- ConcertProgramId: this.get("Id"),
- PeriodId: this.get("AlphaPeriod").value
- },
- callback: this.onCallBackProcess,
- scope: this
- };
- ProcessModuleUtilities.executeProcess(arg);
- },
- onCallBackProcess: function()
- {
- ProcessModuleUtilities.responseCallback(arguments[0], arguments[1], arguments[2]);
- if(arguments[2].status!=200)
- {
- showInformationDialog(this.get("Resources.String.SchemaLocalizableString3"));
- return;
- }
- this.sandbox.publish("RunProcessGeneratePerformances", {}, [this.sandbox.id+"_detail_AlphaSchema1Detail039e48aaAlphaPerformance"]);
- },
- save: function(validation)
- {
- if(validation || !this.get("AlphaActive"))
- {
- this.callParent(arguments);
- return;
- }
- var select = this.Ext.create("Terrasoft.EntitySchemaQuery", {
- rootSchemaName: "AlphaConcertProgram"
- });
- select.addAggregationSchemaColumn("Id",
- Terrasoft.AggregationType.COUNT, "All");
- var filter = this.Terrasoft.createColumnFilterWithParameter(
- this.Terrasoft.ComparisonType.EQUAL,
- "AlphaActive",
- true);
- select.filters.addItem(filter);
- var notthisfilter = this.Terrasoft.createColumnFilterWithParameter(
- this.Terrasoft.ComparisonType.NOT_EQUAL,
- "Id",
- this.get("Id"));
- select.filters.addItem(notthisfilter);
- select.getEntityCollection(function(responce) {
- if(!responce.success)
- {
- this.save(true);
- }
- var allItems=responce.collection.collection.items[0];
- Terrasoft.SysSettings.querySysSettings("MaxConcertPrograms", function(sysSettings) {
- if(allItems.get("All")>=sysSettings.MaxConcertPrograms)
- this.showInformationDialog(this.get("Resources.Strings.SchemaLocalizableString2"));
- else
- this.save(true);
- }, this);
- }, this);
- }
- },
- dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
- diff: /**SCHEMA_DIFF*/[
- {
- "operation": "insert",
- "name": "AlphaName3543401d-a9a9-481d-ab74-e2e2984d003b",
- "values": {
- "layout": {
- "colSpan": 24,
- "rowSpan": 1,
- "column": 0,
- "row": 0,
- "layoutName": "ProfileContainer"
- },
- "bindTo": "AlphaName"
- },
- "parentName": "ProfileContainer",
- "propertyName": "items",
- "index": 0
- },
- {
- "operation": "insert",
- "name": "LOOKUP2d2c81cc-e89d-4618-818b-be25ab08219d",
- "values": {
- "layout": {
- "colSpan": 24,
- "rowSpan": 1,
- "column": 0,
- "row": 1,
- "layoutName": "ProfileContainer"
- },
- "bindTo": "AlphaAccount",
- "enabled": true,
- "contentType": 5
- },
- "parentName": "ProfileContainer",
- "propertyName": "items",
- "index": 1
- },
- {
- "operation": "insert",
- "name": "STRING8e6c7ea7-681d-43b0-9bbd-4527ea6e60e6",
- "values": {
- "layout": {
- "colSpan": 24,
- "rowSpan": 1,
- "column": 0,
- "row": 2,
- "layoutName": "ProfileContainer"
- },
- "bindTo": "AlphaCode",
- "enabled": true
- },
- "parentName": "ProfileContainer",
- "propertyName": "items",
- "index": 2
- },
- {
- "operation": "insert",
- "name": "LOOKUP1bd9f7ad-54ff-4885-83a5-9faa743ebfd6",
- "values": {
- "layout": {
- "colSpan": 24,
- "rowSpan": 1,
- "column": 0,
- "row": 3,
- "layoutName": "ProfileContainer"
- },
- "bindTo": "AlphaPeriod",
- "enabled": true,
- "contentType": 5
- },
- "parentName": "ProfileContainer",
- "propertyName": "items",
- "index": 3
- },
- {
- "operation": "insert",
- "name": "BOOLEAN0c8442d0-73d0-40c5-8b3f-782d0ee04251",
- "values": {
- "layout": {
- "colSpan": 24,
- "rowSpan": 1,
- "column": 0,
- "row": 4,
- "layoutName": "ProfileContainer"
- },
- "bindTo": "AlphaActive",
- "enabled": true
- },
- "parentName": "ProfileContainer",
- "propertyName": "items",
- "index": 4
- },
- {
- "operation": "insert",
- "name": "STRING119be1cb-4421-41aa-965f-0833fc636c0d",
- "values": {
- "layout": {
- "colSpan": 12,
- "rowSpan": 1,
- "column": 0,
- "row": 0,
- "layoutName": "Header"
- },
- "bindTo": "AlphaCommentary",
- "enabled": true,
- "contentType": 0
- },
- "parentName": "Header",
- "propertyName": "items",
- "index": 0
- },
- {
- "operation": "insert",
- "name": "Tab63cfeec5TabLabel",
- "values": {
- "caption": {
- "bindTo": "Resources.Strings.Tab63cfeec5TabLabelTabCaption"
- },
- "items": []
- },
- "parentName": "Tabs",
- "propertyName": "tabs",
- "index": 0
- },
- {
- "operation": "insert",
- "name": "AlphaSchema1Detail039e48aa",
- "values": {
- "itemType": 2,
- "markerValue": "added-detail"
- },
- "parentName": "Tab63cfeec5TabLabel",
- "propertyName": "items",
- "index": 0
- },
- {
- "operation": "insert",
- "name": "NotesAndFilesTab",
- "values": {
- "caption": {
- "bindTo": "Resources.Strings.NotesAndFilesTabCaption"
- },
- "items": []
- },
- "parentName": "Tabs",
- "propertyName": "tabs",
- "index": 1
- },
- {
- "operation": "insert",
- "name": "Files",
- "values": {
- "itemType": 2
- },
- "parentName": "NotesAndFilesTab",
- "propertyName": "items",
- "index": 0
- },
- {
- "operation": "insert",
- "name": "NotesControlGroup",
- "values": {
- "itemType": 15,
- "caption": {
- "bindTo": "Resources.Strings.NotesGroupCaption"
- },
- "items": []
- },
- "parentName": "NotesAndFilesTab",
- "propertyName": "items",
- "index": 1
- },
- {
- "operation": "insert",
- "name": "Notes",
- "values": {
- "bindTo": "AlphaNotes",
- "dataValueType": 1,
- "contentType": 4,
- "layout": {
- "column": 0,
- "row": 0,
- "colSpan": 24
- },
- "labelConfig": {
- "visible": false
- },
- "controlConfig": {
- "imageLoaded": {
- "bindTo": "insertImagesToNotes"
- },
- "images": {
- "bindTo": "NotesImagesCollection"
- }
- }
- },
- "parentName": "NotesControlGroup",
- "propertyName": "items",
- "index": 0
- }
- ]/**SCHEMA_DIFF*/
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement