View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0024706 | Plugin - Reminder | General | public | 2018-08-28 08:49 | 2023-03-25 12:02 |
| Reporter | cas | Assigned To | cas | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | open | ||
| Summary | 0024706: Reminder plugin Version 2.13 has been released | ||||
| Description | This plugin can be used to send periodic email reminders to bug reporters, The files in the
This plugin is build upon version 2.x.x of mantis and should be installed as | ||||
| Additional Information | Bugfixes and removal of deprecated functions(hope I got them all) | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
|
Version 2.10, now with all latest scripts. |
|
|
Fixed the bugs & Also adjusted the test scripts to show additional details |
|
|
bug_feedback_mail.php - There were no changes in the output, the fix has no visble effect bug_reminder_mail.php (the mail, which has been send to the assigned developer) - There were no changes in the output, the fix has no visble effect bug_reminder_mail.php (the mail, which has been send to the managers) - Completely broken - no changes in the output, no visible effect and recently additional html-tags There is a new "strange" behavior in bug_reminder_mail.php - This script ist now looking for the core.php file using relative paths: PHP Fatal error: require_once(): Failed opening required '../../../core.php' (include_path=':/usr/share/kopano/php') in /var/www/html/mantis/plugins/Reminder/scripts/bug_reminder_mail.php on line 9 When you want to use it in a cron job, you have to write a script which cd's to the absolute path of the Reminder (i.E. /var/www/html/mantis/plugins/Reminder/scripts/). Is this work-around really nessesary? |
|
|
did you run the testscripts from the browser? |
|
|
bug_feedback_mail_test.php id: 8 handler_id: 3 reporter_id:3 project_id: 1
|
|
|
Reviewed all the scripts and they are working on my end including additional output (please do adjust the setting in config to ON for additional details !!) |
|
|
bug_reminder_mail_test.php Path setting retrieved : https://ko.heidschnuckel.de/mantis/ https://ko.heidschnuckel.de/mantis/view.php?id=5 Finished Reminder Test |
|
|
You're right - i haven't seen that there is an additional configuration option. It's a bit difficult for me because my english is very bad (i am using "Google Translator" :-) The only think remaining is, that bug_reminder_mail.php shows |
|
|
Did you verify the setting in the config which defaults to OFF? |
|
|
This should take away the remaining " |
|
|
I found another I also translated some stuff, please have a look at strings_german.txt Now, i have another problem: Having a "first peek" at the manager-e-mail of bug_reminder_mail.php, i see that there are tickets included, which have the due date 2038-03-21 (20 years. My configuration was 2 days "before"...) strings_german.txt (2,406 bytes)
<?php $s_reminder_plugin_title = "Erinnerungs-Emails von Mantis" ; $s_reminder_config = "Einstellungen" ; $s_reminder_bug_status = "Nur Einträge mit folgendem Status auswählen" ; $s_reminder_mail_subject = "Nachrichteninhalt der Erinnerungsnachricht" ; $s_reminder_sender = "E-Mail-Adresse des Senders" ; $s_reminder_days_treshold = "Anzahl der Tage (Stunden) vor Fälligkeitsdatum"; $s_reminder_update_config = 'Einstellungen speichern'; $s_reminder_store_as_note = "Speichere Erinnerung als Notiz (nur für Bearbeiter)"; $s_reminder_store_enabled = "An"; $s_reminder_store_disabled = "Aus"; $s_reminder_ignore_unset = "Ignoriere Einträge ohne Fälligkeitsdatum"; $s_reminder_ignore_past = "Ignoriere Einträge mit Fälligkeitsdatum in der Vergangenheit"; $s_reminder_group_issues = "Gruppiere Einträge (Nur wenn nächste Option Aus ist)"; $s_reminder_group_project = "Separate, gruppierte E-Mail pro Projekt (Nur wenn vorherige Option Aus ist)"; $s_reminder_manager_overview = "Erzeuge E-Mail für Manager pro Projekt"; $s_reminder_handler = "Erzeuge E-Mail für Bearbeiter"; $s_reminder_group_subject = "Betreff für gruppierte E-Mail"; $s_reminder_group_body1 = "Start des Nachrichteninhalts von gruppierter E-Mail"; $s_reminder_group_body2 = "Ende des Nachrichteninhalts von gruppierter E-Mail"; $s_reminder_project_name = "Projekt auswählen:"; $s_reminder_download = "Einträge mit Fälligkeitsdatum herunterladen"; $s_reminder_feedback_email = "Mantis Versand Rückmeldungs E-Mail" ; $s_reminder_feedback_project_name = "Wählen Sie ein Projekt zum Empfang von Rückmeldungs-Email"; $s_reminder_feedback_status = "Nur Einträge mit folgendem Status auswählen" ; $s_reminder_login = "Geplantes Skript mit folgendem Konto ausführen: " ; $s_reminder_subject = "Betreff der E-Mail für Rückmeldungs-Skript" ; $s_reminder_finished = "Text der nach Aufruf im Browser erscheint" ; $s_reminder_plugin_desc = "Erinnert an fällige Einträge per Email und CSV-Export. Erinnerung bei Rückmeldungen."; $s_reminder_hours = "Benutze Stunden statt Tagen"; $s_reminder_export_settings = "Export-Einstellungen"; $s_reminder_export_colsep = "Trennzeichen der CSV-Spalten"; $s_reminder_include = "Nur ausgewählte Projekte (Aus = Alle Projekte)"; $s_reminder_details = "Detaillierte E-Mails (inklusive Zusammenfassung)"; bug_reminder_mail.php (9,023 bytes)
<?php
# This page tests sending an E-mail if a due date is getting near
if( php_sapi_name() != 'cli' ) {
echo "It is not allowed to run this script with PHP SAPI name: " . php_sapi_name() . ".\n";
exit( 1 );
}
# No real email is sent nor are notes created for the various issues
require_once( '../../../core.php' );
$t_login = config_get( 'plugin_Reminder_reminder_login' );
$ok=auth_attempt_script_login( $t_login );
$t_core_path = config_get( 'core_path' );
require_once( $t_core_path.'bug_api.php' );
require_once( $t_core_path.'email_api.php' );
require_once( $t_core_path.'bugnote_api.php' );
$t_bug_table = db_get_table( 'bug' );
$t_man_table = db_get_table( 'project_user_list' );
$t_rem_days = config_get( 'plugin_Reminder_reminder_days_treshold' );
$t_rem_status = config_get( 'plugin_Reminder_reminder_bug_status' );
$t_rem_body = config_get( 'plugin_Reminder_reminder_mail_subject' );
$t_rem_store = config_get( 'plugin_Reminder_reminder_store_as_note' );
$t_rem_ignore = config_get( 'plugin_Reminder_reminder_ignore_unset' );
$t_rem_ign_past = config_get( 'plugin_Reminder_reminder_ignore_past' );
$t_rem_handler = config_get( 'plugin_Reminder_reminder_handler' );
$t_rem_group1 = config_get( 'plugin_Reminder_reminder_group_issues' );
$t_rem_group2 = config_get( 'plugin_Reminder_reminder_group_project' );
$t_rem_manager = config_get( 'plugin_Reminder_reminder_manager_overview' );
$t_rem_subject = config_get( 'plugin_Reminder_reminder_group_subject' );
$t_rem_body1 = config_get( 'plugin_Reminder_reminder_group_body1' );
$t_rem_body2 = config_get( 'plugin_Reminder_reminder_group_body2' );
$t_rem_details = config_get( 'plugin_Reminder_reminder_details' );
$t_rem_hours = config_get('plugin_Reminder_reminder_hours');
if (ON != $t_rem_hours){
$multiply=24;
} else{
$multiply=1;
}
//
// access level for manager= 70
// this needs to be made flexible
// we will only produce overview for those projects that have a separate manager
//
$baseline = time(true)+ ($t_rem_days*$multiply*60*60);
$basenow = time(true);
if ( ON == $t_rem_handler ) {
$query = "select id,handler_id,project_id,summary from $t_bug_table where status in (".implode(",", $t_rem_status).") and due_date<=$baseline and handler_id>0 ";
if ( ON == $t_rem_ign_past ) {
$query .=" and due_date>=$basenow" ;
} else{
if ( ON == $t_rem_ignore ) {
$query .=" and due_date>1" ;
}
}
$t_rem_include = config_get('plugin_Reminder_reminder_include');
$t_rem_projects = "(";
$t_rem_projects .= config_get('plugin_Reminder_reminder_project_id');
$t_rem_projects .= ")";
if (ON==$t_rem_include){
if ($t_rem_projects <>"0") {
$query .= " and $t_bug_table.project_id IN ". $t_rem_projects;
}
}else{
$query .= " and $t_bug_table.project_id NOT IN ".$t_rem_projects;
}
if ( ON == $t_rem_group1 ) {
$query .=" order by handler_id" ;
} else {
if ( ON == $t_rem_group2 ) {
$query .=" order by $t_bug_table.project_id,handler_id" ;
}
}
$results = db_query( $query );
$resnum=db_num_rows($results);
if ( OFF == $t_rem_group1 ) {
if ($results) {
while ($row1 = db_fetch_array($results)) {
$id = $row1['id'];
$handler = $row1['handler_id'];
$summary = $row1['summary'];
if ( OFF == $t_rem_details ) {
$list = string_get_bug_view_url_with_fqdn( $id, $handler2 );
} else {
$url = string_get_bug_view_url_with_fqdn( $id, $handler2 );
$list = " * $summary\n $url\n";
}
$body = $t_rem_body1;
$body .= "\n\n";
$body .= $list;
$body .= "\n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler, $body );
# Add reminder as bugnote if store reminders option is ON.
if ( ON == $t_rem_store ) {
$t_attr = '|'.$handler2.'|';
bugnote_add( $id, $t_rem_body, 0, config_get( 'default_reminder_view_status' ) == VS_PRIVATE, REMINDER, $t_attr, NULL, FALSE );
}
}
}
} else {
if ($results){
$start = true ;
$list= "";
// first group and store reminder per issue
while ($row1 = db_fetch_array($results)) {
$id = $row1['id'];
$handler = $row1['handler_id'];
$project = $row1['project_id'];
$summary = $row1['summary'];
if ($start){
$handler2 = $handler ;
$start = false ;
}
if ($handler==$handler2){
$list .="\n";
if ( OFF == $t_rem_details ) {
$list.= string_get_bug_view_url_with_fqdn( $id, $handler2 );
} else {
$url = string_get_bug_view_url_with_fqdn( $id, $handler2 );
$list.= " * $summary\n $url\n";
}
# Add reminder as bugnote if store reminders option is ON.
if ( ON == $t_rem_store ) {
$t_attr = '|'.$handler2.'|';
bugnote_add( $id, $t_rem_body, 0, config_get( 'default_reminder_view_status' ) == VS_PRIVATE, REMINDER, $t_attr, NULL, FALSE );
}
} else {
// now send the grouped email
$body = $t_rem_body1;
$body .= "\n\n";
$body .= $list;
$body .= "\n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler2, $body);
$handler2 = $handler ;
$list ="\n";
if ( OFF == $t_rem_details ) {
$list = string_get_bug_view_url_with_fqdn( $id, $handler2 );
} else {
$url = string_get_bug_view_url_with_fqdn( $id, $handler2 );
$list = " * $summary\n $url\n";
}
# Add reminder as bugnote if store reminders option is ON.
if ( ON == $t_rem_store ) {
$t_attr = '|'.$handler2.'|';
bugnote_add( $id, $t_rem_body, 0, config_get( 'default_reminder_view_status' ) == VS_PRIVATE, REMINDER, $t_attr, NULL, FALSE );
}
}
}
// handle last one
if ($resnum>0){
// now send the grouped email
$body = $t_rem_body1;
$body .= "\n\n";
$body .= $list;
$body .= "\n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $handler2, $body);
}
//
}
}
}
if ( ON == $t_rem_manager ) {
// select relevant issues in combination with an assigned manager to the project
$query = "select id,handler_id,user_id,summary from $t_bug_table,$t_man_table where status in (".implode(",", $t_rem_status).") and due_date<=$baseline ";
$query = "select id,handler_id,user_id,summary from $t_bug_table,$t_man_table where status in (".implode(",", $t_rem_status).") ";
if ( ON == $t_rem_ign_past ) {
$query .=" and due_date>=$basenow" ;
} else{
if ( ON == $t_rem_ignore ) {
$query .=" and due_date>1" ;
}
}
$t_rem_include = config_get('plugin_Reminder_reminder_include');
$t_rem_projects = "(";
$t_rem_projects .= config_get('plugin_Reminder_reminder_project_id');
$t_rem_projects .= ")";
if (ON==$t_rem_include){
if ($t_rem_projects <>"0") {
$query .= " and $t_bug_table.project_id IN ". $t_rem_projects;
}
} else {
$query .= " and $t_bug_table.project_id NOT IN ".$t_rem_projects;
}
$query .=" and $t_bug_table.project_id=$t_man_table.project_id and $t_man_table.access_level=70" ;
$query .=" order by $t_man_table.project_id,$t_man_table.user_id" ;
$results = db_query( $query );
$resnum=db_num_rows($results);
if ($results){
$start = true ;
$list= "";
// first group and store reminder per issue
while ($row1 = db_fetch_array($results)) {
$id = $row1['id'];
$handler = $row1['handler_id'];
$manager = $row1['user_id'];
$summary= $row1['summary'];
if ($start){
$man2 = $manager ;
$start = false ;
}
if ($manager==$man2){
$list .=" \n\n";
if ( OFF == $t_rem_details ) {
$list.= string_get_bug_view_url_with_fqdn( $id, $handler2 );
} else {
$url = string_get_bug_view_url_with_fqdn( $id, $handler2 );
$list.= " * $summary\n $url\n";
}
} else {
// now send the grouped email
$body = $t_rem_body1. " \n\n";
$body .= $list. " \n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $man2, $body);
$man2 = $manager ;
if ( OFF == $t_rem_details ) {
$list = string_get_bug_view_url_with_fqdn( $id, $man2 );
} else {
$url = string_get_bug_view_url_with_fqdn( $id, $man2 );
$list = " * $summary\n $url\n";
} $list .= " \n\n";
}
}
// handle last one
if ($resnum>0){
// now send the grouped email
$body = $t_rem_body1. " \n\n";
$body .= $list. " \n\n";
$body .= $t_rem_body2;
$result = email_group_reminder( $man2, $body);
}
//
}
}
# Send Grouped reminder
function email_group_reminder( $p_user_id, $issues ) {
$t_username = user_get_field( $p_user_id, 'username' );
$t_email = user_get_email( $p_user_id );
$t_subject = config_get( 'plugin_Reminder_reminder_group_subject' );
$t_message = $issues ;
if( !is_blank( $t_email ) ) {
email_store( $t_email, $t_subject, $t_message );
if( OFF == config_get( 'email_send_using_cronjob' ) ) {
email_send_all();
}
}
}
|
|
|
Updated German translation and removed final |
|
|
Fixed the date issue for you also in 2.13 |
|
|
Dear cas - this is a perfect result and i would really thank you for your patience and your support (i know that my english is more worse than my php knowledge). If there is anythink i can do to support this add-on - let me know! |
|
|
Dear Cas, APPLICATION ERROR 0000401 Datenbankabfrage fehlgeschlagen. Die Reportmeldung lautet #1054: Unknown column 'Array' in 'where clause' für die Abfrage: select mantis_bug_table.id,summary,due_date,username,realname from mantis_bug_table,mantis_user_table where mantis_bug_table.handler_id=mantis_user_table.id and status in (Array) and due_date>1 and due_date<=1538562422 and mantis_bug_table.project_id IN (136). Bitte benutzen Sie die „Zurück“-Taste Ihres Browsers, um auf die vorhergehende Seite zurückzukehren. Dort können Sie den hier angezeigten Eintrag korrigieren oder eine andere Aktion ausführen. Über das Menü können Sie auch direkt zu einer anderen Aktion wechseln. the script : "http://XXXXXXX/mantis/plugins/Reminder/scripts/bug_feedback_mail_test.php" works fine. thanks for your support. Matthias |
|
|
Can you try it once again after selecting multiple statusses in the config page? |
|
|
Dear CAS, I had marked all statuses, but it dosn't help. APPLICATION ERROR 0000401 Database query failed. Error received from database was #1054: Unknown column 'Array' in 'where clause' for the query: select mantis_bug_table.id,summary,due_date,username,realname from mantis_bug_table,mantis_user_table where mantis_bug_table.handler_id=mantis_user_table.id and status in (Array) and due_date>1 and due_date<=1539326343 and mantis_bug_table.project_id NOT IN (0). Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section. Attached my config Have a nice day. Matthias |
|
|
Hi Matthias, |
|
|
Hi Cas, Thank you for your support. |
|
|
Matthias, $query="select $t_bug_table.id,summary,due_date,username,realname from $t_bug_table,$t_user_table where $t_bug_table.handler_id=$t_user_table.id and status in ($t_rem_status) and due_date>1 and due_date<=$baseline" ;Now try again. |
|
|
Hi cas, Now i have selecting all options. I have changes the '#' to Line 31 and tried again ( with multiple statusses ) APPLICATION ERROR 0000401 Database query failed. Error received from database was #1054: Unknown column 'Array' in 'where clause' for the query: select mantis_bug_table.id,summary,due_date,username,realname from mantis_bug_table,mantis_user_table where mantis_bug_table.handler_id=mantis_user_table.id and status=Array and due_date>1 and due_date<=1539428650 and mantis_bug_table.project_id NOT IN (0). Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section. Attached the Printscreen from the PHPAdmin Table with multiple statusses and the Plugin Settings |
|
|
Sorry, for this test, you should only use one(1) status. |
|
|
No problem, This is the Result: PPLICATION ERROR 0000401 Database query failed. Error received from database was #1054: Unknown column 'Array' in 'where clause' for the query: select mantis_bug_table.id,summary,due_date,username,realname from mantis_bug_table,mantis_user_table where mantis_bug_table.handler_id=mantis_user_table.id and status=Array and due_date>1 and due_date<=1539431826 and mantis_bug_table.project_id NOT IN (0). Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section. |
|
|
I have not been able to reproduce your error but we should find a way |
|
|
Hi, cas. that works !!! Can you tell me the different ? thank you Matthias |
|
|
It works but it is not fixed yet. What I did is hard-coded status 50 which made it work. It work normally with an array of values which on your setup fails. |
|
|
That works also ! |
|
|
Then it looks like it is fixed. You can do one more test selecting more than one status. |
|
|
I have tried it with all issues. Have a nice day. |
|
|
Hello, p.s. bug_feedback_mail.php can be work in cron, without adding "$g _email_send_using_cronjob = ON;". |
|
|
Thank you, I found the problem. Sorry for disturbance. |
|
|
Excuse me, |
|
|
@1800548, no it does not work with a custom date-field. Then it would require a change to the plugin. |
|
|
Ok, thank you for your reply! |
|
|
I find it extremely curious how this is released to the public. I have a few things that are broken:
|
|
|
Beste Kees, ik zie jouw correcties graag tegemoet. |
|
|
Cas, thanks for your reply! For our needs we only use the Feedback reminder. I actually started on my own plugin (feedback reminder functionality only) today (with some credits to yours). If you want me to re-do / fix your plugin I could figure something out. Would be helpful if it's all up-to-date on the github repo though. It's nice we have something to work on as a base (which fortunality works for most people as you said). |
|
|
Kees, |
|
|
That's fine. I'll create the feedback plugin for own use in any case, but I'm looking forward to the updated github repo. |
|
|
Hello, I have installed reminder 2.0 from the github location: https://github.com/mantisbt-plugins/Reminder. When I try to install, I dont find install button instead I see that the dependency is not met. How to fix this issue? Thanks in Advance, |
|
|
Hello, I have updated the reminder version 2.13 and was able to install it and configure. I have also setup the cronjob, but I am not receiving any reminder emails. I get emails for creating and other regular notification emails. Please help!. Thanks, |
|
|
Future support via https://github.com/mantisbt-plugins |
|