From 395a720975c45626d601d2d215694ac3d25a7561 Mon Sep 17 00:00:00 2001 From: rmproyectos Date: Sun, 21 Feb 2021 16:57:24 +0000 Subject: [PATCH] Colors and gen_report flag --- app/models/cosmosys_issue.rb | 9 ++++----- app/models/cosmosys_project.rb | 2 +- app/models/cosmosys_user.rb | 21 +++++++++++++++++++++ assets/pythons/IssReports.py | 2 +- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/app/models/cosmosys_issue.rb b/app/models/cosmosys_issue.rb index 535b13a..aa76c69 100644 --- a/app/models/cosmosys_issue.rb +++ b/app/models/cosmosys_issue.rb @@ -17,9 +17,8 @@ def vsupervisor_id if sup != nil then ret = sup.to_i end - else - return ret end + return ret else return self.supervisor_id end @@ -176,7 +175,7 @@ def self.get_relation_color(r) def self.get_fill_color(i) colorstr = 'pink' if i.status.is_closed then - colorstr = 'white' + colorstr = 'lightgrey' else expired = false if i.due_date then @@ -188,13 +187,13 @@ def self.get_fill_color(i) if i.done_ratio > 0 then colorstr = 'lightblue' else - colorstr = 'grey' + colorstr = 'white' end else if i.done_ratio > 0 then colorstr = 'orange' else - colorstr = 'red' + colorstr = 'lightcoral' end end end diff --git a/app/models/cosmosys_project.rb b/app/models/cosmosys_project.rb index fb653a7..9bc85bf 100644 --- a/app/models/cosmosys_project.rb +++ b/app/models/cosmosys_project.rb @@ -64,7 +64,7 @@ def show_as_json_inner(issue_id,root_url,include_subprojects) else treedata[:members][mb.user.login.to_s] = mb.user.attributes.slice("firstname","lastname") treedata[:members][mb.user.login.to_s][:class] = mb.user.class.name - treedata[:members][mb.user.login.to_s][:gen_report] = mb.user.csys.gen_rpt + treedata[:members][mb.user.login.to_s][:gen_report] = mb.user.csys.vgen_rpt end } diff --git a/app/models/cosmosys_user.rb b/app/models/cosmosys_user.rb index 6a2f69e..df83f42 100644 --- a/app/models/cosmosys_user.rb +++ b/app/models/cosmosys_user.rb @@ -1,3 +1,24 @@ class CosmosysUser < ActiveRecord::Base belongs_to :user + + @@cfgenreport = UserCustomField.find_by_name('GenReport') + + def vgen_rpt + if true then #self.gen_rpt == nil then + ret = false + supid = self.user.custom_values.find_by_custom_field_id(@@cfgenreport.id) + if supid != nil then + sup = supid.value + if sup != nil then + if sup != "0" then + ret = true + end + end + end + return ret + else + return self.gen_rpt + end + end + end diff --git a/assets/pythons/IssReports.py b/assets/pythons/IssReports.py index 6b8a1e6..9a6434a 100644 --- a/assets/pythons/IssReports.py +++ b/assets/pythons/IssReports.py @@ -680,7 +680,7 @@ def generate_diagrams(node,diagrams,ancestors,server_url,dependents): print("INFORMES") for person in data['byperson'].keys(): print("Generando infome de ",person) - if True: #(data['byperson'][person]['gen_report']): + if (data['byperson'][person]['gen_report']): success = execute_js('./plugins/cosmosys/assets/pythons/lib/launch_carbone.js', reporting_path + " " + person + " " + person + " "+"1" + " " + period + " " + nextPeriod