forked from Wavyzz/dolibarr
Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop_project
This commit is contained in:
@@ -944,7 +944,6 @@ function activateModule($value,$withdeps=1)
|
||||
$activate = false;
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
var_dump($modulestring);
|
||||
if (file_exists($dir.$modulestring.".class.php"))
|
||||
{
|
||||
$resarray = activateModule($modulestring);
|
||||
@@ -1354,7 +1353,8 @@ function complete_elementList_with_modules(&$elementList)
|
||||
/**
|
||||
* Show array with constants to edit
|
||||
*
|
||||
* @param array $tableau Array of constants array('key'=>type, ) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
|
||||
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
|
||||
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
|
||||
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all
|
||||
* @param string $helptext Help
|
||||
* @return void
|
||||
@@ -1378,17 +1378,28 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
|
||||
if (empty($strictw3c)) print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$label='';
|
||||
$listofparam=array();
|
||||
foreach($tableau as $key => $const) // Loop on each param
|
||||
{
|
||||
$label='';
|
||||
// $const is a const key like 'MYMODULE_ABC'
|
||||
if (is_numeric($key)) {
|
||||
if (is_numeric($key)) { // Very old behaviour
|
||||
$type = 'string';
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = $const;
|
||||
$const = $key;
|
||||
if (is_array($const))
|
||||
{
|
||||
$type = $const['type'];
|
||||
$label = $const['label'];
|
||||
$const = $key;
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = $const;
|
||||
$const = $key;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT ";
|
||||
@@ -1429,7 +1440,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
|
||||
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
|
||||
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type?$obj->type:'string').'">';
|
||||
|
||||
print $langs->trans('Desc'.$const);
|
||||
print ($label ? $label : $langs->trans('Desc'.$const));
|
||||
|
||||
if ($const == 'ADHERENT_MAILMAN_URL')
|
||||
{
|
||||
|
||||
@@ -120,6 +120,7 @@ function societe_prepare_head(Societe $object)
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as n";
|
||||
$sql.= " WHERE fk_soc = ".$object->id;
|
||||
$sql.= " AND entity IN (".getEntity('project').")";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -739,11 +740,12 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
print '<div class="div-table-responsive">';
|
||||
print "\n".'<table class="noborder" width=100%>';
|
||||
|
||||
$sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
|
||||
$sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
|
||||
$sql .= ", cls.code as opp_status_code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid";
|
||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||
$sql .= " AND p.entity IN (".getEntity('project').")";
|
||||
$sql .= " ORDER BY p.dateo DESC";
|
||||
|
||||
$result=$db->query($sql);
|
||||
@@ -799,7 +801,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
||||
print '</td>';
|
||||
// Opp status
|
||||
print '<td align="center">';
|
||||
if ($obj->opp_status_code) print $langs->trans("OppStatusShort".$obj->opp_status_code);
|
||||
if ($obj->opp_status_code) print $langs->trans("OppStatus".$obj->opp_status_code);
|
||||
print '</td>';
|
||||
// Opp percent
|
||||
print '<td align="right">';
|
||||
@@ -908,7 +910,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
{
|
||||
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
|
||||
}
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||
$search_array_options=$extrafields->getOptionalsFromPost($contactstatic->table_element,'','search_');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
|
||||
@@ -668,7 +668,7 @@ function dol_include_once($relpath, $classname='')
|
||||
|
||||
|
||||
/**
|
||||
* Return path of url or filesystem. Return alternate root if exists.
|
||||
* Return path of url or filesystem. Can check into alternate dir or alternate dir + main dir depending on value of $returnemptyifnotfound.
|
||||
*
|
||||
* @param string $path Relative path to file (if mode=0) or relative url (if mode=1). Ie: mydir/myfile, ../myfile
|
||||
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path using same host that current url), 3=Used for an URL path (output full path using host defined into $dolibarr_main_url_root of conf file)
|
||||
@@ -688,7 +688,10 @@ function dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
|
||||
$res = DOL_DOCUMENT_ROOT.'/'.$path; // Standard default path
|
||||
foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
|
||||
{
|
||||
if ($key == 'main') continue;
|
||||
if ($key == 'main')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (file_exists($dirroot.'/'.$path))
|
||||
{
|
||||
$res=$dirroot.'/'.$path;
|
||||
@@ -1035,6 +1038,8 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
||||
}
|
||||
if ($level > $conf->global->SYSLOG_LEVEL) return;
|
||||
|
||||
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
||||
|
||||
// If adding log inside HTML page is required
|
||||
if (! empty($_REQUEST['logtohtml']) && (! empty($conf->global->MAIN_ENABLE_LOG_TO_HTML) || ! empty($conf->global->MAIN_LOGTOHTML))) // MAIN_LOGTOHTML kept for backward compatibility
|
||||
{
|
||||
@@ -1042,7 +1047,7 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename='
|
||||
}
|
||||
|
||||
//TODO: Remove this. MAIN_ENABLE_LOG_INLINE_HTML should be deprecated and use a log handler dedicated to HTML output
|
||||
// If enable html log tag enabled and url parameter log defined, we show output log on HTML comments
|
||||
// If html log tag enabled and url parameter log defined, we show output log on HTML comments
|
||||
if (! empty($conf->global->MAIN_ENABLE_LOG_INLINE_HTML) && ! empty($_GET["log"]))
|
||||
{
|
||||
print "\n\n<!-- Log start\n";
|
||||
@@ -6808,7 +6813,7 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id
|
||||
* Verify if condition in string is ok or not
|
||||
*
|
||||
* @param string $strRights String with condition to check
|
||||
* @return boolean True or False. Return true if strRights is ''
|
||||
* @return boolean True or False. Return True if strRights is ''
|
||||
*/
|
||||
function verifCond($strRights)
|
||||
{
|
||||
@@ -6820,13 +6825,8 @@ function verifCond($strRights)
|
||||
$rights = true;
|
||||
if ($strRights != '')
|
||||
{
|
||||
//$tab_rights = explode('&&', $strRights);
|
||||
//$i = 0;
|
||||
//while (($i < count($tab_rights)) && ($rights == true)) {
|
||||
$str = 'if(!(' . $strRights . ')) { $rights = false; }';
|
||||
dol_eval($str);
|
||||
// $i++;
|
||||
//}
|
||||
dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
|
||||
}
|
||||
return $rights;
|
||||
}
|
||||
@@ -6843,8 +6843,8 @@ function verifCond($strRights)
|
||||
function dol_eval($s, $returnvalue=0, $hideerrors=1)
|
||||
{
|
||||
// Only global variables can be changed by eval function and returned to caller
|
||||
global $db, $langs, $user, $conf;
|
||||
global $mainmenu, $leftmenu;
|
||||
global $db, $langs, $user, $conf, $website, $websitepage;
|
||||
global $action, $mainmenu, $leftmenu;
|
||||
global $rights;
|
||||
global $object;
|
||||
global $mysoc;
|
||||
@@ -7288,7 +7288,8 @@ function dol_getmypid()
|
||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
||||
* If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
|
||||
* If param $mode is 3, can contains a list of string separated by comma like "a,b,c"
|
||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of ID separated with comma (Example '1,3,4')
|
||||
* 3=value is list of string separated with comma (Example 'text 1,text 2'), 4=value is a list of ID separated with comma (Example '1,3,4') for search into a multiselect string ('1,2')
|
||||
* @param integer $nofirstand 1=Do not output the first 'AND'
|
||||
* @return string $res The statement to append to the SQL query
|
||||
*/
|
||||
@@ -7372,11 +7373,9 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||
else if ($mode == 4)
|
||||
{
|
||||
$tmparray=explode(',',trim($crit));
|
||||
|
||||
if (count($tmparray))
|
||||
{
|
||||
$listofcodes='';
|
||||
|
||||
foreach($tmparray as $val)
|
||||
{
|
||||
if ($val)
|
||||
@@ -7385,7 +7384,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||
$newres .= ' OR '. $field . ' = \'' . $db->escape(trim($val)) . '\'';
|
||||
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\'';
|
||||
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\'';
|
||||
$newres .= ')';
|
||||
$newres .= ')';
|
||||
$i2++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user