mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-07 18:18:18 +01:00
Fix: Removed warnings
This commit is contained in:
@@ -4134,7 +4134,7 @@ function verifCond($strRights)
|
|||||||
* This function is called by verifCond() or trans() and transnoentitiesnoconv().
|
* This function is called by verifCond() or trans() and transnoentitiesnoconv().
|
||||||
*
|
*
|
||||||
* @param string $s String to evaluate
|
* @param string $s String to evaluate
|
||||||
* @param int $returnvalue 0=No return (used to execute $a=something). 1=Value of eval is returned (used to eval $something).
|
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
||||||
* @return mixed Nothing or return of eval
|
* @return mixed Nothing or return of eval
|
||||||
*/
|
*/
|
||||||
function dol_eval($s,$returnvalue=0)
|
function dol_eval($s,$returnvalue=0)
|
||||||
@@ -4145,8 +4145,8 @@ function dol_eval($s,$returnvalue=0)
|
|||||||
global $rights;
|
global $rights;
|
||||||
|
|
||||||
//print $s."<br>\n";
|
//print $s."<br>\n";
|
||||||
if ($returnvalue) return eval('return '.$s.';');
|
if ($returnvalue) return @eval('return '.$s.';');
|
||||||
else eval($s);
|
else @eval($s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0)
|
|||||||
{
|
{
|
||||||
global $user,$conf,$langs,$dolibarr_main_db_name;
|
global $user,$conf,$langs,$dolibarr_main_db_name;
|
||||||
|
|
||||||
$mainmenu=$_SESSION["mainmenu"];
|
$mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]);
|
||||||
$leftmenu=$_SESSION["leftmenu"];
|
$leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]);
|
||||||
|
|
||||||
$id='mainmenu';
|
$id='mainmenu';
|
||||||
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ class modAgenda extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->numero = 2400;
|
$this->numero = 2400;
|
||||||
|
|
||||||
|
|||||||
@@ -297,7 +297,11 @@ if (! empty($_SESSION["disablemodules"]))
|
|||||||
$disabled_modules=explode(',',$_SESSION["disablemodules"]);
|
$disabled_modules=explode(',',$_SESSION["disablemodules"]);
|
||||||
foreach($disabled_modules as $module)
|
foreach($disabled_modules as $module)
|
||||||
{
|
{
|
||||||
if ($module) $conf->$module->enabled=false;
|
if ($module)
|
||||||
|
{
|
||||||
|
if (empty($conf->$module)) $conf->$module=new stdClass();
|
||||||
|
$conf->$module->enabled=false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -820,11 +820,11 @@ class Project extends CommonObject
|
|||||||
{
|
{
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
$userAccess = 0;
|
$userAccess = 0;
|
||||||
if (($mode == 'read' && $user->rights->projet->all->lire) || ($mode == 'write' && $user->rights->projet->all->creer) || ($mode == 'delete' && $user->rights->projet->all->supprimer))
|
if (($mode == 'read' && ! empty($user->rights->projet->all->lire)) || ($mode == 'write' && ! empty($user->rights->projet->all->creer)) || ($mode == 'delete' && ! empty($user->rights->projet->all->supprimer)))
|
||||||
{
|
{
|
||||||
$userAccess = 1;
|
$userAccess = 1;
|
||||||
}
|
}
|
||||||
else if ($this->public && (($mode == 'read' && $user->rights->projet->lire) || ($mode == 'write' && $user->rights->projet->creer) || ($mode == 'delete' && $user->rights->projet->supprimer)))
|
else if ($this->public && (($mode == 'read' && ! empty($user->rights->projet->lire)) || ($mode == 'write' && ! empty($user->rights->projet->creer)) || ($mode == 'delete' && ! empty($user->rights->projet->supprimer))))
|
||||||
{
|
{
|
||||||
$userAccess = 1;
|
$userAccess = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
|||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
$mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
$mine = GETPOST('mode')=='mine' ? 1 : 0;
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=0;
|
$socid=0;
|
||||||
@@ -49,7 +49,7 @@ $sortorder = GETPOST("sortorder",'alpha');
|
|||||||
$socstatic=new Societe($db);
|
$socstatic=new Societe($db);
|
||||||
$projectstatic=new Project($db);
|
$projectstatic=new Project($db);
|
||||||
|
|
||||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:($user->rights->projet->all->lire?2:0)),1);
|
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1);
|
||||||
//var_dump($projectsListId);
|
//var_dump($projectsListId);
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ print_fiche_titre($text);
|
|||||||
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
|
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($user->rights->projet->all->lire && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
|
if (! empty($user->rights->projet->all->lire) && ! $socid) print $langs->trans("ProjectsDesc").'<br><br>';
|
||||||
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
else print $langs->trans("ProjectsPublicDesc").'<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ $sql.= ", s.nom, s.rowid as socid";
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
|
||||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||||
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")";
|
||||||
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
|
||||||
$sql.= " GROUP BY s.nom, s.rowid";
|
$sql.= " GROUP BY s.nom, s.rowid";
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,21 @@ global $dolibarr_main_demo;
|
|||||||
if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',1,1,1);
|
if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',1,1,1);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('demo'));
|
$res=$hookmanager->initHooks(array('demo'));
|
||||||
|
|
||||||
|
$demoprofiles=array();
|
||||||
|
$alwayscheckedmodules=array();
|
||||||
|
$alwaysuncheckedmodules=array();
|
||||||
|
$alwayshiddencheckedmodules=array();
|
||||||
|
$alwayshiddenuncheckedmodules=array();
|
||||||
|
|
||||||
|
$tmpaction = 'view';
|
||||||
|
$parameters=array();
|
||||||
|
$object=new stdClass();
|
||||||
|
$reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
$demoprofiles=array(
|
$demoprofiles=array(
|
||||||
array('default'=>'1', 'key'=>'profdemoservonly','label'=>'DemoCompanyServiceOnly',
|
array('default'=>'1', 'key'=>'profdemoservonly','label'=>'DemoCompanyServiceOnly',
|
||||||
'disablemodules'=>'adherent,barcode,boutique,cashdesk,categorie,don,expedition,externalsite,mailmanspip,margin,prelevement,product,stock',
|
'disablemodules'=>'adherent,barcode,boutique,cashdesk,categorie,don,expedition,externalsite,mailmanspip,margin,prelevement,product,stock',
|
||||||
@@ -61,13 +74,6 @@ $demoprofiles=array(
|
|||||||
'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png')
|
'icon'=>DOL_URL_ROOT.'/public/demo/dolibarr_screenshot6.png')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$tmpaction = 'view';
|
|
||||||
$parameters=array();
|
|
||||||
$object=new stdClass();
|
|
||||||
$reshook=$hookmanager->executeHooks('addDemoProfile', $parameters, $object, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
|
||||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
|
||||||
|
|
||||||
// Visible
|
// Visible
|
||||||
$alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want
|
$alwayscheckedmodules=array('barcode','bookmark','externalrss','fckeditor','geoipmaxmind','gravatar','memcached','syslog','user','webservices'); // Technical module we always want
|
||||||
$alwaysuncheckedmodules=array('paybox','paypal','google','scanner','workflow'); // Module we never want
|
$alwaysuncheckedmodules=array('paybox','paypal','google','scanner','workflow'); // Module we never want
|
||||||
@@ -80,6 +86,7 @@ $alwayshiddenuncheckedmodules=array('boutique','ftp',
|
|||||||
// Extended modules
|
// Extended modules
|
||||||
'awstats','bittorrent','bootstrap','cabinetmed','cmcic','concatpdf','customfield','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','multicompany','nltechno','numberingpack','openstreetmap',
|
'awstats','bittorrent','bootstrap','cabinetmed','cmcic','concatpdf','customfield','dolicloud','filemanager','lightbox','mantis','monitoring','moretemplates','multicompany','nltechno','numberingpack','openstreetmap',
|
||||||
'ovh','phenix','phpsysinfo','pibarcode','postnuke','selectbank','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail');
|
'ovh','phenix','phpsysinfo','pibarcode','postnuke','selectbank','skincoloreditor','submiteverywhere','survey','thomsonphonebook','topten','tvacerfa','voyage','webcalendar','webmail');
|
||||||
|
}
|
||||||
|
|
||||||
// Search modules
|
// Search modules
|
||||||
$dirlist=$conf->file->dol_document_root;
|
$dirlist=$conf->file->dol_document_root;
|
||||||
@@ -151,8 +158,8 @@ foreach ($modulesdir as $dir)
|
|||||||
|
|
||||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
||||||
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0;
|
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && empty($conf->global->$const_name)) $modulequalified=0;
|
||||||
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0;
|
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && empty($conf->global->$const_name)) $modulequalified=0;
|
||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2770,7 +2770,7 @@ class Societe extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function getLibCustProspStatut()
|
function getLibCustProspStatut()
|
||||||
{
|
{
|
||||||
return $this->LibCustProspStatut($this->client,$mode);
|
return $this->LibCustProspStatut($this->client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class UserGroup extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array of users id for group
|
* Return array of users id for group this->id (or all if this->id not defined)
|
||||||
*
|
*
|
||||||
* @param string $excludefilter Filter to exclude
|
* @param string $excludefilter Filter to exclude
|
||||||
* @return array Array of users
|
* @return array Array of users
|
||||||
@@ -214,9 +214,11 @@ class UserGroup extends CommonObject
|
|||||||
$newuser->fetch($obj->rowid);
|
$newuser->fetch($obj->rowid);
|
||||||
$ret[$obj->rowid]=$newuser;
|
$ret[$obj->rowid]=$newuser;
|
||||||
}
|
}
|
||||||
|
if (! empty($obj->usergroup_entity))
|
||||||
|
{
|
||||||
$ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity;
|
$ret[$obj->rowid]->usergroup_entity[]=$obj->usergroup_entity;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user