コード例 #1
0
        foreach ($tasks as $key => $row) {
            $obj->load($row['task_id']);
            $canAccess = $obj->canAccess();
            if (!$canAccess) {
                continue;
            }
            $result[$key] = $row;
        }
        // execute and return
        return $result;
    }
}
// assemble the links for the events
$events = CEvent::getEventsForPeriod($first_time, $last_time, $event_filter, $user_id);
$events2 = array();
$tasks = CTask_ex::getAllTasksForPeriod($first_time, $last_time, $company_id);
$start_hour = w2PgetConfig('cal_day_start');
$end_hour = w2PgetConfig('cal_day_end');
foreach ($events as $row) {
    $start = new w2p_Utilities_Date($row['event_start_date']);
    $end = new w2p_Utilities_Date($row['event_end_date']);
    $events2[$start->format('%H%M%S')][] = $row;
    if ($start_hour > $start->format('%H')) {
        $start_hour = $start->format('%H');
    }
    if ($end_hour < $end->format('%H')) {
        $end_hour = $end->format('%H');
    }
}
$tf = $AppUI->getPref('TIMEFORMAT');
$dayStamp = $this_day->format(FMT_TIMESTAMP_DATE);
コード例 #2
0
       ';
$html .= "\n<script language='javascript' type='text/javascript'>       \n  // here's all the html code neccessary to display the chart object\n\n  // Future idea would be to allow XML file name to be passed in and chart tasks built from file.\n\n  \n  var g = new JSGantt.GanttChart('g',document.getElementById('GanttChartDIV'), 'day');\n \n\tg.setShowRes(0); // Show/Hide Responsible (0/1)\n\tg.setShowDur(0); // Show/Hide Duration (0/1)\n\tg.setShowComp(0); // Show/Hide % Complete(0/1)\n   g.setCaptionType('Resource');  // Set to Show Caption (None,Caption,Resource,Duration,Complete)\n \n  if( g ) {\n    // Parameters             (pID, pName,                  pStart,      pEnd,        pColor,   pLink,          pMile, pRes,  pComp, pGroup, pParent, pOpen, pDepend, pCaption)\n\t\n\t// You can also use the XML file parser JSGantt.parseXML('project.xml',g)       \n//  g.setDateInputFormat({$dayFormat})";
echo $html;
foreach ($tasks as $task) {
    //	   $taskclass = w2pFindTaskComplete($task['task_start_date'], $task['task_end_date'], $task['task_percent_complete']);
    $tname = $task[task_name] . "..." . $task[project_name];
    $tid = $task['task_id'];
    $t_start = substr($task['task_start_date'], 5, 2) . '/' . substr($task['task_start_date'], 8, 2) . '/' . substr($task['task_start_date'], 0, 4);
    $t_end = substr($task['task_end_date'], 5, 2) . '/' . substr($task['task_end_date'], 8, 2) . '/' . substr($task['task_end_date'], 0, 4);
    $t_s_m = substr($task['task_start_date'], 5, 2);
    $t_s_d = substr($task['task_start_date'], 8, 2);
    $t_s_y = substr($task['task_start_date'], 0, 4);
    $t_e_m = substr($task['task_end_date'], 5, 2);
    $t_e_d = substr($task['task_end_date'], 8, 2);
    $t_e_y = substr($task['task_end_date'], 0, 4);
    $task_color = CTask_ex::getTaskColor($task['task_start_date'], $task['task_end_date'], $task['task_percent_complete']);
    $perc_compl = $task['task_percent_complete'];
    /*    $times=array(
        'start'=>$t_start,'end'=>$t_end);     
        
            times = '<?php echo "eeeee";//json_encode($$times); 
    
        $task_descr=  $task['task_description'] ;
     			$href = '?m=tasks&a=view&task_id=' . $task['task_id'];
     			$href_edit = '?m=tasks&a=addedit&task_id=' . $task['task_id'];
     			$href_task_log = '?m=tasks&a=view&tab=1&task_id=' . $task['task_id'];
         $descript="Links:  ";
    			$descript .= $href ? '<a href="' . $href . '" class="event">' : '';
    			$descript .= "<b>View</b>";//$row['event_name'];
    			$descript .= $href ? '</a>' : '';
     			$descript .= $href_edit ? '<a href="' . $href_edit . '" class="event">' : '';