Moodle

The form to add a new course category is ridiculously large and in the way

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Component/s: Course
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

On the page to edit courses, there is a massive new form to add a new category.

It used to be very small because it didn't have a description, but now it makes that page unusable.

Can you create small separate script to do that job, something like course/editcategory.php and link to if from the bottom of the course editing page with a single button that says "Add a sub-category" (that string already exists).

At the same time, add a new little "hand" edit icon next to the description when it is shown in editing mode ... this should go to the same form so that people can EDIT the category description again at a later date (currently this is not possible!)

Thanks.

Issue Links

Activity

Hide
Martin Dougiamas added a comment - - edited

Oh, and the "category theme" setting can also go on that new form.

And the name of the category itself.

That should simplify this course listing a lot.

Show
Martin Dougiamas added a comment - - edited Oh, and the "category theme" setting can also go on that new form. And the name of the category itself. That should simplify this course listing a lot.
Hide
Nicolas Connault added a comment -

I understand the need to remove that form from the course add/edit page, but why create a new script for that? There is already category.php?categoryedit=on

Show
Nicolas Connault added a comment - I understand the need to remove that form from the course add/edit page, but why create a new script for that? There is already category.php?categoryedit=on
Hide
Nicolas Connault added a comment - - edited

What a confusing section of the admin!

Admin -> Click on "Add/edit courses" -> course/index.php?categoryedit=on

  • "Add new category" form
  • List of categories

-> Click on a category name -> course/category.php?id=$categoryid&categoryedit=on

