From 3b8c552a3f455ec0b3f3ab4137ff617f385ff8ed Mon Sep 17 00:00:00 2001 From: Daniel Bucher Date: Mon, 21 Jul 2014 15:42:37 -0300 Subject: [PATCH] Remove unused hotspots from plugin. --- lib/mpog_software_plugin.rb | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index 544d2ce..f3cd9b0 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -89,7 +89,7 @@ class MpogSoftwarePlugin < Noosfero::Plugin if context.params.has_key?(:language) language_transaction end - + if context.params.has_key?(:database) databases_transaction end @@ -139,38 +139,12 @@ class MpogSoftwarePlugin < Noosfero::Plugin ["mpog-software-validations.js", "mpog-user-validations.js", "mpog-institution-validations.js"] end - def alternative_exclusion - if context.profile.person? - if context.profile.disable - context.session[:notice] = _('The profile was deactivated.') - context.profile.user.forget_me - context.session.delete(:user) - - true - end - elsif context.profile.community? - context.profile.software_info.software_languages.delete_all - context.profile.destroy - - mensage = context.profile.software_info.nil? ? "community" : "software" - context.session[:notice] = _("The #{mensage} was deleted.") - else - false - end - end - def add_new_organization_button Proc::new do button(:add, _('Create a new software'), :controller => 'mpog_software_plugin_myprofile', :action => 'new_software') end end - def alternative_reactive_account(person) - person.visible = true - person.save - true - end - # FIXME - if in error log apears has_permission?, try to use this method def has_permission?(person, permission, target) person.has_permission_without_plugins?(permission, target) @@ -179,11 +153,11 @@ class MpogSoftwarePlugin < Noosfero::Plugin def incomplete_registration params person = User.find(params[:user]).person percentege = calc_percentage_registration(person) - if percentege >= 0 and percentege <= 100 + if percentege >= 0 and percentege <= 100 return _("Registration "+percentege.to_s+"% incomplete ") end end - + def calc_percentage_registration person empty_fields = 0 required_list = ["cell_phone","contact_phone","institution","comercial_phone","country","city","state","organization_website","role","area_interest","image"] -- libgit2 0.21.2