Prevent posts on archived projects
This commit is contained in:
12
inc/Spot.php
12
inc/Spot.php
@@ -470,6 +470,7 @@ class Spot extends Main
|
|||||||
|
|
||||||
public function getNewFeed($iRefIdFirst) {
|
public function getNewFeed($iRefIdFirst) {
|
||||||
$asResult = array();
|
$asResult = array();
|
||||||
|
$sDesc = '';
|
||||||
|
|
||||||
if($this->oProject->getMode() != Project::MODE_HISTO) {
|
if($this->oProject->getMode() != Project::MODE_HISTO) {
|
||||||
$asMessageIds = $asMediaIds = array();
|
$asMessageIds = $asMediaIds = array();
|
||||||
@@ -496,8 +497,9 @@ class Spot extends Main
|
|||||||
|
|
||||||
$asResult = array_merge($asResult, $asMarkers);
|
$asResult = array_merge($asResult, $asMarkers);
|
||||||
}
|
}
|
||||||
|
else $sDesc = 'mode_histo';
|
||||||
|
|
||||||
return self::getJsonResult(true, '', $asResult);
|
return self::getJsonResult(true, $sDesc, $asResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNextFeed($iRefIdLast=0, $bInternal=false) {
|
public function getNextFeed($iRefIdLast=0, $bInternal=false) {
|
||||||
@@ -582,6 +584,10 @@ class Spot extends Main
|
|||||||
|
|
||||||
public function addPost($sName, $sPost)
|
public function addPost($sName, $sPost)
|
||||||
{
|
{
|
||||||
|
$iPostId = 0;
|
||||||
|
$sDesc = '';
|
||||||
|
|
||||||
|
if($this->oProject->getMode() != Project::MODE_HISTO) {
|
||||||
$asData = array(
|
$asData = array(
|
||||||
Db::getId(Project::PROJ_TABLE) => $this->oProject->getProjectId(),
|
Db::getId(Project::PROJ_TABLE) => $this->oProject->getProjectId(),
|
||||||
'name' => mb_strtolower(trim($sName)),
|
'name' => mb_strtolower(trim($sName)),
|
||||||
@@ -594,8 +600,10 @@ class Spot extends Main
|
|||||||
$iPostId = $this->oDb->insertRow(self::POST_TABLE, $asData);
|
$iPostId = $this->oDb->insertRow(self::POST_TABLE, $asData);
|
||||||
|
|
||||||
$this->oUser->updateNickname($sName);
|
$this->oUser->updateNickname($sName);
|
||||||
|
}
|
||||||
|
else $sDesc = 'mode_histo';
|
||||||
|
|
||||||
return self::getJsonResult(($iPostId > 0), '');
|
return self::getJsonResult(($iPostId > 0), $sDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upload()
|
public function upload()
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ project = Project
|
|||||||
projects = Projects
|
projects = Projects
|
||||||
hikes = Hikes
|
hikes = Hikes
|
||||||
mode = Mode
|
mode = Mode
|
||||||
|
mode_previz = Project in preparation
|
||||||
|
mode_blog = Active Project
|
||||||
|
mode_histo = Archived project
|
||||||
code_name = Code name
|
code_name = Code name
|
||||||
start = Start
|
start = Start
|
||||||
end = End
|
end = End
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ project = Projet
|
|||||||
projects = Projets
|
projects = Projets
|
||||||
hikes = Randonnées
|
hikes = Randonnées
|
||||||
mode = Mode
|
mode = Mode
|
||||||
|
mode_previz = Project en cours de préparation
|
||||||
|
mode_blog = Project actif
|
||||||
|
mode_histo = Project archivé
|
||||||
code_name = Nom de code
|
code_name = Nom de code
|
||||||
start = Départ
|
start = Départ
|
||||||
end = Arrivée
|
end = Arrivée
|
||||||
|
|||||||
Reference in New Issue
Block a user