Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2018-08-28 02:36:15 +02:00
commit 9c6ce4b29d
124 changed files with 979 additions and 1021 deletions

View File

@ -216,7 +216,7 @@ before_script:
- | - |
export CONF_FILE=htdocs/conf/conf.php export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE" echo "Setting up Dolibarr $CONF_FILE"
echo '<?php ' > $CONF_FILE echo '<?php' > $CONF_FILE
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE

View File

@ -158,6 +158,22 @@
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" /> <rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<!-- Rules from PEAR Standard --> <!-- Rules from PEAR Standard -->

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/accountancy/admin/importaccounts.php * \file htdocs/accountancy/admin/importaccounts.php
* \ingroup Advanced accountancy * \ingroup Advanced accountancy
* \brief Page import accounting account * \brief Page import accounting account
*/ */

View File

@ -188,7 +188,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
{ {
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','aZ09'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','aZ09'),'chaine',0,'',$conf->entity);
} }
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity); dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity);
} }
if($_POST["optionlocaltax2"]=="localtax2on") if($_POST["optionlocaltax2"]=="localtax2on")
{ {
@ -200,7 +200,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
{ {
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','aZ09'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','aZ09'),'chaine',0,'',$conf->entity);
} }
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity);
} }
if ($action != 'updateedit' && ! $error) if ($action != 'updateedit' && ! $error)

View File

@ -385,7 +385,7 @@ class PrestaShopWebservice
else else
throw new PrestaShopWebserviceException('Bad parameters given'); throw new PrestaShopWebserviceException('Bad parameters given');
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml)); $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => $xml));
self::checkStatusCode($request['status_code']);// check the response validity self::checkStatusCode($request['status_code']);// check the response validity
return self::parseXML($request['response']); return self::parseXML($request['response']);
} }

View File

