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