Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(angular, $) {
  2.     'use strict';
  3.     angular.module('RegisterFormApp', ['ui.select', 'ngSanitize', 'date.format']);
  4.     angular.module('RegisterFormApp')
  5.  
  6.         .controller('ArticlesController', ArticlesController)
  7.         .controller('RegisterPageController',RegisterPageController)
  8.         .service('scopeService', scopeService)
  9.         .directive('mSelect', mSelect)
  10.         .constant('_', window._)
  11.         .run(['$rootScope', function($rootScope) {
  12.             $rootScope.counts = {
  13.                 news:0
  14.             };
  15.         //  $rootScope.newsUpdated = false;
  16.            
  17.             $rootScope._ = _;
  18.            
  19.             _.mixin({
  20.                'clearObject'  : clearObject,
  21.                'extendObject' : extendObject,
  22.                'replaceObject': replaceObject
  23.             });
  24.            
  25.             function clearObject(object) {
  26.                _.forEach(_.keys(object), function(key) {
  27.                    delete object[key];
  28.                });
  29.             }
  30.  
  31.             function extendObject(src_object, ext_object) {
  32.                _.forEach(ext_object, function(value, key) {
  33.                    if (_.isObject(src_object[key]) && !_.isArray(src_object[key]) && _.isObject(value)) {
  34.                        replaceObject(src_object[key], value);
  35.                    } else {
  36.                        src_object[key] = value;
  37.                    }
  38.                });
  39.             }
  40.            
  41.             function replaceObject(src_object, ext_object) {
  42.                clearObject(src_object);
  43.                extendObject(src_object, ext_object);
  44.             }
  45.  
  46.         }]);
  47.        
  48.        
  49.         function mSelect() {
  50.             return {
  51.                 'restrict'        : 'E',
  52.                 'template'     : '' +
  53.                     '<div class="{{ Ctrl.class }}"><ui-select ng-model="Ctrl.model[Ctrl.modelKey]" theme="select2" search-enabled="Ctrl.search">' +
  54.                         '<ui-select-match class="ui-select-match">' +
  55.                             '<span ng-bind="$select.selected.name"></span>' +
  56.                         '</ui-select-match>' +
  57.                         '<ui-select-choices class="ui-select-choices" repeat="option.option_id as option in Ctrl.options">' +
  58.                             '<span ng-bind-html="option.name | highlight: $select.search"></span>' +
  59.                         '</ui-select-choices>' +
  60.                     '</ui-select></div>' +
  61.                 '',
  62.                 'controller'      : function() {
  63.                     if (!this.search) {
  64.                         this.search = false;
  65.                     } else {
  66.                         this.search = true;
  67.                     }
  68.                 },
  69.                 'controllerAs'    : 'Ctrl',
  70.                 'scope'           : {
  71.                     'modelKey': '@',
  72.                     'model': '=',
  73.                     'options' : '=',
  74.                     'search': '=',
  75.                     'class': '@'
  76.                 },
  77.                 'bindToController': true
  78.             }
  79.         }
  80.  
  81.  
  82.          function scopeService() {
  83.              return {
  84.                  safeApply: function ($scope, fn) {
  85.                      var phase = $scope.$root.$$phase;
  86.                      if (phase == '$apply' || phase == '$digest') {
  87.                          if (fn && typeof fn === 'function') {
  88.                              fn();
  89.                          }
  90.                      } else {
  91.                          $scope.$apply(fn);
  92.                      }
  93.                  },
  94.              };
  95.         }
  96.        
  97.         RegisterPageController.$inject = ['$scope', '$element', 'scopeService','$sce'];
  98.         function RegisterPageController($scope, $element, scopeService, $sce) {
  99.            
  100.             var $this = this,
  101.                 registerData,
  102.                 dt_type_id = $element.data('dt-type-id'),
  103.                 object = $element.data('object-json'),
  104.                 user = $element.data('user-json');
  105.                
  106.                 //object = JSON.parse(object_json);
  107.                
  108. //          console.log(object);
  109.         //  console.log(moment('2016-07-24 21:13:44'));
  110.             $this.load = false;
  111.            
  112.             this.user_email = user.email;  
  113.             this.controlsByAlias = {};
  114.             this.user = {};
  115.             this.user_categories = {};
  116.            
  117.             this.register = register;
  118.             this.partialUpdate = partialUpdate;
  119.            
  120.             $this.savePwd = savePwd;
  121.            
  122.             $this.object = object;
  123.            
  124.             $scope.required = true;
  125.    
  126.             $this.counts = 0;
  127.                
  128.             $this.licenseViewed = licenseViewed;   
  129.            
  130.             $this.licenseNoViewedCount = 0;
  131.                
  132.             this.news = {};
  133.             this.searchNews = searchNews;
  134.            
  135.             $this.allNewsCount = 0;
  136.            
  137.             $this.initNews = initNews;
  138.            
  139.             function initNews() {
  140.                 $this.objectCategories = [];
  141.                
  142.                 _.forEach(object.categories, function(value) {
  143.                     $this.objectCategories.push(value.option_id);
  144.                 });
  145.                
  146.                 searchNews($this, $this.objectCategories, 0, 20);
  147.                
  148.             }
  149.            
  150.             $this.asHtml = function(html) {
  151.                 return $sce.trustAsHtml(html);
  152.             }
  153.            
  154.             initNews();
  155.            
  156.             $.ajax({
  157.                 url: '/my/s3/xapi/public/?method=dynamic/command',
  158.                 type: 'post',
  159.                 data: {
  160.                     alias: 'getUserEditData',
  161.                     data: {
  162.                         alias_dt_type : 'users'
  163.                     }
  164.                 },
  165.                 success: function(response) {
  166.                     scopeService.safeApply($scope, function() {
  167.                         var controlGroups = response.result.data.data.data.controls;
  168.                         if (!_.isEmpty(controlGroups)) {
  169.                             _.each(controlGroups, function(controls) {
  170.                                 _.each(controls, function(control) {
  171.                                     $this.controlsByAlias[control.alias] = control;
  172.                                 });
  173.                             });
  174.                         }
  175.  
  176.                         if (!_.isEmpty(object)) {
  177.                             if (object.user_birthdate) {
  178.                                 object.user_birthdate = new Date(object.user_birthdate).format('dd.mm.yyyy');
  179.                             }
  180.                             $this.user = object;
  181.                            
  182.                             _.forEach($this.user.categories, function(value) {
  183.                                 $this.user_categories[value.option_id] = '1';
  184.                             });
  185.                             if (_.size($this.user.sex)) {
  186.                                 $this.user.sex = $this.user.sex[0].option_id;
  187.                             }
  188.                             if (_.size($this.user.user_study_scientific_title)) {
  189.                                 $this.user.user_study_scientific_title = $this.user.user_study_scientific_title[0].option_id;
  190.                             }
  191.                             if (_.size($this.user.user_study_science_degree)) {
  192.                                 $this.user.user_study_science_degree = $this.user.user_study_science_degree[0].option_id;
  193.                             }
  194.                             if (_.size($this.user.user_study_category)) {
  195.                                 $this.user.user_study_category = $this.user.user_study_category[0].option_id;
  196.                             }
  197.                             if (_.size($this.user.user_job_position)) {
  198.                                 $this.user.user_job_position = $this.user.user_job_position[0].option_id;
  199.                             }
  200.                             if (_.size($this.user.user_job_experience)) {
  201.                                 $this.user.user_job_experience = $this.user.user_job_experience[0].option_id;
  202.                             }
  203.                             if (_.size($this.user.user_job_used_similarity)) {
  204.                                 $this.user.user_job_used_similarity = $this.user.user_job_used_similarity[0].option_id;
  205.                             }
  206.                            
  207.                         }
  208.                         if ($this.user.user_licenses_list) {
  209.                             for (var i = 0; i<$this.user.user_licenses_list.length; i++) {
  210.                                 if ($this.user.user_licenses_list[i].license_status_viewed == 0){
  211.                                     $this.licenseNoViewedCount = parseInt($this.licenseNoViewedCount) + 1;
  212.                                 }
  213.                             }
  214.                         }
  215.                         // console.log($this.user)
  216.                     });
  217.                 /*  $scope.$apply(function() {
  218.  
  219.                     });*/
  220.                     if(document.location.hash!=''){
  221.                         var hash = document.location.hash.replace('#','');
  222.                         $('.tabs-nav-item[data-hash="'+hash+'"]').click();
  223.                     }  
  224.                 }
  225.             });
  226.  
  227.            
  228.             /*
  229.             $.ajax({
  230.                 url: '/my/s3/xapi/public/?method=dynamic/action',
  231.                 type: 'post',
  232.                 data: {
  233.                         "newLicensesCount": {
  234.                             "alias": "newLicensesCount"
  235.                         }
  236.                     }
  237.                 },
  238.                 success: function(response) {
  239.                    
  240.                     console.log('newLicensesCount: ',response.result.action.newLicensesCount);
  241.                 }
  242.             });*/
  243.             function licenseViewed(dt_type_id,object_id,license_status_viewed){
  244.                 if (license_status_viewed==0){
  245.                     $.ajax({
  246.                         url: '/my/s3/xapi/public/?method=dynamic/command',
  247.                         type: 'post',
  248.                         async: false,
  249.                         data: {
  250.                             alias : 'marklicenseViewed',
  251.                             data : {
  252.                               dt_type_id: dt_type_id,
  253.                               object_id: object_id,
  254.                               params : {
  255.                                 license_status_viewed : 1
  256.                               }
  257.                             }
  258.                         },
  259.                         success: function(response) {
  260.                             if(response.result.data){
  261.                                 $this.licenseNoViewedCount = $this.licenseNoViewedCount - 1;
  262.                                 for (var i = 0; i<$this.user.user_licenses_list.length; i++) {
  263.                                     if ($this.user.user_licenses_list[i].object_id == object_id){
  264.                                         $this.user.user_licenses_list[i] = response.result.object;
  265.                                     }
  266.                                 }
  267.                             }
  268.                         }
  269.                     });
  270.                 }
  271.             }
  272.            
  273.             function savePwd(){
  274.                
  275.                 if(!$this.newPwd){
  276.                     return false;
  277.                 }
  278.                 var user_id = $('.user-block-tab').data('object-json')['user_id'];
  279.                 $.ajax({
  280.                     url: '/my/s3/xapi/public/?method=dynamic/command',
  281.                     type: 'post',
  282.                     data: {
  283.                         alias: "changePwdUser",
  284.                         data: {
  285.                             alias_dt_type: 'users',
  286.                             user_id: user_id,
  287.                             pwd: $this.newPwd.pwd,
  288.                             pwdN: $this.newPwd.new_pwd,
  289.                             pwdNcheck: $this.newPwd.new_pwd2   
  290.                         }
  291.                        
  292.                     },
  293.                     success: function(response) {
  294.                         if(response.result.data.status == 'success'){
  295.                             $.ajax({
  296.                                 url: '/user/login',
  297.                                 type: 'post',
  298.                                 data: {
  299.                                     mode: 'login',
  300.                                     login: $this.user_email,
  301.                                     password: $this.newPwd.new_pwd2
  302.                                 },
  303.                                 success: function(response) {
  304.                                     $scope.$apply(function() {
  305.                                         $this.newPwd = {};
  306.                                         alert('Пароль успешно изменен');
  307.                                     })
  308.                                 }
  309.                             });
  310.                         }
  311.                     }
  312.                 });
  313.             }
  314.            
  315.             function register() {
  316.                 $this.user.categories = _.keys($this.user_categories);
  317.  
  318.                 $.ajax({
  319.                     url: '/my/s3/xapi/public/?method=dynamic/editObject',
  320.                     type: 'post',
  321.                     data: {
  322.                         dt_type_id: dt_type_id,
  323.                         object: {
  324.                             object_id: object_id,
  325.                             params: $this.user,
  326.                         },
  327.                         auth: 1
  328.                     },
  329.                     success: function(response) {
  330.                         var user = response.result.user;
  331.                        
  332.                         if (user.user_id) {
  333.                             window.location = '/lk';
  334.                         }
  335.                     }
  336.                 });
  337.             }
  338.            
  339.             function partialUpdate(keys) {
  340.                 var object_id  = $this.user.object_id,
  341.                     dt_type_id = $this.user.dt_type_id,
  342.                     params = {},
  343.                     error = {
  344.                         status:false,
  345.                         names : []
  346.                        
  347.                     };
  348.                    
  349.                 $this.user.categories = [];
  350.                 _.forEach($this.user_categories, function(v, k) {
  351.                     if (v == 1) {
  352.                         $this.user.categories.push(k);
  353.                     }
  354.                 });
  355.                
  356.                 if (!object_id || !dt_type_id || !_.isArray(keys) || _.isEmpty(keys)) {
  357.                     return false;
  358.                 }
  359.                
  360.                 _.forEach(keys, function(key) {
  361.                     params[key] = $this.user[key];
  362.                 //  console.log(key,$this.user[key])
  363.                     if (typeof $this.user[key] == 'undefined' || $this.user[key] == ''){
  364.                         error.status = true;
  365.                         error.names.push(key);
  366.                     }
  367.                 });
  368.             //  console.log(error);
  369.                 if (error.status){
  370.                     alert('Заполните обязательные поля!'/*'поля "' + error.names + '" -  не заполнены!'*/)
  371.                 } else {
  372.                    
  373.                     $.ajax({
  374.                         url: '/my/s3/xapi/public/?method=dynamic/command',
  375.                         type: 'post',
  376.                         async: false,
  377.                         data: {
  378.                             alias: 'updateUser',
  379.                             data: {
  380.                                 alias_dt_type: 'users',
  381.                                 object_id: object_id,
  382.                                 params: params,
  383.                             }
  384.                         },
  385.                         success: function(response) {
  386.                            
  387.                             object = response.result.data.data.object;
  388.                             $this.object = response.result.data.data.object;
  389.                            
  390.                             var cat = object.categories;
  391.                            
  392.                             if(keys[0]=='categories'){
  393.                                 $this.objectCategories = [];
  394.                                 cat.forEach(function(value) {
  395.                                     $this.objectCategories.push(value.option_id);
  396.                                 });
  397.                                 searchNews($this, $this.objectCategories, 0, 20);
  398.                             }
  399.  
  400.                             alert('Сохранено успешно');
  401.                         }
  402.                     });
  403.                    
  404.                 }  
  405.            
  406.             }
  407.            
  408.  
  409.            
  410.             /*норм*/
  411.             function searchNews(data, user_categories, start, limit) {
  412.                 var dataRequest = {},
  413.                     tempId = 0;
  414.                     dataRequest['data'] = {};
  415.                     dataRequest['data']['alias'] = '321';
  416.                     dataRequest['data']['data'] = {};
  417.                     for (var i = 0; i<$this.objectCategories.length; i++){
  418.                         tempId = $this.objectCategories[i];
  419.                         dataRequest['data']['data'][tempId] = {};
  420.                         dataRequest['data']['data'][tempId]['alias'] = 'unwatched_news';
  421.                         dataRequest['data']['data'][tempId]['data'] = {};
  422.                         dataRequest['data']['data'][tempId]['data']['alias_dt_type'] = 'news';
  423.                         dataRequest['data']['data'][tempId]['data']['search'] = {};
  424.                         dataRequest['data']['data'][tempId]['data']['search']['categories'] = tempId;
  425.                     }
  426.                    
  427.                     dataRequest['data']['data']['allCount'] = {};
  428.                     dataRequest['data']['data']['allCount']['alias'] = 'unwatched_news';
  429.                     dataRequest['data']['data']['allCount']['data'] = {};
  430.                     dataRequest['data']['data']['allCount']['data']['alias_dt_type'] = 'news';
  431.                     dataRequest['data']['data']['allCount']['data']['search'] = {};
  432.                     dataRequest['data']['data']['allCount']['data']['search']['categories->option_id'] = {};
  433.                     dataRequest['data']['data']['allCount']['data']['search']['categories->option_id']['value'] = $this.objectCategories;
  434.                     dataRequest['data']['data']['allCount']['data']['search']['categories->option_id']['mode'] = 'or';
  435.                    
  436.                
  437.                 $.when(
  438.                     $.ajax({
  439.                         url: '/my/s3/xapi/public/?method=dynamic/command',
  440.                         type: 'post',
  441.                         data: {
  442.                             alias : 'eachElemunwatched',
  443.                             data : dataRequest
  444.                         }
  445.                     }),
  446.                     $.ajax({
  447.                         url: '/my/s3/xapi/public/?method=dynamic/query',
  448.                         type: 'post',
  449.                         data: {
  450.                             alias: 'getNewsByCategories',
  451.                             start: start || 0,
  452.                             limit: limit || 10,
  453.                             data: {
  454.                                 search : {
  455.                                     'categories->option_id' : {
  456.                                       value : user_categories,
  457.                                       mode : "or"
  458.                                     }
  459.                                 },
  460.                                 sort: {
  461.                                     'object_id': 'asc'
  462.                                 }
  463.                             }
  464.                         }
  465.                     })
  466.                 ).then(function(response1, response2){
  467.                     $scope.$apply(function() {
  468.                         _.clearObject(data.news);
  469.                         _.forEach(response2[0].result.data, function(news) {
  470.                             data.news[news.object_id] = news;  
  471.                         });
  472.                
  473.                         $this.counts = response1[0].result.data.data;
  474.                         $this.allNewsCount = response1[0].result.data.data.allCount.count;
  475.                         $this.load = true;
  476.                     });
  477.                 });
  478.                
  479.             }
  480.            
  481.            
  482.         }
  483.        
  484.  
  485.         ArticlesController.$inject = ['$element', '$scope'];
  486.         function ArticlesController($element, $scope) {
  487.             var $this = this;
  488.                
  489.             this.init = init;
  490.             this.params = {};
  491.             this.article = {};
  492.            
  493.             $this.articles = [];
  494.            
  495.             $this.error = {};
  496.             $this.error.alias = {};
  497.            
  498.             $this.paramsRequired = {
  499.             //  alias : ['article_case_name','article_authors','sex','article_patient_age','article_complaints','article_disease_history','article_life_history','article_guide_diagnosis','article_data_radiological_methods','article_conclusion','article_discussion','article_final_diagnosis']
  500.             //  names : {
  501.                     article_case_name : 'Название клинического случая',
  502.                     article_authors : 'Авторы',
  503.                     sex : 'Пол пациента',
  504.                     article_patient_age : 'Возраст пациента',
  505.                     article_complaints : 'Жалобы',
  506.                     article_disease_history : 'Анамнез заболевания',
  507.                     article_life_history : 'Анамнез жизни',
  508.                     article_guide_diagnosis : 'Направительный диагноз',
  509.                     article_data_radiological_methods : 'Данные лучевых методов исследования',
  510.                     article_conclusion : 'Заключение',
  511.                     article_discussion : 'Обсуждение',
  512.                     article_final_diagnosis : 'Окончательный диагноз'
  513.             //  }
  514.             };
  515.            
  516.             this.debug = function() {
  517.                 console.log($this);
  518.             }
  519.            
  520.            
  521.             this.uploadCount = 1;
  522.             this.sendToConsultation = sendToConsultation;
  523.             this.publicOnSite = publicOnSite;
  524.             this.addMoreFile = addMoreFile;
  525.             this.appendFile = appendFile;
  526.             this.onSelectFile = onSelectFile;
  527.             this.getArticles = getArticles;
  528.            
  529.            
  530.             $this.files = {
  531.                 '_0': {
  532.                     dt_type_alias: 'article_files',
  533.                     params: {}
  534.                 }
  535.             };
  536.  
  537.             init();
  538.             /*норм*/
  539.             function getArticles(){
  540.                 $.ajax({
  541.                     url: '/my/s3/xapi/public/?method=dynamic/query',
  542.                     type: 'post',
  543.                     data: {
  544.                         alias: 'lk_articles'
  545.                     },
  546.                     success: function(response) {
  547.                         $scope.$apply(function() {
  548.                     //      console.log(response.result.data);
  549.                             $this.articles = response.result.data;
  550.                         })
  551.                     }
  552.                 });
  553.             }
  554.            
  555.             function checkRequired(){
  556.                 var error = {
  557.                         status:false,
  558.                         names : [],
  559.                         alias : {}
  560.                        
  561.                     };
  562.                 for (var key in $this.paramsRequired){
  563.                     if ( !($this.article[key] && typeof $this.article[key] != 'undefined' && $this.article[key] != '') ) {
  564.                         error.status = true;
  565.                         error.names.push($this.paramsRequired[key]);
  566.                         error.alias[key] = true;
  567.                     }
  568.                 }
  569.                 return error;
  570.             }
  571.            
  572.             function init() {
  573.                 $.ajax({
  574.                     url: '/my/s3/xapi/public/?method=dynamic/command',
  575.                     type: 'post',
  576.                     data: {
  577.                         alias: 'getArticleEditData',
  578.                         data: {
  579.                             alias_dt_type : 'articles'
  580.                         }
  581.                     },
  582.                     success: function(response) {
  583.                         var controls = {};
  584.                         var controlsObj = response.result.data.data.data.controls;
  585.                         for (var prop in controlsObj) {
  586.                             if(Array.isArray(controlsObj[prop])) {
  587.                                 controlsObj[prop].forEach(function(elem){
  588.                                     controls[elem.alias] = elem;
  589.                                 });
  590.                             }
  591.                         }
  592.                         $scope.$apply(function() {
  593.                             _.replaceObject($this.params, controls);
  594.                         });
  595.                     }
  596.                 });
  597.                 $this.getArticles();
  598.             }
  599.            
  600.             function save(callback) {
  601.                
  602.                 var error = checkRequired();
  603.                 $this.error = error.alias;
  604.                 if (error.status){
  605.                     alert('Заполните обязательные поля!'/*'Поля "' + error.names + '" - не заполнены!'*/);
  606.                     return false
  607.                 }
  608.                 var user_id = $('.user-block-tab').data('object-json')['user_id'];
  609.                
  610.                 $this.article.article_files = $this.files;
  611.             /*  console.log($this.article);
  612.                 return false;*/
  613.  
  614.                 $.ajax({
  615.                     url: '/my/s3/xapi/public/?method=dynamic/command',
  616.                     type: 'post',
  617.                     data: {
  618.                         alias : 'createArticles',
  619.                         data : {
  620.                           dt_type_id: 2617,
  621.                           user_id: user_id,
  622.                           params : $this.article
  623.                         }
  624.                     },
  625.                     success: function(response) {
  626.                         console.log('отправлено на публикацию!');
  627.                         alert('Статья отправлена модератору')
  628.                         if (typeof callback == 'function') {
  629.                             callback($this.article, response);
  630.                         //  console.log(response);
  631.                         }
  632.                         $scope.$apply(function() {
  633.                         //  console.log(response);
  634.                             for (var key in $this.paramsRequired){
  635.                                 $this.article[key] = '';//проверить!
  636.                             }
  637.                         //  console.log($this.article);
  638.                            
  639.                         });
  640.                         $this.getArticles();
  641.                         // $this.article = {};
  642.                         // $this.files = {
  643.                         //  '_0': {
  644.                         //      dt_type_alias: 'article_files',
  645.                         //      params: {}
  646.                         //  }
  647.                         // };
  648.                     }
  649.                 });
  650.             }
  651.            
  652.             function appendFile($event) {
  653.             //  console.log($event.target);
  654.                
  655.                 var btn = $($event.target),
  656.                     input = btn.next();
  657.                
  658.                 input.click();
  659.             }
  660.  
  661.            
  662.             function sendFile(url, file, callback) {
  663.                 var formData = new FormData();
  664.                
  665.                 formData.append("_file", file);
  666.                
  667.                 $.ajax({
  668.                     url: url,
  669.                     type: "POST",
  670.                     async: false,
  671.                     data: formData,
  672.                     processData: false,  // tell jQuery not to process the data
  673.                     contentType: false,   // tell jQuery not to set contentType
  674.                     success: function(response) {
  675.                         if (typeof callback == 'function') {
  676.                             callback(response);
  677.                         }
  678.                     }
  679.                 });
  680.                
  681.             }
  682.            
  683.             function onSelectFile(input, fileObj) {
  684.                 var $input = $(input),
  685.                     btn = $input.prev(),
  686.                     file = input.files[0],
  687.                     url = $input.data('uploadlink'),
  688.                     key = $input.data('key');
  689.                    
  690.                 btn.text(file.name);
  691.  
  692.                 sendFile(url, file, function(response) {
  693.                     var file_ids = JSON.parse(response);
  694.  
  695.                     if (file_ids.length) {
  696.                         $this.files[key].params.article_file = file_ids;
  697.                     }
  698.                    
  699.                     btn.text('ok - ' +  file.name);
  700.                 });
  701.             }
  702.             function addMoreFile() {
  703.                
  704.                 if (_.size($this.files) >= 5) {
  705.                     return false;
  706.                 }
  707.  
  708.                 $this.files['_' + _.size($this.files)] = {
  709.                     dt_type_alias: 'article_files',
  710.                     params: {}
  711.                 };
  712.                 $this.uploadCount = _.size($this.files);
  713.             }
  714.            
  715.            
  716.             function sendToConsultation() {
  717.                 $this.article.article_declared_on = 6817;
  718.                 $this.article.article_status = 7017;
  719.                
  720.                 save();
  721.             }
  722.            
  723.             function publicOnSite() {
  724.                 $this.article.article_declared_on = 6617;
  725.                 $this.article.article_status = 7017;
  726.                
  727.                 save();
  728.             }
  729.  
  730.         }
  731.    
  732. })(angular, jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement