[system] / trunk / wwmoodle / wwassignment / db / mysql.php Repository:
ViewVC logotype

View of /trunk/wwmoodle/wwassignment/db/mysql.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4174 - (download) (as text) (annotate)
Tue Jun 27 20:04:11 2006 UTC (13 years, 7 months ago) by gage
File size: 771 byte(s)
Combining wwmoodle and wwmoodleset into one module called wwassign

    1 <?PHP
    2 
    3 function wwmoodleassignment_upgrade($oldversion) {
    4 /// This function does anything necessary to upgrade
    5 /// older versions to match current functionality
    6 
    7   global $CFG;
    8 
    9   if ($oldversion < 2006042700) {
   10     // fix to handle course shortnames with spaces properly.
   11     table_column('wwassignment_bridge', null, 'coursename', 'varchar', 15, '', '', 'not null', 'course');
   12     // now properly update the table to have modified shortName
   13     $aRecords = get_records('wwassignment_bridge');
   14     foreach( $aRecords as $oRecord ) {
   15       // get the short name:
   16       $oCourse = get_record('course', 'id', $oRecord->course);
   17       $oRecord->coursename = preg_replace("/[^a-zA-Z0-9]/", "", $oCourse->shortname);
   18       update_record('wwassignment_bridge', $oRecord);
   19     }
   20   }
   21   return true;
   22 }
   23 
   24 ?>

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9