With this kind of URL I could expect to have a form allowing me to edit the category I just clicked
on (from the previous page's list of categories). What I see is indeed a category form, but with empty fields!
The reason is that this is a form for adding a subcategory to the selected category.

Also on this page is a list of courses within the selected category. I can delete them,
move them around, and there's even a button for adding a new course.

BUT

No way to edit the category! I can't even see the current category's name or description
anywhere except in the category selection drop-down at the top.

So, I propose the following:
1. Split Category editing from Course editing: each has its own entry in the admin menu
2. As prescribed by Martin in this issue, remove the "Add category" form completely from the courses edit page (course/index.php)
3. Create a new page for creating new categories and sub-categories
a. Drop-down for selecting the parent category (no parent if creating a top-level category).
b. This page will also be used as the "Edit category" page, when a id parameter is given, and
c. Selecting a different parent when in edit mode will simply move the category.
d. If parentid is given to the URL, it will pre-select the parent category in "add" mode. This way this page can easily be linked to from
category lists
e. This category add/edit page DOES NOT include a list of courses, but has a simple link to a page with such a list (with edit icons etc.)
4. In the courses edit set of pages, categories will appear as currently, but there will be no more information than their name and links to a listing of their children (categories or courses). Whenever a category name appears and editing is switched on, a hand icon will appear, linking to the category edit page described in step 3

Show
Nicolas Connault added a comment - - edited What a confusing section of the admin! Admin -> Click on "Add/edit courses" -> course/index.php?categoryedit=on
  • "Add new category" form
  • List of categories
-> Click on a category name -> course/category.php?id=$categoryid&categoryedit=on With this kind of URL I could expect to have a form allowing me to edit the category I just clicked on (from the previous page's list of categories). What I see is indeed a category form, but with empty fields! The reason is that this is a form for adding a subcategory to the selected category. Also on this page is a list of courses within the selected category. I can delete them, move them around, and there's even a button for adding a new course. BUT No way to edit the category! I can't even see the current category's name or description anywhere except in the category selection drop-down at the top. So, I propose the following: 1. Split Category editing from Course editing: each has its own entry in the admin menu 2. As prescribed by Martin in this issue, remove the "Add category" form completely from the courses edit page (course/index.php) 3. Create a new page for creating new categories and sub-categories a. Drop-down for selecting the parent category (no parent if creating a top-level category). b. This page will also be used as the "Edit category" page, when a id parameter is given, and c. Selecting a different parent when in edit mode will simply move the category. d. If parentid is given to the URL, it will pre-select the parent category in "add" mode. This way this page can easily be linked to from category lists e. This category add/edit page DOES NOT include a list of courses, but has a simple link to a page with such a list (with edit icons etc.) 4. In the courses edit set of pages, categories will appear as currently, but there will be no more information than their name and links to a listing of their children (categories or courses). Whenever a category name appears and editing is switched on, a hand icon will appear, linking to the category edit page described in step 3
Hide
Martin Dougiamas added a comment -

Yes, the two pages are still going to be sort of entwined, with links back and forth.

The plan sounds pretty OK, please implement it ASAP.

Show
Martin Dougiamas added a comment - Yes, the two pages are still going to be sort of entwined, with links back and forth. The plan sounds pretty OK, please implement it ASAP.
Hide
Nicolas Connault added a comment -

This is a detail of the plan I am implementing:

COURSE ADMIN

Currently:

1. Add/Edit courses (course/index.php?categoryedit=on)
a. Form: Add new category
b. List of course categories
c. Edit mode:

  • On: Move/Delete/Hide categories
  • Off: BUG-> exits admin panel, totally different page

2. Click on a category (course/category.php?id=#&categoryedit=on)
a. Drop-down list of categories (current is selected)
b. List of sub-categories (links to course/category.php?id=#)
c. Form: Add a sub-category
d. List of courses
e. Edit mode:

  • On: Move/Edit/Delete/Assign_Roles/Hide/Backup/Restore courses + action on multiple selected courses
  • Off: BUG-> exits admin panel, although same page without above options
    f. Button: Re-sort courses by name
    g. Button: Add a new course
    h. Form: Rename category
    i. Form: Search courses

New:

1. Add/Edit courses (course/index.php?categoryedit=on)
a. List of course categories with count of courses in each
b. Edit mode:

  • On: Edit icon next to each category, goes to category admin
  • Off: no icons

2. Click on a category
a. Category Title
b. Drop-down list of categories (current is selected)
c. List of sub-categories (with count of courses)
c. List of courses
d. Edit mode:

  • On:
  • Move/Edit/Delete/Assign_Roles/Hide/Backup/Restore courses + action on multiple selected courses
  • Edit categories (goes to category admin)
  • Off: Plain list of courses, no icons, but links to sub-cats
    e. Button: Re-sort courses by name
    f. Button: Add a new course
    g. Form: Search courses

CATEGORY ADMIN

Currently:

Nothing

New:

1. Add/Edit categories (Top-level category, cannot have courses)
a. List of course categories
b. Edit mode:

  • On: Move/Delete/Hide categories
  • Off: Plain list of categories, no forms, no icons
    c. Button: Create new category

2. Click on a category name (lower-level categories, can have courses and categories)
a. Category Title
b. Drop-down list of categories (current is selected)
c. List of sub-categories
d. Button: Create new category
e. Edit mode:

  • On: Move/Delete/Hide categories
  • Off: Plain list of categories, no forms, no icons
    f. Link to course admin for that category (View # courses in this category)

3. Click on Edit category (hand icon)
a. Form: Edit category (name and description)

  • Same as add category form, but with fields pre-filled
  • Changing parent moves the category to the new parent

4. Click on Create new category (button)
a. Form: new category

  • Element: parent: Drop-down of parent categories to choose from, pre-selected to the category from which the button was clicked, if any (so, on first page of category admin, the site would be the selected parent).
  • Element: name
  • Element: description
  • Element: submit
Show
Nicolas Connault added a comment - This is a detail of the plan I am implementing: COURSE ADMIN Currently: 1. Add/Edit courses (course/index.php?categoryedit=on) a. Form: Add new category b. List of course categories c. Edit mode:
  • On: Move/Delete/Hide categories
  • Off: BUG-> exits admin panel, totally different page
2. Click on a category (course/category.php?id=#&categoryedit=on) a. Drop-down list of categories (current is selected) b. List of sub-categories (links to course/category.php?id=#) c. Form: Add a sub-category d. List of courses e. Edit mode:
  • On: Move/Edit/Delete/Assign_Roles/Hide/Backup/Restore courses + action on multiple selected courses
  • Off: BUG-> exits admin panel, although same page without above options f. Button: Re-sort courses by name g. Button: Add a new course h. Form: Rename category i. Form: Search courses
New: 1. Add/Edit courses (course/index.php?categoryedit=on) a. List of course categories with count of courses in each b. Edit mode:
  • On: Edit icon next to each category, goes to category admin
  • Off: no icons
2. Click on a category a. Category Title b. Drop-down list of categories (current is selected) c. List of sub-categories (with count of courses) c. List of courses d. Edit mode:
  • On:
  • Move/Edit/Delete/Assign_Roles/Hide/Backup/Restore courses + action on multiple selected courses
  • Edit categories (goes to category admin)
  • Off: Plain list of courses, no icons, but links to sub-cats e. Button: Re-sort courses by name f. Button: Add a new course g. Form: Search courses
CATEGORY ADMIN Currently: Nothing New: 1. Add/Edit categories (Top-level category, cannot have courses) a. List of course categories b. Edit mode:
  • On: Move/Delete/Hide categories
  • Off: Plain list of categories, no forms, no icons c. Button: Create new category
2. Click on a category name (lower-level categories, can have courses and categories) a. Category Title b. Drop-down list of categories (current is selected) c. List of sub-categories d. Button: Create new category e. Edit mode:
  • On: Move/Delete/Hide categories
  • Off: Plain list of categories, no forms, no icons f. Link to course admin for that category (View # courses in this category)
3. Click on Edit category (hand icon) a. Form: Edit category (name and description)
  • Same as add category form, but with fields pre-filled
  • Changing parent moves the category to the new parent
4. Click on Create new category (button) a. Form: new category
  • Element: parent: Drop-down of parent categories to choose from, pre-selected to the category from which the button was clicked, if any (so, on first page of category admin, the site would be the selected parent).
  • Element: name
  • Element: description
  • Element: submit
Hide
Nicolas Connault added a comment -

MDL-11543 Temporary solution originally proposed by Martin

Show
Nicolas Connault added a comment - MDL-11543 Temporary solution originally proposed by Martin
Hide
Matt Campbell added a comment -

Using Moodle 1.9 Beta + (2007100805)

The button for adding a sub-category in index.php and category.php both point to editcategory.php, get the following error:

The requested URL /course/editcategory.php was not found on this server.

I don't seem to have a /course/editcategory.php.

Show
Matt Campbell added a comment - Using Moodle 1.9 Beta + (2007100805) The button for adding a sub-category in index.php and category.php both point to editcategory.php, get the following error: The requested URL /course/editcategory.php was not found on this server. I don't seem to have a /course/editcategory.php.
Hide
Matt Campbell added a comment -

Also, with latest changes, how can I edit existing sub-category descriptions? Need to have some sort of link - perhaps a settings icon in the sub-category list?

Show
Matt Campbell added a comment - Also, with latest changes, how can I edit existing sub-category descriptions? Need to have some sort of link - perhaps a settings icon in the sub-category list?
Hide
Nicolas Martignoni added a comment -

Confirming above comment from Matt: the file "course/editcategory.php" doesn't exist, causing a 404 error.

Show
Nicolas Martignoni added a comment - Confirming above comment from Matt: the file "course/editcategory.php" doesn't exist, causing a 404 error.
Hide
Nicolas Martignoni added a comment -

I have verified that the issue raised by Matt ("course/editcategory.php" doesn't exist, causing a 404 error) is now fixed.

Show
Nicolas Martignoni added a comment - I have verified that the issue raised by Matt ("course/editcategory.php" doesn't exist, causing a 404 error) is now fixed.
Hide
Martin Dougiamas added a comment -

Nicolas C, there are some major things not finished yet:

1) When adding a new category on test.moodle.com I see the form but submitting it gives:

"You must provide either an id or the categoryadd switch"

2) As Matt pointed out, there needs to be a link from current categories to edit them.

3) The old mini-forms to
a) change the name of the current category
b) force the category theme for a category

can be removed now, as it's on the main category edit form.

Show
Martin Dougiamas added a comment - Nicolas C, there are some major things not finished yet: 1) When adding a new category on test.moodle.com I see the form but submitting it gives: "You must provide either an id or the categoryadd switch" 2) As Matt pointed out, there needs to be a link from current categories to edit them. 3) The old mini-forms to a) change the name of the current category b) force the category theme for a category can be removed now, as it's on the main category edit form.
Hide
Martin Dougiamas added a comment -

