Ignore:
Timestamp:
Jun 3, 2006 7:47:48 PM (18 years ago)
Author:
scdev
Message:

Q - Merged branches/2.0singleton into trunk. Completed updating classes to use singleton methods. Implemented tests. Fixed some bugs. Changed some interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/versions.php

    r42 r136  
    88
    99$auth->requireLogin();
    10 App::sslOn();
     10$app->sslOn();
    1111
    1212require_once 'codebase/lib/RecordVersion.inc.php';
     
    2020
    2121// Query arguments to retain their values between page requests.
    22 App::carryQuery('record_table');
    23 App::carryQuery('record_key');
    24 App::carryQuery('record_val');
    25 App::carryQuery('version_title');
     22$app->carryQuery('record_table');
     23$app->carryQuery('record_key');
     24$app->carryQuery('record_val');
     25$app->carryQuery('version_title');
    2626
    2727// Titles and navigation header.
     
    3939
    4040if ('' == $version_id && ('' == $record_table || '' == $record_key || '' == $record_val)) {
    41     App::raiseMsg(_("Record not specified for versioning."), MSG_WARNING, __FILE__, __LINE__);
    42     App::logMsg('Record not specified for versioning.', LOG_WARNING, __FILE__, __LINE__);
    43     App::dieBoomerangURL();
     41    $app->raiseMsg(_("Record not specified for versioning."), MSG_WARNING, __FILE__, __LINE__);
     42    $app->logMsg('Record not specified for versioning.', LOG_WARNING, __FILE__, __LINE__);
     43    $app->dieBoomerangURL();
    4444}
    4545
    4646if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) {
    4747    // We remember which page we came from so we can go back there.
    48     App::setBoomerangURL($_SERVER['HTTP_REFERER'], 'versions');
     48    $app->setBoomerangURL($_SERVER['HTTP_REFERER'], 'versions');
    4949}
    5050
     
    5353
    5454case _("Cancel") :
    55     App::dieBoomerangURL('versions', false);
     55    $app->dieBoomerangURL('versions', false);
    5656    break;
    5757
     
    6868    $current = $version->getCurrent($record_table, $record_key, $record_val);
    6969    if (serialize($data) == serialize($current)) {
    70         App::raiseMsg(sprintf(_("Version <strong>%s</strong> is identical to the current record"), $version_id), MSG_NOTICE, __FILE__, __LINE__);
     70        $app->raiseMsg(sprintf(_("Version <strong>%s</strong> is identical to the current record"), $version_id), MSG_NOTICE, __FILE__, __LINE__);
    7171    }
    7272    $nav->addPage(sprintf(_("Difference between version %s (%s) and current record."), $version_id, $versionrecord['version_datetime']));
     
    8686        // Create version of this restored record as the "current" version.
    8787        $version->create($record_table, $record_key, $record_val, $v['version_title']);
    88         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__);
    89         App::dieBoomerangURL('versions', array('break_list_cache'=>'true', false));
     88        $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__);
     89        $app->dieBoomerangURL('versions', array('break_list_cache'=>'true', false));
    9090    } else {
    91         App::raiseMsg(_("Version restoration failed."), MSG_ERR, __FILE__, __LINE__);
    92         App::dieURL($_SERVER['PHP_SELF']);
     91        $app->raiseMsg(_("Version restoration failed."), MSG_ERR, __FILE__, __LINE__);
     92        $app->dieURL($_SERVER['PHP_SELF']);
    9393    }
    9494    break;
     
    101101        $main_template = 'versions_list.ihtml';
    102102    } else {
    103         App::raiseMsg(sprintf(_("No saved versions available for this record"), null), MSG_NOTICE, __FILE__, __LINE__);
    104         App::dieBoomerangURL('versions');
     103        $app->raiseMsg(sprintf(_("No saved versions available for this record"), null), MSG_NOTICE, __FILE__, __LINE__);
     104        $app->dieBoomerangURL('versions');
    105105    }
    106106}
Note: See TracChangeset for help on using the changeset viewer.