1 /** 2 * The following comment prevents JSLint errors concerning undefined global variables. 3 * It tells JSLint that these identifiers are defined elsewhere. 4 */ 5 /*jslint bitwise:true, browser:true, nomen:true, regexp:true, sloppy:true, white:true */ 6 7 /** The following comment is to prevent jslint errors about 8 * using variables before they are defined. 9 */ 10 /*global $, jQuery, Handlebars, dojox, dojo, console, finesse */ 11 12 var finesse = finesse || {}; 13 finesse.restservices = finesse.restservices || {}; 14 15 /** 16 * @class 17 * Overrides the the finesse.restservices.PhoneBooks getCollection to remove 18 * PhoneBook objects that have their "type" not set to "TEAM" 19 */ 20 finesse.restservices.AssignablePhoneBooks = finesse.restservices.PhoneBooks.extend(/** @lends finesse.restservices.AssignablePhoneBooks.prototype */{ 21 22 /** 23 * Overrides the the finesse.restservices.PhoneBooks getCollection to remove 24 * PhoneBook objects that have their "type" not set to "TEAM" 25 * @return {[type]} [description] 26 */ 27 getCollection: function () { 28 var id, phoneBook; 29 30 // Remove items with GLOBAL type 31 for (id in this._collection) 32 { 33 if (this._collection.hasOwnProperty(id)) 34 { 35 phoneBook = this._collection[id]; 36 if (phoneBook.getType() !== "TEAM") 37 { 38 delete this._collection[id]; 39 } 40 } 41 } 42 43 return this._collection; 44 } 45 46 });