Fix code style and var type

This commit is contained in:
Laurent Destailleur 2019-08-31 01:54:21 +02:00
parent a3e221468a
commit 43e0655dd5
24 changed files with 44 additions and 44 deletions

View File

@ -57,12 +57,12 @@ class box_activity extends ModeleBoxes
{ {
global $conf, $user; global $conf, $user;
$this->db=$db; $this->db = $db;
// FIXME: Pb into some status // FIXME: Pb into some status
$this->enabled=($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments) $this->enabled = ($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
$this->hidden= ! ((! empty($conf->facture->enabled) && $user->rights->facture->lire) $this->hidden = ! ((! empty($conf->facture->enabled) && $user->rights->facture->lire)
|| (! empty($conf->commande->enabled) && $user->rights->commande->lire) || (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|| (! empty($conf->propal->enabled) && $user->rights->propale->lire) || (! empty($conf->propal->enabled) && $user->rights->propale->lire)
); );

View File

@ -56,7 +56,7 @@ class box_birthdays extends ModeleBoxes
*/ */
public function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $conf, $user; global $user;
$this->db = $db; $this->db = $db;
@ -71,7 +71,7 @@ class box_birthdays extends ModeleBoxes
*/ */
public function loadBox($max = 20) public function loadBox($max = 20)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db;
$langs->load("boxes"); $langs->load("boxes");
$this->max=$max; $this->max=$max;

View File

@ -56,7 +56,7 @@ class box_birthdays_members extends ModeleBoxes
*/ */
public function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $conf, $user; global $user;
$this->db = $db; $this->db = $db;
@ -71,7 +71,7 @@ class box_birthdays_members extends ModeleBoxes
*/ */
public function loadBox($max = 20) public function loadBox($max = 20)
{ {
global $user, $langs, $db, $conf; global $user, $langs, $db;
$langs->load("boxes"); $langs->load("boxes");
$this->max=$max; $this->max=$max;

View File

@ -54,9 +54,9 @@ class box_bookmarks extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->bookmark->lire); $this->hidden = ! ($user->rights->bookmark->lire);
} }
/** /**

View File

@ -58,9 +58,9 @@ class box_commandes extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->commande->lire); $this->hidden = ! ($user->rights->commande->lire);
} }
/** /**

View File

@ -60,9 +60,9 @@ class box_contacts extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->societe->lire && $user->rights->societe->contact->lire); $this->hidden = ! ($user->rights->societe->lire && $user->rights->societe->contact->lire);
} }
/** /**

View File

@ -57,9 +57,9 @@ class box_contracts extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->contrat->lire); $this->hidden = ! ($user->rights->contrat->lire);
} }
/** /**

View File

@ -56,9 +56,9 @@ class box_factures extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->facture->lire); $this->hidden = ! ($user->rights->facture->lire);
} }
/** /**

View File

@ -57,9 +57,9 @@ class box_factures_fourn extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->fournisseur->facture->lire); $this->hidden = ! ($user->rights->fournisseur->facture->lire);
} }
/** /**

View File

@ -56,9 +56,9 @@ class box_factures_fourn_imp extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->fournisseur->facture->lire); $this->hidden = ! ($user->rights->fournisseur->facture->lire);
} }
/** /**

View File

@ -59,9 +59,9 @@ class box_factures_imp extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->facture->lire); $this->hidden = ! ($user->rights->facture->lire);
} }
/** /**

View File

@ -57,9 +57,9 @@ class box_ficheinter extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->ficheinter->lire); $this->hidden = ! ($user->rights->ficheinter->lire);
} }
/** /**

View File

@ -57,9 +57,9 @@ class box_fournisseurs extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->societe->lire && empty($user->socid)); $this->hidden = ! ($user->rights->societe->lire && empty($user->socid));
} }
/** /**

View File

@ -52,9 +52,9 @@ class box_graph_propales_permonth extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->propale->lire); $this->hidden = ! ($user->rights->propale->lire);
} }
/** /**

View File

@ -65,7 +65,7 @@ class box_members extends ModeleBoxes
$listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
if (! in_array('adherent', $listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users if (! in_array('adherent', $listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
$this->hidden=! ($user->rights->adherent->lire); $this->hidden = ! ($user->rights->adherent->lire);
} }
/** /**

View File

@ -64,7 +64,7 @@ class box_produits extends ModeleBoxes
$listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
$tmpentry=array('enabled'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'perms'=>(! empty($user->rights->produit->lire) || ! empty($user->rights->service->lire)), 'module'=>'product|service'); $tmpentry=array('enabled'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'perms'=>(! empty($user->rights->produit->lire) || ! empty($user->rights->service->lire)), 'module'=>'product|service');
$showmode=isVisibleToUserType(($user->societe_id > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $showmode=isVisibleToUserType(($user->societe_id > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden=($showmode != 1); $this->hidden = ($showmode != 1);
} }
/** /**

View File

@ -66,7 +66,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
$tmpentry=array('enabled'=>((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && ! empty($conf->stock->enabled)), 'perms'=>($user->rights->stock->lire), 'module'=>'product|service|stock'); $tmpentry=array('enabled'=>((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && ! empty($conf->stock->enabled)), 'perms'=>($user->rights->stock->lire), 'module'=>'product|service|stock');
$showmode=isVisibleToUserType(($user->societe_id > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $showmode=isVisibleToUserType(($user->societe_id > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden=($showmode != 1); $this->hidden = ($showmode != 1);
} }
/** /**

View File

@ -59,9 +59,9 @@ class box_project extends ModeleBoxes
$langs->loadLangs(array('boxes', 'projects')); $langs->loadLangs(array('boxes', 'projects'));
$this->db = $db; $this->db = $db;
$this->boxlabel="OpenedProjects"; $this->boxlabel = "OpenedProjects";
$this->hidden=! ($user->rights->projet->lire); $this->hidden = ! ($user->rights->projet->lire);
} }
/** /**

View File

@ -58,9 +58,9 @@ class box_propales extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->propale->lire); $this->hidden = ! ($user->rights->propale->lire);
} }
/** /**

View File

@ -65,7 +65,7 @@ class box_prospect extends ModeleBoxes
// disable box for such cases // disable box for such cases
if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $this->enabled=0; // disabled by this option if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $this->enabled=0; // disabled by this option
$this->hidden=! ($user->rights->societe->lire && empty($user->socid)); $this->hidden = ! ($user->rights->societe->lire && empty($user->socid));
} }
/** /**

View File

@ -58,9 +58,9 @@ class box_services_contracts extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->service->lire && $user->rights->contrat->lire); $this->hidden = ! ($user->rights->service->lire && $user->rights->contrat->lire);
} }
/** /**

View File

@ -56,9 +56,9 @@ class box_services_expired extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->contrat->lire); $this->hidden = ! ($user->rights->contrat->lire);
} }
/** /**

View File

@ -56,9 +56,9 @@ class box_supplier_orders extends ModeleBoxes
{ {
global $user; global $user;
$this->db=$db; $this->db = $db;
$this->hidden=! ($user->rights->fournisseur->commande->lire); $this->hidden = ! ($user->rights->fournisseur->commande->lire);
} }
/** /**

View File

@ -54,7 +54,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
public $enabled=1; public $enabled=1;
/** /**
* @var int Condition to have widget visible (in most cases, permissions) * @var boolean Condition to have widget visible (in most cases, permissions)
*/ */
public $hidden=0; public $hidden=0;