diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 5eb129f9152..e882dabe659 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -727,19 +727,6 @@ else // Status print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; - // Date start - print ''.$langs->trans("DateStart").''; - print $form->select_date($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1); - print '     '. $langs->trans("ProjectReportDate"); - print ''; - - // Date end - print ''.$langs->trans("DateEnd").''; - print $form->select_date($object->date_end?$object->date_end:-1,'projectend',0,0,0,'',1,0,1); - print ''; - if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status @@ -762,6 +749,19 @@ else print ''; } + // Date start + print ''.$langs->trans("DateStart").''; + print $form->select_date($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1); + print '     '. $langs->trans("ProjectReportDate"); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print $form->select_date($object->date_end?$object->date_end:-1,'projectend',0,0,0,'',1,0,1); + print ''; + // Budget print ''.$langs->trans("Budget").''; print ''; @@ -799,48 +799,63 @@ else } else { - print ''; - + // Project card + $linkback = ''.$langs->trans("BackToList").''; - - // Ref - 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 ''; + + + // Ref + /* + print ''; + */ // Label - print ''; + //print ''; // Third party - print ''; + */ // Visibility - print ''; // Statut - print ''; - - // Date start - print ''; - - // Date end - print ''; + //print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { @@ -861,31 +876,53 @@ else 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("Label").''.$object->title.'
'.$langs->trans("ThirdParty").''; + /* + print '
'.$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("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,1,0,0,$conf->currency); print '
'; + + print '
'; + print '
'; + print '
'; + print '
'; + + print ''; + // Description - print ''; // Categories if($conf->categorie->enabled) { - 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->attribute_label)) - { - print $object->showOptionals($extrafields); + print '"; } + print '
'.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; print nl2br($object->description); print '
'.$langs->trans("Categories").''; - print $form->showCategories($object->id,'project',1); - print "
'.$langs->trans("Categories").''; + print $form->showCategories($object->id,'project',1); + print "
'; + + print '
'; + print '
'; + print '
'; + + print '
'; } dol_fiche_end(); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5b572a7d455..cc224176634 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -37,7 +37,8 @@ class Project extends CommonObject public $table_element_line = 'projet_task'; public $fk_element = 'fk_projet'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - + public $picto = 'projectpub'; + /** * {@inheritdoc} */ diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index b8e0134aa1f..f9220b6e555 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -33,7 +33,8 @@ class Task extends CommonObject { public $element='project_task'; //!< Id that identify managed objects public $table_element='projet_task'; //!< Name of table without prefix where object is stored - + public $picto = 'task'; + var $fk_task_parent; var $label; var $description; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 794e9c3af00..228f5fab27d 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -149,13 +149,37 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'contact', $langs->trans("Project"), 0, ($object->public?'projectpub':'project')); - /* - * Projet synthese pour rappel - */ - 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); - $linkback = ''.$langs->trans("BackToList").''; + print '
'; + print '
'; + print '
'; + + print '
'; + + /* // Ref print ''; - + */ + // Visibility - print ''; - // Status - print ''; - - // Date start - print ''; - - // Date end - print ''; - if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { // Opportunity status @@ -204,21 +216,69 @@ if ($id > 0 || ! empty($ref)) if ($code) print $langs->trans("OppStatus".$code); print ''; + // Opportunity percent + print ''; + // Opportunity Amount print ''; } - // Budget + // 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').''; // Define a complementary filter for search of next/prev ref. @@ -176,26 +200,14 @@ if ($id > 0 || ! empty($ref)) if ($object->thirdparty->id > 0) 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("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); 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,0,0,0,$conf->currency); print '
"; - 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(); + + print '
'; + // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl')); foreach($dirtpls as $reldir) diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php index 6c8593789ca..ec1e976237a 100644 --- a/htdocs/projet/info.php +++ b/htdocs/projet/info.php @@ -76,6 +76,7 @@ llxHeader("",$title,$help_url); $object = new Project($db); $object->fetch($id); +$object->fetch_thirdparty(); $object->info($id); $head = project_prepare_head($object); @@ -83,11 +84,38 @@ $head = project_prepare_head($object); dol_fiche_head($head, 'agenda', $langs->trans("Project"), 0, ($object->public?'projectpub':'project')); -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 '
'; dol_print_object_info($object, 1); -print '
'; +print ''; + +print '
'; dol_fiche_end();