ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ.. /** * The mform for creating and editing a calendar event * * @copyright 2009 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @package calendar */ /** * Always include formslib */ if (!defined('MOODLE_INTERNAL')) { die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page } require_once($CFG->dirroot.'/lib/formslib.php'); /** * The mform class for creating and editing a calendar * * @copyright 2009 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class event_form extends moodleform { /** * The form definition */ function definition () { global $CFG, $USER, $OUTPUT; $mform = $this->_form; $newevent = (empty($this->_customdata->event) || empty($this->_customdata->event->id)); $repeatedevents = (!empty($this->_customdata->event->eventrepeats) && $this->_customdata->event->eventrepeats>0); $hasduration = (!empty($this->_customdata->hasduration) && $this->_customdata->hasduration); $mform->addElement('header', 'general', get_string('general')); if ($newevent) { $eventtypes = $this->_customdata->eventtypes; $options = array(); if (!empty($eventtypes->user)) { $options['user'] = get_string('user'); } if (!empty($eventtypes->groups) && is_array($eventtypes->groups)) { $options['group'] = get_string('group'); } if (!empty($eventtypes->courses)) { $options['course'] = get_string('course'); } if (!empty($eventtypes->site)) { $options['site'] = get_string('site'); } $mform->addElement('select', 'eventtype', get_string('eventkind', 'calendar'), $options); $mform->addRule('eventtype', get_string('required'), 'required'); if (!empty($eventtypes->groups) && is_array($eventtypes->groups)) { $groupoptions = array(); foreach ($eventtypes->groups as $group) { $groupoptions[$group->id] = format_string($group->name, true, array('context' => context_course::instance($group->courseid))); } $mform->addElement('select', 'groupid', get_string('typegroup', 'calendar'), $groupoptions); $mform->disabledIf('groupid', 'eventtype', 'noteq', 'group'); } } // Add some hidden fields $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $mform->setDefault('id', 0); $mform->addElement('hidden', 'courseid'); $mform->setType('courseid', PARAM_INT); $mform->addElement('hidden', 'userid'); $mform->setType('userid', PARAM_INT); $mform->setDefault('userid', $USER->id); $mform->addElement('hidden', 'modulename'); $mform->setType('modulename', PARAM_INT); $mform->setDefault('modulename', ''); $mform->addElement('hidden', 'instance'); $mform->setType('instance', PARAM_INT); $mform->setDefault('instance', 0); $mform->addElement('hidden', 'action'); $mform->setType('action', PARAM_INT); // Normal fields $mform->addElement('text', 'name', get_string('eventname','calendar'), 'size="50"'); $mform->addRule('name', get_string('required'), 'required'); $mform->setType('name', PARAM_TEXT); $mform->addElement('editor', 'description', get_string('eventdescription','calendar'), null, $this->_customdata->event->editoroptions); $mform->setType('description', PARAM_RAW); $mform->addElement('date_time_selector', 'timestart', get_string('date')); $mform->addRule('timestart', get_string('required'), 'required'); $mform->addElement('header', 'durationdetails', get_string('eventduration', 'calendar')); $group = array(); $group[] =& $mform->createElement('radio', 'duration', null, get_string('durationnone', 'calendar'), 0); $group[] =& $mform->createElement('radio', 'duration', null, get_string('durationuntil', 'calendar'), 1); $group[] =& $mform->createElement('date_time_selector', 'timedurationuntil', ''); $group[] =& $mform->createElement('radio', 'duration', null, get_string('durationminutes', 'calendar'), 2); $group[] =& $mform->createElement('text', 'timedurationminutes', get_string('durationminutes', 'calendar')); $mform->addGroup($group, 'durationgroup', '', '
', false); $mform->disabledIf('timedurationuntil', 'duration', 'noteq', 1); $mform->disabledIf('timedurationuntil[day]', 'duration', 'noteq', 1); $mform->disabledIf('timedurationuntil[month]', 'duration', 'noteq', 1); $mform->disabledIf('timedurationuntil[year]', 'duration', 'noteq', 1); $mform->disabledIf('timedurationuntil[hour]', 'duration', 'noteq', 1); $mform->disabledIf('timedurationuntil[minute]', 'duration', 'noteq', 1); $mform->setType('timedurationminutes', PARAM_INT); $mform->disabledIf('timedurationminutes','duration','noteq', 2); $mform->setDefault('duration', ($hasduration)?1:0); if ($newevent) { $mform->addElement('header', 'repeatevents', get_string('repeatedevents', 'calendar')); $mform->addElement('checkbox', 'repeat', get_string('repeatevent', 'calendar'), null); $mform->addElement('text', 'repeats', get_string('repeatweeksl', 'calendar'), 'maxlength="10" size="10"'); $mform->setType('repeats', PARAM_INT); $mform->setDefault('repeats', 1); $mform->disabledIf('repeats','repeat','notchecked'); } else if ($repeatedevents) { $mform->addElement('hidden', 'repeatid'); $mform->setType('repeatid', PARAM_INT); $mform->addElement('header', 'repeatedevents', get_string('repeatedevents', 'calendar')); $mform->addElement('radio', 'repeateditall', null, get_string('repeateditall', 'calendar', $this->_customdata->event->eventrepeats), 1); $mform->addElement('radio', 'repeateditall', null, get_string('repeateditthis', 'calendar'), 0); $mform->setDefault('repeateditall', 1); } $this->add_action_buttons(false, get_string('savechanges')); } /** * A bit of custom validation for this form * * @param array $data An assoc array of field=>value * @param array $files An array of files * @return array */ function validation($data, $files) { global $DB, $CFG; $errors = parent::validation($data, $files); if ($data['courseid'] > 0) { if ($course = $DB->get_record('course', array('id'=>$data['courseid']))) { if ($data['timestart'] < $course->startdate) { $errors['timestart'] = get_string('errorbeforecoursestart', 'calendar'); } } else { $errors['courseid'] = get_string('invalidcourse', 'error'); } } if ($data['duration'] == 1 && $data['timestart'] > $data['timedurationuntil']) { $errors['timedurationuntil'] = get_string('invalidtimedurationuntil', 'calendar'); } else if ($data['duration'] == 2 && (trim($data['timedurationminutes']) == '' || $data['timedurationminutes'] < 1)) { $errors['timedurationminutes'] = get_string('invalidtimedurationminutes', 'calendar'); } return $errors; } }