@ -79,10 +79,10 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK
if ($action == 'update') if ($action == 'update')
{ {
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
@ -133,21 +133,21 @@ if ($action == 'update')
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
$varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
if ($_FILES[$varforimage]["tmp_name"]) if ($_FILES[$varforimage]["tmp_name"])

View File

@ -80,9 +80,9 @@ if ($action == 'setvalue' && $user->admin)
if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"),'chaine',0,'',$conf->entity)) $error++;
// Subscriptions // Subscriptions
if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT',GETPOST("fieldfirstsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT',GETPOST("fieldfirstsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++;
if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++;
// This one must be after the others // This one must be after the others

View File

@ -66,11 +66,11 @@ if ($action == 'update')
if (! $error) if (! $error)
{ {
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;

View File

@ -65,27 +65,27 @@ complete_substitutions_array($substitutionarrayfortest, $langs);
if ($action == 'update' && empty($_POST["cancel"])) if ($action == 'update' && empty($_POST["cancel"]))
{ {
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT"), 'chaine', 0, '', $conf->entity);
// Send mode parameters // Send mode parameters
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY"), 'chaine', 0, '', $conf->entity);
// Content parameters // Content parameters
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'), 'chaine', 0, '', $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;

View File

@ -61,12 +61,12 @@ complete_substitutions_array($substitutionarrayfortest, $langs);
if ($action == 'update' && empty($_POST["cancel"])) if ($action == 'update' && empty($_POST["cancel"]))
{ {
// Send mode parameters // Send mode parameters
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"),'chaine',0,'',$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");

View File

@ -64,10 +64,10 @@ if ($action == 'update' && ! $cancel)
{ {
$_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer $_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer
dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity);
// Define list of menu handlers to initialize // Define list of menu handlers to initialize

View File

@ -54,29 +54,29 @@ if ($cancel) {
if ($action == 'update') if ($action == 'update')
{ {
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", $_POST["MAIN_PDF_MARGIN_BOTTOM"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", $_POST["MAIN_PDF_MARGIN_BOTTOM"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'', $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;

View File

@ -436,14 +436,14 @@ if ($mode == 'template' && $user->admin)
} }
// to remove after test // to remove after test
$object=new stdClass(); // $object=new stdClass();
$object->date_time = '2015-11-02 22:30:25'; // $object->date_time = '2015-11-02 22:30:25';
$object->id = 1234; // $object->id = 1234;
$object->customer_firstname = 'John'; // $object->customer_firstname = 'John';
$object->customer_lastname = 'Deuf'; // $object->customer_lastname = 'Deuf';
$object->vendor_firstname = 'Jim'; // $object->vendor_firstname = 'Jim';
$object->vendor_lastname = 'Big'; // $object->vendor_lastname = 'Big';
$object->barcode = '3700123862396'; // $object->barcode = '3700123862396';
//$printer->sendToPrinter($object, 1, 16); //$printer->sendToPrinter($object, 1, 16);
//setEventMessages($printer->error, $printer->errors, 'errors'); //setEventMessages($printer->error, $printer->errors, 'errors');

View File

@ -48,12 +48,12 @@ $action=GETPOST('action','aZ09');
if ($action == 'update' && empty($_POST["cancel"])) if ($action == 'update' && empty($_POST["cancel"]))
{ {
dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", $_POST["MAIN_DISABLE_ALL_SMS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", $_POST["MAIN_DISABLE_ALL_SMS"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SMS_SENDMODE", $_POST["MAIN_SMS_SENDMODE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SMS_SENDMODE", $_POST["MAIN_SMS_SENDMODE"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", $_POST["MAIN_MAIL_SMS_FROM"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", $_POST["MAIN_MAIL_SMS_FROM"], 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); //dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"], 'chaine', 0, '', $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit; exit;

View File

@ -1692,4 +1692,3 @@ class ActionComm extends CommonObject
} }
} }

View File

@ -326,8 +326,6 @@ if ($object->fetch($id) >= 0)
} }
// Si le module mailing est qualifie // Si le module mailing est qualifie
if ($qualified)
{
if ($allowaddtarget) if ($allowaddtarget)
{ {
print '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">'; print '<form class="oddeven tagtr" name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';

View File

@ -16,9 +16,9 @@
*/ */
/** /**
* \file comm/mailing/class/html.formadvtragetemaling.class.php * \file comm/mailing/class/html.formadvtargetemailing.class.php
* \ingroup mailing * \ingroup mailing
* \brief Fichier de la classe des fonctions predefinie de composants html advtargetemaling * \brief Fichier de la classe des fonctions predefinies de composant html advtargetemailing
*/ */
/** /**

View File

@ -1864,7 +1864,7 @@ abstract class CommonObject
case 'order_supplier': case 'order_supplier':
$this->updateline( $this->updateline(
$line->id, ($line->description?$line->description:$line->desc), $line->subprice, $line->qty, $line->remise_percent, $line->id, ($line->description?$line->description:$line->desc), $line->subprice, $line->qty, $line->remise_percent,
$line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false,
$line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice
); );
break; break;

View File

@ -94,4 +94,3 @@ abstract class CommonObjectLine extends CommonObject
// For the moment we use the extends on CommonObject until PHP min is 5.4 so use Traits. // For the moment we use the extends on CommonObject until PHP min is 5.4 so use Traits.
} }

View File

@ -146,4 +146,3 @@ class FormPropal
print '</select>'; print '</select>';
} }
} }

View File

@ -281,5 +281,3 @@ function updateTotal(days,mode)
jQuery('.totalDay'+days).text(total); jQuery('.totalDay'+days).text(total);
} }
} }

View File

@ -191,5 +191,3 @@ function invoice_rec_prepare_head($object)
return $head; return $head;
} }

View File

@ -343,5 +343,3 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir='',
return $error ? -1 : 1; return $error ? -1 : 1;
} }

View File

@ -520,4 +520,3 @@ function quotedPrintDecode($str)
$out = quoted_printable_decode($out); // Available with PHP 4+ $out = quoted_printable_decode($out); // Available with PHP 4+
return trim($out); return trim($out);
} }

View File

@ -173,4 +173,3 @@ class modPhpbarcode extends ModeleBarCode
} }
} }

View File

@ -215,4 +215,3 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
return -1; return -1;
} }
} }

View File

@ -721,4 +721,3 @@ class pdf_strato extends ModelePDFContract
} }
} }

View File

@ -1100,4 +1100,3 @@ class pdf_rouget extends ModelePdfExpedition
} }
} }

View File

@ -919,4 +919,3 @@ class pdf_standard extends ModeleExpenseReport
} }
} }

View File

@ -1843,4 +1843,3 @@ class pdf_crabe extends ModelePDFFactures
} }
} }

View File

@ -732,4 +732,3 @@ class pdf_soleil extends ModelePDFFicheinter
} }
} }

View File

@ -771,5 +771,3 @@ function cleansep($value)
{ {
return str_replace(array(',',';'),'/',$value); return str_replace(array(',',';'),'/',$value);
}; };

View File

@ -953,4 +953,3 @@ class pdf_typhon extends ModelePDFDeliveryOrder
} }
} }

View File

@ -148,4 +148,3 @@ class mailing_example extends MailingTargets
} }
} }

View File

@ -225,4 +225,3 @@ class mailing_pomme extends MailingTargets
} }
} }

View File

@ -77,7 +77,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
* @param int $y y position in user units * @param int $y y position in user units
* @param int $w width in user units * @param int $w width in user units
* @param int $h height in user units * @param int $h height in user units
* @return void * @return void
*/ */
private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h) private function writeBarcode(&$pdf, $code, $encoding, $is2d, $x, $y, $w, $h)
{ {

View File

@ -1691,4 +1691,3 @@ class pdf_azur extends ModelePDFPropales
return ($tab_hl*7); return ($tab_hl*7);
} }
} }

View File

@ -1147,4 +1147,3 @@ class pdf_standard extends ModelePDFStock
} }
} }

View File

@ -1249,4 +1249,3 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
} }
} }