I've actually just fixed 2 and 3. 1 still needs to be fixed.

Show
Martin Dougiamas added a comment - I've actually just fixed 2 and 3. 1 still needs to be fixed.
Hide
Nicolas Connault added a comment -

I've tried adding new category at top-level and sub-categories at lower levels, it all works fine...

Show
Nicolas Connault added a comment - I've tried adding new category at top-level and sub-categories at lower levels, it all works fine...
Hide
Nicolas Connault added a comment -

Looking good!

Show
Nicolas Connault added a comment - Looking good!
Hide
Ralf Hilgenstock added a comment -

Great!!

In edit mode the category description is invisble. You have to 'Turn editing off' to see the description.

Show
Ralf Hilgenstock added a comment - Great!! In edit mode the category description is invisble. You have to 'Turn editing off' to see the description.
Hide
Ralf Hilgenstock added a comment -

Reopen because description isn ot visible in edit mode (version: 2007100903)

Show
Ralf Hilgenstock added a comment - Reopen because description isn ot visible in edit mode (version: 2007100903)
Hide
Martin Dougiamas added a comment -

I removed that intentionally.

It was taking up a lot of room there, especially when you might be loading and reloading that page moving courses around etc. I think it also complicated the page a lot ...

Show
Martin Dougiamas added a comment - I removed that intentionally. It was taking up a lot of room there, especially when you might be loading and reloading that page moving courses around etc. I think it also complicated the page a lot ...
Hide
Matt Campbell added a comment -

Could you add a dropdown for visibility to edit_categoryform.php? While it works just fine to do this from the list of all categories, it would be nice to be able to set this when updating or creating a new category.

Show
Matt Campbell added a comment - Could you add a dropdown for visibility to edit_categoryform.php? While it works just fine to do this from the list of all categories, it would be nice to be able to set this when updating or creating a new category.
Hide
Matt Campbell added a comment -

Closing this issue.

Show
Matt Campbell added a comment - Closing this issue.

Dates

  • Created:
    Updated:
    Resolved: