diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 9ba965e6bfc..fe6ad2cf8d3 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -160,253 +160,255 @@ if ($mode == 'setup' && $user->admin) { $oauthstateanticsrf = bin2hex(random_bytes(128 / 8)); // $list is defined into oauth.lib.php to the list of supporter OAuth providers. - foreach ($listinsetup as $key) { - $supported = 0; - $keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME - $keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array); - $keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array); - if (preg_match('/^.*-/', $keyforsupportedoauth2array)) { - $keybeforeprovider = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); - $keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array); - } else { - $keybeforeprovider = $keyforsupportedoauth2array; - $keyforprovider = ''; - } - $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); - $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; + if (!empty($listinsetup)) { + foreach ($listinsetup as $key) { + $supported = 0; + $keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME + $keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array); + $keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array); + if (preg_match('/^.*-/', $keyforsupportedoauth2array)) { + $keybeforeprovider = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); + $keyforprovider = preg_replace('/^.*-/', '', $keyforsupportedoauth2array); + } else { + $keybeforeprovider = $keyforsupportedoauth2array; + $keyforprovider = ''; + } + $keyforsupportedoauth2array = preg_replace('/-.*$/', '', $keyforsupportedoauth2array); + $keyforsupportedoauth2array = 'OAUTH_'.$keyforsupportedoauth2array.'_NAME'; - $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); + $OAUTH_SERVICENAME = (empty($supportedoauth2array[$keyforsupportedoauth2array]['name']) ? 'Unknown' : $supportedoauth2array[$keyforsupportedoauth2array]['name'].($keyforprovider ? '-'.$keyforprovider : '')); - $shortscope = ''; - if (getDolGlobalString($key[4])) { - $shortscope = getDolGlobalString($key[4]); - } - $state = $shortscope; // TODO USe a better state + $shortscope = ''; + if (getDolGlobalString($key[4])) { + $shortscope = getDolGlobalString($key[4]); + } + $state = $shortscope; // TODO USe a better state - // Define $urltorenew, $urltodelete, $urltocheckperms - if ($keyforsupportedoauth2array == 'OAUTH_GITHUB_NAME') { - // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). - // We pass this param list in to 'state' because we need it before and after the redirect. + // Define $urltorenew, $urltodelete, $urltocheckperms + if ($keyforsupportedoauth2array == 'OAUTH_GITHUB_NAME') { + // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). + // We pass this param list in to 'state' because we need it before and after the redirect. - // Note: github does not accept csrf key inside the state parameter (only known values) - $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($shortscope).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltocheckperms = 'https://github.com/settings/applications/'; - } elseif ($keyforsupportedoauth2array == 'OAUTH_GOOGLE_NAME') { - // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). - // List of scopes for Google are here: https://developers.google.com/identity/protocols/oauth2/scopes - // We pass this key list into the param 'state' because we need it before and after the redirect. - $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'-'.$oauthstateanticsrf.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltocheckperms = 'https://security.google.com/settings/security/permissions'; - } elseif (!empty($supportedoauth2array[$keyforsupportedoauth2array]['returnurl'])) { - $urltorenew = $urlwithroot.$supportedoauth2array[$keyforsupportedoauth2array]['returnurl'].'?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltodelete = $urlwithroot.$supportedoauth2array[$keyforsupportedoauth2array]['returnurl'].'?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltocheckperms = ''; - } else { - $urltorenew = ''; - $urltodelete = ''; - $urltocheckperms = ''; - } + // Note: github does not accept csrf key inside the state parameter (only known values) + $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($shortscope).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltocheckperms = 'https://github.com/settings/applications/'; + } elseif ($keyforsupportedoauth2array == 'OAUTH_GOOGLE_NAME') { + // List of keys that will be converted into scopes (from constants 'SCOPE_state_in_uppercase' in file of service). + // List of scopes for Google are here: https://developers.google.com/identity/protocols/oauth2/scopes + // We pass this key list into the param 'state' because we need it before and after the redirect. + $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'-'.$oauthstateanticsrf.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltocheckperms = 'https://security.google.com/settings/security/permissions'; + } elseif (!empty($supportedoauth2array[$keyforsupportedoauth2array]['returnurl'])) { + $urltorenew = $urlwithroot.$supportedoauth2array[$keyforsupportedoauth2array]['returnurl'].'?shortscope='.urlencode($shortscope).'&state='.urlencode($state).'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltodelete = $urlwithroot.$supportedoauth2array[$keyforsupportedoauth2array]['returnurl'].'?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltocheckperms = ''; + } else { + $urltorenew = ''; + $urltodelete = ''; + $urltocheckperms = ''; + } - if ($urltorenew) { - $urltorenew .= '&keyforprovider='.urlencode($keyforprovider); - } - if ($urltodelete) { - $urltodelete .= '&keyforprovider='.urlencode($keyforprovider); - } + if ($urltorenew) { + $urltorenew .= '&keyforprovider='.urlencode($keyforprovider); + } + if ($urltodelete) { + $urltodelete .= '&keyforprovider='.urlencode($keyforprovider); + } - // Show value of token - $tokenobj = null; - // Token - require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; - // Dolibarr storage - $storage = new DoliStorage($db, $conf, $keyforprovider); - try { - // $OAUTH_SERVICENAME is for example 'Google-keyforprovider' - print ''."\n"; - $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); - //print $storage->token.'
'; - //print $tokenobj->getExtraParams()['id_token'].'
'; - //print $tokenobj->getAccessToken().'
'; - } catch (Exception $e) { - // Return an error if token not found - //print $e->getMessage(); - } + // Show value of token + $tokenobj = null; + // Token + require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php'; + // Dolibarr storage + $storage = new DoliStorage($db, $conf, $keyforprovider); + try { + // $OAUTH_SERVICENAME is for example 'Google-keyforprovider' + print ''."\n"; + $tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME); + //print $storage->token.'
'; + //print $tokenobj->getExtraParams()['id_token'].'
'; + //print $tokenobj->getAccessToken().'
'; + } catch (Exception $e) { + // Return an error if token not found + //print $e->getMessage(); + } - // Set other properties - $refreshtoken = false; - $expiredat = ''; + // Set other properties + $refreshtoken = false; + $expiredat = ''; - $expire = false; - // Is token expired or will token expire in the next 30 seconds - if (is_object($tokenobj)) { - $expire = ($tokenobj->getEndOfLife() !== $tokenobj::EOL_NEVER_EXPIRES && $tokenobj->getEndOfLife() !== $tokenobj::EOL_UNKNOWN && time() > ($tokenobj->getEndOfLife() - 30)); - } - if ($key[1] != '' && $key[2] != '') { + $expire = false; + // Is token expired or will token expire in the next 30 seconds if (is_object($tokenobj)) { - $refreshtoken = $tokenobj->getRefreshToken(); + $expire = ($tokenobj->getEndOfLife() !== $tokenobj::EOL_NEVER_EXPIRES && $tokenobj->getEndOfLife() !== $tokenobj::EOL_UNKNOWN && time() > ($tokenobj->getEndOfLife() - 30)); + } + if ($key[1] != '' && $key[2] != '') { + if (is_object($tokenobj)) { + $refreshtoken = $tokenobj->getRefreshToken(); - $endoflife = $tokenobj->getEndOfLife(); - if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES) { - $expiredat = $langs->trans("Never"); - } elseif ($endoflife == $tokenobj::EOL_UNKNOWN) { - $expiredat = $langs->trans("Unknown"); - } else { - $expiredat = dol_print_date($endoflife, "dayhour", 'tzuserrel'); + $endoflife = $tokenobj->getEndOfLife(); + if ($endoflife == $tokenobj::EOL_NEVER_EXPIRES) { + $expiredat = $langs->trans("Never"); + } elseif ($endoflife == $tokenobj::EOL_UNKNOWN) { + $expiredat = $langs->trans("Unknown"); + } else { + $expiredat = dol_print_date($endoflife, "dayhour", 'tzuserrel'); + } } } - } - $submit_enabled = 0; + $submit_enabled = 0; - print '
'; - print ''; - print ''; + print ''; + print ''; + print ''; - print '
'; - print ''."\n"; + print '
'; + print '
'."\n"; - // Api Name - $label = $langs->trans($keyforsupportedoauth2array); - print ''; - print ''; - print ''; - print ''; - print "\n"; - - print ''; - print ''; - //var_dump($key); - print $langs->trans("OAuthIDSecret").''; - print ''; - print ''; - print ''."\n"; - - // Scopes - print ''; - print ''; - print ''; - - print ''; - print ''; - //var_dump($key); - print $langs->trans("IsTokenGenerated"); - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print "\n"; + + print ''; + print ''; + //var_dump($key); + print $langs->trans("OAuthIDSecret").''; + print ''; + print ''; + print ''."\n"; + + // Scopes + print ''; + print ''; + print ''; + + print ''; + print ''; + //var_dump($key); + print $langs->trans("IsTokenGenerated"); + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + //var_dump($key); + print $langs->trans("Token").''; + print ''; + print ''."\n"; + + if (is_object($tokenobj)) { + // Token refresh + print ''; + print ''; + //var_dump($key); + print $langs->trans("TOKEN_REFRESH"); + print ''; + print ''; + print ''; + + // Token expired + print ''; + print ''; + //var_dump($key); + print $langs->trans("TOKEN_EXPIRED"); + print ''; + print ''; + print ''; + + // Token expired at + print ''; + print ''; + //var_dump($key); + print $langs->trans("TOKEN_EXPIRE_AT"); + print ''; + print ''; + print ''; + } + + print '
'; - print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"'); - if ($label == $keyforsupportedoauth2array) { - print $supportedoauth2array[$keyforsupportedoauth2array]['name']; - } else { - print $label; - } - if ($keyforprovider) { - print ' ('.$keyforprovider.')'; - } else { - print ' ('.$langs->trans("NoName").')'; - } - print '
'; - print ''.$langs->trans("SeePreviousTab").''; - print ''; - print '
'.$langs->trans("Scopes").''; - $currentscopes = getDolGlobalString($key[4]); - print $currentscopes; - print '
'; - if (is_object($tokenobj)) { - print $form->textwithpicto(yn(1), $langs->trans("HasAccessToken").' : '.dol_print_date($storage->date_modification, 'dayhour').' state='.dol_escape_htmltag($storage->state)); - } else { - print ''.$langs->trans("NoAccessToken").''; - } - print ''; - // Links to delete/checks token - if (is_object($tokenobj)) { - //test on $storage->hasAccessToken($OAUTH_SERVICENAME) ? - if ($urltodelete) { - print ''.$langs->trans('DeleteAccess').'
'; + // Api Name + $label = $langs->trans($keyforsupportedoauth2array); + print '
'; + print img_picto('', $supportedoauth2array[$keyforsupportedoauth2array]['picto'], 'class="pictofixedwidth"'); + if ($label == $keyforsupportedoauth2array) { + print $supportedoauth2array[$keyforsupportedoauth2array]['name']; } else { - print ''.$langs->trans('GoOnTokenProviderToDeleteToken').'
'; + print $label; } - } - // Request remote token - if ($urltorenew) { - print ''.$langs->trans('GetAccess').''; - print $form->textwithpicto('', $langs->trans('RequestAccess')); + if ($keyforprovider) { + print ' ('.$keyforprovider.')'; + } else { + print ' ('.$langs->trans("NoName").')'; + } + print '
'; + print ''.$langs->trans("SeePreviousTab").''; + print ''; + print '
'.$langs->trans("Scopes").''; + $currentscopes = getDolGlobalString($key[4]); + print $currentscopes; + print '
'; + if (is_object($tokenobj)) { + print $form->textwithpicto(yn(1), $langs->trans("HasAccessToken").' : '.dol_print_date($storage->date_modification, 'dayhour').' state='.dol_escape_htmltag($storage->state)); + } else { + print ''.$langs->trans("NoAccessToken").''; + } + print ''; + // Links to delete/checks token + if (is_object($tokenobj)) { + //test on $storage->hasAccessToken($OAUTH_SERVICENAME) ? + if ($urltodelete) { + print ''.$langs->trans('DeleteAccess').'
'; + } else { + print ''.$langs->trans('GoOnTokenProviderToDeleteToken').'
'; + } + } + // Request remote token + if ($urltorenew) { + print ''.$langs->trans('GetAccess').''; + print $form->textwithpicto('', $langs->trans('RequestAccess')); + print '
'; + } + // Check remote access + if ($urltocheckperms) { + print '
'.$langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME).': '.$urltocheckperms.''; + } + print '
'; + + if (is_object($tokenobj)) { + $tokentoshow = $tokenobj->getAccessToken(); + print ''.showValueWithClipboardCPButton($tokentoshow, 1, dol_trunc($tokentoshow, 32)).'
'; + //print 'Refresh: '.$tokenobj->getRefreshToken().'
'; + //print 'EndOfLife: '.$tokenobj->getEndOfLife().'
'; + //var_dump($tokenobj->getExtraParams()); + /*print '
Extra:
';*/ + } + print '
'; + print ''.showValueWithClipboardCPButton($refreshtoken, 1, dol_trunc($refreshtoken, 32)).''; + print '
'; + print yn($expire); + print '
'; + print $expiredat; + print '
'; + print '
'; + + if (!empty($driver)) { + if ($submit_enabled) { + print $form->buttonsSaveCancel("Modify", ''); + } + } + + print '
'; print '
'; } - // Check remote access - if ($urltocheckperms) { - print '
'.$langs->trans("ToCheckDeleteTokenOnProvider", $OAUTH_SERVICENAME).': '.$urltocheckperms.''; - } - print ''; - print ''; - - print ''; - print ''; - //var_dump($key); - print $langs->trans("Token").''; - print ''; - - if (is_object($tokenobj)) { - $tokentoshow = $tokenobj->getAccessToken(); - print ''.showValueWithClipboardCPButton($tokentoshow, 1, dol_trunc($tokentoshow, 32)).'
'; - //print 'Refresh: '.$tokenobj->getRefreshToken().'
'; - //print 'EndOfLife: '.$tokenobj->getEndOfLife().'
'; - //var_dump($tokenobj->getExtraParams()); - /*print '
Extra:
';*/ - } - print ''; - print ''."\n"; - - if (is_object($tokenobj)) { - // Token refresh - print ''; - print ''; - //var_dump($key); - print $langs->trans("TOKEN_REFRESH"); - print ''; - print ''; - print ''.showValueWithClipboardCPButton($refreshtoken, 1, dol_trunc($refreshtoken, 32)).''; - print ''; - print ''; - - // Token expired - print ''; - print ''; - //var_dump($key); - print $langs->trans("TOKEN_EXPIRED"); - print ''; - print ''; - print yn($expire); - print ''; - print ''; - - // Token expired at - print ''; - print ''; - //var_dump($key); - print $langs->trans("TOKEN_EXPIRE_AT"); - print ''; - print ''; - print $expiredat; - print ''; - print ''; - } - - print ''; - print ''; - - if (!empty($driver)) { - if ($submit_enabled) { - print $form->buttonsSaveCancel("Modify", ''); - } - } - - print ''; - print '
'; } } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 10b86bc497c..18e4f4cc3be 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -269,9 +269,7 @@ function project_prepare_head(Project $project, $moreparam = '') if ($nbConfOrBooth > 0 || $nbAttendees > 0) { $head[$h][1] .= ''; $head[$h][1] .= ''.$nbConfOrBooth.''; - if ($nbConfOrBooth > 0 && $nbAttendees > 0) { - $head[$h][1] .= ' + '; - } + $head[$h][1] .= ' + '; $head[$h][1] .= ''.$nbAttendees.''; $head[$h][1] .= ''; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 7850fb93fb9..952b599dcf3 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -163,7 +163,7 @@ function showDirectPublicLink($object) $email = CMailFile::getValidAddress($object->origin_email, 2); $url = ''; if ($email) { - $url = dol_buildpath('/public/ticket/view.php', 3).'?track_id='.$object->track_id.'&email='.$email; + $url = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 3)).'view.php?track_id='.$object->track_id.'&email='.$email; } $out = ''; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 165e09c12b5..0349eef17ad 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2500,7 +2500,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->hasRight('adherent', 'cotisation', 'read'), '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->hasRight('adherent', 'cotisation', 'write')); + $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewMembership"), 1, $user->hasRight('adherent', 'cotisation', 'write')); $newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->hasRight('adherent', 'cotisation', 'read')); $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read')); diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 08a24e1fc63..904f2212369 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -428,7 +428,9 @@ class InterfaceTicketEmail extends DolibarrTriggers $message = dol_nl2br($message); } $message_customer .= '

