Overview
Comment: | Suite de [6596fd8999] : cela autorisait au final des dates invalides, on fait donc la conversion en UTC dans le modèle plutôt que le contrôleur |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
3dc757a54389f88c80b66ef121d93a26 |
User & Date: | bohwaz on 2016-05-31 03:54:52 |
Other Links: | manifest | tags |
Context
2016-05-31
| ||
03:57 |
Firefox est encore plus bugué dans les dernières versions: il annonce supporter input[type=date] et désactive donc le widget de fallback de Garradin, mais aucune manière de détecter ces ***** de Firefox, donc on abandonne la détection de input type date et on utilise toujours le widget custom.
Implémentation de sucres ergonomiques pour améliorer l'utilisabilité du widget au passage. check-in: 0504e69180 user: bohwaz tags: trunk | |
03:54 | Suite de [6596fd8999] : cela autorisait au final des dates invalides, on fait donc la conversion en UTC dans le modèle plutôt que le contrôleur check-in: 3dc757a543 user: bohwaz tags: trunk | |
2016-05-20
| ||
05:37 | Fix date page wiki enregistrée avec la timezone locale au lieu de UTC + détecter UTC (défaut quand pas de timezone) check-in: 6596fd8999 user: bohwaz tags: trunk, stable | |
Changes
Modified src/include/lib/Garradin/Wiki.php from [00f08559c4] to [f4f8b19ea5].
︙ | ︙ | |||
117 118 119 120 121 122 123 | } public function edit($id, $data = []) { $db = DB::getInstance(); $this->_checkFields($data); | | | > > | | > > > > | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | } public function edit($id, $data = []) { $db = DB::getInstance(); $this->_checkFields($data); // Modification de la date de création: vérification que le format est bien conforme SQLite if (isset($data['date_creation'])) { if (!Utils::checkDateTime($data['date_creation'])) { throw new UserException('Date invalide: '.($data['date_creation'] ?: 'date non reconnue')); } // On stocke la date en UTC, pas dans le fuseau local $data['date_creation'] = gmdate('Y-m-d H:i:s', strtotime($data['date_creation'])); } if (isset($data['uri'])) { $data['uri'] = self::transformTitleToURI($data['uri']); if ($db->simpleQuerySingle('SELECT 1 FROM wiki_pages WHERE uri = ? AND id != ? LIMIT 1;', false, $data['uri'], (int)$id)) { |
︙ | ︙ |
Modified src/www/admin/wiki/editer.php from [6520a98819] to [467a406a97].
︙ | ︙ | |||
25 26 27 28 29 30 31 | { $page['chiffrement'] = $page['contenu']['chiffrement']; $page['contenu'] = $page['contenu']['contenu']; } if (Utils::post('date')) { | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | { $page['chiffrement'] = $page['contenu']['chiffrement']; $page['contenu'] = $page['contenu']['contenu']; } if (Utils::post('date')) { $date = Utils::post('date') . ' ' . sprintf('%02d:%02d', Utils::post('date_h'), Utils::post('date_min')); } else { $date = false; } if (!empty($_POST['save'])) |
︙ | ︙ | |||
51 52 53 54 55 56 57 | try { $wiki->edit($page['id'], [ 'titre' => Utils::post('titre'), 'uri' => Utils::post('uri'), 'parent' => Utils::post('parent'), 'droit_lecture' => Utils::post('droit_lecture'), 'droit_ecriture'=> Utils::post('droit_ecriture'), | | | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | try { $wiki->edit($page['id'], [ 'titre' => Utils::post('titre'), 'uri' => Utils::post('uri'), 'parent' => Utils::post('parent'), 'droit_lecture' => Utils::post('droit_lecture'), 'droit_ecriture'=> Utils::post('droit_ecriture'), 'date_creation' => $date, ]); $wiki->editRevision($page['id'], (int) Utils::post('revision_edition'), [ 'contenu' => Utils::post('contenu'), 'modification' => Utils::post('modification'), 'id_auteur' => $user['id'], 'chiffrement' => Utils::post('chiffrement'), |
︙ | ︙ | |||
79 80 81 82 83 84 85 | $parent = (int) Utils::post('parent') ?: (int) $page['parent']; $tpl->assign('parent', $parent ? $wiki->getTitle($parent) : 0); $tpl->assign('error', $error); $tpl->assign('page', $page); $tpl->assign('time', time()); | | | 79 80 81 82 83 84 85 86 87 88 89 90 | $parent = (int) Utils::post('parent') ?: (int) $page['parent']; $tpl->assign('parent', $parent ? $wiki->getTitle($parent) : 0); $tpl->assign('error', $error); $tpl->assign('page', $page); $tpl->assign('time', time()); $tpl->assign('date', $date ? strtotime($date) : $page['date_creation']); $tpl->assign('custom_js', ['wiki_editor.js', 'wiki-encryption.js']); $tpl->display('admin/wiki/editer.tpl'); |