';
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 7c34498e6b4..c37c61ca88c 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -756,8 +756,9 @@ else
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
- // MAILING_NO_USING_PHPMAIL may be defined or not
- // MAILING_LIMIT_SENDBYWEB is always defined to something != 0, MAILING_LIMIT_SENDBYCLI may be defined ot not.
+ // MAILING_NO_USING_PHPMAIL may be defined or not.
+ // MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
+ // MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0=no limit).
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
@@ -797,7 +798,7 @@ else
}
$text.=$langs->trans('ConfirmSendingEmailing').' ';
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
- print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,270);
+ print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,300);
}
}
@@ -844,23 +845,28 @@ else
print $langs->trans("TotalNbOfDistinctRecipients");
print '
';
+
+ $linkback = '' . $langs->trans("BackToList") . '';
+
+ $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+
+ print '
';
+ print '';
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
@@ -105,62 +127,15 @@ if ($object->id)
print '
';
+
+$linkback = '' . $langs->trans("BackToList") . '';
+
+$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+
+print '
';
diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example
index c03e41b386c..89e1458d4fd 100644
--- a/htdocs/conf/conf.php.example
+++ b/htdocs/conf/conf.php.example
@@ -250,11 +250,16 @@ $dolibarr_main_restrict_os_commands='mysqldump, mysql, pg_dump, pgrestore';
$dolibarr_nocsrfcheck='0';
// dolibarr_mailing_limit_sendbyweb
-// Can set a limit for mailing send by web. Can be used for a restricted mode.
-// Default value: 0 (use database value if exist)
-// Examples:
-// $dolibarr_mailing_limit_sendbyweb='0';
+// Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
+// Default value: '25'
+// Examples: '-1' (sending by web is forbidden)
+// $dolibarr_mailing_limit_sendbyweb='25';
+// dolibarr_mailing_limit_sendbycli
+// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
+// Default value: '0' (no hard limit, use soft database value if exists)
+// Examples: '-1' (sending by cli is forbidden)
+// $dolibarr_mailing_limit_sendbycli='0';
//##################
@@ -273,18 +278,6 @@ $dolibarr_nocsrfcheck='0';
// Examples:
// $dolibarr_main_limit_users='0';
-// dolibarr_mailing_limit_sendbyweb
-// Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
-// Default value: '0' (no overwrite, use database value if exists)
-// Examples: '-1' (sending by web is forbidden)
-// $dolibarr_mailing_limit_sendbyweb='0';
-
-// dolibarr_mailing_limit_sendbycli
-// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
-// Default value: '0' (no overwrite, use database value if exists)
-// Examples: '-1' (sending by cli is forbidden)
-// $dolibarr_mailing_limit_sendbycli='0';
-
// dolibarr_strict_mode
// Set this to 1 to enable the PHP strict mode. For dev environment only.
// Default value: 0 (use database value if exist)
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 027bedebb6e..9e11001745c 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -488,28 +488,35 @@ class CMailFile
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
- $tmparray = explode(',', $this->addr_to);
- if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
+ $tmparray1 = explode(',', $this->addr_to);
+ if (count($tmparray1) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)
{
$this->error = 'Too much recipients in to:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false;
}
- $tmparray = explode(',', $this->addr_cc);
- if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
+ $tmparray2 = explode(',', $this->addr_cc);
+ if (count($tmparray2) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_CC_IN_SAME_EMAIL)
{
$this->error = 'Too much recipients in cc:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false;
}
- $tmparray = explode(',', $this->addr_bcc);
- if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
+ $tmparray3 = explode(',', $this->addr_bcc);
+ if (count($tmparray3) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_BCC_IN_SAME_EMAIL)
{
$this->error = 'Too much recipients in bcc:';
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
return false;
}
-
+ if ((count($tmparray1)+count($tmparray2)+count($tmparray3)) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
+ {
+ $this->error = 'Too much recipients in to:, cc:, bcc:';
+ dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
+ return false;
+ }
+
+
// Action according to choosed sending method
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
@@ -538,25 +545,28 @@ class CMailFile
}
else
{
- $bounce = ''; // By default
+ $additionnalparam = ''; // By default
if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
{
// le "Return-Path" (retour des messages bounced) dans les header ne fonctionne pas avec tous les MTA
// Le forcage de la valeur grace à l'option -f de sendmail est donc possible si la constante MAIN_MAIL_ALLOW_SENDMAIL_F est definie.
- // La variable definie pose des pb avec certains sendmail securisee (option -f refusee car dangereuse)
- $bounce .= ($bounce?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') );
+ // Having this variable defined may create problems with some sendmail (option -f refused)
+ // Having this variable not defined may create problems with some other sendmail (option -f required)
+ $additionnalparam .= ($additionnalparam?' ':'').(! empty($conf->global->MAIN_MAIL_ERRORS_TO) ? '-f' . $this->getValidAddress($conf->global->MAIN_MAIL_ERRORS_TO,2) : ($this->addr_from != '' ? '-f' . $this->getValidAddress($this->addr_from,2) : '') );
}
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA)) // To force usage of -ba option. This option tells sendmail to read From: or Sender: to setup sender
{
- $bounce .= ($bounce?' ':'').'-ba';
+ $additionnalparam .= ($additionnalparam?' ':'').'-ba';
}
- dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$bounce, LOG_DEBUG);
+ if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_ADDPARAM)) $additionnalparam .= ($additionnalparam?' ':'').'-U '.$additionnalparam; // Use -U to add additionnal params
+
+ dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$additionnalparam, LOG_DEBUG);
$this->message=stripslashes($this->message);
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
- if (! empty($bounce)) $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers, $bounce);
+ if (! empty($additionnalparam)) $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers, $additionnalparam);
else $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers);
if (! $res)
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index c451b2e32fd..81de34e012f 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -282,6 +282,7 @@ class Conf
// Define default dir_output and dir_temp for directories of modules
foreach($this->modules as $module)
{
+ //var_dump($module);
// For multicompany sharings
$this->$module->multidir_output = array($this->entity => $rootfordata."/".$module);
$this->$module->multidir_temp = array($this->entity => $rootfordata."/".$module."/temp");
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 8abe3f271f7..ad968de506a 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5633,18 +5633,18 @@ class Form
* Return a HTML area with the reference of object and a navigation bar for a business object
* To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria.
*
- * @param object $object Object to show
- * @param string $paramid Name of parameter to use to name the id into the URL next/previous link
- * @param string $morehtml More html content to output just before the nav bar
- * @param int $shownav Show Condition (navigation is shown if value is 1)
- * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field)
+ * @param object $object Object to show.
+ * @param string $paramid Name of parameter to use to name the id into the URL next/previous link.
+ * @param string $morehtml More html content to output just before the nav bar.
+ * @param int $shownav Show Condition (navigation is shown if value is 1).
+ * @param string $fieldid Name of field id into database to use for select next and previous (we make the select max and min on this field).
* @param string $fieldref Name of field ref of object (object->ref) to show or 'none' to not show ref.
- * @param string $morehtmlref More html to show after ref
- * @param string $moreparam More param to add in nav link url.
- * @param int $nodbprefix Do not include DB prefix to forge table name
- * @param string $morehtmlleft More html code to show before ref
- * @param string $morehtmlstatus More html code to show under navigation arrows (status place)
- * @param string $morehtmlright More html code to show after ref
+ * @param string $morehtmlref More html to show after ref.
+ * @param string $moreparam More param to add in nav link url. Must start with '&...'.
+ * @param int $nodbprefix Do not include DB prefix to forge table name.
+ * @param string $morehtmlleft More html code to show before ref.
+ * @param string $morehtmlstatus More html code to show under navigation arrows (status place).
+ * @param string $morehtmlright More html code to show after ref.
* @return string Portion HTML with ref + navigation buttons
*/
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
@@ -5657,7 +5657,7 @@ class Form
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
-
+
//$previous_ref = $object->ref_previous?'ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':'';
//$next_ref = $object->ref_next?'ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':'';
$previous_ref = $object->ref_previous?'ref_previous).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'<':' ').'':''.(($conf->dol_use_jmobile != 4)?'<':' ').'';
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index d7ff764ce7a..24ed1425f6b 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -810,7 +810,7 @@ class DoliDBMysqli extends DoliDB
/**
* Create a user and privileges to connect to database (even if database does not exists yet)
*
- * @param string $dolibarr_main_db_host Ip serveur
+ * @param string $dolibarr_main_db_host Ip server or '%'
* @param string $dolibarr_main_db_user Nom user a creer
* @param string $dolibarr_main_db_pass Mot de passe user a creer
* @param string $dolibarr_main_db_name Database name where user must be granted
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index ad592359936..09f89ba0c3f 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -239,7 +239,7 @@ function show_array_actions_to_do($max=5)
print '
';
print ''.$langs->trans("DolibarrSetup");
if ($subtitle) {
@@ -423,7 +424,7 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
print '
'."\n";
- print '
'."\n";
+ print '
'."\n";
}
/**
diff --git a/htdocs/install/mysql/data/llx_c_typent.sql b/htdocs/install/mysql/data/llx_c_typent.sql
index 11b512f26c2..4365a2e99a6 100644
--- a/htdocs/install/mysql/data/llx_c_typent.sql
+++ b/htdocs/install/mysql/data/llx_c_typent.sql
@@ -43,6 +43,6 @@ insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 7, 'TE_RE
insert into llx_c_typent (id,code,libelle,fk_country,active) values ( 8, 'TE_PRIVATE', 'Particulier', NULL, 1);
insert into llx_c_typent (id,code,libelle,fk_country,active) values (100, 'TE_OTHER', 'Autres', NULL, 1);
-- Argentina (country 23)
-insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto', 23, 0);
-insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto', 23, 0);
-insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento', 23, 0);
+insert into llx_c_typent (id,code,libelle,fk_country,active) values (231, 'TE_A_RI', 'Responsable Inscripto (typo A)', 23, 0);
+insert into llx_c_typent (id,code,libelle,fk_country,active) values (232, 'TE_B_RNI', 'Responsable No Inscripto (typo B)', 23, 0);
+insert into llx_c_typent (id,code,libelle,fk_country,active) values (233, 'TE_C_FE', 'Consumidor Final/Exento (typo C)', 23, 0);
diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
index b94d289de31..974184b5f58 100644
--- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
+++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
@@ -230,6 +230,7 @@ ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_valid (fk_user
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_user_approve (fk_user_approve);
ALTER TABLE llx_expensereport ADD INDEX idx_expensereport_fk_refuse (fk_user_approve);
+DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm);
-- Sequence to removed duplicated values of llx_links. Use serveral times if you still have duplicate.
drop table tmp_links_double;
diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql
index 9f192a0d9cc..8d6c12b407f 100755
--- a/htdocs/install/mysql/migration/repair.sql
+++ b/htdocs/install/mysql/migration/repair.sql
@@ -143,6 +143,10 @@ delete from llx_element_element where sourcetype='facture' and fk_source not in
delete from llx_element_element where sourcetype='commande' and fk_source not in (select rowid from llx_commande);
+-- Fix: delete orphelin actioncomm_resources
+DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm);
+
+
UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
UPDATE llx_product SET canvas = NULL where canvas = 'service@product';
diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index 4389cbf2c0d..b323c970a9d 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2012 Laurent Destailleur
+ * Copyright (C) 2004-2016 Laurent Destailleur
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2004 Sebastien Di Cintio
* Copyright (C) 2005-2011 Regis Houssin
@@ -129,7 +129,6 @@ if (@file_exists($forcedfile)) {
}
}
-dolibarr_install_syslog("--- step1: entering step1.php page");
$error = 0;
@@ -138,6 +137,7 @@ $error = 0;
* View
*/
+dolibarr_install_syslog("--- step1: entering step1.php page");
pHeader($langs->trans("ConfigurationFile"),"step2");
@@ -541,9 +541,20 @@ if (! $error && $db->connected && $action == "set")
{
if ($db->connected)
{
- $result=$db->DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name);
-
- if ($result > 0)
+ $resultbis = 1;
+
+ // Create user
+ $result=$db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
+ // Create user bis
+ if ($databasefortest == 'mysql')
+ {
+ if (! in_array($dolibarr_main_db_host, array('127.0.0.1', '::1', 'localhost', 'localhost.local')))
+ {
+ $resultbis=$db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
+ }
+ }
+
+ if ($result > 0 && $resultbis > 0)
{
print '
';
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 82ff69fe88a..c57ea45858a 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -411,6 +411,7 @@ ModuleCompanyCodePanicum=Return an empty accountancy code.
ModuleCompanyCodeDigitaria=Accountancy code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code.
Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough). Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required.
UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than...
+WarningPHPMail=WARNING: Some email providers (like Yahoo) does not allow you to send an email from another server than the Yahoo server if the email address used as a sender is your Yahoo email (like myemail@yahoo.com, myemail@yahoo.fr, ...). Your current setup use the server of the application to send email, so some recipients (the one compatible with the restrictive DMARC protocol), will ask Yahoo if they can accept your email and Yahoo will respond "no" because the server is not a server owned by Yahoo, so few of your sent Emails may not be accepted. If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account).
# Modules
Module0Name=Users & groups
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 4a631b092cf..553e4d884e8 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -239,6 +239,10 @@ ProfId3RU=Prof Id 3 (KPP)
ProfId4RU=Prof Id 4 (OKPO)
ProfId5RU=-
ProfId6RU=-
+ProfId1DZ=RC
+ProfId2DZ=Art.
+ProfId3DZ=NIF
+ProfId4DZ=NIS
VATIntra=VAT number
VATIntraShort=VAT number
VATIntraSyntaxIsValid=Syntax is valid
diff --git a/htdocs/langs/eu_ES/mails.lang b/htdocs/langs/eu_ES/mails.lang
index 1d3552bb262..fa189fd4bf3 100644
--- a/htdocs/langs/eu_ES/mails.lang
+++ b/htdocs/langs/eu_ES/mails.lang
@@ -27,7 +27,7 @@ DeleteAMailing=Delete an emailing
PreviewMailing=Preview emailing
CreateMailing=Create emailing
TestMailing=Test email
-ValidMailing=Valid emailing
+ValidMailing=Validate emailing
MailingStatusDraft=Draft
MailingStatusValidated=Validated
MailingStatusSent=Sent
diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang
index 2a148eebf37..d994b5b6f34 100644
--- a/htdocs/langs/fr_FR/companies.lang
+++ b/htdocs/langs/fr_FR/companies.lang
@@ -239,6 +239,11 @@ ProfId3RU=Id. prof.3 (KPP)
ProfId4RU=Id. prof.4 (OKPO)
ProfId5RU=-
ProfId6RU=-
+ProfId1DZ=RC
+ProfId2DZ=Art.
+ProfId3DZ=NIF
+ProfId4DZ=NIS
+
VATIntra=Numéro de TVA
VATIntraShort=Num. TVA
VATIntraSyntaxIsValid=Syntaxe valide
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index be04b806b1f..6dd6b17ccff 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2014-2016 Alexandre Spangaro
* Copyright (C) 2015 Frederic France
*
* This program is free software; you can redistribute it and/or modify
@@ -86,8 +86,9 @@ if ($action == 'add' && $user->rights->loan->write)
{
if (! $cancel)
{
- $datestart=@dol_mktime(12,0,0, $_POST["startmonth"], $_POST["startday"], $_POST["startyear"]);
- $dateend=@dol_mktime(12,0,0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
+ $datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int'));
+ $dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int'));
+ $capital = price2num(GETPOST('capital'));
if (! $datestart)
{
@@ -99,20 +100,20 @@ if ($action == 'add' && $user->rights->loan->write)
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateEnd")), null, 'errors');
$action = 'create';
}
- elseif (! $_POST["capital"])
+ elseif (! $capital)
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("LoanCapital")), null, 'errors');
$action = 'create';
}
else
{
- $object->label = $_POST["label"];
- $object->fk_bank = $_POST["accountid"];
- $object->capital = $_POST["capital"];
+ $object->label = GETPOST('label');
+ $object->fk_bank = GETPOST('accountid');
+ $object->capital = $capital;
$object->datestart = $datestart;
$object->dateend = $dateend;
- $object->nbterm = $_POST["nbterm"];
- $object->rate = $_POST["rate"];
+ $object->nbterm = GETPOST('nbterm');
+ $object->rate = GETPOST('rate');
$object->note_private = GETPOST('note_private');
$object->note_public = GETPOST('note_public');
@@ -147,9 +148,9 @@ else if ($action == 'update' && $user->rights->loan->write)
if ($object->fetch($id))
{
- $object->label = GETPOST("label");
$object->datestart = dol_mktime(12, 0, 0, GETPOST('startmonth','int'), GETPOST('startday','int'), GETPOST('startyear','int'));
$object->dateend = dol_mktime(12, 0, 0, GETPOST('endmonth','int'), GETPOST('endday','int'), GETPOST('endyear','int'));
+ $object->capital = price2num(GETPOST("capital"));
$object->nbterm = GETPOST("nbterm");
$object->rate = GETPOST("rate");
}
@@ -173,6 +174,14 @@ else if ($action == 'update' && $user->rights->loan->write)
}
}
+if ($action == 'setlabel' && $user->rights->loan->write)
+{
+ $object->fetch($id);
+ $result = $object->setValueFrom('label', GETPOST('label'), '', '', 'text', '', $user, 'LOAN_MODIFY');
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+}
+
/*
* View
*/
@@ -180,8 +189,9 @@ else if ($action == 'update' && $user->rights->loan->write)
$form = new Form($db);
if (! empty($conf->accounting->enabled)) $formaccountancy = New FormVentilation($db);
-$help_url='EN:Module_Loan|FR:Module_Emprunt';
-llxHeader("",$langs->trans("Loan"),$help_url);
+$title = $langs->trans("Loan") . ' - ' . $langs->trans("Card");
+$help_url = 'EN:Module_Loan|FR:Module_Emprunt';
+llxHeader("",$title,$help_url);
// Create mode
@@ -203,7 +213,7 @@ if ($action == 'create')
print '
';
// Label
- print '
'.$langs->trans("Label").'
';
+ print '
'.$langs->trans("Label").'
';
// Bank account
if (! empty($conf->banque->enabled))
@@ -243,7 +253,7 @@ if ($action == 'create')
// Note Private
print '
';
+
+ $linkback = '' . $langs->trans("BackToList") . '';
+
+ $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
+
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+
+ print '
';
+ print '';
+
// Construit liste des fichiers
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
@@ -97,63 +113,13 @@ if ($object->id)
print '