From 1cbfefdbb098fa1ae9179b7cda93f312ab28b1cb Mon Sep 17 00:00:00 2001 From: Adrien Passos Date: Mon, 30 May 2016 16:16:47 +0200 Subject: [PATCH] First release --- .gitignore | 1 + 88x31.png | Bin 0 -> 1813 bytes README.md | 2 + config.sample.php | 27 ++++++ index.php | 229 ++++++++++++++++++++++++++++++++++++++++++++++ style.css | 12 +++ 6 files changed, 271 insertions(+) create mode 100644 .gitignore create mode 100644 88x31.png create mode 100644 config.sample.php create mode 100644 index.php create mode 100644 style.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f4773f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.php diff --git a/88x31.png b/88x31.png new file mode 100644 index 0000000000000000000000000000000000000000..79fd9d78abe894f23ea3eaae38f151276dc0f0df GIT binary patch literal 1813 zcmV+w2kQ8VP)TPwEGwM@j$X+fP6 zWK?VX6*WIJYSbhqF~-(@wcv;DoA?*JyU)3KujgKKb8ix*l6v5foAcwjxzBme^SIS=(dg6@dNMg8>d3?} z4Ua!Am@1R3k?Re3Xl}_*3(ElthL!|bk$6}TxSovD#?u5PpKZ|Q)+RlDu2x(ppCv^f z#zYmuF$Z&jv9J;ln7}rY>~fE4B!l1rCE1}TSFt=;U?>_A)(X-@>^O~0yHt`V_es9qbe$?ID-YZQZRoT6 zaK`~hBN(zElM7;E8&P4E9i1IiR#s+PcQCf&VTYIt34t}QXe9eJxtQ`y(!`8PGOYN| zo`>YDbZR(tb#>I(*eEKlxgBFVyE{!E3Vp`~MmC z&CSge2n0mMHQLZ8kHy^OP>|wDm1I~lMpmIR})<;WU{YqY&zTT73+ zdvxTMmX=b{n?-c(%FjA-GU3R-XK-ME-ab{Xt6q;MBaV*Xppb^JaA?q6nOrNYwL>yA z8IDg#g>tXJvTDW9;>s%3db3$XjAci|55v2_`Odq7fODUGN;lI7=N_g*XH!~ z_KLRJ>i0}>bOb{mT`it79l0USK2;#K5unk|dmz~g*;$pBmkTim;kd^3=RS@!KsfiMlL;KFV>%u7QB_ry zsgpCaUOUbS1(wQMiOMnof^PoSM5oH$vczG%MQy#^B5Kv?)8cz~*I)LW9AaPO75IVV z?T|^6?dY|<18@(-#H(wo8o{@2-_*h)y98T>SMpW{AsnW`>%*$E#Q}!V`hUE1NyD-X z(_SUPIB;;NX6K;6T9?g1$a%6U#9IvqI%dZPf-m3+{UkIBY( z_An0`OR0kfQkR@nT%o0PO6rz4-31+kGgrMar~rb`~lZ42M|< z&NB#xB^w+6W#b2kC zHuPakF2o*{1?Q{5RzBg-2tKKKRAmv~I3eQbLbU$@FKLMXT;pYr00000NkvXXu0mjf DuP1EV literal 0 HcmV?d00001 diff --git a/README.md b/README.md index e69de29..082a4aa 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,2 @@ +README +====== diff --git a/config.sample.php b/config.sample.php new file mode 100644 index 0000000..a65c65a --- /dev/null +++ b/config.sample.php @@ -0,0 +1,27 @@ + + + + + Gthim + + '; + + +// Adresse où est héberger Gihim +$thisUrl = 'http://gthim.local'; + +// Adresse d'I-Milo +$baseUrl = 'https://portail.i-milo.fr'; + +// Liste des portails autorisé +$permitType = array('dj' => 'dossier', 'p' => 'partenaire', 'ods' => 'service'); + +// Liste des informations autorisés pour les dossiers de jeune +$dj_Suivi = array('dis' => 'programmes', 'ser' => 'services', 'dem' => 'demandes', 'eve' => 'evenements', 'ren' => 'appointment'); +$dj_Info = array('ide' => 'identite', 'coo' => 'coordonnees', 'com' => 'complements', 'mob' => 'mobilite', 'cur' => 'cursus', 'sit' => 'situations', 'pro' => 'projets', 'loi' => 'loisirs'); + +// Liste des informations autorisés pour les partenaires entreprise +$p_Suivi = array('eve' => 'actualite', 'eng' => 'engagement', 'off' => 'offre'); +$p_Info = array('inf' => 'information-general', 'coo' => 'coordonnee'); diff --git a/index.php b/index.php new file mode 100644 index 0000000..3909f46 --- /dev/null +++ b/index.php @@ -0,0 +1,229 @@ +'; + exit(); +} + +if (!empty($_POST)) { + echo 'Erreur POST'; + exit(); +} + +if (!empty($_GET)) { + $ci_ = $_GET; + unset($_GET); +} + +if (empty($ci_['type']) || !isset($permitType[$ci_['type']])) { + $msgError[] = 'Vous devez spécifier le type de donnée. Exemple : type=dj
'; + $ci_['doc'] = '1'; +} else { + $type = $ci_['type']; +} + +if (empty($ci_['id'])) { + $msgError[] = 'Vous devez spécifier un identifiant (ID). Exemple : id=45657231
'; + $ci_['doc'] = '1'; +} else { + $pieces = explode(',', $ci_['id']); + $id = filter_var($pieces[0], FILTER_SANITIZE_NUMBER_INT); + if ($id === -1) { + $msgError[] = 'Cette identifiant n\'est pas valide dans I-Milo
'; + $ci_['doc'] = '1'; + } +} + +if ($type === 'dj') { + if (!empty($ci_['info']) && (isset($dj_Info[$ci_['info']]) || isset($dj_Suivi[$ci_['info']]))) { + if (isset($dj_Suivi[$ci_['info']])) { + $cat = 'suivi/'; + $info = $dj_Suivi[$ci_['info']]; + } else { + if (!empty($ci_['edi']) && $ci_['edi'] == 1) { + $cat = ''; + } else { + $cat = 'consultation/'; + } + + $info = $dj_Info[$ci_['info']]; + } + } else { + $info = 'synthese'; + } + + $url = $baseUrl.'/'.$permitType[$type].'/'.$id.'/'.$cat.$info; +} + +if ($type === 'p') { + if (!empty($ci_['info']) && (isset($p_Info[$ci_['info']]) || isset($p_Suivi[$ci_['info']]))) { + if (isset($p_Suivi[$ci_['info']])) { + $cat = 'consulter/'; + $info = $p_Suivi[$ci_['info']]; + } else { + if (!empty($ci_['edi']) && $ci_['edi'] == 1) { + $cat = 'modifier/'; + } else { + $cat = 'consulter/'; + } + $info = $p_Info[$ci_['info']]; + } + } else { + $info = 'synthese'; + } + + $url = $baseUrl.'/'.$permitType[$type].'/entreprise/'.$id.'/'.$cat.$info; +} + +if ($type === 'ods') { + $url = $baseUrl.'/'.$permitType[$type].'/'.$id.'/synthese'; +} + +if (empty($ci_['type']) && empty($ci_['id'])) { + $msgError = array(); +} + +if ($ci_['doc'] === '1') { + echo $header; + if (!empty($msgError)) { + echo ' +
+
    '; + foreach ($msgError as $value) { + echo ' +
  • '.$value.'
  • '; + } + echo ' +
