Skip to content

Commit

Permalink
Colors and gen_report flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rmproyectos committed Feb 21, 2021
1 parent 4f4d04a commit 395a720
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
9 changes: 4 additions & 5 deletions app/models/cosmosys_issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/cosmosys_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
21 changes: 21 additions & 0 deletions app/models/cosmosys_user.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion assets/pythons/IssReports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 395a720

Please sign in to comment.