Project

General

Profile

Bug #5555

On Documents tool, I see more folder in the menu than in the list on the page

Added by Hubert Borderiou about 7 years ago. Updated over 6 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
Users/Groups
Target version:
Start date:
Due date:
% Done:

100%

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

Description

Hi,
I'm in Document tool.
I've got a menu with the tree of all folders.
I see folders in the menu that doesn't exist in the list on folder and files.
e.g. "Fichiers HotPotatoes" and "Certificats"
I can go in folder "Fichiers HotPotatoes" with the menu.
I can go in folder "Certificats" and I go in tool Assessments even if this tool has been disabled by Admin
See attached.


Files

2012-09-28_1435.png (110 KB) 2012-09-28_1435.png Hubert Borderiou, 28/09/2012 14:43
2012-10-16_1444.png (41.7 KB) 2012-10-16_1444.png Hubert Borderiou, 16/10/2012 14:46
documents_folders.png (110 KB) documents_folders.png Yoselyn Castillo, 29/10/2012 13:53
Sans nom 2.pdf (90.2 KB) Sans nom 2.pdf Hubert Borderiou, 29/10/2012 16:32
document.lib.php (149 KB) document.lib.php Yoselyn Castillo, 30/12/2012 05:49
document.php (55.6 KB) document.php Yoselyn Castillo, 30/12/2012 05:51
document.php (55.7 KB) document.php Yoselyn Castillo, 23/01/2013 16:26
document.php (55.5 KB) document.php Yoselyn Castillo, 23/01/2013 20:08
bug.gif (13.1 KB) bug.gif Yoselyn Castillo, 23/01/2013 20:08
groupmanager.lib.php (74.6 KB) groupmanager.lib.php Yoselyn Castillo, 31/01/2013 15:47

Related issues

Related to Chamilo LMS - Feature #6155: Hide folder [Folders of users] in Documents toolNew21/05/2013

Actions

Associated revisions

Revision 52135886 (diff)
Added by Julio Montoya about 7 years ago

Fixing folder selector see #5555 + removing some comments

Revision 9412426b (diff)
Added by Julio Montoya about 7 years ago

Certificate and hotpotatoes results can't be found in the select folder dir see #5555

Revision 70372545 (diff)
Added by Yoselyn Castillo almost 7 years ago

Fixing bug when creating a folder see #5555

Revision 96ea088d (diff)
Added by Julio Montoya almost 7 years ago

Adding isset see #5555

Revision 06132f12 (diff)
Added by Yoselyn Castillo almost 7 years ago

Fixing bug: On Documents tool, I see more folder in the menu than in the list on the page see #5555

Revision 9d7e4b91 (diff)
Added by Yannick Warnier almost 7 years ago

Minor - avoid using variable when there is only one possibility - refs #5555

Revision 12318503 (diff)
Added by Yoselyn Castillo almost 7 years ago

Fixing document group folders see #5555

Revision d46d0cd4 (diff)
Added by Yoselyn Castillo over 6 years ago

Fixing document folder preview see #5555

Revision e202810a (diff)
Added by Yoselyn Castillo over 6 years ago

Fixed different visiblities of folders in documents - refs #5555

Revision dff60772
Added by Yannick Warnier over 6 years ago

Merge pull request #51 from ycastillo/documents

hidding foder ou users - refs #5555

History

#1

Updated by Julio Montoya about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya
#2

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)
  • % Done changed from 0 to 50

I sent some fixes, requires testing

#3

Updated by Hubert Borderiou about 7 years ago

Hi,
in the version I've tested it, I still see folder "Certificats" and "Fichiers HotPotatoes" at the root Document tool like in "2012-09-28_1435.png"

In a newly 1.9.4 installed version, I still see folder "Fichiers HotPotatoes" in the root Document tool, and in the Group Document Tool, I see folder "Certificats" and subfolders with users (see attached 2012-10-16_1444.png)

#4

Updated by Julio Montoya about 7 years ago

  • % Done changed from 50 to 80

I sent another fix for that

#5

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Needs testing to Assigned

Checking...

#6

Updated by Yoselyn Castillo almost 7 years ago

  • Assignee set to Yoselyn Castillo

checking...

#7

Updated by Yoselyn Castillo almost 7 years ago

It looks fine now, tested in stable.chamilo.org. See the attachment and note there are the same 7 folders in list than in menu. But i think it would be better folders in menu to appear ordered alphabetically.

#8

Updated by Hubert Borderiou almost 7 years ago

