Work on new timesheet input pages.
This commit is contained in:
parent
5d4d8151c1
commit
840b047468
@ -506,17 +506,11 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
||||||
* @return $inc
|
* @return $inc
|
||||||
*/
|
*/
|
||||||
function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
||||||
{
|
{
|
||||||
global $db, $user, $bc, $langs;
|
global $db, $user, $bc, $langs;
|
||||||
global $form, $formother, $projectstatic, $taskstatic;
|
global $form, $formother, $projectstatic, $taskstatic;
|
||||||
|
|
||||||
if (! is_object($formother))
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
||||||
$formother = new FormOther($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$lastprojectid=0;
|
$lastprojectid=0;
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -625,7 +619,7 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
|
|||||||
print '</td><td align="right">';
|
print '</td><td align="right">';
|
||||||
//$s.=' ';
|
//$s.=' ';
|
||||||
$s=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
|
$s=$form->select_duration($lines[$i]->id.'duration','',$disabledtask,'text',0,1);
|
||||||
$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
//$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
||||||
print $s;
|
print $s;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -639,7 +633,7 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
|
|||||||
|
|
||||||
$inc++;
|
$inc++;
|
||||||
$level++;
|
$level++;
|
||||||
if ($lines[$i]->id) projectLinesPerTime($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
if ($lines[$i]->id) projectLinesPerDay($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||||
$level--;
|
$level--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -668,17 +662,11 @@ function projectLinesPerTime(&$inc, $parent, $lines, &$level, &$projectsrole, &$
|
|||||||
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
* @param int $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to
|
||||||
* @return $inc
|
* @return $inc
|
||||||
*/
|
*/
|
||||||
function projectLinesPerDay(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
||||||
{
|
{
|
||||||
global $db, $user, $bc, $langs;
|
global $db, $user, $bc, $langs;
|
||||||
global $form, $formother, $projectstatic, $taskstatic;
|
global $form, $formother, $projectstatic, $taskstatic;
|
||||||
|
|
||||||
if (! is_object($formother))
|
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|
||||||
$formother = new FormOther($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
$lastprojectid=0;
|
$lastprojectid=0;
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -805,7 +793,7 @@ function projectLinesPerDay(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$l
|
|||||||
|
|
||||||
$inc++;
|
$inc++;
|
||||||
$level++;
|
$level++;
|
||||||
if ($lines[$i]->id) projectLinesPerDay($inc, $firstdaytoshow, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
if ($lines[$i]->id) projectLinesPerWeek($inc, $firstdaytoshow, $fuser, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||||
$level--;
|
$level--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
|
|
||||||
@ -127,6 +128,7 @@ if ($action == 'addtime' && $user->rights->projet->creer)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
$projectstatic=new Project($db);
|
$projectstatic=new Project($db);
|
||||||
$project = new Project($db);
|
$project = new Project($db);
|
||||||
$taskstatic = new Task($db);
|
$taskstatic = new Task($db);
|
||||||
@ -215,7 +217,7 @@ $restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJEC
|
|||||||
if (count($tasksarray) > 0)
|
if (count($tasksarray) > 0)
|
||||||
{
|
{
|
||||||
$j=0;
|
$j=0;
|
||||||
projectLinesPerTime($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
projectLinesPerDay($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -225,6 +227,10 @@ print "</table>";
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="center">';
|
||||||
|
print '<input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Save").'">';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,7 @@ $restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJEC
|
|||||||
if (count($tasksarray) > 0)
|
if (count($tasksarray) > 0)
|
||||||
{
|
{
|
||||||
$j=0;
|
$j=0;
|
||||||
projectLinesPerDay($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
projectLinesPerWeek($j, $firstdaytoshow, $usertoprocess, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||||
|
|
||||||
print '<tr class="liste_total">
|
print '<tr class="liste_total">
|
||||||
<td class="liste_total" colspan="7" align="right">'.$langs->trans("Total").'</td>
|
<td class="liste_total" colspan="7" align="right">'.$langs->trans("Total").'</td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user