case 'notes':
$url = "/notes/$url";
break;
+ case 'tag':
+ $url = "/tag/$url";
+ break;
default:
$url = "/mod/$module/$url";
break;
update_log_display_entry('message', 'block contact', 'user', 'CONCAT(firstname,\' \',lastname)');
update_log_display_entry('message', 'unblock contact', 'user', 'CONCAT(firstname,\' \',lastname)');
update_log_display_entry('group', 'view', 'groups', 'name');
+ update_log_display_entry('tag', 'update', 'tag', 'name');
/// Create guest record
upgrade_main_savepoint($result, 2009090400);
}
+ if ($result && $oldversion < 2009090800){
+ //insert new record for log_display table
+ //used to record tag update.
+ if (!$DB->record_exists('log_display', array('action'=>'update', 'module'=>'tag'))) {
+ $log_action = new object();
+ $log_action->module = 'tag';
+ $log_action->action = 'update';
+ $log_action->mtable = 'tag';
+ $log_action->field = 'name';
+
+ $result = $result && $DB->insert_record('log_display', $log_action);
+ }
+ upgrade_main_savepoint($result, 2009090800);
+ }
return $result;
}
print_error('errorupdatingrecord', 'tag');
}
}
-
+
+ //log tag changes activity
+ //if tag name exist from form, renaming is allow. record log action as rename
+ //otherwise, record log action as update
+ if (isset($tagnew->name) && ($tag->name != $tagnew->name)){
+ add_to_log($COURSE->id, 'tag', 'update', 'index.php?id='. $tag->id, $tag->name . '->'. $tagnew->name);
+
+ } elseif ($tag->description != $tagnew->description) {
+ add_to_log($COURSE->id, 'tag', 'update', 'index.php?id='. $tag->id, $tag->name);
+ }
+
//updated related tags
tag_set('tag', $tagnew->id, explode(',', trim($tagnew->relatedtags)));
//print_object($tagnew); die();
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2009090400; // YYYYMMDD = date of the last version bump
+ $version = 2009090800; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 dev (Build: 20090909)'; // Human-friendly version name