View File

@ -814,4 +814,3 @@ class pdf_standard extends ModelePDFSuppliersPayments
} }
} }

View File

@ -1496,4 +1496,3 @@ class pdf_aurore extends ModelePDFSupplierProposal
} }
} }

View File

@ -155,12 +155,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
if ($mailfile->error) if ($mailfile->error) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
} }
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {

View File

@ -148,7 +148,6 @@ if ($resql)
{ {
if (! $conf->use_javascript_ajax) if (! $conf->use_javascript_ajax)
{ {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>'; print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>';
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' '; print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';

View File

@ -350,9 +350,7 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child; $idprod = $res->fk_product_child;
} } else {
else
{
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++; $error ++;
} }

View File

@ -1160,9 +1160,7 @@ if (empty($reshook))
if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) {
$idprod = $res->fk_product_child; $idprod = $res->fk_product_child;
} } else {
else
{
setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors');
$error ++; $error ++;
} }

View File

@ -819,7 +819,6 @@ if ($resql)
if ($num > 0) if ($num > 0)
{ {
$i=0; $i=0;
$totalarray=array(); $totalarray=array();
while ($i < min($num,$limit)) while ($i < min($num,$limit))
{ {

View File

@ -146,6 +146,7 @@ if ($year)
print '<td align="right">'.$langs->trans("Size").'</td>'; print '<td align="right">'.$langs->trans("Size").'</td>';
print '<td align="right">'.$langs->trans("Date").'</td>'; print '<td align="right">'.$langs->trans("Date").'</td>';
print '</tr>'; print '</tr>';
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) while (($file = readdir($handle))!==false)

View File

@ -422,13 +422,14 @@ class MultiCurrency extends CommonObject
} }
} }
/** /**
* Try get label of code in llx_currency then add rate * Try get label of code in llx_currency then add rate.
* *
* @param string $code currency code * @param string $code currency code
* @param double $rate new rate * @param double $rate new rate
* @return int -1 if KO, 1 if OK, 2 if label found and OK *
*/ * @return int -1 if KO, 1 if OK, 2 if label found and OK
*/
function addRateFromDolibarr($code, $rate) function addRateFromDolibarr($code, $rate)
{ {
global $db, $user; global $db, $user;
@ -457,7 +458,7 @@ class MultiCurrency extends CommonObject
return -1; return -1;
} }
/** /**
* Add new entry into llx_multicurrency_rate to historise * Add new entry into llx_multicurrency_rate to historise
* *
* @param double $rate rate value * @param double $rate rate value
@ -467,7 +468,7 @@ class MultiCurrency extends CommonObject
public function updateRate($rate) public function updateRate($rate)
{ {
return $this->addRate($rate); return $this->addRate($rate);
} }
/** /**
* Fetch CurrencyRate object in $this->rate * Fetch CurrencyRate object in $this->rate
@ -488,9 +489,9 @@ class MultiCurrency extends CommonObject
return $this->rate->fetch($obj->rowid); return $this->rate->fetch($obj->rowid);
} }
} }
/** /**
* Get id of currency from code * Get id of currency from code
* *
* @param DoliDB $db object db * @param DoliDB $db object db
@ -508,9 +509,9 @@ class MultiCurrency extends CommonObject
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql && $obj = $db->fetch_object($resql)) return $obj->rowid; if ($resql && $obj = $db->fetch_object($resql)) return $obj->rowid;
else return 0; else return 0;
} }
/** /**
* Get id and rate of currency from code * Get id and rate of currency from code
* *
* @param DoliDB $db object db * @param DoliDB $db object db
@ -571,29 +572,28 @@ class MultiCurrency extends CommonObject
else return $amount; else return $amount;
} }
/** /**
* Get current invoite rate * Get current invoite rate
* *
* @param int $fk_facture id of facture * @param int $fk_facture id of facture
* @param string $table facture or facture_fourn * @param string $table facture or facture_fourn
* @return bool * @return bool
*/ */
public static function getInvoiceRate($fk_facture, $table='facture') public static function getInvoiceRate($fk_facture, $table='facture')
{ {
global $db; global $db;
$sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture; $sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture;
dol_syslog(__METHOD__,LOG_DEBUG); dol_syslog(__METHOD__,LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql && ($line = $db->fetch_object($resql))) if ($resql && ($line = $db->fetch_object($resql)))
{ {
return $line->multicurrency_tx; return $line->multicurrency_tx;
} }
return false;
}
return false;
}
/** /**
* With free account we can't set source then recalcul all rates to force another source * With free account we can't set source then recalcul all rates to force another source
@ -636,13 +636,13 @@ class MultiCurrency extends CommonObject
global $db,$conf; global $db,$conf;
$ch = curl_init('http://apilayer.net/api/live?access_key='.$key.''); $ch = curl_init('http://apilayer.net/api/live?access_key='.$key.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch); $response = curl_exec($ch);
curl_close($ch); curl_close($ch);
$response = json_decode($response); $response = json_decode($response);
if ($response->success) if ($response->success)
{ {
$TRate = $response->quotes; $TRate = $response->quotes;
$timestamp = $response->timestamp; $timestamp = $response->timestamp;

View File

@ -3657,7 +3657,7 @@ class Product extends CommonObject
$result.=$linkstart; $result.=$linkstart;
if ($withpicto) { if ($withpicto) {
if ($this->type == Product::TYPE_PRODUCT) $result.=(img_object(($notooltip?'':$label), 'product', ($notooltip?'class="paddingright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); if ($this->type == Product::TYPE_PRODUCT) $result.=(img_object(($notooltip?'':$label), 'product', ($notooltip?'class="paddingright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1));
if ($this->type == Product::TYPE_SERVICE) $result.=(img_object(($notooltip?'':$label), 'service', ($notooltip?'class="paddinright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); if ($this->type == Product::TYPE_SERVICE) $result.=(img_object(($notooltip?'':$label), 'service', ($notooltip?'class="paddinright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1));
} }
$result.= $newref; $result.= $newref;
$result.= $linkend; $result.= $linkend;

View File

@ -1,10 +1,10 @@
<?php <?php
require '../../../main.inc.php'; require '../../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$get = GETPOST('get'); $get = GETPOST('get');
$put = GETPOST('put'); $put = GETPOST('put');
switch ($put) switch ($put)
{ {
@ -48,4 +48,3 @@
break; break;
} }

View File

@ -464,9 +464,7 @@ if (empty($reshook))
$sql .= " WHERE rowid = " . $rowid; $sql .= " WHERE rowid = " . $rowid;
$result = $db->query($sql); $result = $db->query($sql);
} } else {
else
{
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
} }
} }
@ -479,9 +477,7 @@ if (empty($reshook))
$sql .= " WHERE fk_product_price = " . $priceid; $sql .= " WHERE fk_product_price = " . $priceid;
$result = $db->query($sql); $result = $db->query($sql);
} } else {
else
{
setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors'); setEventMessages(('delete_price_by_qty'.$langs->transnoentities(MissingIds)), null,'errors');
} }
} }

View File

@ -583,4 +583,3 @@ class Productlot extends CommonObject
} }
} }

View File

@ -1176,4 +1176,3 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete' && $id>0)
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -546,7 +546,7 @@ if (empty($conf->global->MEMBER_NEWFORM_FORCETYPE))
$isempty=1; $isempty=1;
if (count($listoftype)==1) { $defaulttype=$tmp[0]; $isempty=0; } if (count($listoftype)==1) { $defaulttype=$tmp[0]; $isempty=0; }
print '<tr><td class="titlefield">'.$langs->trans("Type").' <FONT COLOR="red">*</FONT></td><td>'; 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("type", $adht->liste_array(), GETPOST('type')?GETPOST('type'):$defaulttype, $isempty);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
else else
@ -561,7 +561,7 @@ $morphys["mor"] = $langs->trans("Moral");
if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY)) if (empty($conf->global->MEMBER_NEWFORM_FORCEMORPHY))
{ {
print '<tr class="morphy"><td class="titlefield">'.$langs->trans('Nature').' <FONT COLOR="red">*</FONT></td><td>'."\n"; print '<tr class="morphy"><td class="titlefield">'.$langs->trans('Nature').' <FONT COLOR="red">*</FONT></td><td>'."\n";
print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1); print $form->selectarray("morphy", $morphys, GETPOST('morphy'), 1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
else else

View File

@ -449,7 +449,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled))
// Create Stripe customer // Create Stripe customer
include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
$stripe = new Stripe($db); $stripe = new Stripe($db);
$stripeacc = $stripe->getStripeAccount($service); $stripeacc = $stripe->getStripeAccount($service);
$customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1); $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 1);
// Create Stripe card from Token // Create Stripe card from Token
@ -1694,4 +1694,3 @@ htmlPrintOnlinePaymentFooter($mysoc,$langs,1,$suffix,$object);
llxFooter('', 'public'); llxFooter('', 'public');
$db->close(); $db->close();

View File

@ -41,13 +41,13 @@ if (isset($_GET['connect'])){
{ {
$endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_CONNECT_KEY; $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_CONNECT_KEY;
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = 0; $servicestatus = 0;
} }
else else
{ {
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY; $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_CONNECT_KEY;
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 1; $servicestatus = 1;
} }
} }
else { else {
@ -55,13 +55,13 @@ else {
{ {
$endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_KEY; $endpoint_secret = $conf->global->STRIPE_TEST_WEBHOOK_KEY;
$service = 'StripeTest'; $service = 'StripeTest';
$servicestatus = 0; $servicestatus = 0;
} }
else else
{ {
$endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY; $endpoint_secret = $conf->global->STRIPE_LIVE_WEBHOOK_KEY;
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 1; $servicestatus = 1;
} }
} }
$payload = @file_get_contents("php://input"); $payload = @file_get_contents("php://input");
@ -229,35 +229,35 @@ elseif ($event->type == 'charge.failed') {
} }
elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated==true)) { elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated==true)) {
$fulltag=$event->data->object->metadata->FULLTAG; $fulltag=$event->data->object->metadata->FULLTAG;
// Save into $tmptag all metadata // Save into $tmptag all metadata
$tmptag=dolExplodeIntoArray($fulltag,'.','='); $tmptag=dolExplodeIntoArray($fulltag,'.','=');
if (! empty($tmptag['ORD'])){ if (! empty($tmptag['ORD'])) {
$order=new Commande($db); $order=new Commande($db);
$order->fetch('',$tmptag['ORD']); $order->fetch('',$tmptag['ORD']);
$origin='order'; $origin='order';
$item=$order->id; $item=$order->id;
} elseif (! empty($tmptag['INV'])) { } elseif (! empty($tmptag['INV'])) {
$invoice = new Facture($db); $invoice = new Facture($db);
$invoice->fetch('',$tmptag['INV']); $invoice->fetch('',$tmptag['INV']);
$origin='invoice'; $origin='invoice';
$item=$invoice->id; $item=$invoice->id;
} }
$stripe=new Stripe($db); $stripe=new Stripe($db);
$stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here) $stripeacc = $stripe->getStripeAccount($service); // Stripe OAuth connect account of dolibarr user (no network access here)
$stripecu = $stripe->getStripeCustomerAccount($tmptag['CUS'], $servicestatus); // Get thirdparty cu_... $stripecu = $stripe->getStripeCustomerAccount($tmptag['CUS'], $servicestatus); // Get thirdparty cu_...
$charge=$stripe->createPaymentStripe($event->data->object->amount/100,$event->data->object->currency,$origin,$item,$event->data->object->id,$stripecu,$stripeacc,$servicestatus); $charge=$stripe->createPaymentStripe($event->data->object->amount/100,$event->data->object->currency,$origin,$item,$event->data->object->id,$stripecu,$stripeacc,$servicestatus);
if (isset($charge->id) && $charge->statut=='error'){ if (isset($charge->id) && $charge->statut=='error') {
$msg=$charge->message; $msg=$charge->message;
$code=$charge->code; $code=$charge->code;
$error++; $error++;
} }
elseif (isset($charge->id) && $charge->statut=='success' && (! empty($tmptag['ORD']))) { elseif (isset($charge->id) && $charge->statut=='success' && (! empty($tmptag['ORD']))) {
//$order=new Commande($db); //$order=new Commande($db);
//$order->fetch('',$tmptag['ORD']); //$order->fetch('',$tmptag['ORD']);
$invoice = new Facture($db); $invoice = new Facture($db);
$idinv=$invoice->createFromOrder($order,$user); $idinv=$invoice->createFromOrder($order,$user);
@ -273,17 +273,17 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
$ifverif=$invoice->socid; $ifverif=$invoice->socid;
$currency=$invoice->multicurrency_code; $currency=$invoice->multicurrency_code;
$total=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); $total=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
}else{ } else {
$msg=$invoice->error; $msg=$invoice->error;
$error++; $error++;
} }
}else{ } else {
$msg=$invoice->error; $msg=$invoice->error;
$error++; $error++;
} }
} }
if (!$error){ if (!$error) {
$datepaye = dol_now(); $datepaye = dol_now();
$paymentType ="CB"; $paymentType ="CB";
$amounts=array(); $amounts=array();
@ -299,10 +299,10 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
$paiement->note = ''; $paiement->note = '';
} }
if (! $error){ if (! $error) {
$paiement_id=$paiement->create($user, 0); $paiement_id=$paiement->create($user, 0);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($invoice->lines)){ if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE) && count($invoice->lines)) {
$outputlangs = $langs; $outputlangs = $langs;
$newlang = ''; $newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
@ -316,17 +316,17 @@ elseif (($event->type == 'source.chargeable') && ($event->data->object->type ==
$invoice->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); $invoice->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
} }
if ($paiement_id < 0){ if ($paiement_id < 0) {
$msg=$paiement->errors; $msg=$paiement->errors;
$error++; $error++;
}else{ } else {
if ($event->data->object->metadata->source=='order') { if ($event->data->object->metadata->source=='order') {
$order->classifyBilled($user); $order->classifyBilled($user);
} }
} }
} }
if (! $error){ if (! $error) {
$label='(CustomerInvoicePayment)'; $label='(CustomerInvoicePayment)';
if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)'; if (GETPOST('type') == 2) $label='(CustomerInvoicePaymentBack)';
$paiement->addPaymentToBank($user,'payment',$label,$conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS,'',''); $paiement->addPaymentToBank($user,'payment',$label,$conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS,'','');
@ -349,4 +349,3 @@ elseif ($event->type == 'customer.deleted') {
$db->query($sql); $db->query($sql);
$db->commit(); $db->commit();
} }

View File

@ -226,12 +226,9 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
if ($mailfile->error || $mailfile->errors) if ($mailfile->error || $mailfile->errors) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
} }
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
@ -290,12 +287,9 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1);
if ($mailfile->error || $mailfile->errors) if ($mailfile->error || $mailfile->errors) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
} }
if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) { if (!empty($conf->global->TICKET_DISABLE_MAIL_AUTOCOPY_TO)) {
@ -316,9 +310,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) {
setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs'); setEventMessages($langs->trans('YourTicketSuccessfullySaved'), null, 'mesgs');
} }
} } else {
else
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }

View File

@ -121,8 +121,7 @@ if ($action == "view_ticketlist") {
} }
} }
if ($error || $errors) if ($error || $errors) {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }

View File

@ -112,8 +112,7 @@ if ($action == "view_ticket" || $action == "add_message" || $action == "close" |
} }
} }
if ($error || $errors) if ($error || $errors) {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }

View File

@ -1619,12 +1619,9 @@ class Ticket extends CommonObject
} }
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0);
if ($mailfile->error || $mailfile->errors) if ($mailfile->error || $mailfile->errors) {
{
setEventMessages($mailfile->error, $mailfile->errors, 'errors'); setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} } else {
else
{
$result = $mailfile->sendfile(); $result = $mailfile->sendfile();
if ($result > 0) { if ($result > 0) {
$nb_sent++; $nb_sent++;

View File

@ -374,7 +374,8 @@ if (! empty($id) || ! empty($ref)) {
<?php <?php
// End of page // End of page
llxFooter(); llxFooter();
$db->close();
} }
$db->close();

View File

@ -263,14 +263,14 @@ class CoreTest extends PHPUnit_Framework_TestCase
// For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests)
if ($type != 2) if ($type != 2)
{ {
$inj += preg_match('/delete\s+from/i', $val); $inj += preg_match('/delete\s+from/i', $val);
$inj += preg_match('/create\s+table/i', $val); $inj += preg_match('/create\s+table/i', $val);
$inj += preg_match('/update.+set.+=/i', $val); $inj += preg_match('/update.+set.+=/i', $val);
$inj += preg_match('/insert\s+into/i', $val); $inj += preg_match('/insert\s+into/i', $val);
$inj += preg_match('/select.+from/i', $val); $inj += preg_match('/select.+from/i', $val);
$inj += preg_match('/union.+select/i', $val); $inj += preg_match('/union.+select/i', $val);
$inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); $inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
$inj += preg_match('/(\.\.%2f)+/i', $val); $inj += preg_match('/(\.\.%2f)+/i', $val);
} }
// For XSS Injection done by adding javascript with script // For XSS Injection done by adding javascript with script
// This is all cases a browser consider text is javascript: // This is all cases a browser consider text is javascript: