add visibility

This commit is contained in:
Frédéric FRANCE 2019-02-28 00:15:32 +01:00
parent cc1ee2d883
commit ba4ca5d7c2
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
18 changed files with 264 additions and 264 deletions

View File

@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_actions extends ModeleBoxes class box_actions extends ModeleBoxes
{ {
var $boxcode="lastactions"; public $boxcode="lastactions";
var $boximg="object_action"; public $boximg="object_action";
var $boxlabel="BoxLastActions"; public $boxlabel="BoxLastActions";
var $depends = array("agenda"); public $depends = array("agenda");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -54,7 +54,7 @@ class box_actions extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $user; global $user;
@ -69,7 +69,7 @@ class box_actions extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
@ -188,7 +188,7 @@ class box_actions extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
global $langs, $conf; global $langs, $conf;
$out = parent::showBox($this->info_box_head, $this->info_box_contents); $out = parent::showBox($this->info_box_head, $this->info_box_contents);
@ -257,5 +257,5 @@ class box_actions extends ModeleBoxes
else print $out; else print $out;
return ''; return '';
} }
} }

View File

@ -30,21 +30,21 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_activity extends ModeleBoxes class box_activity extends ModeleBoxes
{ {
var $boxcode="activity"; public $boxcode="activity";
var $boximg="object_bill"; public $boximg="object_bill";
var $boxlabel='BoxGlobalActivity'; public $boxlabel='BoxGlobalActivity';
var $depends = array("facture"); public $depends = array("facture");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $enabled = 1; public $enabled = 1;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -53,7 +53,7 @@ class box_activity extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $conf, $user; global $conf, $user;
@ -74,7 +74,7 @@ class box_activity extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $conf, $user, $langs, $db; global $conf, $user, $langs, $db;
@ -450,16 +450,16 @@ class box_activity extends ModeleBoxes
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }
} }

View File

@ -28,20 +28,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_bookmarks extends ModeleBoxes class box_bookmarks extends ModeleBoxes
{ {
var $boxcode="bookmarks"; public $boxcode="bookmarks";
var $boximg="object_bookmark"; public $boximg="object_bookmark";
var $boxlabel="BoxMyLastBookmarks"; public $boxlabel="BoxMyLastBookmarks";
var $depends = array("bookmark"); public $depends = array("bookmark");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -50,7 +50,7 @@ class box_bookmarks extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $user; global $user;
@ -65,7 +65,7 @@ class box_bookmarks extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
$langs->load("boxes"); $langs->load("boxes");
@ -149,16 +149,16 @@ class box_bookmarks extends ModeleBoxes
} }
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }
} }

View File

