Changeset 136 for trunk/services/versions.php
- Timestamp:
- Jun 3, 2006 7:47:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/services/versions.php
r42 r136 8 8 9 9 $auth->requireLogin(); 10 App::sslOn();10 $app->sslOn(); 11 11 12 12 require_once 'codebase/lib/RecordVersion.inc.php'; … … 20 20 21 21 // 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'); 26 26 27 27 // Titles and navigation header. … … 39 39 40 40 if ('' == $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(); 44 44 } 45 45 46 46 if (getFormData('boomerang', false) && isset($_SERVER['HTTP_REFERER'])) { 47 47 // 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'); 49 49 } 50 50 … … 53 53 54 54 case _("Cancel") : 55 App::dieBoomerangURL('versions', false);55 $app->dieBoomerangURL('versions', false); 56 56 break; 57 57 … … 68 68 $current = $version->getCurrent($record_table, $record_key, $record_val); 69 69 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__); 71 71 } 72 72 $nav->addPage(sprintf(_("Difference between version %s (%s) and current record."), $version_id, $versionrecord['version_datetime'])); … … 86 86 // Create version of this restored record as the "current" version. 87 87 $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)); 90 90 } 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']); 93 93 } 94 94 break; … … 101 101 $main_template = 'versions_list.ihtml'; 102 102 } 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'); 105 105 } 106 106 }
Note: See TracChangeset
for help on using the changeset viewer.