From 283aeb294556ed343f3499d28f35ed659de8a245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Feb 2013 01:05:16 +0100 Subject: [PATCH 1/5] Fix: Add option MAIN_USE_LOCALTAX_TYPE_7 to hide localtax 7 because type 7 need to be implemented at invoice level, not line level. This disable the feature (we need better implementation) without removing it for people using it in the past. --- htdocs/admin/dict.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 6c0360a324c..87e40d8645a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -392,9 +392,9 @@ if (GETPOST("id") == 10) "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"), "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"), "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"), - "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)", //$langs->trans("%ageOnServiceBeforeVAT"), - "7" => $langs->trans("Yes").' ('.$langs->trans("Type")." 7)" //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype + "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"), ); + if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) $localtax_typeList["7"]= $langs->trans("Yes").' ('.$langs->trans("Type")." 7)"; //$langs->trans("AmountOnOrder") // We will enable this later. For the moment, work only of invoice localtype } $msg=''; @@ -1292,4 +1292,4 @@ function fieldList($fieldlist,$obj='',$tabname='') } } -?> \ No newline at end of file +?> From f2371be191817ead88794e742ecd64af690e350f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Feb 2013 15:23:25 +0100 Subject: [PATCH 2/5] Fix: Update button does not appear --- htdocs/admin/const.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 77534fd0d76..a2b07ca2d11 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -157,7 +157,7 @@ jQuery(document).ready(function() { jQuery("#delconst").show(); jQuery("#action").val('delete'); }); - jQuery(".inputforupdate").keypress(function() { + jQuery(".inputforupdate").keyup(function() { // keypress does not support back var field_id = jQuery(this).attr("id"); var row_num = field_id.split("_"); jQuery("#updateconst").show(); From 47c89dfd8e18c44459023d46c84d66c97a056b45 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Feb 2013 17:47:21 +0100 Subject: [PATCH 3/5] Fix: trans --- htdocs/langs/en_US/paypal.lang | 2 +- htdocs/langs/fr_FR/paypal.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index f06ce5f6309..ca47b924f5d 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -16,5 +16,5 @@ PAYPAL_CSS_URL=Optionnal Url of CSS style sheet on payment page ThisIsTransactionId=This is id of transaction: %s PAYPAL_ADD_PAYMENT_URL=Add the url of Paypal payment when you send a document by mail PAYPAL_IPN_MAIL_ADDRESS=E-mail address for the instant notification of payment (IPN) -PredefinedMailContentLink=You can click on the secure link below to make your payment via PayPal\n\n%s\n\n +PredefinedMailContentLink=You can click on the secure link below to make your payment (PayPal) if it is not already done.\n\n%s\n\n YouAreCurrentlyInSandboxMode=You are currently in the "sandbox" mode \ No newline at end of file diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang index 74d8a76804a..0567644a92d 100644 --- a/htdocs/langs/fr_FR/paypal.lang +++ b/htdocs/langs/fr_FR/paypal.lang @@ -16,5 +16,5 @@ PAYPAL_CSS_URL=Url optionnelle de la feuille de style CSS de la page de paiement ThisIsTransactionId=Voici l'identifiant de la transaction: %s PAYPAL_ADD_PAYMENT_URL=Ajouter l'url de paiement Paypal lors de l'envoi d'un document par mail PAYPAL_IPN_MAIL_ADDRESS=Adresse e-mail pour les notifications instantanées de paiement (IPN) -PredefinedMailContentLink=Vous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\n\n%s\n\n +PredefinedMailContentLink=Vous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement (Paypal) si ce dernier n'a pas encore été fait.\n\n%s\n\n YouAreCurrentlyInSandboxMode=Vous êtes actuellement dans le mode "sandbox" \ No newline at end of file From 8b244b0d61735628fb571492c9930c28fadc47b4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Feb 2013 19:21:40 +0100 Subject: [PATCH 4/5] Fix: select lost if error --- htdocs/comm/action/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 79500a94fd0..8940b1adfed 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -467,7 +467,7 @@ if ($action == 'create') if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.$langs->trans("Type").''; - if (GETPOST("actioncode")) + if (GETPOST("actioncode") && ! GETPOST('actioncode')) // Force selection only if not a post that fails { print ''."\n"; $cactioncomm->fetch(GETPOST("actioncode")); From d190e924b3e9ebc4fc8fc5039de13f76b4167461 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Feb 2013 19:43:40 +0100 Subject: [PATCH 5/5] Fix: Update of type was not working. --- htdocs/comm/action/class/actioncomm.class.php | 3 ++- htdocs/comm/action/fiche.php | 16 +++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 3e0a9043149..e39221921b0 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -459,7 +459,8 @@ class ActionComm extends CommonObject //print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep); $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; - $sql.= " SET percent='".$this->percentage."'"; + $sql.= " SET percent = '".$this->percentage."'"; + if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->fk_action."'"; $sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null"); $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 8940b1adfed..3e6d71752dd 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -311,6 +311,7 @@ if ($action == 'update') $datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); + $actioncomm->fk_action = dol_getIdFromCode($db, $_POST["actioncode"], 'c_actioncomm'); $actioncomm->label = $_POST["label"]; $actioncomm->datep = $datep; $actioncomm->datef = $datef; @@ -467,16 +468,7 @@ if ($action == 'create') if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''.$langs->trans("Type").''; - if (GETPOST("actioncode") && ! GETPOST('actioncode')) // Force selection only if not a post that fails - { - print ''."\n"; - $cactioncomm->fetch(GETPOST("actioncode")); - print $cactioncomm->getNomUrl(); - } - else - { - $htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto"); - } + $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$actioncomm->type_code, "actioncode","systemauto"); print ''; } else print ''; @@ -739,7 +731,9 @@ if ($id > 0) // Type if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.$langs->trans("Type").''.$act->type.''; + print ''.$langs->trans("Type").''; + $htmlactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$act->type_code, "actioncode","systemauto"); + print ''; } // Title