Merge branch 'develop' into daraelmin-patch-2
This commit is contained in:
commit
cc25a45767
@ -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 md5("$demopass"); ?>' | php`
|
||||
echo '<?php echo MD5("$demopass"); ?>' > /tmp/tmp.php
|
||||
newpass=`php -f /tmp/tmp.php`
|
||||
rm /tmp/tmp.php
|
||||
else
|
||||
newpass=`echo '<?php echo password_hash("$demopass", PASSWORD_DEFAULT); ?>' | php`
|
||||
echo '<?php echo password_hash("'$demopass'", PASSWORD_DEFAULT); ?>' > /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=$?
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ if ($action == 'update') {
|
||||
}
|
||||
if ($result <= 0) {
|
||||
// setEventMessages(null, $accounting->errors, 'errors');
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br/> <pre>'.$sql.'</pre></span></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$db->begin();
|
||||
|
||||
@ -164,7 +164,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
$msg .= '<div><span style="color:green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||
$ok++;
|
||||
} else {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></span></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -188,7 +188,7 @@ if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||
$ok++;
|
||||
} else {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></span></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
@ -322,7 +322,7 @@ class Dolistore
|
||||
$html .= '<tr class="app oddeven '.$compatible.'">
|
||||
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
|
||||
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
|
||||
.'<br/><small>'.$version.'</small></h2>
|
||||
.'<br><small>'.$version.'</small></h2>
|
||||
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
|
||||
// do not load if display none
|
||||
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
|
||||
|
||||
@ -520,9 +520,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
|
||||
$moreforfilter = '<div class="valignmiddle">';
|
||||
|
||||
$moreforfilter .= '<div class="floatright right pagination"><ul><li>';
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'common' ? '' : ' btnTitleSelected')));
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition'.($mode == 'commonkanban' ? '' : ' btnTitleSelected')));
|
||||
$moreforfilter .= '<div class="floatright right pagination --module-list"><ul><li>';
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdateHelp'), 'fa fa-check-double ', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
|
||||
$moreforfilter .= '</li><li>'.dolGetButtonTitleSeparator();
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$moreforfilter .= '</li></ul></div>';
|
||||
|
||||
//$moreforfilter .= '<div class="floatright center marginrightonly hideonsmartphone" style="padding-top: 3px"><span class="paddingright">'.$moreinfo.'</span> '.$moreinfo2.'</div>';
|
||||
@ -583,7 +585,6 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
// Show list of modules
|
||||
$oldfamily = '';
|
||||
$linenum = 0;
|
||||
|
||||
foreach ($orders as $key => $value) {
|
||||
$linenum++;
|
||||
$tab = explode('_', $value);
|
||||
@ -591,6 +592,8 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
$module_position = $tab[2];
|
||||
|
||||
$modName = $filename[$key];
|
||||
|
||||
/** @var DolibarrModules $objMod */
|
||||
$objMod = $modules[$modName];
|
||||
|
||||
//print $objMod->name." - ".$key." - ".$objMod->version."<br>";
|
||||
@ -719,6 +722,22 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
$versiontrans .= $objMod->getVersion(1);
|
||||
}
|
||||
|
||||
if ($objMod->isCoreOrExternalModule() == 'external'
|
||||
&& (
|
||||
$action == 'checklastversion'
|
||||
// This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application.
|
||||
// Adding a cron job could be a good idea see DolibarrModules::checkForUpdate()
|
||||
|| !empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)
|
||||
)
|
||||
) {
|
||||
$checkRes = $objMod->checkForUpdate();
|
||||
if ($checkRes > 0) {
|
||||
setEventMessage($objMod->getName().' : '.$versiontrans.' -> '.$objMod->lastVersion);
|
||||
} elseif ($checkRes < 0) {
|
||||
setEventMessage($objMod->getName().' '.$langs->trans('CheckVersionFail'), 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
// Define imginfo
|
||||
$imginfo = "info";
|
||||
if ($objMod->isCoreOrExternalModule() == 'external') {
|
||||
@ -893,17 +912,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
|
||||
// Version
|
||||
print '<td class="center nowrap" width="120px">';
|
||||
print $versiontrans;
|
||||
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) { // This is a bad practice to activate a synch external access during building of a page. 1 external module can hang the application.
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
if (!empty($objMod->url_last_version)) {
|
||||
$newversion = getURLContent($objMod->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
||||
if (isset($newversion['content'])) {
|
||||
if (version_compare($newversion['content'], $versiontrans) > 0) {
|
||||
print " <span class='butAction' title='".$langs->trans('LastStableVersion')."'>".$newversion['content']."</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($objMod->needUpdate) {
|
||||
$versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
|
||||
print '<span class="badge badge-warning classfortooltip" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
|
||||
} else {
|
||||
print $versiontrans;
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
||||
if (dol_is_file($xmlfile)) {
|
||||
print '<input type="radio" name="target" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> '.$langs->trans("LocalSignature").' = ';
|
||||
print '<input type="radio" name="target" id="checkboxlocal" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> <label for="checkboxlocal">'.$langs->trans("LocalSignature").'</label> = ';
|
||||
print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
|
||||
print '<br>';
|
||||
} else {
|
||||
@ -121,7 +121,7 @@ if (dol_is_file($xmlfile)) {
|
||||
}
|
||||
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||
if ($enableremotecheck) {
|
||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> '.$langs->trans("RemoteSignature").' = ';
|
||||
print '<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> <label for="checkboxremote">'.$langs->trans("RemoteSignature").'</label> = ';
|
||||
print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
|
||||
} else {
|
||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$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++;
|
||||
}
|
||||
|
||||
@ -243,10 +243,13 @@ print '<br>';
|
||||
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
|
||||
|
||||
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
||||
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? $langs->trans("Undefined") : '')." ";
|
||||
print '<span class="opacitymedium"> If unset: \'md5\'</span><br>';
|
||||
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_HASH_ALGO)." ";
|
||||
if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
|
||||
print '<span class="opacitymedium"> If unset: \'md5\'</span>';
|
||||
}
|
||||
print '<br>';
|
||||
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
||||
print '<strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? $langs->trans("Undefined") : $conf->global->MAIN_SECURITY_SALT).'<br>';
|
||||
print '<strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_SALT).'<br>';
|
||||
}
|
||||
if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
||||
print '<div class="info">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.<br>';
|
||||
@ -258,6 +261,11 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
||||
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")).'<br>';
|
||||
}
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -260,7 +260,7 @@ print "<br>\n";
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="button">';
|
||||
print '<br/><br/>';
|
||||
print '<br><br>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -239,7 +239,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
print '<label for="checkbox_use_quick">';
|
||||
print $form->textwithpicto($langs->trans('ExportUseMySQLQuickParameter'), $langs->trans('ExportUseMySQLQuickParameterHelp'));
|
||||
print '</label>';
|
||||
print '<br/>';
|
||||
print '<br>';
|
||||
|
||||
print '<!-- <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" />';
|
||||
print '<label for="checkbox_drop_database">'.$langs->trans("AddDropDatabase").'</label>';
|
||||
|
||||
@ -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 '</td>';
|
||||
print "</tr>";
|
||||
|
||||
$colspan = count($fieldlist) + 2;
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,15 +37,15 @@ function genkeypad($keypadname, $formname)
|
||||
$sz .= '<div id="keypad'.$keypadname.'" style="position:absolute;z-index:90;display:none; background:#AAA; vertical-align:top;">'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 7 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',7);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 8 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',8);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 9 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',9);"/><br/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 9 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',9);"/><br>'."\n";
|
||||
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 4 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',4);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 5 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',5);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 6 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',6);"/><br/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 6 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',6);"/><br>'."\n";
|
||||
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 1 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',1);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 2 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',2);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 3 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',3);"/><br/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 3 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',3);"/><br>'."\n";
|
||||
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value=" 0 " onclick="addvalue(\''.$keypadname.'\',\''.$formname.'\',0);"/>'."\n";
|
||||
$sz .= '<input type="button" style="font-size:'.$btnsize.'px;" value="←" ';
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -678,8 +678,9 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
// Search Icon
|
||||
print '<td class="right">';
|
||||
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
|
||||
if ($obj->statut == 0) { // Not sent yet
|
||||
if ($user->rights->mailing->creer && $allowaddtarget) {
|
||||
if (!empty($user->rights->mailing->creer) && $allowaddtarget) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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 .= ' <DrctDbtTxInf>'.$CrLf;
|
||||
$XML_DEBITOR .= ' <PmtId>'.$CrLf;
|
||||
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
|
||||
$XML_DEBITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('DD-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .= ' </PmtId>'.$CrLf;
|
||||
$XML_DEBITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||
$XML_DEBITOR .= ' <DrctDbtTx>'.$CrLf;
|
||||
@ -1943,7 +1943,7 @@ class BonPrelevement extends CommonObject
|
||||
$XML_CREDITOR .= ' <CdtTrfTxInf>'.$CrLf;
|
||||
$XML_CREDITOR .= ' <PmtId>'.$CrLf;
|
||||
// Add EndToEndId. Must be a unique ID for each payment (for example by including bank, buyer or seller, date, checksum)
|
||||
$XML_CREDITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('AS-'.dol_trunc($row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_CREDITOR .= ' <EndToEndId>'.(($conf->global->PRELEVEMENT_END_TO_END != "") ? $conf->global->PRELEVEMENT_END_TO_END : ('CT-'.dol_trunc($row_idfac.'-'.$row_ref, 20)).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_CREDITOR .= ' </PmtId>'.$CrLf;
|
||||
$XML_CREDITOR .= ' <Amt>'.$CrLf;
|
||||
$XML_CREDITOR .= ' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||
|
||||
@ -1301,7 +1301,7 @@ abstract class CommonDocGenerator
|
||||
),
|
||||
|
||||
'list' => array(
|
||||
'separator' => '<br/>'
|
||||
'separator' => '<br>'
|
||||
),
|
||||
|
||||
'auto' => array(
|
||||
@ -1392,7 +1392,7 @@ abstract class CommonDocGenerator
|
||||
$itemsInRow = 0;
|
||||
$maxItemsInRow = $params['table']['maxItemsInRow'];
|
||||
foreach ($fields as $field) {
|
||||
//$html.= !empty($html)?'<br/>':'';
|
||||
//$html.= !empty($html)?'<br>':'';
|
||||
if ($itemsInRow >= $maxItemsInRow) {
|
||||
// start a new line
|
||||
$html .= "</tr><tr>";
|
||||
|
||||
@ -882,7 +882,7 @@ class DolGraph
|
||||
$this->stringtoshow .= '\'+';
|
||||
$this->stringtoshow .= ($showlegend ? '' : 'label+\' \'+'); // Hide label if already shown in legend
|
||||
$this->stringtoshow .= ($showpointvalue ? 'number+' : '');
|
||||
$this->stringtoshow .= ($showpercent ? '\'<br/>\'+percent+\'%\'+' : '');
|
||||
$this->stringtoshow .= ($showpercent ? '\'<br>\'+percent+\'%\'+' : '');
|
||||
$this->stringtoshow .= '\'';
|
||||
if ($urltemp) {
|
||||
$this->stringtoshow .= '</a>';
|
||||
|
||||
@ -735,7 +735,7 @@ class Translate
|
||||
* @param string $str string root to translate
|
||||
* @param string $countrycode country code (FR, ...)
|
||||
* @return string translated string
|
||||
* @see transcountrynoentities()
|
||||
* @see transcountrynoentities(), picto_from_langcode()
|
||||
*/
|
||||
public function transcountry($str, $countrycode)
|
||||
{
|
||||
@ -753,7 +753,7 @@ class Translate
|
||||
* @param string $str string root to translate
|
||||
* @param string $countrycode country code (FR, ...)
|
||||
* @return string translated string
|
||||
* @see transcountry()
|
||||
* @see transcountry(), picto_from_langcode()
|
||||
*/
|
||||
public function transcountrynoentities($str, $countrycode)
|
||||
{
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
// $keyforselect = name of main table
|
||||
// keyforelement = name of picto
|
||||
// $keyforaliasextra = a key to avoid conflict with extrafields of other objects
|
||||
|
||||
if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) {
|
||||
//print $keyforselet.' - '.$keyforelement.' - '.$keyforaliasextra;
|
||||
dol_print_error('', 'include of file extrafieldsinexport.inc.php was done but var $keyforselect or $keyforelement or $keyforaliasextra was not set');
|
||||
|
||||
@ -547,12 +547,12 @@ function dol_get_last_day($year, $month = 12, $gm = false)
|
||||
*
|
||||
* @param int $date Date GMT
|
||||
* @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ,
|
||||
* True or 1 or 'gmt' to compare with GMT date.
|
||||
* 'gmt' to compare with GMT date.
|
||||
* @return int Date for last hour of a given date
|
||||
*/
|
||||
function dol_get_last_hour($date, $gm = 'tzserver')
|
||||
{
|
||||
$tmparray = dol_getdate($date);
|
||||
$tmparray = dol_getdate($date, false, ($gm == 'gmt' ? 'gmt' : ''));
|
||||
return dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], $gm);
|
||||
}
|
||||
|
||||
@ -561,12 +561,12 @@ function dol_get_last_hour($date, $gm = 'tzserver')
|
||||
*
|
||||
* @param int $date Date GMT
|
||||
* @param mixed $gm False or 0 or 'tzserver' = Return date to compare with server TZ,
|
||||
* True or 1 or 'gmt' to compare with GMT date.
|
||||
* 'gmt' to compare with GMT date.
|
||||
* @return int Date for last hour of a given date
|
||||
*/
|
||||
function dol_get_first_hour($date, $gm = 'tzserver')
|
||||
{
|
||||
$tmparray = dol_getdate($date);
|
||||
$tmparray = dol_getdate($date, false, ($gm == 'gmt' ? 'gmt' : ''));
|
||||
return dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year'], $gm);
|
||||
}
|
||||
|
||||
|
||||
@ -2290,7 +2290,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
dol_print_error("Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"]);
|
||||
return '';
|
||||
} elseif (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)) { // Still available to solve problems in extrafields of type date
|
||||
// This part of code should not be used.
|
||||
// This part of code should not be used anymore.
|
||||
dol_syslog("Functions.lib::dol_print_date function called with a bad value from page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
||||
//if (function_exists('debug_print_backtrace')) debug_print_backtrace();
|
||||
// Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'
|
||||
@ -2318,7 +2318,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
$timetouse = $time + $offsettz + $offsetdst; // TODO Replace this with function Date PHP. We also should not use anymore offsettz and offsetdst but only offsettzstring.
|
||||
|
||||
// Here ret is string in PHP setup language (strftime was used). Now we convert to $outputlangs.
|
||||
$month = adodb_strftime('%m', $timetouse);
|
||||
$month = adodb_strftime('%m', $timetouse, true);
|
||||
$month = sprintf("%02d", $month); // $month may be return with format '06' on some installation and '6' on other, so we force it to '06'.
|
||||
if ($encodetooutput) {
|
||||
$monthtext = $outputlangs->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')),
|
||||
@ -7996,7 +7996,7 @@ function dol_validElement($element)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return img flag of country for a language code or country code
|
||||
* Return img flag of country for a language code or country code.
|
||||
*
|
||||
* @param string $codelang Language code ('en_IN', 'fr_CA', ...) or ISO Country code on 2 characters in uppercase ('IN', 'FR')
|
||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"' or 'class="saturatemedium"')
|
||||
@ -9710,6 +9710,17 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
||||
return '<div class="inline-block divButAction"><'.$tag.' '.$compiledAttributes.'>'.$html.'</'.$tag.'></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add space between dolGetButtonTitle
|
||||
*
|
||||
* @param string $moreClass more css class label
|
||||
* @return string html of title separator
|
||||
*/
|
||||
function dolGetButtonTitleSeparator($moreClass = "")
|
||||
{
|
||||
return '<span class="button-title-separator '.$moreClass.'" ></span>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function dolGetButtonTitle : this kind of buttons are used in title in list
|
||||
*
|
||||
@ -9718,7 +9729,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
||||
* @param string $iconClass class for icon element (Example: 'fa fa-file')
|
||||
* @param string $url the url for link
|
||||
* @param string $id attribute id of button
|
||||
* @param int $status 0 no user rights, 1 active, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
|
||||
* @param int $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use helpText as tooltip
|
||||
* @param array $params various params for future : recommended rather than adding more function arguments
|
||||
* @return string html button
|
||||
*/
|
||||
@ -9753,7 +9764,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
|
||||
$useclassfortooltip = 0;
|
||||
}
|
||||
|
||||
if ($status <= 0) {
|
||||
if ($status == 2) {
|
||||
$attr['class'] .= ' btnTitleSelected';
|
||||
} elseif ($status <= 0) {
|
||||
$attr['class'] .= ' refused';
|
||||
|
||||
$attr['href'] = '';
|
||||
|
||||
@ -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'] = '';
|
||||
}
|
||||
|
||||
@ -203,10 +203,6 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
|
||||
}
|
||||
// Add translation reference (main language)
|
||||
if ($object->isMultiLang()) {
|
||||
// Add myself
|
||||
$tplcontent .= '<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n";
|
||||
$tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php').'" />'."\n";
|
||||
|
||||
// Add page "translation of"
|
||||
$translationof = $objectpage->fk_page;
|
||||
if ($translationof) {
|
||||
@ -225,6 +221,7 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add "has translation pages"
|
||||
$sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objectpage->id.($translationof ? ', '.$translationof : '')).")";
|
||||
$resql = $db->query($sql);
|
||||
@ -244,6 +241,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// Add myself
|
||||
$tplcontent .= '<?php if ($_SERVER["PHP_SELF"] == "'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '')).'/'.$objectpage->pageurl.'.php") { ?>'."\n";
|
||||
$tplcontent .= '<link rel="alternate" hreflang="'.$shortlangcode.'" href="'.(($object->fk_default_home == $objectpage->id) ? '/' : (($shortlangcode != substr($object->lang, 0, 2)) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php').'" />'."\n";
|
||||
|
||||
$tplcontent .= '<?php } ?>'."\n";
|
||||
}
|
||||
// Add manifest.json. Do we have to add it only on home page ?
|
||||
|
||||
@ -192,6 +192,18 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
*/
|
||||
public $version;
|
||||
|
||||
/**
|
||||
* Module last version
|
||||
* @var string $lastVersion
|
||||
*/
|
||||
public $lastVersion = '';
|
||||
|
||||
/**
|
||||
* true indicate this module need update
|
||||
* @var bool $needUpdate
|
||||
*/
|
||||
public $needUpdate = false;
|
||||
|
||||
/**
|
||||
* @var string Module description (short text)
|
||||
*
|
||||
@ -2240,7 +2252,11 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
print '
|
||||
<div class="box-flex-item info-box-module'.(empty($conf->global->$const_name) ? ' info-box-module-disabled' : '').($this->isCoreOrExternalModule() == 'external' ? ' info-box-module-external' : '').'">
|
||||
<div class="box-flex-item info-box-module'
|
||||
.(empty($conf->global->$const_name) ? ' --disabled' : '')
|
||||
.($this->isCoreOrExternalModule() == 'external' ? ' --external' : '')
|
||||
.($this->needUpdate ? ' --need-update' : '')
|
||||
.'">
|
||||
<div class="info-box info-box-sm info-box-module">
|
||||
<div class="info-box-icon'.(empty($conf->global->$const_name) ? '' : ' info-box-icon-module-enabled'.($versiontrans ? ' info-box-icon-module-warning' : '')).'">';
|
||||
|
||||
@ -2258,7 +2274,12 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
}
|
||||
|
||||
if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
|
||||
print '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').'" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
|
||||
$versionTitle = $langs->trans("Version").' '.$this->getVersion(1);
|
||||
if ($this->needUpdate) {
|
||||
$versionTitle.= '<br>'.$langs->trans('ModuleUpdateAvailable').' : '.$this->lastVersion;
|
||||
}
|
||||
|
||||
print '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').' classfortooltip" title="'.dol_escape_js($versionTitle).'" >';
|
||||
print $this->getVersion(1);
|
||||
print '</span>';
|
||||
}
|
||||
@ -2287,4 +2308,33 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
</div><!-- /.info-box -->
|
||||
</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* check for module update
|
||||
* TODO : store results for $this->url_last_version and $this->needUpdate
|
||||
* Add a cron task to monitor for updates
|
||||
*
|
||||
* @return int <0 if Error, 0 == no update needed, >0 if need update
|
||||
*/
|
||||
public function checkForUpdate()
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
if (!empty($this->url_last_version)) {
|
||||
$lastVersion = getURLContent($this->url_last_version, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only
|
||||
if (isset($lastVersion['content']) && strlen($lastVersion['content']) < 30) {
|
||||
// Security warning : be careful with remote data content, the module editor could be hacked (or evil) so limit to a-z A-Z 0-9 _ . -
|
||||
$this->lastVersion = preg_replace("/[^a-zA-Z0-9_\.\-]+/", "", $lastVersion['content']);
|
||||
if (version_compare($this->lastVersion, $this->version) > 0) {
|
||||
$this->needUpdate = true;
|
||||
return 1;
|
||||
} else {
|
||||
$this->needUpdate = false;
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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
|
||||
|
||||
@ -80,9 +80,9 @@ if (!empty($object->comments)) {
|
||||
print '<div class="width75p float comment comment-table" style="background-color:#'.$TColors[$fk_user]['bgcolor'].'">';
|
||||
print '<div class="comment-info comment-cell">';
|
||||
if (!empty($user->photo)) {
|
||||
print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br/>';
|
||||
print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'<br>';
|
||||
}
|
||||
print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>';
|
||||
print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br>';
|
||||
print $langs->trans('Date').' : '.dol_print_date($comment->datec, 'dayhoursec');
|
||||
print '</div>'; // End comment-info
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -117,7 +117,7 @@ class ActionsDatapolicy
|
||||
$object->state_id = '';
|
||||
$object->skype = '';
|
||||
$object->country_id = '';
|
||||
$object->note_private = $object->note_private.'<br/>'.$langs->trans('ANONYMISER_AT', dol_print_date(time()));
|
||||
$object->note_private = $object->note_private.'<br>'.$langs->trans('ANONYMISER_AT', dol_print_date(time()));
|
||||
|
||||
if ($object->update($object->id, $user, 0)) {
|
||||
// On supprime les contacts associé
|
||||
|
||||
@ -2216,7 +2216,7 @@ if ($action == 'create') {
|
||||
if ($detail_entrepot->entrepot_id > 0) {
|
||||
$entrepot = new Entrepot($db);
|
||||
$entrepot->fetch($detail_entrepot->entrepot_id);
|
||||
$detail .= $langs->trans("DetailWarehouseFormat", $entrepot->libelle, $detail_entrepot->qty_shipped).'<br/>';
|
||||
$detail .= $langs->trans("DetailWarehouseFormat", $entrepot->libelle, $detail_entrepot->qty_shipped).'<br>';
|
||||
}
|
||||
}
|
||||
print $form->textwithtooltip(img_picto('', 'object_stock').' '.$langs->trans("DetailWarehouseNumber"), $detail);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
|
||||
@ -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 == '') {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -73,7 +73,10 @@ if ($action == 'update') {
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('', $langs->trans('Parameters'));
|
||||
|
||||
$title = $langs->trans('Parameters');
|
||||
|
||||
llxHeader('', $title, '');
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
|
||||
@ -362,7 +362,7 @@ tr.choiceselected td .button {
|
||||
}
|
||||
|
||||
a.button:link,a.button:visited,a.button:active {
|
||||
color: #888;
|
||||
color: #555;
|
||||
|
||||
}
|
||||
.button {
|
||||
|
||||
@ -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,'北京市');
|
||||
|
||||
@ -55,7 +55,8 @@
|
||||
-- Luxembourg
|
||||
-- Netherlands
|
||||
-- (Moroco)
|
||||
-- Romania
|
||||
-- Romania
|
||||
-- Tunisia
|
||||
|
||||
|
||||
|
||||
@ -803,31 +804,33 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (18801, 'VN', '', 0, '', 'Vrancea');
|
||||
|
||||
|
||||
-- Provinces Tunisia (id country=10)
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN01', 1001, '', 0, '', 'Ariana', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN02', 1001, '', 0, '', 'Béja', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN03', 1001, '', 0, '', 'Ben Arous', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN04', 1001, '', 0, '', 'Bizerte', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN05', 1001, '', 0, '', 'Gabès', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN06', 1001, '', 0, '', 'Gafsa', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN07', 1001, '', 0, '', 'Jendouba', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN08', 1001, '', 0, '', 'Kairouan', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN09', 1001, '', 0, '', 'Kasserine', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN10', 1001, '', 0, '', 'Kébili', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN11', 1001, '', 0, '', 'La Manouba', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN12', 1001, '', 0, '', 'Le Kef', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN13', 1001, '', 0, '', 'Mahdia', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN14', 1001, '', 0, '', 'Médenine', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN15', 1001, '', 0, '', 'Monastir', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN16', 1001, '', 0, '', 'Nabeul', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN17', 1001, '', 0, '', 'Sfax', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN18', 1001, '', 0, '', 'Sidi Bouzid', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN19', 1001, '', 0, '', 'Siliana', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN20', 1001, '', 0, '', 'Sousse', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN21', 1001, '', 0, '', 'Tataouine', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN22', 1001, '', 0, '', 'Tozeur', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN23', 1001, '', 0, '', 'Tunis', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('TN24', 1001, '', 0, '', 'Zaghouan', 1);
|
||||
-- Tunisia Governorates / Provinces / Wilaya (id country=10)
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN01', '', 0, '', 'Ariana');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN02', '', 0, '', 'Béja');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN03', '', 0, '', 'Ben Arous');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN04', '', 0, '', 'Bizerte');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN05', '', 0, '', 'Gabès');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN06', '', 0, '', 'Gafsa');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN07', '', 0, '', 'Jendouba');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN08', '', 0, '', 'Kairouan');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN09', '', 0, '', 'Kasserine');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN10', '', 0, '', 'Kébili');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN11', '', 0, '', 'La Manouba');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN12', '', 0, '', 'Le Kef');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN13', '', 0, '', 'Mahdia');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN14', '', 0, '', 'Médenine');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN15', '', 0, '', 'Monastir');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN16', '', 0, '', 'Nabeul');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN17', '', 0, '', 'Sfax');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN18', '', 0, '', 'Sidi Bouzid');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN19', '', 0, '', 'Siliana');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN20', '', 0, '', 'Sousse');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN21', '', 0, '', 'Tataouine');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN22', '', 0, '', 'Tozeur');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN23', '', 0, '', 'Tunis');
|
||||
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN24', '', 0, '', 'Zaghouan');
|
||||
|
||||
|
||||
|
||||
|
||||
-- Provinces Bolivia (id country=52)
|
||||
|
||||
@ -572,7 +572,7 @@ dolibarr_install_syslog("- step2: end");
|
||||
|
||||
|
||||
$out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno" value="checked" checked="true"> ';
|
||||
$out .= $langs->trans("MakeAnonymousPing");
|
||||
$out .= '<label for="dolibarrpingno">'.$langs->trans("MakeAnonymousPing").'</label>';
|
||||
|
||||
$out .= '<!-- Add js script to manage the uncheck of option to not send the ping -->';
|
||||
$out .= '<script type="text/javascript">';
|
||||
|
||||
@ -2121,4 +2121,8 @@ YouShouldDisablePHPFunctions=You should disable PHP functions
|
||||
IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system commands (for the module Scheduled job, or to run the external command line Anti-virus for example), you shoud disable PHP functions
|
||||
NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good)
|
||||
RecommendedValueIs=Recommended: %s
|
||||
ARestrictedPath=A restricted path
|
||||
ARestrictedPath=A restricted path
|
||||
CheckForModuleUpdate=Check for modules updates
|
||||
CheckForModuleUpdateHelp=Check for modules updates.<br>This action will connect to modules editors to check if a new version is available.
|
||||
ModuleUpdateAvailable=An update is available for this module
|
||||
SwaggerDescriptionFile=Swagger API description file (for use with redoc for example)
|
||||
|
||||
@ -226,6 +226,7 @@ ErrorAPageWithThisNameOrAliasAlreadyExists=The page/container <strong>%s</strong
|
||||
ErrorDuringChartLoad=Error when loading chart of accounts. If few accounts were not loaded, you can still enter them manually.
|
||||
ErrorBadSyntaxForParamKeyForContent=Bad syntax for param keyforcontent. Must have a value starting with %s or %s
|
||||
ErrorVariableKeyForContentMustBeSet=Error, the constant with name %s (with text content to show) or %s (with external url to show) must be set.
|
||||
ErrorURLMustEndWith=URL %s must end %s
|
||||
ErrorURLMustStartWithHttp=URL %s must start with http:// or https://
|
||||
ErrorHostMustNotStartWithHttp=Host name %s must NOT start with http:// or https://
|
||||
ErrorNewRefIsAlreadyUsed=Error, the new reference is already used
|
||||
@ -296,3 +297,4 @@ WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connec
|
||||
WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
|
||||
ErrorActionCommPropertyUserowneridNotDefined=User's owner is required
|
||||
ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary
|
||||
CheckVersionFail=Version check fail
|
||||
|
||||
@ -85,7 +85,7 @@ ListOfPermissionsDefined=List of defined permissions
|
||||
SeeExamples=See examples here
|
||||
EnabledDesc=Condition to have this field active (Examples: 1 or $conf->global->MYMODULE_MYOPTION)
|
||||
VisibleDesc=Is the field visible ? (Examples: 0=Never 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 end view form only (not create, not update).<br><br>Using a negative value means field is not shown by default on list but can be selected for viewing).<br><br>It can be an expression, for example:<br>preg_match('/public/', $_SERVER['PHP_SELF'])?0:1<br>($user->rights->holiday->define_holiday ? 1 : 0)
|
||||
DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.<br/>Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)<br/><br/><strong>For document :</strong><br/>0 = not displayed <br/>1 = display<br/>2 = display only if not empty<br/><br/><strong>For document lines :</strong><br/>0 = not displayed <br/>1 = displayed in a column<br/>3 = display in line description column after the description<br/>4 = display in description column after the description only if not empty
|
||||
DisplayOnPdfDesc=Display this field on compatible PDF documents, you can manage position with "Position" field.<br>Currently, known compatibles PDF models are : eratosthene (order), espadon (ship), sponge (invoices), cyan (propal/quotation), cornas (supplier order)<br><br><strong>For document :</strong><br>0 = not displayed <br>1 = display<br>2 = display only if not empty<br><br><strong>For document lines :</strong><br>0 = not displayed <br>1 = displayed in a column<br>3 = display in line description column after the description<br>4 = display in description column after the description only if not empty
|
||||
DisplayOnPdf=Display on PDF
|
||||
IsAMeasureDesc=Can the value of field be cumulated to get a total into list? (Examples: 1 or 0)
|
||||
SearchAllDesc=Is the field used to make a search from the quick search tool? (Examples: 1 or 0)
|
||||
|
||||
@ -143,5 +143,5 @@ ConfirmSitemapsCreation=Confirm sitemap generation
|
||||
SitemapGenerated=Sitemap Generated
|
||||
ImportFavicon=Favicon
|
||||
ErrorFaviconType=Favicon must be png
|
||||
ErrorFaviconSize=Favicon must be of size 32x32
|
||||
FaviconTooltip=Upload an image which needs to be a png of 32x32
|
||||
ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64
|
||||
FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64)
|
||||
|
||||
@ -340,6 +340,8 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init API
|
||||
if ($dirins && $action == 'initapi' && !empty($module)) {
|
||||
$modulename = ucfirst($module); // Force first letter in uppercase
|
||||
$objectname = $tabobj;
|
||||
@ -374,6 +376,9 @@ if ($dirins && $action == 'initapi' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init PHPUnit
|
||||
if ($dirins && $action == 'initphpunit' && !empty($module)) {
|
||||
$modulename = ucfirst($module); // Force first letter in uppercase
|
||||
$objectname = $tabobj;
|
||||
@ -407,6 +412,9 @@ if ($dirins && $action == 'initphpunit' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init ExtraFields
|
||||
if ($dirins && $action == 'initsqlextrafields' && !empty($module)) {
|
||||
$modulename = ucfirst($module); // Force first letter in uppercase
|
||||
$objectname = $tabobj;
|
||||
@ -450,6 +458,9 @@ if ($dirins && $action == 'initsqlextrafields' && !empty($module)) {
|
||||
}
|
||||
// TODO Enable in class the property $isextrafieldmanaged = 1
|
||||
}
|
||||
|
||||
|
||||
// init Hook
|
||||
if ($dirins && $action == 'inithook' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/class');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -480,6 +491,9 @@ if ($dirins && $action == 'inithook' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init Trigger
|
||||
if ($dirins && $action == 'inittrigger' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/core/triggers');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -510,6 +524,9 @@ if ($dirins && $action == 'inittrigger' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init Widget
|
||||
if ($dirins && $action == 'initwidget' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/core/boxes');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -540,6 +557,9 @@ if ($dirins && $action == 'initwidget' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init CSS
|
||||
if ($dirins && $action == 'initcss' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/css');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -576,6 +596,8 @@ if ($dirins && $action == 'initcss' && !empty($module)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init JS
|
||||
if ($dirins && $action == 'initjs' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/js');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -611,6 +633,9 @@ if ($dirins && $action == 'initjs' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init CLI
|
||||
if ($dirins && $action == 'initcli' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/scripts');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -646,6 +671,9 @@ if ($dirins && $action == 'initcli' && !empty($module)) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $destfile), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// init Doc
|
||||
if ($dirins && $action == 'initdoc' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/doc');
|
||||
$srcdir = DOL_DOCUMENT_ROOT.'/modulebuilder/template';
|
||||
@ -694,6 +722,8 @@ if ($dirins && $action == 'initdoc' && !empty($module)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add Language
|
||||
if ($dirins && $action == 'addlanguage' && !empty($module)) {
|
||||
$newlangcode = GETPOST('newlangcode', 'aZ09');
|
||||
$srcfile = $dirins.'/'.strtolower($module).'/langs/en_US';
|
||||
@ -701,6 +731,8 @@ if ($dirins && $action == 'addlanguage' && !empty($module)) {
|
||||
$result = dolCopyDir($srcfile, $destfile, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
// remove/delete File
|
||||
if ($dirins && $action == 'confirm_removefile' && !empty($module)) {
|
||||
$relativefilename = dol_sanitizePathName(GETPOST('file', 'none'));
|
||||
if ($relativefilename) {
|
||||
@ -726,6 +758,7 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Build the $fields array from SQL table (initfromtablename)
|
||||
if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', 'alpha')) {
|
||||
$tablename = GETPOST('initfromtablename', 'alpha');
|
||||
|
||||
@ -194,7 +194,7 @@ $form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
$title = $langs->trans('Mo');
|
||||
$title = $langs->trans('Mo')." - ".$langs->trans("Card");
|
||||
|
||||
llxHeader('', $title, '');
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -252,7 +252,9 @@ $productlot = new ProductLot($db);
|
||||
$warehousestatic = new Entrepot($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
llxHeader('', $langs->trans('Mo'), '');
|
||||
$help_url = 'EN:Module_Manufacturing_Orders|FR:Module_Ordres_de_Fabrication';
|
||||
|
||||
llxHeader('', $langs->trans('Mo'), $help_url);
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
|
||||
@ -109,7 +109,7 @@ if (empty($reshook)) {
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->label = (string) GETPOST("libelle", "alpha");
|
||||
$object->description = (string) GETPOST("desc", "alpha");
|
||||
$object->statut = GETPOST("statut");
|
||||
$object->statut = GETPOST("statut", "int");
|
||||
$object->lieu = (string) GETPOST("lieu", "alpha");
|
||||
$object->address = (string) GETPOST("address", "alpha");
|
||||
$object->zip = (string) GETPOST("zipcode", "alpha");
|
||||
@ -166,9 +166,9 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Modification entrepot
|
||||
if ($action == 'update' && $cancel <> $langs->trans("Cancel")) {
|
||||
if ($action == 'update' && !$cancel) {
|
||||
if ($object->fetch($id)) {
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->fk_parent = GETPOST("fk_parent");
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->description = GETPOST("desc");
|
||||
@ -178,8 +178,8 @@ if (empty($reshook)) {
|
||||
$object->zip = GETPOST("zipcode");
|
||||
$object->town = GETPOST("town");
|
||||
$object->country_id = GETPOST("country_id");
|
||||
$object->phone = GETPOST("phone");
|
||||
$object->fax = GETPOST("fax");
|
||||
$object->phone = GETPOST("phone");
|
||||
$object->fax = GETPOST("fax");
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
|
||||
@ -1179,7 +1179,7 @@ if ($resql) {
|
||||
$modulepart = 'movement';
|
||||
|
||||
if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id > 0) {
|
||||
print '<br/>';
|
||||
print '<br>';
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
|
||||
@ -611,7 +611,7 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
print '</table><br>';
|
||||
|
||||
|
||||
|
||||
@ -750,7 +750,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br/>';
|
||||
print '</table><br>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -80,8 +80,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_comments.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans('CommentPage');
|
||||
|
||||
llxHeader('', $langs->trans("CommentPage"));
|
||||
llxHeader('', $title, '');
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
@ -239,11 +239,13 @@ if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->pr
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("ProjectContact").' - '.$object->ref.' '.$object->name;
|
||||
$title = $langs->trans('ProjectContact').' - '.$object->ref.' '.$object->name;
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans("ProjectContact");
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans('ProjectContact');
|
||||
}
|
||||
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
|
||||
$help_url = 'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
@ -37,7 +37,7 @@ $action = GETPOST('action', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$mine = (GETPOST('mode', 'alpha') == 'mine' ? 1 : 0);
|
||||
$mine = (GETPOST('mode', 'alpha') == 'mine' ? 1 : 0);
|
||||
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects
|
||||
|
||||
// Security check
|
||||
@ -57,10 +57,10 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
// Get parameters
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
@ -95,11 +95,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("Project").' - '.$langs->trans("Document").' - '.$object->ref.' '.$object->name;
|
||||
$title = $langs->trans('Project').' - '.$langs->trans('Document').' - '.$object->ref.' '.$object->name;
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans("Document");
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans('Document');
|
||||
}
|
||||
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
|
||||
$help_url = 'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
@ -187,12 +187,14 @@ $hookmanager->initHooks(array('projectOverview'));
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("ProjectReferers").' - '.$object->ref.' '.$object->name;
|
||||
$title = $langs->trans('ProjectReferers').' - '.$object->ref.' '.$object->name;
|
||||
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans("ProjectReferers");
|
||||
$title = $object->ref.' '.$object->name.' - '.$langs->trans('ProjectReferers');
|
||||
}
|
||||
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
llxHeader("", $langs->trans("Referers"), $help_url);
|
||||
|
||||
$help_url = 'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
$formproject = new FormProjets($db);
|
||||
|
||||
@ -95,9 +95,14 @@ $projectset = ($mine ? $mine : (empty($user->rights->projet->all->lire) ? 0 : 2)
|
||||
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $projectset, 1);
|
||||
//var_dump($projectsListId);
|
||||
|
||||
llxHeader("", $langs->trans("Projects"), "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos");
|
||||
|
||||
$title = $langs->trans("ProjectsArea");
|
||||
$title = $langs->trans('ProjectsArea');
|
||||
|
||||
$help_url = 'EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
//if ($mine) $title=$langs->trans("MyProjectsArea");
|
||||
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ $reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $acti
|
||||
if ($reshook < 0) {
|
||||
llxHeaderVierge();
|
||||
if (!empty($hookmanager->errors) && is_array($hookmanager->errors)) {
|
||||
print '<div class="error">'.implode('<br/>', $hookmanager->errors).'</div>';
|
||||
print '<div class="error">'.implode('<br>', $hookmanager->errors).'</div>';
|
||||
} else {
|
||||
print '<div class="error">'.$hookmanager->error.'</div>';
|
||||
}
|
||||
|
||||
@ -201,12 +201,12 @@ if (empty($reshook) && $action == 'add') {
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorPasswordsMustMatch")."<br>\n";
|
||||
}
|
||||
if (!GETPOST("email")) {
|
||||
if (!GETPOST('email')) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("EMail"))."<br>\n";
|
||||
}
|
||||
}
|
||||
if (GETPOST('type') <= 0) {
|
||||
if (GETPOST('typeid') <= 0) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type"))."<br>\n";
|
||||
}
|
||||
@ -214,18 +214,18 @@ if (empty($reshook) && $action == 'add') {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv('Nature'))."<br>\n";
|
||||
}
|
||||
if (!GETPOST("lastname")) {
|
||||
if (!GETPOST('lastname')) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."<br>\n";
|
||||
}
|
||||
if (!GETPOST("firstname")) {
|
||||
if (!GETPOST('firstname')) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
|
||||
}
|
||||
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
|
||||
if (GETPOST('email') && !isValidEmail(GETPOST('email'))) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
|
||||
$errmsg .= $langs->trans("ErrorBadEMail", GETPOST('email'))."<br>\n";
|
||||
}
|
||||
$birthday = dol_mktime(GETPOST("birthhour", 'int'), GETPOST("birthmin", 'int'), GETPOST("birthsec", 'int'), GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int'));
|
||||
if (GETPOST("birthmonth") && empty($birthday)) {
|
||||
@ -240,36 +240,32 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
}
|
||||
|
||||
if (GETPOSTISSET('public')) {
|
||||
$public = 1;
|
||||
} else {
|
||||
$public = 0;
|
||||
}
|
||||
$public = GETPOSTISSET('public') ? 1 : 0;
|
||||
|
||||
if (!$error) {
|
||||
// email a peu pres correct et le login n'existe pas
|
||||
$adh = new Adherent($db);
|
||||
$adh->statut = -1;
|
||||
$adh->public = $public;
|
||||
$adh->firstname = GETPOST("firstname");
|
||||
$adh->lastname = GETPOST("lastname");
|
||||
$adh->gender = GETPOST("gender");
|
||||
$adh->civility_id = GETPOST("civility_id");
|
||||
$adh->societe = GETPOST("societe");
|
||||
$adh->address = GETPOST("address");
|
||||
$adh->zip = GETPOST("zipcode");
|
||||
$adh->town = GETPOST("town");
|
||||
$adh->email = GETPOST("email");
|
||||
$adh->firstname = GETPOST('firstname');
|
||||
$adh->lastname = GETPOST('lastname');
|
||||
$adh->gender = GETPOST('gender');
|
||||
$adh->civility_id = GETPOST('civility_id');
|
||||
$adh->societe = GETPOST('societe');
|
||||
$adh->address = GETPOST('address');
|
||||
$adh->zip = GETPOST('zipcode');
|
||||
$adh->town = GETPOST('town');
|
||||
$adh->email = GETPOST('email');
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
$adh->login = GETPOST("login");
|
||||
$adh->pass = GETPOST("pass1");
|
||||
$adh->login = GETPOST('login');
|
||||
$adh->pass = GETPOST('pass1');
|
||||
}
|
||||
$adh->photo = GETPOST("photo");
|
||||
$adh->country_id = GETPOST("country_id", 'int');
|
||||
$adh->state_id = GETPOST("state_id", 'int');
|
||||
$adh->typeid = GETPOST("type", 'int');
|
||||
$adh->note_private = GETPOST("note_private");
|
||||
$adh->morphy = GETPOST("morphy");
|
||||
$adh->photo = GETPOST('photo');
|
||||
$adh->country_id = $conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE ? $conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE : GETPOST('country_id', 'int');
|
||||
$adh->state_id = GETPOST('state_id', 'int');
|
||||
$adh->typeid = $conf->global->MEMBER_NEWFORM_FORCETYPE ? $conf->global->MEMBER_NEWFORM_FORCETYPE : GETPOST('typeid', 'int');
|
||||
$adh->note_private = GETPOST('note_private');
|
||||
$adh->morphy = $conf->global->MEMBER_NEWFORM_FORCEMORPHY ? $conf->global->MEMBER_NEWFORM_FORCEMORPHY : GETPOST('morphy');
|
||||
$adh->birth = $birthday;
|
||||
|
||||
|
||||
@ -551,7 +547,7 @@ jQuery(document).ready(function () {
|
||||
|
||||
print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
|
||||
|
||||
// Type
|
||||
// Type
|
||||
if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
|
||||
$listoftype = $adht->liste_array();
|
||||
$tmp = array_keys($listoftype);
|
||||
@ -562,12 +558,13 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE)) {
|
||||
$isempty = 0;
|
||||
}
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>';
|
||||
print $form->selectarray("type", $adht->liste_array(), GETPOST('type') ?GETPOST('type') : $defaulttype, $isempty);
|
||||
print $form->selectarray("typeid", $adht->liste_array(), GETPOST('typeid') ? GETPOST('typeid') : $defaulttype, $isempty);
|
||||
print '</td></tr>'."\n";
|
||||
} else {
|
||||
$adht->fetch($conf->global->MEMBER_NEWFORM_FORCETYPE);
|
||||
print '<input type="hidden" id="type" name="type" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">';
|
||||
print '<input type="hidden" id="typeid" name="typeid" value="'.$conf->global->MEMBER_NEWFORM_FORCETYPE.'">';
|
||||
}
|
||||
|
||||
// Moral/Physic attribute
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
@ -579,6 +576,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) {
|
||||
print $morphys[$conf->global->MEMBER_NEWFORM_FORCEMORPHY];
|
||||
print '<input type="hidden" id="morphy" name="morphy" value="'.$conf->global->MEMBER_NEWFORM_FORCEMORPHY.'">';
|
||||
}
|
||||
|
||||
// Civility
|
||||
print '<tr><td class="titlefield">'.$langs->trans('UserTitle').'</td><td>';
|
||||
print $formcompany->select_civility(GETPOST('civility_id'), 'civility_id').'</td></tr>'."\n";
|
||||
@ -628,8 +626,6 @@ if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($country_code) {
|
||||
print $formcompany->select_state(GETPOST("state_id"), $country_code);
|
||||
} else {
|
||||
print '';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -650,7 +646,7 @@ print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="ph
|
||||
// Public
|
||||
print '<tr><td>'.$langs->trans("Public").'</td><td><input type="checkbox" name="public"></td></tr>'."\n";
|
||||
// Other attributes
|
||||
$tpl_context = 'public'; // define templae context to public
|
||||
$tpl_context = 'public'; // define template context to public
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
// Comments
|
||||
print '<tr>';
|
||||
@ -658,7 +654,7 @@ print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
|
||||
print '<td class="tdtop"><textarea name="note_private" id="note_private" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note_private', 'restricthtml'), 0, 1).'</textarea></td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Add specific fields used by Dolibarr foundation for example
|
||||
// Add specific fields used by Dolibarr foundation for example
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
|
||||
$arraybudget = array('50'=>'<= 100 000', '100'=>'<= 200 000', '200'=>'<= 500 000', '300'=>'<= 1 500 000', '600'=>'<= 3 000 000', '1000'=>'<= 5 000 000', '2000'=>'5 000 000+');
|
||||
print '<tr id="trbudget" class="trcompany"><td>'.$langs->trans("TurnoverOrBudget").' <FONT COLOR="red">*</FONT></td><td>';
|
||||
@ -675,11 +671,11 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
|
||||
if (jQuery("#budget").val() > 0) { jQuery(".amount").val(jQuery("#budget").val()); }
|
||||
else { jQuery("#budget").val(\'\'); }
|
||||
});
|
||||
/*jQuery("#type").change(function() {
|
||||
if (jQuery("#type").val()==1) { jQuery("#morphy").val(\'mor\'); }
|
||||
if (jQuery("#type").val()==2) { jQuery("#morphy").val(\'phy\'); }
|
||||
if (jQuery("#type").val()==3) { jQuery("#morphy").val(\'mor\'); }
|
||||
if (jQuery("#type").val()==4) { jQuery("#morphy").val(\'mor\'); }
|
||||
/*jQuery("#typeid").change(function() {
|
||||
if (jQuery("#typeid").val()==1) { jQuery("#morphy").val(\'mor\'); }
|
||||
if (jQuery("#typeid").val()==2) { jQuery("#morphy").val(\'phy\'); }
|
||||
if (jQuery("#typeid").val()==3) { jQuery("#morphy").val(\'mor\'); }
|
||||
if (jQuery("#typeid").val()==4) { jQuery("#morphy").val(\'mor\'); }
|
||||
initturnover();
|
||||
});*/
|
||||
function initturnover() {
|
||||
@ -703,13 +699,16 @@ if (!empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) {
|
||||
}
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
|
||||
// $conf->global->MEMBER_NEWFORM_SHOWAMOUNT is an amount
|
||||
$amount = 0;
|
||||
|
||||
// Set amount for the subscription
|
||||
$amount = isset($amount) ? $amount : 0;
|
||||
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT)) {
|
||||
$amount = $conf->global->MEMBER_NEWFORM_AMOUNT;
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) {
|
||||
$amount = GETPOST('amount') ?GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT;
|
||||
$amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT);
|
||||
}
|
||||
// $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe'
|
||||
print '<tr><td>'.$langs->trans("Subscription").'</td><td class="nowrap">';
|
||||
|
||||
@ -213,10 +213,11 @@ if ($action == 'add' && empty($cancel)) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->begin();
|
||||
|
||||
$ret = $object->create($user);
|
||||
if ($ret < 0) $error++;
|
||||
if (!empty($auto_create_paiement) && !$error) {
|
||||
$db->begin();
|
||||
// Create a line of payments
|
||||
$paiement = new PaymentSalary($db);
|
||||
$paiement->chid = $object->id;
|
||||
@ -243,15 +244,11 @@ if ($action == 'add' && empty($cancel)) {
|
||||
setEventMessages($paiement->error, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$db->commit();
|
||||
|
||||
if (GETPOST('saveandnew', 'alpha')) {
|
||||
setEventMessages($langs->trans("RecordSaved"), '', 'mesgs');
|
||||
header("Location: card.php?action=create&fk_project=" . urlencode($projectid) . "&accountid=" . urlencode($accountid) . '&paymenttype=' . urlencode(GETPOST('paymenttype', 'az09')) . '&datepday=' . GETPOST("datepday", 'int') . '&datepmonth=' . GETPOST("datepmonth", 'int') . '&datepyear=' . GETPOST("datepyear", 'int'));
|
||||
@ -260,6 +257,8 @@ if ($action == 'add' && empty($cancel)) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $object->id);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
@ -526,10 +525,12 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Bouton Save payment
|
||||
/* print '<tr class="hide_if_no_auto_create_payment"><td>';
|
||||
/*
|
||||
print '<tr class="hide_if_no_auto_create_payment"><td>';
|
||||
print $langs->trans("ClosePaidSalaryAutomatically");
|
||||
print '</td><td><input type="checkbox" checked value="1" name="closepaidsalary"></td></tr>';
|
||||
*/
|
||||
*/
|
||||
|
||||
// Other attributes
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@ -498,6 +498,12 @@ class Salary extends CommonObject
|
||||
$label = '<u>'.$langs->trans("Salary").'</u>';
|
||||
$label .= '<br>';
|
||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if ($this->label) {
|
||||
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
|
||||
}
|
||||
if ($this->datesp && $this->dateep) {
|
||||
$label .= '<br><b>'.$langs->trans('Period').':</b> '.dol_print_date($this->datesp, 'day').' - '.dol_print_date($this->dateep, 'day');
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id;
|
||||
|
||||
@ -647,9 +653,9 @@ class Salary extends CommonObject
|
||||
/**
|
||||
* Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
|
||||
* @return string Libelle
|
||||
* @return string Label
|
||||
*/
|
||||
public function getLibStatut($mode = 0, $alreadypaid = -1)
|
||||
{
|
||||
|
||||
@ -123,8 +123,23 @@ if ($object->id) {
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.dol_print_size($totalsize, 1, 1).'</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td class="titlefield">' . $langs->trans("DateStartPeriod") . '</td><td>';
|
||||
print dol_print_date($object->datesp, 'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td>' . $langs->trans("DateEndPeriod") . '</td><td>';
|
||||
print dol_print_date($object->dateep, 'day');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>' . $langs->trans("Amount") . '</td><td>' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td>'.count($filearray).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'.dol_print_size($totalsize, 1, 1).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -532,6 +532,10 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
|
||||
$salstatic->id = $obj->rowid;
|
||||
$salstatic->ref = $obj->rowid;
|
||||
$salstatic->label = $obj->label;
|
||||
$salstatic->paye = $obj->paye;
|
||||
$salstatic->datesp = $db->jdate($obj->datesp);
|
||||
$salstatic->dateep = $db->jdate($obj->dateep);
|
||||
|
||||
// Show here line of result
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -260,7 +260,7 @@ if (empty($conf->stripeconnect->enabled)) {
|
||||
print'</td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("StripeConnect").'</td>';
|
||||
print '<td><b>'.$langs->trans("StripeConnect_Mode").'</b><br/>';
|
||||
print '<td><b>'.$langs->trans("StripeConnect_Mode").'</b><br>';
|
||||
print $langs->trans("STRIPE_APPLICATION_FEE_PLATFORM").' ';
|
||||
print price($conf->global->STRIPE_APPLICATION_FEE_PERCENT);
|
||||
print '% + ';
|
||||
|
||||
@ -78,7 +78,7 @@ if ($action == 'addcontact' && $permissiontoedit) {
|
||||
if ($object->fetch($id)) {
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'deletecontact' && $permissiontoedit) {
|
||||
// Deleting a contact
|
||||
@ -89,7 +89,7 @@ if ($action == 'addcontact' && $permissiontoedit) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -279,6 +279,11 @@ div.pagination li:first-child a.btnTitle{
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.button-title-separator{
|
||||
display: inline-block;
|
||||
clear: both;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.imgforviewmode {
|
||||
color: #aaa;
|
||||
|
||||
@ -9,10 +9,14 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
* -------------------
|
||||
*/
|
||||
|
||||
.info-box-module-external span.info-box-icon-version {
|
||||
.info-box-module.--external span.info-box-icon-version {
|
||||
background: #bbb;
|
||||
}
|
||||
|
||||
.info-box-module.--external.--need-update span.info-box-icon-version{
|
||||
background: #bc9525;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
display: block;
|
||||
position: relative;
|
||||
@ -153,7 +157,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
-webkit-transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
.box-flex-item.info-box-module.info-box-module-disabled {
|
||||
.box-flex-item.info-box-module.--disabled {
|
||||
/* opacity: 0.6; */
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
}
|
||||
|
||||
|
||||
.info-box-module-external span.info-box-icon-version {
|
||||
.info-box-module.--external span.info-box-icon-version {
|
||||
background: #bbb;
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ a.info-box-text-a i.fa.fa-exclamation-triangle {
|
||||
transition: opacity 0.5s, visibility 0s 0.5s;
|
||||
}
|
||||
|
||||
.box-flex-item.info-box-module.info-box-module-disabled {
|
||||
.box-flex-item.info-box-module.--disabled {
|
||||
/* opacity: 0.6; */
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +40,7 @@ if (!empty($conf->expensereport->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
}
|
||||
if (!empty($conf->salaries->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php';
|
||||
}
|
||||
|
||||
@ -354,16 +355,18 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
||||
|
||||
// Latest payments of salaries
|
||||
if (!empty($conf->salaries->enabled) &&
|
||||
$user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)
|
||||
(($user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)) || (!empty($user->rights->salaries->readall)))
|
||||
) {
|
||||
$payment_salary = new PaymentSalary($db);
|
||||
$salary = new Salary($db);
|
||||
|
||||
$sql = "SELECT ps.rowid, s.datesp, s.dateep, ps.amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as ps";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON (s.rowid = ps.fk_salary)";
|
||||
$sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, SUM(ps.amount) as alreadypaid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (s.rowid = ps.fk_salary)";
|
||||
$sql .= " WHERE s.fk_user = ".$object->id;
|
||||
$sql .= " AND ps.entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY ps.rowid DESC";
|
||||
$sql .= " AND s.entity IN (".getEntity('salary').")";
|
||||
$sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye";
|
||||
$sql .= " ORDER BY s.dateep DESC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
@ -372,7 +375,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/salaries/payments.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/salaries/list.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -380,16 +383,26 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
|
||||
while ($i < $num && $i < $MAXLIST) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$payment_salary->id = $objp->rowid;
|
||||
$payment_salary->ref = $objp->ref;
|
||||
$payment_salary->datep = $db->jdate($objp->datep);
|
||||
|
||||
$salary->id = $objp->sid;
|
||||
$salary->ref = $objp->sref ? $objp->sref : $objp->sid;
|
||||
$salary->label = $objp->label;
|
||||
$salary->datesp = $db->jdate($objp->datesp);
|
||||
$salary->dateep = $db->jdate($objp->dateep);
|
||||
$salary->paye = $objp->paye;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowraponall">';
|
||||
$payment_salary->id = $objp->rowid;
|
||||
$payment_salary->ref = $objp->rowid;
|
||||
print $payment_salary->getNomUrl(1);
|
||||
print $salary->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->datesp), 'day')."</td>\n";
|
||||
print '<td class="right" width="80px">'.dol_print_date($db->jdate($objp->dateep), 'day')."</td>\n";
|
||||
print '<td class="right" style="min-width: 60px">'.price($objp->amount).'</td>';
|
||||
//print '<td class="right" class="nowraponall"><span class="ampount">'.price($objp->amount).'</span></td>';
|
||||
print '<td class="right" class="nowraponall">'.$salary->getLibStatut(5, $objp->alreadypaid).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -2250,7 +2250,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
|
||||
|
||||
// Address
|
||||
print '<tr><td class="tdtop titlefield">'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
|
||||
print '<tr><td class="tdtop titlefieldcreate">'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield) {
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="3" wrap="soft">';
|
||||
@ -2391,7 +2391,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
// Accountancy code
|
||||
if ($conf->accounting->enabled) {
|
||||
print "<tr>";
|
||||
print '<td class="titlefield">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("AccountancyCode").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield) {
|
||||
print '<input size="30" type="text" class="flat" name="accountancy_code" value="'.$object->accountancy_code.'">';
|
||||
@ -2405,7 +2405,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
|
||||
// User color
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
print '<tr><td>'.$langs->trans("ColorUser").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("ColorUser").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield) {
|
||||
print $formother->selectColor(GETPOSTISSET('color') ?GETPOST('color', 'alphanohtml') : $object->color, 'color', null, 1, '', 'hideifnotset');
|
||||
@ -2417,7 +2417,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
|
||||
// Photo
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Photo").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Photo").'</td>';
|
||||
print '<td>';
|
||||
print $form->showphoto('userphoto', $object, 60, 0, $caneditfield, 'photowithmargin', 'small', 1, 0, 'user', 1);
|
||||
print '</td>';
|
||||
@ -2535,21 +2535,26 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table><hr><table class="border centpercent">';
|
||||
print '</table>';
|
||||
|
||||
print '<hr>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
|
||||
// TODO Move this into tab RH (HierarchicalResponsible must be on both tab)
|
||||
|
||||
// Default warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
||||
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DefaultWarehouse").'</td><td>';
|
||||
print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddWarehouse").'"></span></a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Position/Job
|
||||
print '<tr><td class="titlefield">'.$langs->trans("PostOrFunction").'</td>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("PostOrFunction").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield) {
|
||||
print '<input size="30" type="text" name="job" value="'.dol_escape_htmltag($object->job).'">';
|
||||
|
||||
@ -595,7 +595,7 @@ $moreforfilter = '';
|
||||
// Filter on categories
|
||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('Categories').': ';
|
||||
$moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="paddingright"');
|
||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1);
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
@ -724,7 +724,7 @@ if (!empty($arrayfields['u.gender']['checked'])) {
|
||||
print_liste_field_titre("Gender", $_SERVER['PHP_SELF'], "u.gender", $param, "", "", $sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($arrayfields['u.employee']['checked'])) {
|
||||
print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.employee", $param, "", "", $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['u.fk_user']['checked'])) {
|
||||
print_liste_field_titre("HierarchicalResponsible", $_SERVER['PHP_SELF'], "u.fk_user", $param, "", "", $sortfield, $sortorder);
|
||||
@ -822,6 +822,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$li = $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (!empty($arrayfields['u.login']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
print $li;
|
||||
@ -836,13 +837,13 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['u.lastname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150">'.$obj->lastname.'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'.dol_escape_htmltag($obj->lastname).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['u.firstname']['checked'])) {
|
||||
print '<td class="tdoverflowmax150">'.$obj->firstname.'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'.dol_escape_htmltag($obj->firstname).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -858,7 +859,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['u.employee']['checked'])) {
|
||||
print '<td>'.yn($obj->employee).'</td>';
|
||||
print '<td class="center">'.yn($obj->employee).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -1091,6 +1091,12 @@ class Website extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$line .= "\n-- For Dolibarr v14+ --\n";
|
||||
$line .= "UPDATE llx_website SET fk_default_lang = '".$this->db->escape($this->fk_default_lang)."' WHERE rowid = __WEBSITE_ID__;\n";
|
||||
$line .= "UPDATE llx_website SET otherlang = '".$this->db->escape($this->otherlang)."' WHERE rowid = __WEBSITE_ID__;\n";
|
||||
$line .= "\n";
|
||||
fputs($fp, $line);
|
||||
|
||||
fclose($fp);
|
||||
if (!empty($conf->global->MAIN_UMASK)) {
|
||||
@chmod($filesql, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
@ -1362,7 +1362,11 @@ if ($action == 'updatecss' && $usercanedit) {
|
||||
}
|
||||
$filetoread = realpath(dol_osencode($_FILES['addedfile']['tmp_name']));
|
||||
$filesize = getimagesize($filetoread);
|
||||
if ($filesize[0] != 32 || $filesize[1] != 32) {
|
||||
if ($filesize[0] != $filesize[1]) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors');
|
||||
}
|
||||
if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
|
||||
}
|
||||
@ -2250,15 +2254,23 @@ $tempdir = $conf->website->dir_output.'/'.$websitekey.'/';
|
||||
// Generate web site sitemaps
|
||||
if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$domtree = new DOMDocument('1.0', 'UTF-8');
|
||||
|
||||
$root = $domtree->createElementNS('http://www.sitemaps.org/schemas/sitemap/0.9', 'urlset');
|
||||
$root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
|
||||
|
||||
$domtree->formatOutput = true;
|
||||
|
||||
$xmlname = 'sitemap.'.$websitekey.'.xml';
|
||||
|
||||
$sql = "SELECT wp.type_container , wp.pageurl, wp.lang, wp.tms as tms, w.virtualhost";
|
||||
$sql = "SELECT wp.rowid, wp.type_container , wp.pageurl, wp.lang, wp.fk_page, wp.tms as tms,";
|
||||
$sql .= " w.virtualhost, w.fk_default_home";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."website_page as wp, ".MAIN_DB_PREFIX."website as w";
|
||||
$sql .= " WHERE wp.type_container IN ('page', 'blogpost')";
|
||||
$sql .= " AND wp.fk_website = w.rowid";
|
||||
$sql .= " AND wp.status = ".WebsitePage::STATUS_VALIDATED;
|
||||
$sql .= " AND wp.pageurl NOT IN ('404', '500', '501', '503')";
|
||||
$sql .= " AND w.ref = '".dol_escape_json($websitekey)."'";
|
||||
$sql .= " ORDER BY wp.tms DESC, wp.rowid DESC";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num_rows = $db->num_rows($resql);
|
||||
@ -2267,18 +2279,115 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
while ($i < $num_rows) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
$url = $domtree->createElement('url');
|
||||
$pageurl = $objp->pageurl;
|
||||
|
||||
$shortlangcode = '';
|
||||
if ($objp->lang) {
|
||||
$pageurl = $objp->lang.'/'.$pageurl;
|
||||
$shortlangcode = substr($objp->lang, 0, 2); // en_US or en-US -> en
|
||||
}
|
||||
if (empty($shortlangcode)) {
|
||||
$shortlangcode = substr($object->lang, 0, 2); // en_US or en-US -> en
|
||||
}
|
||||
|
||||
// Forge $pageurl, adding language prefix if it is an alternative language
|
||||
$pageurl = $objp->pageurl.'.php';
|
||||
if ($objp->fk_default_home == $objp->rowid) {
|
||||
$pageurl = '';
|
||||
} else {
|
||||
if ($shortlangcode != substr($object->lang, 0, 2)) {
|
||||
$pageurl = $shortlangcode.'/'.$pageurl;
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->virtualhost) {
|
||||
$domainname = $objp->virtualhost;
|
||||
}
|
||||
$loc = $domtree->createElement('loc', 'http://'.$domainname.'/'.$pageurl);
|
||||
$lastmod = $domtree->createElement('lastmod', $db->jdate($objp->tms));
|
||||
if (! preg_match('/^http/i', $domainname)) {
|
||||
$domainname .= 'https://'.$domainname;
|
||||
}
|
||||
//$pathofpage = $dolibarr_main_url_root.'/'.$pageurl.'.php';
|
||||
|
||||
// URL of sitemaps must end with trailing slash if page is ''
|
||||
$loc = $domtree->createElement('loc', $domainname.'/'.$pageurl);
|
||||
$lastmod = $domtree->createElement('lastmod', dol_print_date($db->jdate($objp->tms), 'dayrfc', 'gmt'));
|
||||
$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
|
||||
$priority = $domtree->createElement('priority', '1');
|
||||
|
||||
$url->appendChild($loc);
|
||||
$url->appendChild($lastmod);
|
||||
// Add suggested frequency for refresh
|
||||
if (!empty($conf->global->WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ)) {
|
||||
$url->appendChild($changefreq);
|
||||
}
|
||||
// Add higher priority for home page
|
||||
if ($objp->fk_default_home == $objp->rowid) {
|
||||
$url->appendChild($priority);
|
||||
}
|
||||
|
||||
// Now add alternate language entries
|
||||
if ($object->isMultiLang()) {
|
||||
$alternatefound = 0;
|
||||
|
||||
// Add page "translation of"
|
||||
$translationof = $objp->fk_page;
|
||||
if ($translationof) {
|
||||
$tmppage = new WebsitePage($db);
|
||||
$tmppage->fetch($translationof);
|
||||
if ($tmppage->id > 0) {
|
||||
$tmpshortlangcode = '';
|
||||
if ($tmppage->lang) {
|
||||
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $tmppage->lang); // en_US or en-US -> en
|
||||
}
|
||||
if (empty($tmpshortlangcode)) {
|
||||
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $object->lang); // en_US or en-US -> en
|
||||
}
|
||||
if ($tmpshortlangcode != $shortlangcode) {
|
||||
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
||||
$xhtmllink->setAttribute("rel", "alternante");
|
||||
$xhtmllink->setAttribute("hreflang", $tmpshortlangcode);
|
||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $tmppage->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2)) ? '/'.$tmpshortlangcode : '').'/'.$tmppage->pageurl.'.php'));
|
||||
$url->appendChild($xhtmllink);
|
||||
|
||||
$alternatefound++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add "has translation pages"
|
||||
$sql = 'SELECT rowid as id, lang, pageurl from '.MAIN_DB_PREFIX.'website_page where fk_page IN ('.$db->sanitize($objp->rowid.($translationof ? ', '.$translationof : '')).")";
|
||||
$resqlhastrans = $db->query($sql);
|
||||
if ($resqlhastrans) {
|
||||
$num_rows_hastrans = $db->num_rows($resqlhastrans);
|
||||
if ($num_rows_hastrans > 0) {
|
||||
while ($objhastrans = $db->fetch_object($resqlhastrans)) {
|
||||
$tmpshortlangcode = '';
|
||||
if ($objhastrans->lang) {
|
||||
$tmpshortlangcode = preg_replace('/[_-].*$/', '', $objhastrans->lang); // en_US or en-US -> en
|
||||
}
|
||||
if ($tmpshortlangcode != $shortlangcode) {
|
||||
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
||||
$xhtmllink->setAttribute("rel", "alternate");
|
||||
$xhtmllink->setAttribute("hreflang", $tmpshortlangcode);
|
||||
$xhtmllink->setAttribute("href", $domainname.($objp->fk_default_home == $objhastrans->id ? '/' : (($tmpshortlangcode != substr($objp->lang, 0, 2) ? '/'.$tmpshortlangcode : '')).'/'.$objhastrans->pageurl.'.php'));
|
||||
$url->appendChild($xhtmllink);
|
||||
|
||||
$alternatefound++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if ($alternatefound) {
|
||||
// Add myself
|
||||
$xhtmllink = $domtree->createElement('xhtml:link', '');
|
||||
$xhtmllink->setAttribute("rel", "alternate");
|
||||
$xhtmllink->setAttribute("hreflang", $shortlangcode);
|
||||
$xhtmllink->setAttribute("href", $domainname.'/'.$pageurl);
|
||||
$url->appendChild($xhtmllink);
|
||||
}
|
||||
}
|
||||
|
||||
$root->appendChild($url);
|
||||
$i++;
|
||||
}
|
||||
@ -2295,6 +2404,8 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// Add the entry Sitemap: into the robot file.
|
||||
$robotcontent = @file_get_contents($filerobot);
|
||||
$result = preg_replace('/<?php // BEGIN PHP[^?]END PHP ?>\n/ims', '', $robotcontent);
|
||||
if ($result) {
|
||||
@ -3199,7 +3310,7 @@ if ($action == 'editcss') {
|
||||
|
||||
print $form->textwithpicto($langs->trans('Virtualhost'), $htmltext, 1, 'help', '', 0, 2, 'virtualhosttooltip');
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="flat" value="'.(GETPOSTISSET('virtualhost') ? GETPOST('virtualhost', 'alpha') : $virtualurl).'" name="virtualhost">';
|
||||
print '<input type="text" class="flat minwidth300" value="'.(GETPOSTISSET('virtualhost') ? GETPOST('virtualhost', 'alpha') : $virtualurl).'" name="virtualhost">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -4113,7 +4224,7 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
|
||||
print getTitleFieldOfList("Type", 0, $_SERVER['PHP_SELF'], 'type_container', '', $param, '', $sortfield, $sortorder, '')."\n";
|
||||
print getTitleFieldOfList("Page", 0, $_SERVER['PHP_SELF'], 'pageurl', '', $param, '', $sortfield, $sortorder, '')."\n";
|
||||
print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF']);
|
||||
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
|
||||
print getTitleFieldOfList("Language", 0, $_SERVER['PHP_SELF'], 'lang', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
|
||||
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
|
||||
print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif
|
||||
print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
|
||||
@ -4171,8 +4282,8 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
|
||||
$param .= '&searchstring='.urlencode($searchkey);
|
||||
|
||||
// Language
|
||||
print '<td>';
|
||||
print $answerrecord->lang;
|
||||
print '<td class="center">';
|
||||
print picto_from_langcode($answerrecord->lang, $answerrecord->lang);
|
||||
print '</td>';
|
||||
|
||||
// Number of words
|
||||
|
||||
@ -36,6 +36,10 @@ if (empty($user->id)) {
|
||||
}
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
|
||||
print "\n".$langs->trans("CurrentTimeZone").' : '.getServerTimeZoneString();
|
||||
print "\n".$langs->trans("CurrentHour").' : '.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver');
|
||||
print "\n";
|
||||
|
||||
|
||||
/**
|
||||
* Class for PHPUnit tests
|
||||
@ -72,9 +76,6 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
|
||||
print "\n".$langs->trans("CurrentTimeZone").' : '.getServerTimeZoneString();
|
||||
print "\n".$langs->trans("CurrentHour").' : '.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver');
|
||||
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
@ -490,5 +491,30 @@ class DateLibTest extends PHPUnit\Framework\TestCase
|
||||
$conf->global->MAIN_START_WEEK = 0; // start on sunday
|
||||
$prev = dol_get_first_day_week($day, $month, $year);
|
||||
$this->assertEquals(1, (int) $prev['first_day']); // sunday for month 2, year 2015 is the 1st
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testDolGetFirstHour
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function testDolGetFirstHour()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$now = 1800 + (24 * 3600 * 10); // The 11th of january 1970 at 0:30 in UTC
|
||||
$result = dol_get_first_hour($now, 'gmt');
|
||||
print __METHOD__." now = ".$now.", dol_print_date(now, 'dayhourrfc', 'gmt') = ".dol_print_date($now, 'dayhourrfc', 'gmt').", result = ".$result.", dol_print_date(result, 'dayhourrfc', 'gmt') = ".dol_print_date($result, 'dayhourrfc', 'gmt')."\n";
|
||||
$this->assertEquals('1970-01-11T00:00:00Z', dol_print_date($result, 'dayhourrfc', 'gmt')); // monday for month 2, year 2014 is the 2
|
||||
|
||||
$now = 23.5 * 3600 + (24 * 3600 * 10); // The 11th of january 1970 at 23:30 in UTC
|
||||
$result = dol_get_first_hour($now, 'gmt');
|
||||
print __METHOD__." now = ".$now.", dol_print_date(now, 'dayhourrfc', 'gmt') = ".dol_print_date($now, 'dayhourrfc', 'gmt').", result = ".$result.", dol_print_date(result, 'dayhourrfc', 'gmt') = ".dol_print_date($result, 'dayhourrfc', 'gmt')."\n";
|
||||
$this->assertEquals('1970-01-11T00:00:00Z', dol_print_date($result, 'dayhourrfc', 'gmt')); // monday for month 2, year 2014 is the 2
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -614,9 +614,9 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
||||
$this->assertEquals($genpass2, '');
|
||||
|
||||
$conf->global->USER_PASSWORD_GENERATED='Standard';
|
||||
$genpass3=getRandomPassword(false); // Should return a password of 10 chars
|
||||
$genpass3=getRandomPassword(false); // Should return a password of 12 chars
|
||||
print __METHOD__." genpass3=".$genpass3."\n";
|
||||
$this->assertEquals(strlen($genpass3), 10);
|
||||
$this->assertEquals(strlen($genpass3), 12);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user