/**
  * Specifies available report filters
  * (allow for filtering on various user and cluster-related fields)
  *
  * @return  generalized_filter_entry array  The list of available filters
  * @uses $CFG
  */
 function get_filters()
 {
     global $CFG;
     //cluster tree
     $enable_tree_label = get_string('enable_tree', $this->languagefile);
     $enable_dropdown_label = get_string('enable_dropdown', $this->languagefile);
     $help_label = get_string('cluster_help', $this->languagefile);
     $clustertree_help = array('user_class_completion_cluster_help', $help_label, 'block_php_report');
     $clustertree_options = array('dropdown_button_text' => $enable_tree_label, 'tree_button_text' => $enable_dropdown_label, 'report_id' => $this->id, 'report_shortname' => 'user_class_completion', 'help' => $clustertree_help, 'fieldset' => false, 'filter_on_user_records' => true);
     //completionstatus checkboxes
     $complete_key = STUSTATUS_PASSED . ',' . STUSTATUS_FAILED;
     $incomplete_key = STUSTATUS_NOTCOMPLETE . ',NULL';
     $completed_courses_label = get_string('show_completed_classes', $this->languagefile);
     $incomplete_courses_label = get_string('show_incomplete_classes', $this->languagefile);
     $heading_label = get_string('completionstatus_options_heading', $this->languagefile);
     $choices = array($complete_key => $completed_courses_label, $incomplete_key => $incomplete_courses_label);
     $checked = array($complete_key, $incomplete_key);
     $completionstatus_options = array('choices' => $choices, 'checked' => $checked, 'numeric' => true, 'nullvalue' => 'NULL', 'isrequired' => false, 'heading' => $heading_label);
     //columns checkboxes
     $curriculum_label = get_string('report_field_curriculum', $this->languagefile);
     $status_label = get_string('report_field_status', $this->languagefile);
     $completion_label = get_string('report_field_completion', $this->languagefile);
     $heading_label = get_string('report_fields_heading', $this->languagefile);
     $choices = array('curriculum' => $curriculum_label, 'status' => $status_label, 'completion' => $completion_label);
     $checked = array('curriculum', 'status', 'completion');
     $columns_options = array('choices' => $choices, 'checked' => $checked, 'allowempty' => true, 'heading' => $heading_label);
     //setup for the completion status dropdown
     $completionstatus_choices = array(STUSTATUS_PASSED => get_string('status_passed', $this->languagefile), STUSTATUS_FAILED => get_string('status_failed', $this->languagefile), STUSTATUS_NOTCOMPLETE => get_string('status_notcomplete', $this->languagefile), user_class_completion_details_report::STUSTATUS_NOTSTARTED => get_string('status_notstarted', $this->languagefile));
     $completionstatus_options = array('choices' => $completionstatus_choices, 'numeric' => true, 'help' => array('user_class_completion_completionstatus_help', get_string('completion_status', 'block_curr_admin'), 'block_php_report'));
     $userfilter = new generalized_filter_elisuserprofile('filter_up_', get_string('filter_user_match', $this->languagefile), array('choices' => $this->_user_fields, 'notadvanced' => array('fullname'), 'extra' => true, 'help' => array('up' => array('fullname' => array('user_class_completion_fullname_help', get_string('fullname'), 'block_php_report'), 'lastname' => array('user_class_completion_lastname_help', get_string('lastname'), 'block_php_report'), 'firstname' => array('user_class_completion_firstname_help', get_string('firstname'), 'block_php_report'), 'idnumber' => array('user_class_completion_idnumber_help', get_string('idnumber'), 'block_php_report'), 'email' => array('user_class_completion_email_help', get_string('email'), 'block_php_report'), 'city' => array('user_class_completion_city_help', get_string('city'), 'block_php_report'), 'country' => array('user_class_completion_country_help', get_string('country'), 'block_php_report'), 'username' => array('user_class_completion_username_help', get_string('username'), 'block_php_report'), 'language' => array('user_class_completion_language_help', get_string('language'), 'block_php_report'), 'inactive' => array('user_class_completion_inactive_help', get_string('inactive'), 'block_php_report'))), 'outerfield' => array('up' => 'u.id')));
     $classfilter = new generalized_filter_curriculumclass('filter-ccc-', get_string('filter_curriculumclass', $this->languagefile), array('choices' => $this->_curriculumclass_fields, 'notadvanced' => array('curriculum' => array('name'), 'course' => array('name'), 'class' => array('idnumber')), 'extra' => true, 'help' => array('curriculum' => array('name' => array('user_class_completion_curriculum_help', get_string('curriculum', 'block_curr_admin'), 'block_php_report')), 'course' => array('name' => array('user_class_completion_course_help', get_string('course', 'block_curr_admin'), 'block_php_report')), 'class' => array('idnumber' => array('user_class_completion_class_help', get_string('c', 'block_curr_admin'), 'block_php_report'), 'environmentid' => array('user_class_completion_environment_help', get_string('environment', 'block_curr_admin'), 'block_php_report'), 'startdate' => array('user_class_completion_startdate_help', get_string('startdate', 'block_curr_admin'), 'block_php_report'))), 'wrapper' => array('curriculum' => '', 'course' => " INNER JOIN {$CFG->prefix}crlm_class_enrolment clse" . " ON clse.classid = cls.id", 'class' => " INNER JOIN {$CFG->prefix}crlm_class_enrolment clse" . " ON clse.classid = cls.id"), 'innerfield' => array('curriculum' => 'cca.userid', 'course' => 'clse.userid', 'class' => 'clse.userid'), 'outerfield' => array('curriculum' => 'u.id', 'course' => 'u.id', 'class' => 'u.id')));
     $titleoptions = array('help' => array('report_title', get_string('report_title', $this->languagefile), 'block_php_report'));
     $summarycoloptions = array('title' => 'summary_report_fields', 'name' => 'summary_fields', 'lang' => $this->languagefile, 'help' => 'user_class_completion_summarydatafields_help', 'fields' => array('userfields' => array('user_address' => 'address', 'user_city' => 'city', 'user_state' => 'state', 'user_email' => 'email', 'custom' => array('user' => 'all')), 'curriculumfields' => array('cur_name' => 'curriculum', 'cur_timecompleted' => 'curriculumcompletiondate', 'cur_timeexpired' => 'curriculumexpirationdate', 'cur_certificate' => 'certificatenumber', 'custom' => array('curriculum' => 'all'))));
     $detailheadoptions = array('title' => 'detail_head_fields', 'name' => 'detail_headers', 'lang' => $this->languagefile, 'help' => 'user_class_completion_detailheaderfields_help', 'fields' => array('userfields' => array('user_address' => 'address', 'user_city' => 'city', 'user_state' => 'state', 'user_email' => 'email', 'custom' => array('user' => 'all'))));
     $detailcoloptions = array('title' => 'detail_col_fields', 'name' => 'detail_fields', 'lang' => $this->languagefile, 'help' => 'user_class_completion_detaildatafields_help', 'fields' => array('curriculumfields' => array('cur_name' => 'curriculum', 'custom' => array('curriculum' => 'all')), 'otherfields' => array('class_role' => 'classrole')));
     $filters = $userfilter->get_filters();
     $filters[] = new generalized_filter_entry('filter-uid', 'u', 'id', get_string('filter_cluster', $this->languagefile), false, 'clustertree', $clustertree_options);
     $schemas = array($classfilter, array('completionstatus', 'filter_completionstatus', false, 'nofiltersimpleselect', $completionstatus_options), array('title', 'title', false, 'display_text', $titleoptions), array('summarycolumns', 'summary_columns', false, 'display_table', $summarycoloptions), array('detailheaders', 'detail_headers', false, 'display_table', $detailheadoptions), array('detailcolumns', 'detail_columns', false, 'display_table', $detailcoloptions));
     foreach ($schemas as $schema) {
         if (is_array($schema)) {
             if ($schema[1] == '') {
                 $label = get_string($schema[0]);
             } else {
                 $label = get_string($schema[1], $this->languagefile);
             }
             $filters[] = new generalized_filter_entry('filter-' . $schema[0], '', $schema[0], $label, $schema[2], $schema[3], $schema[4]);
         } else {
             $filters = array_merge($filters, $schema->get_filters());
         }
     }
     //return all filters
     return $filters;
 }
 /**
  * Specifies available report filters
  * (empty by default but can be implemented by child class)
  *
  * @param boolean $initdata If true, signal the report to load the actual content of the filter objects.
  * @uses $DB
  * @return array The list of available filters
  */
 public function get_filters($initdata = true)
 {
     global $DB;
     // Create all requested User Profile field filters.
     $upfilter = new generalized_filter_elisuserprofile(sitewide_time_summary_report::upfilterid, get_string('filter_user_match', $this->langfile), array('choices' => $this->_fields, 'notadvanced' => array('fullname'), 'extra' => true, 'tables' => array('up' => array(user::TABLE => 'crlmu'))));
     $filters = $upfilter->get_filters();
     //  Cluster filter options
     $clusters = $DB->get_records(userset::TABLE, null, 'name ASC', 'id,name');
     if (!empty($clusters)) {
         // Merge cluster filter IFF values exist
         $filters = array_merge($filters, array(new generalized_filter_entry(sitewide_time_summary_report::clusterfilterid, 'crlmu', 'id', get_string('filter_cluster', $this->langfile), false, 'clusterselect', array('default' => null))));
     }
     // Segment filter options
     $segchoices = array('weeks' => get_string('seg_weeks', $this->langfile), 'months' => get_string('seg_months', $this->langfile), 'years' => get_string('seg_years', $this->langfile), 'noseg' => get_string('seg_none', $this->langfile));
     return array_merge($filters, array(new generalized_filter_entry(sitewide_time_summary_report::datefilterid, '', '', get_string('filter_date_range', $this->langfile), false, 'date'), new generalized_filter_entry(sitewide_time_summary_report::segfilterid, '', '', get_string('segmentreportby', $this->langfile), false, 'radiobuttons', array('choices' => $segchoices, 'checked' => sitewide_time_summary_report::defaultseg, 'default' => sitewide_time_summary_report::defaultseg, 'heading' => get_string('segmentreportby', $this->langfile), 'footer' => '<br/>'))));
 }
 /**
  * Specifies available report filters
  * (allow for filtering on various user and cluster-related fields)
  *
  * @param   boolean  $init_data  If true, signal the report to load the
  *                               actual content of the filter objects
  * @return  generalized_filter_entry array  The list of available filters
  * @uses $CFG
  */
 function get_filters($init_data = true)
 {
     global $CFG, $USER;
     require_once $CFG->dirroot . '/local/elisprogram/accesslib.php';
     //cluster tree
     $enable_tree_label = $this->get_string('enable_tree');
     $enable_dropdown_label = $this->get_string('enable_dropdown');
     $help_label = $this->get_string('cluster_help');
     $clustertree_help = array('user_class_completion_cluster', $help_label, $this->get_langfile());
     $clustertree_options = array('dropdown_button_text' => $enable_tree_label, 'tree_button_text' => $enable_dropdown_label, 'report_id' => $this->id, 'report_shortname' => 'user_class_completion', 'help' => $clustertree_help, 'fieldset' => false, 'filter_on_user_records' => true);
     //completionstatus checkboxes
     $complete_key = STUSTATUS_PASSED . ',' . STUSTATUS_FAILED;
     $incomplete_key = STUSTATUS_NOTCOMPLETE . ',NULL';
     $completed_courses_label = $this->get_string('show_completed_classes');
     $incomplete_courses_label = $this->get_string('show_incomplete_classes');
     $csheading_label = $this->get_string('completionstatus_options_heading');
     $choices = array($complete_key => $completed_courses_label, $incomplete_key => $incomplete_courses_label);
     $cs_checked = array($complete_key, $incomplete_key);
     $completionstatus_options = array('choices' => $choices, 'checked' => $cs_checked, 'numeric' => true, 'nullvalue' => 'NULL', 'isrequired' => false, 'heading' => $csheading_label);
     //columns checkboxes
     $curriculum_label = $this->get_string('report_field_curriculum');
     $status_label = $this->get_string('report_field_status');
     $completion_label = $this->get_string('report_field_completion');
     $heading_label = $this->get_string('report_fields_heading');
     $choices = array('curriculum' => $curriculum_label, 'status' => $status_label, 'completion' => $completion_label);
     $checked = array('curriculum', 'status', 'completion');
     $columns_options = array('choices' => $choices, 'checked' => $checked, 'allowempty' => true, 'heading' => $heading_label);
     //setup for the completion status dropdown
     $completionstatus_choices = array(STUSTATUS_PASSED => get_string('status_passed', $this->languagefile), STUSTATUS_FAILED => get_string('status_failed', $this->languagefile), STUSTATUS_NOTCOMPLETE => get_string('status_notcomplete', $this->languagefile), user_class_completion_details_report::STUSTATUS_NOTSTARTED => get_string('status_notstarted', $this->languagefile));
     $completionstatus_options = array('choices' => $completionstatus_choices, 'numeric' => true, 'nofilter' => true, 'checked' => $cs_checked, 'nullvalue' => 'NULL', 'isrequired' => false, 'heading' => $csheading_label, 'help' => array('user_class_completion_completionstatus', get_string('completion_status', 'local_elisprogram'), $this->languagefile));
     $userfilter = new generalized_filter_elisuserprofile('filter-up-', $this->get_string('filter_user_match'), array('choices' => $this->_user_fields, 'notadvanced' => array('fullname'), 'extra' => true, 'help' => array('up' => array('fullname' => array('user_class_completion_fullname', get_string('fullname'), $this->languagefile), 'lastname' => array('user_class_completion_lastname', get_string('lastname'), $this->languagefile), 'firstname' => array('user_class_completion_firstname', get_string('firstname'), $this->languagefile), 'idnumber' => array('user_class_completion_idnumber', get_string('idnumber'), $this->languagefile), 'email' => array('user_class_completion_email', get_string('email'), $this->languagefile), 'city' => array('user_class_completion_city', get_string('city'), $this->languagefile), 'country' => array('user_class_completion_country', get_string('country'), $this->languagefile), 'username' => array('user_class_completion_username', get_string('username'), $this->languagefile), 'language' => array('user_class_completion_language', get_string('language'), $this->languagefile), 'inactive' => array('user_class_completion_inactive', get_string('inactive'), $this->languagefile))), 'outerfield' => array('up' => 'u.id')));
     $classfilter = new generalized_filter_curriculumclass('filter-ccc-', $this->get_string('filter_curriculumclass'), array('choices' => $this->_curriculumclass_fields, 'notadvanced' => array('curriculum' => array('name'), 'course' => array('name'), 'class' => array('idnumber')), 'extra' => true, 'help' => array('curriculum' => array('name' => array('user_class_completion_curriculum', get_string('curriculum', 'local_elisprogram'), $this->languagefile)), 'course' => array('name' => array('user_class_completion_course', get_string('course', 'local_elisprogram'), $this->languagefile)), 'class' => array('idnumber' => array('user_class_completion_class', get_string('class', 'local_elisprogram'), $this->languagefile), 'environmentid' => array('user_class_completion_environment', get_string('environment', 'local_elisprogram'), $this->languagefile), 'startdate' => array('user_class_completion_startdate', get_string('class_startdate', 'local_elisprogram'), $this->languagefile))), 'wrapper' => array('curriculum' => '', 'course' => ' INNER JOIN {' . student::TABLE . '} clse
                                               ON clse.classid = cls.id', 'class' => ' INNER JOIN {' . student::TABLE . '} clse
                                               ON clse.classid = cls.id'), 'innerfield' => array('curriculum' => 'cca.userid', 'course' => 'clse.userid', 'class' => 'clse.userid'), 'outerfield' => array('curriculum' => 'u.id', 'course' => 'u.id', 'class' => 'u.id')));
     $titleoptions = array('help' => array('user_class_completion_reporttitle', $this->get_string('report_title'), $this->get_langfile()));
     $summarycoloptions = array('title' => 'summary_report_fields', 'name' => 'summary_fields', 'lang' => $this->languagefile, 'help' => 'user_class_completion_summarydatafields', 'fields' => array('userfields' => array('user_address' => 'address', 'user_city' => 'city', 'user_state' => 'state', 'user_email' => 'email', 'custom' => array('user' => 'all')), 'curriculumfields' => array('cur_name' => 'curriculum', 'cur_timecompleted' => 'curriculumcompletiondate', 'cur_timeexpired' => 'curriculumexpirationdate', 'cur_certificate' => 'certificatenumber', 'custom' => array('curriculum' => 'all'))));
     $detailheadoptions = array('title' => 'detail_head_fields', 'name' => 'detail_headers', 'lang' => $this->languagefile, 'help' => 'user_class_completion_detailheaderfields', 'fields' => array('userfields' => array('user_address' => 'address', 'user_city' => 'city', 'user_state' => 'state', 'user_email' => 'email', 'custom' => array('user' => 'all'))));
     $detailcoloptions = array('title' => 'detail_col_fields', 'name' => 'detail_fields', 'lang' => $this->languagefile, 'help' => 'user_class_completion_detaildatafields', 'fields' => array('curriculumfields' => array('cur_name' => 'curriculum', 'custom' => array('curriculum' => 'all')), 'coursefields' => array('custom' => array('course' => 'all')), 'classfields' => array('custom' => array('class' => 'all')), 'otherfields' => array('class_role' => 'classrole')));
     $filters = array();
     $autocomplete_opts = array('report' => $this->get_report_shortname(), 'ui' => 'inline', 'contextlevel' => CONTEXT_ELIS_USER, 'instance_fields' => array('idnumber' => get_string('filter_autocomplete_idnumber', $this->get_langfile()), 'firstname' => get_string('filter_autocomplete_firstname', $this->get_langfile()), 'lastname' => get_string('filter_autocomplete_lastname', $this->get_langfile())), 'custom_fields' => '*', 'label_template' => '[[firstname]] [[lastname]]', 'configurable' => true, 'selection_enabled' => true);
     $filters[] = new generalized_filter_entry('filter-autoc', '', "CONCAT(u.firstname,' ',u.lastname)", get_string('fld_fullname', 'local_eliscore'), false, 'autocomplete_eliswithcustomfields', $autocomplete_opts);
     $filters = $filters + $userfilter->get_filters();
     $filters[] = new generalized_filter_entry('filter-uid', 'u', 'id', $this->get_string('filter_cluster'), false, 'clustertree', $clustertree_options);
     $filters[] = new generalized_filter_entry('filter-completerange', 'stu', 'completetime', $this->get_string('completed_range'), false, 'date');
     $schemas = array($classfilter, array('completionstatus', 'filter_completionstatus', false, 'simpleselect', $completionstatus_options), array('title', 'title', false, 'display_text', $titleoptions), array('summarycolumns', 'summary_columns', false, 'display_table', $summarycoloptions), array('detailheaders', 'detail_headers', false, 'display_table', $detailheadoptions), array('detailcolumns', 'detail_columns', false, 'display_table', $detailcoloptions));
     foreach ($schemas as $schema) {
         if (is_array($schema)) {
             if ($schema[1] == '') {
                 $label = get_string($schema[0]);
             } else {
                 $label = $this->get_string($schema[1]);
             }
             $filters[] = new generalized_filter_entry('filter-' . $schema[0], '', $schema[0], $label, $schema[2], $schema[3], $schema[4]);
         } else {
             $filters = array_merge($filters, $schema->get_filters());
         }
     }
     //return all filters
     return $filters;
 }
예제 #4
0
 /**
  * Specifies available report filters
  * (empty by default but can be implemented by child class)
  *
  * @param boolean $initdata If true, signal the report to load the actual content of the filter objects.
  * @uses $DB
  * @return array The list of available filters
  */
 public function get_filters($initdata = true)
 {
     // Create all requested User Profile field filters.
     $upfilter = new generalized_filter_elisuserprofile('nsu', get_string('filter_user_match', 'rlreport_nonstarter'), array('choices' => $this->_fields, 'notadvanced' => array('fullname'), 'extra' => true, 'tables' => array('up' => array(user::TABLE => 'crlmusr'))));
     // Save the user profile filter for later use in header entries
     $this->upfilter = $upfilter;
     $filters = $upfilter->get_filters();
     $filterhelp = array('nonstarter_report', get_string('nonstarter_report', 'rlreport_nonstarter'), 'rlreport_nonstarter');
     $filters = array_merge($filters, array(new generalized_filter_entry(nonstarter_report::datefilterid, '', '', get_string('filter_date_range', 'rlreport_nonstarter'), false, 'date', array('help' => $filterhelp))));
     return $filters;
 }
예제 #5
0
 /**
  * Specifies available report filters
  * (empty by default but can be implemented by child class)
  *
  * @param boolean $initdata If true, signal the report to load the actual content of the filter objects.
  * @uses $DB
  * @return array The list of available filters
  */
 public function get_filters($initdata = true)
 {
     $cms = array();
     $contexts = get_contexts_by_capability_for_user('curriculum', $this->access_capability, $this->userid);
     $cms_objects = curriculum_get_listing('name', 'ASC', 0, 0, '', '', $contexts);
     if (!empty($cms_objects)) {
         foreach ($cms_objects as $curriculum) {
             $cms[$curriculum->id] = $curriculum->name;
         }
     }
     // Create all requested User Profile field filters.
     $upfilter = new generalized_filter_elisuserprofile('cu', get_string('filter_user_match', 'rlreport_curricula'), array('choices' => $this->_fields, 'notadvanced' => array('fullname'), 'extra' => true, 'tables' => array('up' => array(user::TABLE => 'crlmu'))));
     $filters = $upfilter->get_filters();
     $filters = array_merge($filters, array(new generalized_filter_entry('curr', 'curass', 'curriculumid', get_string('filter_program', 'rlreport_curricula'), false, 'selectall', array('choices' => $cms, 'multiple' => true)), new generalized_filter_entry('cluster', 'crlmu', 'id', get_string('filter_cluster', 'rlreport_curricula'), false, 'clusterselect', array('default' => null))));
     return $filters;
 }
 /**
  * Specifies available report filters
  * (empty by default but can be implemented by child class)
  *
  * @param boolean $initdata If true, signal the report to load the actual content of the filter objects.
  * @uses $DB
  * @return array The list of available filters
  */
 public function get_filters($initdata = true)
 {
     // Create all requested User Profile field filters.
     $upfilter = new generalized_filter_elisuserprofile(sitewide_transcript_report::filterid, get_string('filter_user_match', $this->langfile), array('choices' => $this->_fields, 'notadvanced' => array('fullname'), 'extra' => true, 'tables' => array('up' => array(user::TABLE => 'crlmu'))));
     return $upfilter->get_filters();
 }