예제 #1
0
<?php

$tpl = erLhcoreClassTemplate::getInstance('lhdepartment/group.tpl.php');
$departmentParams = array();
$pages = new lhPaginator();
$pages->serverURL = erLhcoreClassDesign::baseurl('department/group');
$pages->items_total = erLhcoreClassModelDepartamentGroup::getCount($departmentParams);
$pages->setItemsPerPage(20);
$pages->paginate();
$items = array();
if ($pages->items_total > 0) {
    $items = erLhcoreClassModelDepartamentGroup::getList(array_merge($departmentParams, array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC')));
}
$tpl->set('items', $items);
$tpl->set('pages', $pages);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/departments', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('department/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/departments', 'Departments')), array('url' => erLhcoreClassDesign::baseurl('department/departments'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/departments', 'Departments groups')));
    ?>
" <?php 
    echo in_array($departament['id'], $userDepartaments) ? 'checked="checked"' : '';
    ?>
 /><?php 
    echo htmlspecialchars($departament['name']);
    ?>
</label><br>
        	<?php 
}
?>
    	</div>
    </div>
    
    <?php 
$departmentsGroups = erLhcoreClassModelDepartamentGroup::getList(array('limit' => false));
?>
    
    <?php 
if (!empty($departmentsGroups)) {
    ?>
    <div class="col-xs-6">    	           
        <h4><?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account', 'Departments groups');
    ?>
</h4>
       
        <?php 
    foreach ($departmentsGroups as $departamentGroup) {
        ?>
            <label><input type="checkbox" name="UserDepartamentGroup[]" value="<?php