Exemple #1
0
         $existingprogram->timemodified = time();
         $DB->update_record('local_program', $existingprogram);
         $programsupdated++;
     } else {
         // no program information changed
         // $upt->track('status', $strprogramuptodate);
         $programsuptodate++;
     }
 } else {     // else start for [!empty($existingprogram]
     $data = new stdclass();
     $hier = new hierarchy();
     $schools = $hier->get_assignedschools();
     if (is_siteadmin()) {
         $schools = $hier->get_school_items();
     }
     $prgs = programs::getInstance();
     $fullname = trim($program->fullname);
     $shortname = trim($program->shortname);
     // check program duration
     if (empty($program->duration)) {
         echo '<h3 style="color:red;">Please enter program duration  in line  no. "' . $linenum . '" of uploaded excelsheet.</h3>';
         goto loop;
     }
     if (empty($program->fullname)) {
         echo '<h3 style="color:red;">Please enter program fullname  in line  no. "' . $linenum . '" of uploaded excelsheet.</h3>';
         goto loop;
     }
     if (empty($program->shortname)) {
         echo '<h3 style="color:red;">Please enter program shortname  in line  no. "' . $linenum . '" of uploaded excelsheet.</h3>';
         goto loop;
     }
Exemple #2
0
/**
 * List the tool provided in a course
 *
 * @package    local
 * @subpackage programs
 * @copyright  2013 Vinodkumar <*****@*****.**>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once(dirname(__FILE__) . '/../../config.php');
global $CFG, $PAGE;
require_once($CFG->dirroot . '/local/programs/lib.php');
require_once($CFG->dirroot . '/local/lib.php');

$currenttab = optional_param('mode', 'view', PARAM_RAW);
$myprogram = programs::getInstance();
$systemcontext = context_system::instance();

//get the admin layout
$PAGE->set_pagelayout('admin');
//check the context level of the user and check weather the user is login to the system or not
$PAGE->set_context($systemcontext);
require_login();
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}
//If the loggedin user have the capability of managing the batches allow the page
$capabilities_array =$myprogram->program_capabilities(); 
if (!has_any_capability($capabilities_array, $systemcontext)) {
Exemple #3
0
 public static function getInstance() {
     if (!self::$_program) {
         self::$_program = new programs();
     }
     return self::$_program;
 }