Merge branch 'MDL-40112_master' of https://github.com/totara/openbadges

Conflicts:
	lib/db/upgrade.php
	version.php
This commit is contained in:
Eloy Lafuente (stronk7)
2013-07-16 01:29:01 +02:00
7 changed files with 15 additions and 12 deletions
-1
View File
@@ -2029,7 +2029,6 @@ class restore_badges_structure_step extends restore_structure_step {
$params = array(
'name' => $data->name,
'description' => $data->description,
'image' => 0,
'timecreated' => $this->apply_date_offset($data->timecreated),
'timemodified' => $this->apply_date_offset($data->timemodified),
'usercreated' => $data->usercreated,
-1
View File
@@ -80,7 +80,6 @@ if ($form->is_cancelled()) {
$fordb->timemodified = $now;
$fordb->usercreated = $USER->id;
$fordb->usermodified = $USER->id;
$fordb->image = 0;
$fordb->issuername = $data->issuername;
$fordb->issuerurl = $data->issuerurl;
$fordb->issuercontact = $data->issuercontact;
-2
View File
@@ -46,7 +46,6 @@ class badges_testcase extends advanced_testcase {
$fordb->timemodified = time();
$fordb->usercreated = $user->id;
$fordb->usermodified = $user->id;
$fordb->image = 0;
$fordb->issuername = "Test issuer";
$fordb->issuerurl = "http://issuer-url.domain.co.nz";
$fordb->expiredate = null;
@@ -74,7 +73,6 @@ class badges_testcase extends advanced_testcase {
$newid = $badge->make_clone();
$cloned_badge = new badge($newid);
$this->assertEquals($badge->image, $cloned_badge->image);
$this->assertEquals($badge->description, $cloned_badge->description);
$this->assertEquals($badge->issuercontact, $cloned_badge->issuercontact);
$this->assertEquals($badge->issuername, $cloned_badge->issuername);
+1 -6
View File
@@ -108,7 +108,6 @@ class badge {
public $timemodified;
public $usercreated;
public $usermodified;
public $image;
public $issuername;
public $issuerurl;
public $issuercontact;
@@ -241,7 +240,6 @@ class badge {
$fordb->name = get_string('copyof', 'badges', $this->name);
$fordb->status = BADGE_STATUS_INACTIVE;
$fordb->image = 0;
$fordb->usercreated = $USER->id;
$fordb->usermodified = $USER->id;
$fordb->timecreated = time();
@@ -1083,10 +1081,7 @@ function badges_process_badge_image(badge $badge, $iconfile) {
require_once($CFG->libdir. '/gdlib.php');
if (!empty($CFG->gdversion)) {
if ($fileid = (int)process_new_icon($badge->get_context(), 'badges', 'badgeimage', $badge->id, $iconfile)) {
$badge->image = $fileid;
$badge->save();
}
process_new_icon($badge->get_context(), 'badges', 'badgeimage', $badge->id, $iconfile);
@unlink($iconfile);
// Clean up file draft area after badge image has been saved.
-1
View File
@@ -2876,7 +2876,6 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="image" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="usercreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
+13
View File
@@ -2293,5 +2293,18 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013071500.01);
}
if ($oldversion < 2013071500.02) {
// Define field attachment to be dropped from badge.
$table = new xmldb_table('badge');
$field = new xmldb_field('image');
// Conditionally launch drop field eventtype.
if ($dbman->field_exists($table, $field)) {
$dbman->drop_field($table, $field);
}
upgrade_main_savepoint(true, 2013071500.02);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2013071500.01; // YYYYMMDD = weekly release date of this DEV branch
$version = 2013071500.02; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes