forked from Wavyzz/dolibarr
Clean code
This commit is contained in:
@@ -123,7 +123,7 @@ class GlobalToFunction extends AbstractRector
|
||||
if ($node instanceof FuncCall) {
|
||||
$tmpfunctionname = $this->getName($node);
|
||||
// If function is ok. We must avoid a lot of cases like isset(), empty()
|
||||
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'dol_hash', 'make_substitutions', 'min', 'max', 'explode'))) {
|
||||
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'dol_hash', 'explode', 'length_accountg', 'length_accounta', 'make_substitutions', 'min', 'max', 'trunc', 'urlencode', 'yn'))) {
|
||||
//print "tmpfunctionname=".$tmpfunctionname."\n";
|
||||
$args = $node->getArgs();
|
||||
$nbofparam = count($args);
|
||||
@@ -153,7 +153,7 @@ class GlobalToFunction extends AbstractRector
|
||||
if ($node instanceof MethodCall) {
|
||||
$tmpmethodname = $this->getName($node->name);
|
||||
// If function is ok. We must avoid a lot of cases
|
||||
if (in_array($tmpmethodname, array('idate'))) {
|
||||
if (in_array($tmpmethodname, array('idate', 'sanitize', 'select_language'))) {
|
||||
//print "tmpmethodname=".$tmpmethodname."\n";
|
||||
$expr = $node->var;
|
||||
$args = $node->getArgs();
|
||||
|
||||
@@ -161,7 +161,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
if (!getDolGlobalString('AGENDA_EXT_NB')) {
|
||||
$conf->global->AGENDA_EXT_NB = 5;
|
||||
}
|
||||
$MAXAGENDA = !getDolGlobalString('AGENDA_EXT_NB') ? 5 : $conf->global->AGENDA_EXT_NB;
|
||||
$MAXAGENDA = getDolGlobalInt('AGENDA_EXT_NB', 5);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@@ -56,7 +56,7 @@ $list = array(
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$accounting_mode = !getDolGlobalString('ACCOUNTING_MODE') ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
|
||||
$accounting_mode = getDolGlobalString('ACCOUNTING_MODE', 'RECETTES-DEPENSES');
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
@@ -512,7 +512,7 @@ print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("HideClosedServiceByDefault").'</td>';
|
||||
print '<td class="right">';
|
||||
print $form->selectyesno("activate_hideClosedServiceByDefault", (getDolGlobalString('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT') ? $conf->global->CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT : 0), 1);
|
||||
print $form->selectyesno("activate_hideClosedServiceByDefault", getDolGlobalInt('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT', 0), 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ print '<br>';
|
||||
|
||||
|
||||
// Shmop
|
||||
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
|
||||
if (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
|
||||
$shmoparray = dol_listshmop();
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
||||
@@ -281,7 +281,7 @@ class Translate
|
||||
// Using a memcached server
|
||||
if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) {
|
||||
$usecachekey = $newdomain . '_' . $langofdir . '_' . md5($file_lang); // Should not contains special chars
|
||||
} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
|
||||
} elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
|
||||
// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
|
||||
$usecachekey = $newdomain;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ class Translate
|
||||
// Using a memcached server
|
||||
if (isModEnabled('memcached') && getDolGlobalString('MEMCACHED_SERVER')) {
|
||||
$usecachekey = $newdomain . '_' . $langofdir; // Should not contains special chars
|
||||
} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
|
||||
} elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
|
||||
// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
|
||||
$usecachekey = $newdomain;
|
||||
}
|
||||
|
||||
@@ -10349,7 +10349,7 @@ function printCommonFooter($zone = 'private')
|
||||
if (getDolGlobalString('MEMCACHED_SERVER')) {
|
||||
print 'MEMCACHED_SERVER=' . getDolGlobalString('MEMCACHED_SERVER').' - ';
|
||||
}
|
||||
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED) ? $conf->global->MAIN_OPTIMIZE_SPEED : 'off');
|
||||
print 'MAIN_OPTIMIZE_SPEED=' . getDolGlobalString('MAIN_OPTIMIZE_SPEED', 'off');
|
||||
if (!empty($micro_start_time)) { // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in global variable.
|
||||
$micro_end_time = microtime(true);
|
||||
print ' - Build time: '.ceil(1000 * ($micro_end_time - $micro_start_time)).' ms';
|
||||
|
||||
@@ -118,7 +118,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead.
|
||||
} elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) { // This is a really not reliable cache ! Use Memcached instead.
|
||||
// Using shmop
|
||||
$result = dol_setshmop($memoryid, $data, $expire);
|
||||
} else {
|
||||
@@ -194,7 +194,7 @@ function dol_getcache($memoryid)
|
||||
} else {
|
||||
return null; // There is no way to make a difference between NOTFOUND and error when using Memcache. So do not use it, use Memcached instead.
|
||||
}
|
||||
} elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) { // This is a really not reliable cache ! Use Memcached instead.
|
||||
} elseif (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) { // This is a really not reliable cache ! Use Memcached instead.
|
||||
// Using shmop
|
||||
$data = dol_getshmop($memoryid);
|
||||
return $data;
|
||||
|
||||
@@ -145,7 +145,7 @@ if ($action == 'edit') {
|
||||
print '</td><td>';
|
||||
print '<select name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'">';
|
||||
foreach ($valTab as $key1 => $val1) {
|
||||
print '<option value="'.$key1.'" '.($conf->global->$key == $key1 ? 'selected="selected"' : '').'>';
|
||||
print '<option value="'.$key1.'" '.(getDolGlobalString($key) == $key1 ? 'selected="selected"' : '').'>';
|
||||
print $val1;
|
||||
print '</option>';
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ print '<span class="opacitymedium">';
|
||||
print $langs->trans('DATAPOLICYSUBSITUTION');
|
||||
print '__LINKACCEPT__,__LINKREFUSED__,__FIRSTNAME__,__NAME__,__CIVILITY__';
|
||||
print '</span>';
|
||||
$doleditor = new DolEditor($content, $conf->global->$content, '', 250, 'Full', '', false, true, 1, 200, 70);
|
||||
$doleditor = new DolEditor($content, getDolGlobalString($content), '', 250, 'Full', '', false, true, 1, 200, 70);
|
||||
$doleditor->Create();
|
||||
print '</td><tr>';
|
||||
print '<tr class"oddeven"><td class="fieldrequired">';
|
||||
|
||||
@@ -188,10 +188,10 @@ class DataPolicy
|
||||
$la = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||
$lr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||
|
||||
$subject = $conf->global->$s;
|
||||
$message = $conf->global->$ma;
|
||||
$linka = $conf->global->$la;
|
||||
$linkr = $conf->global->$lr;
|
||||
$subject = getDolGlobalString($s);
|
||||
$message = getDolGlobalString($ma);
|
||||
$linka = getDolGlobalString($la);
|
||||
$linkr = getDolGlobalString($lr);
|
||||
$sendtocc = $sendtobcc = '';
|
||||
$filepath = $mimetype = $filename = array();
|
||||
$deliveryreceipt = 0;
|
||||
@@ -267,10 +267,10 @@ class DataPolicy
|
||||
$la = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||
$lr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||
|
||||
$subject = $conf->global->$s;
|
||||
$message = $conf->global->$ma;
|
||||
$linka = $conf->global->$la;
|
||||
$linkr = $conf->global->$lr;
|
||||
$subject = getDolGlobalString($s);
|
||||
$message = getDolGlobalString($ma);
|
||||
$linka = getDolGlobalString($la);
|
||||
$linkr = getDolGlobalString($lr);
|
||||
$sendtocc = $sendtobcc = '';
|
||||
$filepath = $mimetype = $filename = array();
|
||||
$deliveryreceipt = 0;
|
||||
@@ -342,10 +342,10 @@ class DataPolicy
|
||||
$la = 'TXTLINKDATAPOLICYACCEPT_'.$l;
|
||||
$lr = 'TXTLINKDATAPOLICYREFUSE_'.$l;
|
||||
|
||||
$subject = $conf->global->$s;
|
||||
$message = $conf->global->$ma;
|
||||
$linka = $conf->global->$la;
|
||||
$linkr = $conf->global->$lr;
|
||||
$subject = getDolGlobalString($s);
|
||||
$message = getDolGlobalString($ma);
|
||||
$linka = getDolGlobalString($la);
|
||||
$linkr = getDolGlobalString($lr);
|
||||
$sendtocc = $sendtobcc = '';
|
||||
$filepath = $mimetype = $filename = array();
|
||||
$deliveryreceipt = 0;
|
||||
|
||||
@@ -32,8 +32,8 @@ if (!defined('CDAV_CONTACT_TAG')) {
|
||||
|
||||
// define CDAV_URI_KEY if not
|
||||
if (!defined('CDAV_URI_KEY')) {
|
||||
if (isset($conf->global->CDAV_URI_KEY)) {
|
||||
define('CDAV_URI_KEY', $conf->global->CDAV_URI_KEY);
|
||||
if (getDolGlobalString('CDAV_URI_KEY')) {
|
||||
define('CDAV_URI_KEY', getDolGlobalString('CDAV_URI_KEY'));
|
||||
} else {
|
||||
define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8));
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
||||
$info .= $langs->trans('Locale').': <strong>' . getDolGlobalString('MAIN_LANG_DEFAULT').'</strong><br>';
|
||||
$info .= $langs->trans('Currency').': <strong>'.$conf->currency.'</strong><br>';
|
||||
$info .= $langs->trans('Entity').': <strong>'.$conf->entity.'</strong><br>';
|
||||
$info .= $langs->trans('MaxSizeList').': <strong>'.($conf->liste_limit ?: $conf->global->MAIN_SIZE_LISTE_LIMIT).'</strong><br>';
|
||||
$info .= $langs->trans('MaxSizeList').': <strong>'.($conf->liste_limit ?: getDolGlobalString('MAIN_SIZE_LISTE_LIMIT')).'</strong><br>';
|
||||
$info .= $langs->trans('MaxSizeForUploadedFiles').': <strong>' . getDolGlobalString('MAIN_UPLOAD_DOC').'</strong><br>';
|
||||
$info .= '$dolibarr_main_prod = <strong>'.$dolibarr_main_prod.'</strong><br>';
|
||||
$info .= '$dolibarr_nocsrfcheck = <strong>'.$dolibarr_nocsrfcheck.'</strong><br>';
|
||||
|
||||
@@ -75,7 +75,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
@@ -210,7 +210,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE)
|
||||
&& getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== ''
|
||||
&& getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '-1') {
|
||||
$this->fields['fk_soc']['type'] .= ' AND client = '.(int) $conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE;
|
||||
$this->fields['fk_soc']['type'] .= ' AND client = '.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0));
|
||||
}
|
||||
|
||||
// Example to show how to set values of fields definition dynamically
|
||||
@@ -533,7 +533,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
*/
|
||||
public function validate($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@@ -545,14 +545,6 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->conferenceorboothattendee->write))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->conferenceorboothattendee->conferenceorboothattendee_advance->validate))))
|
||||
{
|
||||
$this->error='NotEnoughPermissions';
|
||||
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
@@ -696,13 +688,6 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate))))
|
||||
{
|
||||
$this->error='Permission denied';
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return $this->setStatusCommon($user, self::STATUS_DRAFT, $notrigger, 'CONFERENCEORBOOTHATTENDEE_UNVALIDATE');
|
||||
}
|
||||
|
||||
@@ -720,13 +705,6 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate))))
|
||||
{
|
||||
$this->error='Permission denied';
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return $this->setStatusCommon($user, self::STATUS_CANCELED, $notrigger, 'CONFERENCEORBOOTHATTENDEE_CANCEL');
|
||||
}
|
||||
|
||||
@@ -744,13 +722,6 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->write))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->eventorganization->eventorganization_advance->validate))))
|
||||
{
|
||||
$this->error='Permission denied';
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'CONFERENCEORBOOTHATTENDEE_REOPEN');
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* \brief Page that build two frames: One for menu, the other for the target page to show
|
||||
* Usage:
|
||||
* /externalsite/frames.php to show URL set into setup
|
||||
* /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_CONTENT_abc to show html text defined into $conf->global->EXTERNAL_SITE_CONTENT_abc
|
||||
* /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_URL_abc to show URL defined into $conf->global->EXTERNAL_SITE_URL_abc
|
||||
* /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_CONTENT_abc to show html text defined into conf 'EXTERNAL_SITE_CONTENT_abc'
|
||||
* /externalsite/frames.php?keyforcontent=EXTERNAL_SITE_URL_abc to show URL defined into conf 'EXTERNAL_SITE_URL_abc'
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
|
||||
@@ -124,7 +124,6 @@ $form = new Form($db);
|
||||
|
||||
if ($object->id > 0) {
|
||||
$title = $langs->trans("Agenda");
|
||||
//if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -2509,7 +2509,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
// Create event
|
||||
/*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if (isModEnabled('agenda') && getDolGlobalString('MAIN_ADD_EVENT_ON_ELEMENT_CARD')) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}*/
|
||||
|
||||
@@ -324,7 +324,7 @@ if (empty($reshook)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
if (!getDolGlobalStringempty('MAIN_DISABLE_PDF_AUTOUPDATE')) {
|
||||
$ret = $object->fetch($object->id); // Reload to get new records
|
||||
$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
}*/
|
||||
@@ -4113,7 +4113,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Create event
|
||||
/*if (isModEnabled('agenda') && !empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if (isModEnabled('agenda') && getDolGlobalString('MAIN_ADD_EVENT_ON_ELEMENT_CARD')) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}*/
|
||||
|
||||
@@ -41,9 +41,9 @@ if (isset($user->socid) && $user->socid > 0) {
|
||||
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
|
||||
|
||||
// Maximum elements of the tables
|
||||
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
|
||||
$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
|
||||
$maxLatestEditCount = 5;
|
||||
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
|
||||
$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
|
||||
|
||||
// Security check
|
||||
restrictedArea($user, 'fournisseur', 0, '', 'facture');
|
||||
|
||||
@@ -79,7 +79,7 @@ class Evaluation extends CommonObject
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -78,7 +78,7 @@ class EvaluationLine extends CommonObjectLine
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -77,7 +77,7 @@ class Job extends CommonObject
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -77,7 +77,7 @@ class Position extends CommonObject
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -83,7 +83,7 @@ class Skill extends CommonObject
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -77,7 +77,7 @@ class Skilldet extends CommonObjectLine
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -79,7 +79,7 @@ class SkillRank extends CommonObject
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalString("MY_SETUP_PARAM")')
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
||||
@@ -793,7 +793,7 @@ $db->close();
|
||||
|
||||
/**
|
||||
* Show weather logo. Logo to show depends on $totallate and values for
|
||||
* $conf->global->MAIN_METEO_LEVELx
|
||||
* conf 'MAIN_METEO_LEVELx'
|
||||
*
|
||||
* @param int $totallate Nb of element late
|
||||
* @param string $text Text to show on logo
|
||||
@@ -811,23 +811,20 @@ function showWeather($totallate, $text, $options, $morecss = '')
|
||||
|
||||
|
||||
/**
|
||||
* get weather level
|
||||
* $conf->global->MAIN_METEO_LEVELx
|
||||
* get weather status for conf 'MAIN_METEO_LEVELx'
|
||||
*
|
||||
* @param int $totallate Nb of element late
|
||||
* @return stdClass Return img tag of weather
|
||||
*/
|
||||
function getWeatherStatus($totallate)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$weather = new stdClass();
|
||||
$weather->picto = '';
|
||||
|
||||
$offset = 0;
|
||||
$factor = 10; // By default
|
||||
|
||||
$used_conf = !getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? 'MAIN_METEO_LEVEL' : 'MAIN_METEO_PERCENTAGE_LEVEL';
|
||||
$used_conf = (getDolGlobalString('MAIN_USE_METEO_WITH_PERCENTAGE') ? 'MAIN_METEO_PERCENTAGE_LEVEL' : 'MAIN_METEO_LEVEL');
|
||||
|
||||
$weather->level = 0;
|
||||
$level0 = $offset;
|
||||
|
||||
@@ -1716,10 +1716,6 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
|
||||
print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview
|
||||
}
|
||||
|
||||
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n";
|
||||
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="copyright" title="GNU General Public License" href="https://www.gnu.org/copyleft/gpl.html#SEC1">'."\n";
|
||||
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n";
|
||||
|
||||
// Mobile appli like icon
|
||||
$manifest = DOL_URL_ROOT.'/theme/'.$conf->theme.'/manifest.json.php';
|
||||
if (!empty($manifest)) {
|
||||
@@ -3363,7 +3359,7 @@ function main_area($title = '')
|
||||
print '<table class="centpercent div-table-responsive">'."\n";
|
||||
print '<tbody>';
|
||||
print '<tr><td rowspan="0" class="width20p">';
|
||||
if ($conf->global->MAIN_SHOW_LOGO && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && getDolGlobalString('MAIN_INFO_SOCIETE_LOGO')) {
|
||||
if (getDolGlobalString('MAIN_SHOW_LOGO') && !getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && getDolGlobalString('MAIN_INFO_SOCIETE_LOGO')) {
|
||||
print '<img id="mysoc-info-header-logo" style="max-width:100%" alt="" src="'.DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.dol_escape_htmltag(getDolGlobalString('MAIN_INFO_SOCIETE_LOGO'))).'">';
|
||||
}
|
||||
print '</td><td rowspan="0" class="width50p"></td></tr>'."\n";
|
||||
@@ -3674,7 +3670,7 @@ if (!function_exists("llxFooter")) {
|
||||
|
||||
print "\n".'<!-- Includes JS for Ping of Dolibarr forceping='.$forceping.' MAIN_FIRST_PING_OK_DATE='.getDolGlobalString("MAIN_FIRST_PING_OK_DATE").' MAIN_FIRST_PING_OK_ID='.getDolGlobalString("MAIN_FIRST_PING_OK_ID").' MAIN_LAST_PING_KO_DATE='.getDolGlobalString("MAIN_LAST_PING_KO_DATE").' -->'."\n";
|
||||
print "\n<!-- JS CODE TO ENABLE the anonymous Ping -->\n";
|
||||
$url_for_ping = (!getDolGlobalString('MAIN_URL_FOR_PING') ? "https://ping.dolibarr.org/" : $conf->global->MAIN_URL_FOR_PING);
|
||||
$url_for_ping = getDolGlobalString('MAIN_URL_FOR_PING', "https://ping.dolibarr.org/");
|
||||
// Try to guess the distrib used
|
||||
$distrib = 'standard';
|
||||
if ($_SERVER["SERVER_ADMIN"] == 'doliwamp@localhost') {
|
||||
|
||||
@@ -203,7 +203,7 @@ if (session_id() && !empty($_SESSION["dol_entity"])) {
|
||||
if (!is_numeric($conf->entity)) {
|
||||
$conf->entity = 1;
|
||||
}
|
||||
// Here we read database (llx_const table) and define $conf->global->XXX var.
|
||||
// Here we read database (llx_const table) and define conf var $conf->global->XXX.
|
||||
//print "We work with data into entity instance number '".$conf->entity."'";
|
||||
$conf->setValues($db);
|
||||
|
||||
@@ -255,7 +255,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
|
||||
}
|
||||
|
||||
|
||||
// Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later)
|
||||
// Set default language (must be after the setValues setting global conf 'MAIN_LANG_DEFAULT'. Page main.inc.php will overwrite langs->defaultlang with user value later)
|
||||
if (!defined('NOREQUIRETRAN')) {
|
||||
$langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : getDolGlobalString('MAIN_LANG_DEFAULT', 'auto'));
|
||||
if (defined('MAIN_LANG_DEFAULT')) { // So a page can force the language whatever is setup and parameters in URL
|
||||
|
||||
Reference in New Issue
Block a user