From 578c4ca3835ac327bceb3e2ad0233ec193de4f4b Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 19 Dec 2014 12:32:43 +0100 Subject: [PATCH 01/44] Update odt2pdf.sh Fix odt2pdf.sh --- scripts/odt2pdf/odt2pdf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/odt2pdf/odt2pdf.sh b/scripts/odt2pdf/odt2pdf.sh index 0599e4291c5..9d9bf18a8c7 100755 --- a/scripts/odt2pdf/odt2pdf.sh +++ b/scripts/odt2pdf/odt2pdf.sh @@ -22,7 +22,7 @@ if [ -f "$1.odt" ] nbprocess=$(pgrep -c soffice) if [ $nbprocess -ne 1 ] then - soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless& + soffice --invisible --accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard --headless & retcode=$? if [ $retcode -ne 0 ] then From 1c2c1ff3d877d31d12d870d319a7318a9e18e4f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Dec 2014 19:09:15 +0100 Subject: [PATCH 02/44] Update codesniffer to remove travis errors. --- dev/codesniffer/ruleset.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 7e4ae92274c..2b4cda4184b 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -21,6 +21,9 @@ 0 + + 0 + 0 From 11368e48fe9ea4c3d662477c64cd4298d4343521 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 00:11:12 +0100 Subject: [PATCH 03/44] Update codesniffer to remove travis errors. --- dev/codesniffer/ruleset.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index ae13a41fcb2..9cff30f457d 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -30,7 +30,10 @@ 0 - + + 0 + + 0 From beaec59ab6619ee799c30f9b3fff2af458fceb16 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 00:29:53 +0100 Subject: [PATCH 04/44] PHPCS --- htdocs/core/db/mysqli.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 7a964d07afc..f768a1115bd 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -351,7 +351,6 @@ class DoliDBMysqli extends DoliDB * @return int Nombre de lignes * @see num_rows */ - function affected_rows($resultset) { // If resultset not provided, we take the last used by connexion From 219cd0f8552c4e635ced30a32fe4c355290aa7cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 15:52:50 +0100 Subject: [PATCH 05/44] Fixed: Translation --- htdocs/langs/fr_FR/compta.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 5f0f1c522b9..daf273cee3d 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -199,7 +199,7 @@ AccountancyJournal=Code journal comptabilité COMPTA_PRODUCT_BUY_ACCOUNT=Code comptable par défaut pour l'achat de produits COMPTA_PRODUCT_SOLD_ACCOUNT=Code comptable par défaut pour la vente de produits COMPTA_SERVICE_BUY_ACCOUNT=Code comptable par défaut pour l'achat de services -COMPTA_SERVICE_SOLD_ACCOUNT=Code comptable par défaut pour la vente de produits +COMPTA_SERVICE_SOLD_ACCOUNT=Code comptable par défaut pour la vente de services COMPTA_VAT_ACCOUNT=Code comptable par défaut pour l'encaissement de TVA COMPTA_VAT_BUY_ACCOUNT=Code comptable par défaut pour le versement de la TVA COMPTA_ACCOUNT_CUSTOMER=Code comptable par défaut des tiers clients From 6f4ba2552dcdcb831d3201512fefd471e3f4df16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Dec 2014 10:14:51 +0100 Subject: [PATCH 06/44] Typo on conf variable --- htdocs/comm/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 0ac5d78aead..007a3964d18 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1312,7 +1312,7 @@ if ($action == 'create') print ''; // Bank Account - if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->module->banque->enabled) { + if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->banque->enabled) { print '' . $langs->trans('BankAccount') . ''; $form->select_comptes($fk_account, 'fk_account', 0, '', 1); print ''; From 3d9ce4c1dc3a01d08e9d03e73501fa3d6290becd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Dec 2014 10:32:11 +0100 Subject: [PATCH 07/44] Admin config for ask for payment bank during order --- htdocs/admin/commande.php | 51 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index a0f535c2b7b..aaa1949d7dd 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -147,7 +147,7 @@ if ($action == 'setModuleOptions') } // Activate a model -if ($action == 'set') +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } @@ -222,7 +222,7 @@ else if ($action == 'set_COMMANDE_FREE_TEXT') } } -//Activate Set Shippable Icon In List +// Activate Set Shippable Icon In List else if ($action=="setshippableiconinlist") { $setshippableiconinlist = GETPOST('value','int'); $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); @@ -234,6 +234,23 @@ else if ($action=="setshippableiconinlist") { } } +// Activate ask for payment bank +else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') +{ + $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + setEventMessage($langs->trans("SetupSaved")); + } + else + { + setEventMessage($langs->trans("Error"),'errors'); + } +} + /* * View @@ -576,6 +593,36 @@ if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { print ''; print ''; +// Ask for payment bank during order +if ($conf->banque->enabled) +{ + $var=!$var; + print ''; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '; + if (! empty($conf->use_javascript_ajax)) + { + print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER'); + } + else + { + if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } + } + print ''; +} +else +{ + $var=!$var; + print ''; + print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").' '.$langs->trans('NotAvailable').''; +} + print ''; print '
'; From 82d403c347f5c3c1343ce93b6ae47bf3219fda8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 21 Dec 2014 10:39:54 +0100 Subject: [PATCH 08/44] Update admin.lang --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f0dd8219f06..cbf898a67fc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1152,6 +1152,7 @@ ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes i FreeLegalTextOnOrders=Free text on orders WatermarkOnDraftOrders=Watermark on draft orders (none if empty) ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable +BANK_ASK_PAYMENT_BANK_DURING_ORDER=Ask for bank account destination of order ##### Clicktodial ##### ClickToDialSetup=Click To Dial module setup ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags
__PHONETO__ that will be replaced with the phone number of person to call
__PHONEFROM__ that will be replaced with phone number of calling person (yours)
__LOGIN__ that will be replaced with your clicktodial login (defined on your user card)
__PASS__ that will be replaced with your clicktodial password (defined on your user card). From 748bef6134a5f663c71fe409f4490a2caf04f8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Dec 2014 20:02:53 +0100 Subject: [PATCH 09/44] Translation error --- htdocs/langs/en_US/products.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 1e3027acd25..e290bd49c31 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -28,10 +28,10 @@ ProductsAndServicesStatistics=Products and Services statistics ProductsStatistics=Products statistics ProductsOnSell=Available products ProductsNotOnSell=Obsolete products -ProductsOnSellAndOnBuy=Products not for sale nor purchase +ProductsOnSellAndOnBuy=Products for sale and for purchase ServicesOnSell=Available services ServicesNotOnSell=Obsolete services -ServicesOnSellAndOnBuy=Services not for sale nor purchase +ServicesOnSellAndOnBuy=Services for sale and for purchase InternalRef=Internal reference LastRecorded=Last products/services on sell recorded LastRecordedProductsAndServices=Last %s recorded products/services From 46fe2c67e0a5ce2dbf82ba4b420154e1ae4d5940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 22 Dec 2014 22:32:05 +0100 Subject: [PATCH 10/44] Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks --- ChangeLog | 1 + htdocs/core/lib/functions2.lib.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a169a80654b..92b3911a14c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ Fix: Paypal link were broken dur to SSL v3 closed. - Fix: Show sender Country on PDF docs when sender Country <> receiver Country - Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS - Fix: [ bug #1749 ] Undefined $mailchimp +- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 4127686b459..4c2dd6e5189 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -738,7 +738,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql = "SELECT MAX(".$sqlstring.") as val"; $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; - $sql.= " AND ".$field." NOT LIKE '%PROV%'"; + $sql.= " AND ".$field." NOT LIKE '(PROV%)'"; $sql.= " AND entity IN (".getEntity($table, 1).")"; if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; From db301863867d9f1c48020a0897d9079e3e361358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 22 Dec 2014 22:52:43 +0100 Subject: [PATCH 11/44] Fix: [ bug #1731 ] Can't use quick navigation on project tasks secondary tabs --- ChangeLog | 1 + htdocs/projet/tasks/contact.php | 10 +++++----- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/time.php | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index a169a80654b..00a07efb2d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ Fix: Paypal link were broken dur to SSL v3 closed. - Fix: Show sender Country on PDF docs when sender Country <> receiver Country - Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS - Fix: [ bug #1749 ] Undefined $mailchimp +- Fix: [ bug #1731 ] Can't use quick navigation on project tasks secondary tabs ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index f0bdce25fca..8a6ebb0a3d4 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -57,7 +57,7 @@ $projectstatic = new Project($db); // Add new contact if ($action == 'addcontact' && $user->rights->projet->creer) { - $result = $object->fetch($id); + $result = $object->fetch($id, $ref); if ($result > 0 && $id > 0) { @@ -87,7 +87,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) // bascule du statut d'un contact if ($action == 'swapstatut' && $user->rights->projet->creer) { - if ($object->fetch($id)) + if ($object->fetch($id, $ref)) { $result=$object->swapContactStatus(GETPOST('ligne')); } @@ -100,7 +100,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) // Efface un contact if ($action == 'deleteline' && $user->rights->projet->creer) { - $object->fetch($id); + $object->fetch($id, $ref); $result = $object->delete_contact($_GET["lineid"]); if ($result >= 0) @@ -152,7 +152,7 @@ $userstatic = new User($db); if ($id > 0 || ! empty($ref)) { - if ($object->fetch($id) > 0) + if ($object->fetch($id, $ref) > 0) { $result=$projectstatic->fetch($object->fk_project); if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); @@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref)) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 50763f839f7..03ca7bae452 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -209,7 +209,7 @@ if ($object->id > 0) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; print ''; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index a6f8846ce0e..04e92c7c7f2 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -181,7 +181,7 @@ if ($object->id > 0) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 7136ffc43c5..8f72510adba 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -72,7 +72,7 @@ if ($action == 'addtimespent' && $user->rights->projet->creer) if (! $error) { - $object->fetch($id); + $object->fetch($id, $ref); $object->timespent_note = $_POST["timespent_note"]; $object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds @@ -109,7 +109,7 @@ if ($action == 'updateline' && ! $_POST["cancel"] && $user->rights->projet->cree if (! $error) { - $object->fetch($id); + $object->fetch($id, $ref); $object->timespent_id = $_POST["lineid"]; $object->timespent_note = $_POST["timespent_note_line"]; @@ -183,7 +183,7 @@ if ($id > 0 || ! empty($ref)) /* * Fiche projet en mode visu */ - if ($object->fetch($id) >= 0) + if ($object->fetch($id, $ref) >= 0) { $result=$projectstatic->fetch($object->fk_project); if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); @@ -277,7 +277,7 @@ if ($id > 0 || ! empty($ref)) $object->next_prev_filter=" fk_projet in (".$projectsListId.")"; } else $object->next_prev_filter=" fk_projet = ".$projectstatic->id; - print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); + print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param); print ''; // Label From 56eddeade17904ddd5eb55dc6f0b23cc4a152d39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 02:36:01 +0100 Subject: [PATCH 12/44] Fix merge changelog --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a169a80654b..5f468fa452d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,6 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 3.5.7 compared to 3.5.6 ***** -Fix: Paypal link were broken dur to SSL v3 closed. - ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: bug 1588 : relative discount. @@ -154,6 +151,9 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f - Remove add_photo_web() that is ot used anymore by core code. +***** ChangeLog for 3.5.7 compared to 3.5.6 ***** +Fix: Paypal link were broken dur to SSL v3 closed. + ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 Fix: Can't update phone_pro from web service From 3212fd2b27973d248e8ab7e36746a7ee63186a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 11:00:18 +0100 Subject: [PATCH 13/44] Fix: [ bug #1649 ] Cancel button of several thirdparty actions, does the same thing as modify --- ChangeLog | 1 + htdocs/comm/fiche.php | 30 +++++++++++++++++++----------- htdocs/fourn/fiche.php | 20 ++++++++++++-------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f468fa452d..0e00afbbda0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ English Dolibarr ChangeLog - Fix: Show sender Country on PDF docs when sender Country <> receiver Country - Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS - Fix: [ bug #1749 ] Undefined $mailchimp +- Fix: [ bug #1649 ] Cancel button of several thirdparty actions, does the same thing as modify ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 7ba1cc8bc48..307a8c57385 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -79,17 +79,21 @@ $object = new Societe($db); $parameters = array('socid' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some +//Some actions show a "cancel" input submit button with name="cancel" +$cancelbutton = GETPOST('cancel'); if ($action == 'setcustomeraccountancycode') { - $result=$object->fetch($id); - $object->code_compta=$_POST["customeraccountancycode"]; - $result=$object->update($object->id,$user,1,1,0); - if ($result < 0) - { - $mesgs[]=join(',',$object->errors); + if (!$cancelbutton) { + $result=$object->fetch($id); + $object->code_compta=$_POST["customeraccountancycode"]; + $result=$object->update($object->id,$user,1,1,0); + if ($result < 0) + { + $mesgs[]=join(',',$object->errors); + } + $action=""; } - $action=""; } // conditions de reglement @@ -139,10 +143,14 @@ if ($action == 'cstc') // Update communication level if ($action == 'setOutstandingBill') { - $object->fetch($id); - $object->outstanding_limit=GETPOST('OutstandingBill'); - $result=$object->set_OutstandingBill($user); - if ($result < 0) setEventMessage($object->error,'errors'); + if (!$cancelbutton) { + $object->fetch($id); + $object->outstanding_limit = GETPOST('OutstandingBill'); + $result = $object->set_OutstandingBill($user); + if ($result < 0) { + setEventMessage($object->error, 'errors'); + } + } } diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 2719f9e0a9b..b4ceb2ae1b0 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -60,14 +60,18 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action if ($action == 'setsupplieraccountancycode') { - $result=$object->fetch($id); - $object->code_compta_fournisseur=$_POST["supplieraccountancycode"]; - $result=$object->update($object->id,$user,1,0,1); - if ($result < 0) - { - $mesg=join(',',$object->errors); - } - $action=""; + $cancelbutton = GETPOST('cancel'); + + if (!$cancelbutton) { + + $result = $object->fetch($id); + $object->code_compta_fournisseur = $_POST["supplieraccountancycode"]; + $result = $object->update($object->id, $user, 1, 0, 1); + if ($result < 0) { + $mesg = join(',', $object->errors); + } + $action = ""; + } } // conditions de reglement if ($action == 'setconditions' && $user->rights->societe->creer) From 8a1440997403cf077ebdd8ee4ddd503edbd38e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 11:39:43 +0100 Subject: [PATCH 14/44] Fix: [ bug #1533 ] Links triggers do not show trigger error message --- ChangeLog | 1 + htdocs/core/class/link.class.php | 3 ++- htdocs/core/tpl/document_actions_pre_headers.tpl.php | 9 +++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ec86761300..de2f3618cc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -100,6 +100,7 @@ For users: - Fix: [ bug #1501 ] DEPLACEMENT_CREATE trigger do not intercept trigger action - Fix: [ bug #1506, #1507 ] ECM trigger error problem - Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message +- Fix: [ bug #1533 ] Links triggers do not show trigger error message - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown - Fix: datepicker first day of week can be monday by setting into display setup diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index dce575a1d47..0cdc6a8c4a8 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -187,7 +187,7 @@ class Link extends CommonObject { // Call trigger $result=$this->call_trigger('LINK_MODIFY',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers } @@ -197,6 +197,7 @@ class Link extends CommonObject $this->db->commit(); return 1; } else { + setEventMessages('', $this->errors, 'errors'); $this->db->rollback(); return -1; } diff --git a/htdocs/core/tpl/document_actions_pre_headers.tpl.php b/htdocs/core/tpl/document_actions_pre_headers.tpl.php index a4d97e7defb..36b6ce75fe1 100644 --- a/htdocs/core/tpl/document_actions_pre_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_pre_headers.tpl.php @@ -72,11 +72,16 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $link->id = $linkid; $link->fetch(); $res = $link->delete($user); + $langs->load('link'); - if ($res) { + if ($res > 0) { setEventMessage($langs->trans("LinkRemoved", $link->label)); } else { - setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); + if (count($link->errors)) { + setEventMessages('', $link->errors, 'errors'); + } else { + setEventMessage($langs->trans("ErrorFailedToDeleteLink", $link->label), 'errors'); + } } } header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id.(!empty($withproject)?'&withproject=1':'')); From e8addcb8ba2df0c292f47cd14fe2b6fdcb9e968f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 12:25:21 +0100 Subject: [PATCH 15/44] Fixed: [ bug #1756 ] PHP error while removing an import profile --- htdocs/core/tpl/extrafields_view.tpl.php | 15 ++++++++------- htdocs/imports/class/import.class.php | 7 ++++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index ad2fa068757..7f0115b83bc 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -33,13 +33,13 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) { if ($action == 'edit_extras') { - $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); + $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]); } else { - $value = $object->array_options ["options_" . $key]; + $value = $object->array_options["options_" . $key]; } - if ($extrafields->attribute_type [$key] == 'separate') + if ($extrafields->attribute_type[$key] == 'separate') { print $extrafields->showSeparator($key); } @@ -47,7 +47,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) { print ''; print 'attribute_required [$key])) print ' class="fieldrequired"'; + //var_dump($action);exit; + if ((! empty($action) && $action != 'view') && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; print '>' . $label . ''; //TODO Improve element and rights detection @@ -67,8 +68,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print ''; - if (! empty($conf->browser->phone)) print '
'; + if (! empty($conf->browser->phone)) print '
'; else print '
'; // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); + if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) { + $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options['options_' . $key]); } //TODO Improve element and rights detection @@ -77,7 +78,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print '
'; print ''; print ''; - print ''; + print ''; print ''; print $extrafields->showInputField($key, $value); diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 58a1bf3e931..b846d158227 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -22,8 +22,7 @@ */ /** - * \class Import - * \brief Class to manage imports + * Class to manage imports */ class Import { @@ -313,10 +312,12 @@ class Import { if (! $notrigger) { + /* Not used. This is not a business object. To convert it we must herit from CommonObject // Call trigger $result=$this->call_trigger('IMPORT_DELETE',$user); - if ($result < 0) $error++; + if ($result < 0) $error++; // End call triggers + */ } } From acf7b9f130bb1e45ce34d819615afc4224572c97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 12:59:34 +0100 Subject: [PATCH 16/44] Because this is a legal issue (OPCA), i added the hidden constant for 3.7: WORKFLOW_PROPAL_CAN_CLASSIFY_BILLED_WITHOUT_INVOICES => Button "Classified Billed" is visible on proposal even if there is no invoice linked to proposal. Fixed: Also fix get list of invoice that report too many data. --- htdocs/comm/propal.php | 8 +++++--- htdocs/comm/propal/class/propal.class.php | 9 ++++++--- htdocs/core/class/commonobject.class.php | 2 +- htdocs/langs/en_US/workflow.lang | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 0ac5d78aead..0143e20ba77 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2109,12 +2109,14 @@ if ($action == 'create') // Create an invoice and classify billed if ($object->statut == 2) { - if (! empty($conf->facture->enabled) && $user->rights->facture->creer) { + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) + { print ''; } - $arraypropal = $object->getInvoiceArrayList(); - if (is_array($arraypropal) && count($arraypropal) > 0) { + $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); + if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || ! empty($conf->global->WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES)) + { print ''; } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index fb9d5257d49..be22043e4b5 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1987,16 +1987,19 @@ class Propal extends CommonObject { $linkedInvoices[] = $objectid[$i]; } - // Cas des factures liees via la commande + // Cas des factures liees par un autre objet (ex: commande) else - { + { $this->fetchObjectLinked($objectid[$i],$objecttype); foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid) { $numj=count($subobjectid); for ($j=0;$j<$numj;$j++) { - $linkedInvoices[] = $subobjectid[$j]; + if ($subobjecttype == 'facture') + { + $linkedInvoices[] = $subobjectid[$j]; + } } } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1a9195e069d..54c7b9d860d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1851,7 +1851,7 @@ abstract class CommonObject } } else - { + { $sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')"; $sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')"; } diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index d4ecf42b997..e08c88a9170 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - admin WorkflowSetup=Workflow module setup -WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can enabled automatic actions that you are interesting in. +WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is opened (you make thing in order you want). You can activate the automatic actions that you are interesting in. ThereIsNoWorkflowToModify=There is no workflow you can modify for module you have activated. descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Create a customer order automatically after a commercial proposal is signed descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Create a customer invoice automatically after a commercial proposal is signed From aa618d481b00b683ede0184fc8f54b31e87921bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 13:07:16 +0100 Subject: [PATCH 17/44] Fixed: [ bug #1690 ] Sorting on salary table triggers SQL errors --- htdocs/compta/charges/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index dd6455a3932..ca03e11bcba 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -102,7 +102,7 @@ if ($conf->salaries->enabled) // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire $sql.= " AND s.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } - if (preg_match('/^s/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + if (preg_match('/^s\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); $result = $db->query($sql); if ($result) @@ -204,7 +204,7 @@ if ($conf->tax->enabled) $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; } - if (! preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + if (preg_match('/^cs\./',$sortfield) || preg_match('/^c\./',$sortfield) || preg_match('/^pc\./',$sortfield) || preg_match('/^pct\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); //$sql.= $db->plimit($limit+1,$offset); //print $sql; @@ -295,7 +295,7 @@ if ($conf->tax->enabled) // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire $sql.= " AND pv.datev between '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } - if (preg_match('/^pv/',$sortfield)) $sql.= $db->order($sortfield,$sortorder); + if (preg_match('/^pv\./',$sortfield)) $sql.= $db->order($sortfield,$sortorder); $result = $db->query($sql); if ($result) From 2b4edd999670eadc3104d0496ed2973d553b73e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 13:21:40 +0100 Subject: [PATCH 18/44] Fix: [ bug #1687 ] The ref filter searches on ref and rowid in supplier invoices list --- htdocs/fourn/facture/list.php | 2 +- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 357df92a4eb..2a01602eadc 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -150,7 +150,7 @@ if ($filter && $filter != -1) // GETPOST('filtre') may be a string if ($search_ref) { - if (is_numeric($search_ref)) $sql .= natural_search(array('fac.rowid', 'fac.ref'), $search_ref);// For backward compatibility + if (is_numeric($search_ref)) $sql .= natural_search(array('fac.ref'), $search_ref); else $sql .= natural_search('fac.ref', $search_ref); } if (search_ref_supplier) 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 e2c586de47f..2281793929f 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1136,6 +1136,8 @@ ALTER TABLE llx_facture_fourn MODIFY COLUMN ref VARCHAR(255); ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_ext VARCHAR(255); ALTER TABLE llx_facture_fourn MODIFY COLUMN ref_supplier VARCHAR(255); +UPDATE llx_facture_fourn SET ref = rowid WHERE ref IS NULL or ref = ''; + ALTER TABLE llx_facture_rec ADD COLUMN revenuestamp double(24,8) DEFAULT 0; ALTER TABLE llx_facturedet_rec MODIFY COLUMN tva_tx double(6,3); ALTER TABLE llx_facturedet_rec ADD COLUMN fk_contract_line integer NULL; From a90a03412ab292966f8c02baa9ee2743ac3a9824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 15:43:45 +0100 Subject: [PATCH 19/44] Fixed string not translated in linked objects of a project --- htdocs/projet/element.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 4a0c70e04af..28f41370d5f 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -373,8 +373,10 @@ foreach ($listofreferent as $key => $value) } } +$langs->load('margins'); + // Margin display of the project -print_titre("Margin"); +print_titre($langs->trans("Margins")); print ''; print ''; print ''; From 78307a748dc3c66e1855ccf3aa50258201ad6654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 15:56:29 +0100 Subject: [PATCH 20/44] Corrected confusing table header in task list --- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/tasks/index.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index a37e9651bcc..e9d04c8c8db 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -3,6 +3,7 @@ RefProject=Ref. project ProjectId=Project Id Project=Project Projects=Projects +ProjectStatus=Project status SharedProject=Everybody PrivateProject=Contacts of project MyProjectsDesc=This view is limited to projects you are a contact for (whatever is the type). diff --git a/htdocs/projet/tasks/index.php b/htdocs/projet/tasks/index.php index ec23afb1902..94711b4d92e 100644 --- a/htdocs/projet/tasks/index.php +++ b/htdocs/projet/tasks/index.php @@ -97,7 +97,7 @@ print '
'.$langs->trans("Element").'
'; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; From 743867b91b8305eed0125acb9328355ffc169a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 15:57:30 +0100 Subject: [PATCH 21/44] Spanish translation --- htdocs/langs/es_ES/projects.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/es_ES/projects.lang b/htdocs/langs/es_ES/projects.lang index 988b3e545c8..f393616f898 100644 --- a/htdocs/langs/es_ES/projects.lang +++ b/htdocs/langs/es_ES/projects.lang @@ -3,6 +3,7 @@ RefProject=Ref. proyecto ProjectId=Id proyecto Project=Proyecto Projects=Proyectos +ProjectStatus=Estado del proyecto SharedProject=Proyecto compartido PrivateProject=Contactos del proyecto MyProjectsDesc=Esta vista muestra aquellos proyectos en los que usted es un contacto afectado (cualquier tipo). From 416f13c708cbfbff3e0ff0e1997867e3b37b9a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 16:00:04 +0100 Subject: [PATCH 22/44] Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H --- ChangeLog | 1 + htdocs/margin/agentMargins.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 949492346b2..d24728054e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index e618931ee77..da7bf758f1d 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -57,9 +57,9 @@ $pagenext = $page + 1; $startdate=$enddate=''; if (!empty($_POST['startdatemonth'])) - $startdate = dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); + $startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']); if (!empty($_POST['enddatemonth'])) - $enddate = dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); + $enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']); /* * View From 034455fc2d0e55724ae6d1ad2e80f35d04e9ac5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 23 Dec 2014 16:37:53 +0100 Subject: [PATCH 23/44] Fix: [ bug #1722 ] Missing link in homepage project's box --- htdocs/core/boxes/box_project.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 62ed89dd65b..57863100999 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -1,5 +1,6 @@ + * Copyright (C) 2014 Marcos García * 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 @@ -45,7 +46,7 @@ class box_project extends ModeleBoxes $langs->load("boxes"); $langs->load("projects"); - $this->boxlabel="Projet"; + $this->boxlabel="Projects"; } /** @@ -63,13 +64,8 @@ class box_project extends ModeleBoxes $totalMnt = 0; $totalnb = 0; $totalnbTask=0; - include_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); - require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php"); - $projectstatic=new Project($db); - - - $textHead = $langs->trans("Projet"); + $textHead = $langs->trans("Projects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the orders @@ -91,14 +87,15 @@ class box_project extends ModeleBoxes $i = 0; while ($i < $num) { - $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_projectpub'); - $objp = $db->fetch_object($result); - $projectstatic->fetch($objp->rowid); + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', + 'logo' => 'object_project', + 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid); $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' =>$projectstatic->getNomUrl(1) - ); + 'text' => $objp->ref, + 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid); $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->title From d03cc03cd7ed5fcaef5d26e1912ecc8d82852287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 23 Dec 2014 16:42:05 +0100 Subject: [PATCH 24/44] Enhance select_salesrepresentatives with select2 --- htdocs/core/class/html.formother.class.php | 38 ++++++++++++++-------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d6cf08594bb..4f0439d7b3c 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -356,9 +356,18 @@ class FormOther global $conf,$langs; $langs->load('users'); + $out = ''; + $nodatarole = ''; + // Enhance with select2 + if ($conf->use_javascript_ajax) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname); + $nodatarole=' data-role="none"'; + } // Select each sales and print them in a select input - $moreforfilter =''; + $out.=''; // Get list of users allowed to be viewed $sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login"; @@ -383,34 +392,35 @@ class FormOther { while ($obj_usr = $this->db->fetch_object($resql_usr)) { - $moreforfilter.=''; + $out.=($moreinfo?')':''); + $out.=''; } $this->db->free($resql_usr); } @@ -418,9 +428,9 @@ class FormOther { dol_print_error($this->db); } - $moreforfilter.=''; + $out.=''; - return $moreforfilter; + return $out; } /** From b7dbb1e9cd1e7f8926d7c8ad5ff525d59f5d148b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 17:46:30 +0100 Subject: [PATCH 25/44] Fixed: Do not show disabled user when creating a new event. --- htdocs/comm/action/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 8a2c602a3f0..180dbcddb30 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -678,7 +678,7 @@ if ($action == 'create') $listofuserid=dol_json_decode($_SESSION['assignedtouser'], true); } } - print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); + print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0'); if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': '.$langs->trans("Busy"); print ''; @@ -925,7 +925,7 @@ if ($id > 0) $listofuserid=dol_json_decode($_SESSION['assignedtouser'], true); } } - print $form->select_dolusers_forevent(($action=='create'?'add':'update'),'assignedtouser',1); + print $form->select_dolusers_forevent(($action=='create'?'add':'update'), 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, 'AND u.statut != 0'); if (in_array($user->id,array_keys($listofuserid))) print $langs->trans("MyAvailability").': id]['transparency']?' checked="checked"':'').'">'.$langs->trans("Busy"); print ''; From a111c4765c250c9008e16de5d1c5ab2f46e3800d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Dec 2014 18:00:14 +0100 Subject: [PATCH 26/44] Fixed: Filter lost with navigation --- htdocs/fichinter/list.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9030cd9c4ac..851077b510f 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -121,7 +121,13 @@ if ($result) { $num = $db->num_rows($result); - $urlparam="&socid=$socid"; + $urlparam=''; + if ($socid) $urlparam.="&socid=".$socid; + if ($search_ref) $urlparam.="&search_ref=".urlencode($search_ref); + if ($search_company) $urlparam.="&search_company=".urlencode($search_company); + if ($search_desc) $urlparam.="&search_desc=".urlencode($search_desc); + if ($search_status != '' && $search_status > -1) $urlparam.="&search_status=".urlencode($search_status); + print_barre_liste($langs->trans("ListOfInterventions"), $page, $_SERVER['PHP_SELF'], $urlparam, $sortfield, $sortorder, '', $num); print ''."\n"; @@ -193,7 +199,7 @@ if ($result) print ''; } print ''; - + print ''; print "\n"; @@ -207,7 +213,7 @@ if ($result) print ''; print ''; } - + print '
'.$langs->trans("Project").''.$langs->trans("Status").''.$langs->trans("ProjectStatus").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("DateStart").'
'.convertSecondToTime($objp->duree).''.$interventionstatic->LibStatut($objp->fk_statut,5).' 
'.convertSecondToTime($total).'  
'; print "\n"; $db->free($result); From b68276637bd2adfe7192546ffebfcb1688b86c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Wed, 24 Dec 2014 14:31:17 +0100 Subject: [PATCH 27/44] Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks Conflicts: htdocs/core/lib/functions2.lib.php --- ChangeLog | 1 + htdocs/core/lib/functions2.lib.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5ec86761300..7b5447aed23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -181,6 +181,7 @@ Dolibarr better: - Fix: Show sender Country on PDF docs when sender Country <> receiver Country - Fix: [ bug #1624 ] Use lowest buying price for margin when selling with POS - Fix: [ bug #1749 ] Undefined $mailchimp +- Fix: [ bug #1736 ] Failing supplier Elephant numeration module with some masks ***** ChangeLog for 3.6.1 compared to 3.6.* ***** For users: diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 246af863d12..219d0074813 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -784,9 +784,10 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $sql = "SELECT MAX(".$sqlstring.") as val"; $sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; - $sql.= " AND ".$field." NOT LIKE '%PROV%'"; + $sql.= " AND ".$field." NOT LIKE '(PROV%)'"; if ($bentityon) // only if entity enable $sql.= " AND entity IN (".getEntity($table, 1).")"; + if ($where) $sql.=$where; if ($sqlwhere) $sql.=' AND '.$sqlwhere; From 09a094104cc8199b825a3e6a7acb1fd70d78c267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 18:31:24 +0100 Subject: [PATCH 28/44] Removed duplicated and unused translation key --- htdocs/langs/en_US/projects.lang | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 8d5d7c26a53..74204a176e4 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -11,7 +11,6 @@ ProjectsDesc=This view presents all projects (your user permissions grant you pe MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type). TasksPublicDesc=This view presents all projects and tasks you are allowed to read. TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything). -Myprojects=My projects ProjectsArea=Projects area NewProject=New project AddProject=Create project From 146bba90e73f2ebbf92417d8b341a0f7d6bb252a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 18:42:26 +0100 Subject: [PATCH 29/44] Fix: [ bug #1724 ] Can't add a submenu to projects --- ChangeLog | 1 + htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b5447aed23..e6509e65d99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -149,6 +149,7 @@ For developers: - Qual: Renamed all files & links "fiche.php" into "card.php". - Qual: Replace all constants COMPTA_* by ACCOUNTING_*. - Qual: Replace all constants ACCOUNTINGEX_* by ACCOUNTING_* to simplify migration of the module +- Fix: [ bug #1724 ] Can't add a submenu to projects WARNING: Following changes may create regression for some external modules, but was necessary to make Dolibarr better: diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 06a187fd7de..7acce783e39 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -232,7 +232,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3610__+MAX_llx_menu__, 'project', 'myprojects', 7__+MAX_llx_menu__, '/projet/index.php?leftmenu=projects&mode=mine', 'MyProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3611__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/card.php?leftmenu=projects&action=create&mode=mine', 'NewProject', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3612__+MAX_llx_menu__, 'project', '', 3610__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects&mode=mine', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 781de5f2913..74d6b95df73 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1132,12 +1132,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->load("projects"); // Project affected to user - $newmenu->add("/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); + $newmenu->add("/projet/index.php?leftmenu=projects&mode=mine", $langs->trans("MyProjects"), 0, $user->rights->projet->lire, '', $mainmenu, 'myprojects'); $newmenu->add("/projet/card.php?leftmenu=projects&action=create&mode=mine", $langs->trans("NewProject"), 1, $user->rights->projet->creer); $newmenu->add("/projet/list.php?leftmenu=projects&mode=mine", $langs->trans("List"), 1, $user->rights->projet->lire); // All project i have permission on - $newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire); + $newmenu->add("/projet/index.php?leftmenu=projects", $langs->trans("Projects"), 0, $user->rights->projet->lire && $user->rights->projet->lire, '', $mainmenu, 'projects'); $newmenu->add("/projet/card.php?leftmenu=projects&action=create", $langs->trans("NewProject"), 1, $user->rights->projet->creer && $user->rights->projet->creer); $newmenu->add("/projet/list.php?leftmenu=projects", $langs->trans("List"), 1, $user->rights->projet->lire && $user->rights->projet->lire); From f735aa676e30b5f07e01c63f6387827ad4a579fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 19:16:25 +0100 Subject: [PATCH 30/44] Fix: [ bug #1674 ] PayPal logo copyright issues --- htdocs/paypal/admin/paypal.php | 2 +- htdocs/paypal/img/object_paypal.png | Bin 1055 -> 4438 bytes htdocs/paypal/img/paypal.png | Bin 1684 -> 0 bytes htdocs/paypal/img/paypal_logo.png | Bin 1159 -> 0 bytes 4 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 htdocs/paypal/img/paypal.png delete mode 100644 htdocs/paypal/img/paypal_logo.png diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 69b0664eb9d..e3dff71b721 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -93,7 +93,7 @@ llxHeader('',$langs->trans("PaypalSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre(' - '.$langs->trans("ModuleSetup"),$linkback,'paypal_logo@paypal'); +print_fiche_titre($langs->trans("ModuleSetup").' PayPal',$linkback); print '
'; $head=paypaladmin_prepare_head(); diff --git a/htdocs/paypal/img/object_paypal.png b/htdocs/paypal/img/object_paypal.png index 4ff3c80565df25279d900d6cee4d29676f0676d5..6b1f28eb73ea2cee17cdabbfd316134f42dec56b 100644 GIT binary patch literal 4438 zcmbtY3s@6Z77n7KxKbZjwBqL&T~TW?c@fN*46gvjHJAccR;@ZrhGZm@8E1w!wN%~u zet^Y_FSOPc7ORUEtHt8uQ}L~+D;24t+jUvns`buuK6f6cV5z;d1Rf zmLsuq!<|Oj?C1#&XGw-9X*(p?#nR|ZUMCg{j@&=4I4Q78s+SaIaX7Yr1G zJ3^nSaUU2s4=vC(8WBCgl39c~o~0?rsWBMK5kdxa;7oM5xpeG2u#;Tpp*?#KtM()%sYuew-#;789<8J3wD44wq#!jb{oOby+sI zTORj1%O22n%UZa@Rvp#vEJ{}%44rOA)45ZpT@R>-QK}tFF0q#AAQ>Uxcsx(}cj?0uXOew=P@-#W7iZH8*aAkxBm#byC*_9Fj z;$@~Sifq!%TmMZ)US0Px0`kCOI8T^Sg-ouJ$W#)ACPl776cOMhRmwFISp*_;<+xqh z%Svop9+N?8voV%HplG3QKn9@zk_gP4J92nV^!N@<1%XD|`0azY+UBVa%a>nG*mXs1)CYM8M zwN$POSF7b?A&>=y(0OEP3CKdY8f2lZlZf3u|IZ%wik;4SSX+O6Ey1=c{wEF2rTxD( zH2`LiSeC$enoXf;&|sVyHCbt%=BzXW#U`tvQAP|W?Sf!57zP}a-_BP$F_3stcc)y} zhHWP$C)R_UJ0-OCqjGVgN6YbU2puBow3&z@C$^pPJ4DoJyAZ?fQ-_7}@i_KZ7r<=P zE^rsOTjahfgdN-u)_D;ecgsl>?wja!LrpAgVF``{ofoy!E~@g7d8x;cJjW0$L*@`R zROw>JSA<@GHs*9NK8L!<&`aut@ggu^Eb8JeZxY23S2OZ#Fm9oz8yvA=c1tE;ArJZ# zMhf8&VlWHrAqH9TsjdZLiZ+w!q%WFOX`~8`(oK^dsvdDT2QtJtASTjg!i4cw6vk;g z55^A12GYPl4Tj~K2rbWaN<5Zz7IcmpS=2LwVVYhV9 zcL}`#lUWjE4HM>mq0$`oJ!KyHUW|plhOiuinVB=Q zJHutwWYnmK@49jR%m(^)zOrT^$~K=E4A=kAx?x)Qm*}0NZ&Idx`{$pnzIUXt1eTUX z=7(=pCEvNex?1;sYnS~kHWGO7UhpKU41Y!=J8+ef3yE^-=KZ{{q}04VNq}I z*fTdFPXT?g4<4c$-!RPdvcI+UQFFq>mrb{$?jA<+9uQe{!DA6LecghI_u-S}>IKZR z1ucEwJMoVPn?K(ccD-um9}6b4E!|Jd$>u-OEwxV{cvv*zvG~1)?`}u^`cu6%BC6N< zZ|BY3{%%W`f!7RnyXCFIO~1Q^9_dkfy#B!P)_F0NC$o!6|MKlmeBhyziDwU;%K2zz z%a-Mz-&|N3u-MditL2TzFRQjq=p)-X>e#{H!UuogCh?8S9xgCluBMhB{pHHqrd7xH zBm@UZQmyR6w5B;%wAIz?$0VN$&U<^p#)cn~Pqui6;qc?0{kJV-2aS55o0wH>7%^z*lbe;R zh(Z1-V@l2>;RS1p2VDN4WoTK?Us|!ckGF{8OTvowmS$9hmL?SU-ZFL9%kp!Z4gP%w zoN5hf{QW2WmxYcsvRA9tNN#2ornbgE;x7D{5pg*nY-ZPY*EQ(7Z=JO=8}E$`-%TPdP;GxfwKpv zTs|YO)jVGE?EaJKMVVdD#-(-7-*5i8oUipO?iP7V6?r5`H?e-?tX(&DwFc)8RLDh5 zVV_Y4&4K#Rb(5jW<7`a-kU3)iyS=`7daZicJiL1A;>A4iq9Vllv|)5@$;ya|TK}+B zhtC~2MP1cEtql=(ex82%bk(9^Yn}wnt9|$=b8ku5n>91?&VCj5aUm7kaQFLTjTfic zROWvE535gy4E^v{dT~bIxic=Dx|qAUHyMaiFJAbs?=z)!c5;*OMTy7|m#E(vGkgBO E0AB_H&j0`b literal 1055 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh3?wzC-F*zC*h@TpUD!lvNA9*GX(gAxB|r)7?~NFSs0kvS%83* zm4%g!fsKcSlaGO0oQ+4AonM@RN0LEImq${STi!%M#gIYSLsZ8}#xhjiK90dCl@W-H z)0lwBB#qf5jm0#b)hvSzh|DuMEV4MQvbe0Wd8~8z?DEvDe6`ISg&Ycm91DaU3&dQC zBwULn-AbfAN@YFE*u!UA_P6+I<(c9KN*e z#I5ZoZ|^#Bb@!=T`%d53f9A%)^LLJ1xO42{-4jns?yu!yrP000>X1^@s6#OZ}&0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU&Hc3Q5RCwBqR%vV-RS=%teY@-R700gY zm?n19Bqa%Lm6l$lKvhc1Srzz!03jhH1PCPlA^Haigg`=-I0OO-ajOy%DrW=;DnL*{ z15wihNUAn8hvOW!<6~{F_g?00nqs#Fb)+YI*YCZV`R4m(%zXCq30N}1v9M68`k#IC ziv#27+)iK_9WG@KfJfw6N#y530qv08aoAh3Qmg`|BTl|J|8XwxgmN zP^xMO1_LZlSfGohXFE2`WQ%?DK!e#fFqZ8Q!s#604BQA{nBacao5({UFRyt1t$`PQ z8=Z!#YT{K45Z$uf-#NUvRIaVa7Rz03gmn%=L0|s5^<59QUlBf*mla;A8BNof{N9tN zryo~!vkBO`%n|ajRHlD!p|T^=6f9z3#|WGYhGSTm%azvE6fNjNuw;e>8?H>ezkNg3 zCzYCtJ{<^RF;^#-|K7baKK$XpuLr?l+&V46DA%->v8maXzfz?aq9N%X)+2I2mro)v zp3dF?=Q69K9JIxn59tVxKo(;P`n}NE8iT&oiJyFasQ^yh8Fb>97BLNDwv5C$`18m< z7E=ehN)-(zXY(5yQpczzNi21@xBL-q@Wf5(PA1dYzGq(l^xN~|TM}b^Fy|bEn*Hflp1k+YtZeoVj!r+qAWAEi1%_A+(<_!0 zX?CHs<{}Zg+{SkTe_qw@r>D_OJKXx342pntluW9>$ zcqJYt(hF;I#cD?bv+CH=&`RicEH3@zc;bY^fuS{BZToli_Z`eD)*WwuHT(_=G;EkQ z+`6^v)y+MvM+h3E<_lXuH{7<+V7lq}0@54?Qe}X#b=|6pBFRTWfr)4+Fx=V_`7s&^ zkI9<7>DN>9U!}68TV1|j5L~|Q_ zV^}smsj7BZxSu8}34D3os>t&|`b@cVzPA)eS{QC&_r^xLmWNr>3$G;${{Hnj8&EBRF#$>|Z82 zk#T6vTwx#es0*bUmeMnwJuFJ#ei3+ zT)!^4+vnkjlCcnAVNtv#Xu|fQAaw;~TUpVNXg2c1xrjStVs>FOT=<^jptCJ@Xs%GX z(?E5{n*E2n6Oo}R4k8sPPw~g`0u*l(7wfX_zXvIMdUAf-g-~I{x%l!h4mx=!?FR9% z|925}62R$6htU7rcWEc4?F3wXP*GvjU|X22zMbne+fbxo`B#~rk9UQj-&>6!+D<6cJ zg)#th8BW^b%b>S2Nm+s&{B*FQsJ+;pHIG2bsEyK|YgWJ5*Aa7}syF)QV{pWVR941Y e{@=+z0t^7d5b}>|q?B?10000^@RCwCFmS=2@Q5eV1``+8?txIbZ z(TY&JYQ(M)#E$)e=m$a~))yg02q6(MVz2ljcEpOr3?i{b8`R!S)F^e)O4Yc-|7ri1 zr>~0EdXiu6x$k?{2&CLf`j0d`BMo7ja|N?iA-v5jAdi@ z;9xxMMtuS5djSrCXJy=dBuE0MK_-X>Ic_yU#*;w@Dzm6C2lN7K!P!4D(6&wRL!R+J ze`MSV^=Z=zBwb8^Q5X?pz7X1`WVxa33_4v)gJ?B51|23-~y>20eRNz5jiI z=logsO)%G2)7Y-|N}m|^3B-Y+jGC^c+_eRb6S)f>f+HYJd$28t;)ngyT5^4)eYiJn+a1LZ6d!WrCC z^u=?&q|F&{QJr0+0HkxA6AsI;wBfIW$!_L_aFPZZdUOm}R>Cb7(6B~e0-wn(p5u59 zm}Y_jV|gkJu)HyCOfVGIw+G~rqcl+DBS>X>I7Mp2Sg;wiJsOYXJGGQaKKsgq;32MD~ z=^mKLcMZXK8Yj-_&fjFtze*<*D=Z?lK@*OndGnI=_0-&ztWYB78S~9RWflp!tj9d; zM_y2P{Q^+lghFqva-Qi{w70VHe`&^d9(pjK@g`0=#pq_05ow!hLtqYB7&iv@hyy^{V@uo$d zvjBadk%s%M{}w)$z0Qt}lYW?@^zEaLmh?mljZ37yfegL=)VG@JBwufVa3#*>{~tV< zpsJ9>_EO%WQ--q=iYx>t_`j7Z&pwVNR9k~O;T8|?&9=R<`L;JkJei^j+6soeQwFnT zh%928@~C2XhpnYG|7R%u#SHAh&@(I`_kPlAvekGM=QdG!c7q2tY_wV=$Bq_y&$6ni z3l*>5{E5DoYPEL?3gNY1(Hh_SS*gIKIxSGpfec3{`Y|19>w=N_`8<{ZC{Ds73y2mX1V{B)Z!() zRF@P`-ZL~he1Q32p7g)S#%*C_RSD6u=!@t6*{Y?5O1ZXJqc7D0wgG3u)goatONIP$ z{Vn<%`kWu#fiivmn!hje_*HKhnt9(W%Jmg>*Z(N)f3T Date: Thu, 25 Dec 2014 19:17:52 +0100 Subject: [PATCH 31/44] Resized PayPal logo --- htdocs/paypal/img/object_paypal.png | Bin 4438 -> 4120 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/htdocs/paypal/img/object_paypal.png b/htdocs/paypal/img/object_paypal.png index 6b1f28eb73ea2cee17cdabbfd316134f42dec56b..74ac4392ded01a9a13c00027dcef80a6142c39ba 100644 GIT binary patch delta 744 zcmVz@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF*m;eA5aGbhP zJOBUy32;bRa{vGf6951U69E94oEQKA4Lxa8SaeuTOgdw+J3bA60!2wgK~yLeRZ&f7 z6G0e#Gdr_MlTAZXMB+~?)kbMW@FE5A50Aa*LA(?_35wvUS8-1wBG!v|^&m*T2yz~UYhZVq=4D$I0-=KJB6sqtAa8p3U0L#}eA>g(39h#89tspbKu|_^1j6dz4rCuB1M5yzsngv(Nmfk@|o&D9cSZ_LMWWW4k-D2}fa8Wgg? zAWxB;v74~3)k6@pvAbI}>*eR+-HBUPV?0rN$uUH1wH@^^G-zE)2=*7We$v;ad$Rg{ zC2TZ*;N9a53xe;<7^uAbX*81d={0gZQ8|&&NlBewdZqXDW{IC?uYAt(0mw!cOLe;S zSre_@meqx645bzzwF2=yiM1Hk|L a|JQHlz}o!ZyQowE0000BsjDj zkdP{Ygan65a6oO55C`Bwkx-AhA}-uOTzWt%P>CCtqL!Zum7=Jng&@+TKP~}7V#oHr z$INqfyKB2PBd_1j%$slKdo#O)K62p58!yr1{F_=etv-M1#1?H(xVeJOweP~(l`k%z zKYKNyG*jx{khML1`~rf94??y2sndJJF31LSyRNGj7ghDkQ%M6Sx!9fuI$zvH4hOIM zsr#HTTdq&j&%A48teRT=d@-`>rNDcLod;9UDzf>XqXxn{Xma6gU~D2f)C1s*6lP($ zE{7l4bVh$e1)I}=N6xrG(e)>HM~8bjP}%ZcLig41y1Bs-4!9EmwmB{*Kr5`XaYuSG zAg8!59X&hOAyEGlX#DlyNA&;P=0NVjI(qVDc5i(503chKgG%r($*4AiaQcJj5nagV z@}8!nC*HAMS$t1&=myAYcXWn5if&sN!2l%pB3*yi*ycd??9pg9Knu^kesQH%=mHqq zNp5au8i1V);y%I%na0t)#{7OltI2nfnXtX=bPB-9PR+o|c!rMXpp2&BgsTULP}<_? z4?nH3qeu`it|-O76oB$eb4+yFi}Zs~)U|Dl#PQaa+>geyM-&b%SZH$eV%%!hJhio& zDpP;T6nZO2oY(6ekR*!5u?4=y?#DEqJOn&C+i@<%;ADWCS1<3Mn!A$%fLGj`svv0` zi~kNjp)nFLh^$G$_X!iDgmM`u@;yp+l1U^PANb*`k7XGHR4SFsQe%9Uk`>hC=pUa6 z@%&-Ol%N1cl_!z5nQN&WnMaZhpjWT|sLp?$NdpiS%KQ%6C6^P694t+8*|C!?;dX#n z{6_V2(CceA)CVVC1Xh^WLoI&XMsc0{MR???OV&sv4K(s`Z@X$oU){{91+ W5LNtOQ{4Cf0000 Date: Thu, 25 Dec 2014 21:47:39 +0100 Subject: [PATCH 32/44] Fixed bug which didn't show documents in auto GED when an object had '/' in its ref --- htdocs/comm/propal/class/propal.class.php | 5 +++ htdocs/commande/class/commande.class.php | 5 +++ htdocs/compta/facture/class/facture.class.php | 6 +++- .../sociales/class/chargesociales.class.php | 5 +++ htdocs/contrat/class/contrat.class.php | 5 +++ htdocs/core/class/commonobject.class.php | 32 +++++++++++++++++++ htdocs/core/class/html.formfile.class.php | 15 +++++++-- htdocs/fichinter/class/fichinter.class.php | 5 +++ .../class/fournisseur.commande.class.php | 5 +++ .../fourn/class/fournisseur.facture.class.php | 5 +++ htdocs/product/class/product.class.php | 5 +++ htdocs/projet/class/project.class.php | 5 +++ 12 files changed, 95 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index be22043e4b5..589afedd00c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -47,6 +47,11 @@ class Propal extends CommonObject public $fk_element='fk_propal'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $socid; // Id client diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 49ba2536bfa..06f381a41a9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -44,6 +44,11 @@ class Commande extends CommonOrder public $fk_element = 'fk_commande'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $socid; // Id client diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 632381c8541..f81fb37849f 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -50,6 +50,11 @@ class Facture extends CommonInvoice public $fk_element = 'fk_facture'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'facnumber'; + var $id; //! Id client var $socid; @@ -833,7 +838,6 @@ class Facture extends CommonInvoice return $result; } - /** * Get object and lines from database * diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index fb8bc162c83..1d684c65552 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -34,6 +34,11 @@ class ChargeSociales extends CommonObject public $table='chargesociales'; public $table_element='chargesociales'; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $ref; var $date_ech; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ae384195162..5265f7025c5 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -44,6 +44,11 @@ class Contrat extends CommonObject public $fk_element='fk_contrat'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $ref; var $ref_ext; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 54c7b9d860d..9fb4841c0a9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -54,6 +54,12 @@ abstract class CommonObject // No constructor as it is an abstract class + /** + * Column name of the ref field. + * @var string + */ + protected $table_ref_field = ''; + /** * Check an object id/ref exists @@ -631,6 +637,32 @@ abstract class CommonObject } + /** + * Looks for an object with ref matching the wildcard provided + * It does only work when $this->table_ref_field is set + * + * @param string $ref Wildcard + * @return int >1 = OK, 0 = Not found or table_ref_field not defined, <0 = KO + */ + public function fetchOneLike($ref) + { + if (!$this->table_ref_field) { + return 0; + } + + $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE '.$this->table_ref_field.' LIKE "'.$this->db->escape($ref).'" LIMIT 1'; + + $query = $this->db->query($sql); + + if (!$this->db->num_rows($query)) { + return 0; + } + + $result = $this->db->fetch_object($query); + + return $this->fetch($result->rowid); + } + /** * Load data for barcode into properties ->barcode_type* * Properties ->barcode_type that is id of barcode. Type is used to find other properties, but diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1ef5045c845..34f6418de34 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -997,7 +997,6 @@ class FormFile if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');} if (! $id && ! $ref) continue; - $found=0; if (! empty($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) { @@ -1006,7 +1005,19 @@ class FormFile else { //print 'Fetch '.$id." - ".$ref.'
'; - $result=$object_instance->fetch($id,$ref); + + if ($id) { + $result = $object_instance->fetch($id); + } else { + //fetchOneLike looks for objects with wildcards in its reference. + //It is useful for those masks who get underscores instead of their actual symbols + //fetchOneLike requires some info in the object. If it doesn't have it, then 0 is returned + //that's why we look only look fetchOneLike when fetch returns 0 + if (!$result = $object_instance->fetch('', $ref)) { + $result = $object_instance->fetchOneLike($ref); + } + } + if ($result > 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]=dol_clone($object_instance); } // Save object into a cache if ($result == 0) { $found=1; $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]='notfound'; unset($filearray[$key]); } } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 28ef737de13..4ab0cfdb96b 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -37,6 +37,11 @@ class Fichinter extends CommonObject public $fk_element='fk_fichinter'; public $table_element_line='fichinterdet'; + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $socid; // Id client diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 7593dcf9903..4fe4675f5d8 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -45,6 +45,11 @@ class CommandeFournisseur extends CommonOrder public $fk_element = 'fk_commande'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $ref; // TODO deprecated diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 95da7550db7..d9a4469481f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -43,6 +43,11 @@ class FactureFournisseur extends CommonInvoice public $fk_element='fk_facture_fourn'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $rowid; var $ref; var $product_ref; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 390f250f5d9..ba179aef616 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -46,6 +46,11 @@ class Product extends CommonObject protected $isnolinkedbythird = 1; // No field fk_soc protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $regeximgext='\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff'; //! Identifiant unique diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 41ae40a259d..f762b10d2ca 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -38,6 +38,11 @@ class Project extends CommonObject public $fk_element = 'fk_projet'; protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; + var $id; var $ref; var $description; From ca133d74acd8ccc25bd23bf25e143321e9f0d5fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 22:20:09 +0100 Subject: [PATCH 33/44] Corrected key not translated --- htdocs/ecm/index_auto.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 7d0fc5c64bf..7626774b24c 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -409,7 +409,7 @@ if (! empty($conf->global->ECM_AUTO_TREE_ENABLED)) if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } if (! empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); } if (! empty($conf->projet->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsByProjects")); } - if (! empty($conf->ficheinter->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); } + if (! empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsByInterventions")); } $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'user', 'test'=>1, 'label'=>$langs->trans("Users"), 'desc'=>$langs->trans("ECMDocsByUsers")); } From c870f0e3db09eda2ae2cdda07d8f473181e22885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 22:30:47 +0100 Subject: [PATCH 34/44] Updated changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 7b5447aed23..3f752e4db68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -103,6 +103,7 @@ For users: - Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe. - Fix: [ bug #1535 ] Supplier invoice Extrafields are not shown - Fix: datepicker first day of week can be monday by setting into display setup +- Fix: [ bug #575 ] GED doesn't works if there is "/" in a mask For users, new experimental module (need to set feature level of instance to experimental to see them): - New: Module Accounting Expert to manage accountancy From 7b6a4d1bfd923dfca6c8a62ea46a9bbda0196cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 22:50:15 +0100 Subject: [PATCH 35/44] Fix: [ bug #1715 ] Valign and width attributes are used in div tags --- htdocs/core/class/html.form.class.php | 16 ++++++++++++++-- htdocs/core/lib/agenda.lib.php | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 61d1c08f2aa..e61f1af9617 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -400,14 +400,26 @@ class Form else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag $s=""; if (empty($notabs)) $s.=''; - if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; + if ($direction < 0) { + $s.='<'.$tag.$paramfortooltipimg; + if ($tag == 'td') { + $s .= 'valign="top" '; + } + $s.= 'width="14">'.$img.''; + } // Use another method to help avoid having a space in value in order to use this value with jquery // TODO add this in css //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); if ((string) $text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; - if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; + if ($direction > 0) { + $s.='<'.$tag.$paramfortooltipimg; + if ($tag == 'td') { + $s .= 'valign="top" '; + } + $s.= 'width="14">'.$img.''; + } if (empty($notabs)) $s.='
'; return $s; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3d51490f6b2..23a17534ccf 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -149,7 +149,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh if (! empty($conf->browser->phone)) print ''; else print '
'; print '
'; From eb524cfd29a38d50dbb0c09ce579a18e9d320670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 22:50:33 +0100 Subject: [PATCH 36/44] Copyright info --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e61f1af9617..e90dbdd203d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2010-2014 Philippe Grand * Copyright (C) 2011 Herve Prot - * Copyright (C) 2012 Marcos García + * Copyright (C) 2012-2014 Marcos García * Copyright (C) 2013 Raphaël Doursenaud * Copyright (C) 2014 Alexandre Spangaro * From 2616deb58d5d2e94235dee46292c9bf6b15eabf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 22:52:11 +0100 Subject: [PATCH 37/44] Copyright info --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9fb4841c0a9..d0e4e086640 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2011-2014 Philippe Grand - * Copyright (C) 2012 Marcos García + * Copyright (C) 2012-2014 Marcos García * * 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 From 5ec38d89ffd75482a23ede368a2645b1fde6792a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 22:59:57 +0100 Subject: [PATCH 38/44] Fixed [ bug #1763 ] Undefined variable $interface in Project:574 --- htdocs/projet/class/project.class.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 41ae40a259d..fb98bec1c46 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -568,16 +568,9 @@ class Project extends CommonObject { // Call trigger $result=$this->call_trigger('PROJECT_DELETE',$user); - if ($result < 0) - { + + if ($result < 0) { $error++; - if (! empty($interface->errors)) - { - foreach ($interface->errors as $errmsg ) { - dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR); - $this->errors[] =$errmsg; - } - } } // End call triggers } From aec1bdb3c4bf2608963ca28fd3a771fd043135f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 25 Dec 2014 23:08:07 +0100 Subject: [PATCH 39/44] Fixed [ bug #1766 ] PHP Warning when adding a service to a supplier invoice --- htdocs/comm/propal.php | 5 +---- htdocs/commande/card.php | 4 ++-- htdocs/compta/facture.php | 6 +++--- htdocs/expedition/card.php | 4 +--- htdocs/fourn/commande/card.php | 12 +++--------- htdocs/fourn/facture/card.php | 8 ++------ htdocs/livraison/card.php | 4 +--- 7 files changed, 13 insertions(+), 30 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 5d20743d029..3744a9e4bab 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -189,8 +189,8 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { $tmp=getListOfModels($db, 'propal'); $keys=array_keys($tmp); $model=$keys[0]; } $ret = $object->fetch($id); // Reload to get new records + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -499,9 +499,6 @@ else if ($action == 'add' && $user->rights->propal->creer) $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'propal'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1291d6cce26..62577387bbd 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -922,8 +922,8 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->co $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { $tmp=getListOfModels($db, 'order'); $keys=array_keys($tmp); $model=$keys[0]; } $ret = $object->fetch($id); // Reload to get new records + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -971,8 +971,8 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) { $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { $tmp=getListOfModels($db, 'order'); $keys=array_keys($tmp); $model=$keys[0]; } $ret = $object->fetch($id); // Reload to get new records + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4f8eb73a8db..000b1f7de90 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -417,8 +417,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { $tmp=getListOfModels($db, 'invoice'); $keys=array_keys($tmp); $model=$keys[0]; } $ret = $object->fetch($id); // Reload to get new records + $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } @@ -500,8 +500,8 @@ else if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_ $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { $tmp=getListOfModels($db, 'invoice'); $keys=array_keys($tmp); $model=$keys[0]; } $ret = $object->fetch($id); // Reload to get new records + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } @@ -1328,8 +1328,8 @@ else if ($action == 'addline' && $user->rights->facture->creer) $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { $tmp=getListOfModels($db, 'invoice'); $keys=array_keys($tmp); $model=$keys[0]; } $ret = $object->fetch($id); // Reload to get new records + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 6ee45778d18..423d1565f8c 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -279,10 +279,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'shipping'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 753f91fbdda..09556bd9125 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -357,10 +357,8 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } @@ -462,10 +460,8 @@ else if ($action == 'update_line' && $user->rights->fournisseur->commande->creer $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } @@ -526,10 +522,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourn $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'order_supplier'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 38a0f79a6ea..9542fc062e7 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -711,10 +711,8 @@ elseif ($action == 'addline' && $user->rights->fournisseur->facture->creer) $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'invoice_supplier'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } @@ -793,10 +791,8 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer) $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'invoice_supplier'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 2b6a74a519e..1a89a377fef 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -135,10 +135,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->exped $outputlangs->setDefaultLang($newlang); } $model=$object->modelpdf; - if (empty($model)) { - $tmp=getListOfModels($db, 'delivery'); $keys=array_keys($tmp); $model=$keys[0]; - } $ret = $object->fetch($id); // Reload to get new records + $result=$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); if ($result < 0) dol_print_error($db,$result); } From f4def9ea288c0677117087f883e1625a01b1f358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:07:24 +0100 Subject: [PATCH 40/44] Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers --- ChangeLog | 1 + htdocs/core/db/pgsql.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 949492346b2..48cc3247cb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index efb9888f8b3..3af1c4bef83 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1021,7 +1021,7 @@ class DoliDBPgsql extends DoliDB // Test charset match LC_TYPE (pgsql error otherwise) //print $charset.' '.setlocale(LC_CTYPE,'0'); exit; - $sql='CREATE DATABASE '.$database.' OWNER '.$owner.' ENCODING \''.$charset.'\''; + $sql='CREATE DATABASE "'.$database.'" OWNER "'.$owner.'" ENCODING \''.$charset.'\''; dol_syslog($sql,LOG_DEBUG); $ret=$this->query($sql); return $ret; From 1d39c1acc22fdd7d2767fea7061b24b3242477d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:12:16 +0100 Subject: [PATCH 41/44] Fix: [ bug #1768 ] PHP Warning when error connecting to a PostgreSQL server in install script --- htdocs/core/db/pgsql.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index efb9888f8b3..f0f1f0333c8 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -402,7 +402,7 @@ class DoliDBPgsql extends DoliDB if ((! empty($host) && $host == "socket") && ! defined('NOLOCALSOCKETPGCONNECT')) { $con_string = "dbname='".$name."' user='".$login."' password='".$passwd."'"; // $name may be empty - $this->db = pg_connect($con_string); + $this->db = @pg_connect($con_string); } // if local connection failed or not requested, use TCP/IP @@ -412,7 +412,7 @@ class DoliDBPgsql extends DoliDB if (! $port) $port = 5432; $con_string = "host='".$host."' port='".$port."' dbname='".$name."' user='".$login."' password='".$passwd."'"; - $this->db = pg_connect($con_string); + $this->db = @pg_connect($con_string); } // now we test if at least one connect method was a success From 8e47fe9e1c0d6983fdffcab77d927c3528dda030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:19:09 +0100 Subject: [PATCH 42/44] Fix: [ bug #1757 ] Sorting breaks product/service statistics --- ChangeLog | 1 + htdocs/product/popuprop.php | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 949492346b2..624f4ca15a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** Fix: Paypal link were broken dur to SSL v3 closed. +Fix: [ bug #1757 ] Sorting breaks product/service statistics ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 5404dd1848a..b89fbc3b911 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2014 Marcos García * * 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 @@ -71,7 +72,9 @@ llxHeader('','',$helpurl); $sql = "SELECT count(*) as c"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= ' WHERE entity IN ('.getEntity('product', 1).')'; -if (isset($type)) $sql.= " AND fk_product_type = ".$type; +if ($type !== '') { + $sql.= " AND fk_product_type = ".$type; +} $result=$db->query($sql); if ($result) @@ -82,11 +85,14 @@ if ($result) $param = ''; $title = $langs->trans("ListProductServiceByPopularity"); -if (isset($type)) -{ +if ($type !== '') { $param = '&type='.$type; - $title = $langs->trans("ListProductByPopularity"); - if ($type == 1) $title = $langs->trans("ListServiceByPopularity"); + + if ($type == 1) { + $title = $langs->trans("ListServiceByPopularity"); + } else { + $title = $langs->trans("ListProductByPopularity"); + } } print_barre_liste($title, $page, "popuprop.php",$param,"","","",$num); @@ -106,7 +112,9 @@ $sql.= " FROM ".MAIN_DB_PREFIX."propaldet as pd"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; $sql.= " AND p.rowid = pd.fk_product"; -if (isset($type)) $sql.= " AND fk_product_type = ".$type; +if ($type !== '') { + $sql.= " AND fk_product_type = ".$type; +} $sql.= " GROUP BY (p.rowid)"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit, $offset); From 745eece5fed0d9fbdb7bcd6a72c5efb189a3d438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 26 Dec 2014 00:34:57 +0100 Subject: [PATCH 43/44] Fix: [ bug #1761 ] SQL error when installing 3.7 with PostgreSQL --- htdocs/install/mysql/tables/llx_usergroup_extrafields.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql b/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql index 333eb41ad08..0a89810dce5 100644 --- a/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_usergroup_extrafields.sql @@ -21,6 +21,6 @@ CREATE TABLE IF NOT EXISTS llx_usergroup_extrafields ( tms timestamp, fk_object integer NOT NULL, import_key varchar(14) -- import key -) ENGINE=InnoDB ; +)ENGINE=innodb; From 420ebe0be914511eb6d303581a18f5cdf233a47b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Dec 2014 04:04:16 +0100 Subject: [PATCH 44/44] Fix: Change order to create fields --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 2281793929f..0b71a2fe6fe 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -220,8 +220,8 @@ create table llx_accounting_fiscalyear fk_user_modif integer NULL )ENGINE=innodb; -ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref; -ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref_ext; +ALTER TABLE llx_contrat ADD COLUMN ref_supplier varchar(30) after ref; +ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref_supplier; ALTER TABLE llx_propal ADD COLUMN fk_shipping_method integer AFTER date_livraison; ALTER TABLE llx_commande ADD COLUMN fk_shipping_method integer AFTER date_livraison;