|
|
@@ -4,6 +4,10 @@ require_once dirname(__FILE__) . '/' . 'Lib.php';
|
|
|
Lib::loadClass('V');
|
|
|
Lib::loadClass('User');
|
|
|
Lib::loadClass('ProcesTestyHelper');
|
|
|
+Lib::loadClass('TypespecialVariable');
|
|
|
+Lib::loadClass('UsersHelper');
|
|
|
+Lib::loadClass('DB');
|
|
|
+Lib::loadClass('UserBookmarks');
|
|
|
|
|
|
class ProcesMenu {
|
|
|
|
|
|
@@ -30,7 +34,6 @@ class ProcesMenu {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Lib::loadClass('UsersHelper');
|
|
|
$this->_acl = UsersHelper::getUserAcl($this->_user_id);
|
|
|
if (!$this->_acl) {
|
|
|
die('Error Acl');
|
|
|
@@ -176,7 +179,6 @@ class ProcesMenu {
|
|
|
}
|
|
|
|
|
|
$procesy_init_ids = array();
|
|
|
- Lib::loadClass('DB');
|
|
|
$db = DB::getDB();
|
|
|
$sql = "select `ID`,`DESC` from `CRM_PROCES` where `TYPE`='PROCES_INIT' and `ID` in (".implode(",", $menu_to_show).") ";
|
|
|
$res = $db->query($sql);
|
|
|
@@ -342,7 +344,6 @@ class ProcesMenu {
|
|
|
/*
|
|
|
* $_SESSION['USER_PROFILE'][section][key] = val;
|
|
|
*/
|
|
|
- Lib::loadClass('UserBookmarks');
|
|
|
$userBookmarks = UserBookmarks::getInstance();
|
|
|
|
|
|
$bookmarksJson = array();
|
|
|
@@ -359,6 +360,12 @@ class ProcesMenu {
|
|
|
$userGroupIdsCSV = User::getGroupsIds();
|
|
|
$userGroupIdsCSV = implode(',', $userGroupIdsCSV);
|
|
|
|
|
|
+ $typeSpecialUserId = null;
|
|
|
+ if (User::isAdmin()) {
|
|
|
+ $typeSpecialUserId = TypespecialVariable::getInstance(-1, '__USER_ID');
|
|
|
+ }
|
|
|
+ $typeSpecialZasob = TypespecialVariable::getInstance(-1, '__ZASOB');
|
|
|
+
|
|
|
?>
|
|
|
<div id="SE-menu" class="navbar navbar-inverse" style="position: static;">
|
|
|
<div class="navbar-inner">
|
|
|
@@ -409,41 +416,43 @@ class ProcesMenu {
|
|
|
<li>
|
|
|
<a href="procesy5.php?task=CRM_LISTA_ZASOBOW&filtr_id=" title="Wyświetlenie drzewa zasobów">Wszystkie Zasoby</a>
|
|
|
</li>
|
|
|
- <li>
|
|
|
- <from id="ProcesMenuZasobSearchFrm" class="form-search" method="GET" action="procesy5.php">
|
|
|
- <input type="hidden" name="task" value="CRM_LISTA_ZASOBOW">
|
|
|
- <div class="input-append" style="padding:2px 6px">
|
|
|
- <input id="ProcesMenuZasobSearchInput" type="text" name="filtr_id" class="span2 search-query" placeholder="Nr zasobu">
|
|
|
- <input id="ProcesMenuZasobSearchSubmit" type="submit" class="btn" value="Szukaj" />
|
|
|
- </div>
|
|
|
- </from>
|
|
|
- <script>
|
|
|
-function procesMenuZasobSearchGo() {
|
|
|
- var id = jQuery('#ProcesMenuZasobSearchInput').val();
|
|
|
- if ('' !== id) {
|
|
|
- window.location.href = window.location.protocol + '//' + window.location.host + window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/')) + '/procesy5.php?task=CRM_LISTA_ZASOBOW&filtr_id=' + id;
|
|
|
- }
|
|
|
-}
|
|
|
+
|
|
|
+ <li class="divider"></li>
|
|
|
+ <li class="nav-header"><nobr>Wyszukaj:</nobr></li>
|
|
|
+ <?php if (!$typeSpecialZasob) : ?>
|
|
|
+ <li>
|
|
|
+ <div class="alert alert-error">Brak typespecial __ZASOB</div>
|
|
|
+ </li>
|
|
|
+ <?php else : ?>
|
|
|
+ <li>
|
|
|
+ <form id="ProcesMenuZasobFrm" action="procesy5.php" method="GET" style="padding:0 20px">
|
|
|
+ <input type="hidden" name="task" value="CRM_LISTA_ZASOBOW">
|
|
|
+ <?php
|
|
|
+ $fldName = 'ProcesMenu__filtr_id';
|
|
|
+ $fldParams = array();
|
|
|
+ $fldParams['allowCreate'] = false;
|
|
|
+ $fldParams['ajaxDataUrlBase'] = "index.php?FUNCTION_INIT=PROCES_MENU&HEADER_NOT_INIT=YES&_task=TYPESPECIAL&fld={$fldName}";
|
|
|
+ $fldParams['placeholder'] = 'Szukaj...';
|
|
|
+ $fldParams['formFieldName'] = 'filtr_id';
|
|
|
+ //$fldParams['ajaxDataUrlBase'] .= "&DBG_TS=3";
|
|
|
+ echo $typeSpecialZasob->showFormItem($tblID = -1, $fldName, $selValue = '', $fldParams);
|
|
|
+ ?>
|
|
|
+ <input class="btn btn-mini btn-primary" type="submit" value="Wybierz" />
|
|
|
+ <script>
|
|
|
jQuery(document).ready(function() {
|
|
|
- jQuery('#ProcesMenuZasobSearchInput').on('click', function(e) {
|
|
|
- return false;
|
|
|
- });
|
|
|
- jQuery('#ProcesMenuZasobSearchInput').on('keypress', function(e) {
|
|
|
- if (e.which == 13) {
|
|
|
- procesMenuZasobSearchGo();
|
|
|
- }
|
|
|
- });
|
|
|
- jQuery('#ProcesMenuZasobSearchSubmit').on('click', function(e) {
|
|
|
- procesMenuZasobSearchGo();
|
|
|
- });
|
|
|
jQuery('#ProcesMenuZasobDropdownLink').on('click', function(e) {
|
|
|
setTimeout(function(){
|
|
|
- jQuery('#ProcesMenuZasobSearchInput').focus();
|
|
|
+ jQuery('#ts-<?php echo $fldName; ?>')
|
|
|
+ .next('.selectize-control')
|
|
|
+ .find('input:first')
|
|
|
+ .focus();
|
|
|
}, 200);
|
|
|
});
|
|
|
});
|
|
|
- </script>
|
|
|
+ </script>
|
|
|
+ </form>
|
|
|
</li>
|
|
|
+ <?php endif; ?>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li<?php if ($active == 'obowiazki') echo ' class="active"'; ?>><a href="procesy5.php?task=CRM_WYSWIETL_OBOWIAZKI" title="Wyswietlenie OBOWIAZKOW">Obowiązki</a></li>
|
|
|
@@ -502,32 +511,29 @@ jQuery(document).ready(function() {
|
|
|
<li><a href="index.php?LOGIN=PERMS_RELOAD" title="Przeładuj uprawnienia"><i class="icon-refresh"></i> Przeładuj uprawnienia</a></li>
|
|
|
<?php if (User::isAdmin()) : ?>
|
|
|
<li class="divider"></li>
|
|
|
- <li class="nav-header">Pokaż testy pracownika:</li>
|
|
|
- <li>
|
|
|
- <?php
|
|
|
- Lib::loadClass('UsersHelper');
|
|
|
- $users = UsersHelper::get_users_list(null, 100, 0, 'ADM_NAME', 'ASC');
|
|
|
- $user_sel = array();
|
|
|
- foreach ($users as $r) {
|
|
|
- $user_sel [$r->ID] = "{$r->ID}: {$r->ADM_NAME} ({$r->ADM_ACCOUNT}, {$r->EMAIL}, {$r->ADM_PHONE})";
|
|
|
- }
|
|
|
-
|
|
|
- if (!empty($user_sel)) {
|
|
|
- echo '<form action="index.php" method="POST">';
|
|
|
- echo '<input type="hidden" name="FUNCTION_INIT" value="MENU_SELECT_PROCES">';
|
|
|
- echo '<input type="hidden" name="_action" value="showMyTests">';
|
|
|
- echo '<select name="_user_id">';
|
|
|
- foreach ($user_sel as $k_option => $v_label) {
|
|
|
- $sel = ($k_option == $this->_user_id)? ' selected="selected"' : '';
|
|
|
- echo '<option value="' . $k_option . '"' . $sel . '>' . $v_label . '</option>';
|
|
|
- }
|
|
|
- echo '</select>';
|
|
|
- echo ' ';
|
|
|
- echo '<input type="submit" value="Wybierz" />';
|
|
|
- echo '</form>';
|
|
|
- }
|
|
|
- ?>
|
|
|
- </li>
|
|
|
+ <li class="nav-header"><nobr>Pokaż testy pracownika:</nobr></li>
|
|
|
+ <?php if (!$typeSpecialUserId) : ?>
|
|
|
+ <li>
|
|
|
+ <div class="alert alert-error">Brak typespecial __USERS_ID</div>
|
|
|
+ </li>
|
|
|
+ <?php else : ?>
|
|
|
+ <li>
|
|
|
+ <form action="index.php" method="POST">
|
|
|
+ <input type="hidden" name="FUNCTION_INIT" value="MENU_SELECT_PROCES">
|
|
|
+ <input type="hidden" name="_action" value="showMyTests">
|
|
|
+ <?php
|
|
|
+ $fldName = '_user_id';
|
|
|
+ $fldParams = array();
|
|
|
+ $fldParams['allowCreate'] = false;
|
|
|
+ $fldParams['ajaxDataUrlBase'] = "index.php?FUNCTION_INIT=PROCES_MENU&HEADER_NOT_INIT=YES&_task=TYPESPECIAL&fld={$fldName}";
|
|
|
+ $fldParams['placeholder'] = 'Szukaj...';
|
|
|
+ //$fldParams['ajaxDataUrlBase'] .= "&DBG_TS=3";
|
|
|
+ echo $typeSpecialUserId->showFormItem($tblID = -1, $fldName, $selValue = '', $fldParams);
|
|
|
+ ?>
|
|
|
+ <input class="btn btn-mini btn-warning" type="submit" value="Wybierz" />
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <?php endif; ?>
|
|
|
<?php endif; ?>
|
|
|
<li class="divider"></li>
|
|
|
<li><a href="index.php?LOGIN=LOGOUT"><i class="icon-off"></i> Wyloguj</a></li>
|