Commit c7522fec authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Add join method to member's table"

parents 68e5a52e e291d931
......@@ -371,6 +371,7 @@
<FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
<FIELD NAME="method" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="internal" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="group,member" />
......
......@@ -2783,5 +2783,12 @@ function xmldb_core_upgrade($oldversion=0) {
}
}
if ($oldversion < 2012011300) {
$table = new XMLDBTable('group_member');
$field = new XMLDBField('method');
$field->setAttributes(XMLDB_TYPE_CHAR, 100, null, XMLDB_NOTNULL, null, null, null, 'internal');
add_field($table, $field);
}
return $status;
}
......@@ -756,7 +756,7 @@ function group_delete($groupid, $shortname=null, $institution=null, $notifymembe
* @param int $userid
* @param string $role
*/
function group_add_user($groupid, $userid, $role=null) {
function group_add_user($groupid, $userid, $role=null, $method='internal') {
$groupid = group_param_groupid($groupid);
$userid = group_param_userid($userid);
......@@ -768,6 +768,7 @@ function group_add_user($groupid, $userid, $role=null) {
$role = get_field_sql('SELECT gt.defaultrole FROM {grouptype} gt, {group} g WHERE g.id = ? AND g.grouptype = gt.name', array($groupid));
}
$gm->role = $role;
$gm->method = $method;
db_begin();
insert_record('group_member', $gm);
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2011120200;
$config->version = 2012011300;
$config->release = '1.5.0dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment