OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Revert removal of groups XML responses (#9024)
Oliver Günther9acd19de4692
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rbindex 7300f16dcef..fef4f26d0b1 100644--- a/app/controllers/groups_controller.rb+++ b/app/controllers/groups_controller.rb@@ -38,52 +38,93 @@ class GroupsController < ApplicationControllerbefore_action :find_group, only: %i[destroy show create_memberships destroy_membershipedit_membership add_users]+ # GET /groups+ # GET /groups.xmldef index@groups = Group.order(Arel.sql('lastname ASC'))++ respond_to do |format|+ format.html # index.html.erb+ format.xml { render xml: @groups }+ endend+ # GET /groups/1+ # GET /groups/1.xmldef show- @group_users = group_members- render layout: 'no_menu'+ respond_to do |format|+ format.html do+ @group_users = group_members+ render layout: 'no_menu'+ end+ format.xml { render xml: @group }+ endend+ # GET /groups/new+ # GET /groups/new.xmldef new@group = Group.new++ respond_to do |format|+ format.html # new.html.erb+ format.xml { render xml: @group }+ endend+ # GET /groups/1/editdef edit@group = Group.includes(:members, :users).find(params[:id])set_filters_for_user_autocompleterend+ # POST /groups+ # POST /groups.xmldef create@group = Group.new permitted_params.group- if @group.save- flash[:notice] = I18n.t(:notice_successful_create)- redirect_to(groups_path)- else- render action: :new+ respond_to do |format|+ if @group.save+ flash[:notice] = I18n.t(:notice_successful_create)+ format.html { redirect_to(groups_path) }+ format.xml { render xml: @group, status: :created, location: @group }+ else+ format.html { render action: :new }+ format.xml { render xml: @group.errors, status: :unprocessable_entity }+ endendend+ # PUT /groups/1+ # PUT /groups/1.xmldef update@group = Group.includes(:users).find(params[:id])- if @group.update(permitted_params.group)- flash[:notice] = I18n.t(:notice_successful_update)- redirect_to action: :index- else- render action: :edit+ respond_to do |format|+ if @group.update(permitted_params.group)+ flash[:notice] = I18n.t(:notice_successful_update)+ format.html { redirect_to(groups_path) }+ format.xml { head :ok }+ else+ format.html { render action: 'edit' }+ format.xml { render xml: @group.errors, status: :unprocessable_entity }+ endendend+ # DELETE /groups/1+ # DELETE /groups/1.xmldef destroy::Principals::DeleteJob.perform_later(@group)- flash[:info] = I18n.t(:notice_deletion_scheduled)- redirect_to action: :index+ respond_to do |format|+ format.html do+ flash[:info] = I18n.t(:notice_deletion_scheduled)+ redirect_to(action: :index)+ end+ format.xml { head 202 }+ endenddef add_users