Issue Details (XML | Word | Printable)

Key: MDL-13129
Type: Sub-task Sub-task
Status: In Progress In Progress
Priority: Minor Minor
Assignee: Jordi Piguillem Poch
Reporter: Martin Dougiamas
Votes: 0
Watchers: 5
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-20806

add_courses

Created: 24/Jan/08 02:58 PM   Updated: 11/Nov/09 11:10 AM
Return to search
Component/s: Administration
Affects Version/s: 1.9
Fix Version/s: None

Participants: Carlos Alexandre S. da Fonseca, David Castro, Jordi Piguillem Poch and Martin Dougiamas
Security Level: None
Resolved date: 13/Oct/08
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
Add one or more courses provided as an array

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Jordi Piguillem Poch added a comment - 09/Jul/08 07:43 PM
What do you think about this? We forgot about course category....

/**

  • Adds a new course to the course table
  • @private ?
  • @param array $course
  • $course format:
  • <ul>
  • <li>$course[name]</li>
  • <li>$course[shortname]</li>
  • <li>$course[format]</li>
  • <li>$course[idnumber]</li>
  • <li>$course[category]</li>
  • </ul>
  • @return int|boolean new course id or false
    */
    function add_course($course){
    }

/**

  • Adds several new courses to the course table
  • @param array $courses
  • $courses format
  • <ul>
  • <li>$courses[i][name]</li>
  • <li>$courses[i][shortname]</li>
  • <li>$courses[i][format]</li>
  • <li>$courses[i][idnumber]</li>
  • <li>$courses[i][category]</li>
  • </ul>
  • @uses add_course
  • @return array|boolean array containing new courses ids or false
    */
    function add_courses($courses){
    }

Carlos Alexandre S. da Fonseca added a comment - 01/Aug/08 02:04 AM
i think the course category should be passed by unique identifier (id, name), and have functions, like add_course, to course_categories too (I.E. add_course_category, delete_course_category, ... )
If no category parameter not specified, pass to a default category (0) ...

In the function thats remove a course_category, could have a flag(true/false), like cascade, thats set to do a delete cascade, removing all courses with associate couse_categories if it's set to true, the default could be false.


David Castro added a comment - 08/Oct/08 12:28 AM
This funcionality is completed in CVS.
We have commit a simpletest.