* change for ajax save log.
This commit is contained in:
+13
-4
@@ -370,12 +370,14 @@ class gitModel extends model
|
||||
public function iconvComment($comment)
|
||||
{
|
||||
/* Get encodings. */
|
||||
$encoding = str_replace(' ', '', $this->config->git->encodings);
|
||||
if($encoding == '') return $comment;
|
||||
$encodings = str_replace(' ', '', isset($this->config->git->encodings) ? $this->config->git->encodings : '');
|
||||
if($encodings == '') return $comment;
|
||||
$encodings = explode(',', $encodings);
|
||||
|
||||
/* Try convert. */
|
||||
if($encoding != 'utf-8')
|
||||
foreach($encodings as $encoding)
|
||||
{
|
||||
if($encoding == 'utf-8') continue;
|
||||
$result = @iconv($encoding, 'utf-8', $comment);
|
||||
if($result) return $result;
|
||||
}
|
||||
@@ -556,7 +558,14 @@ class gitModel extends model
|
||||
if($changes)
|
||||
{
|
||||
$historyID = $this->dao->findByAction($record->id)->from(TABLE_HISTORY)->fetch('id');
|
||||
$this->dao->update(TABLE_HISTORY)->data($changes)->where('id')->eq($historyID)->exec();
|
||||
if($historyID)
|
||||
{
|
||||
$this->dao->update(TABLE_HISTORY)->data($changes)->where('id')->eq($historyID)->exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->action->logHistory($record->id, array($changes));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user