From e2392f856c92659acd8d08de01717458fed4a4cc Mon Sep 17 00:00:00 2001 From: "robert.glez" Date: Mon, 24 Feb 2014 01:41:40 +0100 Subject: [PATCH] Second fix for BT#7413 --- main/admin/add_sessions_to_usergroup.php | 406 ++++++++++++----------- main/lang/english/admin.inc.php | 1 + main/lang/spanish/admin.inc.php | 1 + 3 files changed, 211 insertions(+), 197 deletions(-) diff --git a/main/admin/add_sessions_to_usergroup.php b/main/admin/add_sessions_to_usergroup.php index 552f63bd4b..8dbc4bb1e4 100644 --- a/main/admin/add_sessions_to_usergroup.php +++ b/main/admin/add_sessions_to_usergroup.php @@ -1,8 +1,8 @@ 'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); + } else { + $("#advancedSearch").css("display","none"); + $("#img_plus_and_minus").html(\' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedSearch').'\'); + } +} + function validate_filter() { document.formulaire.add_type.value = \''.$add_type.'\'; document.formulaire.form_sent.value=0; @@ -83,16 +93,16 @@ $sessions=array(); $usergroup = new UserGroup(); $id = intval($_GET['id']); if($_POST['form_sent']) { - $form_sent = $_POST['form_sent']; - $elements_posted = $_POST['elements_in_name']; + $form_sent = $_POST['form_sent']; + $elements_posted = $_POST['elements_in_name']; if (!is_array($elements_posted)) { $elements_posted = array(); } if ($form_sent == 1) { - //added a parameter to send emails when registering a user + //added a parameter to send emails when registering a user $usergroup->subscribe_sessions_to_usergroup($id, $elements_posted); header('Location: usergroups.php'); - exit; + exit; } } $data = $usergroup->get($id); @@ -103,9 +113,9 @@ $session_list = SessionManager::get_sessions_list(array(), array('name')); $elements_not_in = $elements_in= array(); if (!empty($session_list)) { - foreach($session_list as $session) { - if (in_array($session['id'], $session_list_in)) { - $elements_in[$session['id']] = $session['name']; + foreach($session_list as $session) { + if (in_array($session['id'], $session_list_in)) { + $elements_in[$session['id']] = $session['name']; } else { $elements_not_in[$session['id']] = $session['name']; } @@ -129,19 +139,19 @@ function search_sessions($needle,$type) { if ($type == 'single') { // search users where username or firstname or lastname begins likes $needle - /* $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user - WHERE (username LIKE "'.$needle.'%" - OR firstname LIKE "'.$needle.'%" - OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'" AND user.status<>'.DRH.''. - $order_clause. - ' LIMIT 11';*/ + /* $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user + WHERE (username LIKE "'.$needle.'%" + OR firstname LIKE "'.$needle.'%" + OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'" AND user.status<>'.DRH.''. + $order_clause. + ' LIMIT 11';*/ } else if ($type == 'searchbox') { $session_list = SessionManager::get_sessions_list(array('s.name LIKE' => "%$needle%")); } else { $session_list = SessionManager::get_sessions_list(array('s.name LIKE' => "$needle%")); } - $i=0; + $i=0; if ($type=='single') { /* while ($user = Database :: fetch_array($rs)) { @@ -156,9 +166,9 @@ function search_sessions($needle,$type) { $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));*/ } else { $return .= ''; - echo ''; - foreach ($new_field['data'] as $option) { - $checked=''; - if (isset($_POST[$varname])) { - if ($_POST[$varname]==$option[1]) { - $checked = 'selected="true"'; - } - } - echo ''; +
> +'.$data['name'].': '.$tool_name.''; + +if ($add_type=='multiple') { + if (is_array($extra_field_list)) { + if (is_array($new_field_list) && count($new_field_list)>0 ) { + echo '

'.get_lang('FilterUsers').'

'; + foreach ($new_field_list as $new_field) { + echo $new_field['name']; + $varname = 'field_'.$new_field['variable']; + echo ' '; - echo '  '; } - echo ''; - echo '

'; + echo ''; } + echo ''; + echo '  '; } + echo ''; + echo '

'; } - echo Display::input('hidden','id',$id); - echo Display::input('hidden','form_sent','1'); - echo Display::input('hidden','add_type',null); - if(!empty($errorMsg)) { - Display::display_normal_message($errorMsg); //main API - } + } +} +echo Display::input('hidden','id',$id); +echo Display::input('hidden','form_sent','1'); +echo Display::input('hidden','add_type',null); +if(!empty($errorMsg)) { + Display::display_normal_message($errorMsg); //main API +} +?> + + + + + + + + + + + + + + + + + + + + + + +
: + :
+ : + +'; ?> +'. get_lang('SearchSessions'); ?> : + + + 
+
+ + +
+ +
+ 'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> +
+ +
+
+ + + + +

+ + +





+
+'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false ); + unset($sessionUsersList); +?> +
+
+ '.get_lang('SubscribeClassToSessions').''; ?> +
+
- - - - - - - - - - - - - - - - - - - - - -
: - :
- : - - '; ?> - : - -  
-
- - -
- -
- 'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> -
- -
-
- - - - -

- - -





-
- 'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false ); - unset($sessionUsersList); - ?> -
-
- '.get_lang('SubscribeClassToSessions').''; - ?> -
- - - + return ret; +} +--> + \ No newline at end of file diff --git a/main/lang/spanish/admin.inc.php b/main/lang/spanish/admin.inc.php index 2493f798ed..dac5394d34 100644 --- a/main/lang/spanish/admin.inc.php +++ b/main/lang/spanish/admin.inc.php @@ -1715,4 +1715,5 @@ $SpaceUsedOnSystemCannotBeMeasuredOnWindows = "El espacio usado en el disco no p $XOldTablesDeleted = "%d tablas antiguas eliminadas"; $XOldDatabasesDeleted = "%d bases de datos antiguas eliminadas"; $ExtensionShouldBeLoaded = "Esta extensión debería ser cargada."; +$SearchSessions = "Búsqueda de sesiones"; ?> \ No newline at end of file