Skip to content
Snippets Groups Projects
Commit 72da9b52 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #2380 from marcosgdf/bug-1825

Better fix for bug 1825
parents d9ab0583 3a917a0d
No related branches found
No related tags found
No related merge requests found
......@@ -140,26 +140,28 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
{
if (count($showextcals) > 0)
{
print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>';
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();
});
});
</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']);
print '<tr><td>';
print '<script type="text/javascript">' . "\n";
//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 ' function jq( myid ) {
return myid.replace( /(:|\.|\[|\]|,|@)/g, "\\\\$1" );
}';
print 'jQuery(document).ready(function () {' . "\n";
print ' jQuery("#check_" + jq("'.$htmlname.'")).click(function() {';
print ' jQuery(".family_" + jq("'.$htmlname.'")).toggle();';
print ' });' . "\n";
print '});' . "\n";
print '</script>' . "\n";
print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val ['name'];
print '</td></tr>';
}
......
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