From c15c0f6fbbd330c6852f8efe0cf3ad18f9786546 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Nov 2015 15:31:27 +0100 Subject: [PATCH 1/4] Minor css fix --- htdocs/core/lib/project.lib.php | 16 ++++++---- htdocs/product/index.php | 9 ++++-- htdocs/theme/eldy/style.css.php | 45 +++++++++++++++++++--------- htdocs/theme/md/style.css.php | 53 ++++++++++++++++++++++----------- 4 files changed, 83 insertions(+), 40 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 004ad3a619f..0479fe007ac 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -980,7 +980,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print ''; $projectstatic->ref=$objp->ref; print $projectstatic->getNomUrl(1); - print ' - '.dol_trunc($objp->title,24).''; + print ' - '.dol_trunc($objp->title,24); + print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; @@ -1004,14 +1005,17 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $i++; } - print ''.$langs->trans("Total").""; + print ''; + print ''.$langs->trans("Total").""; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).''; - print ''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).''; + print ''.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).''; + print ''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''.$total_task.''; - + if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''.$total_task.''; + print ''; + print ''; + $db->free($resql); } else diff --git a/htdocs/product/index.php b/htdocs/product/index.php index a47f4488ea4..c2a702e796a 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -369,6 +369,7 @@ $db->close(); function activitytrim($product_type) { global $conf,$langs,$db; + global $bc; // We display the last 3 years $yearofbegindate=date('Y',dol_time_plus_duree(time(), -3, "y")); @@ -415,6 +416,8 @@ function activitytrim($product_type) } $i = 0; + $var=true; + while ($i < $num) { $objp = $db->fetch_object($result); @@ -422,7 +425,8 @@ function activitytrim($product_type) { if ($trim1+$trim2+$trim3+$trim4 > 0) { - print ''.$tmpyear.''; + $var=!$var; + print ''.$tmpyear.''; print ''.price($trim1).''; print ''.price($trim2).''; print ''.price($trim3).''; @@ -455,7 +459,8 @@ function activitytrim($product_type) } if ($trim1+$trim2+$trim3+$trim4 > 0) { - print ''.$tmpyear.''; + $var=!$var; + print ''.$tmpyear.''; print ''.price($trim1).''; print ''.price($trim2).''; print ''.price($trim3).''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 48fb4262925..e2f6933d352 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1695,9 +1695,14 @@ span.tabspan { div.divButAction { margin-bottom: 1.4em; } +span.butAction, span.butActionDelete { + cursor: pointer; +} + .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { text-decoration: none; margin: 0em em; + padding: 0.6em em; font-family: ; /* for bootstrap look color: #fff; @@ -1727,9 +1732,16 @@ div.divButAction { margin-bottom: 1.4em; } border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; - padding: 4px 14px; text-align: center; cursor: pointer; + color: #fff; + background: rgb(); + background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -moz-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + background-image: -ms-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); + color: #333333; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); background-color: #f5f5f5; @@ -1738,6 +1750,7 @@ div.divButAction { margin-bottom: 1.4em; } background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); + background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; @@ -1789,13 +1802,13 @@ div.divButAction { margin-bottom: 1.4em; } white-space: nowrap !important; cursor: not-allowed !important; margin: 0em em; + padding: 0.6em em; font-family: !important; /* for bootstrap look color: #333; background-color: #e6e6e6; border-color: #adadad; display: inline-block; - padding: 6px 12px; margin-bottom: 0; font-weight: normal !important; line-height: 1.42857143; @@ -1817,7 +1830,8 @@ div.divButAction { margin-bottom: 1.4em; } border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; - padding: 4px 14px; + margin: 0em em; + padding: 0.6em em; text-align: center; cursor: pointer; color: #999 !important; @@ -1841,16 +1855,7 @@ div.divButAction { margin-bottom: 1.4em; } -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} -global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> -.butActionRefused { - display: none; -} - - -span.butAction, span.butActionDelete { - cursor: pointer; } /* Prepare for bootstrap look @@ -1923,6 +1928,12 @@ a.butAction:link, a.butAction:visited, a.butAction:hover, a.butAction:active { } End bootstrap */ +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + + /* ============================================================================== */ @@ -2341,8 +2352,13 @@ table.dataTable td { } tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { padding: 5px 2px 5px 3px; +} +tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd { border-bottom: 1px solid #ddd; } +tr.even:last-child td, tr.pair:last-child td, tr.odd:last-child td, tr.impair:last-child td { + border-bottom: 0px !important; +} tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td { border-bottom: 0px !important; } @@ -2440,13 +2456,14 @@ input.liste_titre { background: #F0F0F0; } .noborder tr.liste_total td, tr.liste_total td, form.liste_total div { - border-top: 1px solid #DDDDDD; color: #332266; font-weight: normal; white-space: nowrap; padding: 4px; } - +form.liste_total div { + border-top: 1px solid #DDDDDD; +} .tableforservicepart1 .impair, .tableforservicepart1 .pair, .tableforservicepart2 .impair, .tableforservicepart2 .pair { background: #FFF; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f7a0cd54202..f912038a1df 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1684,7 +1684,14 @@ span.tabspan { div.divButAction { margin-bottom: 1.4em; } -.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { +span.butAction, span.butActionDelete { + cursor: pointer; +} + + +/* +.butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active +{ text-decoration: none; white-space: nowrap; padding: 0.4em em; @@ -1700,7 +1707,7 @@ div.divButAction { margin-bottom: 1.4em; } border-radius:0px 2px 0px 2px; -moz-box-shadow: 2px 2px 3px #f4f4f4; -webkit-box-shadow: 2px 2px 3px #f4f4f4; - box-shadow: 2px 2px 3px #f4f4f4; + box-shadow: 2px 2px 3px #f4f4f4; } .butAction:hover { @@ -1734,24 +1741,15 @@ div.divButAction { margin-bottom: 1.4em; } -webkit-box-shadow: 3px 3px 4px #f4f4f4; box-shadow: 3px 3px 4px #f4f4f4; } +*/ -global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> -.butActionRefused { - display: none; -} - - -span.butAction, span.butActionDelete { - cursor: pointer; -} - -/* Prepare for bootstrap look +/* Prepare for bootstrap look */ .butAction, .butActionDelete, .butActionRefused { border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); display: inline-block; - padding: 4px 14px; - margin-bottom: 0; + padding: 0.4em em; + margin: 0em em; line-height: 20px; text-align: center; vertical-align: middle; @@ -1780,7 +1778,7 @@ span.butAction, span.butActionDelete { } .butAction { - color: #ffffff; + color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); @@ -1796,7 +1794,7 @@ span.butAction, span.butActionDelete { } .butActionDelete { - color: #ffffff; + color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #cc6d00; background-image: -moz-linear-gradient(top, #cc8800, #cc4400); @@ -1813,7 +1811,26 @@ span.butAction, span.butActionDelete { a.butAction:link, a.butAction:visited, a.butAction:hover, a.butAction:active { color: #FFFFFF; } -End bootstrap */ + +.butActionRefused { + color: #AAAAAA !important; + cursor: not-allowed !important; +} + +a.butAction:hover, a.butActionDelete:hover, a.butActionRefused:hover { + text-decoration: none; +} +a.butAction:hover, a.butActionDelete:hover { + opacity: 0.9; +} + +/* End bootstrap */ + +global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { ?> +.butActionRefused { + display: none; +} + From 7b0a9fabab555f77fdec55fd60b2ea1d8b17d5ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Nov 2015 18:26:25 +0100 Subject: [PATCH 2/4] FIX Order last name / firstname in user list must be done according to option --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d89800227ab..b683bcb0f6c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1376,7 +1376,7 @@ class Form $out.= '>'; } - $out.= $userstatic->getFullName($langs, 0, 0, $maxlength); + $out.= $userstatic->getFullName($langs, 0, -1, $maxlength); // Complete name with more info $moreinfo=0; if (! empty($conf->global->MAIN_SHOW_LOGIN)) From e3c6e4ebe53dca0af117e6abaf879ef988c51735 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Nov 2015 20:00:38 +0100 Subject: [PATCH 3/4] NEW Add planned workload and declared progress on project summary list on project home page (data aggregated from tasks of project) --- htdocs/core/lib/project.lib.php | 74 ++++++++++++++++++++++++++++----- htdocs/langs/en_US/admin.lang | 5 ++- htdocs/theme/eldy/style.css.php | 1 - htdocs/theme/md/style.css.php | 3 +- 4 files changed, 68 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 0479fe007ac..7e1a5e9c9c0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -895,9 +895,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $title=$langs->trans("Projects"); if (strcmp($statut, '') && $statut >= 0) $title=$langs->trans("Projects").' '.$langs->trans($projectstatic->statuts_long[$statut]); + $arrayidtypeofcontact=array(); + print ''; - $sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount, COUNT(DISTINCT t.rowid) as nb"; // We use DISTINCT here because line can be doubled if task has 2 links to same user $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; if ($mytasks) { @@ -916,9 +917,9 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= { $sql.= " AND p.rowid = t.fk_projet"; $sql.= " AND ec.element_id = t.rowid"; - $sql.= " AND ctc.rowid = ec.fk_c_type_contact"; - $sql.= " AND ctc.element = 'project_task'"; $sql.= " AND ec.fk_socpeople = ".$user->id; + $sql.= " AND ec.fk_c_type_contact = ctc.rowid"; // Replace the 2 lines with ec.fk_c_type_contact in $arrayidtypeofcontact + $sql.= " AND ctc.element = 'project_task'"; } if ($statut >= 0) { @@ -938,14 +939,40 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $sql.= " AND (p.datee IS NULL OR p.datee >= ".$db->idate(dol_get_first_day($project_year_filter,1,false)).")"; } } - $sql.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount"; - $sql.= " ORDER BY p.title, p.ref"; + + // Get id of project we must show tasks + $arrayidofprojects=array(); + $sql1 = "SELECT p.rowid as projectid"; + $sql1.= $sql; + $resql = $db->query($sql1); + if ($resql) + { + $i=0; + $num = $db->num_rows($resql); + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $arrayidofprojects[$objp->projectid]=$objp->projectid; + $i++; + } + } + else dol_print_error($db); + if (empty($arrayidofprojects)) $arrayidofprojects[0]=-1; + + // Get list of project with calculation on tasks + $sql2 = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount,"; + $sql2.= " COUNT(t.rowid) as nb, SUM(t.planned_workload) as planned_workload, SUM(t.planned_workload * t.progress / 100) as declared_progess_workload"; + $sql2.= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; + $sql2.= " WHERE p.rowid IN (".join(',',$arrayidofprojects).")"; + $sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount"; + $sql2.= " ORDER BY p.title, p.ref"; $var=true; - $resql = $db->query($sql); - if ( $resql ) + $resql = $db->query($sql2); + if ($resql) { - $total_task = 0; + $total_task = 0; $total_opp_amount = 0; $ponderated_opp_amount = 0; @@ -959,7 +986,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print_liste_field_titre($langs->trans("OpportunityAmount"),"","","","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("OpportunityStatus"),"","","","",'align="right"',$sortfield,$sortorder); } - if (empty($conf->global->PROJECT_HIDE_TASKS)) print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder); + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PlannedWorkload"),"","","","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ProgressDeclared"),"","","","",'align="right"',$sortfield,$sortorder); + } print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder); print "\n"; @@ -993,7 +1025,22 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print ''; } $projectstatic->statut = $objp->status; - if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''; + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print ''; + + $plannedworkload=$objp->planned_workload; + $total_plannedworkload+=$plannedworkload; + print ''; + + $declaredprogressworkload=$objp->declared_progess_workload; + $total_declaredprogressworkload+=$declaredprogressworkload; + print ''; + } + print ''; print "\n"; @@ -1012,7 +1059,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print ''; print ''; } - if (empty($conf->global->PROJECT_HIDE_TASKS)) print ''; + if (empty($conf->global->PROJECT_HIDE_TASKS)) + { + print ''; + print ''; + print ''; + } print ''; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index eacf9b6e5ce..892aa415c92 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -366,7 +366,7 @@ HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide products lines details on generated PDF -PlaceCustomerAddressToIsoLocation=Use ISO location for customer address +PlaceCustomerAddressToIsoLocation=Use french standard position (La PosteĆ  for customer address position Library=Library UrlGenerationParameters=Parameters to secure URLs SecurityTokenIsUnique=Use a unique securekey parameter for each URL @@ -1116,7 +1116,7 @@ GetBarCode=Get barcode EmptyNumRefModelDesc=The code is free. This code can be modified at any time. ##### Module password generation PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase. -PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually. +PasswordGenerationNone=Do not suggest any generated password. Password must be typed in manually. PasswordGenerationPerso=Return a password according to your personally defined configuration. SetupPerso=According to your configuration PasswordPatternDesc=Password pattern description @@ -1674,6 +1674,7 @@ InstallModuleFromWebHasBeenDisabledByFile=Install of external module from applic ConfFileMuseContainCustom=Installing an external module from application save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to have option
- $dolibarr_main_url_root_alt enabled to value $dolibarr_main_url_root_alt="/custom"
- $dolibarr_main_document_root_alt enabled to value "%s/custom" HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Color of highlight line when mouse move passes over (keep empty for no highlight) +LinkColor=Color of links PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes BackgroundColor=Background color diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e2f6933d352..f9c2452e4ce 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2459,7 +2459,6 @@ input.liste_titre { color: #332266; font-weight: normal; white-space: nowrap; - padding: 4px; } form.liste_total div { border-top: 1px solid #DDDDDD; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f912038a1df..7a42ab1f3bb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -707,11 +707,12 @@ img.photoref { box-shadow: 3px 3px 4px #DDD; } .underrefbanner { +} +.underbanner { border-bottom: 2px solid #888; } - /* ============================================================================== */ /* Menu top et 1ere ligne tableau */ /* ============================================================================== */ From c7447b08996e9aa3b9d0a72c65cb829aceae4921 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 21 Nov 2015 20:25:28 +0100 Subject: [PATCH 4/4] Add thirdparty of project into project summary of project home page. Total use a different color --- htdocs/core/lib/project.lib.php | 42 +++++++++++++++++++++++---------- htdocs/projet/index.php | 2 +- htdocs/theme/eldy/style.css.php | 2 +- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 7e1a5e9c9c0..0569e90d903 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -878,16 +878,18 @@ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) * @param int $mytasks Limited to task i am contact to * @param int $statut -1=No filter on statut, 0 or 1 = Filter on status * @param array $listofoppstatus List of opportunity status + * @param array $hiddenfields List of fields to not show * @return void */ -function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array()) +function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=0, $statut=-1, $listofoppstatus=array(),$hiddenfields=array()) { global $langs,$conf,$user,$bc; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic=new Project($db); - + $thirdpartystatic=new Societe($db); + $sortfield=''; $sortorder=''; $project_year_filter=0; @@ -960,12 +962,13 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= if (empty($arrayidofprojects)) $arrayidofprojects[0]=-1; // Get list of project with calculation on tasks - $sql2 = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount,"; + $sql2 = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_soc, s.nom as socname, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount,"; $sql2.= " COUNT(t.rowid) as nb, SUM(t.planned_workload) as planned_workload, SUM(t.planned_workload * t.progress / 100) as declared_progess_workload"; $sql2.= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet"; $sql2.= " WHERE p.rowid IN (".join(',',$arrayidofprojects).")"; - $sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount"; + $sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount"; $sql2.= " ORDER BY p.title, p.ref"; $var=true; @@ -981,6 +984,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print ''; print_liste_field_titre($title.' '.$num.'',$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"","","","",$sortfield,$sortorder); if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print_liste_field_titre($langs->trans("OpportunityAmount"),"","","","",'align="right"',$sortfield,$sortorder); @@ -990,7 +994,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= { print_liste_field_titre($langs->trans("Tasks"),"","","","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PlannedWorkload"),"","","","",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProgressDeclared"),"","","","",'align="right"',$sortfield,$sortorder); + if (! in_array('declaredprogress', $hiddenfields)) print_liste_field_titre($langs->trans("ProgressDeclared"),"","","","",'align="right"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("Status"),"","","","",'align="right"',$sortfield,$sortorder); print "\n"; @@ -1014,6 +1018,15 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= print $projectstatic->getNomUrl(1); print ' - '.dol_trunc($objp->title,24); print ''; + print ''; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; - $declaredprogressworkload=$objp->declared_progess_workload; - $total_declaredprogressworkload+=$declaredprogressworkload; - print ''; + if (! in_array('declaredprogress', $hiddenfields)) + { + $declaredprogressworkload=$objp->declared_progess_workload; + $total_declaredprogressworkload+=$declaredprogressworkload; + print ''; + } } print ''; @@ -1053,7 +1069,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= } print ''; - print '"; + print '"; if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { print ''; @@ -1063,7 +1079,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= { print ''; print ''; - print ''; + if (! in_array('declaredprogress', $hiddenfields)) print ''; } print ''; print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 2f45dce9906..11ae9e78906 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -216,7 +216,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) // List of draft projects -print_projecttasks_array($db,$form,$socid,$projectsListId,0,0,$listofoppstatus); +print_projecttasks_array($db,$form,$socid,$projectsListId,0,0,$listofoppstatus,array('declaredprogress')); print '
'; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index f9c2452e4ce..d8bbe966843 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2456,7 +2456,7 @@ input.liste_titre { background: #F0F0F0; } .noborder tr.liste_total td, tr.liste_total td, form.liste_total div { - color: #332266; + color: #552266; font-weight: normal; white-space: nowrap; }
'.$objp->nb.''.$objp->nb.''.($plannedworkload?convertSecondToTime($plannedworkload):'').''; + //print $objp->planned_workload.'-'.$objp->declared_progess_workload."
"; + print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload,0).'%':''); + print '
'.$projectstatic->getLibStatut(3).'
'.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).''.$form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1).''.$total_task.''.$total_task.''.($total_plannedworkload?convertSecondToTime($total_plannedworkload):'').''.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload,0).'%':'').'
'; + if ($objp->fk_soc > 0) + { + $thirdpartystatic->id=$objp->fk_soc; + $thirdpartystatic->ref=$objp->socname; + $thirdpartystatic->name=$objp->socname; + print $thirdpartystatic->getNomUrl(1); + } + print ''; @@ -1033,12 +1046,15 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks= $total_plannedworkload+=$plannedworkload; print ''.($plannedworkload?convertSecondToTime($plannedworkload):'').''; - //print $objp->planned_workload.'-'.$objp->declared_progess_workload."
"; - print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload,0).'%':''); - print '
'; + //print $objp->planned_workload.'-'.$objp->declared_progess_workload."
"; + print ($plannedworkload?round(100*$declaredprogressworkload/$plannedworkload,0).'%':''); + print '
'.$projectstatic->getLibStatut(3).'
'.$langs->trans("Total")."'.$langs->trans("Total")."'.price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency).''.$total_task.''.($total_plannedworkload?convertSecondToTime($total_plannedworkload):'').''.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload,0).'%':'').''.($total_plannedworkload?round(100*$total_declaredprogressworkload/$total_plannedworkload,0).'%':'').'