public function add() { $result = parent::add(); $result = $result && field_data::set_for_context_from_datarecord('curriculum', $this); return $result; }
public function add() { $result = parent::add(); if (isset($this->curriculum)) { $this->add_course_to_curricula($this->curriculum); } // Add moodle course template if (isset($this->location)) { $template = new coursetemplate($this->id); $template->location = $this->location; $template->templateclass = $this->templateclass; $template->courseid = $this->id; $template->data_update_record(true); } else { coursetemplate::delete_for_course($this->id); } $result = $result && field_data::set_for_context_from_datarecord('course', $this); return $result; }
function add() { // figure out the right depth for the cluster if (!isset($this->depth) || !$this->depth) { if ($this->parent == 0) { $this->depth = 1; } else { $parent = new cluster($this->parent); $this->depth = $parent->depth + 1; } } $result = parent::add(); $plugins = cluster::get_plugins(); foreach ($plugins as $plugin) { require_once CURMAN_DIRLOCATION . '/cluster/' . $plugin . '/lib.php'; call_user_func('cluster_' . $plugin . '_update', $this); } $result = $result && field_data::set_for_context_from_datarecord('cluster', $this); //signal that the cluster was created events_trigger('crlm_cluster_created', $this); return $result; }
public function add() { $status = parent::add(); if ($this->moodlecourseid || $this->autocreate) { moodle_attach_class($this->id, $this->moodlecourseid, '', true, true, $this->autocreate); } $status = $status && field_data::set_for_context_from_datarecord('class', $this); return $status; }
public function add() { $status = parent::add(); if ($status && $this->autocreate) { $this->track_auto_create(); } $status = $status && field_data::set_for_context_from_datarecord('track', $this); return $status; }
/** * * @global <type> $CURMAN */ public function add() { global $CURMAN; if (empty($this->position)) { //SELECT MIN(userid) FROM eli_crlm_wait_list WHERE 1 $sql = 'SELECT ' . sql_max('position') . ' as max FROM ' . $CURMAN->db->prefix_table(WATLSTTABLE) . ' as wl WHERE wl.classid = ' . $this->classid; $max_record = get_record_sql($sql); $max = $max_record->max; $this->position = $max + 1; } $subject = get_string('waitlist', 'block_curr_admin'); $cmclass = new cmclass($this->classid); $message = get_string('added_to_waitlist_message', 'block_curr_admin', $cmclass->idnumber); $user = cm_get_moodleuser($this->userid); $from = get_admin(); // Send a notification and e-mail only if the Moodle user exists if ($user != null) { notification::notify($message, $user, $from); email_to_user($user, $from, $subject, $message); } parent::add(); }
function add() { parent::add(); events_trigger('crlm_curriculum_course_associated', $this); }