Hi,
there are still some strange behaviour in the group document tool
See screecast [[http://screencast.com/t/eI5IWeHYRrdM]]

#9

Updated by Yoselyn Castillo almost 7 years ago

Please, if you can specify which is the strange behavior in the group document tool, i'll be grateful cause i can't see the screencast

#10

Updated by Hubert Borderiou almost 7 years ago

No problem. See attached.

#11

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Yoselyn Castillo)
#12

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Needs testing to Assigned

Checking the described problem...

#13

Updated by Yoselyn Castillo almost 7 years ago

  • Assignee set to Yoselyn Castillo
#14

Updated by Yoselyn Castillo almost 7 years ago

I confirm the bug in groups document tool. Fixing...

#15

Updated by Yoselyn Castillo almost 7 years ago

  • File document.php added
  • Assignee changed from Yoselyn Castillo to Julio Montoya

When you create a folder in document tool inside groups, it always shows folder chat conversatory in the selector. upload this file in order to fix it.

#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

File was added + I added a isset()

#17

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Needs more info to Assigned

Fixed problem redirecting folder when creating a directory in group document tool
There is still a bug when showing all directories in the selector.

#18

Updated by Yoselyn Castillo almost 7 years ago

  • File document.php added
  • File document.lib.php added
  • Assignee changed from Yoselyn Castillo to Julio Montoya

I have made some fixes in order to hide documents for non users of a group and folders of users in the build_selector.

#19

Updated by Julio Montoya almost 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)

File was sent

#20

Updated by Yannick Warnier almost 7 years ago

  • Category set to Users/Groups
  • Status changed from Needs testing to Assigned
  • Assignee set to Yoselyn Castillo

OK... in http://support.chamilo.org/projects/chamilo-18/repository/revisions/bf4d0d6608b7/diff/main/inc/lib/document.lib.php, I would definitely change line 641 for:

last.to_group_id = 0 AND

