molten-trunk/molten5_withgrid/app/controllers/case_watchers_controller.rb
# Returns contacts associated the the support case's case watcher.  
Returns contacts associated the the support case's case watcher.
Returns contacts associated the the support case ' s case watcher .
def case
    @account = @case.account
    if id = params[:from_account]
      @selected_account = Sfaccount.find(id)
    end
    if current_contact.portal_privilege == AppConstants::PRIVILEGE[:super_user]
                  @instruction_text = "Your current access level is \"Super User\" and you can only subscribe 1 contact: yourself."
                  @contacts = [current_contact]
                else
                  @contacts = (@selected_account || @account).contacts
                  if current_contact.portal_privilege == AppConstants::PRIVILEGE[:user_manager]
                    @instruction_text = "Your current access level is \"User Manager\" and you can subscribe other contacts from your company."
                  end
                end
    @subscribers = @case.watcher ? @case.watcher.contacts : []
    @siblings = (@account.portal_case_scope__c == Sfaccount::SCOPES[:children_accounts] and @account.sibling_accounts) ? @account.sibling_accounts.reject { |a| a.contacts(true).empty? } : []
  end
def case @account = @case . account if id = params [ :from_account ] @selected_account = Sfaccount . find ( id ) end if current_contact . portal_privilege == AppConstants :: PRIVILEGE [ :super_user ] @instruction_text = "Your current access level is \"Super User\" and you can only subscribe 1 contact: yourself." @contacts = [ current_contact ] else @contacts = ( @selected_account || @account ) . contacts if current_contact . portal_privilege == AppConstants :: PRIVILEGE [ :user_manager ] @instruction_text = "Your current access level is \"User Manager\" and you can subscribe other contacts from your company." end end @subscribers = @case . watcher ? @case . watcher . contacts : [ ] @siblings = ( @account . portal_case_scope__c == Sfaccount :: SCOPES [ :children_accounts ] and @account . sibling_accounts ) ? @account . sibling_accounts . reject { | a | a . contacts ( true ) . empty? } : [ ] end
Returns contacts associated the the support case's case watcher.
Returns contacts associated the the support case ' s case watcher .
# find the account we are grabing contacts from. this is used in the pulldown selection menu. # super users can only add themselves. # set siblings if (a) this account can view child accounts and (b) it has sibling accounts