function ShowStructureSection(&$arStructure, &$arUsersInStructure, $bUpper = false) { if (count($arStructure) <= 0 || count($arUsersInStructure) <= 0) { echo 'bx_ec_no_structure_data'; return; } while (list($key, $department) = each($arStructure)) { ?> <div class="vcsd-user-section<?php echo $bUpper ? ' vcsd-user-section-upper' : ''; ?> " onclick="BxecCS_SwitchSection(document.getElementById('dep_<?php echo $department["ID"]; ?> _arrow'), 'dep_<?php echo $department["ID"]; ?> _block', arguments[0] || window.event);" title="<?php echo GetMessage("EC_OPEN_CLOSE_SECT"); ?> "> <table> <tr> <td><div style="width: <?php echo ($department["DEPTH_LEVEL"] - 1) * 15; ?> px"></div></td> <td class="vcsd-arrow-cell"><div id="dep_<?php echo $department["ID"]; ?> _arrow" class="vcsd-arrow-right"></div></td> <td><input type="checkbox" id="dep_<?php echo $department["ID"]; ?> " onclick="BxecCS_CheckGroup(this);" title='<?php echo GetMessage("EC_SELECT_SECTION", array('#SEC_TITLE#' => $department["NAME"])); ?> ' /></td> <td class="vcsd-contact-section"><?php echo $department["NAME"]; ?> </td> </tr> </table> </div> <div style="display:none;" id="dep_<?php echo $department["ID"]; ?> _block" class="vcsd-user-contact-block"> <?php $bExit = false; if (list($key, $subdepartment) = each($arStructure)) { prev($arStructure); if ($subdepartment["DEPTH_LEVEL"] > $department["DEPTH_LEVEL"]) { CEventCalendar::ShowStructureSection($arStructure, $arUsersInStructure); } if ($subdepartment["DEPTH_LEVEL"] < $department["DEPTH_LEVEL"]) { $bExit = true; } } ?> <?php if (is_array($arUsersInStructure[$department["ID"]])) { foreach ($arUsersInStructure[$department["ID"]] as $dep_user) { ?> <div class="vcsd-user-contact" onclick="BxecCS_SwitchUser('vscd_user_<?php echo $dep_user["USER_ID"]; ?> ', arguments[0] || window.event);" title="<?php echo GetMessage("EC_SELECT_USER"); ?> "> <table> <tr> <td><div style="width: <?php echo ($department["DEPTH_LEVEL"] - 1) * 15 + 21; ?> px"></div></td> <td><input type="checkbox" value="<?php echo $dep_user["USER_ID"] . '||' . $dep_user["USER_NAME"] . ' ' . $dep_user["USER_LAST_NAME"]; ?> " id="vscd_user_<?php echo $dep_user["USER_ID"]; ?> " /></td> <td><?php echo $dep_user["USER_NAME"]; ?> <?php echo $dep_user["USER_LAST_NAME"]; ?> </td> </tr> </table> </div> <?php } } ?> </div> <?php if ($bExit) { return; } } }