<commit_before>// ==========================================================================
// Project:   xTuple Postbooks - Business Management System Framework
// Copyright: ©2011 OpenMFG LLC, d/b/a xTuple
// ==========================================================================
/*globals global Postbooks XM XT sc_assert */

sc_require('states/module');

Postbooks.CRM = Postbooks.MODULE.design({

  route: 'crm',
  title: "_crm",
  submodules: 'Contact Account ToDo Opportunity Incident Project'.w(),

  enterState: function() {
    arguments.callee.base.apply(this, arguments);

    // Load any lists used in popups
    XT.store.find(XM.IncidentCategory);
    XT.store.find(XM.Priority);
    XT.store.find(XM.IncidentResolution);
    XT.store.find(XM.IncidentSeverity);
    XT.store.find(XM.Honorific);
  },

  // ACTIONS

  showContact: function() {
    this.gotoState('CONTACT');
  },

  showAccount: function() {
    this.gotoState('ACCOUNT');
  },

  showToDo: function() {
    this.gotoState('TO_DO');
  },

  showOpportunity: function() {
    this.gotoState('OPPORTUNITY');
  },

  showIncident: function() {
    this.gotoState('INCIDENT');
  },

  showProject: function() {
    this.gotoState('PROJECT');
  },

  // SUBSTATES

  "CONTACT":     SC.State.plugin('Postbooks.CONTACT'),
  "ACCOUNT":     SC.State.plugin('Postbooks.ACCOUNT'),
  "TO_DO":       SC.State.plugin('Postbooks.TO_DO'),
  "OPPORTUNITY": SC.State.plugin('Postbooks.OPPORTUNITY'),
  "INCIDENT":    SC.State.plugin('Postbooks.INCIDENT'),
  "PROJECT":     SC.State.plugin('Postbooks.PROJECT')

});

Postbooks.CRM.createIncidentCategoryRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.IncidentCategory, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createPriorityRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.Priority, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createIncidentResolutionRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.IncidentResolution, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createIncidentSeverityRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.IncidentSeverity, orderBy: 'order ASC' })
  });
};<commit_msg>Query more data at startup.<commit_after>// ==========================================================================
// Project:   xTuple Postbooks - Business Management System Framework
// Copyright: ©2011 OpenMFG LLC, d/b/a xTuple
// ==========================================================================
/*globals global Postbooks XM XT sc_assert */

sc_require('states/module');

Postbooks.CRM = Postbooks.MODULE.design({

  route: 'crm',
  title: "_crm",
  submodules: 'Contact Account ToDo Opportunity Incident Project'.w(),

  enterState: function() {
    arguments.callee.base.apply(this, arguments);

    // Load any lists used in popups
    XT.store.find(XM.IncidentCategory);
    XT.store.find(XM.Priority);
    XT.store.find(XM.IncidentResolution);
    XT.store.find(XM.IncidentSeverity);
    XT.store.find(XM.Honorific);
    XT.store.find(XM.Priority);
    XT.store.find(XM.OpportunityStage);
    XT.store.find(XM.OpportunityType);     
  },

  // ACTIONS

  showContact: function() {
    this.gotoState('CONTACT');
  },

  showAccount: function() {
    this.gotoState('ACCOUNT');
  },

  showToDo: function() {
    this.gotoState('TO_DO');
  },

  showOpportunity: function() {
    this.gotoState('OPPORTUNITY');
  },

  showIncident: function() {
    this.gotoState('INCIDENT');
  },

  showProject: function() {
    this.gotoState('PROJECT');
  },

  // SUBSTATES

  "CONTACT":     SC.State.plugin('Postbooks.CONTACT'),
  "ACCOUNT":     SC.State.plugin('Postbooks.ACCOUNT'),
  "TO_DO":       SC.State.plugin('Postbooks.TO_DO'),
  "OPPORTUNITY": SC.State.plugin('Postbooks.OPPORTUNITY'),
  "INCIDENT":    SC.State.plugin('Postbooks.INCIDENT'),
  "PROJECT":     SC.State.plugin('Postbooks.PROJECT')

});

Postbooks.CRM.createIncidentCategoryRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.IncidentCategory, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createPriorityRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.Priority, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createIncidentResolutionRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.IncidentResolution, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createIncidentSeverityRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.IncidentSeverity, orderBy: 'order ASC' })
  });
};

Postbooks.CRM.createOpportunityStageRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.OpportunityStage, orderBy: 'name ASC' })
  });
};

Postbooks.CRM.createOpportunityTypeRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.OpportunityType, orderBy: 'name ASC' })
  });
};

Postbooks.CRM.createPriorityRecordArray = function() {
  // We don't need to find, because we do this once, in CRM#enterState.
  return SC.RecordArray.create({
    store: Postbooks.store,
    query: SC.Query.create({ recordType: XM.Priority, orderBy: 'order ASC' })
  });
};
{'fraction_non_alphanumeric': 0.1864589759407773, 'fraction_numerical': 0.0012338062924120913, 'mean_word_length': 4.042768273716952, 'pattern_counts': {'":': 12, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5203589', 'n_tokens_mistral': 2199, 'n_tokens_neox': 2047, 'n_words': 444}