Skip to content

Commit

Permalink
Fix box PHP strict warning
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-florian committed Jun 27, 2016
1 parent 25b8657 commit d0be787
Show file tree
Hide file tree
Showing 32 changed files with 176 additions and 136 deletions.
57 changes: 32 additions & 25 deletions htdocs/core/boxes/box_actions.php
Expand Up @@ -167,13 +167,15 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
function showBox($head = null, $contents = null, $nooutput=0)
{
global $langs, $conf;
parent::showBox($this->info_box_head, $this->info_box_contents);
if (! empty($conf->global->SHOW_DIALOG_HOMEPAGE))
$out='';
if (! empty($conf->global->SHOW_DIALOG_HOMEPAGE))
{
$actioncejour=false;
$contents=$this->info_box_contents;
Expand All @@ -183,8 +185,8 @@ function showBox($head = null, $contents = null)
$bcx[1] = 'class="box_impair"';
if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo"))
{
print '<div id="dialogboxaction" title="'.$nblines." ".$langs->trans("ActionsToDo").'">';
print '<table width=100%>';
$out.= '<div id="dialogboxaction" title="'.$nblines." ".$langs->trans("ActionsToDo").'">';
$out.= '<table width=100%>';
for ($line=0, $n=$nblines; $line < $n; $line++)
{
if (isset($contents[$line]))
Expand All @@ -202,40 +204,45 @@ function showBox($head = null, $contents = null)
$urlsoc=$contents[$line][3]['url'];
$dateligne=$contents[$line][4]['text'];
$percentage=$contents[$line][5]['text'];
print '<tr '.$bcx[$var].'>';
print '<td align=center>';
print img_object("",$logo);
print '</td>';
print '<td align=center><a href="'.$urlevent.'">'.$label.'</a></td>';
print '<td align=center><a href="'.$urlsoc.'">'.img_object("",$logosoc)." ".$nomsoc.'</a></td>';
print '<td align=center>'.$dateligne.'</td>';
print '<td align=center>'.$percentage.'</td>';
print '</tr>';
$out.= '<tr '.$bcx[$var].'>';
$out.= '<td align=center>';
$out.= img_object("",$logo);
$out.= '</td>';
$out.= '<td align=center><a href="'.$urlevent.'">'.$label.'</a></td>';
$out.= '<td align=center><a href="'.$urlsoc.'">'.img_object("",$logosoc)." ".$nomsoc.'</a></td>';
$out.= '<td align=center>'.$dateligne.'</td>';
$out.= '<td align=center>'.$percentage.'</td>';
$out.= '</tr>';
}
}
print '</table>';
$out.= '</table>';

}
print '</div>';
$out.= '</div>';
if ($actioncejour)
{
print '<script>';
print '$("#dialogboxaction").dialog({ autoOpen: true });';
$out.= '<script>';
$out.= '$("#dialogboxaction").dialog({ autoOpen: true });';
if ($conf->global->SHOW_DIALOG_HOMEPAGE > 1) // autoclose after this delay
{
print 'setTimeout(function(){';
print '$("#dialogboxaction").dialog("close");';
print '}, '.($conf->global->SHOW_DIALOG_HOMEPAGE*1000).');';
$out.= 'setTimeout(function(){';
$out.= '$("#dialogboxaction").dialog("close");';
$out.= '}, '.($conf->global->SHOW_DIALOG_HOMEPAGE*1000).');';
}
print '</script>';
$out.= '</script>';
}
else
{
print '<script>';
print '$("#dialogboxaction").dialog({ autoOpen: false });';
print '</script>';
$out.= '<script>';
$out.= '$("#dialogboxaction").dialog({ autoOpen: false });';
$out.= '</script>';
}
}

if ($nooutput) return $out;
else print $out;

return '';
}

}
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_activity.php
Expand Up @@ -455,10 +455,11 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_bookmarks.php
Expand Up @@ -135,11 +135,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_clients.php
Expand Up @@ -157,11 +157,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/boxes/box_commandes.php
Expand Up @@ -176,11 +176,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_comptes.php
Expand Up @@ -169,11 +169,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
15 changes: 8 additions & 7 deletions htdocs/core/boxes/box_contacts.php
Expand Up @@ -83,7 +83,7 @@ function loadBox($max=5)
$societestatic=new Societe($db);

$line = 0;
while ($line < $num)
while ($line < $num)
{
$objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec);
Expand All @@ -100,15 +100,15 @@ function loadBox($max=5)
$contactstatic->address = $objp->address;
$contactstatic->zip = $objp->zip;
$contactstatic->town = $objp->town;

$societestatic->id = $objp->fk_soc;
$societestatic->name = $objp->socname;
$societestatic->name_alias = $objp->name_alias;
$societestatic->code_client = $objp->code_client;
$societestatic->code_fournisseur = $objp->code_fournisseur;
$societestatic->client = $objp->client;
$societestatic->fournisseur = $objp->fournisseur;

$this->info_box_contents[$line][] = array(
'td' => 'align="left"',
'text' => $contactstatic->getNomUrl(1),
Expand All @@ -131,7 +131,7 @@ function loadBox($max=5)
'text' => $contactstatic->getLibStatut(3),
'asis'=>1,
);

$line++;
}

Expand Down Expand Up @@ -163,11 +163,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
15 changes: 8 additions & 7 deletions htdocs/core/boxes/box_contracts.php
Expand Up @@ -55,14 +55,14 @@ function loadBox($max=5)
$this->max=$max;

include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';

$this->info_box_head = array('text' => $langs->trans("BoxTitleLastContracts",$max));

if ($user->rights->contrat->lire)
{
$contractstatic=new Contrat($db);
$thirdpartytmp=new Societe($db);

$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
Expand All @@ -83,8 +83,8 @@ function loadBox($max=5)
$line = 0;

$langs->load("contracts");
while ($line < $num)

while ($line < $num)
{
$objp = $db->fetch_object($resql);
$datec=$db->jdate($objp->datec);
Expand All @@ -99,7 +99,7 @@ function loadBox($max=5)

$thirdpartytmp->name = $objp->name;
$thirdpartytmp->id = $objp->socid;

// fin_validite is no more on contract but on services
// if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); }

Expand Down Expand Up @@ -157,11 +157,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/boxes/box_external_rss.php
Expand Up @@ -184,11 +184,12 @@ function loadBox($max=5, $cachedelay=3600)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
9 changes: 5 additions & 4 deletions htdocs/core/boxes/box_factures.php
Expand Up @@ -180,11 +180,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @return void
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_factures_fourn.php
Expand Up @@ -189,11 +189,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_factures_fourn_imp.php
Expand Up @@ -186,11 +186,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_factures_imp.php
Expand Up @@ -182,11 +182,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
7 changes: 4 additions & 3 deletions htdocs/core/boxes/box_ficheinter.php
Expand Up @@ -144,11 +144,12 @@ function loadBox($max=10)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/boxes/box_fournisseurs.php
Expand Up @@ -139,11 +139,12 @@ function loadBox($max=5)
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return void
*/
function showBox($head = null, $contents = null)
function showBox($head = null, $contents = null, $nooutput=0)
{
parent::showBox($this->info_box_head, $this->info_box_contents);
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}

}
Expand Down

0 comments on commit d0be787

Please sign in to comment.