diff --git a/ChangeLog b/ChangeLog
index 44e2d0a7f38..18cde3550b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@ For users:
Use accesskey on form search.
- New: Intervention documents are now available in ECM module
- New: Add attachments on user card + in ECM module
+- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
@@ -189,9 +190,19 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
+Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: Fusion PDF button on unpaid invoice is no more displayed
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click)
+Fix: Pb when showing log list of holiday module with some mysql versions.
+Fix: Error with bad timezone pushed by some browsers.
+Fix: shipping list SQL request was not filtering on shipping element
+Fix: debian package provided by dolibarr team must use embedded libraries.
+Fix: [ bug #1528 ] Leopard Services numeration module description is not translated.
+Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas
+Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances
+Fix: Update impayees.php
+Fix: Fix Link product, In list view and label product
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 486ca39c18e..35ab381a35f 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -565,6 +565,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$replyto = $_POST ['replytoname'] . ' <' . $_POST ['replytomail'] . '>';
$message = $_POST ['message'];
$sendtocc = $_POST ['sendtocc'];
+ $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
$deliveryreceipt = $_POST ['deliveryreceipt'];
if (dol_strlen($_POST ['subject']))
@@ -591,7 +592,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Envoi de la propal
require_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, $sendtobcc, $deliveryreceipt, - 1);
if ($mailfile->error) {
setEventMessage($mailfile->error, 'errors');
} else {
@@ -2288,6 +2289,8 @@ if ($action == 'create') {
*/
if ($action == 'presend')
{
+ $object->fetch_projet();
+
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/'));
@@ -2340,7 +2343,7 @@ if ($action == 'create') {
if (empty($object->ref_client)) {
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__');
} else if (! empty($object->ref_client)) {
- $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__(__REFCLIENT__)');
+ $formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__ (__REFCLIENT__)');
}
$formmail->withfile = 2;
$formmail->withbody = 1;
@@ -2351,6 +2354,8 @@ if ($action == 'create') {
$formmail->substit ['__PROPREF__'] = $object->ref;
$formmail->substit ['__SIGNATURE__'] = $user->signature;
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
+ $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
+ $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit ['__PERSONALIZED__'] = '';
$formmail->substit ['__CONTACTCIVNAME__'] = '';
@@ -2361,7 +2366,7 @@ if ($action == 'create') {
if (is_array($contactarr) && count($contactarr) > 0) {
foreach ($contactarr as $contact) {
- if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) {
+ if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) { // TODO Use code and not label
$contactstatic = new Contact($db);
$contactstatic->fetch($contact ['id']);
$custcontact = $contactstatic->getFullName($langs, 1);
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index a82eb5dda05..1d59311404e 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -617,7 +617,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
}
}
}
-
+
// if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) {
$pu_ht = price2num($price_ht, 'MU');
@@ -1192,6 +1192,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$replyto = GETPOST('replytoname') . ' <' . GETPOST('replytomail') . '>';
$message = GETPOST('message');
$sendtocc = GETPOST('sendtocc');
+ $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
$deliveryreceipt = GETPOST('deliveryreceipt');
if ($action == 'send') {
@@ -1220,7 +1221,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Send mail
require_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, $sendtobcc, $deliveryreceipt, - 1);
if ($mailfile->error) {
setEventMessage($mailfile->error, 'errors');
} else {
@@ -2430,11 +2431,13 @@ if ($action == 'create' && $user->rights->commande->creer) {
*/
if ($action == 'presend')
{
+ $object->fetch_projet();
+
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
$file = $fileparams ['fullname'];
-
+
// Define output language
$outputlangs = $langs;
$newlang = '';
@@ -2482,7 +2485,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
if (empty($object->ref_client)) {
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__');
} else if (! empty($object->ref_client)) {
- $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__(__REFCLIENT__)');
+ $formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)');
}
$formmail->withfile = 2;
$formmail->withbody = 1;
@@ -2492,6 +2495,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
$formmail->substit ['__ORDERREF__'] = $object->ref;
$formmail->substit ['__SIGNATURE__'] = $user->signature;
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
+ $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
+ $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit ['__PERSONALIZED__'] = '';
$formmail->substit ['__CONTACTCIVNAME__'] = '';
@@ -2501,7 +2506,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
if (is_array($contactarr) && count($contactarr) > 0) {
foreach ($contactarr as $contact) {
- if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) {
+ if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
$contactstatic = new Contact($db);
$contactstatic->fetch($contact ['id']);
$custcontact = $contactstatic->getFullName($langs, 1);
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 056d5168234..de636bf5bdb 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1152,7 +1152,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
$pu_ttc = $prod->price_ttc;
$price_min = $prod->price_min;
$price_base_type = $prod->price_base_type;
-
+
// We define price for product
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->thirdparty->price_level))
{
@@ -1181,7 +1181,7 @@ else if ($action == 'addline' && $user->rights->facture->creer)
}
}
}
-
+
// if price ht is forced (ie: calculated by margin rate and cost price)
if (! empty($price_ht)) {
$pu_ht = price2num($price_ht, 'MU');
@@ -1559,6 +1559,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$replyto = $_POST['replytoname'] . ' <' . $_POST['replytomail'] . '>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
+ $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
$deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send') {
@@ -1601,7 +1602,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// Send mail
require_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, $sendtobcc, $deliveryreceipt, - 1);
if ($mailfile->error) {
setEventMessage($mailfile->error, 'errors');
} else {
@@ -3637,11 +3638,15 @@ if ($action == 'create')
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
print '';
- } else {
+ }
+ else
+ {
/*
- * Affiche formulaire mail
+ * Action presend (or prerelance)
*/
+ $object->fetch_projet();
+
// By default if $action=='presend'
$titreform = 'SendBillByMail';
$topicmail = 'SendBillRef';
@@ -3709,8 +3714,9 @@ if ($action == 'create')
if (empty($object->ref_client)) {
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__');
} else if (! empty($object->ref_client)) {
- $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__(__REFCLIENT__)');
+ $formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__ (__REFCLIENT__)');
}
+
$formmail->withfile = 2;
$formmail->withbody = 1;
$formmail->withdeliveryreceipt = 1;
@@ -3719,6 +3725,8 @@ if ($action == 'create')
$formmail->substit ['__FACREF__'] = $object->ref;
$formmail->substit ['__SIGNATURE__'] = $user->signature;
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
+ $formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
+ $formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
$formmail->substit ['__PERSONALIZED__'] = '';
$formmail->substit ['__CONTACTCIVNAME__'] = '';
@@ -3729,7 +3737,7 @@ if ($action == 'create')
if (is_array($contactarr) && count($contactarr) > 0) {
foreach ($contactarr as $contact) {
- if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) {
+ if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) { // TODO Use code and not label
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index b3d95870838..99f3a0ba082 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -121,6 +121,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
$subject = GETPOST('subject');
$message = GETPOST('message');
$sendtocc = GETPOST('sentocc');
+ $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
$substitutionarray=array(
'__ID__' => $object->id,
@@ -151,7 +152,7 @@ if ($action == 'presend' && GETPOST('sendmail'))
// Send mail
require_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,$sendtobcc,$deliveryreceipt,-1);
if ($mailfile->error)
{
$resultmasssend.='
'.$mailfile->error.'
';
diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example
index 990a10c2500..32adc4b87c9 100644
--- a/htdocs/conf/conf.php.example
+++ b/htdocs/conf/conf.php.example
@@ -12,8 +12,8 @@
//###################
// dolibarr_main_url_root
-// This parameter defines the root URL of your Dolibarr index.php page.
-// It must link to the htdocs directory htdocs.
+// This parameter defines the root URL of your Dolibarr index.php page without ending "/".
+// It must link to the directory htdocs.
// In most cases, this is autodetected but it's still required
// * to show full url bookmarks for some services (ie: agenda rss export url, ...)
// * or when using Apache dir aliases (autodetect fails)
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 3af164abfab..337cf59c9b0 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -26,7 +26,8 @@
// $id must be defined
// $actiontypecode must be defined
-
+// $paramname must be defined
+// $mode must be defined
/*
* Add file in email form
@@ -115,6 +116,11 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $_POST['sendtocc'];
+ $sendtobcc='';
+ if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
+ if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);
+ if ($mode == 'emailfrominvoice') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
+
$deliveryreceipt = $_POST['deliveryreceipt'];
if ($action == 'send' || $action == 'relance')
@@ -141,7 +147,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// Send mail
require_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,$sendtobcc,$deliveryreceipt,-1);
if ($mailfile->error)
{
$mesgs[]='
'.$mailfile->error.'
';
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index c16af4c5b24..a289b43c4a9 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -170,7 +170,7 @@ class CMailFile
}
}
- // Add autocopy to
+ // Add autocopy to (Note: Adding bcc for specific modules are also done from pages)
if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) $addr_bcc.=($addr_bcc?', ':'').$conf->global->MAIN_MAIL_AUTOCOPY_TO;
// Action according to choosed sending method
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 7d5f1a3bf2e..261754801a9 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -439,7 +439,7 @@ class FormMail
}
$out.= "\n";
}
-
+
// CCC
if (! empty($this->withtoccc) || is_array($this->withtoccc))
{
@@ -459,7 +459,12 @@ class FormMail
$out.= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1);
}
}
- //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1);
+
+ $showinfobcc='';
+ if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO;
+ if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO;
+ if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $showinfobcc=$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO;
+ if ($showinfobcc) $out.=' + '.$showinfobcc;
$out.= "\n";
}
@@ -475,9 +480,9 @@ class FormMail
else
{
$defaultvaluefordeliveryreceipt=0;
- if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
- if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'commande_send') $defaultvaluefordeliveryreceipt=1;
if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_PROPAL) && ! empty($this->param['models']) && $this->param['models'] == 'propal_send') $defaultvaluefordeliveryreceipt=1;
+ if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1;
+ if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
$out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1);
}
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 1641aeb132c..cdf05a2c29d 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -838,7 +838,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
}
// Show page nb only on iso languages (so default Helvetica font)
- if (mb_strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica')
+ if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica')
{
$pdf->SetXY(-20,-$posy);
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index c30388050cf..6f8a2bb9b2c 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -92,7 +92,7 @@ if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off');
// Clean parameters
$dolibarr_main_data_root=trim($dolibarr_main_data_root);
-$dolibarr_main_url_root=trim($dolibarr_main_url_root);
+$dolibarr_main_url_root=trim(preg_replace('/\/+$/','',$dolibarr_main_url_root));
$dolibarr_main_url_root_alt=(empty($dolibarr_main_url_root_alt)?'':trim($dolibarr_main_url_root_alt));
$dolibarr_main_document_root=trim($dolibarr_main_document_root);
$dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':trim($dolibarr_main_document_root_alt));
diff --git a/htdocs/holiday/admin/tomergewithholiday.php b/htdocs/holiday/admin/tomergewithholiday.php
new file mode 100755
index 00000000000..c301e1ba348
--- /dev/null
+++ b/htdocs/holiday/admin/tomergewithholiday.php
@@ -0,0 +1,225 @@
+
+ * Copyright (C) 2011 Dimitri Mouillard
+ * Copyright (C) 2012 Regis Houssin
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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 .
+ */
+
+/**
+ * Page module configuration paid holiday.
+ *
+ * \file holiday.php
+ * \ingroup holiday
+ * \brief Page module configuration paid holiday.
+ */
+
+require '../../main.inc.php';
+require DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
+require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
+require_once DOL_DOCUMENT_ROOT. '/user/class/user.class.php';
+require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php';
+
+// Si pas administrateur
+if (! $user->admin) accessforbidden();
+
+
+/*
+ * View
+ */
+
+// Vérification si module activé
+if (empty($conf->holiday->enabled)) print $langs->trans('NotActiveModCP');
+
+llxheader('',$langs->trans('TitleAdminCP'));
+
+print_fiche_titre($langs->trans('MenuCPTypes'));
+
+echo '
';
+
+echo '
';
+echo '
';
+echo '
' . $langs->trans('TypeLabel') . '
';
+echo '
' . $langs->trans('TypeDescription') . '
';
+echo '
' . $langs->trans('TypeAffect') . '
';
+echo '
' . $langs->trans('TypeDelay') . '
';
+echo '
' . $langs->trans('nbCongesDeductedCPMini') . '
';
+echo '
' . $langs->trans('nbCongesEveryMonthCPMini') . '
';
+echo '
';
+echo '
';
+
+$types = $db->query(
+ "SELECT *
+ FROM llx_congespayes_types
+ WHERE deleteAt IS NULL
+ ORDER BY label"
+);
+
+while($type = $db->fetch_array($types))
+{
+ echo'
+
';
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 0e39f591bdd..b88547729c1 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -79,7 +79,7 @@ class Holiday extends CommonObject
/**
- * updateSold
+ * updateSold. Update sold and check table of users for holidays is complete. If not complete.
*
* @return int Return 1
*/
@@ -889,7 +889,7 @@ class Holiday extends CommonObject
$month = date('m',$now);
$lastUpdate = $this->getConfCP('lastUpdate');
$monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
- //print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;
+ //print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;exit;
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
if ($month != $monthLastUpdate)
@@ -986,25 +986,31 @@ class Holiday extends CommonObject
*/
function createCPusers($single=false,$userid='')
{
- // Si c'est l'ensemble des utilisateurs à ajoutés
- if(!$single)
+ // Si c'est l'ensemble des utilisateurs à ajouter
+ if (! $single)
{
dol_syslog(get_class($this).'::createCPusers');
- foreach($this->fetchUsers(false,true) as $users) {
+ $arrayofusers = $this->fetchUsers(false,true);
+
+ foreach($arrayofusers as $users)
+ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users";
$sql.= " (fk_user, nb_holiday)";
$sql.= " VALUES ('".$users['rowid']."','0')";
- $this->db->query($sql);
+ $resql=$this->db->query($sql);
+ if (! $resql) dol_print_error($this->db);
}
- } else {
+ }
+ else
+ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday_users";
$sql.= " (fk_user, nb_holiday)";
$sql.= " VALUES ('".$userid."','0')";
- $this->db->query($sql);
+ $resql=$this->db->query($sql);
+ if (! $resql) dol_print_error($this->db);
}
-
}
/**
@@ -1051,7 +1057,7 @@ class Holiday extends CommonObject
* uniquement pour vérifier si il existe de nouveau utilisateur
*
* @param boolean $liste si vrai retourne une liste, si faux retourne un array
- * @param boolean $type si vrai retourne pour Dolibarr si faux retourne pour CP
+ * @param boolean $type si vrai retourne pour Dolibarr, si faux retourne pour CP
* @return string retourne un tableau de tout les utilisateurs actifs
*/
function fetchUsers($liste=true,$type=true)
@@ -1262,49 +1268,56 @@ class Holiday extends CommonObject
function verifNbUsers($userDolibarrWithoutCP,$userCP) {
if (empty($userCP)) $userCP=0;
- dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarr.' userCP='.$userCP);
+ dol_syslog(get_class($this).'::verifNbUsers userDolibarr='.$userDolibarrWithoutCP.' userCP='.$userCP);
// On vérifie les users Dolibarr sans CP
if ($userDolibarrWithoutCP > 0)
{
- $this->updateConfCP('nbUser',$userDolibarr);
+ $this->db->begin();
+
+ $this->updateConfCP('nbUser',$userDolibarrWithoutCP);
$listUsersCP = $this->fetchUsers(true,false);
// On séléctionne les utilisateurs qui ne sont pas déjà dans le module
$sql = "SELECT u.rowid, u.lastname, u.firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
- $sql.= " WHERE u.rowid NOT IN(".$listUsersCP.")";
-
- $result = $this->db->query($sql);
-
- // Si pas d'erreur SQL
- if($result) {
+ if ($listUsersCP != '') $sql.= " WHERE u.rowid NOT IN(".$listUsersCP.")";
+ $resql = $this->db->query($sql);
+ if ($resql)
+ {
$i = 0;
$num = $this->db->num_rows($resql);
- while($i < $num) {
-
+ while($i < $num)
+ {
$obj = $this->db->fetch_object($resql);
+ $uid = $obj->rowid;
// On ajoute l'utilisateur
- $this->createCPusers(true,$obj->rowid);
+ //print "Add user rowid = ".$uid." into database holiday";
+
+ $result = $this->createCPusers(true,$uid);
$i++;
}
-
+ $this->db->commit();
} else {
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
+ dol_syslog(get_class($this)."::verifNbUsers ".$this->error, LOG_ERR);
+ $this->db->rollback();
return -1;
}
} else {
- // Si il y a moins d'utilisateur Dolibarr que dans le module CP
+ $this->db->begin();
- $this->updateConfCP('nbUser',$userDolibarr);
+ // Si il y a moins d'utilisateur Dolibarr que dans le module CP
+
+ $this->updateConfCP('nbUser',$userDolibarrWithoutCP);
$listUsersDolibarr = $this->fetchUsers(true,true);
@@ -1331,10 +1344,12 @@ class Holiday extends CommonObject
$i++;
}
-
+ $this->db->commit();
} else {
// Erreur SQL
$this->error="Error ".$this->db->lasterror();
+ dol_syslog(get_class($this)."::verifNbUsers ".$this->error, LOG_ERR);
+ $this->db->rollback();
return -1;
}
}
@@ -1720,6 +1735,30 @@ class Holiday extends CommonObject
}
}
+
+ /**
+ * Tous les types
+ *
+ * @return boolean Return array with list of types
+ */
+ function getTypes()
+ {
+ $result = $this->db->query("SELECT rowid, type, affect FROM " . MAIN_DB_PREFIX . "holiday_types");
+ $num = $this->db->num_rows($result);
+ if ($num)
+ {
+ while ($obj = $this->db->fetch_object($result))
+ {
+ $types[] = array('rowid'=> $obj->rowid, 'type'=> $obj->type, 'affect'=>$obj->affect);
+ }
+
+ return $types;
+ }
+
+ return array();
+ }
+
+
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index 4b37a8b53c5..62e8fc698c9 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -43,14 +43,17 @@ $action=GETPOST('action');
*/
$form = new Form($db);
+$userstatic=new User($db);
+$holiday = new Holiday($db);
+
llxHeader(array(),$langs->trans('CPTitreMenu'));
print_fiche_titre($langs->trans('MenuConfCP'));
-$holiday = new Holiday($db);
+$holiday->updateSold(); // Create users into table holiday if they don't exists. TODO Remove if we use field into table user.
+
$listUsers = $holiday->fetchUsers(false,false);
-$userstatic=new User($db);
// Si il y a une action de mise à jour
if ($action == 'update' && isset($_POST['update_cp']))
@@ -71,7 +74,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
$comment = ((isset($_POST['note_holiday'][$userID]) && !empty($_POST['note_holiday'][$userID])) ? ' ('.$_POST['note_holiday'][$userID].')' : '');
// We add the modification to the log
- $holiday->addLogCP($user->id,$userID, $langs->trans('ManualUpdate').$comment,$userValue);
+ $holiday->addLogCP($user->id,$userID, $langs->transnoentitiesnoconv('ManualUpdate').$comment,$userValue);
// Update of the days of the employee
$holiday->updateSoldeCP($userID,$userValue);
diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php
index 0092a6e25c9..9fc3e278ac5 100644
--- a/htdocs/holiday/fiche.php
+++ b/htdocs/holiday/fiche.php
@@ -761,8 +761,9 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
print '';
}
else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0);
+ //var_dump($cp->getConfCP('nbHolidayDeducted'));
$nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted');
- print ' '.$langs->trans('SoldeCPUser', round($nb_holiday,0)).'';
+ print ' '.$langs->trans('SoldeCPUser', round($nb_holiday,2)).'';
print '';
print '';
print '
';
diff --git a/htdocs/holiday/img/add.png b/htdocs/holiday/img/add.png
new file mode 100755
index 00000000000..d15cb50d835
Binary files /dev/null and b/htdocs/holiday/img/add.png differ
diff --git a/htdocs/holiday/img/delete.png b/htdocs/holiday/img/delete.png
new file mode 100755
index 00000000000..e22ed6f43fc
Binary files /dev/null and b/htdocs/holiday/img/delete.png differ
diff --git a/htdocs/holiday/img/edit.png b/htdocs/holiday/img/edit.png
new file mode 100755
index 00000000000..c74571fde8a
Binary files /dev/null and b/htdocs/holiday/img/edit.png differ
diff --git a/htdocs/holiday/tomergewithdefine_holiday.php b/htdocs/holiday/tomergewithdefine_holiday.php
new file mode 100755
index 00000000000..4bf904528a0
--- /dev/null
+++ b/htdocs/holiday/tomergewithdefine_holiday.php
@@ -0,0 +1,125 @@
+
+ * Copyright (C) 2011 Dimitri Mouillard
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * \file define_congespayes.php
+ * \ingroup congespayes
+ * \brief File that defines the balance of paid leave of users.
+ * \version $Id: define_congespayes.php,v 1.00 2011/09/15 11:00:00 dmouillard Exp $
+ * \author dmouillard@teclib.com
+ * \remarks File that defines the balance of paid leave of users.
+ */
+
+require('../main.inc.php');
+require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
+require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
+
+// Protection if external user
+if ($user->societe_id > 0) accessforbidden();
+
+// If the user does not have perm to read the page
+if(!$user->rights->holiday->define_holiday) accessforbidden();
+
+
+/*
+ * View
+ */
+
+llxHeader(array(),$langs->trans('CPTitreMenu'));
+
+
+print_fiche_titre($langs->trans('MenuConfCP'));
+
+$congespayes = new Holidays($db);
+$listUsers = $congespayes->fetchUsers(false, true);
+
+// Si il y a une action de mise à jour
+if (isset($_POST['action']) && $_POST['action'] == 'update') {
+
+ $fk_type = $_POST['fk_type'];
+
+ foreach ($_POST['nb_conges'] as $user_id => $compteur) {
+ if (!empty($compteur)) {
+ $userValue = str_replace(',', '.', $compteur);
+ $userValue = number_format($userValue, 2, '.', '');
+ } else {
+ $userValue = '0.00';
+ }
+ $congespayes->updateSoldeCP($user_id,$userValue,$fk_type);
+ }
+
+ print '
';
+ }
+}
+
+// Fin de page
+$db->close();
+llxFooter();
diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index 566fdbcf502..5f18a524acc 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2007-2014 Laurent Destailleur
* Copyright (C) 2011 Dimitri Mouillard
*
* This program is free software; you can redistribute it and/or modify
@@ -26,6 +26,7 @@
require('../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Protection if external user
if ($user->societe_id > 0) accessforbidden();
@@ -33,22 +34,28 @@ if ($user->societe_id > 0) accessforbidden();
// Si l'utilisateur n'a pas le droit de lire cette page
if(!$user->rights->holiday->view_log) accessforbidden();
+$year=GETPOST('year');
+if (empty($year))
+{
+ $tmpdate=dol_getdate(dol_now());
+ $year=$tmpdate['year'];
+}
/*
* View
-*/
+ */
$langs->load('users');
-llxHeader(array(),$langs->trans('CPTitreMenu'));
+llxHeader(array(),$langs->trans('CPTitreMenu').' ('.$langs->trans("Year").' '.$year.')');
$cp = new Holiday($db);
-//Recent changes are more important than old changes
-$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC','');
+// Recent changes are more important than old changes
+$log_holiday = $cp->fetchLog('ORDER BY cpl.rowid DESC', " AND date_action BETWEEN '".$db->idate(dol_get_first_day($year,1,1))."' AND '".$db->idate(dol_get_last_day($year,12,1))."'"); // Load $cp->logs
-print_fiche_titre($langs->trans('LogCP'));
+print_fiche_titre($langs->trans('LogCP'),''.img_previous().' '.$langs->trans("Year").':'.$year.' '.img_next().'');
print '
';
print '';
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index 97186c9ae75..54aea6de52d 100644
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -925,24 +925,37 @@ DROP TABLE llx_texts;
DROP TABLE llx_c_email_templates;
-CREATE table llx_c_email_templates
+create table llx_c_email_templates
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
- module varchar(32), -- Nom du module en rapport avec le modele
+ module varchar(32), -- Nom du module en rapport avec le modele
type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
- sortorder smallint, -- Ordre affichage
-
- private smallint DEFAULT 0 NOT NULL, -- Template public or private
- fk_user integer, -- Id utilisateur si modele prive, sinon null
+ private smallint DEFAULT 0 NOT NULL, -- Template public or private
+ fk_user integer, -- Id utilisateur si modele prive, sinon null
datec datetime,
tms timestamp,
-
- label varchar(255),
- content text
+ label varchar(255), -- Label of predefined email
+ position smallint, -- Position
+ topic text, -- Predefined topic
+ content text -- Predefined text
)ENGINE=innodb;
UPDATE llx_c_regions SET rowid = 0 where rowid = 1;
DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0;
ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid);
+
+
+CREATE TABLE llx_holiday_types (
+ rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ label varchar(45) NOT NULL,
+ description varchar(255) NOT NULL,
+ affect int(1) NOT NULL,
+ delay int(1) NOT NULL,
+ insertAt DATETIME NOT NULL,
+ updateAt DATETIME,
+ deleteAt DATETIME,
+ nbCongesDeducted varchar(255) NOT NULL,
+ nbCongesEveryMonth varchar(255) NOT NULL
+);
diff --git a/htdocs/install/mysql/tables/llx_c_email_template.sql b/htdocs/install/mysql/tables/llx_c_email_template.sql
index 9390f934bc3..875314bf4c8 100644
--- a/htdocs/install/mysql/tables/llx_c_email_template.sql
+++ b/htdocs/install/mysql/tables/llx_c_email_template.sql
@@ -21,15 +21,14 @@ create table llx_c_email_templates
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
- module varchar(32), -- Nom du module en rapport avec le modele
+ module varchar(32), -- Nom du module en rapport avec le modele
type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
- sortorder smallint, -- Ordre affichage
-
- private smallint DEFAULT 0 NOT NULL, -- Template public or private
- fk_user integer, -- Id utilisateur si modele prive, sinon null
+ private smallint DEFAULT 0 NOT NULL, -- Template public or private
+ fk_user integer, -- Id utilisateur si modele prive, sinon null
datec datetime,
tms timestamp,
-
- label varchar(255),
- content text
+ label varchar(255), -- Label of predefined email
+ position smallint, -- Position
+ topic text, -- Predefined topic
+ content text -- Predefined text
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_holiday_types.sql b/htdocs/install/mysql/tables/llx_holiday_types.sql
new file mode 100755
index 00000000000..242483b5974
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_holiday_types.sql
@@ -0,0 +1,30 @@
+-- ===================================================================
+-- Copyright (C) 2014 Laurent Destailleur
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- 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 .
+--
+-- ===================================================================
+
+CREATE TABLE llx_holiday_types (
+ rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ label varchar(45) NOT NULL,
+ description varchar(255) NOT NULL,
+ affect integer NOT NULL,
+ delay integer NOT NULL,
+ insertAt DATETIME NOT NULL,
+ updateAt DATETIME,
+ deleteAt DATETIME,
+ nbCongesDeducted varchar(255) NOT NULL,
+ nbCongesEveryMonth varchar(255) NOT NULL
+);
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 00a5a2dc3b4..1176a3ab7e9 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -257,6 +257,9 @@ MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into
MAIN_MAIL_EMAIL_FROM=Sender e-mail for automatic emails (By default in php.ini: %s)
MAIN_MAIL_ERRORS_TO=Sender e-mail used for error returns emails sent
MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to
+MAIN_MAIL_AUTOCOPY_PROPOSAL_TO= Send systematically a hidden carbon-copy of proposals sent by email to
+MAIN_MAIL_AUTOCOPY_ORDER_TO= Send systematically a hidden carbon-copy of orders sent by email to
+MAIN_MAIL_AUTOCOPY_INVOICE_TO= Send systematically a hidden carbon-copy of invoice sent by emails to
MAIN_DISABLE_ALL_MAILS=Disable all e-mails sendings (for test purposes or demos)
MAIN_MAIL_SENDMODE=Method to use to send EMails
MAIN_MAIL_SMTPS_ID=SMTP ID if authentication required
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 7ca032cf422..cc4a6018d73 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -513,6 +513,7 @@ if (empty($reshook))
$id=$socid;
$actiontypecode='AC_OTH_AUTO';
$paramname='socid';
+ $mode='emailfromthirdparty';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
@@ -1107,12 +1108,11 @@ else
$res=$object->fetch_optionals($object->id,$extralabels);
//if ($res < 0) { dol_print_error($db); exit; }
-
$head = societe_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
-
+
// Load object modCodeTiers
$module=(! empty($conf->global->SOCIETE_CODECLIENT_ADDON)?$conf->global->SOCIETE_CODECLIENT_ADDON:'mod_codeclient_leopard');
if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php')
@@ -1148,7 +1148,9 @@ else
{
$prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed();
}
-
+
+ $object->oldcopy=dol_clone($object);
+
if (GETPOST('nom'))
{
// We overwrite with values if posted
@@ -1180,7 +1182,7 @@ else
$object->barcode = GETPOST('barcode');
$object->forme_juridique_code = GETPOST('forme_juridique_code');
$object->default_lang = GETPOST('default_lang');
-
+
$object->tva_assuj = GETPOST('assujtva_value');
$object->tva_intra = GETPOST('tva_intra');
$object->status = GETPOST('status');
@@ -1267,7 +1269,7 @@ else
print '';
print '';
if ($modCodeClient->code_auto || $modCodeFournisseur->code_auto) print '';
-
+
print '
';
// Name
@@ -1305,6 +1307,7 @@ else
if ((!$object->code_client || $object->code_client == -1) && $modCodeClient->code_auto)
{
$tmpcode=$object->code_client;
+ if (empty($tmpcode) && ! empty($object->oldcopy->code_client)) $tmpcode=$object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
print '';
}
@@ -1337,6 +1340,7 @@ else
if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
{
$tmpcode=$object->code_fournisseur;
+ if (empty($tmpcode) && ! empty($object->oldcopy->code_fournisseur)) $tmpcode=$object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value.
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
print '';
}
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 319a58131ab..76a6a43f9bb 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2564,6 +2564,41 @@ a.cke_dialog_ui_button
}
+/* ============================================================================== */
+/* Holiday */
+/* ============================================================================== */
+
+#types .btn {
+ cursor: pointer;
+}
+
+#types .btn-primary {
+ font-weight: bold;
+}
+
+#types form {
+ padding: 20px;
+}
+
+#types label {
+ display:inline-block;
+ width:100px;
+ margin-right: 20px;
+ padding: 4px;
+ text-align: right;
+ vertical-align: top;
+}
+
+#types input.text, #types textarea {
+ width: 400px;
+}
+
+#types textarea {
+ height: 100px;
+}
+
+
+
/* ============================================================================== */
/* JSGantt */
/* ============================================================================== */