From 1bfd97009ee89a1eaa6ff74eabccf6e424f61b1c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 14 May 2018 12:03:11 +0200 Subject: [PATCH] fix [modules.json] format + fix 'teacher/pdf' to return data even if no formation is found (+remove dumb data from pdf) --- build/api/module/professor/pdfController.php | 14 ++----- config/modules.json | 40 ++++++++++---------- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/build/api/module/professor/pdfController.php b/build/api/module/professor/pdfController.php index c2219ac..96d0dec 100644 --- a/build/api/module/professor/pdfController.php +++ b/build/api/module/professor/pdfController.php @@ -132,7 +132,7 @@ class pdfController{ $fetched = $form_repo->get(null); /* (2) Error: no formation found */ - if( count($fetched) < 1 ) + if( !is_array($fetched) ) return ['error' => new Error(Err::RepoError)]; /* (3) Reference formations by key = idForm */ @@ -285,10 +285,6 @@ class pdfController{ Il est à noter qu\'elle contient les données générées au '.$date.'. Elle peut ne plus être à jour. -

- Si un problème persiste veuillez contacter les responsables à l\'addresse mail suivante <mail_display_error>. -

-


@@ -317,12 +313,12 @@ class pdfController{ - Heures manquantes + Sous service '.( $missing_h>0 ? "$svg_warning $missing_h" : $missing_h).' h - Heures sup. + Sur service '.$sup_h.' h @@ -352,10 +348,6 @@ class pdfController{ Il est à noter qu\'elle contient les données générées au '.$date.'. Elle peut ne plus être à jour. -

- Si un problème persiste veuillez contacter les responsables à l\'addresse mail suivante <mail_display_error>. -

-


diff --git a/config/modules.json b/config/modules.json index e514e58..7ad73bf 100644 --- a/config/modules.json +++ b/config/modules.json @@ -96,7 +96,7 @@ "par": { "URL0": {"des": "Department id", "typ": "id", "ren": "department" } }, - "output": { + "out": { "switched": { "des": "Whether the department has been switched", "typ": "bool" } } @@ -133,7 +133,7 @@ "par": { "URL0": { "des": "The version id", "typ": "id", "ren": "version" } }, - "output": { + "out": { "sucess": { "des": "success of the operation", "typ": "bool" } } } @@ -142,7 +142,7 @@ "des": "Get the list of the versions of the department", "per": [["cas_admin"]], "par": {}, - "output": { + "out": { "versions": { "des": "List of available versions", "typ": "array" } } }, @@ -150,9 +150,9 @@ "des": "Create a backup if the name is empty, execute the backup if the name is set", "per": [["cas_admin"]], "par": { - "label": { "des": "Label of the version","typ": "text"} + "label": { "des": "Label of the version", "typ": "text" } }, - "output": { + "out": { "created_id": { "des": "The id of the created version", "typ": "varchar(10,10,alphanumeric)" } } }, @@ -160,11 +160,11 @@ "des": "Update a version and switch to this version", "per": [["cas_admin"]], "par": { - "URL0": { "des": "id of the version","typ": "id","ren": "version"}, - "label" : { "des": "Label de la version", "typ": "text", "opt":true}, - "default": { "des": "true if this version is the one that should be used by default on login", "typ": "bool","opt":true} + "URL0": { "des": "id of the version", "typ": "id", "ren": "version" }, + "label": { "des": "Label de la version", "typ": "text", "opt": true }, + "default": { "des": "Whether this version should be used on login", "typ": "bool", "opt": true } }, - "output": { + "out": { "updated": { "des": "Whether the version has been switched|applied", "typ": "bool" } } }, @@ -174,7 +174,7 @@ "par": { "URL0": { "des": "The version id", "typ": "id", "ren": "version" } }, - "output": { + "out": { "deleted": { "des": "Whether the version has been deleted", "typ": "bool" } } } @@ -261,7 +261,7 @@ "GET": { "des": "Get a professor's fiche", - "per": [["cas_admin"],["cas_user"]], + "per": [["cas_admin"], ["cas_user"]], "par": { "URL0": { "des": "Optional professor UID.", "typ": "id", "ren": "prof_id" } }, @@ -346,7 +346,7 @@ "volume": { "des": "Number of hours for Cours", "typ": "id", "opt": true, "def": 0 }, "formations": { "des": "List of formations (ids)", "typ": "array", "opt": true, "def": [] } }, - "output": { + "out": { "created_id" : { "des": "The id of the created Cours", "typ": "id" }, "formations" : { "des": "The ids of the linked formations", "typ": "array" } } @@ -370,7 +370,7 @@ "add_form": { "des": "Id of formations to add", "typ": "array", "opt": true, "def": [] }, "rem_form": { "des": "Id of formations to remove", "typ": "array", "opt": true, "def": [] } }, - "output": { + "out": { "updated" : { "des": "Whether it has been updated", "typ": "bool" } } }, @@ -381,7 +381,7 @@ "par": { "URL0": { "des": "Id of the Cours", "typ": "id", "ren": "idCours" } }, - "output": { + "out": { "deleted" : { "des": "Whether it has been deleted", "typ": "bool" } } } @@ -399,7 +399,7 @@ "volume": { "des": "Number of hours for TD", "typ": "id", "opt": true, "def": 0 }, "formations": { "des": "List of formations (ids)", "typ": "array", "opt": true, "def": [] } }, - "output": { + "out": { "created_id" : { "des": "The id of the created TD", "typ": "id" }, "formations" : { "des": "The ids of the linked formations", "typ": "array" } } @@ -423,7 +423,7 @@ "add_form": { "des": "Id of formations to add", "typ": "array", "opt": true, "def": [] }, "rem_form": { "des": "Id of formations to remove", "typ": "array", "opt": true, "def": [] } }, - "output": { + "out": { "updated" : { "des": "Whether it has been updated", "typ": "bool" } } }, @@ -434,7 +434,7 @@ "par": { "URL0": { "des": "Id of the TD", "typ": "id", "ren": "idTD" } }, - "output": { + "out": { "deleted" : { "des": "Whether it has been deleted", "typ": "bool" } } } @@ -452,7 +452,7 @@ "volume": { "des": "Number of hours for TP", "typ": "id", "opt": true, "def": 0 }, "formations": { "des": "List of formations (ids)", "typ": "array", "opt": true, "def": [] } }, - "output": { + "out": { "created_id" : { "des": "The id of the created TP", "typ": "id" }, "formations" : { "des": "The ids of the linked formations", "typ": "array" } } @@ -476,7 +476,7 @@ "add_form": { "des": "Id of formations to add", "typ": "array", "opt": true, "def": [] }, "rem_form": { "des": "Id of formations to remove", "typ": "array", "opt": true, "def": [] } }, - "output": { + "out": { "updated" : { "des": "Whether it has been updated", "typ": "bool" } } }, @@ -487,7 +487,7 @@ "par": { "URL0": { "des": "Id of the TP", "typ": "id", "ren": "idTP" } }, - "output": { + "out": { "deleted" : { "des": "Whether it has been deleted", "typ": "bool" } } }