/** * A custom method within the Plugin to generate the content * @return string: HTML output, when there is at least one task for today. * @return void : if there is not task for today. * @see class/Task.class.php */ function generateTodaysTasksDisplay() { $output = ''; $do_task = new Task(); $do_task->getAllTasksToday(); if ($do_task->getNumRows()) { $output .= '<div class="task_today">'; while ($do_task->next()) { $output .= "\n" . '<div id="t' . $do_task->idtask . '" class="task_item">'; $output .= "<table><tr><td>"; $output .= '<input type="checkbox" name="c' . $do_task->idtask . '" class="task_checkbox" onclick="fnTaskComplete(\'' . $do_task->idtask . '\')" /></td>'; $output .= '<td><span class="task_desc">' . $do_task->task_category . ' ' . $do_task->task_description . '.</span></td></tr></table></div>'; } $output .= '</div>'; return $output; } else { $this->setIsActive(false); } }
</script> <div class="content"> <table class="main"> <tr> <td class="i_main_right" > <div class="mainheader"> <div class="pad20"> <span class="headline14">Welcome</span> </div> </div> <div class="contentfull"> Welcome back <?php // print_r($_SESSION['do_User']); echo $_SESSION['do_User']->firstname; $do_task->getAllTasksOverdue(); if ($do_task->getNumRows()) { ?> <div class="task"> <div class="headline10" style="color: #ff0000;">Your Overdue taks</div> <?php while ($do_task->next()) { $category = $do_task_category->getTaskCategoryName($do_task->category); ?> <span id="t<?php echo $do_task->idtask; ?> " class="task_item"> <input type="checkbox" name="c<?php echo $do_task->idtask; ?> " class="task_checkbox" onclick="fnTaskComplete('<?php
echo _('select all'); ?> </a></span> | <span class="bluelink"><a href="#" onclick="fnSelNone(); return false;"><?php echo _('select none'); ?> </a></span> )</span> </div> <!--Over Due Tasks--> <?php $num_tasks_overdue = $do_task->getNumAllTasksOverdue(); $do_task->getAllTasksOverdue(); $num_tasks_overdue_limit = $do_task->getNumRows(); if ($do_task->getNumRows()) { ?> <div class="tasks"> <div class="headline10" style="color: #ff0000;"><?php echo _('Overdue'); ?> </div> <div class="contentfull"> <div class="ddtasks"> <div id="tasks_overdue"> <?php echo $do_task->viewTaskList('overdue'); //echo $do_task->viewTasks();
/** * A custom method within the Plugin to generate the content * */ function generateContactTasksDisplay() { $output = ''; $idcontact = $_SESSION['ContactEditSave']->idcontact; $show_tasks_box = false; $ContactRelatedOverdueTask = ''; $do_task_show = new Task(); $do_task_show->getContactRelatedOverdueTask($idcontact); if ($do_task_show->getNumRows()) { $ContactRelatedOverdueTask = $do_task_show->viewContactsTasks(); $show_tasks_box = true; } $ContactRelatedTodayTask = ''; $do_task_show->getContactRelatedTodayTask($idcontact); if ($do_task_show->getNumRows()) { $ContactRelatedTodayTask = $do_task_show->viewContactsTasks(); $show_tasks_box = true; } $ContactRelatedTomorrowTask = ''; $do_task_show->getContactRelatedTomorrowTask($idcontact); if ($do_task_show->getNumRows()) { $ContactRelatedTomorrowTask = $do_task_show->viewContactsTasks(); $show_tasks_box = true; } $ContactRelatedThisWeekTask = ''; $do_task_show->getContactRelatedThisWeekTask($idcontact); if ($do_task_show->getNumRows()) { $ContactRelatedThisWeekTask = $do_task_show->viewContactsTasks(); $show_tasks_box = true; } $ContactRelatedNextWeekTasks = ''; $do_task_show->getContactRelatedNextWeekTasks($idcontact); if ($do_task_show->getNumRows()) { $ContactRelatedNextWeekTasks = $do_task_show->viewContactsTasks(); $show_tasks_box = true; } $ContactRelatedLaterTasks = ''; $do_task_show->getContactRelatedLaterTasks($idcontact); if ($do_task_show->getNumRows()) { $ContactRelatedLaterTasks = $do_task_show->viewContactsTasks(); $show_tasks_box = true; } if ($show_tasks_box === true) { $output .= '<b>' . _('Tasks Related to this Contact') . '</b><br />'; if ($ContactRelatedOverdueTask != '') { $output .= '<div class="headline10" style="color: #ff0000;">Overdue</div>'; $output .= $ContactRelatedOverdueTask; } if ($ContactRelatedTodayTask != '') { $output .= '<div class="headline10">Today</div>'; $output .= $ContactRelatedTodayTask; } if ($ContactRelatedTomorrowTask != '') { $output .= '<div class="headline10">Tomorrow</div>'; $output .= $ContactRelatedTomorrowTask; } if ($ContactRelatedThisWeekTask != '') { $output .= '<div class="headline10">This week</div>'; $output .= $ContactRelatedThisWeekTask; } if ($ContactRelatedNextWeekTasks != '') { $output .= '<div class="headline10">Next week</div>'; $output .= $ContactRelatedNextWeekTasks; } if ($ContactRelatedLaterTasks != '') { $output .= '<div class="headline10">Later</div>'; $output .= $ContactRelatedLaterTasks; } return $output; } else { $this->setIsActive(false); } }