Fix browser reminder

This commit is contained in:
Laurent Destailleur
2020-10-18 14:00:47 +02:00
parent 547b3602cc
commit ef182bed07
5 changed files with 14 additions and 8 deletions

View File

@@ -1097,7 +1097,7 @@ if ($action == 'create')
if (!empty($conf->global->AGENDA_ENABLE_DONEBY))
{
print '<tr><td class="nowrap">'.$langs->trans("ActionDoneBy").'</td><td>';
print $form->select_dolusers(GETPOST("doneby") ?GETPOST("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1);
print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1);
print '</td></tr>';
}

View File

@@ -1874,9 +1874,15 @@ class Form
if ($action != 'view')
{
$out .= '<input type="hidden" class="removedassignedhidden" name="removedassigned" value="">';
$out .= '<script type="text/javascript" language="javascript">jQuery(document).ready(function () { jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });})</script>';
$out .= '<script type="text/javascript" language="javascript">jQuery(document).ready(function () {';
$out .= 'jQuery(".removedassigned").click(function() { jQuery(".removedassignedhidden").val(jQuery(this).val()); });';
$out .= 'jQuery(".assignedtouser").change(function() { console.log(jQuery(".assignedtouser option:selected").val());';
$out .= ' if (jQuery(".assignedtouser option:selected").val() > 0) { jQuery("#'.$action.'assignedtouser").attr("disabled", false); }';
$out .= ' else { jQuery("#'.$action.'assignedtouser").attr("disabled", true); }';
$out .= '});';
$out .= '})</script>';
$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
$out .= ' <input type="submit" class="button valignmiddle" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
$out .= ' <input type="submit" disabled class="button valignmiddle" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
$out .= '<br>';
}

View File

@@ -77,10 +77,10 @@ if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP
data: { time_js_next_test: time_js_next_test, forcechecknow: 1, token: 'notrequired' },
dataType: "json",
success: function (result) {
console.log(result);
//console.log(result);
var arrayofpastreminders = Object.values(result.pastreminders);
console.log("arrayofpastreminders.length"+arrayofpastreminders.length);
if (arrayofpastreminders && arrayofpastreminders.length > 0) {
console.log("Retreived "+arrayofpastreminders.length+" reminders to do.");
var audio = null;
<?php
if (!empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
@@ -145,7 +145,7 @@ if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP
data: { time_js_next_test: time_js_next_test, token: 'notrequired' }
});
} else {
console.log("No past reminder found, next try at "+time_js_next_test);
console.log("No reminder to do found, next search at "+time_js_next_test);
}
}
});

View File

@@ -167,4 +167,3 @@ ReminderType=Callback type
AddReminder=Create an automatic reminder notification for this event
ErrorReminderActionCommCreation=Error creating the reminder notification for this event
BrowserPush=Browser Notification
EventReminder=Event Reminder

View File

@@ -1099,3 +1099,4 @@ DateOfBirth=Date of birth
SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry=Security token has expired, so action has been canceled. Please try again.
UpToDate=Up-to-date
OutOfDate=Out-of-date
EventReminder=Event Reminder