foreach ($grade_letters as $gradelet) { $school_name = $DB->get_record('local_school', array('id' => $gradelet->schoolid)); $line = array(); $greycss = $gradelet->visible ? ' ' : 'dimmed'; /* * ###Bugreport #137-providing link * @author hemalatha c arun<*****@*****.**> * (Resolved) providing view page links to college(organization) name */ $line[] = '<a href="' . $CFG->wwwroot . '/local/collegestructure/view.php?id=' . $school_name->id . '" class="' . $greycss . '">' . $school_name->fullname . '</a>'; $line[] = $gradelet->letter; $line[] = $gradelet->markfrom; $line[] = $gradelet->markto; $line[] = $gradelet->gradepoint; if (has_capability('local/gradeletter:manage', $systemcontext)) { $buttons = $hierarchy->get_actions('gradeletter', 'edit', $gradelet->id, $gradelet->visible); $line[] = $buttons; } $data[] = $line; } $PAGE->requires->js('/local/gradeletter/letter.js'); echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; //View Part starts //start the table $table = new html_table(); $table->id = "gradelettertable"; $table->head = array(get_string('schoolname', 'local_collegestructure'), get_string('lettergrades', 'local_gradeletter'), get_string('markfrom', 'local_gradeletter'), get_string('markto', 'local_gradeletter'), get_string('gradepoint', 'local_gradeletter'));
} $list = $resource->assignedresourcelist(); if (empty($list)) { echo get_string('resounotassinanysch', 'local_classroomresources'); } else { $data = array(); foreach ($list as $resour) { $result = array(); $result[] = $DB->get_field('local_school', 'fullname', array('id' => $resour->schoolid)); $result[] = $DB->get_field('local_building', 'fullname', array('id' => $resour->buildingid)); $result[] = $DB->get_field('local_floor', 'fullname', array('id' => $resour->floorid)); $result[] = $DB->get_field('local_classroom', 'fullname', array('id' => $resour->classroomid)); $name = $resource->get_resource_name($resour->resourceid); $result[] = $name; if (has_capability('local/classroomresources:manage', $systemcontext)) $result[] = $hierarchy->get_actions('classroomresources', 'assignresource', $resour->id, $resour->visible); $data[] = $result; } $PAGE->requires->js('/local/classroomresources/js/resourcelist.js'); echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; $table = new html_table(); $table->id = "resourcelist"; $table->head = array( get_string('schoolid', 'local_collegestructure'), get_string('building', 'local_classroomresources'), get_string('floor', 'local_classroomresources'), get_string('classroom', 'local_classroomresources'), get_string('resources', 'local_classroomresources'));
$line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/programs/view.php?id=' . $program->id . '">' . format_string($program->fullname) . '</a>'; //$line[] = $program->fullname; // Edited by hema /* if($program->duration_format == 'Y') $duration_format='Years'; else if ($program->duration_format == 'M') $duration_format='Months'; */ $line[] = $program->duration . strtolower(get_string('example', 'local_programs')); //$line[] = $name->type; $line[] = $name->level; $line[] = $DB->get_field('local_school', 'fullname', array('id' => $program->schoolid)); //---------checking capabilities---------------------------- $capabilities_array =$myprogram->program_capabilities(array('create','view')); if (has_any_capability($capabilities_array, $systemcontext)) { $line[] = $hierarchy->get_actions('programs', 'program', $program->id, $program->visible); } $data[] = $line; } } //Tab view $myprogram->createtabview($currenttab); //echo $OUTPUT->heading(get_string('programlist', 'local_programs')); //Description for the page if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('viewprogramspage', 'local_programs')); } $PAGE->requires->js('/local/programs/js/program.js');
!empty($eactivity->semesterid) ? $eventinfo .='<span><strong>' . get_string('semester', 'local_semesters') . ' :</strong> ' . $semestername . '</span><br />' : null; $eventinfo .= '<span><strong>' . get_string('eventlevel', 'local_academiccalendar') . ':</strong> ' . $eventls[$eactivity->eventlevel] . '</span><br />'; $line[] = $eventinfo; $date = $startdate; !empty($enddate) ? $date .= ' - ' . $enddate : null; $line[] = $date; $line[] = $startdate; $line[] = $enddate; !empty($eactivity->schoolid) ? $line[] = $schoolname : $line[] = null; !empty($eactivity->programid) ? $line[] = $programname : $line[] = null; !empty($eactivity->semesterid) ? $line[] = $semestername : $line[] = null; $line[] = !empty($eactivity->eventlevel) ? $acalendar->eventls[$eactivity->eventlevel] : null; if (is_siteadmin($USER) || has_any_capability($capabilities_array, $systemcontext)) { $buttons = $hierarchy->get_actions('academiccalendar', 'edit_event', $eactivity->id, $eactivity->publish); $line[] = $buttons; } $data[] = $line; } if (is_siteadmin($USER) || has_capability('local/collegestructure:manage', $systemcontext)) { $currenttab = 'view'; require('tabs.php'); } /* ---Moodle 2.2 and onwards--- */ if (!$acalendar->is_student()) { if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('vieweventdescription', 'local_academiccalendar')); } }
$line[] = $DB->get_field('local_program', 'fullname', array('id' => $tool->programid)); if (count($schools) > 1) { $line[] = $school_name->fullname; } if (has_any_capability($assigncourse_cap, $systemcontext)) { $line[] = '<a ' . $linkcss . ' title="Assign Course" href="' . $CFG->wwwroot . '/local/modules/assigncourse.php?moduleid=' . $tool->id . '&sesskey=' . sesskey() . '">Assign Courses</a>'; } else $line[] = '<a ' . $linkcss . ' title="Permission denied" >Assign Courses</a>'; // ------------------- Edited by hema------------------------------ if (has_any_capability($capabilities_array, $systemcontext)) { $pluginname = 'modules'; $plugin = 'module'; $line[] = $hier->get_actions($pluginname, $plugin, $tool->id, $tool->visible); } $data[] = $line; } $PAGE->requires->js('/local/modules/js/module.js'); echo '<div class="filterarea"></div>'; //View Part starts $table = new html_table(); $table->id = "moduletable"; $multiple = $hier->get_assignedschools(); if (is_siteadmin()) { $multiple = $hier->get_school_items(); } if (count($multiple) == 1) { $table->head = array(
$clases = $resource->cobalt_classroom(); if (empty($clases)) { echo get_string('noclsroom', 'local_classroomresources'); } else { $data = array(); foreach ($clases as $class) { $result = array(); $linkcss = $class->visible ? ' ' : 'class="dimmed" '; $result[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/classroomresources/classroomdetails.php?id=' . $class->id . '">' . format_string($class->fullname) . '</a>'; $result[] = $class->shortname; $result[] = $class->floorname; $result[] = $class->buildingname; $result[] = $class->schoolname; if (has_capability('local/classroomresources:manage', $systemcontext)) $result[] = $hierarchy->get_actions('classroomresources', 'classroom', $class->id, $class->visible); $data[] = $result; } $PAGE->requires->js('/local/classroomresources/js/class.js'); echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; $table = new html_table(); $table->id = "class"; $table->head = array( get_string('classroom', 'local_classroomresources'), get_string('shortname', 'local_classroomresources'), get_string('floor', 'local_classroomresources'), get_string('building', 'local_classroomresources'), get_string('schoolname', 'local_collegestructure')); if (has_capability('local/classroomresources:manage', $systemcontext))
*/ $sem = $DB->get_record('local_semester', array('id' => $semester->semesterid)); $line = array(); $name = $mysemester->names($sem); $linkcss = $sem->visible ? ' ' : 'class="dimmed" '; $line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/semesters/view.php?id=' . $sem->id . '">' . format_string($sem->fullname) . '</a>'; $line[] = $DB->get_field('local_school', 'fullname', array('id' => $semester->schoolid)); $line[] = $name->startdate; $line[] = $name->enddate; // $line[] = $semester->mincredit; // $line[] = $semester->maxcredit; //get action buttons for crud operations //---------checking capabilities---------------------------- if (has_any_capability($capabilities_array, $systemcontext)) { $line[] = $hierarchy->get_actions('semesters', 'semester', $semester->semesterid, $sem->visible, $mode, $semester->schoolid); } $data[] = $line; } //Tab view $mysemester->createtabview($mode); //Description for the page if ($mode == 'current') { if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('viewcursemesterspage', 'local_semesters')); } } elseif ($mode == 'upcoming') { echo $OUTPUT->box(get_string('viewupsemesterspage', 'local_semesters')); } else {
/** * @method collegegrid * @todo To display -Grid view of college structure will all the schools,programs and departments * @param int $page page number * @param int $perpage */ public function collegegrid($page, $flist, $perpage) { global $DB, $CFG, $USER, $OUTPUT; /* ---Get the records from the database--- */ $hierarchy = new hierarchy(); $i = 1; $sql = "SELECT * FROM {local_school} ORDER BY sortorder"; $schoolgrid = $DB->get_records_sql($sql); $totalcount = count($schoolgrid); foreach ($schoolgrid as $school) { $j = 1; $k = 1; $sql = " SELECT distinct(s.id),s.* FROM {local_school} s where (s.id={$school->id} AND id in(select schoolid from {local_school_permissions} where schoolid={$school->id} AND userid={$USER->id})) ORDER BY s.sortorder "; $checkpermissions = $DB->get_records_sql($sql); $creatprogram = '<a title="Add Program" href="' . $CFG->wwwroot . '/local/programs/program.php?id=-1&scid=' . $school->id . '&sesskey=' . sesskey() . '">Add Program</a>'; $creatdepartment = '<a title="Add Course Library" href="' . $CFG->wwwroot . '/local/departments/departments.php?id=-1&scid=' . $school->id . '&sesskey=' . sesskey() . '">Add Course Library</a>'; /* ---start of the first division--- */ $linkcss = $school->visible ? ' ' : 'class="dimmed" '; $showdepth = 1; if ($checkpermissions || is_siteadmin()){ $str = '<div style="border:0px solid red" id="hierarchy-index">'; /* ---printing the school and it actions--- */ $str .='<div > <div style="padding:5px 0px 5px 3px;font-size:14px;border:0px solid #000;background:#CAE1FC"> <a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/collegestructure/view.php?id=' . $school->id . '">' . $this->display_hierarchy_item($school, $showdepth) . '</a>'; $str .='<span style="width:47%;float:right">'; if ($checkpermissions || is_siteadmin()) $str .= $hierarchy->get_actions('collegestructure', 'school', $school->id, $school->visible); $str .='</span></div> '; /* ---printing the manage program label--- */ $str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD"> <div style="border-width:0px 0px 1px 0px;border-style:solid;border-color:#DDD;height:29px;padding:4px 3px 4px 36px;font-weight:bold;font-size:16px;">Programs <span style="width:50%;float:right"> '; if ($checkpermissions || is_siteadmin()) $str .= $creatprogram; $str .='</span> </div>'; /* ---get the program records which are assigned to particular school--- */ $programlists = $DB->get_records('local_program', array('schoolid' => $school->id)); /* ---if programs are listed them show them all--- */ if ($programlists) { $programname = array(); foreach ($programlists as $programlist) { /* ---print the programs and it actions--- */ $linkcss = $programlist->visible ? ' ' : 'class="dimmed" '; $str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD"> <div style="padding:8px 0px 8px 50px;border:0px solid #888000">' . $j . '. <a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/programs/view.php?id=' . $programlist->id . '&scid=' . $school->id . '">' . $programlist->fullname . '</a>'; $str .='<span style="width:50%;float:right;border:0px solid #000">'; if ($checkpermissions || is_siteadmin()) $str .=$hierarchy->get_actions('programs', 'program', $programlist->id, $programlist->visible, 'NULL', $school->id); $str .='</span> </div> </div> '; $j++; } } $str .='</div>'; /* ---end of the program list--- */ /* ---start of the department management--- */ /* ---course/category.php?id=15&categoryedit=on&sesskey=B1DqJnEYxM--- */ $str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD"> <div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD;height:33px;padding:3px 3px 3px 36px;font-weight:bold;font-size:16px;">Course Library <span style="width:50%;float:right"> '; if ($checkpermissions || is_siteadmin()) $str .= $creatdepartment; $str .='</span> </div>'; /* ---get the list of all the department assigned to the school--- */ $departmentlists = $DB->get_records('local_department', array('schoolid' => $school->id)); /* ---if departments are listed show them all--- */ if ($departmentlists) { $departmentname = array(); foreach ($departmentlists as $departmentlist) { /* ---print the department and it actions--- */ $linkcss = $departmentlist->visible ? ' ' : ' class="dimmed" '; $str .='<div style="border-width:0px 0px 0px 0px;border-style:solid;border-color:#DDD"> <div style="padding:8px 0px 8px 50px;">' . $k . '. <a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/departments/viewdept.php?id=' . $departmentlist->id . '&scid=' . $school->id . '&sesskey=B1DqJnEYxM">' . $departmentlist->fullname . '</a>'; $str .='<span style="width:50%;float:right">'; if ($checkpermissions || is_siteadmin()) $str .=$hierarchy->get_actions('departments', 'departments', $departmentlist->id, $departmentlist->visible, 'NULL', $school->id); $str .='</span></div> </div> '; $k++; } } $str .='</div>'; /* ---niranjan take care of this div--- */ $str .='</div>'; $str .='</div>'; $i++; echo $str; } } }
function get_table($tools) { global $PAGE, $USER, $DB, $OUTPUT; $systemcontext = context_system::instance(); $capabilities_array = array('local/prefix:manage', 'local/prefix:delete', 'local/prefix:update', 'local/prefix:visible'); $PAGE->requires->js('/local/prefix/test.js'); $data = array(); foreach ($tools as $tool) { $line = array(); $temp1 = $DB->get_record('local_create_entity', array('id' => $tool->entityid)); $line[] = $temp1->entity_name; $temp3 = $DB->get_record('local_school', array('id' => $tool->schoolid)); $line[] = $temp3->fullname; $temp2 = $DB->get_record('local_program', array('id' => $tool->programid)); $line[] = $temp2->fullname; $line[] = $tool->sequence_no; $line[] = $tool->prefix; $line[] = $tool->suffix; $hier = new hierarchy(); // ------------------- Edited by hema------------------------------ if (has_any_capability($capabilities_array, $systemcontext)) { $buttons = $hier->get_actions('prefix', 'prefix2', $tool->id, $tool->visible); $line[] = $buttons; } $data[] = $line; } // Moodle 2.2 and onwards if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('phead', 'local_prefix')); } echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; //View Part starts //start the table $table = new html_table(); $table->id = 'cooktable'; $table->head = array( get_string('e_name', 'local_prefix'), get_string('schoolid', 'local_collegestructure'), get_string('program', 'local_programs'), get_string('sequence', 'local_prefix'), get_string('prefix', 'local_prefix'), get_string('suffix', 'local_prefix')); // ------------------- Edited by hema------------------------------ if (has_any_capability($capabilities_array, $systemcontext)) { array_push($table->head, get_string('editop', 'local_examtype')); } $table->size = array('15%', '15%', '15%', '15%'); $table->align = array('left', 'left', 'left', 'center'); $table->width = '99%'; $table->data = $data; echo html_writer::table($table); }
$sql = "SELECT * FROM {local_cobaltcourses} WHERE schoolid IN ($schoolid)"; $courses = $DB->get_records_sql($sql); foreach ($courses as $course) { $line = array(); $linkcss = $course->visible ? ' ' : 'class="dimmed" '; $line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/cobaltcourses/view.php?id=' . $course->id . '&title=' . $title . '&plugin=cobaltcourses&page=index">' . format_string($course->shortname) . '</a>'; $line[] = $course->fullname; $line[] = ($course->coursetype == 0) ? get_string('general', 'local_cobaltcourses') : get_string('elective', 'local_cobaltcourses'); $line[] = $DB->get_field('local_department', 'fullname', array('id' => $course->departmentid)); $line[] = $DB->get_field('local_school', 'fullname', array('id' => $course->schoolid)); $line[] = $course->credithours; //-------------------Edited by hema------------------------------------------ if (has_any_capability($capabilities_array, $systemcontext)) { $line[] = $hierarchy->get_actions('cobaltcourses', 'cobaltcourse', $course->id, $course->visible); } $data[] = $line; } /* ---Current tab--- */ $currenttab = 'view'; /* ---adding tabs--- */ createtabview($currenttab); /* ---Heading of the page--- */ if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('descriptionforviewpage', 'local_cobaltcourses')); }
function get_table($tools) { global $PAGE, $USER, $DB, $OUTPUT, $CFG; $PAGE->requires->js('/local/departments/js/dept_test.js'); $data = array(); $capabilities_array = array('local/departments:manage', 'local/departments:delete', 'local/departments:update', 'local/departments:visible'); foreach ($tools as $tool) { $line = array(); // $line[]=$tool->shortname; $linkcss = $tool->visible ? ' ' : 'class="dimmed" '; // $line[] = html_writer::tag('a', $tool->fullname, array('href' => ''.$CFG->wwwroot.'/local/departments/viewdept.php?id='.$tool->id.'')); $line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/departments/viewdept.php?id=' . $tool->id . '">' . format_string($tool->fullname) . '</a>'; $line[] = $tool->shortname; $schoolname = $DB->get_record('local_school', array('id' => $tool->schoolid)); $line[] = $schoolname->fullname; $hier = new hierarchy(); // ------------------- Edited by hema------------------------------ $systemcontext = context_system::instance(); if (has_any_capability($capabilities_array, $systemcontext)) { $buttons = $hier->get_actions('departments', 'departments', $tool->id, $tool->visible); $line[] = $buttons; } $data[] = $line; } echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; //View Part starts //start the table $table = new html_table(); $table->id = 'depttable'; $table->head = array( get_string('deptfullname', 'local_departments'), get_string('deptid', 'local_departments'), get_string('schoolid', 'local_collegestructure')); // ------------------- Edited by hema------------------------------ if (has_any_capability($capabilities_array, $systemcontext)) { array_push($table->head, get_string('action')); } $table->size = array('15%', '15%', '15%', '15%'); $table->align = array('left', 'left', 'left', 'center'); $table->width = '99%'; $table->data = $data; echo html_writer::table($table); }
$floors = $resource->cobalt_floor(); if (empty($floors)) { echo get_string('noflor', 'local_classroomresources'); } else { $data = array(); foreach ($floors as $floor) { $result = array(); $linkcss = $floor->visible ? ' ' : 'class="dimmed" '; $result[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/classroomresources/floordetails.php?id=' . $floor->id . '">' . format_string($floor->fullname) . '</a>'; $result[] = $floor->shortname; $result[] = $floor->buildingname; $result[] = $floor->schoolname; if (has_capability('local/classroomresources:manage', $systemcontext)) $result[] = $hierarchy->get_actions('classroomresources', 'floor', $floor->id, $floor->visible); $data[] = $result; } $PAGE->requires->js('/local/classroomresources/js/floor.js'); echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; $table = new html_table(); $table->id = "floor"; $table->head = array( get_string('floor', 'local_classroomresources'), get_string('shortname', 'local_classroomresources'), get_string('building', 'local_classroomresources'), get_string('schoolid', 'local_collegestructure')); if (has_capability('local/classroomresources:manage', $systemcontext))
} $buildings = $resource->cobalt_building(); if (empty($buildings)) { echo get_string('nobuilcreate', 'local_classroomresources'); } else { $data = array(); foreach ($buildings as $building) { $result = array(); $linkcss = $building->visible ? ' ' : 'class="dimmed" '; $result[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/classroomresources/buildingdetails.php?id=' . $building->id . '">' . format_string($building->fullname) . '</a>'; $result[] = $building->shortname; $result[] = $building->schoolname; if (has_capability('local/classroomresources:manage', $systemcontext)) { $result[] = $hierarchy->get_actions('classroomresources', 'building', $building->id, $building->visible); } $data[] = $result; } $PAGE->requires->js('/local/classroomresources/js/building.js'); echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; $table = new html_table(); $table->id = "building"; $table->head = array( get_string('building', 'local_classroomresources'), get_string('shortname', 'local_classroomresources'), get_string('schoolid', 'local_collegestructure')); if (has_capability('local/classroomresources:manage', $systemcontext)) $table->head[] = get_string('action', 'local_classroomresources'); $table->size = array('20%', '20%', '20%', '20%');
$line[] = $exam->lecturetype; $line[] = $exam->classname; $line[] = $cobcourse->fullname; $exam->starttimehour = ($exam->starttimehour < 10) ? '0' . $exam->starttimehour : $exam->starttimehour; $exam->starttimemin = ($exam->starttimemin < 10) ? '0' . $exam->starttimemin : $exam->starttimemin; $exam->endtimehour = ($exam->endtimehour < 10) ? '0' . $exam->endtimehour : $exam->endtimehour; $exam->endtimemin = ($exam->endtimemin < 10) ? '0' . $exam->endtimemin : $exam->endtimemin; $line[] = date("M d Y", $exam->opendate) . ',<br/>' . $exam->starttimehour . ':' . $exam->starttimemin . ' to ' . $exam->endtimehour . ':' . $exam->endtimemin; // $line[] = $exam->schoolname; if (has_any_capability($capabilities_array, $systemcontext)) { $hierarchy = new hierarchy(); $line[] = $exam->semestername; $buttons = $hierarchy->get_actions('scheduleexam', 'edit', $exam->id, $exam->visible); $line[] = $buttons; $data[] = $line; } else { $data[] = $line; } } } else { $row = new html_table_row(); $optioncell = new html_table_cell(get_string('no_records', 'local_request')); $optioncell->colspan = 7; $row ->cells[] = $optioncell; $data[]=$row; }