Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buildDocList(profession) {
- var docs = {};
- activeDocsArray = [];
- for (var i = 0; i < doctors.length; i++) {
- var aoes = JSON.parse("[" + template_.doctors[i].fachgebiete + "]");
- var sub_aoes = []
- if (activeProfession) {
- sub_aoes = JSON.parse(activeProfession.subfachgebiete);
- }
- for (var k = 0; k < aoes.length; k++) {
- var id = JSON.stringify(aoes[k]);
- var isSideProfession = false;
- if (activeProfession) {
- for (var j = 0; j < sub_aoes.length; j++) {
- if (id === sub_aoes[j]) {
- isSideProfession = true;
- }
- }
- }
- if (profession === "" || (activeProfession != null &&
- ((id === activeProfession.id) || isSideProfession === true))) {
- var name = template_.doctors[i].nachname;
- if (!(name.charAt(0).toLowerCase() in docs)) {
- docs[name.charAt(0).toLowerCase()] = [];
- }
- docs[name.charAt(0).toLowerCase()].push(template_.doctors[i]);
- activeDocsArray.push(template_.doctors[i]);
- break;
- }
- }
- }
- activeDoctors = docs;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement