+
+ sp.each do |k, v|
+ if @opts[:all_script_parameters]
+ if v.is_a? Array or v.is_a? Hash
+ encv = JSON.pretty_generate(v).gsub("\n", "\\l") + "\\l"
+ else
+ encv = v.to_json
+ end
+ gr += "\"#{encode_quotes encv}\" [shape=box];\n"
+ gr += edge(encv, uuid, {:label => k})
+ end
+ end
+ gr
+ end
+
+ def col_name_for_project(col_pdh, project_uuid)
+ [
+ # Search for collections within the same project first.
+ {portable_data_hash: col_pdh, owner_uuid: project_uuid},
+ # then, earch for collections in any project.
+ {portable_data_hash: col_pdh},
+ ].each do |query_args|
+ col = Collection.where(query_args).limit(1)
+ if col.results.any?
+ if col.items_available == 1
+ return col.results.first.name
+ else
+ return "#{col.results.first.name} + #{col.items_available - 1} more"