Ignore:
Timestamp:
Nov 17, 2005 7:37:40 AM (19 years ago)
Author:
scdev
Message:

More random updates. Improved self-instantiation pattern in SessionCache? to match that of App. More little tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/versions.php

    r20 r21  
    7979    if ($lock->isLocked() && !$lock->isMine()) {
    8080        $lock->dieErrorPage();
     81    }
     82
     83    if ($v = $version->restore($version_id)) {
     84        // Create version of this restored record as the "current" version.
     85        $version->create($record_table, $record_key, $record_val, $v['version_title']);
     86        App::raiseMsg(sprintf(_("The record <strong>%s</strong> has been replaced with <strong>%s</strong> version <strong>%s</strong> from <strong>%s</strong>."), getFormData('version_title'), $v['version_title'], $version_id, $v['version_datetime']), MSG_SUCCESS, __FILE__, __LINE__);
     87        App::dieBoomerangURL('versions', array('break_list_cache'=>'true', false));
    8188    } else {
    82         if ($v = $version->restore($version_id)) {
    83             // Create version of this restored record as the "current" version.
    84             $version->create($record_table, $record_key, $record_val, $v['version_title']);
    85             App::raiseMsg(sprintf(_("The record <strong>%s</strong> has been replaced with <strong>%s</strong> version <strong>%s</strong> from <strong>%s</strong>."), getFormData('version_title'), $v['version_title'], $version_id, $v['version_datetime']), MSG_SUCCESS, __FILE__, __LINE__);
    86             App::dieBoomerangURL('versions', array('break_list_cache'=>'true', false));
    87         } else {
    88             App::raiseMsg(_("Version restoration failed."), MSG_ERR, __FILE__, __LINE__);
    89             App::dieURL($_SERVER['PHP_SELF']);
    90         }
     89        App::raiseMsg(_("Version restoration failed."), MSG_ERR, __FILE__, __LINE__);
     90        App::dieURL($_SERVER['PHP_SELF']);
    9191    }
    9292    break;
Note: See TracChangeset for help on using the changeset viewer.