+
'; + } + echo ' +
+

Licence

+

+ Licence Creative Commons
Gthim de Aijam - Mission Locale du Montargois et du Giennois est mis à disposition selon les termes de la licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International. +

+

+ Gthim reste la propriété de Aijam - Mission Locale du Montargois et du Giennois. +

+ +

Documentation de Gthim

'; + if (empty($id)) { + echo ' +

+ Attention les liens ci dessous ne sont pas fonctionnel, vous devez entrer un ID valide pour que les liens fonctionnent. +

'; + } + echo ' +

+ Pour afficher les pages d\'édition vous devez rajouter le paramètre &edi=1 à la fin de l\'url. Cela ne fonctionne que pour les informations de la partie dossier. +

+

+ Pour savoir comment utiliser Gthim dans OBIEE, utilisez cette documentation +

'; + + if ($ci_['doc'] === '1' && ($type === 'dj' || !isset($permitType[$ci_['type']]))) { + echo ' +

Liste des paramètres

+
    +
  • type= (paramètre obligatoire)
  • +
  • id= (paramètre obligatoire)
  • +
  • info= (paramètre optionel)
  • +
  • edi= (paramètre optionel)
  • +
+ +

Dossier jeune

+ Pour accédez au dossier d\'un jeune utiliser le paramètre type=dj
+ Pour accéder au information : +
    +
  • Dispositif info=dis
  • +
  • Services info=ser
  • +
  • Demandes info=dem
  • +
  • Evènements info=eve
  • +
  • Rendez-vous info=ren
  • +
  • Identité info=ide
  • +
  • Coordonnées info=coo
  • +
  • Compléments info=com
  • +
  • Mobilité info=mob
  • +
  • Cursus info=cur
  • +
  • Situations info=sit
  • +
  • Projets info=pro
  • +
  • Loisirs info=loi
  • +
