diff --git a/dev/initdemo/initdemopassword.sh b/dev/initdemo/initdemopassword.sh index d3527151c64..a42e5d23b56 100755 --- a/dev/initdemo/initdemopassword.sh +++ b/dev/initdemo/initdemopassword.sh @@ -39,7 +39,7 @@ if [ "x$confirm" != "xconfirm" ] then echo "----- $0 -----" echo "Usage: initdemopassword.sh confirm [base port login pass password_hash_algo]" - echo "password_hash_algo can be md5 of password_hash" + echo "password_hash_algo can be md5 or password_hash" exit fi @@ -149,15 +149,19 @@ then fi #echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" #mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile -echo "echo \"UPDATE llx_user SET pass_crypted = MD5('$demopass') WHERE login = '$demologin';\" | mysql -P$port $base" -if [ "x$demopasshash" != "xpassword_hash" ] +if [ "x${demopasshash}" != "xpassword_hash" ] then - newpass=`echo '' | php` + echo '' > /tmp/tmp.php + newpass=`php -f /tmp/tmp.php` + rm /tmp/tmp.php else - newpass=`echo '' | php` + echo '' > /tmp/tmp.php + newpass=`php -f /tmp/tmp.php` + rm /tmp/tmp.php fi +echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql -P$port $base" echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql -P$port $base export res=$? diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 94dc6aa05c9..d073139a533 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -35,16 +35,23 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy", "loans", "ban $hookmanager->initHooks(array('accountancyindex')); // Security check -if (empty($conf->accounting->enabled)) { +if ($user->socid > 0) { accessforbidden(); } -if ($user->socid > 0) { +/* +if (empty($conf->accounting->enabled)) { accessforbidden(); } if (empty($user->rights->accounting->mouvements->lire)) { accessforbidden(); } - +*/ +if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) { + accessforbidden(); +} +if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) { + accessforbidden(); +} /* diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 9829be288a5..a3d725bee93 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -112,8 +112,11 @@ if ($action == "save" && empty($cancel)) { * View */ -$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; -llxHeader('', $langs->trans("AgendaSetup"), $wikihelp); +// $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; + +$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; + +llxHeader('', $langs->trans("AgendaSetup"), $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 3869c37ce7d..0f77b9d9d41 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -110,7 +110,7 @@ print ''; print $langs->trans("MakeIntegrityAnalysisFrom").':
'; print ''."\n"; if (dol_is_file($xmlfile)) { - print ' '.$langs->trans("LocalSignature").' = '; + print ' = '; print ''; print '
'; } else { @@ -121,7 +121,7 @@ if (dol_is_file($xmlfile)) { } print ''."\n"; if ($enableremotecheck) { - print ' '.$langs->trans("RemoteSignature").' = '; + print ' = '; print '
'; } else { print ' '.$langs->trans("RemoteSignature").' = '.$xmlremote; @@ -156,7 +156,7 @@ if (GETPOST('target') == 'local') { } } if (GETPOST('target') == 'remote') { - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php. // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { @@ -164,7 +164,7 @@ if (GETPOST('target') == 'remote') { //print "xmlfilestart".$xmlfile."xmlfileend"; $xml = simplexml_load_string($xmlfile); } else { - $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; + $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; setEventMessages($errormsg, null, 'errors'); $error++; } diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index c9a652cd4e4..de59957f5c9 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -243,10 +243,13 @@ print '
'; print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder'); //print ''.$langs->trans("PasswordEncryption").': '; -print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')."   "; -print '     If unset: \'md5\'
'; +print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_HASH_ALGO)."   "; +if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) { + print '     If unset: \'md5\''; +} +print '
'; if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { - print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : $conf->global->MAIN_SECURITY_SALT).'
'; + print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
'; } if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { print '
The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
'; @@ -258,6 +261,11 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { } print '
'; + +print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
"; +print '
'; + + print ''.$langs->trans("AntivirusEnabledOnUpload").': '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0); @@ -292,9 +300,10 @@ if (!empty($eventstolog) && is_array($eventstolog)) { } } } else { - print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")); + print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'
'; } +print '

