2
0
forked from Wavyzz/dolibarr

Look and feel v6

This commit is contained in:
Laurent Destailleur
2017-05-18 12:12:36 +02:00
parent 0b52c43e05
commit a36a9fab2f
10 changed files with 104 additions and 160 deletions

View File

@@ -479,7 +479,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
if ($lines[$i]->planned_workload || $lines[$i]->duration)
{
if ($lines[$i]->planned_workload) print round(100 * $lines[$i]->duration / $lines[$i]->planned_workload,2).' %';
else print $langs->trans('WorkloadNotDefined');
else print '<span class="opacitymedium">'.$langs->trans('WorkloadNotDefined').'</span>';
}
print '</td>';

View File

@@ -711,7 +711,7 @@ elseif ($object->id > 0)
print '<input type="hidden" name="comefromclone" value="'.$comefromclone.'">';
$head=project_prepare_head($object);
dol_fiche_head($head, 'project', $langs->trans("Project"),0,($object->public?'projectpub':'project'));
dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public?'projectpub':'project'));
if ($action == 'edit' && $userWrite > 0)
{

View File

@@ -127,7 +127,7 @@ class Task extends CommonObject
$sql.= ", ".$user->id;
$sql.= ", ".($this->date_start!=''?"'".$this->db->idate($this->date_start)."'":'null');
$sql.= ", ".($this->date_end!=''?"'".$this->db->idate($this->date_end)."'":'null');
$sql.= ", ".($this->planned_workload!=''?$this->planned_workload:0);
$sql.= ", ".(($this->planned_workload!='' && $this->planned_workload >= 0)?$this->planned_workload:'null');
$sql.= ", ".(($this->progress!='' && $this->progress >= 0)?$this->progress:'null');
$sql.= ")";

View File

@@ -123,7 +123,7 @@ $userstatic=new User($db);
$userAccess = $object->restrictedProjectArea($user);
$head=project_prepare_head($object);
dol_fiche_head($head, 'element', $langs->trans("Project"),0,($object->public?'projectpub':'project'));
dol_fiche_head($head, 'element', $langs->trans("Project"), -1, ($object->public?'projectpub':'project'));
// Project card
@@ -231,6 +231,7 @@ print '<div class="clearboth"></div>';
dol_fiche_end();
print '<br>';
/*
* Referers types

View File

@@ -92,9 +92,12 @@ if ($action == 'createtask' && $user->rights->projet->creer)
{
$error=0;
$date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user');
$date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user');
// If we use user timezone, we must change also view/list to use user timezone everywhere
//$date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user');
//$date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user');
$date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear']);
$date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear']);
if (! $cancel)
{
if (empty($taskref))
@@ -215,7 +218,7 @@ if ($id > 0 || ! empty($ref))
$tab=GETPOST('tab')?GETPOST('tab'):'tasks';
$head=project_prepare_head($object);
dol_fiche_head($head, $tab, $langs->trans("Project"), 0, ($object->public?'projectpub':'project'));
dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public?'projectpub':'project'));
$param='';
if ($search_user_id > 0) $param.='&search_user_id='.dol_escape_htmltag($search_user_id);

View File

@@ -293,33 +293,23 @@ if ($id > 0 || ! empty($ref))
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
$morehtmlref='';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1);
if (empty($withproject))
// Project
if (empty($withproject))
{
print '<div class="fichecenter">';
$morehtmlref.='<div class="refidno">';
$morehtmlref.=$langs->trans("Project").': ';
$morehtmlref.=$projectstatic->getNomUrl(1);
$morehtmlref.='<br>';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Project
print '<tr><td class="titlefield">'.$langs->trans("Project").'</td><td>';
print $projectstatic->getNomUrl(1);
print '</td></tr>';
// Customer
print "<tr><td>".$langs->trans("ThirdParty")."</td>";
print '<td colspan="3">';
if ($projectstatic->thirdparty->id > 0) print $projectstatic->thirdparty->getNomUrl(1);
else print '&nbsp;';
print '</td></tr>';
print "</table>";
print '</div>';
// Third party
$morehtmlref.=$langs->trans("ThirdParty").': ';
$morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
$morehtmlref.='</div>';
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param, 0, '', '', 1);
dol_fiche_end();
/*

View File

@@ -239,6 +239,21 @@ if ($object->id > 0)
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
$morehtmlref='';
// Project
if (empty($withproject))
{
$morehtmlref.='<div class="refidno">';
$morehtmlref.=$langs->trans("Project").': ';
$morehtmlref.=$projectstatic->getNomUrl(1);
$morehtmlref.='<br>';
// Third party
$morehtmlref.=$langs->trans("ThirdParty").': ';
$morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
$morehtmlref.='</div>';
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
print '<div class="fichecenter">';
@@ -246,39 +261,6 @@ if ($object->id > 0)
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Ref
/*
print '<tr><td class="titlefield">';
print $langs->trans("Ref");
print '</td><td colspan="3">';
if (empty($withproject) || empty($projectstatic->id))
{
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
}
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
print '</td>';
print '</tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
*/
// Project
if (empty($withproject))
{
print '<tr><td class="titlefield">'.$langs->trans("Project").'</td><td colspan="3">';
print $projectstatic->getNomUrl(1);
print '</td></tr>';
// Third party
print '<td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
if ($projectstatic->thirdparty->id) print $projectstatic->thirdparty->getNomUrl(1);
else print '&nbsp;';
print '</td></tr>';
}
// Files infos
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';

View File

@@ -211,43 +211,26 @@ if ($object->id > 0)
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
$morehtmlref='';
// Project
if (empty($withproject))
{
$morehtmlref.='<div class="refidno">';
$morehtmlref.=$langs->trans("Project").': ';
$morehtmlref.=$projectstatic->getNomUrl(1);
$morehtmlref.='<br>';
// Third party
$morehtmlref.=$langs->trans("ThirdParty").': ';
$morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
$morehtmlref.='</div>';
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
/*
// Ref
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
if (empty($withproject) || empty($projectstatic->id))
{
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
}
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
print $form->showrefnav($object,'ref',$linkback,1,'ref','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 $projectstatic->getNomUrl(1);
print '</td></tr>';
// Third party
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
if ($projectstatic->thirdparty->id > 0) print $projectstatic->thirdparty->getNomUrl(1);
else print'&nbsp;';
print '</td></tr>';
}
print "</table>";
$cssclass='titlefield';
$moreparam=$param;

View File

@@ -447,6 +447,21 @@ if ($id > 0 || ! empty($ref))
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
$morehtmlref='';
// Project
if (empty($withproject))
{
$morehtmlref.='<div class="refidno">';
$morehtmlref.=$langs->trans("Project").': ';
$morehtmlref.=$projectstatic->getNomUrl(1);
$morehtmlref.='<br>';
// Third party
$morehtmlref.=$langs->trans("ThirdParty").': ';
$morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
$morehtmlref.='</div>';
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
print '<div class="fichecenter">';
@@ -454,39 +469,6 @@ if ($id > 0 || ! empty($ref))
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
/*
// Ref
print '<tr><td class="titlefield">';
print $langs->trans("Ref");
print '</td><td colspan="3">';
if (! GETPOST('withproject') || empty($projectstatic->id))
{
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
}
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
print '</td>';
print '</tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
*/
// Project
if (empty($withproject))
{
print '<tr><td class="titlefield">'.$langs->trans("Project").'</td><td colspan="3">';
print $projectstatic->getNomUrl(1);
print '</td></tr>';
// Third party
print '<td>'.$langs->trans("ThirdParty").'</td><td colspan="3">';
if ($projectstatic->societe->id) print $projectstatic->societe->getNomUrl(1);
else print '&nbsp;';
print '</td></tr>';
}
// Date start - Date end
print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td colspan="3">';
$start = dol_print_date($object->date_start,'dayhour');

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
*
@@ -442,27 +442,31 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
$morehtmlref='';
// Project
if (empty($withproject))
{
$morehtmlref.='<div class="refidno">';
$morehtmlref.=$langs->trans("Project").': ';
$morehtmlref.=$projectstatic->getNomUrl(1);
$morehtmlref.='<br>';
// Third party
$morehtmlref.=$langs->trans("ThirdParty").': ';
$morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
$morehtmlref.='</div>';
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Ref
/*
print '<tr><td class="titlefield">';
print $langs->trans("Ref");
print '</td><td colspan="3">';
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
print '</td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
*/
// Date start - Date end
print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td colspan="3">';
print '<tr><td class="titlefield">'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
$start = dol_print_date($object->date_start,'dayhour');
print ($start?$start:'?');
$end = dol_print_date($object->date_end,'dayhour');
@@ -472,17 +476,25 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '</td></tr>';
// Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print convertSecondToTime($object->planned_workload,'allhourmin');
print '</td></tr>';
print '</table>';
print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
// Progress declared
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td>';
print $object->progress.' %';
print '</td></tr>';
// Progress calculated
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td>';
if ($object->planned_workload)
{
$tmparray=$object->getSummaryOfTimeSpent();
@@ -492,23 +504,14 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
else print '';
print '</td></tr>';
// Project
if (empty($withproject))
{
print '<tr><td>'.$langs->trans("Project").'</td><td>';
print $projectstatic->getNomUrl(1);
print '</td></tr>';
// Third party
print '<td>'.$langs->trans("ThirdParty").'</td><td>';
if ($projectstatic->thirdparty->id) print $projectstatic->thirdparty->getNomUrl(1);
else print '&nbsp;';
print '</td></tr>';
}
print '</table>';
print '</div>';
print '</div>';
print '</div>';
print '</div>';
print '<div class="clearboth"></div>';
dol_fiche_end();