NEW! Archiving data. Archiving is a soft delete. It can be undone. Enter the archive mode to see all the data including archives (everything is read-only in that mode). Archiving must be enabled per class (data model). Archiving is achieved by the mean of the API DBObject::Archive (or Unarchive).

SVN:trunk[4692]
This commit is contained in:
Romain Quetiez
2017-04-26 09:52:20 +00:00
parent 9d242e1623
commit fa2fd6dcdf
54 changed files with 1421 additions and 462 deletions

View File

@@ -377,7 +377,25 @@ try
$sMessageKey = $sClass.'::'.$id;
DisplayMessages($sMessageKey, $oP);
$oP->set_title(Dict::S('UI:ErrorPageTitle'));
$oP->P(Dict::S('UI:ObjectDoesNotExist'));
// Attempt to load the object in archive mode
DBSearch::SetArchiveModeDefault(true);
if (is_numeric($id))
{
$oObj = MetaModel::GetObject($sClass, $id, false /* MustBeFound */);
}
else
{
$oObj = MetaModel::GetObjectByName($sClass, $id, false /* MustBeFound */);
}
if (is_null($oObj))
{
$oP->P(Dict::S('UI:ObjectDoesNotExist'));
}
else
{
$oP->P(Dict::S('UI:ObjectArchived'));
}
}
else
{
@@ -1745,5 +1763,4 @@ catch(Exception $e)
IssueLog::Error($e->getMessage());
}
}
?>
}