molten-trunk/molten5_withgrid/app/controllers/case_watchers_controller.rb
# Returns contacts associated with the account (params[:from_account]) case watcher. 
Returns contacts associated with the account (params[:from_account]) case watcher.
Returns contacts associated with the account ( params [ : from_account ] ) case watcher .
def 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.find(:all, :order => 'last_name', :conditions => ["email NOT IN (?) and email IS NOT NULL and email != ''",['null@null.null','no@no.no']])
                  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 = @account.watcher ? @account.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 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 . find ( :all , :order => 'last_name' , :conditions => [ "email NOT IN (?) and email IS NOT NULL and email != ''" , [ 'null@null.null' , 'no@no.no' ] ] ) 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 = @account . watcher ? @account . 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 with the account (params[:from_account]) case watcher.
Returns contacts associated with the account ( params [ : from_account ] ) case watcher .
# find the account we are grabing contacts from # super users can only add themselves. # the current subscribers # set siblings if (a) this account can view child accounts and (b) it has sibling accounts