From 10f2d7cd67022d8155ea8c5e1e33dcf8ca54cfcb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Jun 2016 10:54:02 +0200 Subject: [PATCH] Fix Debug and minor fixes --- htdocs/categories/viewcat.php | 14 +++++++------- htdocs/core/ajax/selectsearchbox.php | 5 +++++ htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/holiday/list.php | 4 +++- htdocs/langs/en_US/holiday.lang | 2 ++ htdocs/langs/en_US/main.lang | 3 ++- htdocs/product/stats/card.php | 8 ++++---- htdocs/projet/contact.php | 25 ++++++++++++++----------- htdocs/projet/element.php | 23 +++++++++++++---------- htdocs/projet/ganttview.php | 8 ++++++-- htdocs/projet/note.php | 5 +++++ htdocs/projet/tasks.php | 7 ++++++- 12 files changed, 68 insertions(+), 38 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index b9beb792ba6..09fda82223b 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -297,7 +297,7 @@ else } else { - print "'.$langs->trans("NoSubCat").""; + print "'.$langs->trans("NoSubCat").""; } print "\n"; } @@ -371,7 +371,7 @@ if ($object->type == Categorie::TYPE_PRODUCT) } else { - print "'.$langs->trans("ThisCategoryHasNoProduct").""; + print "'.$langs->trans("ThisCategoryHasNoProduct").""; } print "\n"; } @@ -422,7 +422,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER) } else { - print "".$langs->trans("ThisCategoryHasNoSupplier").""; + print ''.$langs->trans("ThisCategoryHasNoSupplier").''; } print "\n"; } @@ -475,7 +475,7 @@ if($object->type == Categorie::TYPE_CUSTOMER) } else { - print "".$langs->trans("ThisCategoryHasNoCustomer").""; + print ''.$langs->trans("ThisCategoryHasNoCustomer").''; } print "\n"; } @@ -529,7 +529,7 @@ if ($object->type == Categorie::TYPE_MEMBER) } else { - print "'.$langs->trans("ThisCategoryHasNoMember").""; + print ''.$langs->trans("ThisCategoryHasNoMember").''; } print "\n"; } @@ -582,7 +582,7 @@ if($object->type == Categorie::TYPE_CONTACT) } else { - print "".$langs->trans("ThisCategoryHasNoContact").""; + print ''.$langs->trans("ThisCategoryHasNoContact").''; } print "\n"; } @@ -636,7 +636,7 @@ if ($object->type == Categorie::TYPE_ACCOUNT) } else { - print "'.$langs->trans("ThisCategoryHasNoAccount").""; + print ''.$langs->trans("ThisCategoryHasNoAccount").''; } print "\n"; } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index b4ea22d59eb..416975acfdb 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -111,10 +111,15 @@ if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_ { $arrayresult['searchintointervention']=array('text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue)); } +// HR if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) { $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?sall='.urlencode($search_boxvalue)); } +if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) +{ + $arrayresult['searchintoleaves']=array('text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?sall='.urlencode($search_boxvalue)); +} /* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 5ebe7c13a91..3f022bf0aa7 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1155,8 +1155,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); $newmenu->add("/product/stock/mouvement.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); - if ($conf->supplier_order->enabled) $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); $newmenu->add("/product/stock/massstockmove.php", $langs->trans("MassStockTransferShort"), 1, $user->rights->stock->mouvement->creer); + if ($conf->supplier_order->enabled) $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire); } // Expeditions diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 6fbd411f420..60048f3fe1b 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -85,6 +85,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $fieldstosearchall = array( 'cp.rowid'=>'Ref', 'cp.description'=>'Description', + 'uu.lastname'=>'EmployeeLastname', + 'uu.firstname'=>'EmployeeFirstname' ); @@ -428,7 +430,7 @@ if (! empty($holiday->holiday)) if($holiday_payes == '2') { print ''; - print ''.$langs->trans('None').''; + print ''.$langs->trans('NoRecordFound').''; print ''; } diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 4113dd62aa0..38dc854b5f9 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -76,6 +76,8 @@ BoxTitleLastLeaveRequests=Latest %s modified leave requests HolidaysMonthlyUpdate=Monthly update ManualUpdate=Manual update HolidaysCancelation=Leave request cancelation +EmployeeLastname=Employee lastname +EmployeeFirstname=Employee firstname ## Configuration du Module ## LastUpdateCP=Latest automatic update of leaves allocation diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4b41f0ba038..fb59e1dd8fd 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -751,5 +751,6 @@ SearchIntoCustomerProposals=Customer proposals SearchIntoSupplierProposals=Supplier proposals SearchIntoInterventions=Interventions SearchIntoContracts=Contracts -SearchIntoExpenseReports=Expense reports SearchIntoCustomerShipments=Customer shipments +SearchIntoExpenseReports=Expense reports +SearchIntoLeaves=Leaves diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 3a01d952acd..138cfe45a2b 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -146,7 +146,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') // Choice of type of product if (! empty($conf->dol_use_jmobile)) print "\n".'
'."\n"; - if ((string) $type != '0') print 'id).'&type=0">'; + if ((string) $type != '0') print 'id).'&type=0'.($mode?'&mode='.$mode:'').'">'; else print img_picto('','tick').' '; print $langs->trans("Products"); if ((string) $type != '0') print ''; @@ -154,7 +154,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') if (! empty($conf->dol_use_jmobile)) print '
'."\n".'
'."\n"; else print '   /   '; - if ((string) $type != '1') print 'id).'&type=1">'; + if ((string) $type != '1') print 'id).'&type=1'.($mode?'&mode='.$mode:'').'">'; else print img_picto('','tick').' '; print $langs->trans("Services"); if ((string) $type != '1') print ''; @@ -162,7 +162,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') if (! empty($conf->dol_use_jmobile)) print '
'."\n".'
'."\n"; else print '   /   '; - if ((string) $type == '0' || (string) $type == '1') print 'id).'">'; + if ((string) $type == '0' || (string) $type == '1') print 'id).($mode?'&mode='.$mode:'').'">'; else print img_picto('','tick').' '; print $langs->trans("ProductsAndServices"); if ((string) $type == '0' || (string) $type == '1') print ''; @@ -172,7 +172,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') print '
'; } - // Choice of stats + // Choice of stats mode (byunit or bynumber) if (! empty($conf->dol_use_jmobile)) print "\n".'
'."\n"; if ($mode == 'bynumber') print 'id).($type != '' ? '&type='.$type:'').'&mode=byunit">'; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 6d3dc65903e..794e9c3af00 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -196,17 +196,20 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($object->date_end,'day'); print ''; - // Opportunity status - print ''.$langs->trans("OpportunityStatus").''; - $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); - if ($code) print $langs->trans("OppStatus".$code); - print ''; - - // Opportunity Amount - print ''.$langs->trans("OpportunityAmount").''; - if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); - print ''; - + if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) + { + // Opportunity status + print ''.$langs->trans("OpportunityStatus").''; + $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); + if ($code) print $langs->trans("OppStatus".$code); + print ''; + + // Opportunity Amount + print ''.$langs->trans("OpportunityAmount").''; + if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); + print ''; + } + // Budget print ''.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 86928cbf2b9..1664f2e7269 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -157,16 +157,19 @@ print ''.$langs->trans("DateEnd").''; print dol_print_date($object->date_end,'day'); print ''; -// Opportunity status -print ''.$langs->trans("OpportunityStatus").''; -$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); -if ($code) print $langs->trans("OppStatus".$code); -print ''; - -// Opportunity Amount -print ''.$langs->trans("OpportunityAmount").''; -if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); -print ''; +if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES)) +{ + // Opportunity status + print ''.$langs->trans("OpportunityStatus").''; + $code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code'); + if ($code) print $langs->trans("OppStatus".$code); + print ''; + + // Opportunity Amount + print ''.$langs->trans("OpportunityAmount").''; + if (strcmp($object->opp_amount,'')) print price($object->opp_amount,'',$langs,0,0,0,$conf->currency); + print ''; +} // Budget print ''.$langs->trans("Budget").''; diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 498db12ddc6..b86a961bd69 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -142,7 +142,11 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($object->date_end,'day'); print ''; - + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); + print ''; + print ''; print '
'; @@ -263,7 +267,7 @@ if (count($tasksarray)>0) } else { - print $langs->trans("NoTasks"); + print '
'.$langs->trans("NoTasks").'
'; } diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index ef4be16f51e..43df7ce3b3d 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -122,6 +122,11 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($object->date_end,'day'); print ''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); + print ''; + print ""; print '
'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index ab7e2849330..3d61c96299b 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -248,6 +248,11 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($object->date_end,'day'); print ''; + // Budget + print ''.$langs->trans("Budget").''; + if (strcmp($object->budget_amount, '')) print price($object->budget_amount,'',$langs,0,0,0,$conf->currency); + print ''; + // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook @@ -444,7 +449,7 @@ else if ($id > 0 || ! empty($ref)) } else { - print ''.$langs->trans("NoTasks").''; + print ''.$langs->trans("NoTasks").''; } print "";