Commit a998a1b8 authored by chl's avatar chl

Initial commit

parents
This module just adds the service description to the service list page (/contrat/services_list.php)
It was made in a quick and dirty way : don't take it as an example.
Our use case was that we have technical data in the description, and having it in this
listing speed up the check.
<?php
class ActionsAddDescToServiceList
{
/**
* Overloading the printFieldListTitle function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function printFieldListTitle($parameters, &$object, &$action, $hookmanager)
{
/*
if ($parameters['context'] != 'contractservicelist:main')
return 0;
*/
$this->resprints = print_liste_field_titre('Description du service', $_SERVER["PHP_SELF"], "cd.description", "", $parameters['param'],"",$parameters['sortfield'], $parameters['sortorder']);
return 0;
}
/**
* Overloading the printFieldListOption function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function printFieldListOption($parameters, &$object, &$action, $hookmanager)
{
// No filter, sort order, etc. at the moment (TODO ?)
$this->resprints = '<td class="liste_titre"></td>';
return 0;
}
/**
* Overloading the printFieldListValue function : replacing the parent's function with the one below
*
* @param array() $parameters Hook metadatas (context, etc...)
* @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
* @param string &$action Current action (if set). Generally create or edit or null
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
* @return int < 0 on error, 0 on success, 1 to replace standard code
*/
function printFieldListValue($parameters, &$object, &$action, $hookmanager)
{
$this->resprints = '<td>' . dol_escape_htmltag($parameters['obj']->description) . '</td>';
return 0;
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment