mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Qual: Uniformize code to use new note system.
This commit is contained in:
@@ -1330,7 +1330,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Update private note of element
|
||||
* Update external ref of element
|
||||
*
|
||||
* @param string $ref_ext Update field ref_ext
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@@ -1376,7 +1376,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
// TODO uniformize fields note_private
|
||||
// TODO uniformize fields to note_private
|
||||
if ($this->table_element == 'fichinter' || $this->table_element == 'projet' || $this->table_element == 'projet_task')
|
||||
{
|
||||
$sql.= " SET note_private = '".$this->db->escape($note)."'";
|
||||
|
||||
@@ -75,9 +75,10 @@ class Form
|
||||
* @param object $object Object
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height', 'select:xxx'...)
|
||||
* @param string $moreparam More param to add on a href URL
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
function editfieldkey($text,$htmlname,$preselected,$object,$perm,$typeofdata='string')
|
||||
function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -103,7 +104,7 @@ class Form
|
||||
$ret.='<table class="nobordernopadding" width="100%"><tr><td nowrap="nowrap">';
|
||||
$ret.=$langs->trans($text);
|
||||
$ret.='</td>';
|
||||
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&id='.$object->id.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
||||
if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&id='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
|
||||
$ret.='</tr></table>';
|
||||
}
|
||||
|
||||
@@ -118,17 +119,14 @@ class Form
|
||||
* @param string $value Value to show/edit
|
||||
* @param object $object Object
|
||||
* @param boolean $perm Permission to allow button to edit parameter
|
||||
<<<<<<< HEAD
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:1:rows:cols', 'select:xxx'...)
|
||||
=======
|
||||
* @param string $typeofdata Type of data ('string' by default, 'email', 'numeric:99', 'text' or 'textarea', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:1', 'select:xxx'...)
|
||||
>>>>>>> branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git
|
||||
* @param string $editvalue When in edit mode, use this value as $value instead of value
|
||||
* @param object $extObject External object
|
||||
* @param string $success Success message
|
||||
* @param string $moreparam More param to add on a href URL
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
function editfieldval($text,$htmlname,$value,$object,$perm,$typeofdata='string',$editvalue='',$extObject=null,$success=null)
|
||||
function editfieldval($text, $htmlname, $value, $object, $perm, $typeofdata='string', $editvalue='', $extObject=null, $success=null, $moreparam='')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
|
||||
@@ -145,7 +143,7 @@ class Form
|
||||
if (GETPOST('action') == 'edit'.$htmlname)
|
||||
{
|
||||
$ret.="\n";
|
||||
$ret.='<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$ret.='<form method="post" action="'.$_SERVER["PHP_SELF"].($moreparam?'?'.$moreparam:'').'">';
|
||||
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
|
||||
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$ret.='<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
@@ -74,7 +74,7 @@ function project_prepare_head($object)
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/note.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
$head[$h][2] = 'note';
|
||||
$head[$h][2] = 'notes';
|
||||
$h++;
|
||||
|
||||
// Then tab for sub level of projet, i mean tasks
|
||||
@@ -113,17 +113,17 @@ function task_prepare_head($object)
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$head[$h][2] = 'task';
|
||||
$head[$h][2] = 'task_task';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans("TaskRessourceLinks");
|
||||
$head[$h][2] = 'contact';
|
||||
$head[$h][2] = 'task_contact';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans("TimeSpent");
|
||||
$head[$h][2] = 'time';
|
||||
$head[$h][2] = 'task_time';
|
||||
$h++;
|
||||
|
||||
// Show more tabs from modules
|
||||
@@ -138,12 +138,12 @@ function task_prepare_head($object)
|
||||
$listoffiles=dol_dir_list($filesdir,'files',1);
|
||||
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
$head[$h][2] = 'document';
|
||||
$head[$h][2] = 'task_document';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
|
||||
$head[$h][1] = $langs->trans('Notes');
|
||||
$head[$h][2] = 'note';
|
||||
$head[$h][2] = 'task_notes';
|
||||
$h++;
|
||||
|
||||
return $head;
|
||||
|
||||
@@ -19,12 +19,16 @@
|
||||
$module = $object->element;
|
||||
$note_public = 'note_public';
|
||||
$note_private = 'note';
|
||||
$colwidth=(empty($colwidth)?25:$colwidth);
|
||||
$permission=$user->rights->$module->creer;
|
||||
|
||||
$colwidth=(isset($colwidth)?$colwidth:25);
|
||||
$permission=(isset($permission)?$permission:$user->rights->$module->creer); // If already defined by caller page
|
||||
$moreparam=(isset($moreparam)?$moreparam:'');
|
||||
|
||||
// Special cases
|
||||
if ($module == 'propal') { $module = 'propale'; }
|
||||
elseif ($module == 'fichinter') { $module = 'ficheinter'; $note_private = 'note_private'; }
|
||||
if ($module == 'propal') { $permission=$user->rights->propale->creer; }
|
||||
elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer; $note_private = 'note_private'; }
|
||||
elseif ($module == 'project') { $note_private = 'note_private'; }
|
||||
elseif ($module == 'project_task') { $note_private = 'note_private'; }
|
||||
elseif ($module == 'invoice_supplier') { $permission=$user->rights->fournisseur->facture->creer; }
|
||||
elseif ($module == 'order_supplier') { $permission=$user->rights->fournisseur->commande->creer; }
|
||||
|
||||
@@ -35,13 +39,13 @@ else $typeofdata='textarea:12:100';
|
||||
<!-- BEGIN PHP TEMPLATE NOTES -->
|
||||
<div class="table-border">
|
||||
<div class="table-border-row">
|
||||
<div class="table-key-border-col"<?php echo ' style="width: '.$colwidth.'%"'; ?>><?php echo $form->editfieldkey("NotePublic",$note_public,$object->note_public,$object,$permission,$typeofdata); ?></div>
|
||||
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePublic",$note_public,$object->note_public,$object,$permission,$typeofdata); ?></div>
|
||||
<div class="table-key-border-col"<?php echo ' style="width: '.$colwidth.'%"'; ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $object->note_public, $object, $permission, $typeofdata, $moreparam); ?></div>
|
||||
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $object->note_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
|
||||
</div>
|
||||
<?php if (! $user->societe_id) { ?>
|
||||
<div class="table-border-row">
|
||||
<div class="table-key-border-col"<?php echo ' style="width: '.$colwidth.'%"'; ?>><?php echo $form->editfieldkey("NotePrivate",$note_private,$object->note_private,$object,$permission,$typeofdata); ?></div>
|
||||
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePrivate",$note_private,$object->note_private,$object,$permission,$typeofdata); ?></div>
|
||||
<div class="table-key-border-col"<?php echo ' style="width: '.$colwidth.'%"'; ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $object->note_private, $object, $permission, $typeofdata, $moreparam); ?></div>
|
||||
<div class="table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $object->note_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -91,7 +91,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
|
||||
|
||||
print '</div>';
|
||||
dol_fiche_end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ if ($id > 0 || ! empty($ref))
|
||||
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
|
||||
|
||||
$head = project_prepare_head($project);
|
||||
dol_fiche_head($head, 'note', $langs->trans('Project'), 0, ($project->public?'projectpub':'project'));
|
||||
dol_fiche_head($head, 'notes', $langs->trans('Project'), 0, ($project->public?'projectpub':'project'));
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ if ($id > 0 || ! empty($ref))
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$head = task_prepare_head($task);
|
||||
dol_fiche_head($head, 'contact', $langs->trans("Task"), 0, 'projecttask');
|
||||
dol_fiche_head($head, 'task_contact', $langs->trans("Task"), 0, 'projecttask');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -187,7 +187,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
$head = task_prepare_head($task);
|
||||
dol_fiche_head($head, 'document', $langs->trans("Task"), 0, 'projecttask');
|
||||
dol_fiche_head($head, 'task_document', $langs->trans("Task"), 0, 'projecttask');
|
||||
|
||||
$param=(GETPOST('withproject')?'&withproject=1':'');
|
||||
$linkback=GETPOST('withproject')?'<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$project->id.'">'.$langs->trans("BackToList").'</a>':'';
|
||||
|
||||
@@ -32,7 +32,7 @@ $action=GETPOST('action');
|
||||
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||
$id = GETPOST('id','int');
|
||||
$ref= GETPOST('ref');
|
||||
$ref= GETPOST('ref', 'alpha');
|
||||
$withproject=GETPOST('withproject');
|
||||
|
||||
// Security check
|
||||
@@ -41,51 +41,28 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
if (!$user->rights->projet->lire) accessforbidden();
|
||||
//$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification
|
||||
|
||||
$object = new Task($db);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* Actions */
|
||||
/******************************************************************************/
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'update_public' && $user->rights->projet->creer)
|
||||
if ($action == 'setnote_public' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$task = new Task($db);
|
||||
$task->fetch($id);
|
||||
|
||||
$db->begin();
|
||||
|
||||
$res=$task->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
if ($res < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$task->error.'</div>';
|
||||
$db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
$result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
if ($action == 'update_private' && $user->rights->projet->creer)
|
||||
else if ($action == 'setnote_private' && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$task = new Task($db);
|
||||
$task->fetch($id);
|
||||
|
||||
$db->begin();
|
||||
|
||||
$res=$task->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
if ($res < 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$task->error.'</div>';
|
||||
$db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES));
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -94,165 +71,113 @@ llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$project = new Project($db);
|
||||
$task = new Task($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($task->fetch($id, $ref) > 0)
|
||||
$result=$project->fetch($object->fk_project);
|
||||
if (! empty($project->socid)) $project->societe->fetch($project->socid);
|
||||
|
||||
$userWrite = $project->restrictedProjectArea($user,'write');
|
||||
|
||||
if ($withproject)
|
||||
{
|
||||
$result=$project->fetch($task->fk_project);
|
||||
if (! empty($project->socid)) $project->societe->fetch($project->socid);
|
||||
// Tabs for project
|
||||
$tab='tasks';
|
||||
$head=project_prepare_head($project);
|
||||
dol_fiche_head($head, $tab, $langs->trans("Project"),0,($project->public?'projectpub':'project'));
|
||||
|
||||
$userWrite = $project->restrictedProjectArea($user,'write');
|
||||
|
||||
if ($withproject)
|
||||
{
|
||||
// Tabs for project
|
||||
$tab='tasks';
|
||||
$head=project_prepare_head($project);
|
||||
dol_fiche_head($head, $tab, $langs->trans("Project"),0,($project->public?'projectpub':'project'));
|
||||
|
||||
$param=($mode=='mine'?'&mode=mine':'');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">';
|
||||
print $langs->trans("Ref");
|
||||
print '</td><td>';
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (! $user->rights->projet->all->lire)
|
||||
{
|
||||
$projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,0);
|
||||
$project->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
|
||||
}
|
||||
print $form->showrefnav($project,'ref','',1,'ref','ref','',$param);
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$project->title.'</td></tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
if (! empty($project->societe->id)) print $project->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($project->public) print $langs->trans('SharedProject');
|
||||
else print $langs->trans('PrivateProject');
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$project->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$head = task_prepare_head($task);
|
||||
dol_fiche_head($head, 'note', $langs->trans('Task'), 0, 'projecttask');
|
||||
$param=($mode=='mine'?'&mode=mine':'');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$param=(GETPOST('withproject')?'&withproject=1':'');
|
||||
$linkback=GETPOST('withproject')?'<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$project->id.'">'.$langs->trans("BackToList").'</a>':'';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||
if (! GETPOST('withproject') || empty($project->id))
|
||||
print '<tr><td width="30%">';
|
||||
print $langs->trans("Ref");
|
||||
print '</td><td>';
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (! $user->rights->projet->all->lire)
|
||||
{
|
||||
$projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1);
|
||||
$task->next_prev_filter=" fk_projet in (".$projectsListId.")";
|
||||
$projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,0);
|
||||
$project->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
|
||||
}
|
||||
else $task->next_prev_filter=" fk_projet = ".$project->id;
|
||||
print $form->showrefnav($task,'id',$linkback,1,'rowid','ref','',$param);
|
||||
print $form->showrefnav($project,'ref','',1,'ref','ref','',$param);
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$task->label.'</td></tr>';
|
||||
|
||||
// Project
|
||||
if (empty($withproject))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
print $project->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$project->title.'</td></tr>';
|
||||
|
||||
// Third party
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
if ($project->societe->id > 0) print $project->societe->getNomUrl(1);
|
||||
else print' ';
|
||||
print '</td></tr>';
|
||||
}
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
if (! empty($project->societe->id)) print $project->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Note public
|
||||
print '<tr><td valign="top">'.$langs->trans("NotePublic").'</td>';
|
||||
print '<td valign="top" colspan="3">';
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$task->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update_public">';
|
||||
print '<textarea name="note_public" cols="80" rows="8">'.$task->note_public."</textarea><br>";
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ($task->note_public?nl2br($task->note_public):" ");
|
||||
}
|
||||
print "</td></tr>";
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($project->public) print $langs->trans('SharedProject');
|
||||
else print $langs->trans('PrivateProject');
|
||||
print '</td></tr>';
|
||||
|
||||
// Note private
|
||||
if (! $user->societe_id)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("NotePrivate").'</td>';
|
||||
print '<td valign="top" colspan="3">';
|
||||
if ($_GET["action"] == 'edit')
|
||||
{
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$task->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update_private">';
|
||||
print '<textarea name="note_private" cols="80" rows="8">'.$task->note_private."</textarea><br>";
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print ($task->note_private?nl2br($task->note_private):" ");
|
||||
}
|
||||
print "</td></tr>";
|
||||
}
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$project->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (($user->rights->projet->creer || $user->rights->projet->all->creer) && $_GET['action'] <> 'edit')
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$task->id.'&action=edit">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('Modify').'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$head = task_prepare_head($object);
|
||||
dol_fiche_head($head, 'task_notes', $langs->trans('Task'), 0, 'projecttask');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$param=(GETPOST('withproject')?'&withproject=1':'');
|
||||
$linkback=GETPOST('withproject')?'<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$project->id.'">'.$langs->trans("BackToList").'</a>':'';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
|
||||
if (! GETPOST('withproject') || empty($project->id))
|
||||
{
|
||||
$projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1);
|
||||
$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
|
||||
}
|
||||
else $object->next_prev_filter=" fk_projet = ".$project->id;
|
||||
print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param);
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||
|
||||
// Project
|
||||
if (empty($withproject))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td colspan="3">';
|
||||
print $project->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Third party
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td>';
|
||||
if ($project->societe->id > 0) print $project->societe->getNomUrl(1);
|
||||
else print' ';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
$colwidth=30;
|
||||
$permission=($user->rights->projet->creer || $user->rights->projet->all->creer);
|
||||
$moreparam=$param;
|
||||
include(DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php');
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -208,7 +208,7 @@ if ($taskid)
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$head=task_prepare_head($task);
|
||||
dol_fiche_head($head, 'task', $langs->trans("Task"),0,'projecttask');
|
||||
dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
|
||||
|
||||
if ($action == 'edit' && $user->rights->projet->creer)
|
||||
{
|
||||
|
||||
@@ -216,7 +216,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
$head=task_prepare_head($task);
|
||||
dol_fiche_head($head, 'time', $langs->trans("Task"),0,'projecttask');
|
||||
dol_fiche_head($head, 'task_time', $langs->trans("Task"),0,'projecttask');
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user