summaryrefslogtreecommitdiff
path: root/public/app/controllers/Office.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-25 09:30:37 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-25 09:30:37 +0300
commita3dc1f0f55003ca2fb325ed2e3f974094f6cad2e (patch)
tree09aa5f8208460c5c2883209d7139d59ba2d623e3 /public/app/controllers/Office.php
parent2b1f4aed56c5bfbf014f3f871e9dcc336b5a31b7 (diff)
downloadgyraf1gov-a3dc1f0f55003ca2fb325ed2e3f974094f6cad2e.tar.gz
gyraf1gov-a3dc1f0f55003ca2fb325ed2e3f974094f6cad2e.tar.bz2
gyraf1gov-a3dc1f0f55003ca2fb325ed2e3f974094f6cad2e.zip
break form scripts in parts; first pdf example
Diffstat (limited to 'public/app/controllers/Office.php')
-rw-r--r--public/app/controllers/Office.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/public/app/controllers/Office.php b/public/app/controllers/Office.php
index 5038200..d4b0217 100644
--- a/public/app/controllers/Office.php
+++ b/public/app/controllers/Office.php
@@ -118,12 +118,12 @@ class Office {
- /** (any) petition
+ /** request any (empty/new) petition form
*
- * check if user is authorized to view the content;
- * if so, prepare and render the petition view
+ * The method acts as an authorization checker and internal router
+ * to actual petition form-templates
*
- * @param $petition_type (string): [common|penalty]
+ * @param $petition_tag (string): petition type ex. [common|penalty]
*/
public static function request_petition($petition_tag)
{
@@ -135,8 +135,9 @@ class Office {
'moto' => 'Forbidden',
'message' => 'Για να έχετε πρόσβαση, θα πρέπει πρώτα να συνδεθείτε'
]);
- die(); // then end;
- }
+ die(); // then die();
+
+ } // else continue...
$token = $manager->getUserToken(); // from token
$user = $token->getUser(); // create user
@@ -160,8 +161,9 @@ class Office {
}
- /** render application form
+ /** render an (empty/new) application form
*
+ * @param array $opts : user identity ([user_id => id])
*/
private static function render_application_form($opts)
{
@@ -192,8 +194,6 @@ class Office {
? GENDERED_POSITIONS['she']
: GENDERED_POSITIONS['he'];
-
-
// #4: get Form's HTML and Javascript ----------------------------------
$form = JsonToForm::json_form($form_setup, [
['name' => 'user_id', 'value' => $user_id] // pass user identity
@@ -204,8 +204,10 @@ class Office {
}
- /** render penalty form
+ /**
+ * render an (empty/new) penalty form
*
+ * @param array $opts : user identity ([user_id => id])
*/
private static function render_penalty_form($opts)
{