Completed
Push — master ( 78fac9...861463 )
by Laurent
01:54
created

ActionsFlightlog::addSearchEntry()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
/**
7
 * ActionsFlightlog class
8
 *
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class ActionsFlightlog
12
{
13
14
    public $results = [];
15
16
    /**
17
     * Add entry in search list
18
     *
19
     * @param array $searchInfo
20
     *
21
     * @return int
22
     */
23
    public function addSearchEntry($searchInfo)
24
    {
25
        global $langs;
26
27
        $langs->load("mymodule@flightlog");
28
29
        $this->results["flightlog"] = [
30
            'label' => $langs->trans("Search flight"),
31
            'text'  => $langs->trans("Search flight"),
32
            'url'   => DOL_URL_ROOT . '/flightlog/list.php?mainmenu=flightlog&sall='.$searchInfo['search_boxvalue']
33
        ];
34
    }
35
36
    /**
37
     * @param $parameter
38
     * @param $object
39
     * @param $action
40
     */
41
    public function showLinkToObjectBlock($parameter, $object, $action){
0 ignored issues
show
Unused Code introduced by
The parameter $parameter is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $object is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $action is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
        $this->results["flightlog_bbcvols"]= array('enabled'=>1, 'perms'=>1, 'label'=>'LinkToFlight', 'sql'=>"SELECT f.idBBC_vols as rowid, CONCAT('(ID : ',f.idBBC_vols, ') -',f.date, '-',f.lieuD, ' ; ', f.lieuA) as ref FROM ".MAIN_DB_PREFIX."bbc_vols as f WHERE YEAR(f.date) = (YEAR(NOW())) ORDER BY date DESC");
43
44
    }
45
}