(no need to use a variable if we already know we are entering this condition only if $to_group_id == 0.

#21

Updated by Yoselyn Castillo almost 7 years ago

Ok, Yannick, it is true. let me know when it is uploaded for testing it

#22

Updated by Yannick Warnier almost 7 years ago

  • Status changed from Assigned to Needs testing
  • Priority changed from Normal to High

Enviado. Por favor revisar y cerrar si todo está conforme al reporte inicial y la solución planteada. Es importante cerrarla este viernes para poder lanzar la beta.

#23

Updated by Yoselyn Castillo almost 7 years ago

  • Status changed from Needs testing to Needs more info

Well the initial bug is definitively solved.
Folders in list are the same which appear in the page
In group document I have created a new group in a new course, the first time I have entered it always show chat folder and folder of users in the selector, rest of times list of documents are well shown.

In group document I have entered a group in a course created some time ago and the list show repeated folder of group

In brief, in general document tool everything works fine, but in group document tool there is still some bug showing the list. So what should we do? Close the task for the initial bug and report bug in a new one or continue with this one?

#24

Updated by Yoselyn Castillo almost 7 years ago

They should be fixed now. Upload these files

#25

Updated by Yoselyn Castillo almost 7 years ago

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

Updated by Yoselyn Castillo almost 7 years ago

  • File deleted (document.php)
#27

Updated by Yoselyn Castillo almost 7 years ago

  • File deleted (document.php)
#29

Updated by Julio Montoya almost 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee changed from Julio Montoya to Yoselyn Castillo

file was sent

#30

Updated by Yannick Warnier almost 7 years ago

  • Status changed from Needs testing to Bug resolved
  • % Done changed from 80 to 100

Closing them. Feel free to re-open if anything's wrong regarding the initial report.

#31

Updated by Hubert Borderiou over 6 years ago

  • Status changed from Bug resolved to Needs more info
  • Priority changed from High to Normal
  • Target version changed from 1.9.4 to 1.9.6

Hi,
in the fresh 1..9.4 release, a teacher cannot see group documents
Only admin, members of the group or tutors of the group can see documents in a group folder.

I think it is better if teachers can see all documents for all groups, even if they are not members nor tutors of the group.
If you're ok,
it is in file document/document.php
replace line 1020
if (api_get_group_id() 0 || (GroupManager::is_subscribed(api_get_user_id(), api_get_group_id()) || GroupManager :: is_tutor_of_group(api_get_user_id(), api_get_group_id()) || UserManager::is_admin(api_get_user_id()))) {
with
if ($is_allowed_to_edit || api_get_group_id() 0 || (GroupManager::is_subscribed(api_get_user_id(), api_get_group_id()) || GroupManager :: is_tutor_of_group(api_get_user_id(), api_get_group_id()) || UserManager::is_admin(api_get_user_id()))) {

#32

Updated by Yoselyn Castillo over 6 years ago

I have made many tests in order to check who are now allowed to view group documents.
Actually, teachers of the course are allowed to see the documents if they have admin permissions.
I have tested the previous code, for allowing teachers which have not admin permissions and it doesn't work.
So if We want allow any teachers of a course to see group documents we can use function CourseManager::is_course_teacher(). Isn't it?
Please, rectify me if i am wrong.

#33

Updated by Yoselyn Castillo over 6 years ago

This fix allows teachers to see group documents. Please Try it.

#34

Updated by Julio Montoya over 6 years ago

that conditions is not accurated:

$user_info      = api_get_user_info(api_get_user_id());
    $user_status = $user_info['status'];
    if ($user_status == 1 ...

You have to be sure that the current user is the teacher of that course, if the user is a teacher of another course he will have access to other courses.
You can use api_is_allowed_to_edit()

#35

Updated by Yoselyn Castillo over 6 years ago

Ok, So upload these changes.
I have found a bug.
When a teacher is not subscribed to a course, he can enter group.php but it appears a bug. See the bug.gif

#36

Updated by Julio Montoya over 6 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo
  • % Done changed from 100 to 90

I uploaded the file. Yes, I see the image, it's a bug, but I can't reproduce it!

#37

Updated by Yoselyn Castillo over 6 years ago

Confirmed the bug in stable.chamilo.org, I am checking, later i upload the fix

#38

Updated by Yoselyn Castillo over 6 years ago

Upload this...But as i see, when a user is not subscribed to a course, he can access the course with just clicking "Got to the course" button but what tools should he use?. In groups I just have followed the code as it had been implemented.

#39

Updated by Yannick Warnier over 6 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

Please upload it yourself, Yoselyn, so others can test it.

#40

Updated by Yannick Warnier over 6 years ago

  • Status changed from Assigned to Needs testing
  • Assignee changed from Yoselyn Castillo to Hubert Borderiou
  • % Done changed from 90 to 100

Fix by Yoselyn applied. Please review on stable.chamilo.org and let us know.

#41

Updated by Yannick Warnier over 6 years ago

  • Priority changed from Normal to Urgent
  • % Done changed from 100 to 90
#42

Updated by Hubert Borderiou over 6 years ago

Hi,
I've tested it on stable
It is fine for me for folders HotPotatoes and Certificates
I've got just one question :

in tool Document, as a teacher, I see folders :
- Folders of users
- Chat conversations history

The folder "Folders of users" stores other users files when they, for exemple, answer in a forum with an image.
The image is stored in folder "Folder of users" > "Name_of_the_user" in the document tool for teachers.
It is stored on the file system in folder ./document/shared_folder/sf_user_26 (for user id=26)

On 1.9.4, teachers see these users folder in document tool "Folder of users" > "Name_of_the_user"
The folder is reated when a user post a image in a forum, for exemple.
In stable, it is not anymore.
When a student post an image in a forum, it is not visible for teacher in the tool Document, in folder "Folder of users" > "Name_of_the_user"
Teacher don't see anymore student folder in "Document" > "Folder of users"

As for me (and teachers I spoke with about this) it is not a problem.
But in this case, we may hide the folder "Document" > "Folder of users" for anyone.
It is not usefull to display it in the document tool I think (or if you want to display it, it should display student "Folder of users" too, otherwise the name of this folder is not right)

#43

Updated by Yannick Warnier over 6 years ago

  • Status changed from Needs testing to Assigned
  • Assignee changed from Hubert Borderiou to Yoselyn Castillo
  • Priority changed from Urgent to Normal

Yoselyn, please check.

#44

Updated by Yoselyn Castillo over 6 years ago

I have tested, and it is true, an image uploaded by a student in forum is not shown to teachers, but i think it is due the directory in which the image has been saved

#45

Updated by Hubert Borderiou over 6 years ago

This folder is in the filesystem in document/shared_folder, and a sub folder is created for each user that have used it (inserting an image in a forum post, for exemple) e.g. document/shared_folder/sf_user_40601

I don't know if this folder has other utilities that may explain why it is important to display this folder in the teacher document view.

My question is
- do we want to enable teachers to see the folder [Folders of users] in the document tool ?

As far I'm concerned, I think we can hide this folder in the document tool.
If students want to share documents with other users of the course, thay can use Assignements, or Dropbox, or Group document tool.

Another question is
- should we allowed an administrator view in the document tool of a course where an administrator see every documents and folders in a course, for support purpose ?
it could be very usefull, but this is another another question, for another version...

regards,

#46

Updated by Yannick Warnier over 6 years ago

Hi Hubert,
I'm OK with not displaying the folder by default (but this will require a change in the install script, so I'll have to ask you to create a new task for 1.10 for this and link it to this task).

Regarding the other request, I don't really mind, but it is definitely not a priority. You can register it as a new task but don't set any Target version, please (and put a priority = "low").

Thanks.

Yoselyn, I have commented your pull request on Github (https://github.com/chamilo/chamilo-lms/pull/47) because it implies a database change, and we only allow these in major versions.
Please remove the db change, and I'll pull your code (the rest is OK)

#47

Updated by Yannick Warnier over 6 years ago

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

Also available in: Atom PDF