app/controllers/report_controller/widgets.rb
# Delete all selected or single displayed action(s)
Delete all selected or single displayed action(s)
Delete all selected or single displayed action ( s )
def widget_delete
    assert_privileges("widget_delete")
    widgets = find_checked_items
    if !params[:id].nil? && MiqWidget.find_by_id(params[:id]).nil?
      add_flash(_("%{model} no longer exists") % {:model => ui_lookup(:models => "MiqWidget")},
                :error)
    else
      widgets.push(params[:id]) if params[:id]
    end
    w = MiqWidget.find_by_id(widgets[0])        
    process_widgets(widgets, "destroy") unless widgets.empty?
    nodes = x_node.split('-')
    self.x_node = "#{nodes[0]}-#{WIDGET_CONTENT_TYPE.invert[w.content_type]}"
    replace_right_cell(:replace_trees => [:widgets])
  end
def widget_delete assert_privileges ( "widget_delete" ) widgets = find_checked_items if ! params [ :id ] . nil? && MiqWidget . find_by_id ( params [ :id ] ) . nil? add_flash ( _ ( "%{model} no longer exists" ) % { :model => ui_lookup ( :models => "MiqWidget" ) } , :error ) else widgets . push ( params [ :id ] ) if params [ :id ] end w = MiqWidget . find_by_id ( widgets [ 0 ] ) process_widgets ( widgets , "destroy" ) unless widgets . empty? nodes = x_node . split ( '-' ) self . x_node = "#{nodes[0]}-#{WIDGET_CONTENT_TYPE.invert[w.content_type]}" replace_right_cell ( :replace_trees => [ :widgets ] ) end
Delete all selected or single displayed action(s)
Delete all selected or single displayed action ( s )
# temp var to determine the parent node of deleted items