Overview
Comment: | Fix reminders sent when that reminder was already sent before but since has been renewed |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
85aaa801cb8ff111365d2debf2106041 |
User & Date: | bohwaz on 2021-06-01 21:28:26 |
Other Links: | manifest | tags |
Context
2021-06-01
| ||
21:34 | Fix backup restore with custom NOCASE collation, add migration check-in: bbba6082eb user: bohwaz tags: trunk, stable | |
21:28 | Fix reminders sent when that reminder was already sent before but since has been renewed check-in: 85aaa801cb user: bohwaz tags: trunk | |
21:27 | Try to have a deterministic output check-in: 5fd3652de0 user: bohwaz tags: trunk | |
Changes
Modified src/include/data/1.1.0_schema.sql from [26acbef5df] to [cce4f78c19].
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + + | ( id INTEGER NOT NULL PRIMARY KEY, id_user INTEGER NOT NULL REFERENCES membres (id) ON DELETE CASCADE, id_service INTEGER NOT NULL REFERENCES services (id) ON DELETE CASCADE, id_reminder INTEGER NOT NULL REFERENCES services_reminders (id) ON DELETE CASCADE, |
︙ | |||
320 321 322 323 324 325 326 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - - - - - + + + + + | format TEXT NOT NULL, published TEXT NOT NULL CHECK (datetime(published) = published), modified TEXT NOT NULL CHECK (datetime(modified) = modified), title TEXT NOT NULL, content TEXT NOT NULL ); |
︙ |
Modified src/include/data/schema.sql from [26acbef5df] to [cce4f78c19].
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | - + + | ( id INTEGER NOT NULL PRIMARY KEY, id_user INTEGER NOT NULL REFERENCES membres (id) ON DELETE CASCADE, id_service INTEGER NOT NULL REFERENCES services (id) ON DELETE CASCADE, id_reminder INTEGER NOT NULL REFERENCES services_reminders (id) ON DELETE CASCADE, |
︙ | |||
320 321 322 323 324 325 326 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | - - - - - + + + + + | format TEXT NOT NULL, published TEXT NOT NULL CHECK (datetime(published) = published), modified TEXT NOT NULL CHECK (datetime(modified) = modified), title TEXT NOT NULL, content TEXT NOT NULL ); |
︙ |
Modified src/include/lib/Garradin/Entities/Services/Reminder.php from [4702329012] to [0d2c963b3c].
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - - + + | 'select' => 'm.' . $identity, ], 'email' => [ 'label' => 'Adresse e-mail', 'select' => 'm.email', ], 'date' => [ |
Modified src/include/lib/Garradin/Services/Reminders.php from [a16c5137e4] to [db0958aeaf].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | - - + + - - - - + + + + | 'select' => 's.label', ], 'delay' => [ 'label' => 'Délai du rappel', 'select' => 'r.delay', ], 'date' => [ |
︙ | |||
118 119 120 121 122 123 124 125 126 127 128 129 130 131 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | + | Utils::sendEmail(Utils::EMAIL_CONTEXT_PRIVATE, $reminder->email, $subject, $text, $reminder->id_user); $db = DB::getInstance(); $db->insert('services_reminders_sent', [ 'id_service' => $reminder->id_service, 'id_user' => $reminder->id_user, 'id_reminder' => $reminder->id_reminder, 'due_date' => $reminder->reminder_date, ]); Plugin::fireSignal('rappels.auto', $reminder); return true; } |
︙ | |||
139 140 141 142 143 144 145 | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - - - - + + + + + - - + + | $config = Config::getInstance(); $sql = 'SELECT date(su.expiry_date, sr.delay || \' days\') AS reminder_date, ABS(julianday(date()) - julianday(expiry_date)) AS nb_days, MAX(sr.delay) AS delay, sr.subject, sr.body, s.label, s.description, su.expiry_date, sr.id AS id_reminder, su.id_service, su.id_user, |