diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 68fb0f602db..fafb4ce51fe 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2146,7 +2146,8 @@ class Facture extends CommonInvoice if (!empty($conf->global->INVOICE_USE_SITUATION)) { $final = True; - while ($i < count($this->lines) && $final == True) { + $nboflines = count($this->lines); + while (($i < $nboflines) && $final) { $final = ($this->lines[$i]->situation_percent == 100); $i++; } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 5485834ea26..c4f1f7df615 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -106,45 +106,45 @@ if ($object->id > 0) $totalsize+=$file['size']; } - print ''; - + + // Project card + $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; + if (! $user->rights->projet->all->lire) + { + $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); + $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; + } + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; - // Label - print '
'; - - // Company - print ''; - - // Visibility - print ''; - - // Statut - print ''; + print '
'.$langs->trans("Ref").''; + + $morehtmlref='
'; + // Title + $morehtmlref.=$object->title; + // Thirdparty + if ($object->thirdparty->id > 0) + { + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref.='
'; + // Define a complementary filter for search of next/prev ref. - if (! $user->rights->projet->all->lire) - { - $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0); - $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")"; - } - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; - if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1); - else print ' '; - print '
'.$langs->trans("Visibility").''; - if ($object->public) print $langs->trans('SharedProject'); - else print $langs->trans('PrivateProject'); - print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; // Files infos print ''; print ''; print "
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
\n"; - print "\n"; + + print ''; + + dol_fiche_end(); $modulepart = 'project'; $permission = ($userWrite > 0); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 40cf0c9e7e0..4760f9d91aa 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -23,7 +23,7 @@ /** * \file htdocs/projet/element.php - * \ingroup projet facture + * \ingroup projet * \brief Page of project referrers */ @@ -121,11 +121,37 @@ $head=project_prepare_head($object); dol_fiche_head($head, 'element', $langs->trans("Project"),0,($object->public?'projectpub':'project')); -print ''; +// Project card $linkback = ''.$langs->trans("BackToList").''; -print '
'.$langs->trans("Ref").''; +$morehtmlref='
'; +// Title +$morehtmlref.=$object->title; +// Thirdparty +if ($object->thirdparty->id > 0) +{ + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); +} +$morehtmlref.='
'; + +// Define a complementary filter for search of next/prev ref. +if (! $user->rights->projet->all->lire) +{ + $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); + $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; +} + +dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + +print '
'; +print '
'; +print '
'; + +print ''; + +/*print ''; print ''; - +print '';*/ // Visibility -print ''; // Statut -print ''; - -// Date start -print ''; - -// Date end -print ''; +//print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { @@ -169,19 +184,65 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) if ($code) print $langs->trans("OppStatus".$code); print ''; + // Opportunity percent + print ''; + // Opportunity Amount print ''; } -// Budget -print ''; + +// Date end +print ''; +// Budget +print ''; + +// Other attributes +$cols = 2; +include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + print '
'.$langs->trans("Ref").''; // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { @@ -140,26 +166,15 @@ print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1); else print ' '; -print '
'.$langs->trans("Visibility").''; +print '
'.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("DateStart").''; -print dol_print_date($object->date_start,'day'); -print '
'.$langs->trans("DateEnd").''; -print dol_print_date($object->date_end,'day'); -print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("OpportunityProbability").''; + if (strcmp($object->opp_percent,'')) print price($object->opp_percent,'',$langs,1,0).' %'; + print '
'.$langs->trans("OpportunityAmount").''; - if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); + if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,1,0,0,$conf->currency); print '
'.$langs->trans("Budget").''; -if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); +// Date start +print '
'.$langs->trans("DateStart").''; +print dol_print_date($object->date_start,'day'); +print '
'.$langs->trans("DateEnd").''; +print dol_print_date($object->date_end,'day'); print '
'.$langs->trans("Budget").''; +if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,1,0,0,$conf->currency); +print '
'; +print '
'; +print '
'; +print '
'; +print '
'; + +print ''; + +// Description +print ''; + +// Categories +if($conf->categorie->enabled) { + print '"; +} + +print '
'.$langs->trans("Description").''; +print nl2br($object->description); +print '
'.$langs->trans("Categories").''; + print $form->showCategories($object->id,'project',1); + print "
'; + +print '
'; +print '
'; +print '
'; + +print '
'; + dol_fiche_end(); diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index e26a56c3cc7..c7ab28e38ae 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -98,58 +98,134 @@ if ($id > 0 || ! empty($ref)) $param=($mode=='mine'?'&mode=mine':''); - print ''; + + // Project card + $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - print ''; - - print ''; - print ''; - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + print '
'; + + print '
'; - print $langs->trans("Ref"); - print ''; + + $morehtmlref='
'; + // Title + $morehtmlref.=$object->title; + // Thirdparty + if ($object->thirdparty->id > 0) + { + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref.='
'; + // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { - $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0); - $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")"; + $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); + $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param); - print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; - if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1); - else print ' '; - print '
'; + + + // Ref + /* + print ''; + */ + + // Label + //print ''; + + // Third party + /* + print ''; + */ + // Visibility - print ''; - + // Statut - print ''; - - // Date start - print ''; - - // Date end - print ''; - - // Budget - print ''; - + //print ''; + + if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + // Opportunity status + print ''; + + // Opportunity percent + print ''; + + // Opportunity Amount + print ''; + } + + // Date start + print ''; + + // Date end + print ''; + + // Budget + print ''; + + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + print '
'.$langs->trans("Ref").''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); + print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; + if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project'); + else print' '; + print '
'.$langs->trans("Visibility").''; + print '
'.$langs->trans("Visibility").''; if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'day'); - print '
'.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'day'); - print '
'.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); - print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("OpportunityStatus").''; + $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); + if ($code) print $langs->trans("OppStatus".$code); + print '
'.$langs->trans("OpportunityProbability").''; + if (strcmp($object->opp_percent,'')) print price($object->opp_percent,'',$langs,1,0).' %'; + print '
'.$langs->trans("OpportunityAmount").''; + if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,1,0,0,$conf->currency); + print '
'.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'day'); + print '
'.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'day'); + print '
'.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,1,0,0,$conf->currency); + print '
'; - + print ''; + print '
'; + print '
'; + print '
'; + + print ''; + + // Description + print ''; + + // Categories + if($conf->categorie->enabled) { + print '"; + } + + print '
'.$langs->trans("Description").''; + print nl2br($object->description); + print '
'.$langs->trans("Categories").''; + print $form->showCategories($object->id,'project',1); + print "
'; + + print '
'; + print '
'; + print ''; + + print '
'; + + dol_fiche_end(); } diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 43df7ce3b3d..31081c92256 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -79,61 +79,41 @@ if ($id > 0 || ! empty($ref)) $head = project_prepare_head($object); dol_fiche_head($head, 'notes', $langs->trans('Project'), 0, ($object->public?'projectpub':'project')); - print ''; - + + // Project card + $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Label - print ''; - - // Third party - print ''; - - // Visibility - print ''; - - // Statut - print ''; - - // Date start - print ''; - - // Date end - print ''; - - // Budget - print ''; - print "
'.$langs->trans("Ref").''; + + $morehtmlref='
'; + // Title + $morehtmlref.=$object->title; + // Thirdparty + if ($object->thirdparty->id > 0) + { + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref.='
'; + // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { - $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0); - $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")"; + $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); + $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); - print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; - if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1); - else print' '; - print '
'.$langs->trans("Visibility").''; - if ($object->public) print $langs->trans('SharedProject'); - else print $langs->trans('PrivateProject'); - print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'day'); - print '
'.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'day'); - print '
'.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); - print '
"; - - print '
'; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + + print '
'; + print '
'; + $cssclass="titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - + + print '
'; + + print '
'; + dol_fiche_end(); } diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 9def807c746..46c2e965ea1 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -211,64 +211,132 @@ if ($id > 0 || ! empty($ref)) $param=($mode=='mine'?'&mode=mine':''); - print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; + // Project card + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
'; + // Title + $morehtmlref.=$object->title; + // Thirdparty + if ($object->thirdparty->id > 0) + { + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); + } + $morehtmlref.='
'; + + // Define a complementary filter for search of next/prev ref. + if (! $user->rights->projet->all->lire) + { + $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); + $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; + } + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print ''; - print ''; - print ''; + print '
'; + print '
'; + print '
'; - // Visibility - print '
'; + print '
'; - print $langs->trans("Ref"); - print ''; - // Define a complementary filter for search of next/prev ref. - if (! $user->rights->projet->all->lire) - { - $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0); - $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")"; - } - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param); - print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; - if (! empty($object->thirdparty->id)) print $object->thirdparty->getNomUrl(1); - else print ' '; - print '
'.$langs->trans("Visibility").''; - if ($object->public) print $langs->trans('SharedProject'); - else print $langs->trans('PrivateProject'); - print '
'; - // Statut - print ''; - // Date start - print ''; + // Ref + /* + print ''; + */ - // Date end - print ''; + // Label + //print ''; - // Budget - print ''; - - // Other options - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields_project->attribute_label)) - { - print $object->showOptionals($extrafields_project); - } + // Third party + /* + print ''; + */ + + // Visibility + print ''; + + // Statut + //print ''; + + if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + // Opportunity status + print ''; + + // Opportunity percent + print ''; + + // Opportunity Amount + print ''; + } + + // Date start + print ''; + + // Date end + print ''; + + // Budget + print ''; + + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; + + print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'day'); - print '
'.$langs->trans("Ref").''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref'); + print '
'.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'day'); - print '
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("Budget").''; - if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); - print '
'.$langs->trans("ThirdParty").''; + if ($object->thirdparty->id > 0) print $object->thirdparty->getNomUrl(1, 'project'); + else print' '; + print '
'.$langs->trans("Visibility").''; + if ($object->public) print $langs->trans('SharedProject'); + else print $langs->trans('PrivateProject'); + print '
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'.$langs->trans("OpportunityStatus").''; + $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); + if ($code) print $langs->trans("OppStatus".$code); + print '
'.$langs->trans("OpportunityProbability").''; + if (strcmp($object->opp_percent,'')) print price($object->opp_percent,'',$langs,1,0).' %'; + print '
'.$langs->trans("OpportunityAmount").''; + if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,1,0,0,$conf->currency); + print '
'.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'day'); + print '
'.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'day'); + print '
'.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,1,0,0,$conf->currency); + print '
'; + + print ''; + print '
'; + print '
'; + print '
'; + + print ''; + + // Description + print ''; + + // Categories + if($conf->categorie->enabled) { + print '"; + } + + print '
'.$langs->trans("Description").''; + print nl2br($object->description); + print '
'.$langs->trans("Categories").''; + print $form->showCategories($object->id,'project',1); + print "
'; + + print '
'; + print '
'; + print ''; + + print '
'; - print '
'; dol_fiche_end(); }