Fix code style and var type
This commit is contained in:
parent
a3e221468a
commit
43e0655dd5
@ -57,12 +57,12 @@ class box_activity extends ModeleBoxes
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
// 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->propal->enabled) && $user->rights->propale->lire)
|
||||
);
|
||||
|
||||
@ -56,7 +56,7 @@ class box_birthdays extends ModeleBoxes
|
||||
*/
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $conf, $user;
|
||||
global $user;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
@ -71,7 +71,7 @@ class box_birthdays extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 20)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $db;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
@ -56,7 +56,7 @@ class box_birthdays_members extends ModeleBoxes
|
||||
*/
|
||||
public function __construct($db, $param = '')
|
||||
{
|
||||
global $conf, $user;
|
||||
global $user;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
@ -71,7 +71,7 @@ class box_birthdays_members extends ModeleBoxes
|
||||
*/
|
||||
public function loadBox($max = 20)
|
||||
{
|
||||
global $user, $langs, $db, $conf;
|
||||
global $user, $langs, $db;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
@ -54,9 +54,9 @@ class box_bookmarks extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->bookmark->lire);
|
||||
$this->hidden = ! ($user->rights->bookmark->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -58,9 +58,9 @@ class box_commandes extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->commande->lire);
|
||||
$this->hidden = ! ($user->rights->commande->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -60,9 +60,9 @@ class box_contacts extends ModeleBoxes
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -57,9 +57,9 @@ class box_contracts extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->contrat->lire);
|
||||
$this->hidden = ! ($user->rights->contrat->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -56,9 +56,9 @@ class box_factures extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->facture->lire);
|
||||
$this->hidden = ! ($user->rights->facture->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -57,9 +57,9 @@ class box_factures_fourn extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->fournisseur->facture->lire);
|
||||
$this->hidden = ! ($user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -56,9 +56,9 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->fournisseur->facture->lire);
|
||||
$this->hidden = ! ($user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -59,9 +59,9 @@ class box_factures_imp extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->facture->lire);
|
||||
$this->hidden = ! ($user->rights->facture->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -57,9 +57,9 @@ class box_ficheinter extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->ficheinter->lire);
|
||||
$this->hidden = ! ($user->rights->ficheinter->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -57,9 +57,9 @@ class box_fournisseurs extends ModeleBoxes
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -52,9 +52,9 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->propale->lire);
|
||||
$this->hidden = ! ($user->rights->propale->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -65,7 +65,7 @@ class box_members extends ModeleBoxes
|
||||
$listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -64,7 +64,7 @@ class box_produits extends ModeleBoxes
|
||||
$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');
|
||||
$showmode=isVisibleToUserType(($user->societe_id > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
||||
$this->hidden=($showmode != 1);
|
||||
$this->hidden = ($showmode != 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -66,7 +66,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
$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');
|
||||
$showmode=isVisibleToUserType(($user->societe_id > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
||||
$this->hidden=($showmode != 1);
|
||||
$this->hidden = ($showmode != 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -59,9 +59,9 @@ class box_project extends ModeleBoxes
|
||||
$langs->loadLangs(array('boxes', 'projects'));
|
||||
|
||||
$this->db = $db;
|
||||
$this->boxlabel="OpenedProjects";
|
||||
$this->boxlabel = "OpenedProjects";
|
||||
|
||||
$this->hidden=! ($user->rights->projet->lire);
|
||||
$this->hidden = ! ($user->rights->projet->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -58,9 +58,9 @@ class box_propales extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->propale->lire);
|
||||
$this->hidden = ! ($user->rights->propale->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -65,7 +65,7 @@ class box_prospect extends ModeleBoxes
|
||||
// disable box for such cases
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -58,9 +58,9 @@ class box_services_contracts extends ModeleBoxes
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -56,9 +56,9 @@ class box_services_expired extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->contrat->lire);
|
||||
$this->hidden = ! ($user->rights->contrat->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -56,9 +56,9 @@ class box_supplier_orders extends ModeleBoxes
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db=$db;
|
||||
$this->db = $db;
|
||||
|
||||
$this->hidden=! ($user->rights->fournisseur->commande->lire);
|
||||
$this->hidden = ! ($user->rights->fournisseur->commande->lire);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -54,7 +54,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
|
||||
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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user