'.$langs->trans('Message').' :

'.$message.'


'; - $url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + + $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)).'view.php?track_id='.$object->track_id; + $message_customer .= '

'.$langs->trans($see_ticket).' : '.$url_public_ticket.'

'; $message_customer .= '

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index b1250d4e334..7d9fed91fe0 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1290,6 +1290,8 @@ class EmailCollector extends CommonObject if (strpos($rule['rulevalue'], '!') === 0) { // The value start with !, so we exclude the criteria $not = 'NOT '; + // Then remove the ! from the string for next filters + $rule['rulevalue'] = substr($rule['rulevalue'], 1); } if ($rule['type'] == 'from') { @@ -1428,6 +1430,8 @@ class EmailCollector extends CommonObject if (strpos($rule['rulevalue'], '!') === 0) { // The value start with !, so we exclude the criteria $not = 'NOT '; + // Then remove the ! from the string for next filters + $rule['rulevalue'] = substr($rule['rulevalue'], 1); } if ($rule['type'] == 'from') { @@ -2410,10 +2414,25 @@ class EmailCollector extends CommonObject if ($operation['type'] == 'loadthirdparty') { dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was not found"); - $errorforactions++; - $langs->load("errors"); - $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty); - $this->errors[] = $this->error; + //search into contacts of thirdparty + $resultContact = $contactstatic->fetch('', '', '', $emailtouseforthirdparty); + if ($resultContact > 0) { + $idtouseforthirdparty = $contactstatic->socid; + $result = $thirdpartystatic->fetch($idtouseforthirdparty); + if ($result > 0) { + dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was found thanks to linked contact search"); + } else { + $errorforactions++; + $langs->load("errors"); + $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty); + $this->errors[] = $this->error; + } + } else { + $errorforactions++; + $langs->load("errors"); + $this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty); + $this->errors[] = $this->error; + } } elseif ($operation['type'] == 'loadandcreatethirdparty') { dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was not found. We try to create it."); diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 718041fdd7b..786453d972d 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -246,3 +246,4 @@ XSubsriptionCreated=%s subscription(s) created XSubsriptionErrors=%s subscription(s) where in error CreateSubscription=Create subscription WarningNoComplementaryActionDone=No Complementary action on recording will be executed with this massaction +NewMembership=New membership \ No newline at end of file diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 53c7957cf78..eb3c4d656a0 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -326,7 +326,8 @@ class modMyModule extends DolibarrModules /* END MODULEBUILDER TOPMENU MYOBJECT */ /* BEGIN MODULEBUILDER LEFTMENU MYOBJECT */ - /*$this->menu[$r++]=array( + /* + $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry 'titre'=>'MyObject', @@ -341,6 +342,20 @@ class modMyModule extends DolibarrModules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'New_MyObject', + 'mainmenu'=>'mymodule', + 'leftmenu'=>'mymodule_myobject_new', + 'url'=>'/mymodule/myobject_card.php?action=create', + 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->hasRight("mymodule", "myobject", "write")' + 'target'=>'', + 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + ); $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry @@ -355,20 +370,7 @@ class modMyModule extends DolibarrModules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'New_MyObject', - 'mainmenu'=>'mymodule', - 'leftmenu'=>'mymodule_myobject_new', - 'url'=>'/mymodule/myobject_card.php?action=create', - 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->hasRight("mymodule", "myobject", "write")' - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - );*/ + */ /* END MODULEBUILDER LEFTMENU MYOBJECT */ diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 6e13ce4117b..1a482944772 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -111,7 +111,7 @@ if ($reshook < 0) { // Add file in email form if (empty($reshook)) { if ($cancel) { - $backtopage = DOL_URL_ROOT.'/public/ticket/index.php'; + $backtopage = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/'); header("Location: ".$backtopage); exit; @@ -395,7 +395,7 @@ if (empty($reshook)) { $message = (getDolGlobalString('TICKET_MESSAGE_MAIL_NEW') !== '' ? getDolGlobalString('TICKET_MESSAGE_MAIL_NEW') : $langs->transnoentities('TicketNewEmailBody')).'

'; $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'
'; - $url_public_ticket = (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id; + $url_public_ticket = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', dol_buildpath('/public/ticket/', 2)).'view.php?track_id='.$object->track_id; $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', ''.$object->track_id.'').'
'; $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl').'

