app/controllers/configuration_controller.rb
# handle buttons pressed on the button bar
handle buttons pressed on the button bar
handle buttons pressed on the button bar
def button
    @refresh_div = "main_div" 
    timeprofile_delete if params[:pressed] == "tp_delete"
    copy_record if params[:pressed] == "tp_copy"
    edit_record if params[:pressed] == "tp_edit"
    if ! @refresh_partial && @flash_array.nil? 
      add_flash(_("Button not yet implemented"), :error)
      @refresh_partial = "layouts/flash_msg"
      @refresh_div = "flash_msg_div"
    end
    if params[:pressed].ends_with?("_edit", "_copy")
      render :update do |page|
        page.redirect_to :action => @refresh_partial, :id => @redirect_id
      end
    else
      c_tb = build_toolbar(center_toolbar_filename)
      render :update do |page|                    
        page.replace("flash_msg_div", :partial => "layouts/flash_msg")
        page.replace_html("main_div", :partial => "ui_4") 
        page << javascript_pf_toolbar_reload('center_tb', c_tb)
      end
    end
  end
def button @refresh_div = "main_div" timeprofile_delete if params [ :pressed ] == "tp_delete" copy_record if params [ :pressed ] == "tp_copy" edit_record if params [ :pressed ] == "tp_edit" if ! @refresh_partial && @flash_array . nil? add_flash ( _ ( "Button not yet implemented" ) , :error ) @refresh_partial = "layouts/flash_msg" @refresh_div = "flash_msg_div" end if params [ :pressed ] . ends_with? ( "_edit" , "_copy" ) render :update do | page | page . redirect_to :action => @refresh_partial , :id => @redirect_id end else c_tb = build_toolbar ( center_toolbar_filename ) render :update do | page | page . replace ( "flash_msg_div" , :partial => "layouts/flash_msg" ) page . replace_html ( "main_div" , :partial => "ui_4" ) page << javascript_pf_toolbar_reload ( 'center_tb' , c_tb ) end end end
handle buttons pressed on the button bar
handle buttons pressed on the button bar
# Default div for button.rjs to refresh # if no button handler ran, show not implemented msg # Use RJS to update the display # Replace the main div area contents