[geeklog-cvs] Geeklog-1.x/plugins/calendar functions.inc, 1.80, 1.81

Dirk Haun dhaun at qs1489.pair.com
Mon Mar 17 17:12:56 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/plugins/calendar
In directory qs1489.pair.com:/tmp/cvs-serv17216/calendar

Modified Files:
	functions.inc 
Log Message:
Plugins are updated by the install script, so we don't need to maintain the plugin's upgrade function


Index: functions.inc
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/plugins/calendar/functions.inc,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** functions.inc	16 Mar 2008 12:22:01 -0000	1.80
--- functions.inc	17 Mar 2008 21:12:54 -0000	1.81
***************
*** 371,375 ****
      // Since the eventsubmission table does not contain fields for the owner
      // and group, we set those to the current user. Also set the default
!     // permissions as specified in the plugin's config.php
      if (isset ($_GROUPS['Calendar Admin'])) {
          $group_id = $_GROUPS['Calendar Admin'];
--- 371,375 ----
      // Since the eventsubmission table does not contain fields for the owner
      // and group, we set those to the current user. Also set the default
!     // permissions as specified in the plugin's configuration
      if (isset ($_GROUPS['Calendar Admin'])) {
          $group_id = $_GROUPS['Calendar Admin'];
***************
*** 1368,1402 ****
  function plugin_upgrade_calendar()
  {
!     global $_TABLES, $_CA_CONF, $_STATES;
! 
!     // the plugin needs this function so complain when it doesn't exist
!     if (!function_exists ('MBYTE_strpos')) {
          return 3002;
      }
  
!     $pi_version = DB_getItem($_TABLES['plugins'], 'pi_version',
!                              "$pi_name = 'calendar'");
! 
!     if (($pi_version == '1.0.0') || ($pi_version == '1.0.1')) {
!         DB_query("ALTER TABLE {$_TABLES['events']} CHANGE state state varchar(40) default NULL");
!         DB_query("ALTER TABLE {$_TABLES['eventsubmission']} CHANGE state state varchar(40) default NULL");
!         DB_query("ALTER TABLE {$_TABLES['personal_events']} CHANGE state state varchar(40) default NULL");
! 
!         if (isset($_STATES) && is_array($_STATES)) {
!             $tables = array($_TABLES['events'], $_TABLES['eventsubmission'],
!                             $_TABLES['personal_events']);
! 
!             foreach ($_STATES as $key => $state) {
!                 foreach ($tables as $table) {
!                     DB_change($table, 'state', addslashes($state),
!                                       'state', addslashes($key));
!                 }
!             }
!         }
!     }
! 
!     DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '{$_CA_CONF['version']}', pi_gl_version = '1.5.0' WHERE pi_name = 'calendar'");
! 
!     return true;
  }
  
--- 1368,1380 ----
  function plugin_upgrade_calendar()
  {
!     // the plugin needs these function so complain when they don't exist
!     if (!function_exists('PLG_uninstall') ||
!             !function_exists('COM_createLink')) {
          return 3002;
      }
  
!     // upgrades are done by the install script - return a generic error
!     COM_errorLog("Plugin upgrade function not implemented");
!     return 3001;
  }
  




More information about the geeklog-cvs mailing list