-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41b4c18
commit 4631d6c
Showing
39 changed files
with
330 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.7 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
@@ -25,13 +25,19 @@ class OpenAjax extends OpenAjaxCachePrep | |
/** | ||
* Check for ajax requests customized beyond | ||
* Survloop's default behavior, called via /ajax/{type}. | ||
* This overrides the ajaxChecks function in | ||
* RockHopSoft\Survloop\Controllers\Tree\TreeSurv. | ||
* | ||
* @param Illuminate\Http\Request $request | ||
* @param string $type | ||
* @return boolean | ||
*/ | ||
public function ajaxChecksCustom(Request $request, $type = '') | ||
{ | ||
$extension = $this->extensionAjaxChecks($request, $type); | ||
if (trim($extension) != '') { | ||
return $extension; | ||
} | ||
if ($type == 'dept-kml-desc') { | ||
return $this->ajaxDeptKmlDesc($request); | ||
} elseif ($type == 'save-default-state') { | ||
|
@@ -53,6 +59,20 @@ public function ajaxChecksCustom(Request $request, $type = '') | |
return ''; | ||
} | ||
|
||
/** | ||
* Check for ajax requests customized beyond | ||
* Survloop's default behavior, called via /ajax/{type}. | ||
* e.g. flexyourrights/openpolice-extension | ||
* | ||
* @param Illuminate\Http\Request $request | ||
* @param string $type | ||
* @return boolean | ||
*/ | ||
protected function extensionAjaxChecks(Request $request, $type = '') | ||
{ | ||
return ''; | ||
} | ||
|
||
/** | ||
* Print home page complaints previews. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.15 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
@@ -22,13 +22,20 @@ class OpenComplaintConditions extends OpenSessDataOverride | |
/** | ||
* Delegate the conditional checks which are customized from | ||
* the simpler default Survloop existing thus far. | ||
* This overrides the parseConditions function in | ||
* RockHopSoft\Survloop\Controllers\Tree\TreeSurvConds. | ||
* Return 0 or 1 (instead of -1) to override. | ||
* | ||
* @param int $nID | ||
* @param string $condition | ||
* @return int | ||
*/ | ||
protected function checkNodeConditionsCustom($nID, $condition = '') | ||
{ | ||
$extension = $this->extensionCheckNodeConditions($nID, $condition); | ||
if (in_array($extension, [0, 1])) { | ||
return $extension; | ||
} | ||
$complaint = null; | ||
if (isset($this->sessData->dataSets["complaints"]) | ||
&& isset($this->sessData->dataSets["complaints"][0]) | ||
|
@@ -155,6 +162,21 @@ protected function checkNodeConditionsCustom($nID, $condition = '') | |
} | ||
return -1; | ||
} | ||
|
||
/** | ||
* Delegate the conditional checks which are customized from | ||
* the simpler default OpenPolice.org & Survloop existing thus far. | ||
* Return 0 or 1 (instead of -1) to override. | ||
* e.g. flexyourrights/openpolice-extension | ||
* | ||
* @param int $nID | ||
* @param string $condition | ||
* @return int | ||
*/ | ||
protected function extensionCheckNodeConditions($nID, $condition = '') | ||
{ | ||
return -1; | ||
} | ||
|
||
/** | ||
* Checks whether or not this incident began | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
@@ -26,14 +26,18 @@ class OpenComplaintSaves extends OpenComplaintConditions | |
/** | ||
* Override default behavior for submitting survey forms, | ||
* delegateing specifc saving procedures for custom nodes. | ||
* This overrides the postNodePublic function in | ||
* RockHopSoft\Survloop\Controllers\Tree\TreeSurvInput. | ||
* | ||
* @param int $nID | ||
* @param string $nIDtxt | ||
* @param array $tmpSubTier | ||
* @param TreeNodeSurv $curr | ||
* @return boolean | ||
*/ | ||
protected function postNodePublicCustom(&$curr) | ||
{ | ||
$extension = $this->extensionPostNodePublic($curr); | ||
if ($extension !== false) { | ||
return $extension; | ||
} | ||
$nID = $curr->nID; | ||
if (empty($tmpSubTier)) { | ||
$tmpSubTier = $this->loadNodeSubTier($nID); | ||
|
@@ -89,6 +93,19 @@ protected function postNodePublicCustom(&$curr) | |
} | ||
return false; // false to continue standard post processing | ||
} | ||
|
||
/** | ||
* Override default behavior for submitting survey forms, | ||
* delegateing specifc saving procedures for custom nodes. | ||
* e.g. flexyourrights/openpolice-extension | ||
* | ||
* @param TreeNodeSurv $curr | ||
* @return boolean | ||
*/ | ||
protected function extensionPostNodePublic(&$curr) | ||
{ | ||
return false; // false to continue standard post processing | ||
} | ||
|
||
/** | ||
* Store the start date — and optionally start time — of the incident. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.2.18 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.0.12 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
* | ||
* OpenPolice.org | ||
* @package flexyourrights/openpolice | ||
* @author Morgan Lesko <[email protected]> | ||
* @author Morgan Lesko <[email protected]> | ||
* @since v0.2.1 | ||
*/ | ||
namespace FlexYourRights\OpenPolice\Controllers; | ||
|
Oops, something went wrong.