Browse Source

Add hooks to add column in list of payment modes

Laurent Destailleur 6 years ago
parent
commit
4398649af6
2 changed files with 11 additions and 0 deletions
  1. 1 0
      htdocs/modulebuilder/template/myobject_list.php
  2. 10 0
      htdocs/societe/paymentmodes.php

+ 1 - 0
htdocs/modulebuilder/template/myobject_list.php

@@ -446,6 +446,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
 $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
 $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object);    // Note that $action and $object may have been modified by hook
 print $hookmanager->resPrint;
+// Action column
 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
 print '</tr>'."\n";
 

+ 10 - 0
htdocs/societe/paymentmodes.php

@@ -832,6 +832,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
 		print '<td align="center">'.$langs->trans('Default').'</td>';
 		print '<td>'.$langs->trans('Note').'</td>';
 		print '<td>'.$langs->trans('DateModification').'</td>';
+		// Hook fields
+		$parameters=array('arrayfields'=>array(),'param'=>'','sortfield'=>'','sortorder'=>'');
+		$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object);    // Note that $action and $object may have been modified by hook
+		print $hookmanager->resPrint;
+		// Action column
 		print "<td></td>";
 		print "</tr>\n";
 
@@ -917,6 +922,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
 							print '<td>';
 							print dol_print_date($companypaymentmodetemp->tms, 'dayhour');
 							print '</td>';
+							// Fields from hook
+							$parameters=array('arrayfields'=>array(), 'obj'=>$obj);
+							$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object);    // Note that $action and $object may have been modified by hook
+							print $hookmanager->resPrint;
+							// Action column
 							print '<td align="right" class="nowraponall">';
 							if ($user->rights->societe->creer)
 							{