add visibility
This commit is contained in:
parent
cc1ee2d883
commit
ba4ca5d7c2
@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_actions extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastactions";
|
||||
var $boximg="object_action";
|
||||
var $boxlabel="BoxLastActions";
|
||||
var $depends = array("agenda");
|
||||
public $boxcode="lastactions";
|
||||
public $boximg="object_action";
|
||||
public $boxlabel="BoxLastActions";
|
||||
public $depends = array("agenda");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ class box_actions extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -69,7 +69,7 @@ class box_actions extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
@ -188,7 +188,7 @@ class box_actions extends ModeleBoxes
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
global $langs, $conf;
|
||||
$out = parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||
@ -257,5 +257,5 @@ class box_actions extends ModeleBoxes
|
||||
else print $out;
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,21 +30,21 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_activity extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="activity";
|
||||
var $boximg="object_bill";
|
||||
var $boxlabel='BoxGlobalActivity';
|
||||
var $depends = array("facture");
|
||||
public $boxcode="activity";
|
||||
public $boximg="object_bill";
|
||||
public $boxlabel='BoxGlobalActivity';
|
||||
public $depends = array("facture");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
var $enabled = 1;
|
||||
public $param;
|
||||
public $enabled = 1;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -53,7 +53,7 @@ class box_activity extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
@ -74,7 +74,7 @@ class box_activity extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
|
||||
@ -450,16 +450,16 @@ class box_activity extends ModeleBoxes
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,20 +28,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_bookmarks extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="bookmarks";
|
||||
var $boximg="object_bookmark";
|
||||
var $boxlabel="BoxMyLastBookmarks";
|
||||
var $depends = array("bookmark");
|
||||
public $boxcode="bookmarks";
|
||||
public $boximg="object_bookmark";
|
||||
public $boxlabel="BoxMyLastBookmarks";
|
||||
public $depends = array("bookmark");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -50,7 +50,7 @@ class box_bookmarks extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -65,7 +65,7 @@ class box_bookmarks extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
$langs->load("boxes");
|
||||
@ -149,16 +149,16 @@ class box_bookmarks extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_clients extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastcustomers";
|
||||
var $boximg="object_company";
|
||||
var $boxlabel="BoxLastCustomers";
|
||||
var $depends = array("societe");
|
||||
public $boxcode="lastcustomers";
|
||||
public $boximg="object_company";
|
||||
public $boxlabel="BoxLastCustomers";
|
||||
public $depends = array("societe");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $enabled = 1;
|
||||
public $enabled = 1;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ class box_clients extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
@ -72,7 +72,7 @@ class box_clients extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
$langs->load("boxes");
|
||||
@ -175,7 +175,7 @@ class box_clients extends ModeleBoxes
|
||||
* @param int $nooutput No print, only 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);
|
||||
}
|
||||
|
||||
@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_commandes extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastcustomerorders";
|
||||
var $boximg="object_order";
|
||||
var $boxlabel="BoxLastCustomerOrders";
|
||||
var $depends = array("commande");
|
||||
public $boxcode="lastcustomerorders";
|
||||
public $boximg="object_order";
|
||||
public $boxlabel="BoxLastCustomerOrders";
|
||||
public $depends = array("commande");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ class box_commandes extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -69,7 +69,7 @@ class box_commandes extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
@ -198,7 +198,7 @@ class box_commandes extends ModeleBoxes
|
||||
* @param int $nooutput No print, only 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);
|
||||
}
|
||||
|
||||
@ -33,20 +33,20 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
*/
|
||||
class box_produits extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastproducts";
|
||||
var $boximg="object_product";
|
||||
var $boxlabel="BoxLastProducts";
|
||||
var $depends = array("produit");
|
||||
public $boxcode="lastproducts";
|
||||
public $boximg="object_product";
|
||||
public $boxlabel="BoxLastProducts";
|
||||
public $depends = array("produit");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -55,7 +55,7 @@ class box_produits extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
@ -73,7 +73,7 @@ class box_produits extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf, $hookmanager;
|
||||
|
||||
@ -218,16 +218,16 @@ class box_produits extends ModeleBoxes
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,20 +35,20 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
*/
|
||||
class box_produits_alerte_stock extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="productsalertstock";
|
||||
var $boximg="object_product";
|
||||
var $boxlabel="BoxProductsAlertStock";
|
||||
var $depends = array("produit");
|
||||
public $boxcode="productsalertstock";
|
||||
public $boximg="object_product";
|
||||
public $boxlabel="BoxProductsAlertStock";
|
||||
public $depends = array("produit");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -57,7 +57,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $conf,$user;
|
||||
|
||||
@ -75,7 +75,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
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
|
||||
* @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);
|
||||
}
|
||||
|
||||
@ -30,20 +30,20 @@ include_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
|
||||
*/
|
||||
class box_project extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="project";
|
||||
var $boximg="object_projectpub";
|
||||
var $boxlabel;
|
||||
//var $depends = array("projet");
|
||||
public $boxcode="project";
|
||||
public $boximg="object_projectpub";
|
||||
public $boxlabel;
|
||||
//var $depends = array("projet");
|
||||
|
||||
/**
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -51,7 +51,7 @@ class box_project extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
@ -64,45 +64,45 @@ class box_project extends ModeleBoxes
|
||||
$this->hidden=! ($user->rights->projet->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
/**
|
||||
* Load data for box to show them later
|
||||
*
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
|
||||
$this->max=$max;
|
||||
$this->max=$max;
|
||||
|
||||
$totalMnt = 0;
|
||||
$totalnb = 0;
|
||||
$totalnbTask=0;
|
||||
$totalMnt = 0;
|
||||
$totalnb = 0;
|
||||
$totalnbTask=0;
|
||||
|
||||
$textHead = $langs->trans("OpenedProjects");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
$textHead = $langs->trans("OpenedProjects");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
|
||||
// list the summary of the orders
|
||||
if ($user->rights->projet->lire) {
|
||||
// list the summary of the orders
|
||||
if ($user->rights->projet->lire) {
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$projectstatic = new Project($this->db);
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$projectstatic = new Project($this->db);
|
||||
|
||||
$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.
|
||||
|
||||
// Get list of project id allowed to user (in a string list separated by coma)
|
||||
$projectsListId='';
|
||||
if (! $user->rights->projet->all->lire) $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
|
||||
$projectsListId='';
|
||||
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.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut, p.public";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$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
|
||||
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
//$sql.= $db->plimit($max, 0);
|
||||
//$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -120,7 +120,7 @@ class box_project extends ModeleBoxes
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => '',
|
||||
'text' => $projectstatic->getNomUrl(1),
|
||||
'asis' => 1
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
@ -128,42 +128,42 @@ class box_project extends ModeleBoxes
|
||||
'text' => $objp->title,
|
||||
);
|
||||
|
||||
$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.= " WHERE p.entity IN (".getEntity('project').')';
|
||||
$sql.=" AND p.rowid = ".$objp->rowid;
|
||||
$resultTask = $db->query($sql);
|
||||
if ($resultTask) {
|
||||
$objTask = $db->fetch_object($resultTask);
|
||||
$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.= " WHERE p.entity IN (".getEntity('project').')';
|
||||
$sql.=" AND p.rowid = ".$objp->rowid;
|
||||
$resultTask = $db->query($sql);
|
||||
if ($resultTask) {
|
||||
$objTask = $db->fetch_object($resultTask);
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => $objTask->nb." ".$langs->trans("Tasks"),
|
||||
);
|
||||
if ($objTask->nb > 0)
|
||||
if ($objTask->nb > 0)
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => round($objTask->totprogress/$objTask->nb, 0)."%",
|
||||
);
|
||||
else
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A ");
|
||||
$totalnbTask += $objTask->nb;
|
||||
} else {
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => round(0));
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A ");
|
||||
}
|
||||
else
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A ");
|
||||
$totalnbTask += $objTask->nb;
|
||||
} else {
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => round(0));
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => "N/A ");
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
if ($max < $num)
|
||||
{
|
||||
$this->info_box_contents[$i][] = array('td' => 'colspan="5"', 'text' => '...');
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ($max < $num)
|
||||
{
|
||||
$this->info_box_contents[$i][] = array('td' => 'colspan="5"', 'text' => '...');
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add the sum à the bottom of the boxes
|
||||
// Add the sum à the bottom of the boxes
|
||||
$this->info_box_contents[$i][] = array(
|
||||
'td' => '',
|
||||
'text' => $langs->trans("Total")." ".$textHead,
|
||||
@ -181,18 +181,18 @@ class box_project extends ModeleBoxes
|
||||
'td' => '',
|
||||
'text' => " ",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @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 string
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_propales extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastpropals";
|
||||
var $boximg="object_propal";
|
||||
var $boxlabel="BoxLastProposals";
|
||||
var $depends = array("propal"); // conf->propal->enabled
|
||||
public $boxcode="lastpropals";
|
||||
public $boximg="object_propal";
|
||||
public $boxlabel="BoxLastProposals";
|
||||
public $depends = array("propal"); // conf->propal->enabled
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ class box_propales extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -69,7 +69,7 @@ class box_propales extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
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 int $nooutput No print, only 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);
|
||||
}
|
||||
|
||||
@ -34,20 +34,20 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
*/
|
||||
class box_prospect extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastprospects";
|
||||
var $boximg="object_company";
|
||||
var $boxlabel="BoxLastProspects";
|
||||
var $depends = array("societe");
|
||||
public $boxcode="lastprospects";
|
||||
public $boximg="object_company";
|
||||
public $boxlabel="BoxLastProspects";
|
||||
public $depends = array("societe");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $enabled = 1;
|
||||
public $enabled = 1;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -56,7 +56,7 @@ class box_prospect extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
@ -74,7 +74,7 @@ class box_prospect extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
@ -177,7 +177,7 @@ class box_prospect extends ModeleBoxes
|
||||
* @param int $nooutput No print, only 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);
|
||||
}
|
||||
|
||||
@ -32,20 +32,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
*/
|
||||
class box_services_contracts extends ModeleBoxes
|
||||
{
|
||||
var $boxcode="lastproductsincontract";
|
||||
var $boximg="object_product";
|
||||
var $boxlabel="BoxLastProductsInContract";
|
||||
var $depends = array("service","contrat");
|
||||
public $boxcode="lastproductsincontract";
|
||||
public $boximg="object_product";
|
||||
public $boxlabel="BoxLastProductsInContract";
|
||||
public $depends = array("service","contrat");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -54,7 +54,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -69,7 +69,7 @@ class box_services_contracts extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
|
||||
@ -249,8 +249,8 @@ class box_services_contracts extends ModeleBoxes
|
||||
* @param int $nooutput No print, only 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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,20 +30,20 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
class box_services_expired extends ModeleBoxes
|
||||
{
|
||||
|
||||
var $boxcode="expiredservices"; // id of box
|
||||
var $boximg="object_contract";
|
||||
var $boxlabel="BoxOldestExpiredServices";
|
||||
var $depends = array("contrat"); // conf->propal->enabled
|
||||
public $boxcode="expiredservices"; // id of box
|
||||
public $boximg="object_contract";
|
||||
public $boxlabel="BoxOldestExpiredServices";
|
||||
public $depends = array("contrat"); // conf->propal->enabled
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
public $param;
|
||||
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ class box_services_expired extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -67,7 +67,7 @@ class box_services_expired extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
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 $contents Array with properties of box lines
|
||||
* @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 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);
|
||||
}
|
||||
|
||||
@ -31,19 +31,19 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
|
||||
class box_supplier_orders extends ModeleBoxes
|
||||
{
|
||||
|
||||
var $boxcode = "latestsupplierorders";
|
||||
var $boximg = "object_order";
|
||||
var $boxlabel="BoxLatestSupplierOrders";
|
||||
var $depends = array("fournisseur");
|
||||
public $boxcode = "latestsupplierorders";
|
||||
public $boximg = "object_order";
|
||||
public $boxlabel="BoxLatestSupplierOrders";
|
||||
public $depends = array("fournisseur");
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $param;
|
||||
var $info_box_head = array();
|
||||
var $info_box_contents = array();
|
||||
public $param;
|
||||
public $info_box_head = array();
|
||||
public $info_box_contents = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param)
|
||||
public function __construct($db, $param)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -67,7 +67,7 @@ class box_supplier_orders extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
$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 $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
* @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 string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ class box_task extends ModeleBoxes
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
@ -73,7 +73,7 @@ class box_task extends ModeleBoxes
|
||||
* @param int $max Maximum number of records to load
|
||||
* @return void
|
||||
*/
|
||||
function loadBox($max = 5)
|
||||
public function loadBox($max = 5)
|
||||
{
|
||||
global $conf, $user, $langs, $db;
|
||||
|
||||
@ -150,7 +150,7 @@ class box_task extends ModeleBoxes
|
||||
* @param int $nooutput No print, only 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);
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $param More parameters
|
||||
*/
|
||||
function __construct($db, $param = '')
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
$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
|
||||
*/
|
||||
function error()
|
||||
public function 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
|
||||
*/
|
||||
function fetch($rowid)
|
||||
public function fetch($rowid)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -182,7 +182,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function outputBox($head = null, $contents = null)
|
||||
public function outputBox($head = null, $contents = null)
|
||||
{
|
||||
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
|
||||
* @return string
|
||||
*/
|
||||
function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
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.
|
||||
* @return array Array list of widget
|
||||
*/
|
||||
static function getWidgetsList($forcedirwidget = null)
|
||||
public static function getWidgetsList($forcedirwidget = null)
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ if (! function_exists('json_decode'))
|
||||
* @param bool $assoc False return an object, true return an array
|
||||
* @return mixed Object or Array
|
||||
*/
|
||||
function json_decode($json, $assoc=false)
|
||||
function json_decode($json, $assoc = false)
|
||||
{
|
||||
return dol_json_decode($json, $assoc);
|
||||
}
|
||||
@ -229,7 +229,7 @@ if (! function_exists('json_decode'))
|
||||
* @return mixed Object or Array or false on error
|
||||
* @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);
|
||||
|
||||
@ -242,8 +242,8 @@ function dol_json_decode($json, $assoc=false)
|
||||
if (! $comment)
|
||||
{
|
||||
if (($json[$i] == '{') || ($json[$i] == '[')) $out.= 'array(';
|
||||
else if (($json[$i] == '}') || ($json[$i] == ']')) $out.= ')';
|
||||
else if ($json[$i] == ':') $out.= ' => ';
|
||||
elseif (($json[$i] == '}') || ($json[$i] == ']')) $out.= ')';
|
||||
elseif ($json[$i] == ':') $out.= ' => ';
|
||||
else $out.=$json[$i];
|
||||
}
|
||||
else $out.= $json[$i];
|
||||
@ -292,7 +292,7 @@ function _unval($val)
|
||||
// single, escaped unicode character
|
||||
$utf16 = chr(hexdec($reg[1])) . chr(hexdec($reg[2]));
|
||||
$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;
|
||||
}
|
||||
|
||||
@ -134,16 +134,16 @@ abstract class DolibarrTriggers
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
abstract function runTrigger($action, $object, User $user, Translate $langs, Conf $conf);
|
||||
/**
|
||||
* 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)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public abstract function runTrigger($action, $object, User $user, Translate $langs, Conf $conf);
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
*
|
||||
* @return array Array of events managed by notification module
|
||||
*/
|
||||
function getListOfManagedEvents()
|
||||
public function getListOfManagedEvents()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user