@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_clients extends ModeleBoxes class box_clients extends ModeleBoxes
{ {
var $boxcode="lastcustomers"; public $boxcode="lastcustomers";
var $boximg="object_company"; public $boximg="object_company";
var $boxlabel="BoxLastCustomers"; public $boxlabel="BoxLastCustomers";
var $depends = array("societe"); public $depends = array("societe");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $enabled = 1; public $enabled = 1;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -54,7 +54,7 @@ class box_clients extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $conf, $user; global $conf, $user;
@ -72,7 +72,7 @@ class box_clients extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
$langs->load("boxes"); $langs->load("boxes");
@ -175,7 +175,7 @@ class box_clients extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_commandes extends ModeleBoxes class box_commandes extends ModeleBoxes
{ {
var $boxcode="lastcustomerorders"; public $boxcode="lastcustomerorders";
var $boximg="object_order"; public $boximg="object_order";
var $boxlabel="BoxLastCustomerOrders"; public $boxlabel="BoxLastCustomerOrders";
var $depends = array("commande"); public $depends = array("commande");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -54,7 +54,7 @@ class box_commandes extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $user; global $user;
@ -69,7 +69,7 @@ class box_commandes extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
@ -198,7 +198,7 @@ class box_commandes extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -33,20 +33,20 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
*/ */
class box_produits extends ModeleBoxes class box_produits extends ModeleBoxes
{ {
var $boxcode="lastproducts"; public $boxcode="lastproducts";
var $boximg="object_product"; public $boximg="object_product";
var $boxlabel="BoxLastProducts"; public $boxlabel="BoxLastProducts";
var $depends = array("produit"); public $depends = array("produit");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -55,7 +55,7 @@ class box_produits extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $conf, $user; global $conf, $user;
@ -73,7 +73,7 @@ class box_produits extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf, $hookmanager; global $user, $langs, $db, $conf, $hookmanager;
@ -218,16 +218,16 @@ class box_produits extends ModeleBoxes
} }
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }
} }

View File

@ -35,20 +35,20 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
*/ */
class box_produits_alerte_stock extends ModeleBoxes class box_produits_alerte_stock extends ModeleBoxes
{ {
var $boxcode="productsalertstock"; public $boxcode="productsalertstock";
var $boximg="object_product"; public $boximg="object_product";
var $boxlabel="BoxProductsAlertStock"; public $boxlabel="BoxProductsAlertStock";
var $depends = array("produit"); public $depends = array("produit");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -57,7 +57,7 @@ class box_produits_alerte_stock extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $conf,$user; global $conf,$user;
@ -75,7 +75,7 @@ class box_produits_alerte_stock extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf, $hookmanager; global $user, $langs, $db, $conf, $hookmanager;
@ -241,7 +241,7 @@ class box_produits_alerte_stock extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -30,20 +30,20 @@ include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
*/ */
class box_project extends ModeleBoxes class box_project extends ModeleBoxes
{ {
var $boxcode="project"; public $boxcode="project";
var $boximg="object_projectpub"; public $boximg="object_projectpub";
var $boxlabel; public $boxlabel;
//var $depends = array("projet"); //var $depends = array("projet");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
* Constructor * Constructor
@ -51,7 +51,7 @@ class box_project extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $user, $langs; global $user, $langs;
@ -64,45 +64,45 @@ class box_project extends ModeleBoxes
$this->hidden=! ($user->rights->projet->lire); $this->hidden=! ($user->rights->projet->lire);
} }
/** /**
* Load data for box to show them later * Load data for box to show them later
* *
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $conf, $user, $langs, $db; global $conf, $user, $langs, $db;
$this->max=$max; $this->max=$max;
$totalMnt = 0; $totalMnt = 0;
$totalnb = 0; $totalnb = 0;
$totalnbTask=0; $totalnbTask=0;
$textHead = $langs->trans("OpenedProjects"); $textHead = $langs->trans("OpenedProjects");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the orders // list the summary of the orders
if ($user->rights->projet->lire) { if ($user->rights->projet->lire) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projectstatic = new Project($this->db); $projectstatic = new Project($this->db);
$socid=0; $socid=0;
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement. //if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
// Get list of project id allowed to user (in a string list separated by coma) // Get list of project id allowed to user (in a string list separated by coma)
$projectsListId=''; $projectsListId='';
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public"; $sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " WHERE p.fk_statut = 1"; // Only open projects $sql.= " WHERE p.fk_statut = 1"; // Only open projects
if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users
$sql.= " ORDER BY p.datec DESC"; $sql.= " ORDER BY p.datec DESC";
//$sql.= $db->plimit($max, 0); //$sql.= $db->plimit($max, 0);
$result = $db->query($sql); $result = $db->query($sql);
@ -120,7 +120,7 @@ class box_project extends ModeleBoxes
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
'td' => '', 'td' => '',
'text' => $projectstatic->getNomUrl(1), 'text' => $projectstatic->getNomUrl(1),
'asis' => 1 'asis' => 1
); );
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
@ -128,42 +128,42 @@ class box_project extends ModeleBoxes
'text' => $objp->title, 'text' => $objp->title,
); );
$sql ="SELECT count(*) as nb, sum(progress) as totprogress"; $sql ="SELECT count(*) as nb, sum(progress) as totprogress";
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid"; $sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
$sql.= " WHERE p.entity IN (".getEntity('project').')'; $sql.= " WHERE p.entity IN (".getEntity('project').')';
$sql.=" AND p.rowid = ".$objp->rowid; $sql.=" AND p.rowid = ".$objp->rowid;
$resultTask = $db->query($sql); $resultTask = $db->query($sql);
if ($resultTask) { if ($resultTask) {
$objTask = $db->fetch_object($resultTask); $objTask = $db->fetch_object($resultTask);
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
'td' => 'class="right"', 'td' => 'class="right"',
'text' => $objTask->nb." ".$langs->trans("Tasks"), 'text' => $objTask->nb." ".$langs->trans("Tasks"),
); );
if ($objTask->nb > 0) if ($objTask->nb > 0)
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
'td' => 'class="right"', 'td' => 'class="right"',
'text' => round($objTask->totprogress/$objTask->nb, 0)."%", 'text' => round($objTask->totprogress/$objTask->nb, 0)."%",
); );
else else
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A "); $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A ");
$totalnbTask += $objTask->nb; $totalnbTask += $objTask->nb;
} else { } else {
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => round(0)); $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => round(0));
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A "); $this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A ");
} }
$i++; $i++;
} }
if ($max < $num) if ($max < $num)
{ {
$this->info_box_contents[$i][] = array('td' => 'colspan="5"', 'text' => '...'); $this->info_box_contents[$i][] = array('td' => 'colspan="5"', 'text' => '...');
$i++; $i++;
} }
} }
} }
// Add the sum à the bottom of the boxes // Add the sum à the bottom of the boxes
$this->info_box_contents[$i][] = array( $this->info_box_contents[$i][] = array(
'td' => '', 'td' => '',
'text' => $langs->trans("Total")."&nbsp;".$textHead, 'text' => $langs->trans("Total")."&nbsp;".$textHead,
@ -181,18 +181,18 @@ class box_project extends ModeleBoxes
'td' => '', 'td' => '',
'text' => "&nbsp;", 'text' => "&nbsp;",
); );
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }
} }

View File

@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_propales extends ModeleBoxes class box_propales extends ModeleBoxes
{ {
var $boxcode="lastpropals"; public $boxcode="lastpropals";
var $boximg="object_propal"; public $boximg="object_propal";
var $boxlabel="BoxLastProposals"; public $boxlabel="BoxLastProposals";
var $depends = array("propal"); // conf->propal->enabled public $depends = array("propal"); // conf->propal->enabled
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -54,7 +54,7 @@ class box_propales extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $user; global $user;
@ -69,7 +69,7 @@ class box_propales extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
@ -181,14 +181,14 @@ class box_propales extends ModeleBoxes
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -34,20 +34,20 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
*/ */
class box_prospect extends ModeleBoxes class box_prospect extends ModeleBoxes
{ {
var $boxcode="lastprospects"; public $boxcode="lastprospects";
var $boximg="object_company"; public $boximg="object_company";
var $boxlabel="BoxLastProspects"; public $boxlabel="BoxLastProspects";
var $depends = array("societe"); public $depends = array("societe");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $enabled = 1; public $enabled = 1;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -56,7 +56,7 @@ class box_prospect extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $conf, $user; global $conf, $user;
@ -74,7 +74,7 @@ class box_prospect extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
@ -177,7 +177,7 @@ class box_prospect extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/ */
class box_services_contracts extends ModeleBoxes class box_services_contracts extends ModeleBoxes
{ {
var $boxcode="lastproductsincontract"; public $boxcode="lastproductsincontract";
var $boximg="object_product"; public $boximg="object_product";
var $boxlabel="BoxLastProductsInContract"; public $boxlabel="BoxLastProductsInContract";
var $depends = array("service","contrat"); public $depends = array("service","contrat");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -54,7 +54,7 @@ class box_services_contracts extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $user; global $user;
@ -69,7 +69,7 @@ class box_services_contracts extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
@ -249,8 +249,8 @@ class box_services_contracts extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }
} }

View File

@ -30,20 +30,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
class box_services_expired extends ModeleBoxes class box_services_expired extends ModeleBoxes
{ {
var $boxcode="expiredservices"; // id of box public $boxcode="expiredservices"; // id of box
var $boximg="object_contract"; public $boximg="object_contract";
var $boxlabel="BoxOldestExpiredServices"; public $boxlabel="BoxOldestExpiredServices";
var $depends = array("contrat"); // conf->propal->enabled public $depends = array("contrat"); // conf->propal->enabled
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -52,7 +52,7 @@ class box_services_expired extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $user; global $user;
@ -67,7 +67,7 @@ class box_services_expired extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db, $conf;
@ -189,14 +189,14 @@ class box_services_expired extends ModeleBoxes
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -31,19 +31,19 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
class box_supplier_orders extends ModeleBoxes class box_supplier_orders extends ModeleBoxes
{ {
var $boxcode = "latestsupplierorders"; public $boxcode = "latestsupplierorders";
var $boximg = "object_order"; public $boximg = "object_order";
var $boxlabel="BoxLatestSupplierOrders"; public $boxlabel="BoxLatestSupplierOrders";
var $depends = array("fournisseur"); public $depends = array("fournisseur");
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $param; public $param;
var $info_box_head = array(); public $info_box_head = array();
var $info_box_contents = array(); public $info_box_contents = array();
/** /**
@ -52,7 +52,7 @@ class box_supplier_orders extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param) public function __construct($db, $param)
{ {
global $user; global $user;
@ -67,7 +67,7 @@ class box_supplier_orders extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $conf, $user, $langs, $db; global $conf, $user, $langs, $db;
$langs->load("boxes"); $langs->load("boxes");
@ -177,14 +177,14 @@ class box_supplier_orders extends ModeleBoxes
} }
/** /**
* Method to show box * Method to show box
* *
* @param array $head Array with properties of box title * @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines * @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -54,7 +54,7 @@ class box_task extends ModeleBoxes
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $user, $langs; global $user, $langs;
@ -73,7 +73,7 @@ class box_task extends ModeleBoxes
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max = 5) public function loadBox($max = 5)
{ {
global $conf, $user, $langs, $db; global $conf, $user, $langs, $db;
@ -150,7 +150,7 @@ class box_task extends ModeleBoxes
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }

View File

@ -115,7 +115,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
$this->db=$db; $this->db=$db;
} }
@ -125,7 +125,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
* *
* @return string Error message * @return string Error message
*/ */
function error() public function error()
{ {
return $this->error; return $this->error;
} }
@ -138,7 +138,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) public function fetch($rowid)
{ {
global $conf; global $conf;
@ -182,7 +182,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
* *
* @return string * @return string
*/ */
function outputBox($head = null, $contents = null) public function outputBox($head = null, $contents = null)
{ {
global $langs, $user, $conf; global $langs, $user, $conf;
@ -204,7 +204,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
* @param int $nooutput No print, only return string * @param int $nooutput No print, only return string
* @return string * @return string
*/ */
function showBox($head = null, $contents = null, $nooutput = 0) public function showBox($head = null, $contents = null, $nooutput = 0)
{ {
global $langs, $user, $conf; global $langs, $user, $conf;
@ -385,7 +385,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
* @param array $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only. * @param array $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only.
* @return array Array list of widget * @return array Array list of widget
*/ */
static function getWidgetsList($forcedirwidget = null) public static function getWidgetsList($forcedirwidget = null)
{ {
global $conf, $langs, $db; global $conf, $langs, $db;

View File

@ -214,7 +214,7 @@ if (! function_exists('json_decode'))
* @param bool $assoc False return an object, true return an array * @param bool $assoc False return an object, true return an array
* @return mixed Object or Array * @return mixed Object or Array
*/ */
function json_decode($json, $assoc=false) function json_decode($json, $assoc = false)
{ {
return dol_json_decode($json, $assoc); return dol_json_decode($json, $assoc);
} }
@ -229,7 +229,7 @@ if (! function_exists('json_decode'))
* @return mixed Object or Array or false on error * @return mixed Object or Array or false on error
* @see json_decode() * @see json_decode()
*/ */
function dol_json_decode($json, $assoc=false) function dol_json_decode($json, $assoc = false)
{ {
dol_syslog("For better performance, enable the native json in your PHP", LOG_WARNING); dol_syslog("For better performance, enable the native json in your PHP", LOG_WARNING);
@ -242,8 +242,8 @@ function dol_json_decode($json, $assoc=false)
if (! $comment) if (! $comment)
{ {
if (($json[$i] == '{') || ($json[$i] == '[')) $out.= 'array('; if (($json[$i] == '{') || ($json[$i] == '[')) $out.= 'array(';
else if (($json[$i] == '}') || ($json[$i] == ']')) $out.= ')'; elseif (($json[$i] == '}') || ($json[$i] == ']')) $out.= ')';
else if ($json[$i] == ':') $out.= ' => '; elseif ($json[$i] == ':') $out.= ' => ';
else $out.=$json[$i]; else $out.=$json[$i];
} }
else $out.= $json[$i]; else $out.= $json[$i];
@ -292,7 +292,7 @@ function _unval($val)
// single, escaped unicode character // single, escaped unicode character
$utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2])); $utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2]));
$utf8 = utf162utf8($utf16); $utf8 = utf162utf8($utf16);
$val=preg_replace('/\\\u'.$reg[1].$reg[2].'/i',$utf8,$val); $val=preg_replace('/\\\u'.$reg[1].$reg[2].'/i', $utf8, $val);
} }
return $val; return $val;
} }

View File

@ -134,16 +134,16 @@ abstract class DolibarrTriggers
} }
} }
/** /**
* Function called when a Dolibarrr business event is done. * Function called when a Dolibarrr business event is done.
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared) * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
* *
* @param string $action Event action code * @param string $action Event action code
* @param Object $object Object * @param Object $object Object
* @param User $user Object user * @param User $user Object user
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @param conf $conf Object conf * @param conf $conf Object conf
* @return int <0 if KO, 0 if no triggered ran, >0 if OK * @return int <0 if KO, 0 if no triggered ran, >0 if OK
*/ */
abstract function runTrigger($action, $object, User $user, Translate $langs, Conf $conf); public abstract function runTrigger($action, $object, User $user, Translate $langs, Conf $conf);
} }

View File

@ -96,7 +96,7 @@ class InterfaceNotification extends DolibarrTriggers
* *
* @return array Array of events managed by notification module * @return array Array of events managed by notification module
*/ */
function getListOfManagedEvents() public function getListOfManagedEvents()
{ {
global $conf; global $conf;