'; // End of page llxFooter(); diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 311b67c21f2..f55f432ed5a 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -490,6 +490,9 @@ if ($id) { } } } + if (!isset($obj->position)) { + $obj->position = 1; + } fieldListWebsites($fieldlist, $obj, $tabname[$id], 'add'); @@ -499,8 +502,6 @@ if ($id) { } print ''; print ""; - - $colspan = count($fieldlist) + 2; } print ''; diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php index 5209cc51157..df5b9945a76 100644 --- a/htdocs/api/class/api_login.class.php +++ b/htdocs/api/class/api_login.class.php @@ -52,6 +52,28 @@ class Login * @throws RestException 500 System error * * @url GET / + */ + public function loginUnsecured($login, $password, $entity = '', $reset = 0) + { + return $this->index($login, $password, $entity, $reset); + } + + /** + * Login + * + * Request the API token for a couple username / password. + * Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file). + * Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: The API token (DOLAPIKEY) can be found/set on the user page. + * + * @param string $login User login + * @param string $password User password + * @param string $entity Entity (when multicompany module is used). '' means 1=first company. + * @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access) + * @return array Response status and user token + * + * @throws RestException 403 Access denied + * @throws RestException 500 System error + * * @url POST / */ public function index($login, $password, $entity = '', $reset = 0) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 0029d0fd110..ca716712189 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1661,10 +1661,14 @@ class Setup extends DolibarrApi if (empty($xmlremote)) { $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml'; } - if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) { + if ($xmlremote && !preg_match('/^https?:\/\//i', $xmlremote)) { $langs->load("errors"); throw new RestException(500, $langs->trans("ErrorURLMustStartWithHttp", $xmlremote)); } + if ($xmlremote && !preg_match('/\.xml$/', $xmlremote)) { + $langs->load("errors"); + throw new RestException(500, $langs->trans("ErrorURLMustEndWith", $xmlremote, '.xml')); + } if ($target == 'local') { if (dol_is_file($xmlfile)) { @@ -1673,7 +1677,7 @@ class Setup extends DolibarrApi throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile); } } else { - $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only + $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php. // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { @@ -1681,7 +1685,7 @@ class Setup extends DolibarrApi //print "xmlfilestart".$xmlfile."endxmlfile"; $xml = simplexml_load_string($xmlfile); } else { - $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; + $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg']; throw new RestException(500, $errormsg); } } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index e105d011e96..f7ceea4743d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -28,7 +28,6 @@ */ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncommreminder.class.php'; @@ -2290,14 +2289,16 @@ class ActionComm extends CommonObject $this->db->begin(); - //Select all action comm reminder + //Select all action comm reminders $sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; $sql .= " WHERE typeremind = 'email' AND status = 0"; - $sql .= " AND dateremind <= '".$this->db->idate(dol_now())."'"; + $sql .= " AND dateremind <= '".$this->db->idate($now)."'"; + $sql .= " AND entity IN (".getEntity('actioncomm').")"; $sql .= $this->db->order("dateremind", "ASC"); $resql = $this->db->query($sql); if ($resql) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($this->db); while ($obj = $this->db->fetch_object($resql)) { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ac21db8cff8..d9557845492 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -678,8 +678,9 @@ if ($object->fetch($id) >= 0) { // Search Icon print ''; + print ''; if ($obj->statut == 0) { // Not sent yet - if ($user->rights->mailing->creer && $allowaddtarget) { + if (!empty($user->rights->mailing->creer) && $allowaddtarget) { print ''.img_delete($langs->trans("RemoveRecipient")).''; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 350b7a64779..b949877dc82 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -4891,6 +4891,164 @@ class Facture extends CommonInvoice return -2; } } + + + /** + * Send reminders by emails for ivoices that are due + * CAN BE A CRON TASK + * + * @param int $nbdays Delay after due date (or before if delay is negative) + * @param string $paymentmode '' or 'all' by default (no filter), or 'LIQ', 'CHQ', CB', ... + * @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send') + * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) + */ + public function sendEmailsReminderOnDueDate($nbdays = 0, $paymentmode = 'all', $template = '') + { + global $conf, $langs, $user; + + $error = 0; + $this->output = ''; + $this->error = ''; + $nbMailSend = 0; + $errorsMsg = array(); + + if (empty($conf->facture->enabled)) { // Should not happen. If module disabled, cron job should not be visible. + $langs->load("bills"); + $this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture")); + return 0; + } + /*if (empty($conf->global->FACTURE_REMINDER_EMAIL)) { + $langs->load("bills"); + $this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Facture")); + return 0; + } + */ + + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($this->db); + + $now = dol_now(); + $tmpinvoice = new Facture($this->db); + + dol_syslog(__METHOD__, LOG_DEBUG); + + $this->db->begin(); + + //Select all action comm reminder + $sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."facture as f"; + if (!empty($paymentmode) && $paymentmode != 'all') { + $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; + } + $sql .= " WHERE f.paye = 0"; + $sql .= " AND f.date_lim_reglement = '".$this->db->idate(dol_get_first_hour(dol_time_plus_duree(dol_now(), -1 * $nbdays, 'd'), 'gmt'), 'gmt')."'"; + $sql .= " AND f.entity IN (".getEntity('facture').")"; + if (!empty($paymentmode) && $paymentmode != 'all') { + $sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'"; + } + // TODO Add filter to check there is no payment started + $sql .= $this->db->order("date_lim_reglement", "ASC"); + $resql = $this->db->query($sql); + + if ($resql) { + while ($obj = $this->db->fetch_object($resql)) { + if (!$error) { + // Load event + $res = $tmpinvoice->fetch($obj->id); + if ($res > 0) { + $tmpinvoice->fetch_thirdparty(); + + $outputlangs = new Translate('', $conf); + if ($tmpinvoice->thirdparty->default_lang) { + $outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang); + } else { + $outputlangs = $langs; + } + + // Select email template + $arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template)); + if (is_numeric($arraymessage) && $arraymessage <= 0) { + $langs->load("bills"); + $this->output = $langs->trans('FailedToFindEmailTemplate', $template); + return 0; + } + + // PREPARE EMAIL + $errormesg = ''; + + // Make substitution in email content + $substitutionarray = getCommonSubstitutionArray($langs, 0, '', $this); + + complete_substitutions_array($substitutionarray, $langs, $this); + + // Content + $sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray); + + //Topic + $sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->trans('EventReminder')); + + // Recipient + $res = $tmpinvoice->fetch_thirdparty(); + $recipient = $tmpinvoice->thirdparty; + if ($res > 0) { + if (!empty($recipient->email)) { + $to = $recipient->email; + } else { + $errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->fk_soc.". No email defined for user."; + $error++; + } + } else { + $errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->fk_soc; + $error++; + } + + // Sender + $from = $conf->global->MAIN_MAIL_EMAIL_FROM; + if (empty($from)) { + $errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM"; + $error++; + } + + if (!$error) { + // Errors Recipient + $errors_to = $conf->global->MAIN_MAIL_ERRORS_TO; + + $trackid = 'inv'.$tmpinvoice->id; + // Mail Creation + $cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', $trackid, '', '', ''); + + // Sending Mail + if ($cMailFile->sendfile()) { + $nbMailSend++; + } else { + $errormesg = $cMailFile->error.' : '.$to; + $error++; + } + } + + if ($errormesg) { + $errorsMsg[] = $errormesg; + } + } else { + $errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id; + $error++; + } + } + } + } else { + $error++; + } + + if (!$error) { + $this->output = 'Nb of emails sent : '.$nbMailSend; + $this->db->commit(); + return 0; + } else { + $this->db->commit(); // We commit also on error, to have the error message recorded. + $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error; + return $error; + } + } } /** diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 92f9c320acd..087911ce140 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1597,7 +1597,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT soc.rowid as socid, soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,"; $sql .= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; - $sql .= " f.ref as fac, pf.fk_facture_fourn as idfac,"; + $sql .= " f.ref as fac, pf.fk_facture_fourn as idfac, f.ref_supplier as fac_ref_supplier,"; $sql .= " rib.rowid, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum, rib.date_rum"; $sql .= " FROM"; $sql .= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,"; @@ -1633,7 +1633,7 @@ class BonPrelevement extends CommonObject $cachearraytotestduplicate[$obj->idfac] = $obj->rowid; $daterum = (!empty($obj->date_rum)) ? $this->db->jdate($obj->date_rum) : $this->db->jdate($obj->datec); - $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); + $fileCrediteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac_ref_supplier, $obj->idfac, $obj->iban, $obj->bic, $daterum, $obj->drum, $obj->rum, $type); $this->total = $this->total + $obj->somme; $i++; } @@ -1897,7 +1897,7 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$CrLf; // Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum) - $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters + $XML_DEBITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.round($row_somme, 2).''.$CrLf; $XML_DEBITOR .= ' '.$CrLf; @@ -1943,7 +1943,7 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; // Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum) - $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters + $XML_CREDITOR .= ' '.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).''.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.round($row_somme, 2).''.$CrLf; diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 0d29c0d1323..a868c99a66f 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -1,5 +1,9 @@ transnoentities('Month'.$month); @@ -2336,7 +2336,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = if (preg_match('/__a__/i', $format)) { $timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. - $w = adodb_strftime('%w', $timetouse); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. + $w = adodb_strftime('%w', $timetouse, true); // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring. $dayweek = $outputlangs->transnoentitiesnoconv('Day'.$w); $ret = str_replace('__A__', $dayweek, $ret); $ret = str_replace('__a__', dol_substr($dayweek, 0, 3), $ret); @@ -2353,7 +2353,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs = * * @param int $timestamp Timestamp * @param boolean $fast Fast mode. deprecated. - * @param string $forcetimezone '' to use the PHP server timezone. Or use a form like 'Europe/Paris' or '+0200' to force timezone. + * @param string $forcetimezone '' to use the PHP server timezone. Or use a form like 'gmt', 'Europe/Paris' or '+0200' to force timezone. * @return array Array of informations * 'seconds' => $secs, * 'minutes' => $min, @@ -2375,7 +2375,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') $datetimeobj = new DateTime(); $datetimeobj->setTimestamp($timestamp); // Use local PHP server timezone if ($forcetimezone) { - $datetimeobj->setTimezone(new DateTimeZone($forcetimezone)); // (add timezone relative to the date entered) + $datetimeobj->setTimezone(new DateTimeZone($forcetimezone == 'gmt' ? 'UTC' : $forcetimezone)); // (add timezone relative to the date entered) } $arrayinfo = array( 'year'=>((int) date_format($datetimeobj, 'Y')), diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 531e366de77..0d729e6c762 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -165,14 +165,21 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } elseif (in_array($hosttocheck, array('ip6-localhost', 'ip6-loopback'))) { $iptocheck = '::1'; } else { - // TODO Resolve $hosttocheck to get the IP $iptocheck and set CURLOPT_CONNECT_TO to use this ip - $iptocheck = $hosttocheck; + // Resolve $hosttocheck to get the IP $iptocheck and set CURLOPT_CONNECT_TO to use this ip so curl will not try another resolution that may give a different result + if (function_exists('gethostbyname')) { + $iptocheck = gethostbyname($hosttocheck); + } else { + $iptocheck = $hosttocheck; + } + // TODO Resolve ip v6 } - if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) { // This is not an IP + // Check $iptocheck is an IP (v4 or v6), if not clear value. + if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) { // This is not an IP, we clean data $iptocheck = '0'; // } + //var_dump($_SERVER); if ($iptocheck) { if ($localurl == 0) { // Only external url allowed (dangerous, may allow to get malware) if (!filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { @@ -181,18 +188,38 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $info['content'] = 'Error bad hostname IP (private or reserved range). Must be an external URL.'; break; } - if (in_array($iptocheck, array('100.100.100.200'))) { + if ($iptocheck == $_SERVER["SERVER_ADDR"]) { $info['http_code'] = 400; - $info['content'] = 'Error bad hostname IP (Used by Alibaba metadata). Must be an external URL.'; + $info['content'] = 'Error bad hostname IP (IP is a local IP). Must be an external URL.'; break; } - } - if ($localurl == 1) { // Only local url allowed (dangerous, may allow to get metadata on server or make internal port scanning) + if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { + $info['http_code'] = 400; + $info['content'] = 'Error bad hostname IP (IP is a local IP defined into MAIN_SECURITY_SERVER_IP). Must be an external URL.'; + break; + } + } else { // Only local url allowed (dangerous, may allow to get metadata on server or make internal port scanning) if (filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { $info['http_code'] = 400; $info['content'] = 'Error bad hostname. Must be a local URL.'; break; } + if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', '127.0.0.1,::1,'.$conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { + $info['http_code'] = 400; + $info['content'] = 'Error bad hostname IP (IP is not a local IP defined into list MAIN_SECURITY_SERVER_IP). Must be a local URL in allowed list.'; + break; + } + } + // Common check (local and external) + if (in_array($iptocheck, array('100.100.100.200'))) { + $info['http_code'] = 400; + $info['content'] = 'Error bad hostname IP (Used by Alibaba metadata). Must be an external URL.'; + break; + } + + // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result. Possible only on PHP v7+ + if (defined('CURLOPT_CONNECT_TO')) { + curl_setopt($ch, CURLOPT_CONNECT_TO, $iptocheck); } } @@ -220,7 +247,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = $rep = array(); if (curl_errno($ch)) { - // Ad keys to $rep + // Add keys to $rep $rep['content'] = $response; // moving to display page to display curl errors @@ -231,14 +258,16 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } else { //$info = curl_getinfo($ch); - // Ad keys to $rep + // Add keys to $rep $rep = $info; //$rep['header_size']=$info['header_size']; //$rep['http_code']=$info['http_code']; dol_syslog("getURLContent http_code=".$rep['http_code']); // Add more keys to $rep - $rep['content'] = $response; + if ($response) { + $rep['content'] = $response; + } $rep['curl_error_no'] = ''; $rep['curl_error_msg'] = ''; } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 691828cd9d2..7a593740590 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -415,7 +415,7 @@ class modAgenda extends DolibarrModules 'langs' => 'agenda', 'position' => 170, 'perms' => '$user->rights->agenda->allactions->read', - 'enabled' => '$conf->categorie->enabled&&$conf->categorie->enabled', + 'enabled' => '$conf->categorie->enabled', 'target' => '', 'user' => 2 ); @@ -456,8 +456,12 @@ class modAgenda extends DolibarrModules 'p.ref' => 'project', ); + $keyforselect = 'actioncomm'; $keyforelement = 'action'; $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'actioncomm as ac'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_extrafields as extra ON ac.id = extra.fk_object'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id'; if (!empty($user) && empty($user->rights->agenda->allactions->read)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index d1ad993af68..8e9d242a6e3 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -121,6 +121,7 @@ class modFacture extends DolibarrModules $datestart = dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); $this->cronjobs = array( 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart), + 1=>array('label'=>'SendEmailsRemindersOnDueDate', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture.class.php', 'objectname'=>'Facture', 'method'=>'sendEmailsReminderOnDueDate', 'parameters'=>"10,all,EmailTemplateCode", 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority)', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart), ); // Permissions diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 0b926f6a802..2af3b39789e 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1140,9 +1140,9 @@ class Cronjob extends CommonObject $ret = dol_include_once($this->classesname); if ($ret === false || (!class_exists($this->objectname))) { if ($ret === false) { - $this->error = $langs->trans('CronCannotLoadClass', $this->classesname, $this->objectname); + $this->error = $langs->transnoentitiesnoconv('CronCannotLoadClass', $this->classesname, $this->objectname); } else { - $this->error = $langs->trans('CronCannotLoadObject', $this->classesname, $this->objectname); + $this->error = $langs->transnoentitiesnoconv('CronCannotLoadObject', $this->classesname, $this->objectname); } dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); $this->lastoutput = $this->error; @@ -1155,7 +1155,7 @@ class Cronjob extends CommonObject // test if method exists if (!$error) { if (!method_exists($this->objectname, $this->methodename)) { - $this->error = $langs->trans('CronMethodDoesNotExists', $this->objectname, $this->methodename); + $this->error = $langs->transnoentitiesnoconv('CronMethodDoesNotExists', $this->objectname, $this->methodename); dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); $this->lastoutput = $this->error; $this->lastresult = -1; @@ -1163,7 +1163,7 @@ class Cronjob extends CommonObject $error++; } if (in_array(strtolower(trim($this->methodename)), array('executecli'))) { - $this->error = $langs->trans('CronMethodNotAllowed', $this->methodename, $this->objectname); + $this->error = $langs->transnoentitiesnoconv('CronMethodNotAllowed', $this->methodename, $this->objectname); dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); $this->lastoutput = $this->error; $this->lastresult = -1; diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index 37206815cbf..147f0842e4c 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -110,8 +110,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); $title = $langs->trans("ExpenseReport")." - ".$langs->trans("Documents"); -$helpurl = "EN:Module_Expense_Reports"; -llxHeader("", $title, $helpurl); +$help_url = "EN:Module_Expense_Reports|FR:Module_Notes_de_frais"; + +llxHeader("", $title, $help_url); if ($object->id) { $object->fetch_thirdparty(); diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index f9792d5b68c..be8c735edc1 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -75,8 +75,8 @@ $tripandexpense_static = new ExpenseReport($db); $childids = $user->getAllChildIds(); $childids[] = $user->id; -//$help_url='EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones'; -$help_url = ''; +$help_url = "EN:Module_Expense_Reports|FR:Module_Notes_de_frais"; + llxHeader('', $langs->trans("ListOfFees"), $help_url); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index ae4261990f4..e83899d28d1 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -80,10 +80,10 @@ $diroutputmassaction = $conf->expensereport->dir_output.'/temp/massgeneration/'. // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -98,19 +98,22 @@ if (!$sortfield) { } -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_ref = GETPOST('search_ref', 'alpha'); -$search_user = GETPOST('search_user', 'int'); -$search_amount_ht = GETPOST('search_amount_ht', 'alpha'); -$search_amount_vat = GETPOST('search_amount_vat', 'alpha'); -$search_amount_ttc = GETPOST('search_amount_ttc', 'alpha'); -$search_status = (GETPOST('search_status', 'intcomma') != '' ?GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma')); -$month_start = GETPOST("month_start", "int"); -$year_start = GETPOST("year_start", "int"); -$day_start = GETPOST("day_start", "int"); -$day_end = GETPOST("day_end", "int"); -$month_end = GETPOST("month_end", "int"); -$year_end = GETPOST("year_end", "int"); +$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); + +$search_ref = GETPOST('search_ref', 'alpha'); +$search_user = GETPOST('search_user', 'int'); +$search_amount_ht = GETPOST('search_amount_ht', 'alpha'); +$search_amount_vat = GETPOST('search_amount_vat', 'alpha'); +$search_amount_ttc = GETPOST('search_amount_ttc', 'alpha'); +$search_status = (GETPOST('search_status', 'intcomma') != '' ?GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma')); + +$year_start = GETPOST('year_start', 'int'); +$month_start = GETPOST('month_start', 'int'); +$day_start = GETPOST('day_start', 'int'); +$year_end = GETPOST('year_end', 'int'); +$month_end = GETPOST('month_end', 'int'); +$day_end = GETPOST('day_end', 'int'); + $optioncss = GETPOST('optioncss', 'alpha'); if ($search_status == '') { diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9c34fe4b39f..ee9edc6694b 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -293,6 +293,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add GroupBy from hooks +$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); // Count total nb of records diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 2772137284b..f5baeee4027 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -55,7 +55,9 @@ if (empty($permissiontoread)) accessforbidden(); $form = new Form($db); $establishmenttmp = new Establishment($db); -llxHeader('', $langs->trans("Establishments")); +$title = $langs->trans('Establishments'); + +llxHeader('', $title, ''); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortorder = GETPOST("sortorder", 'alpha'); diff --git a/htdocs/hrm/admin/admin_hrm.php b/htdocs/hrm/admin/admin_hrm.php index d19b15e3499..455035a6b53 100644 --- a/htdocs/hrm/admin/admin_hrm.php +++ b/htdocs/hrm/admin/admin_hrm.php @@ -73,7 +73,10 @@ if ($action == 'update') { * View */ -llxHeader('', $langs->trans('Parameters')); + +$title = $langs->trans('Parameters'); + +llxHeader('', $title, ''); $form = new Form($db); diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index f169ce60b37..09485357956 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -84,7 +84,9 @@ if (!empty($conf->holiday->enabled) && !empty($setupcompanynotcomplete)) { $childids = $user->getAllChildIds(); $childids[] = $user->id; -llxHeader('', $langs->trans('HRMArea')); +$title = $langs->trans('HRMArea'); + +llxHeader('', $title, ''); print load_fiche_titre($langs->trans("HRMArea"), '', 'hrm'); diff --git a/htdocs/install/default.css b/htdocs/install/default.css index eaefd6d5b2b..5363d9530e1 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -362,7 +362,7 @@ tr.choiceselected td .button { } a.button:link,a.button:visited,a.button:active { - color: #888; + color: #555; } .button { diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index f2f1048cf19..5f94ece4720 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -71,17 +71,22 @@ -- Indonesia -> for Departmements -- Italy -- Luxembourg --- Morocco +-- Mauritius -- Mexique -> for Departmements +-- Morocco -- Netherlands -> for Departmements -- Panama -> for Departmements +-- Portugal -- Romania -> for Departmements -- San Salvador +-- Slovenia -- Spain -- Switzerland/Suisse -> for Departmements/Cantons -- Tunesia +-- United Arab Emirates -> for Departmements -- United Kingdom -- USA -> for Departmements +-- Venezuela @@ -260,6 +265,25 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 140, 14003, '', 0, 'Luxembourg'); +-- Mauritius Regions (id country=152) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15201, '', 0, 'Rivière Noire'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15202, '', 0, 'Flacq'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15203, '', 0, 'Grand Port'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15204, '', 0, 'Moka'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15205, '', 0, 'Pamplemousses'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15206, '', 0, 'Plaines Wilhems'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15207, '', 0, 'Port-Louis'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15208, '', 0, 'Rivière du Rempart'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15209, '', 0, 'Savanne'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15210, '', 0, 'Rodrigues'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15211, '', 0, 'Les îles Agaléga'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 152, 15212, '', 0, 'Les écueils des Cargados Carajos'); + + +-- Mexique Regions (id country=154) +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 154, 15401, '', 0, 'Mexique'); + + -- Morocco / Maroc - Regions (id country=12) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 12, 1201, '', 0, 'Tanger-Tétouan'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen'); @@ -279,10 +303,6 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 12, 1216, '', 0, 'Oued Ed-Dahab Lagouira'); --- Mexique Regions (id country=154) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 154, 15401, '', 0, 'Mexique'); - - -- Netherlands Regions (id country=17) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 17, 1701, '', 0,'Provincies van Nederland '); @@ -291,6 +311,11 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 1 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 178, 17801, '', 0, 'Panama'); +-- Portugal Regions (rowid country=25) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15001, 'PT', NULL, 'Portugal'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 25, 15002, 'PT9', NULL, 'Azores-Madeira'); + + -- Romania Regions (id country=188) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 188, 18801, '', 0, 'Romania'); @@ -301,6 +326,11 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 8 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 86, 8603, NULL, NULL, 'Occidental'); +-- Slovenia Regions (rowid country=202) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 202, '20203', 'SI03', NULL, 'East Slovenia'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ( 202, '20204', 'SI04', NULL, 'West Slovenia'); + + -- Spain Regions (id country=4) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 401, '', 0, 'Andalucia'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 4, 402, '', 0, 'Aragón'); @@ -329,30 +359,34 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 6 -- Tunisia Regions (id country=10) -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1001, '',0,'Ariana'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1002, '',0,'Béja'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1003, '',0,'Ben Arous'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1004, '',0,'Bizerte'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1005, '',0,'Gabès'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1006, '',0,'Gafsa'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1007, '',0,'Jendouba'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1008, '',0,'Kairouan'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1009, '',0,'Kasserine'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1010, '',0,'Kébili'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1011, '',0,'La Manouba'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1012, '',0,'Le Kef'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1013, '',0,'Mahdia'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1014, '',0,'Médenine'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1015, '',0,'Monastir'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1016, '',0,'Nabeul'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1017, '',0,'Sfax'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1018, '',0,'Sidi Bouzid'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1019, '',0,'Siliana'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1020, '',0,'Sousse'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1021, '',0,'Tataouine'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1022, '',0,'Tozeur'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1023, '',0,'Tunis'); -insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1024, '',0,'Zaghouan'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1001, '', 0, 'Ariana'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1002, '', 0, 'Béja'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1003, '', 0, 'Ben Arous'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1004, '', 0, 'Bizerte'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1005, '', 0, 'Gabès'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1006, '', 0, 'Gafsa'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1007, '', 0, 'Jendouba'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1008, '', 0, 'Kairouan'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1009, '', 0, 'Kasserine'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1010, '', 0, 'Kébili'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1011, '', 0, 'La Manouba'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1012, '', 0, 'Le Kef'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1013, '', 0, 'Mahdia'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1014, '', 0, 'Médenine'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1015, '', 0, 'Monastir'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1016, '', 0, 'Nabeul'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1017, '', 0, 'Sfax'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1018, '', 0, 'Sidi Bouzid'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1019, '', 0, 'Siliana'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1020, '', 0, 'Sousse'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1021, '', 0, 'Tataouine'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1022, '', 0, 'Tozeur'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1023, '', 0, 'Tunis'); +insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values (10, 1024, '', 0, 'Zaghouan'); + + +-- United Arab Emirates (UAE) Regions (rowid country=227) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 227, 22701, '', 0, 'United Arab Emirates'); -- UK United Kingdom Regions (id_country=7) @@ -366,34 +400,21 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 7 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 11, 1101, '', 0, 'United-States'); +-- Venezuela Regions (id country=232) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23201, '', 0, 'Los Andes'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23202, '', 0, 'Capital'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23203, '', 0, 'Central'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23204, '', 0, 'Cento Occidental'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23205, '', 0, 'Guayana'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23206, '', 0, 'Insular'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23207, '', 0, 'Los Llanos'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23208, '', 0, 'Nor-Oriental'); +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 232, 23209, '', 0, 'Zuliana'); --- Regions Mauritius (id country=152) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15201, '', 0, 'Rivière Noire', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15202, '', 0, 'Flacq', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15203, '', 0, 'Grand Port', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15204, '', 0, 'Moka', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15205, '', 0, 'Pamplemousses', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15206, '', 0, 'Plaines Wilhems', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15207, '', 0, 'Port-Louis', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15208, '', 0, 'Rivière du Rempart', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15209, '', 0, 'Savanne', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15210, '', 0, 'Rodrigues', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15211, '', 0, 'Les îles Agaléga', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1); --- Regions Venezuela (id country=232) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23201, '', 0, 'Los Andes', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23202, '', 0, 'Capital', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23203, '', 0, 'Central', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23204, '', 0, 'Cento Occidental', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23205, '', 0, 'Guayana', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23206, '', 0, 'Insular', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23207, '', 0, 'Los Llanos', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23208, '', 0, 'Nor-Oriental', 1); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23209, '', 0, 'Zuliana', 1); -- Regions Peru (id country=181) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 181, 18101, '', 0, 'Amazonas', 1); @@ -425,10 +446,6 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) va --- Regions United Arab Emirates (rowid country=227) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 227, 22701, '', 0, 'United Arab Emirates', 1); - - -- Regions Hungary (rowid country=18) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 183100, 'HU31', NULL, 'Northern Hungary'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 183200, 'HU32', NULL, 'Northern Great Plain'); @@ -438,13 +455,7 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 182200, 'HU22', NULL, 'Western Transdanubia'); INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (18, 182300, 'HU23', NULL, 'Southern Transdanubia'); --- Regions Portugal (rowid country=25) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (25, 15001, 'PT', NULL, 'Portugal'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (25, 15002, 'PT9', NULL, 'Azores-Madeira'); --- Regions Slovenia (rowid country=202) -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ('202', '20203', 'SI03', NULL, 'East Slovenia'); -INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ('202', '20204', 'SI04', NULL, 'West Slovenia'); -- Regions China (rowid country=9) insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 901, '京',0,'北京市'); diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index d9321656355..2841ae8bdfe 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -572,7 +572,7 @@ dolibarr_install_syslog("- step2: end"); $out = ' '; -$out .= $langs->trans("MakeAnonymousPing"); +$out .= ''; $out .= ''; $out .= '