Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5
This commit is contained in:
commit
1caf39ad22
@ -15,7 +15,9 @@ Fix: [ bug #1528 ] Leopard Services numeration module description is not transla
|
|||||||
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas
|
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas
|
||||||
Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances
|
Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances
|
||||||
Fix: Update impayees.php
|
Fix: Update impayees.php
|
||||||
Fix: Fix Link product, In list view and label product
|
Fix: Link product, In list view and label product
|
||||||
|
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
|
||||||
|
Fix: When disabled, all fields to add time into task line must be disabled.
|
||||||
|
|
||||||
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
|
||||||
Fix: Hide title of event when agenda module disabled.
|
Fix: Hide title of event when agenda module disabled.
|
||||||
|
|||||||
@ -2755,7 +2755,7 @@ class Form
|
|||||||
* Show a form to select a project
|
* Show a form to select a project
|
||||||
*
|
*
|
||||||
* @param int $page Page
|
* @param int $page Page
|
||||||
* @param int $socid Id third party
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* @param int $selected Id pre-selected project
|
* @param int $selected Id pre-selected project
|
||||||
* @param string $htmlname Name of select field
|
* @param string $htmlname Name of select field
|
||||||
* @return void
|
* @return void
|
||||||
@ -3713,7 +3713,7 @@ class Form
|
|||||||
}
|
}
|
||||||
elseif ($typehour=='text')
|
elseif ($typehour=='text')
|
||||||
{
|
{
|
||||||
print '<input type="text" size="3" name="'.$prefix.'hour" class="flat" value="'.((int) $hourSelected).'">';
|
print '<input type="text" size="3" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').' class="flat" value="'.((int) $hourSelected).'">';
|
||||||
}
|
}
|
||||||
print $langs->trans('Hours'). " ";
|
print $langs->trans('Hours'). " ";
|
||||||
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';
|
print '<select class="flat" name="'.$prefix.'min"'.($disabled?' disabled="disabled"':'').'>';
|
||||||
|
|||||||
@ -422,16 +422,17 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
|||||||
/**
|
/**
|
||||||
* Output a task line
|
* Output a task line
|
||||||
*
|
*
|
||||||
* @param string &$inc ?
|
* @param string &$inc ?
|
||||||
* @param string $parent ?
|
* @param string $parent ?
|
||||||
* @param Object $lines ?
|
* @param Object $lines ?
|
||||||
* @param int &$level ?
|
* @param int &$level ?
|
||||||
* @param string &$projectsrole ?
|
* @param string &$projectsrole ?
|
||||||
* @param string &$tasksrole ?
|
* @param string &$tasksrole ?
|
||||||
* @param int $mytask 0 or 1 to enable only if task is a task i am affected to
|
* @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
|
* @return $inc
|
||||||
*/
|
*/
|
||||||
function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mytask=0)
|
function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $mine, $restricteditformytask=0)
|
||||||
{
|
{
|
||||||
global $user, $bc, $langs;
|
global $user, $bc, $langs;
|
||||||
global $form, $projectstatic, $taskstatic;
|
global $form, $projectstatic, $taskstatic;
|
||||||
@ -454,99 +455,104 @@ function projectLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksr
|
|||||||
$lastprojectid=$lines[$i]->fk_project;
|
$lastprojectid=$lines[$i]->fk_project;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">\n";
|
// If we want all or we have a role on task, we show it
|
||||||
|
if (empty($mine) || ! empty($tasksrole[$lines[$i]->id]))
|
||||||
// Project
|
|
||||||
print "<td>";
|
|
||||||
$projectstatic->id=$lines[$i]->fk_project;
|
|
||||||
$projectstatic->ref=$lines[$i]->projectref;
|
|
||||||
$projectstatic->public=$lines[$i]->public;
|
|
||||||
$projectstatic->label=$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project];
|
|
||||||
print $projectstatic->getNomUrl(1);
|
|
||||||
print "</td>";
|
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<td>';
|
|
||||||
$taskstatic->id=$lines[$i]->id;
|
|
||||||
$taskstatic->ref=$lines[$i]->id;
|
|
||||||
print $taskstatic->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Label task
|
|
||||||
print "<td>";
|
|
||||||
for ($k = 0 ; $k < $level ; $k++)
|
|
||||||
{
|
{
|
||||||
print " ";
|
print "<tr ".$bc[$var].">\n";
|
||||||
}
|
|
||||||
$taskstatic->id=$lines[$i]->id;
|
// Project
|
||||||
$taskstatic->ref=$lines[$i]->label;
|
print "<td>";
|
||||||
print $taskstatic->getNomUrl(0);
|
$projectstatic->id=$lines[$i]->fk_project;
|
||||||
print "</td>\n";
|
$projectstatic->ref=$lines[$i]->projectref;
|
||||||
|
$projectstatic->public=$lines[$i]->public;
|
||||||
// Date start
|
$projectstatic->label=$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project];
|
||||||
print '<td align="center">';
|
print $projectstatic->getNomUrl(1);
|
||||||
print dol_print_date($lines[$i]->date_start,'day');
|
print "</td>";
|
||||||
print '</td>';
|
|
||||||
|
// Ref
|
||||||
// Date end
|
print '<td>';
|
||||||
print '<td align="center">';
|
$taskstatic->id=$lines[$i]->id;
|
||||||
print dol_print_date($lines[$i]->date_end,'day');
|
$taskstatic->ref=$lines[$i]->id;
|
||||||
print '</td>';
|
print $taskstatic->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
// Planned Workload
|
|
||||||
print '<td align="right">';
|
// Label task
|
||||||
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
|
print "<td>";
|
||||||
else print '--:--';
|
for ($k = 0 ; $k < $level ; $k++)
|
||||||
print '</td>';
|
{
|
||||||
|
print " ";
|
||||||
// Progress declared %
|
}
|
||||||
print '<td align="right">';
|
$taskstatic->id=$lines[$i]->id;
|
||||||
print $lines[$i]->progress.' %';
|
$taskstatic->ref=$lines[$i]->label;
|
||||||
print '</td>';
|
print $taskstatic->getNomUrl(0);
|
||||||
|
print "</td>\n";
|
||||||
// Time spent
|
|
||||||
print '<td align="right">';
|
// Date start
|
||||||
if ($lines[$i]->duration)
|
print '<td align="center">';
|
||||||
{
|
print dol_print_date($lines[$i]->date_start,'dayhour');
|
||||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
print '</td>';
|
||||||
print convertSecondToTime($lines[$i]->duration,'allhourmin');
|
|
||||||
print '</a>';
|
// Date end
|
||||||
}
|
print '<td align="center">';
|
||||||
else print '--:--';
|
print dol_print_date($lines[$i]->date_end,'dayhour');
|
||||||
print "</td>\n";
|
print '</td>';
|
||||||
|
|
||||||
$disabledproject=1;$disabledtask=1;
|
// Planned Workload
|
||||||
//print "x".$lines[$i]->fk_project;
|
print '<td align="right">';
|
||||||
//var_dump($lines[$i]);
|
if ($lines[$i]->planned_workload) print convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
|
||||||
//var_dump($projectsrole[$lines[$i]->fk_project]);
|
else print '--:--';
|
||||||
// If at least one role for project
|
print '</td>';
|
||||||
if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
|
|
||||||
{
|
// Progress declared %
|
||||||
$disabledproject=0;
|
print '<td align="right">';
|
||||||
$disabledtask=0;
|
print $lines[$i]->progress.' %';
|
||||||
}
|
print '</td>';
|
||||||
// If mytask and no role on task
|
|
||||||
if ($mytask && empty($tasksrole[$lines[$i]->id]))
|
// Time spent
|
||||||
{
|
print '<td align="right">';
|
||||||
$disabledtask=1;
|
if ($lines[$i]->duration)
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
||||||
|
print convertSecondToTime($lines[$i]->duration,'allhourmin');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
else print '--:--';
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
$disabledproject=1;$disabledtask=1;
|
||||||
|
//print "x".$lines[$i]->fk_project;
|
||||||
|
//var_dump($lines[$i]);
|
||||||
|
//var_dump($projectsrole[$lines[$i]->fk_project]);
|
||||||
|
// If at least one role for project
|
||||||
|
if ($lines[$i]->public || ! empty($projectsrole[$lines[$i]->fk_project]) || $user->rights->projet->all->creer)
|
||||||
|
{
|
||||||
|
$disabledproject=0;
|
||||||
|
$disabledtask=0;
|
||||||
|
}
|
||||||
|
// If $restricteditformytask is on and I have no role on task, i disable edit
|
||||||
|
if ($restricteditformytask && empty($tasksrole[$lines[$i]->id]))
|
||||||
|
{
|
||||||
|
$disabledtask=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td class="nowrap">';
|
||||||
|
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask);
|
||||||
|
$s.=' ';
|
||||||
|
$s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text');
|
||||||
|
$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
||||||
|
print $s;
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">';
|
||||||
|
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
|
||||||
|
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="nowrap">';
|
|
||||||
$s =$form->select_date('',$lines[$i]->id,'','','',"addtime",1,0,1,$disabledtask);
|
|
||||||
$s.=' ';
|
|
||||||
$s.=$form->select_duration($lines[$i]->id,'',$disabledtask,'text');
|
|
||||||
$s.=' <input type="submit" class="button"'.($disabledtask?' disabled="disabled"':'').' value="'.$langs->trans("Add").'">';
|
|
||||||
print $s;
|
|
||||||
print '</td>';
|
|
||||||
print '<td align="right">';
|
|
||||||
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("YouAreNotContactOfProject"));
|
|
||||||
else if ($disabledtask) print $form->textwithpicto('',$langs->trans("TaskIsNotAffectedToYou"));
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
$inc++;
|
$inc++;
|
||||||
$level++;
|
$level++;
|
||||||
if ($lines[$i]->id) projectLinesb($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mytask);
|
if ($lines[$i]->id) projectLinesb($inc, $lines[$i]->id, $lines, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||||
$level--;
|
$level--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1287,18 +1287,8 @@ if ($action == 'create')
|
|||||||
$form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
|
$form->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Project
|
// Public note
|
||||||
if (! empty($conf->projet->enabled))
|
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
||||||
{
|
|
||||||
$formproject=new FormProjets($db);
|
|
||||||
|
|
||||||
$langs->load('projects');
|
|
||||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
|
||||||
$formproject->select_projects(-1, $projectid, 'projectid');
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
|
$doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70);
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
@ -1822,11 +1812,11 @@ else
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'classify')
|
if ($action == 'classify')
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,'projectid');
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1', $object->fk_project, 'projectid');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,'none');
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -114,8 +114,6 @@ $title=$langs->trans("TimeSpent");
|
|||||||
if ($mine) $title=$langs->trans("MyTimeSpent");
|
if ($mine) $title=$langs->trans("MyTimeSpent");
|
||||||
|
|
||||||
|
|
||||||
llxHeader("",$title,"");
|
|
||||||
|
|
||||||
//$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1);
|
//$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1);
|
||||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all project i have permission on. I want my tasks and some of my task may be on a public projet that is not my project
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all project i have permission on. I want my tasks and some of my task may be on a public projet that is not my project
|
||||||
|
|
||||||
@ -133,6 +131,9 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($project->id?$pr
|
|||||||
//var_dump($taskrole);
|
//var_dump($taskrole);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
llxHeader("",$title,"");
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num);
|
||||||
|
|
||||||
|
|
||||||
@ -156,8 +157,18 @@ print '<td align="right">'.$langs->trans("Progress").'</td>';
|
|||||||
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
|
||||||
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
|
print '<td colspan="2">'.$langs->trans("AddDuration").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
projectLinesb($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine);
|
|
||||||
|
|
||||||
|
// By default, we can edit only tasks we are assigned to
|
||||||
|
$restricteditformytask=(empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS)?1:0);
|
||||||
|
|
||||||
|
if (count($tasksarray) > 0)
|
||||||
|
{
|
||||||
|
projectLinesb($j, 0, $tasksarray, $level, $projectsrole, $tasksrole, $mine, $restricteditformytask);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td colspan="10">'.$langs->trans("NoTasks").'</td></tr>';
|
||||||
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,8 @@ if ($action == 'addtimespent' && $user->rights->projet->creer)
|
|||||||
}
|
}
|
||||||
if (empty($_POST["userid"]))
|
if (empty($_POST["userid"]))
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans('ErrorUserNotAffectedToTask'),'errors');
|
$langs->load("errors");
|
||||||
|
setEventMessage($langs->trans('ErrorUserNotAssignedToTask'),'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,9 +328,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Contributor
|
// Contributor
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$contactoftask=$object->getListContactId('internal');
|
$restrictaddtimetocontactoftask=0;
|
||||||
|
if (empty($conf->global->PROJECT_TIME_ON_ALL_TASKS_MY_PROJECTS))
|
||||||
|
{
|
||||||
|
$restrictaddtimetocontactoftask=$object->getListContactId('internal');
|
||||||
|
}
|
||||||
print img_object('','user');
|
print img_object('','user');
|
||||||
print $form->select_dolusers($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$contactoftask);
|
print $form->select_dolusers($_POST["userid"]?$_POST["userid"]:$user->id,'userid',0,'',0,'',$restrictaddtimetocontactoftask); // Note: If user is not allowed it will be disabled into combo list and userid not posted
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user