Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. define("AlphaConcertProgram1Page", ["ProcessModuleUtilities"], function(ProcessModuleUtilities) {
  2.     return {
  3.         entitySchemaName: "AlphaConcertProgram",
  4.         attributes: {},
  5.         modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
  6.         messages: {
  7.             "RunProcessGeneratePerformances": {
  8.                 mode: Terrasoft.MessageMode.PTP,
  9.                 direction: Terrasoft.MessageDirectionType.PUBLISH
  10.             }
  11.         },
  12.         details: /**SCHEMA_DETAILS*/{
  13.             "Files": {
  14.                 "schemaName": "FileDetailV2",
  15.                 "entitySchemaName": "AlphaConcertProgramFile",
  16.                 "filter": {
  17.                     "masterColumn": "Id",
  18.                     "detailColumn": "AlphaConcertProgram"
  19.                 }
  20.             },
  21.             "AlphaSchema1Detail039e48aa": {
  22.                 "schemaName": "AlphaSchema1Detail",
  23.                 "entitySchemaName": "AlphaPerformance",
  24.                 "filter": {
  25.                     "detailColumn": "AlphaConcertProgram",
  26.                     "masterColumn": "Id"
  27.                 }
  28.             }
  29.         }/**SCHEMA_DETAILS*/,
  30.         businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
  31.         methods: {
  32.             getActions: function() {
  33.                 var defaultMenuItems = this.callParent(arguments);
  34.                 var actionMenuItems = Ext.create("Terrasoft.BaseViewModelCollection");
  35.                 actionMenuItems.addItem(this.getButtonMenuItem({
  36.                     "Tag": "runPerformances",
  37.                     "Caption": this.get("Resources.Strings.SchemaLocalizableString1"),
  38.                     "Enabled": true
  39.                 }));
  40.                 defaultMenuItems.each(function(item) {
  41.                     actionMenuItems.addItem(item);
  42.                 });
  43.                 return actionMenuItems;
  44.             },
  45.             runPerformances: function()
  46.             {
  47.                 if(Ext.isEmpty(this.get("AlphaPeriod")))
  48.                 {
  49.                     this.showInformationDialog(this.get("Resources.Strings.SchemaLocalizableString4"));
  50.                     return;
  51.                 }
  52.                 this.save({isSilent: true});
  53.                 var arg = {
  54.                     sysProcessName: "AlphaGeneratePerformances",
  55.                     parameters: {
  56.                         ConcertProgramId: this.get("Id"),
  57.                         PeriodId: this.get("AlphaPeriod").value
  58.                     },
  59.                     callback: this.onCallBackProcess,
  60.                     scope: this
  61.                 };
  62.                 ProcessModuleUtilities.executeProcess(arg);
  63.             },
  64.             onCallBackProcess: function()
  65.             {
  66.                 ProcessModuleUtilities.responseCallback(arguments[0], arguments[1], arguments[2]);
  67.                 if(arguments[2].status!=200)
  68.                 {
  69.                     showInformationDialog(this.get("Resources.String.SchemaLocalizableString3"));
  70.                     return;
  71.                 }
  72.                 this.sandbox.publish("RunProcessGeneratePerformances", {}, [this.sandbox.id+"_detail_AlphaSchema1Detail039e48aaAlphaPerformance"]);
  73.             },
  74.             save: function(validation)
  75.             {
  76.                 if(validation || !this.get("AlphaActive"))
  77.                 {
  78.                     this.callParent(arguments);
  79.                     return;
  80.                 }
  81.                 var select = this.Ext.create("Terrasoft.EntitySchemaQuery", {
  82.                     rootSchemaName: "AlphaConcertProgram"
  83.                 });
  84.                 select.addAggregationSchemaColumn("Id",
  85.                         Terrasoft.AggregationType.COUNT, "All");
  86.                 var filter = this.Terrasoft.createColumnFilterWithParameter(
  87.                     this.Terrasoft.ComparisonType.EQUAL,
  88.                     "AlphaActive",
  89.                     true);
  90.                 select.filters.addItem(filter);
  91.                
  92.                 var notthisfilter = this.Terrasoft.createColumnFilterWithParameter(
  93.                     this.Terrasoft.ComparisonType.NOT_EQUAL,
  94.                     "Id",
  95.                     this.get("Id"));
  96.                 select.filters.addItem(notthisfilter);
  97.                
  98.                 select.getEntityCollection(function(responce) {
  99.                     if(!responce.success)
  100.                     {
  101.                         this.save(true);
  102.                     }
  103.                     var allItems=responce.collection.collection.items[0];
  104.                     Terrasoft.SysSettings.querySysSettings("MaxConcertPrograms", function(sysSettings) {
  105.                         if(allItems.get("All")>=sysSettings.MaxConcertPrograms)
  106.                             this.showInformationDialog(this.get("Resources.Strings.SchemaLocalizableString2"));
  107.                         else
  108.                             this.save(true);
  109.                         }, this);
  110.                 }, this);
  111.             }
  112.         },
  113.         dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
  114.         diff: /**SCHEMA_DIFF*/[
  115.             {
  116.                 "operation": "insert",
  117.                 "name": "AlphaName3543401d-a9a9-481d-ab74-e2e2984d003b",
  118.                 "values": {
  119.                     "layout": {
  120.                         "colSpan": 24,
  121.                         "rowSpan": 1,
  122.                         "column": 0,
  123.                         "row": 0,
  124.                         "layoutName": "ProfileContainer"
  125.                     },
  126.                     "bindTo": "AlphaName"
  127.                 },
  128.                 "parentName": "ProfileContainer",
  129.                 "propertyName": "items",
  130.                 "index": 0
  131.             },
  132.             {
  133.                 "operation": "insert",
  134.                 "name": "LOOKUP2d2c81cc-e89d-4618-818b-be25ab08219d",
  135.                 "values": {
  136.                     "layout": {
  137.                         "colSpan": 24,
  138.                         "rowSpan": 1,
  139.                         "column": 0,
  140.                         "row": 1,
  141.                         "layoutName": "ProfileContainer"
  142.                     },
  143.                     "bindTo": "AlphaAccount",
  144.                     "enabled": true,
  145.                     "contentType": 5
  146.                 },
  147.                 "parentName": "ProfileContainer",
  148.                 "propertyName": "items",
  149.                 "index": 1
  150.             },
  151.             {
  152.                 "operation": "insert",
  153.                 "name": "STRING8e6c7ea7-681d-43b0-9bbd-4527ea6e60e6",
  154.                 "values": {
  155.                     "layout": {
  156.                         "colSpan": 24,
  157.                         "rowSpan": 1,
  158.                         "column": 0,
  159.                         "row": 2,
  160.                         "layoutName": "ProfileContainer"
  161.                     },
  162.                     "bindTo": "AlphaCode",
  163.                     "enabled": true
  164.                 },
  165.                 "parentName": "ProfileContainer",
  166.                 "propertyName": "items",
  167.                 "index": 2
  168.             },
  169.             {
  170.                 "operation": "insert",
  171.                 "name": "LOOKUP1bd9f7ad-54ff-4885-83a5-9faa743ebfd6",
  172.                 "values": {
  173.                     "layout": {
  174.                         "colSpan": 24,
  175.                         "rowSpan": 1,
  176.                         "column": 0,
  177.                         "row": 3,
  178.                         "layoutName": "ProfileContainer"
  179.                     },
  180.                     "bindTo": "AlphaPeriod",
  181.                     "enabled": true,
  182.                     "contentType": 5
  183.                 },
  184.                 "parentName": "ProfileContainer",
  185.                 "propertyName": "items",
  186.                 "index": 3
  187.             },
  188.             {
  189.                 "operation": "insert",
  190.                 "name": "BOOLEAN0c8442d0-73d0-40c5-8b3f-782d0ee04251",
  191.                 "values": {
  192.                     "layout": {
  193.                         "colSpan": 24,
  194.                         "rowSpan": 1,
  195.                         "column": 0,
  196.                         "row": 4,
  197.                         "layoutName": "ProfileContainer"
  198.                     },
  199.                     "bindTo": "AlphaActive",
  200.                     "enabled": true
  201.                 },
  202.                 "parentName": "ProfileContainer",
  203.                 "propertyName": "items",
  204.                 "index": 4
  205.             },
  206.             {
  207.                 "operation": "insert",
  208.                 "name": "STRING119be1cb-4421-41aa-965f-0833fc636c0d",
  209.                 "values": {
  210.                     "layout": {
  211.                         "colSpan": 12,
  212.                         "rowSpan": 1,
  213.                         "column": 0,
  214.                         "row": 0,
  215.                         "layoutName": "Header"
  216.                     },
  217.                     "bindTo": "AlphaCommentary",
  218.                     "enabled": true,
  219.                     "contentType": 0
  220.                 },
  221.                 "parentName": "Header",
  222.                 "propertyName": "items",
  223.                 "index": 0
  224.             },
  225.             {
  226.                 "operation": "insert",
  227.                 "name": "Tab63cfeec5TabLabel",
  228.                 "values": {
  229.                     "caption": {
  230.                         "bindTo": "Resources.Strings.Tab63cfeec5TabLabelTabCaption"
  231.                     },
  232.                     "items": []
  233.                 },
  234.                 "parentName": "Tabs",
  235.                 "propertyName": "tabs",
  236.                 "index": 0
  237.             },
  238.             {
  239.                 "operation": "insert",
  240.                 "name": "AlphaSchema1Detail039e48aa",
  241.                 "values": {
  242.                     "itemType": 2,
  243.                     "markerValue": "added-detail"
  244.                 },
  245.                 "parentName": "Tab63cfeec5TabLabel",
  246.                 "propertyName": "items",
  247.                 "index": 0
  248.             },
  249.             {
  250.                 "operation": "insert",
  251.                 "name": "NotesAndFilesTab",
  252.                 "values": {
  253.                     "caption": {
  254.                         "bindTo": "Resources.Strings.NotesAndFilesTabCaption"
  255.                     },
  256.                     "items": []
  257.                 },
  258.                 "parentName": "Tabs",
  259.                 "propertyName": "tabs",
  260.                 "index": 1
  261.             },
  262.             {
  263.                 "operation": "insert",
  264.                 "name": "Files",
  265.                 "values": {
  266.                     "itemType": 2
  267.                 },
  268.                 "parentName": "NotesAndFilesTab",
  269.                 "propertyName": "items",
  270.                 "index": 0
  271.             },
  272.             {
  273.                 "operation": "insert",
  274.                 "name": "NotesControlGroup",
  275.                 "values": {
  276.                     "itemType": 15,
  277.                     "caption": {
  278.                         "bindTo": "Resources.Strings.NotesGroupCaption"
  279.                     },
  280.                     "items": []
  281.                 },
  282.                 "parentName": "NotesAndFilesTab",
  283.                 "propertyName": "items",
  284.                 "index": 1
  285.             },
  286.             {
  287.                 "operation": "insert",
  288.                 "name": "Notes",
  289.                 "values": {
  290.                     "bindTo": "AlphaNotes",
  291.                     "dataValueType": 1,
  292.                     "contentType": 4,
  293.                     "layout": {
  294.                         "column": 0,
  295.                         "row": 0,
  296.                         "colSpan": 24
  297.                     },
  298.                     "labelConfig": {
  299.                         "visible": false
  300.                     },
  301.                     "controlConfig": {
  302.                         "imageLoaded": {
  303.                             "bindTo": "insertImagesToNotes"
  304.                         },
  305.                         "images": {
  306.                             "bindTo": "NotesImagesCollection"
  307.                         }
  308.                     }
  309.                 },
  310.                 "parentName": "NotesControlGroup",
  311.                 "propertyName": "items",
  312.                 "index": 0
  313.             }
  314.         ]/**SCHEMA_DIFF*/
  315.     };
  316. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement