Ejemplo n.º 1
0
 /**
  * Returns the changes for a given record in a particular language, since
  * a given version number.
  * @param Dataface_Record &$record The record we are interested in.
  * @param string $language 2-digit language code
  * @param float $version <major_version>.<minor_version>
  * @param string $fieldname Optional field name to get changes for.
  * @returns mixed Either a Dataface_Record object with the changes, or 
  *				a string with the changes for $fieldname.
  *
  */
 function getChanges(&$record, $version, $lang = null, $fieldname = null)
 {
     $app = Dataface_Application::getInstance();
     if (!isset($lang)) {
         $lang = $app->_conf['lang'];
     }
     list($major_version, $minor_version) = explode('.', $version);
     $trecord = $this->getTranslationRecord($record, $lang);
     import('Dataface/HistoryTool.php');
     $ht = new Dataface_HistoryTool();
     $hrecord = $ht->searchArchives($trecord, array('major_version' => $major_version, 'minor_version' => $minor_version), $lang);
     $modified = $hrecord->strval('history__modified');
     return $ht->getDiffsByDate($record, $modified, null, $lang, $fieldname);
 }