i18n::translate('"To Do" tasks'), 'type'=>'both', 'descr'=>i18n::translate('The To Do block lists all outstanding _TODO facts in the database.'), 'canconfig'=>true, 'config'=>array( 'cache' =>0, 'show_unassigned'=>true, // show unassigned items 'show_other' =>false, // show items assigned to other users 'show_future' =>false // show items with a future date ) ); // this block prints a list of _TODO events in your gedcom function print_todo($block=true, $config='', $side, $index) { global $ctype, $WT_IMAGE_DIR, $WT_IMAGES, $WT_BLOCKS; $block=true; // Always restrict this block's height if (empty($config)) { $config=$WT_BLOCKS['print_todo']['config']; } $id='todo'; $title=''; if ($WT_BLOCKS['print_todo']['canconfig']) { if ($ctype=='gedcom' && WT_USER_GEDCOM_ADMIN || $ctype=='user' && WT_USER_ID) { if ($ctype=='gedcom') { $name = WT_GEDCOM; } else { $name = WT_USER_NAME; } $title .= ""; $title .= "\"".i18n::translate('Configure')."\""; } } $title.=i18n::translate('"To Do" tasks').help_link('todo'); $content=''; require_once WT_ROOT.'js/sorttable.js.htm'; require_once WT_ROOT.'includes/classes/class_gedcomrecord.php'; $table_id = 'ID'.floor(microtime()*1000000); // sorttable requires a unique ID $content .= ''; $content .= ''; $content .= ''; $content .= ''; if ($config['show_unassigned']=='yes' || $config['show_other']=='yes') { $content .= ''; } $content .= ''; $content .= ''; $found=false; $end_jd=$config['show_future']=='yes' ? 99999999 : client_jd(); foreach (get_calendar_events(0, $end_jd, '_TODO', WT_GED_ID) as $todo) { $record=GedcomRecord::getInstance($todo['id']); if ($record && $record->canDisplayDetails()) { $pgvu=get_gedcom_value('_PGVU', 2, $todo['factrec']); if ($pgvu==WT_USER_NAME || !$pgvu && $config['show_unassigned']=='yes' || $pgvu && $config['show_other']=='yes') { $content.=''; $content.=''; $name=$record->getListName(); $content.=''; if ($config['show_unassigned']=='yes' || $config['show_other']=='yes') { $content.=''; } $text=get_gedcom_value('_TODO', 1, $todo['factrec']); $content.=''; $content.=''; $found=true; } } } $content .= '
'.i18n::translate('DATE').''.i18n::translate('Record').''.i18n::translate('User name').''.i18n::translate('TEXT').'
'.str_replace('Display(false)).''.PrintReady($name).''.$pgvu.''.PrintReady($text).'
'; if (!$found) { $content.='

'.i18n::translate('There are no "To Do" tasks.').'

'; } global $THEME_DIR; if ($block) { require $THEME_DIR.'templates/block_small_temp.php'; } else { require $THEME_DIR.'templates/block_main_temp.php'; } } function print_todo_config($config) { global $WT_BLOCKS, $DAYS_TO_SHOW_LIMIT; if (empty($config)) { $config=$WT_BLOCKS['print_todo']['config']; } echo ''; echo i18n::translate('Show other users\' tasks'), help_link('todo_show_other'); echo ''; echo edit_field_yes_no('show_other', $config['show_other']); echo ''; echo ''; echo i18n::translate('Show unassigned tasks'), help_link('todo_show_unassigned'); echo ''; echo edit_field_yes_no('show_other', $config['show_unassigned']); echo ''; echo ''; echo i18n::translate('Show future tasks'), help_link('todo_show_future'); echo ''; echo edit_field_yes_no('show_other', $config['show_future']); echo ''; // Cache file life is not configurable by user echo ''; } ?>