diff --git a/app/controllers/checklist_templates_controller.rb b/app/controllers/checklist_templates_controller.rb
index 542bd0e..6a9025a 100644
--- a/app/controllers/checklist_templates_controller.rb
+++ b/app/controllers/checklist_templates_controller.rb
@@ -1,6 +1,6 @@
class ChecklistTemplatesController < ApplicationController
before_filter :login_required
- layout 'checklists'
+ layout 'settings'
def index
@checklists = ChecklistTemplate.find(:all)
diff --git a/app/controllers/device_types_controller.rb b/app/controllers/device_types_controller.rb
index 2f19c83..24665a9 100644
--- a/app/controllers/device_types_controller.rb
+++ b/app/controllers/device_types_controller.rb
@@ -1,6 +1,6 @@
class DeviceTypesController < ApplicationController
before_filter :login_required
- layout 'devices'
+ layout 'settings'
def index
@device_types = DeviceType.find(:all)
diff --git a/app/helpers/address_helper.rb b/app/helpers/address_helper.rb
deleted file mode 100644
index 95e40aa..0000000
--- a/app/helpers/address_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module AddressHelper
-end
diff --git a/app/helpers/devices_helper.rb b/app/helpers/devices_helper.rb
deleted file mode 100644
index c0e9e88..0000000
--- a/app/helpers/devices_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module DevicesHelper
-end
diff --git a/app/helpers/email_helper.rb b/app/helpers/email_helper.rb
deleted file mode 100644
index 37a644c..0000000
--- a/app/helpers/email_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module EmailHelper
-end
diff --git a/app/helpers/inventory_items_helper.rb b/app/helpers/inventory_items_helper.rb
deleted file mode 100644
index 93cb29e..0000000
--- a/app/helpers/inventory_items_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module InventoryItemsHelper
-end
diff --git a/app/helpers/passwords_helper.rb b/app/helpers/passwords_helper.rb
deleted file mode 100644
index 8797917..0000000
--- a/app/helpers/passwords_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module PasswordsHelper
-end
diff --git a/app/helpers/phone_helper.rb b/app/helpers/phone_helper.rb
deleted file mode 100644
index 0acd53e..0000000
--- a/app/helpers/phone_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module PhoneHelper
-end
diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb
deleted file mode 100644
index f54a8fc..0000000
--- a/app/helpers/sessions_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module SessionsHelper
-end
\ No newline at end of file
diff --git a/app/helpers/things_helper.rb b/app/helpers/things_helper.rb
deleted file mode 100644
index 6ce4cba..0000000
--- a/app/helpers/things_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module ThingsHelper
-end
diff --git a/app/models/device.rb b/app/models/device.rb
index a669a8b..c95401e 100644
--- a/app/models/device.rb
+++ b/app/models/device.rb
@@ -4,6 +4,7 @@ class Device < ActiveRecord::Base
has_and_belongs_to_many :tickets
has_many :checklists, :dependent => :destroy
has_many :things, :as => :attached, :dependent => :destroy
+ has_many :sentries
validates_uniqueness_of :service_tag
validates_presence_of :client_id, :device_type_id
diff --git a/app/models/user.rb b/app/models/user.rb
index 437be2b..3514977 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -18,6 +18,7 @@ class User < ActiveRecord::Base
# Relationships
has_and_belongs_to_many :roles
has_one :client
+ has_many :schedules
has_attached_file :avatar,
:styles => { :avatar => "50x50#" }
diff --git a/app/views/checklist_templates/edit.html.erb b/app/views/checklist_templates/edit.html.erb
index 2431ed6..f137dad 100644
--- a/app/views/checklist_templates/edit.html.erb
+++ b/app/views/checklist_templates/edit.html.erb
@@ -2,4 +2,11 @@
Editing <%= @checklist.name %> Checklist
<%= render :partial => 'form' %>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/checklist_templates/index.html.erb b/app/views/checklist_templates/index.html.erb
index aad291f..9f52ff6 100644
--- a/app/views/checklist_templates/index.html.erb
+++ b/app/views/checklist_templates/index.html.erb
@@ -14,4 +14,13 @@
<% end %>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/checklist_templates/new.html.erb b/app/views/checklist_templates/new.html.erb
index 31b842f..b3f0e85 100644
--- a/app/views/checklist_templates/new.html.erb
+++ b/app/views/checklist_templates/new.html.erb
@@ -2,4 +2,11 @@
New Checklist
<%= render :partial => 'form' %>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/checklist_templates/show.html.erb b/app/views/checklist_templates/show.html.erb
index e3d833b..297ecca 100644
--- a/app/views/checklist_templates/show.html.erb
+++ b/app/views/checklist_templates/show.html.erb
@@ -66,5 +66,6 @@
$("a.add_device_type_association").bind("click", function(){
$("#device_types").parent().slideDown(1000);
});
+ $("#sidebar li a.checklist_template_configuration").parent().addClass("selected");
});
\ No newline at end of file
diff --git a/app/views/layouts/checklists.html.erb b/app/views/layouts/checklists.html.erb
deleted file mode 100644
index 74f53ee..0000000
--- a/app/views/layouts/checklists.html.erb
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
- Suite
- <%= javascript_include_tag "jquery", "jquery-ui" %>
- <%= javascript_include_tag "jquery.metadata", "quicksilver", "jquery.quickselect" %>
- <%= javascript_include_tag "common", "checklists" %>
- <%= stylesheet_link_tag "blueprint/screen", "jquery-theme", "common", "checklists", :media => "screen", :cache => "checklist-css-combined" %>
-
-
-
-
-
-
-
-
- <%= yield %>
-
-
-
-
-
\ No newline at end of file
diff --git a/app/views/layouts/clients.html.erb b/app/views/layouts/clients.html.erb
index db0192f..273ac4a 100644
--- a/app/views/layouts/clients.html.erb
+++ b/app/views/layouts/clients.html.erb
@@ -18,7 +18,7 @@
Clients
Tickets
Devices
- Checklists
+ Settings
<%= flash_messages %>
diff --git a/app/views/layouts/devices.html.erb b/app/views/layouts/devices.html.erb
index c8593d6..425b588 100644
--- a/app/views/layouts/devices.html.erb
+++ b/app/views/layouts/devices.html.erb
@@ -17,7 +17,7 @@
Clients
Tickets
Devices
- Checklists
+ Settings
<%= flash_messages %>
@@ -28,10 +28,6 @@
- Configuration
-
<%= yield %>
diff --git a/app/views/layouts/tickets.html.erb b/app/views/layouts/tickets.html.erb
index 5a464be..2db34a5 100644
--- a/app/views/layouts/tickets.html.erb
+++ b/app/views/layouts/tickets.html.erb
@@ -19,7 +19,7 @@
Clients
Tickets
Devices
-
Checklists
+
Settings
diff --git a/config/routes.rb b/config/routes.rb
index 7e238b4..df58164 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,6 @@
ActionController::Routing::Routes.draw do |map|
- # Restful Authentication Rewrites
+ # Restful Authentication
map.logout '/logout', :controller => 'sessions', :action => 'destroy'
map.login '/login', :controller => 'sessions', :action => 'new'
map.register '/register', :controller => 'users', :action => 'create'
@@ -9,54 +9,51 @@
map.forgot_password '/forgot_password', :controller => 'passwords', :action => 'new'
map.change_password '/change_password/:reset_code', :controller => 'passwords', :action => 'reset'
map.create_password '/create_password/:reset_code', :controller => 'passwords', :action => 'create_password'
-
- # Restful Authentication Resources
map.resources :users
map.resources :passwords
map.resource :session
- map.resources :attachments
-
- map.client_list '/clients/list', :controller => 'clients', :action => 'list'
-
- map.search_clients '/clients/search', :controller => 'clients', :action => 'search'
+ # Main Resources
map.resources :clients do |client|
client.resources :tickets
client.resources :devices
client.resources :users
end
-
- map.search_tickets '/tickets/search', :controller => 'tickets', :action => 'search'
- map.resources :ticket_entries
map.resources :tickets do |ticket|
ticket.resources :ticket_entries
ticket.resources :devices
ticket.resources :checklists
end
-
- map.resources :device_types
-
map.resources :devices do |device|
device.resources :checklists
device.resources :tickets
+ device.resources :sentries
end
-
+
+ # Secondary Resources
+ map.resources :ticket_entries
+ map.resources :device_types
+ map.resources :sentries do |sentry|
+ sentry.resources :events
+ end
+ map.resources :settings
map.resources :things
+ map.resources :checklists
+ map.resources :checklist_templates
+ map.resources :goggles
+ map.resources :schedules
+ # Custom Routes
+ map.search_clients '/clients/search', :controller => 'clients', :action => 'search'
+ map.client_list '/clients/list', :controller => 'clients', :action => 'list'
+ map.search_tickets '/tickets/search', :controller => 'tickets', :action => 'search'
map.device_details '/tickets/:ticket_id/devices/:id/details', :controller => 'devices', :action => 'details'
map.add_to_ticket '/tickets/:ticket_id/devices/:id/add_to_ticket', :controller => 'devices', :action => 'add_to_ticket'
map.remove_device_from_ticket '/tickets/:ticket_id/devices/:id/remove_from_ticket', :controller => 'devices', :action => 'remove_from_ticket'
-
- map.resources :checklists
- map.remove_checklist_from_ticket '/tickets/:ticket_id/checklists/:id/remove_from_ticket', :controller => 'checklists', :action => 'remove_from_ticket'
-
- map.resources :checklist_templates
map.add_association '/checklist_templates/:checklist_template_id/device_types/:id/add_association', :controller => 'checklist_templates', :action => "add_assocation"
map.remove_association '/checklist_templates/:checklist_template_id/device_types/:id/remove_association', :controller => 'checklist_templates', :action => "remove_assocation"
-
- # Home Page
- map.root :controller => 'tickets', :action => 'index'
-
+ map.remove_checklist_from_ticket '/tickets/:ticket_id/checklists/:id/remove_from_ticket', :controller => 'checklists', :action => 'remove_from_ticket'
+
# iPhone routes
map.namespace :iphone do |iphone|
iphone.resources :clients do |client|
@@ -72,6 +69,10 @@
iphone.root :controller => 'clients', :action => 'home'
end
+ # Home Page
+ map.root :controller => 'tickets', :action => 'index'
+
+ # Last but not least
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
diff --git a/config/settings.yml.example b/config/settings.yml.example
index 1356f92..f05cefe 100644
--- a/config/settings.yml.example
+++ b/config/settings.yml.example
@@ -2,6 +2,9 @@ development: &non_production_settings
site_url: http://localhost:3000
site_name: Suite
admin_email: youremail@domain.com
+ # we use https://www.grc.com/passwords.htm to generate some unique strings
+ event_api_username: ln4A9DvHOs2qZXTLOg8hPx5jV5cClb9Emra129Fi0Q2cqcMvIysiL0XCSKcu5S6
+ event_api_password: MPQ1CBykdvLmcjRs9el0DKbKMEkdGJPT2OD4Dn1jtXNZMSoHy8f8ViMt6auJhu3
test:
<<: *non_production_settings
@@ -10,3 +13,6 @@ production:
site_url: http://suite.yourdomain.com
site_name: Suite
admin_email: youremail@domain.com
+ # we use https://www.grc.com/passwords.htm to generate some unique strings
+ event_api_username: ln4A9DvHOs2qZXTLOg8hPx5jV5cClb9Emra129Fi0Q2cqcMvIysiL0XCSKcu5S6
+ event_api_password: MPQ1CBykdvLmcjRs9el0DKbKMEkdGJPT2OD4Dn1jtXNZMSoHy8f8ViMt6auJhu3
diff --git a/db/schema.rb b/db/schema.rb
index 3d4ba00..230ed89 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20081211230915) do
+ActiveRecord::Schema.define(:version => 20081212174923) do
create_table "addresses", :force => true do |t|
t.string "context", :default => "Work", :null => false
@@ -119,6 +119,25 @@
t.datetime "updated_at"
end
+ create_table "events", :force => true do |t|
+ t.string "recordable_type"
+ t.integer "recordable_id"
+ t.text "data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "goggles", :force => true do |t|
+ t.string "name"
+ t.string "script"
+ t.text "note"
+ end
+
+ create_table "notification_queues", :force => true do |t|
+ t.text "message"
+ t.integer "schedule_id"
+ end
+
create_table "passwords", :force => true do |t|
t.integer "user_id"
t.string "reset_code"
@@ -158,6 +177,31 @@
t.integer "user_id"
end
+ create_table "schedules", :force => true do |t|
+ t.string "name"
+ t.boolean "active"
+ t.integer "user_id"
+ t.string "start_time"
+ t.string "end_time"
+ t.integer "backup_id"
+ end
+
+ create_table "sentries", :force => true do |t|
+ t.boolean "state"
+ t.text "message"
+ t.integer "device_id"
+ t.string "goggle_parameters"
+ t.datetime "last_surveyed_at"
+ t.integer "survey_interval"
+ t.integer "notifications_to_send"
+ t.integer "maximum_notify_frequency"
+ t.integer "notifications_sent"
+ t.integer "schedule_id"
+ t.integer "goggle_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
create_table "sessions", :force => true do |t|
t.string "session_id", :default => "", :null => false
t.text "data"
diff --git a/public/stylesheets/devices.css b/public/stylesheets/devices.css
index 3293bde..e260f9f 100644
--- a/public/stylesheets/devices.css
+++ b/public/stylesheets/devices.css
@@ -2,7 +2,6 @@
/* Sidebar */
div.sidebar-list ul#devices li a.search {background:url("/images/icons/find.png") no-repeat;}
-div.sidebar-list ul#configuration li a.device_type_configuration {background:url("/images/icons/script_edit.png") no-repeat 0px 1px;}
/* Search box */
#applesearch .sbox input {width:300px;}
\ No newline at end of file