diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index eb7617b5c7e..e4015812e62 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -234,10 +234,10 @@ function project_admin_prepare_head() /** * Show task lines with a particular parent * - * @param string $inc Counter that count number of lines legitimate to show (for return) - * @param int $parent Id of parent task to start - * @param array $lines Array of all tasks - * @param int $level Level of task + * @param string $inc Line number (start to 0, then increased by recursive call) + * @param string $parent Id of parent project to show (0 to show all) + * @param Task[] $lines Array of lines + * @param int $level Level (start to 0, then increased/decrease by recursive call) * @param string $var Color * @param int $showproject Show project columns * @param int $taskrole Array of roles of user for each tasks @@ -482,12 +482,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t /** * Output a task line into a pertime intput mode * - * @param string $inc ? - * @param string $parent ? - * @param Task[] $lines ? - * @param int $level ? - * @param string $projectsrole ? - * @param string $tasksrole ? + * @param string $inc Line number (start to 0, then increased by recursive call) + * @param string $parent Id of parent project to show (0 to show all) + * @param Task[] $lines Array of lines + * @param int $level Level (start to 0, then increased/decrease by recursive call) + * @param string $projectsrole Array of roles user has on project + * @param string $tasksrole Array of roles user has on task * @param string $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @return $inc @@ -628,12 +628,12 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$ /** * Output a task line into a perday intput mode * - * @param string $inc ? - * @param string $parent ? - * @param Task[] $lines ? - * @param int $level ? - * @param string $projectsrole ? - * @param string $tasksrole ? + * @param string $inc Line number (start to 0, then increased by recursive call) + * @param string $parent Id of parent project to show (0 to show all) + * @param Task[] $lines Array of lines + * @param int $level Level (start to 0, then increased/decrease by recursive call) + * @param string $projectsrole Array of roles user has on project + * @param string $tasksrole Array of roles user has on task * @param string $mine Show only task lines I am assigned to * @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @return $inc @@ -750,7 +750,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t { $dayWorkLoad = 0; $tableCell =''; - $tableCell.='+'; + $tableCell.='+'; $tableCell.=''; @@ -927,7 +927,8 @@ function print_projecttasks_array($db, $socid, $projectsListId, $mytasks=0, $sta print ""; - if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) { + if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) + { //Add the year filter input print ''; print ''; diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index dc25c1f33b7..936e86ad692 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -136,4 +136,5 @@ ProjectMustBeValidatedFirst=Project must be validated first ProjectDraft=Draft projects FirstAddRessourceToAllocateTime=Associate a ressource to allocate time InputPerTime=Input per time -InputPerDay=Input per day \ No newline at end of file +InputPerDay=Input per day +TimeAlreadyRecorded=Time spent already recorded for this task/day and user %s \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4818b2d38f1..36e246c42f2 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1376,9 +1376,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a // Wrapper to show tooltips print "\n".''; } diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index f7b37ca1ca0..692267d6965 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -50,6 +50,11 @@ $result = restrictedArea($user, 'projet', $projectid); $now=dol_now(); +$year=GETPOST("year","int")?GETPOST("year","int"):date("Y"); +$month=GETPOST("month","int")?GETPOST("month","int"):date("m"); +$week=GETPOST("week","int")?GETPOST("week","int"):date("W"); +$day=GETPOST("day","int")?GETPOST("day","int"):date("d"); + /* * Actions @@ -138,6 +143,40 @@ print "\n"; dol_fiche_end(); */ + +$startdayarray=dol_get_first_day_week($day, $month, $year); + +$prev = $startdayarray; +$prev_year = $prev['prev_year']; +$prev_month = $prev['prev_month']; +$prev_day = $prev['prev_day']; +$first_day = $prev['first_day']; +$first_month= $prev['first_month']; +$first_year = $prev['first_year']; +$week = $prev['week']; + +$day = (int) $day; +$next = dol_get_next_week($first_day, $week, $first_month, $first_year); +$next_year = $next['year']; +$next_month = $next['month']; +$next_day = $next['day']; + +// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1) +$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year); +$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd'); + +$tmpday = $first_day; + +// Show navigation bar +$nav ="".img_previous($langs->trans("Previous"))."\n"; +$nav.=" ".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week; +$nav.=" \n"; +$nav.="".img_next($langs->trans("Next"))."\n"; +$nav.="   (".$langs->trans("Today").")"; +$picto='calendarweek'; +print '
'.$nav.'
'; + + print '
'; print ''; print ''; @@ -147,8 +186,6 @@ print ''; print ''; //print ''; -$tmp=dol_getdate($now); -$startdayarray=dol_get_first_day_week($tmp['mday'], $tmp['mon'], $tmp['year']); $startday=dol_mktime(12, 0, 0, $startdayarray['first_month'], $startdayarray['first_day'], $startdayarray['first_year']); for($i=0;$i<7;$i++) @@ -192,7 +229,14 @@ print '
'; print ''; print '
'; -print ''; +print ''."\n\n"; + + +print ''; llxFooter();
'.$langs->trans("Project").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("TimeSpent").'