// The conditional availability date system used to rely on dates being
// set to 23:59:59 for the end date, but now that exact times are
// supported, it uses midnight on the following day.
-
+
// The query is restricted on 'time mod 10 = 9' in order that
// it is safe to run this upgrade twice if something goes wrong.
$DB->execute('UPDATE {course_modules} SET availableuntil = availableuntil + 1 ' .
'WHERE availableuntil > 0 AND ' . $DB->sql_modulo('availableuntil', 10) . ' = 9');
-
+
// Because availableuntil is stored in modinfo, we need to clear modinfo
// for all courses.
rebuild_course_cache(0, true);
// Main savepoint reached
upgrade_main_savepoint(true, 2011101200.01);
}
-
+
return true;
}
if(!$template = $DB->get_record("feedback_template", array("id"=>$deletetempl))) {
print_error('error');
}
-
+
if($template->ispublic) {
$systemcontext = get_system_context();
require_capability('mod/feedback:createpublictemplate', $systemcontext);
require_capability('mod/feedback:deletetemplate', $systemcontext);
}
-
+
feedback_delete_template($template);
redirect($deleteurl->out(false));
}
'deletetempl'=>$template->id,
'shoulddelete'=>1,
));
-
+
$data[] = $OUTPUT->single_button($url, $strdeletefeedback, 'post');
$tablecourse->add_data($data);
}
$tablepublic->set_attribute('class', 'generaltable');
$tablepublic->setup();
-
// echo $OUTPUT->heading(get_string('public', 'feedback'), 3);
// echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
foreach($templates as $template) {
'deletetempl'=>$template->id,
'shoulddelete'=>1,
));
-
+
$data[] = $OUTPUT->single_button($url, $strdeletefeedback, 'post');
$tablepublic->add_data($data);
}
echo $OUTPUT->box_end();
}
}
-
+
echo $OUTPUT->box_start('boxaligncenter boxwidthnormal');
$url = new moodle_url($deleteurl, array(
'id'=>$id,
'canceldelete'=>1,
));
-
+
echo $OUTPUT->single_button($url, get_string('back'), 'post');
echo $OUTPUT->box_end();
}
if(is_array($feedbackitems)){
$itemnr = 0;
-
+
$align = right_to_left() ? 'right' : 'left';
$helpbutton = $OUTPUT->help_icon('preview', 'feedback');
if (!$item = $DB->get_record('feedback_item', array('id'=>$itemid))) {
return false;
}
-
+
//if the filearea is "item" so we check the permissions like view/complete the feedback
if($filearea === 'item') {
//get the feedback
if(has_capability('mod/feedback:complete', $context)) {
$canload = true;
}
-
+
//now we check whether the user has the view capability
if(has_capability('mod/feedback:view', $context)) {
$canload = true;
}
-
+
//if the feedback is on frontpage and anonymous and the fullanonymous is allowed
//so the file can be loaded too.
if(isset($CFG->feedback_allowfullanonymous)
if(!$template = $DB->get_record('feedback_template', array('id'=>$item->template))) {
return false;
}
-
+
//if the file is not public so the capability edititems has to be there
if(!$template->ispublic) {
if(!has_capability('mod/feedback:edititems', $context)) {
$item->position = $item->position + $positionoffset;
$item->id = $DB->insert_record('feedback_item', $item);
-
+
//TODO: moving the files to the new items
if ($templatefiles = $fs->get_area_files($s_context->id, 'mod_feedback', 'template', $t_item->id, "id", false)) {
foreach($templatefiles as $tfile) {
//deleting the files from the item
$fs = get_file_storage();
-
+
if($template) {
if($template->ispublic) {
$context = get_system_context();
class webservice_xmlrpc_server extends webservice_zend_server {
/**
* Contructor
- * @param integer $authmethod authentication method one of WEBSERVICE_AUTHMETHOD_*
+ * @param integer $authmethod authentication method one of WEBSERVICE_AUTHMETHOD_*
*/
public function __construct($authmethod) {
require_once 'Zend/XmlRpc/Server.php';
$client = new Zend_XmlRpc_Client($serverurl);
return $client->call($function, $params);
}
-}
\ No newline at end of file
+}