diff --git a/db/migrate/20150720180509_software_release_date.rb b/db/migrate/20150720180509_software_release_date.rb new file mode 100644 index 0000000..7bb64c1 --- /dev/null +++ b/db/migrate/20150720180509_software_release_date.rb @@ -0,0 +1,42 @@ +class SoftwareReleaseDate < ActiveRecord::Migration + def up + softwares = SoftwareInfo.all + softwares.each do |software| + if software.community + name = software.community.name.strip + software.community.name = name + software.community.save + software.community.layout_template = "lefttopright" + print "." if software.community.save + boxToMove = software.community.boxes.where(:position => 1).first + blockToMove = boxToMove.blocks.where(:type => "SoftwareInformationBlock").first + if blockToMove + newBox = software.community.boxes.where(:position => 4).first + blockToMove.box = newBox + print "." if blockToMove.save + end + else + software.destroy + end + end + + file = File.new("plugins/spb_migrations/files/date-communities.txt", "r") + while (line = file.gets) + result = line.split('|') + software_name = result[2].gsub("/n", "") + software = Community.find(:first, :conditions => ["lower(name) = ?", software_name.strip.downcase]) + software.created_at = Time.zone.parse(result[1]) if software + if software && software.save + print "." + else + print "F" + puts software_name + end + end + file.close + puts "" + end + + def down + end +end diff --git a/db/migrate/20150720190133_change_blocks_mirror_option.rb b/db/migrate/20150720190133_change_blocks_mirror_option.rb new file mode 100644 index 0000000..8b84dd4 --- /dev/null +++ b/db/migrate/20150720190133_change_blocks_mirror_option.rb @@ -0,0 +1,38 @@ +class ChangeBlocksMirrorOption < ActiveRecord::Migration + def up + blocks = Block.where(:type => LinkListBlock) + institution = Community["institution"] + software = Community["software"] + + boxTemplateInstitution = institution.boxes.where(:position => 2).first + + boxTemplateInstitution.blocks.each do |block| + block.mirror = true + print "." if block.save + end + + boxTemplateSoftware = software.boxes.where(:position => 2).first + + boxTemplateSoftware.blocks.each do |block| + block.mirror = true + print "." if block.save + end + + blocks.each do |block| + if !(block.owner.class == Environment) && block.owner.organization? && !block.owner.enterprise? + if block.owner.software? + software_block = boxTemplateSoftware.blocks.where(:title => block.title).first + block.mirror_block_id = software_block.id if software_block + elsif block.owner.institution? + institution_block = boxTemplateInstitution.blocks.where(:title => block.title).first + block.mirror_block_id = institution_block.id if institution_block + end + end + print "." if block.save + end + puts "" + end + + def down + end +end diff --git a/files/date-communities.txt b/files/date-communities.txt new file mode 100644 index 0000000..f141a71 --- /dev/null +++ b/files/date-communities.txt @@ -0,0 +1,68 @@ + 56443993 | 2012-07-24 09:36:30.348122-03 | Ação + 9677539 | 2009-03-05 13:45:38.24475-03 | Amadeus + 10374226 | 2009-04-01 15:02:56.691053-03 | Apoena + 8265263 | 2008-12-18 08:35:49.864072-02 | ASES + 10157501 | 2009-03-20 10:56:23.37942-03 | Banco de Talentos + 3585 | 2007-02-06 12:17:18.221666-02 | CACIC - Configurador Automático e Coletor de Informações Computacionais + 48535178 | 2012-03-07 10:33:23.788233-03 | CAU - Central de Atendimento ao Usuário + 98687140 | 2014-01-20 15:20:59.784404-02 | Citsmart + 11791260 | 2009-06-16 17:13:08.465927-03 | CMS - Controle de Marcas e Sinais + 133801 | 2007-04-03 16:31:16.047284-03 | Cocar + 27016128 | 2010-12-07 09:28:26.601182-02 | Cortex + 3632535 | 2008-04-07 15:34:10.143308-03 | Curupira + 27886394 | 2010-12-22 14:48:39.54407-02 | Demoiselle + 42650664 | 2011-10-24 18:08:56.902343-02 | DIM - Dispensação Individualizada de Medicamentos + 15315976 | 2009-10-09 15:15:52.554301-03 | e-cidade + 21650445 | 2010-06-11 15:04:50.470888-03 | EdiTom + 20675454 | 2010-04-28 16:57:25.907169-03 | EducatuX + 22297303 | 2010-07-19 10:29:05.349868-03 | e-ISS + 24188584 | 2010-09-03 15:05:17.470815-03 | e-Nota + 31042 | 2007-03-12 09:47:54.97039-03 | e-Proinfo + 23731755 | 2010-08-24 12:17:02.069138-03 | ERP5 BR + 126403824 | 2014-12-08 10:28:11.812721-02 | e-Sic Livre + 11809545 | 2009-06-17 09:19:30.697619-03 | Fila + 44509627 | 2011-11-30 16:11:20.487561-02 | FormDin + 30726269 | 2011-03-25 18:15:38.333798-03 | Geosan + 20483099 | 2010-04-16 14:53:04.201919-03 | Geplanes + 33752093 | 2011-05-25 13:08:28.449124-03 | GGAS + 1101545 | 2007-06-18 15:31:22.060335-03 | Ginga + 30724784 | 2011-03-25 17:44:11.373481-03 | Gnuteca + 31574974 | 2011-04-15 15:57:57.260004-03 | gpweb + 1593449 | 2007-08-30 16:51:38.073906-03 | Gsan - Sistema Integrado de Gestão de Serviços de Saneamento + 66594611 | 2013-04-23 15:06:59.865025-03 | Guarux + 1444332 | 2007-08-07 08:15:42.941934-03 | i3GEO + 6552490 | 2008-09-29 13:26:07.553951-03 | i-Educar + 626732 | 2007-05-07 14:31:51.222225-03 | InVesalius + 25913900 | 2010-11-09 15:33:43.132943-02 | Jaguar + 18068594 | 2010-01-06 16:28:29.99099-02 | Koruja + 601158 | 2007-05-03 14:49:32.350206-03 | KyaPanel + 3673574 | 2008-04-09 15:18:24.118203-03 | LightBase + 11809207 | 2009-06-17 09:18:46.708981-03 | Linux Educacional + 9022831 | 2009-02-04 15:21:13.18503-02 | MDArte + 11808514 | 2009-06-17 09:10:36.619105-03 | Minuano + 60993607 | 2012-11-30 10:37:59.581285-02 | NAVi + 8566986 | 2009-01-14 14:14:24.306736-02 | OASIS + 4449 | 2007-02-07 10:23:59.658958-02 | OpenACS + 12702936 | 2009-07-14 09:56:30.44857-03 | Pandorga GNU/Linux + 9066433 | 2009-02-06 13:37:26.116692-02 | Prefeitura Livre + 25956481 | 2010-11-11 11:24:24.2039-02 | Provinha Brasil + 12815452 | 2009-07-20 15:30:32.189921-03 | PW3270 + 18016032 | 2010-01-05 09:51:29.030808-02 | REDECA + 30725662 | 2011-03-25 17:59:59.551252-03 | Sagu – gestão acadêmica unificada + 3695494 | 2008-04-11 10:38:11.361528-03 | Sagui + 15719494 | 2009-10-20 10:38:37.237684-02 | SGA LIVRE - Sistema de Gerenciamento do Atendimento + 63022108 | 2013-01-30 11:22:50.327218-02 | SGDoc + 51261 | 2007-03-23 15:10:36.399602-03 | SGD – Sistema de Gestão de Demandas + 23369799 | 2010-08-13 14:04:43.562233-03 | SGF - Sistema de Gestão de Frotas + 93658 | 2007-03-29 08:41:09.667033-03 | Sigati + 3485513 | 2008-03-26 16:45:51.301379-03 | SIMEC - Sistema Integrado de Planejamento Orçamento e Finanças + 5482 | 2007-02-09 10:05:23.803077-02 | Sisau-Saci-Contra + 42365353 | 2011-10-19 16:17:57.49005-02 | SAELE + 44620010 | 2011-12-05 18:03:30.046532-02 | Sistema de Ouvidoria + 54650395 | 2012-06-29 15:24:43.920424-03 | SIVAC - Sistema on-line de Vacinação + 26934301 | 2010-12-02 17:40:23.960186-02 | SNEP PBX IP + 7283318 | 2008-11-11 14:31:33.260701-02 | SPED - Sistema de protocolo eletrônico + 51053337 | 2012-04-27 13:49:25.11419-03 | Tucunaré + 103459100 | 2014-02-17 11:28:47.085822-03 | Urbem CNM + 5986695 | 2008-09-10 15:26:48.814791-03 | WebIntegrator- Produtividade Java WEB + 4215419 | 2008-05-21 16:57:49.092527-03 | Xemelê diff --git a/lib/spb_migrations_plugin.rb b/lib/spb_migrations_plugin.rb new file mode 100644 index 0000000..fc7c7d2 --- /dev/null +++ b/lib/spb_migrations_plugin.rb @@ -0,0 +1,13 @@ +class SpbMigrationsPlugin < Noosfero::Plugin + + def self.plugin_name + # FIXME + "SpbMigrationsPlugin" + end + + def self.plugin_description + # FIXME + _("A plugin that does this and that.") + end + +end -- libgit2 0.21.2