Skip to content

Commit

Permalink
Removed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 23, 2019
1 parent 4d92d77 commit a77b46f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
17 changes: 7 additions & 10 deletions htdocs/emailcollector/class/emailcollector.class.php
Expand Up @@ -184,7 +184,7 @@ class EmailCollector extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs, $user;
global $conf, $langs;

$this->db = $db;

Expand Down Expand Up @@ -234,7 +234,7 @@ public function create(User $user, $notrigger = false)
*/
public function createFromClone(User $user, $fromid)
{
global $langs, $hookmanager, $extrafields;
global $langs, $extrafields;
$error = 0;

dol_syslog(__METHOD__, LOG_DEBUG);
Expand Down Expand Up @@ -337,8 +337,6 @@ public function fetchAll(User $user, $activeOnly = 0, $sortfield = 's.rowid', $s

$obj_ret = array();

$socid = $user->societe_id ? $user->societe_id : '';

$sql = "SELECT s.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector as s";
$sql.= ' WHERE s.entity IN ('.getEntity('emailcollector').')';
Expand All @@ -358,6 +356,7 @@ public function fetchAll(User $user, $activeOnly = 0, $sortfield = 's.rowid', $s
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$i = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
Expand Down Expand Up @@ -415,14 +414,11 @@ public function delete(User $user, $notrigger = false)
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $menumanager;
global $conf, $langs, $hookmanager;

if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips

$result = '';
$companylink = '';

$label = '<u>' . $langs->trans("EmailCollector") . '</u>';
$label.= '<br>';
Expand Down Expand Up @@ -1023,6 +1019,7 @@ public function doCollectOneCollector()
function createPartArray($structure, $prefix = "")
{
//print_r($structure);
$part_array=array();
if (count($structure->parts) > 0) { // There some sub parts
foreach ($structure->parts as $count => $part) {
add_part_to_array($part, $prefix.($count+1), $part_array);
Expand Down Expand Up @@ -1348,7 +1345,7 @@ function addPartToArray($obj, $partno, &$part_array)
else
{
// Nothing can be done for this param
$errorforaction++;
$errorforactions++;
$this->error = 'The extract rule to use to load thirdparty has on an unknown source (must be HEADER, SUBJECT or BODY)';
$this->errors[] = $this->error;
}
Expand All @@ -1361,7 +1358,7 @@ function addPartToArray($obj, $partno, &$part_array)
}
else
{
$errorforaction++;
$errorforactions++;
$this->error = 'Bad syntax for description of action parameters: '.$actionparam;
$this->errors[] = $this->error;
break;
Expand Down
16 changes: 9 additions & 7 deletions htdocs/modulebuilder/template/class/myobject.class.php
Expand Up @@ -202,7 +202,7 @@ class MyObject extends CommonObject
*/
public function __construct(DoliDB $db)
{
global $conf, $langs, $user;
global $conf, $langs;

$this->db = $db;

Expand Down Expand Up @@ -252,7 +252,7 @@ public function create(User $user, $notrigger = false)
*/
public function createFromClone(User $user, $fromid)
{
global $langs, $hookmanager, $extrafields;
global $langs, $extrafields;
$error = 0;

dol_syslog(__METHOD__, LOG_DEBUG);
Expand Down Expand Up @@ -392,16 +392,20 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset =
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);

while ($obj = $this->db->fetch_object($resql))
$i = 0;
while ($i < min($limit, $num))
{
$obj = $this->db->fetch_object($resql);

$record = new self($this->db);

$record->id = $obj->rowid;
// TODO Get other fields

//var_dump($record->id);
$records[$record->id] = $record;

$i++;
}
$this->db->free($resql);

Expand Down Expand Up @@ -451,9 +455,7 @@ public function delete(User $user, $notrigger = false)
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
{
global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $menumanager;
global $conf, $langs, $hookmanager;

if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips

Expand Down

0 comments on commit a77b46f

Please sign in to comment.