getName().$block_id; $class=$this->getName().'_block'; if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) { $title=''; } else { $title=''; } $title.=$this->getTitle().help_link('todo', $this->getName()); $table_id = 'ID'.floor(microtime()*1000000); // create a unique ID $controller ->addExternalJavaScript(WT_STATIC_URL.'js/jquery/jquery.dataTables.min.js') ->addInlineJavaScript(' jQuery("#'.$table_id.'").dataTable( { "sDom": \'t\', '.WT_I18N::datatablesI18N().', "bAutoWidth":false, "bPaginate": false, "bLengthChange": false, "bFilter": false, "bInfo": true, "bJQueryUI": true, "aoColumns": [ /* 0-DATE */ { "bVisible": false }, /* 1-Date */ { "iDataSort": 0 }, /* 1-Record */ {}, /* 2-Username */ {}, /* 3-Text */ {} ] }); jQuery("#'.$table_id.'").css("visibility", "visible"); jQuery(".loading-image").css("display", "none"); '); $content=''; $content .= '
 
'; $content .= ''; $content .= ''; $content .= ''; //hidden by datables code $content .= ''; $content .= ''; if ($show_unassigned || $show_other) { $content .= ''; } $content .= ''; $content .= ''; $found=false; $end_jd=$show_future ? 99999999 : WT_CLIENT_JD; foreach (get_calendar_events(0, $end_jd, '_TODO', WT_GED_ID) as $todo) { $record=WT_GedcomRecord::getInstance($todo['id']); if ($record && $record->canDisplayDetails()) { $user_name=get_gedcom_value('_WT_USER', 2, $todo['factrec']); if ($user_name==WT_USER_NAME || !$user_name && $show_unassigned || $user_name && $show_other) { $content.=''; //-- Event date (sortable) $content .= ''; $content.=''; $content.=''; if ($show_unassigned || $show_other) { $content.=''; } $text=get_gedcom_value('_TODO', 1, $todo['factrec']); $content.=''; $content.=''; $found=true; } } } $content .= ''; if (!$found) { $content.='

'.WT_I18N::translate('There are no research tasks in this family tree.').'

'; } if ($template) { if ($block) { require WT_THEME_DIR.'templates/block_small_temp.php'; } else { require WT_THEME_DIR.'templates/block_main_temp.php'; } } else { return $content; } } // Implement class WT_Module_Block public function loadAjax() { return false; } // Implement class WT_Module_Block public function isUserBlock() { return true; } // Implement class WT_Module_Block public function isGedcomBlock() { return true; } // Implement class WT_Module_Block public function configureBlock($block_id) { if (safe_POST_bool('save')) { set_block_setting($block_id, 'show_other', safe_POST_bool('show_other')); set_block_setting($block_id, 'show_unassigned', safe_POST_bool('show_unassigned')); set_block_setting($block_id, 'show_future', safe_POST_bool('show_future')); set_block_setting($block_id, 'block', safe_POST_bool('block')); echo WT_JS_START, 'window.opener.location.href=window.opener.location.href;window.close();', WT_JS_END; exit; } require_once WT_ROOT.'includes/functions/functions_edit.php'; $show_other=get_block_setting($block_id, 'show_other', true); echo ''; echo WT_I18N::translate('Show research tasks that are assigned to other users'); echo ''; echo edit_field_yes_no('show_other', $show_other); echo ''; $show_unassigned=get_block_setting($block_id, 'show_unassigned', true); echo ''; echo WT_I18N::translate('Show research tasks that are not assigned to any user'); echo ''; echo edit_field_yes_no('show_unassigned', $show_unassigned); echo ''; $show_future=get_block_setting($block_id, 'show_future', true); echo ''; echo WT_I18N::translate('Show research tasks that have a date in the future'); echo ''; echo edit_field_yes_no('show_future', $show_future); echo ''; $block=get_block_setting($block_id, 'block', true); echo ''; echo /* I18N: label for a yes/no option */ WT_I18N::translate('Add a scrollbar when block contents grow'); echo ''; echo edit_field_yes_no('block', $block); echo ''; } }