+

Suivi

+
    +
  • Dispositif adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=dis
  • +
  • Services adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=ser
  • +
  • Demandes adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=dem
  • +
  • Evènements adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=eve
  • +
  • Rendez-vous adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=ren
  • +
'; + echo ' +

Dossier

+
    +
  • Identité adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=ide
  • +
  • Coordonnées adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=coo
  • +
  • Compléments adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=com
  • +
  • Mobilité adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=mob
  • +
  • Cursus adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=cur
  • +
  • Situations adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=sit
  • +
  • Projets adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=pro
  • +
  • Loisirs / Connaissances adresse complète pour OBIEE : '.$thisUrl.'/?type=dj&id=&info=loi
  • +
'; + } + if ($ci_['doc'] === '1' && ($type === 'p' || !isset($permitType[$ci_['type']]))) { + echo ' +

Partenaire

+ Pour accédez au dossier d\'un partenaire utiliser le paramètre type=p
+ Pour accéder au information : +
    +
  • Evènements info=eve
  • +
  • Engagements eng=ser
  • +
  • Offres info=off
  • +
  • Informations générales info=inf
  • +
  • Coordonnées info=coo
  • +
+

Suivi

+
    +
  • Evènements adresse complète pour OBIEE : '.$thisUrl.'/?type=p&id=&info=eve
  • +
  • Engagements adresse complète pour OBIEE : '.$thisUrl.'/?type=p&id=&info=eng
  • +
  • Offres adresse complète pour OBIEE : '.$thisUrl.'/?type=p&id=&info=off
  • + +
+

Dossier

+ '; + } + if ($ci_['doc'] === '1' && ($type === 'ods' || !isset($permitType[$ci_['type']]))) { + echo ' +

Offre de service

+ Pour accédez a une offre de service utiliser le paramètre type=ods +

Suivi

+
    +
  • Synthèse adresse complète pour OBIEE : '.$thisUrl.'/?type=ods&id=
  • +
+
+ '; + } +} else { + header('location:'.$url); +} +//debug +/* +

+

Voici les paramètres que vous avez passé à Gthim

+type = '.$type.' ('.$permitType[$type].')
+ID = '.$id.'
+info = '.strip_tags($ci_['info']).' ('.$info.')
'; +if ($ci_['edi'] === '1') { + echo 'edi = 1 (oui)
'; +} else { + echo 'edi = vide (non)
'; +} +echo 'lien généré = '.$url.' +

'; +*/ diff --git a/style.css b/style.css new file mode 100644 index 0000000..5808d01 --- /dev/null +++ b/style.css @@ -0,0 +1,12 @@ +code { +background-color: #cdcdcd; +padding: 0.1em; +} + +html { + padding: 1em; +} + +.msg { + background-color: orange; +}