'; @@ -508,7 +508,8 @@ if (!getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE')) { } $arrayofjs = array(); -$arrayofcss = array('/opensurvey/css/style.css', '/ticket/css/styles.css.php'); + +$arrayofcss = array('/opensurvey/css/style.css', getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', '/ticket/').'css/styles.css.php'); llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss); diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index 486200ee5ca..64a70c95c0d 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -80,8 +80,8 @@ if (!getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE')) { exit; } -$arrayofjs = array(); -$arrayofcss = array('/ticket/css/styles.css.php'); +$arrayofjs = array(); +$arrayofcss = array(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', '/ticket/').'css/styles.css.php'); llxHeaderTicket($langs->trans('Tickets'), "", 0, 0, $arrayofjs, $arrayofcss); @@ -90,8 +90,10 @@ print '
'; print '

'.(getDolGlobalString("TICKET_PUBLIC_TEXT_HOME", ''.$langs->trans("TicketPublicDesc")).'

').'

'; print '
'; +$baseurl = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/'); + print '
'; -print '

'.dol_escape_htmltag($langs->trans("CreateTicket")).'
'; +print '

'.dol_escape_htmltag($langs->trans("CreateTicket")).'
'; print '

'.dol_escape_htmltag($langs->trans("ViewMyTicketList")).'
'; print '
'.img_picto('', 'ticket', 'class="fa-15"').'
'.dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")).'
'; print '
'; diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 3267d9aef67..1842af349b4 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -92,7 +92,7 @@ if (!isModEnabled('ticket')) { */ if ($cancel) { - $backtopage = DOL_URL_ROOT.'/public/ticket/index.php'; + $backtopage = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/'); header("Location: ".$backtopage); exit; @@ -181,14 +181,14 @@ $user_assign = new User($db); $user_create = new User($db); $formTicket = new FormTicket($db); -if (!$conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) { +if (!getDolGlobalString('TICKET_ENABLE_PUBLIC_INTERFACE')) { print '
'.$langs->trans('TicketPublicInterfaceForbidden').'
'; $db->close(); exit(); } $arrayofjs = array(); -$arrayofcss = array('/ticket/css/styles.css.php'); +$arrayofcss = array(getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', '/ticket/').'css/styles.css.php'); llxHeaderTicket($langs->trans("Tickets"), "", 0, 0, $arrayofjs, $arrayofcss); @@ -481,7 +481,7 @@ if ($action == "view_ticketlist") { print ''; } - if ((getDolGlobalString('TICKET_SHOW_PROGRESSION')) && !empty($arrayfields['t.progress']['checked'])) { + if (getDolGlobalString('TICKET_SHOW_PROGRESSION') && !empty($arrayfields['t.progress']['checked'])) { print ''; } @@ -546,7 +546,7 @@ if ($action == "view_ticketlist") { if (!empty($arrayfields['severity.code']['checked'])) { print_liste_field_titre($arrayfields['severity.code']['label'], $url_page_current, 'severity.code', '', $param, '', $sortfield, $sortorder); } - if ((getDolGlobalString('TICKET_SHOW_PROGRESSION')) && !empty($arrayfields['t.progress']['checked'])) { + if (getDolGlobalString('TICKET_SHOW_PROGRESSION') && !empty($arrayfields['t.progress']['checked'])) { print_liste_field_titre($arrayfields['t.progress']['label'], $url_page_current, 't.progress', '', $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['t.fk_user_create']['checked'])) { @@ -638,7 +638,7 @@ if ($action == "view_ticketlist") { } // Progression - if ((getDolGlobalString('TICKET_SHOW_PROGRESSION')) && !empty($arrayfields['t.progress']['checked'])) { + if (getDolGlobalString('TICKET_SHOW_PROGRESSION') && !empty($arrayfields['t.progress']['checked'])) { print ''; print $obj->progress; print ''; @@ -712,7 +712,9 @@ if ($action == "view_ticketlist") { print ''; - print '
'; - if (!getDolGlobalString('TICKET_SHOW_MESSAGES_ON_CARD')) { + if (getDolGlobalString('TICKET_SHOW_MESSAGES_ON_CARD')) { print '
'; $MAXEVENT = 10; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index c96779054ce..4e3497882e6 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -75,7 +75,7 @@ class CTicketCategory 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) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5d33ede5ea7..8f40a7c02ac 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -302,7 +302,7 @@ class Ticket 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) @@ -2414,7 +2414,7 @@ class Ticket extends CommonObject global $conf; $defaultref = ''; - $modele = !getDolGlobalString('TICKET_ADDON') ? 'mod_ticket_simple' : $conf->global->TICKET_ADDON; + $modele = getDolGlobalString('TICKET_ADDON', 'mod_ticket_simple'); // Search template files $file = ''; @@ -2718,7 +2718,7 @@ class Ticket extends CommonObject // Add global email address recipient if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && - getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && !array_key_exists($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto) + getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto) ) { $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); } @@ -2821,8 +2821,8 @@ class Ticket extends CommonObject $message .= '
'.$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : '.$object->track_id.'
'; // Add global email address recipient - if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') !== '' && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) { - if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') !== '') { + if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) { + if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) { $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); } } @@ -2898,6 +2898,7 @@ class Ticket extends CommonObject // If public interface is not enable, use link to internal page into mail $url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ? (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id; + $message .= '
'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : '.$object->track_id.'
'; // Build final message @@ -2919,8 +2920,8 @@ class Ticket extends CommonObject } // Add global email address recipient - if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') !== '' && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) { - if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO') !== '') { + if (getDolGlobalString('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS') && !array_key_exists(getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'), $sendto)) { + if (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')) { $sendto[getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO')] = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_TO'); } } @@ -2964,8 +2965,8 @@ class Ticket extends CommonObject * * @param string $subject Email subject * @param string $message Email message - * @param int $send_internal_cc Receive a copy on internal email ($conf->global->TICKET_NOTIFICATION_EMAIL_FROM) - * @param array $array_receiver Array of receiver. example array('name' => 'John Doe', 'email' => 'john@doe.com', etc...) + * @param int $send_internal_cc Receive a copy on internal email (getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM') + * @param array $array_receiver Array of receiver. Example array('name' => 'John Doe', 'email' => 'john@doe.com', etc...) * @param array $filename_list List of files to attach (full path of filename on file system) * @param array $mimetype_list List of MIME type of attached files * @param array $mimefilename_list List of attached file name in message @@ -2975,7 +2976,7 @@ class Ticket extends CommonObject { global $conf, $langs, $user; - if (getDolGlobalInt('TICKET_DISABLE_ALL_MAILS')) { + if (getDolGlobalString('TICKET_DISABLE_ALL_MAILS')) { dol_syslog(get_class($this).'::sendTicketMessageByEmail: Emails are disable into ticket setup by option TICKET_DISABLE_ALL_MAILS', LOG_WARNING); return false; } @@ -2991,6 +2992,7 @@ class Ticket extends CommonObject $array_receiver = array_merge($array_receiver, $this->getInfosTicketExternalContact(1)); } + $sendtocc = ""; if ($send_internal_cc) { $sendtocc = getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM'); } else { @@ -3009,8 +3011,7 @@ class Ticket extends CommonObject // Send email $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO'); - - if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') { + if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) { $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } @@ -3059,7 +3060,7 @@ class Ticket extends CommonObject } } - if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') { + if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 4ccef134ea0..2b1a28cbdb0 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -447,9 +447,9 @@ if ($search_dateclose_end) { $sql .= " AND t.date_close <= '".$db->idate($search_dateclose_end)."'"; } -if (!$user->socid && ($mode == "mine" || (!$user->admin && getDolGlobalInt('TICKET_LIMIT_VIEW_ASSIGNED_ONLY')))) { +if (!$user->socid && ($mode == "mine" || (!$user->admin && getDolGlobalString('TICKET_LIMIT_VIEW_ASSIGNED_ONLY')))) { $sql .= " AND (t.fk_user_assign = ".((int) $user->id); - if (!getDolGlobalInt('TICKET_LIMIT_VIEW_ASSIGNED_ONLY')) { + if (!getDolGlobalString('TICKET_LIMIT_VIEW_ASSIGNED_ONLY')) { $sql .= " OR t.fk_user_create = ".((int) $user->id); } $sql .= ")"; @@ -498,7 +498,7 @@ if (!$resql) { $num = $db->num_rows($resql); // Direct jump if only one record found -if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { +if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".DOL_URL_ROOT.'/ticket/card.php?id='.$id); @@ -785,7 +785,7 @@ if ($massaction == 'presendonclose') { "name" => "massaction", "value" => "close" ]); - $selectedchoice = getDolGlobalInt('TICKET_NOTIFY_AT_CLOSING') ? "yes" : "no"; + $selectedchoice = getDolGlobalString('TICKET_NOTIFY_AT_CLOSING') ? "yes" : "no"; print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassTicketClosingSendEmail"), $langs->trans("ConfirmMassTicketClosingSendEmailQuestion"), 'confirm_send_close', $hidden_form, $selectedchoice, 0, 200, 500, 1); } @@ -1145,13 +1145,13 @@ while ($i < $imaxinloop) { $date_last_msg_sent = (int) $object->date_last_msg_sent; $hour_diff = ($now - $date_last_msg_sent) / 3600 ; - if (!empty($conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE && $date_last_msg_sent == 0)) { + if (getDolGlobalString('TICKET_DELAY_BEFORE_FIRST_RESPONSE') && $date_last_msg_sent == 0) { $creation_date = $object->datec; $hour_diff_creation = ($now - $creation_date) / 3600 ; - if ($hour_diff_creation > $conf->global->TICKET_DELAY_BEFORE_FIRST_RESPONSE) { + if ($hour_diff_creation > getDolGlobalInt('TICKET_DELAY_BEFORE_FIRST_RESPONSE')) { print " " . img_picto($langs->trans('Late') . ' : ' . $langs->trans('TicketsDelayForFirstResponseTooLong', getDolGlobalString('TICKET_DELAY_BEFORE_FIRST_RESPONSE')), 'warning', 'style="color: red;"', false, 0, 0, '', ''); } - } elseif (getDolGlobalString('TICKET_DELAY_SINCE_LAST_RESPONSE') && $hour_diff > $conf->global->TICKET_DELAY_SINCE_LAST_RESPONSE) { + } elseif (getDolGlobalString('TICKET_DELAY_SINCE_LAST_RESPONSE') && $hour_diff > getDolGlobalInt('TICKET_DELAY_SINCE_LAST_RESPONSE')) { print " " . img_picto($langs->trans('Late') . ' : ' . $langs->trans('TicketsDelayFromLastResponseTooLong', getDolGlobalString('TICKET_DELAY_SINCE_LAST_RESPONSE')), 'warning'); } } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 98fb7551fe1..51c65f71f45 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -146,7 +146,7 @@ $userstat = new User($db); $formticket = new FormTicket($db); $title = $langs->trans("Ticket").' - '.$object->ref.' '.$object->name; -if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ticketnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { +if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ticketnameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) { $title = $object->ref.' '.$object->name.' - '.$langs->trans("Info"); } $help_url = 'FR:DocumentationModuleTicket'; diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index f8e0c80c612..fe4d8b42f97 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -47,7 +47,7 @@ if ($user->socid > 0) { $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear; -$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); +$startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); $endyear = $year; // Load translation files required by the page diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php index cebcaf46494..e70395eb79b 100644 --- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php @@ -46,7 +46,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } ?> trans("Ticket"); ?> - global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { + getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" >