Skip to content
Snippets Groups Projects
Commit 41c55d19 authored by Marcos García de La Fuente's avatar Marcos García de La Fuente
Browse files

Better fix for bug-1825. There are actually a lot to things to escape and...

Better fix for bug-1825. There are actually a lot to things to escape and escaped methods can make conflict with similar names so it is better to make a md5 to have a unique value
parent 78762388
No related branches found
No related tags found
No related merge requests found
......@@ -1038,7 +1038,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++;
}
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_ext'.dol_string_nospecial($event->icalname):'family_other');
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
}
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; }
else { $numother++; $cssclass='family_other'; }
......
......@@ -140,25 +140,20 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (count($showextcals) > 0)
{
print '<tr><td>';
//jQuery Learning "How do I select an element by an ID that has characters used in CSS notation?"
//http://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/
print '<script type="text/javascript">
function jq( myid ) {
return myid.replace( /(:|\.|\[|\]|,|@)/g, "\\\\$1" );
}
jQuery(document).ready(function () {
jQuery("form.listactionsfilter input[name^=\"check_\"]").click(function() {
var name = $(this).attr("name");
jQuery(".family_" + jq(name.replace("check_", ""))).toggle();
jQuery(".family_" + name.replace("check_", "")).toggle();
});
});
</script>';
print '<input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>';
foreach ($showextcals as $val)
{
$htmlname = dol_string_nospecial($val['name']);
$htmlname = md5($val['name']);
print '<tr><td>';
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_ext' . $htmlname . '" checked="true"> ' . $val ['name'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment