summaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-07-08 21:32:39 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-07-08 21:32:39 +0200
commit1b140d6c06b62c25568163c567b2165a35551154 (patch)
treedde4c95afa96d2460777d69d8aa1d026871922ad /app/Models
parent8b3ec252182c1e5e04fbec70e7dad1b96df09c3f (diff)
parent0f842c1aea74792d9b6f7e41e374c5aa0ec745fb (diff)
Merge branch 'dev' of github.com:marienfressinaud/freshrss into dev
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Configuration.php4
-rw-r--r--app/Models/EntryDAO.php12
-rw-r--r--app/Models/EntryDAOSQLite.php10
3 files changed, 5 insertions, 21 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index f2084b833..7596c54cd 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -20,6 +20,7 @@ class FreshRSS_Configuration {
'onread_jump_next' => true,
'lazyload' => true,
'sticky_post' => true,
+ 'reading_confirm' => false,
'sort_order' => 'DESC',
'anon_access' => false,
'mark_when' => array(
@@ -149,6 +150,9 @@ class FreshRSS_Configuration {
public function _sticky_post($value) {
$this->data['sticky_post'] = ((bool)$value) && $value !== 'no';
}
+ public function _reading_confirm($value) {
+ $this->data['reading_confirm'] = ((bool)$value) && $value !== 'no';
+ }
public function _sort_order ($value) {
$this->data['sort_order'] = $value === 'ASC' ? 'ASC' : 'DESC';
}
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 6f3f472f6..f184ab1fa 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -137,7 +137,6 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return $affected;
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` '
. 'SET is_read=? '
. 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?)';
@@ -147,15 +146,12 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
} else {
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
@@ -179,7 +175,6 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$idMax = time() . '000000';
Minz_Log::record($nb . 'Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
. 'SET e.is_read=1 '
@@ -194,15 +189,12 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
}
@@ -211,7 +203,6 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$idMax = time() . '000000';
Minz_Log::record($nb . 'Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
. 'SET e.is_read=1 '
@@ -221,15 +212,12 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
}
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index efcbed521..3dabce4b2 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -75,7 +75,6 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
Minz_Log::record($nb . 'Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?';
if ($onlyFavorites) {
$sql .= ' AND is_favorite=1';
@@ -86,16 +85,13 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadEntries 1: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
+ Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads(false, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
}
@@ -104,7 +100,6 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$idMax = time() . '000000';
Minz_Log::record($nb . 'Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
}
- $this->bd->beginTransaction();
$sql = 'UPDATE `' . $this->prefix . 'entry` '
. 'SET is_read=1 '
@@ -115,15 +110,12 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
- $this->bd->rollBack();
return false;
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads($id, false))) {
- $this->bd->rollBack();
return false;
}
- $this->bd->commit();
return $affected;
}