/** * Deletes a form element and any items that it may have * * @param int $reportfield_id the id of the reportfield */ public function delete_form_element($reportfield_id) { //get the record for the field $pluginrecord = $this->dbc->get_form_element_by_reportfield($this->tablename, $reportfield_id); if (!empty($this->items_tablename)) { //delete all items for the field then delete the field itself by calling the function in the //parent class $this->dbc->delete_items($this->items_tablename, $pluginrecord->id); } //also delete any submitted data - it'll survive in ghostly form in the log table $this->dbc->delete_items($this->data_entry_tablename, $pluginrecord->id); $reportfield = $this->dbc->get_report_field_data($reportfield_id); $extraparams = array('audit_type' => $this->audit_type(), 'label' => $reportfield->label, 'description' => $reportfield->description, 'id' => $reportfield_id); return parent::delete_form_element($this->tablename, $reportfield_id, $extraparams); }
/** * Delete a form element */ public function delete_form_element($reportfield_id) { return parent::delete_form_element($this->tablename, $reportfield_id); }
public function delete_form_element($reportfield_id) { $reportfield = $this->dbc->get_report_field_data($reportfield_id); $extraparams = array('audit_type' => $this->audit_type(), 'label' => $reportfield->label, 'description' => $reportfield->description, 'id' => $reportfield_id); return parent::delete_form_element($this->tablename, $reportfield_id, $extraparams); }