start('console:build_application', 'Build Application instance and load commands'); $application = \OCP\Server::get(Application::class); /* base.php will have removed eventual debug options from argv in $_SERVER */ $argv = $_SERVER['argv']; $input = new ArgvInput($argv); $application->loadCommands($input, new ConsoleOutput()); $eventLogger->end('console:build_application'); $eventLogger->start('console:run', 'Run the command'); $application->setAutoExit(false); $exitCode = $application->run($input); $eventLogger->end('console:run'); $profiler = \OCP\Server::get(IProfiler::class); if ($profiler->isEnabled()) { $eventLogger->end('runtime'); $profile = $profiler->collect(\OCP\Server::get(IRequest::class), new Response()); $profile->setMethod('occ'); $profile->setUrl(implode(' ', $argv)); $profiler->saveProfile($profile); } if ($exitCode > 255) { $exitCode = 255; } exit($exitCode); } catch (Exception $ex) { exceptionHandler($ex); } catch (Error $ex) { exceptionHandler($ex); } /redmine.git/tree/db/migrate/018_set_doc_and_files_notifications.rb?h=3.0.4'>018_set_doc_and_files_notifications.rb
blob: f260bebc635c19aa6c841e64b69b1efadde00a10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class SetDocAndFilesNotifications < ActiveRecord::Migration
  # model removed
  class Permission < ActiveRecord::Base; end

  def self.up
    Permission.where(:controller => "projects", :action => "add_file").each {|p| p.update_attribute(:mail_option, true)}
    Permission.where(:controller => "projects", :action => "add_document").each {|p| p.update_attribute(:mail_option, true)}
    Permission.where(:controller => "documents", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, true)}
    Permission.where(:controller => "issues", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, true)}
  end

  def self.down
    Permission.where(:controller => "projects", :action => "add_file").each {|p| p.update_attribute(:mail_option, false)}
    Permission.where(:controller => "projects", :action => "add_document").each {|p| p.update_attribute(:mail_option, false)}
    Permission.where(:controller => "documents", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, false)}
    Permission.where(:controller => "issues", :action => "add_attachment").each {|p| p.update_attribute(:mail_option, false)}
  end
end