Bug #2238
Filter function in agenda doesnt work...
Description
Filtering by group or user doesnt work in agenda.
Files
Associated revisions
Replacing sel_user with user_id adding intval, simplifying function calls see #2238
Merge branch 'ycastillo-1.9.x.1' into 1.9.x - refs #2238
Fix wiki print button see #2238
History
Updated by Julio Montoya about 10 years ago
- Status changed from New to Needs more info
It filters by the users that receive the message not by the sender. It works when I test it.
We should change the label to "Filter by sender" or "Filter by destination user"
Updated by Olivier CORRE about 10 years ago
Ok, I see.
Anyways to filter by user (sender).
Julio Montoya wrote:
It filters by the users that receive the message not by the sender. It works when I test it.
We should change the label to "Filter by sender" or "Filter by destination user"
Updated by Yannick Warnier almost 10 years ago
I don't really understand why your would like to filter by sender...
Updated by Olivier CORRE almost 10 years ago
parce qu'on utilise l'agenda pour le suivi des cours. il est important de pouvoir voir ce que chacque a fait :-)
Updated by Yannick Warnier almost 10 years ago
Donc l'objectif c'est de filtrer par utilisateur qui a enregistré un évènement, ou de classer par cours?
Est-ce qu'on parle d'utilisateurs professeurs ou d'utilisateurs étudiants? (dans le dernier cas ça implique déjà d'avoir permis aux étudiants d'ajouter des évènements dans le cours).
Est-ce que ça devrait être permis au niveau de l'agenda global?
Updated by Julio Montoya almost 10 years ago
je viens d'envoyer un commit qui doit régler ca (le code d'agenda/calendar est horrible... )
Updated by Yannick Warnier over 8 years ago
- Assignee changed from Yoselyn Castillo to Olivier CORRE
- Target version changed from 1.9 RC1 to 1.9.2
Seems like we lost completely the ability to filter events by anything else than a date now.
Olivier, could you update us (with a screenshot, maybe) about the filtering options that you need? Moving this to 1.9.2 at least.
Updated by Yannick Warnier about 8 years ago
- Status changed from Needs more info to Assigned
- Assignee changed from Olivier CORRE to Yoselyn Castillo
- Target version changed from 1.9.4 to 1.9.6
OK, refreshing this task now.
There should be an option for the admin to filter by destination user or destination group inside the course agenda tool.
The generic tool possibly includes too many events to be able to filter by user or group, but the course tool should offer a select list saying "Filter by destination:" and give a list of groups and users, just left of the "Import iCal" icon.
Just like the one you get when creating an event: main/calendar/agenda.php?cidReq=ABC&id_session=0&gidReq=0&sort=asc&toolgroup=0&action=add
Updated by Yoselyn Castillo about 8 years ago
- File agenda.lib.php agenda.lib.php added
- File agenda.inc.php agenda.inc.php added
- File agenda_js.php agenda_js.php added
- File agenda.ajax.php agenda.ajax.php added
- Assignee changed from Yoselyn Castillo to Julio Montoya
Upload These are the changes for filter. I have a question it should be necessary to filter by groups? These filter by user
Updated by Julio Montoya about 8 years ago
- % Done changed from 0 to 70
Waiting for the release of 1.9.4 in order to send this changes
Updated by Julio Montoya about 8 years ago
- Status changed from Assigned to Needs more info
- Assignee changed from Julio Montoya to Yoselyn Castillo
I found many problems with your changes please be careful next time:
You can put your js code inside the "$(document).ready()" or "$(function()" both jquery functions are the same (function() is a shorcut of ready).
In the construct_to_select_form() be very careful with HTML tags, you did this:
function construct_to_select_form($group_list = null, $user_list = null, $filter = 0) { $result = '<form style="float:right;"><select data-placeholder="'.get_lang('Select').'name="sel_to" class="chzn-select" id="selected_form_id"></form>'; // adding the groups to the select form $result .= '<option value=0>'.get_lang('Everyone').'</option>'; // adding the individual users to the select form if (!empty($user_list)) { $result .= '<optgroup label="'.get_lang('Users').'">'; foreach ($user_list as $this_user) { $username = api_htmlentities(sprintf(get_lang('LoginX'), $this_user['username']), ENT_QUOTES); $user_info = api_get_person_name($this_user['firstname'], $this_user['lastname']).' ('.$this_user['username'].')'; $selected = $this_user['user_id'] == $filter ? "selected" : null; $result .= "<option title='$username' value=".$this_user['user_id']." ".$selected.">$user_info.</option>"; } $result .= "</optgroup>"; } $result .= "</select>"; return $result; }
You forgot to close the "data-placeholder" attribute and the "</form>" tag should be at the end of the form.
You should try to use the UI of bootstrap instead of recreating a new interface like adding a <div style="width:380px;"> you could use <form class"form-search">
You can check those divs here:
http://twitter.github.com/bootstrap/base-css.html#forms
I sent my changes here:
Don't forget to add intval() when you get a variable from the user($_POST, $_GET, $_REQUEST) and also is more clear to declared a variable with "$user_id" instead of "$sel_user" in French "sel" is "salt", so is funny to read "sel user" :)
Updated by Julio Montoya about 8 years ago
- File all_agenda.png all_agenda.png added
I found a bug: when I select a user I can create an event to other users:
so after adding a message to another user the calendar is updated but it has the user filter so I see nothing. I have to select Everyone then I will see my event.
Updated by Yoselyn Castillo about 8 years ago
Sorry for those things which i forgot, I know this code has to be improved, but i really wanted to know if the filter worked. Later i will upload all changes
Updated by Yoselyn Castillo about 8 years ago
The solution i have found is to update the filter to the user which is the receiver of the new event created once the dialog is closed. Like this What do you think?
Updated by Julio Montoya about 8 years ago
If you select diferent users the URL will be start to grow after adding some messages i have this url. When selecting a group as a destination I have this "&user_id=:1"
/agenda_js.php?type=course&user_id=303&user_id=235&user_id=311&user_id=13,USER:303,USER:338,USER:282&user_id=:1&user_id=:1
Updated by Yoselyn Castillo almost 8 years ago
- File month.tpl month.tpl added
- File agenda.ajax.php agenda.ajax.php added
- File agenda_js.php agenda_js.php added
- File agenda.lib.php added
- File agenda.inc.php agenda.inc.php added
- Assignee changed from Yoselyn Castillo to Julio Montoya
now, url are fixed,and i have added group filter function. Tell me when you upload the files, because it needs testing
Updated by Yannick Warnier almost 8 years ago
- Category set to Agenda
Julio, did you send these in the end? You didn't say. I sure does seem like there is a difference between the files sent by Yoselyn and the current ones, but I'm not sure if nobody else has worked on these since then...
Updated by Yannick Warnier almost 8 years ago
- Assignee changed from Julio Montoya to Yoselyn Castillo
Yoselyn, please check that the Github repository contains your changes. Otherwise send them now (make sure you don't overwrite any other, unrelated, code when you do that).
Updated by Yannick Warnier over 7 years ago
Yoselyn? Can you confirm if your changes were pulled?
Updated by Yannick Warnier over 7 years ago
Yoselyn confirmed she's got a patch for this and will send it on Wednesday
Updated by Yoselyn Castillo over 7 years ago
Updated by Julio Montoya over 7 years ago
Julio Montoya wrote:
You should add the URL of the pull request here.
the pull request is:
Updated by Julio Montoya over 7 years ago
- Status changed from Assigned to Needs more info
I added some comments there
Updated by Yoselyn Castillo over 7 years ago
- Status changed from Needs more info to Assigned
Sorry the file is not the latest, checking...
Updated by Yoselyn Castillo over 7 years ago
- Assignee changed from Yoselyn Castillo to Julio Montoya
The correct pull request has been sent:
https://github.com/chamilo/chamilo-lms/pull/42
Please, check it as soon as possible, locally this filter works ok
Updated by Yannick Warnier over 7 years ago
- Assignee changed from Julio Montoya to Yoselyn Castillo
- % Done changed from 70 to 80
- lower the box a little - so far it is just a bit above the top border of the icons, in Firefox. I tested with a margin-top in the "action .form {" of base.css and it looks better. Check in Chrome and send to git.
- the texts shown in the dropbox are not helping to understand that it is a filter. Instead of (in Spanish) "Todos", "Grupos" and "Usuarios", it should say "Filtro: Todos", "Filtrar por grupo" and "Filtrar por usuario".
- $FilterAll = "Filter: Everyone";
- $FilterByGroup = "Filter by group";
- $FilterByUser = "Filter by user";
Updated by Yoselyn Castillo over 7 years ago
Styles changes https://github.com/chamilo/chamilo-lms/pull/54
lang vars were added to translate.chamilo.org
Updated by Yannick Warnier over 7 years ago
- Status changed from Assigned to Bug resolved
- % Done changed from 80 to 100
OK for me
Adding calendar user filter sent by ycastillo see #2238