Project

General

Profile

Bug #2238

Filter function in agenda doesnt work...

Added by Olivier CORRE about 9 years ago. Updated over 6 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
Agenda
Target version:
Start date:
10/11/2010
Due date:
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Filtering by group or user doesnt work in agenda.


Files

agenda.lib.php (35 KB) agenda.lib.php Yoselyn Castillo, 03/01/2013 14:33
agenda.inc.php (194 KB) agenda.inc.php Yoselyn Castillo, 03/01/2013 14:33
agenda_js.php (6.6 KB) agenda_js.php Yoselyn Castillo, 03/01/2013 14:33
agenda.ajax.php (4.59 KB) agenda.ajax.php Yoselyn Castillo, 03/01/2013 14:33
all_agenda.png (55.6 KB) all_agenda.png Julio Montoya, 21/01/2013 18:35
month.tpl (18.7 KB) month.tpl Yoselyn Castillo, 23/01/2013 20:16
month.tpl (19.8 KB) month.tpl Yoselyn Castillo, 28/01/2013 18:01
agenda.ajax.php (4.8 KB) agenda.ajax.php Yoselyn Castillo, 28/01/2013 18:01
agenda_js.php (6.61 KB) agenda_js.php Yoselyn Castillo, 28/01/2013 18:01
agenda.inc.php (216 KB) agenda.inc.php Yoselyn Castillo, 28/01/2013 18:01
agenda.lib.php (38.5 KB) agenda.lib.php Yoselyn Castillo, 22/02/2013 18:22

Associated revisions

Revision 0bfaad22 (diff)
Added by Julio Montoya almost 7 years ago

Adding calendar user filter sent by ycastillo see #2238

Revision 22137bb2 (diff)
Added by Julio Montoya almost 7 years ago

Replacing sel_user with user_id adding intval, simplifying function calls see #2238

Revision a2032afc
Added by Yannick Warnier over 6 years ago

Merge branch 'ycastillo-1.9.x.1' into 1.9.x - refs #2238

Revision 15cc0ad4
Added by Yannick Warnier over 6 years ago

Merge pull request #54 from ycastillo/1.9.x.calendar

1.9.x.calendar - refs #2238

Revision f1da2bbe (diff)
Added by jmontoyaa almost 2 years ago

Fix wiki print button see #2238

History

#1

Updated by Julio Montoya almost 9 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"

#2

Updated by Olivier CORRE almost 9 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"

#3

Updated by Yannick Warnier over 8 years ago

I don't really understand why your would like to filter by sender...

#4

Updated by Olivier CORRE over 8 years ago

parce qu'on utilise l'agenda pour le suivi des cours. il est important de pouvoir voir ce que chacque a fait :-)

#5

Updated by Yannick Warnier over 8 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?

#6

Updated by Julio Montoya over 8 years ago

je viens d'envoyer un commit qui doit régler ca (le code d'agenda/calendar est horrible... )

#7

Updated by Yannick Warnier over 7 years ago

  • Target version set to 1.9 Beta
#8

Updated by Yannick Warnier over 7 years ago

  • Target version changed from 1.9 Beta to 1.9 RC1
#9

Updated by Yoselyn Castillo over 7 years ago

  • Assignee set to Yoselyn Castillo
#10

Updated by Yannick Warnier over 7 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.

#11

Updated by Yannick Warnier about 7 years ago

  • Target version changed from 1.9.2 to 1.9.4
#12

Updated by Yannick Warnier almost 7 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

#13

Updated by Yoselyn Castillo almost 7 years ago

Ok, I take this

#14

Updated by Yoselyn Castillo almost 7 years ago

Upload These are the changes for filter. I have a question it should be necessary to filter by groups? These filter by user

#15

Updated by Julio Montoya almost 7 years ago

  • % Done changed from 0 to 70

Waiting for the release of 1.9.4 in order to send this changes

#16

Updated by Julio Montoya almost 7 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:

http://code.google.com/p/chamilo/source/detail?r=6cbea405639a6a03e4881972179a945411a80dd1&name=1.9.x&repo=classic

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" :)

http://code.google.com/p/chamilo/source/detail?r=281ca82e2ad12244eb41dbd460c198bb47af499c&name=1.9.x&repo=classic

#17

Updated by Julio Montoya almost 7 years ago

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.

#18

Updated by Yoselyn Castillo almost 7 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

#19

Updated by Yoselyn Castillo almost 7 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?

#20

Updated by Julio Montoya almost 7 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

#21

Updated by Yoselyn Castillo almost 7 years ago

Yes, you are right, i am fixing it...

#22

Updated by Yoselyn Castillo almost 7 years ago

now, url are fixed,and i have added group filter function. Tell me when you upload the files, because it needs testing

#23

Updated by Yoselyn Castillo almost 7 years ago

  • File deleted (agenda.lib.php)
#24

Updated by Yoselyn Castillo almost 7 years ago

  • File agenda.lib.php added

Other corrections sent

#25

Updated by Yoselyn Castillo almost 7 years ago

  • File deleted (agenda.lib.php)
#26

Updated by Yoselyn Castillo almost 7 years ago

  • File agenda.lib.php added
#28

Updated by Yoselyn Castillo over 6 years ago

  • File deleted (agenda.lib.php)
#29

Updated by Julio Montoya over 6 years ago

I think we really need to use github :)

#30

Updated by Yannick Warnier over 6 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...

#31

Updated by Yannick Warnier over 6 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).

#32

Updated by Yannick Warnier over 6 years ago

Yoselyn? Can you confirm if your changes were pulled?

#33

Updated by Yannick Warnier over 6 years ago

Yoselyn confirmed she's got a patch for this and will send it on Wednesday

#34

Updated by Yoselyn Castillo over 6 years ago

Pull request has been sent

#35

Updated by Julio Montoya over 6 years ago

You should add the URL of the pull request here.

#37

Updated by Julio Montoya over 6 years ago

Julio Montoya wrote:

You should add the URL of the pull request here.

the pull request is:

https://github.com/chamilo/chamilo-lms/pull/28

#38

Updated by Julio Montoya over 6 years ago

  • Status changed from Assigned to Needs more info

I added some comments there

#39

Updated by Yoselyn Castillo over 6 years ago

  • Status changed from Needs more info to Assigned

Sorry the file is not the latest, checking...

#40

Updated by Yoselyn Castillo over 6 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

#41

Updated by Yannick Warnier over 6 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo
  • % Done changed from 70 to 80
It would be good to have the following:
  • 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".
This (latter) will require the declaration of new variables in translate.chamilo.org (put them in trad4all.inc.php):
  • $FilterAll = "Filter: Everyone";
  • $FilterByGroup = "Filter by group";
  • $FilterByUser = "Filter by user";
#42

Updated by Yoselyn Castillo over 6 years ago

Styles changes https://github.com/chamilo/chamilo-lms/pull/54
lang vars were added to translate.chamilo.org

#43

Updated by Yannick Warnier over 6 years ago

  • Status changed from Assigned to Bug resolved
  • % Done changed from 80 to 100

OK for me

Also available in: Atom PDF