From 72effa3f25b2e6495ee7893c59ef53bb787a2c1c Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 15 Mar 2013 09:31:11 +0100 Subject: [PATCH 001/150] Fix part of bugs [ bug #766 ] --- htdocs/admin/expedition.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 709832b1968..2349053f46f 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -65,9 +65,9 @@ if ($action == 'updateMask') if (isset($res)) { if ($res < 0) - setEventMessage($langs->trans("SetupSaved")); - else setEventMessage($langs->trans("Error"), 'errors'); + else + setEventMessage($langs->trans("SetupSaved")); } } @@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT') $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); if ($res < 0) - setEventMessage($langs->trans("SetupSaved")); - else setEventMessage($langs->trans("Error"), 'errors'); + else + setEventMessage($langs->trans("SetupSaved")); } else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') @@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); if ($res < 0) - setEventMessage($langs->trans("SetupSaved")); - else setEventMessage($langs->trans("Error"), 'errors'); + else + setEventMessage($langs->trans("SetupSaved")); } else if ($action == 'specimen') @@ -173,7 +173,12 @@ else if ($action == 'setdoc') else if ($action == 'setmodel') { - dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); + + if ($res < 0) + setEventMessage($langs->trans("Error"), 'errors'); + else + setEventMessage($langs->trans("SetupSaved")); } From 010207532f2d9c6cacb0d32addbed483899b9bf0 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 10:12:40 +0100 Subject: [PATCH 002/150] fix trad --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 599b8c69ef7..1554fcede0f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -998,7 +998,7 @@ WebCalCheckWebcalSetup=Maybe the Webcal module setup is not correct. ##### Invoices ##### BillsSetup=Invoices module setup BillsDate=Invoices date -BillsNumberingModule=Invoices and credit notes numbering module +BillsNumberingModule=Invoices and credit notes numbering model BillsPDFModules=Invoice documents models CreditNoteSetup=Credit note module setup CreditNotePDFModules=Credit note document models From 95c9d19d5eb8e41f86e5818ec96b11c63584e584 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Mar 2013 11:31:49 +0100 Subject: [PATCH 003/150] Fix: Restore ability to filter on '0' --- htdocs/exports/class/export.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 622f26506f9..07199f815d8 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -233,8 +233,7 @@ class Export // pour ne pas a gerer le nombre de condition foreach ($array_filterValue as $key => $value) { - if (!empty($value)) - $sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[0][$key], $key, $array_filterValue[$key]); + if ($value != '') $sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[0][$key], $key, $array_filterValue[$key]); } $sql.=$sqlWhere; } @@ -248,7 +247,7 @@ class Export * * @param string $TypeField Type of Field to filter * @param string $NameField Name of the field to filter - * @param string $ValueField Initial value of the field to filter + * @param string $ValueField Value of the field for filter. Must not be '' * @return string sql string of then field ex : "field='xxx'>" */ function build_filterQuery($TypeField, $NameField, $ValueField) From 36e99e100b0641109de62ea7ee478c1d5cd403bf Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 12:13:23 +0100 Subject: [PATCH 004/150] fix trad --- htdocs/langs/ar_SA/bills.lang | 2 +- htdocs/langs/bg_BG/bills.lang | 2 +- htdocs/langs/da_DK/bills.lang | 2 +- htdocs/langs/el_GR/bills.lang | 2 +- htdocs/langs/en_US/bills.lang | 4 ++-- htdocs/langs/et_EE/bills.lang | 2 +- htdocs/langs/fi_FI/bills.lang | 2 +- htdocs/langs/he_IL/bills.lang | 2 +- htdocs/langs/hu_HU/bills.lang | 2 +- htdocs/langs/is_IS/bills.lang | 2 +- htdocs/langs/ja_JP/bills.lang | 2 +- htdocs/langs/nb_NO/bills.lang | 2 +- htdocs/langs/nl_NL/bills.lang | 2 +- htdocs/langs/pl_PL/bills.lang | 2 +- htdocs/langs/ro_RO/bills.lang | 2 +- htdocs/langs/sv_SE/bills.lang | 2 +- htdocs/langs/zh_CN/bills.lang | 2 +- htdocs/langs/zh_TW/bills.lang | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/langs/ar_SA/bills.lang b/htdocs/langs/ar_SA/bills.lang index 6fad3e67919..3987e77682f 100644 --- a/htdocs/langs/ar_SA/bills.lang +++ b/htdocs/langs/ar_SA/bills.lang @@ -433,6 +433,6 @@ EditGlobalDiscounts=تعديل الخصومات مطلق AddCreditNote=علما خلق الائتمان InvoiceNotChecked=لا فاتورة مختارة ShowUnpaidAll=وتظهر جميع الفواتير غير المسددة -ClosePaidInvoicesAutomatically=تصنيف "سيولي" كل معيار أو الفواتير استبدال سيولي entierely. +ClosePaidInvoicesAutomatically=تصنيف "سيولي" كل معيار أو الفواتير استبدال سيولي entirely. AllCompletelyPayedInvoiceWillBeClosed=كل فاتورة مع عدم وجود لا تزال لدفع ستغلق تلقائيا إلى "فياض" الوضع. // STOP - Lines generated via autotranslator.php tool (2012-02-29 15:56:17). diff --git a/htdocs/langs/bg_BG/bills.lang b/htdocs/langs/bg_BG/bills.lang index 86920ad6d7d..9d295d4edc5 100644 --- a/htdocs/langs/bg_BG/bills.lang +++ b/htdocs/langs/bg_BG/bills.lang @@ -384,7 +384,7 @@ DisabledBecausePayments=Не е възможно, тъй като има няк CantRemovePaymentWithOneInvoicePaid=Не може да се премахне плащането, тъй като има най-малко една фактура, класифицирани плаща ExpectedToPay=Очаквано плащане PayedByThisPayment=Плаща от това плащане -ClosePaidInvoicesAutomatically=Класифицира "ЗАПЛАЩАТ" стандартно или заместващи фактури entierely ЗАПЛАЩАТ. +ClosePaidInvoicesAutomatically=Класифицира "ЗАПЛАЩАТ" стандартно или заместващи фактури entirely ЗАПЛАЩАТ. AllCompletelyPayedInvoiceWillBeClosed=Всички фактура не остават да плати, ще бъде затворено автоматично статус "Платени". TypeContact_facture_internal_SALESREPFOLL=Представител проследяване клиент фактура TypeContact_facture_external_BILLING=Контакта с клиентите фактура diff --git a/htdocs/langs/da_DK/bills.lang b/htdocs/langs/da_DK/bills.lang index f915134e890..f357cb6bec2 100644 --- a/htdocs/langs/da_DK/bills.lang +++ b/htdocs/langs/da_DK/bills.lang @@ -433,6 +433,6 @@ EditGlobalDiscounts=Rediger absolutte rabatter AddCreditNote=Opret kreditnota InvoiceNotChecked=Ingen valgt faktura ShowUnpaidAll=Vis alle ubetalte fakturaer -ClosePaidInvoicesAutomatically=Klassificere "betales" hele standarden eller udskiftning af fakturaer entierely betales. +ClosePaidInvoicesAutomatically=Klassificere "betales" hele standarden eller udskiftning af fakturaer entirely betales. AllCompletelyPayedInvoiceWillBeClosed=Alle faktura uden mangler at betale, vil automatisk blive lukket for status "betales". // STOP - Lines generated via autotranslator.php tool (2012-02-29 16:00:06). diff --git a/htdocs/langs/el_GR/bills.lang b/htdocs/langs/el_GR/bills.lang index e38fd849716..30bd5669898 100644 --- a/htdocs/langs/el_GR/bills.lang +++ b/htdocs/langs/el_GR/bills.lang @@ -419,7 +419,7 @@ AddGlobalDiscount=Προσθήκη έκπτωσης AddCreditNote=Δημιουργία πιστωτικό σημείωμα InvoiceNotChecked=Δεν έχει επιλεγεί τιμολόγιο ShowUnpaidAll=Εμφάνιση όλων των απλήρωτων τιμολογίων -ClosePaidInvoicesAutomatically=Ταξινομήστε "Πληρωμένες» όλα τα τιμολόγια entierely payed. +ClosePaidInvoicesAutomatically=Ταξινομήστε "Πληρωμένες» όλα τα τιμολόγια entirely payed. AllCompletelyPayedInvoiceWillBeClosed=Όλα τιμολόγιο χωρίς παραμένουν να πληρώσουν θα κλείσει αυτόματα σε κατάσταση "Πληρωμένες». // STOP - Lines generated via autotranslator.php tool (2011-06-26 15:36:46). diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 6928bc1a603..78179acd8c9 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -384,8 +384,8 @@ DisabledBecausePayments=Not possible since there is some payments CantRemovePaymentWithOneInvoicePaid=Can't remove payment since there is at least one invoice classified payed ExpectedToPay=Expected payment PayedByThisPayment=Payed by this payment -ClosePaidInvoicesAutomatically=Classify "Payed" all standard or replacement invoices entierely payed. -ClosePaidCreditNotesAutomatically=Classify "Payed" all credit notes entierely paid back. +ClosePaidInvoicesAutomatically=Classify "Payed" all standard or replacement invoices entirely payed. +ClosePaidCreditNotesAutomatically=Classify "Payed" all credit notes entirely paid back. AllCompletelyPayedInvoiceWillBeClosed=All invoice with no remain to pay will be automatically closed to status "Payed". ToMakePayment=Pay ToMakePaymentBack=Pay back diff --git a/htdocs/langs/et_EE/bills.lang b/htdocs/langs/et_EE/bills.lang index 6b7f9cfc53e..b2b9a21de61 100644 --- a/htdocs/langs/et_EE/bills.lang +++ b/htdocs/langs/et_EE/bills.lang @@ -374,7 +374,7 @@ DisabledBecausePayments=Ole võimalik, sest seal on mõned maksed CantRemovePaymentWithOneInvoicePaid=Ei saa eemaldada makse sest seal on vähemalt üks arve klassifitseeritud payed ExpectedToPay=Oodatud makse PayedByThisPayment=Payed selle makse -ClosePaidInvoicesAutomatically=Liigitada "payed" kõik standard või asendamine arved entierely payed. +ClosePaidInvoicesAutomatically=Liigitada "payed" kõik standard või asendamine arved entirely payed. AllCompletelyPayedInvoiceWillBeClosed=Kõik arve, millel ei ole veel maksma automaatselt suletud olek "payed". TypeContact_facture_internal_SALESREPFOLL=Esindaja järelmeetmeid kliendi arve TypeContact_facture_external_BILLING=Kliendi arve kontaktandmed diff --git a/htdocs/langs/fi_FI/bills.lang b/htdocs/langs/fi_FI/bills.lang index 9c383ea1fde..c56954a7b96 100644 --- a/htdocs/langs/fi_FI/bills.lang +++ b/htdocs/langs/fi_FI/bills.lang @@ -431,6 +431,6 @@ EditGlobalDiscounts=Muokkaa absoluuttinen alennukset AddCreditNote=Luo hyvityslasku InvoiceNotChecked=Ei laskun valittu ShowUnpaidAll=Näytä kaikki maksamattomat laskut -ClosePaidInvoicesAutomatically=Luokittele "maksanut" kaikki vakio-tai korvaavan laskuja entierely maksanut. +ClosePaidInvoicesAutomatically=Luokittele "maksanut" kaikki vakio-tai korvaavan laskuja entirely maksanut. AllCompletelyPayedInvoiceWillBeClosed=Kaikki lasku ilman jää maksaa automaattisesti suljettu tila "maksanut". // STOP - Lines generated via autotranslator.php tool (2012-02-29 16:11:08). diff --git a/htdocs/langs/he_IL/bills.lang b/htdocs/langs/he_IL/bills.lang index d0c5cb1044c..a16a4c45547 100644 --- a/htdocs/langs/he_IL/bills.lang +++ b/htdocs/langs/he_IL/bills.lang @@ -374,7 +374,7 @@ DisabledBecausePayments=לא ניתן שכן אין תשלומים מסוימי CantRemovePaymentWithOneInvoicePaid=לא ניתן להסיר תשלום מאז יש לפחות חשבונית אחת מסווגים שילם ExpectedToPay=צפוי התשלום PayedByThisPayment=שילם על ידי תשלום זה -ClosePaidInvoicesAutomatically=לסווג "שילם" את כל תקן או חשבוניות החלפת שילם entierely. +ClosePaidInvoicesAutomatically=לסווג "שילם" את כל תקן או חשבוניות החלפת שילם entirely. AllCompletelyPayedInvoiceWillBeClosed=כל חשבונית ללא להישאר לשלם ייסגר באופן אוטומטי למצב "שילם". TypeContact_facture_internal_SALESREPFOLL=לקוחות נציג הבאה למעלה החשבונית TypeContact_facture_external_BILLING=חשבונית הלקוח קשר diff --git a/htdocs/langs/hu_HU/bills.lang b/htdocs/langs/hu_HU/bills.lang index 8546d155e7b..4439698118d 100644 --- a/htdocs/langs/hu_HU/bills.lang +++ b/htdocs/langs/hu_HU/bills.lang @@ -374,7 +374,7 @@ DisabledBecausePayments=Nem lehetséges, mert van némi kifizetések CantRemovePaymentWithOneInvoicePaid=Nem lehet eltávolítani a fizetési hiszen legalább egy számlát fizetni osztályozott ExpectedToPay=Várható fizetés PayedByThisPayment=Megfizetni ezt a fizetési -ClosePaidInvoicesAutomatically=Classify "fizetni" minden szabványos vagy csere számlák entierely fizetni. +ClosePaidInvoicesAutomatically=Classify "fizetni" minden szabványos vagy csere számlák entirely fizetni. AllCompletelyPayedInvoiceWillBeClosed=Minden számla nélkül is fizetni fogják automatikusan bezárja az állapota "fizetni". TypeContact_facture_internal_SALESREPFOLL=Reprezentatív nyomon követése vevőszámla TypeContact_facture_external_BILLING=Ügyfél számla Kapcsolat diff --git a/htdocs/langs/is_IS/bills.lang b/htdocs/langs/is_IS/bills.lang index 21209b0158f..a342ad46e78 100644 --- a/htdocs/langs/is_IS/bills.lang +++ b/htdocs/langs/is_IS/bills.lang @@ -410,6 +410,6 @@ EditGlobalDiscounts=Breyta hreinum afslætti AddCreditNote=Búa inneignarnótuna InvoiceNotChecked=Engin reikningur valinn ShowUnpaidAll=Sýna alla ógreiddra reikninga -ClosePaidInvoicesAutomatically=Flokka "borgað" allt staðall eða skipti reikningar entierely borgað. +ClosePaidInvoicesAutomatically=Flokka "borgað" allt staðall eða skipti reikningar entirely borgað. AllCompletelyPayedInvoiceWillBeClosed=Allt Reikningar með ekki áfram að borga verður sjálfkrafa lokað til stöðu "borgað". // STOP - Lines generated via autotranslator.php tool (2012-02-29 16:27:05). diff --git a/htdocs/langs/ja_JP/bills.lang b/htdocs/langs/ja_JP/bills.lang index f2172127b5f..e8088302025 100644 --- a/htdocs/langs/ja_JP/bills.lang +++ b/htdocs/langs/ja_JP/bills.lang @@ -374,7 +374,7 @@ DisabledBecausePayments=いくつかの支払いがあるのでできませ​ CantRemovePaymentWithOneInvoicePaid=支払った分類少なくとも一つの請求書があるので支払いを削除することはできません ExpectedToPay=予想される支払い PayedByThisPayment=この支払によって支払った -ClosePaidInvoicesAutomatically="支払った"すべての標準またはentierely支払った交換用の請求書を分類します。 +ClosePaidInvoicesAutomatically="支払った"すべての標準またはentirely支払った交換用の請求書を分類します。 AllCompletelyPayedInvoiceWillBeClosed=を持たないすべての請求書は自動的にステータスが "支払った"に閉鎖され支払うことに残っています。 TypeContact_facture_internal_SALESREPFOLL=代表的なフォローアップ顧客の請求書 TypeContact_facture_external_BILLING=顧客の請求書の連絡先 diff --git a/htdocs/langs/nb_NO/bills.lang b/htdocs/langs/nb_NO/bills.lang index faf0e2b69b4..1a3618b132c 100644 --- a/htdocs/langs/nb_NO/bills.lang +++ b/htdocs/langs/nb_NO/bills.lang @@ -438,6 +438,6 @@ EditGlobalDiscounts=Rediger absolutte rabatter AddCreditNote=Lag kreditt notat InvoiceNotChecked=Ingen faktura er valgt ShowUnpaidAll=Vis alle ubetalte fakturaer -ClosePaidInvoicesAutomatically=Klassifisere "betalt" alle standard eller utskifting fakturaer entierely utbetales. +ClosePaidInvoicesAutomatically=Klassifisere "betalt" alle standard eller utskifting fakturaer entirely utbetales. AllCompletelyPayedInvoiceWillBeClosed=Alle faktura uten gjenstår å betale vil bli automatisk stengt for status "betales". // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:07:28). diff --git a/htdocs/langs/nl_NL/bills.lang b/htdocs/langs/nl_NL/bills.lang index d8d7bae1abe..bc238882ecc 100644 --- a/htdocs/langs/nl_NL/bills.lang +++ b/htdocs/langs/nl_NL/bills.lang @@ -400,7 +400,7 @@ EditGlobalDiscounts=Edit absolute kortingen AddCreditNote=Maak een credit nota AllCompletelyPayedInvoiceWillBeClosed=Alle factuur zonder te blijven om te betalen zal automatisch worden gesloten om status "Betaald". TerreNumRefModelError=Een wetsvoorstel te beginnen met $ syymm bestaat al en is niet compatibel met dit model van de reeks. Verwijderen of hernoemen naar deze module te activeren. -ClosePaidInvoicesAutomatically=Classificeren "Betaalde" alle standaard of vervanging facturen entierely betaald. +ClosePaidInvoicesAutomatically=Classificeren "Betaalde" alle standaard of vervanging facturen entirely betaald. // STOP - Lines generated via autotranslator.php tool (2011-10-10 02:25:52). diff --git a/htdocs/langs/pl_PL/bills.lang b/htdocs/langs/pl_PL/bills.lang index 422892976c9..549154c32e2 100644 --- a/htdocs/langs/pl_PL/bills.lang +++ b/htdocs/langs/pl_PL/bills.lang @@ -432,6 +432,6 @@ EditGlobalDiscounts=Edytuj bezwzględne zniżki AddCreditNote=Tworzenie noty kredytowej InvoiceNotChecked=Nie wybrano faktura ShowUnpaidAll=Pokaż wszystkie niezapłacone faktury -ClosePaidInvoicesAutomatically=Klasyfikowanie "Opłacone" wszystkie standardy lub fakturach zastępczych entierely zapłaci. +ClosePaidInvoicesAutomatically=Klasyfikowanie "Opłacone" wszystkie standardy lub fakturach zastępczych entirely zapłaci. AllCompletelyPayedInvoiceWillBeClosed=Wszystko faktura bez pozostawać do zapłaty zostanie automatycznie zamknięta do statusu "płatny". // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:19:17). diff --git a/htdocs/langs/ro_RO/bills.lang b/htdocs/langs/ro_RO/bills.lang index e0042ad162b..aa7e69936e3 100644 --- a/htdocs/langs/ro_RO/bills.lang +++ b/htdocs/langs/ro_RO/bills.lang @@ -432,6 +432,6 @@ EditGlobalDiscounts=Editare reduceri absolute AddCreditNote=Creaţi note de credit InvoiceNotChecked=Nu factură selectat ShowUnpaidAll=Arata toate facturile neachitate -ClosePaidInvoicesAutomatically=Clasifica "platiti", toate facturile standard sau de înlocuire entierely platite. +ClosePaidInvoicesAutomatically=Clasifica "platiti", toate facturile standard sau de înlocuire entirely platite. AllCompletelyPayedInvoiceWillBeClosed=Toate cu factura nu rămân la plata vor fi închise automat la statutul de "platite". // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:24:55). diff --git a/htdocs/langs/sv_SE/bills.lang b/htdocs/langs/sv_SE/bills.lang index 2b477bb3084..7d60a306554 100644 --- a/htdocs/langs/sv_SE/bills.lang +++ b/htdocs/langs/sv_SE/bills.lang @@ -409,6 +409,6 @@ EditGlobalDiscounts=Redigera absoluta rabatter AddCreditNote=Skapa kreditnota InvoiceNotChecked=Faktura vald ShowUnpaidAll=Visa alla obetalda fakturor -ClosePaidInvoicesAutomatically=Klassificera "betalade" alla standard eller fakturor ersättning entierely betalt. +ClosePaidInvoicesAutomatically=Klassificera "betalade" alla standard eller fakturor ersättning entirely betalt. AllCompletelyPayedInvoiceWillBeClosed=Alla fakturor utan återstår att betala kommer automatiskt stängd för status "betald". // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:32:49). diff --git a/htdocs/langs/zh_CN/bills.lang b/htdocs/langs/zh_CN/bills.lang index d3330a6a431..ad61aa5068e 100644 --- a/htdocs/langs/zh_CN/bills.lang +++ b/htdocs/langs/zh_CN/bills.lang @@ -414,6 +414,6 @@ EditGlobalDiscounts=编辑绝对折扣 AddCreditNote=创建信用票据 InvoiceNotChecked=选择无发票 ShowUnpaidAll=显示所有未付发票 -ClosePaidInvoicesAutomatically=分类“支付最高”的所有entierely支付最高标准或更换发票。 +ClosePaidInvoicesAutomatically=分类“支付最高”的所有entirely支付最高标准或更换发票。 AllCompletelyPayedInvoiceWillBeClosed=所有发票仍然没有支付将被自动关闭状态“支付最高”。 // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:38:07). diff --git a/htdocs/langs/zh_TW/bills.lang b/htdocs/langs/zh_TW/bills.lang index 399aa502b29..ae3bfa163ad 100644 --- a/htdocs/langs/zh_TW/bills.lang +++ b/htdocs/langs/zh_TW/bills.lang @@ -414,6 +414,6 @@ EditGlobalDiscounts=編輯絕對折扣 AddCreditNote=創建信用票據 InvoiceNotChecked=選擇無發票 ShowUnpaidAll=顯示所有未付款的發票 -ClosePaidInvoicesAutomatically=分類“支付最高”的所有entierely支付最高標準或更換發票。 +ClosePaidInvoicesAutomatically=分類“支付最高”的所有entirely支付最高標準或更換發票。 AllCompletelyPayedInvoiceWillBeClosed=所有發票仍然沒有支付將被自動關閉狀態“支付最高”。 // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:38:07). From 86dab44c9892caf6274366579b528426d1f9425b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 15 Mar 2013 15:33:49 +0100 Subject: [PATCH 005/150] Added natural search to products --- htdocs/product/liste.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index bef33a022b1..9fb9aa8de51 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013 Raphaël Doursenaud * * 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 @@ -133,12 +134,16 @@ else $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; if ($sall) { - $sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'"; - if (! empty($conf->barcode->enabled)) - { - $sql.= " OR p.barcode LIKE '%".$db->escape($sall)."%'"; + // For natural search + $scrit = explode(' ', $sall); + foreach ($scrit as $crit) { + $sql.= " AND (p.ref LIKE '%".$db->escape($crit)."%' OR p.label LIKE '%".$db->escape($crit)."%' OR p.description LIKE '%".$db->escape($crit)."%' OR p.note LIKE '%".$db->escape($crit)."%'"; + if (! empty($conf->barcode->enabled)) + { + $sql.= " OR p.barcode LIKE '%".$db->escape($crit)."%'"; + } + $sql.= ')'; } - $sql.= ')'; } // if the type is not 1, we show all products (type = 0,2,3) if (dol_strlen($type)) From ea442d93519e09b43c9498c1defc38f4db7ad14b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 15 Mar 2013 15:37:11 +0100 Subject: [PATCH 006/150] Fixed use of deprecated data field --- htdocs/societe/societe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 5792661dd5e..763274d2a79 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -99,7 +99,7 @@ if ($mode == 'search') if ($search_categ) $sql.= " AND s.rowid = cs.fk_societe"; // Join for the needed table to filter by categ if (! $user->rights->societe->lire || ! $user->rights->fournisseur->lire) { - if (! $user->rights->fournisseur->lire) $sql.=" AND s.fourn != 1"; + if (! $user->rights->fournisseur->lire) $sql.=" AND s.fournisseur != 1"; } // Insert sale filter if ($search_sale) From 639c033afbcb2765653a760ec076e40573438850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 15 Mar 2013 15:37:59 +0100 Subject: [PATCH 007/150] Added natural search to third parties --- htdocs/societe/societe.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 763274d2a79..26583442b2c 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Raphaël Doursenaud * * 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 @@ -80,19 +81,25 @@ if ($mode == 'search') // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - $sql.= " AND ("; - $sql.= " s.nom LIKE '%".$db->escape($socname)."%'"; - $sql.= " OR s.code_client LIKE '%".$db->escape($socname)."%'"; - $sql.= " OR s.email LIKE '%".$db->escape($socname)."%'"; - $sql.= " OR s.url LIKE '%".$db->escape($socname)."%'"; - $sql.= " OR s.siren LIKE '%".$db->escape($socname)."%'"; - if (!empty($conf->barcode->enabled)) - { - $sql.= "OR s.barcode LIKE '".$db->escape($socname)."'"; - } + // For natural search + $scrit = explode(' ', $socname); + foreach ($scrit as $crit) { + $sql.= " AND ("; + $sql.= " s.nom LIKE '%".$db->escape($crit)."%'"; + $sql.= " OR s.code_client LIKE '%".$db->escape($crit)."%'"; + $sql.= " OR s.email LIKE '%".$db->escape($crit)."%'"; + $sql.= " OR s.url LIKE '%".$db->escape($crit)."%'"; + $sql.= " OR s.siren LIKE '%".$db->escape($crit)."%'"; + + if (!empty($conf->barcode->enabled)) + { + $sql.= "OR s.barcode LIKE '".$db->escape($crit)."'"; + } + + $sql.= ")"; + } - $sql.= ")"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale From 4bcf3b3c32c710bac48bf35b16e65b5180219f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 15 Mar 2013 15:44:23 +0100 Subject: [PATCH 008/150] Added natural search to contacts --- htdocs/contact/list.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6d782c892d9..a6108ab9e8e 100755 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -3,6 +3,7 @@ * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Raphaël Doursenaud * * 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 @@ -196,7 +197,11 @@ else if ($type == "p") // filtre sur type } if ($sall) { - $sql .= " AND (p.lastname LIKE '%".$db->escape($sall)."%' OR p.firstname LIKE '%".$db->escape($sall)."%' OR p.email LIKE '%".$db->escape($sall)."%')"; + // For natural search + $scrit = explode(' ', $sall); + foreach ($scrit as $crit) { + $sql .= " AND (p.lastname LIKE '%".$db->escape($crit)."%' OR p.firstname LIKE '%".$db->escape($crit)."%' OR p.email LIKE '%".$db->escape($crit)."%')"; + } } if (! empty($socid)) { From 656915b8a894f39a2ab853b9375ed0d2cbd57f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 15 Mar 2013 15:48:03 +0100 Subject: [PATCH 009/150] Added natural search to members --- htdocs/adherents/liste.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 8bab0cab35b..27ddd052225 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2003 Rodolphe Quiedeville * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2013 Raphaël Doursenaud * * 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 @@ -101,11 +102,15 @@ if ($search_categ == -2) $sql.= " AND cm.fk_categorie IS NULL"; $sql.= " AND d.entity = ".$conf->entity; if ($sall) { - $sql.=" AND ("; - if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR "; - $sql.=" d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'"; - $sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'"; - $sql.=" OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')"; + // For natural search + $scrit = explode(' ', $sall); + foreach ($scrit as $crit) { + $sql.=" AND ("; + if (is_numeric($sall)) $sql.= "d.rowid = ".$sall." OR "; + $sql.=" d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'"; + $sql.=" OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'"; + $sql.=" OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')"; + } } if ($type > 0) { From 3c7c5f262f3c288ba57fdca1b9a80c56555593d8 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 16:03:03 +0100 Subject: [PATCH 010/150] anglicization of comments --- .../modules_commandefournisseur.php | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index 6b9fd315f18..f9407ba804e 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -40,7 +40,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator /** - * Return list of active generation modules + * Return list of active generation models * * @param DoliDB $db Database handler * @param string $maxfilenamelength Max length of value to show @@ -64,24 +64,24 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references de commandes fournisseurs + * Parent Class of numbering models of suppliers orders references */ abstract class ModeleNumRefSuppliersOrders { var $error=''; - /** Return if a module can be used or not + /** Return if a model can be used or not * - * @return boolean true if module can be used + * @return boolean true if model can be used */ function isEnabled() { return true; } - /** Renvoie la description par defaut du modele de numerotation + /** Returns the default description of the model numbering * - * @return string Texte descripif + * @return string Description Text */ function info() { @@ -90,7 +90,7 @@ abstract class ModeleNumRefSuppliersOrders return $langs->trans("NoDescription"); } - /** Renvoie un exemple de numerotation + /** Returns a numbering example * * @return string Example */ @@ -101,16 +101,16 @@ abstract class ModeleNumRefSuppliersOrders return $langs->trans("NoExample"); } - /** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner. + /** Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. * - * @return boolean false si conflit, true si ok + * @return boolean false if conflict, true if ok */ function canBeActivated() { return true; } - /** Renvoie prochaine valeur attribuee + /** Returns next value assigned * * @return string Valeur */ @@ -120,9 +120,9 @@ abstract class ModeleNumRefSuppliersOrders return $langs->trans("NotAvailable"); } - /** Renvoie version du module numerotation + /** Returns version of the model numbering * - * @return string Valeur + * @return string Value */ function getVersion() { @@ -143,7 +143,7 @@ abstract class ModeleNumRefSuppliersOrders * @param DoliDB $db Database handler * @param Object $object Object supplier order * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs Object lang a utiliser pour traduction + * @param Translate $outputlangs Object lang to use for traduction * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref @@ -164,7 +164,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet $srctemplatepath=''; - // Positionne le modele sur le nom du modele a utiliser + // Set the model on the model name to use if (! dol_strlen($modele)) { if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) @@ -177,7 +177,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet } } - // If selected modele is a filename template (then $modele="modelname:filename") + // If selected model is a filename template (then $modele="modelname:filename") $tmp=explode(':',$modele,2); if (! empty($tmp[1])) { @@ -195,7 +195,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet { $file = $prefix."_".$modele.".modules.php"; - // On verifie l'emplacement du modele + // We checked the location of the model $file=dol_buildpath($reldir."core/modules/supplier_order/pdf/".$file,0); if (file_exists($file)) { @@ -207,7 +207,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet if ($filefound) break; } - // Charge le modele + // Load the model if ($filefound) { require_once $file; @@ -225,12 +225,12 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_delete_preview($object); - // Appel des triggers + // Calls triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('ORDER_SUPPLIER_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End calls triggers return 1; } From 16efed11ca63a3605939ddd3e65d1c27ec557d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 15 Mar 2013 16:05:49 +0100 Subject: [PATCH 011/150] Added natural search to product line search --- htdocs/core/class/html.form.class.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 784c8bc926f..941865da45a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2010 Philippe Grand * Copyright (C) 2011 Herve Prot * Copyright (C) 2012 Marcos García + * Copyright (C) 2013 Raphaël Doursenaud * * 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 @@ -1223,9 +1224,13 @@ class Form } else { - $sql.=" AND (p.ref LIKE '%".$filterkey."%' OR p.label LIKE '%".$filterkey."%'"; - if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '%".$filterkey."%'"; - $sql.=")"; + // For natural search + $scrit = explode(' ', $filterkey); + foreach ($scrit as $crit) { + $sql.=" AND (p.ref LIKE '%".$crit."%' OR p.label LIKE '%".$crit."%'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '%".$crit."%'"; + $sql.=")"; + } } if (! empty($conf->barcode->enabled)) From b0bce235959ae08d5198bb7171cebc159dbf3759 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 16:16:38 +0100 Subject: [PATCH 012/150] prepair numbering models for supplier invoices --- .../modules_facturefournisseur.php | 78 ++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 5d409dd6c67..3d4e442f6f3 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013 Philippe Grand * * 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 @@ -20,7 +21,7 @@ /** * \file htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php * \ingroup facture fournisseur - * \brief File that contain parent class for supplier invoices models + * \brief File that contains parent class for supplier invoices models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -55,6 +56,79 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator } +/** + * Parent Class of numbering models of suppliers invoices references + */ +abstract class ModeleNumRefSuppliersInvoices +{ + var $error=''; + + /** Return if a model can be used or not + * + * @return boolean true if model can be used + */ + function isEnabled() + { + return true; + } + + /** Returns the default description of the model numbering + * + * @return string Description Text + */ + function info() + { + global $langs; + $langs->load("invoices"); + return $langs->trans("NoDescription"); + } + + /** Returns a numbering example + * + * @return string Example + */ + function getExample() + { + global $langs; + $langs->load("invoices"); + return $langs->trans("NoExample"); + } + + /** Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. + * + * @return boolean false if conflict, true if ok + */ + function canBeActivated() + { + return true; + } + + /** Returns next value assigned + * + * @return string Valeur + */ + function getNextValue() + { + global $langs; + return $langs->trans("NotAvailable"); + } + + /** Returns version of the model numbering + * + * @return string Value + */ + function getVersion() + { + global $langs; + $langs->load("admin"); + + if ($this->version == 'development') return $langs->trans("VersionDevelopment"); + if ($this->version == 'experimental') return $langs->trans("VersionExperimental"); + if ($this->version == 'dolibarr') return DOL_VERSION; + return $langs->trans("NotAvailable"); + } +} + /** * Create a document onto disk according to template module. * @@ -168,4 +242,4 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided } } -?> +?> \ No newline at end of file From c0e5cacafcb9cfa31c77d38e19936a3473f6f3ab Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 15 Mar 2013 16:18:14 +0100 Subject: [PATCH 013/150] Fix: Bad orders list viewstatut filter if expeditons module is disabled --- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/index.php | 2 +- htdocs/langs/ca_ES/orders.lang | 2 +- htdocs/langs/es_ES/orders.lang | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7ce259573be..e33c307d367 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -857,7 +857,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); if ($leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); - if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-2"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); + if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-3"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); diff --git a/htdocs/index.php b/htdocs/index.php index bb5a6bf8178..b42117e1c3b 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -308,7 +308,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $board->load_board($user); $board->warning_delay=$conf->commande->client->warning_delay/60/60/24; $board->label=$langs->trans("OrdersToProcess"); - $board->url=DOL_URL_ROOT.'/commande/liste.php?viewstatut=-2'; + $board->url=DOL_URL_ROOT.'/commande/liste.php?viewstatut=-3'; $board->img=img_object($langs->trans("Orders"),"order"); $rowspan++; $dashboardlines[]=$board; diff --git a/htdocs/langs/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index 15fd9b6c9a1..c63981ccf2e 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -28,7 +28,7 @@ SuppliersOrdersToProcess=Comandes a proveïdors a processar StatusOrderCanceledShort=Anul·lada StatusOrderDraftShort=Esborrany StatusOrderValidatedShort=Validada -StatusOrderOnProcessShort=Per rebre +StatusOrderOnProcessShort=En procés StatusOrderSentShort=Expedició en curs StatusOrderSent=Enviament en curs StatusOrderProcessedShort=Processada diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 13710c240b7..51bfbd082a2 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -28,7 +28,7 @@ SuppliersOrdersToProcess=Pedidos a proveedores a procesar StatusOrderCanceledShort=Anulado StatusOrderDraftShort=Borrador StatusOrderValidatedShort=Validado -StatusOrderOnProcessShort=Pdte. Recibir +StatusOrderOnProcessShort=En proceso StatusOrderSentShort=Expedición en curso StatusOrderSent=Envío en curso StatusOrderProcessedShort=Procesado From a9eed57e27aef5395b0da0eefbfb56ee93cc6e47 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 16:43:28 +0100 Subject: [PATCH 014/150] prepair numbering models for supplier invoices --- .../mod_facture_fournisseur_tulip.php | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php new file mode 100644 index 00000000000..88e930f7804 --- /dev/null +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -0,0 +1,145 @@ + + * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Philippe Grand + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php + * \ingroup commande + * \brief File containing the Tulip Class of numbering models of suppliers invoices references + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/modules_facturefournisseur.php'; + + +/** + \class mod_facture_fournisseur_tulip + \brief Tulip Class of numbering models of suppliers invoices references +*/ +class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersOrders +{ + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $error = ''; + var $nom = 'Tulip'; + + + /** + * Returns the description of the model numbering + * + * @return string Description Text + */ + function info() + { + global $conf,$langs; + + $langs->load("bills"); + $langs->load("admin"); + + $form = new Form($this->db); + + $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; + $texte.= '
'; + $texte.= ''; + $texte.= ''; + $texte.= ''; + $texte.= ''; + + $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Invoice"),$langs->transnoentities("Invoice")); + $tooltip.=$langs->trans("GenericMaskCodes2"); + $tooltip.=$langs->trans("GenericMaskCodes3"); + $tooltip.=$langs->trans("GenericMaskCodes4a",$langs->transnoentities("Invoice"),$langs->transnoentities("Invoice")); + $tooltip.=$langs->trans("GenericMaskCodes5"); + + // Parametrage du prefix + $texte.= ''; + $texte.= ''; + + $texte.= ''; + + $texte.= ''; + + $texte.= '
'.$langs->trans("Mask").':'.$form->textwithpicto('',$tooltip,1,1).' 
'; + $texte.= '
'; + + return $texte; + } + + /** + * Returns a numbering example + * + * @return string Example + */ + function getExample() + { + global $conf,$langs,$mysoc; + + $old_code_client=$mysoc->code_client; + $mysoc->code_client='CCCCCCCCCC'; + $numExample = $this->getNextValue($mysoc,''); + $mysoc->code_client=$old_code_client; + + if (! $numExample) + { + $numExample = $langs->trans('NotConfigured'); + } + return $numExample; + } + + /** + * Return next value + * + * @param Societe $objsoc Object third party + * @param Object $object Object + * @return string Value if OK, 0 if KO + */ + function getNextValue($objsoc=0,$object='') + { + global $db,$conf; + + require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; + + // On defini critere recherche compteur + $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK; + + if (! $mask) + { + $this->error='NotConfigured'; + return 0; + } + + $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); + + return $numFinal; + } + + + /** + * Renvoie la reference de commande suivante non utilisee + * + * @param Societe $objsoc Object third party + * @param Object $object Object + * @return string Texte descripif + */ + function commande_get_num($objsoc=0,$object='') + { + return $this->getNextValue($objsoc,$object); + } +} + +?> \ No newline at end of file From 1a62cdfbe85a5af570827932a370c3bae765142a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Mar 2013 17:06:42 +0100 Subject: [PATCH 015/150] Fix: Use better test to show localtax to avoid problem when switching from different country. --- .../core/modules/commande/doc/pdf_einstein.modules.php | 10 ++++------ htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 ++++------ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 10 ++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index ffb2b7fc1be..f13af05b108 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -378,10 +378,8 @@ class pdf_einstein extends ModelePDFCommandes // TODO : store local taxes types into object lines and remove this $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($localtax1_type)) - $localtax1_type = $localtax1_array[0]; - if (empty($localtax2_type)) - $localtax2_type = $localtax2_array[0]; + if (! isset($localtax1_type)) $localtax1_type = $localtax1_array[0]; + if (! isset($localtax2_type)) $localtax2_type = $localtax2_array[0]; //end TODO // retrieve global local tax @@ -390,9 +388,9 @@ class pdf_einstein extends ModelePDFCommandes if ($localtax2_type == '7') $localtax2_rate = $localtax2_array[1]; - if ($localtax1ligne != 0 || $localtax1_type == '7') + if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7')) $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2ligne != 0 || $localtax2_type == '7') + if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7')) $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 7b46fe6e5a5..d5cafd460c2 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -380,10 +380,8 @@ class pdf_crabe extends ModelePDFFactures // TODO : store local taxes types into object lines and remove this $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($localtax1_type)) - $localtax1_type = $localtax1_array[0]; - if (empty($localtax2_type)) - $localtax2_type = $localtax2_array[0]; + if (! isset($localtax1_type)) $localtax1_type = $localtax1_array[0]; + if (! isset($localtax2_type)) $localtax2_type = $localtax2_array[0]; //end TODO // retrieve global local tax @@ -392,9 +390,9 @@ class pdf_crabe extends ModelePDFFactures if ($localtax2_type == '7') $localtax2_rate = $localtax2_array[1]; - if ($localtax1ligne != 0 || $localtax1_type == '7') + if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7')) $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2ligne != 0 || $localtax2_type == '7') + if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7')) $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 6c481063086..b62a6fe01f6 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -375,10 +375,8 @@ class pdf_azur extends ModelePDFPropales // TODO : store local taxes types into object lines and remove this $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($localtax1_type)) - $localtax1_type = $localtax1_array[0]; - if (empty($localtax2_type)) - $localtax2_type = $localtax2_array[0]; + if (! isset($localtax1_type)) $localtax1_type = $localtax1_array[0]; + if (! isset($localtax2_type)) $localtax2_type = $localtax2_array[0]; //end TODO // retrieve global local tax @@ -387,9 +385,9 @@ class pdf_azur extends ModelePDFPropales if ($localtax2_type == '7') $localtax2_rate = $localtax2_array[1]; - if ($localtax1ligne != 0 || $localtax1_type == '7') + if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7')) $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2ligne != 0 || $localtax2_type == '7') + if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7')) $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; From 8f7c629d9cc051d110aa3e71cd8dc2e2a82e0c22 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 17:45:25 +0100 Subject: [PATCH 016/150] prepair numbering models for supplier invoices --- htdocs/admin/fournisseur.php | 122 ++++++++++++++++++ .../mod_facture_fournisseur_tulip.php | 6 +- .../modules_facturefournisseur.php | 2 +- 3 files changed, 126 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index e92ef38ee97..98f10481edc 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -116,6 +116,25 @@ if ($action == 'specimen') // For orders } } +if ($action == 'updateMaskInvoice') +{ + $maskconstinvoice=GETPOST('maskconstinvoice','alpha'); + $maskinvoice=GETPOST('maskinvoice','alpha'); + + if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + if ($action == 'specimenfacture') // For invoices { $modele=GETPOST('module','alpha'); @@ -521,6 +540,109 @@ foreach ($dirmodels as $reldir) print '
'; +// Supplier invoice numbering model + +print_titre($langs->trans("InvoicesNumberingModels")); + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +clearstatcache(); + +foreach ($dirmodels as $reldir) +{ + $dir = dol_buildpath($reldir."core/modules/supplier_invoice/"); + + if (is_dir($dir)) + { + $handle = opendir($dir); + if (is_resource($handle)) + { + $var=true; + + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 25) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file)-3, 3) == 'php') + { + $file = substr($file, 0, dol_strlen($file)-4); + + require_once $dir.$file.'.php'; + + $module = new $file; + + if ($module->isEnabled()) + { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + $var=!$var; + print ''; + + // Show example of numbering model + print ''."\n"; + + print ''; + + $invoice=new FactureFournisseur($db); + $invoice->initAsSpecimen(); + + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval=$module->getNextValue($mysoc,$invoice); + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { + $htmltooltip.=''.$langs->trans("NextValue").': '; + if ($nextval) + { + $htmltooltip.=$nextval.'
'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + + print ''; + + print ''; + } + } + } + closedir($handle); + } + } +} + +print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Info").'
'.$module->nom."\n"; + print $module->info(); + print ''; + $tmp=$module->getExample(); + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + } + elseif ($tmp=='NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
'; + if ($conf->global->INVOICE_SUPPLIER_ADDON == "$file") + { + print img_picto($langs->trans("Activated"),'switch_on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print '

'; + /* * Modeles documents for supplier invoices */ diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 88e930f7804..fe4aca4dd7f 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/modules_facturef \class mod_facture_fournisseur_tulip \brief Tulip Class of numbering models of suppliers invoices references */ -class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersOrders +class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices { var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' var $error = ''; @@ -56,7 +56,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersOrders $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; $texte.= '
'; $texte.= ''; - $texte.= ''; + $texte.= ''; $texte.= ''; $texte.= ''; @@ -123,7 +123,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersOrders return 0; } - $numFinal=get_next_value($db,$mask,'commande_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); + $numFinal=get_next_value($db,$mask,'facture_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); return $numFinal; } diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 3d4e442f6f3..c8fe4685fe2 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -242,4 +242,4 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided } } -?> \ No newline at end of file +?> From e46900ad84f50da3a7eeb2892271f8f9ca478931 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 18:40:31 +0100 Subject: [PATCH 017/150] prepair numbering models for supplier invoices --- .../mod_facture_fournisseur_cactus.php | 147 ++++++++++++++++++ .../mod_facture_fournisseur_tulip.php | 4 +- 2 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php new file mode 100644 index 00000000000..f753d8b2fce --- /dev/null +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -0,0 +1,147 @@ + + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2013 Philippe Grand + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/supplier_order/mod_facture_fournisseur_cactus.php + * \ingroup commande + * \brief File containing the Cactus Class of numbering models of suppliers invoices references + */ + +require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/modules_facturefournisseur.php'; + + +/** + * Cactus Class of numbering models of suppliers invoices references + */ +class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices +{ + var $version='dolibarr'; // 'development', 'experimental', 'dolibarr' + var $error = ''; + var $nom = 'Cactus'; + var $prefix='SI'; + + + /** + * Return description of numbering model + * + * @return string Text with description + */ + function info() + { + global $langs; + return $langs->trans("SimpleNumRefModelDesc",$this->prefix); + } + + + /** + * Returns a numbering example + * + * @return string Example + */ + function getExample() + { + return $this->prefix."1301-0001"; + } + + + /** + * Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. + * + * @return boolean false if conflict, true if ok + */ + function canBeActivated() + { + global $conf,$langs; + + $siyymm=''; $max=''; + + $posindice=8; + $sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref LIKE '".$this->prefix."____-%'"; + $sql.= " AND entity = ".$conf->entity; + $resql=$db->query($sql); + if ($resql) + { + $row = $db->fetch_row($resql); + if ($row) { $siyymm = substr($row[0],0,6); $max=$row[0]; } + } + if (! $siyymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i',$siyymm)) + { + return true; + } + else + { + $langs->load("errors"); + $this->error=$langs->trans('ErrorNumRefModel',$max); + return false; + } + } + + /** + * Return next value + * + * @param Societe $objsoc Object third party + * @param Object $object Object + * @return string Value if OK, 0 if KO + */ + function getNextValue($objsoc=0,$object='') + { + global $db,$conf; + + // D'abord on recupere la valeur max + $posindice=8; + $sql = "SELECT MAX(SUBSTRING(ref FROM ".$posindice.")) as max"; + $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn"; + $sql.= " WHERE ref like '".$this->prefix."____-%'"; + $sql.= " AND entity = ".$conf->entity; + + $resql=$db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $max = intval($obj->max); + else $max=0; + } + + //$date=time(); + $date=$object->datec; // Not always defined + if (empty($date)) $date=$object->date; // Creation date is order date for suppliers orders + $yymm = strftime("%y%m",$date); + $num = sprintf("%04s",$max+1); + + return $this->prefix.$yymm."-".$num; + } + + + /** + * Renvoie la reference de facture suivante non utilisee + * + * @param Societe $objsoc Object third party + * @param Object $object Object + * @return string Texte descripif + */ + function invoice_get_num($objsoc=0,$object='') + { + return $this->getNextValue($objsoc,$object); + } +} + +?> diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index fe4aca4dd7f..72cf50adc60 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -130,13 +130,13 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices /** - * Renvoie la reference de commande suivante non utilisee + * Renvoie la reference de facture suivante non utilisee * * @param Societe $objsoc Object third party * @param Object $object Object * @return string Texte descripif */ - function commande_get_num($objsoc=0,$object='') + function invoice_get_num($objsoc=0,$object='') { return $this->getNextValue($objsoc,$object); } From 654e99df8c236c24252913fb034c7f750eff32e8 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 15 Mar 2013 18:56:10 +0100 Subject: [PATCH 018/150] Work on new type of extrafield : separator with no field stored in database --- htdocs/core/class/extrafields.class.php | 12 ++++++++---- htdocs/langs/fr_FR/admin.lang | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index de828e8a237..b09ee145ebf 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -63,7 +63,8 @@ class ExtraFields 'price'=>'ExtrafieldPrice', 'phone'=>'ExtrafieldPhone', 'mail'=>'ExtrafieldMail', - 'select' => 'ExtrafieldSelect' + 'select' => 'ExtrafieldSelect', + 'separator' => 'ExtrafieldSeparator' ); /** @@ -103,10 +104,13 @@ class ExtraFields if (empty($label)) return -1; - // Create field into database - $result=$this->create($attrname,$type,$size,$elementtype, $unique, $required, $default_value,$param); + // Create field into database except for separator type + if ($elementtype != 'separator') + { + $result=$this->create($attrname,$type,$size,$elementtype, $unique, $required, $default_value,$param); + } $err1=$this->errno; - if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS') + if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $elementtype == 'separator') { // Add declaration of field into table $result2=$this->create_label($attrname,$label,$type,$pos,$size,$elementtype, $unique, $required, $param); diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 04a95bf5980..09325b9ab3e 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -354,6 +354,7 @@ ExtrafieldPhone = Téléphone ExtrafieldPrice = Prix ExtrafieldMail = Email ExtrafieldSelect = Liste de sélection +ExtrafieldSeparator = Séparateur de champ LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF WarningUsingFPDF=Attention: Votre fichier conf.php contient la directive dolibarr_pdf_force_fpdf=1. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalitée (Unicode, transparence des images, langues cyrillic, arabes ou asiatiques...), aussi vous pouvez rencontrez des problèmes durant la génération des PDF.
Pour résoudre cela et avoir un support complet de PDF, vous pouvez télécharger la librairie TCPDF puis commenter ou supprimer la ligne $dolibarr_pdf_force_fpdf=1, et ajouter à la place $dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF' LocalTaxDesc=Certains pays appliquent 2 voir 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:
1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)
2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)
3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)
4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)
5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)
6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale) From b1d50e3f7fc0570f7841ba3e90799c05c6adb0d2 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 15 Mar 2013 18:56:44 +0100 Subject: [PATCH 019/150] Move extrafield type select list on top of form --- htdocs/core/tpl/admin_extrafields_add.tpl.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index d4f5cf9ae40..864eaa13f0d 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -55,16 +55,16 @@
+ + - -'; From b36b776f10a3a3627223f1385fde1ccc5e24abf5 Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 15 Mar 2013 23:39:18 +0100 Subject: [PATCH 022/150] IKM : work on new extrafield separator type --- htdocs/core/class/extrafields.class.php | 27 ++++++++++++++----- htdocs/core/tpl/admin_extrafields_add.tpl.php | 14 +++++++--- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index b09ee145ebf..d917d6283ce 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -64,7 +64,7 @@ class ExtraFields 'phone'=>'ExtrafieldPhone', 'mail'=>'ExtrafieldMail', 'select' => 'ExtrafieldSelect', - 'separator' => 'ExtrafieldSeparator' + 'separate' => 'ExtrafieldSeparator' ); /** @@ -103,14 +103,13 @@ class ExtraFields if (empty($attrname)) return -1; if (empty($label)) return -1; - - // Create field into database except for separator type - if ($elementtype != 'separator') + // Create field into database except for separator type which is not stored in database + if ($type != 'separate') { $result=$this->create($attrname,$type,$size,$elementtype, $unique, $required, $default_value,$param); } $err1=$this->errno; - if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $elementtype == 'separator') + if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate') { // Add declaration of field into table $result2=$this->create_label($attrname,$label,$type,$pos,$size,$elementtype, $unique, $required, $param); @@ -550,8 +549,13 @@ class ExtraFields { while ($tab = $this->db->fetch_object($resql)) { + // we can add this attribute to adherent object - $array_name_label[$tab->name]=$tab->label; + if ($tab->type != 'separate') + { + $array_name_label[$tab->name]=$tab->label; + } + $this->attribute_type[$tab->name]=$tab->type; $this->attribute_label[$tab->name]=$tab->label; $this->attribute_size[$tab->name]=$tab->size; @@ -734,5 +738,16 @@ class ExtraFields return $out; } + /** + * Return HTML string to print separator extrafield + * + * @param string $key Key of attribute + * @return string + */ + function showSeparator($key) + { + $out = ''; + return $out; + } } ?> diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index 864eaa13f0d..5be1b8baaae 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -25,11 +25,18 @@ var size = jQuery("#size"); var unique = jQuery("#unique"); var required = jQuery("#required"); + var default_value = jQuery("#default_value"); if (type == 'date') { size.val('').attr('disabled','disabled'); unique.removeAttr('disabled','disabled'); jQuery("#value_choice").hide(); } @@ -41,6 +48,7 @@ else if (type == 'boolean') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();} else if (type == 'price') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").hide();} else if (type == 'select') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); jQuery("#value_choice").show();} + else if (type == 'separate') { size.val('').attr('disabled','disabled'); unique.attr('disabled','disabled'); required.val('').attr('disabled','disabled'); default_value.val('').attr('disabled','disabled'); jQuery("#value_choice").hide();} else size.val('').attr('disabled','disabled'); } init_typeoffields(''); @@ -64,7 +72,7 @@ - + - + From 7a16e1b6581e72502f1fa37d65e8e65b97dbe40c Mon Sep 17 00:00:00 2001 From: jfefe Date: Fri, 15 Mar 2013 23:41:24 +0100 Subject: [PATCH 023/150] Show extrafield separator in propale --- htdocs/comm/propal.php | 51 +++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e17940379bf..eb4278cb528 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1360,11 +1360,20 @@ if ($action == 'create') foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; + + // Show separator only + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } } } @@ -1854,19 +1863,25 @@ else foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } } if(count($extrafields->attribute_label) > 0) { From ba0963ea7dbfd3241637c7e5e79cf27ac27ed5c3 Mon Sep 17 00:00:00 2001 From: jfefe Date: Sat, 16 Mar 2013 00:00:57 +0100 Subject: [PATCH 024/150] Fix : implement separator extrafield - missing check on update --- htdocs/core/class/commonobject.class.php | 24 +++++++++++++++--------- htdocs/core/class/extrafields.class.php | 9 ++++++--- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 50bd564e8d9..26b8a0c5826 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2138,21 +2138,27 @@ abstract class CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."_extrafields (fk_object"; foreach($this->array_options as $key => $value) { + $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field of attribut - $sql.=",".substr($key,8); // Remove 'options_' prefix + if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate + $sql.=",".$attributeKey; } $sql .= ") VALUES (".$this->id; foreach($this->array_options as $key => $value) { + $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field o fattribut - if ($this->array_options[$key] != '') - { - $sql.=",'".$this->array_options[$key]."'"; - } - else - { - $sql.=",null"; - } + if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) + { + if ($this->array_options[$key] != '') + { + $sql.=",'".$this->array_options[$key]."'"; + } + else + { + $sql.=",null"; + } + } } $sql.=")"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d917d6283ce..5b12672f6ce 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -357,7 +357,6 @@ class ExtraFields function update($attrname,$label,$type,$length,$elementtype,$unique=0,$required=0,$pos,$param='') { $table=$elementtype.'_extrafields'; - // Special case for not normalized table names if ($elementtype == 'member') $table='adherent_extrafields'; elseif ($elementtype == 'company') $table='societe_extrafields'; @@ -385,8 +384,12 @@ class ExtraFields $lengthdb=$length; } $field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required?'NOT NULL':'NULL')); - $result=$this->db->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc); - if ($result > 0) + + if ($type != 'separate') // No table update when separate type + { + $result=$this->db->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc); + } + if ($result > 0 || $type == 'separate') { if ($label) { From f1a05528ad49e06ec1592089c0bcc5dfc162eba0 Mon Sep 17 00:00:00 2001 From: jfefe Date: Sat, 16 Mar 2013 00:16:30 +0100 Subject: [PATCH 025/150] Show extrafield separator on invoice --- htdocs/compta/facture.php | 40 ++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6b0cd0dfb93..4e0652a9d1d 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2101,11 +2101,19 @@ if ($action == 'create') foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; + // Show separator only + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } } } @@ -3090,19 +3098,25 @@ else if ($id > 0 || ! empty($ref)) foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; } - - print ''."\n"; } if(count($extrafields->attribute_label) > 0) { From f16c9dd3ac2e8ba1abda433ca11a94d57b7b9998 Mon Sep 17 00:00:00 2001 From: jfefe Date: Sat, 16 Mar 2013 00:19:53 +0100 Subject: [PATCH 026/150] Fix : bad permission --- htdocs/compta/facture.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4e0652a9d1d..96fca70af4c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3107,7 +3107,7 @@ else if ($id > 0 || ! empty($ref)) print 'attribute_required[$key])) print ' class="fieldrequired"'; print '>'.$label.''; } From 9a5743187984a948a7bc2fba664e7cede7035e60 Mon Sep 17 00:00:00 2001 From: jfefe Date: Sat, 16 Mar 2013 00:28:45 +0100 Subject: [PATCH 027/150] Show extrafield separator on thirdparty and contact --- htdocs/contact/fiche.php | 47 ++++++++++++++------ htdocs/societe/soc.php | 95 ++++++++++++++++++++++++---------------- 2 files changed, 91 insertions(+), 51 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 2f1f0613740..885711bb526 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -521,11 +521,18 @@ else foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } } } @@ -736,11 +743,18 @@ else foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.'\n"; + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.'\n"; + } } } @@ -948,9 +962,16 @@ else foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - print '\n"; + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print '\n"; + } } } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b45bf5a8e59..80de6ec7146 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -985,20 +985,27 @@ else { $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - if (($e % 2) == 0) + if ($extrafields->attribute_type[$key] == 'separate') { - print ''; - $colspan='0'; - } - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - print ''; - - if (($e % 2) == 1) print ''."\n"; - $e++; + print $extrafields->showSeparator($key); + } + else + { + if (($e % 2) == 0) + { + print ''; + $colspan='0'; + } + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + print ''; + + if (($e % 2) == 1) print ''."\n"; + $e++; + } } } @@ -1414,25 +1421,30 @@ else { $colspan = '3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - - if (($e % 2) == 0) + if ($extrafields->attribute_type[$key] == 'separate') { - print ''."\n"; - $colspan = '0'; + print $extrafields->showSeparator($key); } - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - print '"."\n"; - - if (($e % 2) == 1 ) + else { - print "\n"; + if (($e % 2) == 0) + { + print ''."\n"; + $colspan = '0'; + } + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + print '"."\n"; + + if (($e % 2) == 1 ) + { + print "\n"; + } + $e++; } - $old_pos = $extrafields->attribute_pos[$key]; - $e++; } } // Logo @@ -1753,18 +1765,25 @@ else { $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options['options_'.$key])?$object->array_options['options_'.$key]:'')); - if (($e % 2) == 0) + if ($extrafields->attribute_type[$key] == 'separate') { - print ''; - $colspan='0'; + print $extrafields->showSeparator($key); + } + else + { + if (($e % 2) == 0) + { + print ''; + $colspan='0'; + } + print ''; + print '"; + + if (($e % 2) == 1) print ''; + $e++; } - print ''; - print '"; - - if (($e % 2) == 1) print ''; - $e++; } } From e71103ed021b12965234731094544a11171e5624 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 16 Mar 2013 09:23:34 +0100 Subject: [PATCH 028/150] task #768: https://doliforge.org/tracker/?func=detail&aid=768&group_id=144 task #769 : https://doliforge.org/tracker/?func=detail&aid=769&group_id=144 --- htdocs/admin/fckeditor.php | 6 ++++++ htdocs/core/class/html.formmail.class.php | 5 +++++ htdocs/core/modules/modFckeditor.class.php | 9 ++++++--- htdocs/langs/en_US/admin.lang | 4 +++- htdocs/langs/es_ES/admin.lang | 4 +++- htdocs/langs/fr_FR/admin.lang | 4 +++- 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 125c3cb12d0..57bc089c6a5 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -41,6 +41,8 @@ $modules = array( 'PRODUCTDESC' => 'FCKeditorForProduct', 'MAILING' => 'FCKeditorForMailing', 'DETAILS' => 'FCKeditorForProductDetails', +'USERSIGN' => 'FCKeditorForUserSignature', +'MAIL' => 'FCKeditorForMail' ); // Conditions pour que l'option soit proposee $conditions = array( @@ -48,6 +50,8 @@ $conditions = array( 'PRODUCTDESC' => (! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'MAILING' => ! empty($conf->mailing->enabled), 'DETAILS' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)), +'USERSIGN' => 1, +'MAIL' => (! empty($conf->facture->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled)) ); // Picto $picto = array( @@ -55,6 +59,8 @@ $picto = array( 'PRODUCTDESC' => 'product', 'MAILING' => 'email', 'DETAILS' => 'generic', +'USERSIGN' => 'user', +'MAIL' => 'email' ); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index bca6463055b..656679a66f0 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -77,6 +77,8 @@ class FormMail */ function __construct($db) { + global $conf; + $this->db = $db; $this->withform=1; @@ -593,6 +595,9 @@ class FormMail // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { + $this->withfckeditor=1; + } $doleditor=new DolEditor('message',$defaultmessage,'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72); $out.= $doleditor->Create(1); } diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index 10bd7414722..5c3f3f266bb 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -67,9 +67,12 @@ class modFckeditor extends DolibarrModules // Constantes $this->const = array(); - $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE","yesno","1","Activation fckeditor sur notes autres"); - $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC","yesno","1","Activation fckeditor sur notes produits"); - $this->const[2] = array("FCKEDITOR_ENABLE_MAILING","yesno","1","Activation fckeditor sur emailing"); + $this->const[0] = array("FCKEDITOR_ENABLE_SOCIETE","yesno","1","WYSIWIG for description and note (except products/services)"); + $this->const[1] = array("FCKEDITOR_ENABLE_PRODUCTDESC","yesno","1","WYSIWIG for products/services description and note"); + $this->const[2] = array("FCKEDITOR_ENABLE_MAILING","yesno","1","WYSIWIG for mass emailings"); + $this->const[3] = array("FCKEDITOR_ENABLE_DETAILS","yesno","1","WYSIWIG for products details lines for all entities"); + $this->const[4] = array("FCKEDITOR_ENABLE_USERSIGN","yesno","1","WYSIWIG for products details lines for all entities"); + $this->const[5] = array("FCKEDITOR_ENABLE_MAIL","yesno","1","WYSIWIG for products details lines for all entities"); // Boites $this->boxes = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3b13ef6e834..b27ab4e0301 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1274,7 +1274,9 @@ ActivateFCKeditor=Activate advanced editor for: FCKeditorForCompany=WYSIWIG creation/edition of elements description and note (except products/services) FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). Warning: Using this option for this case is seriously not recommanded as it can create problems with special characters and page formating when building PDF files. -FCKeditorForMailing=WYSIWIG creation/edition of mailings +FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) +FCKeditorForUserSignature=WYSIWIG creation/edition of user signature +FCKeditorForMail=WYSIWIG creation/edition for all mail (except Outils->eMailing) ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database (Key %s not found in table %s). OSCommerceTestOk=Connection to server '%s' on database '%s' with user '%s' successfull. diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 6c6239b9522..811d9166b57 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -1270,7 +1270,9 @@ ActivateFCKeditor=Activar editor avanzado para : FCKeditorForCompany=Creación/edición WYSIWIG de la descripción y notas de los terceros FCKeditorForProduct=Creación/edición WYSIWIG de la descripción y notas de los productos/servicios FCKeditorForProductDetails=Creación/edición WYSIWIG de las líneas de detalle de los productos (en pedidos, presupuestos, facturas, etc.) -FCKeditorForMailing=Creación/edición WYSIWIG de los E-Mails +FCKeditorForMailing=Creación/edición WYSIWIG de los E-Mails (Utilidades->E-Mailings) +FCKeditorForUserSignature=Creación/edición WYSIWIG de los usuario firma +FCKeditorForMail=Creación/edición WYSIWIG de todos los E-Mails (excepto Utilidades->E-Mailings) ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=La conexión se ha establecido, pero la base de datos no parece de OSCommerce. OSCommerceTestOk=La conexión al servidor '%s' sobre la base '%s' por el usuario '%s' es correcta. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 04a95bf5980..6d5b639378f 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1274,7 +1274,9 @@ ActivateFCKeditor= Activer éditeur avancé pour : FCKeditorForCompany= Création/édition WYSIWIG de la description et note des éléments (autre que produits/services) FCKeditorForProduct= Création/édition WYSIWIG de la description et note des produits/services FCKeditorForProductDetails= Création/édition WYSIWIG des lignes détails produits (sur commandes, propales, factures, etc...). Attention: L'utilisation pour ce cas est fortement déconseillée car peut poser des problèmes dans la gestion de caractères et mise en page des fichiers PDF générés. -FCKeditorForMailing= Création/édition WYSIWIG des mailings +FCKeditorForMailing= Création/édition WYSIWIG des mailings (Outils->EMailings) +FCKeditorForUserSignature=Création/édition WYSIWIG de la signature des utilisateurs +FCKeditorForMail=Création/édition WYSIWIG tous les mails (sauf Outils->EMailings) ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase= La connexion a réussi mais la base ne semble pas être une base OSCommerce (clé %s non trouvée dans la table %s). OSCommerceTestOk= La connexion au serveur '%s' sur la base '%s' par l'utilisateur '%s' a réussi. From 1f5ebb594a0ef9fa00f8b613b7fd6fc791813819 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 16 Mar 2013 09:43:09 +0100 Subject: [PATCH 029/150] [ task #769 ] WYSIWYG for user signature --- htdocs/user/class/user.class.php | 6 +++++- htdocs/user/fiche.php | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index feb1b6164e0..63db83634a8 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -201,7 +201,11 @@ class User extends CommonObject $this->user_mobile = $obj->user_mobile; $this->email = $obj->email; $this->job = $obj->job; - $this->signature = $obj->signature; + if (!empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) && dol_textishtml(dol_html_entity_decode($obj->signature, ENT_COMPAT | ENT_HTML401))) { + $this->signature = dol_html_entity_decode($obj->signature, ENT_COMPAT | ENT_HTML401); + }else { + $this->signature = $obj->signature; + } $this->admin = $obj->admin; $this->note = $obj->note; $this->statut = $obj->statut; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 5c4ddac9718..cec4686ba5f 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -886,7 +886,17 @@ if (($action == 'create') || ($action == 'adduserldap')) // Signature print ''; print ''; // Multicompany @@ -1794,7 +1804,17 @@ else // Signature print "".''; print ''; // openid From cf21b32eb1e953448341a4696f27bf8f46f57545 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 16 Mar 2013 09:46:34 +0100 Subject: [PATCH 030/150] task #768 --- htdocs/core/class/html.formmail.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 656679a66f0..37ad8a6384c 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -76,9 +76,7 @@ class FormMail * @param DoliDB $db Database handler */ function __construct($db) - { - global $conf; - + { $this->db = $db; $this->withform=1; From de458fa62615ecfecb6bf5a1b39972a73d009e5c Mon Sep 17 00:00:00 2001 From: eldy Date: Sat, 16 Mar 2013 12:22:37 +0100 Subject: [PATCH 031/150] Qual: Move option at better place --- htdocs/admin/pdf.php | 54 +++++++++++++++++++++++++++++++++++---- htdocs/admin/security.php | 44 ------------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index fc384046256..2734bacea2a 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -68,6 +68,20 @@ if ($action == 'update') exit; } +if ($action == 'activate_pdfsecurity') +{ + dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} +else if ($action == 'disable_pdfsecurity') +{ + dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + + /* * View @@ -366,31 +380,61 @@ else // Show print_fiche_titre($langs->trans("Other"),'','').'
'; $var=true; print '
trans("Type"); ?> +selectarray('type',$type2label,GETPOST('type')); ?> +
trans("Position"); ?>
trans("Label"); ?>
trans("AttributeCode"); ?> (trans("AlphaNumOnlyCharsAndNoSpace"); ?>)
trans("Type"); ?> -selectarray('type',$type2label,GETPOST('type')); ?> -
From 7dbc782d42888a30fcf9e273b1f563682a76ea7e Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 19:03:07 +0100 Subject: [PATCH 020/150] prepair numbering models for supplier invoices --- .../core/modules/supplier_invoice/modules_facturefournisseur.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index c8fe4685fe2..7a80cc93bfe 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -24,6 +24,7 @@ * \brief File that contains parent class for supplier invoices models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requis car utilise par les classes qui heritent /** From 6fbb00a8905f14a8a8fcc24ce4ef9a4ee295dc99 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 15 Mar 2013 19:28:26 +0100 Subject: [PATCH 021/150] prepair numbering models for supplier invoices --- htdocs/admin/fournisseur.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index 98f10481edc..b26b156cebf 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -261,6 +261,14 @@ if ($action == 'setmod') dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity); } +if ($action == 'invoicesetmod') +{ + // TODO Verifier si module numerotation choisi peut etre active + // par appel methode canBeActivated + + dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity); +} + if ($action == 'addcat') { $fourn = new Fournisseur($db); @@ -604,7 +612,7 @@ foreach ($dirmodels as $reldir) } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } print '
'.$this->attribute_label[$key].'
trans("Label"); ?>
trans("AttributeCode"); ?> (trans("AlphaNumOnlyCharsAndNoSpace"); ?>)
trans("AttributeCode"); ?> (trans("AlphaNumOnlyCharsAndNoSpace"); ?>)
@@ -75,7 +83,7 @@
trans("DefaultValue"); ?>">
trans("DefaultValue"); ?>">
trans("Size"); ?>
'; - print $extrafields->showInputField($key,$value); - print '
'; + print $extrafields->showInputField($key,$value); + print '
'; - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print $extrafields->showInputField($key,$value); - } - else - { - print $extrafields->showOutputField($key,$value); - } - - print '
'; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print '
'; - print $extrafields->showInputField($key,$value); - print '
'; + print $extrafields->showInputField($key,$value); + print '
'; - if ($action == 'edit_extras' && $user->rights->propal->creer) + if ($extrafields->attribute_type[$key] == 'separate') { - print $extrafields->showInputField($key,$value); + print $extrafields->showSeparator($key); } else { - print $extrafields->showOutputField($key,$value); + print '
'; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print '
'; - if ($action == 'edit_extras' && $user->rights->propal->creer) + if ($action == 'edit_extras' && $user->rights->facture->creer) { print $extrafields->showInputField($key,$value); } @@ -3121,7 +3121,7 @@ else if ($id > 0 || ! empty($ref)) if(count($extrafields->attribute_label) > 0) { - if ($action == 'edit_extras' && $user->rights->propal->creer) + if ($action == 'edit_extras' && $user->rights->facture->creer) { print '
'; print ''; @@ -3130,7 +3130,7 @@ else if ($id > 0 || ! empty($ref)) } else { - if ($object->statut == 0 && $user->rights->propal->creer) + if ($object->statut == 0 && $user->rights->facture->creer) { print '
'.img_picto('','edit').' '.$langs->trans('Modify').'
'; - print $extrafields->showInputField($key,$value); - print '
'; + print $extrafields->showInputField($key,$value); + print '
'; - print $extrafields->showInputField($key,$value); - print "
'; + print $extrafields->showInputField($key,$value); + print "
'.$label.''; - print $extrafields->showOutputField($key,$value); - print "
'.$label.''; + print $extrafields->showOutputField($key,$value); + print "
'; - print $extrafields->showInputField($key,$value); - print '
'; + print $extrafields->showInputField($key,$value); + print '
'; - print $extrafields->showInputField($key,$value); - print "
'; + print $extrafields->showInputField($key,$value); + print "
'.$label.''; + print $extrafields->showOutputField($key,$value); + print "
'.$label.''; - print $extrafields->showOutputField($key,$value); - print "
'.$langs->trans("Signature").''; - print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + if (!empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)) { + $withfckeditor=1; + //Mailing is mandatory to have dolHTMLencode done by ckeditor + $ckeditortoolbar='dolibarr_mailings'; + } else { + $withfckeditor=0; + $ckeditortoolbar=''; + } + $doleditor=new DolEditor('signature',GETPOST('signature'),'',280,$ckeditortoolbar,'In',true,true,$withfckeditor,8,72); + print $doleditor->Create(1); print '
'.$langs->trans("Signature").''; - print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + if (!empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)) { + $withfckeditor=1; + //Mailing is mandatory to have dolHTMLencode done by ckeditor + $ckeditortoolbar='dolibarr_mailings'; + } else { + $withfckeditor=0; + $ckeditortoolbar=''; + } + $doleditor=new DolEditor('signature',$object->signature,'',280,$ckeditortoolbar,'In',true,true,$withfckeditor,8,72); + print $doleditor->Create(1); print '
'; - print ''; + print ''; + // Hide any PDF informations $var=!$var; - print ''; + + // Encrypt and protect PDF + $var=!$var; + print ""; + print ''; + print ''; + print '"; + + print ""; + print ''; + if ($conf->global->MAIN_FEATURES_LEVEL > 1) { //Desc $var=!$var; - print ''; //Ref $var=!$var; - print ''; //Details $var=!$var; - print ''; } diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index a78d2354141..9c4bfc67af4 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -154,19 +154,6 @@ else if ($action == 'disable_encryptdbpassconf') } } -if ($action == 'activate_pdfsecurity') -{ - dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity); - header("Location: security.php"); - exit; -} -else if ($action == 'disable_pdfsecurity') -{ - dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity); - header("Location: security.php"); - exit; -} - if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') { dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1','chaine',0,'',$conf->entity); @@ -364,37 +351,6 @@ print ""; print ""; print ''; -// Encryption et protection des PDF -$var=!$var; -print ""; -print ''; -print ''; - -print '"; - -print ""; -print ''; - - // Disable link "Forget password" on logon $var=!$var; From 55f9879a6cf9c7030d91808be92892b6b44f6afc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Mar 2013 14:53:15 +0100 Subject: [PATCH 032/150] Replace table with div. Prepare work for android application. --- htdocs/adherents/index.php | 12 +++++++----- htdocs/categories/index.php | 13 ++++++++----- htdocs/comm/index.php | 16 +++++++++------- htdocs/comm/mailing/index.php | 18 +++++++++--------- htdocs/comm/propal/index.php | 14 +++++++++----- htdocs/comm/prospect/index.php | 19 ++++++++++--------- htdocs/commande/index.php | 14 +++++++++----- htdocs/compta/index.php | 19 +++++++++---------- htdocs/compta/paiement/cheque/index.php | 16 +++++++++------- htdocs/compta/prelevement/index.php | 13 +++++++++---- htdocs/compta/ventilation/index.php | 22 ++++++++++++++-------- htdocs/ecm/index.php | 2 ++ htdocs/expedition/index.php | 17 ++++++++++------- htdocs/fourn/index.php | 20 +++++++++++++------- htdocs/product/index.php | 14 ++++++++++---- htdocs/product/stock/index.php | 16 +++++++++++----- htdocs/societe/index.php | 15 ++++++++++----- htdocs/user/home.php | 18 ++++++++++-------- 18 files changed, 168 insertions(+), 110 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 9e86de34c58..e3787b18c89 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -47,7 +47,6 @@ $subscriptionstatic=new Cotisation($db); print_fiche_titre($langs->trans("MembersArea")); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; + print '
'.$langs->trans("HideAnyVATInformationOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1); print '
'; + $text = $langs->trans("ProtectAndEncryptPdfFiles"); + $desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); + print $desc; + print ''; + if($conf->global->PDF_SECURITY_ENCRYPTION == 1) + { + print img_picto($langs->trans("Active"),'tick'); + } + print ''; + if ($conf->global->PDF_SECURITY_ENCRYPTION == 0) + { + print ''.$langs->trans("Activate").''; + } + if($conf->global->PDF_SECURITY_ENCRYPTION == 1) + { + print ''.$langs->trans("Disable").''; + } + print "
'.$langs->trans("HideDescOnPDF").''; + print '
'.$langs->trans("HideDescOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1); print '
'.$langs->trans("HideRefOnPDF").''; + print '
'.$langs->trans("HideRefOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1); print '
'.$langs->trans("HideDetailsOnPDF").''; + print '
'.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print '
'; -$text = $langs->trans("ProtectAndEncryptPdfFiles"); -$desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); -print $desc; -print ''; -if($conf->global->PDF_SECURITY_ENCRYPTION == 1) -{ - print img_picto($langs->trans("Active"),'tick'); -} - -print ''; -if ($conf->global->PDF_SECURITY_ENCRYPTION == 0) -{ - print ''.$langs->trans("Activate").''; -} -if($conf->global->PDF_SECURITY_ENCRYPTION == 1) -{ - print ''.$langs->trans("Disable").''; -} -print "
'; $var=True; @@ -122,7 +121,8 @@ if ($result) } -print '
'; +//print '
'; +print '
'; // Formulaire recherche adherent @@ -195,7 +195,9 @@ if ($conf->use_javascript_ajax) print '
'; } -print ''; + +//print ''; +print '
'; $var=true; @@ -416,8 +418,8 @@ print "".price(price2num($numb>0?($tot/$numb):0,'MT'))."\n"; print "
\n"; -print ''; -print ''; +//print ''; +print '
'; llxFooter(); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index cf0138a0022..532a95f7317 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -60,9 +60,9 @@ llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss); print_fiche_titre($title); -print ''; - -print '
'; +//print ''; +//print '
'; +print '
'; /* @@ -89,7 +89,9 @@ print '
'; -print ''; + +//print ''; +print '
'; /* @@ -121,7 +123,8 @@ if ($catname || $id > 0) } -print '
'; +//print '
'; +print '
'; print '
'; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index cfcd8ee121c..c30d75192d8 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -87,8 +87,9 @@ llxHeader(); print_fiche_titre($langs->trans("CustomerArea")); +print '
'; +/* print ''; - print ''; if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) || @@ -96,6 +97,7 @@ if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || { print ''; -print '
'; } +*/ // Recherche Propal if (! empty($conf->propal->enabled) && $user->rights->propal->lire) @@ -256,7 +258,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) } } -if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || + +/*if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) || (! empty($conf->commande->enabled) && $user->rights->commande->lire)) { @@ -266,8 +269,8 @@ if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || else { print ''; -} - +}*/ +print '
'; $NBMAX=3; @@ -542,11 +545,10 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) } -print '
'; +//print ''; +print '
'; llxFooter(); $db->close(); - ?> \ No newline at end of file diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index e2cbe9fb5a9..b2ff4d92f76 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -44,9 +44,9 @@ llxHeader('','EMailing',$help_url); print_fiche_titre($langs->trans("MailingArea")); -print ''; - -print ''; -print '
'; +//print ''; +//print '
'; +print '
'; // Recherche emails @@ -141,7 +141,9 @@ if (is_resource($handle)) print "

"; -print '
'; + +//print ''; +print '
'; /* @@ -198,11 +200,8 @@ else } - -print '
'; - -$db->close(); +//print ''; +print '
'; if ($langs->file_exists("html/spam.html",0)) { @@ -217,4 +216,5 @@ if ($langs->file_exists("html/spam.html",0)) { llxFooter(); +$db->close(); ?> diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 41bc6bf5f0b..4ac166b54a2 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -54,9 +54,10 @@ llxHeader("",$langs->trans("ProspectionArea"),$help_url); print_fiche_titre($langs->trans("ProspectionArea")); -print ''; +//print '
'; +//print '
'; +print '
'; -print '
'; /* * Search form @@ -199,7 +200,9 @@ if (! empty($conf->propal->enabled)) } } -print ''; + +//print ''; +print '
'; $max=5; @@ -509,10 +512,11 @@ if (! empty($conf->propal->enabled)) } */ -print '
'; +//print ''; +print '
'; -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 6d9ad5c3f62..bf53b674bc5 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -46,9 +46,10 @@ llxHeader(); print_fiche_titre($langs->trans("ProspectionArea")); -print ''; +//print '
'; +//print ''; -print '
'; +print '
'; -print '
'; if (! empty($conf->propal->enabled)) { @@ -158,17 +159,18 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) } } + +//print ''; +print '
'; + + /* * Actions commerciales a faire - * */ -print '
'; - if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10); /* * Dernieres propales ouvertes - * */ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { @@ -276,11 +278,10 @@ if ($resql) } -print '
'; +//print ''; +print '
'; llxFooter(); $db->close(); - ?> \ No newline at end of file diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index c382599bb4c..3301721df7a 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -55,9 +55,10 @@ llxHeader("",$langs->trans("Orders"),$help_url); print_fiche_titre($langs->trans("OrdersArea")); -print ''; +//print '
'; +//print '
'; +print '
'; -print '
'; /* * Search form @@ -204,7 +205,9 @@ if (! empty($conf->commande->enabled)) } } -print ''; + +//print ''; +print '
'; $max=5; @@ -421,10 +424,11 @@ if (! empty($conf->commande->enabled)) } -print '
'; +//print ''; +print '
'; -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 978109ff67e..d4aad86977e 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -104,10 +104,9 @@ llxHeader("",$langs->trans("AccountancyTreasuryArea")); print_fiche_titre($langs->trans("AccountancyTreasuryArea")); -print ''; - -print ''; -print ''; - -print '
'; +//print ''; +//print ''; -print '
'; +print '
'; $max=3; @@ -323,8 +322,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- } } -print '
'; + +//print ''; +print '
'; + // Last modified customer invoices if (! empty($conf->facture->enabled) && $user->rights->facture->lire) @@ -1031,12 +1032,10 @@ if ($resql) print "

"; } -print '
'; +//print ''; +print '
'; llxFooter(); $db->close(); - ?> diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index aec05b00da4..45a1f665a37 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -46,9 +46,9 @@ llxHeader('',$langs->trans("ChequesArea")); print_fiche_titre($langs->trans("ChequesArea")); -print ''; - -print '
'; +//print ''; +//print '\n"; -print "
'; +print '
'; $sql = "SELECT count(b.rowid)"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -86,7 +86,8 @@ else } -print '
'; +//print ''; +print '
'; $sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.number as ref"; @@ -143,10 +144,11 @@ else dol_print_error($db); } -print "
\n"; -$db->close(); +//print "
\n"; +print '
'; llxFooter(); + +$db->close(); ?> diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 907aad6679c..5fdd334db55 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -61,9 +61,10 @@ if (prelevement_check_config() < 0) print_fiche_titre($langs->trans("CustomersStandingOrdersArea")); -print ''; +//print '
'; +//print '
'; +print '
'; -print '
'; $thirdpartystatic=new Societe($db); $invoicestatic=new Facture($db); @@ -85,8 +86,9 @@ print ''; print price($bprev->SommeAPrelever()); print '

'; -print ''; +//print ''; +print '
'; /* @@ -218,7 +220,10 @@ else } -print ''; +//print ''; +print '
'; llxFooter(); + +$db->close(); ?> diff --git a/htdocs/compta/ventilation/index.php b/htdocs/compta/ventilation/index.php index 9cd939868c8..d01d1735734 100644 --- a/htdocs/compta/ventilation/index.php +++ b/htdocs/compta/ventilation/index.php @@ -32,14 +32,14 @@ llxHeader('','Compta - Ventilation'); print_fiche_titre("Ventilation Comptable"); -print ''; - -print '
'; +//print ''; +//print '
'; +print '
'; $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " , ".MAIN_DB_PREFIX."facture as f"; $sql.= " WHERE fd.fk_code_ventilation = 0"; -$sql.= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;"; +$sql.= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1"; $result = $db->query($sql); if ($result) @@ -56,14 +56,17 @@ print ''; print ''; print ''; $var=!$var; -print "".''; +print "".''; $var=!$var; print "
'.$langs->trans("Lines").'
'.$langs->trans("Type").''.$langs->trans("Nb").'
'.$langs->trans("Invoices").''.$nbfac.'
'.$langs->trans("Invoices").''.$nbfac.'
\n"; -print '
'; + +//print ''; +print '
'; + print ''; -print ''; +print ''; $sql = "SELECT count(*), ccg.intitule, ccg.rowid,ccg.numero FROM ".MAIN_DB_PREFIX."facturedet as fd"; $sql.= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg"; @@ -90,8 +93,11 @@ if ($resql) } print "
Type'.$langs->trans("NbOfLines").''.$langs->trans("AccountNumber").''.$langs->trans("TransID").'
'.$langs->trans("Type").''.$langs->trans("NbOfLines").''.$langs->trans("AccountNumber").''.$langs->trans("TransID").'
\n"; -print '
'; +//print '
'; +print '
'; + llxFooter(); +$db->close(); ?> diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 2f42787dda6..418177e44d8 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -393,9 +393,11 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { } print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager")); +print '
'; print $langs->trans("ECMAreaDesc")."
"; print $langs->trans("ECMAreaDesc2")."
"; print "
\n"; +print '
'; // Confirm remove file (for non javascript users) if ($action == 'delete' && empty($conf->use_javascript_ajax)) diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 084fb65aca7..1b28f1f7b7f 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -43,8 +43,11 @@ llxHeader('',$langs->trans("Sendings"),$helpurl); print_fiche_titre($langs->trans("SendingsArea")); -print ''; -print '
'; + +//print ''; +//print '
'; +print '
'; + $var=false; print ''; @@ -159,10 +162,8 @@ if ($resql) } -/* - * - */ -print '
'; +//print ''; +print '
'; /* @@ -272,7 +273,9 @@ if ($resql) } else dol_print_error($db); -print '
'; + +//print '
'; +print '
'; llxFooter(); diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index c03004cf7b5..ec832a670d2 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -50,8 +50,11 @@ llxHeader("",$langs->trans("SuppliersArea")); print_fiche_titre($langs->trans("SuppliersArea")); -print ''; -print '
'; + +//print ''; +//print '\n"; -print '\n"; -print "
'; +print '
'; + // Orders $commande = new CommandeFournisseur($db); @@ -221,8 +224,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- } } -print "
'; + +//print ''; +print '
'; + /* * List last modified supliers @@ -314,10 +319,11 @@ if (count($companystatic->SupplierCategories)) print "
\n"; } -print "
\n"; -$db->close(); +//print "
\n"; +print '
'; llxFooter(); + +$db->close(); ?> diff --git a/htdocs/product/index.php b/htdocs/product/index.php index bb5baaaf698..f0ab56ae6f0 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -66,9 +66,11 @@ llxHeader("",$langs->trans("ProductsAndServices"),$helpurl); print_fiche_titre($transAreaType); -print ''; -print '
'; +//print ''; +//print ''; print '
'; +print '
'; + /* * Zone recherche produit/service @@ -156,7 +158,10 @@ print $total; print '
'; -print '
'; + +//print ''; +print '
'; + /* * Last modified products @@ -253,7 +258,8 @@ else dol_print_error($db); } -print '
'; +//print '
'; +print '
'; llxFooter(); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 1dc2d16957b..d544175b2fd 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -42,8 +42,11 @@ llxHeader("",$langs->trans("Stocks"),$help_url); print_fiche_titre($langs->trans("StocksArea")); -print ''; -print '
'; + +//print ''; +//print '
'; +print '
'; + /* * Zone recherche entrepot @@ -101,7 +104,10 @@ else dol_print_error($db); } -print '
'; + +//print ''; +print '
'; + // Last movements $max=10; @@ -157,10 +163,10 @@ if ($resql) print "
"; } -print '
'; +//print ''; +print '
'; llxFooter(); $db->close(); - ?> diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index f273549efb9..e113ad7e0e1 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -48,9 +48,11 @@ llxHeader("",$langs->trans("ThirdParties"),$helpurl); print_fiche_titre($transAreaType); -print ''; -print '
'; +//print ''; +//print ''; print '
'; +print '
'; + /* * Search area @@ -148,7 +150,10 @@ print $total; print '
'; -print '
'; + +//print ''; +print '
'; + /* * Last third parties modified @@ -243,10 +248,10 @@ else dol_print_error($db); } -print '
'; +//print ''; +print '
'; llxFooter(); $db->close(); - ?> diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 7dd9e44f800..66c74e5d290 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -56,9 +56,10 @@ llxHeader(); print_fiche_titre($langs->trans("MenuUsersAndGroups")); -print ''; +//print '
'; +//print ''; -print '
'; +print '
'; -print '
'; // Search User $var=false; @@ -87,7 +88,9 @@ if ($canreadperms) print ''; } -print ''; + +//print ''; +print '
'; /* @@ -250,11 +253,10 @@ if ($canreadperms) } } -print '
'; - -$db->close(); - +//print ''; +print '
'; llxFooter(); + +$db->close(); ?> From 5ad1cbbfa5c7807fe7db63720e4c9e89a3d9cdab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Mar 2013 15:04:27 +0100 Subject: [PATCH 033/150] Fix: Filter lost during navigation --- htdocs/admin/tools/listevents.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 7f5abf388eb..8056080be23 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -111,7 +111,7 @@ if ($action == 'confirm_purge' && $confirm == 'yes' && $user->admin) * View */ -llxHeader(); +llxHeader('',$langs->trans("Audit")); $form=new Form($db); @@ -124,11 +124,11 @@ $sql.= " u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."events as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = e.fk_user"; $sql.= " WHERE e.entity = ".$conf->entity; -if ($search_code) { $usefilter++; $sql.=" AND e.type LIKE '%".$search_code."%'"; } -if ($search_ip) { $usefilter++; $sql.=" AND e.ip LIKE '%".$search_ip."%'"; } -if ($search_user) { $usefilter++; $sql.=" AND u.login LIKE '%".$search_user."%'"; } -if ($search_desc) { $usefilter++; $sql.=" AND e.description LIKE '%".$search_desc."%'"; } -if ($search_ua) { $usefilter++; $sql.=" AND e.user_agent LIKE '%".$search_ua."%'"; } +if ($search_code) { $usefilter++; $sql.=" AND e.type LIKE '%".$db->escape($search_code)."%'"; } +if ($search_ip) { $usefilter++; $sql.=" AND e.ip LIKE '%".$db->escape($search_ip)."%'"; } +if ($search_user) { $usefilter++; $sql.=" AND u.login LIKE '%".$db->escape($search_user)."%'"; } +if ($search_desc) { $usefilter++; $sql.=" AND e.description LIKE '%".$db->escape($search_desc)."%'"; } +if ($search_ua) { $usefilter++; $sql.=" AND e.user_agent LIKE '%".$db->escape($search_ua)."%'"; } $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); //print $sql; @@ -138,7 +138,14 @@ if ($result) $num = $db->num_rows($result); $i = 0; - print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,'setup'); + $param=''; + if ($search_code) $param.='&search_code='.$search_code; + if ($search_ip) $param.='&search_ip='.$search_ip; + if ($search_user) $param.='&search_user='.$search_user; + if ($search_desc) $param.='&search_desc='.$search_desc; + if ($search_ua) $param.='&search_ua='.$search_ua; + + print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, 0, 'setup'); if ($action == 'purge') { @@ -178,7 +185,7 @@ if ($result) print ''; print ''; - print ''; + //print ''; print ''; print ''; From 7a69066dc849abfb326bddb27007d5173d0b5ccf Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sat, 16 Mar 2013 15:24:14 +0100 Subject: [PATCH 034/150] enhancement of suppliers module --- htdocs/admin/supplier_invoice.php | 511 ++++++++++++++++++ .../{fournisseur.php => supplier_order.php} | 348 +----------- htdocs/core/modules/modFournisseur.class.php | 7 +- htdocs/langs/fr_FR/admin.lang | 1 + 4 files changed, 544 insertions(+), 323 deletions(-) create mode 100644 htdocs/admin/supplier_invoice.php rename htdocs/admin/{fournisseur.php => supplier_order.php} (57%) diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php new file mode 100644 index 00000000000..49e31d1b86c --- /dev/null +++ b/htdocs/admin/supplier_invoice.php @@ -0,0 +1,511 @@ + + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2011-2013 Philippe Grand + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/admin/supplier_invoice.php + * \ingroup fournisseur + * \brief Page d'administration-configuration du module Fournisseur + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + +$langs->load("admin"); +$langs->load("other"); +$langs->load("orders"); + +if (!$user->admin) +accessforbidden(); + +$type=GETPOST('type', 'alpha'); +$value=GETPOST('value', 'alpha'); +$action=GETPOST('action', 'alpha'); + +$specimenthirdparty=new Societe($db); +$specimenthirdparty->initAsSpecimen(); + + +/* + * Actions + */ + +if ($action == 'updateMask') +{ + $maskconstorder=GETPOST('maskconstorder','alpha'); + $maskorder=GETPOST('maskorder','alpha'); + + if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + +if ($action == 'specimen') // For invoices +{ + $modele=GETPOST('module','alpha'); + + $facture = new FactureFournisseur($db); + $facture->initAsSpecimen(); + $facture->thirdparty=$specimenthirdparty; // Define who should has build the invoice (so the supplier) + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach($dirmodels as $reldir) + { + $file=dol_buildpath($reldir."core/modules/supplier_invoice/pdf/pdf_".$modele.".modules.php",0); + if (file_exists($file)) + { + $filefound=1; + $classname = "pdf_".$modele; + break; + } + } + + if ($filefound) + { + require_once $file; + + $module = new $classname($db,$facture); + + if ($module->write_file($facture,$langs) > 0) + { + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf"); + return; + } + else + { + $mesg=''.$module->error.''; + dol_syslog($module->error, LOG_ERR); + } + } + else + { + $mesg=''.$langs->trans("ErrorModuleNotFound").''; + dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); + } +} + +if ($action == 'set') +{ + $label = GETPOST('label','alpha'); + $scandir = GETPOST('scandir','alpha'); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; + $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; + $sql.= ($label?"'".$db->escape($label)."'":'null').", "; + $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); + $sql.= ")"; + $res=$db->query($sql); + if ($res) + { + + } + // else dol_print_error($db); +} + +if ($action == 'del') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; + $sql.= " WHERE nom = '".$value."'"; + $sql.= " AND type = '".$type."'"; + $sql.= " AND entity = ".$conf->entity; + $db->query($sql); + if ($res) + { + + } + // else dol_print_error($db); +} + +if ($action == 'setdoc') +{ + $label = GETPOST('label','alpha'); + $scandir = GETPOST('scandir','alpha'); + + $db->begin(); + + if ($type == 'order_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value; + } + + // On active le modele + $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; + $sql_del.= " WHERE nom = '".$db->escape($value)."'"; + $sql_del.= " AND type = '".$type."'"; + $sql_del.= " AND entity = ".$conf->entity; + $result1=$db->query($sql_del); + + $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; + $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; + $sql.= ($label?"'".$db->escape($label)."'":'null').", "; + $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); + $sql.= ")"; + $result2=$db->query($sql); + if ($result1 && $result2) + { + $db->commit(); + } + else + { + $db->rollback(); + } +} + +if ($action == 'setmod') +{ + // TODO Verifier si module numerotation choisi peut etre active + // par appel methode canBeActivated + + dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); +} + +if ($action == 'addcat') +{ + $fourn = new Fournisseur($db); + $fourn->CreateCategory($user,$_POST["cat"]); +} + +if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') +{ + $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT'); // No alpha here, we want exact string + + $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + + +/* + * View + */ + +$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + +llxHeader("",""); + +$form=new Form($db); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup'); + +print "
"; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/supplier_order.php"; +$head[$h][1] = $langs->trans("SupplierOrder"); +$head[$h][2] = 'Order'; +$h++; + +$head[$h][0] = DOL_URL_ROOT."/admin/supplier_invoice.php"; +$head[$h][1] = $langs->trans("SuppliersInvoice"); +$head[$h][2] = 'Invoice'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + + +// Supplier invoice numbering module + +print_titre($langs->trans("SuppliersInvoiceNumberingModel")); + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +clearstatcache(); + +foreach ($dirmodels as $reldir) +{ + $dir = dol_buildpath($reldir."core/modules/supplier_invoice/"); + + if (is_dir($dir)) + { + $handle = opendir($dir); + if (is_resource($handle)) + { + $var=true; + + while (($file = readdir($handle))!==false) + { + if (substr($file, 0, 25) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file)-3, 3) == 'php') + { + $file = substr($file, 0, dol_strlen($file)-4); + + require_once $dir.$file.'.php'; + + $module = new $file; + + if ($module->isEnabled()) + { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + + $var=!$var; + print ''; + + // Show example of numbering module + print ''."\n"; + + print ''; + + $invoice=new FactureFournisseur($db); + $invoice->initAsSpecimen(); + + // Info + $htmltooltip=''; + $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; + $nextval=$module->getNextValue($mysoc,$invoice); + if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval + { + $htmltooltip.=''.$langs->trans("NextValue").': '; + if ($nextval) + { + $htmltooltip.=$nextval.'
'; + } + else + { + $htmltooltip.=$langs->trans($module->error).'
'; + } + } + + print ''; + + print ''; + } + } + } + closedir($handle); + } + } +} + +print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Info").'
'.$module->nom."\n"; + print $module->info(); + print ''; + $tmp=$module->getExample(); + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + } + elseif ($tmp=='NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
'; + if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") + { + print img_picto($langs->trans("Activated"),'switch_on'); + } + else + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print '

'; + + + + +/* + * Modeles documents for supplier invoices + */ + +print_titre($langs->trans("BillsPDFModules")); + +// Defini tableau def de modele +$def = array(); + +$sql = "SELECT nom"; +$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; +$sql.= " WHERE type = 'order_supplier'"; +$sql.= " AND entity = ".$conf->entity; + +$resql=$db->query($sql); +if ($resql) +{ + $i = 0; + $num_rows=$db->num_rows($resql); + while ($i < $num_rows) + { + $array = $db->fetch_array($resql); + array_push($def, $array[0]); + $i++; + } +} +else +{ + dol_print_error($db); +} + +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print ''."\n"; + +clearstatcache(); + +foreach ($dirmodels as $reldir) +{ + $dir = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/"); + + if (is_dir($dir)) + { + $var=true; + + $handle=opendir($dir); + + + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') + { + $name = substr($file, 4, dol_strlen($file) -16); + $classname = substr($file, 0, dol_strlen($file) -12); + + $var=!$var; + print "\n"; + print "\n"; + print "\n"; + + // Active + if (in_array($name, $def)) + { + print '"; + } + else + { + print '"; + } + + // Defaut + print ''; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; + $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); + print ''; + print ''; + + print "\n"; + } + } + + closedir($handle); + } + } +} + +print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("Info").'
".$name."\n"; + require_once $dir.$file; + $module = new $classname($db,$specimenthirdparty); + print $module->description; + print "'."\n"; + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") + { + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'; + print img_picto($langs->trans("Enabled"),'switch_on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"),'switch_on'); + } + print "'."\n"; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print "'; + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") + { + print img_picto($langs->trans("Default"),'on'); + } + else + { + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + } + print ''; + print $form->textwithpicto('',$htmltooltip,1,0); + print ''; + print ''.img_object($langs->trans("Preview"),'order').''; + print '

'; + +print_titre($langs->trans("OtherOptions")); +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +print ''; +print ''; +print ''; +print '\n"; +print ''; + +dol_htmloutput_mesg($mesg); + +$db->close(); +llxFooter(); +?> diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/supplier_order.php similarity index 57% rename from htdocs/admin/fournisseur.php rename to htdocs/admin/supplier_order.php index b26b156cebf..aa609d65721 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/supplier_order.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2010-2012 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -22,7 +22,7 @@ */ /** - * \file htdocs/admin/fournisseur.php + * \file htdocs/admin/supplier_order.php * \ingroup fournisseur * \brief Page d'administration-configuration du module Fournisseur */ @@ -31,10 +31,10 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $langs->load("admin"); -$langs->load('other'); +$langs->load("other"); +$langs->load("orders"); if (!$user->admin) accessforbidden(); @@ -116,71 +116,6 @@ if ($action == 'specimen') // For orders } } -if ($action == 'updateMaskInvoice') -{ - $maskconstinvoice=GETPOST('maskconstinvoice','alpha'); - $maskinvoice=GETPOST('maskinvoice','alpha'); - - if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'specimenfacture') // For invoices -{ - $modele=GETPOST('module','alpha'); - - $facture = new FactureFournisseur($db); - $facture->initAsSpecimen(); - $facture->thirdparty=$specimenthirdparty; // Define who should has build the invoice (so the supplier) - - // Search template files - $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); - foreach($dirmodels as $reldir) - { - $file=dol_buildpath($reldir."core/modules/supplier_invoice/pdf/pdf_".$modele.".modules.php",0); - if (file_exists($file)) - { - $filefound=1; - $classname = "pdf_".$modele; - break; - } - } - - if ($filefound) - { - require_once $file; - - $module = new $classname($db,$facture); - - if ($module->write_file($facture,$langs) > 0) - { - header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf"); - return; - } - else - { - $mesg=''.$module->error.''; - dol_syslog($module->error, LOG_ERR); - } - } - else - { - $mesg=''.$langs->trans("ErrorModuleNotFound").''; - dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); - } -} - if ($action == 'set') { $label = GETPOST('label','alpha'); @@ -225,11 +160,6 @@ if ($action == 'setdoc') $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value; } - if ($type == 'invoice_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) - { - $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value; - } - // On active le modele $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; $sql_del.= " WHERE nom = '".$db->escape($value)."'"; @@ -261,25 +191,17 @@ if ($action == 'setmod') dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity); } -if ($action == 'invoicesetmod') -{ - // TODO Verifier si module numerotation choisi peut etre active - // par appel methode canBeActivated - - dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity); -} - if ($action == 'addcat') { $fourn = new Fournisseur($db); $fourn->CreateCategory($user,$_POST["cat"]); } -if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') +if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT') { - $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT'); // No alpha here, we want exact string + $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -300,7 +222,7 @@ if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); -llxHeader(); +llxHeader("",""); $form=new Form($db); @@ -309,6 +231,22 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup'); print "
"; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/supplier_order.php"; +$head[$h][1] = $langs->trans("SupplierOrder"); +$head[$h][2] = 'Order'; +$hselected=$h; +$h++; + +$head[$h][0] = DOL_URL_ROOT."/admin/supplier_invoice.php"; +$head[$h][1] = $langs->trans("SuppliersInvoice"); +$head[$h][2] = 'Invoice'; + +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + // Supplier order numbering module @@ -548,240 +486,6 @@ foreach ($dirmodels as $reldir) print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')
'; +print ''; +print '
'; +print ''; +print "

'; -// Supplier invoice numbering model - -print_titre($langs->trans("InvoicesNumberingModels")); - -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - -clearstatcache(); - -foreach ($dirmodels as $reldir) -{ - $dir = dol_buildpath($reldir."core/modules/supplier_invoice/"); - - if (is_dir($dir)) - { - $handle = opendir($dir); - if (is_resource($handle)) - { - $var=true; - - while (($file = readdir($handle))!==false) - { - if (substr($file, 0, 25) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file)-3, 3) == 'php') - { - $file = substr($file, 0, dol_strlen($file)-4); - - require_once $dir.$file.'.php'; - - $module = new $file; - - if ($module->isEnabled()) - { - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - - $var=!$var; - print ''; - - // Show example of numbering model - print ''."\n"; - - print ''; - - $invoice=new FactureFournisseur($db); - $invoice->initAsSpecimen(); - - // Info - $htmltooltip=''; - $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$invoice); - if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval - { - $htmltooltip.=''.$langs->trans("NextValue").': '; - if ($nextval) - { - $htmltooltip.=$nextval.'
'; - } - else - { - $htmltooltip.=$langs->trans($module->error).'
'; - } - } - - print ''; - - print ''; - } - } - } - closedir($handle); - } - } -} - -print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("Info").'
'.$module->nom."\n"; - print $module->info(); - print ''; - $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { - $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; - } - elseif ($tmp=='NotConfigured') print $langs->trans($tmp); - else print $tmp; - print '
'; - if ($conf->global->INVOICE_SUPPLIER_ADDON == "$file") - { - print img_picto($langs->trans("Activated"),'switch_on'); - } - else - { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; - } - print ''; - print $form->textwithpicto('',$htmltooltip,1,0); - print '

'; - -/* - * Modeles documents for supplier invoices - */ - -print_titre($langs->trans("BillsPDFModules")); - -// Defini tableau def de modele -$def = array(); - -$sql = "SELECT nom"; -$sql.= " FROM ".MAIN_DB_PREFIX."document_model"; -$sql.= " WHERE type = 'invoice_supplier'"; -$sql.= " AND entity = ".$conf->entity; - -$resql=$db->query($sql); -if ($resql) -{ - $i = 0; - $num_rows=$db->num_rows($resql); - while ($i < $num_rows) - { - $array = $db->fetch_array($resql); - array_push($def, $array[0]); - $i++; - } -} -else -{ - dol_print_error($db); -} - - -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''; -print ''."\n"; - -clearstatcache(); - -foreach ($dirmodels as $reldir) -{ - $dir = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/"); - - if (is_dir($dir)) - { - $var=true; - - $handle=opendir($dir); - - if (is_resource($handle)) - { - while (($file = readdir($handle)) !== false) - { - if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_') - { - $name = substr($file, 4, dol_strlen($file) -16); - $classname = substr($file, 0, dol_strlen($file) -12); - - $var=!$var; - print "\n"; - print "\n"; - print "\n"; - - // Active - if (in_array($name, $def)) - { - print ""; - } - else - { - print ""; - } - - // Defaut - print "'; - - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); - $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - print ''; - print ''; - - print "\n"; - } - } - closedir($handle); - } - } -} - -print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status").''.$langs->trans("Default").''.$langs->trans("Info").'
".$name.""; - require_once $dir.$file; - $module = new $classname($db,$specimenthirdparty); - print $module->description; - print "\n"; - if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name") - { - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'; - print img_picto($langs->trans("Enabled"),'switch_on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"),'switch_on'); - } - print "\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').''; - print ""; - if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") - { - print img_picto($langs->trans("Default"),'on'); - } - else - { - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; - } - print ''; - print $form->textwithpicto('',$htmltooltip,1,0); - print ''; - print ''.img_object($langs->trans("Preview"),'bill').''; - print '

'; - print_titre($langs->trans("OtherOptions")); print ''; print ''; @@ -792,10 +496,10 @@ print "\n"; print ''; print ''; -print ''; +print ''; print '\n"; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 4cb3b9163ef..7ca64a2c524 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -72,7 +72,7 @@ class modFournisseur extends DolibarrModules $this->langfiles = array('bills', 'companies', 'suppliers', 'orders'); // Config pages - $this->config_page_url = array("fournisseur.php"); + $this->config_page_url = array("supplier_order.php"); // Constantes $this->const = array(); @@ -92,6 +92,11 @@ class modFournisseur extends DolibarrModules $this->const[$r][1] = "chaine"; $this->const[$r][2] = "canelle"; $r++; + + $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = "tulip"; + $r++; // Boxes $this->boxes = array(); diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 04a95bf5980..ccf194dfeb0 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1383,6 +1383,7 @@ MultiCompanySetup=Configuration du module Multi-société SuppliersSetup=Configuration du module Fournisseurs SuppliersCommandModel=Modèle de commandes fournisseur complet (logo...) SuppliersInvoiceModel=Modèle de factures fournisseur complet (logo...) +SuppliersInvoiceNumberingModel=Modèles de numérotation des factures fournisseur ##### GeoIPMaxmind ##### GeoIPMaxmindSetup=Configuration du module GeoIP Maxmind PathToGeoIPMaxmindCountryDataFile=Chemin du fichier Maxmind contenant les conversions IP->Pays.
Exemple: /usr/local/share/GeoIP/GeoIP.dat From 86dff79b735a2554785c62fd26fe83c5617115b1 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sat, 16 Mar 2013 16:58:45 +0100 Subject: [PATCH 035/150] try to fix : cannot display numbering models --- .../mod_facture_fournisseur_cactus.php | 6 ++--- .../mod_facture_fournisseur_tulip.php | 2 +- .../modules_facturefournisseur.php | 24 ++++++++++++------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php index f753d8b2fce..7e1febf3189 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php @@ -20,11 +20,11 @@ /** * \file htdocs/core/modules/supplier_order/mod_facture_fournisseur_cactus.php - * \ingroup commande + * \ingroup supplier invoice * \brief File containing the Cactus Class of numbering models of suppliers invoices references */ -require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/modules_facturefournisseur.php'; +require_once DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/modules_facturefournisseur.php'; /** @@ -123,7 +123,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices //$date=time(); $date=$object->datec; // Not always defined - if (empty($date)) $date=$object->date; // Creation date is order date for suppliers orders + if (empty($date)) $date=$object->date; // Creation date is invoice date for suppliers invoices $yymm = strftime("%y%m",$date); $num = sprintf("%04s",$max+1); diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 72cf50adc60..d0ee9e23738 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -123,7 +123,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices return 0; } - $numFinal=get_next_value($db,$mask,'facture_fournisseur','ref','',$objsoc->code_fournisseur,$object->date_commande); + $numFinal=get_next_value($db,$mask,'facture_fournisseur','ref','',$objsoc->code_fournisseur,$object->datec); return $numFinal; } diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 7a80cc93bfe..6be7100c14e 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -22,6 +22,7 @@ * \file htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php * \ingroup facture fournisseur * \brief File that contains parent class for supplier invoices models + * and parent class for supplier invoices numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requis car utilise par les classes qui heritent @@ -36,7 +37,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator /** - * Return list of active generation modules + * Return list of active generation models * * @param DoliDB $db Database handler * @param string $maxfilenamelength Max length of value to show @@ -131,7 +132,7 @@ abstract class ModeleNumRefSuppliersInvoices } /** - * Create a document onto disk according to template module. + * Create a document onto disk according to template model. * * @param DoliDB $db Database handler * @param Object $object Object supplier invoice @@ -158,7 +159,7 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided $srctemplatepath=''; - // Positionne le modele sur le nom du modele a utiliser + // Set the model on the model name to use if (! dol_strlen($modele)) { if (! empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)) @@ -189,7 +190,7 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided { $file = $prefix."_".$modele.".modules.php"; - // On verifie l'emplacement du modele + // We checked the location of the model $file=dol_buildpath($reldir."core/modules/supplier_invoice/pdf/".$file,0); if (file_exists($file)) { @@ -201,7 +202,7 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided if ($filefound) break; } - // Charge le modele + // Load the model if ($filefound) { require_once $file; @@ -219,12 +220,12 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; dol_delete_preview($object); - // Appel des triggers + // Calls triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_INVOICE_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End calls triggers return 1; } @@ -238,7 +239,14 @@ function supplier_invoice_pdf_create($db, $object, $modele, $outputlangs, $hided } else { - print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); + if (! $conf->global->INVOICE_SUPPLIER_ADDON_PDF) + { + print $langs->trans("Error")." ".$langs->trans("Error_INVOICE_SUPPLIER_ADDON_PDF_NotDefined"); + } + else + { + print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); + } return 0; } } From 07bc0cd09e314a2c4866ba7b629670071ef1708e Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 16 Mar 2013 17:01:17 +0100 Subject: [PATCH 036/150] Taking account remark https://github.com/FHenry/dolibarr/commit/1f5ebb594a0ef9fa00f8b613b7fd6fc791813819 --- htdocs/user/class/user.class.php | 6 +----- htdocs/user/fiche.php | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 63db83634a8..feb1b6164e0 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -201,11 +201,7 @@ class User extends CommonObject $this->user_mobile = $obj->user_mobile; $this->email = $obj->email; $this->job = $obj->job; - if (!empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) && dol_textishtml(dol_html_entity_decode($obj->signature, ENT_COMPAT | ENT_HTML401))) { - $this->signature = dol_html_entity_decode($obj->signature, ENT_COMPAT | ENT_HTML401); - }else { - $this->signature = $obj->signature; - } + $this->signature = $obj->signature; $this->admin = $obj->admin; $this->note = $obj->note; $this->statut = $obj->statut; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index cec4686ba5f..7a1059acd89 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1205,7 +1205,11 @@ else // Signature print '\n"; // Hierarchy From 013b7eca1092aae986d805f1cc846064a2e227aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Mar 2013 17:02:13 +0100 Subject: [PATCH 037/150] Fix: A better fix for status/list of orders. There was a confusion because of bad translation key StatusOrderToBill that in fact mean "StatusOrderDelivered". More explanation: http://wiki.dolibarr.org/index.php/Module_Customers_Orders#Life_cycle_.2F_Business_rules --- htdocs/commande/liste.php | 5 +++-- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/ca_ES/orders.lang | 6 ++++-- htdocs/langs/en_US/orders.lang | 2 +- htdocs/langs/es_ES/orders.lang | 6 ++++-- htdocs/langs/fr_FR/orders.lang | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index df59576c88b..3bc807476e8 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -129,7 +129,8 @@ if ($viewstatut <> '') { if ($viewstatut < 4 && $viewstatut > -3) { - $sql.= ' AND c.fk_statut ='.$viewstatut; // brouillon, validee, en cours, annulee + if ($viewstatut == 1 && empty($conf->expedition->enabled)) $sql.= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' + else $sql.= ' AND c.fk_statut = '.$viewstatut; // brouillon, validee, en cours, annulee if ($viewstatut == 3) { $sql.= ' AND c.facture = 0'; // need to create invoice @@ -222,7 +223,7 @@ if ($resql) if ($viewstatut == -2) $title.=' - '.$langs->trans('StatusOrderToProcessShort'); if ($viewstatut == -3) - $title.=' - '.$langs->trans('StatusOrderValidated').', '.$langs->trans("StatusOrderSent").', '.$langs->trans('StatusOrderToBill'); + $title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); $param='&socid='.$socid.'&viewstatut='.$viewstatut; if ($ordermonth) $param.='&ordermonth='.$ordermonth; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index e33c307d367..3b16988abe5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -857,7 +857,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); if ($leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); - if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-3"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); + if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); // The translation key is StatusOrderToBill but it means StatusDelivered. TODO We should renamed this later if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders", $langs->trans("Statistics"), 1, $user->rights->commande->lire); diff --git a/htdocs/langs/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index c63981ccf2e..39ee41a4ca9 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -32,7 +32,8 @@ StatusOrderOnProcessShort=En procés StatusOrderSentShort=Expedició en curs StatusOrderSent=Enviament en curs StatusOrderProcessedShort=Processada -StatusOrderToBillShort=A facturar +StatusOrderToBillShort=Emès +StatusOrderToBillShort2=A facturar StatusOrderApprovedShort=Aprovada StatusOrderRefusedShort=Rebutjada StatusOrderToProcessShort=A processar @@ -43,7 +44,8 @@ StatusOrderDraft=Esborrany (a validar) StatusOrderValidated=Validada StatusOrderOnProcess=Pendent de rebre StatusOrderProcessed=Processada -StatusOrderToBill=A facturar +StatusOrderToBill=Emès +StatusOrderToBill2=A facturar StatusOrderApproved=Aprovada StatusOrderRefused=Rebutjada StatusOrderReceivedPartially=Rebuda parcialment diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 2796759a8f0..172f6fb13c6 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -85,7 +85,7 @@ NumberOfOrdersByMonth=Number of orders by month AmountOfOrdersByMonthHT=amount of orders by month (net of tax) ListOfOrders=List of orders CloseOrder=Close order -ConfirmCloseOrder=Are you sure you want to close this order ? Once an order is closed, it can only be billed. +ConfirmCloseOrder=Are you sure you want to set this order to deliverd ? Once an order is delivered, it can be set to billed. ConfirmCloseOrderIfSending=Are you sure you want to close this order ? You must close an order only when all shipping are done. ConfirmDeleteOrder=Are you sure you want to delete this order ? ConfirmValidateOrder=Are you sure you want to validate this order under name %s ? diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 51bfbd082a2..65044ab09a7 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -32,7 +32,8 @@ StatusOrderOnProcessShort=En proceso StatusOrderSentShort=Expedición en curso StatusOrderSent=Envío en curso StatusOrderProcessedShort=Procesado -StatusOrderToBillShort=A facturar +StatusOrderToBillShort=Emitido +StatusOrderToBillShort2=A facturar StatusOrderApprovedShort=Aprobado StatusOrderRefusedShort=Rechazado StatusOrderToProcessShort=A procesar @@ -43,7 +44,8 @@ StatusOrderDraft=Borrador (a validar) StatusOrderValidated=Validado StatusOrderOnProcess=Pendiente de recibir StatusOrderProcessed=Procesado -StatusOrderToBill=A facturar +StatusOrderToBill=Emitido +StatusOrderToBill2=A facturar StatusOrderApproved=Aprobado StatusOrderRefused=Rechazado StatusOrderReceivedPartially=Recibido parcialmente diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index 1866ecbdcfb..045b6223038 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -85,7 +85,7 @@ NumberOfOrdersByMonth=Nombre de commandes par mois AmountOfOrdersByMonthHT=Montant total de commandes par mois (HT) ListOfOrders=Liste des commandes CloseOrder=Clôturer commande -ConfirmCloseOrder=Êtes-vous sûr de vouloir clôturer cette commande ? Une fois une commande clôturée, elle peut être facturée. +ConfirmCloseOrder=Êtes-vous sûr de vouloir classer cette commande à Délivrée ? Une fois une commande délivrée, elle peut aussi être passée à facturée. ConfirmCloseOrderIfSending=Êtes-vous sûr de vouloir clôturer cette commande ? Vous ne devez clôturer une commande qu'une fois les produits expédiés. ConfirmDeleteOrder=Êtes-vous sûr de vouloir effacer cette commande ? ConfirmValidateOrder=Êtes-vous sûr de vouloir valider cette commande sous la référence %s ? From d2c10159fe9aeb2eb073cf44da6663e0bdaefe74 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sat, 16 Mar 2013 17:10:24 +0100 Subject: [PATCH 038/150] try to fix : cannot display numbering models --- htdocs/core/modules/modFournisseur.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 7ca64a2c524..6a948192dc6 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -95,7 +95,7 @@ class modFournisseur extends DolibarrModules $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "tulip"; + $this->const[$r][2] = "mod_facture_fournisseur_tulip"; $r++; // Boxes From 8931a19b7e06483e32d2738f8aeddb4d76e1733d Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sat, 16 Mar 2013 17:25:39 +0100 Subject: [PATCH 039/150] try to fix : cannot display numbering models --- .../fourn/class/fournisseur.facture.class.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index ffc123fe2de..cd106c3a120 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1305,6 +1305,59 @@ class FactureFournisseur extends CommonInvoice $result.=$lien.($max?dol_trunc($this->ref,$max):$this->ref).$lienfin; return $result; } + + /** + * Renvoie la reference de facture suivante non utilisee en fonction du modele + * de numerotation actif defini dans INVOICE_SUPPLIER_ADDON_NUMBER + * + * @param Societe $soc objet societe + * @return string reference libre pour la facture + */ + function getNextNumRef($soc) + { + global $db, $langs, $conf; + $langs->load("orders"); + + $dir = DOL_DOCUMENT_ROOT .'/core/modules/supplier_invoice/'; + + if (! empty($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER)) + { + $file = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER.'.php'; + + if (is_readable($dir.'/'.$file)) + { + // Definition du nom de modele de numerotation de commande fournisseur + $modName=$conf->global->INVOICE_SUPPLIER_ADDON_NUMBER; + require_once $dir.'/'.$file; + + // Recuperation de la nouvelle reference + $objMod = new $modName($this->db); + + $numref = ""; + $numref = $objMod->invoice_get_num($soc,$this); + + if ( $numref != "") + { + return $numref; + } + else + { + dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error); + return -1; + } + } + else + { + print $langs->trans("Error")." ".$langs->trans("Error_FailedToLoad_INVOICE_SUPPLIER_ADDON_NUMBER_File",$conf->global->INVOICE_SUPPLIER_ADDON_NUMBER); + return -2; + } + } + else + { + print $langs->trans("Error")." ".$langs->trans("Error_INVOICE_SUPPLIER_ADDON_NUMBER_NotDefined"); + return -3; + } + } /** From d4f5ac8754d966216529f806cfdf52e7e74d0cbf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Mar 2013 18:02:32 +0100 Subject: [PATCH 040/150] Fix: regression after rename of field --- htdocs/cashdesk/index_verif.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index b6dc3cb2046..7ceabf13308 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -77,7 +77,7 @@ if ( $retour >= 0 ) { $return=array(); - $sql = "SELECT rowid, name, firstname"; + $sql = "SELECT rowid, lastname, firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."user"; $sql.= " WHERE login = '".$username."'"; $sql.= " AND entity IN (0,".$conf->entity.")"; From 54f963f8ae5ca2999396421b38968f34dcd10383 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sat, 16 Mar 2013 22:32:03 +0100 Subject: [PATCH 041/150] Trad: Fix: A better fix for status/list of orders. There was a confusion because of bad translation key StatusOrderToBill that in fact mean "StatusOrderDelivered". --- htdocs/langs/ca_ES/orders.lang | 4 ++-- htdocs/langs/es_ES/orders.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index 39ee41a4ca9..a0a49bb243c 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -84,8 +84,8 @@ NumberOfOrdersByMonth=Nombre de comandes per mes AmountOfOrdersByMonthHT=Import total de comandes per mes (Sense IVA) ListOfOrders=Llistat de comandes CloseOrder=Tancar comanda -ConfirmCloseOrder=Esteu segur de voler tancar aquesta comanda? Un cop tancat, haurà de facturar-se -ConfirmCloseOrderIfSending=Esteu segur de voler tancar aquesta comanda? No ha de tancar una comanda que encara no té els seus productes enviats +ConfirmCloseOrder=Esteu segur que voleu classificar aquesta comanda com a enviat? Un cop enviat una comanda, només podrà facturar-se +ConfirmCloseOrderIfSending=Esteu segur que voleu tancar aquesta comanda? Només hauria de tancar una comanda quan aquesta hagi estat enviada completament. ConfirmDeleteOrder=Esteu segur de voler eliminar aquest comanda? ConfirmValidateOrder=Esteu segur de voler validar aquesta comanda sota la referència %s ? ConfirmUnvalidateOrder=Esteu segur de voler restaurar la comanda %s a l'estat esborrany? diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 65044ab09a7..3b1069cf7a6 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -84,8 +84,8 @@ NumberOfOrdersByMonth=Número de pedidos por mes AmountOfOrdersByMonthHT=Importe total de pedidos por mes (sin IVA) ListOfOrders=Listado de pedidos CloseOrder=Cerrar pedido -ConfirmCloseOrder=¿Está seguro de querer cerrar este pedido? Una vez cerrado, deberá facturarse -ConfirmCloseOrderIfSending=¿Está seguro de querer cerrar este pedido? No debe cerrar un pedido que aún no tiene sus productos enviados +ConfirmCloseOrder=¿Está seguro de querer clasificar este pedido como enviado? Una vez enviado un pedido, solo podrá facturarse +ConfirmCloseOrderIfSending=¿Está seguro de querer cerrar este pedido? Solamente debería cerrar un pedido cuando este haya sido enviado completamente. ConfirmDeleteOrder=¿Está seguro de querer eliminar este pedido? ConfirmValidateOrder=¿Está seguro de querer validar este pedido bajo la referencia %s ? ConfirmUnvalidateOrder=¿Está seguro de querer restaurar el pedido %s al estado borrador? From 88256b753133fb53a1dfc70a668fa955a55e11d6 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 17 Mar 2013 10:21:44 +0100 Subject: [PATCH 042/150] normalize --- htdocs/admin/supplier_order.php | 4 ++-- htdocs/core/modules/modFournisseur.class.php | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index aa609d65721..a14b8cd1a6a 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -188,7 +188,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } if ($action == 'addcat') @@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir) print ''."\n"; print '\n"; print ''."\n"; @@ -333,7 +330,7 @@ print '
'; print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')
'; -print ''; +print ''; print '
'; print ''; print "
'.$langs->trans('Signature').''; - print dol_textishtml($object->signature)?$object->signature:dol_nl2br($object->signature,1,false); + if (!empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) && dol_textishtml(dol_html_entity_decode($object->signature, ENT_COMPAT | ENT_HTML401))) { + print dol_html_entity_decode($object->signature, ENT_COMPAT | ENT_HTML401); + }else { + print dol_nl2br($object->signature,1,false); + } print "
'; - if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file") + if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"),'switch_on'); } diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 6a948192dc6..5868d6d2108 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -81,21 +82,29 @@ class modFournisseur extends DolibarrModules $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "muscadet"; + $this->const[$r][3] = 'Nom du gestionnaire de generation des bons de commande en PDF'; + $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON"; + $this->const[$r][0] = "COMMANDE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_commande_fournisseur_muguet"; + $this->const[$r][3] = 'Nom du gestionnaire de numerotation des commandes fournisseur'; + $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "canelle"; + $this->const[$r][3] = 'Nom du gestionnaire de generation des factures fournisseur en PDF'; + $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_facture_fournisseur_tulip"; + $this->const[$r][3] = 'Nom du gestionnaire de numerotation des factures fournisseur'; + $this->const[$r][4] = 0; $r++; // Boxes From c44e9d60445882c847f38e48b282b3d36ffa888a Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 17 Mar 2013 11:00:38 +0100 Subject: [PATCH 043/150] normalize and simplify code --- htdocs/admin/expedition.php | 39 ++++++------ htdocs/admin/supplier_order.php | 109 +++++++++++--------------------- 2 files changed, 56 insertions(+), 92 deletions(-) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 2c69b643884..00830445ca6 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -65,9 +65,9 @@ if ($action == 'updateMask') if (isset($res)) { if ($res < 0) - setEventMessage($langs->trans("Error"), 'errors'); - else setEventMessage($langs->trans("SetupSaved")); + else + setEventMessage($langs->trans("Error"), 'errors'); } } @@ -77,9 +77,9 @@ else if ($action == 'set_SHIPPING_FREE_TEXT') $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); if ($res < 0) - setEventMessage($langs->trans("Error"), 'errors'); - else setEventMessage($langs->trans("SetupSaved")); + else + setEventMessage($langs->trans("Error"), 'errors'); } else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') @@ -88,9 +88,9 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); if ($res < 0) - setEventMessage($langs->trans("Error"), 'errors'); - else setEventMessage($langs->trans("SetupSaved")); + else + setEventMessage($langs->trans("Error"), 'errors'); } else if ($action == 'specimen') @@ -173,12 +173,7 @@ else if ($action == 'setdoc') else if ($action == 'setmodel') { - $res = dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); - - if ($res < 0) - setEventMessage($langs->trans("Error"), 'errors'); - else - setEventMessage($langs->trans("SetupSaved")); + dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } @@ -259,16 +254,16 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file)-4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/expedition/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print '
'.$module->nom."'; @@ -278,7 +273,9 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '

'; /* - * Modeles de documents + * Documents models for Sendings Receipt */ print_titre($langs->trans("SendingsReceiptModel")); @@ -495,4 +492,4 @@ print ''; llxFooter(); $db->close(); -?> +?> \ No newline at end of file diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index a14b8cd1a6a..ab8569b15b0 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -54,9 +54,9 @@ $specimenthirdparty->initAsSpecimen(); if ($action == 'updateMask') { $maskconstorder=GETPOST('maskconstorder','alpha'); - $maskorder=GETPOST('maskorder','alpha'); + $maskvalue=GETPOST('maskvalue','alpha'); - if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity); + if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskvalue,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -70,7 +70,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') // For orders +else if ($action == 'specimen') // For orders { $modele=GETPOST('module','alpha'); @@ -116,74 +116,40 @@ if ($action == 'specimen') // For orders } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $res=$db->query($sql); - if ($res) - { - - } - // else dol_print_error($db); + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - $db->query($sql); - if ($res) - { - - } - // else dol_print_error($db); + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF',$conf->entity); + } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); + if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value; + } - $db->begin(); - - if ($type == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) - { - $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value; - } - - // On active le modele - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $result2=$db->query($sql); - if ($result1 && $result2) - { - $db->commit(); - } - else - { - $db->rollback(); - } + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -191,13 +157,13 @@ if ($action == 'setmod') dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } -if ($action == 'addcat') +else if ($action == 'addcat') { $fourn = new Fournisseur($db); $fourn->CreateCategory($user,$_POST["cat"]); } -if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT') +else if ($action == 'set_SUPPLIER_ORDER_FREE_TEXT') { $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT'); // No alpha here, we want exact string @@ -352,10 +318,8 @@ foreach ($dirmodels as $reldir) print '
'; - - /* - * Modeles documents for supplier orders + * Documents models for supplier orders */ print_titre($langs->trans("OrdersModelModule")); @@ -396,17 +360,14 @@ print ''."\n"; clearstatcache(); +$var=true; foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir."core/modules/supplier_order/pdf/"); if (is_dir($dir)) { - $var=true; - $handle=opendir($dir); - - if (is_resource($handle)) { while (($file = readdir($handle))!==false) @@ -448,7 +409,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ''; if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") { @@ -485,6 +446,12 @@ foreach ($dirmodels as $reldir) } print '
'; +print '
'; + +/* + * Other options + * + */ print_titre($langs->trans("OtherOptions")); print ''; From 57d20e28fb49a25ec69a1f870ff9a8d054047189 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 17 Mar 2013 12:56:54 +0100 Subject: [PATCH 044/150] normalize and simplify code --- htdocs/admin/expedition.php | 7 ++--- htdocs/admin/livraison.php | 33 +++++++++++---------- htdocs/core/modules/modExpedition.class.php | 3 +- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 00830445ca6..34535b1d321 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -220,9 +220,8 @@ if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* - * Numbering module - */ -//print "
"; + * Expedition numbering model + */ print_titre($langs->trans("SendingsNumberingModules")); diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index fa4b7b3c1d4..49cbeee9026 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -164,7 +164,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); } @@ -209,8 +209,9 @@ $h++; dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* - * Module numerotation + * Livraison numbering model */ + print_titre($langs->trans("DeliveryOrderNumberingModules")); print '
'; @@ -240,16 +241,16 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file)-4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/livraison/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - - if ($module->isEnabled()) + + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print ''."\n"; print '
'.$module->nom."\n"; print $module->info(); @@ -258,13 +259,15 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/',$tmp)) { + $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; + } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; - if ($conf->global->LIVRAISON_ADDON == "$file") + if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"),'switch_on'); } @@ -311,12 +314,12 @@ print '
'; /* - * Modeles de documents + * Documents Models for delivery */ print '
'; print_titre($langs->trans("DeliveryOrderModel")); -// Defini tableau def de modele invoice +// Defini tableau def de modele $type="delivery"; $def = array(); @@ -397,7 +400,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ""; if ($conf->global->LIVRAISON_ADDON_PDF == "$name") { diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 112173656c5..5704f96d0cc 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -101,7 +102,7 @@ class modExpedition extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON"; + $this->const[$r][0] = "LIVRAISON_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_livraison_jade"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des bons de reception'; From 1d09e122c0a8a92ea701f5b02a20e7bc242c06b7 Mon Sep 17 00:00:00 2001 From: eldy Date: Sun, 17 Mar 2013 14:28:57 +0100 Subject: [PATCH 045/150] Some debug with pgsql --- htdocs/admin/carrier.php | 4 +++- htdocs/expedition/class/expedition.class.php | 13 +++++++++---- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 15 +++++++++++---- htdocs/install/pgsql/functions/functions.sql | 2 +- htdocs/langs/en_US/sendings.lang | 1 + htdocs/langs/fr_FR/sendings.lang | 1 + htdocs/livraison/class/livraison.class.php | 4 ++-- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/carrier.php b/htdocs/admin/carrier.php index 305b3f30529..612c14d2248 100644 --- a/htdocs/admin/carrier.php +++ b/htdocs/admin/carrier.php @@ -1,5 +1,7 @@ + * * 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 @@ -17,7 +19,7 @@ /** * \file htdocs/admin/carrier.php * \ingroup expedition - * \brief Page d'administration des Transporteurs + * \brief Page to setup carriers. TODO Delete this page. We mut use dictionnary instead. */ require '../main.inc.php'; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 919bac93394..cac81eda070 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -81,7 +81,9 @@ class Expedition extends CommonObject var $total_localtax1; // Total Local tax 1 var $total_localtax2; // Total Local tax 2 - + var $listmeths; // List of carriers + + /** * Constructor * @@ -1175,12 +1177,14 @@ class Expedition extends CommonObject /** * Fetch all deliveries method and return an array. Load array this->listmeths. + * * @param id $id only this carrier, all if none * @return void */ function list_delivery_methods($id='') { global $langs; + $listmeths = array(); $i=0; @@ -1220,6 +1224,7 @@ class Expedition extends CommonObject $i++; } } + else dol_print_error($this->db,''); } /** @@ -1231,8 +1236,8 @@ class Expedition extends CommonObject { if ($id=='') { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (rowid, code, libelle, description, tracking)"; - $sql.=" VALUES ('','".$this->update[code]."','".$this->update[libelle]."','".$this->update[description]."','".$this->update[tracking]."')"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)"; + $sql.=" VALUES ('".$this->update[code]."','".$this->update[libelle]."','".$this->update[description]."','".$this->update[tracking]."')"; $resql = $this->db->query($sql); } else @@ -1245,7 +1250,7 @@ class Expedition extends CommonObject $sql.= " WHERE rowid=".$id; $resql = $this->db->query($sql); } - + if ($resql < 0) dol_print_error($this->db,''); } /** diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 55e8e3af0ce..a8a57e7750d 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -12,8 +12,7 @@ -- To restrict request to Mysql version x.y use -- VMYSQLx.y -- To restrict request to Pgsql version x.y use -- VPGSQLx.y -- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- To make pk to be auto increment (postgres) VPGSQL8.2 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid INTEGER SERIAL PRIMARY KEY; - +-- To make pk to be auto increment (postgres) VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); @@ -38,6 +37,7 @@ UPDATE llx_const set name='MAIN_INFO_SOCIETE_TOWN' where name='MAIN_INFO_SOCIETE UPDATE llx_const set name='MAIN_INFO_SOCIETE_ZIP' where name='MAIN_INFO_SOCIETE_CP'; UPDATE llx_const set name='MAIN_INFO_SOCIETE_COUNTRY' where name='MAIN_INFO_SOCIETE_PAYS'; UPDATE llx_const set name='MAIN_INFO_SOCIETE_STATE' where name='MAIN_INFO_SOCIETE_DEPARTEMENT'; +UPDATE llx_const set name='LIVRAISON_ADDON_NUMBER' where name='LIVRAISON_ADDON'; ALTER TABLE llx_user add COLUMN fk_user integer; @@ -84,9 +84,16 @@ alter table llx_societe_address CHANGE COLUMN cp zip varchar(10); ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description; -ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL; +--ALTER TABLE llx_c_shipment_mode DROP COLUMN CASCADE; +--ALTER TABLE llx_c_shipment_mode ADD COLUMN rowid INTEGER AUTO_INCREMENT PRIMARY KEY; +--ALTER TABLE llc_c_shipment_mode ADD COLUMN rowid SERIAL PRIMARY KEY; +--ALTER TABLE llx_c_shipment_mode ADD COLUMN rowid INTEGER AUTO_INCREMENT PRIMARY KEY; + -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; --- VPGSQL8.2 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid INTEGER SERIAL PRIMARY KEY; +-- VPGSQL8.2 DROP table llx_c_shipment_mode; +-- VPGSQL8.2 CREATE TABLE llx_c_shipment_mode (rowid SERIAL PRIMARY KEY, tms timestamp, code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, tracking varchar(256) NOT NULL, active integer DEFAULT 0, module varchar(32) NULL); + + ALTER TABLE llx_stock_mouvement MODIFY COLUMN value real; diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 4ffba5b8c43..0c7f39025f9 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -52,7 +52,7 @@ CREATE OR REPLACE FUNCTION dol_util_rebuild_sequences() RETURNS integer as $body CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer AS $BODY$ DECLARE mytables RECORD; BEGIN FOR mytables IN SELECT relname FROM pg_class WHERE relhastriggers IS TRUE AND relkind = 'r' AND NOT relname LIKE 'pg_%' LOOP IF DoEnable THEN EXECUTE 'ALTER TABLE ' || mytables.relname || ' ENABLE TRIGGER ALL'; ELSE EXECUTE 'ALTER TABLE ' || mytables.relname || ' DISABLE TRIGGER ALL'; END IF; END LOOP; RETURN 1; END; $BODY$ LANGUAGE 'PLPGSQL'; --- Add triggers +-- Add triggers for timestamp fields CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE 'PLPGSQL'; CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accountingtransaction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index a4299fb94ab..58f4a3d96b7 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -59,6 +59,7 @@ LinkToTrackYourPackage=Link to track your package ShipmentCreationIsDoneFromOrder=For the moment, creation of a new shipment is done from the order card. RelatedShippings=Related shippings ShipmentLine=Shipment line +CarrierList=List of transporters # Sending methods SendingMethodCATCH=Catch by customer diff --git a/htdocs/langs/fr_FR/sendings.lang b/htdocs/langs/fr_FR/sendings.lang index a80b61649da..1df80a252e1 100644 --- a/htdocs/langs/fr_FR/sendings.lang +++ b/htdocs/langs/fr_FR/sendings.lang @@ -59,6 +59,7 @@ LinkToTrackYourPackage=Lien pour suivi de votre colis ShipmentCreationIsDoneFromOrder=Pour le moment, la création d'une nouvelle expédition se fait depuis la fiche commande. RelatedShippings=Expédition(s) associée(s) ShipmentLine=Ligne d'expédition +CarrierList=Liste des transporteurs # Sending methods SendingMethodCATCH=Enlèvement par le client diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index d2ecc0119ce..d5dce8c6830 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -334,10 +334,10 @@ class Livraison extends CommonObject if ($user->rights->expedition->livraison->valider) { - if (! empty($conf->global->LIVRAISON_ADDON)) + if (! empty($conf->global->LIVRAISON_ADDON_NUMBER)) { // Definition du nom de module de numerotation de commande - $modName = $conf->global->LIVRAISON_ADDON; + $modName = $conf->global->LIVRAISON_ADDON_NUMBER; if (is_readable(DOL_DOCUMENT_ROOT .'/core/modules/livraison/'.$modName.'.php')) { From 6afa1cb2c9eb501ace9692a23b1a1aa858cfb8f3 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 17 Mar 2013 14:40:49 +0100 Subject: [PATCH 046/150] normalize --- .../modules/expedition/modules_expedition.php | 40 +++++++++++-------- .../modules_commandefournisseur.php | 22 +++++----- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index 0b7d2ffdc54..bf74e1adcd1 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -25,7 +25,8 @@ /** * \file htdocs/core/modules/expedition/modules_expedition.php * \ingroup expedition - * \brief File of class to manage expedition numbering + * \brief File that contains parent class for sending receipts models + * and parent class for sending receipts numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -60,15 +61,15 @@ abstract class ModelePdfExpedition extends CommonDocGenerator /** - * Classe mere des modeles de numerotation des references d expedition + * Parent Class of numbering models of sending receipts references */ abstract class ModelNumRefExpedition { var $error=''; - /** Return if a module can be used or not + /** Return if a model can be used or not * - * @return boolean true if module can be used + * @return boolean true if model can be used */ function isEnabled() { @@ -88,7 +89,7 @@ abstract class ModelNumRefExpedition } /** - * Return numbering example + * Returns numbering example * * @return string Example */ @@ -110,7 +111,7 @@ abstract class ModelNumRefExpedition } /** - * Return next value + * Returns next value assigned * * @param Societe $objsoc Third party object * @param Object $shipment Shipment object @@ -123,7 +124,7 @@ abstract class ModelNumRefExpedition } /** - * Return numbering version module + * Returns version of the numbering model * * @return string Value */ @@ -158,7 +159,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) $srctemplatepath=''; - // Positionne le modele sur le nom du modele a utiliser + // Sets the model on the model name to use if (! dol_strlen($modele)) { if (! empty($conf->global->EXPEDITION_ADDON_PDF)) @@ -171,7 +172,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) } } - // If selected modele is a filename template (then $modele="modelname:filename") + // If selected model is a filename template (then $modele="modelname:filename") $tmp=explode(':',$modele,2); if (! empty($tmp[1])) { @@ -189,7 +190,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) { $file = $prefix."_expedition_".$modele.".modules.php"; - // On verifie l'emplacement du modele + // We check the model location $file=dol_buildpath($reldir."core/modules/expedition/doc/".$file,0); if (file_exists($file)) { @@ -201,7 +202,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) if ($filefound) break; } - // Charge le modele + // Load the model if ($filefound) { require_once $file; @@ -221,14 +222,14 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) //require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; //dol_delete_preview($object); - // Appel des triggers + // Calls triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('SHIPPING_BUILDDOC',$object,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } - // Fin appel triggers + // End calls triggers return 1; } @@ -242,8 +243,15 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) } else { - dol_print_error('',$langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file)); - return -1; + if (! $conf->global->EXPEDITION_ADDON_PDF) + { + print $langs->trans("Error")." ".$langs->trans("Error_EXPEDITION_ADDON_PDF_NotDefined"); + } + else + { + print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists",$file); + } + return 0; } } ?> \ No newline at end of file diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index f9407ba804e..d14d4ae5f43 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -24,7 +24,7 @@ /** * \file htdocs/core/modules/supplier_order/modules_commandefournisseur.php * \ingroup commande fournisseur - * \brief File that contain parent class for supplier orders models + * \brief File that contains parent class for supplier orders models * and parent class for supplier orders numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; @@ -44,13 +44,13 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator * * @param DoliDB $db Database handler * @param string $maxfilenamelength Max length of value to show - * @return array List of numbers + * @return array List of templates */ static function liste_modeles($db,$maxfilenamelength=0) { global $conf; - $type='order_supplier'; + $type='supplier_order'; $liste=array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -79,7 +79,7 @@ abstract class ModeleNumRefSuppliersOrders return true; } - /** Returns the default description of the model numbering + /** Returns default description of numbering model * * @return string Description Text */ @@ -101,7 +101,7 @@ abstract class ModeleNumRefSuppliersOrders return $langs->trans("NoExample"); } - /** Tests if the numbers already in force in the database do not cause conflicts that would prevent this numbering. + /** Tests if existing numbers make problems with numbering * * @return boolean false if conflict, true if ok */ @@ -120,7 +120,7 @@ abstract class ModeleNumRefSuppliersOrders return $langs->trans("NotAvailable"); } - /** Returns version of the model numbering + /** Returns version of the numbering model * * @return string Value */ @@ -138,7 +138,7 @@ abstract class ModeleNumRefSuppliersOrders /** - * Create a document onto disk according to template module. + * Create a document onto disk according to template model. * * @param DoliDB $db Database handler * @param Object $object Object supplier order @@ -164,7 +164,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet $srctemplatepath=''; - // Set the model on the model name to use + // Sets the model on the model name to use if (! dol_strlen($modele)) { if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) @@ -195,7 +195,7 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet { $file = $prefix."_".$modele.".modules.php"; - // We checked the location of the model + // We check the model location $file=dol_buildpath($reldir."core/modules/supplier_order/pdf/".$file,0); if (file_exists($file)) { @@ -229,7 +229,9 @@ function supplier_order_pdf_create($db, $object, $modele, $outputlangs, $hidedet include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($db); $result=$interface->run_triggers('ORDER_SUPPLIER_BUILDDOC',$object,$user,$langs,$conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } // End calls triggers return 1; From 29b8ce1c2dff923a448c9eb5d477b47be83f3ae1 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 17 Mar 2013 15:27:52 +0100 Subject: [PATCH 047/150] try to fix: supplier invoice numbering --- htdocs/core/modules/modFournisseur.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 5868d6d2108..5ebff71df0c 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -102,7 +102,7 @@ class modFournisseur extends DolibarrModules $this->const[$r][0] = "INVOICE_SUPPLIER_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_facture_fournisseur_tulip"; + $this->const[$r][2] = "mod_facture_fournisseur_cactus"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des factures fournisseur'; $this->const[$r][4] = 0; $r++; From 294b4865d116c1b83b21ea0f9ff428615682739f Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 17 Mar 2013 16:10:43 +0100 Subject: [PATCH 048/150] normalize and simplify code --- htdocs/admin/supplier_invoice.php | 96 +++++++++++-------------------- 1 file changed, 34 insertions(+), 62 deletions(-) diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 49e31d1b86c..f28e3d1a244 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -53,10 +53,10 @@ $specimenthirdparty->initAsSpecimen(); if ($action == 'updateMask') { - $maskconstorder=GETPOST('maskconstorder','alpha'); - $maskorder=GETPOST('maskorder','alpha'); + $maskconstinvoice=GETPOST('maskconstinvoice','alpha'); + $maskvalue=GETPOST('maskvalue','alpha'); - if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity); + if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskvalue,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; @@ -116,71 +116,37 @@ if ($action == 'specimen') // For invoices } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $res=$db->query($sql); - if ($res) - { - - } - // else dol_print_error($db); + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$value."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - $db->query($sql); - if ($res) - { - - } - // else dol_print_error($db); + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$value") dolibarr_del_const($db, 'INVOICE_SUPPLIER_ADDON_PDF',$conf->entity); + } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); + if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value; + } - $db->begin(); - - if ($type == 'order_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) - { - $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value; - } - - // On active le modele - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $result2=$db->query($sql); - if ($result1 && $result2) - { - $db->commit(); - } - else - { - $db->rollback(); - } + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } } if ($action == 'setmod') @@ -294,7 +260,7 @@ foreach ($dirmodels as $reldir) print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { @@ -447,7 +413,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ''; if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") { @@ -484,6 +450,12 @@ foreach ($dirmodels as $reldir) } print '
'; +print '
'; + +/* + * Other options + * + */ print_titre($langs->trans("OtherOptions")); print ''; From d0449768f7bd595671edf0201a379aa099624b2f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Mar 2013 19:31:13 +0100 Subject: [PATCH 049/150] Use div instead of table --- htdocs/contrat/index.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index cdc0de87bf5..88220fa7e29 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -66,9 +66,10 @@ llxHeader(); print_fiche_titre($langs->trans("ContractsArea")); -print '
'; +//print '
'; +//print '
'; +print '
'; -print '
'; // Search contract if (! empty($conf->contrat->enabled)) @@ -284,7 +285,9 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) } } -print ''; + +//print ''; +print '
'; // Last modified contracts @@ -599,9 +602,9 @@ else dol_print_error($db); } -print '
'; -print '
'; +//print ''; +print '
'; llxFooter(); From 7703537b96f593c2948dac0094f72eeae906b9e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Mar 2013 19:39:53 +0100 Subject: [PATCH 050/150] New: Work on cron module --- htdocs/core/modules/modCron.class.php | 14 + htdocs/cron/admin/cron.php | 5 +- htdocs/cron/class/cronjob.class.php | 446 ++++++++++++++++++++ htdocs/cron/index.php | 220 +++++++++- htdocs/install/mysql/tables/llx_cronjob.sql | 32 ++ htdocs/langs/en_US/cron.lang | 7 +- htdocs/langs/fr_FR/cron.lang | 7 +- htdocs/public/cron/cron_run_jobs.php | 173 ++++++++ 8 files changed, 900 insertions(+), 4 deletions(-) create mode 100644 htdocs/cron/class/cronjob.class.php create mode 100644 htdocs/install/mysql/tables/llx_cronjob.sql create mode 100644 htdocs/public/cron/cron_run_jobs.php diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 00e2a419e98..fbc14945f02 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -84,6 +84,20 @@ class modCron extends DolibarrModules $this->rights = array(); $this->rights_class = 'cron'; $r=0; + + // Main menu entries + $r=0; + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'CronJobs', + 'url'=>'/cron/index.php', + 'langs'=>'cron@cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>100, + 'enabled'=>'$leftmenu==\'modulesadmintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $r++; } diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index 887f914dbe9..fd77bcc6851 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -102,8 +102,11 @@ print '

'; // Cron launch print ''.$langs->trans("URLToLaunchCronJobs").':
'; -$url=DOL_MAIN_URL_ROOT.'/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY); +$url=DOL_MAIN_URL_ROOT.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY); print img_picto('','object_globe.png').' '.$url."
\n"; +print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; +$url=DOL_MAIN_URL_ROOT.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'id=cronjobid'; +print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php new file mode 100644 index 00000000000..b2b5fcddd1a --- /dev/null +++ b/htdocs/cron/class/cronjob.class.php @@ -0,0 +1,446 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file dev/skeletons/cronjob.class.php + * \ingroup cron + * \brief CRUD class file (Create/Read/Update/Delete) for cronjob table + * Initialy built by build_class_from_table on 2013-03-17 18:50 + */ + +// Put here all includes required by your class file +require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); +//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); +//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); + + +/** + * Put here description of your class + */ +class Cronjob extends CommonObject +{ + var $db; //!< To store db handler + var $error; //!< To return error code (or message) + var $errors=array(); //!< To return several error codes (or messages) + var $element='cronjob'; //!< Id that identify managed objects + var $table_element='cronjob'; //!< Name of table without prefix where object is stored + + var $id; + + var $tms=''; + var $datec=''; + var $command; + var $params; + var $datelastrun=''; + var $lastresult=''; + var $lastoutput; + var $fk_user; + var $note; + + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + function __construct($db) + { + $this->db = $db; + return 1; + } + + + /** + * Create object into database + * + * @param User $user User that creates + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + function create($user, $notrigger=0) + { + global $conf, $langs; + $error=0; + + // Clean parameters + + if (isset($this->command)) $this->command=trim($this->command); + if (isset($this->params)) $this->params=trim($this->params); + if (isset($this->lastoutput)) $this->lastoutput=trim($this->lastoutput); + if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user); + if (isset($this->note)) $this->note=trim($this->note); + + + + // Check parameters + // Put here code to add control on parameters values + + // Insert request + $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob("; + + $sql.= "datec,"; + $sql.= "command,"; + $sql.= "params,"; + $sql.= "datelastrun,"; + $sql.= "lastresult,"; + $sql.= "lastoutput,"; + $sql.= "fk_user,"; + $sql.= "note"; + + + $sql.= ") VALUES ("; + + $sql.= " ".(! isset($this->datec) || dol_strlen($this->datec)==0?'NULL':$this->db->idate($this->datec)).","; + $sql.= " ".(! isset($this->command)?'NULL':"'".$this->db->escape($this->command)."'").","; + $sql.= " ".(! isset($this->params)?'NULL':"'".$this->db->escape($this->params)."'").","; + $sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':$this->db->idate($this->datelastrun)).","; + $sql.= " ".(! isset($this->lastresult) || dol_strlen($this->lastresult)==0?'NULL':$this->db->idate($this->lastresult)).","; + $sql.= " ".(! isset($this->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").","; + $sql.= " ".(! isset($this->fk_user)?'NULL':"'".$this->fk_user."'").","; + $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").""; + + + $sql.= ")"; + + $this->db->begin(); + + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob"); + + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return $this->id; + } + } + + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @return int <0 if KO, >0 if OK + */ + function fetch($id) + { + global $langs; + $sql = "SELECT"; + $sql.= " t.rowid,"; + + $sql.= " t.tms,"; + $sql.= " t.datec,"; + $sql.= " t.command,"; + $sql.= " t.params,"; + $sql.= " t.datelastrun,"; + $sql.= " t.lastresult,"; + $sql.= " t.lastoutput,"; + $sql.= " t.fk_user,"; + $sql.= " t.note"; + + + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; + $sql.= " WHERE t.rowid = ".$id; + + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + + $this->id = $obj->rowid; + + $this->tms = $this->db->jdate($obj->tms); + $this->datec = $this->db->jdate($obj->datec); + $this->command = $obj->command; + $this->params = $obj->params; + $this->datelastrun = $this->db->jdate($obj->datelastrun); + $this->lastresult = $this->db->jdate($obj->lastresult); + $this->lastoutput = $obj->lastoutput; + $this->fk_user = $obj->fk_user; + $this->note = $obj->note; + + + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); + return -1; + } + } + + + /** + * Update object into database + * + * @param User $user User that modifies + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function update($user=0, $notrigger=0) + { + global $conf, $langs; + $error=0; + + // Clean parameters + + if (isset($this->command)) $this->command=trim($this->command); + if (isset($this->params)) $this->params=trim($this->params); + if (isset($this->lastoutput)) $this->lastoutput=trim($this->lastoutput); + if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user); + if (isset($this->note)) $this->note=trim($this->note); + + + + // Check parameters + // Put here code to add a control on parameters values + + // Update request + $sql = "UPDATE ".MAIN_DB_PREFIX."cronjob SET"; + + $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; + $sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').","; + $sql.= " command=".(isset($this->command)?"'".$this->db->escape($this->command)."'":"null").","; + $sql.= " params=".(isset($this->params)?"'".$this->db->escape($this->params)."'":"null").","; + $sql.= " datelastrun=".(dol_strlen($this->datelastrun)!=0 ? "'".$this->db->idate($this->datelastrun)."'" : 'null').","; + $sql.= " lastresult=".(dol_strlen($this->lastresult)!=0 ? "'".$this->db->idate($this->lastresult)."'" : 'null').","; + $sql.= " lastoutput=".(isset($this->lastoutput)?"'".$this->db->escape($this->lastoutput)."'":"null").","; + $sql.= " fk_user=".(isset($this->fk_user)?$this->fk_user:"null").","; + $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").""; + + + $sql.= " WHERE rowid=".$this->id; + + $this->db->begin(); + + dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + + if (! $error) + { + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + function delete($user, $notrigger=0) + { + global $conf, $langs; + $error=0; + + $this->db->begin(); + + if (! $error) + { + if (! $notrigger) + { + // Uncomment this and change MYOBJECT to your own tag if you + // want this action calls a trigger. + + //// Call triggers + //include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + //$interface=new Interfaces($this->db); + //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); + //if ($result < 0) { $error++; $this->errors=$interface->errors; } + //// End call triggers + } + } + + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; + $sql.= " WHERE rowid=".$this->id; + + dol_syslog(get_class($this)."::delete sql=".$sql); + $resql = $this->db->query($sql); + if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } + } + + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); + return 1; + } + } + + + + /** + * Load an object from its id and create a new one in database + * + * @param int $fromid Id of object to clone + * @return int New id of clone + */ + function createFromClone($fromid) + { + global $user,$langs; + + $error=0; + + $object=new Cronjobs($this->db); + + $this->db->begin(); + + // Load source object + $object->fetch($fromid); + $object->id=0; + $object->statut=0; + + // Clear fields + // ... + + // Create clone + $result=$object->create($user); + + // Other options + if ($result < 0) + { + $this->error=$object->error; + $error++; + } + + if (! $error) + { + + + } + + // End + if (! $error) + { + $this->db->commit(); + return $object->id; + } + else + { + $this->db->rollback(); + return -1; + } + } + + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + function initAsSpecimen() + { + $this->id=0; + + $this->tms=''; + $this->datec=''; + $this->command=''; + $this->params=''; + $this->datelastrun=''; + $this->lastresult=''; + $this->lastoutput=''; + $this->fk_user=''; + $this->note=''; + + + } + +} +?> diff --git a/htdocs/cron/index.php b/htdocs/cron/index.php index 7db0dd9ebf9..3d7ef46ad77 100644 --- a/htdocs/cron/index.php +++ b/htdocs/cron/index.php @@ -1 +1,219 @@ -Url not available \ No newline at end of file + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file dev/Cronjobss/Cronjobs_page.php + * \ingroup mymodule othermodule1 othermodule2 + * \brief This file is an example of a php page + * Initialy built by build_class_from_table on 2013-03-17 18:50 + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + +// Change this following line to use the correct relative path (../, ../../, etc) +$res=0; +if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; +if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; +if (! $res && file_exists("../../../main.inc.php")) $res=@include '../../../main.inc.php'; +if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res) die("Include of main fails"); +// Change this following line to use the correct relative path from htdocs +dol_include_once('/module/class/cronjob.class.php'); + +// Load traductions files requiredby by page +$langs->load("companies"); +$langs->load("other"); +$langs->load("cron"); + +// Get parameters +$id = GETPOST('id','int'); +$action = GETPOST('action','alpha'); +$myparam = GETPOST('myparam','alpha'); +$action='list'; + +// Protection if external user +if ($user->societe_id > 0) accessforbidden(); +if (! $user->admin) accessforbidden(); + + +/******************************************************************* +* ACTIONS +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +if ($action == 'add') +{ + $object=new Cronjobs($db); + $object->prop1=$_POST["field1"]; + $object->prop2=$_POST["field2"]; + $result=$object->create($user); + if ($result > 0) + { + // Creation OK + } + { + // Creation KO + $mesg=$object->error; + } +} + + + + + +/*************************************************** +* VIEW +* +* Put here all code to build page +****************************************************/ + +llxHeader('','MyPageName',''); + +$form=new Form($db); + + +//print ''; +//print '
'; +print '
'; + + + + + +//print '
'; +print '
'; + + + +// Example 1 : Adding jquery code +print ''; + + +// Example 2 : Adding links to objects +// The class must extends CommonObject class to have this method available +//$somethingshown=$object->showLinkedObjectBlock(); + + +// Example 3 : List of data +if ($action == 'list') +{ + $sql = "SELECT"; + $sql.= " t.rowid,"; + + $sql.= " t.tms,"; + $sql.= " t.datec,"; + $sql.= " t.command,"; + $sql.= " t.params,"; + $sql.= " t.datelastrun,"; + $sql.= " t.lastresult,"; + $sql.= " t.lastoutput,"; + $sql.= " t.fk_user,"; + $sql.= " t.note"; + + + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; + //$sql.= " WHERE field3 = 'xxx'"; + //$sql.= " ORDER BY field1 ASC"; + + + print_fiche_titre($langs->trans("ListOfCronJobs"),'','').'
'; + + + print ''."\n"; + print ''; + print_liste_field_titre($langs->trans('Id'),$_SERVER['PHP_SELF'],'t.rowid','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Command'),$_SERVER['PHP_SELF'],'t.command','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('DateCreation'),$_SERVER['PHP_SELF'],'t.datec','align="center"',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('LastOutput'),$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('DateLastRun'),$_SERVER['PHP_SELF'],'t.datelastrun','align="center"',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('LastResult'),$_SERVER['PHP_SELF'],'t.lastresult','align="right"',$param,'',$sortfield,$sortorder); + print ''; + + dol_syslog($script_file." sql=".$sql, LOG_DEBUG); + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + if ($num) + { + while ($i < $num) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + // You can use here results + print ''; + } + $i++; + } + } + } + else + { + $error++; + dol_print_error($db); + } + + print '
'; + print $obj->rowid; + print ''; + print $obj->command; + print ''; + print $db->jdate($obj->datec); + print ''; + print ''; + print ''; + print $db->jdate($obj->datelastrun); + print ''; + print $obj->lastresult; + print '
'."\n"; +} + + +//print '
'; +print '
'; + + +// End of page +llxFooter(); +$db->close(); +?> diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql new file mode 100644 index 00000000000..5a8e33ef38f --- /dev/null +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -0,0 +1,32 @@ +-- =================================================================== +-- Copyright (C) 2013 Laurent Destailleur +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + +create table llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + command varchar(256), + params text, + frequency varchar(24), + datelastrun datetime, + lastresult date, + lastoutput text, + fk_user integer DEFAULT NULL, + note text +)ENGINE=innodb; diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 64859a0de3f..4f504d34e59 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -3,4 +3,9 @@ CHARSET=UTF-8 CronSetup=Cron scheduler setup CronDesc=This page can be used to setup options of the scheduler manager URLToLaunchCronJobs=URL to launch cron jobs -KeyForCronAccess=Security key for URL to launch cron jobs \ No newline at end of file +KeyForCronAccess=Security key for URL to launch cron jobs +DateLastRun=Last run +LastOutput=Last run output +LastResult=Last result code +ListOfCronJobs=List of scheduled jobs +Command=Command \ No newline at end of file diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index a5f3e44dad2..1a9bf136e02 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -3,4 +3,9 @@ CHARSET=UTF-8 CronSetup=Configuration du séquenceur de taches CronDesc=Cette page permet de configurer certaines options du séquenceur de taches URLToLaunchCronJobs=URL pour lancer les taches automatiques -KeyForCronAccess=Clé de sécurité pour l'URL de lancement des taches automatiques \ No newline at end of file +KeyForCronAccess=Clé de sécurité pour l'URL de lancement des taches automatiques +DateLastRun=Dernier lancement +LastOutput=Dernière sortie +LastResult=Dernière code retour +ListOfCronJobs=Liste des taches programmées +Command=Commande \ No newline at end of file diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php new file mode 100644 index 00000000000..75e15a414a0 --- /dev/null +++ b/htdocs/public/cron/cron_run_jobs.php @@ -0,0 +1,173 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file cron/cron_run_jobs.php + * \ingroup cron + * \brief This file is the page to call to run jobs + * Initialy built by build_class_from_table on 2013-03-17 18:50 + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); +//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show +//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php +//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) + +// Change this following line to use the correct relative path (../, ../../, etc) +$res=0; +if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; +if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; +if (! $res && file_exists("../../../main.inc.php")) $res=@include '../../../main.inc.php'; +if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only +if (! $res) die("Include of main fails"); +// Change this following line to use the correct relative path from htdocs +include_once(DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php'); + + +// C'est un wrapper, donc header vierge +/** + * Header function + * + * @return void + */ +function llxHeaderVierge() { + print 'Export agenda cal'; +} +/** + * Footer function + * + * @return void + */ +function llxFooterVierge() { + print ''; +} + + + +// Load traductions files requiredby by page +$langs->load("companies"); +$langs->load("other"); +$langs->load("cron@cron"); + +// Get parameters +$id = GETPOST('id','int'); +$action = GETPOST('action','alpha'); + +// Protection if external user +if ($user->societe_id > 0) +{ + //accessforbidden(); +} + +// Security check +if (empty($conf->cron->enabled)) accessforbidden('',1,1,1); + +// Check also security key +if (empty($_GET["securitykey"]) || $conf->global->CRON_KEY != $_GET["securitykey"]) +{ + $user->getrights(); + + llxHeaderVierge(); + print '
Bad value for key.
'; + llxFooterVierge(); + exit; +} + + +/******************************************************************* +* ACTIONS +* +* Put here all code to do according to value of "action" parameter +********************************************************************/ + +if ($action == 'add') +{ + $object=new Cronjobs($db); + $object->prop1=$_POST["field1"]; + $object->prop2=$_POST["field2"]; + $result=$object->create($user); + if ($result > 0) + { + // Creation OK + } + { + // Creation KO + $mesg=$object->error; + } +} + + + + + +/*************************************************** +* VIEW +* +* Put here all code to build page +****************************************************/ + +llxHeader('',$langs->trans('CronList'),''); + +$form=new Form($db); + + +// Put here content of your page + +// Example 1 : Adding jquery code +print ''; + + +$cronjob=new CronJob($db); +$result=$cronjob->fetch($id); + +if ($result > 0) +{ + + +} +else +{ + $langs->load("errors"); + print $langs->trans("ErrorRecordNotFound"); +} + + +// End of page +llxFooter(); + +$db->close(); +?> From 9e46a55bbf8fb852cb197fc3498fc19d5098a114 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 17 Mar 2013 22:26:06 +0100 Subject: [PATCH 051/150] Taking account remark on pull request --- htdocs/user/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 7a1059acd89..2e3a14777b2 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1208,7 +1208,7 @@ else if (!empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) && dol_textishtml(dol_html_entity_decode($object->signature, ENT_COMPAT | ENT_HTML401))) { print dol_html_entity_decode($object->signature, ENT_COMPAT | ENT_HTML401); }else { - print dol_nl2br($object->signature,1,false); + print dol_textishtml($object->signature)?$object->signature:dol_nl2br($object->signature,1,false); } print "\n"; From e59084cafcb861c2aa80cd796c67f898c62f1ca6 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2013 13:04:08 +0100 Subject: [PATCH 052/150] various fixes on margin : - fix on sortorder - fix for credit notes - fix for total --- htdocs/margin/agentMargins.php | 35 +++++++++++++--------- htdocs/margin/customerMargins.php | 37 +++++++++++++++++------- htdocs/margin/productMargins.php | 31 +++++++++++++++----- htdocs/margin/tabs/productMargins.php | 14 +++++---- htdocs/margin/tabs/thirdpartyMargins.php | 14 +++++---- 5 files changed, 88 insertions(+), 43 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 5e65af70e79..f5826435ffa 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -40,7 +40,13 @@ $mesg = ''; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; +if (! $sortfield) +{ + if ($agentid > 0) + $sortfield="s.nom"; + else + $sortfield="u.name"; +} $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; @@ -75,7 +81,7 @@ $titre=$langs->trans("Margins"); $picto='margin'; dol_fiche_head($head, 'agentMargins', $titre, 0, $picto); -print ''; +print ''; print ''; print ''; @@ -118,10 +124,11 @@ if (! empty($conf->global->DISPLAY_MARK_RATES)) { print "
'.$langs->trans('CommercialAgent').'
"; print ''; -$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,"; -$sql.= " u.login,"; -$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,"; -$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge" ; +$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, u.rowid as agent,"; +$sql.= " u.login, u.name, u.firstname,"; +$sql.= " sum(d.total_ht) as selling_price,"; +$sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; +$sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); @@ -155,7 +162,8 @@ if ($agentid > 0) else $sql.= " GROUP BY u.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit +1, $offset); +// TODO: calculate total to display then restore pagination +//$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) @@ -163,7 +171,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',0,0,''); $i = 0; print ""; @@ -172,7 +180,7 @@ if ($result) if ($agentid > 0) print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); else - print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.name","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); @@ -191,7 +199,7 @@ if ($result) if ($num > 0) { $var=true; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -208,9 +216,8 @@ if ($result) print "\n"; } else { - $userstatic->id=$objp->agent; - $userstatic->login=$objp->login; - print "\n"; + $userstatic->fetch($objp->agent); + print "\n"; } print "\n"; print "\n"; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 06a0180a4b4..d44feb263ae 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -40,10 +40,6 @@ $result = restrictedArea($user, 'societe','',''); $mesg = ''; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; @@ -77,7 +73,7 @@ $titre=$langs->trans("Margins"); $picto='margin'; dol_fiche_head($head, 'customerMargins', $titre, 0, $picto); -print '
'; +print ''; print '
".$companystatic->getNomUrl(1,'customer')."".$userstatic->getLoginUrl(1)."".$userstatic->getFullName($langs,0,0,0)."".price($objp->selling_price)."".price($objp->buying_price)."
'; $client = false; @@ -105,6 +101,23 @@ else { print ''; } +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) +{ + if ($client) + { + $sortfield="f.datef"; + $sortorder="DESC"; + } + else + { + $sortfield="s.nom"; + $sortorder="ASC"; + } +} + // Start date print ''; print '"; print '\n"; @@ -1105,26 +1105,26 @@ else print $langs->trans('SendingMethod'); print ''; - if ($action != 'editexpedition_method_id') print ''; + if ($action != 'editshipping_method_id') print ''; print '
'.$langs->trans('StartDate').''; @@ -142,8 +155,9 @@ print ''; $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, s.client,"; $sql.= " f.facnumber, f.total as total_ht,"; -$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,"; -$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ; +$sql.= " sum(d.total_ht) as selling_price,"; +$sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; +$sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -166,7 +180,8 @@ if ($client) else $sql.= " GROUP BY s.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit +1, $offset); +// TODO: calculate total to display then restore pagination +//$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) @@ -174,7 +189,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',0,0,''); $i = 0; print ""; @@ -203,7 +218,7 @@ if ($result) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 183aa359c33..dd0c0901a1e 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -48,7 +48,20 @@ $mesg = ''; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="p.ref"; +if (! $sortfield) +{ + if ($id > 0) + { + $sortfield="f.datef"; + $sortorder="DESC"; + } + else + { + $sortfield="p.ref"; + $sortorder="ASC"; + } +} + $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; @@ -83,7 +96,7 @@ $titre=$langs->trans("Margins"); $picto='margin'; dol_fiche_head($head, 'productMargins', $titre, 0, $picto); -print '
'; +print ''; print '
'; if ($id > 0) { @@ -144,8 +157,9 @@ print ''; $sql = "SELECT DISTINCT d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref,"; $sql.= " f.facnumber, f.total as total_ht,"; -$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,"; -$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ; +$sql.= " sum(d.total_ht) as selling_price,"; +$sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; +$sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; @@ -170,7 +184,8 @@ if ($id > 0) else $sql.= " GROUP BY d.fk_product"; $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit +1, $offset); +// TODO: calculate total to display then restore pagination +//$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) @@ -178,7 +193,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',0,0,''); $i = 0; print "
"; @@ -207,7 +222,7 @@ if ($result) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 8e91670eace..c4f37667ba8 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -130,7 +130,10 @@ if ($id > 0 || ! empty($ref)) $sql = "SELECT DISTINCT s.nom, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.total as total_ht,"; - $sql.= " (d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price, (d.buy_price_ht * d.qty) as buying_price, d.qty, ((d.subprice - d.buy_price_ht) * d.qty) as marge," ; + $sql.= " d.total_ht as selling_price,"; + $sql.= " IF (f.type =2,(d.buy_price_ht * d.qty *-1),(d.buy_price_ht * d.qty)) as buying_price, "; + $sql.= " IF (f.type =2,d.qty *-1,d.qty) as qty,"; + $sql.= " IF (f.type =2,((d.price + d.buy_price_ht) * d.qty),((d.price - d.buy_price_ht) * d.qty)) as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -148,14 +151,15 @@ if ($id > 0 || ! empty($ref)) if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= $db->plimit($conf->liste_limit +1, $offset); + // TODO: calculate total to display then restore pagination + //$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=$object->id",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=$object->id",$sortfield,$sortorder,'',0,0,''); $i = 0; print "
"; @@ -184,7 +188,7 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); $var=!$var; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index c145e53e816..d0c0b9a67a4 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -128,7 +128,10 @@ if ($socid > 0) $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.total as total_ht,"; - $sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price, sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ; + $sql.= " sum(d.total_ht) as selling_price,"; + + $sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; + $sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -143,14 +146,15 @@ if ($socid > 0) $sql .= " AND d.buy_price_ht <> 0"; $sql.= " GROUP BY f.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= $db->plimit($conf->liste_limit +1, $offset); + // TODO: calculate total to display then restore pagination + //$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=$societe->id",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=$societe->id",$sortfield,$sortorder,'',0,0,''); $i = 0; print "
"; @@ -176,7 +180,7 @@ if ($socid > 0) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); From f8291a9efe62388b05fd3ffa79df94a7be61a576 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2013 14:18:17 +0100 Subject: [PATCH 053/150] use ifsql function --- htdocs/margin/agentMargins.php | 4 ++-- htdocs/margin/customerMargins.php | 4 ++-- htdocs/margin/productMargins.php | 4 ++-- htdocs/margin/tabs/productMargins.php | 6 +++--- htdocs/margin/tabs/thirdpartyMargins.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index f5826435ffa..5dc39a1c6eb 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -127,8 +127,8 @@ print ''; $sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, u.rowid as agent,"; $sql.= " u.login, u.name, u.firstname,"; $sql.= " sum(d.total_ht) as selling_price,"; -$sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; -$sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge" ; +$sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; +$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index d44feb263ae..d46133193f6 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -156,8 +156,8 @@ print ''; $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, s.client,"; $sql.= " f.facnumber, f.total as total_ht,"; $sql.= " sum(d.total_ht) as selling_price,"; -$sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; -$sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge," ; +$sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; +$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index dd0c0901a1e..04c22bb793f 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -158,8 +158,8 @@ print ''; $sql = "SELECT DISTINCT d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref,"; $sql.= " f.facnumber, f.total as total_ht,"; $sql.= " sum(d.total_ht) as selling_price,"; -$sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; -$sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge," ; +$sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; +$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index c4f37667ba8..19aa66390b1 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -131,9 +131,9 @@ if ($id > 0 || ! empty($ref)) $sql = "SELECT DISTINCT s.nom, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.total as total_ht,"; $sql.= " d.total_ht as selling_price,"; - $sql.= " IF (f.type =2,(d.buy_price_ht * d.qty *-1),(d.buy_price_ht * d.qty)) as buying_price, "; - $sql.= " IF (f.type =2,d.qty *-1,d.qty) as qty,"; - $sql.= " IF (f.type =2,((d.price + d.buy_price_ht) * d.qty),((d.price - d.buy_price_ht) * d.qty)) as marge," ; + $sql.= $db->ifsql('f.type =2','(d.buy_price_ht * d.qty *-1)','(d.buy_price_ht * d.qty)')." as buying_price, "; + $sql.= $db->ifsql('f.type =2','d.qty *-1','d.qty')." as qty,"; + $sql.= $db->ifsql('f.type =2','((d.price + d.buy_price_ht) * d.qty)','((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index d0c0b9a67a4..be56cbb5589 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -130,8 +130,8 @@ if ($socid > 0) $sql.= " f.facnumber, f.total as total_ht,"; $sql.= " sum(d.total_ht) as selling_price,"; - $sql.= " IF (f.type =2,sum(d.buy_price_ht * d.qty *-1),sum(d.buy_price_ht * d.qty)) as buying_price, "; - $sql.= " IF (f.type =2,sum((d.price + d.buy_price_ht) * d.qty),sum((d.price - d.buy_price_ht) * d.qty)) as marge," ; + $sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; + $sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; From e2f28b6c519b596ec30a5219affc2d064b821053 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2013 15:40:56 +0100 Subject: [PATCH 054/150] remove experimental commissions module --- htdocs/commissions/admin/commissions.php | 192 ---------- htdocs/commissions/index.php | 329 ------------------ htdocs/commissions/lib/commissions.lib.php | 52 --- htdocs/core/modules/modCommissions.class.php | 169 --------- htdocs/langs/ca_ES/commissions.lang | 41 --- htdocs/langs/en_US/commissions.lang | 44 --- htdocs/langs/es_ES/commissions.lang | 41 --- htdocs/langs/fr_FR/commissions.lang | 44 --- .../theme/auguria/img/object_commissions.png | Bin 651 -> 0 bytes .../bureau2crea/img/object_commissions.png | Bin 651 -> 0 bytes .../theme/cameleo/img/object_commissions.png | Bin 651 -> 0 bytes htdocs/theme/eldy/img/object_commissions.png | Bin 651 -> 0 bytes 12 files changed, 912 deletions(-) delete mode 100644 htdocs/commissions/admin/commissions.php delete mode 100644 htdocs/commissions/index.php delete mode 100644 htdocs/commissions/lib/commissions.lib.php delete mode 100644 htdocs/core/modules/modCommissions.class.php delete mode 100644 htdocs/langs/ca_ES/commissions.lang delete mode 100644 htdocs/langs/en_US/commissions.lang delete mode 100644 htdocs/langs/es_ES/commissions.lang delete mode 100644 htdocs/langs/fr_FR/commissions.lang delete mode 100644 htdocs/theme/auguria/img/object_commissions.png delete mode 100644 htdocs/theme/bureau2crea/img/object_commissions.png delete mode 100644 htdocs/theme/cameleo/img/object_commissions.png delete mode 100644 htdocs/theme/eldy/img/object_commissions.png diff --git a/htdocs/commissions/admin/commissions.php b/htdocs/commissions/admin/commissions.php deleted file mode 100644 index 015cab308ff..00000000000 --- a/htdocs/commissions/admin/commissions.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file /htdocs/admin/commissions.php - * \ingroup commissions - * \brief Page to setup advanced commissions module - */ - -include '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/commissions/lib/commissions.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); - -$langs->load("admin"); -$langs->load("bills"); -$langs->load("commissions"); - -if (! $user->admin) accessforbidden(); - - -/* - * Action - */ -if (GETPOST('commissionBase')) -{ - if (dolibarr_set_const($db, 'COMMISSION_BASE', GETPOST('commissionBase'), 'string', 0, '', $conf->entity) > 0) - { - $conf->global->COMMISSION_BASE = GETPOST('commissionBase'); - setEventMessage($langs->trans("RecordModifiedSuccessfully")); - } - else - { - dol_print_error($db); - } -} - -if (GETPOST('productCommissionRate')) -{ - if (dolibarr_set_const($db, 'PRODUCT_COMMISSION_RATE', GETPOST('productCommissionRate'), 'rate', 0, '', $conf->entity) > 0) - { - } - else - { - dol_print_error($db); - } -} - -if (GETPOST('serviceCommissionRate')) -{ - if (dolibarr_set_const($db, 'SERVICE_COMMISSION_RATE', GETPOST('serviceCommissionRate'), 'rate', 0, '', $conf->entity) > 0) - { - } - else - { - dol_print_error($db); - } -} - -if (GETPOST('AGENT_CONTACT_TYPE')) -{ - if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', GETPOST('AGENT_CONTACT_TYPE'), 'chaine', 0, '', $conf->entity) > 0) - { - $conf->global->AGENT_CONTACT_TYPE = GETPOST('AGENT_CONTACT_TYPE'); - } - else - { - dol_print_error($db); - } -} - -/* - * View - */ - -llxHeader('',$langs->trans("CommissionsSetup")); - - -$linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("commissionsSetup"),$linkback,'setup'); - - -$head = commissions_admin_prepare_head(); - -dol_fiche_head($head, 'parameters', $langs->trans("Commissions"), 0, 'commissions'); - -print "
"; - - -print_fiche_titre($langs->trans("MemberMainOptions"),'',''); -print '
'; -print ''; -print ''; -print ''."\n"; -print ''."\n"; -print ''; - -$var=true; -$form = new Form($db); - -print ''; - -// COMMISSION BASE (TURNOVER / MARGIN) -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -// PRODUCT COMMISSION RATE -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -// SERVICE COMMISSION RATE -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -$var=!$var; -print ''; -print ''; -print ''; - -print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Details").'
'.$langs->trans("CommissionBase").''; -print 'global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "TURNOVER") - print 'checked'; -print ' />'; -print $langs->trans("CommissionBasedOnTurnover"); -print '
'; -print 'margin->enabled)) - print 'disabled'; -elseif (isset($conf->global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "MARGIN") - print 'checked'; -print ' />'; -print $langs->trans("CommissionBasedOnMargins"); -print '
'.$langs->trans('CommissionBaseDetails'); -print '
'; -print $langs->trans('CommissionBasedOnMarginsDetails'); -print '
'.$langs->trans("ProductCommissionRate").''; -print '  %'; -print ''.$langs->trans('ProductCommissionRateDetails').'
'.$langs->trans("ServiceCommissionRate").''; -print '  %'; -print ''.$langs->trans('ServiceCommissionRateDetails').'
'.$langs->trans("AgentContactType").''; -$formcompany = new FormCompany($db); -$facture = new Facture($db); -print $formcompany->selectTypeContact($facture, $conf->global->AGENT_CONTACT_TYPE, "AGENT_CONTACT_TYPE","internal","code",1); -print ''.$langs->trans('AgentContactTypeDetails').'
'; -print ''; -print '
'; - -print ''; - -dol_fiche_end(); - -print '
'; - -llxFooter(); -$db->close(); -?> diff --git a/htdocs/commissions/index.php b/htdocs/commissions/index.php deleted file mode 100644 index cdc6329d858..00000000000 --- a/htdocs/commissions/index.php +++ /dev/null @@ -1,329 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/commissions/index.php - * \ingroup commissions - * \brief Page des commissions par agent commercial - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (! empty($conf->margin->enabled)) - require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; - -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load("commissions"); -if (! empty($conf->margin->enabled)) - $langs->load("margins"); - -// Security check -$agentid = GETPOST('agentid','int'); - -$mesg = ''; - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$startdate=$enddate=''; - -if (!empty($_POST['startdatemonth'])) - $startdate = date('Y-m-d', dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear'])); -if (!empty($_POST['enddatemonth'])) - $enddate = date('Y-m-d', dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear'])); - -/* - * View - */ - -$userstatic = new User($db); -$companystatic = new Societe($db); -$invoicestatic=new Facture($db); - -$form = new Form($db); - -llxHeader('',$langs->trans("Commissions")); - -$text=$langs->trans("Commissions"); -print_fiche_titre($text); - -print '
'; -print ''; - -if ($agentid > 0) { - - print ''; - print ''; - - if (! $sortorder) $sortorder="ASC"; - if (! $sortfield) $sortfield="s.nom"; -} -else { - print ''; - print ''; - if (! $sortorder) $sortorder="ASC"; - if (! $sortfield) $sortfield="u.login"; -} - -// Start date -print ''; -print ''; -print ''; -print ''; -print ''; - -// Include unpayed invoices -print ''; - - -// Total Margin -if ($conf->global->COMMISSION_BASE == "MARGIN") { - print ''; -} -elseif ($conf->global->COMMISSION_BASE == "TURNOVER") { - print ''; -} - -// Total Commission -print ''; - -print "
'.$langs->trans('CommercialAgent').''; - print $form->select_dolusers($agentid,'agentid',1,'',0,'',''); - print '
'.$langs->trans('CommercialAgent').''; - print $form->select_dolusers('','agentid',1,'',0,'',''); - print '
'.$langs->trans('StartDate').''; -$form->select_date($startdate,'startdate','','',1,"sel",1,1); -print ''.$langs->trans('EndDate').''; -$form->select_date($enddate,'enddate','','',1,"sel",1,1); -print ''; -print ''; -print '
'.$langs->trans("IncludeUnpayedInvoices").''; -print ''; -print '
'.$langs->trans("TotalMargin").''; - print ''; // set by jquery (see below) - print '
'.$langs->trans("TurnoverTotal").''; - print ''; // set by jquery (see below) - print '
'.$langs->trans("TotalCommission").''; -print ''; // set by jquery (see below) -print '
"; -print '
'; - -$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,"; -$sql.= " u.login,"; -if ($conf->global->COMMISSION_BASE == "MARGIN") { - $sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) end) as productBase," ; - $sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) else 0 end) as serviceBase" ; -} -elseif ($conf->global->COMMISSION_BASE == "TURNOVER") { - $sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) end) as productBase," ; - $sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) else 0 end) as serviceBase" ; -} -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= ", ".MAIN_DB_PREFIX."facture as f"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); -$sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; -$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= ", ".MAIN_DB_PREFIX."user as u"; -$sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND sc.fk_soc = f.fk_soc"; -if (! empty($conf->global->AGENT_CONTACT_TYPE)) - $sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))"; -else - $sql .= " AND sc.fk_user = u.rowid"; -if (GETPOST('unpayed') == 'on') - $sql.= " AND f.fk_statut > 0"; -else - $sql.= " AND f.fk_statut > 1"; -$sql.= " AND s.entity = ".$conf->entity; -$sql.= " AND d.fk_facture = f.rowid"; -if ($agentid > 0) { - if (! empty($conf->global->AGENT_CONTACT_TYPE)) - $sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))"; - else - $sql .= " AND sc.fk_user = ".$agentid; -} -if (!empty($startdate)) - $sql.= " AND f.datef >= '".$startdate."'"; -if (!empty($enddate)) - $sql.= " AND f.datef <= '".$enddate."'"; -if ($conf->global->COMMISSION_BASE == "MARGIN") - $sql .= " AND d.buy_price_ht IS NOT NULL"; -if (($conf->global->COMMISSION_BASE == "MARGIN") && isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) - $sql .= " AND d.buy_price_ht <> 0"; -if ($agentid > 0) - $sql.= " GROUP BY s.rowid"; -else - $sql.= " GROUP BY u.rowid"; -$sql.= " ORDER BY $sortfield $sortorder "; -//$sql.= $db->plimit($conf->liste_limit +1, $offset); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - - print '
'; - print_barre_liste($langs->trans("CommissionDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,''); - - $i = 0; - print ""; - - print ''; - if ($agentid > 0) - print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); - else - print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); - - // product commission - if ($conf->global->COMMISSION_BASE == "MARGIN") - print_liste_field_titre($langs->trans("ProductMargin"),$_SERVER["PHP_SELF"],"productBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - elseif ($conf->global->COMMISSION_BASE == "TURNOVER") - print_liste_field_titre($langs->trans("ProductTurnover"),$_SERVER["PHP_SELF"],"productBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - print_liste_field_titre($langs->trans("CommissionRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProductCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - // service commission - if ($conf->global->COMMISSION_BASE == "MARGIN") - print_liste_field_titre($langs->trans("ServiceMargin"),$_SERVER["PHP_SELF"],"serviceBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - elseif ($conf->global->COMMISSION_BASE == "TURNOVER") - print_liste_field_titre($langs->trans("ServiceTurnover"),$_SERVER["PHP_SELF"],"serviceBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - print_liste_field_titre($langs->trans("CommissionRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ServiceCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - // total commission - print_liste_field_titre($langs->trans("TotalCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - print "\n"; - - $cumul_base_produit = 0; - $cumul_base_service = 0; - $cumul_commission_produit = 0; - $cumul_commission_service = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); - if ($num > 0) - { - $var=True; - while ($i < $num && $i < $conf->liste_limit) - { - $objp = $db->fetch_object($result); - - $var=!$var; - - print ""; - if ($agentid > 0) { - $companystatic->id=$objp->socid; - $companystatic->nom=$objp->nom; - $companystatic->client=$objp->client; - print "\n"; - } - else { - $userstatic->id=$objp->agent; - $userstatic->login=$objp->login; - print "\n"; - } - - // product commission - $productCommissionRate=(! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0); - $productBase=(! empty($objp->productBase)?$objp->productBase:0); - $productCommission = (! empty($productBase)?($productCommissionRate * $productBase / 100):0); - print "\n"; - print "\n"; - print "\n"; - - // service commission - $serviceCommissionRate=(! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:0); - $serviceBase=(! empty($objp->serviceBase)?$objp->serviceBase:0); - $serviceCommission = (! empty($serviceBase)?($serviceCommissionRate * $serviceBase / 100):0); - print "\n"; - print "\n"; - print "\n"; - - // total commission - print "\n"; - print "\n"; - - $i++; - - $cumul_base_produit += round($productBase, $rounding); - $cumul_base_service += round($serviceBase, $rounding); - $cumul_commission_produit += round($productCommission, $rounding); - $cumul_commission_service += round($serviceCommission, $rounding); - } - } - - // affichage totaux commission - $var=!$var; - print ''; - print '"; - // product commission - print "\n"; - print "\n"; - print "\n"; - // service commission - print "\n"; - print "\n"; - print "\n"; - // total commission - print "\n"; - - print "\n"; - - print ""; - print "
".$companystatic->getNomUrl(1,'customer')."".$userstatic->getLoginUrl(1)."".price($productBase)."".price($productCommissionRate)."".price($productCommission)."".price($serviceBase)."".price($serviceCommissionRate)."".price($serviceCommission)."".price($productCommission + $serviceCommission)."
'; - print $langs->trans('Total'); - print "".price($cumul_base_produit)."".price((! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0))."".price($cumul_commission_produit)."".price($cumul_base_service)."".price((! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:0))."".price($cumul_commission_service)."".price($cumul_commission_produit + $cumul_commission_service)."
"; -} -else -{ - dol_print_error($db); -} -$db->free($result); - - -llxFooter(); -$db->close(); -?> - \ No newline at end of file diff --git a/htdocs/commissions/lib/commissions.lib.php b/htdocs/commissions/lib/commissions.lib.php deleted file mode 100644 index aa87720968c..00000000000 --- a/htdocs/commissions/lib/commissions.lib.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file /htdocs/commissions/lib/commissions.lib.php - * \ingroup commissions - * \brief Library for common commissions functions - */ - -/** - * Define head array for tabs of marges tools setup pages - * - * @return Array of head - */ -function commissions_admin_prepare_head() -{ - global $langs, $conf; - - $h = 0; - $head = array(); - - $head[$h][0] = DOL_URL_ROOT.'/commissions/admin/commissions.php'; - $head[$h][1] = $langs->trans("Parameters"); - $head[$h][2] = 'parameters'; - $h++; - - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab - // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin'); - - complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin','remove'); - - return $head; -} - -?> diff --git a/htdocs/core/modules/modCommissions.class.php b/htdocs/core/modules/modCommissions.class.php deleted file mode 100644 index 64908f5248c..00000000000 --- a/htdocs/core/modules/modCommissions.class.php +++ /dev/null @@ -1,169 +0,0 @@ - - * Copyright (C) 2012 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \defgroup commissions Module commissions - * \brief Module commissions - * \file htdocs/core/modules/modCommissions.class.php - * \ingroup commissions - * \brief Description and activation file for module Commissions - */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; - - -/** - * Class to describe modude Commisions - */ -class modCommissions extends DolibarrModules -{ - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - - // Id for module (must be unique). - // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). - $this->numero = 60000; - // Key text used to identify module (for permissions, menus, etc...) - $this->rights_class = 'Commissions'; - - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' - // It is used to group modules in module setup page - $this->family = "financial"; - // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i','',get_class($this)); - // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "Commissions management"; - // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'experimental'; - // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - // Where to store the module in setup page (0=common,1=interface,2=other) - $this->special = 2; - // Name of png file (without png) used for this module. - // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. - $this->picto='commissions'; - - // Data directories to create when module is enabled. - $this->dirs = array(); - - // Config pages. Put here list of php page names stored in admmin directory used to setup module. - $this->config_page_url = array("commissions.php@commissions"); - - // Dependencies - $this->depends = array("modFacture", "modMargin"); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5,1); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(3,2); // Minimum version of Dolibarr required by module - $this->langfiles = array("commissions"); - - // Constants - $this->const = array(0=>array('COMMISSION_BASE',"chaine","TURNOVER",'Default commission base',0)); // List of particular constants to add when module is enabled - - // New pages on tabs - $this->tabs = array(); - - // Boxes - $this->boxes = array(); // List of boxes - $r=0; - - // Permissions - $this->rights = array(); // Permission array used by this module - $r=0; - - // Add here list of permission defined by an id, a label, a boolean and two constant strings. - // Example: - // $this->rights[$r][0] = 2000; // Permission id (must not be already used) - // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) - // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - // $r++; - - - // Main menu entries - $this->menu = array(); // List of menus to add - $r = 0; - - // left menu entry - $this->menu[$r]=array( - 'fk_menu'=>'fk_mainmenu=accountancy', // Put 0 if this is a top menu - 'type'=>'left', // This is a Top menu entry - 'titre'=>'Commissions', - 'mainmenu'=>'accountancy', - 'leftmenu'=>'commissions', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school). - 'url'=>'/commissions/index.php', - 'langs'=>'commissions', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>200, - 'enabled'=>'$conf->commissions->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - } - - /** - * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. - * It also creates data directories. - * - * @return int 1 if OK, 0 if KO - */ - function init() - { - $sql = array(); - - $result=$this->load_tables(); - - return $this->_init($sql); - } - - /** - * Function called when module is disabled. - * Remove from database constants, boxes and permissions from Dolibarr database. - * Data directories are not deleted. - * - * @return int 1 if OK, 0 if KO - */ - function remove() - { - $sql = array(); - - return $this->_remove($sql); - } - - - /** - * Create tables and keys required by module - * Files mymodule.sql and mymodule.key.sql with create table and create keys - * commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return; - } -} - -?> diff --git a/htdocs/langs/ca_ES/commissions.lang b/htdocs/langs/ca_ES/commissions.lang deleted file mode 100644 index da97a4066f2..00000000000 --- a/htdocs/langs/ca_ES/commissions.lang +++ /dev/null @@ -1,41 +0,0 @@ -# Dolibarr language file - ca_ES - commissions -CHARSET=UTF-8 - -Module60000Desc=Gestió de comissions -commissionsSetup=Configuració de la gestió de comissions - -ProductCommissionRate=Taxa de comissió sobre els productes -ServiceCommissionRate=Taxa de comissió sobre els serveis - -ProductCommissionRateDetails=Taxa usada per calcular les comissions sobre les vendes de productes -ServiceCommissionRateDetails=Taxa usada per calcular les comissions sobre les vendes de serveis - -Commissions=Comissions -CommissionDetails=Detall de comissions - -IncludeUnpayedInvoices=Incloure les factures no cobrades -TotalCommission=Total comissions - -ProductMargin=Marge / productes -ServiceMargin=Marge / serveis - -CommissionRate=Taxes comissions - -ProductCommission=Comissió / productes -ServiceCommission=Comissió / serveis - -CommissionBase=Base de càlcul de comissions -CommissionBasedOnTurnover=Comissions calculades sobre el volum de venda -CommissionBasedOnMargins=Comissions calculades sobre els marges -CommissionBaseDetails=Estableix el mètode de càlcul de les comissions -CommissionBasedOnMarginsDetails=El càlcul basat en els marges requereix l'activació del mòdul marges - -TurnoverTotal = Volum de vendes sense IVA -ProductTurnover=Vendes sense IVA / productes -ServiceTurnover=Vendes sense IVA / serveis - -CommercialAgent=Agent comercial - -StartDate=Data d'inici -EndDate=Data de fi -Launch=Començar \ No newline at end of file diff --git a/htdocs/langs/en_US/commissions.lang b/htdocs/langs/en_US/commissions.lang deleted file mode 100644 index 776f4d0c1a1..00000000000 --- a/htdocs/langs/en_US/commissions.lang +++ /dev/null @@ -1,44 +0,0 @@ -# Dolibarr language file - fr_FR - commissions -CHARSET=UTF-8 - -Module60000Desc=Commissions management -commissionsSetup=Commissions management setup - -ProductCommissionRate=Commission rate on products -ServiceCommissionRate=Commission rate on services - -ProductCommissionRateDetails=Commission rate on product sales -ServiceCommissionRateDetails=Commission rate on service sales - -Commissions=Commissions -CommissionDetails=Commissions details - -IncludeUnpayedInvoices=Include overdue invoices -TotalCommission=Commissions subtotal - -ProductMargin=Margin / products -ServiceMargin=Margin / services - -CommissionRate=Commission rate - -ProductCommission=Commission / produics -ServiceCommission=Commission / services - -CommissionBase=Commissions base -CommissionBasedOnTurnover=Commissions based on turnover -CommissionBasedOnMargins=Commissions based on margins -CommissionBaseDetails=Define calculation method for commissions -CommissionBasedOnMarginsDetails=Commissions based on margins needs margin module activation. - -TurnoverTotal = Total turrnover -ProductTurnover=Product turnover -ServiceTurnover=Service turnover - -CommercialAgent=Commercial agent - -StartDate=Start date -EndDate=End date -Launch=Start - -AgentContactType=Contact type used for commissioning -AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents \ No newline at end of file diff --git a/htdocs/langs/es_ES/commissions.lang b/htdocs/langs/es_ES/commissions.lang deleted file mode 100644 index 2077ca5990c..00000000000 --- a/htdocs/langs/es_ES/commissions.lang +++ /dev/null @@ -1,41 +0,0 @@ -# Dolibarr language file - es_ES - commissions -CHARSET=UTF-8 - -Module60000Desc=Gestión de comisiones -commissionsSetup=Configuración de la gestión de comisiones - -ProductCommissionRate=Tasa de comisión sobre los productos -ServiceCommissionRate=Tasa de comisión sobre los servicios - -ProductCommissionRateDetails=Tasa usada para calcular las comisiones sobre las ventas de productos -ServiceCommissionRateDetails=Tasa usada para calcular las comisiones sobre las ventas de servicios - -Commissions=Comisiones -CommissionDetails=Detalle de comisiones - -IncludeUnpayedInvoices=Incluir las facturas no cobradas -TotalCommission=Total comisiones - -ProductMargin=Margen / productos -ServiceMargin=Margen / servicios - -CommissionRate=Tasas comisiones - -ProductCommission=Comisión / productos -ServiceCommission=Comisión / servicios - -CommissionBase=Base de cálculo de comisiones -CommissionBasedOnTurnover=Comisiones calculadas sobre el volumen de venta -CommissionBasedOnMargins=Comisiones calculadas sobre los márgenes -CommissionBaseDetails=Establece el método de cálculo de las comisiones -CommissionBasedOnMarginsDetails=El cálculo basado en los márgenes requiere la activación del módulo márgenes - -TurnoverTotal = Volumen de ventas sin IVA -ProductTurnover=Ventas sin IVA / productos -ServiceTurnover=Ventas sin IVA / servicios - -CommercialAgent=Agente comercial - -StartDate=Fecha de inicio -EndDate=Fecha de fin -Launch=Comenzar \ No newline at end of file diff --git a/htdocs/langs/fr_FR/commissions.lang b/htdocs/langs/fr_FR/commissions.lang deleted file mode 100644 index 5fb83f32320..00000000000 --- a/htdocs/langs/fr_FR/commissions.lang +++ /dev/null @@ -1,44 +0,0 @@ -# Dolibarr language file - fr_FR - commissions -CHARSET=UTF-8 - -Module60000Desc=Gestion des commissions -commissionsSetup=Paramétrage de la gestion des commissions - -ProductCommissionRate=Taux de commissionnement sur les produits -ServiceCommissionRate=Taux de commissionnement sur les services - -ProductCommissionRateDetails=Taux utilisé pour calculer les commissions sur les ventes de produits -ServiceCommissionRateDetails=Taux utilisé pour calculer les commissions sur les ventes de services - -Commissions=Commissions -CommissionDetails=Détail des commissions - -IncludeUnpayedInvoices=Inclure les factures non réglées -TotalCommission=Total des commissions - -ProductMargin=Marge / produits -ServiceMargin=Marge / services - -CommissionRate=Taux de commissionnement - -ProductCommission=Commission / produits -ServiceCommission=Commission / services - -CommissionBase=Base de calcul des commissions -CommissionBasedOnTurnover=Commissions calculées sur le CA -CommissionBasedOnMargins=Commissions calculées sur les marges -CommissionBaseDetails=Définit le mode de calcul des commissions -CommissionBasedOnMarginsDetails=Le calcul basé sur les marges nécessite l'activation du module marges. - -TurnoverTotal = Chiffre d'affaire réalisé HT -ProductTurnover=CA HT / produits -ServiceTurnover=CA HT / services - -CommercialAgent=Agent commercial - -StartDate=Date de début -EndDate=Date de fin -Launch=Démarrer - -AgentContactType=Type de contact commissionné -AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux \ No newline at end of file diff --git a/htdocs/theme/auguria/img/object_commissions.png b/htdocs/theme/auguria/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/htdocs/theme/bureau2crea/img/object_commissions.png b/htdocs/theme/bureau2crea/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/htdocs/theme/cameleo/img/object_commissions.png b/htdocs/theme/cameleo/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/htdocs/theme/eldy/img/object_commissions.png b/htdocs/theme/eldy/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h From fb75358c101b580a7a80829518229b980e5123ac Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Mon, 18 Mar 2013 17:34:29 +0100 Subject: [PATCH 055/150] fix: deprecated for expedition_methode_id --- .../doc/pdf_expedition_merou.modules.php | 4 ++-- .../doc/pdf_expedition_rouget.modules.php | 4 ++-- htdocs/expedition/class/expedition.class.php | 12 +++++----- htdocs/expedition/fiche.php | 22 +++++++++---------- .../install/mysql/migration/3.3.0-3.4.0.sql | 1 + 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 56e0d90fdb3..39c70faab79 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -546,10 +546,10 @@ class pdf_expedition_merou extends ModelePdfExpedition $object->GetUrlTrackingStatus($object->tracking_number); if (! empty($object->tracking_url)) { - if ($object->expedition_method_id > 0) + if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey - $code=$outputlangs->getLabelFromKey($this->db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); $label=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; } else diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 172966b89cf..368527612f1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -189,10 +189,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition $object->GetUrlTrackingStatus($object->tracking_number); if (! empty($object->tracking_url)) { - if ($object->expedition_method_id > 0) + if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey - $code=$outputlangs->getLabelFromKey($this->db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); $label=$outputlangs->trans("LinkToTrackYourPackage")."
"; $label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; $pdf->SetFont('','B', $default_font_size - 2); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index cac81eda070..393a316df15 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -51,7 +51,6 @@ class Expedition extends CommonObject var $origin; var $origin_id; var $lines=array(); - var $expedition_method_id; // deprecated var $shipping_method_id; var $tracking_number; var $tracking_url; @@ -203,7 +202,7 @@ class Expedition extends CommonObject $sql.= ", ".($this->date_delivery>0?"'".$this->db->idate($this->date_delivery)."'":"null"); $sql.= ", ".$this->socid; $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null"); - $sql.= ", ".($this->expedition_method_id>0?$this->expedition_method_id:"null"); + $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:"null"); $sql.= ", '".$this->db->escape($this->tracking_number)."'"; $sql.= ", ".$this->weight; $sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth @@ -373,7 +372,6 @@ class Expedition extends CommonObject $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->fk_delivery_address = $obj->fk_address; $this->modelpdf = $obj->model_pdf; - $this->expedition_method_id = $obj->fk_expedition_methode; // TODO deprecated $this->shipping_method_id = $obj->fk_expedition_methode; $this->tracking_number = $obj->tracking_number; $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility @@ -683,7 +681,7 @@ class Expedition extends CommonObject if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author); if (isset($this->fk_user_valid)) $this->fk_user_valid=trim($this->fk_user_valid); if (isset($this->fk_delivery_address)) $this->fk_delivery_address=trim($this->fk_delivery_address); - if (isset($this->expedition_method_id)) $this->expedition_method_id=trim($this->expedition_method_id); + if (isset($this->shipping_method_id)) $this->shipping_method_id=trim($this->shipping_method_id); if (isset($this->tracking_number)) $this->tracking_number=trim($this->tracking_number); if (isset($this->statut)) $this->statut=trim($this->statut); if (isset($this->trueDepth)) $this->trueDepth=trim($this->trueDepth); @@ -714,7 +712,7 @@ class Expedition extends CommonObject $sql.= " date_expedition=".(dol_strlen($this->date_expedition)!=0 ? "'".$this->db->idate($this->date_expedition)."'" : 'null').","; $sql.= " date_delivery=".(dol_strlen($this->date_delivery)!=0 ? "'".$this->db->idate($this->date_delivery)."'" : 'null').","; $sql.= " fk_address=".(isset($this->fk_delivery_address)?$this->fk_delivery_address:"null").","; - $sql.= " fk_expedition_methode=".((isset($this->expedition_method_id) && $this->expedition_method_id > 0)?$this->expedition_method_id:"null").","; + $sql.= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0)?$this->shipping_method_id:"null").","; $sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; $sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").","; @@ -1291,11 +1289,11 @@ class Expedition extends CommonObject { $code=''; - if (! empty($this->expedition_method_id)) + if (! empty($this->shipping_method_id)) { $sql = "SELECT em.code, em.tracking"; $sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; - $sql.= " WHERE em.rowid = ".$this->expedition_method_id; + $sql.= " WHERE em.rowid = ".$this->shipping_method_id; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 21289f60864..bcb55bb3ef8 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -104,7 +104,7 @@ if ($action == 'add') $object->ref_customer = $objectsrc->ref_client; $object->date_delivery = $date_delivery; // Date delivery planed $object->fk_delivery_address = $objectsrc->fk_delivery_address; - $object->expedition_method_id = GETPOST('expedition_method_id','int'); + $object->shipping_method_id = GETPOST('shipping_method_id','int'); $object->tracking_number = GETPOST('tracking_number','alpha'); $object->ref_int = GETPOST('ref_int','alpha'); @@ -260,7 +260,7 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl' || $action == 'settrueWidth' || $action == 'settrueHeight' || $action == 'settrueDepth' -|| $action == 'setexpedition_method_id') +|| $action == 'setshipping_method_id') { $error=0; @@ -274,7 +274,7 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl' if ($action == 'settrueWidth') $shipping->trueWidth = trim(GETPOST('trueWidth','int')); if ($action == 'settrueHeight') $shipping->trueHeight = trim(GETPOST('trueHeight','int')); if ($action == 'settrueDepth') $shipping->trueDepth = trim(GETPOST('trueDepth','int')); - if ($action == 'setexpedition_method_id') $shipping->expedition_method_id = trim(GETPOST('expedition_method_id','int')); + if ($action == 'setshipping_method_id') $shipping->shipping_method_id = trim(GETPOST('shipping_method_id','int')); if (! $error) { @@ -658,7 +658,7 @@ if ($action == 'create') print "
".$langs->trans("DeliveryMethod")."'; $expe->fetch_delivery_methods(); - print $form->selectarray("expedition_method_id",$expe->meths,GETPOST('expedition_method_id','int'),1,0,0,"",1); + print $form->selectarray("shipping_method_id",$expe->meths,GETPOST('shipping_method_id','int'),1,0,0,"",1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print "
id.'">'.img_edit($langs->trans('SetSendingMethod'),1).'id.'">'.img_edit($langs->trans('SetSendingMethod'),1).'
'; print ''; - if ($action == 'editexpedition_method_id') + if ($action == 'editshipping_method_id') { - print '
'; + print ''; print ''; - print ''; + print ''; $object->fetch_delivery_methods(); - print $form->selectarray("expedition_method_id",$object->meths,$object->expedition_method_id,1,0,0,"",1); + print $form->selectarray("shipping_method_id",$object->meths,$object->shipping_method_id,1,0,0,"",1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; print '
'; } else { - if ($object->expedition_method_id > 0) + if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey - $code=$langs->getLabelFromKey($db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $code=$langs->getLabelFromKey($db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); print $langs->trans("SendingMethod".strtoupper($code)); } } diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index a8a57e7750d..a01458780a6 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -81,6 +81,7 @@ alter table llx_socpeople CHANGE COLUMN cp zip varchar(10); alter table llx_societe_rib CHANGE COLUMN adresse_proprio owner_address text; alter table llx_societe_address CHANGE COLUMN ville town text; alter table llx_societe_address CHANGE COLUMN cp zip varchar(10); +alter table llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer; ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description; From d4ecb93014d9c0a16a84d78f2f53ef94e70bbcf2 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 18 Mar 2013 18:44:57 +0100 Subject: [PATCH 056/150] can now create contract from signed propal --- htdocs/comm/propal.php | 4491 ++++++++++++------------ htdocs/contrat/class/contrat.class.php | 12 +- htdocs/contrat/fiche.php | 214 +- 3 files changed, 2459 insertions(+), 2258 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index eb4278cb528..b74ebd11938 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1,747 +1,747 @@ - - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel -* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/comm/propal.php - * \ingroup propale - * \brief Page of commercial proposals card and list - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->projet->enabled)) -{ - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -} - -$langs->load('companies'); -$langs->load('propal'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('orders'); -$langs->load('products'); -$langs->load("deliveries"); -if (! empty($conf->margin->enabled)) - $langs->load('margins'); - -$error=0; - -$id=GETPOST('id','int'); -$ref=GETPOST('ref','alpha'); -$socid=GETPOST('socid','int'); -$action=GETPOST('action','alpha'); -$origin=GETPOST('origin','alpha'); -$originid=GETPOST('originid','int'); -$confirm=GETPOST('confirm','alpha'); -$lineid=GETPOST('lineid','int'); - -//PDF -$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); -$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); - -// Nombre de ligne pour choix de produit/service predefinis -$NBLINES=4; - -// Security check -if (! empty($user->societe_id)) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); - -$object = new Propal($db); -$extrafields = new ExtraFields($db); - -// Load object -if ($id > 0 || ! empty($ref)) -{ - $ret=$object->fetch($id, $ref); - if ($ret > 0) $ret=$object->fetch_thirdparty(); - if ($ret < 0) dol_print_error('',$object->error); -} - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('propalcard')); - - - -/* - * Actions - */ - -$parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - -// Action clone object -if ($action == 'confirm_clone' && $confirm == 'yes') -{ - if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) - { - setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); - } - else - { - if ($object->id > 0) - { - $result=$object->createFromClone($socid); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); - exit; - } - else - { - setEventMessage($object->error, 'errors'); - $action=''; - } - } - } -} - -// Suppression de la propale -else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) -{ - $result=$object->delete($user); - if ($result > 0) - { - header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); - exit; - } - else - { - $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); - } -} - -// Remove line -else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) -{ - $result = $object->deleteline($lineid); - // reorder lines - if ($result) $object->line_order(true); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; -} - -// Validation -else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) -{ - $result=$object->valid($user); - if ($result >= 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - } - else - { - $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); - } -} - -else if ($action == 'setdate' && $user->rights->propal->creer) -{ - $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - - if (empty($datep)) - { - $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - } - - if (! $error) - { - $result=$object->set_date($user,$datep); - if ($result < 0) dol_print_error($db,$object->error); - } -} -else if ($action == 'setecheance' && $user->rights->propal->creer) -{ - $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); - if ($result < 0) dol_print_error($db,$object->error); -} -else if ($action == 'setdate_livraison' && $user->rights->propal->creer) -{ - $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); - if ($result < 0) dol_print_error($db,$object->error); -} - -// Positionne ref client -else if ($action == 'set_ref_client' && $user->rights->propal->creer) -{ - $object->set_ref_client($user, $_POST['ref_client']); -} - -else if ($action == 'setnote_public' && $user->rights->propal->creer) -{ - $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); - if ($result < 0) dol_print_error($db,$object->error); -} - -else if ($action == 'setnote' && $user->rights->propal->creer) -{ - $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); - if ($result < 0) dol_print_error($db,$object->error); -} - -// Create proposal -else if ($action == 'add' && $user->rights->propal->creer) -{ - $object->socid=$socid; - $object->fetch_thirdparty(); - - $datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); - $duration=GETPOST('duree_validite'); - - if (empty($datep)) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - $action='create'; - $error++; - } - if (empty($duration)) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); - $action='create'; - $error++; - } - - if ($socid<1) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); - $action='create'; - $error++; - } - - if (! $error) - { - $db->begin(); - - // Si on a selectionne une propal a copier, on realise la copie - if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) - { - if ($object->fetch(GETPOST('copie_propal')) > 0) - { - $object->ref = GETPOST('ref'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = $duration; - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->remise_percent = GETPOST('remise_percent'); - $object->remise_absolue = GETPOST('remise_absolue'); - $object->socid = GETPOST('socid'); - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - $object->statut = 0; - - $id = $object->create_from($user); - } - else - { - setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); - } - } - else - { - $object->ref = GETPOST('ref'); - $object->ref_client = GETPOST('ref_client'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = GETPOST('duree_validite'); - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - - $object->origin = GETPOST('origin'); - $object->origin_id = GETPOST('originid'); - - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - if ($_POST['idprod'.$i]) - { - $xid = 'idprod'.$i; - $xqty = 'qty'.$i; - $xremise = 'remise'.$i; - $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); - } - } - - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=GETPOST($key); - } - } - - $id = $object->create($user); - } - - if ($id > 0) - { - // Insertion contact par defaut si defini - if (GETPOST('contactidp')) - { - $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); - if ($result < 0) - { - $error++; - setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); - } - } - - if (! $error) - { - $db->commit(); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } - else - { - $db->rollback(); - } - } - else - { - dol_print_error($db,$object->error); - $db->rollback(); - exit; - } - } -} - -// Classify billed -else if ($action == 'classifybilled' && $user->rights->propal->cloturer) -{ - $object->cloture($user, 4, ''); -} - -// Reopen proposal -else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) -{ - // prevent browser refresh from reopening proposal several times - if ($object->statut==2 || $object->statut==3) - { - $object->setStatut(1); - } -} - -// Close proposal -else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) -{ - if (! GETPOST('statut')) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")), 'errors'); - $action='statut'; - } - else - { - // prevent browser refresh from closing proposal several times - if ($object->statut==1) - { - $object->cloture($user, GETPOST('statut'), GETPOST('note')); - } - } -} - -/* - * Add file in email form - */ -if (GETPOST('addfile')) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - // Set tmp user directory TODO Use a dedicated directory for temp mails files - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir_tmp = $vardir.'/temp'; - - dol_add_file_process($upload_dir_tmp,0,0); - $action='presend'; -} - -/* - * Remove file in email form - */ -if (GETPOST('removedfile')) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir_tmp = $vardir.'/temp'; - - // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'],0); - $action='presend'; -} - -/* - * Send mail - */ -if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) -{ - $langs->load('mails'); - - if ($object->id > 0) - { - if ($_POST['sendto']) - { - // Le destinataire a ete fourni via le champ libre - $sendto = $_POST['sendto']; - $sendtoid = 0; - } - elseif ($_POST['receiver'] != '-1') - { - // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party - { - $sendto = $object->client->email; - $sendtoid = 0; - } - else // Id du contact - { - $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); - $sendtoid = $_POST['receiver']; - } - } - - if (dol_strlen($sendto)) - { - $langs->load("commercial"); - - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; - $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; - $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $deliveryreceipt = $_POST['deliveryreceipt']; - - if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; - else $subject = $langs->transnoentities('Propal').' '.$object->ref; - $actiontypecode='AC_PROP'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; - if ($message) - { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; - } - $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); - - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $attachedfiles=$formmail->get_attached_files(); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; - - // Envoi de la propal - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); - if ($mailfile->error) - { - setEventMessage($mailfile->error, 'errors'); - } - else - { - $result=$mailfile->sendfile(); - if ($result) - { - // Initialisation donnees - $object->sendtoid = $sendtoid; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; - $object->actionmsg2 = $actionmsg2; - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers - - if (! $error) - { - // Redirect here - // This avoid sending mail twice if going out and then back to page - $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); - setEventMessage($mesg); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; - } - else - { - dol_print_error($db); - } - } - else - { - $langs->load("other"); - if ($mailfile->error) - { - $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); - $mesg.='
'.$mailfile->error; - } - else - { - $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - } - setEventMessage($mesg, 'errors'); - } - } - } - else - { - $langs->load("other"); - setEventMessage($langs->trans('ErrorMailRecipientIsEmpty').'!', 'errors'); - dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); - } - } - else - { - $langs->load("other"); - setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")), 'errors'); - dol_syslog($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal"))); - } -} - -// Go back to draft -if ($action == 'modif' && $user->rights->propal->creer) -{ - $object->set_draft($user); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } -} - -else if ($action == "setabsolutediscount" && $user->rights->propal->creer) -{ - if ($_POST["remise_id"]) - { - if ($object->id > 0) - { - $result=$object->insert_discount($_POST["remise_id"]); - if ($result < 0) - { - setEventMessage($object->error, 'errors'); - } - } - } -} - -//Ajout d'une ligne produit dans la propale -else if ($action == "addline" && $user->rights->propal->creer) -{ - $idprod=GETPOST('idprod', 'int'); - $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); - $price_ht = GETPOST('price_ht'); - $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); - - if (empty($idprod) && GETPOST('type') < 0) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); - $error++; - } - if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - if (empty($idprod) && empty($product_desc)) - { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors'); - $error++; - } - - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) - { - $pu_ht=0; - $pu_ttc=0; - $price_min=0; - $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); - - // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $txtva par celui du produit - if (! empty($idprod)) - { - $prod = new Product($db); - $prod->fetch($idprod); - - $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); - - // If prices fields are update - if (GETPOST('usenewaddlineform')) - { - $pu_ht=price2num($price_ht, 'MU'); - $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); - $tva_tx=str_replace('*','', $tva_tx); - $desc = $product_desc; - } - else - { - $tva_tx = get_default_tva($mysoc,$object->client,$prod->id); - $tva_npr = get_default_npr($mysoc,$object->client,$prod->id); - - // On defini prix unitaire - if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) - { - $pu_ht = $prod->multiprices[$object->client->price_level]; - $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; - $price_min = $prod->multiprices_min[$object->client->price_level]; - $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; - } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } - - // On reevalue prix selon taux tva car taux tva transaction peut etre different - // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) - { - if ($price_base_type != 'HT') - { - $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); - } - else - { - $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); - } - } - - $desc=''; - - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) - { - $outputlangs = $langs; - $newlang=''; - if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if (empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description; - } - else - { - $desc = $prod->description; - } - - $desc=dol_concatdesc($desc,$product_desc); - + + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2011 Philippe Grand + * Copyright (C) 2012 Christophe Battarel +* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/comm/propal.php + * \ingroup propale + * \brief Page of commercial proposals card and list + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} + +$langs->load('companies'); +$langs->load('propal'); +$langs->load('compta'); +$langs->load('bills'); +$langs->load('orders'); +$langs->load('products'); +$langs->load("deliveries"); +if (! empty($conf->margin->enabled)) + $langs->load('margins'); + +$error=0; + +$id=GETPOST('id','int'); +$ref=GETPOST('ref','alpha'); +$socid=GETPOST('socid','int'); +$action=GETPOST('action','alpha'); +$origin=GETPOST('origin','alpha'); +$originid=GETPOST('originid','int'); +$confirm=GETPOST('confirm','alpha'); +$lineid=GETPOST('lineid','int'); + +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + +// Nombre de ligne pour choix de produit/service predefinis +$NBLINES=4; + +// Security check +if (! empty($user->societe_id)) $socid=$user->societe_id; +$result = restrictedArea($user, 'propal', $id); + +$object = new Propal($db); +$extrafields = new ExtraFields($db); + +// Load object +if ($id > 0 || ! empty($ref)) +{ + $ret=$object->fetch($id, $ref); + if ($ret > 0) $ret=$object->fetch_thirdparty(); + if ($ret < 0) dol_print_error('',$object->error); +} + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('propalcard')); + + + +/* + * Actions + */ + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + +// Action clone object +if ($action == 'confirm_clone' && $confirm == 'yes') +{ + if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) + { + setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); + } + else + { + if ($object->id > 0) + { + $result=$object->createFromClone($socid); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action=''; + } + } + } +} + +// Suppression de la propale +else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) +{ + $result=$object->delete($user); + if ($result > 0) + { + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + exit; + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans($object->error), 'errors'); + } +} + +// Remove line +else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) +{ + $result = $object->deleteline($lineid); + // reorder lines + if ($result) $object->line_order(true); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; +} + +// Validation +else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) +{ + $result=$object->valid($user); + if ($result >= 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans($object->error), 'errors'); + } +} + +else if ($action == 'setdate' && $user->rights->propal->creer) +{ + $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + + if (empty($datep)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + } + + if (! $error) + { + $result=$object->set_date($user,$datep); + if ($result < 0) dol_print_error($db,$object->error); + } +} +else if ($action == 'setecheance' && $user->rights->propal->creer) +{ + $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); + if ($result < 0) dol_print_error($db,$object->error); +} +else if ($action == 'setdate_livraison' && $user->rights->propal->creer) +{ + $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); + if ($result < 0) dol_print_error($db,$object->error); +} + +// Positionne ref client +else if ($action == 'set_ref_client' && $user->rights->propal->creer) +{ + $object->set_ref_client($user, $_POST['ref_client']); +} + +else if ($action == 'setnote_public' && $user->rights->propal->creer) +{ + $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); + if ($result < 0) dol_print_error($db,$object->error); +} + +else if ($action == 'setnote' && $user->rights->propal->creer) +{ + $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); + if ($result < 0) dol_print_error($db,$object->error); +} + +// Create proposal +else if ($action == 'add' && $user->rights->propal->creer) +{ + $object->socid=$socid; + $object->fetch_thirdparty(); + + $datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + $duration=GETPOST('duree_validite'); + + if (empty($datep)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + $action='create'; + $error++; + } + if (empty($duration)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); + $action='create'; + $error++; + } + + if ($socid<1) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); + $action='create'; + $error++; + } + + if (! $error) + { + $db->begin(); + + // Si on a selectionne une propal a copier, on realise la copie + if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) + { + if ($object->fetch(GETPOST('copie_propal')) > 0) + { + $object->ref = GETPOST('ref'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = $duration; + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->remise_percent = GETPOST('remise_percent'); + $object->remise_absolue = GETPOST('remise_absolue'); + $object->socid = GETPOST('socid'); + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + $object->statut = 0; + + $id = $object->create_from($user); + } + else + { + setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); + } + } + else + { + $object->ref = GETPOST('ref'); + $object->ref_client = GETPOST('ref_client'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = GETPOST('duree_validite'); + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + + $object->origin = GETPOST('origin'); + $object->origin_id = GETPOST('originid'); + + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + if ($_POST['idprod'.$i]) + { + $xid = 'idprod'.$i; + $xqty = 'qty'.$i; + $xremise = 'remise'.$i; + $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); + } + } + + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=GETPOST($key); + } + } + + $id = $object->create($user); + } + + if ($id > 0) + { + // Insertion contact par defaut si defini + if (GETPOST('contactidp')) + { + $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); + if ($result < 0) + { + $error++; + setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); + } + } + + if (! $error) + { + $db->commit(); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db,$object->error); + $db->rollback(); + exit; + } + } +} + +// Classify billed +else if ($action == 'classifybilled' && $user->rights->propal->cloturer) +{ + $object->cloture($user, 4, ''); +} + +// Reopen proposal +else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) +{ + // prevent browser refresh from reopening proposal several times + if ($object->statut==2 || $object->statut==3) + { + $object->setStatut(1); + } +} + +// Close proposal +else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) +{ + if (! GETPOST('statut')) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")), 'errors'); + $action='statut'; + } + else + { + // prevent browser refresh from closing proposal several times + if ($object->statut==1) + { + $object->cloture($user, GETPOST('statut'), GETPOST('note')); + } + } +} + +/* + * Add file in email form + */ +if (GETPOST('addfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory TODO Use a dedicated directory for temp mails files + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + dol_add_file_process($upload_dir_tmp,0,0); + $action='presend'; +} + +/* + * Remove file in email form + */ +if (GETPOST('removedfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + // TODO Delete only files that was uploaded from email form + dol_remove_file_process($_POST['removedfile'],0); + $action='presend'; +} + +/* + * Send mail + */ +if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) +{ + $langs->load('mails'); + + if ($object->id > 0) + { + if ($_POST['sendto']) + { + // Le destinataire a ete fourni via le champ libre + $sendto = $_POST['sendto']; + $sendtoid = 0; + } + elseif ($_POST['receiver'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party + { + $sendto = $object->client->email; + $sendtoid = 0; + } + else // Id du contact + { + $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); + $sendtoid = $_POST['receiver']; + } + } + + if (dol_strlen($sendto)) + { + $langs->load("commercial"); + + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; + $message = $_POST['message']; + $sendtocc = $_POST['sendtocc']; + $deliveryreceipt = $_POST['deliveryreceipt']; + + if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; + else $subject = $langs->transnoentities('Propal').' '.$object->ref; + $actiontypecode='AC_PROP'; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + if ($message) + { + $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; + $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; + $actionmsg.=$message; + } + $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $attachedfiles=$formmail->get_attached_files(); + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + // Envoi de la propal + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + if ($mailfile->error) + { + setEventMessage($mailfile->error, 'errors'); + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + // Initialisation donnees + $object->sendtoid = $sendtoid; + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; + $object->actionmsg2 = $actionmsg2; + $object->fk_element = $object->id; + $object->elementtype = $object->element; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + + if (! $error) + { + // Redirect here + // This avoid sending mail twice if going out and then back to page + $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); + setEventMessage($mesg); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else + { + dol_print_error($db); + } + } + else + { + $langs->load("other"); + if ($mailfile->error) + { + $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $mesg.='
'.$mailfile->error; + } + else + { + $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + } + setEventMessage($mesg, 'errors'); + } + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty').'!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")), 'errors'); + dol_syslog($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal"))); + } +} + +// Go back to draft +if ($action == 'modif' && $user->rights->propal->creer) +{ + $object->set_draft($user); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } +} + +else if ($action == "setabsolutediscount" && $user->rights->propal->creer) +{ + if ($_POST["remise_id"]) + { + if ($object->id > 0) + { + $result=$object->insert_discount($_POST["remise_id"]); + if ($result < 0) + { + setEventMessage($object->error, 'errors'); + } + } + } +} + +//Ajout d'une ligne produit dans la propale +else if ($action == "addline" && $user->rights->propal->creer) +{ + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); + + if (empty($idprod) && GETPOST('type') < 0) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + $error++; + } + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + $error++; + } + if (empty($idprod) && empty($product_desc)) + { + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors'); + $error++; + } + + if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + { + $pu_ht=0; + $pu_ttc=0; + $price_min=0; + $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); + + // Ecrase $pu par celui du produit + // Ecrase $desc par celui du produit + // Ecrase $txtva par celui du produit + if (! empty($idprod)) + { + $prod = new Product($db); + $prod->fetch($idprod); + + $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); + + // If prices fields are update + if (GETPOST('usenewaddlineform')) + { + $pu_ht=price2num($price_ht, 'MU'); + $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); + $tva_tx=str_replace('*','', $tva_tx); + $desc = $product_desc; + } + else + { + $tva_tx = get_default_tva($mysoc,$object->client,$prod->id); + $tva_npr = get_default_npr($mysoc,$object->client,$prod->id); + + // On defini prix unitaire + if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) + { + $pu_ht = $prod->multiprices[$object->client->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; + $price_min = $prod->multiprices_min[$object->client->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; + } + else + { + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; + } + + // On reevalue prix selon taux tva car taux tva transaction peut etre different + // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). + if ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { + $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); + } + else + { + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); + } + } + + $desc=''; + + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description; + } + else + { + $desc = $prod->description; + } + + $desc=dol_concatdesc($desc,$product_desc); + // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { @@ -752,1501 +752,1512 @@ else if ($action == "addline" && $user->rights->propal->creer) $tmptxt.=')'; $desc= dol_concatdesc($desc, $tmptxt); } - } - - $type = $prod->type; - } - else - { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); - $tva_tx = str_replace('*', '', $tva_tx); - $label = (GETPOST('product_label')?GETPOST('product_label'):''); - $desc = $product_desc; - $type = GETPOST('type'); - } - - // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); - - // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $object->client); - $localtax2_tx= get_localtax($tva_tx, 2, $object->client); - - $info_bits=0; - if ($tva_npr) $info_bits |= 0x01; - - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) - { - $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); - setEventMessage($mesg, 'errors'); - } - else - { - // Insert line - $result=$object->addline( - $id, - $desc, - $pu_ht, - GETPOST('qty'), - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $idprod, - GETPOST('remise_percent'), - $price_base_type, - $pu_ttc, - $info_bits, - $type, - -1, - 0, - GETPOST('fk_parent_line'), - $fournprice, - $buyingprice, - $label - ); - - if ($result > 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['idprod']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - - // old method - unset($_POST['np_desc']); - unset($_POST['dp_desc']); - } - else - { - setEventMessage($object->error, 'errors'); - } - } - } -} - -// Mise a jour d'une ligne dans la propale -else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save') == $langs->trans("Save")) -{ - // Define info_bits - $info_bits=0; - if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; - - // Clean parameters - $description=dol_htmlcleanlastbr(GETPOST('product_desc')); - - // Define vat_rate - $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); - $vat_rate=str_replace('*','',$vat_rate); - $localtax1_rate=get_localtax($vat_rate,1,$object->client); - $localtax2_rate=get_localtax($vat_rate,2,$object->client); - $pu_ht=GETPOST('price_ht'); - - // Add buying price - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); - - // Define special_code for special lines - $special_code=0; - if (! GETPOST('qty')) $special_code=3; - - // Check minimum price - $productid = GETPOST('productid', 'int'); - if (! empty($productid)) - { - $product = new Product($db); - $res=$product->fetch($productid); - - $type=$product->type; - - $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) - $price_min = $product->multiprices_min[$object->client->price_level]; - - $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); - - if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) - { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); - $error++; - } - } - else - { - $type = GETPOST('type'); - $label = (GETPOST('product_label') ? GETPOST('product_label'):''); - - // Check parameters - if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); - $error++; - } - } - - if (! $error) - { - $result = $object->updateline( - GETPOST('lineid'), - $pu_ht, - GETPOST('qty'), - GETPOST('remise_percent'), - $vat_rate, - $localtax1_rate, - $localtax2_rate, - $description, - 'HT', - $info_bits, - $special_code, - GETPOST('fk_parent_line'), - 0, - $fournprice, - $buyingprice, - $label, - $type - ); - - if ($result >= 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['productid']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - } - else - { - setEventMessage($object->error, 'errors'); - } - } -} - -else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) -{ - header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition - exit; -} - -// Generation doc (depuis lien ou depuis cartouche doc) -else if ($action == 'builddoc' && $user->rights->propal->creer) -{ - if (GETPOST('model')) - { - $object->setDocModel($user, GETPOST('model')); - } - - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - else - { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); - exit; - } -} - -// Remove file in doc form -else if ($action == 'remove_file' && $user->rights->propal->creer) -{ - if ($object->id > 0) - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $conf->propal->dir_output; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); - } -} - -// Set project -else if ($action == 'classin' && $user->rights->propal->creer) -{ - $object->setProject($_POST['projectid']); -} - -// Delai de livraison -else if ($action == 'setavailability' && $user->rights->propal->creer) -{ - $result = $object->availability($_POST['availability_id']); -} - -// Origine de la propale -else if ($action == 'setdemandreason' && $user->rights->propal->creer) -{ - $result = $object->demand_reason($_POST['demand_reason_id']); -} - -// Conditions de reglement -else if ($action == 'setconditions' && $user->rights->propal->creer) -{ - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); -} - -else if ($action == 'setremisepercent' && $user->rights->propal->creer) -{ - $result = $object->set_remise_percent($user, $_POST['remise_percent']); -} - -else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) -{ - $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); -} - -// Mode de reglement -else if ($action == 'setmode' && $user->rights->propal->creer) -{ - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); -} - -/* - * Ordonnancement des lignes - */ - -else if ($action == 'up' && $user->rights->propal->creer) -{ - $object->line_up(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); - exit; -} - -else if ($action == 'down' && $user->rights->propal->creer) -{ - $object->line_down(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); - exit; -} -else if ($action == 'update_extras') -{ - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=$_POST[$key]; - } - } - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); - $parameters=array('id'=>$object->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - -} - -if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) -{ - if ($action == 'addcontact') - { - if ($object->id > 0) - { - $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); - } - else - { - setEventMessage($object->error, 'errors'); - } - } - } - - // Bascule du statut d'un contact - else if ($action == 'swapstatut') - { - if ($object->fetch($id) > 0) - { - $result=$object->swapContactStatus(GETPOST('ligne')); - } - else - { - dol_print_error($db); - } - } - - // Efface un contact - else if ($action == 'deletecontact') - { - $object->fetch($id); - $result = $object->delete_contact($lineid); - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - dol_print_error($db); - } - } -} - - -/* - * View - */ - -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); - -$form = new Form($db); -$formother = new FormOther($db); -$formfile = new FormFile($db); -$formpropal = new FormPropal($db); -$companystatic=new Societe($db); - -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('propal'); - -$now=dol_now(); - -// Add new proposal -if ($action == 'create') -{ - print_fiche_titre($langs->trans("NewProp")); - - $soc = new Societe($db); - if ($socid>0) $res=$soc->fetch($socid); - - $object = new Propal($db); - - print '
'; - print ''; - print ''; - - if ($origin != 'project' && $originid) - { - print ''; - print ''; - } - - print ''; - - // Reference - print ''; - - // Ref customer - print ''; - print ''; - - // Third party - print ''; - print ''; - if($socid>0) - { - print ''; - } - else - { - print ''; - } - print ''."\n"; - - // Contacts - if($socid>0) - { - print "'; - - // Ligne info remises tiers - print ''; - } - - // Date - print ''; - - // Validaty duration - print ''; - - // Terms of payment - print ''; - - // Mode of payment - print ''; - - // What trigger creation - print ''; - - // Delivery delay - print ''; - - // Delivery date (or manufacturing) - print ''; - print ''; - - // Model - print ''; - print ''; - print '"; - - // Project - if (! empty($conf->projet->enabled) && $socid>0) - { - $projectid = 0; - if ($origin == 'project') $projectid = ($originid?$originid:0); - - print ''; - print ''; - print ''; - } - - // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - - // Show separator only - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } - } - } - - print "
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; - print '
'.$langs->trans('Customer').''; - print $soc->getNomUrl(1); - print ''; - print ''; - print $form->select_company('','socid','s.client = 1 OR s.client = 2 OR s.client = 3',1); - print '
".$langs->trans("DefaultContact").''; - $form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); - print '
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$soc->getAvailableDiscounts(); - print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); - else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.'; - print '
'.$langs->trans('Date').''; - $form->select_date('','','','','',"addprop"); - print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; - $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); - print '
'.$langs->trans('PaymentMode').''; - $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); - print '
'.$langs->trans('Source').''; - $form->select_demand_reason('','demand_reason_id',"SRC_PROP",1); - print '
'.$langs->trans('AvailabilityPeriod').''; - $form->select_availability('','availability_id','',1); - print '
'.$langs->trans("DeliveryDate").''; - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") - { - $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - $syear = date("Y", $tmpdte); - $smonth = date("m", $tmpdte); - $sday = date("d", $tmpdte); - $form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop"); - } - else - { - $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - $form->select_date($datepropal,'liv_','','','',"addprop"); - } - print '
'.$langs->trans("DefaultModel").''; - $liste=ModelePDFPropales::liste_modeles($db); - print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF); - print "
'.$langs->trans("Project").''; - - $numprojet=select_projects($soc->id,$projectid); - if ($numprojet==0) - { - print '   '.$langs->trans("AddProject").''; - } - print '
'; - print $extrafields->showInputField($key,$value); - print '
"; - print '
'; - - /* - * Combobox pour la fonction de copie - */ - - if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) - { - print ''; - } - - print ''; - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) - { - // For backward compatibility - print ''; - print ''; - print ''; - print ''; - - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; - - print ''; - print ''; - } - - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - print ''; - } - print '
'.$langs->trans("CopyPropalFrom").' '; - $liste_propal = array(); - $liste_propal[0] = ''; - - $sql ="SELECT p.rowid as id, p.ref, s.nom"; - $sql.=" FROM ".MAIN_DB_PREFIX."propal p"; - $sql.= ", ".MAIN_DB_PREFIX."societe s"; - $sql.= " WHERE s.rowid = p.fk_soc"; - $sql.= " AND p.entity = ".$conf->entity; - $sql.= " AND p.fk_statut <> 0"; - $sql.= " ORDER BY Id"; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $row = $db->fetch_row($resql); - $propalRefAndSocName = $row[1]." - ".$row[2]; - $liste_propal[$row[0]]=$propalRefAndSocName; - $i++; - } - print $form->selectarray("copie_propal",$liste_propal, 0); - } - else - { - dol_print_error($db); - } - print '
 
'.$langs->trans("CreateEmptyPropal").'
'; - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $lib=$langs->trans("ProductsAndServices"); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - print ''; - print ''; - print ''; - print ''; - } - - print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; - // multiprix - if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) - $form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level); - else - $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); - print '%
"; - - } - print '
'; - print '
'; - - $langs->load("bills"); - print '
'; - print ''; - print ' '; - print '
'; - - print "
"; -} -else -{ - /* - * Show object in view mode - */ - - $soc = new Societe($db); - $soc->fetch($object->socid); - - $head = propal_prepare_head($object); - dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); - - $formconfirm=''; - - // Clone confirmation - if ($action == 'clone') - { - // Create an array for form - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid','int'),'socid','(s.client=1 OR s.client=2 OR s.client=3)')) - ); - // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1); - } - - // Confirm delete - else if ($action == 'delete') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); - } - - // Confirm reopen - else if ($action == 'reopen') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); - } - - // Confirmation delete product/service line - else if ($action == 'ask_deleteline') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); - } - - // Confirm validate proposal - else if ($action == 'validate') - { - $error=0; - - // on verifie si l'objet est en numerotation provisoire - $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV') - { - $numref = $object->getNextNumRef($soc); - if (empty($numref)) - { - $error++; - dol_htmloutput_errors($object->error); - } - } - else - { - $numref = $object->ref; - } - - $text=$langs->trans('ConfirmValidateProp',$numref); - if (! empty($conf->notification->enabled)) - { - require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; - $notify=new Notify($db); - $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); - } - - if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); - } - - if (! $formconfirm) - { - $parameters=array('lineid'=>$lineid); - $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - - // Print form confirm - print $formconfirm; - - - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - - // Company - print ''; - print ''; - - // Ligne info remises tiers - print ''; - - // Date of proposal - print ''; - print ''; - - // Date end proposal - print ''; - print ''; - print ''; - - // Payment term - print ''; - print ''; - - // Delivery date - $langs->load('deliveries'); - print ''; - print ''; - - // Delivery delay - print ''; - print ''; - - // Origin of demand - print ''; - print ''; - - // Payment mode - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - print ''; - } - else - { - print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print '
'; - print ''; - if ($action != 'refclient' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print ''.img_edit($langs->trans('Modify')).'
'; - print '
'; - if ($user->rights->propal->creer && $action == 'refclient') - { - print '
'; - print ''; - print ''; - print ''; - print ' '; - print '
'; - } - else - { - print $object->ref_client; - } - print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - print '. '; - $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); - $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); - $absolute_discount=price2num($absolute_discount,'MT'); - $absolute_creditnote=price2num($absolute_creditnote,'MT'); - if ($absolute_discount) - { - if ($object->statut > 0) - { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - } - else - { - // Remise dispo de type non avoir - $filter='fk_facture_source IS NULL'; - print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); - } - } - if ($absolute_creditnote) - { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; - } - if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; - print '
'; - print ''; - if ($action != 'editdate' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('Date'); - print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; - print '
'; - if (! empty($object->brouillon) && $action == 'editdate') - { - print '
'; - print ''; - print ''; - $form->select_date($object->date,'re','','',0,"editdate"); - print ''; - print '
'; - } - else - { - if ($object->date) - { - print dol_print_date($object->date,'daytext'); - } - else - { - print ' '; - } - } - print '
'; - print ''; - if ($action != 'editecheance' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('DateEndPropal'); - print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; - print '
'; - if (! empty($object->brouillon) && $action == 'editecheance') - { - print '
'; - print ''; - print ''; - $form->select_date($object->fin_validite,'ech','','','',"editecheance"); - print ''; - print '
'; - } - else - { - if (! empty($object->fin_validite)) - { - print dol_print_date($object->fin_validite,'daytext'); - if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); - } - else - { - print ' '; - } - } - print '
'; - print ''; - if ($action != 'editconditions' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('PaymentConditionsShort'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'),1).'
'; - print '
'; - if ($action == 'editconditions') - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); - } - else - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); - } - print '
'; - print ''; - if ($action != 'editdate_livraison' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('DeliveryDate'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'),1).'
'; - print '
'; - if ($action == 'editdate_livraison') - { - print '
'; - print ''; - print ''; - $form->select_date($object->date_livraison,'liv_','','','',"editdate_livraison"); - print ''; - print '
'; - } - else - { - print dol_print_date($object->date_livraison,'daytext'); - } - print '
'; - print ''; - if ($action != 'editavailability' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('AvailabilityPeriod'); - if (! empty($conf->commande->enabled)) print ' ('.$langs->trans('AfterOrder').')'; - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'),1).'
'; - print '
'; - if ($action == 'editavailability') - { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); - } - else - { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1); - } - - print '
'; - print ''; - if ($action != 'editdemandreason' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('Source'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'),1).'
'; - print '
'; - //print $object->demand_reason_id; - if ($action == 'editdemandreason') - { - $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); - } - else - { - $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none'); - } - - print '
'; - print ''; - if ($action != 'editmode' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('PaymentMode'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'),1).'
'; - print '
'; - if ($action == 'editmode') - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); - } - else - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); - } - print '
'; - print ''; - if ($user->rights->propal->creer) - { - if ($action != 'classify') print ''; - print '
'; - print $langs->trans('Project').''.img_edit($langs->transnoentitiesnoconv('SetProject')).'
'; - print '
'; - if ($action == 'classify') - { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); - } - else - { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); - } - print '
'; - if (! empty($object->fk_project)) - { - print ''; - $proj = new Project($db); - $proj->fetch($object->fk_project); - print ''; - print $proj->ref; - print ''; - print ''; - } - else { - print ' '; - } - } - print ''; - } - - // Other attributes - $res=$object->fetch_optionals($object->id,$extralabels); - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - - if ($action == 'edit_extras') - { - print '
'; - print ''; - print ''; - print ''; - } - - - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print $extrafields->showInputField($key,$value); - } - else - { - print $extrafields->showOutputField($key,$value); - } - print ''."\n"; - } - } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print ''; - print ''; - print ''; - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->propal->creer) - { - print ''.img_picto('','edit').' '.$langs->trans('Modify').''; - } - } - } - } - - // Amount HT - print ''.$langs->trans('AmountHT').''; - print ''.price($object->total_ht).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Margin Infos - if (! empty($conf->margin->enabled)) { - print ''; - $object->displayMarginInfos(); - print ''; - } - print ''; - - // Amount VAT - print ''.$langs->trans('AmountVAT').''; - print ''.price($object->total_tva).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Amount Local Taxes - if ($mysoc->localtax1_assuj=="1") //Localtax1 - { - print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; - print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - if ($mysoc->localtax2_assuj=="1") //Localtax2 - { - print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; - print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - - - // Amount TTC - print ''.$langs->trans('AmountTTC').''; - print ''.price($object->total_ttc).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Statut - print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; - - print '
'; - - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - $blocname = 'contacts'; - $title = $langs->trans('ContactsAddresses'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $blocname = 'notes'; - $title = $langs->trans('Notes'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - /* - * Lines - */ - - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) - { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print ''; - - // Show object lines - $result = $object->getLinesArray(); - if (! empty($object->lines)) - $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid); - - // Form to add new line - if ($object->statut == 0 && $user->rights->propal->creer) - { - if ($action != 'editline') - { - $var=true; - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { - // Add free or predefined products/services - $object->formAddObjectLine(0,$mysoc,$soc); - } - else - { - // Add free products/services - $object->formAddFreeProduct(0,$mysoc,$soc); - - // Add predefined products/services - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $var=!$var; - $object->formAddPredefinedProduct(0,$mysoc,$soc); - } - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - } - - print '
'; - - print ''; - print "\n"; - - if ($action == 'statut') - { - /* - * Formulaire cloture (signe ou non) - */ - $form_close = '
'; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans("CloseAs").''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans('Note').'
'; - $form_close.= ''; - $form_close.= '   '; - $form_close.= ' '; - $form_close.= '
'; - - print $form_close; - } - - - /* - * Boutons Actions - */ - if ($action != 'presend') - { - print '
'; - - if ($action != 'statut' && $action <> 'editline') - { - // Validate - if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) - { - if (count($object->lines) > 0) print ''.$langs->trans('Validate').''; - //else print ''.$langs->trans('Validate').''; - } - - // Edit - if ($object->statut == 1 && $user->rights->propal->creer) - { - print ''.$langs->trans('Modify').''; - } - - // ReOpen - if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) - { - print 'global->MAIN_JUMP_TAG)?'':'#reopen').'"'; - print '>'.$langs->trans('ReOpen').''; - } - - // Send - if ($object->statut == 1 || $object->statut == 2) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) - { - print ''.$langs->trans('SendByMail').''; - } - else print ''.$langs->trans('SendByMail').''; - } - - // Create an order - if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) - { - if ($user->rights->commande->creer) - { - print ''.$langs->trans("AddOrder").''; - } - } - - // Create an invoice and classify billed - if ($object->statut == 2 && $user->societe_id == 0) - { - if (! empty($conf->facture->enabled) && $user->rights->facture->creer) - { - print ''.$langs->trans("AddBill").''; - } - - $arraypropal=$object->getInvoiceArrayList(); - if (is_array($arraypropal) && count($arraypropal) > 0) - { - print 'socid.'">'.$langs->trans("ClassifyBilled").''; - } - } - - // Close - if ($object->statut == 1 && $user->rights->propal->cloturer) - { - print 'global->MAIN_JUMP_TAG)?'':'#close').'"'; - print '>'.$langs->trans('Close').''; - } - - // Clone - if ($user->rights->propal->creer) - { - print ''.$langs->trans("ToClone").''; - } - - // Delete - if ($user->rights->propal->supprimer) - { - print ''.$langs->trans('Delete').''; - } - - } - - print '
'; - print "
\n"; - } - - if ($action != 'presend') - { - print '
'; - print ''; // ancre - - - /* - * Documents generes - */ - $filename=dol_sanitizeFileName($object->ref); - $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed=$user->rights->propal->creer; - $delallowed=$user->rights->propal->supprimer; - - $var=true; - - $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang); - - - /* - * Linked object block - */ - $somethingshown=$object->showLinkedObjectBlock(); - - print ''; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'propal',$socid); - - print '
'; - } - - - /* - * Action presend - * - */ - if ($action == 'presend') - { - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); - $file=$fileparams['fullname']; - - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); - $file=$fileparams['fullname']; - } - - print '
'; - print_titre($langs->trans('SendPropalByMail')); - - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->fromtype = 'user'; - $formmail->fromid = $user->id; - $formmail->fromname = $user->getFullName($langs); - $formmail->frommail = $user->email; - $formmail->withfrom=1; + } + + $type = $prod->type; + } + else + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label')?GETPOST('product_label'):''); + $desc = $product_desc; + $type = GETPOST('type'); + } + + // Margin + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + + // Local Taxes + $localtax1_tx= get_localtax($tva_tx, 1, $object->client); + $localtax2_tx= get_localtax($tva_tx, 2, $object->client); + + $info_bits=0; + if ($tva_npr) $info_bits |= 0x01; + + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + { + $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); + setEventMessage($mesg, 'errors'); + } + else + { + // Insert line + $result=$object->addline( + $id, + $desc, + $pu_ht, + GETPOST('qty'), + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + GETPOST('remise_percent'), + $price_base_type, + $pu_ttc, + $info_bits, + $type, + -1, + 0, + GETPOST('fk_parent_line'), + $fournprice, + $buyingprice, + $label + ); + + if ($result > 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['idprod']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + + // old method + unset($_POST['np_desc']); + unset($_POST['dp_desc']); + } + else + { + setEventMessage($object->error, 'errors'); + } + } + } +} + +// Mise a jour d'une ligne dans la propale +else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save') == $langs->trans("Save")) +{ + // Define info_bits + $info_bits=0; + if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; + + // Clean parameters + $description=dol_htmlcleanlastbr(GETPOST('product_desc')); + + // Define vat_rate + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + $vat_rate=str_replace('*','',$vat_rate); + $localtax1_rate=get_localtax($vat_rate,1,$object->client); + $localtax2_rate=get_localtax($vat_rate,2,$object->client); + $pu_ht=GETPOST('price_ht'); + + // Add buying price + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + + // Define special_code for special lines + $special_code=0; + if (! GETPOST('qty')) $special_code=3; + + // Check minimum price + $productid = GETPOST('productid', 'int'); + if (! empty($productid)) + { + $product = new Product($db); + $res=$product->fetch($productid); + + $type=$product->type; + + $price_min = $product->price_min; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) + $price_min = $product->multiprices_min[$object->client->price_level]; + + $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); + + if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + { + setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); + $error++; + } + } + else + { + $type = GETPOST('type'); + $label = (GETPOST('product_label') ? GETPOST('product_label'):''); + + // Check parameters + if (GETPOST('type') < 0) { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + $error++; + } + } + + if (! $error) + { + $result = $object->updateline( + GETPOST('lineid'), + $pu_ht, + GETPOST('qty'), + GETPOST('remise_percent'), + $vat_rate, + $localtax1_rate, + $localtax2_rate, + $description, + 'HT', + $info_bits, + $special_code, + GETPOST('fk_parent_line'), + 0, + $fournprice, + $buyingprice, + $label, + $type + ); + + if ($result >= 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + } + else + { + setEventMessage($object->error, 'errors'); + } + } +} + +else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) +{ + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition + exit; +} + +// Generation doc (depuis lien ou depuis cartouche doc) +else if ($action == 'builddoc' && $user->rights->propal->creer) +{ + if (GETPOST('model')) + { + $object->setDocModel($user, GETPOST('model')); + } + + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + else + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + exit; + } +} + +// Remove file in doc form +else if ($action == 'remove_file' && $user->rights->propal->creer) +{ + if ($object->id > 0) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $conf->propal->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file,0,0,0,$object); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); + } +} + +// Set project +else if ($action == 'classin' && $user->rights->propal->creer) +{ + $object->setProject($_POST['projectid']); +} + +// Delai de livraison +else if ($action == 'setavailability' && $user->rights->propal->creer) +{ + $result = $object->availability($_POST['availability_id']); +} + +// Origine de la propale +else if ($action == 'setdemandreason' && $user->rights->propal->creer) +{ + $result = $object->demand_reason($_POST['demand_reason_id']); +} + +// Conditions de reglement +else if ($action == 'setconditions' && $user->rights->propal->creer) +{ + $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); +} + +else if ($action == 'setremisepercent' && $user->rights->propal->creer) +{ + $result = $object->set_remise_percent($user, $_POST['remise_percent']); +} + +else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) +{ + $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); +} + +// Mode de reglement +else if ($action == 'setmode' && $user->rights->propal->creer) +{ + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); +} + +/* + * Ordonnancement des lignes + */ + +else if ($action == 'up' && $user->rights->propal->creer) +{ + $object->line_up(GETPOST('rowid')); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + exit; +} + +else if ($action == 'down' && $user->rights->propal->creer) +{ + $object->line_down(GETPOST('rowid')); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + exit; +} +else if ($action == 'update_extras') +{ + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=$_POST[$key]; + } + } + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('propaldao')); + $parameters=array('id'=>$object->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$object->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + +} + +if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) +{ + if ($action == 'addcontact') + { + if ($object->id > 0) + { + $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + } + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + } + else + { + setEventMessage($object->error, 'errors'); + } + } + } + + // Bascule du statut d'un contact + else if ($action == 'swapstatut') + { + if ($object->fetch($id) > 0) + { + $result=$object->swapContactStatus(GETPOST('ligne')); + } + else + { + dol_print_error($db); + } + } + + // Efface un contact + else if ($action == 'deletecontact') + { + $object->fetch($id); + $result = $object->delete_contact($lineid); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + dol_print_error($db); + } + } +} + + +/* + * View + */ + +llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); + +$form = new Form($db); +$formother = new FormOther($db); +$formfile = new FormFile($db); +$formpropal = new FormPropal($db); +$companystatic=new Societe($db); + +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('propal'); + +$now=dol_now(); + +// Add new proposal +if ($action == 'create') +{ + print_fiche_titre($langs->trans("NewProp")); + + $soc = new Societe($db); + if ($socid>0) $res=$soc->fetch($socid); + + $object = new Propal($db); + + print '
'; + print ''; + print ''; + + if ($origin != 'project' && $originid) + { + print ''; + print ''; + } + + print ''; + + // Reference + print ''; + + // Ref customer + print ''; + print ''; + + // Third party + print ''; + print ''; + if($socid>0) + { + print ''; + } + else + { + print ''; + } + print ''."\n"; + + // Contacts + if($socid>0) + { + print "'; + + // Ligne info remises tiers + print ''; + } + + // Date + print ''; + + // Validaty duration + print ''; + + // Terms of payment + print ''; + + // Mode of payment + print ''; + + // What trigger creation + print ''; + + // Delivery delay + print ''; + + // Delivery date (or manufacturing) + print ''; + print ''; + + // Model + print ''; + print ''; + print '"; + + // Project + if (! empty($conf->projet->enabled) && $socid>0) + { + $projectid = 0; + if ($origin == 'project') $projectid = ($originid?$originid:0); + + print ''; + print ''; + print ''; + } + + // Other attributes + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + + // Show separator only + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } + } + } + + print "
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; + print '
'.$langs->trans('Customer').''; + print $soc->getNomUrl(1); + print ''; + print ''; + print $form->select_company('','socid','s.client = 1 OR s.client = 2 OR s.client = 3',1); + print '
".$langs->trans("DefaultContact").''; + $form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); + print '
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $absolute_discount=$soc->getAvailableDiscounts(); + print '. '; + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '
'.$langs->trans('Date').''; + $form->select_date('','','','','',"addprop"); + print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; + $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); + print '
'.$langs->trans('PaymentMode').''; + $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); + print '
'.$langs->trans('Source').''; + $form->select_demand_reason('','demand_reason_id',"SRC_PROP",1); + print '
'.$langs->trans('AvailabilityPeriod').''; + $form->select_availability('','availability_id','',1); + print '
'.$langs->trans("DeliveryDate").''; + if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") + { + $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); + $syear = date("Y", $tmpdte); + $smonth = date("m", $tmpdte); + $sday = date("d", $tmpdte); + $form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop"); + } + else + { + $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $form->select_date($datepropal,'liv_','','','',"addprop"); + } + print '
'.$langs->trans("DefaultModel").''; + $liste=ModelePDFPropales::liste_modeles($db); + print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF); + print "
'.$langs->trans("Project").''; + + $numprojet=select_projects($soc->id,$projectid); + if ($numprojet==0) + { + print '   '.$langs->trans("AddProject").''; + } + print '
'; + print $extrafields->showInputField($key,$value); + print '
"; + print '
'; + + /* + * Combobox pour la fonction de copie + */ + + if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) + { + print ''; + } + + print ''; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) + { + // For backward compatibility + print ''; + print ''; + print ''; + print ''; + + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; + + print ''; + print ''; + } + + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) + { + print ''; + } + print '
'.$langs->trans("CopyPropalFrom").' '; + $liste_propal = array(); + $liste_propal[0] = ''; + + $sql ="SELECT p.rowid as id, p.ref, s.nom"; + $sql.=" FROM ".MAIN_DB_PREFIX."propal p"; + $sql.= ", ".MAIN_DB_PREFIX."societe s"; + $sql.= " WHERE s.rowid = p.fk_soc"; + $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.fk_statut <> 0"; + $sql.= " ORDER BY Id"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($resql); + $propalRefAndSocName = $row[1]." - ".$row[2]; + $liste_propal[$row[0]]=$propalRefAndSocName; + $i++; + } + print $form->selectarray("copie_propal",$liste_propal, 0); + } + else + { + dol_print_error($db); + } + print '
 
'.$langs->trans("CreateEmptyPropal").'
'; + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $lib=$langs->trans("ProductsAndServices"); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + print ''; + print ''; + print ''; + print ''; + } + + print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; + // multiprix + if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) + $form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level); + else + $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); + print '%
"; + + } + print '
'; + print '
'; + + $langs->load("bills"); + print '
'; + print ''; + print ' '; + print '
'; + + print "
"; +} +else +{ + /* + * Show object in view mode + */ + + $soc = new Societe($db); + $soc->fetch($object->socid); + + $head = propal_prepare_head($object); + dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); + + $formconfirm=''; + + // Clone confirmation + if ($action == 'clone') + { + // Create an array for form + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid','int'),'socid','(s.client=1 OR s.client=2 OR s.client=3)')) + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1); + } + + // Confirm delete + else if ($action == 'delete') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); + } + + // Confirm reopen + else if ($action == 'reopen') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); + } + + // Confirmation delete product/service line + else if ($action == 'ask_deleteline') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); + } + + // Confirm validate proposal + else if ($action == 'validate') + { + $error=0; + + // on verifie si l'objet est en numerotation provisoire + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') + { + $numref = $object->getNextNumRef($soc); + if (empty($numref)) + { + $error++; + dol_htmloutput_errors($object->error); + } + } + else + { + $numref = $object->ref; + } + + $text=$langs->trans('ConfirmValidateProp',$numref); + if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; + $notify=new Notify($db); + $text.='
'; + $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); + } + + if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); + } + + if (! $formconfirm) + { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + // Print form confirm + print $formconfirm; + + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Ref client + print ''; + print ''; + + // Company + print ''; + print ''; + + // Ligne info remises tiers + print ''; + + // Date of proposal + print ''; + print ''; + + // Date end proposal + print ''; + print ''; + print ''; + + // Payment term + print ''; + print ''; + + // Delivery date + $langs->load('deliveries'); + print ''; + print ''; + + // Delivery delay + print ''; + print ''; + + // Origin of demand + print ''; + print ''; + + // Payment mode + print ''; + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + print ''; + } + else + { + print '
'.$langs->trans('Ref').''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print '
'; + print ''; + if ($action != 'refclient' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Modify')).'
'; + print '
'; + if ($user->rights->propal->creer && $action == 'refclient') + { + print '
'; + print ''; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print $object->ref_client; + } + print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + print '. '; + $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); + $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); + $absolute_discount=price2num($absolute_discount,'MT'); + $absolute_creditnote=price2num($absolute_creditnote,'MT'); + if ($absolute_discount) + { + if ($object->statut > 0) + { + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + } + else + { + // Remise dispo de type non avoir + $filter='fk_facture_source IS NULL'; + print '
'; + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); + } + } + if ($absolute_creditnote) + { + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; + } + if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; + print '
'; + print ''; + if ($action != 'editdate' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('Date'); + print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; + print '
'; + if (! empty($object->brouillon) && $action == 'editdate') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date,'re','','',0,"editdate"); + print ''; + print '
'; + } + else + { + if ($object->date) + { + print dol_print_date($object->date,'daytext'); + } + else + { + print ' '; + } + } + print '
'; + print ''; + if ($action != 'editecheance' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('DateEndPropal'); + print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; + print '
'; + if (! empty($object->brouillon) && $action == 'editecheance') + { + print '
'; + print ''; + print ''; + $form->select_date($object->fin_validite,'ech','','','',"editecheance"); + print ''; + print '
'; + } + else + { + if (! empty($object->fin_validite)) + { + print dol_print_date($object->fin_validite,'daytext'); + if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + } + else + { + print ' '; + } + } + print '
'; + print ''; + if ($action != 'editconditions' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('PaymentConditionsShort'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'),1).'
'; + print '
'; + if ($action == 'editconditions') + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); + } + else + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); + } + print '
'; + print ''; + if ($action != 'editdate_livraison' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('DeliveryDate'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'),1).'
'; + print '
'; + if ($action == 'editdate_livraison') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date_livraison,'liv_','','','',"editdate_livraison"); + print ''; + print '
'; + } + else + { + print dol_print_date($object->date_livraison,'daytext'); + } + print '
'; + print ''; + if ($action != 'editavailability' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('AvailabilityPeriod'); + if (! empty($conf->commande->enabled)) print ' ('.$langs->trans('AfterOrder').')'; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'),1).'
'; + print '
'; + if ($action == 'editavailability') + { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); + } + else + { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1); + } + + print '
'; + print ''; + if ($action != 'editdemandreason' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('Source'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'),1).'
'; + print '
'; + //print $object->demand_reason_id; + if ($action == 'editdemandreason') + { + $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); + } + else + { + $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none'); + } + + print '
'; + print ''; + if ($action != 'editmode' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('PaymentMode'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'),1).'
'; + print '
'; + if ($action == 'editmode') + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); + } + else + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); + } + print '
'; + print ''; + if ($user->rights->propal->creer) + { + if ($action != 'classify') print ''; + print '
'; + print $langs->trans('Project').''.img_edit($langs->transnoentitiesnoconv('SetProject')).'
'; + print '
'; + if ($action == 'classify') + { + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); + } + else + { + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); + } + print '
'; + if (! empty($object->fk_project)) + { + print ''; + $proj = new Project($db); + $proj->fetch($object->fk_project); + print ''; + print $proj->ref; + print ''; + print ''; + } + else { + print ' '; + } + } + print ''; + } + + // Other attributes + $res=$object->fetch_optionals($object->id,$extralabels); + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + + if ($action == 'edit_extras') + { + print '
'; + print ''; + print ''; + print ''; + } + + + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print ''."\n"; + } + } + + if(count($extrafields->attribute_label) > 0) { + + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print ''; + print ''; + print ''; + print ''; + + } + else { + if ($object->statut == 0 && $user->rights->propal->creer) + { + print ''.img_picto('','edit').' '.$langs->trans('Modify').''; + } + } + } + } + + // Amount HT + print ''.$langs->trans('AmountHT').''; + print ''.price($object->total_ht).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Margin Infos + if (! empty($conf->margin->enabled)) { + print ''; + $object->displayMarginInfos(); + print ''; + } + print ''; + + // Amount VAT + print ''.$langs->trans('AmountVAT').''; + print ''.price($object->total_tva).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Amount Local Taxes + if ($mysoc->localtax1_assuj=="1") //Localtax1 + { + print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; + print ''.price($object->total_localtax1).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 + { + print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; + print ''.price($object->total_localtax2).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + + + // Amount TTC + print ''.$langs->trans('AmountTTC').''; + print ''.price($object->total_ttc).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Statut + print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; + + print '
'; + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $blocname = 'contacts'; + $title = $langs->trans('ContactsAddresses'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $blocname = 'notes'; + $title = $langs->trans('Notes'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + /* + * Lines + */ + + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) + { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + } + + print ''; + + // Show object lines + $result = $object->getLinesArray(); + if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid); + + // Form to add new line + if ($object->statut == 0 && $user->rights->propal->creer) + { + if ($action != 'editline') + { + $var=true; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + // Add free or predefined products/services + $object->formAddObjectLine(0,$mysoc,$soc); + } + else + { + // Add free products/services + $object->formAddFreeProduct(0,$mysoc,$soc); + + // Add predefined products/services + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $var=!$var; + $object->formAddPredefinedProduct(0,$mysoc,$soc); + } + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + } + + print '
'; + + print ''; + print "\n"; + + if ($action == 'statut') + { + /* + * Formulaire cloture (signe ou non) + */ + $form_close = '
'; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans("CloseAs").''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans('Note').'
'; + $form_close.= ''; + $form_close.= '   '; + $form_close.= ' '; + $form_close.= '
'; + + print $form_close; + } + + + /* + * Boutons Actions + */ + if ($action != 'presend') + { + print '
'; + + if ($action != 'statut' && $action <> 'editline') + { + // Validate + if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) + { + if (count($object->lines) > 0) print ''.$langs->trans('Validate').''; + //else print ''.$langs->trans('Validate').''; + } + + // Edit + if ($object->statut == 1 && $user->rights->propal->creer) + { + print ''.$langs->trans('Modify').''; + } + + // ReOpen + if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) + { + print 'global->MAIN_JUMP_TAG)?'':'#reopen').'"'; + print '>'.$langs->trans('ReOpen').''; + } + + // Send + if ($object->statut == 1 || $object->statut == 2) + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) + { + print ''.$langs->trans('SendByMail').''; + } + else print ''.$langs->trans('SendByMail').''; + } + + // Create an order + if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) + { + if ($user->rights->commande->creer) + { + print ''.$langs->trans("AddOrder").''; + } + } + + // Create contract + if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) + { + $langs->load("contracts"); + + if ($user->rights->contrat->creer) + { + print ''.$langs->trans('AddContract').''; + } + } + + // Create an invoice and classify billed + if ($object->statut == 2 && $user->societe_id == 0) + { + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) + { + print ''.$langs->trans("AddBill").''; + } + + $arraypropal=$object->getInvoiceArrayList(); + if (is_array($arraypropal) && count($arraypropal) > 0) + { + print 'socid.'">'.$langs->trans("ClassifyBilled").''; + } + } + + // Close + if ($object->statut == 1 && $user->rights->propal->cloturer) + { + print 'global->MAIN_JUMP_TAG)?'':'#close').'"'; + print '>'.$langs->trans('Close').''; + } + + // Clone + if ($user->rights->propal->creer) + { + print ''.$langs->trans("ToClone").''; + } + + // Delete + if ($user->rights->propal->supprimer) + { + print ''.$langs->trans('Delete').''; + } + + } + + print '
'; + print "
\n"; + } + + if ($action != 'presend') + { + print '
'; + print ''; // ancre + + + /* + * Documents generes + */ + $filename=dol_sanitizeFileName($object->ref); + $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed=$user->rights->propal->creer; + $delallowed=$user->rights->propal->supprimer; + + $var=true; + + $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang); + + + /* + * Linked object block + */ + $somethingshown=$object->showLinkedObjectBlock(); + + print ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'propal',$socid); + + print '
'; + } + + + /* + * Action presend + * + */ + if ($action == 'presend') + { + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); + $file=$fileparams['fullname']; + + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); + $file=$fileparams['fullname']; + } + + print '
'; + print_titre($langs->trans('SendPropalByMail')); + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; $liste=array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; - $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; - $formmail->withtocc=$liste; - $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - - // Tableau des substitutions - $formmail->substit['__PROPREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - // Tableau des parametres complementaires - $formmail->param['action']='send'; - $formmail->param['models']='propal_send'; - $formmail->param['id']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - - $formmail->show_form(); - - print '
'; - } -} - -// End of page -llxFooter(); -$db->close(); -?> + $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; + $formmail->withtocc=$liste; + $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + + // Tableau des substitutions + $formmail->substit['__PROPREF__']=$object->ref; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + // Tableau des parametres complementaires + $formmail->param['action']='send'; + $formmail->param['models']='propal_send'; + $formmail->param['id']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } + + $formmail->show_form(); + + print '
'; + } +} + +// End of page +llxFooter(); +$db->close(); +?> diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d005396d829..398f30dd100 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -649,14 +649,16 @@ class Contrat extends CommonObject // Insert contract $sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,"; $sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,"; - $sql.= " ref, entity)"; + $sql.= " ref, entity, note, note_public)"; $sql.= " VALUES (".$this->db->idate($now).",".$this->socid.",".$user->id; $sql.= ",".$this->db->idate($this->date_contrat); $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); $sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL"); - $sql.= ",".($this->fk_projet>0?$this->fk_projet:"NULL"); + $sql.= ",".($this->fk_project>0?$this->fk_project:"NULL"); $sql.= ", ".(dol_strlen($this->ref)<=0 ? "null" : "'".$this->ref."'"); $sql.= ", ".$conf->entity; + $sql.= ", ".(!empty($this->note)?("'".$this->db->escape($this->note)."'"):"NULL"); + $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); $sql.= ")"; $resql=$this->db->query($sql); if ($resql) @@ -694,6 +696,12 @@ class Contrat extends CommonObject if (! $error) { + // Add linked object + if (! $error && $this->origin && $this->origin_id) + { + $ret = $this->add_object_linked(); + if (! $ret) dol_print_error($this->db); + } $this->db->commit(); return $this->id; } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index ac56afab3ca..902dde79f17 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -176,27 +176,158 @@ if ($action == 'add' && $user->rights->contrat->creer) if (! $error) { - $object->socid = $socid; + $object->socid = $socid; $object->date_contrat = $datecontrat; $object->commercial_suivi_id = GETPOST('commercial_suivi_id','int'); $object->commercial_signature_id = GETPOST('commercial_signature_id','int'); $object->note = GETPOST('note','alpha'); + $object->note_public = GETPOST('note_public','alpha'); $object->fk_project = GETPOST('projectid','int'); $object->remise_percent = GETPOST('remise_percent','alpha'); $object->ref = GETPOST('ref','alpha'); - $result = $object->create($user,$langs,$conf); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - $mesg='
'.$object->error.'
'; - } - $action='create'; + // If creation from another object of another module (Example: origin=propal, originid=1) + if ($_POST['origin'] && $_POST['originid']) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $_POST['origin']; + if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } + + // For compatibility + if ($element == 'order') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + + $object->origin = $_POST['origin']; + $object->origin_id = $_POST['originid']; + + // Possibility to add external linked objects with hooks + $object->linked_objects[$object->origin] = $object->origin_id; + if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) + { + $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); + } + + $id = $object->create($user); + if ($id < 0) { + $mesg='
'.$object->error.'
'; + } + + if ($id > 0) + { + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + + $classname = ucfirst($subelement); + $srcobject = new $classname($db); + + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); + $result=$srcobject->fetch($object->origin_id); + if ($result > 0) + { + $srcobject->fetch_thirdparty(); + $lines = $srcobject->lines; + if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); + + $fk_parent_line=0; + $num=count($lines); + + for ($i=0;$i<$num;$i++) + { + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + + if ($product_type == 1) { //only services + // service prédéfini + if ($lines[$i]->fk_product > 0) + { + $product_static = new Product($db); + + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $prod = new Product($db, $lines[$i]->fk_product); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$srcobject->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; + } + else + { + $label = $lines[$i]->product_label; + } + + if ($conf->global->PRODUIT_DESC_IN_FORM) + $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; + } + else { + $desc = dol_htmlentitiesbr($lines[$i]->desc); + } + + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start =0, + $date_end =0, + 'HT', + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht + ); + + if ($result < 0) + { + $error++; + break; + } + + } + } + + } + else + { + $mesg=$srcobject->error; + $error++; + } + } + else + { + $mesg=$object->error; + $error++; + } + } + else + { + $result = $object->create($user,$langs,$conf); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + $mesg='
'.$object->error.'
'; + } + $action='create'; + } } } @@ -622,6 +753,51 @@ if ($action == 'create') $soc = new Societe($db); if ($socid>0) $soc->fetch($socid); + if (GETPOST('origin') && GETPOST('originid')) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = GETPOST('origin'); + if (preg_match('/^([^_]+)_([^_]+)/i',GETPOST('origin'),$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } + + if ($element == 'project') + { + $projectid=GETPOST('originid'); + } + else + { + // For compatibility + if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + + $classname = ucfirst($subelement); + $objectsrc = new $classname($db); + $objectsrc->fetch(GETPOST('originid')); + if (empty($objectsrc->lines) && method_exists($objectsrc,'fetch_lines')) $objectsrc->fetch_lines(); + $objectsrc->fetch_thirdparty(); + + $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); + + $soc = $objectsrc->client; + + $note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : '')); + $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); + + // Object source contacts list + $srccontactslist = $objectsrc->liste_contact(-1,'external',1); + } + } + else { + $projectid = GETPOST('projectid','int'); + $note_private = GETPOST("note"); + $note_public = GETPOST("note_public"); + } + $object->date_contrat = dol_now(); $numct = $object->getNextNumRef($soc); @@ -687,18 +863,18 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) { print ''.$langs->trans("Project").''; - select_projects($soc->id,GETPOST("projectid"),"projectid"); + select_projects($soc->id,$projectid,"projectid"); print ""; } print ''.$langs->trans("NotePublic").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note_public', GETPOST('note_public'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); + $doleditor=new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); /* print ''; */ @@ -706,11 +882,11 @@ if ($action == 'create') { print ''.$langs->trans("NotePrivate").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note', GETPOST('note'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); + $doleditor=new DolEditor('note', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); /* print '';*/ print ''; } @@ -721,6 +897,12 @@ if ($action == 'create') print "\n"; + if (is_object($objectsrc)) + { + print ''; + print ''; + } + print '
'; print "\n"; From bf912e2c781ddbc1f2ac2a6d2e6b980506831d02 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2013 15:19:31 +0100 Subject: [PATCH 057/150] Fix: Some bug into supplier pdf invoice setup. --- htdocs/admin/supplier_invoice.php | 6 +++--- .../pdf/pdf_canelle.modules.php | 1 + htdocs/theme/amarok/style.css.php | 19 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index f28e3d1a244..079d0c5c915 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier @@ -24,7 +24,7 @@ /** * \file htdocs/admin/supplier_invoice.php * \ingroup fournisseur - * \brief Page d'administration-configuration du module Fournisseur + * \brief Setup to admin supplier invoices */ require '../main.inc.php'; @@ -241,7 +241,7 @@ foreach ($dirmodels as $reldir) while (($file = readdir($handle))!==false) { - if (substr($file, 0, 25) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file)-3, 3) == 'php') + if (substr($file, 0, 24) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file)-3, 3) == 'php') { $file = substr($file, 0, dol_strlen($file)-4); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 2ed53db1e46..b0c49293a78 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -93,6 +93,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Get source company if (! is_object($object->thirdparty)) $object->fetch_thirdparty(); + if (! is_object($object->thirdparty)) $object->thirdparty=$mysoc; // If fetch_thirdparty fails, object has no socid (specimen) $this->emetteur=$object->thirdparty; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 44c08732d13..3607c8c4edd 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1137,21 +1137,21 @@ tr.fiche { .ok { color:#159e26; - background:url() left center no-repeat; + background:url() left center no-repeat !important; padding-left:20px; font-weight:bold; } .warning { color:#bca936; - background:url() left center no-repeat; + background:url() left center no-repeat !important; padding-left:20px; font-weight:bold; } .error { color:#a61111; - background:url() left center no-repeat; + background:#f58080 url() left center no-repeat !important; padding-left:20px; font-weight:bold; } @@ -1159,17 +1159,16 @@ tr.fiche { td.highlights {background:#f9c5c6;} div.ok { - background:#61e372 url() 3px center no-repeat; - color:#ffffff; + background:#61e372; /* url() 3px center no-repeat; */ + /*color:#ffffff;*/ padding:2px 4px 2px 24px; margin:0.5em 0em; - border:1px solid #159e26; font-weight:normal; } div.warning, div.info { - background:#fcf5b8 url() 3px center no-repeat; - color:#232323; + background:#fcf5b8; /* url() 3px center no-repeat; */ + /*color:#232323; */ padding:2px 4px 2px 24px; margin:0.5em 0em; border:1px solid #bca936; @@ -1177,8 +1176,8 @@ div.warning, div.info { } div.error { - background:#f58080 url() 3px center no-repeat; - color:#ffffff; + background:#f58080; /* url() 3px center no-repeat; */ + /* color:#ffffff; */ padding:2px 4px 2px 24px; margin:0.5em 0em; border:1px solid #a61111; From 199bbe90a8130e0fe880e5cf823e7f6ab995e285 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Mar 2013 15:28:40 +0100 Subject: [PATCH 058/150] Add missing style --- htdocs/theme/amarok/style.css.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 3607c8c4edd..cb7d355ef9a 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -494,6 +494,8 @@ div.vmenu { text-align:center; } +a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:px; font-family: ; text-align: ; font-weight: normal; color: #666666; } + /* ============================================================================== */ /* Panes for Main */ From 5c87a4ff5685cd7fe01e97c92fb525c5d9016e04 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Tue, 19 Mar 2013 17:20:54 +0100 Subject: [PATCH 059/150] standardize and simplify code and enhance display --- htdocs/admin/commande.php | 99 ++++++++++++++------------------------- 1 file changed, 36 insertions(+), 63 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 7dda6ded0e4..2a225234af6 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -66,7 +66,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -111,74 +111,36 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='order'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - if ($db->query($sql)) - { - - } + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $type='order'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$db->escape($value)."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - - if ($db->query($sql)) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent $conf->global->COMMANDE_ADDON_PDF = $value; } // On active le modele - $type='order'; - - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - dol_syslog("Delete from model table ".$sql_del); - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$value."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$scandir."'":"null"); - $sql.= ")"; - dol_syslog("Insert into model table ".$sql); - $result2=$db->query($sql); - if ($result1 && $result2) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { - $db->commit(); - } - else - { - dol_syslog("Error ".$db->lasterror(), LOG_ERR); - $db->rollback(); + $ret = addDocumentModel($value, $type, $label, $scandir); } } @@ -240,10 +202,18 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup'); print '
'; +$h = 0; +$head[$h][0] = DOL_URL_ROOT."/admin/commande.php"; +$head[$h][1] = $langs->trans("Orders"); +$head[$h][2] = 'Order'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* - * Numbering module + * Orders Numbering model */ print_titre($langs->trans("OrdersNumberingModules")); @@ -276,22 +246,22 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file)-4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print ''.$module->nom."\n"; print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -508,11 +478,14 @@ foreach ($dirmodels as $reldir) } print ''; - -//Autres Options print "
"; -print_titre($langs->trans("OtherOptions")); +/* + * Other options + * + */ + +print_titre($langs->trans("OtherOptions")); print ''; print ''; print ''; From fa21a1d5de34d3e2a3412bedfbf2239b1b6f9587 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Tue, 19 Mar 2013 18:56:39 +0100 Subject: [PATCH 060/150] Update fiche.php vrong url to fiche project --- htdocs/comm/action/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index c7ac95111b1..07a6647f4bb 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -575,7 +575,7 @@ if ($action == 'create') $numproject=select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); if ($numproject==0) { - print '   '.$langs->trans("AddProject").''; + print '   '.$langs->trans("AddProject").''; } print ''; } From a76594c296c39c2744d35fe43ad10f8753a27317 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Tue, 19 Mar 2013 19:57:42 +0100 Subject: [PATCH 061/150] standardize and simplify code and enhance display --- htdocs/admin/fichinter.php | 123 +++++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 52 deletions(-) diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 708acf6bc86..023593ea2a7 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -67,42 +67,7 @@ if ($action == 'updateMask') } } -if ($action == 'set_FICHINTER_FREE_TEXT') -{ - $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'set_FICHINTER_DRAFT_WATERMARK') -{ - $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); - - $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'specimen') +else if ($action == 'specimen') // For fiche inter { $modele= GETPOST('module','alpha'); @@ -147,12 +112,13 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -161,7 +127,8 @@ if ($action == 'del') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { @@ -178,7 +145,7 @@ if ($action == 'setdoc') } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -186,6 +153,41 @@ if ($action == 'setmod') dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity); } +else if ($action == 'set_FICHINTER_FREE_TEXT') +{ + $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha'); + $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + +else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') +{ + $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); + + $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + /* * View @@ -202,6 +204,17 @@ print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup'); print "
"; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/fichinter.php"; +$head[$h][1] = $langs->trans("Interventions"); +$head[$h][2] = 'Ficheinter'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +// Interventions numbering model print_titre($langs->trans("FicheinterNumberingModules")); @@ -234,22 +247,22 @@ foreach ($dirmodels as $reldir) $file = $reg[1]; $classname = substr($file,4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/fichinter/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print '
'; - // Show example of numbering module + // Show example of numbering model print '
'.$langs->trans("Parameter").'
'.$module->nom."\n"; print $module->info(); print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -295,6 +308,9 @@ foreach ($dirmodels as $reldir) print '

'; +/* + * Documents models for Interventions + */ print_titre($langs->trans("TemplatePDFInterventions")); @@ -377,7 +393,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ""; if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { @@ -413,11 +429,14 @@ foreach ($dirmodels as $reldir) } print ''; - -//Autres Options print "
"; -print_titre($langs->trans("OtherOptions")); +/* + * Other options + * + */ + +print_titre($langs->trans("OtherOptions")); print ''; print ''; print ''; From c7666cbc3d8d9538726a8ad111ad14276bcb6653 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 20 Mar 2013 09:30:13 +0100 Subject: [PATCH 062/150] fix getting buying price when creating automatically an order from a proposal (with first option activated in workflow module) --- htdocs/commande/class/commande.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 481b51400a5..cfc88e161e2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -914,6 +914,12 @@ class Commande extends CommonOrder $line->special_code = $object->lines[$i]->special_code; $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->fk_fournprice = $object->lines[$i]->fk_fournprice; + $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); + $line->pa_ht = $marginInfos[0]; + $line->marge_tx = $marginInfos[1]; + $line->marque_tx = $marginInfos[2]; + $this->lines[$i] = $line; } From a635f88992ee060f448b5628b5af1c20d359eb6e Mon Sep 17 00:00:00 2001 From: eldy Date: Wed, 20 Mar 2013 11:08:54 +0100 Subject: [PATCH 063/150] Look: Minir fix --- htdocs/theme/amarok/style.css.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 3607c8c4edd..53b5bc114a7 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -120,6 +120,9 @@ a:hover, a:active { color:rgba(0,0,0,.6); } +input, input.flat, textarea, textarea.flat, form.flat select, select.flat { + padding: 1px; +} input, textarea { font-size:px; font-family:; @@ -810,7 +813,7 @@ td.vmenu { } div.fiche { - padding:8px 12px 10px; + padding:8px 6px 10px; margin-: browser->phone) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'16':'24'; ?>px; margin-: browser->phone)?'12':'6'; ?>px; } @@ -1138,21 +1141,21 @@ tr.fiche { .ok { color:#159e26; background:url() left center no-repeat !important; - padding-left:20px; + padding-left:20px !important; font-weight:bold; } .warning { color:#bca936; background:url() left center no-repeat !important; - padding-left:20px; + padding-left:20px !important; font-weight:bold; } .error { color:#a61111; background:#f58080 url() left center no-repeat !important; - padding-left:20px; + padding-left:20px !important; font-weight:bold; } @@ -1161,7 +1164,7 @@ td.highlights {background:#f9c5c6;} div.ok { background:#61e372; /* url() 3px center no-repeat; */ /*color:#ffffff;*/ - padding:2px 4px 2px 24px; + padding:2px 4px 2px 6px; margin:0.5em 0em; font-weight:normal; } @@ -1169,7 +1172,7 @@ div.ok { div.warning, div.info { background:#fcf5b8; /* url() 3px center no-repeat; */ /*color:#232323; */ - padding:2px 4px 2px 24px; + padding:2px 4px 2px 6px; margin:0.5em 0em; border:1px solid #bca936; font-weight:normal; @@ -1178,7 +1181,7 @@ div.warning, div.info { div.error { background:#f58080; /* url() 3px center no-repeat; */ /* color:#ffffff; */ - padding:2px 4px 2px 24px; + padding:2px 4px 2px 6px; margin:0.5em 0em; border:1px solid #a61111; font-weight:normal; From df28716e2781e57da33dde4377442d51b8f8135d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Mar 2013 14:22:28 +0100 Subject: [PATCH 064/150] Show date of subscript + date of creation of subscription (may differ) --- htdocs/adherents/card_subscriptions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 25767e8f5b2..bde482799fe 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -660,6 +660,7 @@ if ($rowid) { $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,"; $sql.= " c.rowid as crowid, c.cotisation,"; + $sql.= " c.datec,"; $sql.= " c.dateadh,"; $sql.= " c.datef,"; $sql.= " c.fk_bank,"; @@ -683,7 +684,8 @@ if ($rowid) print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; if (! empty($conf->banque->enabled)) @@ -701,6 +703,7 @@ if ($rowid) $cotisationstatic->ref=$objp->crowid; $cotisationstatic->id=$objp->crowid; print ''; + print '\n"; print '\n"; print '\n"; print ''; @@ -1029,4 +1032,4 @@ else llxFooter(); $db->close(); -?> +?> \ No newline at end of file From a326995c37704551e35790a0f362c5a368242c77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Mar 2013 14:29:26 +0100 Subject: [PATCH 065/150] New: Add info when option ADHERENT_VAT_FOR_SUBSCRIPTIONS is off. --- htdocs/adherents/card_subscriptions.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index bde482799fe..279669497ec 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -902,16 +902,18 @@ if ($rowid) // Title payments //print ''; - // Define a way to write payment + // No more action print ''; print ''; From 257f6da8f4a01a112b0165851649e04879db9dd6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Mar 2013 20:34:30 +0100 Subject: [PATCH 066/150] New: Add field to make accountancy dispatch module easier to build. Must match module customer invoice. --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 4 ++++ htdocs/install/mysql/tables/llx_facture_fourn_det.sql | 2 ++ 2 files changed, 6 insertions(+) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index a01458780a6..e446a50a33a 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -155,3 +155,7 @@ ALTER TABLE llx_holiday ADD COLUMN note_public text; -- Add new trigger on Invoice BILL_UNVALIDATE + Index INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang) + + +ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_code_ventilation integer DEFAULT 0 NOT NULL; +ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_export_compta integer DEFAULT 0 NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql index 16dacbbb336..25432793ef0 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql @@ -43,5 +43,7 @@ create table llx_facture_fourn_det product_type integer DEFAULT 0, date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service + fk_code_ventilation integer DEFAULT 0 NOT NULL, + fk_export_compta integer DEFAULT 0 NOT NULL, import_key varchar(14) )ENGINE=innodb; From a2763df9e739d1a9262b4ad0b58ed50b9c49dbd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Mar 2013 21:41:16 +0100 Subject: [PATCH 067/150] Qual: Start to clean the simple accountancy moule. --- .../facture/class/facture-rec.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 22 ++++++++----------- .../compta/ventilation/fournisseur/index.php | 8 +++---- htdocs/compta/ventilation/lignes.php | 6 ++--- htdocs/compta/ventilation/liste.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 8 +------ .../install/mysql/migration/3.3.0-3.4.0.sql | 2 +- .../mysql/tables/llx_facture_fourn_det.sql | 1 - .../install/mysql/tables/llx_facturedet.sql | 1 - htdocs/install/mysql/tables/llx_paiement.sql | 9 ++------ htdocs/langs/en_US/admin.lang | 2 +- htdocs/langs/en_US/compta.lang | 4 +++- htdocs/langs/fr_FR/admin.lang | 2 +- htdocs/langs/fr_FR/compta.lang | 2 ++ 14 files changed, 28 insertions(+), 42 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index b41fa735e7c..4e168d0645f 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -336,7 +336,6 @@ class FactureRec extends Facture $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; $line->total_ttc = $objp->total_ttc; - $line->export_compta = $objp->fk_export_compta; $line->code_ventilation = $objp->fk_code_ventilation; $line->rang = $objp->rang; $line->special_code = $objp->special_code; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ace5e15312c..f3427ee5d4b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -455,7 +455,7 @@ class Facture extends CommonInvoice } } else if ($reshook < 0) $error++; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); @@ -866,7 +866,7 @@ class Facture extends CommonInvoice $this->extraparams = (array) json_decode($obj->extraparams, true); if ($this->statut == 0) $this->brouillon = 1; - + // Retreive all extrafield for invoice // fetch optionals attributes and labels if(!class_exists('Extrafields')) @@ -925,7 +925,7 @@ class Facture extends CommonInvoice $sql.= ' l.localtax1_tx, l.localtax2_tx, l.remise, l.remise_percent, l.fk_remise_except, l.subprice,'; $sql.= ' l.rang, l.special_code,'; $sql.= ' l.date_start as date_start, l.date_end as date_end,'; - $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_export_compta, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; + $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; @@ -970,7 +970,6 @@ class Facture extends CommonInvoice $line->total_localtax1 = $objp->total_localtax1; $line->total_localtax2 = $objp->total_localtax2; $line->total_ttc = $objp->total_ttc; - $line->export_compta = $objp->fk_export_compta; $line->code_ventilation = $objp->fk_code_ventilation; $line->fk_fournprice = $objp->fk_fournprice; $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); @@ -1860,7 +1859,7 @@ class Facture extends CommonInvoice } } } - + if ($error == 0) { $old_statut=$this->statut; @@ -1870,8 +1869,8 @@ class Facture extends CommonInvoice include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('BILL_UNVALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; + if ($result < 0) { + $error++; $this->errors=$interface->errors; $this->statut=$old_statut; $this->brouillon=0; @@ -1881,7 +1880,7 @@ class Facture extends CommonInvoice $this->db->rollback(); return -1; } - + if ($error == 0) { $this->db->commit(); @@ -3196,7 +3195,6 @@ class FactureLigne var $total_ttc; var $fk_code_ventilation = 0; - var $fk_export_compta = 0; var $date_start; var $date_end; @@ -3237,7 +3235,7 @@ class FactureLigne $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,'; $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; $sql.= ' fd.info_bits, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; - $sql.= ' fd.fk_code_ventilation, fd.fk_export_compta,'; + $sql.= ' fd.fk_code_ventilation,'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid'; @@ -3271,7 +3269,6 @@ class FactureLigne $this->total_localtax2 = $objp->total_localtax2; $this->total_ttc = $objp->total_ttc; $this->fk_code_ventilation = $objp->fk_code_ventilation; - $this->fk_export_compta = $objp->fk_export_compta; $this->rang = $objp->rang; $this->fk_fournprice = $objp->fk_fournprice; $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); @@ -3338,7 +3335,7 @@ class FactureLigne $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; $sql.= ' (fk_facture, fk_parent_line, label, description, qty, tva_tx, localtax1_tx, localtax2_tx,'; $sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,'; - $sql.= ' date_start, date_end, fk_code_ventilation, fk_export_compta, '; + $sql.= ' date_start, date_end, fk_code_ventilation, '; $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; $sql.= " VALUES (".$this->fk_facture.","; @@ -3357,7 +3354,6 @@ class FactureLigne $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; $sql.= ' '.$this->fk_code_ventilation.','; - $sql.= ' '.$this->fk_export_compta.','; $sql.= ' '.$this->rang.','; $sql.= ' '.$this->special_code.','; $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; diff --git a/htdocs/compta/ventilation/fournisseur/index.php b/htdocs/compta/ventilation/fournisseur/index.php index c10bb23a056..636891e7c18 100644 --- a/htdocs/compta/ventilation/fournisseur/index.php +++ b/htdocs/compta/ventilation/fournisseur/index.php @@ -39,7 +39,7 @@ print '"; } - // Defaut + // Default print ""; print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { +// if ($conf->global->MAIN_FEATURES_LEVEL > 1) +// { //Desc $var=!$var; print ''; - } +// } print '
'.$langs->trans("Parameter").'
'.$langs->trans("Ref").''.$langs->trans("DateSubscription").''.$langs->trans("DateCreation").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$cotisationstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->datec),'dayhour')."'.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).'
'.$langs->trans("Payment").'
'.$langs->trans('MoreActions'); print ''; print ' '.$langs->trans("None").'
'; + // Add entry into bank accoun if (! empty($conf->banque->enabled)) { print ' '.$langs->trans("MoreActionBankDirect").'
'; } + // Add invoice with no payments if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print ' '.$langs->trans("MoreActionInvoiceOnly"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else - { + { print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; print $langs->trans("CreateDolibarrThirdParty"); print ')'; } + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0).'.'; print '
'; } + // Add invoice with payments if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print ' '.$langs->trans("MoreActionBankViaInvoice"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else - { + { print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; print $langs->trans("CreateDolibarrThirdParty"); print ')'; } + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0).'.'; print '
'; } print '
'; $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) { @@ -50,7 +50,7 @@ if ($result) } $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) @@ -62,7 +62,7 @@ if ($result) } $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facture_fourn_det"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) { @@ -73,7 +73,7 @@ if ($result) } /*$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiementfourn"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index e5cf6bc8edd..c938e9774c4 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -48,7 +48,7 @@ if ($page < 0) $page = 0; $limit = $conf->liste_limit; $offset = $limit * $page ; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero,"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total_ttc as price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; @@ -72,7 +72,7 @@ if ($result) $num_lignes = $db->num_rows($result); $i = 0; - print_barre_liste("Lignes de facture ventil�es",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); + print_barre_liste($langs->trans("InvoiceDispatched"),$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); print '
'; print ''; @@ -136,7 +136,7 @@ else print "
"; -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php index 70679d3a381..81613640541 100644 --- a/htdocs/compta/ventilation/liste.php +++ b/htdocs/compta/ventilation/liste.php @@ -54,7 +54,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $limit = $conf->liste_limit; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.rowid, l.fk_code_ventilation,"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total as price, l.rowid, l.fk_code_ventilation,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " , ".MAIN_DB_PREFIX."facturedet as l"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7e459f07f20..9dee5c7bee6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -799,17 +799,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Compta simple - if (! empty($conf->comptabilite->enabled) && ! empty($conf->global->FACTURE_VENTILATION)) + if (! empty($conf->comptabilite->enabled) && ($conf->global->MAIN_FEATURES_LEVEL >= 2)) { $newmenu->add("/compta/ventilation/index.php?leftmenu=ventil",$langs->trans("Dispatch"),0,$user->rights->compta->ventilation->lire, '', $mainmenu, 'ventil'); if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/liste.php",$langs->trans("ToDispatch"),1,$user->rights->compta->ventilation->lire); if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/lignes.php",$langs->trans("Dispatched"),1,$user->rights->compta->ventilation->lire); - if ($leftmenu=="ventil") $newmenu->add("/compta/param/",$langs->trans("Setup"),1,$user->rights->compta->ventilation->parametrer); - if ($leftmenu=="ventil") $newmenu->add("/compta/param/comptes/fiche.php?action=create",$langs->trans("New"),2,$user->rights->compta->ventilation->parametrer); - if ($leftmenu=="ventil") $newmenu->add("/compta/param/comptes/liste.php",$langs->trans("List"),2,$user->rights->compta->ventilation->parametrer); - if ($leftmenu=="ventil") $newmenu->add("/compta/export/",$langs->trans("Export"),1,$user->rights->compta->ventilation->lire); - if ($leftmenu=="ventil") $newmenu->add("/compta/export/index.php?action=export",$langs->trans("New"),2,$user->rights->compta->ventilation->lire); - if ($leftmenu=="ventil") $newmenu->add("/compta/export/liste.php",$langs->trans("List"),2,$user->rights->compta->ventilation->lire); } // Compta expert diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index e446a50a33a..b83741231f2 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -158,4 +158,4 @@ ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang) ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_code_ventilation integer DEFAULT 0 NOT NULL; -ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_export_compta integer DEFAULT 0 NOT NULL; +ALTER TABLE llx_facturedet DROP COLUMN fk_export_compta; diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql index 25432793ef0..325950a4e46 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql @@ -44,6 +44,5 @@ create table llx_facture_fourn_det date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service fk_code_ventilation integer DEFAULT 0 NOT NULL, - fk_export_compta integer DEFAULT 0 NOT NULL, import_key varchar(14) )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index 847178d8330..949dee1933c 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -51,7 +51,6 @@ create table llx_facturedet buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT fk_product_fournisseur_price integer DEFAULT NULL, -- reference prix fournisseur fk_code_ventilation integer DEFAULT 0 NOT NULL, - fk_export_compta integer DEFAULT 0 NOT NULL, special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales rang integer DEFAULT 0, -- ordre d'affichage import_key varchar(14) diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index 6787aee87fd..00680f29d69 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -18,10 +18,6 @@ -- -- =================================================================== - --- Satut, 0 ou 1, 1 n'est plus supprimable --- fk_export_compta 0 pas exporte - create table llx_paiement ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -36,7 +32,6 @@ create table llx_paiement fk_bank integer NOT NULL DEFAULT 0, fk_user_creat integer, -- utilisateur qui a cree l'info fk_user_modif integer, -- utilisateur qui a modifie l'info - statut smallint DEFAULT 0 NOT NULL, - fk_export_compta integer DEFAULT 0 NOT NULL - + statut smallint DEFAULT 0 NOT NULL, -- Satut, 0 ou 1, 1 n'est plus supprimable + fk_export_compta integer DEFAULT 0 NOT NULL -- fk_export_compta 0 pas exporte )ENGINE=innodb; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5e632efbe1e..671a00ddf16 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -369,7 +369,7 @@ Module1Desc=Companies and contact management (customers, prospects...) Module2Name=Commercial Module2Desc=Commercial management Module10Name=Accounting -Module10Desc=Simple accounting management (invoice and payment dispatching) +Module10Desc=Simple accounting reports (journals, turnover) based onto database content. No dispatching. Module20Name=Proposals Module20Desc=Commercial proposal management Module22Name=Mass E-mailings diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c38ccd07d68..538b4f1784a 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -149,4 +149,6 @@ WarningDepositsNotIncluded=Deposits invoices are not included in this version wi DatePaymentTermCantBeLowerThanObjectDate=Payment term date can't be lower than object date. Pcg_version=Pcg version Pcg_type=Pcg type -Pcg_subtype=Pcg subtype \ No newline at end of file +Pcg_subtype=Pcg subtype +InvoiceLinesToDispatch=Invoice lines to dispatch +InvoiceDispatched=Dispatched invoices \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3834defebc8..095e1a63dc6 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -368,7 +368,7 @@ Module1Desc= Gestion des tiers (sociétés, particuliers) et contacts Module2Name= Commercial Module2Desc= Gestion commerciale Module10Name= Comptabilité -Module10Desc= Gestion simpliste de comptabilité (ventilation de factures et paiements uniquement) +Module10Desc= Activation de rapports simplistes de comptabilité (ca, journaux) basé sur la base. Pas de ventilation. Module20Name= Propositions commerciales Module20Desc= Gestion des devis/propositions commerciales Module22Name= EMailings diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 01ba085620b..12ea0024f63 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -161,3 +161,5 @@ DatePaymentTermCantBeLowerThanObjectDate=La date limite de règlement ne peut ê Pcg_version=Version du plan Pcg_type=Classe de compte Pcg_subtype=Sous classe de compte +InvoiceLinesToDispatch=Lignes de factures à ventiler +InvoiceDispatched=Factures ventilées \ No newline at end of file From cb237774696facb4a11052df27fba3f282eed131 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Wed, 20 Mar 2013 22:21:22 +0100 Subject: [PATCH 068/150] fix sql error --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index b83741231f2..9684651832c 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -154,7 +154,7 @@ ALTER TABLE llx_holiday ADD COLUMN note_public text; -- Add new trigger on Invoice BILL_UNVALIDATE + Index INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); -ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang) +ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang); ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_code_ventilation integer DEFAULT 0 NOT NULL; From a3ad06134a1868fc5f4599b2ea6c0a1ddb64166c Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Wed, 20 Mar 2013 22:34:53 +0100 Subject: [PATCH 069/150] display enhancement and standardize --- htdocs/admin/prelevement.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index f5dfb2bc8fb..2e21c3cfb4c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -117,6 +117,17 @@ llxHeader('',$langs->trans("WithdrawalsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("WithdrawalsSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/prelevement.php"; +$head[$h][1] = $langs->trans("Withdrawals"); +$head[$h][2] = 'Withdrawal'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); print '
'; print ''; From 40c889955b0d84d057e5adeb867b9e2ca07a2422 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 21 Mar 2013 08:22:24 +0100 Subject: [PATCH 070/150] display enhancement and standardize --- htdocs/admin/project.php | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 8ea4910541c..f2f216d7b52 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010 Regis Houssin * Copyright (C) 2011 Laurent Destailleur * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -66,7 +66,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -111,12 +111,13 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -125,7 +126,8 @@ if ($action == 'del') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { @@ -142,7 +144,7 @@ if ($action == 'setdoc') } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -156,7 +158,7 @@ if ($action == 'setmod') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); -llxHeader(); +llxHeader("",$langs->trans("ProjectsSetup")); $form=new Form($db); @@ -165,8 +167,20 @@ print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup'); print "
"; +$h = 0; -// Project numbering module +$head[$h][0] = DOL_URL_ROOT."/admin/project.php"; +$head[$h][1] = $langs->trans("Projects"); +$head[$h][2] = 'Project'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +/* + * Projects Numbering model + */ + print_titre($langs->trans("ProjectsNumberingModules")); print ''; @@ -198,7 +212,7 @@ foreach ($dirmodels as $reldir) $file = $reg[1]; $classname = substr($file,4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; @@ -213,7 +227,7 @@ foreach ($dirmodels as $reldir) print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print '
'; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -269,7 +283,7 @@ print '

'; /* - * Modeles documents for projects + * Document templates generators */ print_titre($langs->trans("ProjectsModelModule")); @@ -352,7 +366,7 @@ foreach ($dirmodels as $reldir) print "
"; if ($conf->global->PROJECT_ADDON_PDF == "$name") { From c389d75edecf7296b1ffa713f8387614f18a5e1b Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 21 Mar 2013 08:39:17 +0100 Subject: [PATCH 071/150] display enhancement and standardize --- htdocs/admin/contract.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 80e1547b33f..5e32dd097d0 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,5 +1,6 @@ + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -27,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $langs->load("admin"); $langs->load("errors"); +$langs->load("contracts"); if (!$user->admin) accessforbidden(); @@ -88,6 +90,20 @@ print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup'); print "
"; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/contract.php"; +$head[$h][1] = $langs->trans("Contracts"); +$head[$h][2] = 'Contract'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +/* + * Contracts Numbering model + */ + print_titre($langs->trans("ContractsNumberingModules")); print ''; @@ -129,7 +145,7 @@ if (is_resource($handle)) print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { +// if ($conf->global->MAIN_FEATURES_LEVEL > 1) +// { //Desc $var=!$var; print ''; - } +// } print '
'; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } From 5192794aabe2199bc297bb8826d5ac62fd2f7be2 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 21 Mar 2013 08:47:45 +0100 Subject: [PATCH 072/150] display enhancement and standardize --- htdocs/admin/compta.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index e45a316858f..a5213413d54 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -2,7 +2,8 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -35,6 +36,10 @@ accessforbidden(); $action = GETPOST('action','alpha'); +/* + * Actions + */ + $compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES'; if ($action == 'setcomptamode') @@ -87,7 +92,7 @@ if ($action == 'update' || $action == 'add') }*/ /* - * Affichage page + * View */ llxHeader(); @@ -97,9 +102,18 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans('ComptaSetup'),$linkback,'setup'); - print '
'; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/compta.php"; +$head[$h][1] = $langs->trans("Compta"); +$head[$h][2] = 'Compta'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + print ''; // Cas du parametre COMPTA_MODE From 45d9d525a444c5b3198f2cda9ec58e0436774700 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 21 Mar 2013 09:22:26 +0100 Subject: [PATCH 073/150] display enhancement and standardize --- htdocs/admin/dons.php | 88 ++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index 21c2b3a1a59..2e62048e329 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -47,7 +48,7 @@ if ($action == 'specimen') $don = new Don($db); $don->initAsSpecimen(); - // Charge le modele + // Search template files $dir = DOL_DOCUMENT_ROOT . "/core/modules/dons/"; $file = $modele.".modules.php"; if (file_exists($dir.$file)) @@ -75,67 +76,39 @@ if ($action == 'specimen') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $value = GETPOST('value','alpha'); - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); + if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->COMMANDE_ADDON_PDF = $value; + } - if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity)) - { - $conf->global->DON_ADDON_MODEL = $value; - } - - // On active le modele - $type='donation'; - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."' AND type = '".$type."'"; - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $result2=$db->query($sql); - if ($result1 && $result2) - { - $db->commit(); - } - else - { - $db->rollback(); - } + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $value = GETPOST('value','alpha'); - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='donation'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $resql=$db->query($sql); + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $value = GETPOST('value','alpha'); - - $type='donation'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql .= " WHERE nom = '".$value."' AND type = '".$type."'"; - $resql=$db->query($sql); + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); + } } - /* * View */ @@ -147,6 +120,17 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration'); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/dons.php"; +$head[$h][1] = $langs->trans("Donations"); +$head[$h][2] = 'Donation'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); // Document templates From 3e8ebb953daf95594b272652a4b45e19a3a1b6d8 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Thu, 21 Mar 2013 13:38:38 +0100 Subject: [PATCH 074/150] fix :constant error --- htdocs/admin/dons.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index 2e62048e329..0176436c928 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -79,11 +79,11 @@ if ($action == 'specimen') // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent - $conf->global->COMMANDE_ADDON_PDF = $value; + $conf->global->DON_ADDON_MODEL = $value; } // On active le modele @@ -105,7 +105,7 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); + if ($conf->global->DON_ADDON_MODEL == "$value") dolibarr_del_const($db, 'DON_ADDON_MODEL',$conf->entity); } } From 4949d74267fcd3c2dc979fa22c6a9c46318c2876 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Mar 2013 00:02:25 +0100 Subject: [PATCH 075/150] New: Add a tab "consumption" on thirdparties to list products bought/sells. (i implement list for customer invoices and supplier orders, need someone to finish work for customer orders and supplier invoices) --- ChangeLog | 1 + htdocs/compta/recap-compta.php | 23 ++- htdocs/core/lib/company.lib.php | 5 + htdocs/langs/ar_SA/main.lang | 2 - htdocs/langs/en_US/companies.lang | 1 + htdocs/langs/en_US/main.lang | 2 +- htdocs/langs/fr_FR/companies.lang | 1 + htdocs/langs/fr_FR/main.lang | 2 +- htdocs/societe/consumption.php | 318 ++++++++++++++++++++++++++++++ 9 files changed, 344 insertions(+), 11 deletions(-) create mode 100644 htdocs/societe/consumption.php diff --git a/ChangeLog b/ChangeLog index f7eedaf2369..66e4a8cfd89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3 ***** For users: +- New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Some performance enhancements. - New: Can attach files onto trip and expenses modules. - New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR. diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 553262a3b4b..bc89cf7de7e 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -43,6 +43,8 @@ if ($user->societe_id > 0) * View */ +$userstatic=new User($db); + llxHeader(); if ($socid > 0) @@ -135,7 +137,7 @@ if ($socid > 0) $var=!$var; print "
"; - print "\n"; + print "\n"; print '\n"; print ''; @@ -146,8 +148,12 @@ if ($socid > 0) print ''; print '\n"; - // Auteur - print ''; + // Author + $userstatic->id=$objf->userid; + $userstatic->login=$objf->login; + print ''; print "\n"; @@ -172,7 +178,7 @@ if ($socid > 0) $objp = $db->fetch_object($resqlp); //$var=!$var; print ""; - print '\n"; + print '\n"; print ''; @@ -182,8 +188,12 @@ if ($socid > 0) $solde = $solde - $objp->amount; print '\n"; - // Auteur - print ''; + // Author + $userstatic->id=$objp->userid; + $userstatic->login=$objp->login; + print ''; print ''; @@ -214,5 +224,4 @@ else llxFooter(); $db->close(); - ?> diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 8ba3a161712..f06e8027e5f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -90,6 +90,11 @@ function societe_prepare_head($object) $head[$h][2] = 'note'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Referers"); + $head[$h][2] = 'consumption'; + $h++; + // Attached files $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); diff --git a/htdocs/langs/ar_SA/main.lang b/htdocs/langs/ar_SA/main.lang index 5befea18b77..f273f913d04 100644 --- a/htdocs/langs/ar_SA/main.lang +++ b/htdocs/langs/ar_SA/main.lang @@ -428,8 +428,6 @@ NbOfThirdParties=عدد من الأطراف الثالثة NbOfCustomers=عدد من العملاء NbOfLines=عدد الخطوط NbOfObjects=عدد الأجسام -NbOfReferers=عدد referers -Referers=Referers TotalQuantity=الكمية الإجمالية DateFromTo=ل٪ من ق ق ٪ DateFrom=من ق ٪ diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 1ce5db6ccd4..0ae15edba41 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -392,6 +392,7 @@ UniqueThirdParties=Total of unique third parties InActivity=Open ActivityCeased=Closed ActivityStateFilter=Activity status +ProductsIntoElements=List of products into # Monkey MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0b82960dab2..99a60857e3d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -487,7 +487,7 @@ NbOfCustomers=Number of customers NbOfLines=Number of lines NbOfObjects=Number of objects NbOfReferers=Number of referrers -Referers=Referrers +Referers=Consumption TotalQuantity=Total quantity DateFromTo=From %s to %s DateFrom=From %s diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 254d1e8af16..99612d8ec2d 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -394,6 +394,7 @@ UniqueThirdParties=Total de tiers uniques InActivity=En activité ActivityCeased=Clos ActivityStateFilter=Statut d'activité +ProductsIntoElements=Liste des produits dans les %s # Monkey MonkeyNumRefModelDesc=Renvoie le numéro sous la forme %syymm-nnnn pour les codes clients et %syymm-nnnn pour les codes fournisseurs où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0. diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index a7093fd8b75..b31b711f3a3 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -490,7 +490,7 @@ NbOfCustomers=Nombre de clients NbOfLines=Nombre de lignes NbOfObjects=Nombre d'objets NbOfReferers=Nombre de références -Referers=Référents +Referers=Consommation TotalQuantity=Quantité totale DateFromTo=Du %s au %s DateFrom=A partir du %s diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php new file mode 100644 index 00000000000..733b8ee84ce --- /dev/null +++ b/htdocs/societe/consumption.php @@ -0,0 +1,318 @@ + + * Copyright (C) 2004-2012 Laurent Destailleur + * + * Version V1.1 Initial version of Philippe Berthet + * Version V2 Change to be compatible with 3.4 and enhanced to be more generic + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/societe/consumption.php + * \ingroup societe + * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + */ + +require("../main.inc.php"); +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + +// Security check +$socid = GETPOST('socid','int'); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'societe', $socid, '&societe'); +$object = new Societe($db); +if ($socid > 0) $object->fetch($socid); + +// Sort & Order fields +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { + $page = 0; +} +$offset = $conf->liste_limit * $page; +if (! $sortorder) $sortorder='DESC'; +if (! $sortfield) $sortfield='datePrint'; +$limit = $conf->liste_limit; + +// Search fields +$sref=GETPOST("sref"); +$sprod_fulldescr=GETPOST("sprod_fulldescr"); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); + +// Clean up on purge search criteria ? +if (GETPOST("button_removefilter")) +{ + $sref=''; + $sprod_fulldescr=''; + $year=''; + $month=''; +} +// Customer or supplier selected in drop box +$thirdTypeSelect = GETPOST("third_select_id"); +$type_element = GETPOST('type_element')?GETPOST('type_element'):'invoice'; + +$langs->load("bills"); +$langs->load("orders"); +$langs->load("suppliers"); + + +/* + * Actions + */ + + + +/* + * View + */ + +$form = new Form($db); +$formother = new FormOther($db); +$productstatic=new Product($db); + +$titre = $langs->trans("Referer",$object->name); +llxHeader('',$titre,''); + +if (empty($socid)) +{ + dol_print_error($db); + exit; +} + +$head = societe_prepare_head($object); +dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company'); + +print ''; +print ''; +print ''; + +print '
".dol_print_date($fac->date)."".dol_print_date($fac->date,'day')."'.img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."'.$fac->getLibStatut(2,$totalpaye).' '.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objf->login.''; + print $userstatic->getLoginUrl(1); + print '
'.dol_print_date($db->jdate($objp->dp))."'.dol_print_date($db->jdate($objp->dp),'day')."'; print '      '; // Decalage print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.''.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.''; + print $userstatic->getLoginUrl(1); + print '
'; +print ''; +print ''; + +if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field +{ + print ''; +} + +if ($object->client) +{ + print ''; + $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."facture where fk_soc = ".$socid; + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); + + $obj = $db->fetch_object($resql); + $nbFactsClient = $obj->nb; + $thirdTypeArray['customer']=$langs->trans("customer"); + if ($conf->facture->enabled) $elementTypeArray['invoice']=$langs->trans('Invoices'); + if ($conf->commande->enabled) $elementTypeArray['order']=$langs->trans('Orders'); +} + +if ($object->fournisseur) +{ + print ''; + $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."commande_fournisseur where fk_soc = ".$socid; + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); + + $obj = $db->fetch_object($resql); + $nbCmdsFourn = $obj->nb; + $thirdTypeArray['supplier']=$langs->trans("supplier"); + if ($conf->fournisseur->enabled) $elementTypeArray['supplier_invoice']=$langs->trans('SuppliersInvoices'); + if ($conf->fournisseur->enabled) $elementTypeArray['supplier_order']=$langs->trans('SuppliersOrders'); +} +print '
'.$langs->trans('ThirdPartyName').''; +print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); +print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; + print $langs->trans('CustomerCode').''; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; + print '
'; + print $langs->trans('SupplierCode').''; + print $object->code_fournisseur; + if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; + print '
'; + +dol_fiche_end(); +print '
'; + + +$sql_select=''; +if ($type_element == 'invoice') +{ // Customer : show products from invoices +$documentstatic=new Facture($db); +$sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as datePrint, '; +$tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; +$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; +$where.= " AND d.fk_facture = f.rowid"; +$where.= " AND f.entity = ".$conf->entity; +$datePrint = 'f.datef'; +$doc_number='f.facnumber'; +$thirdTypeSelect='customer'; +} +if ($type_element == 'order') +{ + // TODO + +} +if ($type_element == 'supplier_order') +{ // Supplier : Show products from orders. +$documentstatic=new CommandeFournisseur($db); +$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, "1" as doc_type, c.date_valid as datePrint, '; +$tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d"; +$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; +$where.= " AND d.fk_commande = c.rowid"; +$datePrint = 'c.date_creation'; +$doc_number='c.ref'; +$thirdTypeSelect='supplier'; +} +if ($type_element == 'supplier_invoice') +{ + // TODO + +} + +$sql = $sql_select; +$sql.= ' d.fk_product as product_id, d.description as prod_descr, '; +$sql.= ' d.qty as prod_qty, p.rowid as prod_id, p.fk_product_type as prod_type,'; +$sql.= " s.rowid as socid, p.ref as prod_ref, p.label as prod_label"; +$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".$tables_from; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; +$sql.= $where; +if ($month > 0) { + if ($year > 0) { + $start = dol_mktime(0, 0, 0, $month, 1, $year); + $end = dol_time_plus_duree($start, 1 , 'm') - 1; + $sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; + } else { + $sql.= " AND date_format(".$datePrint.", '%m') = '".sprintf('%02d',$month)."'"; + } +} else if ($year > 0) { + $start = dol_mktime(0, 0, 0, 1, 1, $year); + $end = dol_time_plus_duree($start, 1 , 'y') - 1; + $sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; +} +if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'"; +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit + 1, $offset); + + +// Define type of elements +$typeElementString = $form->selectarray("type_element",$elementTypeArray,GETPOST('type_element')); +$button = ''; +$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid; + +print_barre_liste($langs->trans('ProductsIntoElements', $typeElementString.' '.$button), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); + +if ($sql_select) +{ + dol_syslog("sql=".$sql); + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); +} + +print ''."\n"; +// Titles with sort buttons +print ''; +print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'datePrint','',$param,'align="center" width="150"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); +// Filters +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +if ($sql_select) +{ + $var=true; + $num = $db->num_rows($resql); + $i = 0; + while (($objp = $db->fetch_object($resql)) && $i < $conf->liste_limit ) + { + $var=!$var; + print ""; + print ''; + print ''; + $prodreftxt=''; + if(!empty($objp->prod_id)) { + $productstatic->id = $objp->prod_id; + $productstatic->ref = $objp->prod_ref; + $productstatic->status = $objp->prod_type; + $prodreftxt = $productstatic->getNomUrl(0); + if(!empty($objp->prod_label)) $prodreftxt .= ' - '.$objp->prod_label; + } + if(!empty($objp->prod_descr)) { + if(!empty($prodreftxt)) { + $prodreftxt .= '
'.$objp->prod_descr; + } else { + $prodreftxt .= $objp->prod_descr; + } + } + print ''; + print ''; + print "\n"; + $i++; + } + if ($num > $conf->liste_limit) { + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); + } + $db->free($resql); +} +else { + print ''; +} + +print "
'; +print ''; +print ''; // date +print $formother->select_month($month?$month:-1,'month',1); +$formother->select_year($year?$year:-1,'year',1, 20, 1); +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; + $documentstatic->id=$objp->doc_id; + $documentstatic->ref=$objp->doc_number; + $documentstatic->type=$objp->type; + print $documentstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->datePrint),'day').''.$prodreftxt.''.$objp->prod_qty.'
'.$langs->trans("FeatureNotYetAvailable").'
"; +print ""; + + +/* + * Errors + */ + +dol_htmloutput_errors($warning); +dol_htmloutput_errors($error,$errors); + +llxFooter(); + +$db->close(); +?> From 1730d9e2b766f025a0841a2e11bd50b95a8d72c4 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 09:30:04 +0100 Subject: [PATCH 076/150] display enhancement and normalize --- htdocs/admin/ecm.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 908b36dbabb..45a142d8190 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -70,6 +70,17 @@ llxHeader('',$langs->trans("ECMSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("ECMSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/ecm.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); print ''; print ''; From b44d5de58e4793fd4a6cee56317e5ab6725d902c Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 09:38:48 +0100 Subject: [PATCH 077/150] display enhancement and normalize --- htdocs/admin/taxes.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index bf5e0db26a6..8e547bd4e21 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -121,6 +121,17 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans('TaxSetup'),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/taxes.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); print '
'; From 945c511a5b73195ee64e5b9478e616a016631b3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Mar 2013 10:27:36 +0100 Subject: [PATCH 078/150] Qual: Clean code --- htdocs/core/class/commonobject.class.php | 27 ++--- htdocs/core/tpl/objectline_view.tpl.php | 90 +++++++------- htdocs/societe/consumption.php | 145 +++++++++++++++++++++-- 3 files changed, 192 insertions(+), 70 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 26b8a0c5826..9058350747f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2141,7 +2141,7 @@ abstract class CommonObject $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field of attribut if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate - $sql.=",".$attributeKey; + $sql.=",".$attributeKey; } $sql .= ") VALUES (".$this->id; foreach($this->array_options as $key => $value) @@ -2695,7 +2695,8 @@ abstract class CommonObject global $form,$bc,$bcdd; $element=$this->element; - $text=''; + + $text=''; $description=''; $type=0; // Show product and description $type=(! empty($line->product_type)?$line->product_type:$line->fk_product_type); @@ -2703,27 +2704,25 @@ abstract class CommonObject if (! empty($line->date_start)) $type=1; // deprecated if (! empty($line->date_end)) $type=1; // deprecated - if ($line->fk_product > 0) - { - $product_static = new Product($this->db); - - $product_static->type=$line->fk_product_type; - $product_static->id=$line->fk_product; - $product_static->ref=$line->ref; - $text=$product_static->getNomUrl(1); - } - // Ligne en mode visu if ($action != 'editline' || $selected != $line->id) { - // Produit + // Product if ($line->fk_product > 0) { - // Define output language + $product_static = new Product($this->db); + + $product_static->type=$line->fk_product_type; + $product_static->id=$line->fk_product; + $product_static->ref=$line->ref; + $text=$product_static->getNomUrl(1); + + // Define output language (TODO Does this works ?) if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $this->fetch_thirdparty(); $prod = new Product($this->db); + $prod->fetch($line->fk_product); $outputlangs = $langs; $newlang=''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index abaef7a1910..051f4f98071 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * + * To use this template, the following var must be defined + * $type, $text, $description, $line */ ?> @@ -38,59 +40,59 @@ description) { - if ($line->description == '(CREDIT_NOTE)') - { - $discount=new DiscountAbsolute($this->db); - $discount->fetch($line->fk_remise_except); - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); - } - elseif ($line->description == '(DEPOSIT)') - { - $discount=new DiscountAbsolute($this->db); - $discount->fetch($line->fk_remise_except); - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); - // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; - } - else - { - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); - } + if ($line->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($line->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + elseif ($line->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($line->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); } } - else - { - if ($line->fk_product > 0) { + } + else + { + if ($line->fk_product > 0) { - echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); + echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); - // Show range - print_date_range($line->date_start, $line->date_end); + // Show range + echo get_date_range($line->date_start, $line->date_end); - // Add description in form - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) - { - print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; - } + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; + } + } else { + + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + + if (! empty($line->label)) { + $text.= ' '.$line->label.''; + echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); } else { - - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); - if ($type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - - if (! empty($line->label)) { - $text.= ' '.$line->label.''; - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); - } else { - echo $text.' '.dol_htmlentitiesbr($line->description); - } - - // Show range - print_date_range($line->date_start,$line->date_end); + echo $text.' '.dol_htmlentitiesbr($line->description); } + + // Show range + echo get_date_range($line->date_start,$line->date_end); } - ?> + } + ?>
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 733b8ee84ce..4f61d24a4aa 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -193,9 +193,9 @@ if ($type_element == 'supplier_invoice') } $sql = $sql_select; -$sql.= ' d.fk_product as product_id, d.description as prod_descr, '; -$sql.= ' d.qty as prod_qty, p.rowid as prod_id, p.fk_product_type as prod_type,'; -$sql.= " s.rowid as socid, p.ref as prod_ref, p.label as prod_label"; +$sql.= ' d.fk_product as product_id, d.fk_product as fk_product, d.label, d.description as description, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty,'; +$sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type,'; +$sql.= " s.rowid as socid, p.ref as prod_ref, p.label as product_label"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".$tables_from; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; $sql.= $where; @@ -272,23 +272,144 @@ if ($sql_select) print $documentstatic->getNomUrl(1); print ''; print ''; + + print ''; + */ + print ''; + + //print ''; + print ''; + print "\n"; $i++; } From e506601214223d59ef7279abeedf26370fa16a68 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 10:48:14 +0100 Subject: [PATCH 079/150] display enhancement and standardize --- htdocs/{compta/bank => }/admin/bank.php | 15 +++++++++++++-- htdocs/core/modules/modBanque.class.php | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) rename htdocs/{compta/bank => }/admin/bank.php (93%) diff --git a/htdocs/compta/bank/admin/bank.php b/htdocs/admin/bank.php similarity index 93% rename from htdocs/compta/bank/admin/bank.php rename to htdocs/admin/bank.php index a45fa29c912..98a08708dff 100644 --- a/htdocs/compta/bank/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,6 +1,7 @@ * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -18,12 +19,12 @@ /** - * \file htdocs/compta/bank/admin/bank.php + * \file htdocs/admin/bank.php * \ingroup bank * \brief Page to setup the bank module */ -require '../../../main.inc.php'; +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -87,6 +88,16 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("BankSetupModule"),$linkback,'setup'); print '
'; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/bank.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + print '
tva_tx,'%',$line->info_bits); ?>'.dol_print_date($db->jdate($objp->datePrint),'day').''; + + // Define text, description and type + $text=''; $description=''; $type=0; + + // Code to show product duplicated from commonobject->printObjectLine + if ($objp->fk_product > 0) + { + $product_static = new Product($db); + + $product_static->type=$objp->fk_product_type; + $product_static->id=$objp->fk_product; + $product_static->ref=$objp->ref; + $text=$product_static->getNomUrl(1); + } + + // Product + if ($objp->fk_product > 0) + { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $this->fetch_thirdparty(); + $prod = new Product($db); + $prod->fetch($objp->fk_product); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$this->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; + } + else + { + $label = $objp->product_label; + } + + $text.= ' - '.(! empty($objp->label)?$objp->label:$label); + $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description)); + } + + if (($objp->info_bits & 2) == 2) { ?> + + trans("ShowReduc"),'reduc').' '; + if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); + //else $txt=$langs->trans("Discount"); + print $txt; + ?> + + description) + { + if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description); + } + } + } + else + { + if ($objp->fk_product > 0) { + + echo $form->textwithtooltip($text,$description,3,'','',$i,0,''); + + // Show range + echo get_date_range($objp->date_start, $objp->date_end); + + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + + } else { + + //if (! empty($objp->fk_parent_line)) echo img_picto('', 'rightarrow'); + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + + if (! empty($objp->label)) { + $text.= ' '.$objp->label.''; + echo $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i,0,''); + } else { + echo $text.' '.dol_htmlentitiesbr($objp->description); + } + + // Show range + echo get_date_range($objp->date_start,$objp->date_end); + } + } + + /* $prodreftxt=''; - if(!empty($objp->prod_id)) { + if ($objp->prod_id > 0) + { $productstatic->id = $objp->prod_id; $productstatic->ref = $objp->prod_ref; $productstatic->status = $objp->prod_type; $prodreftxt = $productstatic->getNomUrl(0); - if(!empty($objp->prod_label)) $prodreftxt .= ' - '.$objp->prod_label; + if(!empty($objp->product_label)) $prodreftxt .= ' - '.$objp->product_label; } - if(!empty($objp->prod_descr)) { - if(!empty($prodreftxt)) { - $prodreftxt .= '
'.$objp->prod_descr; - } else { - $prodreftxt .= $objp->prod_descr; - } + // Show range + $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; } - print '
'.$prodreftxt.''.$prodreftxt.''.$objp->prod_qty.'
'; print ''; print ''; diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 1bae9f61129..832d96a194b 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -65,7 +65,7 @@ class modBanque extends DolibarrModules // Config pages //------------- - $this->config_page_url = array("bank.php@compta/bank"); + $this->config_page_url = array("bank.php"); // Dependancies $this->depends = array(); From 12f1d1b6dd87a392dfe292fe37114281cffcdf91 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 11:11:18 +0100 Subject: [PATCH 080/150] display enhancement and standardize --- htdocs/admin/stock.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 1f40461ca0f..ba28ea15635 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -3,6 +3,7 @@ * Copyright (C) 2008-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -97,6 +98,16 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("StockSetup"),$linkback,'setup'); print '
'; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/stock.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + $form=new Form($db); $var=true; print '
'.$langs->trans("Parameters").'
'; @@ -124,9 +135,12 @@ print '' print ''; print "\n"; print "\n"; - +print '
'; +print '
'; +print '
'; // Title rule for stock decrease +print ''; print ''; print " \n"; print " \n"; @@ -174,9 +188,11 @@ if (! empty($conf->expedition->enabled)) print ''; print "\n\n\n"; } - +print '
".$langs->trans("RuleForStockManagementDecrease")." 
'; +print '
'; // Title rule for stock increase +print ''; print ''; print " \n"; print " \n"; From 371c7194fa93fa419df40d871da21c5881c18ab7 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 11:15:52 +0100 Subject: [PATCH 081/150] display enhancement and standardize --- htdocs/admin/mailing.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index ea5c9b7bbb4..87252252d65 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -103,6 +103,16 @@ llxHeader('',$langs->trans("MailingSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("MailingSetup"),$linkback,'setup'); +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/mailing.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + dol_htmloutput_mesg($mesg); From 07940d719b6b0379f103d6effb9a46bf5d636616 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 13:00:26 +0100 Subject: [PATCH 082/150] fix error translation --- htdocs/langs/ar_SA/members.lang | 2 +- htdocs/langs/bg_BG/members.lang | 2 +- htdocs/langs/da_DK/members.lang | 2 +- htdocs/langs/el_GR/members.lang | 2 +- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/et_EE/members.lang | 2 +- htdocs/langs/fa_IR/members.lang | 2 +- htdocs/langs/fi_FI/members.lang | 2 +- htdocs/langs/he_IL/members.lang | 2 +- htdocs/langs/hu_HU/members.lang | 2 +- htdocs/langs/is_IS/members.lang | 2 +- htdocs/langs/it_IT/members.lang | 2 +- htdocs/langs/ja_JP/members.lang | 2 +- htdocs/langs/nb_NO/members.lang | 2 +- htdocs/langs/pl_PL/members.lang | 2 +- htdocs/langs/pt_PT/members.lang | 2 +- htdocs/langs/ro_RO/members.lang | 2 +- htdocs/langs/sv_SE/members.lang | 2 +- htdocs/langs/zh_TW/members.lang | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/langs/ar_SA/members.lang b/htdocs/langs/ar_SA/members.lang index 570dfab4069..6b16226f9e5 100644 --- a/htdocs/langs/ar_SA/members.lang +++ b/htdocs/langs/ar_SA/members.lang @@ -152,7 +152,7 @@ ShowTypeCard=وتبين من نوع '٪ ق' HTPasswordExport=الملف htpassword جيل NoThirdPartyAssociatedToMember=لم يرتبط بها من طرف ثالث لهذا العضو ThirdPartyDolibarr=Dolibarr طرف ثالث -MembersAndSubscriptions=وأعضاء Suscriptions +MembersAndSubscriptions=وأعضاء Subscriptions // Date 2009-08-11 13:27:01 // STOP - Lines generated via parser diff --git a/htdocs/langs/bg_BG/members.lang b/htdocs/langs/bg_BG/members.lang index c2fabf1da50..88d614bb1ad 100644 --- a/htdocs/langs/bg_BG/members.lang +++ b/htdocs/langs/bg_BG/members.lang @@ -163,7 +163,7 @@ ShowTypeCard=Покажи тип "%s" HTPasswordExport=htpassword файл поколение NoThirdPartyAssociatedToMember=Никоя трета страна, свързана с този потребител ThirdPartyDolibarr=Dolibarr трета страна -MembersAndSubscriptions=Членове и Suscriptions +MembersAndSubscriptions=Членове и Subscriptions MoreActions=Допълнително действие на запис MoreActionBankDirect=Създаване на директен запис на сделката по сметка MoreActionBankViaInvoice=Създаване на фактура и плащане по сметка diff --git a/htdocs/langs/da_DK/members.lang b/htdocs/langs/da_DK/members.lang index c2975ad715c..9492f48514a 100644 --- a/htdocs/langs/da_DK/members.lang +++ b/htdocs/langs/da_DK/members.lang @@ -161,7 +161,7 @@ MemberId=Medlem id PaymentSubscription=Nye bidrag betaling NoThirdPartyAssociatedToMember=Nr. tredjepart forbundet til dette medlem ThirdPartyDolibarr=Dolibarr tredjepart -MembersAndSubscriptions=Medlemmer og Suscriptions +MembersAndSubscriptions=Medlemmer og Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 20:39:59). diff --git a/htdocs/langs/el_GR/members.lang b/htdocs/langs/el_GR/members.lang index 8343aff155c..270e3cd1f1e 100644 --- a/htdocs/langs/el_GR/members.lang +++ b/htdocs/langs/el_GR/members.lang @@ -152,7 +152,7 @@ ShowTypeCard=Show type '%s' HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated to this member ThirdPartyDolibarr=Dolibarr third party -MembersAndSubscriptions= Members and Suscriptions +MembersAndSubscriptions= Members and Subscriptions MoreActions=Complementary action on recording MoreActionBankDirect=Create a direct transaction record on account MoreActionBankViaInvoice=Create an invoice and payment on account diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 77657563851..e1eda16c790 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -155,7 +155,7 @@ ShowTypeCard=Show type '%s' HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated to this member ThirdPartyDolibarr=Dolibarr third party -MembersAndSubscriptions= Members and Suscriptions +MembersAndSubscriptions= Members and Subscriptions MoreActions=Complementary action on recording MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription MoreActionBankDirect=Create a direct transaction record on account diff --git a/htdocs/langs/et_EE/members.lang b/htdocs/langs/et_EE/members.lang index b2d7eb1bc7a..ef7bcef6304 100644 --- a/htdocs/langs/et_EE/members.lang +++ b/htdocs/langs/et_EE/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=Näita tüüp "%s" HTPasswordExport=htpassword fail põlvkonna NoThirdPartyAssociatedToMember=Ükski kolmas isik on seotud selle liige ThirdPartyDolibarr=Dolibarr kolmanda osapoole -MembersAndSubscriptions=Liikmete ja Suscriptions +MembersAndSubscriptions=Liikmete ja Subscriptions MoreActions=Täiendav tegevus salvestus MoreActionBankDirect=Loo otseseid tehingukulusid rekord konto MoreActionBankViaInvoice=Loo arve ja ettemaks diff --git a/htdocs/langs/fa_IR/members.lang b/htdocs/langs/fa_IR/members.lang index e7ecd54bf5c..b0a46554eb6 100644 --- a/htdocs/langs/fa_IR/members.lang +++ b/htdocs/langs/fa_IR/members.lang @@ -152,7 +152,7 @@ ShowTypeCard=وتبين من نوع '٪ ق' HTPasswordExport=الملف htpassword جيل NoThirdPartyAssociatedToMember=لم يرتبط بها من طرف ثالث لهذا العضو ThirdPartyDolibarr=Dolibarr طرف ثالث -MembersAndSubscriptions=وأعضاء Suscriptions +MembersAndSubscriptions=وأعضاء Subscriptions // Date 2009-08-11 13:27:01 // STOP - Lines generated via parser diff --git a/htdocs/langs/fi_FI/members.lang b/htdocs/langs/fi_FI/members.lang index b4c5c52f2d4..cad773224bc 100644 --- a/htdocs/langs/fi_FI/members.lang +++ b/htdocs/langs/fi_FI/members.lang @@ -159,7 +159,7 @@ MemberId=Jäsen id PaymentSubscription=Uusi osuus maksu NoThirdPartyAssociatedToMember=Kolmansista osapuolista ei näihin jäsen ThirdPartyDolibarr=Dolibarr kolmannen osapuolen -MembersAndSubscriptions=Jäsenet ja Suscriptions +MembersAndSubscriptions=Jäsenet ja Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 20:45:19). diff --git a/htdocs/langs/he_IL/members.lang b/htdocs/langs/he_IL/members.lang index b8f1a2389d0..647559b284a 100644 --- a/htdocs/langs/he_IL/members.lang +++ b/htdocs/langs/he_IL/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=הצג מסוג "%s" HTPasswordExport=htpassword הדור הקובץ NoThirdPartyAssociatedToMember=אין צד שלישי הקשור משתמש זה ThirdPartyDolibarr=Dolibarr צד שלישי -MembersAndSubscriptions=משתמשים ו Suscriptions +MembersAndSubscriptions=משתמשים ו Subscriptions MoreActions=פעולה משלימה על ההקלטה MoreActionBankDirect=יצירת הרשומה העסקה ישירה על חשבון MoreActionBankViaInvoice=יצירת חשבונית התשלום על חשבון diff --git a/htdocs/langs/hu_HU/members.lang b/htdocs/langs/hu_HU/members.lang index a1baf95f0c6..ff2cbf8d7ec 100644 --- a/htdocs/langs/hu_HU/members.lang +++ b/htdocs/langs/hu_HU/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=Mutasd típusú "%s" HTPasswordExport=htpassword fájl létrehozása NoThirdPartyAssociatedToMember=Harmadik félnek nem társult a tag ThirdPartyDolibarr=Dolibarr harmadik fél -MembersAndSubscriptions=A tagok és Suscriptions +MembersAndSubscriptions=A tagok és Subscriptions MoreActions=Kiegészítő fellépés a felvételi MoreActionBankDirect=Hozzon létre egy közvetlen tranzakciós rekord miatt MoreActionBankViaInvoice=Hozzon létre egy számlát és előleg diff --git a/htdocs/langs/is_IS/members.lang b/htdocs/langs/is_IS/members.lang index d64fc0dbd55..20f211f24ef 100644 --- a/htdocs/langs/is_IS/members.lang +++ b/htdocs/langs/is_IS/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=Sýna tegund ' %s ' HTPasswordExport=htpassword skrá kynslóð NoThirdPartyAssociatedToMember=Engar þriðja aðila í tengslum við þennan ThirdPartyDolibarr=Dolibarr þriðja aðila -MembersAndSubscriptions=Aðilar og Suscriptions +MembersAndSubscriptions=Aðilar og Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-06-30 00:15:29). diff --git a/htdocs/langs/it_IT/members.lang b/htdocs/langs/it_IT/members.lang index 4000e50c514..e1645587088 100644 --- a/htdocs/langs/it_IT/members.lang +++ b/htdocs/langs/it_IT/members.lang @@ -88,7 +88,7 @@ MemberModifiedInDolibarr =Membri modificati su Dolibarr MEMBER_NEWFORM_PAYONLINE =Saltate sulla integrato pagina di pagamento online MemberNotOrNoMoreExpectedToSubscribe =Membri non iscritti o non più attesi per iscrizione MemberPublicLinks =Link/pagine pubbliche -MembersAndSubscriptions =Deputati e Suscriptions +MembersAndSubscriptions =Deputati e Subscriptions MembersArea =Sezione riservata membri MembersAttributes =Attributi dei membri MembersByCountryDesc =Questa schermata mostra le statistiche dei membri per paese. Il grafico dipende da servizi online di Google ed è disponibile solo se il server può connettersi ad internet. diff --git a/htdocs/langs/ja_JP/members.lang b/htdocs/langs/ja_JP/members.lang index 4fee5b42355..afc8a3f759b 100644 --- a/htdocs/langs/ja_JP/members.lang +++ b/htdocs/langs/ja_JP/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=タイプ "%s"を表示 HTPasswordExport=htpasswordファイルの生成 NoThirdPartyAssociatedToMember=このメンバに関連付けられているサードパーティません ThirdPartyDolibarr=Dolibarrサードパーティ -MembersAndSubscriptions=メンバーとSuscriptions +MembersAndSubscriptions=メンバーとSubscriptions MoreActions=記録上の相補的なアクション MoreActionBankDirect=アカウントに直接トランザクション·レコードを作成します。 MoreActionBankViaInvoice=アカウントの請求書と支払いを作成します。 diff --git a/htdocs/langs/nb_NO/members.lang b/htdocs/langs/nb_NO/members.lang index 471b4e735a9..62c8faf8822 100644 --- a/htdocs/langs/nb_NO/members.lang +++ b/htdocs/langs/nb_NO/members.lang @@ -29,7 +29,7 @@ DescADHERENT_CARD_TEXT_RIGHT=Tekst trykt på kort medlem (justere på høyre) DescADHERENT_MAILMAN_LISTS=Liste (er) for automatisk insription av nye medlemmer (separert med komma) NoThirdPartyAssociatedToMember=Ingen tredjepart knyttet til dette medlemmet ThirdPartyDolibarr=Dolibarr tredjepart -MembersAndSubscriptions=Medlemmer og Suscriptions +MembersAndSubscriptions=Medlemmer og Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-07-17 11:48:27). diff --git a/htdocs/langs/pl_PL/members.lang b/htdocs/langs/pl_PL/members.lang index 4782007adfd..0810e643b43 100644 --- a/htdocs/langs/pl_PL/members.lang +++ b/htdocs/langs/pl_PL/members.lang @@ -162,7 +162,7 @@ MemberId=Państwa id PaymentSubscription=Nowy wkład płatności NoThirdPartyAssociatedToMember=Nr trzeciej związane do tego członka ThirdPartyDolibarr=Dolibarr trzeciej -MembersAndSubscriptions=Członkowie i Suscriptions +MembersAndSubscriptions=Członkowie i Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:07:31). diff --git a/htdocs/langs/pt_PT/members.lang b/htdocs/langs/pt_PT/members.lang index 0c42a9c3295..d82002190b5 100644 --- a/htdocs/langs/pt_PT/members.lang +++ b/htdocs/langs/pt_PT/members.lang @@ -149,7 +149,7 @@ SetLinkToThirdParty=Link para uma Dolibarr terceiro SubscriptionId=Assinaturas id MemberId=Estados-id PaymentSubscription=Nova contribuição pagamento -MembersAndSubscriptions=Deputados e Suscriptions +MembersAndSubscriptions=Deputados e Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:10:10). diff --git a/htdocs/langs/ro_RO/members.lang b/htdocs/langs/ro_RO/members.lang index 067614c8b30..d14d60ab82b 100644 --- a/htdocs/langs/ro_RO/members.lang +++ b/htdocs/langs/ro_RO/members.lang @@ -160,7 +160,7 @@ MemberId=Statele id PaymentSubscription=New plata contribuţiei NoThirdPartyAssociatedToMember=Nu părţi terţe asociate la prezenta membru ThirdPartyDolibarr=Dolibarr terţă parte -MembersAndSubscriptions=Membrii şi Suscriptions +MembersAndSubscriptions=Membrii şi Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:12:07). diff --git a/htdocs/langs/sv_SE/members.lang b/htdocs/langs/sv_SE/members.lang index bf398731fe3..ded4d0542d6 100644 --- a/htdocs/langs/sv_SE/members.lang +++ b/htdocs/langs/sv_SE/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=Visa typ "%s" HTPasswordExport=htpassword fil generation NoThirdPartyAssociatedToMember=Ingen tredje part som är associerade till denna medlem ThirdPartyDolibarr=Dolibarr tredje part -MembersAndSubscriptions=Medlemmar och Suscriptions +MembersAndSubscriptions=Medlemmar och Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-08-27 08:51:26). diff --git a/htdocs/langs/zh_TW/members.lang b/htdocs/langs/zh_TW/members.lang index c08035af7a1..1b344cfd452 100644 --- a/htdocs/langs/zh_TW/members.lang +++ b/htdocs/langs/zh_TW/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=顯示類型'%s' HTPasswordExport=htpassword文件生成 NoThirdPartyAssociatedToMember=無關聯的第三方該會員 ThirdPartyDolibarr=Dolibarr第三者 -MembersAndSubscriptions=議員和Suscriptions +MembersAndSubscriptions=議員和Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-06-08 21:22:55). From 0215031632bfc0cbe3ced261463818f9aa434345 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 22 Mar 2013 14:45:20 +0100 Subject: [PATCH 083/150] [ task #122 ] Create a scheduled cron module --- htdocs/core/class/html.formcron.class.php | 93 +++ htdocs/core/lib/cron.lib.php | 70 ++ htdocs/core/modules/modCron.class.php | 102 ++- htdocs/cron/admin/cron.php | 139 ++-- htdocs/cron/card.php | 596 +++++++++++++++ htdocs/cron/class/cronjob.class.php | 696 ++++++++++++++++-- htdocs/cron/functions_cron.lib.php | 27 - htdocs/cron/index.php | 219 ------ htdocs/cron/info.php | 59 ++ htdocs/cron/list.php | 289 ++++++++ .../install/mysql/migration/3.3.0-3.4.0.sql | 33 + htdocs/install/mysql/tables/llx_cronjob.sql | 84 ++- htdocs/install/pgsql/functions/functions.sql | 1 + htdocs/langs/en_US/admin.lang | 4 + htdocs/langs/en_US/cron.lang | 90 ++- htdocs/langs/fr_FR/admin.lang | 4 + htdocs/langs/fr_FR/cron.lang | 96 ++- htdocs/public/cron/cron_run_jobs.php | 243 +++--- htdocs/theme/amarok/img/cron.png | Bin 0 -> 2165 bytes htdocs/theme/amarok/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/auguria/img/cron.png | Bin 0 -> 2165 bytes htdocs/theme/auguria/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/bureau2crea/img/cron.png | Bin 0 -> 2165 bytes htdocs/theme/bureau2crea/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/cameleo/img/cron.png | Bin 0 -> 2165 bytes htdocs/theme/cameleo/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/eldy/img/menus/cron.png | Bin 0 -> 2165 bytes htdocs/theme/eldy/img/menus/object_cron.png | Bin 0 -> 655 bytes scripts/cron/cron_run_jobs.php | 146 ++++ 29 files changed, 2432 insertions(+), 559 deletions(-) create mode 100644 htdocs/core/class/html.formcron.class.php create mode 100644 htdocs/core/lib/cron.lib.php create mode 100644 htdocs/cron/card.php delete mode 100644 htdocs/cron/functions_cron.lib.php delete mode 100644 htdocs/cron/index.php create mode 100644 htdocs/cron/info.php create mode 100644 htdocs/cron/list.php create mode 100644 htdocs/theme/amarok/img/cron.png create mode 100644 htdocs/theme/amarok/img/object_cron.png create mode 100644 htdocs/theme/auguria/img/cron.png create mode 100644 htdocs/theme/auguria/img/object_cron.png create mode 100644 htdocs/theme/bureau2crea/img/cron.png create mode 100644 htdocs/theme/bureau2crea/img/object_cron.png create mode 100644 htdocs/theme/cameleo/img/cron.png create mode 100644 htdocs/theme/cameleo/img/object_cron.png create mode 100644 htdocs/theme/eldy/img/menus/cron.png create mode 100644 htdocs/theme/eldy/img/menus/object_cron.png create mode 100644 scripts/cron/cron_run_jobs.php diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php new file mode 100644 index 00000000000..2acb83e3f05 --- /dev/null +++ b/htdocs/core/class/html.formcron.class.php @@ -0,0 +1,93 @@ + +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * \file cron/class/html.formcron.class.php +* \brief Fichier de la classe des fonctions predefinie de composants html cron +*/ + + +/** + * Class to manage building of HTML components +*/ +class FormCron extends Form +{ + var $db; + var $error; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + return 1; + } + + + /** + * Display On Off selector + * + * @param string $htmlname Html control name + * @param string $selected selected value + * @param string $readonly Select is read only or not + * @return string HTML select field + */ + function select_typejob($htmlname,$selected=0,$readonly=0) + { + global $langs; + + $langs->load('cron@cron'); + if (!empty($readonly)) { + if ($selected=='command') { + $out= $langs->trans('CronType_command'); + $out.=''; + } elseif ($selected=='method') { + $out= $langs->trans('CronType_method'); + $out.=''; + } + }else { + + $out=''; + } + + return $out; + } +} diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php new file mode 100644 index 00000000000..5d388c35a16 --- /dev/null +++ b/htdocs/core/lib/cron.lib.php @@ -0,0 +1,70 @@ +. + */ +/** + * \file htdocs/jobs/lib/jobs.lib.php + * \brief Ensemble de fonctions de base pour le module jobs + * \ingroup jobs + */ + +/** + * Return array of tabs to used on pages for third parties cards. + * + * @param Object $object Object company shown + * @return array Array of tabs + */ + +function cronadmin_prepare_head() +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath('/cron/admin/cron.php', 1); + $head[$h][1] = $langs->trans("CronSetup"); + $head[$h][2] = 'setup'; + $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cronadmin'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cronadmin', 'remove'); + + + return $head; +} + +function cron_prepare_head($object) +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath('/cron/cron/card.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("CronTask"); + $head[$h][2] = 'card'; + $h++; + + $head[$h][0] = dol_buildpath('/cron/cron/info.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("CronInfoPage"); + $head[$h][2] = 'info'; + $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cron'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cron', 'remove'); + + return $head; +} diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index fbc14945f02..2cf4e9cd9e4 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr + * Copyright (C) 2013 Florian Henry * * 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 @@ -16,11 +17,11 @@ */ /** - * \defgroup webservices Module webservices - * \brief Module to enable the Dolibarr server of web services - * \file htdocs/core/modules/modCron.class.php - * \ingroup cron - * \brief File to describe cron module + * \defgroup cron Module cron + * \brief cron module descriptor. + * \file cron/core/modules/modCron.class.php + * \ingroup cron + * \brief Description and activation file for module Jobs */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; @@ -46,7 +47,7 @@ class modCron extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the Dolibarr cron service"; - $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version + $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) @@ -59,7 +60,7 @@ class modCron extends DolibarrModules // Config pages //------------- - $this->config_page_url = array("cron.php@cron"); + $this->config_page_url = array("cron"); // Dependancies //------------- @@ -69,7 +70,16 @@ class modCron extends DolibarrModules // Constantes //----------- - $this->const = array(); + $this->const = array( + 0=>array( + 'MAIN_CRON_KEY', + 'chaine', + '', + 'CRON KEY', + 0, + 'main', + 0 + ),); // New pages on tabs // ----------------- @@ -79,11 +89,34 @@ class modCron extends DolibarrModules //------ $this->boxes = array(); - // Permissions - //------------ - $this->rights = array(); - $this->rights_class = 'cron'; - $r=0; + // Permissions + $this->rights = array(); // Permission array used by this module + $this->rights_class = 'cron'; + $r=0; + + $this->rights[$r][0] = 23001; + $this->rights[$r][1] = 'Read cron jobs'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'read'; + $r++; + + $this->rights[$r][0] = 23002; + $this->rights[$r][1] = 'Create cron Jobs'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'create'; + $r++; + + $this->rights[$r][0] = 23003; + $this->rights[$r][1] = 'Delete cron Jobs'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'delete'; + $r++; + + $this->rights[$r][0] = 23004; + $this->rights[$r][1] = 'Execute cron Jobs'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'execute'; + $r++; // Main menu entries $r=0; @@ -92,12 +125,49 @@ class modCron extends DolibarrModules 'titre'=>'CronJobs', 'url'=>'/cron/index.php', 'langs'=>'cron@cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, + 'position'=>100, + 'leftmenu'=>'cron', 'enabled'=>'$leftmenu==\'modulesadmintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; + + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', + 'type'=>'left', + 'titre'=>'CronListActive', + 'url'=>'/cron/cron/list.php?status=1', + 'langs'=>'cron@cron', + 'position'=>201, + 'enabled'=>'$user->rights->cron->read', + 'perms'=>'$user->rights->cron->read', + 'target'=>'', + 'user'=>2); + $r++; + + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', + 'type'=>'left', + 'titre'=>'CronListInactive', + 'url'=>'/cron/cron/list.php?status=0', + 'langs'=>'cron@cron', + 'position'=>201, + 'enabled'=>'$user->rights->cron->read', + 'perms'=>'$user->rights->cron->read', + 'target'=>'', + 'user'=>2); + $r++; + + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', + 'type'=>'left', + 'titre'=>'CronAdd', + 'url'=>'/cron/cron/card.php?action=create', + 'langs'=>'cron@cron', + 'position'=>202, + 'enabled'=>'$user->rights->cron->create', + 'perms'=>'$user->rights->cron->create', + 'target'=>'', + 'user'=>2); + $r++; } @@ -114,8 +184,6 @@ class modCron extends DolibarrModules // Prevent pb of modules not correctly disabled //$this->remove($options); - $sql = array(); - return $this->_init($sql,$options); } diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index fd77bcc6851..238208035f3 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -1,34 +1,36 @@ * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +* Copyright (C) 2011 Juanjo Menent +* Copyright (C) 2012 Regis Houssin +* Copyright (C) 2013 Florian Henry +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ /** - * \file htdocs/cron/admin/cron.php - * \ingroup cron - * \brief Page to setup cron module - */ + * \file cron/admin/cron.php +* \ingroup cron +*/ -require '../../main.inc.php'; +// Dolibarr environment +$res = @include("../../main.inc.php"); // From htdocs directory require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; -$langs->load("admin"); -$langs->load("cron"); +$langs->load("admin"); +$langs->load("cron"); if (! $user->admin) accessforbidden(); @@ -36,37 +38,40 @@ if (! $user->admin) $actionsave=GETPOST("save"); // Sauvegardes parametres -if ($actionsave) +if (!empty($actionsave)) { - $i=0; + $i=0; - $db->begin(); + $db->begin(); - $i+=dolibarr_set_const($db,'CRON_KEY',trim(GETPOST("CRON_KEY")),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'MAIN_CRON_KEY',trim(GETPOST("MAIN_CRON_KEY")),'chaine',0,'',0); - if ($i >= 1) - { - $db->commit(); - setEventMessage($langs->trans("SetupSaved")); - } - else - { - $db->rollback(); - setEventMessage($langs->trans("Error"), 'errors'); - } + if ($i >= 1) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"), 'errors'); + } } /* * View - */ +*/ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("CronSetup"),$linkback,'setup'); -print $langs->trans("CronDesc")."
\n"; +// Configuration header +$head = cronadmin_prepare_head(); +dol_fiche_head($head,'setup',$langs->trans("Module2300Name"),0,'cron'); + print "
\n"; print '
'; @@ -76,13 +81,12 @@ print '
".$langs->trans("RuleForStockManagementIncrease")." 
'; print ''; print ""; print ""; -//print ""; print ""; print ""; print ''; print ''; -print ''; @@ -102,12 +106,35 @@ print '

'; // Cron launch print ''.$langs->trans("URLToLaunchCronJobs").':
'; -$url=DOL_MAIN_URL_ROOT.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY); +$url=dol_buildpath('/cron/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login; print img_picto('','object_globe.png').' '.$url."
\n"; print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; -$url=DOL_MAIN_URL_ROOT.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'id=cronjobid'; -print img_picto('','object_globe.png').' '.$url."
\n"; +$url=dol_buildpath('/cron/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; +print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; +print '
'; + + +$linuxlike=1; +if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; + +if ($linuxlike) { + print $langs->trans("CronExplainHowToRunUnix"); +} else { + print $langs->trans("CronExplainHowToRunWin"); +} +print '
'; +print ''.$langs->trans("FileToLaunchCronJobs").':
'; +$file=dol_buildpath('/cron/script/cron/cron_run_jobs.php').' '.(empty($conf->global->MAIN_CRON_KEY)?'securitykey':''.$conf->global->MAIN_CRON_KEY.'').' '.$user->login.' cronjobid(optionnal)'; +if ($linuxlike) { + print 'user@host:'.DOL_DOCUMENT_ROOT.'$ php '.$file."
\n"; +} else { + print DOL_DOCUMENT_ROOT.'> php '.$file."
\n"; +} +print '
'; + + print '
'; @@ -116,20 +143,18 @@ if (! empty($conf->use_javascript_ajax)) { print "\n".''; } - llxFooter(); -$db->close(); -?> +$db->close(); \ No newline at end of file diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php new file mode 100644 index 00000000000..bd6ffb0e5c9 --- /dev/null +++ b/htdocs/cron/card.php @@ -0,0 +1,596 @@ + + * +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * \file cron/card.php + * \ingroup cron + * \brief Cron Jobs Card + */ + +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + +// librairie jobs +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/html.formcron.class.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; + + +$langs->load("admin"); +$langs->load("cron"); + +if (!$user->rights->cron->create) accessforbidden(); + +$id=GETPOST('id','int'); +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$cancel=GETPOST('cancel'); + +$object = new Cronjob($db); +if (!empty($id)) { + $result=$object->fetch($id); + if ($result < 0) { + setEventMessage($object->error,'errors'); + } +} + +if(!empty($cancel)) { + if (!empty($id)) { + $action=''; + }else { + Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1'); + } + +} + +// Delete jobs +if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete){ + + + $result = $object->delete($user); + + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + }else { + Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1'); + } +} + +// Execute jobs +if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute){ + + $result=$object->run_jobs($user->login); + + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action=''; + }else { + $action=''; + } + +} + + +if ($action=='add') { + + $object->jobtype=GETPOST('jobtype','alpha'); + $object->label=GETPOST('label','alpha'); + $object->command=GETPOST('command','alpha'); + $object->priority=GETPOST('priority','int'); + $object->classesname=GETPOST('classesname','alpha'); + $object->objectname=GETPOST('objectname','alpha'); + $object->methodename=GETPOST('methodename','alpha'); + $object->params=GETPOST('params'); + $object->md5params=GETPOST('md5params'); + $object->module_name=GETPOST('module_name','alpha'); + $object->note=GETPOST('note'); + $object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int')); + $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); + $object->unitfrequency=GETPOST('unitfrequency','int'); + $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int'); + + //Ajout de la tache cron + $result = $object->create($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='create'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + +// Save parameters +if ($action=='update') { + $object->id=$id; + $object->jobtype=GETPOST('jobtype','alpha'); + $object->label=GETPOST('label','alpha'); + $object->command=GETPOST('command','alpha'); + $object->classesname=GETPOST('classesname','alpha'); + $object->priority=GETPOST('priority','int'); + $object->objectname=GETPOST('objectname','alpha'); + $object->methodename=GETPOST('methodename','alpha'); + $object->params=GETPOST('params'); + $object->md5params=GETPOST('md5params'); + $object->module_name=GETPOST('module_name','alpha'); + $object->note=GETPOST('note'); + $object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int')); + $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); + $object->unitfrequency=GETPOST('unitfrequency','int'); + $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int'); + + //Ajout de la tache cron + $result = $object->update($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + +if ($action=='activate') { + $object->status=1; + + //Ajout de la tache cron + $result = $object->update($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + +if ($action=='inactive') { + $object->status=0; + //Ajout de la tache cron + $result = $object->update($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + + +/* + * View +*/ + +llxHeader('',$langs->trans("CronAdd")); + +if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') { + $head=cron_prepare_head($object); + dol_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'bill'); +} elseif ($action=='create') { + print_fiche_titre($langs->trans("CronTask"),'','setup'); +} + +if ($conf->use_javascript_ajax) +{ + print "\n".''."\n"; +} + +$form = new Form($db); +$formCron = new FormCron($db); + +if ($action == 'delete') +{ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + if ($ret == 'html') print '
'; + $action=''; +} + +if ($action == 'execute'){ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + if ($ret == 'html') print '
'; + $action=''; +} + + + +/* + * Create Template +*/ + +if (empty($object->status)) { + dol_htmloutput_mesg($langs->trans("CronTaskInactive"),'','warning',1); +} + +if (($action=="create") || ($action=="edit")) { + + print ''; + print ''."\n"; + if (!empty($object->id)) { + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + + print '
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
'.$langs->trans("KeyForCronAccess").''; +print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); print '
'; + + print '"; + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print "\n"; + + print ""; + $priority=0; + if (!empty($object->priority)) { + $priority=$object->priority; + } + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print ""; + print "\n"; + + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + + print '"; + print ""; + print "\n"; + + print '
'; + print $langs->trans('CronLabel')."label."\" /> "; + print ""; + print "
"; + print $langs->trans('CronType').""; + print $formCron->select_typejob('jobtype',$object->jobtype); + print ""; + print "
"; + print $langs->trans('CronHourStart').""; + if(!empty($object->datestart)){ + $form->select_date($object->datestart,'datestart',1,1,'',"cronform"); + } + else{ + $form->select_date(dol_now(),'datestart',1,1,'',"cronform"); + } + print ""; + print "
"; + print $langs->trans('CronDtEnd').""; + if(!empty($object->dateend)){ + $form->select_date($object->dateend,'dateend',1,1,'',"cronform"); + } + else{ + $form->select_date('','dateend',1,1,1,"cronform"); + } + print ""; + print "
"; + print $langs->trans('CronPriority')." "; + print ""; + print "
"; + print $langs->trans('CronEvery')."unitfrequency=="60"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + + $input = "unitfrequency=="3600"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + + $input = "unitfrequency=="86400"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + + $input = "unitfrequency=="604800"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + print ""; + print "
'; + print $langs->trans('CronModule').""; + print "module_name."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronModuleHelp"),1,'help'); + print "
'; + print $langs->trans('CronClassFile').""; + print "classesname."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronClassFileHelp"),1,'help'); + print "
'; + print $langs->trans('CronObject').""; + print "objectname."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronObjectHelp"),1,'help'); + print "
'; + print $langs->trans('CronMethod').""; + print "methodename."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronMethodHelp"),1,'help'); + print "
'; + print $langs->trans('CronArgs').""; + print "params."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronArgsHelp"),1,'help'); + print "
'; + print $langs->trans('CronCommand').""; + print "command."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronCommandHelp"),1,'help'); + print "
'; + print $langs->trans('CronNote').""; + $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, 4, 90); + $doleditor->Create(); + print ""; + print "
'; + print "trans("Save")."\">"; + print "trans("Cancel")."\">"; + print ""; + print "
'; + + print "\n"; + +}else { + + /* + * view Template + */ + + // box add_jobs_box + print ''; + + print '"; + print "\n"; + + print '"; + print ""; + + print ""; + + print ""; + + print ""; + + print ""; + print ""; + + print ""; + print ""; + + print ""; + print ""; + + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '
'; + print $langs->trans('CronId')."".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id'); + print "
'; + print $langs->trans('CronLabel')."".$object->label; + print "
"; + print $langs->trans('CronType').""; + print $formCron->select_typejob('jobtype',$object->jobtype,1); + print "
"; + print $langs->trans('CronHourStart').""; + if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
"; + print $langs->trans('CronDtEnd').""; + if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
"; + print $langs->trans('CronPriority')."".$object->priority; + print "
"; + print $langs->trans('CronNbRun')."".$object->nbrun; + print "
"; + print $langs->trans('CronEvery').""; + if($object->unitfrequency == "60") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Minutes'); + if($object->unitfrequency == "3600") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Hours'); + if($object->unitfrequency == "86400") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Days'); + if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Weeks'); + print "
'; + print $langs->trans('CronModule').""; + print $object->module_name; + print "
'; + print $langs->trans('CronClassFile').""; + print $object->classesname; + print "
'; + print $langs->trans('CronObject').""; + print $object->objectname; + print "
'; + print $langs->trans('CronMethod').""; + print $object->methodename; + print "
'; + print $langs->trans('CronArgs').""; + print $object->params; + print "
'; + print $langs->trans('CronCommand').""; + print $object->command; + print "
'; + print $langs->trans('CronNote').""; + print $object->note; + print "
'; + print $langs->trans('CronDtLastLaunch').""; + if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
'; + print $langs->trans('CronDtNextLaunch').""; + if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
'; + print $langs->trans('CronDtLastResult').""; + if(!empty($object->datelastresult)) {print dol_print_date($object->datelastresult,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
'; + print $langs->trans('CronLastResult').""; + print $object->lastresult; + print "
'; + print $langs->trans('CronLastOutput').""; + print nl2br($object->lastoutput); + print "
'; + + print "\n\n
\n"; + if (! $user->rights->cron->create) { + print ''.$langs->trans("Edit").''; + } else { + print ''.$langs->trans("Edit").''; + } + if (! $user->rights->cron->delete) { + print ''.$langs->trans("Delete").''; + } else { + print ''.$langs->trans("Delete").''; + } + if (! $user->rights->cron->create) { + print ''.$langs->trans("CronStatusActiveBtn").'/'.$langs->trans("CronStatusInactiveBtn").''; + } else { + if (empty($object->status)) { + print ''.$langs->trans("CronStatusActiveBtn").''; + } else { + print ''.$langs->trans("CronStatusInactiveBtn").''; + } + } + if ((! $user->rights->cron->execute) || (empty($object->status))) { + print ''.$langs->trans("CronExecute").''; + } else { + print ''.$langs->trans("CronExecute").''; + } + print '

'; +} + +$db->close(); +llxFooter(); \ No newline at end of file diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b2b5fcddd1a..b24055c6f3d 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2013 Florian Henry * * 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 @@ -17,42 +17,58 @@ */ /** - * \file dev/skeletons/cronjob.class.php + * \file cron/class/cronjob.class.php * \ingroup cron - * \brief CRUD class file (Create/Read/Update/Delete) for cronjob table - * Initialy built by build_class_from_table on 2013-03-17 18:50 */ // Put here all includes required by your class file require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); /** - * Put here description of your class + * Crob Job class */ class Cronjob extends CommonObject { var $db; //!< To store db handler var $error; //!< To return error code (or message) var $errors=array(); //!< To return several error codes (or messages) - var $element='cronjob'; //!< Id that identify managed objects + var $element='cronjob'; //!< Id that identify managed objects var $table_element='cronjob'; //!< Name of table without prefix where object is stored var $id; - + + var $ref; //Use for prevnext_ref + var $jobtype; var $tms=''; var $datec=''; + var $label; var $command; + var $classesname; + var $objectname; + var $methodename; var $params; + var $md5params; + var $module_name; + var $priority; var $datelastrun=''; - var $lastresult=''; + var $datenextrun=''; + var $dateend=''; + var $datestart=''; + var $datelastresult=''; + var $lastresult; var $lastoutput; - var $fk_user; + var $unitfrequency; + var $frequency; + var $status; + var $fk_user_author; + var $fk_user_mod; var $note; + var $nbrun; + + var $lines; - + /** @@ -80,51 +96,128 @@ class Cronjob extends CommonObject $error=0; // Clean parameters - + + if (isset($this->label)) $this->label=trim($this->label); + if (isset($this->jobtype)) $this->jobtype=trim($this->jobtype); if (isset($this->command)) $this->command=trim($this->command); + if (isset($this->classesname)) $this->classesname=trim($this->classesname); + if (isset($this->objectname)) $this->objectname=trim($this->objectname); + if (isset($this->methodename)) $this->methodename=trim($this->methodename); if (isset($this->params)) $this->params=trim($this->params); + if (isset($this->md5params)) $this->md5params=trim($this->md5params); + if (isset($this->module_name)) $this->module_name=trim($this->module_name); + if (isset($this->priority)) $this->priority=trim($this->priority); if (isset($this->lastoutput)) $this->lastoutput=trim($this->lastoutput); - if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user); + if (isset($this->lastresult)) $this->lastresult=trim($this->lastresult); + if (isset($this->unitfrequency)) $this->unitfrequency=trim($this->unitfrequency); + if (isset($this->frequency)) $this->frequency=trim($this->frequency); + if (isset($this->status)) $this->status=trim($this->status); if (isset($this->note)) $this->note=trim($this->note); - - + if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun); // Check parameters - // Put here code to add control on parameters values + // Put here code to add a control on parameters values + if (dol_strlen($this->datestart)==0) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronDtStart')); + $error++; + } + if (empty($this->label)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronLabel')); + $error++; + } + if ((dol_strlen($this->datestart)!=0) && (dol_strlen($this->dateend)!=0) && ($this->dateend<$this->datestart)) { + $this->errors[]=$langs->trans('CronErrEndDateStartDt'); + $error++; + } + if (empty($this->unitfrequency)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronFrequency')); + $error++; + } + if (($this->jobtype=='command') && (empty($this->command))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronCommand')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->classesname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronClass')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->methodename))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronMethod')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->objectname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronObject')); + $error++; + } // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob("; - + $sql.= "datec,"; + $sql.= "jobtype,"; + $sql.= "label,"; $sql.= "command,"; + $sql.= "classesname,"; + $sql.= "objectname,"; + $sql.= "methodename,"; $sql.= "params,"; + $sql.= "md5params,"; + $sql.= "module_name,"; + $sql.= "priority,"; $sql.= "datelastrun,"; + $sql.= "datenextrun,"; + $sql.= "dateend,"; + $sql.= "datestart,"; $sql.= "lastresult,"; + $sql.= "datelastresult,"; $sql.= "lastoutput,"; - $sql.= "fk_user,"; - $sql.= "note"; - + $sql.= "unitfrequency,"; + $sql.= "frequency,"; + $sql.= "status,"; + $sql.= "fk_user_author,"; + $sql.= "fk_user_mod,"; + $sql.= "note,"; + $sql.= "nbrun"; + $sql.= ") VALUES ("; - - $sql.= " ".(! isset($this->datec) || dol_strlen($this->datec)==0?'NULL':$this->db->idate($this->datec)).","; + + $sql.= " ".$this->db->idate(dol_now()).","; + $sql.= " ".(! isset($this->jobtype)?'NULL':"'".$this->db->escape($this->jobtype)."'").","; + $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; $sql.= " ".(! isset($this->command)?'NULL':"'".$this->db->escape($this->command)."'").","; + $sql.= " ".(! isset($this->classesname)?'NULL':"'".$this->db->escape($this->classesname)."'").","; + $sql.= " ".(! isset($this->objectname)?'NULL':"'".$this->db->escape($this->objectname)."'").","; + $sql.= " ".(! isset($this->methodename)?'NULL':"'".$this->db->escape($this->methodename)."'").","; $sql.= " ".(! isset($this->params)?'NULL':"'".$this->db->escape($this->params)."'").","; + $sql.= " ".(! isset($this->md5params)?'NULL':"'".$this->db->escape($this->md5params)."'").","; + $sql.= " ".(! isset($this->module_name)?'NULL':"'".$this->db->escape($this->module_name)."'").","; + $sql.= " ".(! isset($this->priority)?'NULL':"'".$this->priority."'").","; $sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':$this->db->idate($this->datelastrun)).","; - $sql.= " ".(! isset($this->lastresult) || dol_strlen($this->lastresult)==0?'NULL':$this->db->idate($this->lastresult)).","; + $sql.= " ".(! isset($this->datenextrun) || dol_strlen($this->datenextrun)==0?'NULL':$this->db->idate($this->datenextrun)).","; + $sql.= " ".(! isset($this->dateend) || dol_strlen($this->dateend)==0?'NULL':$this->db->idate($this->dateend)).","; + $sql.= " ".(! isset($this->datestart) || dol_strlen($this->datestart)==0?'NULL':$this->db->idate($this->datestart)).","; + $sql.= " ".(! isset($this->lastresult)?'NULL':"'".$this->db->escape($this->lastresult)."'").","; + $sql.= " ".(! isset($this->datelastresult) || dol_strlen($this->datelastresult)==0?'NULL':$this->db->idate($this->datelastresult)).","; $sql.= " ".(! isset($this->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").","; - $sql.= " ".(! isset($this->fk_user)?'NULL':"'".$this->fk_user."'").","; - $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").""; - + $sql.= " ".(! isset($this->unitfrequency)?'NULL':"'".$this->unitfrequency."'").","; + $sql.= " ".(! isset($this->frequency)?'NULL':"'".$this->frequency."'").","; + $sql.= " ".(! isset($this->status)?'0':"'".$this->status."'").","; + $sql.= " ".$user->id.","; + $sql.= " ".$user->id.","; + $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").","; + $sql.= " ".(! isset($this->nbrun)?'0':"'".$this->db->escape($this->nbrun)."'").""; + $sql.= ")"; + $this->db->begin(); dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob"); @@ -173,18 +266,35 @@ class Cronjob extends CommonObject global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; - + $sql.= " t.tms,"; $sql.= " t.datec,"; + $sql.= " t.jobtype,"; + $sql.= " t.label,"; $sql.= " t.command,"; + $sql.= " t.classesname,"; + $sql.= " t.objectname,"; + $sql.= " t.methodename,"; $sql.= " t.params,"; + $sql.= " t.md5params,"; + $sql.= " t.module_name,"; + $sql.= " t.priority,"; $sql.= " t.datelastrun,"; + $sql.= " t.datenextrun,"; + $sql.= " t.dateend,"; + $sql.= " t.datestart,"; $sql.= " t.lastresult,"; + $sql.= " t.datelastresult,"; $sql.= " t.lastoutput,"; - $sql.= " t.fk_user,"; - $sql.= " t.note"; - + $sql.= " t.unitfrequency,"; + $sql.= " t.frequency,"; + $sql.= " t.status,"; + $sql.= " t.fk_user_author,"; + $sql.= " t.fk_user_mod,"; + $sql.= " t.note,"; + $sql.= " t.nbrun"; + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql.= " WHERE t.rowid = ".$id; @@ -197,18 +307,36 @@ class Cronjob extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - + $this->ref = $obj->rowid; + $this->tms = $this->db->jdate($obj->tms); $this->datec = $this->db->jdate($obj->datec); + $this->label = $obj->label; + $this->jobtype = $obj->jobtype; $this->command = $obj->command; + $this->classesname = $obj->classesname; + $this->objectname = $obj->objectname; + $this->methodename = $obj->methodename; $this->params = $obj->params; + $this->md5params = $obj->md5params; + $this->module_name = $obj->module_name; + $this->priority = $obj->priority; $this->datelastrun = $this->db->jdate($obj->datelastrun); - $this->lastresult = $this->db->jdate($obj->lastresult); + $this->datenextrun = $this->db->jdate($obj->datenextrun); + $this->dateend = $this->db->jdate($obj->dateend); + $this->datestart = $this->db->jdate($obj->datestart); + $this->lastresult = $obj->lastresult; $this->lastoutput = $obj->lastoutput; - $this->fk_user = $obj->fk_user; + $this->datelastresult = $this->db->jdate($obj->datelastresult); + $this->unitfrequency = $obj->unitfrequency; + $this->frequency = $obj->frequency; + $this->status = $obj->status; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_mod = $obj->fk_user_mod; $this->note = $obj->note; + $this->nbrun = $obj->nbrun; - + } $this->db->free($resql); @@ -221,6 +349,141 @@ class Cronjob extends CommonObject return -1; } } + + /** + * Load object in memory from the database + * + * @param string $sortorder sort order + * @param string $sortfield sort field + * @param int $limit limit page + * @param int $offset page + * @param int $status display active or not + * @param array $filter filter output + * @return int <0 if KO, >0 if OK + */ + function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='') + { + global $langs; + $sql = "SELECT"; + $sql.= " t.rowid,"; + $sql.= " t.tms,"; + $sql.= " t.datec,"; + $sql.= " t.jobtype,"; + $sql.= " t.label,"; + $sql.= " t.command,"; + $sql.= " t.classesname,"; + $sql.= " t.objectname,"; + $sql.= " t.methodename,"; + $sql.= " t.params,"; + $sql.= " t.md5params,"; + $sql.= " t.module_name,"; + $sql.= " t.priority,"; + $sql.= " t.datelastrun,"; + $sql.= " t.datenextrun,"; + $sql.= " t.dateend,"; + $sql.= " t.datestart,"; + $sql.= " t.lastresult,"; + $sql.= " t.datelastresult,"; + $sql.= " t.lastoutput,"; + $sql.= " t.unitfrequency,"; + $sql.= " t.frequency,"; + $sql.= " t.status,"; + $sql.= " t.fk_user_author,"; + $sql.= " t.fk_user_mod,"; + $sql.= " t.note,"; + $sql.= " t.nbrun"; + + + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; + $status = (empty($status))?'0':'1'; + $sql.= " WHERE t.status=".$status; + //Manage filter + if (is_array($filter) && count($filter)>0) { + foreach($filter as $key => $value) { + $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + } + } + + + $sql.= " ORDER BY $sortfield $sortorder "; + if (!empty($limit) && !empty($offset)) { + $sql.= $this->db->plimit( $limit + 1 ,$offset); + } + + $sqlwhere = array(); + + if (!empty($module_name)) { + $sqlwhere[]='(t.module_name='.$module_name.')'; + } + if (count($sqlwhere)>0) { + $sql.= " WHERE ".implode(' AND ',$sqlwhere); + } + + dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num=$this->db->num_rows($resql); + $i=0; + + if ($num) + { + $this->lines=array(); + + while ($i < $num) + { + + $line = new Cronjobline(); + + $obj = $this->db->fetch_object($resql); + + $line->id = $obj->rowid; + $line->ref = $obj->rowid; + + $line->tms = $this->db->jdate($obj->tms); + $line->datec = $this->db->jdate($obj->datec); + $line->label = $obj->label; + $line->jobtype = $obj->jobtype; + $line->command = $obj->command; + $line->classesname = $obj->classesname; + $line->objectname = $obj->objectname; + $line->methodename = $obj->methodename; + $line->params = $obj->params; + $line->md5params = $obj->md5params; + $line->module_name = $obj->module_name; + $line->priority = $obj->priority; + $line->datelastrun = $this->db->jdate($obj->datelastrun); + $line->datenextrun = $this->db->jdate($obj->datenextrun); + $line->dateend = $this->db->jdate($obj->dateend); + $line->datestart = $this->db->jdate($obj->datestart); + $line->lastresult = $obj->lastresult; + $line->datelastresult = $this->db->jdate($obj->datelastresult); + $line->lastoutput = $obj->lastoutput; + $line->unitfrequency = $obj->unitfrequency; + $line->frequency = $obj->frequency; + $line->status = $obj->status; + $line->fk_user_author = $obj->fk_user_author; + $line->fk_user_mod = $obj->fk_user_mod; + $line->note = $obj->note; + $line->nbrun = $obj->nbrun; + + $this->lines[]=$line; + + $i++; + + } + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); + return -1; + } + } /** @@ -233,35 +496,98 @@ class Cronjob extends CommonObject function update($user=0, $notrigger=0) { global $conf, $langs; + + $langs->load('cron'); + $error=0; // Clean parameters - + + if (isset($this->label)) $this->label=trim($this->label); + if (isset($this->jobtype)) $this->jobtype=trim($this->jobtype); if (isset($this->command)) $this->command=trim($this->command); + if (isset($this->classesname)) $this->classesname=trim($this->classesname); + if (isset($this->objectname)) $this->objectname=trim($this->objectname); + if (isset($this->methodename)) $this->methodename=trim($this->methodename); if (isset($this->params)) $this->params=trim($this->params); + if (isset($this->md5params)) $this->md5params=trim($this->md5params); + if (isset($this->module_name)) $this->module_name=trim($this->module_name); + if (isset($this->priority)) $this->priority=trim($this->priority); if (isset($this->lastoutput)) $this->lastoutput=trim($this->lastoutput); - if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user); + if (isset($this->lastresult)) $this->lastresult=trim($this->lastresult); + if (isset($this->unitfrequency)) $this->unitfrequency=trim($this->unitfrequency); + if (isset($this->frequency)) $this->frequency=trim($this->frequency); + if (isset($this->status)) $this->status=trim($this->status); if (isset($this->note)) $this->note=trim($this->note); - - + if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun); // Check parameters // Put here code to add a control on parameters values + if (empty($this->status)) { + $this->dateend=dol_now(); + } + if (dol_strlen($this->datestart)==0) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronDtStart')); + $error++; + } + if ((dol_strlen($this->datestart)!=0) && (dol_strlen($this->dateend)!=0) && ($this->dateend<$this->datestart)) { + $this->errors[]=$langs->trans('CronErrEndDateStartDt'); + $error++; + } + if (empty($this->label)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronLabel')); + $error++; + } + if (empty($this->unitfrequency)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronFrequency')); + $error++; + } + if (($this->jobtype=='command') && (empty($this->command))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronCommand')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->classesname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronClass')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->methodename))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronMethod')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->objectname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronObject')); + $error++; + } + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."cronjob SET"; - - $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; - $sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').","; + + $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; + $sql.= " jobtype=".(isset($this->jobtype)?"'".$this->db->escape($this->jobtype)."'":"null").","; $sql.= " command=".(isset($this->command)?"'".$this->db->escape($this->command)."'":"null").","; + $sql.= " classesname=".(isset($this->classesname)?"'".$this->db->escape($this->classesname)."'":"null").","; + $sql.= " objectname=".(isset($this->objectname)?"'".$this->db->escape($this->objectname)."'":"null").","; + $sql.= " methodename=".(isset($this->methodename)?"'".$this->db->escape($this->methodename)."'":"null").","; $sql.= " params=".(isset($this->params)?"'".$this->db->escape($this->params)."'":"null").","; + $sql.= " md5params=".(isset($this->md5params)?"'".$this->db->escape($this->md5params)."'":"null").","; + $sql.= " module_name=".(isset($this->module_name)?"'".$this->db->escape($this->module_name)."'":"null").","; + $sql.= " priority=".(isset($this->priority)?$this->priority:"null").","; $sql.= " datelastrun=".(dol_strlen($this->datelastrun)!=0 ? "'".$this->db->idate($this->datelastrun)."'" : 'null').","; - $sql.= " lastresult=".(dol_strlen($this->lastresult)!=0 ? "'".$this->db->idate($this->lastresult)."'" : 'null').","; + $sql.= " datenextrun=".(dol_strlen($this->datenextrun)!=0 ? "'".$this->db->idate($this->datenextrun)."'" : 'null').","; + $sql.= " dateend=".(dol_strlen($this->dateend)!=0 ? "'".$this->db->idate($this->dateend)."'" : 'null').","; + $sql.= " datestart=".(dol_strlen($this->datestart)!=0 ? "'".$this->db->idate($this->datestart)."'" : 'null').","; + $sql.= " datelastresult=".(dol_strlen($this->datelastresult)!=0 ? "'".$this->db->idate($this->datelastresult)."'" : 'null').","; + $sql.= " lastresult=".(isset($this->lastresult)?"'".$this->db->escape($this->lastresult)."'":"null").","; $sql.= " lastoutput=".(isset($this->lastoutput)?"'".$this->db->escape($this->lastoutput)."'":"null").","; - $sql.= " fk_user=".(isset($this->fk_user)?$this->fk_user:"null").","; - $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").""; - + $sql.= " unitfrequency=".(isset($this->unitfrequency)?$this->unitfrequency:"null").","; + $sql.= " frequency=".(isset($this->frequency)?$this->frequency:"null").","; + $sql.= " status=".(isset($this->status)?$this->status:"null").","; + $sql.= " fk_user_mod=".$user->id.","; + $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").","; + $sql.= " nbrun=".(isset($this->nbrun)?$this->nbrun:"null"); + $sql.= " WHERE rowid=".$this->id; $this->db->begin(); @@ -269,7 +595,7 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { if (! $notrigger) @@ -377,7 +703,7 @@ class Cronjob extends CommonObject $error=0; - $object=new Cronjobs($this->db); + $object=new Cronjob($this->db); $this->db->begin(); @@ -428,19 +754,277 @@ class Cronjob extends CommonObject function initAsSpecimen() { $this->id=0; - + $this->ref=0; + $this->tms=''; $this->datec=''; + $this->label=''; + $this->jobtype=''; $this->command=''; + $this->classesname=''; + $this->objectname=''; + $this->methodename=''; $this->params=''; + $this->md5params=''; + $this->module_name=''; + $this->priority=''; $this->datelastrun=''; - $this->lastresult=''; + $this->datenextrun=''; + $this->dateend=''; + $this->datestart=''; + $this->datelastresult=''; $this->lastoutput=''; - $this->fk_user=''; - $this->note=''; - - + $this->lastresult=''; + $this->unitfrequency=''; + $this->frequency=''; + $this->status=''; + $this->fk_user_author=''; + $this->fk_user_mod=''; + $this->note=''; + $this->nbrun=''; } + + /** + * Load object information + * + * @return void + */ + function info() + { + global $langs; + + $sql = "SELECT"; + $sql.= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author"; + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f"; + $sql.= " WHERE f.rowid = ".$this->id; + + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + $this->id = $obj->rowid; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->tms); + $this->user_modification = $obj->fk_user_mod; + $this->user_creation = $obj->fk_user_author; + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); + return -1; + } + } + + /** + * Run a job + * + * @param string $userlogin User login + * @return int <0 if KO, >0 if OK + */ + function run_jobs($userlogin) + { + global $langs, $conf; + + $langs->load('cron'); + + if (empty($userlogin)) { + $this->error="User login is mandatory"; + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $user=new User($this->db); + $result=$user->fetch('',$userlogin); + if ($result<0) { + $this->error="User Error:".$user->error; + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + }else { + if (empty($user->id)) { + $this->error=" User user login:".$userlogin." do not exists"; + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + } + + dol_syslog(get_class($this)."::run_jobs userlogin:$userlogin", LOG_DEBUG); + + $error=0; + $now=dol_now(); + + $this->db->begin(); + + if ($this->jobtype=='method') { + // load classes + $ret=dol_include_once("/".$this->module_name."/class/".$this->classesname,$this->objectname); + if ($ret===false) { + $this->error=$langs->trans('CronCannotLoadClass',$file,$this->objectname); + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + + // Load langs + $result=$langs->load($this->module_name.'@'.$this->module_name); + if ($result<0) { + dol_syslog(get_class($this)."::run_jobs Cannot load module langs".$langs->error, LOG_ERR); + return -1; + } + + dol_syslog(get_class($this)."::run_jobs ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG); + + // Create Object for the call module + $object = new $this->objectname($this->db); + + $params_arr = array(); + $params_arr=explode(", ",$this->params); + if (!is_array($params_arr)) { + $result = call_user_func(array($object, $this->methodename), $this->params); + }else { + $result = call_user_func_array(array($object, $this->methodename), $params_arr); + } + + if ($result===false) { + dol_syslog(get_class($this)."::run_jobs ".$object->error, LOG_ERR); + return -1; + }else { + $this->lastoutput=var_export($result,true); + $this->lastresult=var_export($result,true); + } + + } elseif ($this->jobtype=='command') { + dol_syslog(get_class($this)."::run_jobs system:".$this->command, LOG_DEBUG); + $output_arr=array(); + + exec($this->command, $output_arr,$retval); + + dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG); + + $this->lastoutput=''; + if (is_array($output_arr) && count($output_arr)>0) { + foreach($output_arr as $val) { + $this->lastoutput.=$val."\n"; + } + } + $this->lastresult=$retval; + } + + $this->datelastresult=$now; + $this->datelastrun=$now; + $this->nbrun=$this->nbrun+1; + $result = $this->update($user); + if ($result<0) { + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + $this->db->rollback(); + return -1; + }else { + $this->db->commit(); + return 1; + } + + + } + + /** + * Reprogram a job + * + * @param string $userlogin User login + * @return int <0 if KO, >0 if OK + * + */ + function reprogram_jobs($userlogin) + { + global $langs, $conf; + + dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG); + + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $user=new User($this->db); + $result=$user->fetch('',$userlogin); + if ($result<0) { + $this->error="User Error:".$user->error; + dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); + return -1; + }else { + if (empty($user->id)) { + $this->error=" User user login:".$userlogin." do not exists"; + dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); + return -1; + } + } + + dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG); + + if (empty($this->datenextrun)) { + $this->datenextrun=dol_now()+$this->frequency; + } else { + if ($this->datenextrundatenextrun=dol_now()+$this->frequency; + } else { + $this->datenextrun=$this->datenextrun+$this->frequency; + } + } + $result = $this->update($user); + if ($result<0) { + dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); + return -1; + } + + return 1; + + } } -?> + + +/** + * Crob Job line class + */ +class Cronjobline{ + + var $id; + var $ref; + + var $tms=''; + var $datec=''; + var $label; + var $jobtype; + var $command; + var $classesname; + var $objectname; + var $methodename; + var $params; + var $md5params; + var $module_name; + var $priority; + var $datelastrun=''; + var $datenextrun=''; + var $dateend=''; + var $datestart=''; + var $lastresult=''; + var $lastoutput; + var $unitfrequency; + var $frequency; + var $status; + var $fk_user_author; + var $fk_user_mod; + var $note; + var $nbrun; + + /** + * Constructor + * + */ + function __construct() + { + return 1; + } +} \ No newline at end of file diff --git a/htdocs/cron/functions_cron.lib.php b/htdocs/cron/functions_cron.lib.php deleted file mode 100644 index 31cc8ebefad..00000000000 --- a/htdocs/cron/functions_cron.lib.php +++ /dev/null @@ -1,27 +0,0 @@ - - * Copyright (C) 2007-2009 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file cron/functions_cron.lib.php - * \ingroup core - * \brief Functions for miscellaneous cron tasks - */ - - - -?> diff --git a/htdocs/cron/index.php b/htdocs/cron/index.php deleted file mode 100644 index 3d7ef46ad77..00000000000 --- a/htdocs/cron/index.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file dev/Cronjobss/Cronjobs_page.php - * \ingroup mymodule othermodule1 othermodule2 - * \brief This file is an example of a php page - * Initialy built by build_class_from_table on 2013-03-17 18:50 - */ - -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) - -// Change this following line to use the correct relative path (../, ../../, etc) -$res=0; -if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; -if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; -if (! $res && file_exists("../../../main.inc.php")) $res=@include '../../../main.inc.php'; -if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res) die("Include of main fails"); -// Change this following line to use the correct relative path from htdocs -dol_include_once('/module/class/cronjob.class.php'); - -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("cron"); - -// Get parameters -$id = GETPOST('id','int'); -$action = GETPOST('action','alpha'); -$myparam = GETPOST('myparam','alpha'); -$action='list'; - -// Protection if external user -if ($user->societe_id > 0) accessforbidden(); -if (! $user->admin) accessforbidden(); - - -/******************************************************************* -* ACTIONS -* -* Put here all code to do according to value of "action" parameter -********************************************************************/ - -if ($action == 'add') -{ - $object=new Cronjobs($db); - $object->prop1=$_POST["field1"]; - $object->prop2=$_POST["field2"]; - $result=$object->create($user); - if ($result > 0) - { - // Creation OK - } - { - // Creation KO - $mesg=$object->error; - } -} - - - - - -/*************************************************** -* VIEW -* -* Put here all code to build page -****************************************************/ - -llxHeader('','MyPageName',''); - -$form=new Form($db); - - -//print ''; -//print '
'; -print '
'; - - - - - -//print '
'; -print '
'; - - - -// Example 1 : Adding jquery code -print ''; - - -// Example 2 : Adding links to objects -// The class must extends CommonObject class to have this method available -//$somethingshown=$object->showLinkedObjectBlock(); - - -// Example 3 : List of data -if ($action == 'list') -{ - $sql = "SELECT"; - $sql.= " t.rowid,"; - - $sql.= " t.tms,"; - $sql.= " t.datec,"; - $sql.= " t.command,"; - $sql.= " t.params,"; - $sql.= " t.datelastrun,"; - $sql.= " t.lastresult,"; - $sql.= " t.lastoutput,"; - $sql.= " t.fk_user,"; - $sql.= " t.note"; - - - $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; - //$sql.= " WHERE field3 = 'xxx'"; - //$sql.= " ORDER BY field1 ASC"; - - - print_fiche_titre($langs->trans("ListOfCronJobs"),'','').'
'; - - - print ''."\n"; - print ''; - print_liste_field_titre($langs->trans('Id'),$_SERVER['PHP_SELF'],'t.rowid','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Command'),$_SERVER['PHP_SELF'],'t.command','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DateCreation'),$_SERVER['PHP_SELF'],'t.datec','align="center"',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('LastOutput'),$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DateLastRun'),$_SERVER['PHP_SELF'],'t.datelastrun','align="center"',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('LastResult'),$_SERVER['PHP_SELF'],'t.lastresult','align="right"',$param,'',$sortfield,$sortorder); - print ''; - - dol_syslog($script_file." sql=".$sql, LOG_DEBUG); - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($resql); - if ($obj) - { - // You can use here results - print ''; - } - $i++; - } - } - } - else - { - $error++; - dol_print_error($db); - } - - print '
'; - print $obj->rowid; - print ''; - print $obj->command; - print ''; - print $db->jdate($obj->datec); - print ''; - print ''; - print ''; - print $db->jdate($obj->datelastrun); - print ''; - print $obj->lastresult; - print '
'."\n"; -} - - -//print '
'; -print '
'; - - -// End of page -llxFooter(); -$db->close(); -?> diff --git a/htdocs/cron/info.php b/htdocs/cron/info.php new file mode 100644 index 00000000000..b5b9c6d29dc --- /dev/null +++ b/htdocs/cron/info.php @@ -0,0 +1,59 @@ + +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/** + * \file /cron/cron/info.php + * \brief Page fiche d'une operation + */ + +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + +// Security check +if (!$user->rights->cron->read) accessforbidden(); + +$id=GETPOST('id','int'); + +$mesg = ''; + +/* + * View +*/ + +llxHeader('',$langs->trans("CronInfo")); + +$object = new Cronjob($db); +$object->fetch($id); +$object->info($id); + +$head = cron_prepare_head($object); + +dol_fiche_head($head, 'info', $langs->trans("CronInfo"), 0, 'bill'); + +print '
'; +dol_print_object_info($object); +print '
'; +print ''; + + +$db->close(); +llxFooter(); \ No newline at end of file diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php new file mode 100644 index 00000000000..2d472add564 --- /dev/null +++ b/htdocs/cron/list.php @@ -0,0 +1,289 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file cron/cron/list.php + * \ingroup cron + * \brief Lists Jobs + */ + + +require '../main.inc.php'; +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); + +// librairie jobs +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; + +$langs->load("admin"); +$langs->load("cron"); + +if (!$user->rights->cron->read) accessforbidden(); + +/* + * Actions + */ +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$id=GETPOST('id','int'); + +$sortorder=GETPOST('sortorder','alpha'); +$sortfield=GETPOST('sortfield','alpha'); +$page=GETPOST('page','int'); +$status=GETPOST('status','int'); + +//Search criteria +$search_label=GETPOST("search_label",'alpha'); + +if (empty($sortorder)) $sortorder="DESC"; +if (empty($sortfield)) $sortfield="t.datenextrun"; +if (empty($arch)) $arch = 0; + +if ($page == -1) { + $page = 0 ; +} + +$limit = $conf->global->MAIN_SIZE_LISTE_LIMIT; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Do we click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $search_label=''; +} + +$filter=array(); +if (!empty($search_label)) { + $filter['t.label']=$search_label; +} + +// Delete jobs +if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete){ + + //Delete de la tache cron + $object = new Cronjob($db); + $object->id=$id; + $result = $object->delete($user); + + if ($result < 0) { + setEventMessage($object->error,'errors'); + } +} + +// Execute jobs +if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute){ + + //Execute jobs + $object = new Cronjob($db); + $job = $object->fetch($id); + + $result = $object->run_jobs($user->login); + if ($result < 0) { + setEventMessage($object->error,'errors'); + } + +} + + +/* + * View + */ +if (!empty($status)) { + $pagetitle=$langs->trans("CronListActive"); +}else { + $pagetitle=$langs->trans("CronListInactive"); +} + +llxHeader('',$pagetitle); + + +// Form object for popup +$form = new Form($db); + +if ($action == 'delete') +{ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + if ($ret == 'html') print '
'; +} + +if ($action == 'execute'){ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + if ($ret == 'html') print '
'; +} + + +print_fiche_titre($pagetitle,'','setup'); + +print $langs->trans('CronInfo'); + +// liste des jobs creer +$object = new Cronjob($db); +$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter); +if ($result < 0) { + setEventMessage($object->error,'errors'); +} + + +print "

"; +print $langs->trans('CronWaitingJobs'); +print "

"; + +if (count($object->lines)>0) { + + print ''; + print ''; + $arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label; + print_liste_field_titre($langs->trans("CronLabel"),$_SERVEUR['PHP_SELF'],"t.label","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronTask"),'','',"",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtStart"),$_SERVEUR['PHP_SELF'],"t.datestart","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVEUR['PHP_SELF'],"t.dateend","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVEUR['PHP_SELF'],"t.datelastrun","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVEUR['PHP_SELF'],"t.datenextrun","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronNbRun"),$_SERVEUR['PHP_SELF'],"t.nbrun","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronLastResult"),$_SERVEUR['PHP_SELF'],"t.lastresult","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVEUR['PHP_SELF'],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder); + print ''; + + print ''; + + print ''."\n"; + print ''; + print ''; + + + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + + + // Boucler sur chaque job + $style='impair'; + foreach($object->lines as $line){ + // title profil + if ($style=='pair') {$style='impair';} + else {$style='pair';} + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + } + print '
'; + print ''; + print '         '; + print '  '; + print ''; + print '
'; + if(!empty($line->label)) { + print ''.$line->label.''; + } + else { + print $langs->trans('CronNone'); + } + print ''; + if ($line->jobtype=='method') { + print $langs->trans('CronModule').':'.$line->module_name.'
'; + print $langs->trans('CronClass').':'. $line->classesname.'
'; + print $langs->trans('CronObject').':'. $line->objectname.'
'; + print $langs->trans('CronMethod').':'. $line->methodename; + if(!empty($line->params)) { + print '
'.$langs->trans('CronArgs').':'. $line->params; + } + + }elseif ($line->jobtype=='command') { + print $langs->trans('CronCommand').':'. dol_trunc($line->command); + if(!empty($line->params)) { + print '
'.$langs->trans('CronArgs').':'. $line->params; + } + } + print '
'; + if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if($line->unitfrequency == "60") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Minutes'); + if($line->unitfrequency == "3600") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Hours'); + if($line->unitfrequency == "86400") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Days'); + if($line->unitfrequency == "604800") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Weeks'); + print ''; + if(!empty($line->nbrun)) {print $line->nbrun;} else {print '0';} + print ''; + if(!empty($line->lastresult)) {print dol_trunc($line->lastresult);} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->lastoutput)) {print dol_trunc(nl2br($line->lastoutput),100);} else {print $langs->trans('CronNone');} + print ''; + if ($user->rights->cron->delete) { + print "id."&status=".$status."&action=delete\" title=\"".$langs->trans('CronDelete')."\">\"".$langs-trans('CronDelete')."\" />"; + } else { + print "trans('NotEnoughPermissions')."\">\"".$langs-trans('NotEnoughPermissions')."\" />"; + } + if ($user->rights->cron->execute) { + print "id."&status=".$status."&action=execute\" title=\"".$langs->trans('CronExecute')."\">\"".$langs-trans('CronExecute')."\" />"; + } else { + print "trans('NotEnoughPermissions')."\">\"".$langs-trans('NotEnoughPermissions')."\" />"; + } + print '
'; +} else { + print $langs->trans('CronNoJobs'); +} + +print '
'; + +llxFooter(); +$db->close(); \ No newline at end of file diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 9684651832c..0394764a5a7 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -159,3 +159,36 @@ ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang); ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_code_ventilation integer DEFAULT 0 NOT NULL; ALTER TABLE llx_facturedet DROP COLUMN fk_export_compta; + +CREATE TABLE llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text +)ENGINE=innodb; + + diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index 5a8e33ef38f..959a3a1705d 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -1,32 +1,52 @@ --- =================================================================== --- Copyright (C) 2013 Laurent Destailleur --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =================================================================== - -create table llx_cronjob -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - datec datetime, - command varchar(256), - params text, - frequency varchar(24), - datelastrun datetime, - lastresult date, - lastoutput text, - fk_user integer DEFAULT NULL, - note text -)ENGINE=innodb; +-- =================================================================== +-- Copyright (C) 2013 Laurent Destailleur +-- Copyright (C) 2013 Florian Henry +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +CREATE TABLE IF NOT EXISTS llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text +)ENGINE=innodb; + + diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 0c7f39025f9..b1f9282b6bf 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -116,3 +116,4 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXE CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cronjob FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 671a00ddf16..a9aae951692 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -672,6 +672,10 @@ Permission1237=Export supplier orders and their details Permission1251=Run mass imports of external data into database (data load) Permission1321=Export customer invoices, attributes and payments Permission1421=Export customer orders and attributes +Permission23001 = Read Scheduled task +Permission23002 = Create/update Scheduled task +Permission23003 = Delete Scheduled task +Permission23004 = Execute Scheduled task Permission2401=Read actions (events or tasks) linked to his account Permission2402=Create/modify actions (events or tasks) linked to his account Permission2403=Delete actions (events or tasks) linked to his account diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 4f504d34e59..c64c74f1f58 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -1,11 +1,87 @@ # Dolibarr language file - en_US - cron CHARSET=UTF-8 -CronSetup=Cron scheduler setup -CronDesc=This page can be used to setup options of the scheduler manager + +# +# Admin +# +CronSetup= Configuration Scheduled task management URLToLaunchCronJobs=URL to launch cron jobs +OrToLaunchASpecificJob=Or to launch a specific job KeyForCronAccess=Security key for URL to launch cron jobs -DateLastRun=Last run -LastOutput=Last run output -LastResult=Last result code -ListOfCronJobs=List of scheduled jobs -Command=Command \ No newline at end of file +FileToLaunchCronJobs=Command to launch cron jobs +CronExplainHowToRunUnix=On Unix environement you should use crontab to run Command line each minutes +CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run Command line each minutes + +# +# Page list +# +CronDateLastRun=Last run +CronLastOutput=Last run output +CronLastResult=Last result code +CronListOfCronJobs=List of scheduled jobs +CronCommand=Command +CronList= Job list +CronDelete= Delete cron jobs +CronConfirmDelete= Are you sure to delete this cron jobs ? +CronExecute=Launch task +CronConfirmExecute= Are you sure to execute this job now +CronInfo= Jobs allow to execute task that have been planned +CronWaitingJobs=Wainting jobs +CronTask=Task +CronNone= None +CronDtStart=Start date +CronDtEnd=End fin +CronDtNextLaunch=Next execution +CronDtLastLaunch=Last execution +CronFrequency=Frequancy +CronClass=Classe +CronMethod=Method +CronModule=Module +CronAction=Action +CronStatus=Status +CronStatusActive=Active +CronStatusInactive=Inactive +CronNoJobs=No jobs registered +CronPriority=Priority +CronLabel=Description +CronNbRun=Nb. launch + +# +#Page card +# +CronAdd= Add jobs +CronHourStart= Start Hour and date of task +CronEvery= And execute task each +CronObject= Instance/Object to create +CronArgs=Parameters +CronSaveSucess=Save succefully +CronNote=Comment +CronFieldMandatory=Fields %s is mandatory +CronErrEndDateStartDt=End date cannot be before start date +CronStatusActiveBtn=Active +CronStatusInactiveBtn=Inactive +CronTaskInactive=This task is inactive +CronDtLastResult=Last result date +CronId=Id +CronClassFile=Classes (file name) +CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module).
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of module is product +CronClassFileHelp=The file name to load.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is product.class.php +CronObjectHelp=The object name to load.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is Product +CronMethodHelp=The object method to launch.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of method is is fecth +CronArgsHelp=The method arguments.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be 0, ProductRef +CronCommandHelp=The system command line to execute. + +# +# Info +# +CronInfoPage=Information + + +# +# Common +# +CronType=Task type +CronType_method=Call method of a Dolibarr Class +CronType_command=Shell command +CronMenu=Cron +CronCannotLoadClass=Cannot load class %s or object %s \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 095e1a63dc6..a20821cd61b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -678,6 +678,10 @@ Permission1411= Lire les mouvements comptables Permission1412= Créer/modifier/annuler les mouvements comptables Permission1415= Lire CA, bilans, résultats, journaux, grands livres Permission1421= Exporter les commandes clients et attributs +Permission23001 = Voir les taches planifiée +Permission23002 = Créer/Modifier les taches planifiée +Permission23003 = Supprimer les taches planifiée +Permission23004 = Executer les taches planifiée Permission2401= Lire les actions (événements ou tâches) liées à son compte Permission2402= Créer/modifier les actions (événements ou tâches) liées à son compte Permission2403= Supprimer les actions (événements ou tâches) liées à son compte diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 1a9bf136e02..d0aaccfecf7 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -1,11 +1,93 @@ # Dolibarr language file - fr_FR - cron CHARSET=UTF-8 -CronSetup=Configuration du séquenceur de taches -CronDesc=Cette page permet de configurer certaines options du séquenceur de taches + +# +# Admin +# +CronSetup = Page de configuration du module - Gestion de tâches planifiées URLToLaunchCronJobs=URL pour lancer les taches automatiques +OrToLaunchASpecificJob=Ou pour lancer une tache spécifique KeyForCronAccess=Clé de sécurité pour l'URL de lancement des taches automatiques -DateLastRun=Dernier lancement -LastOutput=Dernière sortie -LastResult=Dernière code retour -ListOfCronJobs=Liste des taches programmées -Command=Commande \ No newline at end of file +FileToLaunchCronJobs=Commande pour lancer les taches automatiques +CronExplainHowToRunUnix=Sur un environement Unix vous pouvez paramétré CronTab pour executer cette commande toute les minutes +CronExplainHowToRunWin=Sur un environement Microsoft(tm) Windows vous pouvez utilisr le planificateur de tache pour lancer cette commande toute les minutes + +# +# Menu +# +CronListActive= Liste des tâches planifiées active +CronListInactive= Liste des tâches planifiées inactive + + +# +# Page list +# +CronDateLastRun=Dernier lancement +CronLastOutput=Dernière sortie +CronLastResult=Dernier code retour +CronCommand=Commande +CronList= Liste des tâches planifiées +CronDelete= Supprimer la tâche planifiée +CronConfirmDelete= Êtes-vous sûr de vouloir supprimer cette tâche planifiée ? +CronExecute=Exécuter cette tâche +CronConfirmExecute= Êtes-vous sûr de vouloir exécuter cette tâche maintenant? +CronInfo= Les jobs permettent d'exécuter des tâches à intervales réguliers +CronWaitingJobs= Vos jobs en attente: +CronTask= Tâche +CronNone=Aucun(e) +CronDtStart=Date début +CronDtEnd=Date fin +CronDtNextLaunch=Prochaine éxécution +CronDtLastLaunch=Dernière éxécution +CronFrequency=Fréquence +CronClass=Classes +CronMethod=Méthode +CronModule=Module +CronAction=Action +CronStatus=Status +CronStatusActive=Active +CronStatusInactive=Inactive +CronEach=Tou(te)s +CronNoJobs= Aucun jobs actuellement +CronPriority=Priorité +CronLabel=Description +CronNbRun=Nb. exec. +CronDtLastResult=Date du derniétre resulat de la dernière éxécution + +# +#Page card +# +CronAdd= Ajoutez une tâche +CronHourStart= Jour et Heure de début de la tâche +CronEvery= Puis execution toutes les +CronObject= Instance/Objet à créer +CronArgs= Argument +CronSaveSucess=Enregistrement effectué +CronNote=Note +CronFieldMandatory=Le champ %s est obligatoire +CronErrEndDateStartDt=La date de fin ne peux être avant la date de début +CronStatusActiveBtn=Activer +CronStatusInactiveBtn=Désactiver +CronTaskInactive=Cette tâche est désactivée +CronId=Id +CronClassFile=Classes (fichier) +CronModuleHelp=Nom du repertoire du module dolibarr (fonctionne automatiquement avec les modules externe Dolibarr).
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de module est product +CronClassFileHelp=Le fichier qui contient l'objet .
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de classe est product.class.php +CronObjectHelp=Le nom de l'object a crée.
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de objet est Product +CronMethodHelp=La mèthode a lancer.
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de mèthode est fecth +CronArgsHelp=Les arguments de la mèthode.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, la valeur de paramétre pourrait être 0, RefProduit +CronCommandHelp=La commande système a éxecuter + +# +# Info +# +CronInfoPage=Suivie + +# +# Common +# +CronType=Type d'action a executer +CronType_method=Méthode d'une classe d'un module Dolibarr +CronType_command=Commande Shell +CronMenu=Cron +CronCannotLoadClass=impossible de charger la classe %s ou l'object %s \ No newline at end of file diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 75e15a414a0..838c298212f 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr + * Copyright (C) 2013 Florian Henry Export agenda cal'; -} -/** - * Footer function - * - * @return void - */ -function llxFooterVierge() { - print ''; -} - - - -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("cron@cron"); - -// Get parameters -$id = GETPOST('id','int'); -$action = GETPOST('action','alpha'); - -// Protection if external user -if ($user->societe_id > 0) -{ - //accessforbidden(); +// librarie core +// Dolibarr environment +$res = @include("../../main.inc.php"); // From htdocs directory +if (! $res) { + $res = @include("../../../main.inc.php"); // From "custom" directory } +if (! $res) die("Include of master.inc.php fails"); -// Security check -if (empty($conf->cron->enabled)) accessforbidden('',1,1,1); +// librarie jobs +dol_include_once("/cron/class/cronjob.class.php"); -// Check also security key -if (empty($_GET["securitykey"]) || $conf->global->CRON_KEY != $_GET["securitykey"]) -{ - $user->getrights(); - - llxHeaderVierge(); - print '
Bad value for key.
'; - llxFooterVierge(); - exit; + +global $langs, $conf; + +// Check the key, avoid that a stranger starts cron +$key = $_GET['securitykey']; +if (empty($key)) { + echo 'securitykey is require'; + exit; } - - -/******************************************************************* -* ACTIONS -* -* Put here all code to do according to value of "action" parameter -********************************************************************/ - -if ($action == 'add') +if($key != $conf->global->MAIN_CRON_KEY) { - $object=new Cronjobs($db); - $object->prop1=$_POST["field1"]; - $object->prop2=$_POST["field2"]; - $result=$object->create($user); - if ($result > 0) - { - // Creation OK - } - { - // Creation KO - $mesg=$object->error; + echo 'securitykey is wrong'; + exit; +} +// Check the key, avoid that a stranger starts cron +$userlogin = $_GET['userlogin']; +if (empty($userlogin)) { + echo 'userlogin is require'; + exit; +} +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +$user=new User($db); +$result=$user->fetch('',$userlogin); +if ($result<0) { + echo "User Error:".$user->error; + dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); + exit; +}else { + if (empty($user->id)) { + echo " User user login:".$userlogin." do not exists"; + dol_syslog(" User user login:".$userlogin." do not exists", LOG_ERR); + exit; } } +$id = $_GET['id']; +// Language Management +$langs->load("admin"); +$langs->load("cron@cron"); +// create a jobs object +$object = new Cronjob($db); +$filter=array(); +if (empty($id)) { + $filter=array(); + $filter['t.rowid']=$id; +} +$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter); +if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + exit; +} -/*************************************************** -* VIEW -* -* Put here all code to build page -****************************************************/ +// current date +$now=dol_now(); -llxHeader('',$langs->trans('CronList'),''); +if(is_array($object->lines) && (count($object->lines)>0)){ + // Loop over job + foreach($object->lines as $line){ -$form=new Form($db); - - -// Put here content of your page - -// Example 1 : Adding jquery code -print ''; - - -$cronjob=new CronJob($db); -$result=$cronjob->fetch($id); - -if ($result > 0) -{ - - + echo "OK"; +} else { + echo "No Jobs to run"; } -else -{ - $langs->load("errors"); - print $langs->trans("ErrorRecordNotFound"); -} - - -// End of page -llxFooter(); - -$db->close(); -?> diff --git a/htdocs/theme/amarok/img/cron.png b/htdocs/theme/amarok/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/amarok/img/object_cron.png b/htdocs/theme/amarok/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/auguria/img/cron.png b/htdocs/theme/auguria/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/auguria/img/object_cron.png b/htdocs/theme/auguria/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/bureau2crea/img/cron.png b/htdocs/theme/bureau2crea/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/bureau2crea/img/object_cron.png b/htdocs/theme/bureau2crea/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/cameleo/img/cron.png b/htdocs/theme/cameleo/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/cameleo/img/object_cron.png b/htdocs/theme/cameleo/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/menus/cron.png b/htdocs/theme/eldy/img/menus/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/menus/object_cron.png b/htdocs/theme/eldy/img/menus/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php new file mode 100644 index 00000000000..0c22107bde6 --- /dev/null +++ b/scripts/cron/cron_run_jobs.php @@ -0,0 +1,146 @@ +#!/usr/bin/php +. + */ + +/** + * \file cron/script/cron/cron_run_jobs.php + * \ingroup cron + * \brief Execute pendings jobs + */ +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOLOGIN')) define('NOLOGIN','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); + +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + +// Test if batch mode +if (substr($sapi_type, 0, 3) == 'cgi') { + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + exit; +} + +if (! isset($argv[1]) || ! $argv[1]) { + print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; + exit; +} +$key=$argv[1]; + +if (! isset($argv[2]) || ! $argv[2]) { + print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; + exit; +} else { + $userlogin=$argv[2]; +} + + +$res=@include("../../master.inc.php"); // For root directory +if (! $res) $res=@include("../../../master.inc.php"); // For "custom" directory +if (! $res) die("Include of master.inc.php fails"); + + +// librarie jobs +require_once (DOL_DOCUMENT_ROOT_ALT."/cron/class/cronjob.class.php"); + + +//Check security key +if($key != $conf->global->MAIN_CRON_KEY) +{ + echo 'securitykey is wrong'; + exit; +} + +//Check user login +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +$user=new User($db); +$result=$user->fetch('',$userlogin); +if ($result<0) { + echo "User Error:".$user->error; + dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); + exit; +}else { + if (empty($user->id)) { + echo " User user login:".$userlogin." do not exists"; + dol_syslog(" User user login:".$userlogin." do not exists", LOG_ERR); + exit; + } +} + +if (isset($argv[3]) || $argv[3]) { + $id = $argv[3]; +} + +// librarie jobs +require_once (DOL_DOCUMENT_ROOT_ALT."/cron/class/cronjob.class.php"); + +// create a jobs object +$object = new Cronjob($db); + +$filter=array(); +if (empty($id)) { + $filter=array(); + $filter['t.rowid']=$id; +} + +$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter); +if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + exit; +} + +// current date +$now=dol_now(); + +if(is_array($object->lines) && (count($object->lines)>0)){ + // Loop over job + foreach($object->lines as $line){ + + //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database + if (($line->datenextrun < $now) && $line->dateend < $now){ + $cronjob=new Cronjob($db); + $result=$cronjob->fetch($line->id); + if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + exit; + } + // execute methode + $result=$cronjob->run_jobs($userlogin); + if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR); + exit; + } + + // we re-program the next execution and stores the last execution time for this job + $result=$cronjob->reprogram_jobs($userlogin); + if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: reprogram_jobs Error".$cronjob->error, LOG_ERR); + exit; + } + + } + } +} \ No newline at end of file From 52573cad89b58bbbdd7d95ea80cb25203b099d38 Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 22 Mar 2013 15:12:57 +0100 Subject: [PATCH 084/150] New: Remove FEATURE_LEVEL>1 for PDF options hide details, desc and ref --- htdocs/admin/pdf.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 2734bacea2a..80c42edba0c 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-213 Juanjo Menent * * 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 @@ -57,12 +57,12 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { +// if ($conf->global->MAIN_FEATURES_LEVEL > 1) +// { dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); - } +// } header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -224,8 +224,8 @@ if ($action == 'edit') // Edit print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print '
'.$langs->trans("HideDescOnPDF").''; @@ -243,7 +243,7 @@ if ($action == 'edit') // Edit print '
'.$langs->trans("HideDetailsOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1); print '
'; @@ -418,8 +418,8 @@ else // Show print "
'.$langs->trans("HideDescOnPDF").''; @@ -437,7 +437,7 @@ else // Show print '
'.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print '
'; From d2875d4e6d426b2c825aa947d2c4451d1c73de9a Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 22 Mar 2013 15:14:43 +0100 Subject: [PATCH 085/150] [ task #122 ] Create a scheduled cron module --- htdocs/core/lib/cron.lib.php | 7 ++- htdocs/core/modules/modCron.class.php | 63 +++++++-------------- htdocs/cron/admin/cron.php | 10 ++-- htdocs/cron/info.php | 2 +- htdocs/cron/list.php | 8 ++- htdocs/install/mysql/tables/llx_cronjob.sql | 2 +- 6 files changed, 37 insertions(+), 55 deletions(-) diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 5d388c35a16..abd85131e29 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -1,5 +1,6 @@ * * 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 @@ -15,7 +16,7 @@ * along with this program. If not, see . */ /** - * \file htdocs/jobs/lib/jobs.lib.php + * \file cron/lib/cron.lib.php * \brief Ensemble de fonctions de base pour le module jobs * \ingroup jobs */ @@ -52,12 +53,12 @@ function cron_prepare_head($object) $h = 0; $head = array(); - $head[$h][0] = dol_buildpath('/cron/cron/card.php', 1).'?id='.$object->id; + $head[$h][0] = dol_buildpath('/cron/card.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans("CronTask"); $head[$h][2] = 'card'; $h++; - $head[$h][0] = dol_buildpath('/cron/cron/info.php', 1).'?id='.$object->id; + $head[$h][0] = dol_buildpath('/cron/info.php', 1).'?id='.$object->id; $head[$h][1] = $langs->trans("CronInfoPage"); $head[$h][2] = 'info'; $h++; diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 2cf4e9cd9e4..b7bcafc12be 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -60,13 +60,13 @@ class modCron extends DolibarrModules // Config pages //------------- - $this->config_page_url = array("cron"); + $this->config_page_url = array("cron.php@cron"); // Dependancies //------------- $this->depends = array(); $this->requiredby = array(); - $this->langfiles = array("cron"); + $this->langfiles = array("cron@cron"); // Constantes //----------- @@ -122,52 +122,27 @@ class modCron extends DolibarrModules $r=0; $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry - 'titre'=>'CronJobs', - 'url'=>'/cron/index.php', - 'langs'=>'cron@cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, - 'leftmenu'=>'cron', + 'titre'=>'CronListActive', + 'url'=>'/cron/list.php?status=1', + 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>200, 'enabled'=>'$leftmenu==\'modulesadmintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', - 'type'=>'left', - 'titre'=>'CronListActive', - 'url'=>'/cron/cron/list.php?status=1', - 'langs'=>'cron@cron', - 'position'=>201, - 'enabled'=>'$user->rights->cron->read', - 'perms'=>'$user->rights->cron->read', - 'target'=>'', - 'user'=>2); - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', - 'type'=>'left', - 'titre'=>'CronListInactive', - 'url'=>'/cron/cron/list.php?status=0', - 'langs'=>'cron@cron', - 'position'=>201, - 'enabled'=>'$user->rights->cron->read', - 'perms'=>'$user->rights->cron->read', - 'target'=>'', - 'user'=>2); - $r++; - - $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', - 'type'=>'left', - 'titre'=>'CronAdd', - 'url'=>'/cron/cron/card.php?action=create', - 'langs'=>'cron@cron', - 'position'=>202, - 'enabled'=>'$user->rights->cron->create', - 'perms'=>'$user->rights->cron->create', - 'target'=>'', - 'user'=>2); - $r++; + + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'CronListInactive', + 'url'=>'/cron/list.php?status=0', + 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>201, + 'enabled'=>'$leftmenu==\'modulesadmintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $r++; } diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index 238208035f3..894e9dc4457 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -106,10 +106,10 @@ print '

'; // Cron launch print ''.$langs->trans("URLToLaunchCronJobs").':
'; -$url=dol_buildpath('/cron/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login; +$url=dol_buildpath('/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login; print img_picto('','object_globe.png').' '.$url."
\n"; print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; -$url=dol_buildpath('/cron/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; +$url=dol_buildpath('/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; print '
'; @@ -126,11 +126,11 @@ if ($linuxlike) { } print '
'; print ''.$langs->trans("FileToLaunchCronJobs").':
'; -$file=dol_buildpath('/cron/script/cron/cron_run_jobs.php').' '.(empty($conf->global->MAIN_CRON_KEY)?'securitykey':''.$conf->global->MAIN_CRON_KEY.'').' '.$user->login.' cronjobid(optionnal)'; +$file='/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->MAIN_CRON_KEY)?'securitykey':''.$conf->global->MAIN_CRON_KEY.'').' '.$user->login.' cronjobid(optionnal)'; if ($linuxlike) { - print 'user@host:'.DOL_DOCUMENT_ROOT.'$ php '.$file."
\n"; + print 'user@host:'.DOL_DOCUMENT_ROOT.'$ php ..'.$file."
\n"; } else { - print DOL_DOCUMENT_ROOT.'> php '.$file."
\n"; + print DOL_DOCUMENT_ROOT.'> php ..'.$file."
\n"; } print '
'; diff --git a/htdocs/cron/info.php b/htdocs/cron/info.php index b5b9c6d29dc..55c294d54ed 100644 --- a/htdocs/cron/info.php +++ b/htdocs/cron/info.php @@ -47,7 +47,7 @@ $object->info($id); $head = cron_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("CronInfo"), 0, 'bill'); +dol_fiche_head($head, 'info', $langs->trans("CronTask"), 0, 'bill'); print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; if (! empty($conf->banque->enabled)) @@ -701,6 +703,7 @@ if ($rowid) $cotisationstatic->ref=$objp->crowid; $cotisationstatic->id=$objp->crowid; print ''; + print '\n"; print '\n"; print '\n"; print ''; @@ -899,16 +902,18 @@ if ($rowid) // Title payments //print ''; - // Define a way to write payment + // No more action print ''; print ''; @@ -1029,4 +1037,4 @@ else llxFooter(); $db->close(); -?> +?> \ No newline at end of file diff --git a/htdocs/compta/bank/admin/bank.php b/htdocs/admin/bank.php similarity index 93% rename from htdocs/compta/bank/admin/bank.php rename to htdocs/admin/bank.php index a45fa29c912..98a08708dff 100644 --- a/htdocs/compta/bank/admin/bank.php +++ b/htdocs/admin/bank.php @@ -1,6 +1,7 @@ * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -18,12 +19,12 @@ /** - * \file htdocs/compta/bank/admin/bank.php + * \file htdocs/admin/bank.php * \ingroup bank * \brief Page to setup the bank module */ -require '../../../main.inc.php'; +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -87,6 +88,16 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("BankSetupModule"),$linkback,'setup'); print '
'; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/bank.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + print '
'; dol_print_object_info($object); diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 2d472add564..5e972f0e55b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -283,7 +283,13 @@ if (count($object->lines)>0) { print $langs->trans('CronNoJobs'); } -print '
'; +print "\n\n
\n"; +if (! $user->rights->cron->create) { + print ''.$langs->trans("New").''; +} else { + print ''.$langs->trans("New").''; +} +print '

'; llxFooter(); $db->close(); \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index 959a3a1705d..a5bb3c10f59 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -18,7 +18,7 @@ -- =================================================================== -CREATE TABLE IF NOT EXISTS llx_cronjob +CREATE TABLE llx_cronjob ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp, From ab0354f14f6dc68982e48279a7df90ce823dff62 Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 22 Mar 2013 15:15:13 +0100 Subject: [PATCH 086/150] New: Remove FEATURE_LEVEL>1 for PDF options hide details, desc and ref --- htdocs/admin/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 80c42edba0c..5617ecc1dfb 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012-213 Juanjo Menent + * Copyright (C) 2012-2103 Juanjo Menent * * 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 49702ce5788ffe5b88b5f920762bed44fa6e4de3 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 22 Mar 2013 15:18:33 +0100 Subject: [PATCH 087/150] Change module to experimantal --- htdocs/core/modules/modCron.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index b7bcafc12be..53d9afabf30 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -47,7 +47,7 @@ class modCron extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); $this->description = "Enable the Dolibarr cron service"; - $this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version + $this->version = 'experimental'; // 'experimental' or 'dolibarr' or version // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) From 708f0472cd7aba69a5a8d1bf1cb73e377b16fe9b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Mar 2013 16:40:35 +0100 Subject: [PATCH 088/150] Qual: Prepare menu handler to be able to output content into a list. --- htdocs/core/menus/standard/eldy.lib.php | 276 +++++++++++------------ htdocs/core/menus/standard/eldy_menu.php | 47 +++- htdocs/theme/amarok/style.css.php | 2 +- 3 files changed, 178 insertions(+), 147 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 7e459f07f20..c07360abd10 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -33,9 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array &$menu Object Menu to return back list of menu entries + * @param int $noout Disable output (Initialise &$menu only). * @return void */ -function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) +function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) { global $user,$conf,$langs,$dolibarr_main_db_name; @@ -45,18 +46,19 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) $id='mainmenu'; $listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); - print_start_menu_array(); + if (empty($noout)) print_start_menu_array(); // Home + $showmode=1; $classname=""; if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "home") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } else $classname = 'class="tmenu"'; $idsel='home'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("Home"), 1, DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu=', $langs->trans("Home"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("Home"), 1, DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/index.php?mainmenu=home&leftmenu=', $langs->trans("Home"), 0, $showmode, $atarget, "home", ''); // Third parties $tmpentry=array('enabled'=>(! empty($conf->societe->enabled) || ! empty($conf->fournisseur->enabled)), 'perms'=>(! empty($user->rights->societe->lire) || ! empty($user->rights->fournisseur->lire)), 'module'=>'societe|fournisseur'); @@ -71,10 +73,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='companies'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("ThirdParties"), $showmode, DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $langs->trans("ThirdParties"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("ThirdParties"), $showmode, DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/societe/index.php?mainmenu=companies&leftmenu=', $langs->trans("ThirdParties"), 0, $showmode, $atarget, "companies", ''); } // Products-Services @@ -100,10 +102,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) $chaine.=$langs->trans("Services"); } - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu=', $chaine, 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/product/index.php?mainmenu=products&leftmenu=', $chaine, 0, $showmode, $atarget, "products", ''); } // Commercial @@ -124,10 +126,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='commercial'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("Commercial"), $showmode, DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $langs->trans("Commercial"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("Commercial"), $showmode, DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $langs->trans("Commercial"), 0, $showmode, $atarget, "commercial", ""); } // Financial @@ -144,10 +146,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='accountancy'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("MenuFinancial"), $showmode, DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("MenuFinancial"), $showmode, DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/compta/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "accountancy", ''); } // Bank @@ -165,10 +167,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='bank'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("MenuBankCash"), $showmode, DOL_URL_ROOT.'/compta/bank/index.php?mainmenu=bank&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/compta/bank/index.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("MenuBankCash"), $showmode, DOL_URL_ROOT.'/compta/bank/index.php?mainmenu=bank&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/compta/bank/index.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", ''); } // Projects @@ -185,10 +187,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='project'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("Projects"), $showmode, DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $langs->trans("Projects"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("Projects"), $showmode, DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/projet/index.php?mainmenu=project&leftmenu=', $langs->trans("Projects"), 0, $showmode, $atarget, "project", ''); } // Tools @@ -205,10 +207,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='tools'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("Tools"), $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $langs->trans("Tools"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("Tools"), $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $langs->trans("Tools"), 0, $showmode, $atarget, "tools", ''); } // OSCommerce 1 @@ -225,10 +227,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='shop'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("OSCommerce"), $showmode, DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu=', $langs->trans("OSCommerce"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("OSCommerce"), $showmode, DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/boutique/index.php?mainmenu=shop&leftmenu=', $langs->trans("OSCommerce"), 0, $showmode, $atarget, "shop", ''); } // Members @@ -243,10 +245,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) else $classname = 'class="tmenu"'; $idsel='members'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($langs->trans("MenuMembers"), $showmode, DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $id, $idsel, $classname, $atarget); - print_end_menu_entry(); - $menu->add(DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $langs->trans("MenuMembers"), 0, $showmode, $atarget, $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($langs->trans("MenuMembers"), $showmode, DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry(); + $menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $langs->trans("MenuMembers"), 0, $showmode, $atarget, "members", ''); } @@ -262,23 +264,24 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) $showmode=dol_eldy_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal); if ($showmode == 1) { - if (preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) + $url = $newTabMenu[$i]['url']; + if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) { $url = $newTabMenu[$i]['url']; - } - else - { - $url=dol_buildpath($newTabMenu[$i]['url'],1); + $param=''; if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url)) { - if (! preg_match('/\?/',$url)) $url.='?'; - else $url.='&'; - $url.='mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; + if (! preg_match('/\?/',$url)) $param.='?'; + else $param.='&'; + $param.='mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu='; } //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad + $url = dol_buildpath($url,1).$param; + $shorturl = $newTabMenu[$i]['url'].$param; } $url=preg_replace('/__LOGIN__/',$user->login,$url); - + $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); + // Define the class (top menu selected or not) if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; else if (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"'; @@ -286,13 +289,13 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) } else if ($showmode == 2) $classname='class="tmenu"'; - print_start_menu_entry($idsel,$classname); - print_text_menu_entry($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); - print_end_menu_entry(); - $menu->add($url, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), $mainmenu, $leftmenu); + if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_text_menu_entry($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); + if (empty($noout)) print_end_menu_entry(); + $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ''); } - print_end_menu_array(); + if (empty($noout)) print_end_menu_array(); } @@ -391,19 +394,22 @@ function print_end_menu_array() * @param array $menu_array_after Table of menu entries to show after entries of menu handler * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array &$menu Object Menu to return back list of menu entries + * @param int $noout Disable output (Initialise &$menu only). + * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' + * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) * @return void */ -function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu) +function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='') { global $user,$conf,$langs,$dolibarr_main_db_name,$mysoc; $newmenu = $menu; - $mainmenu=$_SESSION["mainmenu"]; - $leftmenu=$_SESSION["leftmenu"]; + $mainmenu=($forcemainmenu?$forcemainmenu:$_SESSION["mainmenu"]); + $leftmenu=($forceleftmenu?'':$_SESSION["leftmenu"]); // Show logo company - if (! empty($conf->global->MAIN_SHOW_LOGO)) + if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO)) { $mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) @@ -1164,107 +1170,91 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! is_array($menu_array)) return 0; // Show menu - $alt=0; - $num=count($menu_array); - for ($i = 0; $i < $num; $i++) + if (empty($noout)) { - $showmenu=true; - if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false; - - $alt++; - if (empty($menu_array[$i]['level']) && $showmenu) + $alt=0; + $num=count($menu_array); + for ($i = 0; $i < $num; $i++) { - if (($alt%2==0)) + $showmenu=true; + if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false; + + $alt++; + if (empty($menu_array[$i]['level']) && $showmenu) { - print '
'."\n"; + if (($alt%2==0)) + { + print '
'."\n"; + } + else + { + print '
'."\n"; + } } - else + + // Place tabulation + $tabstring=''; + $tabul=($menu_array[$i]['level'] - 1); + if ($tabul > 0) { - print '
'."\n"; + for ($j=0; $j < $tabul; $j++) + { + $tabstring.='   '; + } } - } - - // Place tabulation - $tabstring=''; - $tabul=($menu_array[$i]['level'] - 1); - if ($tabul > 0) - { - for ($j=0; $j < $tabul; $j++) + + // For external modules + $url = dol_buildpath($menu_array[$i]['url'], 1); + + print ''."\n"; + + // Menu niveau 0 + if ($menu_array[$i]['level'] == 0) { - $tabstring.='   '; + if ($menu_array[$i]['enabled']) + { + print ''."\n"; + } + else if ($showmenu) + { + print ''."\n"; + } + if ($showmenu) + print ''."\n"; } - } - - // For external modules - $url = dol_buildpath($menu_array[$i]['url'], 1); - - print ''."\n"; - - // Menu niveau 0 - if ($menu_array[$i]['level'] == 0) - { - if ($menu_array[$i]['enabled']) + // Menu niveau > 0 + if ($menu_array[$i]['level'] > 0) { - print ''."\n"; + if ($menu_array[$i]['enabled']) + { + print ''."\n"; + } + else if ($showmenu) + { + print ''."\n"; + } } - else if ($showmenu) + + // If next is a new block or end + if (empty($menu_array[$i+1]['level'])) { - print ''."\n"; + if ($showmenu) + print ''."\n"; + print "
\n"; } - if ($showmenu) - print ''."\n"; - } - // Menu niveau > 0 - if ($menu_array[$i]['level'] > 0) - { - if ($menu_array[$i]['enabled']) - { - print ''."\n"; - } - else if ($showmenu) - { - print ''."\n"; - } - } - - // If next is a new block or end - if (empty($menu_array[$i+1]['level'])) - { - if ($showmenu) - print ''."\n"; - print "
\n"; } } - + return count($menu_array); } -/** - * Core function to output top menu eldy - * - * @param DoliDB $db Database handler - * @param string $atarget Target - * @param int $type_user 0=Menu for backoffice, 1=Menu for front office - * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @return void - */ -function print_jmobile_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu) -{ - print '
    '; - foreach ($tabMenu as $key => $val) - { - print '
  • '.$key.'
  • '; - } - print '
'; -} - /** * Function to test if an entry is enabled or not * diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 2b4ad8c97a7..f920a905983 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -112,7 +112,7 @@ class MenuManager */ function showmenu($mode) { - global $conf; + global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php'; @@ -129,12 +129,53 @@ class MenuManager if ($mode == 'top') $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu); if ($mode == 'left') $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu); - if ($mode == 'jmobile') $res=print_jmobile_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$this->menu); + if ($mode == 'jmobile') + { + $res=print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); + + foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + { + print '
    '; + print '
  • '; + if ($val['enabled'] == 1) + { + $relurl=dol_buildpath($val['url'],1); + + print ''.$val['titre'].''."\n"; + + $submenu=new Menu(); + $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$val['mainmenu'],$val['leftmenu']); + $nexturl=dol_buildpath($submenu->liste[0]['url'],1); + $canonrelurl=preg_replace('/\?.*$/','',$relurl); + $canonnexturl=preg_replace('/\?.*$/','',$nexturl); + //var_dump($canonrelurl); + //var_dump($canonnexturl); + if ($canonrelurl != $canonnexturl && $val['mainmenu'] != 'home') + { + // We add sub entry + print '
  • '.$langs->trans("MainArea").'-'.$val['titre'].'
  • '."\n"; + } + var_dump($val['titre']); + foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' + { + $relurl2=dol_buildpath($val2['url'],1); + print '
  • '.$val2['titre'].'
  • '."\n"; + } + //var_dump($submenu); + } + if ($val['enabled'] == 2) + { + print ''.$val['titre'].''; + } + print ''; + print '
'."\n"; + print 'wwwwwww'; + } + } unset($this->menu); //print 'xx'.$mode; - //var_dump($this->menu); return $res; } diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index cb7d355ef9a..8c92d9e561b 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -388,7 +388,7 @@ div.tmenu ul li a.tmenusel {/* texte du menu principal sélectionné */ font-weight:bold; } -.tmenudisabled {color:#d0d0d0 !important;} +.tmenudisabled { color:#808080 !important; cursor: not-allowed; } /* --- end nav --- */ From 2ec462dcf4814b5ea9e805faf72435d8e37dc469 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Mar 2013 17:00:55 +0100 Subject: [PATCH 089/150] Fix: [ task #771 ] harmonize length of zipcode New: Add personal address for users. --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 12 +++++++++++- htdocs/install/mysql/tables/llx_societe.sql | 2 +- htdocs/install/mysql/tables/llx_user.sql | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index a8a57e7750d..d5fb257cead 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -153,4 +153,14 @@ ALTER TABLE llx_holiday ADD COLUMN note_public text; -- Add new trigger on Invoice BILL_UNVALIDATE + Index INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); -ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang) +ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang) + +ALTER TABLE llx_societe MODIFY COLUMN zip varchar(25); + + +ALTER TABLE llx_user ADD COLUMN address varchar(255); +ALTER TABLE llx_user ADD COLUMN zip varchar(25); +ALTER TABLE llx_user ADD COLUMN town varchar(50); +ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; -- +ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; + diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index 2c09e7a60fb..786bfa92d38 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -41,7 +41,7 @@ create table llx_societe code_compta varchar(24), -- code compta client code_compta_fournisseur varchar(24), -- code compta founisseur address varchar(255), -- company address - zip varchar(10), -- zipcode + zip varchar(25), -- zipcode town varchar(50), -- town fk_departement integer DEFAULT 0, -- fk_pays integer DEFAULT 0, -- diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 3974096085f..0a3f63d873d 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -35,6 +35,11 @@ create table llx_user civilite varchar(6), name varchar(50), firstname varchar(50), + address varchar(255), -- user personal address + zip varchar(25), -- zipcode + town varchar(50), -- town + fk_state integer DEFAULT 0, -- + fk_country integer DEFAULT 0, -- job varchar(128), office_phone varchar(20), office_fax varchar(20), From 350bcea1833485e9e953bb7953d960c237e94ea9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Mar 2013 17:10:17 +0100 Subject: [PATCH 090/150] Merge --- ChangeLog | 1 + htdocs/adherents/card_subscriptions.php | 18 +- htdocs/{compta/bank => }/admin/bank.php | 15 +- htdocs/admin/commande.php | 99 +- htdocs/admin/compta.php | 20 +- htdocs/admin/contract.php | 18 +- htdocs/admin/dons.php | 88 +- htdocs/admin/ecm.php | 11 + htdocs/admin/fichinter.php | 123 +- htdocs/admin/mailing.php | 10 + htdocs/admin/pdf.php | 20 +- htdocs/admin/prelevement.php | 11 + htdocs/admin/project.php | 38 +- htdocs/admin/stock.php | 20 +- htdocs/admin/taxes.php | 11 + htdocs/comm/action/fiche.php | 2 +- htdocs/comm/propal.php | 4491 +++++++++-------- htdocs/commande/class/commande.class.php | 6 + htdocs/commissions/admin/commissions.php | 192 - htdocs/commissions/index.php | 329 -- htdocs/commissions/lib/commissions.lib.php | 52 - .../facture/class/facture-rec.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 22 +- htdocs/compta/recap-compta.php | 23 +- .../compta/ventilation/fournisseur/index.php | 8 +- htdocs/compta/ventilation/lignes.php | 6 +- htdocs/compta/ventilation/liste.php | 2 +- htdocs/contrat/class/contrat.class.php | 12 +- htdocs/contrat/fiche.php | 214 +- htdocs/core/class/commonobject.class.php | 27 +- htdocs/core/class/html.formcron.class.php | 93 + htdocs/core/lib/company.lib.php | 5 + htdocs/core/lib/cron.lib.php | 71 + htdocs/core/menus/standard/eldy.lib.php | 8 +- .../doc/pdf_expedition_merou.modules.php | 4 +- .../doc/pdf_expedition_rouget.modules.php | 4 +- htdocs/core/modules/modBanque.class.php | 2 +- htdocs/core/modules/modCommissions.class.php | 169 - htdocs/core/modules/modCron.class.php | 83 +- htdocs/core/tpl/objectline_view.tpl.php | 90 +- htdocs/cron/admin/cron.php | 139 +- htdocs/cron/card.php | 596 +++ htdocs/cron/class/cronjob.class.php | 696 ++- htdocs/cron/functions_cron.lib.php | 27 - htdocs/cron/index.php | 219 - htdocs/cron/info.php | 59 + htdocs/cron/list.php | 295 ++ htdocs/expedition/class/expedition.class.php | 12 +- htdocs/expedition/fiche.php | 22 +- .../install/mysql/migration/3.3.0-3.4.0.sql | 39 +- htdocs/install/mysql/tables/llx_cronjob.sql | 84 +- .../mysql/tables/llx_facture_fourn_det.sql | 1 + .../install/mysql/tables/llx_facturedet.sql | 1 - htdocs/install/mysql/tables/llx_paiement.sql | 9 +- htdocs/install/pgsql/functions/functions.sql | 1 + htdocs/langs/ar_SA/main.lang | 2 - htdocs/langs/ar_SA/members.lang | 2 +- htdocs/langs/bg_BG/members.lang | 2 +- htdocs/langs/ca_ES/commissions.lang | 41 - htdocs/langs/ca_ES/orders.lang | 4 +- htdocs/langs/da_DK/members.lang | 2 +- htdocs/langs/el_GR/members.lang | 2 +- htdocs/langs/en_US/admin.lang | 6 +- htdocs/langs/en_US/commissions.lang | 44 - htdocs/langs/en_US/companies.lang | 1 + htdocs/langs/en_US/compta.lang | 4 +- htdocs/langs/en_US/cron.lang | 90 +- htdocs/langs/en_US/main.lang | 2 +- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/es_ES/commissions.lang | 41 - htdocs/langs/es_ES/orders.lang | 4 +- htdocs/langs/et_EE/members.lang | 2 +- htdocs/langs/fa_IR/members.lang | 2 +- htdocs/langs/fi_FI/members.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 6 +- htdocs/langs/fr_FR/commissions.lang | 44 - htdocs/langs/fr_FR/companies.lang | 1 + htdocs/langs/fr_FR/compta.lang | 2 + htdocs/langs/fr_FR/cron.lang | 96 +- htdocs/langs/fr_FR/main.lang | 2 +- htdocs/langs/he_IL/members.lang | 2 +- htdocs/langs/hu_HU/members.lang | 2 +- htdocs/langs/is_IS/members.lang | 2 +- htdocs/langs/it_IT/members.lang | 2 +- htdocs/langs/ja_JP/members.lang | 2 +- htdocs/langs/nb_NO/members.lang | 2 +- htdocs/langs/pl_PL/members.lang | 2 +- htdocs/langs/pt_PT/members.lang | 2 +- htdocs/langs/ro_RO/members.lang | 2 +- htdocs/langs/sv_SE/members.lang | 2 +- htdocs/langs/zh_TW/members.lang | 2 +- htdocs/margin/agentMargins.php | 35 +- htdocs/margin/customerMargins.php | 37 +- htdocs/margin/productMargins.php | 31 +- htdocs/margin/tabs/productMargins.php | 14 +- htdocs/margin/tabs/thirdpartyMargins.php | 14 +- htdocs/public/cron/cron_run_jobs.php | 243 +- htdocs/societe/consumption.php | 439 ++ htdocs/theme/amarok/img/cron.png | Bin 0 -> 2165 bytes htdocs/theme/amarok/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/amarok/style.css.php | 17 +- htdocs/theme/auguria/img/cron.png | Bin 0 -> 2165 bytes .../theme/auguria/img/object_commissions.png | Bin 651 -> 0 bytes htdocs/theme/auguria/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/bureau2crea/img/cron.png | Bin 0 -> 2165 bytes .../bureau2crea/img/object_commissions.png | Bin 651 -> 0 bytes htdocs/theme/bureau2crea/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/cameleo/img/cron.png | Bin 0 -> 2165 bytes .../theme/cameleo/img/object_commissions.png | Bin 651 -> 0 bytes htdocs/theme/cameleo/img/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/eldy/img/menus/cron.png | Bin 0 -> 2165 bytes htdocs/theme/eldy/img/menus/object_cron.png | Bin 0 -> 655 bytes htdocs/theme/eldy/img/object_commissions.png | Bin 651 -> 0 bytes scripts/cron/cron_run_jobs.php | 146 + 114 files changed, 5882 insertions(+), 4141 deletions(-) rename htdocs/{compta/bank => }/admin/bank.php (93%) delete mode 100644 htdocs/commissions/admin/commissions.php delete mode 100644 htdocs/commissions/index.php delete mode 100644 htdocs/commissions/lib/commissions.lib.php create mode 100644 htdocs/core/class/html.formcron.class.php create mode 100644 htdocs/core/lib/cron.lib.php delete mode 100644 htdocs/core/modules/modCommissions.class.php create mode 100644 htdocs/cron/card.php delete mode 100644 htdocs/cron/functions_cron.lib.php delete mode 100644 htdocs/cron/index.php create mode 100644 htdocs/cron/info.php create mode 100644 htdocs/cron/list.php delete mode 100644 htdocs/langs/ca_ES/commissions.lang delete mode 100644 htdocs/langs/en_US/commissions.lang delete mode 100644 htdocs/langs/es_ES/commissions.lang delete mode 100644 htdocs/langs/fr_FR/commissions.lang create mode 100644 htdocs/societe/consumption.php create mode 100644 htdocs/theme/amarok/img/cron.png create mode 100644 htdocs/theme/amarok/img/object_cron.png create mode 100644 htdocs/theme/auguria/img/cron.png delete mode 100644 htdocs/theme/auguria/img/object_commissions.png create mode 100644 htdocs/theme/auguria/img/object_cron.png create mode 100644 htdocs/theme/bureau2crea/img/cron.png delete mode 100644 htdocs/theme/bureau2crea/img/object_commissions.png create mode 100644 htdocs/theme/bureau2crea/img/object_cron.png create mode 100644 htdocs/theme/cameleo/img/cron.png delete mode 100644 htdocs/theme/cameleo/img/object_commissions.png create mode 100644 htdocs/theme/cameleo/img/object_cron.png create mode 100644 htdocs/theme/eldy/img/menus/cron.png create mode 100644 htdocs/theme/eldy/img/menus/object_cron.png delete mode 100644 htdocs/theme/eldy/img/object_commissions.png create mode 100644 scripts/cron/cron_run_jobs.php diff --git a/ChangeLog b/ChangeLog index f7eedaf2369..66e4a8cfd89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3 ***** For users: +- New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Some performance enhancements. - New: Can attach files onto trip and expenses modules. - New: Add option MAIN_PDF_TITLE_BACKGROUND_COLOR. diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 25767e8f5b2..279669497ec 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -660,6 +660,7 @@ if ($rowid) { $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe,"; $sql.= " c.rowid as crowid, c.cotisation,"; + $sql.= " c.datec,"; $sql.= " c.dateadh,"; $sql.= " c.datef,"; $sql.= " c.fk_bank,"; @@ -683,7 +684,8 @@ if ($rowid) print '
'.$langs->trans("Ref").''.$langs->trans("DateSubscription").''.$langs->trans("DateCreation").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$cotisationstatic->getNomUrl(1).''.dol_print_date($db->jdate($objp->datec),'dayhour')."'.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).'
'.$langs->trans("Payment").'
'.$langs->trans('MoreActions'); print ''; print ' '.$langs->trans("None").'
'; + // Add entry into bank accoun if (! empty($conf->banque->enabled)) { print ' '.$langs->trans("MoreActionBankDirect").'
'; } + // Add invoice with no payments if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print ' '.$langs->trans("MoreActionInvoiceOnly"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else - { + { print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; print $langs->trans("CreateDolibarrThirdParty"); print ')'; } + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0).'.'; print '
'; } + // Add invoice with payments if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print ' '.$langs->trans("MoreActionBankViaInvoice"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; else - { + { print ' ('.$langs->trans("NoThirdPartyAssociatedToMember"); print ' - '; print $langs->trans("CreateDolibarrThirdParty"); print ')'; } + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0).'.'; print '
'; } print '
'; print ''; print ''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 7dda6ded0e4..2a225234af6 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -66,7 +66,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -111,74 +111,36 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='order'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - if ($db->query($sql)) - { - - } + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $type='order'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql.= " WHERE nom = '".$db->escape($value)."'"; - $sql.= " AND type = '".$type."'"; - $sql.= " AND entity = ".$conf->entity; - - if ($db->query($sql)) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent $conf->global->COMMANDE_ADDON_PDF = $value; } // On active le modele - $type='order'; - - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."'"; - $sql_del.= " AND type = '".$type."'"; - $sql_del.= " AND entity = ".$conf->entity; - dol_syslog("Delete from model table ".$sql_del); - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$value."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$scandir."'":"null"); - $sql.= ")"; - dol_syslog("Insert into model table ".$sql); - $result2=$db->query($sql); - if ($result1 && $result2) + $ret = delDocumentModel($value, $type); + if ($ret > 0) { - $db->commit(); - } - else - { - dol_syslog("Error ".$db->lasterror(), LOG_ERR); - $db->rollback(); + $ret = addDocumentModel($value, $type, $label, $scandir); } } @@ -240,10 +202,18 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup'); print '
'; +$h = 0; +$head[$h][0] = DOL_URL_ROOT."/admin/commande.php"; +$head[$h][1] = $langs->trans("Orders"); +$head[$h][2] = 'Order'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); /* - * Numbering module + * Orders Numbering model */ print_titre($langs->trans("OrdersNumberingModules")); @@ -276,22 +246,22 @@ foreach ($dirmodels as $reldir) { $file = substr($file, 0, dol_strlen($file)-4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print '
'; - // Show example of numbering module + // Show example of numbering model print '
'.$langs->trans("Parameters").'
'.$module->nom."\n"; print $module->info(); print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -508,11 +478,14 @@ foreach ($dirmodels as $reldir) } print '
'; - -//Autres Options print "
"; -print_titre($langs->trans("OtherOptions")); +/* + * Other options + * + */ + +print_titre($langs->trans("OtherOptions")); print ''; print ''; print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index e45a316858f..a5213413d54 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -2,7 +2,8 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -35,6 +36,10 @@ accessforbidden(); $action = GETPOST('action','alpha'); +/* + * Actions + */ + $compta_mode = defined('COMPTA_MODE')?COMPTA_MODE:'RECETTES-DEPENSES'; if ($action == 'setcomptamode') @@ -87,7 +92,7 @@ if ($action == 'update' || $action == 'add') }*/ /* - * Affichage page + * View */ llxHeader(); @@ -97,9 +102,18 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans('ComptaSetup'),$linkback,'setup'); - print '
'; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/compta.php"; +$head[$h][1] = $langs->trans("Compta"); +$head[$h][2] = 'Compta'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + print '
'.$langs->trans("Parameter").'
'; // Cas du parametre COMPTA_MODE diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 80e1547b33f..5e32dd097d0 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -1,5 +1,6 @@ + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -27,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $langs->load("admin"); $langs->load("errors"); +$langs->load("contracts"); if (!$user->admin) accessforbidden(); @@ -88,6 +90,20 @@ print_fiche_titre($langs->trans("ContractsSetup"),$linkback,'setup'); print "
"; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/contract.php"; +$head[$h][1] = $langs->trans("Contracts"); +$head[$h][2] = 'Contract'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +/* + * Contracts Numbering model + */ + print_titre($langs->trans("ContractsNumberingModules")); print '
'; @@ -129,7 +145,7 @@ if (is_resource($handle)) print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print '"; } - // Defaut + // Default print "
'; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } diff --git a/htdocs/admin/dons.php b/htdocs/admin/dons.php index 21c2b3a1a59..0176436c928 100644 --- a/htdocs/admin/dons.php +++ b/htdocs/admin/dons.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -47,7 +48,7 @@ if ($action == 'specimen') $don = new Don($db); $don->initAsSpecimen(); - // Charge le modele + // Search template files $dir = DOL_DOCUMENT_ROOT . "/core/modules/dons/"; $file = $modele.".modules.php"; if (file_exists($dir.$file)) @@ -75,67 +76,39 @@ if ($action == 'specimen') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { - $value = GETPOST('value','alpha'); - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $db->begin(); + if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity)) + { + // La constante qui a ete lue en avant du nouveau set + // on passe donc par une variable pour avoir un affichage coherent + $conf->global->DON_ADDON_MODEL = $value; + } - if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity)) - { - $conf->global->DON_ADDON_MODEL = $value; - } - - // On active le modele - $type='donation'; - $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql_del.= " WHERE nom = '".$db->escape($value)."' AND type = '".$type."'"; - $result1=$db->query($sql_del); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $result2=$db->query($sql); - if ($result1 && $result2) - { - $db->commit(); - } - else - { - $db->rollback(); - } + // On active le modele + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + $ret = addDocumentModel($value, $type, $label, $scandir); + } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { - $value = GETPOST('value','alpha'); - $label = GETPOST('label','alpha'); - $scandir = GETPOST('scandir','alpha'); - - $type='donation'; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)"; - $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", "; - $sql.= ($label?"'".$db->escape($label)."'":'null').", "; - $sql.= (! empty($scandir)?"'".$db->escape($scandir)."'":"null"); - $sql.= ")"; - $resql=$db->query($sql); + $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { - $value = GETPOST('value','alpha'); - - $type='donation'; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model"; - $sql .= " WHERE nom = '".$value."' AND type = '".$type."'"; - $resql=$db->query($sql); + $ret = delDocumentModel($value, $type); + if ($ret > 0) + { + if ($conf->global->DON_ADDON_MODEL == "$value") dolibarr_del_const($db, 'DON_ADDON_MODEL',$conf->entity); + } } - /* * View */ @@ -147,6 +120,17 @@ llxHeader('',$langs->trans("DonationsSetup"),'DonConfiguration'); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("DonationsSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/dons.php"; +$head[$h][1] = $langs->trans("Donations"); +$head[$h][2] = 'Donation'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); // Document templates diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 908b36dbabb..45a142d8190 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -70,6 +70,17 @@ llxHeader('',$langs->trans("ECMSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("ECMSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/ecm.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); print ''; print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 708acf6bc86..023593ea2a7 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -6,7 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -67,42 +67,7 @@ if ($action == 'updateMask') } } -if ($action == 'set_FICHINTER_FREE_TEXT') -{ - $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'set_FICHINTER_DRAFT_WATERMARK') -{ - $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); - - $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - - if (! $res > 0) $error++; - - if (! $error) - { - $mesg = "".$langs->trans("SetupSaved").""; - } - else - { - $mesg = "".$langs->trans("Error").""; - } -} - -if ($action == 'specimen') +else if ($action == 'specimen') // For fiche inter { $modele= GETPOST('module','alpha'); @@ -147,12 +112,13 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -161,7 +127,8 @@ if ($action == 'del') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { @@ -178,7 +145,7 @@ if ($action == 'setdoc') } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -186,6 +153,41 @@ if ($action == 'setmod') dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity); } +else if ($action == 'set_FICHINTER_FREE_TEXT') +{ + $freetext= GETPOST('FICHINTER_FREE_TEXT','alpha'); + $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + +else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') +{ + $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); + + $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = "".$langs->trans("SetupSaved").""; + } + else + { + $mesg = "".$langs->trans("Error").""; + } +} + /* * View @@ -202,6 +204,17 @@ print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup'); print "
"; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/fichinter.php"; +$head[$h][1] = $langs->trans("Interventions"); +$head[$h][2] = 'Ficheinter'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +// Interventions numbering model print_titre($langs->trans("FicheinterNumberingModules")); @@ -234,22 +247,22 @@ foreach ($dirmodels as $reldir) $file = $reg[1]; $classname = substr($file,4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/fichinter/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - + if ($module->isEnabled()) { + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $var=!$var; print '
'; - // Show example of numbering module + // Show example of numbering model print '
'.$module->nom."\n"; print $module->info(); print ''; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -295,6 +308,9 @@ foreach ($dirmodels as $reldir) print '

'; +/* + * Documents models for Interventions + */ print_titre($langs->trans("TemplatePDFInterventions")); @@ -377,7 +393,7 @@ foreach ($dirmodels as $reldir) print "
"; if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { @@ -413,11 +429,14 @@ foreach ($dirmodels as $reldir) } print '
'; - -//Autres Options print "
"; -print_titre($langs->trans("OtherOptions")); +/* + * Other options + * + */ + +print_titre($langs->trans("OtherOptions")); print ''; print ''; print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index ea5c9b7bbb4..87252252d65 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -103,6 +103,16 @@ llxHeader('',$langs->trans("MailingSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("MailingSetup"),$linkback,'setup'); +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/mailing.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + dol_htmloutput_mesg($mesg); diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 2734bacea2a..5617ecc1dfb 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2103 Juanjo Menent * * 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 @@ -57,12 +57,12 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity); - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { +// if ($conf->global->MAIN_FEATURES_LEVEL > 1) +// { dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); - } +// } header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -224,8 +224,8 @@ if ($action == 'edit') // Edit print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1); print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { +// if ($conf->global->MAIN_FEATURES_LEVEL > 1) +// { //Desc $var=!$var; print ''; - } +// } print '
'.$langs->trans("Parameter").'
'.$langs->trans("HideDescOnPDF").''; @@ -243,7 +243,7 @@ if ($action == 'edit') // Edit print '
'.$langs->trans("HideDetailsOnPDF").''; print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1); print '
'; @@ -418,8 +418,8 @@ else // Show print ""; print ''; - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { +// if ($conf->global->MAIN_FEATURES_LEVEL > 1) +// { //Desc $var=!$var; print ''.$langs->trans("HideDescOnPDF").''; @@ -437,7 +437,7 @@ else // Show print ''.$langs->trans("HideDetailsOnPDF").''; print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1); print ''; - } +// } print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index f5dfb2bc8fb..2e21c3cfb4c 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -117,6 +117,17 @@ llxHeader('',$langs->trans("WithdrawalsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("WithdrawalsSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/prelevement.php"; +$head[$h][1] = $langs->trans("Withdrawals"); +$head[$h][2] = 'Withdrawal'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); print ''; print ''; diff --git a/htdocs/admin/project.php b/htdocs/admin/project.php index 8ea4910541c..f2f216d7b52 100644 --- a/htdocs/admin/project.php +++ b/htdocs/admin/project.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010 Regis Houssin * Copyright (C) 2011 Laurent Destailleur * Copyright (C) 2011-2012 Juanjo Menent - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2013 Philippe Grand * * 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 @@ -66,7 +66,7 @@ if ($action == 'updateMask') } } -if ($action == 'specimen') +else if ($action == 'specimen') { $modele=GETPOST('module','alpha'); @@ -111,12 +111,13 @@ if ($action == 'specimen') } } -if ($action == 'set') +// Activate a model +else if ($action == 'set') { $ret = addDocumentModel($value, $type, $label, $scandir); } -if ($action == 'del') +else if ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) @@ -125,7 +126,8 @@ if ($action == 'del') } } -if ($action == 'setdoc') +// Set default model +else if ($action == 'setdoc') { if (dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) { @@ -142,7 +144,7 @@ if ($action == 'setdoc') } } -if ($action == 'setmod') +else if ($action == 'setmod') { // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated @@ -156,7 +158,7 @@ if ($action == 'setmod') $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); -llxHeader(); +llxHeader("",$langs->trans("ProjectsSetup")); $form=new Form($db); @@ -165,8 +167,20 @@ print_fiche_titre($langs->trans("ProjectsSetup"),$linkback,'setup'); print "
"; +$h = 0; -// Project numbering module +$head[$h][0] = DOL_URL_ROOT."/admin/project.php"; +$head[$h][1] = $langs->trans("Projects"); +$head[$h][2] = 'Project'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + +/* + * Projects Numbering model + */ + print_titre($langs->trans("ProjectsNumberingModules")); print ''; @@ -198,7 +212,7 @@ foreach ($dirmodels as $reldir) $file = $reg[1]; $classname = substr($file,4); - require_once DOL_DOCUMENT_ROOT ."/core/modules/project/".$file.'.php'; + require_once $dir.$file.'.php'; $module = new $file; @@ -213,7 +227,7 @@ foreach ($dirmodels as $reldir) print $module->info(); print ''; - // Show example of numbering module + // Show example of numbering model print '
'; $tmp=$module->getExample(); if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; @@ -269,7 +283,7 @@ print '

'; /* - * Modeles documents for projects + * Document templates generators */ print_titre($langs->trans("ProjectsModelModule")); @@ -352,7 +366,7 @@ foreach ($dirmodels as $reldir) print ""; } - // Defaut + // Default print ""; if ($conf->global->PROJECT_ADDON_PDF == "$name") { diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 1f40461ca0f..ba28ea15635 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -3,6 +3,7 @@ * Copyright (C) 2008-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2013 Philippe Grand * * 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 @@ -97,6 +98,16 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("StockSetup"),$linkback,'setup'); print '
'; +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/stock.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); + $form=new Form($db); $var=true; print ''; @@ -124,9 +135,12 @@ print '' print ''; print "\n"; print "\n"; - +print '
'; +print '
'; +print '
'; // Title rule for stock decrease +print ''; print ''; print " \n"; print " \n"; @@ -174,9 +188,11 @@ if (! empty($conf->expedition->enabled)) print ''; print "\n\n\n"; } - +print '
".$langs->trans("RuleForStockManagementDecrease")." 
'; +print '
'; // Title rule for stock increase +print ''; print ''; print " \n"; print " \n"; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index bf5e0db26a6..8e547bd4e21 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -121,6 +121,17 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans('TaxSetup'),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/taxes.php"; +$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][2] = 'general'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); print '
'; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index c7ac95111b1..07a6647f4bb 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -575,7 +575,7 @@ if ($action == 'create') $numproject=select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid'); if ($numproject==0) { - print '   '.$langs->trans("AddProject").''; + print '   '.$langs->trans("AddProject").''; } print ''; } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index eb4278cb528..b74ebd11938 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1,747 +1,747 @@ - - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel -* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/comm/propal.php - * \ingroup propale - * \brief Page of commercial proposals card and list - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->projet->enabled)) -{ - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -} - -$langs->load('companies'); -$langs->load('propal'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('orders'); -$langs->load('products'); -$langs->load("deliveries"); -if (! empty($conf->margin->enabled)) - $langs->load('margins'); - -$error=0; - -$id=GETPOST('id','int'); -$ref=GETPOST('ref','alpha'); -$socid=GETPOST('socid','int'); -$action=GETPOST('action','alpha'); -$origin=GETPOST('origin','alpha'); -$originid=GETPOST('originid','int'); -$confirm=GETPOST('confirm','alpha'); -$lineid=GETPOST('lineid','int'); - -//PDF -$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); -$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); - -// Nombre de ligne pour choix de produit/service predefinis -$NBLINES=4; - -// Security check -if (! empty($user->societe_id)) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); - -$object = new Propal($db); -$extrafields = new ExtraFields($db); - -// Load object -if ($id > 0 || ! empty($ref)) -{ - $ret=$object->fetch($id, $ref); - if ($ret > 0) $ret=$object->fetch_thirdparty(); - if ($ret < 0) dol_print_error('',$object->error); -} - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('propalcard')); - - - -/* - * Actions - */ - -$parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - -// Action clone object -if ($action == 'confirm_clone' && $confirm == 'yes') -{ - if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) - { - setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); - } - else - { - if ($object->id > 0) - { - $result=$object->createFromClone($socid); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); - exit; - } - else - { - setEventMessage($object->error, 'errors'); - $action=''; - } - } - } -} - -// Suppression de la propale -else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) -{ - $result=$object->delete($user); - if ($result > 0) - { - header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); - exit; - } - else - { - $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); - } -} - -// Remove line -else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) -{ - $result = $object->deleteline($lineid); - // reorder lines - if ($result) $object->line_order(true); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; -} - -// Validation -else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) -{ - $result=$object->valid($user); - if ($result >= 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - } - else - { - $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); - } -} - -else if ($action == 'setdate' && $user->rights->propal->creer) -{ - $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - - if (empty($datep)) - { - $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - } - - if (! $error) - { - $result=$object->set_date($user,$datep); - if ($result < 0) dol_print_error($db,$object->error); - } -} -else if ($action == 'setecheance' && $user->rights->propal->creer) -{ - $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); - if ($result < 0) dol_print_error($db,$object->error); -} -else if ($action == 'setdate_livraison' && $user->rights->propal->creer) -{ - $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); - if ($result < 0) dol_print_error($db,$object->error); -} - -// Positionne ref client -else if ($action == 'set_ref_client' && $user->rights->propal->creer) -{ - $object->set_ref_client($user, $_POST['ref_client']); -} - -else if ($action == 'setnote_public' && $user->rights->propal->creer) -{ - $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); - if ($result < 0) dol_print_error($db,$object->error); -} - -else if ($action == 'setnote' && $user->rights->propal->creer) -{ - $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); - if ($result < 0) dol_print_error($db,$object->error); -} - -// Create proposal -else if ($action == 'add' && $user->rights->propal->creer) -{ - $object->socid=$socid; - $object->fetch_thirdparty(); - - $datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); - $duration=GETPOST('duree_validite'); - - if (empty($datep)) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - $action='create'; - $error++; - } - if (empty($duration)) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); - $action='create'; - $error++; - } - - if ($socid<1) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); - $action='create'; - $error++; - } - - if (! $error) - { - $db->begin(); - - // Si on a selectionne une propal a copier, on realise la copie - if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) - { - if ($object->fetch(GETPOST('copie_propal')) > 0) - { - $object->ref = GETPOST('ref'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = $duration; - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->remise_percent = GETPOST('remise_percent'); - $object->remise_absolue = GETPOST('remise_absolue'); - $object->socid = GETPOST('socid'); - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - $object->statut = 0; - - $id = $object->create_from($user); - } - else - { - setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); - } - } - else - { - $object->ref = GETPOST('ref'); - $object->ref_client = GETPOST('ref_client'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = GETPOST('duree_validite'); - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - - $object->origin = GETPOST('origin'); - $object->origin_id = GETPOST('originid'); - - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - if ($_POST['idprod'.$i]) - { - $xid = 'idprod'.$i; - $xqty = 'qty'.$i; - $xremise = 'remise'.$i; - $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); - } - } - - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=GETPOST($key); - } - } - - $id = $object->create($user); - } - - if ($id > 0) - { - // Insertion contact par defaut si defini - if (GETPOST('contactidp')) - { - $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); - if ($result < 0) - { - $error++; - setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); - } - } - - if (! $error) - { - $db->commit(); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } - else - { - $db->rollback(); - } - } - else - { - dol_print_error($db,$object->error); - $db->rollback(); - exit; - } - } -} - -// Classify billed -else if ($action == 'classifybilled' && $user->rights->propal->cloturer) -{ - $object->cloture($user, 4, ''); -} - -// Reopen proposal -else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) -{ - // prevent browser refresh from reopening proposal several times - if ($object->statut==2 || $object->statut==3) - { - $object->setStatut(1); - } -} - -// Close proposal -else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) -{ - if (! GETPOST('statut')) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")), 'errors'); - $action='statut'; - } - else - { - // prevent browser refresh from closing proposal several times - if ($object->statut==1) - { - $object->cloture($user, GETPOST('statut'), GETPOST('note')); - } - } -} - -/* - * Add file in email form - */ -if (GETPOST('addfile')) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - // Set tmp user directory TODO Use a dedicated directory for temp mails files - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir_tmp = $vardir.'/temp'; - - dol_add_file_process($upload_dir_tmp,0,0); - $action='presend'; -} - -/* - * Remove file in email form - */ -if (GETPOST('removedfile')) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir_tmp = $vardir.'/temp'; - - // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'],0); - $action='presend'; -} - -/* - * Send mail - */ -if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) -{ - $langs->load('mails'); - - if ($object->id > 0) - { - if ($_POST['sendto']) - { - // Le destinataire a ete fourni via le champ libre - $sendto = $_POST['sendto']; - $sendtoid = 0; - } - elseif ($_POST['receiver'] != '-1') - { - // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party - { - $sendto = $object->client->email; - $sendtoid = 0; - } - else // Id du contact - { - $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); - $sendtoid = $_POST['receiver']; - } - } - - if (dol_strlen($sendto)) - { - $langs->load("commercial"); - - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; - $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; - $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $deliveryreceipt = $_POST['deliveryreceipt']; - - if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; - else $subject = $langs->transnoentities('Propal').' '.$object->ref; - $actiontypecode='AC_PROP'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; - if ($message) - { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; - } - $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); - - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $attachedfiles=$formmail->get_attached_files(); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; - - // Envoi de la propal - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); - if ($mailfile->error) - { - setEventMessage($mailfile->error, 'errors'); - } - else - { - $result=$mailfile->sendfile(); - if ($result) - { - // Initialisation donnees - $object->sendtoid = $sendtoid; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; - $object->actionmsg2 = $actionmsg2; - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers - - if (! $error) - { - // Redirect here - // This avoid sending mail twice if going out and then back to page - $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); - setEventMessage($mesg); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; - } - else - { - dol_print_error($db); - } - } - else - { - $langs->load("other"); - if ($mailfile->error) - { - $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); - $mesg.='
'.$mailfile->error; - } - else - { - $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - } - setEventMessage($mesg, 'errors'); - } - } - } - else - { - $langs->load("other"); - setEventMessage($langs->trans('ErrorMailRecipientIsEmpty').'!', 'errors'); - dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); - } - } - else - { - $langs->load("other"); - setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")), 'errors'); - dol_syslog($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal"))); - } -} - -// Go back to draft -if ($action == 'modif' && $user->rights->propal->creer) -{ - $object->set_draft($user); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } -} - -else if ($action == "setabsolutediscount" && $user->rights->propal->creer) -{ - if ($_POST["remise_id"]) - { - if ($object->id > 0) - { - $result=$object->insert_discount($_POST["remise_id"]); - if ($result < 0) - { - setEventMessage($object->error, 'errors'); - } - } - } -} - -//Ajout d'une ligne produit dans la propale -else if ($action == "addline" && $user->rights->propal->creer) -{ - $idprod=GETPOST('idprod', 'int'); - $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); - $price_ht = GETPOST('price_ht'); - $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); - - if (empty($idprod) && GETPOST('type') < 0) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); - $error++; - } - if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - if (empty($idprod) && empty($product_desc)) - { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors'); - $error++; - } - - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) - { - $pu_ht=0; - $pu_ttc=0; - $price_min=0; - $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); - - // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $txtva par celui du produit - if (! empty($idprod)) - { - $prod = new Product($db); - $prod->fetch($idprod); - - $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); - - // If prices fields are update - if (GETPOST('usenewaddlineform')) - { - $pu_ht=price2num($price_ht, 'MU'); - $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); - $tva_tx=str_replace('*','', $tva_tx); - $desc = $product_desc; - } - else - { - $tva_tx = get_default_tva($mysoc,$object->client,$prod->id); - $tva_npr = get_default_npr($mysoc,$object->client,$prod->id); - - // On defini prix unitaire - if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) - { - $pu_ht = $prod->multiprices[$object->client->price_level]; - $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; - $price_min = $prod->multiprices_min[$object->client->price_level]; - $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; - } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } - - // On reevalue prix selon taux tva car taux tva transaction peut etre different - // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) - { - if ($price_base_type != 'HT') - { - $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); - } - else - { - $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); - } - } - - $desc=''; - - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) - { - $outputlangs = $langs; - $newlang=''; - if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if (empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description; - } - else - { - $desc = $prod->description; - } - - $desc=dol_concatdesc($desc,$product_desc); - + + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2011 Philippe Grand + * Copyright (C) 2012 Christophe Battarel +* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/comm/propal.php + * \ingroup propale + * \brief Page of commercial proposals card and list + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} + +$langs->load('companies'); +$langs->load('propal'); +$langs->load('compta'); +$langs->load('bills'); +$langs->load('orders'); +$langs->load('products'); +$langs->load("deliveries"); +if (! empty($conf->margin->enabled)) + $langs->load('margins'); + +$error=0; + +$id=GETPOST('id','int'); +$ref=GETPOST('ref','alpha'); +$socid=GETPOST('socid','int'); +$action=GETPOST('action','alpha'); +$origin=GETPOST('origin','alpha'); +$originid=GETPOST('originid','int'); +$confirm=GETPOST('confirm','alpha'); +$lineid=GETPOST('lineid','int'); + +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + +// Nombre de ligne pour choix de produit/service predefinis +$NBLINES=4; + +// Security check +if (! empty($user->societe_id)) $socid=$user->societe_id; +$result = restrictedArea($user, 'propal', $id); + +$object = new Propal($db); +$extrafields = new ExtraFields($db); + +// Load object +if ($id > 0 || ! empty($ref)) +{ + $ret=$object->fetch($id, $ref); + if ($ret > 0) $ret=$object->fetch_thirdparty(); + if ($ret < 0) dol_print_error('',$object->error); +} + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('propalcard')); + + + +/* + * Actions + */ + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + +// Action clone object +if ($action == 'confirm_clone' && $confirm == 'yes') +{ + if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) + { + setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); + } + else + { + if ($object->id > 0) + { + $result=$object->createFromClone($socid); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action=''; + } + } + } +} + +// Suppression de la propale +else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) +{ + $result=$object->delete($user); + if ($result > 0) + { + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + exit; + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans($object->error), 'errors'); + } +} + +// Remove line +else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) +{ + $result = $object->deleteline($lineid); + // reorder lines + if ($result) $object->line_order(true); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; +} + +// Validation +else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) +{ + $result=$object->valid($user); + if ($result >= 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans($object->error), 'errors'); + } +} + +else if ($action == 'setdate' && $user->rights->propal->creer) +{ + $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + + if (empty($datep)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + } + + if (! $error) + { + $result=$object->set_date($user,$datep); + if ($result < 0) dol_print_error($db,$object->error); + } +} +else if ($action == 'setecheance' && $user->rights->propal->creer) +{ + $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); + if ($result < 0) dol_print_error($db,$object->error); +} +else if ($action == 'setdate_livraison' && $user->rights->propal->creer) +{ + $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); + if ($result < 0) dol_print_error($db,$object->error); +} + +// Positionne ref client +else if ($action == 'set_ref_client' && $user->rights->propal->creer) +{ + $object->set_ref_client($user, $_POST['ref_client']); +} + +else if ($action == 'setnote_public' && $user->rights->propal->creer) +{ + $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); + if ($result < 0) dol_print_error($db,$object->error); +} + +else if ($action == 'setnote' && $user->rights->propal->creer) +{ + $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); + if ($result < 0) dol_print_error($db,$object->error); +} + +// Create proposal +else if ($action == 'add' && $user->rights->propal->creer) +{ + $object->socid=$socid; + $object->fetch_thirdparty(); + + $datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + $duration=GETPOST('duree_validite'); + + if (empty($datep)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + $action='create'; + $error++; + } + if (empty($duration)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); + $action='create'; + $error++; + } + + if ($socid<1) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); + $action='create'; + $error++; + } + + if (! $error) + { + $db->begin(); + + // Si on a selectionne une propal a copier, on realise la copie + if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) + { + if ($object->fetch(GETPOST('copie_propal')) > 0) + { + $object->ref = GETPOST('ref'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = $duration; + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->remise_percent = GETPOST('remise_percent'); + $object->remise_absolue = GETPOST('remise_absolue'); + $object->socid = GETPOST('socid'); + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + $object->statut = 0; + + $id = $object->create_from($user); + } + else + { + setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); + } + } + else + { + $object->ref = GETPOST('ref'); + $object->ref_client = GETPOST('ref_client'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = GETPOST('duree_validite'); + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + + $object->origin = GETPOST('origin'); + $object->origin_id = GETPOST('originid'); + + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + if ($_POST['idprod'.$i]) + { + $xid = 'idprod'.$i; + $xqty = 'qty'.$i; + $xremise = 'remise'.$i; + $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); + } + } + + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=GETPOST($key); + } + } + + $id = $object->create($user); + } + + if ($id > 0) + { + // Insertion contact par defaut si defini + if (GETPOST('contactidp')) + { + $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); + if ($result < 0) + { + $error++; + setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); + } + } + + if (! $error) + { + $db->commit(); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db,$object->error); + $db->rollback(); + exit; + } + } +} + +// Classify billed +else if ($action == 'classifybilled' && $user->rights->propal->cloturer) +{ + $object->cloture($user, 4, ''); +} + +// Reopen proposal +else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) +{ + // prevent browser refresh from reopening proposal several times + if ($object->statut==2 || $object->statut==3) + { + $object->setStatut(1); + } +} + +// Close proposal +else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) +{ + if (! GETPOST('statut')) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")), 'errors'); + $action='statut'; + } + else + { + // prevent browser refresh from closing proposal several times + if ($object->statut==1) + { + $object->cloture($user, GETPOST('statut'), GETPOST('note')); + } + } +} + +/* + * Add file in email form + */ +if (GETPOST('addfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory TODO Use a dedicated directory for temp mails files + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + dol_add_file_process($upload_dir_tmp,0,0); + $action='presend'; +} + +/* + * Remove file in email form + */ +if (GETPOST('removedfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + // TODO Delete only files that was uploaded from email form + dol_remove_file_process($_POST['removedfile'],0); + $action='presend'; +} + +/* + * Send mail + */ +if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) +{ + $langs->load('mails'); + + if ($object->id > 0) + { + if ($_POST['sendto']) + { + // Le destinataire a ete fourni via le champ libre + $sendto = $_POST['sendto']; + $sendtoid = 0; + } + elseif ($_POST['receiver'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party + { + $sendto = $object->client->email; + $sendtoid = 0; + } + else // Id du contact + { + $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); + $sendtoid = $_POST['receiver']; + } + } + + if (dol_strlen($sendto)) + { + $langs->load("commercial"); + + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; + $message = $_POST['message']; + $sendtocc = $_POST['sendtocc']; + $deliveryreceipt = $_POST['deliveryreceipt']; + + if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; + else $subject = $langs->transnoentities('Propal').' '.$object->ref; + $actiontypecode='AC_PROP'; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + if ($message) + { + $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; + $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; + $actionmsg.=$message; + } + $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $attachedfiles=$formmail->get_attached_files(); + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + // Envoi de la propal + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + if ($mailfile->error) + { + setEventMessage($mailfile->error, 'errors'); + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + // Initialisation donnees + $object->sendtoid = $sendtoid; + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; + $object->actionmsg2 = $actionmsg2; + $object->fk_element = $object->id; + $object->elementtype = $object->element; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + + if (! $error) + { + // Redirect here + // This avoid sending mail twice if going out and then back to page + $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); + setEventMessage($mesg); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else + { + dol_print_error($db); + } + } + else + { + $langs->load("other"); + if ($mailfile->error) + { + $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $mesg.='
'.$mailfile->error; + } + else + { + $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + } + setEventMessage($mesg, 'errors'); + } + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty').'!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")), 'errors'); + dol_syslog($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal"))); + } +} + +// Go back to draft +if ($action == 'modif' && $user->rights->propal->creer) +{ + $object->set_draft($user); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } +} + +else if ($action == "setabsolutediscount" && $user->rights->propal->creer) +{ + if ($_POST["remise_id"]) + { + if ($object->id > 0) + { + $result=$object->insert_discount($_POST["remise_id"]); + if ($result < 0) + { + setEventMessage($object->error, 'errors'); + } + } + } +} + +//Ajout d'une ligne produit dans la propale +else if ($action == "addline" && $user->rights->propal->creer) +{ + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); + + if (empty($idprod) && GETPOST('type') < 0) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + $error++; + } + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + $error++; + } + if (empty($idprod) && empty($product_desc)) + { + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors'); + $error++; + } + + if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + { + $pu_ht=0; + $pu_ttc=0; + $price_min=0; + $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); + + // Ecrase $pu par celui du produit + // Ecrase $desc par celui du produit + // Ecrase $txtva par celui du produit + if (! empty($idprod)) + { + $prod = new Product($db); + $prod->fetch($idprod); + + $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); + + // If prices fields are update + if (GETPOST('usenewaddlineform')) + { + $pu_ht=price2num($price_ht, 'MU'); + $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); + $tva_tx=str_replace('*','', $tva_tx); + $desc = $product_desc; + } + else + { + $tva_tx = get_default_tva($mysoc,$object->client,$prod->id); + $tva_npr = get_default_npr($mysoc,$object->client,$prod->id); + + // On defini prix unitaire + if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) + { + $pu_ht = $prod->multiprices[$object->client->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; + $price_min = $prod->multiprices_min[$object->client->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; + } + else + { + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; + } + + // On reevalue prix selon taux tva car taux tva transaction peut etre different + // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). + if ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { + $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); + } + else + { + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); + } + } + + $desc=''; + + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description; + } + else + { + $desc = $prod->description; + } + + $desc=dol_concatdesc($desc,$product_desc); + // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { @@ -752,1501 +752,1512 @@ else if ($action == "addline" && $user->rights->propal->creer) $tmptxt.=')'; $desc= dol_concatdesc($desc, $tmptxt); } - } - - $type = $prod->type; - } - else - { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); - $tva_tx = str_replace('*', '', $tva_tx); - $label = (GETPOST('product_label')?GETPOST('product_label'):''); - $desc = $product_desc; - $type = GETPOST('type'); - } - - // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); - - // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $object->client); - $localtax2_tx= get_localtax($tva_tx, 2, $object->client); - - $info_bits=0; - if ($tva_npr) $info_bits |= 0x01; - - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) - { - $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); - setEventMessage($mesg, 'errors'); - } - else - { - // Insert line - $result=$object->addline( - $id, - $desc, - $pu_ht, - GETPOST('qty'), - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $idprod, - GETPOST('remise_percent'), - $price_base_type, - $pu_ttc, - $info_bits, - $type, - -1, - 0, - GETPOST('fk_parent_line'), - $fournprice, - $buyingprice, - $label - ); - - if ($result > 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['idprod']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - - // old method - unset($_POST['np_desc']); - unset($_POST['dp_desc']); - } - else - { - setEventMessage($object->error, 'errors'); - } - } - } -} - -// Mise a jour d'une ligne dans la propale -else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save') == $langs->trans("Save")) -{ - // Define info_bits - $info_bits=0; - if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; - - // Clean parameters - $description=dol_htmlcleanlastbr(GETPOST('product_desc')); - - // Define vat_rate - $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); - $vat_rate=str_replace('*','',$vat_rate); - $localtax1_rate=get_localtax($vat_rate,1,$object->client); - $localtax2_rate=get_localtax($vat_rate,2,$object->client); - $pu_ht=GETPOST('price_ht'); - - // Add buying price - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); - - // Define special_code for special lines - $special_code=0; - if (! GETPOST('qty')) $special_code=3; - - // Check minimum price - $productid = GETPOST('productid', 'int'); - if (! empty($productid)) - { - $product = new Product($db); - $res=$product->fetch($productid); - - $type=$product->type; - - $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) - $price_min = $product->multiprices_min[$object->client->price_level]; - - $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); - - if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) - { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); - $error++; - } - } - else - { - $type = GETPOST('type'); - $label = (GETPOST('product_label') ? GETPOST('product_label'):''); - - // Check parameters - if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); - $error++; - } - } - - if (! $error) - { - $result = $object->updateline( - GETPOST('lineid'), - $pu_ht, - GETPOST('qty'), - GETPOST('remise_percent'), - $vat_rate, - $localtax1_rate, - $localtax2_rate, - $description, - 'HT', - $info_bits, - $special_code, - GETPOST('fk_parent_line'), - 0, - $fournprice, - $buyingprice, - $label, - $type - ); - - if ($result >= 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['productid']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - } - else - { - setEventMessage($object->error, 'errors'); - } - } -} - -else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) -{ - header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition - exit; -} - -// Generation doc (depuis lien ou depuis cartouche doc) -else if ($action == 'builddoc' && $user->rights->propal->creer) -{ - if (GETPOST('model')) - { - $object->setDocModel($user, GETPOST('model')); - } - - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - else - { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); - exit; - } -} - -// Remove file in doc form -else if ($action == 'remove_file' && $user->rights->propal->creer) -{ - if ($object->id > 0) - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $conf->propal->dir_output; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); - } -} - -// Set project -else if ($action == 'classin' && $user->rights->propal->creer) -{ - $object->setProject($_POST['projectid']); -} - -// Delai de livraison -else if ($action == 'setavailability' && $user->rights->propal->creer) -{ - $result = $object->availability($_POST['availability_id']); -} - -// Origine de la propale -else if ($action == 'setdemandreason' && $user->rights->propal->creer) -{ - $result = $object->demand_reason($_POST['demand_reason_id']); -} - -// Conditions de reglement -else if ($action == 'setconditions' && $user->rights->propal->creer) -{ - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); -} - -else if ($action == 'setremisepercent' && $user->rights->propal->creer) -{ - $result = $object->set_remise_percent($user, $_POST['remise_percent']); -} - -else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) -{ - $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); -} - -// Mode de reglement -else if ($action == 'setmode' && $user->rights->propal->creer) -{ - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); -} - -/* - * Ordonnancement des lignes - */ - -else if ($action == 'up' && $user->rights->propal->creer) -{ - $object->line_up(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); - exit; -} - -else if ($action == 'down' && $user->rights->propal->creer) -{ - $object->line_down(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); - exit; -} -else if ($action == 'update_extras') -{ - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=$_POST[$key]; - } - } - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); - $parameters=array('id'=>$object->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - -} - -if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) -{ - if ($action == 'addcontact') - { - if ($object->id > 0) - { - $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); - } - else - { - setEventMessage($object->error, 'errors'); - } - } - } - - // Bascule du statut d'un contact - else if ($action == 'swapstatut') - { - if ($object->fetch($id) > 0) - { - $result=$object->swapContactStatus(GETPOST('ligne')); - } - else - { - dol_print_error($db); - } - } - - // Efface un contact - else if ($action == 'deletecontact') - { - $object->fetch($id); - $result = $object->delete_contact($lineid); - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - dol_print_error($db); - } - } -} - - -/* - * View - */ - -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); - -$form = new Form($db); -$formother = new FormOther($db); -$formfile = new FormFile($db); -$formpropal = new FormPropal($db); -$companystatic=new Societe($db); - -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('propal'); - -$now=dol_now(); - -// Add new proposal -if ($action == 'create') -{ - print_fiche_titre($langs->trans("NewProp")); - - $soc = new Societe($db); - if ($socid>0) $res=$soc->fetch($socid); - - $object = new Propal($db); - - print '
'; - print ''; - print ''; - - if ($origin != 'project' && $originid) - { - print ''; - print ''; - } - - print '
".$langs->trans("RuleForStockManagementIncrease")." 
'; - - // Reference - print ''; - - // Ref customer - print ''; - print ''; - - // Third party - print ''; - print ''; - if($socid>0) - { - print ''; - } - else - { - print ''; - } - print ''."\n"; - - // Contacts - if($socid>0) - { - print "'; - - // Ligne info remises tiers - print ''; - } - - // Date - print ''; - - // Validaty duration - print ''; - - // Terms of payment - print ''; - - // Mode of payment - print ''; - - // What trigger creation - print ''; - - // Delivery delay - print ''; - - // Delivery date (or manufacturing) - print ''; - print ''; - - // Model - print ''; - print ''; - print '"; - - // Project - if (! empty($conf->projet->enabled) && $socid>0) - { - $projectid = 0; - if ($origin == 'project') $projectid = ($originid?$originid:0); - - print ''; - print ''; - print ''; - } - - // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - - // Show separator only - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } - } - } - - print "
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; - print '
'.$langs->trans('Customer').''; - print $soc->getNomUrl(1); - print ''; - print ''; - print $form->select_company('','socid','s.client = 1 OR s.client = 2 OR s.client = 3',1); - print '
".$langs->trans("DefaultContact").''; - $form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); - print '
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$soc->getAvailableDiscounts(); - print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); - else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.'; - print '
'.$langs->trans('Date').''; - $form->select_date('','','','','',"addprop"); - print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; - $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); - print '
'.$langs->trans('PaymentMode').''; - $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); - print '
'.$langs->trans('Source').''; - $form->select_demand_reason('','demand_reason_id',"SRC_PROP",1); - print '
'.$langs->trans('AvailabilityPeriod').''; - $form->select_availability('','availability_id','',1); - print '
'.$langs->trans("DeliveryDate").''; - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") - { - $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - $syear = date("Y", $tmpdte); - $smonth = date("m", $tmpdte); - $sday = date("d", $tmpdte); - $form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop"); - } - else - { - $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - $form->select_date($datepropal,'liv_','','','',"addprop"); - } - print '
'.$langs->trans("DefaultModel").''; - $liste=ModelePDFPropales::liste_modeles($db); - print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF); - print "
'.$langs->trans("Project").''; - - $numprojet=select_projects($soc->id,$projectid); - if ($numprojet==0) - { - print '   '.$langs->trans("AddProject").''; - } - print '
'; - print $extrafields->showInputField($key,$value); - print '
"; - print '
'; - - /* - * Combobox pour la fonction de copie - */ - - if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) - { - print ''; - } - - print ''; - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) - { - // For backward compatibility - print ''; - print ''; - print ''; - print ''; - - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; - - print ''; - print ''; - } - - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - print ''; - } - print '
'.$langs->trans("CopyPropalFrom").' '; - $liste_propal = array(); - $liste_propal[0] = ''; - - $sql ="SELECT p.rowid as id, p.ref, s.nom"; - $sql.=" FROM ".MAIN_DB_PREFIX."propal p"; - $sql.= ", ".MAIN_DB_PREFIX."societe s"; - $sql.= " WHERE s.rowid = p.fk_soc"; - $sql.= " AND p.entity = ".$conf->entity; - $sql.= " AND p.fk_statut <> 0"; - $sql.= " ORDER BY Id"; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $row = $db->fetch_row($resql); - $propalRefAndSocName = $row[1]." - ".$row[2]; - $liste_propal[$row[0]]=$propalRefAndSocName; - $i++; - } - print $form->selectarray("copie_propal",$liste_propal, 0); - } - else - { - dol_print_error($db); - } - print '
 
'.$langs->trans("CreateEmptyPropal").'
'; - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $lib=$langs->trans("ProductsAndServices"); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - print ''; - print ''; - print ''; - print ''; - } - - print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; - // multiprix - if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) - $form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level); - else - $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); - print '%
"; - - } - print '
'; - print '
'; - - $langs->load("bills"); - print '
'; - print ''; - print ' '; - print '
'; - - print ""; -} -else -{ - /* - * Show object in view mode - */ - - $soc = new Societe($db); - $soc->fetch($object->socid); - - $head = propal_prepare_head($object); - dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); - - $formconfirm=''; - - // Clone confirmation - if ($action == 'clone') - { - // Create an array for form - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid','int'),'socid','(s.client=1 OR s.client=2 OR s.client=3)')) - ); - // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1); - } - - // Confirm delete - else if ($action == 'delete') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); - } - - // Confirm reopen - else if ($action == 'reopen') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); - } - - // Confirmation delete product/service line - else if ($action == 'ask_deleteline') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); - } - - // Confirm validate proposal - else if ($action == 'validate') - { - $error=0; - - // on verifie si l'objet est en numerotation provisoire - $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV') - { - $numref = $object->getNextNumRef($soc); - if (empty($numref)) - { - $error++; - dol_htmloutput_errors($object->error); - } - } - else - { - $numref = $object->ref; - } - - $text=$langs->trans('ConfirmValidateProp',$numref); - if (! empty($conf->notification->enabled)) - { - require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; - $notify=new Notify($db); - $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); - } - - if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); - } - - if (! $formconfirm) - { - $parameters=array('lineid'=>$lineid); - $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - - // Print form confirm - print $formconfirm; - - - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - - // Company - print ''; - print ''; - - // Ligne info remises tiers - print ''; - - // Date of proposal - print ''; - print ''; - - // Date end proposal - print ''; - print ''; - print ''; - - // Payment term - print ''; - print ''; - - // Delivery date - $langs->load('deliveries'); - print ''; - print ''; - - // Delivery delay - print ''; - print ''; - - // Origin of demand - print ''; - print ''; - - // Payment mode - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - print ''; - } - else - { - print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print '
'; - print ''; - if ($action != 'refclient' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print ''.img_edit($langs->trans('Modify')).'
'; - print '
'; - if ($user->rights->propal->creer && $action == 'refclient') - { - print '
'; - print ''; - print ''; - print ''; - print ' '; - print '
'; - } - else - { - print $object->ref_client; - } - print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - print '. '; - $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); - $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); - $absolute_discount=price2num($absolute_discount,'MT'); - $absolute_creditnote=price2num($absolute_creditnote,'MT'); - if ($absolute_discount) - { - if ($object->statut > 0) - { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - } - else - { - // Remise dispo de type non avoir - $filter='fk_facture_source IS NULL'; - print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); - } - } - if ($absolute_creditnote) - { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; - } - if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; - print '
'; - print ''; - if ($action != 'editdate' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('Date'); - print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; - print '
'; - if (! empty($object->brouillon) && $action == 'editdate') - { - print '
'; - print ''; - print ''; - $form->select_date($object->date,'re','','',0,"editdate"); - print ''; - print '
'; - } - else - { - if ($object->date) - { - print dol_print_date($object->date,'daytext'); - } - else - { - print ' '; - } - } - print '
'; - print ''; - if ($action != 'editecheance' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('DateEndPropal'); - print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; - print '
'; - if (! empty($object->brouillon) && $action == 'editecheance') - { - print '
'; - print ''; - print ''; - $form->select_date($object->fin_validite,'ech','','','',"editecheance"); - print ''; - print '
'; - } - else - { - if (! empty($object->fin_validite)) - { - print dol_print_date($object->fin_validite,'daytext'); - if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); - } - else - { - print ' '; - } - } - print '
'; - print ''; - if ($action != 'editconditions' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('PaymentConditionsShort'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'),1).'
'; - print '
'; - if ($action == 'editconditions') - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); - } - else - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); - } - print '
'; - print ''; - if ($action != 'editdate_livraison' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('DeliveryDate'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'),1).'
'; - print '
'; - if ($action == 'editdate_livraison') - { - print '
'; - print ''; - print ''; - $form->select_date($object->date_livraison,'liv_','','','',"editdate_livraison"); - print ''; - print '
'; - } - else - { - print dol_print_date($object->date_livraison,'daytext'); - } - print '
'; - print ''; - if ($action != 'editavailability' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('AvailabilityPeriod'); - if (! empty($conf->commande->enabled)) print ' ('.$langs->trans('AfterOrder').')'; - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'),1).'
'; - print '
'; - if ($action == 'editavailability') - { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); - } - else - { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1); - } - - print '
'; - print ''; - if ($action != 'editdemandreason' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('Source'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'),1).'
'; - print '
'; - //print $object->demand_reason_id; - if ($action == 'editdemandreason') - { - $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); - } - else - { - $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none'); - } - - print '
'; - print ''; - if ($action != 'editmode' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('PaymentMode'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'),1).'
'; - print '
'; - if ($action == 'editmode') - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); - } - else - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); - } - print '
'; - print ''; - if ($user->rights->propal->creer) - { - if ($action != 'classify') print ''; - print '
'; - print $langs->trans('Project').''.img_edit($langs->transnoentitiesnoconv('SetProject')).'
'; - print '
'; - if ($action == 'classify') - { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); - } - else - { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); - } - print '
'; - if (! empty($object->fk_project)) - { - print ''; - $proj = new Project($db); - $proj->fetch($object->fk_project); - print ''; - print $proj->ref; - print ''; - print ''; - } - else { - print ' '; - } - } - print ''; - } - - // Other attributes - $res=$object->fetch_optionals($object->id,$extralabels); - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - - if ($action == 'edit_extras') - { - print '
'; - print ''; - print ''; - print ''; - } - - - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print $extrafields->showInputField($key,$value); - } - else - { - print $extrafields->showOutputField($key,$value); - } - print ''."\n"; - } - } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print ''; - print ''; - print ''; - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->propal->creer) - { - print ''.img_picto('','edit').' '.$langs->trans('Modify').''; - } - } - } - } - - // Amount HT - print ''.$langs->trans('AmountHT').''; - print ''.price($object->total_ht).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Margin Infos - if (! empty($conf->margin->enabled)) { - print ''; - $object->displayMarginInfos(); - print ''; - } - print ''; - - // Amount VAT - print ''.$langs->trans('AmountVAT').''; - print ''.price($object->total_tva).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Amount Local Taxes - if ($mysoc->localtax1_assuj=="1") //Localtax1 - { - print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; - print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - if ($mysoc->localtax2_assuj=="1") //Localtax2 - { - print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; - print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - - - // Amount TTC - print ''.$langs->trans('AmountTTC').''; - print ''.price($object->total_ttc).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Statut - print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; - - print '
'; - - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - $blocname = 'contacts'; - $title = $langs->trans('ContactsAddresses'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $blocname = 'notes'; - $title = $langs->trans('Notes'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - /* - * Lines - */ - - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) - { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print ''; - - // Show object lines - $result = $object->getLinesArray(); - if (! empty($object->lines)) - $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid); - - // Form to add new line - if ($object->statut == 0 && $user->rights->propal->creer) - { - if ($action != 'editline') - { - $var=true; - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { - // Add free or predefined products/services - $object->formAddObjectLine(0,$mysoc,$soc); - } - else - { - // Add free products/services - $object->formAddFreeProduct(0,$mysoc,$soc); - - // Add predefined products/services - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $var=!$var; - $object->formAddPredefinedProduct(0,$mysoc,$soc); - } - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - } - - print '
'; - - print ''; - print "\n"; - - if ($action == 'statut') - { - /* - * Formulaire cloture (signe ou non) - */ - $form_close = '
'; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans("CloseAs").''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans('Note').'
'; - $form_close.= ''; - $form_close.= '   '; - $form_close.= ' '; - $form_close.= '
'; - - print $form_close; - } - - - /* - * Boutons Actions - */ - if ($action != 'presend') - { - print '
'; - - if ($action != 'statut' && $action <> 'editline') - { - // Validate - if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) - { - if (count($object->lines) > 0) print ''.$langs->trans('Validate').''; - //else print ''.$langs->trans('Validate').''; - } - - // Edit - if ($object->statut == 1 && $user->rights->propal->creer) - { - print ''.$langs->trans('Modify').''; - } - - // ReOpen - if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) - { - print 'global->MAIN_JUMP_TAG)?'':'#reopen').'"'; - print '>'.$langs->trans('ReOpen').''; - } - - // Send - if ($object->statut == 1 || $object->statut == 2) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) - { - print ''.$langs->trans('SendByMail').''; - } - else print ''.$langs->trans('SendByMail').''; - } - - // Create an order - if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) - { - if ($user->rights->commande->creer) - { - print ''.$langs->trans("AddOrder").''; - } - } - - // Create an invoice and classify billed - if ($object->statut == 2 && $user->societe_id == 0) - { - if (! empty($conf->facture->enabled) && $user->rights->facture->creer) - { - print ''.$langs->trans("AddBill").''; - } - - $arraypropal=$object->getInvoiceArrayList(); - if (is_array($arraypropal) && count($arraypropal) > 0) - { - print 'socid.'">'.$langs->trans("ClassifyBilled").''; - } - } - - // Close - if ($object->statut == 1 && $user->rights->propal->cloturer) - { - print 'global->MAIN_JUMP_TAG)?'':'#close').'"'; - print '>'.$langs->trans('Close').''; - } - - // Clone - if ($user->rights->propal->creer) - { - print ''.$langs->trans("ToClone").''; - } - - // Delete - if ($user->rights->propal->supprimer) - { - print ''.$langs->trans('Delete').''; - } - - } - - print '
'; - print "
\n"; - } - - if ($action != 'presend') - { - print '
'; - print ''; // ancre - - - /* - * Documents generes - */ - $filename=dol_sanitizeFileName($object->ref); - $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed=$user->rights->propal->creer; - $delallowed=$user->rights->propal->supprimer; - - $var=true; - - $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang); - - - /* - * Linked object block - */ - $somethingshown=$object->showLinkedObjectBlock(); - - print ''; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'propal',$socid); - - print '
'; - } - - - /* - * Action presend - * - */ - if ($action == 'presend') - { - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); - $file=$fileparams['fullname']; - - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); - $file=$fileparams['fullname']; - } - - print '
'; - print_titre($langs->trans('SendPropalByMail')); - - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->fromtype = 'user'; - $formmail->fromid = $user->id; - $formmail->fromname = $user->getFullName($langs); - $formmail->frommail = $user->email; - $formmail->withfrom=1; + } + + $type = $prod->type; + } + else + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label')?GETPOST('product_label'):''); + $desc = $product_desc; + $type = GETPOST('type'); + } + + // Margin + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + + // Local Taxes + $localtax1_tx= get_localtax($tva_tx, 1, $object->client); + $localtax2_tx= get_localtax($tva_tx, 2, $object->client); + + $info_bits=0; + if ($tva_npr) $info_bits |= 0x01; + + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + { + $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); + setEventMessage($mesg, 'errors'); + } + else + { + // Insert line + $result=$object->addline( + $id, + $desc, + $pu_ht, + GETPOST('qty'), + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + GETPOST('remise_percent'), + $price_base_type, + $pu_ttc, + $info_bits, + $type, + -1, + 0, + GETPOST('fk_parent_line'), + $fournprice, + $buyingprice, + $label + ); + + if ($result > 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['idprod']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + + // old method + unset($_POST['np_desc']); + unset($_POST['dp_desc']); + } + else + { + setEventMessage($object->error, 'errors'); + } + } + } +} + +// Mise a jour d'une ligne dans la propale +else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save') == $langs->trans("Save")) +{ + // Define info_bits + $info_bits=0; + if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; + + // Clean parameters + $description=dol_htmlcleanlastbr(GETPOST('product_desc')); + + // Define vat_rate + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + $vat_rate=str_replace('*','',$vat_rate); + $localtax1_rate=get_localtax($vat_rate,1,$object->client); + $localtax2_rate=get_localtax($vat_rate,2,$object->client); + $pu_ht=GETPOST('price_ht'); + + // Add buying price + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + + // Define special_code for special lines + $special_code=0; + if (! GETPOST('qty')) $special_code=3; + + // Check minimum price + $productid = GETPOST('productid', 'int'); + if (! empty($productid)) + { + $product = new Product($db); + $res=$product->fetch($productid); + + $type=$product->type; + + $price_min = $product->price_min; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) + $price_min = $product->multiprices_min[$object->client->price_level]; + + $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); + + if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + { + setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); + $error++; + } + } + else + { + $type = GETPOST('type'); + $label = (GETPOST('product_label') ? GETPOST('product_label'):''); + + // Check parameters + if (GETPOST('type') < 0) { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + $error++; + } + } + + if (! $error) + { + $result = $object->updateline( + GETPOST('lineid'), + $pu_ht, + GETPOST('qty'), + GETPOST('remise_percent'), + $vat_rate, + $localtax1_rate, + $localtax2_rate, + $description, + 'HT', + $info_bits, + $special_code, + GETPOST('fk_parent_line'), + 0, + $fournprice, + $buyingprice, + $label, + $type + ); + + if ($result >= 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + } + else + { + setEventMessage($object->error, 'errors'); + } + } +} + +else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) +{ + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition + exit; +} + +// Generation doc (depuis lien ou depuis cartouche doc) +else if ($action == 'builddoc' && $user->rights->propal->creer) +{ + if (GETPOST('model')) + { + $object->setDocModel($user, GETPOST('model')); + } + + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + else + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + exit; + } +} + +// Remove file in doc form +else if ($action == 'remove_file' && $user->rights->propal->creer) +{ + if ($object->id > 0) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $conf->propal->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file,0,0,0,$object); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); + } +} + +// Set project +else if ($action == 'classin' && $user->rights->propal->creer) +{ + $object->setProject($_POST['projectid']); +} + +// Delai de livraison +else if ($action == 'setavailability' && $user->rights->propal->creer) +{ + $result = $object->availability($_POST['availability_id']); +} + +// Origine de la propale +else if ($action == 'setdemandreason' && $user->rights->propal->creer) +{ + $result = $object->demand_reason($_POST['demand_reason_id']); +} + +// Conditions de reglement +else if ($action == 'setconditions' && $user->rights->propal->creer) +{ + $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); +} + +else if ($action == 'setremisepercent' && $user->rights->propal->creer) +{ + $result = $object->set_remise_percent($user, $_POST['remise_percent']); +} + +else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) +{ + $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); +} + +// Mode de reglement +else if ($action == 'setmode' && $user->rights->propal->creer) +{ + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); +} + +/* + * Ordonnancement des lignes + */ + +else if ($action == 'up' && $user->rights->propal->creer) +{ + $object->line_up(GETPOST('rowid')); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + exit; +} + +else if ($action == 'down' && $user->rights->propal->creer) +{ + $object->line_down(GETPOST('rowid')); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + exit; +} +else if ($action == 'update_extras') +{ + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=$_POST[$key]; + } + } + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('propaldao')); + $parameters=array('id'=>$object->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$object->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + +} + +if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) +{ + if ($action == 'addcontact') + { + if ($object->id > 0) + { + $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + } + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + } + else + { + setEventMessage($object->error, 'errors'); + } + } + } + + // Bascule du statut d'un contact + else if ($action == 'swapstatut') + { + if ($object->fetch($id) > 0) + { + $result=$object->swapContactStatus(GETPOST('ligne')); + } + else + { + dol_print_error($db); + } + } + + // Efface un contact + else if ($action == 'deletecontact') + { + $object->fetch($id); + $result = $object->delete_contact($lineid); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + dol_print_error($db); + } + } +} + + +/* + * View + */ + +llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); + +$form = new Form($db); +$formother = new FormOther($db); +$formfile = new FormFile($db); +$formpropal = new FormPropal($db); +$companystatic=new Societe($db); + +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('propal'); + +$now=dol_now(); + +// Add new proposal +if ($action == 'create') +{ + print_fiche_titre($langs->trans("NewProp")); + + $soc = new Societe($db); + if ($socid>0) $res=$soc->fetch($socid); + + $object = new Propal($db); + + print '
'; + print ''; + print ''; + + if ($origin != 'project' && $originid) + { + print ''; + print ''; + } + + print ''; + + // Reference + print ''; + + // Ref customer + print ''; + print ''; + + // Third party + print ''; + print ''; + if($socid>0) + { + print ''; + } + else + { + print ''; + } + print ''."\n"; + + // Contacts + if($socid>0) + { + print "'; + + // Ligne info remises tiers + print ''; + } + + // Date + print ''; + + // Validaty duration + print ''; + + // Terms of payment + print ''; + + // Mode of payment + print ''; + + // What trigger creation + print ''; + + // Delivery delay + print ''; + + // Delivery date (or manufacturing) + print ''; + print ''; + + // Model + print ''; + print ''; + print '"; + + // Project + if (! empty($conf->projet->enabled) && $socid>0) + { + $projectid = 0; + if ($origin == 'project') $projectid = ($originid?$originid:0); + + print ''; + print ''; + print ''; + } + + // Other attributes + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + + // Show separator only + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } + } + } + + print "
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; + print '
'.$langs->trans('Customer').''; + print $soc->getNomUrl(1); + print ''; + print ''; + print $form->select_company('','socid','s.client = 1 OR s.client = 2 OR s.client = 3',1); + print '
".$langs->trans("DefaultContact").''; + $form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); + print '
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $absolute_discount=$soc->getAvailableDiscounts(); + print '. '; + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '
'.$langs->trans('Date').''; + $form->select_date('','','','','',"addprop"); + print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; + $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); + print '
'.$langs->trans('PaymentMode').''; + $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); + print '
'.$langs->trans('Source').''; + $form->select_demand_reason('','demand_reason_id',"SRC_PROP",1); + print '
'.$langs->trans('AvailabilityPeriod').''; + $form->select_availability('','availability_id','',1); + print '
'.$langs->trans("DeliveryDate").''; + if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") + { + $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); + $syear = date("Y", $tmpdte); + $smonth = date("m", $tmpdte); + $sday = date("d", $tmpdte); + $form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop"); + } + else + { + $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $form->select_date($datepropal,'liv_','','','',"addprop"); + } + print '
'.$langs->trans("DefaultModel").''; + $liste=ModelePDFPropales::liste_modeles($db); + print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF); + print "
'.$langs->trans("Project").''; + + $numprojet=select_projects($soc->id,$projectid); + if ($numprojet==0) + { + print '   '.$langs->trans("AddProject").''; + } + print '
'; + print $extrafields->showInputField($key,$value); + print '
"; + print '
'; + + /* + * Combobox pour la fonction de copie + */ + + if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) + { + print ''; + } + + print ''; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) + { + // For backward compatibility + print ''; + print ''; + print ''; + print ''; + + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; + + print ''; + print ''; + } + + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) + { + print ''; + } + print '
'.$langs->trans("CopyPropalFrom").' '; + $liste_propal = array(); + $liste_propal[0] = ''; + + $sql ="SELECT p.rowid as id, p.ref, s.nom"; + $sql.=" FROM ".MAIN_DB_PREFIX."propal p"; + $sql.= ", ".MAIN_DB_PREFIX."societe s"; + $sql.= " WHERE s.rowid = p.fk_soc"; + $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.fk_statut <> 0"; + $sql.= " ORDER BY Id"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($resql); + $propalRefAndSocName = $row[1]." - ".$row[2]; + $liste_propal[$row[0]]=$propalRefAndSocName; + $i++; + } + print $form->selectarray("copie_propal",$liste_propal, 0); + } + else + { + dol_print_error($db); + } + print '
 
'.$langs->trans("CreateEmptyPropal").'
'; + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $lib=$langs->trans("ProductsAndServices"); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + print ''; + print ''; + print ''; + print ''; + } + + print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; + // multiprix + if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) + $form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level); + else + $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); + print '%
"; + + } + print '
'; + print '
'; + + $langs->load("bills"); + print '
'; + print ''; + print ' '; + print '
'; + + print "
"; +} +else +{ + /* + * Show object in view mode + */ + + $soc = new Societe($db); + $soc->fetch($object->socid); + + $head = propal_prepare_head($object); + dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); + + $formconfirm=''; + + // Clone confirmation + if ($action == 'clone') + { + // Create an array for form + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid','int'),'socid','(s.client=1 OR s.client=2 OR s.client=3)')) + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1); + } + + // Confirm delete + else if ($action == 'delete') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); + } + + // Confirm reopen + else if ($action == 'reopen') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); + } + + // Confirmation delete product/service line + else if ($action == 'ask_deleteline') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); + } + + // Confirm validate proposal + else if ($action == 'validate') + { + $error=0; + + // on verifie si l'objet est en numerotation provisoire + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') + { + $numref = $object->getNextNumRef($soc); + if (empty($numref)) + { + $error++; + dol_htmloutput_errors($object->error); + } + } + else + { + $numref = $object->ref; + } + + $text=$langs->trans('ConfirmValidateProp',$numref); + if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; + $notify=new Notify($db); + $text.='
'; + $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); + } + + if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); + } + + if (! $formconfirm) + { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + // Print form confirm + print $formconfirm; + + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Ref client + print ''; + print ''; + + // Company + print ''; + print ''; + + // Ligne info remises tiers + print ''; + + // Date of proposal + print ''; + print ''; + + // Date end proposal + print ''; + print ''; + print ''; + + // Payment term + print ''; + print ''; + + // Delivery date + $langs->load('deliveries'); + print ''; + print ''; + + // Delivery delay + print ''; + print ''; + + // Origin of demand + print ''; + print ''; + + // Payment mode + print ''; + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + print ''; + } + else + { + print '
'.$langs->trans('Ref').''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print '
'; + print ''; + if ($action != 'refclient' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Modify')).'
'; + print '
'; + if ($user->rights->propal->creer && $action == 'refclient') + { + print '
'; + print ''; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print $object->ref_client; + } + print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + print '. '; + $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); + $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); + $absolute_discount=price2num($absolute_discount,'MT'); + $absolute_creditnote=price2num($absolute_creditnote,'MT'); + if ($absolute_discount) + { + if ($object->statut > 0) + { + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + } + else + { + // Remise dispo de type non avoir + $filter='fk_facture_source IS NULL'; + print '
'; + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); + } + } + if ($absolute_creditnote) + { + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; + } + if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; + print '
'; + print ''; + if ($action != 'editdate' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('Date'); + print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; + print '
'; + if (! empty($object->brouillon) && $action == 'editdate') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date,'re','','',0,"editdate"); + print ''; + print '
'; + } + else + { + if ($object->date) + { + print dol_print_date($object->date,'daytext'); + } + else + { + print ' '; + } + } + print '
'; + print ''; + if ($action != 'editecheance' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('DateEndPropal'); + print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; + print '
'; + if (! empty($object->brouillon) && $action == 'editecheance') + { + print '
'; + print ''; + print ''; + $form->select_date($object->fin_validite,'ech','','','',"editecheance"); + print ''; + print '
'; + } + else + { + if (! empty($object->fin_validite)) + { + print dol_print_date($object->fin_validite,'daytext'); + if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + } + else + { + print ' '; + } + } + print '
'; + print ''; + if ($action != 'editconditions' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('PaymentConditionsShort'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'),1).'
'; + print '
'; + if ($action == 'editconditions') + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); + } + else + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); + } + print '
'; + print ''; + if ($action != 'editdate_livraison' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('DeliveryDate'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'),1).'
'; + print '
'; + if ($action == 'editdate_livraison') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date_livraison,'liv_','','','',"editdate_livraison"); + print ''; + print '
'; + } + else + { + print dol_print_date($object->date_livraison,'daytext'); + } + print '
'; + print ''; + if ($action != 'editavailability' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('AvailabilityPeriod'); + if (! empty($conf->commande->enabled)) print ' ('.$langs->trans('AfterOrder').')'; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'),1).'
'; + print '
'; + if ($action == 'editavailability') + { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); + } + else + { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1); + } + + print '
'; + print ''; + if ($action != 'editdemandreason' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('Source'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'),1).'
'; + print '
'; + //print $object->demand_reason_id; + if ($action == 'editdemandreason') + { + $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); + } + else + { + $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none'); + } + + print '
'; + print ''; + if ($action != 'editmode' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('PaymentMode'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'),1).'
'; + print '
'; + if ($action == 'editmode') + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); + } + else + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); + } + print '
'; + print ''; + if ($user->rights->propal->creer) + { + if ($action != 'classify') print ''; + print '
'; + print $langs->trans('Project').''.img_edit($langs->transnoentitiesnoconv('SetProject')).'
'; + print '
'; + if ($action == 'classify') + { + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); + } + else + { + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); + } + print '
'; + if (! empty($object->fk_project)) + { + print ''; + $proj = new Project($db); + $proj->fetch($object->fk_project); + print ''; + print $proj->ref; + print ''; + print ''; + } + else { + print ' '; + } + } + print ''; + } + + // Other attributes + $res=$object->fetch_optionals($object->id,$extralabels); + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + + if ($action == 'edit_extras') + { + print '
'; + print ''; + print ''; + print ''; + } + + + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print ''."\n"; + } + } + + if(count($extrafields->attribute_label) > 0) { + + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print ''; + print ''; + print ''; + print ''; + + } + else { + if ($object->statut == 0 && $user->rights->propal->creer) + { + print ''.img_picto('','edit').' '.$langs->trans('Modify').''; + } + } + } + } + + // Amount HT + print ''.$langs->trans('AmountHT').''; + print ''.price($object->total_ht).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Margin Infos + if (! empty($conf->margin->enabled)) { + print ''; + $object->displayMarginInfos(); + print ''; + } + print ''; + + // Amount VAT + print ''.$langs->trans('AmountVAT').''; + print ''.price($object->total_tva).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Amount Local Taxes + if ($mysoc->localtax1_assuj=="1") //Localtax1 + { + print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; + print ''.price($object->total_localtax1).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 + { + print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; + print ''.price($object->total_localtax2).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + + + // Amount TTC + print ''.$langs->trans('AmountTTC').''; + print ''.price($object->total_ttc).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Statut + print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; + + print '
'; + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $blocname = 'contacts'; + $title = $langs->trans('ContactsAddresses'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $blocname = 'notes'; + $title = $langs->trans('Notes'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + /* + * Lines + */ + + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) + { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + } + + print ''; + + // Show object lines + $result = $object->getLinesArray(); + if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid); + + // Form to add new line + if ($object->statut == 0 && $user->rights->propal->creer) + { + if ($action != 'editline') + { + $var=true; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + // Add free or predefined products/services + $object->formAddObjectLine(0,$mysoc,$soc); + } + else + { + // Add free products/services + $object->formAddFreeProduct(0,$mysoc,$soc); + + // Add predefined products/services + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $var=!$var; + $object->formAddPredefinedProduct(0,$mysoc,$soc); + } + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + } + + print '
'; + + print ''; + print "\n"; + + if ($action == 'statut') + { + /* + * Formulaire cloture (signe ou non) + */ + $form_close = '
'; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans("CloseAs").''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans('Note').'
'; + $form_close.= ''; + $form_close.= '   '; + $form_close.= ' '; + $form_close.= '
'; + + print $form_close; + } + + + /* + * Boutons Actions + */ + if ($action != 'presend') + { + print '
'; + + if ($action != 'statut' && $action <> 'editline') + { + // Validate + if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) + { + if (count($object->lines) > 0) print ''.$langs->trans('Validate').''; + //else print ''.$langs->trans('Validate').''; + } + + // Edit + if ($object->statut == 1 && $user->rights->propal->creer) + { + print ''.$langs->trans('Modify').''; + } + + // ReOpen + if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) + { + print 'global->MAIN_JUMP_TAG)?'':'#reopen').'"'; + print '>'.$langs->trans('ReOpen').''; + } + + // Send + if ($object->statut == 1 || $object->statut == 2) + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) + { + print ''.$langs->trans('SendByMail').''; + } + else print ''.$langs->trans('SendByMail').''; + } + + // Create an order + if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) + { + if ($user->rights->commande->creer) + { + print ''.$langs->trans("AddOrder").''; + } + } + + // Create contract + if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) + { + $langs->load("contracts"); + + if ($user->rights->contrat->creer) + { + print ''.$langs->trans('AddContract').''; + } + } + + // Create an invoice and classify billed + if ($object->statut == 2 && $user->societe_id == 0) + { + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) + { + print ''.$langs->trans("AddBill").''; + } + + $arraypropal=$object->getInvoiceArrayList(); + if (is_array($arraypropal) && count($arraypropal) > 0) + { + print 'socid.'">'.$langs->trans("ClassifyBilled").''; + } + } + + // Close + if ($object->statut == 1 && $user->rights->propal->cloturer) + { + print 'global->MAIN_JUMP_TAG)?'':'#close').'"'; + print '>'.$langs->trans('Close').''; + } + + // Clone + if ($user->rights->propal->creer) + { + print ''.$langs->trans("ToClone").''; + } + + // Delete + if ($user->rights->propal->supprimer) + { + print ''.$langs->trans('Delete').''; + } + + } + + print '
'; + print "
\n"; + } + + if ($action != 'presend') + { + print '
'; + print ''; // ancre + + + /* + * Documents generes + */ + $filename=dol_sanitizeFileName($object->ref); + $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed=$user->rights->propal->creer; + $delallowed=$user->rights->propal->supprimer; + + $var=true; + + $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang); + + + /* + * Linked object block + */ + $somethingshown=$object->showLinkedObjectBlock(); + + print ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'propal',$socid); + + print '
'; + } + + + /* + * Action presend + * + */ + if ($action == 'presend') + { + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); + $file=$fileparams['fullname']; + + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); + $file=$fileparams['fullname']; + } + + print '
'; + print_titre($langs->trans('SendPropalByMail')); + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; $liste=array(); foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; - $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; - $formmail->withtocc=$liste; - $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - - // Tableau des substitutions - $formmail->substit['__PROPREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - // Tableau des parametres complementaires - $formmail->param['action']='send'; - $formmail->param['models']='propal_send'; - $formmail->param['id']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - - $formmail->show_form(); - - print '
'; - } -} - -// End of page -llxFooter(); -$db->close(); -?> + $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; + $formmail->withtocc=$liste; + $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + + // Tableau des substitutions + $formmail->substit['__PROPREF__']=$object->ref; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + // Tableau des parametres complementaires + $formmail->param['action']='send'; + $formmail->param['models']='propal_send'; + $formmail->param['id']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } + + $formmail->show_form(); + + print '
'; + } +} + +// End of page +llxFooter(); +$db->close(); +?> diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 15a42841002..493f34c3962 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -912,6 +912,12 @@ class Commande extends CommonOrder $line->special_code = $object->lines[$i]->special_code; $line->fk_parent_line = $object->lines[$i]->fk_parent_line; + $line->fk_fournprice = $object->lines[$i]->fk_fournprice; + $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); + $line->pa_ht = $marginInfos[0]; + $line->marge_tx = $marginInfos[1]; + $line->marque_tx = $marginInfos[2]; + $this->lines[$i] = $line; } diff --git a/htdocs/commissions/admin/commissions.php b/htdocs/commissions/admin/commissions.php deleted file mode 100644 index 015cab308ff..00000000000 --- a/htdocs/commissions/admin/commissions.php +++ /dev/null @@ -1,192 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file /htdocs/admin/commissions.php - * \ingroup commissions - * \brief Page to setup advanced commissions module - */ - -include '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/commissions/lib/commissions.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); -require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); - -$langs->load("admin"); -$langs->load("bills"); -$langs->load("commissions"); - -if (! $user->admin) accessforbidden(); - - -/* - * Action - */ -if (GETPOST('commissionBase')) -{ - if (dolibarr_set_const($db, 'COMMISSION_BASE', GETPOST('commissionBase'), 'string', 0, '', $conf->entity) > 0) - { - $conf->global->COMMISSION_BASE = GETPOST('commissionBase'); - setEventMessage($langs->trans("RecordModifiedSuccessfully")); - } - else - { - dol_print_error($db); - } -} - -if (GETPOST('productCommissionRate')) -{ - if (dolibarr_set_const($db, 'PRODUCT_COMMISSION_RATE', GETPOST('productCommissionRate'), 'rate', 0, '', $conf->entity) > 0) - { - } - else - { - dol_print_error($db); - } -} - -if (GETPOST('serviceCommissionRate')) -{ - if (dolibarr_set_const($db, 'SERVICE_COMMISSION_RATE', GETPOST('serviceCommissionRate'), 'rate', 0, '', $conf->entity) > 0) - { - } - else - { - dol_print_error($db); - } -} - -if (GETPOST('AGENT_CONTACT_TYPE')) -{ - if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', GETPOST('AGENT_CONTACT_TYPE'), 'chaine', 0, '', $conf->entity) > 0) - { - $conf->global->AGENT_CONTACT_TYPE = GETPOST('AGENT_CONTACT_TYPE'); - } - else - { - dol_print_error($db); - } -} - -/* - * View - */ - -llxHeader('',$langs->trans("CommissionsSetup")); - - -$linkback=''.$langs->trans("BackToModuleList").''; -print_fiche_titre($langs->trans("commissionsSetup"),$linkback,'setup'); - - -$head = commissions_admin_prepare_head(); - -dol_fiche_head($head, 'parameters', $langs->trans("Commissions"), 0, 'commissions'); - -print "
"; - - -print_fiche_titre($langs->trans("MemberMainOptions"),'',''); -print ''; -print ''; -print ''; -print ''."\n"; -print ''."\n"; -print ''; - -$var=true; -$form = new Form($db); - -print ''; - -// COMMISSION BASE (TURNOVER / MARGIN) -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -// PRODUCT COMMISSION RATE -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -// SERVICE COMMISSION RATE -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -// INTERNAL CONTACT TYPE USED AS COMMERCIAL AGENT -$var=!$var; -print ''; -print ''; -print ''; -print ''; -print ''; - -$var=!$var; -print ''; -print ''; -print ''; - -print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Details").'
'.$langs->trans("CommissionBase").''; -print 'global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "TURNOVER") - print 'checked'; -print ' />'; -print $langs->trans("CommissionBasedOnTurnover"); -print '
'; -print 'margin->enabled)) - print 'disabled'; -elseif (isset($conf->global->COMMISSION_BASE) && $conf->global->COMMISSION_BASE == "MARGIN") - print 'checked'; -print ' />'; -print $langs->trans("CommissionBasedOnMargins"); -print '
'.$langs->trans('CommissionBaseDetails'); -print '
'; -print $langs->trans('CommissionBasedOnMarginsDetails'); -print '
'.$langs->trans("ProductCommissionRate").''; -print '  %'; -print ''.$langs->trans('ProductCommissionRateDetails').'
'.$langs->trans("ServiceCommissionRate").''; -print '  %'; -print ''.$langs->trans('ServiceCommissionRateDetails').'
'.$langs->trans("AgentContactType").''; -$formcompany = new FormCompany($db); -$facture = new Facture($db); -print $formcompany->selectTypeContact($facture, $conf->global->AGENT_CONTACT_TYPE, "AGENT_CONTACT_TYPE","internal","code",1); -print ''.$langs->trans('AgentContactTypeDetails').'
'; -print ''; -print '
'; - -print ''; - -dol_fiche_end(); - -print '
'; - -llxFooter(); -$db->close(); -?> diff --git a/htdocs/commissions/index.php b/htdocs/commissions/index.php deleted file mode 100644 index cdc6329d858..00000000000 --- a/htdocs/commissions/index.php +++ /dev/null @@ -1,329 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/commissions/index.php - * \ingroup commissions - * \brief Page des commissions par agent commercial - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (! empty($conf->margin->enabled)) - require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php'; - -$langs->load("companies"); -$langs->load("bills"); -$langs->load("products"); -$langs->load("commissions"); -if (! empty($conf->margin->enabled)) - $langs->load("margins"); - -// Security check -$agentid = GETPOST('agentid','int'); - -$mesg = ''; - -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); -if ($page == -1) { $page = 0; } -$offset = $conf->liste_limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; - -$startdate=$enddate=''; - -if (!empty($_POST['startdatemonth'])) - $startdate = date('Y-m-d', dol_mktime(12, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear'])); -if (!empty($_POST['enddatemonth'])) - $enddate = date('Y-m-d', dol_mktime(12, 0, 0, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear'])); - -/* - * View - */ - -$userstatic = new User($db); -$companystatic = new Societe($db); -$invoicestatic=new Facture($db); - -$form = new Form($db); - -llxHeader('',$langs->trans("Commissions")); - -$text=$langs->trans("Commissions"); -print_fiche_titre($text); - -print '
'; -print ''; - -if ($agentid > 0) { - - print ''; - print ''; - - if (! $sortorder) $sortorder="ASC"; - if (! $sortfield) $sortfield="s.nom"; -} -else { - print ''; - print ''; - if (! $sortorder) $sortorder="ASC"; - if (! $sortfield) $sortfield="u.login"; -} - -// Start date -print ''; -print ''; -print ''; -print ''; -print ''; - -// Include unpayed invoices -print ''; - - -// Total Margin -if ($conf->global->COMMISSION_BASE == "MARGIN") { - print ''; -} -elseif ($conf->global->COMMISSION_BASE == "TURNOVER") { - print ''; -} - -// Total Commission -print ''; - -print "
'.$langs->trans('CommercialAgent').''; - print $form->select_dolusers($agentid,'agentid',1,'',0,'',''); - print '
'.$langs->trans('CommercialAgent').''; - print $form->select_dolusers('','agentid',1,'',0,'',''); - print '
'.$langs->trans('StartDate').''; -$form->select_date($startdate,'startdate','','',1,"sel",1,1); -print ''.$langs->trans('EndDate').''; -$form->select_date($enddate,'enddate','','',1,"sel",1,1); -print ''; -print ''; -print '
'.$langs->trans("IncludeUnpayedInvoices").''; -print ''; -print '
'.$langs->trans("TotalMargin").''; - print ''; // set by jquery (see below) - print '
'.$langs->trans("TurnoverTotal").''; - print ''; // set by jquery (see below) - print '
'.$langs->trans("TotalCommission").''; -print ''; // set by jquery (see below) -print '
"; -print '
'; - -$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,"; -$sql.= " u.login,"; -if ($conf->global->COMMISSION_BASE == "MARGIN") { - $sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) end) as productBase," ; - $sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) else 0 end) as serviceBase" ; -} -elseif ($conf->global->COMMISSION_BASE == "TURNOVER") { - $sql.= " sum(case d.product_type when 1 then 0 else (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) end) as productBase," ; - $sql.= " sum(case d.product_type when 1 then (((d.subprice * (1 - d.remise_percent / 100))) * d.qty) else 0 end) as serviceBase" ; -} -$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; -$sql.= ", ".MAIN_DB_PREFIX."facture as f"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); -$sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; -$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= ", ".MAIN_DB_PREFIX."user as u"; -$sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND sc.fk_soc = f.fk_soc"; -if (! empty($conf->global->AGENT_CONTACT_TYPE)) - $sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = u.rowid) OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = u.rowid))"; -else - $sql .= " AND sc.fk_user = u.rowid"; -if (GETPOST('unpayed') == 'on') - $sql.= " AND f.fk_statut > 0"; -else - $sql.= " AND f.fk_statut > 1"; -$sql.= " AND s.entity = ".$conf->entity; -$sql.= " AND d.fk_facture = f.rowid"; -if ($agentid > 0) { - if (! empty($conf->global->AGENT_CONTACT_TYPE)) - $sql.= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))"; - else - $sql .= " AND sc.fk_user = ".$agentid; -} -if (!empty($startdate)) - $sql.= " AND f.datef >= '".$startdate."'"; -if (!empty($enddate)) - $sql.= " AND f.datef <= '".$enddate."'"; -if ($conf->global->COMMISSION_BASE == "MARGIN") - $sql .= " AND d.buy_price_ht IS NOT NULL"; -if (($conf->global->COMMISSION_BASE == "MARGIN") && isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) - $sql .= " AND d.buy_price_ht <> 0"; -if ($agentid > 0) - $sql.= " GROUP BY s.rowid"; -else - $sql.= " GROUP BY u.rowid"; -$sql.= " ORDER BY $sortfield $sortorder "; -//$sql.= $db->plimit($conf->liste_limit +1, $offset); - -$result = $db->query($sql); -if ($result) -{ - $num = $db->num_rows($result); - - print '
'; - print_barre_liste($langs->trans("CommissionDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,''); - - $i = 0; - print ""; - - print ''; - if ($agentid > 0) - print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); - else - print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); - - // product commission - if ($conf->global->COMMISSION_BASE == "MARGIN") - print_liste_field_titre($langs->trans("ProductMargin"),$_SERVER["PHP_SELF"],"productBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - elseif ($conf->global->COMMISSION_BASE == "TURNOVER") - print_liste_field_titre($langs->trans("ProductTurnover"),$_SERVER["PHP_SELF"],"productBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - print_liste_field_titre($langs->trans("CommissionRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ProductCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - // service commission - if ($conf->global->COMMISSION_BASE == "MARGIN") - print_liste_field_titre($langs->trans("ServiceMargin"),$_SERVER["PHP_SELF"],"serviceBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - elseif ($conf->global->COMMISSION_BASE == "TURNOVER") - print_liste_field_titre($langs->trans("ServiceTurnover"),$_SERVER["PHP_SELF"],"serviceBase","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - print_liste_field_titre($langs->trans("CommissionRate"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ServiceCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - // total commission - print_liste_field_titre($langs->trans("TotalCommission"),$_SERVER["PHP_SELF"],"","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); - - print "\n"; - - $cumul_base_produit = 0; - $cumul_base_service = 0; - $cumul_commission_produit = 0; - $cumul_commission_service = 0; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); - if ($num > 0) - { - $var=True; - while ($i < $num && $i < $conf->liste_limit) - { - $objp = $db->fetch_object($result); - - $var=!$var; - - print ""; - if ($agentid > 0) { - $companystatic->id=$objp->socid; - $companystatic->nom=$objp->nom; - $companystatic->client=$objp->client; - print "\n"; - } - else { - $userstatic->id=$objp->agent; - $userstatic->login=$objp->login; - print "\n"; - } - - // product commission - $productCommissionRate=(! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0); - $productBase=(! empty($objp->productBase)?$objp->productBase:0); - $productCommission = (! empty($productBase)?($productCommissionRate * $productBase / 100):0); - print "\n"; - print "\n"; - print "\n"; - - // service commission - $serviceCommissionRate=(! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:0); - $serviceBase=(! empty($objp->serviceBase)?$objp->serviceBase:0); - $serviceCommission = (! empty($serviceBase)?($serviceCommissionRate * $serviceBase / 100):0); - print "\n"; - print "\n"; - print "\n"; - - // total commission - print "\n"; - print "\n"; - - $i++; - - $cumul_base_produit += round($productBase, $rounding); - $cumul_base_service += round($serviceBase, $rounding); - $cumul_commission_produit += round($productCommission, $rounding); - $cumul_commission_service += round($serviceCommission, $rounding); - } - } - - // affichage totaux commission - $var=!$var; - print ''; - print '"; - // product commission - print "\n"; - print "\n"; - print "\n"; - // service commission - print "\n"; - print "\n"; - print "\n"; - // total commission - print "\n"; - - print "\n"; - - print ""; - print "
".$companystatic->getNomUrl(1,'customer')."".$userstatic->getLoginUrl(1)."".price($productBase)."".price($productCommissionRate)."".price($productCommission)."".price($serviceBase)."".price($serviceCommissionRate)."".price($serviceCommission)."".price($productCommission + $serviceCommission)."
'; - print $langs->trans('Total'); - print "".price($cumul_base_produit)."".price((! empty($conf->global->PRODUCT_COMMISSION_RATE)?$conf->global->PRODUCT_COMMISSION_RATE:0))."".price($cumul_commission_produit)."".price($cumul_base_service)."".price((! empty($conf->global->SERVICE_COMMISSION_RATE)?$conf->global->SERVICE_COMMISSION_RATE:0))."".price($cumul_commission_service)."".price($cumul_commission_produit + $cumul_commission_service)."
"; -} -else -{ - dol_print_error($db); -} -$db->free($result); - - -llxFooter(); -$db->close(); -?> - \ No newline at end of file diff --git a/htdocs/commissions/lib/commissions.lib.php b/htdocs/commissions/lib/commissions.lib.php deleted file mode 100644 index aa87720968c..00000000000 --- a/htdocs/commissions/lib/commissions.lib.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file /htdocs/commissions/lib/commissions.lib.php - * \ingroup commissions - * \brief Library for common commissions functions - */ - -/** - * Define head array for tabs of marges tools setup pages - * - * @return Array of head - */ -function commissions_admin_prepare_head() -{ - global $langs, $conf; - - $h = 0; - $head = array(); - - $head[$h][0] = DOL_URL_ROOT.'/commissions/admin/commissions.php'; - $head[$h][1] = $langs->trans("Parameters"); - $head[$h][2] = 'parameters'; - $h++; - - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab - // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin'); - - complete_head_from_modules($conf,$langs,'',$head,$h,'commissionsadmin','remove'); - - return $head; -} - -?> diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index b41fa735e7c..4e168d0645f 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -336,7 +336,6 @@ class FactureRec extends Facture $line->total_ht = $objp->total_ht; $line->total_tva = $objp->total_tva; $line->total_ttc = $objp->total_ttc; - $line->export_compta = $objp->fk_export_compta; $line->code_ventilation = $objp->fk_code_ventilation; $line->rang = $objp->rang; $line->special_code = $objp->special_code; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index ace5e15312c..f3427ee5d4b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -455,7 +455,7 @@ class Facture extends CommonInvoice } } else if ($reshook < 0) $error++; - + // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); @@ -866,7 +866,7 @@ class Facture extends CommonInvoice $this->extraparams = (array) json_decode($obj->extraparams, true); if ($this->statut == 0) $this->brouillon = 1; - + // Retreive all extrafield for invoice // fetch optionals attributes and labels if(!class_exists('Extrafields')) @@ -925,7 +925,7 @@ class Facture extends CommonInvoice $sql.= ' l.localtax1_tx, l.localtax2_tx, l.remise, l.remise_percent, l.fk_remise_except, l.subprice,'; $sql.= ' l.rang, l.special_code,'; $sql.= ' l.date_start as date_start, l.date_end as date_end,'; - $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_export_compta, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; + $sql.= ' l.info_bits, l.total_ht, l.total_tva, l.total_localtax1, l.total_localtax2, l.total_ttc, l.fk_code_ventilation, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; $sql.= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; @@ -970,7 +970,6 @@ class Facture extends CommonInvoice $line->total_localtax1 = $objp->total_localtax1; $line->total_localtax2 = $objp->total_localtax2; $line->total_ttc = $objp->total_ttc; - $line->export_compta = $objp->fk_export_compta; $line->code_ventilation = $objp->fk_code_ventilation; $line->fk_fournprice = $objp->fk_fournprice; $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht); @@ -1860,7 +1859,7 @@ class Facture extends CommonInvoice } } } - + if ($error == 0) { $old_statut=$this->statut; @@ -1870,8 +1869,8 @@ class Facture extends CommonInvoice include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('BILL_UNVALIDATE',$this,$user,$langs,$conf); - if ($result < 0) { - $error++; + if ($result < 0) { + $error++; $this->errors=$interface->errors; $this->statut=$old_statut; $this->brouillon=0; @@ -1881,7 +1880,7 @@ class Facture extends CommonInvoice $this->db->rollback(); return -1; } - + if ($error == 0) { $this->db->commit(); @@ -3196,7 +3195,6 @@ class FactureLigne var $total_ttc; var $fk_code_ventilation = 0; - var $fk_export_compta = 0; var $date_start; var $date_end; @@ -3237,7 +3235,7 @@ class FactureLigne $sql.= ' fd.localtax1_tx, fd. localtax2_tx, fd.remise, fd.remise_percent, fd.fk_remise_except, fd.subprice,'; $sql.= ' fd.date_start as date_start, fd.date_end as date_end, fd.fk_product_fournisseur_price as fk_fournprice, fd.buy_price_ht as pa_ht,'; $sql.= ' fd.info_bits, fd.total_ht, fd.total_tva, fd.total_ttc, fd.total_localtax1, fd.total_localtax2, fd.rang,'; - $sql.= ' fd.fk_code_ventilation, fd.fk_export_compta,'; + $sql.= ' fd.fk_code_ventilation,'; $sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid'; @@ -3271,7 +3269,6 @@ class FactureLigne $this->total_localtax2 = $objp->total_localtax2; $this->total_ttc = $objp->total_ttc; $this->fk_code_ventilation = $objp->fk_code_ventilation; - $this->fk_export_compta = $objp->fk_export_compta; $this->rang = $objp->rang; $this->fk_fournprice = $objp->fk_fournprice; $marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht); @@ -3338,7 +3335,7 @@ class FactureLigne $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facturedet'; $sql.= ' (fk_facture, fk_parent_line, label, description, qty, tva_tx, localtax1_tx, localtax2_tx,'; $sql.= ' fk_product, product_type, remise_percent, subprice, fk_remise_except,'; - $sql.= ' date_start, date_end, fk_code_ventilation, fk_export_compta, '; + $sql.= ' date_start, date_end, fk_code_ventilation, '; $sql.= ' rang, special_code, fk_product_fournisseur_price, buy_price_ht,'; $sql.= ' info_bits, total_ht, total_tva, total_ttc, total_localtax1, total_localtax2)'; $sql.= " VALUES (".$this->fk_facture.","; @@ -3357,7 +3354,6 @@ class FactureLigne $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; $sql.= ' '.$this->fk_code_ventilation.','; - $sql.= ' '.$this->fk_export_compta.','; $sql.= ' '.$this->rang.','; $sql.= ' '.$this->special_code.','; $sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").','; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 553262a3b4b..bc89cf7de7e 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -43,6 +43,8 @@ if ($user->societe_id > 0) * View */ +$userstatic=new User($db); + llxHeader(); if ($socid > 0) @@ -135,7 +137,7 @@ if ($socid > 0) $var=!$var; print ""; - print "".dol_print_date($fac->date)."\n"; + print "".dol_print_date($fac->date,'day')."\n"; print ''.img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."\n"; print ''.$fac->getLibStatut(2,$totalpaye).''; @@ -146,8 +148,12 @@ if ($socid > 0) print ' '; print ''.price($solde)."\n"; - // Auteur - print ''.img_object($langs->trans("ShowUser"),'user').' '.$objf->login.''; + // Author + $userstatic->id=$objf->userid; + $userstatic->login=$objf->login; + print ''; + print $userstatic->getLoginUrl(1); + print ''; print "\n"; @@ -172,7 +178,7 @@ if ($socid > 0) $objp = $db->fetch_object($resqlp); //$var=!$var; print ""; - print ''.dol_print_date($db->jdate($objp->dp))."\n"; + print ''.dol_print_date($db->jdate($objp->dp),'day')."\n"; print ''; print '      '; // Decalage print ''.img_object($langs->trans("ShowPayment"),"payment").' '.$langs->trans("Payment").' '.$objp->rowid.''; @@ -182,8 +188,12 @@ if ($socid > 0) $solde = $solde - $objp->amount; print ''.price($solde)."\n"; - // Auteur - print ''.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.''; + // Author + $userstatic->id=$objp->userid; + $userstatic->login=$objp->login; + print ''; + print $userstatic->getLoginUrl(1); + print ''; print ''; @@ -214,5 +224,4 @@ else llxFooter(); $db->close(); - ?> diff --git a/htdocs/compta/ventilation/fournisseur/index.php b/htdocs/compta/ventilation/fournisseur/index.php index c10bb23a056..636891e7c18 100644 --- a/htdocs/compta/ventilation/fournisseur/index.php +++ b/htdocs/compta/ventilation/fournisseur/index.php @@ -39,7 +39,7 @@ print ''; $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) { @@ -50,7 +50,7 @@ if ($result) } $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) @@ -62,7 +62,7 @@ if ($result) } $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facture_fourn_det"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) { @@ -73,7 +73,7 @@ if ($result) } /*$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiementfourn"; -$sql .= " WHERE fk_export_compta = 0"; +$sql .= " WHERE fk_code_ventilation = 0"; $result = $db->query($sql); if ($result) diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php index e5cf6bc8edd..c938e9774c4 100644 --- a/htdocs/compta/ventilation/lignes.php +++ b/htdocs/compta/ventilation/lignes.php @@ -48,7 +48,7 @@ if ($page < 0) $page = 0; $limit = $conf->liste_limit; $offset = $limit * $page ; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero,"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total_ttc as price, l.qty, l.rowid, l.tva_tx, l.fk_code_ventilation, c.intitule, c.numero,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; @@ -72,7 +72,7 @@ if ($result) $num_lignes = $db->num_rows($result); $i = 0; - print_barre_liste("Lignes de facture ventil�es",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); + print_barre_liste($langs->trans("InvoiceDispatched"),$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); print '
'; print ''; @@ -136,7 +136,7 @@ else print "
"; -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/compta/ventilation/liste.php b/htdocs/compta/ventilation/liste.php index 70679d3a381..81613640541 100644 --- a/htdocs/compta/ventilation/liste.php +++ b/htdocs/compta/ventilation/liste.php @@ -54,7 +54,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; $limit = $conf->liste_limit; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.rowid, l.fk_code_ventilation,"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, f.total as price, l.rowid, l.fk_code_ventilation,"; $sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " , ".MAIN_DB_PREFIX."facturedet as l"; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d005396d829..398f30dd100 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -649,14 +649,16 @@ class Contrat extends CommonObject // Insert contract $sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,"; $sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,"; - $sql.= " ref, entity)"; + $sql.= " ref, entity, note, note_public)"; $sql.= " VALUES (".$this->db->idate($now).",".$this->socid.",".$user->id; $sql.= ",".$this->db->idate($this->date_contrat); $sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL"); $sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL"); - $sql.= ",".($this->fk_projet>0?$this->fk_projet:"NULL"); + $sql.= ",".($this->fk_project>0?$this->fk_project:"NULL"); $sql.= ", ".(dol_strlen($this->ref)<=0 ? "null" : "'".$this->ref."'"); $sql.= ", ".$conf->entity; + $sql.= ", ".(!empty($this->note)?("'".$this->db->escape($this->note)."'"):"NULL"); + $sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL"); $sql.= ")"; $resql=$this->db->query($sql); if ($resql) @@ -694,6 +696,12 @@ class Contrat extends CommonObject if (! $error) { + // Add linked object + if (! $error && $this->origin && $this->origin_id) + { + $ret = $this->add_object_linked(); + if (! $ret) dol_print_error($this->db); + } $this->db->commit(); return $this->id; } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index ac56afab3ca..902dde79f17 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -176,27 +176,158 @@ if ($action == 'add' && $user->rights->contrat->creer) if (! $error) { - $object->socid = $socid; + $object->socid = $socid; $object->date_contrat = $datecontrat; $object->commercial_suivi_id = GETPOST('commercial_suivi_id','int'); $object->commercial_signature_id = GETPOST('commercial_signature_id','int'); $object->note = GETPOST('note','alpha'); + $object->note_public = GETPOST('note_public','alpha'); $object->fk_project = GETPOST('projectid','int'); $object->remise_percent = GETPOST('remise_percent','alpha'); $object->ref = GETPOST('ref','alpha'); - $result = $object->create($user,$langs,$conf); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else { - $mesg='
'.$object->error.'
'; - } - $action='create'; + // If creation from another object of another module (Example: origin=propal, originid=1) + if ($_POST['origin'] && $_POST['originid']) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = $_POST['origin']; + if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } + + // For compatibility + if ($element == 'order') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + + $object->origin = $_POST['origin']; + $object->origin_id = $_POST['originid']; + + // Possibility to add external linked objects with hooks + $object->linked_objects[$object->origin] = $object->origin_id; + if (is_array($_POST['other_linked_objects']) && ! empty($_POST['other_linked_objects'])) + { + $object->linked_objects = array_merge($object->linked_objects, $_POST['other_linked_objects']); + } + + $id = $object->create($user); + if ($id < 0) { + $mesg='
'.$object->error.'
'; + } + + if ($id > 0) + { + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + + $classname = ucfirst($subelement); + $srcobject = new $classname($db); + + dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); + $result=$srcobject->fetch($object->origin_id); + if ($result > 0) + { + $srcobject->fetch_thirdparty(); + $lines = $srcobject->lines; + if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); + + $fk_parent_line=0; + $num=count($lines); + + for ($i=0;$i<$num;$i++) + { + $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); + + if ($product_type == 1) { //only services + // service prédéfini + if ($lines[$i]->fk_product > 0) + { + $product_static = new Product($db); + + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $prod = new Product($db, $lines[$i]->fk_product); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$srcobject->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; + } + else + { + $label = $lines[$i]->product_label; + } + + if ($conf->global->PRODUIT_DESC_IN_FORM) + $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):''; + } + else { + $desc = dol_htmlentitiesbr($lines[$i]->desc); + } + + $result = $object->addline( + $desc, + $lines[$i]->subprice, + $lines[$i]->qty, + $lines[$i]->tva_tx, + $lines[$i]->localtax1_tx, + $lines[$i]->localtax2_tx, + $lines[$i]->fk_product, + $lines[$i]->remise_percent, + $date_start =0, + $date_end =0, + 'HT', + 0, + $lines[$i]->info_bits, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht + ); + + if ($result < 0) + { + $error++; + break; + } + + } + } + + } + else + { + $mesg=$srcobject->error; + $error++; + } + } + else + { + $mesg=$object->error; + $error++; + } + } + else + { + $result = $object->create($user,$langs,$conf); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else { + $mesg='
'.$object->error.'
'; + } + $action='create'; + } } } @@ -622,6 +753,51 @@ if ($action == 'create') $soc = new Societe($db); if ($socid>0) $soc->fetch($socid); + if (GETPOST('origin') && GETPOST('originid')) + { + // Parse element/subelement (ex: project_task) + $element = $subelement = GETPOST('origin'); + if (preg_match('/^([^_]+)_([^_]+)/i',GETPOST('origin'),$regs)) + { + $element = $regs[1]; + $subelement = $regs[2]; + } + + if ($element == 'project') + { + $projectid=GETPOST('originid'); + } + else + { + // For compatibility + if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } + if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } + + dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); + + $classname = ucfirst($subelement); + $objectsrc = new $classname($db); + $objectsrc->fetch(GETPOST('originid')); + if (empty($objectsrc->lines) && method_exists($objectsrc,'fetch_lines')) $objectsrc->fetch_lines(); + $objectsrc->fetch_thirdparty(); + + $projectid = (!empty($objectsrc->fk_project)?$objectsrc->fk_project:''); + + $soc = $objectsrc->client; + + $note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : '')); + $note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : ''); + + // Object source contacts list + $srccontactslist = $objectsrc->liste_contact(-1,'external',1); + } + } + else { + $projectid = GETPOST('projectid','int'); + $note_private = GETPOST("note"); + $note_public = GETPOST("note_public"); + } + $object->date_contrat = dol_now(); $numct = $object->getNextNumRef($soc); @@ -687,18 +863,18 @@ if ($action == 'create') if (! empty($conf->projet->enabled)) { print ''.$langs->trans("Project").''; - select_projects($soc->id,GETPOST("projectid"),"projectid"); + select_projects($soc->id,$projectid,"projectid"); print ""; } print ''.$langs->trans("NotePublic").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note_public', GETPOST('note_public'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); + $doleditor=new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); /* print ''; */ @@ -706,11 +882,11 @@ if ($action == 'create') { print ''.$langs->trans("NotePrivate").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('note', GETPOST('note'), '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); + $doleditor=new DolEditor('note', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); /* print '';*/ print ''; } @@ -721,6 +897,12 @@ if ($action == 'create') print "\n"; + if (is_object($objectsrc)) + { + print ''; + print ''; + } + print '
'; print "\n"; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 26b8a0c5826..9058350747f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2141,7 +2141,7 @@ abstract class CommonObject $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field of attribut if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate - $sql.=",".$attributeKey; + $sql.=",".$attributeKey; } $sql .= ") VALUES (".$this->id; foreach($this->array_options as $key => $value) @@ -2695,7 +2695,8 @@ abstract class CommonObject global $form,$bc,$bcdd; $element=$this->element; - $text=''; + + $text=''; $description=''; $type=0; // Show product and description $type=(! empty($line->product_type)?$line->product_type:$line->fk_product_type); @@ -2703,27 +2704,25 @@ abstract class CommonObject if (! empty($line->date_start)) $type=1; // deprecated if (! empty($line->date_end)) $type=1; // deprecated - if ($line->fk_product > 0) - { - $product_static = new Product($this->db); - - $product_static->type=$line->fk_product_type; - $product_static->id=$line->fk_product; - $product_static->ref=$line->ref; - $text=$product_static->getNomUrl(1); - } - // Ligne en mode visu if ($action != 'editline' || $selected != $line->id) { - // Produit + // Product if ($line->fk_product > 0) { - // Define output language + $product_static = new Product($this->db); + + $product_static->type=$line->fk_product_type; + $product_static->id=$line->fk_product; + $product_static->ref=$line->ref; + $text=$product_static->getNomUrl(1); + + // Define output language (TODO Does this works ?) if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $this->fetch_thirdparty(); $prod = new Product($this->db); + $prod->fetch($line->fk_product); $outputlangs = $langs; $newlang=''; diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php new file mode 100644 index 00000000000..2acb83e3f05 --- /dev/null +++ b/htdocs/core/class/html.formcron.class.php @@ -0,0 +1,93 @@ + +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * \file cron/class/html.formcron.class.php +* \brief Fichier de la classe des fonctions predefinie de composants html cron +*/ + + +/** + * Class to manage building of HTML components +*/ +class FormCron extends Form +{ + var $db; + var $error; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + $this->db = $db; + return 1; + } + + + /** + * Display On Off selector + * + * @param string $htmlname Html control name + * @param string $selected selected value + * @param string $readonly Select is read only or not + * @return string HTML select field + */ + function select_typejob($htmlname,$selected=0,$readonly=0) + { + global $langs; + + $langs->load('cron@cron'); + if (!empty($readonly)) { + if ($selected=='command') { + $out= $langs->trans('CronType_command'); + $out.=''; + } elseif ($selected=='method') { + $out= $langs->trans('CronType_method'); + $out.=''; + } + }else { + + $out=''; + } + + return $out; + } +} diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 8ba3a161712..f06e8027e5f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -90,6 +90,11 @@ function societe_prepare_head($object) $head[$h][2] = 'note'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Referers"); + $head[$h][2] = 'consumption'; + $h++; + // Attached files $head[$h][0] = DOL_URL_ROOT.'/societe/document.php?socid='.$object->id; $head[$h][1] = $langs->trans("Documents"); diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php new file mode 100644 index 00000000000..abd85131e29 --- /dev/null +++ b/htdocs/core/lib/cron.lib.php @@ -0,0 +1,71 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +/** + * \file cron/lib/cron.lib.php + * \brief Ensemble de fonctions de base pour le module jobs + * \ingroup jobs + */ + +/** + * Return array of tabs to used on pages for third parties cards. + * + * @param Object $object Object company shown + * @return array Array of tabs + */ + +function cronadmin_prepare_head() +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath('/cron/admin/cron.php', 1); + $head[$h][1] = $langs->trans("CronSetup"); + $head[$h][2] = 'setup'; + $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cronadmin'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cronadmin', 'remove'); + + + return $head; +} + +function cron_prepare_head($object) +{ + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath('/cron/card.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("CronTask"); + $head[$h][2] = 'card'; + $h++; + + $head[$h][0] = dol_buildpath('/cron/info.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("CronInfoPage"); + $head[$h][2] = 'info'; + $h++; + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cron'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'cron', 'remove'); + + return $head; +} diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index c07360abd10..64f415ac085 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -805,17 +805,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Compta simple - if (! empty($conf->comptabilite->enabled) && ! empty($conf->global->FACTURE_VENTILATION)) + if (! empty($conf->comptabilite->enabled) && ($conf->global->MAIN_FEATURES_LEVEL >= 2)) { $newmenu->add("/compta/ventilation/index.php?leftmenu=ventil",$langs->trans("Dispatch"),0,$user->rights->compta->ventilation->lire, '', $mainmenu, 'ventil'); if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/liste.php",$langs->trans("ToDispatch"),1,$user->rights->compta->ventilation->lire); if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/lignes.php",$langs->trans("Dispatched"),1,$user->rights->compta->ventilation->lire); - if ($leftmenu=="ventil") $newmenu->add("/compta/param/",$langs->trans("Setup"),1,$user->rights->compta->ventilation->parametrer); - if ($leftmenu=="ventil") $newmenu->add("/compta/param/comptes/fiche.php?action=create",$langs->trans("New"),2,$user->rights->compta->ventilation->parametrer); - if ($leftmenu=="ventil") $newmenu->add("/compta/param/comptes/liste.php",$langs->trans("List"),2,$user->rights->compta->ventilation->parametrer); - if ($leftmenu=="ventil") $newmenu->add("/compta/export/",$langs->trans("Export"),1,$user->rights->compta->ventilation->lire); - if ($leftmenu=="ventil") $newmenu->add("/compta/export/index.php?action=export",$langs->trans("New"),2,$user->rights->compta->ventilation->lire); - if ($leftmenu=="ventil") $newmenu->add("/compta/export/liste.php",$langs->trans("List"),2,$user->rights->compta->ventilation->lire); } // Compta expert diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 56e0d90fdb3..39c70faab79 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -546,10 +546,10 @@ class pdf_expedition_merou extends ModelePdfExpedition $object->GetUrlTrackingStatus($object->tracking_number); if (! empty($object->tracking_url)) { - if ($object->expedition_method_id > 0) + if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey - $code=$outputlangs->getLabelFromKey($this->db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); $label=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; } else diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 172966b89cf..368527612f1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -189,10 +189,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition $object->GetUrlTrackingStatus($object->tracking_number); if (! empty($object->tracking_url)) { - if ($object->expedition_method_id > 0) + if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey - $code=$outputlangs->getLabelFromKey($this->db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); $label=$outputlangs->trans("LinkToTrackYourPackage")."
"; $label.=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; $pdf->SetFont('','B', $default_font_size - 2); diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 1bae9f61129..832d96a194b 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -65,7 +65,7 @@ class modBanque extends DolibarrModules // Config pages //------------- - $this->config_page_url = array("bank.php@compta/bank"); + $this->config_page_url = array("bank.php"); // Dependancies $this->depends = array(); diff --git a/htdocs/core/modules/modCommissions.class.php b/htdocs/core/modules/modCommissions.class.php deleted file mode 100644 index 64908f5248c..00000000000 --- a/htdocs/core/modules/modCommissions.class.php +++ /dev/null @@ -1,169 +0,0 @@ - - * Copyright (C) 2012 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \defgroup commissions Module commissions - * \brief Module commissions - * \file htdocs/core/modules/modCommissions.class.php - * \ingroup commissions - * \brief Description and activation file for module Commissions - */ -include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; - - -/** - * Class to describe modude Commisions - */ -class modCommissions extends DolibarrModules -{ - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - function __construct($db) - { - $this->db = $db; - - // Id for module (must be unique). - // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). - $this->numero = 60000; - // Key text used to identify module (for permissions, menus, etc...) - $this->rights_class = 'Commissions'; - - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' - // It is used to group modules in module setup page - $this->family = "financial"; - // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) - $this->name = preg_replace('/^mod/i','',get_class($this)); - // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "Commissions management"; - // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = 'experimental'; - // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) - $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - // Where to store the module in setup page (0=common,1=interface,2=other) - $this->special = 2; - // Name of png file (without png) used for this module. - // Png file must be in theme/yourtheme/img directory under name object_pictovalue.png. - $this->picto='commissions'; - - // Data directories to create when module is enabled. - $this->dirs = array(); - - // Config pages. Put here list of php page names stored in admmin directory used to setup module. - $this->config_page_url = array("commissions.php@commissions"); - - // Dependencies - $this->depends = array("modFacture", "modMargin"); // List of modules id that must be enabled if this module is enabled - $this->requiredby = array(); // List of modules id to disable if this one is disabled - $this->phpmin = array(5,1); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(3,2); // Minimum version of Dolibarr required by module - $this->langfiles = array("commissions"); - - // Constants - $this->const = array(0=>array('COMMISSION_BASE',"chaine","TURNOVER",'Default commission base',0)); // List of particular constants to add when module is enabled - - // New pages on tabs - $this->tabs = array(); - - // Boxes - $this->boxes = array(); // List of boxes - $r=0; - - // Permissions - $this->rights = array(); // Permission array used by this module - $r=0; - - // Add here list of permission defined by an id, a label, a boolean and two constant strings. - // Example: - // $this->rights[$r][0] = 2000; // Permission id (must not be already used) - // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) - // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - // $r++; - - - // Main menu entries - $this->menu = array(); // List of menus to add - $r = 0; - - // left menu entry - $this->menu[$r]=array( - 'fk_menu'=>'fk_mainmenu=accountancy', // Put 0 if this is a top menu - 'type'=>'left', // This is a Top menu entry - 'titre'=>'Commissions', - 'mainmenu'=>'accountancy', - 'leftmenu'=>'commissions', // Use 1 if you also want to add left menu entries using this descriptor. Use 0 if left menu entries are defined in a file pre.inc.php (old school). - 'url'=>'/commissions/index.php', - 'langs'=>'commissions', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>200, - 'enabled'=>'$conf->commissions->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled. - 'perms'=>'1', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - $r++; - } - - /** - * Function called when module is enabled. - * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. - * It also creates data directories. - * - * @return int 1 if OK, 0 if KO - */ - function init() - { - $sql = array(); - - $result=$this->load_tables(); - - return $this->_init($sql); - } - - /** - * Function called when module is disabled. - * Remove from database constants, boxes and permissions from Dolibarr database. - * Data directories are not deleted. - * - * @return int 1 if OK, 0 if KO - */ - function remove() - { - $sql = array(); - - return $this->_remove($sql); - } - - - /** - * Create tables and keys required by module - * Files mymodule.sql and mymodule.key.sql with create table and create keys - * commands must be stored in directory /mymodule/sql/ - * This function is called by this->init. - * - * @return int <=0 if KO, >0 if OK - */ - function load_tables() - { - return; - } -} - -?> diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index fbc14945f02..53d9afabf30 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr + * Copyright (C) 2013 Florian Henry * * 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 @@ -16,11 +17,11 @@ */ /** - * \defgroup webservices Module webservices - * \brief Module to enable the Dolibarr server of web services - * \file htdocs/core/modules/modCron.class.php - * \ingroup cron - * \brief File to describe cron module + * \defgroup cron Module cron + * \brief cron module descriptor. + * \file cron/core/modules/modCron.class.php + * \ingroup cron + * \brief Description and activation file for module Jobs */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; @@ -65,11 +66,20 @@ class modCron extends DolibarrModules //------------- $this->depends = array(); $this->requiredby = array(); - $this->langfiles = array("cron"); + $this->langfiles = array("cron@cron"); // Constantes //----------- - $this->const = array(); + $this->const = array( + 0=>array( + 'MAIN_CRON_KEY', + 'chaine', + '', + 'CRON KEY', + 0, + 'main', + 0 + ),); // New pages on tabs // ----------------- @@ -79,25 +89,60 @@ class modCron extends DolibarrModules //------ $this->boxes = array(); - // Permissions - //------------ - $this->rights = array(); - $this->rights_class = 'cron'; - $r=0; + // Permissions + $this->rights = array(); // Permission array used by this module + $this->rights_class = 'cron'; + $r=0; + + $this->rights[$r][0] = 23001; + $this->rights[$r][1] = 'Read cron jobs'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'read'; + $r++; + + $this->rights[$r][0] = 23002; + $this->rights[$r][1] = 'Create cron Jobs'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'create'; + $r++; + + $this->rights[$r][0] = 23003; + $this->rights[$r][1] = 'Delete cron Jobs'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'delete'; + $r++; + + $this->rights[$r][0] = 23004; + $this->rights[$r][1] = 'Execute cron Jobs'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'execute'; + $r++; // Main menu entries $r=0; $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry - 'titre'=>'CronJobs', - 'url'=>'/cron/index.php', - 'langs'=>'cron@cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>100, + 'titre'=>'CronListActive', + 'url'=>'/cron/list.php?status=1', + 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>200, 'enabled'=>'$leftmenu==\'modulesadmintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both $r++; + + $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'CronListInactive', + 'url'=>'/cron/list.php?status=0', + 'langs'=>'cron', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>201, + 'enabled'=>'$leftmenu==\'modulesadmintools\'', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->rights->cron->read', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $r++; } @@ -114,8 +159,6 @@ class modCron extends DolibarrModules // Prevent pb of modules not correctly disabled //$this->remove($options); - $sql = array(); - return $this->_init($sql,$options); } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index abaef7a1910..051f4f98071 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -16,6 +16,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * + * To use this template, the following var must be defined + * $type, $text, $description, $line */ ?> @@ -38,59 +40,59 @@ description) { - if ($line->description == '(CREDIT_NOTE)') - { - $discount=new DiscountAbsolute($this->db); - $discount->fetch($line->fk_remise_except); - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); - } - elseif ($line->description == '(DEPOSIT)') - { - $discount=new DiscountAbsolute($this->db); - $discount->fetch($line->fk_remise_except); - echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); - // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; - } - else - { - echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); - } + if ($line->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($line->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + elseif ($line->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($this->db); + $discount->fetch($line->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($line->description); } } - else - { - if ($line->fk_product > 0) { + } + else + { + if ($line->fk_product > 0) { - echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); + echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); - // Show range - print_date_range($line->date_start, $line->date_end); + // Show range + echo get_date_range($line->date_start, $line->date_end); - // Add description in form - if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) - { - print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; - } + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($line->description) && $line->description!=$line->product_label)?'
'.dol_htmlentitiesbr($line->description):''; + } + } else { + + if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + + if (! empty($line->label)) { + $text.= ' '.$line->label.''; + echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); } else { - - if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow'); - if ($type==1) $text = img_object($langs->trans('Service'),'service'); - else $text = img_object($langs->trans('Product'),'product'); - - if (! empty($line->label)) { - $text.= ' '.$line->label.''; - echo $form->textwithtooltip($text,dol_htmlentitiesbr($line->description),3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):'')); - } else { - echo $text.' '.dol_htmlentitiesbr($line->description); - } - - // Show range - print_date_range($line->date_start,$line->date_end); + echo $text.' '.dol_htmlentitiesbr($line->description); } + + // Show range + echo get_date_range($line->date_start,$line->date_end); } - ?> + } + ?> tva_tx,'%',$line->info_bits); ?> diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index fd77bcc6851..894e9dc4457 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -1,34 +1,36 @@ * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2011 Juanjo Menent - * Copyright (C) 2012 Regis Houssin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +* Copyright (C) 2011 Juanjo Menent +* Copyright (C) 2012 Regis Houssin +* Copyright (C) 2013 Florian Henry +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ /** - * \file htdocs/cron/admin/cron.php - * \ingroup cron - * \brief Page to setup cron module - */ + * \file cron/admin/cron.php +* \ingroup cron +*/ -require '../../main.inc.php'; +// Dolibarr environment +$res = @include("../../main.inc.php"); // From htdocs directory require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; -$langs->load("admin"); -$langs->load("cron"); +$langs->load("admin"); +$langs->load("cron"); if (! $user->admin) accessforbidden(); @@ -36,37 +38,40 @@ if (! $user->admin) $actionsave=GETPOST("save"); // Sauvegardes parametres -if ($actionsave) +if (!empty($actionsave)) { - $i=0; + $i=0; - $db->begin(); + $db->begin(); - $i+=dolibarr_set_const($db,'CRON_KEY',trim(GETPOST("CRON_KEY")),'chaine',0,'',$conf->entity); + $i+=dolibarr_set_const($db,'MAIN_CRON_KEY',trim(GETPOST("MAIN_CRON_KEY")),'chaine',0,'',0); - if ($i >= 1) - { - $db->commit(); - setEventMessage($langs->trans("SetupSaved")); - } - else - { - $db->rollback(); - setEventMessage($langs->trans("Error"), 'errors'); - } + if ($i >= 1) + { + $db->commit(); + setEventMessage($langs->trans("SetupSaved")); + } + else + { + $db->rollback(); + setEventMessage($langs->trans("Error"), 'errors'); + } } /* * View - */ +*/ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("CronSetup"),$linkback,'setup'); -print $langs->trans("CronDesc")."
\n"; +// Configuration header +$head = cronadmin_prepare_head(); +dol_fiche_head($head,'setup',$langs->trans("Module2300Name"),0,'cron'); + print "
\n"; print '
'; @@ -76,13 +81,12 @@ print ''; print ''; print ""; print ""; -//print ""; print ""; print ""; print ''; print ''; -print ''; @@ -102,12 +106,35 @@ print '

'; // Cron launch print ''.$langs->trans("URLToLaunchCronJobs").':
'; -$url=DOL_MAIN_URL_ROOT.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY); +$url=dol_buildpath('/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login; print img_picto('','object_globe.png').' '.$url."
\n"; print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; -$url=DOL_MAIN_URL_ROOT.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'id=cronjobid'; -print img_picto('','object_globe.png').' '.$url."
\n"; +$url=dol_buildpath('/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; +print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; +print '
'; + + +$linuxlike=1; +if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; + +if ($linuxlike) { + print $langs->trans("CronExplainHowToRunUnix"); +} else { + print $langs->trans("CronExplainHowToRunWin"); +} +print '
'; +print ''.$langs->trans("FileToLaunchCronJobs").':
'; +$file='/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->MAIN_CRON_KEY)?'securitykey':''.$conf->global->MAIN_CRON_KEY.'').' '.$user->login.' cronjobid(optionnal)'; +if ($linuxlike) { + print 'user@host:'.DOL_DOCUMENT_ROOT.'$ php ..'.$file."
\n"; +} else { + print DOL_DOCUMENT_ROOT.'> php ..'.$file."
\n"; +} +print '
'; + + print '
'; @@ -116,20 +143,18 @@ if (! empty($conf->use_javascript_ajax)) { print "\n".''; } - llxFooter(); -$db->close(); -?> +$db->close(); \ No newline at end of file diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php new file mode 100644 index 00000000000..bd6ffb0e5c9 --- /dev/null +++ b/htdocs/cron/card.php @@ -0,0 +1,596 @@ + + * +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +/** + * \file cron/card.php + * \ingroup cron + * \brief Cron Jobs Card + */ + +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + +// librairie jobs +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/class/html.formcron.class.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; + + +$langs->load("admin"); +$langs->load("cron"); + +if (!$user->rights->cron->create) accessforbidden(); + +$id=GETPOST('id','int'); +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$cancel=GETPOST('cancel'); + +$object = new Cronjob($db); +if (!empty($id)) { + $result=$object->fetch($id); + if ($result < 0) { + setEventMessage($object->error,'errors'); + } +} + +if(!empty($cancel)) { + if (!empty($id)) { + $action=''; + }else { + Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1'); + } + +} + +// Delete jobs +if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete){ + + + $result = $object->delete($user); + + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + }else { + Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1'); + } +} + +// Execute jobs +if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute){ + + $result=$object->run_jobs($user->login); + + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action=''; + }else { + $action=''; + } + +} + + +if ($action=='add') { + + $object->jobtype=GETPOST('jobtype','alpha'); + $object->label=GETPOST('label','alpha'); + $object->command=GETPOST('command','alpha'); + $object->priority=GETPOST('priority','int'); + $object->classesname=GETPOST('classesname','alpha'); + $object->objectname=GETPOST('objectname','alpha'); + $object->methodename=GETPOST('methodename','alpha'); + $object->params=GETPOST('params'); + $object->md5params=GETPOST('md5params'); + $object->module_name=GETPOST('module_name','alpha'); + $object->note=GETPOST('note'); + $object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int')); + $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); + $object->unitfrequency=GETPOST('unitfrequency','int'); + $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int'); + + //Ajout de la tache cron + $result = $object->create($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='create'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + +// Save parameters +if ($action=='update') { + $object->id=$id; + $object->jobtype=GETPOST('jobtype','alpha'); + $object->label=GETPOST('label','alpha'); + $object->command=GETPOST('command','alpha'); + $object->classesname=GETPOST('classesname','alpha'); + $object->priority=GETPOST('priority','int'); + $object->objectname=GETPOST('objectname','alpha'); + $object->methodename=GETPOST('methodename','alpha'); + $object->params=GETPOST('params'); + $object->md5params=GETPOST('md5params'); + $object->module_name=GETPOST('module_name','alpha'); + $object->note=GETPOST('note'); + $object->datestart=dol_mktime(GETPOST('datestarthour','int'), GETPOST('datestartmin','int'), 0, GETPOST('datestartmonth','int'), GETPOST('datestartday','int'), GETPOST('datestartyear','int')); + $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); + $object->unitfrequency=GETPOST('unitfrequency','int'); + $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int'); + + //Ajout de la tache cron + $result = $object->update($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + +if ($action=='activate') { + $object->status=1; + + //Ajout de la tache cron + $result = $object->update($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + +if ($action=='inactive') { + $object->status=0; + //Ajout de la tache cron + $result = $object->update($user); + + // test du Resultat de la requete + if ($result < 0) { + setEventMessage($object->error,'errors'); + $action='edit'; + } + else { + setEventMessage($langs->trans('CronSaveSucess'),'mesgs'); + $action=''; + } +} + + +/* + * View +*/ + +llxHeader('',$langs->trans("CronAdd")); + +if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') { + $head=cron_prepare_head($object); + dol_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'bill'); +} elseif ($action=='create') { + print_fiche_titre($langs->trans("CronTask"),'','setup'); +} + +if ($conf->use_javascript_ajax) +{ + print "\n".''."\n"; +} + +$form = new Form($db); +$formCron = new FormCron($db); + +if ($action == 'delete') +{ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + if ($ret == 'html') print '
'; + $action=''; +} + +if ($action == 'execute'){ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + if ($ret == 'html') print '
'; + $action=''; +} + + + +/* + * Create Template +*/ + +if (empty($object->status)) { + dol_htmloutput_mesg($langs->trans("CronTaskInactive"),'','warning',1); +} + +if (($action=="create") || ($action=="edit")) { + + print ''; + print ''."\n"; + if (!empty($object->id)) { + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + + print '
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
'.$langs->trans("KeyForCronAccess").''; +print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); print '
'; + + print '"; + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print "\n"; + + print ""; + $priority=0; + if (!empty($object->priority)) { + $priority=$object->priority; + } + print ""; + print ""; + print "\n"; + + print ""; + print ""; + print ""; + print "\n"; + + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + print '"; + print ""; + print "\n"; + + + print '"; + print ""; + print "\n"; + + print '
'; + print $langs->trans('CronLabel')."label."\" /> "; + print ""; + print "
"; + print $langs->trans('CronType').""; + print $formCron->select_typejob('jobtype',$object->jobtype); + print ""; + print "
"; + print $langs->trans('CronHourStart').""; + if(!empty($object->datestart)){ + $form->select_date($object->datestart,'datestart',1,1,'',"cronform"); + } + else{ + $form->select_date(dol_now(),'datestart',1,1,'',"cronform"); + } + print ""; + print "
"; + print $langs->trans('CronDtEnd').""; + if(!empty($object->dateend)){ + $form->select_date($object->dateend,'dateend',1,1,'',"cronform"); + } + else{ + $form->select_date('','dateend',1,1,1,"cronform"); + } + print ""; + print "
"; + print $langs->trans('CronPriority')." "; + print ""; + print "
"; + print $langs->trans('CronEvery')."unitfrequency=="60"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + + $input = "unitfrequency=="3600"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + + $input = "unitfrequency=="86400"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + + $input = "unitfrequency=="604800"){ + $input .= ' checked="checked" />'; + } + else{ + $input .= ' />'; + } + $input .= ""; + print $input; + print ""; + print "
'; + print $langs->trans('CronModule').""; + print "module_name."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronModuleHelp"),1,'help'); + print "
'; + print $langs->trans('CronClassFile').""; + print "classesname."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronClassFileHelp"),1,'help'); + print "
'; + print $langs->trans('CronObject').""; + print "objectname."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronObjectHelp"),1,'help'); + print "
'; + print $langs->trans('CronMethod').""; + print "methodename."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronMethodHelp"),1,'help'); + print "
'; + print $langs->trans('CronArgs').""; + print "params."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronArgsHelp"),1,'help'); + print "
'; + print $langs->trans('CronCommand').""; + print "command."\" /> "; + print ""; + print $form->textwithpicto('',$langs->trans("CronCommandHelp"),1,'help'); + print "
'; + print $langs->trans('CronNote').""; + $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, 4, 90); + $doleditor->Create(); + print ""; + print "
'; + print "trans("Save")."\">"; + print "trans("Cancel")."\">"; + print ""; + print "
'; + + print "
\n"; + +}else { + + /* + * view Template + */ + + // box add_jobs_box + print ''; + + print '"; + print "\n"; + + print '"; + print ""; + + print ""; + + print ""; + + print ""; + + print ""; + print ""; + + print ""; + print ""; + + print ""; + print ""; + + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '"; + + print '
'; + print $langs->trans('CronId')."".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id'); + print "
'; + print $langs->trans('CronLabel')."".$object->label; + print "
"; + print $langs->trans('CronType').""; + print $formCron->select_typejob('jobtype',$object->jobtype,1); + print "
"; + print $langs->trans('CronHourStart').""; + if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
"; + print $langs->trans('CronDtEnd').""; + if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
"; + print $langs->trans('CronPriority')."".$object->priority; + print "
"; + print $langs->trans('CronNbRun')."".$object->nbrun; + print "
"; + print $langs->trans('CronEvery').""; + if($object->unitfrequency == "60") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Minutes'); + if($object->unitfrequency == "3600") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Hours'); + if($object->unitfrequency == "86400") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Days'); + if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Weeks'); + print "
'; + print $langs->trans('CronModule').""; + print $object->module_name; + print "
'; + print $langs->trans('CronClassFile').""; + print $object->classesname; + print "
'; + print $langs->trans('CronObject').""; + print $object->objectname; + print "
'; + print $langs->trans('CronMethod').""; + print $object->methodename; + print "
'; + print $langs->trans('CronArgs').""; + print $object->params; + print "
'; + print $langs->trans('CronCommand').""; + print $object->command; + print "
'; + print $langs->trans('CronNote').""; + print $object->note; + print "
'; + print $langs->trans('CronDtLastLaunch').""; + if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
'; + print $langs->trans('CronDtNextLaunch').""; + if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
'; + print $langs->trans('CronDtLastResult').""; + if(!empty($object->datelastresult)) {print dol_print_date($object->datelastresult,'dayhourtext');} else {print $langs->trans('CronNone');} + print "
'; + print $langs->trans('CronLastResult').""; + print $object->lastresult; + print "
'; + print $langs->trans('CronLastOutput').""; + print nl2br($object->lastoutput); + print "
'; + + print "\n\n
\n"; + if (! $user->rights->cron->create) { + print ''.$langs->trans("Edit").''; + } else { + print ''.$langs->trans("Edit").''; + } + if (! $user->rights->cron->delete) { + print ''.$langs->trans("Delete").''; + } else { + print ''.$langs->trans("Delete").''; + } + if (! $user->rights->cron->create) { + print ''.$langs->trans("CronStatusActiveBtn").'/'.$langs->trans("CronStatusInactiveBtn").''; + } else { + if (empty($object->status)) { + print ''.$langs->trans("CronStatusActiveBtn").''; + } else { + print ''.$langs->trans("CronStatusInactiveBtn").''; + } + } + if ((! $user->rights->cron->execute) || (empty($object->status))) { + print ''.$langs->trans("CronExecute").''; + } else { + print ''.$langs->trans("CronExecute").''; + } + print '

'; +} + +$db->close(); +llxFooter(); \ No newline at end of file diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b2b5fcddd1a..b24055c6f3d 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2013 Florian Henry * * 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 @@ -17,42 +17,58 @@ */ /** - * \file dev/skeletons/cronjob.class.php + * \file cron/class/cronjob.class.php * \ingroup cron - * \brief CRUD class file (Create/Read/Update/Delete) for cronjob table - * Initialy built by build_class_from_table on 2013-03-17 18:50 */ // Put here all includes required by your class file require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); -//require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); /** - * Put here description of your class + * Crob Job class */ class Cronjob extends CommonObject { var $db; //!< To store db handler var $error; //!< To return error code (or message) var $errors=array(); //!< To return several error codes (or messages) - var $element='cronjob'; //!< Id that identify managed objects + var $element='cronjob'; //!< Id that identify managed objects var $table_element='cronjob'; //!< Name of table without prefix where object is stored var $id; - + + var $ref; //Use for prevnext_ref + var $jobtype; var $tms=''; var $datec=''; + var $label; var $command; + var $classesname; + var $objectname; + var $methodename; var $params; + var $md5params; + var $module_name; + var $priority; var $datelastrun=''; - var $lastresult=''; + var $datenextrun=''; + var $dateend=''; + var $datestart=''; + var $datelastresult=''; + var $lastresult; var $lastoutput; - var $fk_user; + var $unitfrequency; + var $frequency; + var $status; + var $fk_user_author; + var $fk_user_mod; var $note; + var $nbrun; + + var $lines; - + /** @@ -80,51 +96,128 @@ class Cronjob extends CommonObject $error=0; // Clean parameters - + + if (isset($this->label)) $this->label=trim($this->label); + if (isset($this->jobtype)) $this->jobtype=trim($this->jobtype); if (isset($this->command)) $this->command=trim($this->command); + if (isset($this->classesname)) $this->classesname=trim($this->classesname); + if (isset($this->objectname)) $this->objectname=trim($this->objectname); + if (isset($this->methodename)) $this->methodename=trim($this->methodename); if (isset($this->params)) $this->params=trim($this->params); + if (isset($this->md5params)) $this->md5params=trim($this->md5params); + if (isset($this->module_name)) $this->module_name=trim($this->module_name); + if (isset($this->priority)) $this->priority=trim($this->priority); if (isset($this->lastoutput)) $this->lastoutput=trim($this->lastoutput); - if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user); + if (isset($this->lastresult)) $this->lastresult=trim($this->lastresult); + if (isset($this->unitfrequency)) $this->unitfrequency=trim($this->unitfrequency); + if (isset($this->frequency)) $this->frequency=trim($this->frequency); + if (isset($this->status)) $this->status=trim($this->status); if (isset($this->note)) $this->note=trim($this->note); - - + if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun); // Check parameters - // Put here code to add control on parameters values + // Put here code to add a control on parameters values + if (dol_strlen($this->datestart)==0) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronDtStart')); + $error++; + } + if (empty($this->label)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronLabel')); + $error++; + } + if ((dol_strlen($this->datestart)!=0) && (dol_strlen($this->dateend)!=0) && ($this->dateend<$this->datestart)) { + $this->errors[]=$langs->trans('CronErrEndDateStartDt'); + $error++; + } + if (empty($this->unitfrequency)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronFrequency')); + $error++; + } + if (($this->jobtype=='command') && (empty($this->command))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronCommand')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->classesname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronClass')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->methodename))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronMethod')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->objectname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronObject')); + $error++; + } // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob("; - + $sql.= "datec,"; + $sql.= "jobtype,"; + $sql.= "label,"; $sql.= "command,"; + $sql.= "classesname,"; + $sql.= "objectname,"; + $sql.= "methodename,"; $sql.= "params,"; + $sql.= "md5params,"; + $sql.= "module_name,"; + $sql.= "priority,"; $sql.= "datelastrun,"; + $sql.= "datenextrun,"; + $sql.= "dateend,"; + $sql.= "datestart,"; $sql.= "lastresult,"; + $sql.= "datelastresult,"; $sql.= "lastoutput,"; - $sql.= "fk_user,"; - $sql.= "note"; - + $sql.= "unitfrequency,"; + $sql.= "frequency,"; + $sql.= "status,"; + $sql.= "fk_user_author,"; + $sql.= "fk_user_mod,"; + $sql.= "note,"; + $sql.= "nbrun"; + $sql.= ") VALUES ("; - - $sql.= " ".(! isset($this->datec) || dol_strlen($this->datec)==0?'NULL':$this->db->idate($this->datec)).","; + + $sql.= " ".$this->db->idate(dol_now()).","; + $sql.= " ".(! isset($this->jobtype)?'NULL':"'".$this->db->escape($this->jobtype)."'").","; + $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; $sql.= " ".(! isset($this->command)?'NULL':"'".$this->db->escape($this->command)."'").","; + $sql.= " ".(! isset($this->classesname)?'NULL':"'".$this->db->escape($this->classesname)."'").","; + $sql.= " ".(! isset($this->objectname)?'NULL':"'".$this->db->escape($this->objectname)."'").","; + $sql.= " ".(! isset($this->methodename)?'NULL':"'".$this->db->escape($this->methodename)."'").","; $sql.= " ".(! isset($this->params)?'NULL':"'".$this->db->escape($this->params)."'").","; + $sql.= " ".(! isset($this->md5params)?'NULL':"'".$this->db->escape($this->md5params)."'").","; + $sql.= " ".(! isset($this->module_name)?'NULL':"'".$this->db->escape($this->module_name)."'").","; + $sql.= " ".(! isset($this->priority)?'NULL':"'".$this->priority."'").","; $sql.= " ".(! isset($this->datelastrun) || dol_strlen($this->datelastrun)==0?'NULL':$this->db->idate($this->datelastrun)).","; - $sql.= " ".(! isset($this->lastresult) || dol_strlen($this->lastresult)==0?'NULL':$this->db->idate($this->lastresult)).","; + $sql.= " ".(! isset($this->datenextrun) || dol_strlen($this->datenextrun)==0?'NULL':$this->db->idate($this->datenextrun)).","; + $sql.= " ".(! isset($this->dateend) || dol_strlen($this->dateend)==0?'NULL':$this->db->idate($this->dateend)).","; + $sql.= " ".(! isset($this->datestart) || dol_strlen($this->datestart)==0?'NULL':$this->db->idate($this->datestart)).","; + $sql.= " ".(! isset($this->lastresult)?'NULL':"'".$this->db->escape($this->lastresult)."'").","; + $sql.= " ".(! isset($this->datelastresult) || dol_strlen($this->datelastresult)==0?'NULL':$this->db->idate($this->datelastresult)).","; $sql.= " ".(! isset($this->lastoutput)?'NULL':"'".$this->db->escape($this->lastoutput)."'").","; - $sql.= " ".(! isset($this->fk_user)?'NULL':"'".$this->fk_user."'").","; - $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").""; - + $sql.= " ".(! isset($this->unitfrequency)?'NULL':"'".$this->unitfrequency."'").","; + $sql.= " ".(! isset($this->frequency)?'NULL':"'".$this->frequency."'").","; + $sql.= " ".(! isset($this->status)?'0':"'".$this->status."'").","; + $sql.= " ".$user->id.","; + $sql.= " ".$user->id.","; + $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").","; + $sql.= " ".(! isset($this->nbrun)?'0':"'".$this->db->escape($this->nbrun)."'").""; + $sql.= ")"; + $this->db->begin(); dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob"); @@ -173,18 +266,35 @@ class Cronjob extends CommonObject global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; - + $sql.= " t.tms,"; $sql.= " t.datec,"; + $sql.= " t.jobtype,"; + $sql.= " t.label,"; $sql.= " t.command,"; + $sql.= " t.classesname,"; + $sql.= " t.objectname,"; + $sql.= " t.methodename,"; $sql.= " t.params,"; + $sql.= " t.md5params,"; + $sql.= " t.module_name,"; + $sql.= " t.priority,"; $sql.= " t.datelastrun,"; + $sql.= " t.datenextrun,"; + $sql.= " t.dateend,"; + $sql.= " t.datestart,"; $sql.= " t.lastresult,"; + $sql.= " t.datelastresult,"; $sql.= " t.lastoutput,"; - $sql.= " t.fk_user,"; - $sql.= " t.note"; - + $sql.= " t.unitfrequency,"; + $sql.= " t.frequency,"; + $sql.= " t.status,"; + $sql.= " t.fk_user_author,"; + $sql.= " t.fk_user_mod,"; + $sql.= " t.note,"; + $sql.= " t.nbrun"; + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql.= " WHERE t.rowid = ".$id; @@ -197,18 +307,36 @@ class Cronjob extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - + $this->ref = $obj->rowid; + $this->tms = $this->db->jdate($obj->tms); $this->datec = $this->db->jdate($obj->datec); + $this->label = $obj->label; + $this->jobtype = $obj->jobtype; $this->command = $obj->command; + $this->classesname = $obj->classesname; + $this->objectname = $obj->objectname; + $this->methodename = $obj->methodename; $this->params = $obj->params; + $this->md5params = $obj->md5params; + $this->module_name = $obj->module_name; + $this->priority = $obj->priority; $this->datelastrun = $this->db->jdate($obj->datelastrun); - $this->lastresult = $this->db->jdate($obj->lastresult); + $this->datenextrun = $this->db->jdate($obj->datenextrun); + $this->dateend = $this->db->jdate($obj->dateend); + $this->datestart = $this->db->jdate($obj->datestart); + $this->lastresult = $obj->lastresult; $this->lastoutput = $obj->lastoutput; - $this->fk_user = $obj->fk_user; + $this->datelastresult = $this->db->jdate($obj->datelastresult); + $this->unitfrequency = $obj->unitfrequency; + $this->frequency = $obj->frequency; + $this->status = $obj->status; + $this->fk_user_author = $obj->fk_user_author; + $this->fk_user_mod = $obj->fk_user_mod; $this->note = $obj->note; + $this->nbrun = $obj->nbrun; - + } $this->db->free($resql); @@ -221,6 +349,141 @@ class Cronjob extends CommonObject return -1; } } + + /** + * Load object in memory from the database + * + * @param string $sortorder sort order + * @param string $sortfield sort field + * @param int $limit limit page + * @param int $offset page + * @param int $status display active or not + * @param array $filter filter output + * @return int <0 if KO, >0 if OK + */ + function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='') + { + global $langs; + $sql = "SELECT"; + $sql.= " t.rowid,"; + $sql.= " t.tms,"; + $sql.= " t.datec,"; + $sql.= " t.jobtype,"; + $sql.= " t.label,"; + $sql.= " t.command,"; + $sql.= " t.classesname,"; + $sql.= " t.objectname,"; + $sql.= " t.methodename,"; + $sql.= " t.params,"; + $sql.= " t.md5params,"; + $sql.= " t.module_name,"; + $sql.= " t.priority,"; + $sql.= " t.datelastrun,"; + $sql.= " t.datenextrun,"; + $sql.= " t.dateend,"; + $sql.= " t.datestart,"; + $sql.= " t.lastresult,"; + $sql.= " t.datelastresult,"; + $sql.= " t.lastoutput,"; + $sql.= " t.unitfrequency,"; + $sql.= " t.frequency,"; + $sql.= " t.status,"; + $sql.= " t.fk_user_author,"; + $sql.= " t.fk_user_mod,"; + $sql.= " t.note,"; + $sql.= " t.nbrun"; + + + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; + $status = (empty($status))?'0':'1'; + $sql.= " WHERE t.status=".$status; + //Manage filter + if (is_array($filter) && count($filter)>0) { + foreach($filter as $key => $value) { + $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; + } + } + + + $sql.= " ORDER BY $sortfield $sortorder "; + if (!empty($limit) && !empty($offset)) { + $sql.= $this->db->plimit( $limit + 1 ,$offset); + } + + $sqlwhere = array(); + + if (!empty($module_name)) { + $sqlwhere[]='(t.module_name='.$module_name.')'; + } + if (count($sqlwhere)>0) { + $sql.= " WHERE ".implode(' AND ',$sqlwhere); + } + + dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + $num=$this->db->num_rows($resql); + $i=0; + + if ($num) + { + $this->lines=array(); + + while ($i < $num) + { + + $line = new Cronjobline(); + + $obj = $this->db->fetch_object($resql); + + $line->id = $obj->rowid; + $line->ref = $obj->rowid; + + $line->tms = $this->db->jdate($obj->tms); + $line->datec = $this->db->jdate($obj->datec); + $line->label = $obj->label; + $line->jobtype = $obj->jobtype; + $line->command = $obj->command; + $line->classesname = $obj->classesname; + $line->objectname = $obj->objectname; + $line->methodename = $obj->methodename; + $line->params = $obj->params; + $line->md5params = $obj->md5params; + $line->module_name = $obj->module_name; + $line->priority = $obj->priority; + $line->datelastrun = $this->db->jdate($obj->datelastrun); + $line->datenextrun = $this->db->jdate($obj->datenextrun); + $line->dateend = $this->db->jdate($obj->dateend); + $line->datestart = $this->db->jdate($obj->datestart); + $line->lastresult = $obj->lastresult; + $line->datelastresult = $this->db->jdate($obj->datelastresult); + $line->lastoutput = $obj->lastoutput; + $line->unitfrequency = $obj->unitfrequency; + $line->frequency = $obj->frequency; + $line->status = $obj->status; + $line->fk_user_author = $obj->fk_user_author; + $line->fk_user_mod = $obj->fk_user_mod; + $line->note = $obj->note; + $line->nbrun = $obj->nbrun; + + $this->lines[]=$line; + + $i++; + + } + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); + return -1; + } + } /** @@ -233,35 +496,98 @@ class Cronjob extends CommonObject function update($user=0, $notrigger=0) { global $conf, $langs; + + $langs->load('cron'); + $error=0; // Clean parameters - + + if (isset($this->label)) $this->label=trim($this->label); + if (isset($this->jobtype)) $this->jobtype=trim($this->jobtype); if (isset($this->command)) $this->command=trim($this->command); + if (isset($this->classesname)) $this->classesname=trim($this->classesname); + if (isset($this->objectname)) $this->objectname=trim($this->objectname); + if (isset($this->methodename)) $this->methodename=trim($this->methodename); if (isset($this->params)) $this->params=trim($this->params); + if (isset($this->md5params)) $this->md5params=trim($this->md5params); + if (isset($this->module_name)) $this->module_name=trim($this->module_name); + if (isset($this->priority)) $this->priority=trim($this->priority); if (isset($this->lastoutput)) $this->lastoutput=trim($this->lastoutput); - if (isset($this->fk_user)) $this->fk_user=trim($this->fk_user); + if (isset($this->lastresult)) $this->lastresult=trim($this->lastresult); + if (isset($this->unitfrequency)) $this->unitfrequency=trim($this->unitfrequency); + if (isset($this->frequency)) $this->frequency=trim($this->frequency); + if (isset($this->status)) $this->status=trim($this->status); if (isset($this->note)) $this->note=trim($this->note); - - + if (isset($this->nbrun)) $this->nbrun=trim($this->nbrun); // Check parameters // Put here code to add a control on parameters values + if (empty($this->status)) { + $this->dateend=dol_now(); + } + if (dol_strlen($this->datestart)==0) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronDtStart')); + $error++; + } + if ((dol_strlen($this->datestart)!=0) && (dol_strlen($this->dateend)!=0) && ($this->dateend<$this->datestart)) { + $this->errors[]=$langs->trans('CronErrEndDateStartDt'); + $error++; + } + if (empty($this->label)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronLabel')); + $error++; + } + if (empty($this->unitfrequency)) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronFrequency')); + $error++; + } + if (($this->jobtype=='command') && (empty($this->command))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronCommand')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->classesname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronClass')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->methodename))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronMethod')); + $error++; + } + if (($this->jobtype=='method') && (empty($this->objectname))) { + $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronObject')); + $error++; + } + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."cronjob SET"; - - $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').","; - $sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').","; + + $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; + $sql.= " jobtype=".(isset($this->jobtype)?"'".$this->db->escape($this->jobtype)."'":"null").","; $sql.= " command=".(isset($this->command)?"'".$this->db->escape($this->command)."'":"null").","; + $sql.= " classesname=".(isset($this->classesname)?"'".$this->db->escape($this->classesname)."'":"null").","; + $sql.= " objectname=".(isset($this->objectname)?"'".$this->db->escape($this->objectname)."'":"null").","; + $sql.= " methodename=".(isset($this->methodename)?"'".$this->db->escape($this->methodename)."'":"null").","; $sql.= " params=".(isset($this->params)?"'".$this->db->escape($this->params)."'":"null").","; + $sql.= " md5params=".(isset($this->md5params)?"'".$this->db->escape($this->md5params)."'":"null").","; + $sql.= " module_name=".(isset($this->module_name)?"'".$this->db->escape($this->module_name)."'":"null").","; + $sql.= " priority=".(isset($this->priority)?$this->priority:"null").","; $sql.= " datelastrun=".(dol_strlen($this->datelastrun)!=0 ? "'".$this->db->idate($this->datelastrun)."'" : 'null').","; - $sql.= " lastresult=".(dol_strlen($this->lastresult)!=0 ? "'".$this->db->idate($this->lastresult)."'" : 'null').","; + $sql.= " datenextrun=".(dol_strlen($this->datenextrun)!=0 ? "'".$this->db->idate($this->datenextrun)."'" : 'null').","; + $sql.= " dateend=".(dol_strlen($this->dateend)!=0 ? "'".$this->db->idate($this->dateend)."'" : 'null').","; + $sql.= " datestart=".(dol_strlen($this->datestart)!=0 ? "'".$this->db->idate($this->datestart)."'" : 'null').","; + $sql.= " datelastresult=".(dol_strlen($this->datelastresult)!=0 ? "'".$this->db->idate($this->datelastresult)."'" : 'null').","; + $sql.= " lastresult=".(isset($this->lastresult)?"'".$this->db->escape($this->lastresult)."'":"null").","; $sql.= " lastoutput=".(isset($this->lastoutput)?"'".$this->db->escape($this->lastoutput)."'":"null").","; - $sql.= " fk_user=".(isset($this->fk_user)?$this->fk_user:"null").","; - $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").""; - + $sql.= " unitfrequency=".(isset($this->unitfrequency)?$this->unitfrequency:"null").","; + $sql.= " frequency=".(isset($this->frequency)?$this->frequency:"null").","; + $sql.= " status=".(isset($this->status)?$this->status:"null").","; + $sql.= " fk_user_mod=".$user->id.","; + $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").","; + $sql.= " nbrun=".(isset($this->nbrun)?$this->nbrun:"null"); + $sql.= " WHERE rowid=".$this->id; $this->db->begin(); @@ -269,7 +595,7 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { if (! $notrigger) @@ -377,7 +703,7 @@ class Cronjob extends CommonObject $error=0; - $object=new Cronjobs($this->db); + $object=new Cronjob($this->db); $this->db->begin(); @@ -428,19 +754,277 @@ class Cronjob extends CommonObject function initAsSpecimen() { $this->id=0; - + $this->ref=0; + $this->tms=''; $this->datec=''; + $this->label=''; + $this->jobtype=''; $this->command=''; + $this->classesname=''; + $this->objectname=''; + $this->methodename=''; $this->params=''; + $this->md5params=''; + $this->module_name=''; + $this->priority=''; $this->datelastrun=''; - $this->lastresult=''; + $this->datenextrun=''; + $this->dateend=''; + $this->datestart=''; + $this->datelastresult=''; $this->lastoutput=''; - $this->fk_user=''; - $this->note=''; - - + $this->lastresult=''; + $this->unitfrequency=''; + $this->frequency=''; + $this->status=''; + $this->fk_user_author=''; + $this->fk_user_mod=''; + $this->note=''; + $this->nbrun=''; } + + /** + * Load object information + * + * @return void + */ + function info() + { + global $langs; + + $sql = "SELECT"; + $sql.= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author"; + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f"; + $sql.= " WHERE f.rowid = ".$this->id; + + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); + $resql=$this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); + $this->id = $obj->rowid; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->tms); + $this->user_modification = $obj->fk_user_mod; + $this->user_creation = $obj->fk_user_author; + } + $this->db->free($resql); + + return 1; + } + else + { + $this->error="Error ".$this->db->lasterror(); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); + return -1; + } + } + + /** + * Run a job + * + * @param string $userlogin User login + * @return int <0 if KO, >0 if OK + */ + function run_jobs($userlogin) + { + global $langs, $conf; + + $langs->load('cron'); + + if (empty($userlogin)) { + $this->error="User login is mandatory"; + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $user=new User($this->db); + $result=$user->fetch('',$userlogin); + if ($result<0) { + $this->error="User Error:".$user->error; + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + }else { + if (empty($user->id)) { + $this->error=" User user login:".$userlogin." do not exists"; + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + } + + dol_syslog(get_class($this)."::run_jobs userlogin:$userlogin", LOG_DEBUG); + + $error=0; + $now=dol_now(); + + $this->db->begin(); + + if ($this->jobtype=='method') { + // load classes + $ret=dol_include_once("/".$this->module_name."/class/".$this->classesname,$this->objectname); + if ($ret===false) { + $this->error=$langs->trans('CronCannotLoadClass',$file,$this->objectname); + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + + // Load langs + $result=$langs->load($this->module_name.'@'.$this->module_name); + if ($result<0) { + dol_syslog(get_class($this)."::run_jobs Cannot load module langs".$langs->error, LOG_ERR); + return -1; + } + + dol_syslog(get_class($this)."::run_jobs ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG); + + // Create Object for the call module + $object = new $this->objectname($this->db); + + $params_arr = array(); + $params_arr=explode(", ",$this->params); + if (!is_array($params_arr)) { + $result = call_user_func(array($object, $this->methodename), $this->params); + }else { + $result = call_user_func_array(array($object, $this->methodename), $params_arr); + } + + if ($result===false) { + dol_syslog(get_class($this)."::run_jobs ".$object->error, LOG_ERR); + return -1; + }else { + $this->lastoutput=var_export($result,true); + $this->lastresult=var_export($result,true); + } + + } elseif ($this->jobtype=='command') { + dol_syslog(get_class($this)."::run_jobs system:".$this->command, LOG_DEBUG); + $output_arr=array(); + + exec($this->command, $output_arr,$retval); + + dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG); + + $this->lastoutput=''; + if (is_array($output_arr) && count($output_arr)>0) { + foreach($output_arr as $val) { + $this->lastoutput.=$val."\n"; + } + } + $this->lastresult=$retval; + } + + $this->datelastresult=$now; + $this->datelastrun=$now; + $this->nbrun=$this->nbrun+1; + $result = $this->update($user); + if ($result<0) { + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + $this->db->rollback(); + return -1; + }else { + $this->db->commit(); + return 1; + } + + + } + + /** + * Reprogram a job + * + * @param string $userlogin User login + * @return int <0 if KO, >0 if OK + * + */ + function reprogram_jobs($userlogin) + { + global $langs, $conf; + + dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG); + + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $user=new User($this->db); + $result=$user->fetch('',$userlogin); + if ($result<0) { + $this->error="User Error:".$user->error; + dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); + return -1; + }else { + if (empty($user->id)) { + $this->error=" User user login:".$userlogin." do not exists"; + dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); + return -1; + } + } + + dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG); + + if (empty($this->datenextrun)) { + $this->datenextrun=dol_now()+$this->frequency; + } else { + if ($this->datenextrundatenextrun=dol_now()+$this->frequency; + } else { + $this->datenextrun=$this->datenextrun+$this->frequency; + } + } + $result = $this->update($user); + if ($result<0) { + dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); + return -1; + } + + return 1; + + } } -?> + + +/** + * Crob Job line class + */ +class Cronjobline{ + + var $id; + var $ref; + + var $tms=''; + var $datec=''; + var $label; + var $jobtype; + var $command; + var $classesname; + var $objectname; + var $methodename; + var $params; + var $md5params; + var $module_name; + var $priority; + var $datelastrun=''; + var $datenextrun=''; + var $dateend=''; + var $datestart=''; + var $lastresult=''; + var $lastoutput; + var $unitfrequency; + var $frequency; + var $status; + var $fk_user_author; + var $fk_user_mod; + var $note; + var $nbrun; + + /** + * Constructor + * + */ + function __construct() + { + return 1; + } +} \ No newline at end of file diff --git a/htdocs/cron/functions_cron.lib.php b/htdocs/cron/functions_cron.lib.php deleted file mode 100644 index 31cc8ebefad..00000000000 --- a/htdocs/cron/functions_cron.lib.php +++ /dev/null @@ -1,27 +0,0 @@ - - * Copyright (C) 2007-2009 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file cron/functions_cron.lib.php - * \ingroup core - * \brief Functions for miscellaneous cron tasks - */ - - - -?> diff --git a/htdocs/cron/index.php b/htdocs/cron/index.php deleted file mode 100644 index 3d7ef46ad77..00000000000 --- a/htdocs/cron/index.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file dev/Cronjobss/Cronjobs_page.php - * \ingroup mymodule othermodule1 othermodule2 - * \brief This file is an example of a php page - * Initialy built by build_class_from_table on 2013-03-17 18:50 - */ - -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) - -// Change this following line to use the correct relative path (../, ../../, etc) -$res=0; -if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; -if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; -if (! $res && file_exists("../../../main.inc.php")) $res=@include '../../../main.inc.php'; -if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res && file_exists("../../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only -if (! $res) die("Include of main fails"); -// Change this following line to use the correct relative path from htdocs -dol_include_once('/module/class/cronjob.class.php'); - -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("cron"); - -// Get parameters -$id = GETPOST('id','int'); -$action = GETPOST('action','alpha'); -$myparam = GETPOST('myparam','alpha'); -$action='list'; - -// Protection if external user -if ($user->societe_id > 0) accessforbidden(); -if (! $user->admin) accessforbidden(); - - -/******************************************************************* -* ACTIONS -* -* Put here all code to do according to value of "action" parameter -********************************************************************/ - -if ($action == 'add') -{ - $object=new Cronjobs($db); - $object->prop1=$_POST["field1"]; - $object->prop2=$_POST["field2"]; - $result=$object->create($user); - if ($result > 0) - { - // Creation OK - } - { - // Creation KO - $mesg=$object->error; - } -} - - - - - -/*************************************************** -* VIEW -* -* Put here all code to build page -****************************************************/ - -llxHeader('','MyPageName',''); - -$form=new Form($db); - - -//print ''; -//print '
'; -print '
'; - - - - - -//print '
'; -print '
'; - - - -// Example 1 : Adding jquery code -print ''; - - -// Example 2 : Adding links to objects -// The class must extends CommonObject class to have this method available -//$somethingshown=$object->showLinkedObjectBlock(); - - -// Example 3 : List of data -if ($action == 'list') -{ - $sql = "SELECT"; - $sql.= " t.rowid,"; - - $sql.= " t.tms,"; - $sql.= " t.datec,"; - $sql.= " t.command,"; - $sql.= " t.params,"; - $sql.= " t.datelastrun,"; - $sql.= " t.lastresult,"; - $sql.= " t.lastoutput,"; - $sql.= " t.fk_user,"; - $sql.= " t.note"; - - - $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; - //$sql.= " WHERE field3 = 'xxx'"; - //$sql.= " ORDER BY field1 ASC"; - - - print_fiche_titre($langs->trans("ListOfCronJobs"),'','').'
'; - - - print ''."\n"; - print ''; - print_liste_field_titre($langs->trans('Id'),$_SERVER['PHP_SELF'],'t.rowid','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Command'),$_SERVER['PHP_SELF'],'t.command','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DateCreation'),$_SERVER['PHP_SELF'],'t.datec','align="center"',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('LastOutput'),$_SERVER['PHP_SELF'],'','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('DateLastRun'),$_SERVER['PHP_SELF'],'t.datelastrun','align="center"',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('LastResult'),$_SERVER['PHP_SELF'],'t.lastresult','align="right"',$param,'',$sortfield,$sortorder); - print ''; - - dol_syslog($script_file." sql=".$sql, LOG_DEBUG); - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - if ($num) - { - while ($i < $num) - { - $obj = $db->fetch_object($resql); - if ($obj) - { - // You can use here results - print ''; - } - $i++; - } - } - } - else - { - $error++; - dol_print_error($db); - } - - print '
'; - print $obj->rowid; - print ''; - print $obj->command; - print ''; - print $db->jdate($obj->datec); - print ''; - print ''; - print ''; - print $db->jdate($obj->datelastrun); - print ''; - print $obj->lastresult; - print '
'."\n"; -} - - -//print '
'; -print '
'; - - -// End of page -llxFooter(); -$db->close(); -?> diff --git a/htdocs/cron/info.php b/htdocs/cron/info.php new file mode 100644 index 00000000000..55c294d54ed --- /dev/null +++ b/htdocs/cron/info.php @@ -0,0 +1,59 @@ + +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +/** + * \file /cron/cron/info.php + * \brief Page fiche d'une operation + */ + +require '../main.inc.php'; + +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + + +// Security check +if (!$user->rights->cron->read) accessforbidden(); + +$id=GETPOST('id','int'); + +$mesg = ''; + +/* + * View +*/ + +llxHeader('',$langs->trans("CronInfo")); + +$object = new Cronjob($db); +$object->fetch($id); +$object->info($id); + +$head = cron_prepare_head($object); + +dol_fiche_head($head, 'info', $langs->trans("CronTask"), 0, 'bill'); + +print '
'; +dol_print_object_info($object); +print '
'; +print ''; + + +$db->close(); +llxFooter(); \ No newline at end of file diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php new file mode 100644 index 00000000000..5e972f0e55b --- /dev/null +++ b/htdocs/cron/list.php @@ -0,0 +1,295 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file cron/cron/list.php + * \ingroup cron + * \brief Lists Jobs + */ + + +require '../main.inc.php'; +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); + +// librairie jobs +require_once DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"; +require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php'; + +$langs->load("admin"); +$langs->load("cron"); + +if (!$user->rights->cron->read) accessforbidden(); + +/* + * Actions + */ +$action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); +$id=GETPOST('id','int'); + +$sortorder=GETPOST('sortorder','alpha'); +$sortfield=GETPOST('sortfield','alpha'); +$page=GETPOST('page','int'); +$status=GETPOST('status','int'); + +//Search criteria +$search_label=GETPOST("search_label",'alpha'); + +if (empty($sortorder)) $sortorder="DESC"; +if (empty($sortfield)) $sortfield="t.datenextrun"; +if (empty($arch)) $arch = 0; + +if ($page == -1) { + $page = 0 ; +} + +$limit = $conf->global->MAIN_SIZE_LISTE_LIMIT; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +// Do we click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $search_label=''; +} + +$filter=array(); +if (!empty($search_label)) { + $filter['t.label']=$search_label; +} + +// Delete jobs +if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete){ + + //Delete de la tache cron + $object = new Cronjob($db); + $object->id=$id; + $result = $object->delete($user); + + if ($result < 0) { + setEventMessage($object->error,'errors'); + } +} + +// Execute jobs +if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->execute){ + + //Execute jobs + $object = new Cronjob($db); + $job = $object->fetch($id); + + $result = $object->run_jobs($user->login); + if ($result < 0) { + setEventMessage($object->error,'errors'); + } + +} + + +/* + * View + */ +if (!empty($status)) { + $pagetitle=$langs->trans("CronListActive"); +}else { + $pagetitle=$langs->trans("CronListInactive"); +} + +llxHeader('',$pagetitle); + + +// Form object for popup +$form = new Form($db); + +if ($action == 'delete') +{ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); + if ($ret == 'html') print '
'; +} + +if ($action == 'execute'){ + $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1); + if ($ret == 'html') print '
'; +} + + +print_fiche_titre($pagetitle,'','setup'); + +print $langs->trans('CronInfo'); + +// liste des jobs creer +$object = new Cronjob($db); +$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter); +if ($result < 0) { + setEventMessage($object->error,'errors'); +} + + +print "

"; +print $langs->trans('CronWaitingJobs'); +print "

"; + +if (count($object->lines)>0) { + + print ''; + print ''; + $arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label; + print_liste_field_titre($langs->trans("CronLabel"),$_SERVEUR['PHP_SELF'],"t.label","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronTask"),'','',"",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtStart"),$_SERVEUR['PHP_SELF'],"t.datestart","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVEUR['PHP_SELF'],"t.dateend","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVEUR['PHP_SELF'],"t.datelastrun","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVEUR['PHP_SELF'],"t.datenextrun","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronNbRun"),$_SERVEUR['PHP_SELF'],"t.nbrun","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronLastResult"),$_SERVEUR['PHP_SELF'],"t.lastresult","",$arg_url,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVEUR['PHP_SELF'],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder); + print ''; + + print ''; + + print ''."\n"; + print ''; + print ''; + + + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + + + + // Boucler sur chaque job + $style='impair'; + foreach($object->lines as $line){ + // title profil + if ($style=='pair') {$style='impair';} + else {$style='pair';} + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + + print ''; + } + print '
'; + print ''; + print '         '; + print '  '; + print ''; + print '
'; + if(!empty($line->label)) { + print ''.$line->label.''; + } + else { + print $langs->trans('CronNone'); + } + print ''; + if ($line->jobtype=='method') { + print $langs->trans('CronModule').':'.$line->module_name.'
'; + print $langs->trans('CronClass').':'. $line->classesname.'
'; + print $langs->trans('CronObject').':'. $line->objectname.'
'; + print $langs->trans('CronMethod').':'. $line->methodename; + if(!empty($line->params)) { + print '
'.$langs->trans('CronArgs').':'. $line->params; + } + + }elseif ($line->jobtype=='command') { + print $langs->trans('CronCommand').':'. dol_trunc($line->command); + if(!empty($line->params)) { + print '
'.$langs->trans('CronArgs').':'. $line->params; + } + } + print '
'; + if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} + print ''; + if($line->unitfrequency == "60") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Minutes'); + if($line->unitfrequency == "3600") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Hours'); + if($line->unitfrequency == "86400") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Days'); + if($line->unitfrequency == "604800") print $langs->trans('CronEach')." ".($line->frequency/$line->unitfrequency)." ".$langs->trans('Weeks'); + print ''; + if(!empty($line->nbrun)) {print $line->nbrun;} else {print '0';} + print ''; + if(!empty($line->lastresult)) {print dol_trunc($line->lastresult);} else {print $langs->trans('CronNone');} + print ''; + if(!empty($line->lastoutput)) {print dol_trunc(nl2br($line->lastoutput),100);} else {print $langs->trans('CronNone');} + print ''; + if ($user->rights->cron->delete) { + print "id."&status=".$status."&action=delete\" title=\"".$langs->trans('CronDelete')."\">\"".$langs-trans('CronDelete')."\" />"; + } else { + print "trans('NotEnoughPermissions')."\">\"".$langs-trans('NotEnoughPermissions')."\" />"; + } + if ($user->rights->cron->execute) { + print "id."&status=".$status."&action=execute\" title=\"".$langs->trans('CronExecute')."\">\"".$langs-trans('CronExecute')."\" />"; + } else { + print "trans('NotEnoughPermissions')."\">\"".$langs-trans('NotEnoughPermissions')."\" />"; + } + print '
'; +} else { + print $langs->trans('CronNoJobs'); +} + +print "\n\n
\n"; +if (! $user->rights->cron->create) { + print ''.$langs->trans("New").''; +} else { + print ''.$langs->trans("New").''; +} +print '

'; + +llxFooter(); +$db->close(); \ No newline at end of file diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index cac81eda070..393a316df15 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -51,7 +51,6 @@ class Expedition extends CommonObject var $origin; var $origin_id; var $lines=array(); - var $expedition_method_id; // deprecated var $shipping_method_id; var $tracking_number; var $tracking_url; @@ -203,7 +202,7 @@ class Expedition extends CommonObject $sql.= ", ".($this->date_delivery>0?"'".$this->db->idate($this->date_delivery)."'":"null"); $sql.= ", ".$this->socid; $sql.= ", ".($this->fk_delivery_address>0?$this->fk_delivery_address:"null"); - $sql.= ", ".($this->expedition_method_id>0?$this->expedition_method_id:"null"); + $sql.= ", ".($this->shipping_method_id>0?$this->shipping_method_id:"null"); $sql.= ", '".$this->db->escape($this->tracking_number)."'"; $sql.= ", ".$this->weight; $sql.= ", ".$this->sizeS; // TODO Should use this->trueDepth @@ -373,7 +372,6 @@ class Expedition extends CommonObject $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->fk_delivery_address = $obj->fk_address; $this->modelpdf = $obj->model_pdf; - $this->expedition_method_id = $obj->fk_expedition_methode; // TODO deprecated $this->shipping_method_id = $obj->fk_expedition_methode; $this->tracking_number = $obj->tracking_number; $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility @@ -683,7 +681,7 @@ class Expedition extends CommonObject if (isset($this->fk_user_author)) $this->fk_user_author=trim($this->fk_user_author); if (isset($this->fk_user_valid)) $this->fk_user_valid=trim($this->fk_user_valid); if (isset($this->fk_delivery_address)) $this->fk_delivery_address=trim($this->fk_delivery_address); - if (isset($this->expedition_method_id)) $this->expedition_method_id=trim($this->expedition_method_id); + if (isset($this->shipping_method_id)) $this->shipping_method_id=trim($this->shipping_method_id); if (isset($this->tracking_number)) $this->tracking_number=trim($this->tracking_number); if (isset($this->statut)) $this->statut=trim($this->statut); if (isset($this->trueDepth)) $this->trueDepth=trim($this->trueDepth); @@ -714,7 +712,7 @@ class Expedition extends CommonObject $sql.= " date_expedition=".(dol_strlen($this->date_expedition)!=0 ? "'".$this->db->idate($this->date_expedition)."'" : 'null').","; $sql.= " date_delivery=".(dol_strlen($this->date_delivery)!=0 ? "'".$this->db->idate($this->date_delivery)."'" : 'null').","; $sql.= " fk_address=".(isset($this->fk_delivery_address)?$this->fk_delivery_address:"null").","; - $sql.= " fk_expedition_methode=".((isset($this->expedition_method_id) && $this->expedition_method_id > 0)?$this->expedition_method_id:"null").","; + $sql.= " fk_shipping_method=".((isset($this->shipping_method_id) && $this->shipping_method_id > 0)?$this->shipping_method_id:"null").","; $sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; $sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").","; @@ -1291,11 +1289,11 @@ class Expedition extends CommonObject { $code=''; - if (! empty($this->expedition_method_id)) + if (! empty($this->shipping_method_id)) { $sql = "SELECT em.code, em.tracking"; $sql.= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; - $sql.= " WHERE em.rowid = ".$this->expedition_method_id; + $sql.= " WHERE em.rowid = ".$this->shipping_method_id; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 21289f60864..bcb55bb3ef8 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -104,7 +104,7 @@ if ($action == 'add') $object->ref_customer = $objectsrc->ref_client; $object->date_delivery = $date_delivery; // Date delivery planed $object->fk_delivery_address = $objectsrc->fk_delivery_address; - $object->expedition_method_id = GETPOST('expedition_method_id','int'); + $object->shipping_method_id = GETPOST('shipping_method_id','int'); $object->tracking_number = GETPOST('tracking_number','alpha'); $object->ref_int = GETPOST('ref_int','alpha'); @@ -260,7 +260,7 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl' || $action == 'settrueWidth' || $action == 'settrueHeight' || $action == 'settrueDepth' -|| $action == 'setexpedition_method_id') +|| $action == 'setshipping_method_id') { $error=0; @@ -274,7 +274,7 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl' if ($action == 'settrueWidth') $shipping->trueWidth = trim(GETPOST('trueWidth','int')); if ($action == 'settrueHeight') $shipping->trueHeight = trim(GETPOST('trueHeight','int')); if ($action == 'settrueDepth') $shipping->trueDepth = trim(GETPOST('trueDepth','int')); - if ($action == 'setexpedition_method_id') $shipping->expedition_method_id = trim(GETPOST('expedition_method_id','int')); + if ($action == 'setshipping_method_id') $shipping->shipping_method_id = trim(GETPOST('shipping_method_id','int')); if (! $error) { @@ -658,7 +658,7 @@ if ($action == 'create') print "".$langs->trans("DeliveryMethod").""; print ''; $expe->fetch_delivery_methods(); - print $form->selectarray("expedition_method_id",$expe->meths,GETPOST('expedition_method_id','int'),1,0,0,"",1); + print $form->selectarray("shipping_method_id",$expe->meths,GETPOST('shipping_method_id','int'),1,0,0,"",1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print "\n"; @@ -1105,26 +1105,26 @@ else print $langs->trans('SendingMethod'); print ''; - if ($action != 'editexpedition_method_id') print 'id.'">'.img_edit($langs->trans('SetSendingMethod'),1).''; + if ($action != 'editshipping_method_id') print 'id.'">'.img_edit($langs->trans('SetSendingMethod'),1).''; print ''; print ''; - if ($action == 'editexpedition_method_id') + if ($action == 'editshipping_method_id') { - print ''; + print ''; print ''; - print ''; + print ''; $object->fetch_delivery_methods(); - print $form->selectarray("expedition_method_id",$object->meths,$object->expedition_method_id,1,0,0,"",1); + print $form->selectarray("shipping_method_id",$object->meths,$object->shipping_method_id,1,0,0,"",1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); print ''; print ''; } else { - if ($object->expedition_method_id > 0) + if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey - $code=$langs->getLabelFromKey($db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $code=$langs->getLabelFromKey($db,$object->shipping_method_id,'c_shipment_mode','rowid','code'); print $langs->trans("SendingMethod".strtoupper($code)); } } diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index d5fb257cead..9728e9d4a29 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -81,6 +81,7 @@ alter table llx_socpeople CHANGE COLUMN cp zip varchar(10); alter table llx_societe_rib CHANGE COLUMN adresse_proprio owner_address text; alter table llx_societe_address CHANGE COLUMN ville town text; alter table llx_societe_address CHANGE COLUMN cp zip varchar(10); +alter table llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer; ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(256) NOT NULL DEFAULT '' AFTER description; @@ -153,7 +154,43 @@ ALTER TABLE llx_holiday ADD COLUMN note_public text; -- Add new trigger on Invoice BILL_UNVALIDATE + Index INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (28,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10); -ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang) +ALTER TABLE llx_c_action_trigger ADD INDEX idx_action_trigger_rang (rang); + + +ALTER TABLE llx_facture_fourn_det ADD COLUMN fk_code_ventilation integer DEFAULT 0 NOT NULL; +ALTER TABLE llx_facturedet DROP COLUMN fk_export_compta; + +CREATE TABLE llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text +)ENGINE=innodb; + ALTER TABLE llx_societe MODIFY COLUMN zip varchar(25); diff --git a/htdocs/install/mysql/tables/llx_cronjob.sql b/htdocs/install/mysql/tables/llx_cronjob.sql index 5a8e33ef38f..a5bb3c10f59 100644 --- a/htdocs/install/mysql/tables/llx_cronjob.sql +++ b/htdocs/install/mysql/tables/llx_cronjob.sql @@ -1,32 +1,52 @@ --- =================================================================== --- Copyright (C) 2013 Laurent Destailleur --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =================================================================== - -create table llx_cronjob -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - datec datetime, - command varchar(256), - params text, - frequency varchar(24), - datelastrun datetime, - lastresult date, - lastoutput text, - fk_user integer DEFAULT NULL, - note text -)ENGINE=innodb; +-- =================================================================== +-- Copyright (C) 2013 Laurent Destailleur +-- Copyright (C) 2013 Florian Henry +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +CREATE TABLE llx_cronjob +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + datec datetime, + jobtype varchar(10) NOT NULL, + label text NOT NULL, + command varchar(255), + classesname varchar(255), + objectname varchar(255), + methodename varchar(255), + params text NOT NULL, + md5params varchar(32), + module_name varchar(255), + priority integer DEFAULT 0, + datelastrun datetime, + datenextrun datetime, + datestart datetime, + dateend datetime, + datelastresult datetime, + lastresult text, + lastoutput text, + unitfrequency integer NOT NULL DEFAULT 0, + frequency integer NOT NULL DEFAULT 0, + nbrun integer, + status integer NOT NULL DEFAULT 1, + fk_user_author integer DEFAULT NULL, + fk_user_mod integer DEFAULT NULL, + note text +)ENGINE=innodb; + + diff --git a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql index 16dacbbb336..325950a4e46 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn_det.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn_det.sql @@ -43,5 +43,6 @@ create table llx_facture_fourn_det product_type integer DEFAULT 0, date_start datetime DEFAULT NULL, -- date debut si service date_end datetime DEFAULT NULL, -- date fin si service + fk_code_ventilation integer DEFAULT 0 NOT NULL, import_key varchar(14) )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_facturedet.sql b/htdocs/install/mysql/tables/llx_facturedet.sql index 847178d8330..949dee1933c 100644 --- a/htdocs/install/mysql/tables/llx_facturedet.sql +++ b/htdocs/install/mysql/tables/llx_facturedet.sql @@ -51,7 +51,6 @@ create table llx_facturedet buy_price_ht double(24,8) DEFAULT 0, -- prix d'achat HT fk_product_fournisseur_price integer DEFAULT NULL, -- reference prix fournisseur fk_code_ventilation integer DEFAULT 0 NOT NULL, - fk_export_compta integer DEFAULT 0 NOT NULL, special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales rang integer DEFAULT 0, -- ordre d'affichage import_key varchar(14) diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index 6787aee87fd..00680f29d69 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -18,10 +18,6 @@ -- -- =================================================================== - --- Satut, 0 ou 1, 1 n'est plus supprimable --- fk_export_compta 0 pas exporte - create table llx_paiement ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -36,7 +32,6 @@ create table llx_paiement fk_bank integer NOT NULL DEFAULT 0, fk_user_creat integer, -- utilisateur qui a cree l'info fk_user_modif integer, -- utilisateur qui a modifie l'info - statut smallint DEFAULT 0 NOT NULL, - fk_export_compta integer DEFAULT 0 NOT NULL - + statut smallint DEFAULT 0 NOT NULL, -- Satut, 0 ou 1, 1 n'est plus supprimable + fk_export_compta integer DEFAULT 0 NOT NULL -- fk_export_compta 0 pas exporte )ENGINE=innodb; diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 0c7f39025f9..b1f9282b6bf 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -116,3 +116,4 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXE CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_usergroup FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cronjob FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/langs/ar_SA/main.lang b/htdocs/langs/ar_SA/main.lang index 5befea18b77..f273f913d04 100644 --- a/htdocs/langs/ar_SA/main.lang +++ b/htdocs/langs/ar_SA/main.lang @@ -428,8 +428,6 @@ NbOfThirdParties=عدد من الأطراف الثالثة NbOfCustomers=عدد من العملاء NbOfLines=عدد الخطوط NbOfObjects=عدد الأجسام -NbOfReferers=عدد referers -Referers=Referers TotalQuantity=الكمية الإجمالية DateFromTo=ل٪ من ق ق ٪ DateFrom=من ق ٪ diff --git a/htdocs/langs/ar_SA/members.lang b/htdocs/langs/ar_SA/members.lang index 570dfab4069..6b16226f9e5 100644 --- a/htdocs/langs/ar_SA/members.lang +++ b/htdocs/langs/ar_SA/members.lang @@ -152,7 +152,7 @@ ShowTypeCard=وتبين من نوع '٪ ق' HTPasswordExport=الملف htpassword جيل NoThirdPartyAssociatedToMember=لم يرتبط بها من طرف ثالث لهذا العضو ThirdPartyDolibarr=Dolibarr طرف ثالث -MembersAndSubscriptions=وأعضاء Suscriptions +MembersAndSubscriptions=وأعضاء Subscriptions // Date 2009-08-11 13:27:01 // STOP - Lines generated via parser diff --git a/htdocs/langs/bg_BG/members.lang b/htdocs/langs/bg_BG/members.lang index c2fabf1da50..88d614bb1ad 100644 --- a/htdocs/langs/bg_BG/members.lang +++ b/htdocs/langs/bg_BG/members.lang @@ -163,7 +163,7 @@ ShowTypeCard=Покажи тип "%s" HTPasswordExport=htpassword файл поколение NoThirdPartyAssociatedToMember=Никоя трета страна, свързана с този потребител ThirdPartyDolibarr=Dolibarr трета страна -MembersAndSubscriptions=Членове и Suscriptions +MembersAndSubscriptions=Членове и Subscriptions MoreActions=Допълнително действие на запис MoreActionBankDirect=Създаване на директен запис на сделката по сметка MoreActionBankViaInvoice=Създаване на фактура и плащане по сметка diff --git a/htdocs/langs/ca_ES/commissions.lang b/htdocs/langs/ca_ES/commissions.lang deleted file mode 100644 index da97a4066f2..00000000000 --- a/htdocs/langs/ca_ES/commissions.lang +++ /dev/null @@ -1,41 +0,0 @@ -# Dolibarr language file - ca_ES - commissions -CHARSET=UTF-8 - -Module60000Desc=Gestió de comissions -commissionsSetup=Configuració de la gestió de comissions - -ProductCommissionRate=Taxa de comissió sobre els productes -ServiceCommissionRate=Taxa de comissió sobre els serveis - -ProductCommissionRateDetails=Taxa usada per calcular les comissions sobre les vendes de productes -ServiceCommissionRateDetails=Taxa usada per calcular les comissions sobre les vendes de serveis - -Commissions=Comissions -CommissionDetails=Detall de comissions - -IncludeUnpayedInvoices=Incloure les factures no cobrades -TotalCommission=Total comissions - -ProductMargin=Marge / productes -ServiceMargin=Marge / serveis - -CommissionRate=Taxes comissions - -ProductCommission=Comissió / productes -ServiceCommission=Comissió / serveis - -CommissionBase=Base de càlcul de comissions -CommissionBasedOnTurnover=Comissions calculades sobre el volum de venda -CommissionBasedOnMargins=Comissions calculades sobre els marges -CommissionBaseDetails=Estableix el mètode de càlcul de les comissions -CommissionBasedOnMarginsDetails=El càlcul basat en els marges requereix l'activació del mòdul marges - -TurnoverTotal = Volum de vendes sense IVA -ProductTurnover=Vendes sense IVA / productes -ServiceTurnover=Vendes sense IVA / serveis - -CommercialAgent=Agent comercial - -StartDate=Data d'inici -EndDate=Data de fi -Launch=Començar \ No newline at end of file diff --git a/htdocs/langs/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index 39ee41a4ca9..a0a49bb243c 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -84,8 +84,8 @@ NumberOfOrdersByMonth=Nombre de comandes per mes AmountOfOrdersByMonthHT=Import total de comandes per mes (Sense IVA) ListOfOrders=Llistat de comandes CloseOrder=Tancar comanda -ConfirmCloseOrder=Esteu segur de voler tancar aquesta comanda? Un cop tancat, haurà de facturar-se -ConfirmCloseOrderIfSending=Esteu segur de voler tancar aquesta comanda? No ha de tancar una comanda que encara no té els seus productes enviats +ConfirmCloseOrder=Esteu segur que voleu classificar aquesta comanda com a enviat? Un cop enviat una comanda, només podrà facturar-se +ConfirmCloseOrderIfSending=Esteu segur que voleu tancar aquesta comanda? Només hauria de tancar una comanda quan aquesta hagi estat enviada completament. ConfirmDeleteOrder=Esteu segur de voler eliminar aquest comanda? ConfirmValidateOrder=Esteu segur de voler validar aquesta comanda sota la referència %s ? ConfirmUnvalidateOrder=Esteu segur de voler restaurar la comanda %s a l'estat esborrany? diff --git a/htdocs/langs/da_DK/members.lang b/htdocs/langs/da_DK/members.lang index c2975ad715c..9492f48514a 100644 --- a/htdocs/langs/da_DK/members.lang +++ b/htdocs/langs/da_DK/members.lang @@ -161,7 +161,7 @@ MemberId=Medlem id PaymentSubscription=Nye bidrag betaling NoThirdPartyAssociatedToMember=Nr. tredjepart forbundet til dette medlem ThirdPartyDolibarr=Dolibarr tredjepart -MembersAndSubscriptions=Medlemmer og Suscriptions +MembersAndSubscriptions=Medlemmer og Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 20:39:59). diff --git a/htdocs/langs/el_GR/members.lang b/htdocs/langs/el_GR/members.lang index 8343aff155c..270e3cd1f1e 100644 --- a/htdocs/langs/el_GR/members.lang +++ b/htdocs/langs/el_GR/members.lang @@ -152,7 +152,7 @@ ShowTypeCard=Show type '%s' HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated to this member ThirdPartyDolibarr=Dolibarr third party -MembersAndSubscriptions= Members and Suscriptions +MembersAndSubscriptions= Members and Subscriptions MoreActions=Complementary action on recording MoreActionBankDirect=Create a direct transaction record on account MoreActionBankViaInvoice=Create an invoice and payment on account diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5e632efbe1e..a9aae951692 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -369,7 +369,7 @@ Module1Desc=Companies and contact management (customers, prospects...) Module2Name=Commercial Module2Desc=Commercial management Module10Name=Accounting -Module10Desc=Simple accounting management (invoice and payment dispatching) +Module10Desc=Simple accounting reports (journals, turnover) based onto database content. No dispatching. Module20Name=Proposals Module20Desc=Commercial proposal management Module22Name=Mass E-mailings @@ -672,6 +672,10 @@ Permission1237=Export supplier orders and their details Permission1251=Run mass imports of external data into database (data load) Permission1321=Export customer invoices, attributes and payments Permission1421=Export customer orders and attributes +Permission23001 = Read Scheduled task +Permission23002 = Create/update Scheduled task +Permission23003 = Delete Scheduled task +Permission23004 = Execute Scheduled task Permission2401=Read actions (events or tasks) linked to his account Permission2402=Create/modify actions (events or tasks) linked to his account Permission2403=Delete actions (events or tasks) linked to his account diff --git a/htdocs/langs/en_US/commissions.lang b/htdocs/langs/en_US/commissions.lang deleted file mode 100644 index 776f4d0c1a1..00000000000 --- a/htdocs/langs/en_US/commissions.lang +++ /dev/null @@ -1,44 +0,0 @@ -# Dolibarr language file - fr_FR - commissions -CHARSET=UTF-8 - -Module60000Desc=Commissions management -commissionsSetup=Commissions management setup - -ProductCommissionRate=Commission rate on products -ServiceCommissionRate=Commission rate on services - -ProductCommissionRateDetails=Commission rate on product sales -ServiceCommissionRateDetails=Commission rate on service sales - -Commissions=Commissions -CommissionDetails=Commissions details - -IncludeUnpayedInvoices=Include overdue invoices -TotalCommission=Commissions subtotal - -ProductMargin=Margin / products -ServiceMargin=Margin / services - -CommissionRate=Commission rate - -ProductCommission=Commission / produics -ServiceCommission=Commission / services - -CommissionBase=Commissions base -CommissionBasedOnTurnover=Commissions based on turnover -CommissionBasedOnMargins=Commissions based on margins -CommissionBaseDetails=Define calculation method for commissions -CommissionBasedOnMarginsDetails=Commissions based on margins needs margin module activation. - -TurnoverTotal = Total turrnover -ProductTurnover=Product turnover -ServiceTurnover=Service turnover - -CommercialAgent=Commercial agent - -StartDate=Start date -EndDate=End date -Launch=Start - -AgentContactType=Contact type used for commissioning -AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents \ No newline at end of file diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 1ce5db6ccd4..0ae15edba41 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -392,6 +392,7 @@ UniqueThirdParties=Total of unique third parties InActivity=Open ActivityCeased=Closed ActivityStateFilter=Activity status +ProductsIntoElements=List of products into # Monkey MonkeyNumRefModelDesc=Return numero with format %syymm-nnnn for customer code and %syymm-nnnn for supplier code where yy is year, mm is month and nnnn is a sequence with no break and no return to 0. diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c38ccd07d68..538b4f1784a 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -149,4 +149,6 @@ WarningDepositsNotIncluded=Deposits invoices are not included in this version wi DatePaymentTermCantBeLowerThanObjectDate=Payment term date can't be lower than object date. Pcg_version=Pcg version Pcg_type=Pcg type -Pcg_subtype=Pcg subtype \ No newline at end of file +Pcg_subtype=Pcg subtype +InvoiceLinesToDispatch=Invoice lines to dispatch +InvoiceDispatched=Dispatched invoices \ No newline at end of file diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index 4f504d34e59..c64c74f1f58 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -1,11 +1,87 @@ # Dolibarr language file - en_US - cron CHARSET=UTF-8 -CronSetup=Cron scheduler setup -CronDesc=This page can be used to setup options of the scheduler manager + +# +# Admin +# +CronSetup= Configuration Scheduled task management URLToLaunchCronJobs=URL to launch cron jobs +OrToLaunchASpecificJob=Or to launch a specific job KeyForCronAccess=Security key for URL to launch cron jobs -DateLastRun=Last run -LastOutput=Last run output -LastResult=Last result code -ListOfCronJobs=List of scheduled jobs -Command=Command \ No newline at end of file +FileToLaunchCronJobs=Command to launch cron jobs +CronExplainHowToRunUnix=On Unix environement you should use crontab to run Command line each minutes +CronExplainHowToRunWin=On Microsoft(tm) Windows environement you can use Scheduled task tools to run Command line each minutes + +# +# Page list +# +CronDateLastRun=Last run +CronLastOutput=Last run output +CronLastResult=Last result code +CronListOfCronJobs=List of scheduled jobs +CronCommand=Command +CronList= Job list +CronDelete= Delete cron jobs +CronConfirmDelete= Are you sure to delete this cron jobs ? +CronExecute=Launch task +CronConfirmExecute= Are you sure to execute this job now +CronInfo= Jobs allow to execute task that have been planned +CronWaitingJobs=Wainting jobs +CronTask=Task +CronNone= None +CronDtStart=Start date +CronDtEnd=End fin +CronDtNextLaunch=Next execution +CronDtLastLaunch=Last execution +CronFrequency=Frequancy +CronClass=Classe +CronMethod=Method +CronModule=Module +CronAction=Action +CronStatus=Status +CronStatusActive=Active +CronStatusInactive=Inactive +CronNoJobs=No jobs registered +CronPriority=Priority +CronLabel=Description +CronNbRun=Nb. launch + +# +#Page card +# +CronAdd= Add jobs +CronHourStart= Start Hour and date of task +CronEvery= And execute task each +CronObject= Instance/Object to create +CronArgs=Parameters +CronSaveSucess=Save succefully +CronNote=Comment +CronFieldMandatory=Fields %s is mandatory +CronErrEndDateStartDt=End date cannot be before start date +CronStatusActiveBtn=Active +CronStatusInactiveBtn=Inactive +CronTaskInactive=This task is inactive +CronDtLastResult=Last result date +CronId=Id +CronClassFile=Classes (file name) +CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module).
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of module is product +CronClassFileHelp=The file name to load.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is product.class.php +CronObjectHelp=The object name to load.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is Product +CronMethodHelp=The object method to launch.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of method is is fecth +CronArgsHelp=The method arguments.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be 0, ProductRef +CronCommandHelp=The system command line to execute. + +# +# Info +# +CronInfoPage=Information + + +# +# Common +# +CronType=Task type +CronType_method=Call method of a Dolibarr Class +CronType_command=Shell command +CronMenu=Cron +CronCannotLoadClass=Cannot load class %s or object %s \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0b82960dab2..99a60857e3d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -487,7 +487,7 @@ NbOfCustomers=Number of customers NbOfLines=Number of lines NbOfObjects=Number of objects NbOfReferers=Number of referrers -Referers=Referrers +Referers=Consumption TotalQuantity=Total quantity DateFromTo=From %s to %s DateFrom=From %s diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 77657563851..e1eda16c790 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -155,7 +155,7 @@ ShowTypeCard=Show type '%s' HTPasswordExport=htpassword file generation NoThirdPartyAssociatedToMember=No third party associated to this member ThirdPartyDolibarr=Dolibarr third party -MembersAndSubscriptions= Members and Suscriptions +MembersAndSubscriptions= Members and Subscriptions MoreActions=Complementary action on recording MoreActionsOnSubscription=Complementary action, suggested by default when recording a subscription MoreActionBankDirect=Create a direct transaction record on account diff --git a/htdocs/langs/es_ES/commissions.lang b/htdocs/langs/es_ES/commissions.lang deleted file mode 100644 index 2077ca5990c..00000000000 --- a/htdocs/langs/es_ES/commissions.lang +++ /dev/null @@ -1,41 +0,0 @@ -# Dolibarr language file - es_ES - commissions -CHARSET=UTF-8 - -Module60000Desc=Gestión de comisiones -commissionsSetup=Configuración de la gestión de comisiones - -ProductCommissionRate=Tasa de comisión sobre los productos -ServiceCommissionRate=Tasa de comisión sobre los servicios - -ProductCommissionRateDetails=Tasa usada para calcular las comisiones sobre las ventas de productos -ServiceCommissionRateDetails=Tasa usada para calcular las comisiones sobre las ventas de servicios - -Commissions=Comisiones -CommissionDetails=Detalle de comisiones - -IncludeUnpayedInvoices=Incluir las facturas no cobradas -TotalCommission=Total comisiones - -ProductMargin=Margen / productos -ServiceMargin=Margen / servicios - -CommissionRate=Tasas comisiones - -ProductCommission=Comisión / productos -ServiceCommission=Comisión / servicios - -CommissionBase=Base de cálculo de comisiones -CommissionBasedOnTurnover=Comisiones calculadas sobre el volumen de venta -CommissionBasedOnMargins=Comisiones calculadas sobre los márgenes -CommissionBaseDetails=Establece el método de cálculo de las comisiones -CommissionBasedOnMarginsDetails=El cálculo basado en los márgenes requiere la activación del módulo márgenes - -TurnoverTotal = Volumen de ventas sin IVA -ProductTurnover=Ventas sin IVA / productos -ServiceTurnover=Ventas sin IVA / servicios - -CommercialAgent=Agente comercial - -StartDate=Fecha de inicio -EndDate=Fecha de fin -Launch=Comenzar \ No newline at end of file diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 65044ab09a7..3b1069cf7a6 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -84,8 +84,8 @@ NumberOfOrdersByMonth=Número de pedidos por mes AmountOfOrdersByMonthHT=Importe total de pedidos por mes (sin IVA) ListOfOrders=Listado de pedidos CloseOrder=Cerrar pedido -ConfirmCloseOrder=¿Está seguro de querer cerrar este pedido? Una vez cerrado, deberá facturarse -ConfirmCloseOrderIfSending=¿Está seguro de querer cerrar este pedido? No debe cerrar un pedido que aún no tiene sus productos enviados +ConfirmCloseOrder=¿Está seguro de querer clasificar este pedido como enviado? Una vez enviado un pedido, solo podrá facturarse +ConfirmCloseOrderIfSending=¿Está seguro de querer cerrar este pedido? Solamente debería cerrar un pedido cuando este haya sido enviado completamente. ConfirmDeleteOrder=¿Está seguro de querer eliminar este pedido? ConfirmValidateOrder=¿Está seguro de querer validar este pedido bajo la referencia %s ? ConfirmUnvalidateOrder=¿Está seguro de querer restaurar el pedido %s al estado borrador? diff --git a/htdocs/langs/et_EE/members.lang b/htdocs/langs/et_EE/members.lang index b2d7eb1bc7a..ef7bcef6304 100644 --- a/htdocs/langs/et_EE/members.lang +++ b/htdocs/langs/et_EE/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=Näita tüüp "%s" HTPasswordExport=htpassword fail põlvkonna NoThirdPartyAssociatedToMember=Ükski kolmas isik on seotud selle liige ThirdPartyDolibarr=Dolibarr kolmanda osapoole -MembersAndSubscriptions=Liikmete ja Suscriptions +MembersAndSubscriptions=Liikmete ja Subscriptions MoreActions=Täiendav tegevus salvestus MoreActionBankDirect=Loo otseseid tehingukulusid rekord konto MoreActionBankViaInvoice=Loo arve ja ettemaks diff --git a/htdocs/langs/fa_IR/members.lang b/htdocs/langs/fa_IR/members.lang index e7ecd54bf5c..b0a46554eb6 100644 --- a/htdocs/langs/fa_IR/members.lang +++ b/htdocs/langs/fa_IR/members.lang @@ -152,7 +152,7 @@ ShowTypeCard=وتبين من نوع '٪ ق' HTPasswordExport=الملف htpassword جيل NoThirdPartyAssociatedToMember=لم يرتبط بها من طرف ثالث لهذا العضو ThirdPartyDolibarr=Dolibarr طرف ثالث -MembersAndSubscriptions=وأعضاء Suscriptions +MembersAndSubscriptions=وأعضاء Subscriptions // Date 2009-08-11 13:27:01 // STOP - Lines generated via parser diff --git a/htdocs/langs/fi_FI/members.lang b/htdocs/langs/fi_FI/members.lang index b4c5c52f2d4..cad773224bc 100644 --- a/htdocs/langs/fi_FI/members.lang +++ b/htdocs/langs/fi_FI/members.lang @@ -159,7 +159,7 @@ MemberId=Jäsen id PaymentSubscription=Uusi osuus maksu NoThirdPartyAssociatedToMember=Kolmansista osapuolista ei näihin jäsen ThirdPartyDolibarr=Dolibarr kolmannen osapuolen -MembersAndSubscriptions=Jäsenet ja Suscriptions +MembersAndSubscriptions=Jäsenet ja Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 20:45:19). diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 3834defebc8..a20821cd61b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -368,7 +368,7 @@ Module1Desc= Gestion des tiers (sociétés, particuliers) et contacts Module2Name= Commercial Module2Desc= Gestion commerciale Module10Name= Comptabilité -Module10Desc= Gestion simpliste de comptabilité (ventilation de factures et paiements uniquement) +Module10Desc= Activation de rapports simplistes de comptabilité (ca, journaux) basé sur la base. Pas de ventilation. Module20Name= Propositions commerciales Module20Desc= Gestion des devis/propositions commerciales Module22Name= EMailings @@ -678,6 +678,10 @@ Permission1411= Lire les mouvements comptables Permission1412= Créer/modifier/annuler les mouvements comptables Permission1415= Lire CA, bilans, résultats, journaux, grands livres Permission1421= Exporter les commandes clients et attributs +Permission23001 = Voir les taches planifiée +Permission23002 = Créer/Modifier les taches planifiée +Permission23003 = Supprimer les taches planifiée +Permission23004 = Executer les taches planifiée Permission2401= Lire les actions (événements ou tâches) liées à son compte Permission2402= Créer/modifier les actions (événements ou tâches) liées à son compte Permission2403= Supprimer les actions (événements ou tâches) liées à son compte diff --git a/htdocs/langs/fr_FR/commissions.lang b/htdocs/langs/fr_FR/commissions.lang deleted file mode 100644 index 5fb83f32320..00000000000 --- a/htdocs/langs/fr_FR/commissions.lang +++ /dev/null @@ -1,44 +0,0 @@ -# Dolibarr language file - fr_FR - commissions -CHARSET=UTF-8 - -Module60000Desc=Gestion des commissions -commissionsSetup=Paramétrage de la gestion des commissions - -ProductCommissionRate=Taux de commissionnement sur les produits -ServiceCommissionRate=Taux de commissionnement sur les services - -ProductCommissionRateDetails=Taux utilisé pour calculer les commissions sur les ventes de produits -ServiceCommissionRateDetails=Taux utilisé pour calculer les commissions sur les ventes de services - -Commissions=Commissions -CommissionDetails=Détail des commissions - -IncludeUnpayedInvoices=Inclure les factures non réglées -TotalCommission=Total des commissions - -ProductMargin=Marge / produits -ServiceMargin=Marge / services - -CommissionRate=Taux de commissionnement - -ProductCommission=Commission / produits -ServiceCommission=Commission / services - -CommissionBase=Base de calcul des commissions -CommissionBasedOnTurnover=Commissions calculées sur le CA -CommissionBasedOnMargins=Commissions calculées sur les marges -CommissionBaseDetails=Définit le mode de calcul des commissions -CommissionBasedOnMarginsDetails=Le calcul basé sur les marges nécessite l'activation du module marges. - -TurnoverTotal = Chiffre d'affaire réalisé HT -ProductTurnover=CA HT / produits -ServiceTurnover=CA HT / services - -CommercialAgent=Agent commercial - -StartDate=Date de début -EndDate=Date de fin -Launch=Démarrer - -AgentContactType=Type de contact commissionné -AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux \ No newline at end of file diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 254d1e8af16..99612d8ec2d 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -394,6 +394,7 @@ UniqueThirdParties=Total de tiers uniques InActivity=En activité ActivityCeased=Clos ActivityStateFilter=Statut d'activité +ProductsIntoElements=Liste des produits dans les %s # Monkey MonkeyNumRefModelDesc=Renvoie le numéro sous la forme %syymm-nnnn pour les codes clients et %syymm-nnnn pour les codes fournisseurs où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0. diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 01ba085620b..12ea0024f63 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -161,3 +161,5 @@ DatePaymentTermCantBeLowerThanObjectDate=La date limite de règlement ne peut ê Pcg_version=Version du plan Pcg_type=Classe de compte Pcg_subtype=Sous classe de compte +InvoiceLinesToDispatch=Lignes de factures à ventiler +InvoiceDispatched=Factures ventilées \ No newline at end of file diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 1a9bf136e02..d0aaccfecf7 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -1,11 +1,93 @@ # Dolibarr language file - fr_FR - cron CHARSET=UTF-8 -CronSetup=Configuration du séquenceur de taches -CronDesc=Cette page permet de configurer certaines options du séquenceur de taches + +# +# Admin +# +CronSetup = Page de configuration du module - Gestion de tâches planifiées URLToLaunchCronJobs=URL pour lancer les taches automatiques +OrToLaunchASpecificJob=Ou pour lancer une tache spécifique KeyForCronAccess=Clé de sécurité pour l'URL de lancement des taches automatiques -DateLastRun=Dernier lancement -LastOutput=Dernière sortie -LastResult=Dernière code retour -ListOfCronJobs=Liste des taches programmées -Command=Commande \ No newline at end of file +FileToLaunchCronJobs=Commande pour lancer les taches automatiques +CronExplainHowToRunUnix=Sur un environement Unix vous pouvez paramétré CronTab pour executer cette commande toute les minutes +CronExplainHowToRunWin=Sur un environement Microsoft(tm) Windows vous pouvez utilisr le planificateur de tache pour lancer cette commande toute les minutes + +# +# Menu +# +CronListActive= Liste des tâches planifiées active +CronListInactive= Liste des tâches planifiées inactive + + +# +# Page list +# +CronDateLastRun=Dernier lancement +CronLastOutput=Dernière sortie +CronLastResult=Dernier code retour +CronCommand=Commande +CronList= Liste des tâches planifiées +CronDelete= Supprimer la tâche planifiée +CronConfirmDelete= Êtes-vous sûr de vouloir supprimer cette tâche planifiée ? +CronExecute=Exécuter cette tâche +CronConfirmExecute= Êtes-vous sûr de vouloir exécuter cette tâche maintenant? +CronInfo= Les jobs permettent d'exécuter des tâches à intervales réguliers +CronWaitingJobs= Vos jobs en attente: +CronTask= Tâche +CronNone=Aucun(e) +CronDtStart=Date début +CronDtEnd=Date fin +CronDtNextLaunch=Prochaine éxécution +CronDtLastLaunch=Dernière éxécution +CronFrequency=Fréquence +CronClass=Classes +CronMethod=Méthode +CronModule=Module +CronAction=Action +CronStatus=Status +CronStatusActive=Active +CronStatusInactive=Inactive +CronEach=Tou(te)s +CronNoJobs= Aucun jobs actuellement +CronPriority=Priorité +CronLabel=Description +CronNbRun=Nb. exec. +CronDtLastResult=Date du derniétre resulat de la dernière éxécution + +# +#Page card +# +CronAdd= Ajoutez une tâche +CronHourStart= Jour et Heure de début de la tâche +CronEvery= Puis execution toutes les +CronObject= Instance/Objet à créer +CronArgs= Argument +CronSaveSucess=Enregistrement effectué +CronNote=Note +CronFieldMandatory=Le champ %s est obligatoire +CronErrEndDateStartDt=La date de fin ne peux être avant la date de début +CronStatusActiveBtn=Activer +CronStatusInactiveBtn=Désactiver +CronTaskInactive=Cette tâche est désactivée +CronId=Id +CronClassFile=Classes (fichier) +CronModuleHelp=Nom du repertoire du module dolibarr (fonctionne automatiquement avec les modules externe Dolibarr).
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de module est product +CronClassFileHelp=Le fichier qui contient l'objet .
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de classe est product.class.php +CronObjectHelp=Le nom de l'object a crée.
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de objet est Product +CronMethodHelp=La mèthode a lancer.
Par exemple pour appeler la mèthode fetch de l'object Product de Dolibarr /htdocs/product/class/product.class.php, la valeur de mèthode est fecth +CronArgsHelp=Les arguments de la mèthode.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, la valeur de paramétre pourrait être 0, RefProduit +CronCommandHelp=La commande système a éxecuter + +# +# Info +# +CronInfoPage=Suivie + +# +# Common +# +CronType=Type d'action a executer +CronType_method=Méthode d'une classe d'un module Dolibarr +CronType_command=Commande Shell +CronMenu=Cron +CronCannotLoadClass=impossible de charger la classe %s ou l'object %s \ No newline at end of file diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index a7093fd8b75..b31b711f3a3 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -490,7 +490,7 @@ NbOfCustomers=Nombre de clients NbOfLines=Nombre de lignes NbOfObjects=Nombre d'objets NbOfReferers=Nombre de références -Referers=Référents +Referers=Consommation TotalQuantity=Quantité totale DateFromTo=Du %s au %s DateFrom=A partir du %s diff --git a/htdocs/langs/he_IL/members.lang b/htdocs/langs/he_IL/members.lang index b8f1a2389d0..647559b284a 100644 --- a/htdocs/langs/he_IL/members.lang +++ b/htdocs/langs/he_IL/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=הצג מסוג "%s" HTPasswordExport=htpassword הדור הקובץ NoThirdPartyAssociatedToMember=אין צד שלישי הקשור משתמש זה ThirdPartyDolibarr=Dolibarr צד שלישי -MembersAndSubscriptions=משתמשים ו Suscriptions +MembersAndSubscriptions=משתמשים ו Subscriptions MoreActions=פעולה משלימה על ההקלטה MoreActionBankDirect=יצירת הרשומה העסקה ישירה על חשבון MoreActionBankViaInvoice=יצירת חשבונית התשלום על חשבון diff --git a/htdocs/langs/hu_HU/members.lang b/htdocs/langs/hu_HU/members.lang index a1baf95f0c6..ff2cbf8d7ec 100644 --- a/htdocs/langs/hu_HU/members.lang +++ b/htdocs/langs/hu_HU/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=Mutasd típusú "%s" HTPasswordExport=htpassword fájl létrehozása NoThirdPartyAssociatedToMember=Harmadik félnek nem társult a tag ThirdPartyDolibarr=Dolibarr harmadik fél -MembersAndSubscriptions=A tagok és Suscriptions +MembersAndSubscriptions=A tagok és Subscriptions MoreActions=Kiegészítő fellépés a felvételi MoreActionBankDirect=Hozzon létre egy közvetlen tranzakciós rekord miatt MoreActionBankViaInvoice=Hozzon létre egy számlát és előleg diff --git a/htdocs/langs/is_IS/members.lang b/htdocs/langs/is_IS/members.lang index d64fc0dbd55..20f211f24ef 100644 --- a/htdocs/langs/is_IS/members.lang +++ b/htdocs/langs/is_IS/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=Sýna tegund ' %s ' HTPasswordExport=htpassword skrá kynslóð NoThirdPartyAssociatedToMember=Engar þriðja aðila í tengslum við þennan ThirdPartyDolibarr=Dolibarr þriðja aðila -MembersAndSubscriptions=Aðilar og Suscriptions +MembersAndSubscriptions=Aðilar og Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-06-30 00:15:29). diff --git a/htdocs/langs/it_IT/members.lang b/htdocs/langs/it_IT/members.lang index 4000e50c514..e1645587088 100644 --- a/htdocs/langs/it_IT/members.lang +++ b/htdocs/langs/it_IT/members.lang @@ -88,7 +88,7 @@ MemberModifiedInDolibarr =Membri modificati su Dolibarr MEMBER_NEWFORM_PAYONLINE =Saltate sulla integrato pagina di pagamento online MemberNotOrNoMoreExpectedToSubscribe =Membri non iscritti o non più attesi per iscrizione MemberPublicLinks =Link/pagine pubbliche -MembersAndSubscriptions =Deputati e Suscriptions +MembersAndSubscriptions =Deputati e Subscriptions MembersArea =Sezione riservata membri MembersAttributes =Attributi dei membri MembersByCountryDesc =Questa schermata mostra le statistiche dei membri per paese. Il grafico dipende da servizi online di Google ed è disponibile solo se il server può connettersi ad internet. diff --git a/htdocs/langs/ja_JP/members.lang b/htdocs/langs/ja_JP/members.lang index 4fee5b42355..afc8a3f759b 100644 --- a/htdocs/langs/ja_JP/members.lang +++ b/htdocs/langs/ja_JP/members.lang @@ -162,7 +162,7 @@ ShowTypeCard=タイプ "%s"を表示 HTPasswordExport=htpasswordファイルの生成 NoThirdPartyAssociatedToMember=このメンバに関連付けられているサードパーティません ThirdPartyDolibarr=Dolibarrサードパーティ -MembersAndSubscriptions=メンバーとSuscriptions +MembersAndSubscriptions=メンバーとSubscriptions MoreActions=記録上の相補的なアクション MoreActionBankDirect=アカウントに直接トランザクション·レコードを作成します。 MoreActionBankViaInvoice=アカウントの請求書と支払いを作成します。 diff --git a/htdocs/langs/nb_NO/members.lang b/htdocs/langs/nb_NO/members.lang index 471b4e735a9..62c8faf8822 100644 --- a/htdocs/langs/nb_NO/members.lang +++ b/htdocs/langs/nb_NO/members.lang @@ -29,7 +29,7 @@ DescADHERENT_CARD_TEXT_RIGHT=Tekst trykt på kort medlem (justere på høyre) DescADHERENT_MAILMAN_LISTS=Liste (er) for automatisk insription av nye medlemmer (separert med komma) NoThirdPartyAssociatedToMember=Ingen tredjepart knyttet til dette medlemmet ThirdPartyDolibarr=Dolibarr tredjepart -MembersAndSubscriptions=Medlemmer og Suscriptions +MembersAndSubscriptions=Medlemmer og Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-07-17 11:48:27). diff --git a/htdocs/langs/pl_PL/members.lang b/htdocs/langs/pl_PL/members.lang index 4782007adfd..0810e643b43 100644 --- a/htdocs/langs/pl_PL/members.lang +++ b/htdocs/langs/pl_PL/members.lang @@ -162,7 +162,7 @@ MemberId=Państwa id PaymentSubscription=Nowy wkład płatności NoThirdPartyAssociatedToMember=Nr trzeciej związane do tego członka ThirdPartyDolibarr=Dolibarr trzeciej -MembersAndSubscriptions=Członkowie i Suscriptions +MembersAndSubscriptions=Członkowie i Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:07:31). diff --git a/htdocs/langs/pt_PT/members.lang b/htdocs/langs/pt_PT/members.lang index 0c42a9c3295..d82002190b5 100644 --- a/htdocs/langs/pt_PT/members.lang +++ b/htdocs/langs/pt_PT/members.lang @@ -149,7 +149,7 @@ SetLinkToThirdParty=Link para uma Dolibarr terceiro SubscriptionId=Assinaturas id MemberId=Estados-id PaymentSubscription=Nova contribuição pagamento -MembersAndSubscriptions=Deputados e Suscriptions +MembersAndSubscriptions=Deputados e Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:10:10). diff --git a/htdocs/langs/ro_RO/members.lang b/htdocs/langs/ro_RO/members.lang index 067614c8b30..d14d60ab82b 100644 --- a/htdocs/langs/ro_RO/members.lang +++ b/htdocs/langs/ro_RO/members.lang @@ -160,7 +160,7 @@ MemberId=Statele id PaymentSubscription=New plata contribuţiei NoThirdPartyAssociatedToMember=Nu părţi terţe asociate la prezenta membru ThirdPartyDolibarr=Dolibarr terţă parte -MembersAndSubscriptions=Membrii şi Suscriptions +MembersAndSubscriptions=Membrii şi Subscriptions // STOP - Lines generated via autotranslator.php tool (2009-08-13 21:12:07). diff --git a/htdocs/langs/sv_SE/members.lang b/htdocs/langs/sv_SE/members.lang index bf398731fe3..ded4d0542d6 100644 --- a/htdocs/langs/sv_SE/members.lang +++ b/htdocs/langs/sv_SE/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=Visa typ "%s" HTPasswordExport=htpassword fil generation NoThirdPartyAssociatedToMember=Ingen tredje part som är associerade till denna medlem ThirdPartyDolibarr=Dolibarr tredje part -MembersAndSubscriptions=Medlemmar och Suscriptions +MembersAndSubscriptions=Medlemmar och Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-08-27 08:51:26). diff --git a/htdocs/langs/zh_TW/members.lang b/htdocs/langs/zh_TW/members.lang index c08035af7a1..1b344cfd452 100644 --- a/htdocs/langs/zh_TW/members.lang +++ b/htdocs/langs/zh_TW/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=顯示類型'%s' HTPasswordExport=htpassword文件生成 NoThirdPartyAssociatedToMember=無關聯的第三方該會員 ThirdPartyDolibarr=Dolibarr第三者 -MembersAndSubscriptions=議員和Suscriptions +MembersAndSubscriptions=議員和Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-06-08 21:22:55). diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index a195ef6de04..6ca0879a88a 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -40,7 +40,13 @@ $mesg = ''; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; +if (! $sortfield) +{ + if ($agentid > 0) + $sortfield="s.nom"; + else + $sortfield="u.name"; +} $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; @@ -75,7 +81,7 @@ $titre=$langs->trans("Margins"); $picto='margin'; dol_fiche_head($head, 'agentMargins', $titre, 0, $picto); -print '
'; +print ''; print ''; print ''; @@ -118,10 +124,11 @@ if (! empty($conf->global->DISPLAY_MARK_RATES)) { print "
'.$langs->trans('CommercialAgent').'
"; print '
'; -$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, sc.fk_user as agent,"; -$sql.= " u.login,"; -$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,"; -$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge" ; +$sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, u.rowid as agent,"; +$sql.= " u.login, u.name, u.firstname,"; +$sql.= " sum(d.total_ht) as selling_price,"; +$sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; +$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); @@ -155,7 +162,8 @@ if ($agentid > 0) else $sql.= " GROUP BY u.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit +1, $offset); +// TODO: calculate total to display then restore pagination +//$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) @@ -163,7 +171,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',0,0,''); $i = 0; print ""; @@ -172,7 +180,7 @@ if ($result) if ($agentid > 0) print_liste_field_titre($langs->trans("Customer"),$_SERVER["PHP_SELF"],"s.nom","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); else - print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.login","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("CommercialAgent"),$_SERVER["PHP_SELF"],"u.name","","&agentid=".$agentid,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SellingPrice"),$_SERVER["PHP_SELF"],"selling_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("BuyingPrice"),$_SERVER["PHP_SELF"],"buying_price","","&agentid=".$agentid,'align="right"',$sortfield,$sortorder); @@ -191,7 +199,7 @@ if ($result) if ($num > 0) { $var=true; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); @@ -208,9 +216,8 @@ if ($result) print "\n"; } else { - $userstatic->id=$objp->agent; - $userstatic->login=$objp->login; - print "\n"; + $userstatic->fetch($objp->agent); + print "\n"; } print "\n"; print "\n"; diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 23fb49dab87..a07d3192e9b 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -40,10 +40,6 @@ $result = restrictedArea($user, 'societe','',''); $mesg = ''; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="s.nom"; $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; @@ -77,7 +73,7 @@ $titre=$langs->trans("Margins"); $picto='margin'; dol_fiche_head($head, 'customerMargins', $titre, 0, $picto); -print '
'; +print ''; print '
".$companystatic->getNomUrl(1,'customer')."".$userstatic->getLoginUrl(1)."".$userstatic->getFullName($langs,0,0,0)."".price($objp->selling_price)."".price($objp->buying_price)."
'; $client = false; @@ -105,6 +101,23 @@ else { print ''; } +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) +{ + if ($client) + { + $sortfield="f.datef"; + $sortorder="DESC"; + } + else + { + $sortfield="s.nom"; + $sortorder="ASC"; + } +} + // Start date print ''; print ''; } print ''."\n"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 96fca70af4c..77294a3c459 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1916,7 +1916,7 @@ if ($action == 'create') else { print ''; } print ''."\n"; diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 902dde79f17..de9ce68e6b3 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -827,7 +827,7 @@ if ($action == 'create') else { print ''; } print ''."\n"; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 941865da45a..4807ec768fa 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -678,7 +678,7 @@ class Form if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; if (! empty($user->societe_id)) $sql.= " AND s.rowid = ".$user->societe_id; - if ($filter) $sql.= " AND ".$filter; + if ($filter) $sql.= " AND (".$filter.")"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY nom ASC"; From 90025f9c13cf0a4270fd76ecfc9be9a6e7f52044 Mon Sep 17 00:00:00 2001 From: eldy Date: Sat, 23 Mar 2013 13:07:25 +0100 Subject: [PATCH 098/150] Work on revenue stamp --- htdocs/compta/facture.php | 41 +++++++++++++++++-- htdocs/compta/facture/class/facture.class.php | 6 ++- htdocs/core/class/commonobject.class.php | 6 +-- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 5 files changed, 48 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 77294a3c459..aa6f3cfec07 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -302,6 +302,14 @@ else if ($action == 'setpaymentterm' && $user->rights->facture->creer) $result=$object->update($user); if ($result < 0) dol_print_error($db,$object->error); } +else if ($action == 'setrevenuestamp' && $user->rights->facture->creer) +{ + $object->fetch($id); + $object->revenuestamp=GETPOST('revenuestamp'); + $result=$object->update($user); + $object->update_price(1); + if ($result < 0) dol_print_error($db,$object->error); +} else if ($action == 'setremisepercent' && $user->rights->facture->creer) { $object->fetch($id); @@ -2745,6 +2753,7 @@ else if ($id > 0 || ! empty($ref)) /* * List of payments */ + $selleruserevenustamp=empty($conf->global->MAIN_USE_REVENUE_STAMP)?0:1; // TODO Add method societe->useRevenueStamp() to look into table llx_c_revenue_stamp if there is one line for country $sign=1; if ($object->type == 2) $sign=-1; @@ -2752,11 +2761,10 @@ else if ($id > 0 || ! empty($ref)) $nbrows=8; $nbcols=2; if (! empty($conf->projet->enabled)) $nbrows++; if (! empty($conf->banque->enabled)) $nbcols++; - - //Local taxes if($mysoc->localtax1_assuj=="1") $nbrows++; if($mysoc->localtax2_assuj=="1") $nbrows++; - + if ($selleruserevenustamp) $nbrows++; + print '
'.$langs->trans('StartDate').''; @@ -142,8 +155,9 @@ print ''; $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, s.client,"; $sql.= " f.facnumber, f.total as total_ht,"; -$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,"; -$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ; +$sql.= " sum(d.total_ht) as selling_price,"; +$sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; +$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -166,7 +180,8 @@ if ($client) else $sql.= " GROUP BY s.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit +1, $offset); +// TODO: calculate total to display then restore pagination +//$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) @@ -174,7 +189,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',0,0,''); $i = 0; print ""; @@ -203,7 +218,7 @@ if ($result) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 4f22ba5599e..3b709559f28 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -48,7 +48,20 @@ $mesg = ''; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="p.ref"; +if (! $sortfield) +{ + if ($id > 0) + { + $sortfield="f.datef"; + $sortorder="DESC"; + } + else + { + $sortfield="p.ref"; + $sortorder="ASC"; + } +} + $page = GETPOST("page",'int'); if ($page == -1) { $page = 0; } $offset = $conf->liste_limit * $page; @@ -83,7 +96,7 @@ $titre=$langs->trans("Margins"); $picto='margin'; dol_fiche_head($head, 'productMargins', $titre, 0, $picto); -print '
'; +print ''; print '
'; if ($id > 0) { @@ -144,8 +157,9 @@ print ''; $sql = "SELECT DISTINCT d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref,"; $sql.= " f.facnumber, f.total as total_ht,"; -$sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price,"; -$sql.= " sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ; +$sql.= " sum(d.total_ht) as selling_price,"; +$sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; +$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; @@ -170,7 +184,8 @@ if ($id > 0) else $sql.= " GROUP BY d.fk_product"; $sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit +1, $offset); +// TODO: calculate total to display then restore pagination +//$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) @@ -178,7 +193,7 @@ if ($result) $num = $db->num_rows($result); print '
'; - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',0,0,''); $i = 0; print "
"; @@ -207,7 +222,7 @@ if ($result) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 407f3603d49..326efc526d2 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -130,7 +130,10 @@ if ($id > 0 || ! empty($ref)) $sql = "SELECT DISTINCT s.nom, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.total as total_ht,"; - $sql.= " (d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price, (d.buy_price_ht * d.qty) as buying_price, d.qty, ((d.subprice - d.buy_price_ht) * d.qty) as marge," ; + $sql.= " d.total_ht as selling_price,"; + $sql.= $db->ifsql('f.type =2','(d.buy_price_ht * d.qty *-1)','(d.buy_price_ht * d.qty)')." as buying_price, "; + $sql.= $db->ifsql('f.type =2','d.qty *-1','d.qty')." as qty,"; + $sql.= $db->ifsql('f.type =2','((d.price + d.buy_price_ht) * d.qty)','((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -148,14 +151,15 @@ if ($id > 0 || ! empty($ref)) if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= $db->plimit($conf->liste_limit +1, $offset); + // TODO: calculate total to display then restore pagination + //$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=$object->id",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=$object->id",$sortfield,$sortorder,'',0,0,''); $i = 0; print "
"; @@ -184,7 +188,7 @@ if ($id > 0 || ! empty($ref)) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); $var=!$var; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index cbb42401b5a..643d190d04d 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2013 Christophe Battarel * * 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 @@ -128,7 +128,10 @@ if ($socid > 0) $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.total as total_ht,"; - $sql.= " sum(d.subprice * d.qty * (1 - d.remise_percent / 100)) as selling_price, sum(d.buy_price_ht * d.qty) as buying_price, sum(((d.subprice * (1 - d.remise_percent / 100)) - d.buy_price_ht) * d.qty) as marge," ; + $sql.= " sum(d.total_ht) as selling_price,"; + + $sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; + $sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -143,14 +146,15 @@ if ($socid > 0) $sql .= " AND d.buy_price_ht <> 0"; $sql.= " GROUP BY f.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; - $sql.= $db->plimit($conf->liste_limit +1, $offset); + // TODO: calculate total to display then restore pagination + //$sql.= $db->plimit($conf->liste_limit +1, $offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); - print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=$societe->id",$sortfield,$sortorder,'',$num,0,''); + print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=$societe->id",$sortfield,$sortorder,'',0,0,''); $i = 0; print "
"; @@ -176,7 +180,7 @@ if ($socid > 0) if ($num > 0) { $var=True; - while ($i < $num && $i < $conf->liste_limit) + while ($i < $num /*&& $i < $conf->liste_limit*/) { $objp = $db->fetch_object($result); diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 75e15a414a0..838c298212f 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr + * Copyright (C) 2013 Florian Henry Export agenda cal'; -} -/** - * Footer function - * - * @return void - */ -function llxFooterVierge() { - print ''; -} - - - -// Load traductions files requiredby by page -$langs->load("companies"); -$langs->load("other"); -$langs->load("cron@cron"); - -// Get parameters -$id = GETPOST('id','int'); -$action = GETPOST('action','alpha'); - -// Protection if external user -if ($user->societe_id > 0) -{ - //accessforbidden(); +// librarie core +// Dolibarr environment +$res = @include("../../main.inc.php"); // From htdocs directory +if (! $res) { + $res = @include("../../../main.inc.php"); // From "custom" directory } +if (! $res) die("Include of master.inc.php fails"); -// Security check -if (empty($conf->cron->enabled)) accessforbidden('',1,1,1); +// librarie jobs +dol_include_once("/cron/class/cronjob.class.php"); -// Check also security key -if (empty($_GET["securitykey"]) || $conf->global->CRON_KEY != $_GET["securitykey"]) -{ - $user->getrights(); - - llxHeaderVierge(); - print '
Bad value for key.
'; - llxFooterVierge(); - exit; + +global $langs, $conf; + +// Check the key, avoid that a stranger starts cron +$key = $_GET['securitykey']; +if (empty($key)) { + echo 'securitykey is require'; + exit; } - - -/******************************************************************* -* ACTIONS -* -* Put here all code to do according to value of "action" parameter -********************************************************************/ - -if ($action == 'add') +if($key != $conf->global->MAIN_CRON_KEY) { - $object=new Cronjobs($db); - $object->prop1=$_POST["field1"]; - $object->prop2=$_POST["field2"]; - $result=$object->create($user); - if ($result > 0) - { - // Creation OK - } - { - // Creation KO - $mesg=$object->error; + echo 'securitykey is wrong'; + exit; +} +// Check the key, avoid that a stranger starts cron +$userlogin = $_GET['userlogin']; +if (empty($userlogin)) { + echo 'userlogin is require'; + exit; +} +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +$user=new User($db); +$result=$user->fetch('',$userlogin); +if ($result<0) { + echo "User Error:".$user->error; + dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); + exit; +}else { + if (empty($user->id)) { + echo " User user login:".$userlogin." do not exists"; + dol_syslog(" User user login:".$userlogin." do not exists", LOG_ERR); + exit; } } +$id = $_GET['id']; +// Language Management +$langs->load("admin"); +$langs->load("cron@cron"); +// create a jobs object +$object = new Cronjob($db); +$filter=array(); +if (empty($id)) { + $filter=array(); + $filter['t.rowid']=$id; +} +$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter); +if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + exit; +} -/*************************************************** -* VIEW -* -* Put here all code to build page -****************************************************/ +// current date +$now=dol_now(); -llxHeader('',$langs->trans('CronList'),''); +if(is_array($object->lines) && (count($object->lines)>0)){ + // Loop over job + foreach($object->lines as $line){ -$form=new Form($db); - - -// Put here content of your page - -// Example 1 : Adding jquery code -print ''; - - -$cronjob=new CronJob($db); -$result=$cronjob->fetch($id); - -if ($result > 0) -{ - - + echo "OK"; +} else { + echo "No Jobs to run"; } -else -{ - $langs->load("errors"); - print $langs->trans("ErrorRecordNotFound"); -} - - -// End of page -llxFooter(); - -$db->close(); -?> diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php new file mode 100644 index 00000000000..4f61d24a4aa --- /dev/null +++ b/htdocs/societe/consumption.php @@ -0,0 +1,439 @@ + + * Copyright (C) 2004-2012 Laurent Destailleur + * + * Version V1.1 Initial version of Philippe Berthet + * Version V2 Change to be compatible with 3.4 and enhanced to be more generic + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/societe/consumption.php + * \ingroup societe + * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty + */ + +require("../main.inc.php"); +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + +// Security check +$socid = GETPOST('socid','int'); +if ($user->societe_id) $socid=$user->societe_id; +$result = restrictedArea($user, 'societe', $socid, '&societe'); +$object = new Societe($db); +if ($socid > 0) $object->fetch($socid); + +// Sort & Order fields +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if ($page == -1) { + $page = 0; +} +$offset = $conf->liste_limit * $page; +if (! $sortorder) $sortorder='DESC'; +if (! $sortfield) $sortfield='datePrint'; +$limit = $conf->liste_limit; + +// Search fields +$sref=GETPOST("sref"); +$sprod_fulldescr=GETPOST("sprod_fulldescr"); +$month = GETPOST('month','int'); +$year = GETPOST('year','int'); + +// Clean up on purge search criteria ? +if (GETPOST("button_removefilter")) +{ + $sref=''; + $sprod_fulldescr=''; + $year=''; + $month=''; +} +// Customer or supplier selected in drop box +$thirdTypeSelect = GETPOST("third_select_id"); +$type_element = GETPOST('type_element')?GETPOST('type_element'):'invoice'; + +$langs->load("bills"); +$langs->load("orders"); +$langs->load("suppliers"); + + +/* + * Actions + */ + + + +/* + * View + */ + +$form = new Form($db); +$formother = new FormOther($db); +$productstatic=new Product($db); + +$titre = $langs->trans("Referer",$object->name); +llxHeader('',$titre,''); + +if (empty($socid)) +{ + dol_print_error($db); + exit; +} + +$head = societe_prepare_head($object); +dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company'); + +print '
'; +print ''; +print ''; + +print '
'; +print ''; +print ''; + +if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field +{ + print ''; +} + +if ($object->client) +{ + print ''; + $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."facture where fk_soc = ".$socid; + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); + + $obj = $db->fetch_object($resql); + $nbFactsClient = $obj->nb; + $thirdTypeArray['customer']=$langs->trans("customer"); + if ($conf->facture->enabled) $elementTypeArray['invoice']=$langs->trans('Invoices'); + if ($conf->commande->enabled) $elementTypeArray['order']=$langs->trans('Orders'); +} + +if ($object->fournisseur) +{ + print ''; + $sql = "SELECT count(*) as nb from ".MAIN_DB_PREFIX."commande_fournisseur where fk_soc = ".$socid; + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); + + $obj = $db->fetch_object($resql); + $nbCmdsFourn = $obj->nb; + $thirdTypeArray['supplier']=$langs->trans("supplier"); + if ($conf->fournisseur->enabled) $elementTypeArray['supplier_invoice']=$langs->trans('SuppliersInvoices'); + if ($conf->fournisseur->enabled) $elementTypeArray['supplier_order']=$langs->trans('SuppliersOrders'); +} +print '
'.$langs->trans('ThirdPartyName').''; +print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom'); +print '
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; + print $langs->trans('CustomerCode').''; + print $object->code_client; + if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; + print '
'; + print $langs->trans('SupplierCode').''; + print $object->code_fournisseur; + if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; + print '
'; + +dol_fiche_end(); +print '
'; + + +$sql_select=''; +if ($type_element == 'invoice') +{ // Customer : show products from invoices +$documentstatic=new Facture($db); +$sql_select = 'SELECT f.rowid as doc_id, f.facnumber as doc_number, f.type as doc_type, f.datef as datePrint, '; +$tables_from = MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."facturedet as d"; +$where = " WHERE f.fk_soc = s.rowid AND s.rowid = ".$socid; +$where.= " AND d.fk_facture = f.rowid"; +$where.= " AND f.entity = ".$conf->entity; +$datePrint = 'f.datef'; +$doc_number='f.facnumber'; +$thirdTypeSelect='customer'; +} +if ($type_element == 'order') +{ + // TODO + +} +if ($type_element == 'supplier_order') +{ // Supplier : Show products from orders. +$documentstatic=new CommandeFournisseur($db); +$sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, "1" as doc_type, c.date_valid as datePrint, '; +$tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d"; +$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid; +$where.= " AND d.fk_commande = c.rowid"; +$datePrint = 'c.date_creation'; +$doc_number='c.ref'; +$thirdTypeSelect='supplier'; +} +if ($type_element == 'supplier_invoice') +{ + // TODO + +} + +$sql = $sql_select; +$sql.= ' d.fk_product as product_id, d.fk_product as fk_product, d.label, d.description as description, d.info_bits, d.date_start, d.date_end, d.qty, d.qty as prod_qty,'; +$sql.= ' p.ref as ref, p.rowid as prod_id, p.rowid as fk_product, p.fk_product_type as prod_type, p.fk_product_type as fk_product_type,'; +$sql.= " s.rowid as socid, p.ref as prod_ref, p.label as product_label"; +$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".$tables_from; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON d.fk_product = p.rowid '; +$sql.= $where; +if ($month > 0) { + if ($year > 0) { + $start = dol_mktime(0, 0, 0, $month, 1, $year); + $end = dol_time_plus_duree($start, 1 , 'm') - 1; + $sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; + } else { + $sql.= " AND date_format(".$datePrint.", '%m') = '".sprintf('%02d',$month)."'"; + } +} else if ($year > 0) { + $start = dol_mktime(0, 0, 0, 1, 1, $year); + $end = dol_time_plus_duree($start, 1 , 'y') - 1; + $sql.= " AND ".$datePrint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'"; +} +if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$sref."%'"; +$sql.= $db->order($sortfield,$sortorder); +$sql.= $db->plimit($limit + 1, $offset); + + +// Define type of elements +$typeElementString = $form->selectarray("type_element",$elementTypeArray,GETPOST('type_element')); +$button = ''; +$param="&sref=".$sref."&month=".$month."&year=".$year."&sprod_fulldescr=".$sprod_fulldescr."&socid=".$socid; + +print_barre_liste($langs->trans('ProductsIntoElements', $typeElementString.' '.$button), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', ''); + +if ($sql_select) +{ + dol_syslog("sql=".$sql); + $resql=$db->query($sql); + if (!$resql) dol_print_error($db); +} + +print ''."\n"; +// Titles with sort buttons +print ''; +print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'doc_number','',$param,'align="left"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Date'),$_SERVER['PHP_SELF'],'datePrint','',$param,'align="center" width="150"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Product'),$_SERVER['PHP_SELF'],'','',$param,'align="left"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('Quantity'),$_SERVER['PHP_SELF'],'prod_qty','',$param,'align="right"',$sortfield,$sortorder); +// Filters +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +if ($sql_select) +{ + $var=true; + $num = $db->num_rows($resql); + $i = 0; + while (($objp = $db->fetch_object($resql)) && $i < $conf->liste_limit ) + { + $var=!$var; + print ""; + print ''; + print ''; + + print ''; + + //print ''; + + print ''; + + print "\n"; + $i++; + } + if ($num > $conf->liste_limit) { + print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num); + } + $db->free($resql); +} +else { + print ''; +} + +print "
'; +print ''; +print ''; // date +print $formother->select_month($month?$month:-1,'month',1); +$formother->select_year($year?$year:-1,'year',1, 20, 1); +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'; + $documentstatic->id=$objp->doc_id; + $documentstatic->ref=$objp->doc_number; + $documentstatic->type=$objp->type; + print $documentstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->datePrint),'day').''; + + // Define text, description and type + $text=''; $description=''; $type=0; + + // Code to show product duplicated from commonobject->printObjectLine + if ($objp->fk_product > 0) + { + $product_static = new Product($db); + + $product_static->type=$objp->fk_product_type; + $product_static->id=$objp->fk_product; + $product_static->ref=$objp->ref; + $text=$product_static->getNomUrl(1); + } + + // Product + if ($objp->fk_product > 0) + { + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $this->fetch_thirdparty(); + $prod = new Product($db); + $prod->fetch($objp->fk_product); + + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$this->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; + } + else + { + $label = $objp->product_label; + } + + $text.= ' - '.(! empty($objp->label)?$objp->label:$label); + $description=(! empty($conf->global->PRODUIT_DESC_IN_FORM)?'':dol_htmlentitiesbr($objp->description)); + } + + if (($objp->info_bits & 2) == 2) { ?> + + trans("ShowReduc"),'reduc').' '; + if ($objp->description == '(DEPOSIT)') $txt=$langs->trans("Deposit"); + //else $txt=$langs->trans("Discount"); + print $txt; + ?> + + description) + { + if ($objp->description == '(CREDIT_NOTE)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0)); + } + elseif ($objp->description == '(DEPOSIT)' && $objp->fk_remise_except > 0) + { + $discount=new DiscountAbsolute($db); + $discount->fetch($objp->fk_remise_except); + echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); + // Add date of deposit + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; + } + else + { + echo ($txt?' - ':'').dol_htmlentitiesbr($objp->description); + } + } + } + else + { + if ($objp->fk_product > 0) { + + echo $form->textwithtooltip($text,$description,3,'','',$i,0,''); + + // Show range + echo get_date_range($objp->date_start, $objp->date_end); + + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + print (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + + } else { + + //if (! empty($objp->fk_parent_line)) echo img_picto('', 'rightarrow'); + if ($type==1) $text = img_object($langs->trans('Service'),'service'); + else $text = img_object($langs->trans('Product'),'product'); + + if (! empty($objp->label)) { + $text.= ' '.$objp->label.''; + echo $form->textwithtooltip($text,dol_htmlentitiesbr($objp->description),3,'','',$i,0,''); + } else { + echo $text.' '.dol_htmlentitiesbr($objp->description); + } + + // Show range + echo get_date_range($objp->date_start,$objp->date_end); + } + } + + /* + $prodreftxt=''; + if ($objp->prod_id > 0) + { + $productstatic->id = $objp->prod_id; + $productstatic->ref = $objp->prod_ref; + $productstatic->status = $objp->prod_type; + $prodreftxt = $productstatic->getNomUrl(0); + if(!empty($objp->product_label)) $prodreftxt .= ' - '.$objp->product_label; + } + // Show range + $prodreftxt .= get_date_range($objp->date_start, $objp->date_end); + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + $prodreftxt .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + } + */ + print '
'.$prodreftxt.''.$objp->prod_qty.'
'.$langs->trans("FeatureNotYetAvailable").'
"; +print ""; + + +/* + * Errors + */ + +dol_htmloutput_errors($warning); +dol_htmloutput_errors($error,$errors); + +llxFooter(); + +$db->close(); +?> diff --git a/htdocs/theme/amarok/img/cron.png b/htdocs/theme/amarok/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/amarok/img/object_cron.png b/htdocs/theme/amarok/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 8c92d9e561b..48fa2c8f5a3 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -120,6 +120,9 @@ a:hover, a:active { color:rgba(0,0,0,.6); } +input, input.flat, textarea, textarea.flat, form.flat select, select.flat { + padding: 1px; +} input, textarea { font-size:px; font-family:; @@ -812,7 +815,7 @@ td.vmenu { } div.fiche { - padding:8px 12px 10px; + padding:8px 6px 10px; margin-: browser->phone) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'16':'24'; ?>px; margin-: browser->phone)?'12':'6'; ?>px; } @@ -1140,21 +1143,21 @@ tr.fiche { .ok { color:#159e26; background:url() left center no-repeat !important; - padding-left:20px; + padding-left:20px !important; font-weight:bold; } .warning { color:#bca936; background:url() left center no-repeat !important; - padding-left:20px; + padding-left:20px !important; font-weight:bold; } .error { color:#a61111; background:#f58080 url() left center no-repeat !important; - padding-left:20px; + padding-left:20px !important; font-weight:bold; } @@ -1163,7 +1166,7 @@ td.highlights {background:#f9c5c6;} div.ok { background:#61e372; /* url() 3px center no-repeat; */ /*color:#ffffff;*/ - padding:2px 4px 2px 24px; + padding:2px 4px 2px 6px; margin:0.5em 0em; font-weight:normal; } @@ -1171,7 +1174,7 @@ div.ok { div.warning, div.info { background:#fcf5b8; /* url() 3px center no-repeat; */ /*color:#232323; */ - padding:2px 4px 2px 24px; + padding:2px 4px 2px 6px; margin:0.5em 0em; border:1px solid #bca936; font-weight:normal; @@ -1180,7 +1183,7 @@ div.warning, div.info { div.error { background:#f58080; /* url() 3px center no-repeat; */ /* color:#ffffff; */ - padding:2px 4px 2px 24px; + padding:2px 4px 2px 6px; margin:0.5em 0em; border:1px solid #a61111; font-weight:normal; diff --git a/htdocs/theme/auguria/img/cron.png b/htdocs/theme/auguria/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/auguria/img/object_commissions.png b/htdocs/theme/auguria/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/htdocs/theme/auguria/img/object_cron.png b/htdocs/theme/auguria/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/bureau2crea/img/cron.png b/htdocs/theme/bureau2crea/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/bureau2crea/img/object_commissions.png b/htdocs/theme/bureau2crea/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/htdocs/theme/bureau2crea/img/object_cron.png b/htdocs/theme/bureau2crea/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/cameleo/img/cron.png b/htdocs/theme/cameleo/img/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/cameleo/img/object_commissions.png b/htdocs/theme/cameleo/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/htdocs/theme/cameleo/img/object_cron.png b/htdocs/theme/cameleo/img/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/menus/cron.png b/htdocs/theme/eldy/img/menus/cron.png new file mode 100644 index 0000000000000000000000000000000000000000..ddfe62e7b24f19698ca3b7d8c308865ec2bd4088 GIT binary patch literal 2165 zcmV-*2#WWKP) zhGCk@X*r@*SrN^}8T{p|e17pGwrwpVn@vQrU5H$luS8AMV{XGORpb zia<)yT3w~STfYRIWd=0;{%-Yf%`SuQ$ zS5r7mg$i7fnnaT>kuUK`5$h?D$YhnS>0;vIg|w8x8^*@&?y;SB-$T9GBv`#pShV(T80uqfkUhX6HYl)S(k32M934HSMubtMHk68_QmH{B zoylb4ND;>h5yxmM!V)1e@`+-fFp7z9y$pn*Q63!P$);=L@T)AUPDTtLI3`62L4vm%Nn~Px>ZZZu6Y3B*;cC=7p$2E-DVtwTX z5`&Z$(!6>KBU>bW*F7W(MKnz#jza_rDFuzd#zQ9*HktrU6QaIerPXp4jn$QvPj4>H zZ|dqUt2kW}q~l~i#fx?y7$HX`F8+*Aiq zEYOPm7`j0mMa<3q3*Yyy7z+yvM<=g-{$y|eCS<0F%J<>ioI_U)GG>b~xK7ip5*tZ! zS%XMAc-2V)p(9Wv@+GWd52OpIAV5Q)SvJXZT3w%=5!2IC*G$u#(fuG;*x1$i<6ZZU znwn)RbW;S48X{<5MNLwcz}6+U5z>}TlTMr1R!mS|C-8hCrIX0!NaymTGFi-I3f(j@ zO-ua!gQFZj`nOjc$9Y$Oc+W%4h57kXce!VDaN7=IC4|xpR1A^tAf$s%fUU*YT8O0_ z%&-Ao6X~`Hf&e|8Cz)h=1fJ~cg!@B7y*)7-yh za9g3+wNb@ZMxfcq5Mrs*hz@?2NE{pMjl zIDYKq#f6186+}8fv)NqNG_e>(;S-y;Y&F`8C54?9qOFrC-Hq>sg!L6{TKKL{wXSGr zC8FGB?5>@pN@X-ViO>usr4%0?f0uWTymf5i;>DkbQM3kND5VfWsIzC!9?532Wy3Ij zHTLu~Mo(YA@)Jq)bU`?^WtuCqXmJve%@J?x!N~QX=Qd(wiil(e!?IPY)e;{beV4ah zKRkZ=^!Q7Gl(V-7+qgY=Kyc#3iQfl7;H+0GzxdAMPi?sOYrDv_<&~Sr2v4Mlu(8{B zknFpgL~aA7WrLz5Rv16xBjlbkL?pc8L_I4_j$}I}|FIq7N2e&-1 zedo}j`|sbqZ)Ep_?AUoX=}a0FO5H{$A%v8YndwQ+ojJwHe|%KAaN+##rluzU7zDSH z?B2bb@$vC5s~QUb4Js&TCG-#`9JzMs-p~SO~oP900000NkvXXu0mjf<>nx% literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/menus/object_cron.png b/htdocs/theme/eldy/img/menus/object_cron.png new file mode 100644 index 0000000000000000000000000000000000000000..b929050598d10d851b4bca1299e8cd75514a41cc GIT binary patch literal 655 zcmV;A0&x9_P)`xW z!{Lw=MWM-LV$|#Pmq`9;;qnNIsj7Mri9{$I4ihKOW;3zbW*^@<9F8Eza*l!?Oi)_` zjT(&xt=DT>E|;PTFRt!#xd^~qk#@V?db{14ayp&9g7a-G7SmR%72N|=4a0Z?``co% z2mx5PSS;l6c&O9qJb}+D=W@Bbd_M0RkHcDqg8Zub>>`;LOYKzD-vUUY4gr?IeRVtMpKtCwByn)dj300vL!`?A$)U2-K|*F_7Q$bupE9awy3RV`Ml z)eWfy4I~KplgXr@*z5JUXL3571d&)(6(f=qa5r)I-S77ePziExqtS?(&8A3XrMWjw z#25@D)wo}&P$-C30>^Wx_6SZ^@na^F336h!TJ3}CYuveT`~!AnW+vV$8+b-P&d&^0 p!Vuy5Ug1vw`g)E#{|NsC7yzo}QT`99$FKkZ002ovPDHLkV1izUCSd>o literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/img/object_commissions.png b/htdocs/theme/eldy/img/object_commissions.png deleted file mode 100644 index 39f09967046b32c8563a44af9da1b0b454175626..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)FVe>ug)pt&qqU8XGoQof21v4uoQYD?CsA}0 zssidqY_F|yu=I*@xyHEx^+UmKw1T|<5?3X`*77&zKgDqxZY=8(t+sU>aF!@Vk&Q+n zOOsb4wHhJ1U8baV;|mQ^Lt&ubCcdzMdXcEC*uv}@AYj$l%jCH`HAOPE@drWLeD<&r zyghzO6abFH^O+|MUu`B8PqMm_Ang=!8~O>t|A;C(Rk9Tg;r63>Tkv&to*)2XFPXMo z)pw9vKPAexJgmiw^o@*S1@n09X8fVh3Bu3UQ#O#(bT`cIO&1qR zG&EgMt40!e+0IDqBX!M+h^j8!rKUMaW>!^IjUEn<+O^G*N&002ovPDHLkV1jd4IY$5h diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php new file mode 100644 index 00000000000..0c22107bde6 --- /dev/null +++ b/scripts/cron/cron_run_jobs.php @@ -0,0 +1,146 @@ +#!/usr/bin/php +. + */ + +/** + * \file cron/script/cron/cron_run_jobs.php + * \ingroup cron + * \brief Execute pendings jobs + */ +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOLOGIN')) define('NOLOGIN','1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); + +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + +// Test if batch mode +if (substr($sapi_type, 0, 3) == 'cgi') { + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + exit; +} + +if (! isset($argv[1]) || ! $argv[1]) { + print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; + exit; +} +$key=$argv[1]; + +if (! isset($argv[2]) || ! $argv[2]) { + print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; + exit; +} else { + $userlogin=$argv[2]; +} + + +$res=@include("../../master.inc.php"); // For root directory +if (! $res) $res=@include("../../../master.inc.php"); // For "custom" directory +if (! $res) die("Include of master.inc.php fails"); + + +// librarie jobs +require_once (DOL_DOCUMENT_ROOT_ALT."/cron/class/cronjob.class.php"); + + +//Check security key +if($key != $conf->global->MAIN_CRON_KEY) +{ + echo 'securitykey is wrong'; + exit; +} + +//Check user login +require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +$user=new User($db); +$result=$user->fetch('',$userlogin); +if ($result<0) { + echo "User Error:".$user->error; + dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); + exit; +}else { + if (empty($user->id)) { + echo " User user login:".$userlogin." do not exists"; + dol_syslog(" User user login:".$userlogin." do not exists", LOG_ERR); + exit; + } +} + +if (isset($argv[3]) || $argv[3]) { + $id = $argv[3]; +} + +// librarie jobs +require_once (DOL_DOCUMENT_ROOT_ALT."/cron/class/cronjob.class.php"); + +// create a jobs object +$object = new Cronjob($db); + +$filter=array(); +if (empty($id)) { + $filter=array(); + $filter['t.rowid']=$id; +} + +$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter); +if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + exit; +} + +// current date +$now=dol_now(); + +if(is_array($object->lines) && (count($object->lines)>0)){ + // Loop over job + foreach($object->lines as $line){ + + //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database + if (($line->datenextrun < $now) && $line->dateend < $now){ + $cronjob=new Cronjob($db); + $result=$cronjob->fetch($line->id); + if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); + exit; + } + // execute methode + $result=$cronjob->run_jobs($userlogin); + if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR); + exit; + } + + // we re-program the next execution and stores the last execution time for this job + $result=$cronjob->reprogram_jobs($userlogin); + if ($result<0) { + echo "Error:".$cronjob->error; + dol_syslog("cron_run_jobs.php:: reprogram_jobs Error".$cronjob->error, LOG_ERR); + exit; + } + + } + } +} \ No newline at end of file From e9cbf94e06831f366cdb21b0b123ca48867fc973 Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 22 Mar 2013 17:31:43 +0100 Subject: [PATCH 091/150] Trad: Add es_ES and ca_ES missing translations --- htdocs/langs/ca_ES/admin.lang | 17 +++++- htdocs/langs/ca_ES/bills.lang | 1 + htdocs/langs/ca_ES/companies.lang | 2 + htdocs/langs/ca_ES/compta.lang | 6 ++ htdocs/langs/ca_ES/cron.lang | 92 +++++++++++++++++++++++++++++++ htdocs/langs/ca_ES/main.lang | 2 +- htdocs/langs/ca_ES/sendings.lang | 1 + htdocs/langs/es_ES/admin.lang | 16 ++++-- htdocs/langs/es_ES/bills.lang | 1 + htdocs/langs/es_ES/companies.lang | 2 + htdocs/langs/es_ES/compta.lang | 8 ++- htdocs/langs/es_ES/cron.lang | 92 +++++++++++++++++++++++++++++++ htdocs/langs/es_ES/main.lang | 2 +- htdocs/langs/es_ES/sendings.lang | 1 + 14 files changed, 233 insertions(+), 10 deletions(-) create mode 100644 htdocs/langs/ca_ES/cron.lang create mode 100644 htdocs/langs/es_ES/cron.lang diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 89761b3eba5..de095a8ff62 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -348,16 +348,18 @@ TextLong=Text llarg Int=numèric enter Float=Decimal DateAndTime=Data i hora +Unique=Unic Boolean=Boleano (Checkbox) ExtrafieldPhone=Telèfon ExtrafieldPrice=Preu ExtrafieldMail=Correu ExtrafieldSelect=Llista de selecció +ExtrafieldSeparator= LibraryToBuildPDF=Llibreria usada per a la creació d'arxius PDF WarningUsingFPDF=Atenció: El seu arxiu conf.php conté la directiva dolibarr_pdf_force_fpdf=1. Això fa que s'usi la llibreria FPDF per generar els seus arxius PDF. Aquesta llibreria és antiga i no cobreix algunes funcionalitats (Unicode, transparència d'imatges, idiomes ciríl · lics, àrabs o asiàtics, etc.), Pel que pot tenir problemes en la generació dels PDF.
Per resoldre-ho, i disposar d'un suport complet de PDF, pot descarregar la llibreria TCPDF , i a continuació comentar o eliminar la línia $dolibarr_pdf_force_fpdf=1, i afegir al seu lloc $dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF' LocalTaxDesc=Alguns països apliquen 2 o 3 taxes a cada línia de factura. Si és el cas, escolliu el tipus de la segona i tercera taxa i el seu valor. Els possibles tipus són:
1: taxa local aplicable a productes i serveis sense IVA (IVA no s'aplica a la taxa local)
2: taxa local s'aplica a productes i serveis abans de l'IVA (IVA es calcula sobre import + taxa local)
3: taxa local s'aplica a productes sense IVA (IVA no s'aplica a la taxa local)
4: taxa local s'aplica a productes abans de l'IVA (IVA es calcula sobre l'import + taxa local)
5: taxa local s'aplica a serveis sense IVA (IVA no s'aplica a la taxa local)
6: taxa local s'aplica a serveis abans de l'IVA (IVA es calcula sobre import + taxa local) SuhosinSessionEncrypt=Emmagatzematge de sessions xifrades per Suhosin -# Modules= = +# Modules Module0Name=Usuaris y grups Module0Desc=Gestió d'usuaris i grups Module1Name=Tercers @@ -365,7 +367,7 @@ Module1Desc=Gestió de tercers (empreses, particulars) i contactes Module2Name=Comercial Module2Desc=Gestió comercial Module10Name=Comptabilitat -Module10Desc=Gestió simple de la comptabilitat (desglossament de factures i pagaments) +Module10Desc=Activació d'informes simples de comptabilitat (diaris, vendes) basats en el contingut de la base de dades. Sense desglossaments. Module20Name=Pressupostos Module20Desc=Gestió de pressupostos/propostes comercials Module22Name=E-Mailings @@ -450,6 +452,8 @@ Module1780Name=Categories Module1780Desc=Gestió de categories (productes, proveïdors i clients) Module2000Name=Editor WYSIWYG Module2000Desc=Permet l'edició de certes zones de text mitjançant un editor avançat +Module2300Name=Cron +Module2300Desc=Gestor de tasques programades Module2400Name=Agenda Module2400Desc=Gestió de l'agenda i de les accions Module2500Name=Gestió Electrònica de Documents @@ -673,6 +677,10 @@ Permission1411=Llegir els moviments comptables Permission1412=Crear/modificar/anular moviments comptables Permission1415=Llegir Balanços, informes, diaris, llibres mestres Permission1421=Exporta comandes de clients i atributs +Permission23001=Veure les tasques programades +Permission23002=Crear/Modificar les tasques programades +Permission23003=Eliminar les tasques programades +Permission23004=Executar les tasques programades Permission2401=Llegir accions (esdeveniments o tasques) vinculades al seu compte Permission2402=Crear/modificar accions (esdeveniments o tasques) vinculades al seu compte Permission2403=Modificar accions (esdeveniments o tasques) vinculades al seu compte @@ -946,7 +954,7 @@ TranslationDesc=L'elecció de l'idioma mostrat en pantalla es modifica:
* A n ClassNotFoundIntoPathWarning=No s'ha trobat la classe %s en el seu path PHP YesInSummer=Sí a l'estiu OnlyFollowingModulesAreOpenedToExternalUsers=Recordeu que només els mòduls següents estan oberts a usuaris externs (siguin quins siguin els permisos dels usuaris): -##### Module password generation= = +##### Module password generation PasswordGenerationStandard=Retorna una contrasenya generada per l'algoritme intern Dolibarr: 8 caràcters, números i caràcters en minúscules barrejades. PasswordGenerationNone=No ofereix contrasenyes. La contrasenya s'introdueix manualment. ##### Users setup ##### @@ -1270,6 +1278,8 @@ FCKeditorForCompany=Creació/edició WYSIWIG de la descripció i notes dels terc FCKeditorForProduct=Creació/edició WYSIWIG de la descripció i notes dels productes/serveis FCKeditorForProductDetails=Creació/edició WYSIWIG de les línies de detall dels productes (en comandes, pressupostos, factures, etc.) FCKeditorForMailing=Creació/edició WYSIWIG dels E-Mails +FCKeditorForUserSignature=Creació/edició WYSIWIG dela firma dels usuaris +FCKeditorForMail=Creació/edició WYSIWIG de tots els E-mails (excepte Utilitats->E-Mailings) ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=La connexió s'ha establert, però la base de dades no sembla de OSCommerce. OSCommerceTestOk=La connexió al servidor '%s' sobre la base '%s' per l'usuari '%s' és correcta. @@ -1378,6 +1388,7 @@ MultiCompanySetup=Configuració del mòdul Multi-empresa SuppliersSetup=Configuració del mòdul Proveïdors SuppliersCommandModel=Model de comandes a proveïdors complet (logo...) SuppliersInvoiceModel=Model de factures de proveïdors complet (logo...) +SuppliersInvoiceNumberingModel=Models de numeració de factures de proveïdor ##### GeoIPMaxmind ##### GeoIPMaxmindSetup=Configuració del mòdul GeoIP Maxmind PathToGeoIPMaxmindCountryDataFile=Ruta de l'arxiu Maxmind que conté les conversions IP-> País.
Exemple: /usr/local/share/GeoIP/GeoIP.dat diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index 8456f4518e4..3f923cb917d 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -385,6 +385,7 @@ ClosePaidCreditNotesAutomatically=Classificar automàticament com "Pagats" els a AllCompletelyPayedInvoiceWillBeClosed=Totes les factures amb una resta a pagar 0 seran automàticament tancades a l'estat "Pagada". ToMakePayment=Pagar ToMakePaymentBack=Reemborsar +ListOfYourUnpaidInvoices=Llistat de factures impagades ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Responsable seguiment factura a client TypeContact_facture_external_BILLING=Contacte client facturació diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang index 1559fd7cf72..c474ac42f68 100644 --- a/htdocs/langs/ca_ES/companies.lang +++ b/htdocs/langs/ca_ES/companies.lang @@ -393,6 +393,8 @@ UniqueThirdParties=Total de tercers únics InActivity=Actiu ActivityCeased=Tancat ActivityStateFilter=Estat d'activitat +ProductsIntoElements=Llistat de productes en %s + # Monkey MonkeyNumRefModelDesc=Retorna un número sota el format %syymm-nnnn per als codis de clients i %syymm-nnnn per als codis dels proveïdors, on yy és l'any, mm el mes i nnnn un comptador seqüencial sense ruptura i sense tornar a 0. # Leopard diff --git a/htdocs/langs/ca_ES/compta.lang b/htdocs/langs/ca_ES/compta.lang index fb9d58e541d..eff4e5cd8ad 100644 --- a/htdocs/langs/ca_ES/compta.lang +++ b/htdocs/langs/ca_ES/compta.lang @@ -157,3 +157,9 @@ COMPTA_ACCOUNT_SUPPLIER=Codi comptable per defecte de proveïdors (si no està d AddRemind=Desglossar import disponible RemainToDivide=Resta a repartir : WarningDepositsNotIncluded=Les factures de bestreta encara no estan incloses en aquesta versió en el mòdul de comptabilitat. +DatePaymentTermCantBeLowerThanObjectDate=La data límit de pagament no pot ser inferior a la data de l'objecte +Pcg_version=Versió del pla +Pcg_type=Tipus de compte +Pcg_subtype=Subtipus de compte +InvoiceLinesToDispatch=Línies de factures a desglossar +InvoiceDispatched=Factures desglossades \ No newline at end of file diff --git a/htdocs/langs/ca_ES/cron.lang b/htdocs/langs/ca_ES/cron.lang new file mode 100644 index 00000000000..67833a6b65b --- /dev/null +++ b/htdocs/langs/ca_ES/cron.lang @@ -0,0 +1,92 @@ +# Dolibarr language file - ca_ES - cron +CHARSET=UTF-8 + +# +# Admin +# +CronSetup=Pàgina de configuració del mòdul - Gestió de tasques planificades +URLToLaunchCronJobs=URL per llançar les tasques automàtiques +OrToLaunchASpecificJob=O per llançar una tasca específica +KeyForCronAccess=Codi de seguretat per a la URL de llançament de tasques automàtiques +FileToLaunchCronJobs=Ordre per llançar les tasques automàtiques +CronExplainHowToRunUnix=En un entorn Unix pot parametritzar crontab per executar aquesta comanda cada minut +CronExplainHowToRunWin=En un entorn Microsoft (tm) Windows pot utilitzar el planificador de tasques per llançar aquesta comanda cada minut +# +# Menu +# +CronListActive=Llistat de tasques planificades actives +CronListInactive=Llistat de tasques planificades inactives + + +# +# Page list +# +CronDateLastRun=Últim llançament +CronLastOutput=Última sortida +CronLastResult=Últim codi tornat +CronCommand=Comando +CronList=Llistat de tasques planificades +CronDelete=Eliminar la tasca planificada +CronConfirmDelete=Està segur que voleu eliminar aquesta tasca planificada? +CronExecute=Executar aquesta tasca +CronConfirmExecute=Està segur que voleu executar ara aquesta tasca? +CronInfo=Els treballs permeten executar les tasques a intervals regulars +CronWaitingJobs=Els seus treballs en espera: +CronTask=Tasca +CronNone=Ningún +CronDtStart=Data inici +CronDtEnd=Data fi +CronDtNextLaunch=Propera execució +CronDtLastLaunch=Darrera execució +CronFrequency=Freqüència +CronClass=Clase +CronMethod=Mètod +CronModule=Mòdul +CronAction=Acció +CronStatus=Estat +CronStatusActive=Activa +CronStatusInactive=Inactiva +CronEach=Cada +CronNoJobs=Sense treballs actualment +CronPriority=Prioritat +CronLabel=Descripció +CronNbRun=Nº ejec. +CronDtLastResult=Data de l'últim resultat de l'última execució + +# +#Page card +# +CronAdd=Afegir una tasca +CronHourStart=Dia i hora d'inici de la tasca +CronEvery=Executar cada +CronObject=Instància/Objecte a crear +CronArgs=Argument +CronSaveSucess=Registre guardat +CronNote=Nota +CronFieldMandatory=El camp %s és obligatori +CronErrEndDateStartDt=La data de fi no pot ser anterior a la d'inici +CronStatusActiveBtn=Activar +CronStatusInactiveBtn=Desactivar +CronTaskInactive=Aquesta tasca es troba desactivada +CronId=Id +CronClassFile=Classe (arxiu) +CronModuleHelp=Nombre del directorio del módulo Dolibarr (funciona automáticamente con los módulos externos Dolibarr).
Por ejemplo para llamar al método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del módulo es product +CronClassFileHelp=El archivo archivo que contiene el objeto.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor de la clase es product.class.php +CronObjectHelp=El nombre del objeto a crear.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del objeto es Product +CronMethodHelp=El método a lanzar.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del método es fecth +CronArgsHelp=Los argumentos del método.
Por ejemplo para usar el método fetch del objeto Product deDolibarr /htdocs/product/class/product.class.php, el valor del parámetro podría ser 0, RefProduit +CronCommandHelp=El comando del sistema a executar + +# +# Info +# +CronInfoPage=Informació + +# +# Common +# +CronType=Tipus d'acció a executar +CronType_method=Mètode d'una classe d'un mòdul Dolibarr +CronType_command=Comando Shell +CronMenu=Cron +CronCannotLoadClass=impossible carregar la classe %s de l'objecte %s \ No newline at end of file diff --git a/htdocs/langs/ca_ES/main.lang b/htdocs/langs/ca_ES/main.lang index a3d51433d1a..35b4d437e4e 100644 --- a/htdocs/langs/ca_ES/main.lang +++ b/htdocs/langs/ca_ES/main.lang @@ -489,7 +489,7 @@ NbOfThirdParties=Número de tercers NbOfCustomers=Nombre de clients NbOfLines=Números de línies NbOfObjects=Nombre d'objectes -NbOfReferers=Nombre de referències +NbOfReferers=Consumició Referers=Referències TotalQuantity=Quantitat total DateFromTo=De %s a %s diff --git a/htdocs/langs/ca_ES/sendings.lang b/htdocs/langs/ca_ES/sendings.lang index 38462265059..fc53bde5f28 100644 --- a/htdocs/langs/ca_ES/sendings.lang +++ b/htdocs/langs/ca_ES/sendings.lang @@ -59,6 +59,7 @@ LinkToTrackYourPackage=Enllaç per al seguiment del seu paquet ShipmentCreationIsDoneFromOrder=De moment, la creació d'una nova expedició es realitza des de la fitxa de comanda. RelatedShippings=Expedició(ns) associades ShipmentLine=Línia d'expedició +CarrierList=Llistat de transportistes # Sending methods SendingMethodCATCH=Recollit pel client diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 811d9166b57..88328c5cfac 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -354,11 +354,12 @@ ExtrafieldPhone=Teléfono ExtrafieldPrice=Precio ExtrafieldMail=Correo ExtrafieldSelect=Lista de selección +ExtrafieldSeparator= LibraryToBuildPDF=Librería usada para la creación de archivos PDF WarningUsingFPDF=Atención: Su archivo conf.php contiene la directiva dolibarr_pdf_force_fpdf=1. Esto hace que se use la librería FPDF para generar sus archivos PDF. Esta librería es antigua y no cubre algunas funcionalidades (Unicode, transparencia de imágenes, idiomas cirílicos, árabes o asiáticos, etc.), por lo que puede tener problemas en la generación de los PDF.
Para resolverlo, y disponer de un soporte completo de PDF, puede descargar la librería TCPDF , y a continuación comentar o eliminar la línea $dolibarr_pdf_force_fpdf=1, y añadir en su lugar $dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF' LocalTaxDesc=Algunos países aplican 2 o 3 tasas a cada línea de factura. Si es el caso, escoja el tipo de la segunda y tercera tasa y su valor. Los posibles tipos son:
1 : tasa local aplicable a productos y servicios sin IVA (IVA no se aplica en la tasa local)
2 : tasa local se aplica a productos y servicios antes del IVA (IVA se calcula sobre importe+tasa local)
3 : tasa local se aplica a productos sin IVA (IVA no se aplica en la tasa local)
4 : tasa local se aplica a productos antes del IVA (IVA se calcula sobre el importe+tasa local)
5 : tasa local se aplica a servicios sin IVA (IVA no se aplica a la tasa local)
6 : tasa local se aplica a servicios antes del IVA (IVA se calcula sobre importe + tasa local) SuhosinSessionEncrypt=Almacenamiento de sesiones cifradas por Suhosin -# Modules= = +# Modules Module0Name=Usuarios y grupos Module0Desc=Gestión de usuarios y grupos Module1Name=Terceros @@ -366,7 +367,7 @@ Module1Desc=Gestión de terceros (empresas, particulares) y contactos Module2Name=Comercial Module2Desc=Gestión comercial Module10Name=Contabilidad -Module10Desc=Gestión simple de la contabilidad (desglose de facturas y pagos) +Module10Desc=Activación de informes simples de contabilidad (diarios, ventas) basados en el contenido de la base de datos. Sin desgloses. Module20Name=Presupuestos Module20Desc=Gestión de presupuestos/propuestas comerciales Module22Name=E-Mailings @@ -451,6 +452,8 @@ Module1780Name=Categorías Module1780Desc=Gestión de categorías (productos, proveedores y clientes) Module2000Name=Editor WYSIWYG Module2000Desc=Permite la edición de ciertas zonas de texto mediante un editor avanzado +Module2300Name=Cron +Module2300Desc=Gestor de tareas programadas Module2400Name=Agenda Module2400Desc=Gestión de la agenda y de las acciones Module2500Name=Gestión Electrónica de Documentos @@ -674,6 +677,10 @@ Permission1411=Leer los movimientos contables Permission1412=Crear/modificar/anular movimientos contables Permission1415=Leer Balances, informes, diarios, libros maestros Permission1421=Exportar pedidos de clientes y atributos +Permission23001=Ver las tareas programadas +Permission23002=Crear/Modificar las tareas programadas +Permission23003=Eliminar las tareas programadas +Permission23004=Ejecutar las tareas programadas Permission2401=Leer acciones (eventos o tareas) vinculadas a su cuenta Permission2402=Crear/eliminar acciones (eventos o tareas) vinculadas a su cuenta Permission2403=Modificar acciones (eventos o tareas) vinculadas a su cuenta @@ -947,7 +954,7 @@ TranslationDesc=La elección del idioma mostrado en pantalla se modifica:
* A ClassNotFoundIntoPathWarning=No se ha encontrado la clase %s en su path PHP YesInSummer=Sí en verano OnlyFollowingModulesAreOpenedToExternalUsers=Tenga en cuenta que sólo los módulos siguientes están abiertos a usuarios externos (sean cuales sean los permisos de los usuarios): -##### Module password generation= = +##### Module password generation PasswordGenerationStandard=Devuelve una contraseña generada por el algoritmo interno Dolibarr: 8 caracteres, números y caracteres en minúsculas mezcladas. PasswordGenerationNone=No ofrece contraseñas. La contraseña se introduce manualmente. ##### Users setup ##### @@ -1271,7 +1278,7 @@ FCKeditorForCompany=Creación/edición WYSIWIG de la descripción y notas de los FCKeditorForProduct=Creación/edición WYSIWIG de la descripción y notas de los productos/servicios FCKeditorForProductDetails=Creación/edición WYSIWIG de las líneas de detalle de los productos (en pedidos, presupuestos, facturas, etc.) FCKeditorForMailing=Creación/edición WYSIWIG de los E-Mails (Utilidades->E-Mailings) -FCKeditorForUserSignature=Creación/edición WYSIWIG de los usuario firma +FCKeditorForUserSignature=Creación/edición WYSIWIG de la firma de usuarios FCKeditorForMail=Creación/edición WYSIWIG de todos los E-Mails (excepto Utilidades->E-Mailings) ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=La conexión se ha establecido, pero la base de datos no parece de OSCommerce. @@ -1381,6 +1388,7 @@ MultiCompanySetup=Configuración del módulo Multi-empresa SuppliersSetup=Configuración del módulo Proveedores SuppliersCommandModel=Modelo de pedidos a proveedores completo (logo...) SuppliersInvoiceModel=Modelo de facturas de proveedores completo (logo...) +SuppliersInvoiceNumberingModel=Modelos de numeración de facturas de proveedor ##### GeoIPMaxmind ##### GeoIPMaxmindSetup=Configuración del módulo GeoIP Maxmind PathToGeoIPMaxmindCountryDataFile=Ruta del archivo Maxmind que contiene las conversiones IP->País.
Ejemplo: /usr/local/share/GeoIP/GeoIP.dat diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index e72c4637fd4..4429143bacf 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -385,6 +385,7 @@ ClosePaidCreditNotesAutomatically=Clasificar automáticamente como "Pagados" los AllCompletelyPayedInvoiceWillBeClosed=Todas las facturas con un resto a pagar 0 serán automáticamente cerradas al estado "Pagada". ToMakePayment=Pagar ToMakePaymentBack=Reembolsar +ListOfYourUnpaidInvoices=Listado de facturas impagadas ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Responsable seguimiento factura a cliente TypeContact_facture_external_BILLING=Contacto cliente facturación diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index fedfabfbc2c..b86b0d5fffa 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -394,6 +394,8 @@ UniqueThirdParties=Total de terceros únicos InActivity=Activo ActivityCeased=Cerrado ActivityStateFilter=Estado de actividad +ProductsIntoElements=Listado de productos en %s + # Monkey MonkeyNumRefModelDesc=Devuelve un número bajo el formato %syymm-nnnn para los códigos de clientes y %syymm-nnnn para los códigos de los proveedores, donde yy es el año, mm el mes y nnnn un contador secuencial sin ruptura y sin volver a 0. # Leopard diff --git a/htdocs/langs/es_ES/compta.lang b/htdocs/langs/es_ES/compta.lang index 2f72861a920..f2e86e42739 100644 --- a/htdocs/langs/es_ES/compta.lang +++ b/htdocs/langs/es_ES/compta.lang @@ -158,4 +158,10 @@ COMPTA_ACCOUNT_CUSTOMER=Código contable por defecto de clientes (si no está de COMPTA_ACCOUNT_SUPPLIER=Código contable por defecto de proveedores (si no está definido en la pestaña terceros) AddRemind=Desglosar importe disponible RemainToDivide=Resto a repartir : -WarningDepositsNotIncluded=Las facturas de anticipo aún no están incluidas en esta versión en el módulo de contabilidad. \ No newline at end of file +WarningDepositsNotIncluded=Las facturas de anticipo aún no están incluidas en esta versión en el módulo de contabilidad. +DatePaymentTermCantBeLowerThanObjectDate=La fecha límite de pago no puede ser inferior a la fecha del objeto +Pcg_version=Versión del plan +Pcg_type=Tipo de cuenta +Pcg_subtype=Subtipo de cuenta +InvoiceLinesToDispatch=Líneas de facturas a desglosar +InvoiceDispatched=Facturas desglosadas \ No newline at end of file diff --git a/htdocs/langs/es_ES/cron.lang b/htdocs/langs/es_ES/cron.lang new file mode 100644 index 00000000000..37710fdd67d --- /dev/null +++ b/htdocs/langs/es_ES/cron.lang @@ -0,0 +1,92 @@ +# Dolibarr language file - es_ES - cron +CHARSET=UTF-8 + +# +# Admin +# +CronSetup=Página de configuración del módulo - Gestión de tareas planificadas +URLToLaunchCronJobs=URL para lanzar las tareas automáticas +OrToLaunchASpecificJob=O para lanzar una tarea específica +KeyForCronAccess=Código de seguridad para la URL de lanzamiento de tareas automáticas +FileToLaunchCronJobs=Comando para lanzar las tareas automáticas +CronExplainHowToRunUnix=En un entorno Unix puede parametrizar CronTab para ejecutar este comando cada minuto +CronExplainHowToRunWin=En un entorno Microsoft(tm) Windows puede usar el planificador de tareas para lanzar este comando cada minuto +# +# Menu +# +CronListActive=Listado de tareas planificadas activas +CronListInactive= Listado de tareas planificadas inactivas + + +# +# Page list +# +CronDateLastRun=Último lanzamiento +CronLastOutput=Última salida +CronLastResult=Último código devuelto +CronCommand=Comando +CronList=Listado de tareas planificadas +CronDelete=Eliminar la tarea planificada +CronConfirmDelete=¿Está seguro de querer eliminar esta tarea planificada? +CronExecute=Ejecutar esta tarea +CronConfirmExecute=¿Está seguro de querer ejecutar ahora esta tarea? +CronInfo=Los trabajos permiten ejecutar las tareas a intervalos regulares +CronWaitingJobs=Sus trabajos en espera: +CronTask=Tarea +CronNone=Ninguno +CronDtStart=Fecha inicio +CronDtEnd=Fecha fin +CronDtNextLaunch=Próxima ejecución +CronDtLastLaunch=Última ejecución +CronFrequency=Frecuencia +CronClass=Clase +CronMethod=Método +CronModule=Módulo +CronAction=Acción +CronStatus=Estado +CronStatusActive=Activa +CronStatusInactive=Inactiva +CronEach=Cada +CronNoJobs=Sin trabajos actualmente +CronPriority=Prioridad +CronLabel=Descripción +CronNbRun=Nº ejec. +CronDtLastResult=Fecha del último resultado de la última ejecución + +# +#Page card +# +CronAdd=Añadir una tarea +CronHourStart=Dia y hora de inicio de la tarea +CronEvery=Ejecutar cada +CronObject=Instancia/Objeto a crear +CronArgs=Argumento +CronSaveSucess=Registro guardado +CronNote=Nota +CronFieldMandatory=El campo %s es obligatorio +CronErrEndDateStartDt=La fecha de fin no puede ser anterior a la de inicio +CronStatusActiveBtn=Activar +CronStatusInactiveBtn=Desactivar +CronTaskInactive=Esta tarea se encuentra desactivada +CronId=Id +CronClassFile=Clase (archivo) +CronModuleHelp=Nombre del directorio del módulo Dolibarr (funciona automáticamente con los módulos externos Dolibarr).
Por ejemplo para llamar al método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del módulo es product +CronClassFileHelp=El archivo archivo que contiene el objeto.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor de la clase es product.class.php +CronObjectHelp=El nombre del objeto a crear.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del objeto es Product +CronMethodHelp=El método a lanzar.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del método es fecth +CronArgsHelp=Los argumentos del método.
Por ejemplo para usar el método fetch del objeto Product deDolibarr /htdocs/product/class/product.class.php, el valor del parámetro podría ser 0, RefProduit +CronCommandHelp=El comando del sistema a ejecutar + +# +# Info +# +CronInfoPage=Información + +# +# Common +# +CronType=Tipo de acción a ejecutar +CronType_method=Método de una clase de un módulo Dolibarr +CronType_command=Comando Shell +CronMenu=Cron +CronCannotLoadClass=imposible cargar la clase %s o el objeto %s \ No newline at end of file diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index ec308d590d5..b7ba4d9c578 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -489,7 +489,7 @@ NbOfThirdParties=Número de terceros NbOfCustomers=Numero de clientes NbOfLines=Números de líneas NbOfObjects=Número de objetos -NbOfReferers=Número de referencias +NbOfReferers=Consumición Referers=Referencias TotalQuantity=Cantidad total DateFromTo=De %s a %s diff --git a/htdocs/langs/es_ES/sendings.lang b/htdocs/langs/es_ES/sendings.lang index 7efaabc81cd..99dda507fa8 100644 --- a/htdocs/langs/es_ES/sendings.lang +++ b/htdocs/langs/es_ES/sendings.lang @@ -59,6 +59,7 @@ LinkToTrackYourPackage=Enlace para el seguimento de su paquete ShipmentCreationIsDoneFromOrder=De momento, la creación de una nueva expedición se realiza desde la ficha de pedido. RelatedShippings=Expedición(es) asociada(s) ShipmentLine=Línea de expedición +CarrierList=Listado de transportistas # Sending methods SendingMethodCATCH=Recogido por el cliente From 9476a346b87f97f6765bea58b5273c6429f190c0 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 22 Mar 2013 18:23:43 +0100 Subject: [PATCH 092/150] Fix update run date --- htdocs/cron/class/cronjob.class.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b24055c6f3d..2fc051a5b82 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -862,8 +862,6 @@ class Cronjob extends CommonObject $error=0; $now=dol_now(); - $this->db->begin(); - if ($this->jobtype=='method') { // load classes $ret=dol_include_once("/".$this->module_name."/class/".$this->classesname,$this->objectname); @@ -885,6 +883,15 @@ class Cronjob extends CommonObject // Create Object for the call module $object = new $this->objectname($this->db); + //Update launch start date + $this->datelastrun=$now; + $this->nbrun=$this->nbrun+1; + $result = $this->update($user); + if ($result<0) { + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + $params_arr = array(); $params_arr=explode(", ",$this->params); if (!is_array($params_arr)) { @@ -905,6 +912,15 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::run_jobs system:".$this->command, LOG_DEBUG); $output_arr=array(); + //Update launch start date + $this->datelastrun=$now; + $this->nbrun=$this->nbrun+1; + $result = $this->update($user); + if ($result<0) { + dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); + return -1; + } + exec($this->command, $output_arr,$retval); dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG); @@ -918,16 +934,13 @@ class Cronjob extends CommonObject $this->lastresult=$retval; } + //Update result date $this->datelastresult=$now; - $this->datelastrun=$now; - $this->nbrun=$this->nbrun+1; $result = $this->update($user); if ($result<0) { dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); - $this->db->rollback(); return -1; }else { - $this->db->commit(); return 1; } From 34bfdb18466de4df7eb872a2f4d6ad7b820c2af5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 22 Mar 2013 19:21:46 +0100 Subject: [PATCH 093/150] Fix: broken feature if the table has no field fk_parent_line --- htdocs/core/class/commonobject.class.php | 25 +++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9058350747f..975765d12b4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1012,13 +1012,13 @@ abstract class CommonObject /** * Save a new position (field rang) for details lines. * You can choose to set position for lines with already a position or lines without any position defined. - * Call this function only for table that contains a field fk_parent_line. * - * @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines. - * @param string $rowidorder ASC or DESC + * @param boolean $renum true to renum all already ordered lines, false to renum only not already ordered lines. + * @param string $rowidorder ASC or DESC + * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_order($renum=false, $rowidorder='ASC') + function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true) { if (! $this->table_element_line) { @@ -1055,7 +1055,8 @@ abstract class CommonObject // We first search all lines that are parent lines (for multilevel details lines) $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.$this->table_element_line; $sql.= ' WHERE '.$this->fk_element.' = '.$this->id; - $sql.= ' AND fk_parent_line IS NULL'; + if ($fk_parent_line) + $sql.= ' AND fk_parent_line IS NULL'; $sql.= ' ORDER BY rang ASC, rowid '.$rowidorder; dol_syslog(get_class($this)."::line_order search all parent lines sql=".$sql, LOG_DEBUG); @@ -1130,12 +1131,13 @@ abstract class CommonObject /** * Update a line to have a lower rank * - * @param int $rowid Id of line + * @param int $rowid Id of line + * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_up($rowid) + function line_up($rowid, $fk_parent_line=true) { - $this->line_order(); + $this->line_order(false, 'ASC', $fk_parent_line); // Get rang of line $rang = $this->getRangOfLine($rowid); @@ -1147,12 +1149,13 @@ abstract class CommonObject /** * Update a line to have a higher rank * - * @param int $rowid Id of line + * @param int $rowid Id of line + * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - function line_down($rowid) + function line_down($rowid, $fk_parent_line=true) { - $this->line_order(); + $this->line_order(false, 'ASC', $fk_parent_line); // Get rang of line $rang = $this->getRangOfLine($rowid); From ea296d8429892dc67a733ba4fa3ede238441d1be Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 22 Mar 2013 19:24:26 +0100 Subject: [PATCH 094/150] fix error translation --- htdocs/langs/zh_CN/members.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/zh_CN/members.lang b/htdocs/langs/zh_CN/members.lang index e8ad2efad6f..a664e7290a2 100644 --- a/htdocs/langs/zh_CN/members.lang +++ b/htdocs/langs/zh_CN/members.lang @@ -157,7 +157,7 @@ ShowTypeCard=显示类型'%s' HTPasswordExport=htpassword文件生成 NoThirdPartyAssociatedToMember=无关联的第三方该会员 ThirdPartyDolibarr=Dolibarr第三者 -MembersAndSubscriptions=议员和Suscriptions +MembersAndSubscriptions=议员和Subscriptions // STOP - Lines generated via autotranslator.php tool (2010-06-08 21:22:55). From 7ce90c7bf194a4407a4c90011a9a7726074af074 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 23 Mar 2013 12:03:47 +0100 Subject: [PATCH 095/150] Fix : Main eMail configuration SMTP password as input type wasn't password (password display in clear...)! --- htdocs/admin/mails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index fa4aa52bfc8..f96528648af 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -434,7 +434,7 @@ if ($action == 'edit') // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) { - print ''; + print ''; } else { From 3af7ca5ac8722436db37b88e75b689aa617465c9 Mon Sep 17 00:00:00 2001 From: eldy Date: Sat, 23 Mar 2013 12:23:09 +0100 Subject: [PATCH 096/150] Work on revenue stamp feature. --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 975765d12b4..dcd96ed6734 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1509,6 +1509,9 @@ abstract class CommonObject $this->total_localtax2 += $obj->total_localtax2; $this->total_ttc += $obj->total_ttc; + // Add revenue stamp to total + $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0; + // Check if there is a global invoice tax for this vat rate // FIXME: We should have no database access into this function. Also localtax 7 seems to have problem so i add condition to avoid it into standard usage without loosing it. if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) From c8d6e9e44a37cc14143b40f661feff3306b3138e Mon Sep 17 00:00:00 2001 From: eldy Date: Sat, 23 Mar 2013 12:33:25 +0100 Subject: [PATCH 097/150] Fix: List of customers to build invoice or order --- htdocs/commande/fiche.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/contrat/fiche.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 52b7761adbe..bb9c9117f24 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1487,7 +1487,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G else { print '
'; - print $form->select_company('','socid','s.client = 1',1); + print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); print '
'; - print $form->select_company('','socid','s.client = 1',1); + print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); print '
'; - print $form->select_company('','socid','s.client = 1',1); + print $form->select_company('','socid','s.client = 1 OR s.client = 3',1); print '
'; print ''; @@ -3042,6 +3050,33 @@ else if ($id > 0 || ! empty($ref)) print ''; } + // Revenue stamp + if ($selleruserevenustamp) // Test company use revenue stamp + { + print ''; + } + + // Total with tax print ''; // Statut diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f3427ee5d4b..38995fdebb9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -75,6 +75,7 @@ class Facture extends CommonInvoice var $total_ht=0; var $total_tva=0; var $total_ttc=0; + var $revenuestamp; var $note; // deprecated var $note_private; var $note_public; @@ -795,7 +796,8 @@ class Facture extends CommonInvoice if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; - $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount,f.tva, f.localtax1, f.localtax2, f.total,f.total_ttc,f.remise_percent,f.remise_absolue,f.remise'; + $sql = 'SELECT f.rowid,f.facnumber,f.ref_client,f.ref_ext,f.ref_int,f.type,f.fk_soc,f.amount,f.tva, f.localtax1, f.localtax2, f.total, f.total_ttc, f.revenuestamp'; + $sql.= ', f.remise_percent, f.remise_absolue, f.remise'; $sql.= ', f.datef as df'; $sql.= ', f.date_lim_reglement as dlr'; $sql.= ', f.datec as datec'; @@ -841,6 +843,7 @@ class Facture extends CommonInvoice $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ttc = $obj->total_ttc; + $this->revenuestamp = $obj->revenuestamp; $this->paye = $obj->paye; $this->close_code = $obj->close_code; $this->close_note = $obj->close_note; @@ -1050,6 +1053,7 @@ class Facture extends CommonInvoice $sql.= " localtax2=".(isset($this->total_localtax2)?$this->total_localtax2:"null").","; $sql.= " total=".(isset($this->total_ht)?$this->total_ht:"null").","; $sql.= " total_ttc=".(isset($this->total_ttc)?$this->total_ttc:"null").","; + $sql.= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '')?$this->revenuestamp:"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; $sql.= " fk_user_author=".(isset($this->user_author)?$this->user_author:"null").","; $sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").","; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index dcd96ed6734..79a471a0251 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1509,9 +1509,6 @@ abstract class CommonObject $this->total_localtax2 += $obj->total_localtax2; $this->total_ttc += $obj->total_ttc; - // Add revenue stamp to total - $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0; - // Check if there is a global invoice tax for this vat rate // FIXME: We should have no database access into this function. Also localtax 7 seems to have problem so i add condition to avoid it into standard usage without loosing it. if (! empty($conf->global->MAIN_USE_LOCALTAX_TYPE_7)) @@ -1559,6 +1556,9 @@ abstract class CommonObject $i++; } + // Add revenue stamp to total + $this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0; + $this->db->free($resql); // Now update global field total_ht, total_ttc and tva diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 785f131b61b..1ce21c7a8f6 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -390,6 +390,7 @@ AllCompletelyPayedInvoiceWillBeClosed=All invoice with no remain to pay will be ToMakePayment=Pay ToMakePaymentBack=Pay back ListOfYourUnpaidInvoices=List of unpaid invoices +RevenueStamp=Revenue stamp ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Representative following-up customer invoice TypeContact_facture_external_BILLING=Customer invoice contact diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 51424be1cbf..e5955167dd8 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -387,6 +387,7 @@ AllCompletelyPayedInvoiceWillBeClosed=Toutes les factures avec un reste à payer ToMakePayment=Payer ToMakePaymentBack=Rembourser ListOfYourUnpaidInvoices=Liste des factures impayées +RevenueStamp=Timbre fiscal ##### Types de contacts ##### TypeContact_facture_internal_SALESREPFOLL=Responsable suivi facture client TypeContact_facture_external_BILLING=Contact client facturation From 8971e6fe15db3907195ccf684800531c04ed929a Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 23 Mar 2013 14:39:23 +0100 Subject: [PATCH 099/150] [ task #710 ] Envoi de mail --- htdocs/comm/propal.php | 26 +++++++++++- htdocs/commande/fiche.php | 22 +++++++++- htdocs/compta/facture.php | 25 +++++++++++ htdocs/core/class/html.formmail.class.php | 2 +- htdocs/expedition/fiche.php | 40 +++++++++++++++-- htdocs/fichinter/fiche.php | 34 ++++++++++++--- htdocs/fourn/commande/fiche.php | 52 ++++++++++++++++------- htdocs/fourn/facture/fiche.php | 34 ++++++++++++--- htdocs/langs/bg_BG/other.lang | 16 +++---- htdocs/langs/ca_ES/other.lang | 16 +++---- htdocs/langs/da_DK/other.lang | 18 ++++---- htdocs/langs/de_AT/other.lang | 16 +++---- htdocs/langs/de_DE/other.lang | 16 +++---- htdocs/langs/el_GR/other.lang | 16 +++---- htdocs/langs/en_IN/other.lang | 2 +- htdocs/langs/en_US/other.lang | 16 +++---- htdocs/langs/es_ES/other.lang | 16 +++---- htdocs/langs/et_EE/other.lang | 16 +++---- htdocs/langs/fi_FI/other.lang | 16 +++---- htdocs/langs/fr_FR/other.lang | 16 +++---- htdocs/langs/hu_HU/other.lang | 16 +++---- htdocs/langs/is_IS/other.lang | 16 +++---- htdocs/langs/it_IT/other.lang | 16 +++---- htdocs/langs/nb_NO/other.lang | 16 +++---- htdocs/langs/nl_NL/other.lang | 16 +++---- htdocs/langs/pl_PL/other.lang | 16 +++---- htdocs/langs/pt_BR/other.lang | 8 ++-- htdocs/langs/pt_PT/other.lang | 16 +++---- htdocs/langs/ro_RO/other.lang | 16 +++---- htdocs/langs/ru_RU/other.lang | 16 +++---- htdocs/langs/ru_UA/other.lang | 16 +++---- htdocs/langs/sl_SI/other.lang | 16 +++---- htdocs/langs/sv_SE/other.lang | 16 +++---- htdocs/langs/tr_TR/other.lang | 16 +++---- 34 files changed, 400 insertions(+), 231 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index b74ebd11938..de1a87ffe7e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -526,7 +526,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Envoi de la propal require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); @@ -2238,12 +2238,34 @@ else $formmail->substit['__PROPREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) { + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='propal_send'; $formmail->param['id']=$object->id; $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - + + // Init list of files if (GETPOST("mode")=='init') { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 52b7761adbe..477fb64d896 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1212,7 +1212,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Send mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) { $mesg='
'.$mailfile->error.'
'; @@ -2442,6 +2442,26 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $formmail->substit['__ORDERREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_commande_external_CUSTOMER')) { + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='order_send'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 96fca70af4c..cdfe2a1f211 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3531,6 +3531,31 @@ else if ($id > 0 || ! empty($ref)) $formmail->substit['__FACREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) { + + require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; + + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + + // Tableau des parametres complementaires du post $formmail->param['action']=$action; $formmail->param['models']=$modelmail; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 37ad8a6384c..f00843f9af1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -596,7 +596,7 @@ class FormMail if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $this->withfckeditor=1; } - $doleditor=new DolEditor('message',$defaultmessage,'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72); + $doleditor=new DolEditor('message',nl2br($defaultmessage),'',280,$this->ckeditortoolbar,'In',true,true,$this->withfckeditor,8,72); $out.= $doleditor->Create(1); } $out.= "\n"; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index bcb55bb3ef8..d58b6d60f4f 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -412,7 +412,7 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile' $from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>'; $replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>'; - $message = GETPOST('message','alpha'); + $message = GETPOST('message'); $sendtocc = GETPOST('sendtocc','alpha'); $deliveryreceipt = GETPOST('deliveryreceipt','alpha'); @@ -442,7 +442,7 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile' // Send mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) { $mesg='
'.$mailfile->error.'
'; @@ -1293,7 +1293,7 @@ else * Boutons actions */ - if ($user->societe_id == 0) + if (($user->societe_id == 0) && ($action!='presend')) { print '
'; @@ -1457,6 +1457,40 @@ else $formmail->substit['__SHIPPINGREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + //Find the good contact adress + if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { + $objectsrc=new Commande($db); + $objectsrc->fetch($object->$typeobject->id); + } + if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { + $objectsrc=new Propal($db); + $objectsrc->fetch($object->$typeobject->id); + } + $custcontact=''; + $contactarr=array(); + $contactarr=$objectsrc->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + + if ($contact['libelle']==$langs->trans('TypeContact_commande_external_CUSTOMER')) { + + require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; + + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='shipping_send'; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index b67c2a0df16..f7371f42066 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -662,7 +662,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA $from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>'; $replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>'; - $message = GETPOST('message','alpha'); + $message = GETPOST('message'); $sendtocc = GETPOST('sendtocc','alpha'); $deliveryreceipt = GETPOST('deliveryreceipt','alpha'); @@ -692,7 +692,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA // Envoi de la propal require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) { $mesg='
'.$mailfile->error.'
'; @@ -702,8 +702,8 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA $result=$mailfile->sendfile(); if ($result) { - $mesg='
'.$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)).'.
'; - + $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); + setEventMessage($mesg); $error=0; // Initialisation donnees @@ -729,7 +729,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA { // Redirect here // This avoid sending mail twice if going out and then back to page - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&msg='.urlencode($mesg)); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } } @@ -1365,7 +1365,7 @@ else if ($id > 0 || ! empty($ref)) if ($user->societe_id == 0) { - if ($action != 'editdescription') + if ($action != 'editdescription' && ($action != 'presend')) { // Validate if ($object->statut == 0 && $user->rights->ficheinter->creer && count($object->lines) > 0) @@ -1518,6 +1518,28 @@ else if ($id > 0 || ! empty($ref)) $formmail->substit['__FICHINTERREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_fichinter_external_CUSTOMER')) { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='fichinter_send'; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 4baa7ac50f5..6a369873755 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -746,24 +746,24 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // if (is_readable($file)) // { - if ($_POST['sendto']) + if (GETPOST('sendto','alpha')) { // Le destinataire a ete fourni via le champ libre - $sendto = $_POST['sendto']; + $sendto = GETPOST('sendto','alpha'); $sendtoid = 0; } - elseif ($_POST['receiver'] != '-1') + elseif (GETPOST('receiver','alpha') != '-1') { // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party + if (GETPOST('receiver','alpha') == 'thirdparty') // Id of third party { $sendto = $object->client->email; $sendtoid = 0; } else // Id du contact { - $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); - $sendtoid = $_POST['receiver']; + $sendto = $object->client->contact_get_property(GETPOST('receiver','alpha'),'email'); + $sendtoid = GETPOST('receiver','alpha'); } } @@ -771,15 +771,15 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G { $langs->load("commercial"); - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; - $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; - $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $deliveryreceipt = $_POST['deliveryreceipt']; + $from = GETPOST('fromname','alpha') . ' <' . GETPOST('frommail','alpha') .'>'; + $replyto = GETPOST('replytoname','alpha'). ' <' . GETPOST('replytomail','alpha').'>'; + $message = GETPOST('message'); + $sendtocc = GETPOST('sendtocc','alpha'); + $deliveryreceipt = GETPOST('deliveryreceipt','alpha'); if ($action == 'send') { - if (dol_strlen($_POST['subject'])) $subject=$_POST['subject']; + if (dol_strlen(GETPOST('subject'))) $subject=GETPOST('subject'); else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref; $actiontypecode='AC_SUP_ORD'; $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; @@ -803,7 +803,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Send mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) { setEventMessage($mailfile->error, 'errors'); @@ -840,8 +840,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G else { // Redirect here - // This avoid sending mail twice if going out and then back to page - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&mesg='.urlencode($mesg)); + // This avoid sending mail twice if going out and then back to page + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } } @@ -1908,6 +1908,28 @@ elseif (! empty($object->id)) $formmail->substit['__ORDERREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_order_supplier_external_BILLING')) { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='order_supplier_send'; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 571742a977d..b726d39231a 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -737,10 +737,10 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P // Send mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); if ($mailfile->error) { - $mesg='
'.$mailfile->error.'
'; + setEventMessage($mailfile->error,'errors'); } else { @@ -748,7 +748,8 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P if ($result) { $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain " - + setEventMessage($mesg); + $error=0; // Initialisation donnees @@ -776,7 +777,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P { // Redirect here // This avoid sending mail twice if going out and then back to page - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&mesg='.urlencode($mesg)); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } } @@ -1241,6 +1242,7 @@ else $productstatic = new Product($db); $object->fetch($id); + $object->fetch_thirdparty(); $societe = new Fournisseur($db); $societe->fetch($object->socid); @@ -2034,7 +2036,7 @@ else * Show mail form */ if ($action == 'presend') - { + { $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/')); @@ -2089,6 +2091,28 @@ else $formmail->substit['__FACREF__']=$object->ref; $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + + //Find the good contact adress + $custcontact=''; + $contactarr=array(); + $contactarr=$object->liste_contact(-1,'external'); + + if (is_array($contactarr) && count($contactarr)>0) { + foreach($contactarr as $contact) { + if ($contact['libelle']==$langs->trans('TypeContact_invoice_supplier_external_BILLING')) { + require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; + $contactstatic=new Contact($db); + $contactstatic->fetch($contact['id']); + $custcontact=$contactstatic->getFullName($langs,1); + } + } + + if (!empty($custcontact)) { + $formmail->substit['__CONTACTCIVNAME__']=$custcontact; + } + } + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='invoice_supplier_send'; diff --git a/htdocs/langs/bg_BG/other.lang b/htdocs/langs/bg_BG/other.lang index a534bbc1218..a38a46300a2 100644 --- a/htdocs/langs/bg_BG/other.lang +++ b/htdocs/langs/bg_BG/other.lang @@ -56,14 +56,14 @@ Miscellanous=Разни NbOfActiveNotifications=Броят на нотификациите PredefinedMailTest=Това е тест поща. \ NПромените две линии са разделени с нов ред. \n\n __ SIGNATURE__ PredefinedMailTestHtml=Това е тест поща (тест дума трябва да бъде с удебелен шрифт).
Двете линии са разделени от връщане на каретката.

__SIGNATURE__ -PredefinedMailContentSendInvoice=Тук ще намерите фактура __ FACREF__ \n\n от __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Бихме искали да ви предупредя, че фактурата FACREF__ __ изглежда не се заплащат. Така че това е фактурата в прикачения файл отново, за напомняне. \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendProposal=Тук ще намерите търговския propoal __ PROPREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendOrder=Тук ще намерите за __ ORDERREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Тук ще намерите нашата цел __ ORDERREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Тук ще намерите фактура __ FACREF__ \n\n от __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendShipping=Тук ще намерите корабоплаването __ SHIPPINGREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ -PredefinedMailContentSendFichInter=Тук ще намерите намесата __ FICHINTERREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Тук ще намерите фактура __ FACREF__ \n\n от __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Бихме искали да ви предупредя, че фактурата FACREF__ __ изглежда не се заплащат. Така че това е фактурата в прикачения файл отново, за напомняне. \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Тук ще намерите търговския propoal __ PROPREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Тук ще намерите за __ ORDERREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Тук ще намерите нашата цел __ ORDERREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Тук ще намерите фактура __ FACREF__ \n\n от __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Тук ще намерите корабоплаването __ SHIPPINGREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Тук ще намерите намесата __ FICHINTERREF__ \n\n __ PERSONALIZED__Sincerely \n\n __ SIGNATURE__ DemoDesc=Dolibarr е компактен ERP / CRM състои от няколко функционални модули. Демо, което включва всички модули не означава нищо, тъй като това никога не се случва. Така че, няколко демо профили са на разположение. ChooseYourDemoProfil=Изберете профила демо, които съответстват на вашата дейност ... DemoFundation=Управление на членовете на фондация diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang index 2be64f5bf8d..04e0a957cf6 100644 --- a/htdocs/langs/ca_ES/other.lang +++ b/htdocs/langs/ca_ES/other.lang @@ -48,14 +48,14 @@ Miscellanous=Diversos NbOfActiveNotifications=Número notificacions PredefinedMailTest=Això és un correu de prova.\nLes 2 línies estan separades per un retorn de carro a la línia. PredefinedMailTestHtml=Això és un e-mail de prova (la paraula prova ha d'estar en negreta).
Les 2 línies estan separades per un retorn de carro en la línia -PredefinedMailContentSendInvoice=Us adjuntem la factura __FACREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Posem en el seu coneixement que la factura __FACREF__ sembla no estar pagada. Se l'adjuntem doncs, perquè pugui revisar-la.\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Us adjuntem el pressupost __PROPREF__ \n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Us adjuntem la comanda __ORDERREF__ \n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Us adjuntem la nostra comanda __ORDERREF__ \n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Us adjuntem la factura __FACREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Us adjuntem l'expedició __SHIPPINGREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Us adjuntem l'intervenció __FICHINTERREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Us adjuntem la factura __FACREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Posem en el seu coneixement que la factura __FACREF__ sembla no estar pagada. Se l'adjuntem doncs, perquè pugui revisar-la.\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Us adjuntem el pressupost __PROPREF__ \n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Us adjuntem la comanda __ORDERREF__ \n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Us adjuntem la nostra comanda __ORDERREF__ \n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Us adjuntem la factura __FACREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Us adjuntem l'expedició __SHIPPINGREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Us adjuntem l'intervenció __FICHINTERREF__\n\n__PERSONALIZED__Cordialment\n\n__SIGNATURE__ DemoDesc=Dolibarr és un programari per a la gestió de negocis (professionals o associacions), compost de mòduls funcionals independents i opcionals. Una demostració que inclogui tots aquests mòduls no té sentit perquè no utilitzarà tots els mòduls. A més, té disponibles diversos tipus de perfils de demostració. ChooseYourDemoProfil=Seleccioneu el perfil de demostració que millor correspongui a la seva activitat ... DemoFundation=Gestió de membres d'una associació diff --git a/htdocs/langs/da_DK/other.lang b/htdocs/langs/da_DK/other.lang index 63924c7af90..5aee3d71a07 100644 --- a/htdocs/langs/da_DK/other.lang +++ b/htdocs/langs/da_DK/other.lang @@ -175,7 +175,7 @@ ExternalSites=Eksterne sites // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> da_DA -PredefinedMailContentSendSupplierOrder=Du vil her finde vores ordre __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Du vil her finde vores ordre __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n WeightUnitpound=pund VolumeUnitounce=unse VolumeUnitlitre=liter @@ -212,9 +212,9 @@ Notify_MEMBER_VALIDATE=Medlem valideret Notify_MEMBER_SUBSCRIPTION=Medlem abonnerer Notify_MEMBER_RESILIATE=Medlem resiliated Notify_MEMBER_DELETE=Medlem slettet -PredefinedMailContentSendSupplierInvoice=Du vil her finde fakturaen __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n -PredefinedMailContentSendShipping=Du vil her finde shipping __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n -PredefinedMailContentSendFichInter=Du vil her finde interventionen __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Du vil her finde fakturaen __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Du vil her finde shipping __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Du vil her finde interventionen __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n Top=Top Bottom=Bund Left=Venstre @@ -234,9 +234,9 @@ Export=Eksport // START - Lines generated via autotranslator.php tool (2012-02-29 15:59:19). // Reference language: en_US -> da_DK -PredefinedMailContentSendInvoice=Du vil her finde fakturaen __FACREF__ \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Vi vil gerne advare dig om, at fakturaen __FACREF__ synes ikke betales. Så dette er den faktura i vedhæftningen igen, som en påmindelse. \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Du vil her finde den kommercielle propoal __PROPREF__ \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Du vil her finde den rækkefølge __ORDERREF__ \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ -ShipmentValidatedInDolibarr=Forsendelse %s valideret i Dolibarr +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Du vil her finde fakturaen __FACREF__ \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Vi vil gerne advare dig om, at fakturaen __FACREF__ synes ikke betales. Så dette er den faktura i vedhæftningen igen, som en påmindelse. \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Du vil her finde den kommercielle propoal __PROPREF__ \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Du vil her finde den rækkefølge __ORDERREF__ \n\n__PERSONALIZED__ venlig hilsen \n\n__SIGNATURE__ +ShipmentValidatedInDolibarr=__CONTACTCIVNAME__ \n\n Forsendelse %s valideret i Dolibarr // STOP - Lines generated via autotranslator.php tool (2012-02-29 15:59:21). diff --git a/htdocs/langs/de_AT/other.lang b/htdocs/langs/de_AT/other.lang index 3629e008956..ff3481857d3 100644 --- a/htdocs/langs/de_AT/other.lang +++ b/htdocs/langs/de_AT/other.lang @@ -22,10 +22,10 @@ AttachANewFile=Neue Datei/Dokument anhängen LinkedObject=Verknüpftes Objekt Miscellanous=Verschiedenes NbOfActiveNotifications=Anzahl aktiver Benachrichtigungen -PredefinedMailContentSendInvoice=Bitte entnehmen Sie dem Anhang die Rechnung __FACREF__\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Bedauerlicherweise scheint die Rechnung __FACREF__ bislang unbeglichen. Als Erinnerung übersenden wir Ihnen diese nochmals im Anhang\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Bitte entnehmen Sie dem Anhang unser Angebot __PROPREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Bitte entnehmen Sie dem Anhang die Bestellung __ORDERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang die Rechnung __FACREF__\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Bedauerlicherweise scheint die Rechnung __FACREF__ bislang unbeglichen. Als Erinnerung übersenden wir Ihnen diese nochmals im Anhang\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang unser Angebot __PROPREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang die Bestellung __ORDERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ ChooseYourDemoProfil=Bitte wählen Sie das Demo-Profil das Ihrem Berufsfeld am ehesten entspricht DemoFundation=Verwalten Sie die Mitglieder einer Stiftung DemoFundation2=Verwalten Sie die Mitglieder und Bankkonten einer Stiftung @@ -156,7 +156,7 @@ YouReceiveMailBecauseOfNotification=Sie erhalten diese Nachricht, weil Ihre E-Ma YouReceiveMailBecauseOfNotification2=Sie erhalten dieses Mail aufgrund folgender Benachrichtigung: ExternalSites=Externe Seiten -PredefinedMailContentSendSupplierOrder=Hier finden Sie unser Bestellformular __ORDERREF__ \n\nMit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Hier finden Sie unser Bestellformular __ORDERREF__ \n\nMit freundlichen Grüßen\n\n__SIGNATURE__ WeightUnitpound=Pfund VolumeUnitounce=Unze VolumeUnitlitre=Liter @@ -191,9 +191,9 @@ Notify_MEMBER_VALIDATE=Mitglied validiert Notify_MEMBER_SUBSCRIPTION=Mitglied gezeichneten Notify_MEMBER_RESILIATE=Mitglied resiliated Notify_MEMBER_DELETE=Mitglied gelöscht -PredefinedMailContentSendSupplierInvoice=Hier finden Sie die Rechnung __FACREF__ \n\nSincerely \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Hier finden Sie die Versandkosten __SHIPPINGREF__ \n\nSincerely \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Hier finden Sie die Intervention __FICHINTERREF__ \n\nSincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Hier finden Sie die Rechnung __FACREF__ \n\nSincerely \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Hier finden Sie die Versandkosten __SHIPPINGREF__ \n\nSincerely \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Hier finden Sie die Intervention __FICHINTERREF__ \n\nSincerely \n\n__SIGNATURE__ Top=Top Bottom=Boden Left=Links diff --git a/htdocs/langs/de_DE/other.lang b/htdocs/langs/de_DE/other.lang index 01ddd534a0c..a8a8e18ae63 100644 --- a/htdocs/langs/de_DE/other.lang +++ b/htdocs/langs/de_DE/other.lang @@ -55,14 +55,14 @@ Miscellanous=Verschiedenes NbOfActiveNotifications=Anzahl aktiver Benachrichtigungen PredefinedMailTest=Dies ist ein Test-Mail.\n Die beiden Zeilen sind durch eine Zeilenschaltung getrennt. PredefinedMailTestHtml=Dies ist ein (HTML)-Test Mail (das Wort Test muss in Fettschrift erscheinen).
Die beiden Zeilen sollteb durch eine Zeilenschaltung getrennt sein. -PredefinedMailContentSendInvoice=Bitte entnehmen Sie dem Anhang die Rechnung __FACREF__\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Bedauerlicherweise scheint die Rechnung __FACREF__ bislang unbeglichen. Als Erinnerung übersenden wir Ihnen diese nochmals im Anhang\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Bitte entnehmen Sie dem Anhang unser Angebot __PROPREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Bitte entnehmen Sie dem Anhang die Bestellung __ORDERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Hier finden Sie unser Bestellformular __ORDERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Anbei erhalten Sie die Rechnung __ FACREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Als Anlage erhalten Sie unsere Versandkosten __ SHIPPINGREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Anbei finden Sie die Intervention __ FICHINTERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n_n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang die Rechnung __FACREF__\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Bedauerlicherweise scheint die Rechnung __FACREF__ bislang unbeglichen. Als Erinnerung übersenden wir Ihnen diese nochmals im Anhang\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang unser Angebot __PROPREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang die Bestellung __ORDERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Hier finden Sie unser Bestellformular __ORDERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Anbei erhalten Sie die Rechnung __ FACREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Als Anlage erhalten Sie unsere Versandkosten __ SHIPPINGREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Anbei finden Sie die Intervention __ FICHINTERREF__ \n\n__PERSONALIZED__Mit freundlichen Grüßen\n_n__SIGNATURE__ DemoDesc=Bei Dolibarr handelt es sich um ein kompaktes ERP/CRM-System, bestehend aus einzelnen Modulen. Da eine Demo aller Module kaum eine praxisnahe Anwendung darstellt, stehen Ihnen unterschiedliche Demo-Profile zur Verfügung. ChooseYourDemoProfil=Bitte wählen Sie das Demo-Profil das Ihrem Berufsfeld am ehesten entspricht DemoFundation=Verwalten Sie die Mitglieder einer Stiftung diff --git a/htdocs/langs/el_GR/other.lang b/htdocs/langs/el_GR/other.lang index 8981b6bccb7..2e2671f60a5 100644 --- a/htdocs/langs/el_GR/other.lang +++ b/htdocs/langs/el_GR/other.lang @@ -115,7 +115,7 @@ FONTFORPDF=Freemono // START - Lines generated via autotranslator.php tool (2011-06-26 15:35:22). // Reference language: en_US -> el_GR ToolsDesc=Αυτή η περιοχή είναι αφιερωμένη στην ομάδα διάφορα εργαλεία που είναι διαθέσιμα δεν σε άλλες καταχωρήσεις μενού.

Αυτά τα εργαλεία είναι προσβάσιμα από το μενού στο πλάι. -PredefinedMailContentSendShipping=Θα βρείτε εδώ τη ναυτιλία __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Θα βρείτε εδώ τη ναυτιλία __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ Top=Κορυφή Bottom=Κάτω μέρος Left=Αριστερά @@ -187,13 +187,13 @@ Notify_MEMBER_VALIDATE=Επικυρωθεί μέλη Notify_MEMBER_SUBSCRIPTION=Εγγραφεί μέλος Notify_MEMBER_RESILIATE=Resiliated μέλη Notify_MEMBER_DELETE=Διαγράφεται μέλη -PredefinedMailContentSendInvoice=Εδώ θα βρείτε το τιμολόγιο __ FACREF__ \n\n __PERSONALIZED__Ειλικρινά \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Θα θέλαμε να σας προειδοποιήσω ότι το τιμολόγιο FACREF__ __ φαίνεται να μη πληρώνονται. Έτσι, αυτό είναι το τιμολόγιο στο συνημμένο και πάλι, ως υπενθύμιση. Ειλικρινά \n\n__PERSONALIZED__ \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Εδώ θα βρείτε την εμπορική propoal __ PROPREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Εδώ θα βρείτε τη σειρά __ ORDERREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Εδώ θα βρείτε για μας __ ORDERREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Εδώ θα βρείτε το τιμολόγιο __ FACREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Θα βρείτε εδώ την παρέμβαση __ FICHINTERREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Εδώ θα βρείτε το τιμολόγιο __ FACREF__ \n\n __PERSONALIZED__Ειλικρινά \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Θα θέλαμε να σας προειδοποιήσω ότι το τιμολόγιο FACREF__ __ φαίνεται να μη πληρώνονται. Έτσι, αυτό είναι το τιμολόγιο στο συνημμένο και πάλι, ως υπενθύμιση. Ειλικρινά \n\n__PERSONALIZED__ \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Εδώ θα βρείτε την εμπορική propoal __ PROPREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Εδώ θα βρείτε τη σειρά __ ORDERREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Εδώ θα βρείτε για μας __ ORDERREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Εδώ θα βρείτε το τιμολόγιο __ FACREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Θα βρείτε εδώ την παρέμβαση __ FICHINTERREF__ \n\n__PERSONALIZED__ Ειλικρινά \n\n__SIGNATURE__ DemoDesc=Dolibarr είναι ένα συμπαγές ERP / CRM αποτελείται από διάφορες λειτουργικές ενότητες. Ένα demo που περιλαμβάνει όλες τις ενότητες δεν σημαίνει τίποτα, όπως ποτέ δεν συμβαίνει αυτό. Έτσι, πολλά προφίλ επίδειξη είναι διαθέσιμα. ChooseYourDemoProfil=Επιλέξτε το προφίλ που ταιριάζει με επίδειξη δραστηριότητά σας ... DemoFundation=Διαχειριστείτε τα μέλη του ιδρύματος diff --git a/htdocs/langs/en_IN/other.lang b/htdocs/langs/en_IN/other.lang index 3b944fa7e92..2b3fffed18d 100644 --- a/htdocs/langs/en_IN/other.lang +++ b/htdocs/langs/en_IN/other.lang @@ -1,3 +1,3 @@ # Dolibarr language file - en_US - other CHARSET=UTF-8 -PredefinedMailContentSendProposal=You will find here the quotation __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n You will find here the quotation __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 6a46d319b15..bcba133ba6d 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -49,14 +49,14 @@ Miscellanous=Miscellaneous NbOfActiveNotifications=Number of notifications PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__ PredefinedMailTestHtml=This is a test mail (the word test must be in bold).
The two lines are separated by a carriage return.

__SIGNATURE__ -PredefinedMailContentSendInvoice=You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=We would like to warn you that the invoice __FACREF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=You will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=You will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=You will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=You will find here the shipping __SHIPPINGREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=You will find here the intervention __FICHINTERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n We would like to warn you that the invoice __FACREF__ seems to not being payed. So this is the invoice in attachment again, as a reminder.\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n You will find here the commercial proposal __PROPREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n You will find here the order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n You will find here our order __ORDERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n You will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n You will find here the shipping __SHIPPINGREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n You will find here the intervention __FICHINTERREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ DemoDesc=Dolibarr is a compact ERP/CRM composed by several functional modules. A demo that includes all modules does not mean anything as this never occurs. So, several demo profiles are available. ChooseYourDemoProfil=Choose the demo profile that match your activity... DemoFundation=Manage members of a foundation diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index 7ef141abbd0..f86e7e74799 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -48,14 +48,14 @@ Miscellanous=Miscelánea NbOfActiveNotifications=Número notificaciones PredefinedMailTest=Esto es un correo de prueba.\nLas 2 líneas están separadas por un retorno de carro a la línea. PredefinedMailTestHtml=Esto es un e-mail de prueba(la palabra prueba debe de estar en negrita).
Las 2 líneas están separadas por un retorno de carro en la línea -PredefinedMailContentSendInvoice=Le adjuntamos la factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Ponemos en su conocimiento que la factura __FACREF__ parece no estar pagada. Se la adjuntamos pues, para que pueda revisarla.\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Le adjuntamos el presupuesto __PROPREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Le adjuntamos el pedido __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Le adjuntamos nuestro pedido __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Le adjuntamos la factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Le adjuntamos la expedición __SHIPPINGREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Le adjuntamos la intervención __FICHINTERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Le adjuntamos la factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Ponemos en su conocimiento que la factura __FACREF__ parece no estar pagada. Se la adjuntamos pues, para que pueda revisarla.\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Le adjuntamos el presupuesto __PROPREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Le adjuntamos el pedido __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Le adjuntamos nuestro pedido __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Le adjuntamos la factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Le adjuntamos la expedición __SHIPPINGREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Le adjuntamos la intervención __FICHINTERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ DemoDesc=Dolibarr es un software para la gestión de negocios (profesionales o asociaciones), compuesto de módulos funcionales independientes y opcionales. Una demostración que incluya todos estos módulos no tiene sentido porque no utilizará todos los módulos. Además, tiene disponibles varios tipos de perfiles de demostración. ChooseYourDemoProfil=Seleccione el perfil de demostración que mejor corresponda a su actividad... DemoFundation=Gestión de miembros de una asociación diff --git a/htdocs/langs/et_EE/other.lang b/htdocs/langs/et_EE/other.lang index 6a9fd740187..05f03c45749 100644 --- a/htdocs/langs/et_EE/other.lang +++ b/htdocs/langs/et_EE/other.lang @@ -56,14 +56,14 @@ Miscellanous=Muu NbOfActiveNotifications=Teadete arv PredefinedMailTest=See on test mail. \ NThe kaks rida on eraldatud kelgutagastusmärgid. PredefinedMailTestHtml=See on test post (sõna test peab olema paksus kirjas).
2 rida on eraldatud kelgutagastusmärgid. -PredefinedMailContentSendInvoice=Leiad siin arve __FACREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Soovime teid hoiatama, et arve __FACREF__ tundub ei payed. Nii et see on arve arestimine jälle, nagu meeldetuletus. \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Leiad siin kaubandusliku propoal __PROPREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Leiad siin, et __ORDERREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Leiad siin meie, et __ORDERREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Leiad siin arve __FACREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Leiad siin shipping __SHIPPINGREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Leiad siin sekkumine __FICHINTERREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Leiad siin arve __FACREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Soovime teid hoiatama, et arve __FACREF__ tundub ei payed. Nii et see on arve arestimine jälle, nagu meeldetuletus. \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Leiad siin kaubandusliku propoal __PROPREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Leiad siin, et __ORDERREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Leiad siin meie, et __ORDERREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Leiad siin arve __FACREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Leiad siin shipping __SHIPPINGREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Leiad siin sekkumine __FICHINTERREF__ \n\n Lugupidamisega \n\n__SIGNATURE__ DemoDesc=Dolibarr on kompaktne ERP / CRM koosseisus mitmed funktsionaalseid mooduleid. Demo, mis hõlmab kõiki mooduleid ei tähenda midagi, kui see kunagi juhtub. Niisiis, mitu demo profiilid on saadaval. ChooseYourDemoProfil=Vali demo profiili, mis vastavad teie tegevus ... DemoFundation=Halda liikmeid sihtasutus diff --git a/htdocs/langs/fi_FI/other.lang b/htdocs/langs/fi_FI/other.lang index dd4dec72aac..9f0e94160b8 100644 --- a/htdocs/langs/fi_FI/other.lang +++ b/htdocs/langs/fi_FI/other.lang @@ -173,7 +173,7 @@ ExternalSites=Ulkoiset sivustot // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> fi_FI -PredefinedMailContentSendSupplierOrder=Löydät tästä meidän järjestys __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Löydät tästä meidän järjestys __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=punta VolumeUnitounce=unssi VolumeUnitlitre=litra @@ -224,13 +224,13 @@ Notify_BILL_SENTBYMAIL=Asiakkaan lasku lähetetään postitse Notify_MEMBER_SUBSCRIPTION=Jäsen merkitty Notify_MEMBER_RESILIATE=Jäsen resiliated Notify_MEMBER_DELETE=Jäsen poistettu -PredefinedMailContentSendInvoice=Löydät täältä laskun __ FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Haluamme varoittaa, että lasku __ FACREF__ näyttää ei maksanut. Joten tämä on laskun liitetiedostona uudelleen, kuten muistutuksen. \n\n__PERSONALIZED__ Vilpittömästi \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Löydät täältä kaupallinen propoal __ PROPREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Löydät täältä järjestyksessä __ ORDERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Löydät täältä laskun __ FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Löydät täältä merenkulku __ SHIPPINGREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Löydät täältä intervention __ FICHINTERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Löydät täältä laskun __ FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Haluamme varoittaa, että lasku __ FACREF__ näyttää ei maksanut. Joten tämä on laskun liitetiedostona uudelleen, kuten muistutuksen. \n\n__PERSONALIZED__ Vilpittömästi \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Löydät täältä kaupallinen propoal __ PROPREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Löydät täältä järjestyksessä __ ORDERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Löydät täältä laskun __ FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Löydät täältä merenkulku __ SHIPPINGREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Löydät täältä intervention __ FICHINTERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ StartUpload=Aloita lataaminen CancelUpload=Peruuta Lähetä FileIsTooBig=Files on liian suuri diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index ed49d874b11..9076dff82ba 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -48,14 +48,14 @@ Miscellanous=Divers NbOfActiveNotifications=Nombre de notifications PredefinedMailTest=Ceci est un mail de test.\nLes 2 lignes sont séparées par un retour à la ligne.\n\n__SIGNATURE__ PredefinedMailTestHtml=Ceci est un mail de test (le mot test doit être en gras).
Les 2 lignes sont séparées par un retour à la ligne.

__SIGNATURE__ -PredefinedMailContentSendInvoice=Veuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Nous apportons à votre connaissance que la facture __FACREF__ ne semble pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Veuillez trouver ci-joint la proposition commerciale __PROPREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Veuillez trouver ci-joint la commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Veuillez trouver ci-joint notre commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Veuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Veuillez trouver ci-joint le bon d'expédition __SHIPPINGREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Veuillez trouver ci-joint la fiche d'intervention __FICHINTERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Nous apportons à votre connaissance que la facture __FACREF__ ne semble pas avoir été réglée. La voici donc, pour rappel, en pièce jointe.\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la proposition commerciale __PROPREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint notre commande __ORDERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la facture __FACREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint le bon d'expédition __SHIPPINGREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Veuillez trouver ci-joint la fiche d'intervention __FICHINTERREF__\n\n__PERSONALIZED__Cordialement\n\n__SIGNATURE__ DemoDesc=Dolibarr est un logiciel de gestion d'activité (professionnelle ou associative) composé de modules fonctionnels indépendants et optionnels. Une démonstration qui inclut tous ces modules n'a pas de sens car les modules ne sont jamais tous utilisés en même temps. Aussi, plusieurs profils type de démo sont disponibles. ChooseYourDemoProfil=Veuillez choisir le profil de démo qui correspond le mieux à votre activité... DemoFundation=Gestion des adhérents d'une association diff --git a/htdocs/langs/hu_HU/other.lang b/htdocs/langs/hu_HU/other.lang index 4272e4a1d69..97c3c3e3470 100644 --- a/htdocs/langs/hu_HU/other.lang +++ b/htdocs/langs/hu_HU/other.lang @@ -145,14 +145,14 @@ LinkedObject=Csatolt objektum Miscellanous=Vegyes NbOfActiveNotifications=Bejelentések száma PredefinedMailTest=Ez egy teszt mailt. \ NA két vonal választja el egymástól kocsivissza. -PredefinedMailContentSendInvoice=Meg fogja találni itt a számla __FACREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Szeretnénk figyelmeztetni, hogy a számla __FACREF__ úgy tűnik, hogy nem fizetni. Szóval ez a számla mellékleteként ismét emlékeztetőül. \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Meg fogja találni itt a kereskedelmi propoal __PROPREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Meg fogja találni itt a sorrendben __ORDERREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Meg fogja találni itt a rendezés __ORDERREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Meg fogja találni itt a számla __FACREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Meg fogja találni itt a hajózási __SHIPPINGREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Meg fogja találni itt a beavatkozás __FICHINTERREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a számla __FACREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Szeretnénk figyelmeztetni, hogy a számla __FACREF__ úgy tűnik, hogy nem fizetni. Szóval ez a számla mellékleteként ismét emlékeztetőül. \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a kereskedelmi propoal __PROPREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a sorrendben __ORDERREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a rendezés __ORDERREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a számla __FACREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a hajózási __SHIPPINGREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a beavatkozás __FICHINTERREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ ChooseYourDemoProfil=Válassza ki a demo, amely egyezik a profilt tevékenység ... DemoFundation=Tagok kezelése egy alapítvány DemoFundation2=Tagok kezelése és bankszámla egy alapítvány diff --git a/htdocs/langs/is_IS/other.lang b/htdocs/langs/is_IS/other.lang index 55488adcff9..f0343871b02 100644 --- a/htdocs/langs/is_IS/other.lang +++ b/htdocs/langs/is_IS/other.lang @@ -166,7 +166,7 @@ CalculatedVolume=Reiknað magn // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> is_IS -PredefinedMailContentSendSupplierOrder=Þú vilja finna hér til __ORDERREF__ okkar \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Þú vilja finna hér til __ORDERREF__ okkar \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=pund VolumeUnitounce=eyri VolumeUnitlitre=l @@ -194,7 +194,7 @@ Notify_FICHEINTER_VALIDATE=Afskipti fullgilt Notify_SHIPPING_VALIDATE=Shipping fullgilt Notify_SHIPPING_SENTBYMAIL=Shipping send með pósti Notify_MEMBER_VALIDATE=Member fullgilt -PredefinedMailContentSendFichInter=Þú vilja finna hér á afskiptum __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Þú vilja finna hér á afskiptum __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ Top=Top Bottom=Bottom Left=Vinstri @@ -217,12 +217,12 @@ Notify_BILL_SENTBYMAIL=Viðskiptavinur Reikningar send með pósti Notify_MEMBER_SUBSCRIPTION=Member áskrift Notify_MEMBER_RESILIATE=Member resiliated Notify_MEMBER_DELETE=Member eytt -PredefinedMailContentSendInvoice=Þú vilja finna hér á reikningsnúmerið __ FACREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Við viljum vara þig á að reikningur __ FACREF__ virðist ekki vera greiddur. Svo er þetta reikningur í viðhengi aftur, sem áminningu. \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Þú vilja finna hér auglýsing propoal __ PROPREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Þú vilja finna hér til __ ORDERREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Þú vilja finna hér á reikningsnúmerið __ FACREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Þú vilja finna hér siglinga __ SHIPPINGREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Þú vilja finna hér á reikningsnúmerið __ FACREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Við viljum vara þig á að reikningur __ FACREF__ virðist ekki vera greiddur. Svo er þetta reikningur í viðhengi aftur, sem áminningu. \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Þú vilja finna hér auglýsing propoal __ PROPREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Þú vilja finna hér til __ ORDERREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Þú vilja finna hér á reikningsnúmerið __ FACREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Þú vilja finna hér siglinga __ SHIPPINGREF__ \n\n__PERSONALIZED__ kveðju \n\n__SIGNATURE__ AddFiles=Bæta við skrár StartUpload=Byrja senda CancelUpload=Hætta við diff --git a/htdocs/langs/it_IT/other.lang b/htdocs/langs/it_IT/other.lang index 9e9cdee6426..33e575ca64f 100644 --- a/htdocs/langs/it_IT/other.lang +++ b/htdocs/langs/it_IT/other.lang @@ -138,14 +138,14 @@ NumberOfUnitsProposals =Numero di unità sulle proposte degli ultimi 12 NumberOfUnitsSupplierInvoices =Numero di unità sulle fatture fornitore degli ultimi 12 mesi OpenANewWindow =Apri una nuova finestra PaymentDoneInDolibarr =Pagamenti %s fatto su Dolibarr -PredefinedMailContentSendFichInter =Alleghiamo l'intervento __FICHINTERREF__ \n\n__PERSONALIZED__Cordiali saluti \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder =Vorremmo portare alla Vostra attenzione che la fattura __FACREF__ sembra non essere stata saldata. La fattura è allegata alla presente, come promemoria. \n\n__PERSONALIZED__ Cordiali saluti \n\n__SIGNATURE__ -PredefinedMailContentSendInvoice =Alleghiamo la fattura __FACREF__ \n\n__PERSONALIZED__ Cordiali Saluti \n\n__SIGNATURE__ -PredefinedMailContentSendOrder =Alleghiamo l'ordine __ORDERREF__ \n\n__PERSONALIZED__ Cordiali Saluti \n\n__SIGNATURE__ -PredefinedMailContentSendProposal =Alleghiamo la proposta commerciale __PROPREF__ \n\n__PERSONALIZED__ Cordiali Saluti \n\n__SIGNATURE__ -PredefinedMailContentSendShipping =Alleghiamo la spedizione __SHIPPINGREF__ \n\n__PERSONALIZED__Cordiali Saluti \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice =Alleghiamo la fattura __FACREF__ \n\n__PERSONALIZED__Cordiali Saluti \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder =Alleghiamo il nostro ordine n __ORDERREF__ \n\n__PERSONALIZED__Cordiali Saluti \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter =__CONTACTCIVNAME__ \n\n Alleghiamo l'intervento __FICHINTERREF__ \n\n__PERSONALIZED__Cordiali saluti \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder =__CONTACTCIVNAME__ \n\n Vorremmo portare alla Vostra attenzione che la fattura __FACREF__ sembra non essere stata saldata. La fattura è allegata alla presente, come promemoria. \n\n__PERSONALIZED__ Cordiali saluti \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice =__CONTACTCIVNAME__ \n\n Alleghiamo la fattura __FACREF__ \n\n__PERSONALIZED__ Cordiali Saluti \n\n__SIGNATURE__ +PredefinedMailContentSendOrder =__CONTACTCIVNAME__ \n\n Alleghiamo l'ordine __ORDERREF__ \n\n__PERSONALIZED__ Cordiali Saluti \n\n__SIGNATURE__ +PredefinedMailContentSendProposal =__CONTACTCIVNAME__ \n\n Alleghiamo la proposta commerciale __PROPREF__ \n\n__PERSONALIZED__ Cordiali Saluti \n\n__SIGNATURE__ +PredefinedMailContentSendShipping =__CONTACTCIVNAME__ \n\n Alleghiamo la spedizione __SHIPPINGREF__ \n\n__PERSONALIZED__Cordiali Saluti \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice =__CONTACTCIVNAME__ \n\n Alleghiamo la fattura __FACREF__ \n\n__PERSONALIZED__Cordiali Saluti \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder =__CONTACTCIVNAME__ \n\n Alleghiamo il nostro ordine n __ORDERREF__ \n\n__PERSONALIZED__Cordiali Saluti \n\n__SIGNATURE__ PredefinedMailTestHtml =Questa è una mail di test (la parola test deve risultare in grassetto).
Le due linee sono separate da un a capo. PredefinedMailTest =Questa è una mail di prova. \NLe due linee sono separate da un a capo. ProfIdShortDesc =Prof ID %s è un dato dipendente dal paese terzo.
Ad esempio, per il paese %s, è il codice %s. diff --git a/htdocs/langs/nb_NO/other.lang b/htdocs/langs/nb_NO/other.lang index aa9883fe23d..451d2c47fac 100644 --- a/htdocs/langs/nb_NO/other.lang +++ b/htdocs/langs/nb_NO/other.lang @@ -24,10 +24,10 @@ AttachANewFile=Legg ved ny fil/dokument LinkedObject=Lenkede objekter Miscellanous=Diverse NbOfActiveNotifications=Antall påminnelser -PredefinedMailContentSendInvoice=Vedlagt oversendes faktura __FACREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=I følge våre noteringer ser det ut til at vår faktura __FACREF__ fortsatt står ubetalt hos oss. Dersom Deres betaling har krysset denne påminnelsen ber vi Dem vennligst se bort fra denne henvendelsen. \n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Vedlagt oversendes tilbud __PROPREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Vedlagt oversendese __ORDERREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Vedlagt oversendes faktura __FACREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n I følge våre noteringer ser det ut til at vår faktura __FACREF__ fortsatt står ubetalt hos oss. Dersom Deres betaling har krysset denne påminnelsen ber vi Dem vennligst se bort fra denne henvendelsen. \n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Vedlagt oversendes tilbud __PROPREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Vedlagt oversendese __ORDERREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ DemoDesc=Dolibarr er ikke en komplett ERP, men er bygget opp av flere forskjellige moduler. Vi har derfor laget flere forskjellige demoprofiler ChooseYourDemoProfil=Velg demoprofilen som passer til ditt område... DemoFundation=Håndtere medlemmer i en organisasjon @@ -170,7 +170,7 @@ ExternalSites=Eksterne nettsteder // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> nb_NO -PredefinedMailContentSendSupplierOrder=Du finner her vårt bestillingsskjema __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Du finner her vårt bestillingsskjema __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=pund VolumeUnitounce=unse VolumeUnitlitre=liter @@ -222,9 +222,9 @@ Notify_BILL_SENTBYMAIL=Kunden faktura sendt i posten Notify_ORDER_SUPPLIER_VALIDATE=Leverandør orden validert Notify_ORDER_SUPPLIER_SENTBYMAIL=Leverandør ordre sendes med post Notify_BILL_SUPPLIER_VALIDATE=Leverandør faktura validert -PredefinedMailContentSendSupplierInvoice=Du finner her fakturaen __FACREF__ \n\n__PERSONALIZED__ Vennlig hilsen \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Du finner her shipping __SHIPPINGREF__ \n\n__PERSONALIZED__ Vennlig hilsen \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Du finner her intervensjonen __FICHINTERREF__ \n\n__PERSONALIZED__ Vennlig hilsen \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Du finner her fakturaen __FACREF__ \n\n__PERSONALIZED__ Vennlig hilsen \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Du finner her shipping __SHIPPINGREF__ \n\n__PERSONALIZED__ Vennlig hilsen \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Du finner her intervensjonen __FICHINTERREF__ \n\n__PERSONALIZED__ Vennlig hilsen \n\n__SIGNATURE__ Top=Topp Bottom=Bottom FileIsTooBig=Filer er for stor diff --git a/htdocs/langs/nl_NL/other.lang b/htdocs/langs/nl_NL/other.lang index 361ac295a61..e2e7fba77f2 100644 --- a/htdocs/langs/nl_NL/other.lang +++ b/htdocs/langs/nl_NL/other.lang @@ -27,12 +27,12 @@ Miscellanous = Diversen NbOfActiveNotifications = Aantal kennisgevingen PredefinedMailTest = Dit is een test e-mail.\nDe twee lijnen worden gescheiden door een harde return. PredefinedMailTestHtml = Dit is een test e-mail (het woord test moet vetgedrukt worden weergegeven).
De twee lijnen worden gescheiden door een harde return. -PredefinedMailContentSendInvoice = Bijgevoegd vindt u de factuur __FACREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder = Wij willen u erop wijzen dat de factuur __FACREF__ niet lijkt te zijn voldaan. Daarom sturen wij u nogmaals de factuur als bijlage. \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ -PredefinedMailContentSendProposal = Hierbij sturen wij u de offerte __PROPREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ -PredefinedMailContentSendOrder = Hierbij sturen wij u de opdracht __ORDERREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder = Hierbij onze opdracht __ORDERREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice = Hierbij sturen wij u de factuur __FACREF__\n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice = __CONTACTCIVNAME__ \n\n Bijgevoegd vindt u de factuur __FACREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder = __CONTACTCIVNAME__ \n\n Wij willen u erop wijzen dat de factuur __FACREF__ niet lijkt te zijn voldaan. Daarom sturen wij u nogmaals de factuur als bijlage. \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ +PredefinedMailContentSendProposal =__CONTACTCIVNAME__ \n\n Hierbij sturen wij u de offerte __PROPREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ +PredefinedMailContentSendOrder = __CONTACTCIVNAME__ \n\n Hierbij sturen wij u de opdracht __ORDERREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder = __CONTACTCIVNAME__ \n\n Hierbij onze opdracht __ORDERREF__ \n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice = __CONTACTCIVNAME__ \n\n Hierbij sturen wij u de factuur __FACREF__\n\n__PERSONALIZED__Met vriendelijke groeten,\n\n__SIGNATURE__ DemoDesc = Dolibarr is een compacte ERP / CRM oplossing opgebouwd met verschillende functionele modules. Een demo met alle modules beschikbaar betekent niets als nooit iets gebeurt. Dus, zijn enkele demo-profielen beschikbaar. ChooseYourDemoProfil = Kies het demoprofiel dat overeenkomt met uw activiteiten... DemoFundation = Ledenbeheer van een stichting @@ -206,8 +206,8 @@ Notify_MEMBER_VALIDATE=Lid gevalideerd Notify_MEMBER_SUBSCRIPTION=Lid ingeschreven Notify_MEMBER_RESILIATE=Lid resiliated Notify_MEMBER_DELETE=Lid verwijderd -PredefinedMailContentSendShipping=Hier vindt u de verzendkosten __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Hier vindt u de tussenkomst __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\nHier vindt u de verzendkosten __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\nHier vindt u de tussenkomst __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ SelectAColor=Kies een kleur AddFiles=Bestanden toevoegen StartUpload=Start uploaden diff --git a/htdocs/langs/pl_PL/other.lang b/htdocs/langs/pl_PL/other.lang index 8c1c462be49..9caefe6bc0f 100644 --- a/htdocs/langs/pl_PL/other.lang +++ b/htdocs/langs/pl_PL/other.lang @@ -251,7 +251,7 @@ ExternalSites=tereny zewnętrzne // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> pl_PL -PredefinedMailContentSendSupplierOrder=Znajdziecie tu nasze zamówienie __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Znajdziecie tu nasze zamówienie __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=funt VolumeUnitounce=uncja VolumeUnitlitre=litr @@ -279,9 +279,9 @@ Notify_MEMBER_VALIDATE=Członek zatwierdzone Notify_MEMBER_SUBSCRIPTION=Członek subskrybowanych Notify_MEMBER_RESILIATE=Członek resiliated Notify_MEMBER_DELETE=Członek usunięte -PredefinedMailContentSendSupplierInvoice=Znajdziecie tu Państwo fakturę __FACREF__ \n\nSincerely \n\n -PredefinedMailContentSendShipping=Znajdziesz tu wysyłki __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n -PredefinedMailContentSendFichInter=Znajdziesz tu interwencji __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Znajdziecie tu Państwo fakturę __FACREF__ \n\nSincerely \n\n +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Znajdziesz tu wysyłki __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Znajdziesz tu interwencji __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n Top=Top Bottom=Dno FileFormat=Format pliku @@ -305,10 +305,10 @@ Notify_BILL_SUPPLIER_SENTBYMAIL=Faktura dostawca wysłane pocztą Notify_CONTRACT_VALIDATE=Umowa zatwierdzona Notify_FICHEINTER_VALIDATE=Interwencja zatwierdzone Notify_SHIPPING_VALIDATE=Wysyłka zatwierdzone -PredefinedMailContentSendInvoice=Znajdziecie tu Państwo faktury __FACREF__ \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Pragniemy ostrzec, że faktura __FACREF__ wydaje się nie być wypłacana. Więc to jest faktura w załączniku ponownie, jako przypomnienie. \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Znajdziecie tu komercyjnego propoal __PROPREF__ \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Znajdziecie tutaj aby __ORDERREF__ \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Znajdziecie tu Państwo faktury __FACREF__ \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Pragniemy ostrzec, że faktura __FACREF__ wydaje się nie być wypłacana. Więc to jest faktura w załączniku ponownie, jako przypomnienie. \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Znajdziecie tu komercyjnego propoal __PROPREF__ \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Znajdziecie tutaj aby __ORDERREF__ \n\n__PERSONALIZED__ poważaniem \n\n__SIGNATURE__ Left=W lewo Right=Prawo ThisIsListOfModules=To jest lista modułów selekcjonowane przez tego profilu demo (tylko najczęściej moduły są widoczne w tym demo). Zmodyfikować, aby mieć bardziej spersonalizowany demo i kliknij "Start". diff --git a/htdocs/langs/pt_BR/other.lang b/htdocs/langs/pt_BR/other.lang index 43c27cbfbf6..688fd19e32a 100755 --- a/htdocs/langs/pt_BR/other.lang +++ b/htdocs/langs/pt_BR/other.lang @@ -19,10 +19,10 @@ AttachANewFile=Adicionar Novo Arquivo/Documento LinkedObject=Arquivo Anexo Miscellanous=Diversos NbOfActiveNotifications=Número Notificações -PredefinedMailContentSendInvoice=Estimados senhores,\n\nem anexo enviamos a nossa fatura __FACREF__ .\n\nAtenciosamente\n\n -PredefinedMailContentSendInvoiceReminder=Estimados senhores,\n\ninformamos que a fatura __FACREF__ nos consta como não paga. Por favor revisar a fatura anexada e nos dar uma posicao.\n\nAtenciosamente\n\n -PredefinedMailContentSendProposal=Estimados senhores,\n\nem anexo enviamos a proposta solicitada __PROPREF__ .\n\nAtenciosamente\n\n -PredefinedMailContentSendOrder=Estimados senhores,\n\nem anexo segue o pedido solicitado __ORDERREF__ .\n\nAtenciosamente\n\n +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Estimados senhores,\n\nem anexo enviamos a nossa fatura __FACREF__ .\n\nAtenciosamente\n\n +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Estimados senhores,\n\ninformamos que a fatura __FACREF__ nos consta como não paga. Por favor revisar a fatura anexada e nos dar uma posicao.\n\nAtenciosamente\n\n +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Estimados senhores,\n\nem anexo enviamos a proposta solicitada __PROPREF__ .\n\nAtenciosamente\n\n +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Estimados senhores,\n\nem anexo segue o pedido solicitado __ORDERREF__ .\n\nAtenciosamente\n\n DemoDesc=Dolibarr não é um ERP monolítico, mas está composto de módulos funcionais simples e opcionais. Uma demonstração que inclua todos estes módulos não tem sentido, já que nunca mais todos os módulos são utilizados. De todas maneras existe disponíveis muitos perfis de demonstração ChooseYourDemoProfil=quer ver o perfil de demonstração que melhor corresponda e a sua Atividade... DemoFundation=Administração de Membros de uma associação diff --git a/htdocs/langs/pt_PT/other.lang b/htdocs/langs/pt_PT/other.lang index 6123038bc5a..8fb2274b40d 100644 --- a/htdocs/langs/pt_PT/other.lang +++ b/htdocs/langs/pt_PT/other.lang @@ -16,10 +16,10 @@ AttachANewFile=Adicionar Novo Ficheiro/documento LinkedObject=Objecto adjudicado Miscellanous=Diversos NbOfActiveNotifications=Número Notificações -PredefinedMailContentSendInvoice=Juntamos a factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Damos conhecimento que a factura __FACREF__ parece não estar paga. Segue em anexo, para que possa rever.\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Juntamos o orçamento __PROPREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Juntamos o pedido __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Juntamos a factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Damos conhecimento que a factura __FACREF__ parece não estar paga. Segue em anexo, para que possa rever.\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Juntamos o orçamento __PROPREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Juntamos o pedido __ORDERREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ DemoDesc=Dolibarr não é um ERP monolítico, mas está composto de módulos funcionais simples e opcionais. uma demonstração que inclua todos estes módulos não tem sentido, já que nunca mais todos Os módulos são utilizados. De todas maneiras existem disponiveis muitos perfis de demonstração ChooseYourDemoProfil=Quer ver o perfil de demonstração que melhor corresponda e a sua Actividade... DemoFundation=Gestão de Membros de uma associação @@ -151,7 +151,7 @@ DolibarrNotification=Notificação automática // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> pt_PT -PredefinedMailContentSendSupplierOrder=Você vai encontrar aqui o nosso fim __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\nVocê vai encontrar aqui o nosso fim __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=libra VolumeUnitounce=onça VolumeUnitlitre=litro @@ -177,8 +177,8 @@ Notify_BILL_SUPPLIER_SENTBYMAIL=Fatura do fornecedor enviada por correio Notify_CONTRACT_VALIDATE=Contrato validado Notify_FICHEINTER_VALIDATE=Intervenção validado Notify_SHIPPING_VALIDATE=Transporte validado -PredefinedMailContentSendShipping=Você vai encontrar aqui o transporte __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Você vai encontrar aqui a intervenção __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\nVocê vai encontrar aqui o transporte __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\nVocê vai encontrar aqui a intervenção __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ Top=Topo Bottom=Fundo Left=À esquerda @@ -204,7 +204,7 @@ Notify_MEMBER_VALIDATE=Membro validado Notify_MEMBER_SUBSCRIPTION=Membro subscrito Notify_MEMBER_RESILIATE=Membro anulado Notify_MEMBER_DELETE=Membro excluído -PredefinedMailContentSendSupplierInvoice=Você vai encontrar aqui a factura __FACREF__ \n\n__PERSONALIZED__ Sinceramente \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\nVocê vai encontrar aqui a factura __FACREF__ \n\n__PERSONALIZED__ Sinceramente \n\n__SIGNATURE__ SelectAColor=Escolha uma cor AddFiles=Adicionar arquivos StartUpload=Iniciar upload diff --git a/htdocs/langs/ro_RO/other.lang b/htdocs/langs/ro_RO/other.lang index a98adb2718a..3b46ab31625 100644 --- a/htdocs/langs/ro_RO/other.lang +++ b/htdocs/langs/ro_RO/other.lang @@ -309,7 +309,7 @@ ExternalSites=Sites externos // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> ro_RO -PredefinedMailContentSendSupplierOrder=Veţi găsi aici noastre pentru __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Veţi găsi aici noastre pentru __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=livră VolumeUnitounce=uncie VolumeUnitlitre=litru @@ -340,7 +340,7 @@ Notify_MEMBER_VALIDATE=Membru validate Notify_MEMBER_SUBSCRIPTION=Membru subscris Notify_MEMBER_RESILIATE=Membru reziliat Notify_MEMBER_DELETE=Membre elimină -PredefinedMailContentSendSupplierInvoice=Veţi găsi aici factura __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Veţi găsi aici factura __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ ThisIsListOfModules=Aceasta este o listă de module preselectate de acest profil de demo-ul (numai modulele cele mai comune sunt vizibile în această demonstraţie). Editeaza aceasta să aibă un demo mai personalizate şi apăsaţi pe "Start". ClickHere=Click aici UseAdvancedPerms=Utilizaţi permisiunile avansate ale unor module @@ -362,12 +362,12 @@ Notify_ORDER_SUPPLIER_VALIDATE=Pentru furnizorul validate Notify_ORDER_SUPPLIER_SENTBYMAIL=Pentru furnizorul trimis prin e-mail Notify_BILL_SUPPLIER_VALIDATE=Factura furnizorului validate Notify_BILL_SUPPLIER_PAYED=Factura platita cu furnizorul -PredefinedMailContentSendInvoice=Veţi găsi aici factura __FACREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Ne-ar dori să vă avertizeze că __FACREF__ factura pare a nu fi platit. Deci, aceasta este factură în ataşamentul din nou, ca un memento. \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Veţi găsi aici comercial propoal __PROPREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Veţi găsi aici, pentru __ORDERREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Veţi găsi aici de transport maritim __SHIPPINGREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Veţi găsi aici de intervenţie __FICHINTERREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Veţi găsi aici factura __FACREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Ne-ar dori să vă avertizeze că __FACREF__ factura pare a nu fi platit. Deci, aceasta este factură în ataşamentul din nou, ca un memento. \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Veţi găsi aici comercial propoal __PROPREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Veţi găsi aici, pentru __ORDERREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Veţi găsi aici de transport maritim __SHIPPINGREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Veţi găsi aici de intervenţie __FICHINTERREF__ \n\n__PERSONALIZED__ respect \n\n__SIGNATURE__ Top=Top Bottom=De jos Left=Stânga diff --git a/htdocs/langs/ru_RU/other.lang b/htdocs/langs/ru_RU/other.lang index a27146c596f..b68df84422a 100644 --- a/htdocs/langs/ru_RU/other.lang +++ b/htdocs/langs/ru_RU/other.lang @@ -304,7 +304,7 @@ ExternalSites=На внешних сайтах // START - Lines generated via autotranslator.php tool (2010-09-04 01:33:40). // Reference language: en_US -> ru_RU -PredefinedMailContentSendSupplierOrder=Вы найдете здесь наш заказ __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Вы найдете здесь наш заказ __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ WeightUnitpound=фунт VolumeUnitounce=унция VolumeUnitlitre=литр @@ -321,9 +321,9 @@ ToolsDesc=Эта область посвящена группе разные и Notify_WITHDRAW_TRANSMIT=Передача вывода Notify_WITHDRAW_CREDIT=Кредитный выход Notify_WITHDRAW_EMIT=Isue вывода -PredefinedMailContentSendSupplierInvoice=Только здесь вы найдете счета __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n -PredefinedMailContentSendShipping=Здесь вы найдете доставку __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n -PredefinedMailContentSendFichInter=Вы найдете здесь вмешательство __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Только здесь вы найдете счета __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Здесь вы найдете доставку __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely \n\n +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Вы найдете здесь вмешательство __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n Top=Топ Bottom=Дно Left=Левый @@ -368,9 +368,9 @@ Notify_MEMBER_VALIDATE=Член проверки Notify_MEMBER_SUBSCRIPTION=Член подписки Notify_MEMBER_RESILIATE=Член resiliated Notify_MEMBER_DELETE=Член удален -PredefinedMailContentSendInvoice=Здесь вы найдете счет __FACREF__ \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Мы бы хотели предупредить Вас, что счет-фактура __FACREF__, кажется, не оплачиваются. Так что это счета-фактуры в приложении опять же, как напоминание. \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Здесь вы найдете коммерческие propoal __PROPREF__ \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Вы найдете здесь порядок __ORDERREF__ \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Здесь вы найдете счет __FACREF__ \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Мы бы хотели предупредить Вас, что счет-фактура __FACREF__, кажется, не оплачиваются. Так что это счета-фактуры в приложении опять же, как напоминание. \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Здесь вы найдете коммерческие propoal __PROPREF__ \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Вы найдете здесь порядок __ORDERREF__ \n\n__PERSONALIZED__ уважением \n\n__SIGNATURE__ ShipmentValidatedInDolibarr=Отгрузка %s подтверждены в Dolibarr // STOP - Lines generated via autotranslator.php tool (2012-02-29 17:28:06). diff --git a/htdocs/langs/ru_UA/other.lang b/htdocs/langs/ru_UA/other.lang index a526dbce1c5..d67455ca004 100644 --- a/htdocs/langs/ru_UA/other.lang +++ b/htdocs/langs/ru_UA/other.lang @@ -40,14 +40,14 @@ TotalSizeOfAttachedFiles=Общий размер присоединенных ф MaxSize=Максимальный размер PredefinedMailTest=Это тест почте. \ NВ две строки, разделенные возвратом каретки. PredefinedMailTestHtml=Это тест почте (слово тест должен быть жирным шрифтом).
Две строки, разделенные возвратом каретки. -PredefinedMailContentSendInvoice=Только здесь вы найдете счета __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Мы бы хотели предупредить Вас, что счет-фактура __FACREF__, кажется, не оплачиваются. Так что это счета-фактуры в привязанности снова, как напоминание. \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Только здесь вы найдете коммерческие propoal __PROPREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Вы найдете здесь порядок __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Здесь Вы найдете наш заказ __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Только здесь вы найдете счета __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Здесь вы найдете доставку __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Вы найдете здесь вмешательство __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Только здесь вы найдете счета __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Мы бы хотели предупредить Вас, что счет-фактура __FACREF__, кажется, не оплачиваются. Так что это счета-фактуры в привязанности снова, как напоминание. \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Только здесь вы найдете коммерческие propoal __PROPREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Вы найдете здесь порядок __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Здесь Вы найдете наш заказ __ORDERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Только здесь вы найдете счета __FACREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Здесь вы найдете доставку __SHIPPINGREF__ \n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Вы найдете здесь вмешательство __FICHINTERREF__ \n\n__PERSONALIZED__Sincerely \n\n__SIGNATURE__ DemoCompanyProductAndStocks=Управление малого и среднего продуктов компании, продающей DemoCompanyAll=Управление малых и средних компаний с несколькими деятельности (все основные модули) GoToDemo=Перейти в демо- diff --git a/htdocs/langs/sl_SI/other.lang b/htdocs/langs/sl_SI/other.lang index 664ef8ea4a1..a9af5499b8d 100644 --- a/htdocs/langs/sl_SI/other.lang +++ b/htdocs/langs/sl_SI/other.lang @@ -65,14 +65,14 @@ WarningInstallDirExists = Pozor, instalacijska mapa (htdocs/install) še WarningUntilDirRemoved = Vsa varnostna opozorila (ki jih vidi samo uporabnik admin) bodo ostala aktivna, dokler je prisotna ranljivost(oz. je konstanta MAIN_REMOVE_INSTALL_WARNING dodana v Nastavitev->Ostale nastavitve). PredefinedMailTest = To je testni mail.\nDve vrstici sta ločeni z carriage return. PredefinedMailTestHtml = To je test mail (beseda test mora biti v krepkem tisku).
Dve vrstici sta ločeni z carriage return. -PredefinedMailContentSendInvoice = V prilogi je račun __FACREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder = Želimo vas opozoriti, da račun __FACREF__ ni bil poravnan. Zato vam račun še enkrat pošiljamo v prilogi.\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendProposal = V prilogi je ponudba __PROPREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendOrder = V prilogi je potrditev naročila __ORDERREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder = V prilogi je naročilo __ORDERREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice = V prilogi je potrjen račun __FACREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendShipping = V prilogi je pošiljka __SHIPPINGREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter = V prilogi je intervencija __FICHINTERREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice =__CONTACTCIVNAME__ \n\n V prilogi je račun __FACREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder = __CONTACTCIVNAME__ \n\n Želimo vas opozoriti, da račun __FACREF__ ni bil poravnan. Zato vam račun še enkrat pošiljamo v prilogi.\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendProposal = __CONTACTCIVNAME__ \n\n V prilogi je ponudba __PROPREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendOrder =__CONTACTCIVNAME__ \n\n V prilogi je potrditev naročila __ORDERREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder = __CONTACTCIVNAME__ \n\n V prilogi je naročilo __ORDERREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice = __CONTACTCIVNAME__ \n\n V prilogi je potrjen račun __FACREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendShipping = __CONTACTCIVNAME__ \n\n V prilogi je pošiljka __SHIPPINGREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter = __CONTACTCIVNAME__ \n\n V prilogi je intervencija __FICHINTERREF__\n\n__PERSONALIZED__S spoštovanjem\n\n__SIGNATURE__ DemoDesc = Dolibarr je kompakten ERP/CRM sestavljen iz več funkcionalnih modulov. Demo z vsemi moduli nima pomena, ker se kot tak nikoli ne pojavi. Zato je na voljo več demo profilov. ChooseYourDemoProfil = Izberite demo profil, ki ustreza vaši aktivnosti... DemoFundation = Urejanje članov ustanove diff --git a/htdocs/langs/sv_SE/other.lang b/htdocs/langs/sv_SE/other.lang index ce3ec551a3f..191f95768a5 100644 --- a/htdocs/langs/sv_SE/other.lang +++ b/htdocs/langs/sv_SE/other.lang @@ -201,14 +201,14 @@ Notify_BILL_SENTBYMAIL=Kundfaktura skickas per post Notify_MEMBER_SUBSCRIPTION=Medlem tecknat Notify_MEMBER_RESILIATE=Medlem resiliated Notify_MEMBER_DELETE=Elementet bort -PredefinedMailContentSendInvoice=Här hittar du fakturan __FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Vi vill varna dig för att fakturan __FACREF__ verkar inte betalt. Så detta är fakturan i bilagan igen, som en påminnelse. \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Här hittar du den kommersiella propoal __PROPREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Här hittar du den ordning __ORDERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Här hittar du vårt beställningsformulär __ORDERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Här hittar du fakturan __FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Här hittar du sjöfarten __SHIPPINGREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Här hittar du insatsen __FICHINTERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Här hittar du fakturan __FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Vi vill varna dig för att fakturan __FACREF__ verkar inte betalt. Så detta är fakturan i bilagan igen, som en påminnelse. \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Här hittar du den kommersiella propoal __PROPREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Här hittar du den ordning __ORDERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Här hittar du vårt beställningsformulär __ORDERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Här hittar du fakturan __FACREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Här hittar du sjöfarten __SHIPPINGREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Här hittar du insatsen __FICHINTERREF__ \n\n__PERSONALIZED__ Sincerely \n\n__SIGNATURE__ StartUpload=Starta upp CancelUpload=Avbryt upp FileIsTooBig=Filer är för stor diff --git a/htdocs/langs/tr_TR/other.lang b/htdocs/langs/tr_TR/other.lang index 881fb05ec28..9f0ffa6f878 100755 --- a/htdocs/langs/tr_TR/other.lang +++ b/htdocs/langs/tr_TR/other.lang @@ -56,14 +56,14 @@ Miscellanous=Çeşitli NbOfActiveNotifications=Number of notifications PredefinedMailTest=Bu bir deneme postasıdır.\nİki satır enter tuşu ile ayrılmıştır. PredefinedMailTestHtml=Bu bir deneme postası (deneme sözcüğü koyu olmalı).
İki satır enter tuşu ile ayrılmıştır. -PredefinedMailContentSendInvoice=Burada faturayı bulacaksınız __FACREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendInvoiceReminder=Fatura __FACREF__ nın ödenmemiş göründüğünün size uyarısını yapmak isteriz. Dolayısı ile fatura yeniden anımsatmak üzere eklenmiştir.\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendProposal=Burada ticari teklifi bulacaksınız __PROPREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendOrder=Burada siparişi bulacaksınız __ORDERREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierOrder=Burada siparişimizi bulacaksınız __ORDERREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendSupplierInvoice=Burada faturayı bulacaksınız __FACREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendShipping=Burada sevkiyatı bulacaksınız __SHIPPINGREF__\n\n__PERSONALIZED__ Saygılarımızla\n\n__SIGNATURE__ -PredefinedMailContentSendFichInter=Burada müdahaleyi bulacaksınız __FICHINTERREF__\n\n__PERSONALIZED__ Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Burada faturayı bulacaksınız __FACREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Fatura __FACREF__ nın ödenmemiş göründüğünün size uyarısını yapmak isteriz. Dolayısı ile fatura yeniden anımsatmak üzere eklenmiştir.\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendProposal=__CONTACTCIVNAME__ \n\n Burada ticari teklifi bulacaksınız __PROPREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendOrder=__CONTACTCIVNAME__ \n\n Burada siparişi bulacaksınız __ORDERREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierOrder=__CONTACTCIVNAME__ \n\n Burada siparişimizi bulacaksınız __ORDERREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendSupplierInvoice=__CONTACTCIVNAME__ \n\n Burada faturayı bulacaksınız __FACREF__\n\n__PERSONALIZED__Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendShipping=__CONTACTCIVNAME__ \n\n Burada sevkiyatı bulacaksınız __SHIPPINGREF__\n\n__PERSONALIZED__ Saygılarımızla\n\n__SIGNATURE__ +PredefinedMailContentSendFichInter=__CONTACTCIVNAME__ \n\n Burada müdahaleyi bulacaksınız __FICHINTERREF__\n\n__PERSONALIZED__ Saygılarımızla\n\n__SIGNATURE__ DemoDesc=Dolibarr birçok fonksiyonel modülden oluşan derlitoplu bir ERP/CRM programıdır. Bu durumda tüm modülleri içeren bir demo asla hiçbir şey demek değildir. Yani, birçok demo profili vardır. ChooseYourDemoProfil=İşlemlerinize uyan demo profilini seçin... DemoFundation= Bir vakıfın üyelerini yönet From fbf8d410d21987c3fd0dd27060e21f1887e90229 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Mar 2013 17:34:23 +0100 Subject: [PATCH 100/150] New: Support revenue stamp onto invoices --- ChangeLog | 1 + htdocs/admin/company.php | 8 +-- htdocs/compta/facture.php | 46 ++++++------- .../modules/facture/doc/pdf_crabe.modules.php | 11 +++ .../install/mysql/data/llx_c_revenuestamp.sql | 13 +--- htdocs/install/mysql/data/llx_c_tva.sql | 14 ++-- .../install/mysql/migration/3.3.0-3.4.0.sql | 15 ++++- htdocs/install/mysql/tables/llx_c_tva.sql | 4 +- htdocs/societe/class/societe.class.php | 67 ++++++++++++------- 9 files changed, 103 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66e4a8cfd89..db9fc3b9f8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3 ***** For users: +- New: Support revenue stamp onto invoices. - New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Some performance enhancements. - New: Can attach files onto trip and expenses modules. diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 55ad5902e13..55a8a8b8b60 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit') /* * Local Taxes */ - if ($mysoc->hasLocalTax(1)) + if ($mysoc->useLocalTax(1)) { // Local Tax 1 print '
'; @@ -579,7 +579,7 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; print "
'.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).'
'; + print ''; + if ($action != 'editrevenuestamp' && ! empty($object->brouillon) && $user->rights->facture->creer) print ''; + print '
'; + print $langs->trans('RevenueStamp'); + print 'id.'">'.img_edit($langs->trans('SetRevenuStamp'),1).'
'; + print '
'; + if ($action == 'editrevenuestamp') + { + print '
'; + print ''; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print price($object->revenuestamp,1,'',1,-1,-1,$conf->currency); + } + print '
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).'
"; } - if ($mysoc->hasLocalTax(2)) + if ($mysoc->useLocalTax(2)) { // Local Tax 2 print '
'; @@ -927,7 +927,7 @@ else /* * Local Taxes */ - if ($mysoc->hasLocalTax(1)) + if ($mysoc->useLocalTax(1)) { // Local Tax 1 print '
'; @@ -960,7 +960,7 @@ else print "
"; } - if ($mysoc->hasLocalTax(2)) + if ($mysoc->useLocalTax(2)) { // Local Tax 2 print '
'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index aa6f3cfec07..f792d7c6e20 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -377,22 +377,22 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu $object->fetch_thirdparty(); // Check parameters - + // Check for mandatory prof id for ($i = 1; $i < 5; $i++) { - + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY'; $idprof='idprof'.$i; if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) { if (! $error) $langs->load("errors"); $error++; - + setEventMessage($langs->trans('ErrorProdIdIsMandatory',$langs->transcountry('ProfId'.$i, $object->thirdparty->country_code)),'errors'); } - } - + } + //Check for warehouse if ($object->type != 3 && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $object->hasProductsOrServices(1)) { @@ -403,7 +403,7 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu $action=''; } } - + if (! $error) { $result = $object->validate($user,'',$idwarehouse); @@ -625,7 +625,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $db->begin(); $error=0; - + // Get extra fields foreach($_POST as $key => $value) { @@ -1638,7 +1638,7 @@ else if ($action == 'builddoc') // En get ou en post if (GETPOST('model')) $object->setDocModel($user, GETPOST('model')); if (GETPOST('fk_bank')) $object->fk_bank=GETPOST('fk_bank'); - + // Define output language $outputlangs = $langs; $newlang=''; @@ -2280,10 +2280,10 @@ else if ($id > 0 || ! empty($ref)) */ $result=$object->fetch($id,$ref); - + // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('facture'); - + if ($result > 0) { if ($user->societe_id>0 && $user->societe_id!=$object->socid) accessforbidden('',0); @@ -2292,11 +2292,12 @@ else if ($id > 0 || ! empty($ref)) $soc = new Societe($db); $soc->fetch($object->socid); + $selleruserevenustamp=$mysoc->useRevenueStamp(); $totalpaye = $object->getSommePaiement(); $totalcreditnotes = $object->getSumCreditNotesUsed(); $totaldeposits = $object->getSumDepositsUsed(); - //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits; + //print "totalpaye=".$totalpaye." totalcreditnotes=".$totalcreditnotes." totaldeposts=".$totaldeposits." selleruserrevenuestamp=".$selleruserevenustamp; // We can also use bcadd to avoid pb with floating points // For example print 239.2 - 229.3 - 9.9; does not return 0. @@ -2753,7 +2754,6 @@ else if ($id > 0 || ! empty($ref)) /* * List of payments */ - $selleruserevenustamp=empty($conf->global->MAIN_USE_REVENUE_STAMP)?0:1; // TODO Add method societe->useRevenueStamp() to look into table llx_c_revenue_stamp if there is one line for country $sign=1; if ($object->type == 2) $sign=-1; @@ -2764,7 +2764,7 @@ else if ($id > 0 || ! empty($ref)) if($mysoc->localtax1_assuj=="1") $nbrows++; if($mysoc->localtax2_assuj=="1") $nbrows++; if ($selleruserevenustamp) $nbrows++; - + print ''; print ''; @@ -3039,12 +3039,12 @@ else if ($id > 0 || ! empty($ref)) print ''; // Amount Local Taxes - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + if ($mysoc->localtax1_assuj=="1" && $mysoc->useLocalTax(1)) //Localtax1 (example RE) { print ''; print ''; } - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + if ($mysoc->localtax2_assuj=="1" && $mysoc->useLocalTax(2)) //Localtax2 (example IRPF) { print ''; print ''; @@ -3075,7 +3075,7 @@ else if ($id > 0 || ! empty($ref)) } print ''; } - + // Total with tax print ''; @@ -3113,14 +3113,14 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; } - + // Other attributes $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - + if ($action == 'edit_extras') { print ''; @@ -3128,8 +3128,8 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; } - - + + foreach($extrafields->attribute_label as $key=>$label) { $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); @@ -3153,16 +3153,16 @@ else if ($id > 0 || ! empty($ref)) print ''."\n"; } } - + if(count($extrafields->attribute_label) > 0) { - + if ($action == 'edit_extras' && $user->rights->facture->creer) { print ''; - + } else { if ($object->statut == 0 && $user->rights->facture->creer) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ef7698d0564..15ee4e29aba 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1020,6 +1020,17 @@ class pdf_crabe extends ModelePDFFactures //} } + // Revenue stamp + if (price2num($object->revenuestamp) != 0) + { + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); + + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); + } + // Total TTC $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); diff --git a/htdocs/install/mysql/data/llx_c_revenuestamp.sql b/htdocs/install/mysql/data/llx_c_revenuestamp.sql index 8d998111218..040a8370485 100644 --- a/htdocs/install/mysql/data/llx_c_revenuestamp.sql +++ b/htdocs/install/mysql/data/llx_c_revenuestamp.sql @@ -1,13 +1,4 @@ --- Copyright (C) 2001-2004 Rodolphe Quiedeville --- Copyright (C) 2003 Jean-Louis Bergamo -- Copyright (C) 2004-2011 Laurent Destailleur --- Copyright (C) 2004 Benoit Mortier --- Copyright (C) 2004 Guillaume Delecourt --- Copyright (C) 2005-2009 Regis Houssin --- Copyright (C) 2007 Patrick Raguin --- Copyright (C) 2010-2011 Juanjo Menent --- Copyright (C) 2012 Sebastian Neuwert --- Copyright (C) 2012 Ricardo Schluter -- -- 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 @@ -35,5 +26,5 @@ delete from llx_c_revenuestamp; --- TUNISIA -- -insert into llx_c_revenuestamp(rowid,fk_pays,taux,note,active) values (101, 10, '0.4', 'Timbre fiscal', 1); +-- TUNISIA (id country=10) -- +insert into llx_c_revenuestamp(rowid,fk_pays,taux,note,active) values (101, 10, 0.4, 'Revenue stamp tunisia', 1); diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index b5f578f579b..b6d38949451 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -219,13 +219,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 6 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '0','0','VAT Rate 0', 1); -- TUNISIA (id country=10) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0.4, '7'); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (102,10, '12','0','VAT 12%',1, 1, '4', 0.4, '7'); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (103,10, '18','0','VAT 18%',1, 1, '4', 0.4, '7'); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1, 1, '4', 0.4, '7'); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1, 1, '4', 0.4, '7'); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1, 1, '4', 0.4, '7'); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10, '0','0','VAT Rate 0', 1, 1, '4', 0.4, '7'); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (102,10, '12','0','VAT 12%',1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (103,10, '18','0','VAT 18%',1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (105,10, '15','0','VAT 12% Majoré à 25% (15%)',1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1, 1, '4', 0, null); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10, '0','0','VAT Rate 0', 1, 1, '4', 0, null); -- UKRAINE (id country=226) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '20','0','VAT standart rate',1); diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index e6b82dc565e..571ba7373a2 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -130,8 +130,6 @@ CREATE TABLE llx_c_revenuestamp insert into llx_c_revenuestamp(rowid,fk_pays,taux,note,active) values (101, 10, '0.4', 'Timbre fiscal', 1); -ALTER TABLE llx_actioncomm ADD COLUMN code varchar(32) NULL after fk_action; - ALTER TABLE llx_c_tva MODIFY COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0'; ALTER TABLE llx_c_tva MODIFY COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0'; ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0'; @@ -148,6 +146,13 @@ ALTER TABLE llx_facturedet MODIFY COLUMN localtax1_type varchar(10) NOT NULL DEF ALTER TABLE llx_facturedet MODIFY COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0'; ALTER TABLE llx_propaldet MODIFY COLUMN localtax1_type varchar(10) NOT NULL DEFAULT '0'; ALTER TABLE llx_propaldet MODIFY COLUMN localtax2_type varchar(10) NOT NULL DEFAULT '0'; +-- No more use type 7, use revenuse stamp instead +UPDATE llx_c_tva set localtax1=0, localtax1_type='0' where localtax1_type = '7'; +UPDATE llx_c_tva set localtax2=0, localtax2_type='0' where localtax2_type = '7'; + + +ALTER TABLE llx_actioncomm ADD COLUMN code varchar(32) NULL after fk_action; + ALTER TABLE llx_holiday ADD COLUMN note text; ALTER TABLE llx_holiday ADD COLUMN note_public text; @@ -197,5 +202,9 @@ ALTER TABLE llx_societe MODIFY COLUMN zip varchar(25); ALTER TABLE llx_user ADD COLUMN address varchar(255); ALTER TABLE llx_user ADD COLUMN zip varchar(25); ALTER TABLE llx_user ADD COLUMN town varchar(50); -ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; -- +ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; + + + + diff --git a/htdocs/install/mysql/tables/llx_c_tva.sql b/htdocs/install/mysql/tables/llx_c_tva.sql index 219b1fb9744..46aa3632faa 100644 --- a/htdocs/install/mysql/tables/llx_c_tva.sql +++ b/htdocs/install/mysql/tables/llx_c_tva.sql @@ -24,9 +24,9 @@ create table llx_c_tva fk_pays integer NOT NULL, taux double NOT NULL, localtax1 double NOT NULL DEFAULT 0, - localtax1_type varchar(10) NOT NULL DEFAULT '0', + localtax1_type varchar(10) NOT NULL DEFAULT '0', localtax2 double NOT NULL DEFAULT 0, - localtax2_type varchar(10) NOT NULL DEFAULT '0', + localtax2_type varchar(10) NOT NULL DEFAULT '0', recuperableonly integer NOT NULL DEFAULT 0, note varchar(128), active tinyint DEFAULT 1 NOT NULL, diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c87a6ef11f4..ecf387e13c2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -82,7 +82,9 @@ class Societe extends CommonObject var $idprof1; // IdProf1 (Ex: Siren in France) var $idprof2; // IdProf2 (Ex: Siret in France) var $idprof3; // IdProf3 (Ex: Ape in France) - var $idprof4; // IdProf4 (Ex: RCS in France) + var $idprof4; // IdProf4 (Ex: RCS in France) + var $idprof5; // IdProf5 + var $idprof6; // IdProf6 var $prefix_comm; @@ -2599,40 +2601,53 @@ class Societe extends CommonObject } /** - * Check if localtax define for company - * Used to build previews or test instances. - * id must be 0 if object instance is a specimen. + * Check if thirdparty may using localtax or not * - * @param localTaxNum $localTaxNum 1 or 2 - * @return boolean true / false + * @param int $localTaxNum To get info for only localtax1 or localtax2 + * @return array array(0=>boolean, 1=>boolean) */ - function hasLocalTax($localTaxNum) { - global $user,$langs,$conf; + function useLocalTax($localTaxNum=0) + { + $sql = "SELECT t.localtax1, t.localtax2"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; + $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; + $sql .= " AND t.active = 1"; + if (empty($localTaxNum)) $sql .= " AND (t.localtax1_type <> '0' OR t.localtax2_type <> '0')"; + elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; + elseif ($localTaxNum == 2) $sql .= " AND t.localtax2_type <> '0'"; - // check parameter - if ($localTaxNum != 1 && $localTaxNum != 2) - return false; + dol_syslog("useLocalTax sql=".$sql); + $resql=$this->db->query($sql); + if ($resql) + { + return ($this->db->num_rows($resql) > 0); + } + else return false; + } - // Search local taxes - $sql = "SELECT t.localtax1, t.localtax2"; - $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; - $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; - $sql .= " AND t.active = 1"; - if ($localTaxNum == 1) - $sql .= " AND t.localtax1 <> 0"; - elseif ($localTaxNum == 2) - $sql .= " AND t.localtax2 <> 0"; + /** + * Check if thirdparty is from a country using revenue stamps + * + * @return boolean Yes or no + */ + function useRevenueStamp() + { + $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."c_revenuestamp as r, ".MAIN_DB_PREFIX."c_pays as p"; + $sql .= " WHERE r.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; + $sql .= " AND r.active = 1"; - dol_syslog("get_localtax sql=".$sql); + dol_syslog("useRevenueStamp sql=".$sql); $resql=$this->db->query($sql); if ($resql) { - return ($this->db->num_rows($resql) > 0); - + $obj=$this->db->fetch_object($resql); + return (($obj->nb > 0)?true:false); } else - return false; - + { + $this->error=$this->db->lasterror(); + return false; + } } /** @@ -2752,7 +2767,7 @@ class Societe extends CommonObject /** * Set commnunication level * - * @param User $user Utilisateur qui definie la remise + * @param User $user User making change * @return int <0 if KO, >0 if OK */ function set_commnucation_level($user) From 4d527d26af5609f343783d563685050de9ea08c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Mar 2013 17:40:18 +0100 Subject: [PATCH 101/150] New: support full address into user cards. --- htdocs/user/class/user.class.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index feb1b6164e0..37ff6735df5 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -912,6 +912,11 @@ class User extends CommonObject $this->office_phone = $contact->phone_pro; $this->office_fax = $contact->fax; $this->user_mobile = $contact->phone_mobile; + $this->address = $contact->address; + $this->zip = $contact->zip; + $this->town = $contact->town; + $this->state_id = $contact->state_id; + $this->country_id = $contact->country_id; if (empty($login)) $login=strtolower(substr($contact->firstname, 0, 4)) . strtolower(substr($contact->lastname, 0, 4)); $this->login = $login; @@ -974,11 +979,16 @@ class User extends CommonObject // Positionne parametres $this->admin = 0; - $this->lastname = $member->lastname; - $this->firstname = $member->firstname; - $this->email = $member->email; - $this->fk_member = $member->id; - $this->pass = $member->pass; + $this->lastname = $member->lastname; + $this->firstname = $member->firstname; + $this->email = $member->email; + $this->fk_member = $member->id; + $this->pass = $member->pass; + $this->address = $member->address; + $this->zip = $member->zip; + $this->town = $member->town; + $this->state_id = $member->state_id; + $this->country_id = $member->country_id; if (empty($login)) $login=strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4)); $this->login = $login; @@ -1120,6 +1130,11 @@ class User extends CommonObject $sql.= ", firstname = '".$this->db->escape($this->firstname)."'"; $sql.= ", login = '".$this->db->escape($this->login)."'"; $sql.= ", admin = ".$this->admin; + $sql.= ", address = '".$this->db->escape($this->address)."'"; + $sql.= ", zip = '".$this->db->escape($this->zip)."'"; + $sql.= ", town = '".$this->db->escape($this->town)."'"; + $sql.= ", fk_state = '".$this->db->escape($this->state_id)."'"; + $sql.= ", fk_country = '".$this->db->escape($this->country_id)."'"; $sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; From 73de8d169f5fbb333df96058121be69f4b924360 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Mar 2013 18:04:46 +0100 Subject: [PATCH 102/150] Fix: Avoid call method on non object error --- .../core/class/commondocgenerator.class.php | 28 +++++++++---------- .../doc/doc_generic_invoice_odt.modules.php | 10 +++---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index faccaa31545..9561aa288fb 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -185,11 +185,11 @@ abstract class CommonDocGenerator } $array_thirdparty=array_merge($array_thirdparty,array('company_options_'.$key => $object->array_options['options_'.$key])); } - } + } return $array_thirdparty; } - + /** * Define array with couple substitution key => substitution value * @@ -201,7 +201,7 @@ abstract class CommonDocGenerator function get_substitutionarray_propal($object,$outputlangs,$array_key='object') { global $conf; - + $array_propal=array( $array_key.'_id'=>$object->id, $array_key.'_ref'=>$object->ref, @@ -224,14 +224,14 @@ abstract class CommonDocGenerator $array_key.'_note_private'=>$object->note, $array_key.'_note'=>$object->note_public, ); - + // Add vat by rates foreach ($object->lines as $line) { if (empty($array_propal[$array_key.'_total_vat_'.$line->tva_tx])) $array_propal[$array_key.'_total_vat_'.$line->tva_tx]=0; $array_propal[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva; } - + // Retrieve extrafields if(is_array($object->array_options) && count($object->array_options)) { @@ -240,12 +240,12 @@ abstract class CommonDocGenerator $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label('propal',true); $object->fetch_optionals($object->id,$extralabels); - + $array_propal = $this->fill_substitutionarray_with_extrafields($object,$array_propal,$extrafields,$array_key,$outputlangs); } return $array_propal; } - + /** * Define array with couple substitution key => substitution value @@ -257,7 +257,7 @@ abstract class CommonDocGenerator function get_substitutionarray_propal_lines($line,$outputlangs) { global $conf; - + return array( 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), 'line_product_ref'=>$line->product_ref, @@ -274,7 +274,7 @@ abstract class CommonDocGenerator 'line_date_end'=>$line->date_end ); } - + /** * Fill array with couple extrafield key => extrafield value * @@ -309,14 +309,14 @@ abstract class CommonDocGenerator { $object->array_options['options_'.$key] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour'):''); } - $array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); + $array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); } - + return $array_to_fill; - + } - - + + /** * Rect pdf * diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 957b5d85428..977de72d164 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -139,7 +139,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if (empty($resarray['object_total_vat_'.$line->tva_tx])) $resarray['object_total_vat_'.$line->tva_tx]=0; $resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva; } - + // Retrieve extrafields if(is_array($object->array_options) && count($object->array_options)) { @@ -148,7 +148,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label('facture',true); $object->fetch_optionals($object->id,$extralabels); - + $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key='object',$outputlangs); } return $resarray; @@ -358,14 +358,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures { $socobject=$object->client; } - + // Fetch info for linked propal $linked_propal = $object->fetchObjectLinked('','','',''); print '
';
                 //print_r($object->linkedObjects['propal']); exit;
 
                 $propal_object = $object->linkedObjects['propal'][0];
-                
+
                 // Make substitution
                 $substitutionarray=array(
                     '__FROM_NAME__' => $this->emetteur->nom,
@@ -415,7 +415,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 				$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
 				$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
 				$array_objet=$this->get_substitutionarray_object($object,$outputlangs);
-				$array_propal=$this->get_substitutionarray_propal($propal_object,$outputlangs,'propal');
+				$array_propal=is_object($propal_object)?$this->get_substitutionarray_propal($propal_object,$outputlangs,'propal'):array();
 
 				$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal);
 				complete_substitutions_array($tmparray, $outputlangs, $object);

From 9fe0d2cdd25927b2909c34ed4aea94d1b4998a7a Mon Sep 17 00:00:00 2001
From: Laurent Destailleur 
Date: Sat, 23 Mar 2013 18:22:25 +0100
Subject: [PATCH 103/150] Fix: Removed a lors 'pre'. Also accurency of data
 must not be overwrite by odt template engine (to be compatible with all
 countries precision).

---
 .../doc/doc_generic_invoice_odt.modules.php       | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 977de72d164..ee80dbbb141 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -121,16 +121,16 @@ class doc_generic_invoice_odt extends ModelePDFFactures
         	'object_payment_mode'=>($outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code)!='PaymentType'.$object->mode_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentType'.$object->mode_reglement_code):$object->mode_reglement),
         	'object_payment_term_code'=>$object->cond_reglement_code,
         	'object_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code)!='PaymentCondition'.$object->cond_reglement_code?$outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code):$object->cond_reglement),
-        	'object_total_ht'=>price2num($object->total_ht,2),
-            'object_total_vat'=>price2num($object->total_tva,2),
-            'object_total_ttc'=>price2num($object->total_ttc,2),
+        	'object_total_ht'=>price2num($object->total_ht),
+            'object_total_vat'=>price2num($object->total_tva),
+            'object_total_ttc'=>price2num($object->total_ttc),
             'object_total_discount_ht' => price2num($object->getTotalDiscount(), 0, $outputlangs),
             'object_vatrate'=>(isset($object->tva)?vatrate($object->tva):''),
             'object_note_private'=>$object->note,
             'object_note'=>$object->note_public,
         	// Payments
             'object_already_payed'=>$alreadypayed,
-            'object_remain_to_pay'=>price2num($object->total_ttc - $sumpayed,2)
+            'object_remain_to_pay'=>price2num($object->total_ttc - $sumpayed)
         );
 
         // Add vat by rates
@@ -174,9 +174,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
             'line_up'=>price($line->subprice, 0, $outputlangs),
             'line_qty'=>$line->qty,
             'line_discount_percent'=>($line->remise_percent?$line->remise_percent.'%':''),
-            'line_price_ht'=>price2num($line->total_ht, 2),
-            'line_price_ttc'=>price2num($line->total_ttc, 2),
-            'line_price_vat'=>price2num($line->total_tva, 2),
+            'line_price_ht'=>price2num($line->total_ht),
+            'line_price_ttc'=>price2num($line->total_ttc),
+            'line_price_vat'=>price2num($line->total_tva),
             'line_date_start'=>dol_print_date($line->date_start, 'day', false, $outputlangs),
             'line_date_end'=>dol_print_date($line->date_end, 'day', false, $outputlangs),
         );
@@ -361,7 +361,6 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 
                 // Fetch info for linked propal
                 $linked_propal = $object->fetchObjectLinked('','','','');
-                print '
';
                 //print_r($object->linkedObjects['propal']); exit;
 
                 $propal_object = $object->linkedObjects['propal'][0];

From 7f61061805e963ef30f072cb6ecc7ee59e785c2f Mon Sep 17 00:00:00 2001
From: Grand Philippe 
Date: Sat, 23 Mar 2013 19:08:02 +0100
Subject: [PATCH 104/150] fix : wrong URL

---
 htdocs/compta/bank/rappro.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php
index 2463c768098..d631e8e1843 100644
--- a/htdocs/compta/bank/rappro.php
+++ b/htdocs/compta/bank/rappro.php
@@ -84,7 +84,7 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
 
     if (! $error)
     {
-		header('Location: '.DOL_URL_ROOT.'/compta/bank/rappro?account='.$id);	// To avoid to submit twice and allow back
+		header('Location: '.DOL_URL_ROOT.'/compta/bank/rappro.php?account='.$id);	// To avoid to submit twice and allow back
     	exit;
     }
 }

From c3589e97856911e080a99fbcc98084091f99a449 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur 
Date: Sat, 23 Mar 2013 19:23:17 +0100
Subject: [PATCH 105/150] Some debug into cron module: - Because cron is a
 module, constant must start with CRON_. - Miscellanous fixes. - For external
 link to run jobs from url, we must forge url using conf file and not
 autodetect url.

---
 htdocs/core/class/html.formcron.class.php     |  16 +-
 htdocs/core/lib/cron.lib.php                  |  25 +--
 htdocs/core/modules/modCron.class.php         |  16 +-
 htdocs/cron/admin/cron.php                    |  79 +++++----
 htdocs/cron/card.php                          | 142 ++++++++-------
 htdocs/cron/class/cronjob.class.php           | 162 +++++++++---------
 htdocs/langs/fr_FR/cron.lang                  |   4 +-
 htdocs/public/cron/cron_run_jobs.php          |  12 +-
 .../eldy/img/{menus => }/object_cron.png      | Bin
 scripts/cron/cron_run_jobs.php                | 102 ++++++-----
 10 files changed, 297 insertions(+), 261 deletions(-)
 rename htdocs/theme/eldy/img/{menus => }/object_cron.png (100%)
 mode change 100644 => 100755 scripts/cron/cron_run_jobs.php

diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php
index 2acb83e3f05..b6747e04a56 100644
--- a/htdocs/core/class/html.formcron.class.php
+++ b/htdocs/core/class/html.formcron.class.php
@@ -41,7 +41,7 @@ class FormCron extends Form
 		return 1;
 	}
 
-	
+
 	/**
 	 * Display On Off selector
 	 *
@@ -53,7 +53,7 @@ class FormCron extends Form
 	function select_typejob($htmlname,$selected=0,$readonly=0)
 	{
 		global $langs;
-		
+
 		$langs->load('cron@cron');
 		if (!empty($readonly)) {
 			if ($selected=='command') {
@@ -68,26 +68,26 @@ class FormCron extends Form
 				$out.='';
 			}
 		}else {
-		
-		$out='';
+
 		if ($selected=='command') {
 			$selected_attr=' selected=\"selected\" ';
 		} else {
 			$selected_attr='';
 		}
 		$out.= '';
-		
+
 		if ($selected=='method') {
 			$selected_attr=' selected=\"selected\" ';
 		} else {
 			$selected_attr='';
 		}
 		$out.= '';
-		
+
 		$out.='';
 		}
-		
+
 		return $out;
 	}
 }
diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php
index abd85131e29..7ba1e7b38a3 100644
--- a/htdocs/core/lib/cron.lib.php
+++ b/htdocs/core/lib/cron.lib.php
@@ -15,19 +15,18 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see .
  */
+
 /**
  *	\file       cron/lib/cron.lib.php
- *	\brief      Ensemble de fonctions de base pour le module jobs
- *	\ingroup    jobs
+ *	\brief      Function for module cron
+ *	\ingroup    cron
  */
 
 /**
- * Return array of tabs to used on pages for third parties cards.
+ * Return array of tabs to used on pages to setup cron module.
  *
- * @param 	Object	$object		Object company shown
  * @return 	array				Array of tabs
  */
-
 function cronadmin_prepare_head()
 {
     global $langs, $conf, $user;
@@ -35,18 +34,24 @@ function cronadmin_prepare_head()
     $head = array();
 
     $head[$h][0] = dol_buildpath('/cron/admin/cron.php', 1);
-    $head[$h][1] = $langs->trans("CronSetup");
+    $head[$h][1] = $langs->trans("Miscellanous");
     $head[$h][2] = 'setup';
     $h++;
-    
+
     complete_head_from_modules($conf, $langs, $object, $head, $h, 'cronadmin');
-    
+
     complete_head_from_modules($conf, $langs, $object, $head, $h, 'cronadmin', 'remove');
-    
+
 
     return $head;
 }
 
+/**
+ * Return array of tabs to used on a cron job
+ *
+ * @param 	Object	$object		Object cron
+ * @return 	array				Array of tabs
+ */
 function cron_prepare_head($object)
 {
 	global $langs, $conf, $user;
@@ -59,7 +64,7 @@ function cron_prepare_head($object)
 	$h++;
 
 	$head[$h][0] = dol_buildpath('/cron/info.php', 1).'?id='.$object->id;
-	$head[$h][1] = $langs->trans("CronInfoPage");
+	$head[$h][1] = $langs->trans("Info");
 	$head[$h][2] = 'info';
 	$h++;
 
diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php
index 53d9afabf30..828e3c2664a 100644
--- a/htdocs/core/modules/modCron.class.php
+++ b/htdocs/core/modules/modCron.class.php
@@ -43,7 +43,7 @@ class modCron extends DolibarrModules
 
 		// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
 		// It is used to group modules in module setup page
-        $this->family = "technic";
+        $this->family = "base";
         // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
         $this->name = preg_replace('/^mod/i','',get_class($this));
         $this->description = "Enable the Dolibarr cron service";
@@ -70,9 +70,9 @@ class modCron extends DolibarrModules
 
         // Constantes
         //-----------
-        	$this->const = array(	
+        	$this->const = array(
 				0=>array(
-					'MAIN_CRON_KEY',
+					'CRON_KEY',
 					'chaine',
 					'',
 					'CRON KEY',
@@ -93,25 +93,25 @@ class modCron extends DolibarrModules
 		$this->rights = array();		// Permission array used by this module
 		$this->rights_class = 'cron';
 		$r=0;
-		
+
 		$this->rights[$r][0] = 23001;
 		$this->rights[$r][1] = 'Read cron jobs';
 		$this->rights[$r][3] = 1;
 		$this->rights[$r][4] = 'read';
 		$r++;
-		
+
 		$this->rights[$r][0] = 23002;
 		$this->rights[$r][1] = 'Create cron Jobs';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'create';
 		$r++;
-		
+
 		$this->rights[$r][0] = 23003;
 		$this->rights[$r][1] = 'Delete cron Jobs';
 		$this->rights[$r][3] = 0;
 		$this->rights[$r][4] = 'delete';
 		$r++;
-		
+
 		$this->rights[$r][0] = 23004;
 		$this->rights[$r][1] = 'Execute cron Jobs';
 		$this->rights[$r][3] = 0;
@@ -131,7 +131,7 @@ class modCron extends DolibarrModules
 						        'target'=>'',
 						        'user'=>2);				                // 0=Menu for internal users, 1=external users, 2=both
         $r++;
-        
+
         $this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=modulesadmintools',		    // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
 						        'type'=>'left',			                // This is a Left menu entry
 						        'titre'=>'CronListInactive',
diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php
index 894e9dc4457..7846a25e636 100644
--- a/htdocs/cron/admin/cron.php
+++ b/htdocs/cron/admin/cron.php
@@ -1,28 +1,28 @@
 
  * Copyright (C) 2005-2013	Laurent Destailleur		
-* Copyright (C) 2011		Juanjo Menent			
-* Copyright (C) 2012		Regis Houssin			
-* Copyright (C) 2013		Florian Henry			
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 3 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see .
-*/
+ * Copyright (C) 2011		Juanjo Menent			
+ * Copyright (C) 2012		Regis Houssin			
+ * Copyright (C) 2013		Florian Henry			
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
 
 /**
  *      \file       cron/admin/cron.php
-*		\ingroup    cron
-*/
+ *		\ingroup    cron
+ */
 
 // Dolibarr environment
 $res = @include("../../main.inc.php"); // From htdocs directory
@@ -44,7 +44,7 @@ if (!empty($actionsave))
 
 	$db->begin();
 
-	$i+=dolibarr_set_const($db,'MAIN_CRON_KEY',trim(GETPOST("MAIN_CRON_KEY")),'chaine',0,'',0);
+	$i+=dolibarr_set_const($db,'CRON_KEY',trim(GETPOST("CRON_KEY")),'chaine',0,'',0);
 
 	if ($i >= 1)
 	{
@@ -61,7 +61,7 @@ if (!empty($actionsave))
 
 /*
  *	View
-*/
+ */
 
 llxHeader();
 
@@ -70,6 +70,7 @@ print_fiche_titre($langs->trans("CronSetup"),$linkback,'setup');
 
 // Configuration header
 $head = cronadmin_prepare_head();
+
 dol_fiche_head($head,'setup',$langs->trans("Module2300Name"),0,'cron');
 
 print "
\n"; @@ -86,7 +87,7 @@ print ""; print '
'; print ''; -print ''; @@ -101,38 +102,42 @@ print ''; print ''; +dol_fiche_end(); + print '

'; +// Define $urlwithroot +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + // Cron launch print ''.$langs->trans("URLToLaunchCronJobs").':
'; -$url=dol_buildpath('/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login; +$url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login; print img_picto('','object_globe.png').' '.$url."
\n"; print ' '.$langs->trans("OrToLaunchASpecificJob").'
'; -$url=dol_buildpath('/public/cron/cron_run_jobs.php',1).(empty($conf->global->MAIN_CRON_KEY)?'':'?securitykey='.$conf->global->MAIN_CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; +$url=$urlwithroot.'/public/cron/cron_run_jobs.php'.(empty($conf->global->CRON_KEY)?'':'?securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid'; print img_picto('','object_globe.png').' '.$url."
\n"; print '
'; -print '
'; $linuxlike=1; if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; -if ($linuxlike) { - print $langs->trans("CronExplainHowToRunUnix"); -} else { - print $langs->trans("CronExplainHowToRunWin"); -} print '
'; print ''.$langs->trans("FileToLaunchCronJobs").':
'; -$file='/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->MAIN_CRON_KEY)?'securitykey':''.$conf->global->MAIN_CRON_KEY.'').' '.$user->login.' cronjobid(optionnal)'; -if ($linuxlike) { - print 'user@host:'.DOL_DOCUMENT_ROOT.'$ php ..'.$file."
\n"; -} else { - print DOL_DOCUMENT_ROOT.'> php ..'.$file."
\n"; -} + +$file='/scripts/cron/cron_run_jobs.php'.' '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$user->login.' [cronjobid]'; +print '
\n"; print '
'; +print $langs->trans("Note").': '; +if ($linuxlike) { + print $langs->trans("CronExplainHowToRunUnix"); +} else { + print $langs->trans("CronExplainHowToRunWin"); +} @@ -149,7 +154,7 @@ if (! empty($conf->use_javascript_ajax)) generic: true }, function(token) { - $("#MAIN_CRON_KEY").val(token); + $("#CRON_KEY").val(token); }); }); });'; diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index bd6ffb0e5c9..feb86585181 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -42,6 +42,11 @@ $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $cancel=GETPOST('cancel'); + +/* + * Actions + */ + $object = new Cronjob($db); if (!empty($id)) { $result=$object->fetch($id); @@ -56,13 +61,13 @@ if(!empty($cancel)) { }else { Header ( "Location: ".dol_buildpath('/cron/cron/list.php',1).'?status=1'); } - + } // Delete jobs if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->delete){ - + $result = $object->delete($user); if ($result < 0) { @@ -105,7 +110,7 @@ if ($action=='add') { $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); $object->unitfrequency=GETPOST('unitfrequency','int'); $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int'); - + //Ajout de la tache cron $result = $object->create($user); @@ -138,7 +143,7 @@ if ($action=='update') { $object->dateend=dol_mktime(GETPOST('dateendhour','int'), GETPOST('dateendmin','int'), 0, GETPOST('dateendmonth','int'), GETPOST('dateendday','int'), GETPOST('dateendyear','int')); $object->unitfrequency=GETPOST('unitfrequency','int'); $object->frequency=$object->unitfrequency * GETPOST('nbfrequency','int'); - + //Ajout de la tache cron $result = $object->update($user); @@ -187,16 +192,23 @@ if ($action=='inactive') { } -/* - * View -*/ +/* + * View + */ + +$form = new Form($db); +$formCron = new FormCron($db); + llxHeader('',$langs->trans("CronAdd")); -if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') { +if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') +{ $head=cron_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'bill'); -} elseif ($action=='create') { +} +elseif ($action=='create') +{ print_fiche_titre($langs->trans("CronTask"),'','setup'); } @@ -223,9 +235,6 @@ if ($conf->use_javascript_ajax) print ''."\n"; } -$form = new Form($db); -$formCron = new FormCron($db); - if ($action == 'delete') { $ret=$form->form_confirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1); @@ -243,33 +252,37 @@ if ($action == 'execute'){ /* * Create Template -*/ + */ -if (empty($object->status)) { +if (empty($object->status) && $action != 'create') +{ dol_htmloutput_mesg($langs->trans("CronTaskInactive"),'','warning',1); } if (($action=="create") || ($action=="edit")) { - + print ''; print ''."\n"; - if (!empty($object->id)) { + if (!empty($object->id)) + { print ''."\n"; print ''."\n"; - } else { + } + else + { print ''."\n"; } - + print '
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1,1,'',1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).'
'; print ''; print ''; print '
'.$langs->trans("KeyForCronAccess").''; +print ''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); print '
'; print '"; - print ""; print ""; print "\n"; - + print ""; print "\n"; - + print ""; print "\n"; - + print ""; $priority=0; @@ -315,10 +328,10 @@ if (($action=="create") || ($action=="edit")) { print ""; print "\n"; - + print ""; - print ""; print "\n"; - - + print '"; print ""; print ""; print ""; print ""; print ""; print "\n"; - + print '"; print ""; print "\n"; - + print '"; print "\n"; - + print '"; print "\n"; - + print '
'; print $langs->trans('CronLabel')."label."\" /> "; + print "label."\" /> "; print ""; print "
"; print $langs->trans('CronType').""; print $formCron->select_typejob('jobtype',$object->jobtype); @@ -290,7 +303,7 @@ if (($action=="create") || ($action=="edit")) { print ""; print "
"; print $langs->trans('CronDtEnd').""; if(!empty($object->dateend)){ @@ -303,7 +316,7 @@ if (($action=="create") || ($action=="edit")) { print ""; print "
"; print $langs->trans('CronPriority').""; print "
"; print $langs->trans('CronEvery')."unitfrequency=="60"){ $input .= ' checked="checked" />'; } @@ -337,7 +350,7 @@ if (($action=="create") || ($action=="edit")) { $input .= ""; print $input; - $input = "unitfrequency=="3600"){ $input .= ' checked="checked" />'; } @@ -347,7 +360,7 @@ if (($action=="create") || ($action=="edit")) { $input .= ""; print $input; - $input = "unitfrequency=="86400"){ $input .= ' checked="checked" />'; } @@ -370,11 +383,10 @@ if (($action=="create") || ($action=="edit")) { print ""; print "
'; print $langs->trans('CronModule').""; - print "module_name."\" /> "; + print "module_name."\" /> "; print ""; print $form->textwithpicto('',$langs->trans("CronModuleHelp"),1,'help'); @@ -383,7 +395,7 @@ if (($action=="create") || ($action=="edit")) { print '
'; print $langs->trans('CronClassFile').""; - print "classesname."\" /> "; + print "classesname."\" /> "; print ""; print $form->textwithpicto('',$langs->trans("CronClassFileHelp"),1,'help'); @@ -392,7 +404,7 @@ if (($action=="create") || ($action=="edit")) { print '
'; print $langs->trans('CronObject').""; - print "objectname."\" /> "; + print "objectname."\" /> "; print ""; print $form->textwithpicto('',$langs->trans("CronObjectHelp"),1,'help'); @@ -401,7 +413,7 @@ if (($action=="create") || ($action=="edit")) { print '
'; print $langs->trans('CronMethod').""; - print "methodename."\" /> "; + print "methodename."\" /> "; print ""; print $form->textwithpicto('',$langs->trans("CronMethodHelp"),1,'help'); @@ -410,22 +422,22 @@ if (($action=="create") || ($action=="edit")) { print '
'; print $langs->trans('CronArgs').""; - print "params."\" /> "; + print "params."\" /> "; print ""; print $form->textwithpicto('',$langs->trans("CronArgsHelp"),1,'help'); print "
'; print $langs->trans('CronCommand').""; - print "command."\" /> "; + print "command."\" /> "; print ""; print $form->textwithpicto('',$langs->trans("CronCommandHelp"),1,'help'); print "
'; print $langs->trans('CronNote').""; $doleditor = new DolEditor('note', $object->note, '', 160, 'dolibarr_notes', 'In', true, false, 0, 4, 90); @@ -435,7 +447,7 @@ if (($action=="create") || ($action=="edit")) { print "
'; print "trans("Save")."\">"; print "trans("Cancel")."\">"; @@ -443,20 +455,22 @@ if (($action=="create") || ($action=="edit")) { print ""; print "
'; - + print "\n"; - -}else { - + +} +else +{ + /* * view Template - */ - + */ + // box add_jobs_box print ''; - + print '"; print ""; print ""; - + print ""; - + print ""; - + print ""; print ""; - + print ""; print ""; - + print ""; print ""; - - + + print '"; - + print '"; - + print '"; - + print '"; - + print '"; - + print '"; - + print '"; - + print '"; print '
'; print $langs->trans('CronId')."".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id'); @@ -466,7 +480,7 @@ if (($action=="create") || ($action=="edit")) { print $langs->trans('CronLabel')."".$object->label; print "
"; print $langs->trans('CronType').""; print $formCron->select_typejob('jobtype',$object->jobtype,1); @@ -476,32 +490,32 @@ if (($action=="create") || ($action=="edit")) { print $langs->trans('CronHourStart').""; if(!empty($object->datestart)) {print dol_print_date($object->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} print "
"; print $langs->trans('CronDtEnd').""; if(!empty($object->dateend)) {print dol_print_date($object->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} print "
"; print $langs->trans('CronPriority')."".$object->priority; print "
"; print $langs->trans('CronNbRun')."".$object->nbrun; print "
"; print $langs->trans('CronEvery').""; if($object->unitfrequency == "60") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Minutes'); if($object->unitfrequency == "3600") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Hours'); if($object->unitfrequency == "86400") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Days'); - if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Weeks'); + if($object->unitfrequency == "604800") print $langs->trans('CronEach')." ".($object->frequency/$object->unitfrequency)." ".$langs->trans('Weeks'); print "
'; print $langs->trans('CronModule').""; print $object->module_name; @@ -526,44 +540,48 @@ if (($action=="create") || ($action=="edit")) { print $langs->trans('CronArgs').""; print $object->params; print "
'; print $langs->trans('CronCommand').""; print $object->command; print "
'; print $langs->trans('CronNote').""; print $object->note; print "
'; print $langs->trans('CronDtLastLaunch').""; if(!empty($object->datelastrun)) {print dol_print_date($object->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} print "
'; print $langs->trans('CronDtNextLaunch').""; if(!empty($object->datenextrun)) {print dol_print_date($object->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} print "
'; print $langs->trans('CronDtLastResult').""; if(!empty($object->datelastresult)) {print dol_print_date($object->datelastresult,'dayhourtext');} else {print $langs->trans('CronNone');} print "
'; print $langs->trans('CronLastResult').""; print $object->lastresult; print "
'; print $langs->trans('CronLastOutput').""; print nl2br($object->lastoutput); print "
'; - + + + print dol_fiche_end(); + + print "\n\n
\n"; if (! $user->rights->cron->create) { print ''.$langs->trans("Edit").''; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b24055c6f3d..ebc6c4952e3 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -37,7 +37,7 @@ class Cronjob extends CommonObject var $table_element='cronjob'; //!< Name of table without prefix where object is stored var $id; - + var $ref; //Use for prevnext_ref var $jobtype; var $tms=''; @@ -65,10 +65,10 @@ class Cronjob extends CommonObject var $fk_user_mod; var $note; var $nbrun; - + var $lines; - + /** @@ -96,7 +96,7 @@ class Cronjob extends CommonObject $error=0; // Clean parameters - + if (isset($this->label)) $this->label=trim($this->label); if (isset($this->jobtype)) $this->jobtype=trim($this->jobtype); if (isset($this->command)) $this->command=trim($this->command); @@ -152,7 +152,7 @@ class Cronjob extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob("; - + $sql.= "datec,"; $sql.= "jobtype,"; $sql.= "label,"; @@ -179,9 +179,9 @@ class Cronjob extends CommonObject $sql.= "note,"; $sql.= "nbrun"; - + $sql.= ") VALUES ("; - + $sql.= " ".$this->db->idate(dol_now()).","; $sql.= " ".(! isset($this->jobtype)?'NULL':"'".$this->db->escape($this->jobtype)."'").","; $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").","; @@ -208,16 +208,16 @@ class Cronjob extends CommonObject $sql.= " ".(! isset($this->note)?'NULL':"'".$this->db->escape($this->note)."'").","; $sql.= " ".(! isset($this->nbrun)?'0':"'".$this->db->escape($this->nbrun)."'").""; - + $sql.= ")"; - + $this->db->begin(); dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob"); @@ -266,7 +266,7 @@ class Cronjob extends CommonObject global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; - + $sql.= " t.tms,"; $sql.= " t.datec,"; $sql.= " t.jobtype,"; @@ -294,7 +294,7 @@ class Cronjob extends CommonObject $sql.= " t.note,"; $sql.= " t.nbrun"; - + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $sql.= " WHERE t.rowid = ".$id; @@ -308,7 +308,7 @@ class Cronjob extends CommonObject $this->id = $obj->rowid; $this->ref = $obj->rowid; - + $this->tms = $this->db->jdate($obj->tms); $this->datec = $this->db->jdate($obj->datec); $this->label = $obj->label; @@ -336,7 +336,7 @@ class Cronjob extends CommonObject $this->note = $obj->note; $this->nbrun = $obj->nbrun; - + } $this->db->free($resql); @@ -349,7 +349,7 @@ class Cronjob extends CommonObject return -1; } } - + /** * Load object in memory from the database * @@ -392,8 +392,8 @@ class Cronjob extends CommonObject $sql.= " t.fk_user_mod,"; $sql.= " t.note,"; $sql.= " t.nbrun"; - - + + $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as t"; $status = (empty($status))?'0':'1'; $sql.= " WHERE t.status=".$status; @@ -403,43 +403,43 @@ class Cronjob extends CommonObject $sql.= ' AND '.$key.' LIKE \'%'.$value.'%\''; } } - - - $sql.= " ORDER BY $sortfield $sortorder "; + + + $sql.= " ORDER BY $sortfield $sortorder "; if (!empty($limit) && !empty($offset)) { $sql.= $this->db->plimit( $limit + 1 ,$offset); } - + $sqlwhere = array(); - + if (!empty($module_name)) { $sqlwhere[]='(t.module_name='.$module_name.')'; } if (count($sqlwhere)>0) { $sql.= " WHERE ".implode(' AND ',$sqlwhere); } - + dol_syslog(get_class($this)."::fetch_all sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { $num=$this->db->num_rows($resql); $i=0; - + if ($num) { $this->lines=array(); - + while ($i < $num) { - + $line = new Cronjobline(); - + $obj = $this->db->fetch_object($resql); - + $line->id = $obj->rowid; $line->ref = $obj->rowid; - + $line->tms = $this->db->jdate($obj->tms); $line->datec = $this->db->jdate($obj->datec); $line->label = $obj->label; @@ -466,15 +466,15 @@ class Cronjob extends CommonObject $line->fk_user_mod = $obj->fk_user_mod; $line->note = $obj->note; $line->nbrun = $obj->nbrun; - + $this->lines[]=$line; - + $i++; - + } } $this->db->free($resql); - + return 1; } else @@ -496,13 +496,13 @@ class Cronjob extends CommonObject function update($user=0, $notrigger=0) { global $conf, $langs; - + $langs->load('cron'); - + $error=0; // Clean parameters - + if (isset($this->label)) $this->label=trim($this->label); if (isset($this->jobtype)) $this->jobtype=trim($this->jobtype); if (isset($this->command)) $this->command=trim($this->command); @@ -558,11 +558,11 @@ class Cronjob extends CommonObject $this->errors[]=$langs->trans('CronFieldMandatory',$langs->trans('CronObject')); $error++; } - + // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."cronjob SET"; - + $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").","; $sql.= " jobtype=".(isset($this->jobtype)?"'".$this->db->escape($this->jobtype)."'":"null").","; $sql.= " command=".(isset($this->command)?"'".$this->db->escape($this->command)."'":"null").","; @@ -587,7 +587,7 @@ class Cronjob extends CommonObject $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").","; $sql.= " nbrun=".(isset($this->nbrun)?$this->nbrun:"null"); - + $sql.= " WHERE rowid=".$this->id; $this->db->begin(); @@ -595,7 +595,7 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } - + if (! $error) { if (! $notrigger) @@ -755,7 +755,7 @@ class Cronjob extends CommonObject { $this->id=0; $this->ref=0; - + $this->tms=''; $this->datec=''; $this->label=''; @@ -780,24 +780,24 @@ class Cronjob extends CommonObject $this->status=''; $this->fk_user_author=''; $this->fk_user_mod=''; - $this->note=''; + $this->note=''; $this->nbrun=''; } - + /** - * Load object information + * Load object information * * @return void */ function info() { global $langs; - + $sql = "SELECT"; $sql.= " f.rowid, f.datec, f.tms, f.fk_user_mod, f.fk_user_author"; $sql.= " FROM ".MAIN_DB_PREFIX."cronjob as f"; $sql.= " WHERE f.rowid = ".$this->id; - + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -812,7 +812,7 @@ class Cronjob extends CommonObject $this->user_creation = $obj->fk_user_author; } $this->db->free($resql); - + return 1; } else @@ -822,26 +822,26 @@ class Cronjob extends CommonObject return -1; } } - + /** * Run a job - * + * * @param string $userlogin User login * @return int <0 if KO, >0 if OK */ function run_jobs($userlogin) { global $langs, $conf; - + $langs->load('cron'); - + if (empty($userlogin)) { $this->error="User login is mandatory"; dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); return -1; } - + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $user=new User($this->db); $result=$user->fetch('',$userlogin); @@ -856,14 +856,14 @@ class Cronjob extends CommonObject return -1; } } - + dol_syslog(get_class($this)."::run_jobs userlogin:$userlogin", LOG_DEBUG); - + $error=0; $now=dol_now(); - + $this->db->begin(); - + if ($this->jobtype=='method') { // load classes $ret=dol_include_once("/".$this->module_name."/class/".$this->classesname,$this->objectname); @@ -872,19 +872,19 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR); return -1; } - + // Load langs $result=$langs->load($this->module_name.'@'.$this->module_name); if ($result<0) { dol_syslog(get_class($this)."::run_jobs Cannot load module langs".$langs->error, LOG_ERR); return -1; } - + dol_syslog(get_class($this)."::run_jobs ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG); - + // Create Object for the call module $object = new $this->objectname($this->db); - + $params_arr = array(); $params_arr=explode(", ",$this->params); if (!is_array($params_arr)) { @@ -892,7 +892,7 @@ class Cronjob extends CommonObject }else { $result = call_user_func_array(array($object, $this->methodename), $params_arr); } - + if ($result===false) { dol_syslog(get_class($this)."::run_jobs ".$object->error, LOG_ERR); return -1; @@ -900,15 +900,15 @@ class Cronjob extends CommonObject $this->lastoutput=var_export($result,true); $this->lastresult=var_export($result,true); } - + } elseif ($this->jobtype=='command') { dol_syslog(get_class($this)."::run_jobs system:".$this->command, LOG_DEBUG); $output_arr=array(); - + exec($this->command, $output_arr,$retval); - + dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG); - + $this->lastoutput=''; if (is_array($output_arr) && count($output_arr)>0) { foreach($output_arr as $val) { @@ -917,7 +917,7 @@ class Cronjob extends CommonObject } $this->lastresult=$retval; } - + $this->datelastresult=$now; $this->datelastrun=$now; $this->nbrun=$this->nbrun+1; @@ -930,23 +930,23 @@ class Cronjob extends CommonObject $this->db->commit(); return 1; } - - + + } - + /** * Reprogram a job * * @param string $userlogin User login - * @return int <0 if KO, >0 if OK - * + * @return int <0 if KO, >0 if OK + * */ function reprogram_jobs($userlogin) { global $langs, $conf; - + dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG); - + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $user=new User($this->db); $result=$user->fetch('',$userlogin); @@ -961,9 +961,9 @@ class Cronjob extends CommonObject return -1; } } - + dol_syslog(get_class($this)."::reprogram_jobs ", LOG_DEBUG); - + if (empty($this->datenextrun)) { $this->datenextrun=dol_now()+$this->frequency; } else { @@ -972,15 +972,15 @@ class Cronjob extends CommonObject } else { $this->datenextrun=$this->datenextrun+$this->frequency; } - } + } $result = $this->update($user); if ($result<0) { dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; } - + return 1; - + } } @@ -989,10 +989,10 @@ class Cronjob extends CommonObject * Crob Job line class */ class Cronjobline{ - + var $id; var $ref; - + var $tms=''; var $datec=''; var $label; @@ -1018,7 +1018,7 @@ class Cronjobline{ var $fk_user_mod; var $note; var $nbrun; - + /** * Constructor * diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index d0aaccfecf7..b5fa47b336a 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -9,8 +9,8 @@ URLToLaunchCronJobs=URL pour lancer les taches automatiques OrToLaunchASpecificJob=Ou pour lancer une tache spécifique KeyForCronAccess=Clé de sécurité pour l'URL de lancement des taches automatiques FileToLaunchCronJobs=Commande pour lancer les taches automatiques -CronExplainHowToRunUnix=Sur un environement Unix vous pouvez paramétré CronTab pour executer cette commande toute les minutes -CronExplainHowToRunWin=Sur un environement Microsoft(tm) Windows vous pouvez utilisr le planificateur de tache pour lancer cette commande toute les minutes +CronExplainHowToRunUnix=Sur un environement Unix vous pouvez paramétrer CronTab pour executer cette commande toute les minutes. +CronExplainHowToRunWin=Sur un environement Microsoft(tm) Windows vous pouvez utiliser le planificateur de tache pour lancer cette commande toute les minutes. # # Menu diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 838c298212f..7f25cfaf63c 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -49,7 +49,7 @@ if (empty($key)) { echo 'securitykey is require'; exit; } -if($key != $conf->global->MAIN_CRON_KEY) +if($key != $conf->global->CRON_KEY) { echo 'securitykey is wrong'; exit; @@ -104,13 +104,13 @@ if(is_array($object->lines) && (count($object->lines)>0)){ foreach($object->lines as $line){ dol_syslog("cron_run_jobs.php:: fetch cronjobid:".$line->id, LOG_ERR); - + //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database if ((($line->datenextrun <= $now) && $line->dateend < $now) || ((empty($line->datenextrun)) && (empty($line->dateend)))){ - + dol_syslog("cron_run_jobs.php:: torun line->datenextrun:".dol_print_date($line->datenextrun,'dayhourtext')." line->dateend:".dol_print_date($line->dateend,'dayhourtext')." now:".dol_print_date($now,'dayhourtext'), LOG_ERR); - + $cronjob=new Cronjob($db); $result=$cronjob->fetch($line->id); if ($result<0) { @@ -125,7 +125,7 @@ if(is_array($object->lines) && (count($object->lines)>0)){ dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR); exit; } - + // we re-program the next execution and stores the last execution time for this job $result=$cronjob->reprogram_jobs($userlogin); if ($result<0) { @@ -133,7 +133,7 @@ if(is_array($object->lines) && (count($object->lines)>0)){ dol_syslog("cron_run_jobs.php:: reprogram_jobs Error".$cronjob->error, LOG_ERR); exit; } - + } } echo "OK"; diff --git a/htdocs/theme/eldy/img/menus/object_cron.png b/htdocs/theme/eldy/img/object_cron.png similarity index 100% rename from htdocs/theme/eldy/img/menus/object_cron.png rename to htdocs/theme/eldy/img/object_cron.png diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php old mode 100644 new mode 100755 index 0c22107bde6..159fadd3a61 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -27,72 +27,74 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -if (! defined('NOLOGIN')) define('NOLOGIN','1'); +if (! defined('NOLOGIN')) define('NOLOGIN','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -$sapi_type = php_sapi_name(); -$script_file = basename(__FILE__); -$path=dirname(__FILE__).'/'; - -// Test if batch mode -if (substr($sapi_type, 0, 3) == 'cgi') { - echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; - exit; -} +$sapi_type = php_sapi_name(); +$script_file = basename(__FILE__); +$path=dirname(__FILE__).'/'; + +// Test if batch mode +if (substr($sapi_type, 0, 3) == 'cgi') { + echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n"; + exit; +} + if (! isset($argv[1]) || ! $argv[1]) { print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; exit; } -$key=$argv[1]; +$key=$argv[1]; -if (! isset($argv[2]) || ! $argv[2]) { - print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; - exit; -} else { - $userlogin=$argv[2]; -} +if (! isset($argv[2]) || ! $argv[2]) { + print "Usage: ".$script_file." securitykey userlogin cronjobid(optional)\n"; + exit; +} else { + $userlogin=$argv[2]; +} + +require_once ($path."../../htdocs/master.inc.php"); +require_once (DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"); +require_once (DOL_DOCUMENT_ROOT.'/user/class/user.class.php'); +require_once (DOL_DOCUMENT_ROOT."/cron/class/cronjob.class.php"); -$res=@include("../../master.inc.php"); // For root directory -if (! $res) $res=@include("../../../master.inc.php"); // For "custom" directory -if (! $res) die("Include of master.inc.php fails"); +/* + * Main + */ - -// librarie jobs -require_once (DOL_DOCUMENT_ROOT_ALT."/cron/class/cronjob.class.php"); - - -//Check security key -if($key != $conf->global->MAIN_CRON_KEY) +// Check security key +if ($key != $conf->global->CRON_KEY) { - echo 'securitykey is wrong'; + print "Error: securitykey is wrong\n"; exit; } -//Check user login -require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; +// Check user login $user=new User($db); $result=$user->fetch('',$userlogin); -if ($result<0) { - echo "User Error:".$user->error; +if ($result < 0) +{ + echo "User Error: ".$user->error; dol_syslog("cron_run_jobs.php:: User Error:".$user->error, LOG_ERR); exit; -}else { - if (empty($user->id)) { - echo " User user login:".$userlogin." do not exists"; +} +else +{ + if (empty($user->id)) + { + echo " User user login: ".$userlogin." do not exists"; dol_syslog(" User user login:".$userlogin." do not exists", LOG_ERR); exit; } } -if (isset($argv[3]) || $argv[3]) { +if (isset($argv[3]) || $argv[3]) +{ $id = $argv[3]; } -// librarie jobs -require_once (DOL_DOCUMENT_ROOT_ALT."/cron/class/cronjob.class.php"); - // create a jobs object $object = new Cronjob($db); @@ -103,18 +105,21 @@ if (empty($id)) { } $result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter); -if ($result<0) { - echo "Error:".$cronjob->error; - dol_syslog("cron_run_jobs.php:: fetch Error".$cronjob->error, LOG_ERR); +if ($result<0) +{ + echo "Error: ".$object->error; + dol_syslog("cron_run_jobs.php:: fetch Error ".$object->error, LOG_ERR); exit; } // current date $now=dol_now(); -if(is_array($object->lines) && (count($object->lines)>0)){ +if(is_array($object->lines) && (count($object->lines)>0)) +{ // Loop over job - foreach($object->lines as $line){ + foreach($object->lines as $line) + { //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database if (($line->datenextrun < $now) && $line->dateend < $now){ @@ -132,7 +137,7 @@ if(is_array($object->lines) && (count($object->lines)>0)){ dol_syslog("cron_run_jobs.php:: run_jobs Error".$cronjob->error, LOG_ERR); exit; } - + // we re-program the next execution and stores the last execution time for this job $result=$cronjob->reprogram_jobs($userlogin); if ($result<0) { @@ -140,7 +145,10 @@ if(is_array($object->lines) && (count($object->lines)>0)){ dol_syslog("cron_run_jobs.php:: reprogram_jobs Error".$cronjob->error, LOG_ERR); exit; } - + } } -} \ No newline at end of file +} + +$db->close(); +?> \ No newline at end of file From 1e04ff8bbff4daf7f8672017d5ad2488ae0631d5 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sat, 23 Mar 2013 20:36:32 +0100 Subject: [PATCH 106/150] Add Cron spanish translation (provided by david@luminososmarmenor.com) --- htdocs/langs/es_ES/admin.lang | 12 ++-- htdocs/langs/es_ES/cron.lang | 120 +++++++++++++++++----------------- 2 files changed, 65 insertions(+), 67 deletions(-) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 88328c5cfac..7c5101ce143 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -452,8 +452,8 @@ Module1780Name=Categorías Module1780Desc=Gestión de categorías (productos, proveedores y clientes) Module2000Name=Editor WYSIWYG Module2000Desc=Permite la edición de ciertas zonas de texto mediante un editor avanzado -Module2300Name=Cron -Module2300Desc=Gestor de tareas programadas +Module2300Name=Programador +Module2300Desc=Tareas programadas Module2400Name=Agenda Module2400Desc=Gestión de la agenda y de las acciones Module2500Name=Gestión Electrónica de Documentos @@ -677,10 +677,10 @@ Permission1411=Leer los movimientos contables Permission1412=Crear/modificar/anular movimientos contables Permission1415=Leer Balances, informes, diarios, libros maestros Permission1421=Exportar pedidos de clientes y atributos -Permission23001=Ver las tareas programadas -Permission23002=Crear/Modificar las tareas programadas -Permission23003=Eliminar las tareas programadas -Permission23004=Ejecutar las tareas programadas +Permission23001 = Ver tareas programadas +Permission23002 = Crear/actualizar tareas programadas +Permission23003 = Borrar tareas programadas +Permission23004 = Ejecutar tareas programadas Permission2401=Leer acciones (eventos o tareas) vinculadas a su cuenta Permission2402=Crear/eliminar acciones (eventos o tareas) vinculadas a su cuenta Permission2403=Modificar acciones (eventos o tareas) vinculadas a su cuenta diff --git a/htdocs/langs/es_ES/cron.lang b/htdocs/langs/es_ES/cron.lang index 37710fdd67d..4020f586e49 100644 --- a/htdocs/langs/es_ES/cron.lang +++ b/htdocs/langs/es_ES/cron.lang @@ -4,89 +4,87 @@ CHARSET=UTF-8 # # Admin # -CronSetup=Página de configuración del módulo - Gestión de tareas planificadas -URLToLaunchCronJobs=URL para lanzar las tareas automáticas -OrToLaunchASpecificJob=O para lanzar una tarea específica -KeyForCronAccess=Código de seguridad para la URL de lanzamiento de tareas automáticas -FileToLaunchCronJobs=Comando para lanzar las tareas automáticas -CronExplainHowToRunUnix=En un entorno Unix puede parametrizar CronTab para ejecutar este comando cada minuto -CronExplainHowToRunWin=En un entorno Microsoft(tm) Windows puede usar el planificador de tareas para lanzar este comando cada minuto -# -# Menu -# -CronListActive=Listado de tareas planificadas activas -CronListInactive= Listado de tareas planificadas inactivas - +CronSetup= Configuracion +URLToLaunchCronJobs=URL para ejecutar tareas Cron +OrToLaunchASpecificJob=O para ejecutar una tarea en concreto +KeyForCronAccess=clave para la URL para ejecutar tareas Cron +FileToLaunchCronJobs=Comando para ejecutar tareas Cron +CronExplainHowToRunUnix=En entorno Unix debes usar crontab para ejecutar el comando cada varios minutos +CronExplainHowToRunWin=En un entorno de Microsoft(tm) Windows puedes usar el programador de tareas para ejecutar el comando cada varios minutos # # Page list # -CronDateLastRun=Último lanzamiento -CronLastOutput=Última salida -CronLastResult=Último código devuelto +CronDateLastRun=Ultima ejecucion +CronLastOutput=Resultado de la ultima ejecucion +CronLastResult=Ultimo codigo de resultado +CronListOfCronJobs=Lista de tareas programadas CronCommand=Comando -CronList=Listado de tareas planificadas -CronDelete=Eliminar la tarea planificada -CronConfirmDelete=¿Está seguro de querer eliminar esta tarea planificada? -CronExecute=Ejecutar esta tarea -CronConfirmExecute=¿Está seguro de querer ejecutar ahora esta tarea? -CronInfo=Los trabajos permiten ejecutar las tareas a intervalos regulares -CronWaitingJobs=Sus trabajos en espera: +CronList=Lista de tareas Cron +CronDelete=Borrar tareas Cron +CronConfirmDelete=Estas seguro de querer eliminar estas tareas ? +CronExecute=Ejecutar Tarea +CronConfirmExecute=Estas seguro de querer ejecutar esta tarea ahora ? +CronInfo= Cron te permite ejecutar tareas que han sido programadas +CronWaitingJobs=Trabajos en espera CronTask=Tarea -CronNone=Ninguno +CronNone=Ninguna CronDtStart=Fecha inicio CronDtEnd=Fecha fin -CronDtNextLaunch=Próxima ejecución -CronDtLastLaunch=Última ejecución +CronDtNextLaunch=Siguiente ejecucion +CronDtLastLaunch=ultima ejecucion CronFrequency=Frecuencia -CronClass=Clase -CronMethod=Método -CronModule=Módulo -CronAction=Acción -CronStatus=Estado -CronStatusActive=Activa -CronStatusInactive=Inactiva -CronEach=Cada -CronNoJobs=Sin trabajos actualmente +CronClass=Class +CronMethod=Metodo +CronModule=Modulo +CronAction=Accion +CronStatus=Status +CronStatusActive=Activo +CronStatusInactive=Inactivo +CronNoJobs=Sin trabajos registrados CronPriority=Prioridad -CronLabel=Descripción -CronNbRun=Nº ejec. -CronDtLastResult=Fecha del último resultado de la última ejecución +CronLabel=Descripcion +CronNbRun=Nb. ejecutar # #Page card # -CronAdd=Añadir una tarea -CronHourStart=Dia y hora de inicio de la tarea -CronEvery=Ejecutar cada + +CronListActive=Tareas Activas +CronListInactive=Tareas Inactivas +CronAdd=Tarea Nueva +CronHourStart=Fecha y hora de inicio de la tarea +CronEvery=Y ejecutar la tarea cada CronObject=Instancia/Objeto a crear -CronArgs=Argumento -CronSaveSucess=Registro guardado -CronNote=Nota -CronFieldMandatory=El campo %s es obligatorio -CronErrEndDateStartDt=La fecha de fin no puede ser anterior a la de inicio -CronStatusActiveBtn=Activar -CronStatusInactiveBtn=Desactivar -CronTaskInactive=Esta tarea se encuentra desactivada +CronArgs=Parametros +CronSaveSucess=Guardado con exito +CronNote=Comentario +CronFieldMandatory=campos %s son obligatorios +CronErrEndDateStartDt=La fecha de finalizacion no puede ser anterior a la fecha de inicio +CronStatusActiveBtn=Activo +CronStatusInactiveBtn=Inactivo +CronTaskInactive=Esta tarea esta inactiva +CronDtLastResult=Fecha del ultimo resultado CronId=Id -CronClassFile=Clase (archivo) -CronModuleHelp=Nombre del directorio del módulo Dolibarr (funciona automáticamente con los módulos externos Dolibarr).
Por ejemplo para llamar al método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del módulo es product -CronClassFileHelp=El archivo archivo que contiene el objeto.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor de la clase es product.class.php -CronObjectHelp=El nombre del objeto a crear.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del objeto es Product -CronMethodHelp=El método a lanzar.
Por ejemplo para llamar el método fetch del objeto Product de Dolibarr /htdocs/product/class/product.class.php, el valor del método es fecth -CronArgsHelp=Los argumentos del método.
Por ejemplo para usar el método fetch del objeto Product deDolibarr /htdocs/product/class/product.class.php, el valor del parámetro podría ser 0, RefProduit -CronCommandHelp=El comando del sistema a ejecutar +CronClassFile=Classes (file name) +CronModuleHelp=Name of Dolibarr module directory (also work with external Dolibarr module).
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of module is product +CronClassFileHelp=The file name to load.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is product.class.php +CronObjectHelp=The object name to load.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of class file name is Product +CronMethodHelp=The object method to launch.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of method is is fecth +CronArgsHelp=The method arguments.
For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be 0, ProductRef +CronCommandHelp=The system command line to execute. # # Info # -CronInfoPage=Información +CronInfoPage=Informacion + # # Common # -CronType=Tipo de acción a ejecutar -CronType_method=Método de una clase de un módulo Dolibarr +CronType=Tipo de tarea +CronType_method=Llamar a un metodo de clase Dolibarr CronType_command=Comando Shell -CronMenu=Cron -CronCannotLoadClass=imposible cargar la clase %s o el objeto %s \ No newline at end of file +CronMenu=Programador +CronCannotLoadClass=No se puede cargar la clase %s u objeto %s From 24427d2c658133ba12f449adac30e757f9145398 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 00:35:40 +0100 Subject: [PATCH 107/150] Use combo list for revenue stamp --- htdocs/compta/facture.php | 40 ++++++-------- htdocs/core/class/html.formother.class.php | 64 +++++++++++++++++++++- 2 files changed, 79 insertions(+), 25 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index f792d7c6e20..319160e9a99 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -30,31 +30,25 @@ */ require '../main.inc.php'; -require DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; -require DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; -require DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; -require DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; -require DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -require DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -require DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -require DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; - -if (! empty($conf->commande->enabled)) { - require DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; -} -if (! empty($conf->projet->enabled)) { - require DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - require DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; -} +require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php'; $langs->load('bills'); $langs->load('companies'); $langs->load('products'); $langs->load('main'); -if (! empty($conf->margin->enabled)) - $langs->load('margins'); +if (! empty($conf->margin->enabled)) $langs->load('margins'); $sall=trim(GETPOST('sall')); $projectid=(GETPOST('projectid')?GETPOST('projectid','int'):0); @@ -1777,14 +1771,15 @@ if ($action == 'update_extras') * View */ -llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); - $form = new Form($db); -$htmlother = new FormOther($db); +$formother=new FormOther($db); $formfile = new FormFile($db); $bankaccountstatic=new Account($db); $now=dol_now(); +llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); + + /********************************************************************* * @@ -3065,7 +3060,8 @@ else if ($id > 0 || ! empty($ref)) print '
'; print ''; print ''; - print ''; + print $formother->select_revenue_stamp(GETPOST('revenuestamp'), 'revenuestamp', $mysoc->country_code); + //print ''; print ' '; print '
'; } diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index dffb7f37982..cf7c6fb8bf6 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -153,10 +153,10 @@ class FormOther /** - * Retourne la liste des ecotaxes avec tooltip sur le libelle + * Return list of ecotaxes with label * - * @param string $selected code ecotaxes pre-selectionne - * @param string $htmlname nom de la liste deroulante + * @param string $selected Preselected ecotaxes + * @param string $htmlname Name of combo list * @return void */ function select_ecotaxes($selected='',$htmlname='ecotaxe_id') @@ -169,6 +169,7 @@ class FormOther $sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid"; $sql.= " ORDER BY pays, e.organization ASC, e.code ASC"; + dol_syslog(get_class($this).'::select_ecotaxes sql='.$sql); $resql=$this->db->query($sql); if ($resql) { @@ -206,6 +207,63 @@ class FormOther } } + + /** + * Return list of revenue stamp for country + * + * @param string $selected Value of preselected revenue stamp + * @param string $htmlname Name of combo list + * @return string HTML select list + */ + function select_revenue_stamp($selected='',$htmlname='revenuestamp',$country_code='') + { + global $langs; + + $out=''; + + $sql = "SELECT r.taux"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_pays as p"; + $sql.= " WHERE r.active = 1 AND r.fk_pays = p.rowid"; + $sql.= " AND p.code = '".$country_code."'"; + + dol_syslog(get_class($this).'::select_revenue_stamp sql='.$sql); + $resql=$this->db->query($sql); + if ($resql) + { + $out.=''; + return $out; + } + else + { + dol_print_error($this->db); + return ''; + } + } + + /** * Return a HTML select list to select a percent * From 7fab08eae11cb95fe861d446766597da82401baa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 00:35:51 +0100 Subject: [PATCH 108/150] Save example --- dev/ldap/setup_example_activedirectory.jpg | Bin 0 -> 36874 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 dev/ldap/setup_example_activedirectory.jpg diff --git a/dev/ldap/setup_example_activedirectory.jpg b/dev/ldap/setup_example_activedirectory.jpg new file mode 100644 index 0000000000000000000000000000000000000000..64586da8b88a40d2e396934f6a99d0228e7bcaa8 GIT binary patch literal 36874 zcmdqI1ymeQw=X)lLvRL{!QC~%-5r7i8{7#NLI^fMa2p&#aCeskcL*Ld!GmjnK!7{s zZ{NB1t?!+4?|JX7^_sQ1>Df}d_Wtc%)m_yOUmm^zo+!yF$^qcu-~jTlKfuEhKpKFA zfQX2QfCM`sAt527V4|YH4jc>&G)!C^JUm<+TwHu2a$}@ z;P64*(cxax)UUx$IKqjd5Rr~4;*VW+!Gn` zWhOjM_J9#n?e9(I0z1~+jszB|d&cGhB&r?pO<{OxdD;}^nziAkPca3DKtU>#pZpp5 z;p7=ZZkR4AEF+iK1B|G7P1sx762vUFtXtEWlp-Qi$CI%Q!cl!{UxyD7=;fV#u(lN9 zxI@&Ue%2iT?IaBG`QSyk)oj}TO1^%fqqgV1KG^%6^|kEsm*n1aBfK*rIg8So%3u<0 z0(*UdTUml^UfT|m8}-Im^1gEJ{_LY2^z2!rPIlLMyy8eaBR`K4iKH@<=U~1l5@*8} zYmfSSzR@LEdsrXX>Q<_L%32okJ^*?&Z*}zJ?&K~~Iy?QcKKOmN?p@rfn74I4BwEKj z=98lo8d==xs2`P4st#kP-nJS5T$n_!87%a299Bo?Hhx`KOMSx}KEdWj7J1PeqiaW- z$f#oiLIT#?FKi!lyG`TYM|OmR32w8|Y@w%R&|w%pqOV zSp7%lI5+e|-Sr%$>l&-ArCH=H-0UWhz5|#1*Mg3&ul0e8Bpe6qhgcPd)qO7X(P#K} zP@&8R!02dSNujUDSpD~@w1r=G;hh>P3ws}!CLRD-qWUW{Z=QRVC-!9dSBbG=J>C@V ziL;C9y)5Ngk>4t^cg{PTZm?0p6x94_x0q4K}@dwSvW9{}WK6qlUYFQgW19sobX9snDa4#0)719ehIsd2lR56edCcB&0~$s*6}AgM-YfMb0nSaC#e*z6VzIYj&dVGVE#coM{_s2}NNlqRU>&;XWG)!b{I zmTT<%z1xiF(oF#<#T?%t>p@#aL7F3gQ&GQg;5B+E8+sV><&vL%2Ro7Pknpa{C?d-o zZq)H*=$JJv*Gq=nd>qT~yWY)z=`Xw@zJ-oleZBQ`NLf?)h>l)y#CgS@a{Tdfx1;ZV ztM=~de&zYrwKivWP?=xk-3a*h_^#E(Euh8mqyGb-Nw4J%!N|$`($)0`fcwIm+XsMi z#`23JBhIe@hqIM0LV12Mu{8a^*cgrBkXUqEd(T>6%qtalG`Nv3{+cQFc^!+kj@3&J zCDr?BtA6_<3g7C(l|c~17FPhs1KcEx{iY7?Iwts9`>EQRIF7xx3_DT z2}ATt6Le;)?d6#gsR?vrSqZ{JrjEl#DZH7$qI@!Jku_|T@DX%Lvfjp1w)6JTW5Q{# zD0ddNrP&D$MnyP?F0bQd|A6(WvXMh1(CTg3n72siFbQ;V&+*fQHuo9{IHlgB+}b24 z5+Nuc*R`-`G}bY^S?>cWa@sr85OAHoVYqSUq+?6An^&xZ06M*+^BIQGvQq!zp0e4c z@CqE>GMXkvrM)|3%^hS-*pZY#bh)JNz(HpTWjpG8nWi~x@AmB!ci(Q*12}_viWT2;bjXlnUBO0E z2esu|%CC{LGIwu0iZ3^-b%1IhOQ*7_nXZtj){DY9d3sW;QUworxQRLVxE$)OfSrip z1$dOw!Hi*P1VJmY+^3!n4L;!B6Z($OU%Nb@(2a&M3wZ=(aj{QgKetBcvZb>mL@n8_ z?+S6S5ie_32kcKerfF7=WtZ^Q12}CsLBqr*j63Lj!DhG#NN`6pW2t6LI1#j$34b zAxxvxY+-&3C4d;ZHerP=jcwuUtpzhF#2OjtbTmlN4H)zq&#ZEohm0r^F2rkxZFX-3MRMaMk^Mz}2Al{YT@QW{=0 z7O-RA^c9K>#YkXTTvku0e3kZbZE%FG<$7nh%yKDum1$1jhkc#oP)iD{wU4cqyPZ_V z`6um`b)TYT+4F0h=lQFaZMbfN(@#jL>-9di*qnA`!S5{b$B| z(#8h@z##c|>@j2xmP9uMFMH~bu05M=RB8A*-g5YY?}`vItTcb=*a=)=yhA%8L+wpx zqS(k``T!4~u-rRFm&Qkn+~8Imm&ZSPzSV@cRL+R4B3XG-cAefY6-yq3x|#GQgE5*? zV!WK%Js-z_y#Lh;xv~TK$TsSM7DqQ`>@V|~( z(D&yoK&#l8r+0)cmTZZbECyJo>aO^D` z%#6`~s9VOH=ne^G99y73_RAaPCWxc1^9gG_MZ&O_f{Hsa?$8^IC*$q)U${ra&K+B@ zJ;irjR|EyDrqE7Z{1V-w`vdsJ=#{yf+Xk19jlFsStDq#uPc(^iREuO;?)|pATS_?r z6>gS8Pva6w$AEb^O;1(uh$nk-T3)OdC`P%Sdh@2;v4Acmn6W*ydxPLhBLC{;)TnBN zZBvU~^`+#?@lqlnFpQCl zP}tf?x^>%kb5snisw(hX-(kLx9Hr@;e)>vutqo?3vS{wetTiY>o=1_Pc(eSD*4#S< z&dF89T5km?!@bylCbC=SWX2YVkJKLLT!>wT zl~@Tj4(dDBlnWY`VARw7Z0M*rv?%R?C@Km`t;|}rN?5VNe&Jn}XfxErjVFdC`;1N` zGvn!7+SWoeNa+yv+NTBy(x*(VI2;azLi3!M@$%Ig9?g|2=GRX3Da4}UQK;*3oHtB5 zWo$U2G57U2aB&4!dj?R!uUB;MjonsVSZy;;=Z%H?xD} zd$-@oF&Ee)x~h)|^_9AM7!EiN`r?dhN4%5*wm?4a<%vjL375*7-Ht>@iilN0O_Fp% zdJ=uLqj8n{IWa0dpVF~?oWNC+jVZN;e9FE7^ySY#3Fq5^%6Hh#?#R{St~Oa@p|flA zBo$DiYdv}g?^pC(^nI-ZC6>B2jw4p`mBG;0OJ|K4UR|yY8u8|rCzW^30n#L~7p3rF zBJQKRZ~=syzV79YmwtdcS!FSN%qCq>=)1`$m_Ka3iHkk}(mJ+-eBM1yr`2Y!JgJ~r zWn6#)WU|KzrRwh~=&mH>apI}{nVbtprt}o^iI{~mh7&-JRfAHRqnt=eGZ!yzN%Z-UUmpyj8q;u z%!Cg28#NcEpA7*It)a|_uT}g;vl;X?^Gv}87~1m`Z>8i%`-PsT=bV|8|CExYKOK5$O79=RIE^P0%XOyWd!XpE;nu$8Y*<@7!rEVf7Y$ zgR>V}LE7bK(}KqpbU3950QUE7G-}6bCWY}KC4mlh_rze1cr<$3i*$pyZNWh~%8PyW zHjO{li06YGZepoW%!fe5alUQ!QZbgjijY-i5mll3U4HZ=e4qMVzV+$+85Rvy*kw9W zEm5OHQV@1gV;51CDnML?U9hHbFJb>9<1d?^t1OLRGsylh41qhl+{%6tZGJ~_#dJ6O zMz_Z)|H}dK7xHTrpV7wZbq{qo*S#7x!WyL z1y4oK7t~WjuLohkZlZDSkNajrCbw%{W2MuaoQfh`8}Um2!h1RIO82Msjp&i)ZRxMF zvD2*FC7<`5COL}7$GMQtqfIO)V+1br+p4V!;Hgo|P&G|Fjcuj3Aj8xj1Nmf`TGBQQ ztQbpQM{Aar7Uil51@!%@rW*bFIM`G7hVM<`~{Knx+KFy%&>T-D6kux75EMx5yuromIm3*fvh% zbstu_mN-}TjZ?X?@sJClK4<4mbw+@TPikF)BXPE)6M)_-gX>ZuD=#ckSW=+828I?| z2BI0D%<*_}VeberNpi^NJ>2eg)xB7Fnz;vny#KJc=Zj?Vyv{AE)~exVADV$MvlHZtna|{#a4;_Vf^I zoXi?NY8Y<9=D)Utj+0(^{j?Ijh9uNTd z!|6tRNUZ(kF(o{6W1evwh%`e)ZJ2Tu z*e~T?Ik2ztKD`$Ni#mxJWc4O;+%K#+<~6QTlJ^?T81ivVc=7M+aqfi_`*}V9{^ziW zTU%W~1j0y^t0SzNN8J*irlo=3K3|0RkT1)(>Y1}z;a=20c%VS1;VvcvxT_s+-P*SmA$DVx?EBhDB0{)DT@AlOCv&54!hvsS{ z?>-Q_6aPniGPx&%^Y)+j6bjhh_t}zZAfjbO#g}M7Q%(9;Gv&_q_O`z-4McFgn^}+} z{3dw*iGVzqkZ7NvWhdK;{34-H{^I|lHz+nW6(zlwqIki!hc(UCBoNIb>IBvy*OSI= z8?BoDu0W_P9D!m&JkVQX$I-@qnyR_8+9WRp^)<^d>Y>{I) zY;;AU^eOzfpV0CER(vCS+Mx7%Ds11_qf$qCt48M=vLxu@u4=D0s-g3y2SF5cf_3h@sFY;KPe!(;_&*{J(@l21H~UeNMf7q^axX|=iR^w za3y6euF8f(%QlWOS~nY%L12nhpx5Mut1X&bk*xbd&Pt$+H6n>NPpaJy%eT4o%o6d{#|gLS zj5lSoJ3PFCU)-~k!yAwSM${fW$59 zLm*4tP@1=fpt%NxFkG4}Ffr9uWP70_%OR!NPc+OcnPKQ?%Szrb!EsV~S7kGrqCT)V z)<|SF^q?OjY~#vc+4|C`ECNr0p~Xf)>9`iPv+n^Ao-%tv+5(rXdC+%1qa3{sy&h}p z3X^m!1nP(ml5xmNh9FxY;316d15nj#-4-+2UvVmsJ)84+L;s92^2QuNfiBUvgd!hf z5AF%-PcHh%n>0HQ{m=XK-PLIvJFPyIhC2z&CPF3N&o{s?%_%F;J!umpfLrmSI&urq zS#BI>i)Y$=+rH10f3D=yOC?*p-~|E@fIqOMXDiVs@E6;n=_(X5_)+VG@2HEfWX z=609ULR0Ovrm!b`;;uP*+&0kIF+~$Blae^#OHK?o0x^}12g|-wUE*^hYfX++%gq=_ z|NIK&^EJoWnWP=H-x9bXD`Xr)rh=6TMO+7xE}c4fvnmGBWcM<%uBZ{kRKj2lZLMZA z^YG&)&G64?O&OLKlj&`PIBr^Izuph;w_4nfk~IaM*1#+JlAp@jTaI%-ttw5ID-;d% zXp6H_c1PiXTZ(z%L|BN!b}Q^u&qHU_M_9T-C)UH5L+e@Ax(Cl?IJr3({mQp>e842a zF=p&*mj`*{ypl6ri`2e1W3kQZF@;Wz#si=*33-GcTgR%s3{%?D%jQY<5?XuEy~@+1 z=uf?jYEGT2!k(^M`S^q6P?0*|PO@8b3};gb!{_i1&6)&WQ;R%?or-Cywk?u0qm^~( z5og;<{Stb$&<&>}t_(xxZ@Bx}-Et6CI?TynPq-w}f|;~H$}5d2IKcVf6PMhXm4j6{ zPft&8KEW|J_rYVXUPgVX^oye}&)ncT;;hmou|J*h3zu^h)j9~)&m*Wz^YG#U7b5XI z#LhvP?ZUTZW94q@3a6d8Sba6wf*ldgN8s?@y=bhm+Fb=>J1qJyqu&9&Z-;UiW9v2? zoT_j2I}>dyxtq&344OWu_8&UEO;Tz9VCVDp8+lX+$sj!jDUN#A$tWw@4j6N7{8c`5 zT`}u?AEH(bVL61|{8(*MPp;%S>Kt5S&R_<%r+(1Id|hg6LWAC>-$ zHq=t&d?mk6APj%8EGxRMugcoTvfi(^Zk(AWy3!H*WCTq=s`cr%JqZO`4$VH_uU94? zKgmxT(2+k!b&YHx+S3FjxYQf-DJIhGTbVn)ZSTtD#UtMyrfBzLu0zAr#1tOiTd9~_ z+}4Yui3i_;8|?9Dn;n0!Vs-&Dw@l5x@NWvZ8TWW{BDb1*_%bD`v(07-6rm_>lf?B& z3db8uTZkGV^TrsOs75@aLhtHXl{BxEmC_NG#kD$yHvYiO8{m&rkef<{EJO}k4Pef( zvdAV0oC4yP1FdB2H+Y7R*{2%8kfbeWP_JnCr8nRm`!dnI2G)(SJ>=4M>A6e|XL%*| zb6lOuS8B#xpv36$F~=X>tz!-^yN*CDgQlbKgPXiOoA*`a2ya^e--L$V@`Kkll9^Zw z7M5|RCK2&M8`_k6XKCWCV2kQ*3|#kd1~wn5`M7L9EUnwo(@nypoo&ir z7oAcdj;)KWNEfwvfc)mBCp>J_^hdk3VMpTi!Yloz^YpAUK5<&3{~d-5}KHB;u9#Z@7G9>+9HSi9-Gh>RluEE*sZ*eeZ_ z`^}Q77WJt4H<7dDZ<@>6ISNcMkNO7qiqmCBP2h$5W1|5$siM=rPuNjyk2J>rKx6(G zHcGJ@CTCJ~T6>%F*xny1fBy_S5%lDN?tiO#`G;N&!IPiC9YW!+yH-_zv? zo0mc%I|Cd$JG#Gqd+(l#%exT2V9fj? zmGvwxM|}H@=Zn9*MX~z_G35ae|8sg5?d|~pv%U%zbL_{!V_$T?w5q<5+W2~(cV0Aw ze@`(nUUv29&)-gkwaVDAS-zM->pp0$_yAbVbnIXWX!|*X_3N40vFhVV1vDfM!<%1# zh}+b)o$1%{_rJsbFR|ZM`#KJjV_o_WV!vUrYy1GP`5j^3H&nmz_E#W(BTD2CL@E6V zRf6Y_NR-|7*Bu0=`RTXWde)3I~w@Yf#lZ-o3lQ2@OjX}_KJH%R@mok~jSdg&6Q@1O8&-8y(p1Za2Nb6$~#k(HgxVe($;jAh*y1^;?+ z#Gn2#T4rV2G{dFFPYg~D{-`pxJR7NmTmAeac~J6Vrt`L&R*YC zCYgLI#YpSW?M&W3@ez5M9VsB*&K-q-c%rOX4E~QD>vJySTPr85pY@`W9WiNY085*}&^eSnYDOTrW)LF8y4E zTHf^qZwi;b>qmpNrUYUT*#+m!UHWZ0Z_Z9Y*0bV+Im0_#l3(7jBiD09S0B9Mf9m|Y zduMrdb?r5_vZ@{v+0>mMS4lqIi?#NIV3o~A&M-n)ITJSBsw?p+oIE5yS$C6}x7JmZ zvBTqGxrw3sydUr0qf8z#wSX<3?B{-P-&bEJ)d*#0Z!aSlo+@*>*BC?zg})S=O2sYO`c^@cz(~(5wJP(>7@G?j)qOmLLY~v@%t=_ zmp3mx=Rd%#%xPJ_jy*4$#Y(%)<_w3~>Puj|R^=iJqfhTn&YMR3t^Xf|o0@r$j`m|1 zSsm8eE5?6>|4|q(7ejjaZ>`CeB^CO^7|)Z9JkFoV-#`9ivizT&`h)3wtY5srbwhZ7 zgK6&6#8my#LryLR4B-;CN4L~N_qAbpLx{hBIWKGH$2P&HPt>e)MJvqSVXFFyF8<4h z&0cAj!H@~rduyX)Hf&RDDms1aE0xU{L!BZ4eLj7huq-kTKlE37G=vG+}*p z+{`>s&g(2r@VPPh53V1zVqK$tJe0dXh>ZzzWa(RB_lPd%D0ssw|kOnD%*`9Q;NSeTgN+X;$*N=BDH@}TO_`~S= zc)7H-Drba0gY69)6CIx&{dQE*qd@ha@}1{D(bvA|ksN-}kFzZgT2OM@f0_1%J-rJ5~-$1#b7S=jnkZOszEx z!*vk^PC;)`>eK&7x@UhSUAWg@N&Wv^()~BO?Ekz1{QuDy$(X47m4D-!lT1OX{tq=s z$n+d+Ir;5IP;)2x{@pHvAC#JV7?(T}sC09)h6YXypJi(1!(Hq z-JtXrB|nJiEquYnevifb((DxH0q_M@zyB`5usY^a;ihw9q?*6jQsdpz+vNH@l?Hh& z7qNfw16H2arlOv^BIhW!a=c!0t&w4U3Q4^~G#v=fyhfG!34uZpGf~56EQQ>Q!zTK{ zQadch=D#)n%V;5gEN?@hK0f6{(RV=tXiu@9t#ED8+kwPft}I@h-0){6zc?5hSJ{{l z`{g^laannJ`$R=){bkRw3Nz9ArEPw&`(73FSXvG=_EoE86r62J2%B~PH4N;_Eb-U6 zJqzpB)|0H&i?2QK)lQEY7n#Y9UQ{oO?_nP?9zulBu@ce0#ejk%KwF2P#6yPGyT2wp z*yQ3kJxQ_CC`#d6aN~csbwQxlrzKj9QSX)#=S&e^7dMa64_H;*oIz;rlQ6Cc>ZmO zRCNZ|ATU*!@(to#@f~@0>R2J8n;X{F3@*pzwt+{wo#mRh7IfmNa&uD5>!z`kNc&^g zb{88r!?8}{$Tjb2L>`jEO3V15FeW2<&?beU$5oJ+tYNrzuBg`D`F>Vx%WD_HK6W=y zQzCA!d2>>T@KIh6qVA@|TooGFauCHWMQpE9U9Rzb$w*#gtvJpk|MSuSw(F<15f2_Y zoVUreNrE&vxYWWyiycOf%W5UR*VM@G;Vhc1v24N^;-H_)l?Y!J>uv%lKcTRddK&)T z?e%-BS5RXz_@5;>^hI6h->Y-Qtaf@ve=pppwBC3bUQy`8KHV6gW2_zqvzx)(ePTc+<2EKIP7V1L*z2>eN(VfK25wQ0EKNN z%-z3WNNlLwxkgmBcfBr$w6@2(wb_TQBHy+*g)LYBl`JEEbhBlXl@0xDnxa;)nPFzZ z0-8H&?Z=Bbxd*gvP2o-*b@npnGo{1mDZ>WoaHa9ckPjpQGA_$Rv zZC|?bx!1vK9uc3*y$;F*=j?0zlGOD1i||)#8cKiJ(QP!MjUVWNORr|yTtSX?yy|q@ z9>8+##Ayi|uocjF5JPS8>2BQtpI@tVzxAKJEXQLS4sKHm2>l~Mg!N_Ye{bB=(3>i6 z`g^aQq>)nXKil|F_#3`hZul`rew!So^}7Wg>PcrSSVbpM8vnF0o};fx@g7Z(b$8t+ zx_VNxQPknJDx*nd+~N_HFkB9lE84`cF}dgVHV-iuOs%Ar(eu)H+Sd~vnH)_}N5O(7 z4DbagUZRIWoRCohFhDNBVR~MN4rpY$fZY6u13$Oe-;wy*KxL8t_DS7NOxdO$g zZ*F5C|Kn@OSq<6(&7ClGk>7H&{DD{vvr%LVcEv%PKB<)g7)v)=IP z?b4?j;l*fX6GQqLndgoxCEUmIS{9e71r2?D!DMAERWw;^mQ2YXvS@8A+}VjPsY3ud z5=CMcp%;GS(rBIaF=xYP!`qAc+yi`CWqH*W1=0xdG=V_BE<(IxI|04XuNdv#$W21N zx*e-4y_wu#wht;3#Y#bPzSeMj2hLQn(JWnf#2UllI#FE!k3S;%-3U_$;LSiXrA-Q>tp*of-EN(&J)KoYVCma*Ej>FiJgqM zBzXzdPM{+en9i2iX-x(Lf)D5c;(^5)2kh-48!B?UAL0lSUlA_9Pf(=QSf!JUtF#d? zD=SV+6WTEN(K-4}(4cQwdkj-c5*R}iZBU<3?l3MdgPPJBW ze>{6%o2ZA^iw2UHj`gB=Q9Uxw8(L9&{x2fiIl)d`hq1@L?3lv7@WjPf_9@tVkKoi5-$voWwzv27mTkW>?RD# z8a2oCs%>|wl2ZZcGU>R`%`9xT_0GuUrh2tZiU7v*{jq3L2CadPtqof zw{%Q>#;)Wh8Y%nbcp1OAW?|7DACd2Wg5C2ZTh|CC$S%y&(gu z(=SBev}QF=nIII6{9PhmP&tX81a|R0r#Tk}dtx^-nFIaiWJnjD3R-gBj2#eLh zx2iI|r^_t;+Y8*8YG;eeOOrPC)dQ>?d9*UE@0igshDi5bLy8cdndyiLI$SE<+ElpB z^t%~UIMc;Q)uKgqSC!Gx7K`ZEx*OjFYG&xgm&PeKt>=Bu`6fP`spF6T3+1Oil4s)* z9ny_qC37_F1+Zc!k2M+#2oKKHa3LR^lwP2YIi8=1#X}fgW~m}?p-h-k^p`$yJyQzD zbD7kB8D!OOcuY($RCt79^=eBEI3zYX4upzt7_V{8iU_G>9sqFny8X`&<%U-lCOn$ygFW;fH z|6!)~yVwr_Zyx|Gkryffm0#~qW^Ne7=UpBEKK5wF|7jNeAr8VkuuhI9BF^XLoxAls ze|)O_rUyVf|7%BXOTBnbPERI~eQNcAE!)QCTl|Cay3z)3Fjnz7aDGL7#+L28(9`fS zxZ;}c>&DY&tzoEu;U{Q9#6}keqG=d@aN0COWn&%3nFGgIWhv=w*z*S8<3-XEfDjG= z^ZcIGM1pa>2`5lmCTDY*?gQwodvl~Wolgx;oN<~`d{J+ZWWyr)b2c16uUlCS?-Fb` z@QP9mz&PL5AQbVfnl#i3r&m`1t0|R(1^~6o?piX8VJ?7Ztr2Sz+JfS-CGg}bB&-ww zL1rs;OK_GUU!}eKjhB^ydZODr_U7!%X?yPD{tg4%qXYEDL&Awg*cbjt?eS?=Cr?5SV%Md!bsfH;kA=eno3c)1II2(7BZoRa*ATS(?Uj_i)b_Cah;Wi8oT z24!4;)B~sodo&gzQ!x+vSxL@E$Fw2Ll{`t99HaCNNXMR^kekBA&+*d0(R8$M)O>nT z($~Ywrupj-`)I9FZ}=1!zbLPN>U>{p6B|T{=F5ReN8@K>i*~E=gjI|#M;+9VGzGNj zOG(jj$I^oOpuUW`l2lWEn~23zBKPs{^ebErzPOVujRA7jx*hIRh)_aVT^bz7E@wP%6kz zXSvU9tWgO46u6F;+(-}hY)E=<&JdIvv}weH9jC}L{K?L2Kz=@odY3zLmvF2(>WGhs zSFIXcFkD+JTI^|7-g1qH`a!TBK`(>yDEBUnA^ zP@i!)`p*`j|6ve(=*zlXfEG2q05%WCv~35|zh3tCubaDCWO-VB=fPSR z&LJK7`w7QTuEv~*1}^BOmrOcZe~=^&K@hCGXrV_p_)!EqiQ!=LnsLOZkzIsSDQeO} z-~vhOhd0FPfZIIOq_g!TWBo{P8xEV697b$$!e~H&yxTaCa@dy^wUzegQ|v!Fwr1 z3q>X#4@S8=Vq*LV?{L0_X*}o2c{tzH;O8&7b`*3{%Bbmj8Z9`8=m8WGepo2^&YRy| z&ZfQYuol}3U6kgB+|5^30V$jqb<$79G>q-z0i)H(i<0qE{_iOzu1sSD-d)*ReoQz7 z5)s9EmPkSMO(eqypZIP{Zlm%&&!>ORU#|AQ* zzB|v_D4~xnT?pDcf6Z;v&0=Ex_adR7kpn?Xy_e4j$gw9Kv&MM?LR(s)tBWH~j9L%%}}jx1(1qc8{BbQN&K)F@0lW91rRTCLJV^6-7pkAq`>lFt^S^CPa zjs+__C^mIpDrWZG#CSnu5ty|2E)`!@256F(85PDQ(~uD0S*T3Njp%}8!~5QFjr6CB zmN>ul#w^$rl&u4vqeSPVtUsMKy^m?MR~}()as8!c==eSzl~S>%*-%gS^-6?CYT7UL z82N!L{S~Lnz6E74B@M*Xkbg!n0axIAJa%QTx@Vu@XzEswp_ z1IK89pmq#iQ#VOBQ=NvvP)iOo-06kn`g+J523ZJ%z+l5vo*sdkmpyIEIM4D{fNQ>k zM0VdU%W0IBpT`BOxp^AeUN`mf`tH4d=3dg_Dq^Ic*ex(d+5t>-=8L`d4$%&}SzA6p zgJCpC67?g_+d^fgfik7{0s(8|D16PUTXuU+;^emQKc>EZTIki!e2yMsZvw^%5B(Vs@7-LKGZe*>F4 z^E3WNGFZ~^@lN#-$#n%t){iiML~`kP65%7vXCA>{CZeHfDP(NWh~pP(D$m^5(Uh=i zmIm9Fr(651C!XIh;-I3E4P~15tA&*`fAd#D&DLZ-g-}afJ z6}}@fq2mBc-3%k(7qbD)jBta#O(1+R6k~XjOT?Xvtm^tJSwi5y z(tVi8TQRf#6duVNBvoqe#CnbIg8S_5+32{B!HsHn4Ul~rt=r95v64Mx*h#hRz56^W z?R+Qt=<_-A62;g!ku&PFU>B|h>lju)qgsaLr|k*vWwHem2)xw59g=Ri)Ws7TfXocl z8-atu5%UagNGDa$!b!EFz>RDSzb<=$e!^S$XqLP<;HKhef~r$vPxqHj8qe@Sj`B*7 zS5vKm2_6l@xnG%}+16;eBHZiO!kAS8qV^|aWnJTp!T5a2u4Zwd8pYhVC{Nwm=&;x- z_G;+F!ZFdq=S5vYmOeFUMOZc(9<669qA)=h3Js~~N8>ZGQr0F0l94>C@(!~bdM$gY zd)}>po^*B436sdSeKtIs@s$atb>CDoOi*d7i0$UERM@Fc?)5%h$8F3jVNi_f3cP$Z z`YF~H#7Pp9&ZbMQ_z#%9J}FFwlCYgL5iS6ql!jixM16gnv0&;DS-*GcoiKYEZ))MeQ=qY zH~y=Zt$lb&mKLuCbPc`7`l9&8mj&!oBt$@F7d)yw}H-H3l%m_ zQ=0BowqAJD)h$hsv~|W9=5eQ8MS_BR=Eh~sjAl)(@b`*O5SU2{?)u3rnurDyL{}G< z;=aWf8iho}(h7&V%dex*t!cRVSNmZa;nf;*i5TuiSS7fJ?$F}Fkt!IxZH^W85VpFn zqRC8#+~UZK^4d6%W6<}u(r^Po%q2Z=WnxL#ujG6IPZ#u;r6rgHh&B`4TzoBJgU5HN7l=%LFLU4#^qN)BT7`$pdy zHBNoQTOD@2wyCXaeYa@iYe>pvZnv4VS&@$TSqv~?=p~Ev)=>HTKG@nxD?es2()#5& zqi;^#Qb(frubr=YxAb+*YNG=lL=>R5Hi#b6rkzAtfvyAq2_1lNa@Wvn@g{ydjH zoJ)a|gQo3?+}Nwryvn1)v`A-#8LXtT0?(+yu_TBly};3$TQk>fCJRX{e$RM>M@4tr zV!0M0O?g1SbcH*qe}G|qW%WhHg}+qB_nSU9Ba{a2Ls=-DD?4;~!PIqgfKDL>Q*$^5 z81FF#egV)IuN_6ToLK8juL_(DVFlQh5A znO|EZQe90TZHs|&T7fwe=aab5@K7geo@kq;VnRd@9M!M#Gt8Z_#rja?U3PY&e&qu^ zpSff7L|n4M1c~>ue1qv%QewlB3~xH$zkFNXnr4+%*O%K13c5n+;bW4=af#r)c^CO{ z+X60A^zA#IIk*W)AYoX6OWr;KOfl=&w3CZf-}@e7R0YO(t?xwf`EvEVsLJ-}t>C!< z(9X!xM2e#r6I&CkOD=hPghomj?0 z#1fuk?~qDEyk(gU9x-~iL;j}k(Ww*q7@_-XeVv``4d1arl#Paaa|jN%&)*7f!&NHd zUgX(9#_Wjb>ol2ts`{puRHjmG>WvybwOe&(;Z4*Ca8al+;%c25%J6 z&#p@V664ChVk{IX53Ww5S#`WKsMJ}`%vU6pkHby5Ot*vW9~!mK^;#S&|0o;$eCV}} zf!?gMz97S_%?z3P!b}(MNDkfMa7oS-HaDhF!}2XfNQNU18YqpnH^P;Dvqkv>S_nK` zBkW5kQ?r^_9=w=>%K$6Wv+dK9Uo=In?$e^iiDmq03fsb%mCnMLEyFv#=^1WLfy<@^ zn?sQH5v~l)Heq5osXEMB3qBg)PP~Sk41)19-d$O?n(`MI4GTs_ZBZhd40&FYc|ENi z@j1LGOXP?n1)i0T@0)3YmR6i<4K@Tw)adJ2G3SYY5o{x{?PAvvZ3UN$2p_M{fNalx zbOTXI<3z;^Xzr|gu5um#r2fn}`vO$$4}j~LTsx-}QJ;^4%-u$Bs&IZHA-?#B?S^wB z<3jOiB<~rVGw;*d9W5Vam)W%k0ChQIT?3Z_R=o_N_!r7OG&DAIi8p8E!dWIM1jDphdza;&krK69VL&}KP;qo3wHG4k21_x_pl6`@IW8V&l8aw&3#K9 zpGt}NX3}_b$tcqtD-ZW|JL#=zIM`X1nZx5EX|mmg}%k{*k2oF zPC+E@a*3{o7(kim+=50!!b$g)YNO)ebCFuhICOp#|1k4wYYI5Xn4rRx3l$@%%?jC3 zar6vb_!6N1KOf`co%nP+BGUCaCkMK9)_^(cGn_l2goQ zLe+@hsuF}P)2eFYn zDyICj*cbbhM~1B&ZR#)%@hK~;+QD#AW9nw!WUNOK@&c2C2AK}@Drglsfgo*N0nJ2g zIcgUdU%4XAK zEaJbY2y$miMFT}uv%SlA2tE5ejyjSmT>Sm}zbW$nHa-655#fJ_xrSGMj)m}&3bHy% z->hYf8DR+YpxlTDUgwa`--`Js4;(_K)|>U19qi15S5^nuyQNtrJ8o`ZxF!dHdqA}<;<9x&T)7KyMykqS4CnF zs|5AN+8p@W=2pM7g9_{9Uh{O>+3bTFHF>C6o7HRIdG5$V4sjd5kRIna3*3fx#tNT} zGEapuwYd%at#M0JKWF}M&lXDs?+@G@N8hP;p8_pw>)P6TO~kU^uYwPg_7gu^MwFP877&&Zc<=(9O|48dz<7Mk#{4!ioV*GxF zj9oZ5CC0e!%DobWa%rWoq1VkwSxjKXn@Cd~H+v}wr#;YwBI-MNa`ND8v*!C(2Wa41 z&!$_2gs-Vwk~~oyt4DKujo_Ddf^dr_2l1Quug7wm917`fG`b}Tnhy_8$XNXfTAOMb zf~*V)pVLncONIW#HXgN0`^Cz{rOX5$&c^lubz2tgi3yurLJ!Sg{D`oKlpF%ngE{7%w9SdV8|P9z6rBi~+@+kr z4E!>4b2f}SLbvqyJIq63!30)*WWR*Wy_oEStc-;G&@vPZlwp8};%*%`Q0u7_^Z8!*cnlFg2if6hFc zU`f4PvaMo_nHv`qQw5DVzF!#a+mt6dCnWteP2O#X$~YH;hZ5l_f8mW0YILk6+t9Eo zPq|A%JqG*A!^(ZLh-RcGt{fS~TF}?PFnTU}0T)MK?iJ70h+1As8*fUq`)bT(Bt@S< z#6gV#r9nTj6C*)9$PEZzVhsm&7lg=B^9;nrQdVi#FnK|eX<^IJC}`y z>KmTLy`w%{E!rvI2o@H`@Hl~-u*zH9?8M9Gd4P+=2EnFO5#u%JveR!netE|D(P4j*6<;_C;Gka?V*olXC_M zl4)|zNuX(RmLwvGfPkcKpos#Kl$@K42u*H4GBkpcB}x(zgzvTAxA#8hoqO*)`@B2$ zxOa?u|5>wV&ADo^s;Y~ws`>j(3_-#x4?OV^Mi z=;=OniVPDd*BgeDgx*t!#E!YvssT$xHmwXeuQ_UpDzA(ptzP{I<2^6FZK6FoHLLqE zbN!XCC&OXh>1I`%Nga%%D0FWY57oDa`=h|j^X7X}FP$yRqY5hW`FY)Tsw2;D_`+L9 z9<~mTp0PI;#rEm^4A1q0-P&)LPe;@KHo5;d`8=IwIgQS&IK9WF@wz{M1jxzU(nCw!MM&J;-DSj2W2#PY zhg&QFYe>xC$9%hpjx5n3XKZ?2bh*>iT`>QJPQVV_w&}RCPBTwE@et=8=QcN3fGg#= zPjawGH`lDm5H?&CJs?i9+Q`(GKjqeN(=p_ItgE5JC})NgsNGIf%Uy|2k?eHaaAE+> zHmOh#R*>tL$!?m`U-Tocgvd+y!~KiE?ZQh;sY3SOO>X)>@ne5DB#VXzC#sb@W;}9X zo0LAjww-*)0%^w&o^-DjT}Fuw;ejYa+&)S3q86u0Ls`c=FQ}2TCUQ;Jf&UwbnPrKy1$a?`?yCr!3QzkshgjwTukQH5CX( zZNYm@kI*EIx^G=2t5_GX&ro$v4u6f_d+PEj`pFn$)q$$3$@~ z%!b>sSS`0E)39E9|2aMDl^GHKp1mdhrv2v=y3Fr6-o#z`UwxbM8u&+DptX?SJ0UCU z_0?75_u!75tm7(^HCu#Sq&!{e)TFpF9l@hfb3IiM>XbvgN;K<>!Z}3)9m;~>t#G~k zL-!h+zf(FiwS|=?&g(>})eyk3!A}k1FYfo%FMZzgj9mPDBE_P#yAIAiJBaUW#O>?U0Zr7l-Hp z_h>*`pz zdt^|;h%YcrC5tj!%|wP(UNq^4?v^ng4sz~NjX(Riq%WQA(gjuL1A2P%e)4T} zNzpR~oTVvexY99JN9VklYir)U#SksLy<8wz2si6kiati=?MGOq#Yv=nJ0GNGs<#tO zn-P6P6_*TPI+wnm;2a*}8R-(2Zyh|k%>#z7PSbP4wFDsf$lVekFHl>S^k+Z?@TQW~ zeS?E#vVX97`568O;8d_Um95lGsjG=wNOe`~_UcTYUTQ+2tx;#Lv%R0@^gCK>>kj~& zd7G~Y4+OSEGT=i&t1{nD`3h2%#b4PMZs-d}d>(u=9qmff^X;EiRD-)8V(xiiK}i*e zLNwTm%v=57D^n#CKe>OKdp&4y)x&$d@zX*u*@;ozT{4M|x&>9?pHQhkWs^Wnn}VS5 z06ux~Qkq*l>!q-bo{=M6VVN@yS(Z6$R51(OQ($Ikw|;|@iHA7Ae%3wcEDB9fYV%Lm zW=Zme(7WPrV?bqD_eb-=pR3jjNgiUbw_JBxva(m{Q=Qu8IjN2v;gj}( z#b!V4oNgO=Z!w_A6v^k`6h>FrpSor5>HO-6Z$6q7%S?`hb1b00`?V22+{}4A3LAc{ zH*aX>pZ=^a@u|$M=?2%01J$MfuS#?Vwfx^(gyCcqDj);n(lnu)VSU)EPUyssX3|$1B9*cnQx{?K(%P z3)9JKG<0CKUW24Y>ocFi=kXc3X#%>zcCm-W5avSM;vWDAIJ_on!j#{0-I97g-KJJ@+cl zd=ayu7o4r!c*sW$i5G;+;T4Zjf?3@0D^dq+X{uDR$^;vBkv^=Gugh8mCISY4{RVYKF|j{#6Uv!~_urhqE7EdQVI~k=7ZL zSEWOWR(0A0d%6R|3RZ&>mcC0I$})ToeyJTxPZSf@RCMjy;O{>33xnJ>IH}_q^o?MB zhgSCF{4(W_WhrLEN=VaGL*)aOpC$TyzEijqe`;HMLaMbv5nBIC7TCJB_2395!R}9A zAjzPwjt_3-mj9sP^#`EEcw-L3|Dy0!m@KKcPNFr-i{8iH=9i_lrZ+)9Ps7VdHfa;w zv^Po5(gUE(50vhV%oMWCc(FT)9%$Un{*b?}6SrKm^!gRZg}k;K4Ab$L6hD-mV;24| z%pL!K=9~ZNdmM;Ir4wDVj^DlBdqqW2^Q%16+HG0?OSO70J<-tf;XM>46zuj(%K(t# zQ^}pIcMq>~r~ZLs_QbY|A;Ujg#T%@iaDC{nICD84u5e@UH`*i4HL~h*V`NhEWn_dU zBWUO%x9zaugN>V%;u#^0%1>}d6HF(9T=7)q$Qe3le4F%|=Tjc^xN^BWZ9v!Zu_ed4 zrN(_K4cw-<6G3b@=XNKxV59~e%3Hr|Cyk@G&7JRDk^Dh!KG5}A&)z%rV0&?WLFP&^ ztEsC6CPSfv2yzt#C7ROkz2LGvFAki`NoU=eS;ywVT~U7fBDJF8!&?*6Ttm$-8+#sp z{@~Q=GWP3K; z=9qrZ@eU%~>$cHx(|}{m{6fo@x8PQbs3U;S%IZ98R$Rc@RsOvW6ilJ%pZR0YSzdSQw_zN+C4clF~K-W%OF8oLPhSa>k#ge_zsZ2Hkt$8r%u-&ozIw&$@z`>SOu zi*NKlZ$r`MRN>~ivsm5R88hEfCaDd2%);rzAvw6Mr|-zS*qjw7Bq0Ny&))N zL)Y&$&@*hM6Q$(TvDz<&?n{+ZF{hU{FXFiOv?Wl(Ye9-l>74>&Oln2dT8r*4>#mJE zOM3P2qv4Ik3AQ#JaI`uC33)jyW>0}f(Z1>yu0C(~i3%ty+py#qeVDm5A`^2)7Pk=p z`IASA6$cy>Zc=W=^_uoUBMYK=8?B_RKxVBuJG;iQ=dm5Z;&`p)9M#2W5a3fA+IQ?G zM4(yrY`&t@N%9+Ge)3*p6cyl=d8cIa)cBBQ;<~)mz>jSyq-~$z<*7>i$V?XAL`T4w z0{0;wHOW_NZWEIj{qj12UMUOj&s1^yj4m*q+Ld)HpQJh_h?kVzgPcWZyKm>1@hnL2; zE|IJS-sH?;!ZlWfUE-7U-M=K-#BUS6)!~^+8`DCiSZzllBfEg>(D)-GW$roL!b3^M zf1GK%N>JFSyZiFq+jwr)d`aS(Ho0W!_2awzeGEmde-$sW$ws#Q9aq64(L_r}cxWFAPT*S)DJ5&Lp)Gz3e%{5Unyh(_1w=Qq^h06<4BE^WTb? zSI>k$4);s*SDJsnGdr$WHx%TZpc&XLb*jmeqRN=LjYUdcxVCm37MeK0czECm6w_oE z8Mgwlz5Jq?9HvPB^#@}^Xa8F6g}gdDY~5Yx=q~@@VgJ1h0k<5KuCbzbb+rCl=Y2Cc z=hq8&Zy&*fT5r~M=a(k0?aTUV`tsg4`WrnvKP;Fe8W zMc^3x84LAJXhARMs!XeYO^o@+5s%~YeX-@7n%Bzo0V~xMmE?uDm<>+v%J+EZ{)vl8 z)TM*$?dhZg49D~^c_?FGHHOSv+KOokDO(40wyiw6xeT?#nze9K&=&Le$-krfzM z^F%`ptIe(sD60;!RsCI;@lQg^DfY5=m2OYIRTro1nM0lEbei>wm8xfFr)`3*Ro|gb6L8W(0@e6X#mnxwgWLdU5i=Mm(<7T zn*Ftz0fCvb4;!N*D_TR z2Z}q7v9BeCp0Oj27hk5wJ>{@>Y_d<43dGJ$auhl)7bKiXW#p z-DkECl9ciqcXs)Dq(~qme0022hKLI!+JsHpHTF{cyqU>LD0N1~dG%9BGNf$#u;V{U zgnU?st)culYSZ~+A$&zQC1qBPECbw&o`;Q}J}nRUd-)~2$;280dREwhP$C>qZ1TyI zT5jS+d=pBfkZ*7-XUbEP)YdzW6Zq8Jgd#H(SX==^<3Ezr_~<`@s~GVYne>Td94#&< zXaimOt@Hv6JH+J;m->Mo;<9Ws)xA48t6OO^dFoja56Q99H02(hD4^nas28*{`7;&PRzOQc7#*-F zXryfT&U}Mt(f!df<0pGe1nes^L?M-}lBUQjBZ8){#^#dFCE*OUt?6^|E=Azzl+STU z`F!y;2EVpH8`)%j{S#5^Nn~K6ztrthhaD<18C%tnens*((KmO3Tl=$lQ16nWBZ>AR zDSdYaZv8FC1ARLpXNE2eE@E*SLfGh&+Ha|UBxW5S8qJ6l-4BW=`utCgNwF?uNpo}V z(P^mnVNr5vu9YRbMxreC;SO4bxF{)CJ)0~T6VL|at$3H~?w zBxqyFKGY%~3^#KLVkk`Gen4_*+hYYF{o!h<^R&LQt5KZ+Zfbl05J2)hFKmVZSf)M4 zMSL}MnCJ4dQHbnZWgo;ABw63cSD5|{gArv&CQ7T!$Ta@hFoSukqYe2h&0yE|_X*6Q zkHgGz3NY}j!&=?RL^_wLKL86)dr@#w(7Hp`%Qd4y+GZWuI+mj;?;;BNaxoszImLaG zP-38n>?JtxxYl**VtnOb8+)F1!Ts5Iu&dGtLp7i>)gpvK=*bJM5!(4+RC-=3Z^9D{ z0aZtLxUD{;n-4oOO|3zLR<6Vko#LN``nGO9y@!X;?SE1%^1YVJfGO6Q`1YrcD&|Pk zsq_sI78aDLyC^BOqw6i*c|@|-t53H6=9dHAN5TX0AxW>8{EvKk=iX2+>tE5$il%Kb zoSEG*-j0Z)pX5__4C9`y&7wqk2p)-t!GF1G4s!-}0Z0M%|K7GcZmr6t`%loNB4E)sUqfje!+Y?93M zdh&9p;-Ku&Dg4Z~nbEVwftsn&YgFFEs0FD)TwF&hJ-ugoQaj5v2P6C1Y` z-aN++$Kya+zInMtv_XgKc{flp@QoAfhUfFIhxx(Ifz4uYtIy@=+ zjWaueO?r0({l=L=OJfPgpj*R{4EPJD-^#Vbv8m|Ezl7z^G<}{uj(l}9*kDQAWvKd2 z6x0hOdVc#Y$mQ>b>QYGu=TP&BFF!&DMUjFT0D5rrs7*RU6tYP`8$|`sauQ>i=6@V+ z)-)+$n8Ouk<(#NYJy43_Arn}R|E{se9HccS)=tzUOO()eO`sbB@vo-PvIZgrHe1}O zm3e@gDoTp7u7<)00`!h&ZNo|YDhCEYJ$WZrBT0)2eweLtU5|%If{;l|jmJ;Z7_``; z4@o9%<@na6Kz%0%8CrZ5Fz}{mrs%3PTdf89e%t}y6ct9(xkNF^@TC$Et(F$ z)^y;=iqn*Dl+0(;YNA|OLNBjhKAv99F<%Z6>lmG)rr@jJw9={dEO;j0&Qz7|{2gh( zePe&P)0(Tr(TdmJ|3Le0tt&{b1sf9a_PElEaw>6cF+XH_qm|ZRATJ>ZsbBYt-0WU{ z=J2BWm&cn2Z%psa7^L*$4Eo7K=s5d*y^o|Xp!UUB<$A~xnN6Mm7vf2Q-eV3VL(`|B ztvZkO3;wC^Y4RL`SwG>e_DMLC;uLk+hghVQ|?S$$@mQ^nk;OGjnH6Af9nhX&UAJdPet=Qg#>&ogkh*NIFv5d%Ji;Q5)9|fSYfj2P_Qu* zWLvruW?72pvVy{h9W#9nYa1tp?|Nq%94hX`hS$Rv`27J$AvVNo@ewc82VfqEcHMY2HhK)M$qG44Y+qm6(1XP*o{P0IC7mGxKEev6h=){3v$4Z(EL@l=Dc5W zu%S9kpwT@I$LE-{y=~$^S~+}og-n!i{5rlM%FEu;*fKt+ma|PLmhJ)Z=3CZkIsm}y z#$#8?hV<3lrE6VImyWiz84iJ0{7ntO27#^YGwwt2`(fO#$vL9CZz7)Eo%u`5c3(Xn zJI>qE`%9>+eW{CdaENODOSA|-doA{h>!-&r~JlfgTt804$Y~uFHlZxOz9H5@k@Gc(|p^8pjg5?hhy^lIbDkqNcLpk zTCW6LA!g`t_L8MJP>2fd$j+&SlG^?4ZlCT|-<-!Ikunosac0sJK3x<)A;;4Po ztQi->-aFn5JFTE}S`;wu5)AX09{gAeEx~;(t{C6KgNho@#y;JQ7;Nv(I}dY>v0Jv2 zJosU({wD9Kwedvb%CLR~eg4%#@8HfVirRf?4R3yb)8?;GU(_~s76R|Gmt4@fW1);htHHO04TyC9LipznR2k1RpZPe z8rzK?ZxazjL6n7bAG=Q~SaG~oR4fTkR$27UvV-@PH^yCrBMNpR1zIV_#F?NR0124f z4F>fWKPewY&yyI;fcj7p{|JNG&pUJy&3OnCJStqOP;os1T;DS&MtReWGw#cA4tTMI z&xoO8)5J!n9+bw@J?WTxt&x9rvNgPwLfxDvop5w1ukxuG1~e*-LQc!|rdL+B-Amb1 z_llCe8#o+|s}Of3n>a>M-(zdGbl5~v{>g>?4ulM=z(ZwG1%D^URaVG@Mj^F$OwOV& ze&Abt|B?6h2q#RGYnxGK&dR6{0U4Eg(Eq$53b5JNd#-?rAVlY7|7tn35iftt@I&;c z=l@GR7xwrkhuwc^jQ*>gpNB=dddtT2O?O1uvN~8idJ)&+X|rR9Lc z;!@4Qfc6yUMO+WktZzgxbpdR;RgqDp6Z+iLCgcq%?&bSWo)HK59*Rc3m}tolY{ zIBD=vl=99OC3b}8vl8pWH5eU7e2xpxo1nJud2H(e0Las){E#dRa){V>*1hH`S>iW( z?k|1*zoU=;2mAl5{^#@Ravk1uGLYC%qVxC#+$(iN!JEnfRB<_Xz1d}Br+s`9la+eGVz9KUml z<)ll(K)_TxR5^*wT=Q`Ny)Ctm|8ppI=yd=)(QT>-Z?Jttt_yOR2+ru%7N%=Fh)rJY zp$)38)-HCf78zFs;7z1SfA&@!U$XOCkm=##;*bOt!vlI@RLSU8vRm9F*E zrW?s6SetI^gZG?sxW!EczYe+B0KACnuPeMzqG~kjGH(Hz)XgBw-;<<*R=>zNL(Njw zAC@j%U&EuBOlXV-juQmZM(c;sSQX(~tJ!;O8O_5#1ssi}?7SK6$f zp&fYwiTHPSN(9$b@KO)cNR&1M7I1nG4!dv&Z5Y3jtA$6^lB|{Jm?fl}Kb?tgM(W;shIP5I>el`fkC-uF<@a-S&|B zoU?}I;2THI<6?p8wQd7rCD#1xJnkE+g1X9p(Q6Nc{Un)}qOC6#Y?nHxIC?cKeq<|E z*od^+o}SubV05zxCjL=@@u2P_{8FS}2sVLd&zVAzRzXTV>$^8pD&%w;2)hS>mI44( zOt>y02kfUhvse0iM^158wakQ|F-asE!+$$|RJMs(G5`QZ4-slD=$h~m;8&2O5rA0npFP}31j{lTOV*Gsz|%q4$*HCcJ> zauG?i^z=bE6T{#-59bQ=(hThAaJ^Nj=L<))qW!O%a~gM!OkAUF@w$%B)e8ffSc1gE z;rAk@F>tR$&u2|~zVq&77{uZ4IiTo2(_b{pbcJ%=iQlkLaTh!gbm_=+0(1iZJ>p-3 z9C7KgdFPw-qG?_A(7oA@plNJ7U9%#Xnk+zzp#>n$dKbTa@VKoZiRK!wODneJdl!7h zZ4=F`jnG^S;HvaRsC=f>lUX_9NPLZ&|2f&I#vyjM@V+WXW7B)VFbA&mX=-cga6^XO>JOF>bwf_A!w<(6d5c8?Y?~0PqtM$Mg%9 z5_8zw3OLeW2X7HnsSH^B0T6ACM?CGeSAs0XuF@x=oy)^XuSlY#yUZScLNk_6O)*3>#dzMLVRd!u`zT5!j}3OTmM zQ2S9wy|^!kE&&RC*ECH6)?ilQB{KpAGo#_V0Vo(U-6rDezU#MdZ0+6Ad;W}eQoEle zxW1rV#^9cX(eSR=a9y4|Dj>7l2nHeBy@6HGkm?$;uM4Z$TEW zWOckypI`j~Uo=}~<6qtK$nrTZy|>A}RAzB4`%b_yt;mV+o>$M9OOIaD2bf!lw0P86 zHuGj|F(^LH$|}Fj!4!|vSmTMEc7D89m9GN*!NAH6y&}t`e@90=%1Ad?hymhvA9Hl+ zFJ%pyG@LYtX3d?uHui=8bRZV;$G5jZm8eM*oft6g^AsW81d48l(cB3zGsNZ|LtIio zy6i@>Z6qf)(b_5GAyIK8C91AeugcEzXHywgJX;bB`aCNeVi)hc>je}0$nlXw>emw#my?VSu7+nlhZ4?A!$ zx!L&F&yd{hzI9!N@+{J}l<<%o8VwE5mn5*2e*QqSRpv;y2?~exTcM*!yGW&aGN*K|(7SG;4XmfEM8m_|xDT27x7l`aT?ICJ1S9+f;6~#>C}(q2eKPa1ju?iW ztkh5kU@dJJXnuE8@NHiy&4AC=-Oa`~o?!rE68rXp!t7mjDkZN}fwp!_b1HEW6k*W=b*W9V5ly0&+oJL}gD-Ok7 zTIUOnyC`wNL`@ahJF2V)igg`}1MaJ&+6eoKZe$4`vFu@|6F#Tfv*A`w^Ch2LwmkUz zd0q8Zg7*(U_DnS;Du#a#TU8r8sj9|u^=aUjqx)8SZ=jm|1F(*vN$&v?9~0X`?>Pw* zm37H_(5KLzNa*QXcATU#v27E^=~j|Z#)z~kd|VU@&4I02*iHo!VBLe5NzI$jxB86` zuM5OCs`FKaGvBwqf8=6vGuKM~q25;I+}<8NBwtMPa>2>8grE0&;FyBY9-}~SFkll& z&$r@2!P zR8V3GreCxFBHM{L$x@$~tc}psw|tu!xo05>Q_x3SvZ%QV#O!Rm+fg=P`DDd7d|2Lh zA{UHT_jnrU;w>o;eV101KN1?xAW8BF^KG(dEd^~1!Ui|)zHfu9+cv}1`wA4-)34gFM0fq%J?MX0lG=41g z$bM|4PO}>%NBNdlLoIzW<1A3Na9X;j=vCa|JY!^v^_r-a6R*UVs?Nb&)(pwMY}+`+ zdQYuE&x#16{U>9EmOU(2<;}e!j9P1Ltxd^XFW6x;kf(z`=7BJ)gaRkaZ7pa5Fn@1R zhmPKZT4U6laq((Ey5V~w(XOSh^FGz;&^(WLnPYcqwMqDW%c6Kj$qyOgZB{7SZUtBs$mE}nqoh=Xr~#7&@=>{7G@(qr zbCH<}}bS0OXwYIgr62sa?$5z+u;h0S;`?%RuB1N9EuLsK{ znJ)kmGHKj%G!h=~8~5NUutFjVn|Iz4^Qt1Arsk{gp?r!%olnG_Jom=;4d#(vMh;TCz2WV|{=+3!=o zKWF9b^ClFM1d}YeO9zoX!%i_X&l8Oz=5m8{fk`;Rm)m{pMfS|1o2v&@d096#oCk|a z`){}(E#|b^vhbM+)4AJX;f zrfEHDZy$*_9A7{`T2!yeho=pOQ1Vw-0c)>&d$FpF9<=iq6+AI@rzbI^Sau2aSbUZ^ zj59rIi#pg57X>yr>A3of&gzE^f7(6QU-AkhLF?iy(D!Xy)%ak!y9D`HSXL2(v=O?c zkkX1V5fE#h_RE(xOO6-*Xlr6}%^ZgOCJHUioCM69YdL8FVOm_J-~NZA;Ps#1&AfkR z!2D}mbB-%90fcb5pEWh}qHV0QQ2g1yGb>Eg>S9Lli-?zN3+ec-#twqO>ZJBm|KYQu z*g!ua%#S~z*PGf)t_8M}t;^QI;eV0(&E|tNn$*%_O+j;}!cp`EX8#tTVg)kyR^*I` z`4X_YhB&re@i+G?H4!!Q7wpsM7yS|t2;IIjoTkKH@!4k^z8cbBU2_zo!!{>SgJ)6; zT32Zo<+fD^AM?m=>N|Dv%el1AGjjwP*Q6))vcgCYvG0=BC+&NFxk&Y=`sV63qXKp- z6-@>?9Hs@JJT9(pTDZ~uxr;YdUV)Td{gD2$mbMo4`75rK&NzNni%_T~4la9a6VoEw zch7g#0)9GjG{Ft^O)WwRjM+~36-JMX^It||*rae{wSPmezDgLk9yi|FpZ_Zq!}(hp zhq2Xsf%jS6xP&cos{YZEiOY`jA%PC-#~=j?5?y!Nh7BV7_PydOd`zP4^>mT-}Y zi!^28$64~?C#df`@I!I&>&lc^vmpdKTnwrErCjZ`6#{~onz&vR^hdA?u?5BTdp3S_ z2~7=TgYE0@EfPvwjD_rjjIYE@(uk@%;zv@8U&*P6uf4$l&nxqS`n)HCFD}8Frpfui z9bug~fy1Fq0E4b5gIL`wt%sH`ekCglN4MNq-#;brGk;&DdaG=t2s4;x{R6;ZvJ1R% zB0ZJF?jczC?iM-B`@#CQ27`H5``e8MrRm?}9}dq_T=F~2{eE0EcVjaK=U)8~{0HDs zc;&-stt;gHO^?gPXi#+Z+0K+GD}kztQYPQOX=5@_0AJ?fc0UgHpjf>*y*sAEENN?QQ911O|hziLIe& zH-80z$OcR!TOXQY1Am0jg|@ZA2;<+t=?zPv!;<_J^kmAL$}FR?FAwG^Um~X*FBR$C z8S|G|Th+`JnR=Oi>ETkwT`Bb-j|6M{Zt}RSoEQeiQE)Vun4M;cP9GDiQ~x{V=S?g7M+YPyX^6 zjE*85(?Zy3Rldzz@UEd6xa!a+h1n~ax<3H#tiRO>I`t8BsQPk33!G`myWME#ISJmG zw<)1@GH*ZHY1Qg&FWL`1PQan}GPmN2TLE|A0UsC8ndO|anKr*nBMKvGKlN#}#Ujl- z0%sA|LyxA6w+g7aTpSu}LEob$(_|OM4h!phUigPOy31Q9@O&l6ALbT4#2mQFr`Ud# z$>;X@RyS=E(^sSPdgDrwyUlHk;{(wsB%oab4VH~HAKs0Icf#tU@^yppgW63Io2TcfURT z6Q#Q9yBo6k(?NB_3L zhY>N(mO(9LU9@-q08oaOX_||H%0o-o#You`I8b5I6k zH@*Z+D(>NxSOIZ~i1`y(M2NVK{5HZUb{Ka`*h-e1Mb)P1lAtdGHifJpPYpyZ@x1Sy z^sJ-^2ep4bnh7hBKi?ZukUbmgfAC^*eL12GX-xsY2xW69;e?})=C*RC1AV|FnazAn z`X{{K<2}Q~NDC`UTq9VW+X^PE*DX}~CVXeq{rQ#jibY_baL1Xy1As2$E*uXL5&aFtFGU zQiASbQ}5$5$R7ZM(Y&?o@!P^oBYrmBSoP1OQoiTEDtcJFKJWfC)E+irGYaV+&%1fZ z=le2G`s$e}MI&|0XgMwRT>|Jt^Iv6VC!6NRgL6SEX?E5BBX33DaRxWECMtCiw|VvbIxi zEAa}_>U{kUpQD*ni8J5ywDcW85Ku!=EgCL9CDv$VEGYJUe+*f=r>MNxuwa28%@V(A zpln-8DCDu*x=`AFYa-9{w4@9f+eTlj1T*IAbzNCT!lFnTOw9xSpzlJbtD!HLUMS{c z$OyQFzZHF{CvI6L3fLZG3@3Up;v<-r)fO{SvGR>dTiQg-ZFF9mp!R1%6h#10@Y3O+ zWP)9_A6l8AmEfqpN&=4FM2rIk#N-AFl-lpW*D%X)%8xRbJjBs@1T?&4cHR|@07%5n z$(Hiul^ohj)9sjExPg$fe^aNQV1ETFw)s|aWsE(VknX44li@&uK=ty0iy?ZQ<#?D5 zKkx;a2nhK6)3Rp9Xq}>_g76zIV+n96WC=32iphNExnak9jPvHCUkbfpv~j7P_JNBx zQpmW(r$v2_S2P-|F(E%DmAxqoA$gu|M#I00<$h2klOO0P9bDt+$&(@nF%y_x!PkAV z5=6!kOMqc{CD?On7}>qhad9S(8=Yo!OG;$}mEe`FypjXULQq=VXv~`7cgDRGTnuen zaKzhwzlv;C?6%}}IUPI-Ta70B;z}}r5yc0bVpAAbsucFsZOVJFsShUGas(z1^GB^R zjSb4unI!#mWv)y{jL;W-pog7n>Vpw7$Xy8vccV6p!1(;@U4fSt!YK}uB)k%VsE-=Y zbs1cED;_6JvWsKVT{8W`?Wwy&?n=J0MJ{=y%6Exh7@Fw;rw2Sad)dunb?&y`r(9Pk zY;5_*wpfK_ezZ=;BeCyFw_L^lD8&S~&pY@SEI#~EA!*Hw8`J)5h`r|Um$T*d`>&<{GBgAw^L75^ zulJWh!0!L7isq=!BKz&FA=t6o^!HKY(3|`{$Z^==3F$=hBysftgSVK-MU(3vfNrk5 zYMr6u~y)|d53w}Z53!L2dyCVaXh)-$_>%nzn3qjJ3@0vUY1!J zfTJn};mkhWwuI?}^T)lv)c*kxQaq;#=2PV>P7B0luvSN35|{=5^>%q5c3P1SA6Rw_ zX4-YJgg;e1EC0&?7iuW8@cnC0{beY7RqbxJ{FndV3{LwD|7Tb98IwXOwORTt)BK-b-tL1!lMdc|}c?BZWXc+)GA}>p+LvrY73wDYMhv94)*`zpoO% x3k`o?_4uddj5CNa*FRm#u>P;(zp#0PwJ&OiaLwqv06Z*pohM~H5C2&De*hW Date: Sun, 24 Mar 2013 03:12:40 +0100 Subject: [PATCH 109/150] New: SeparatorThousand and SeparatorDecimal accepts ' chars. --- htdocs/admin/system/dolibarr.php | 14 +++++++------- htdocs/core/lib/functions.lib.php | 22 ++++++++++------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 2613ba59469..75b17a6776e 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -132,27 +132,27 @@ $var=!$var; print ''.$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang().''."\n"; // Thousands $var=!$var; -$thousand=$langs->trans("SeparatorThousand"); +$thousand=$langs->transnoentitiesnoconv("SeparatorThousand"); if ($thousand == 'SeparatorThousand') $thousand=' '; // ' ' does not work on trans method if ($thousand == 'None') $thousand=''; -print ''.$langs->trans("CurrentValueSeparatorThousand").''.($thousand==' '?$langs->trans("Space"):$thousand).''."\n"; +print ''.$langs->trans("CurrentValueSeparatorThousand").''.($thousand==' '?$langs->transnoentitiesnoconv("Space"):$thousand).''."\n"; // Decimals $var=!$var; -$dec=$langs->trans("SeparatorDecimal"); +$dec=$langs->transnoentitiesnoconv("SeparatorDecimal"); print ''.$langs->trans("CurrentValueSeparatorDecimal").''.$dec.''."\n"; // Show results of functions to see if everything works $var=!$var; -print '  => price2num(1233.56+1)'.price2num(1233.56+1,'2').''; +print '  => price2num(1233.56+1)'.price2num(1233.56+1,'2').''."\n"; $var=!$var; -print "  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2').""; +print "  => price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2')."\n"; if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) { $var=!$var; - print "  => price2num('."'1 234.56')".price2num("1 234.56",'2').""; + print "  => price2num('."'1 234.56')".price2num("1 234.56",'2').""; print "\n"; } $var=!$var; -print '  => price(1234.56)'.price(1234.56).''; +print '  => price(1234.56)'.price(1234.56).''."\n"; // Timezone $txt =$langs->trans("OSTZ").' (variable system TZ): '.(! empty($_ENV["TZ"])?$_ENV["TZ"]:$langs->trans("NotDefined")).'
'."\n"; $txt.=$langs->trans("PHPTZ").' (php.ini date.timezone): '.(ini_get("date.timezone")?ini_get("date.timezone"):$langs->trans("NotDefined")).''."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3dec3cecc7f..22e4892af5f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2563,7 +2563,7 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0) * @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate * @param int $rounding Minimum number of decimal to show. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) * @param int $forcerounding Force the number of decimal - * @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency) + * @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency) * @return string Chaine avec montant formate * * @see price2num Revert function of price @@ -2585,8 +2585,8 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou // If $outlangs not forced, we use use language if (! is_object($outlangs)) $outlangs=$langs; - if ($outlangs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->trans("SeparatorDecimal"); - if ($outlangs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$outlangs->trans("SeparatorThousand"); + if ($outlangs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->transnoentitiesnoconv("SeparatorDecimal"); + if ($outlangs->transnoentitiesnoconv("SeparatorThousand")!= "SeparatorThousand") $thousand=$outlangs->transnoentitiesnoconv("SeparatorThousand"); if ($thousand == 'None') $thousand=''; //print "amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'
"; @@ -2616,13 +2616,11 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou if ($forcerounding >= 0) $nbdecimal = $forcerounding; // Format number + $output=number_format($amount, $nbdecimal, $dec, $thousand); if ($form) { - $output=preg_replace('/\s/',' ',number_format($amount, $nbdecimal, $dec, $thousand)); - } - else - { - $output=number_format($amount, $nbdecimal, $dec, $thousand); + $output=preg_replace('/\s/',' ',$output); + $output=preg_replace('/\'/',''',$output); } // Add symbol of currency if requested $cursymbolbefore=$cursymbolafter=''; @@ -2633,7 +2631,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code); } $output.=$cursymbolbefore.$end.$cursymbolafter; - + return $output; } @@ -2660,15 +2658,15 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) // Numbers must be '1234.56' // Decimal delimiter for PHP and database SQL requests must be '.' $dec=','; $thousand=' '; - if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal"); - if ($langs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->trans("SeparatorThousand"); + if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->transnoentitiesnoconv("SeparatorDecimal"); + if ($langs->transnoentitiesnoconv("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->transnoentitiesnoconv("SeparatorThousand"); if ($thousand == 'None') $thousand=''; //print "amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."'
"; // Convert value to universal number format (no thousand separator, '.' as decimal separator) if ($alreadysqlnb != 1) // If not a PHP number or unknown, we change format { - //print 'PP'.$amount.' - '.$dec.' - '.$thousand.'
'; + //print 'PP'.$amount.' - '.$dec.' - '.$thousand.' - '.intval($amount).'
'; // Convert amount to format with dolibarr dec and thousand (this is because PHP convert a number // to format defined by LC_NUMERIC after a calculation and we want source format to be like defined by Dolibarr setup. From a890c7b3ab448192d2e01bac701a508f2656380a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 03:51:49 +0100 Subject: [PATCH 110/150] Fix: Option to hide if no permission instead of grey was broken. --- htdocs/core/menus/standard/auguria.lib.php | 24 ++++--- htdocs/core/menus/standard/eldy.lib.php | 82 ++++++++++++---------- htdocs/core/menus/standard/empty.php | 34 +++++---- 3 files changed, 83 insertions(+), 57 deletions(-) diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 7c70c3173ff..18ffe81ecdd 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -84,9 +84,9 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu) } else if ($showmode == 2) $classname='class="tmenu"'; - print_start_menu_entry_auguria($idsel,$classname); + print_start_menu_entry_auguria($idsel,$classname,$showmode); print_text_menu_entry_auguria($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); - print_end_menu_entry_auguria(); + print_end_menu_entry_auguria($showmode); } print_end_menu_array_auguria(); @@ -111,12 +111,16 @@ function print_start_menu_array_auguria() * * @param string $idsel Text * @param string $classname String to add a css class + * @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed * @return void */ -function print_start_menu_entry_auguria($idsel,$classname) +function print_start_menu_entry_auguria($idsel,$classname,$showmode) { - print ''; - print "\n"; + if ($showmode) + { + print '
'; + print "\n"; + } } /** diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 64f415ac085..f7e5143344a 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -55,9 +55,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='home'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("Home"), 1, DOL_URL_ROOT.'/index.php?mainmenu=home&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/index.php?mainmenu=home&leftmenu=', $langs->trans("Home"), 0, $showmode, $atarget, "home", ''); // Third parties @@ -73,9 +73,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='companies'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("ThirdParties"), $showmode, DOL_URL_ROOT.'/societe/index.php?mainmenu=companies&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/societe/index.php?mainmenu=companies&leftmenu=', $langs->trans("ThirdParties"), 0, $showmode, $atarget, "companies", ''); } @@ -102,9 +102,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) $chaine.=$langs->trans("Services"); } - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($chaine, $showmode, DOL_URL_ROOT.'/product/index.php?mainmenu=products&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/product/index.php?mainmenu=products&leftmenu=', $chaine, 0, $showmode, $atarget, "products", ''); } @@ -126,9 +126,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='commercial'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("Commercial"), $showmode, DOL_URL_ROOT.'/comm/index.php?mainmenu=commercial&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/comm/index.php?mainmenu=commercial&leftmenu=', $langs->trans("Commercial"), 0, $showmode, $atarget, "commercial", ""); } @@ -146,9 +146,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='accountancy'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("MenuFinancial"), $showmode, DOL_URL_ROOT.'/compta/index.php?mainmenu=accountancy&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/compta/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "accountancy", ''); } @@ -167,9 +167,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='bank'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("MenuBankCash"), $showmode, DOL_URL_ROOT.'/compta/bank/index.php?mainmenu=bank&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/compta/bank/index.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", ''); } @@ -187,9 +187,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='project'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("Projects"), $showmode, DOL_URL_ROOT.'/projet/index.php?mainmenu=project&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/projet/index.php?mainmenu=project&leftmenu=', $langs->trans("Projects"), 0, $showmode, $atarget, "project", ''); } @@ -207,9 +207,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='tools'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("Tools"), $showmode, DOL_URL_ROOT.'/core/tools.php?mainmenu=tools&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/core/tools.php?mainmenu=tools&leftmenu=', $langs->trans("Tools"), 0, $showmode, $atarget, "tools", ''); } @@ -227,9 +227,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='shop'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("OSCommerce"), $showmode, DOL_URL_ROOT.'/boutique/index.php?mainmenu=shop&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/boutique/index.php?mainmenu=shop&leftmenu=', $langs->trans("OSCommerce"), 0, $showmode, $atarget, "shop", ''); } @@ -245,9 +245,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) else $classname = 'class="tmenu"'; $idsel='members'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($langs->trans("MenuMembers"), $showmode, DOL_URL_ROOT.'/adherents/index.php?mainmenu=members&leftmenu=', $id, $idsel, $classname, $atarget); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $langs->trans("MenuMembers"), 0, $showmode, $atarget, "members", ''); } @@ -281,7 +281,7 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) } $url=preg_replace('/__LOGIN__/',$user->login,$url); $shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl); - + // Define the class (top menu selected or not) if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"'; else if (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"'; @@ -289,9 +289,9 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) } else if ($showmode == 2) $classname='class="tmenu"'; - if (empty($noout)) print_start_menu_entry($idsel,$classname); + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); if (empty($noout)) print_text_menu_entry($newTabMenu[$i]['titre'], $showmode, $url, $id, $idsel, $classname, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget)); - if (empty($noout)) print_end_menu_entry(); + if (empty($noout)) print_end_menu_entry($showmode); $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ''); } @@ -315,19 +315,23 @@ function print_start_menu_array() * * @param string $idsel Text * @param string $classname String to add a css class + * @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed * @return void */ -function print_start_menu_entry($idsel,$classname) +function print_start_menu_entry($idsel,$classname,$showmode) { - print ''; + if ($showmode) + { + print ''; + } print "\n"; } @@ -396,7 +404,7 @@ function print_end_menu_array() * @param array &$menu Object Menu to return back list of menu entries * @param int $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' - * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) + * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all) * @return void */ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu,&$menu,$noout=0,$forcemainmenu='',$forceleftmenu='') @@ -1172,7 +1180,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu { $showmenu=true; if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu=false; - + $alt++; if (empty($menu_array[$i]['level']) && $showmenu) { @@ -1185,7 +1193,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print '
'."\n"; } } - + // Place tabulation $tabstring=''; $tabul=($menu_array[$i]['level'] - 1); @@ -1196,12 +1204,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $tabstring.='   '; } } - + // For external modules $url = dol_buildpath($menu_array[$i]['url'], 1); - + print ''."\n"; - + // Menu niveau 0 if ($menu_array[$i]['level'] == 0) { @@ -1234,7 +1242,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print ''."\n"; } } - + // If next is a new block or end if (empty($menu_array[$i+1]['level'])) { @@ -1244,7 +1252,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } } } - + return count($menu_array); } diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index ab63a03ae12..2e401e3cf10 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -53,9 +53,9 @@ class MenuManager */ function loadMenu() { - - } - + + } + /** * Show menu @@ -71,17 +71,19 @@ class MenuManager require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php'; $this->menu=new Menu(); - + if ($mode == 'top') { print_start_menu_array_empty(); + // Home + $showmode=1; $idsel='home'; $classname='class="tmenusel"'; - print_start_menu_entry_empty($idsel, $classname); + print_start_menu_entry_empty($idsel, $classname, $showmode); print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&leftmenu=', $id, $idsel, $classname, $this->atarget); - print_end_menu_entry_empty(); + print_end_menu_entry_empty($showmode); print_end_menu_array_empty(); } @@ -190,12 +192,16 @@ function print_start_menu_array_empty() * * @param string $idsel Text * @param string $classname String to add a css class + * @param int $showmode 0 = hide, 1 = allowed or 2 = not allowed * @return void */ -function print_start_menu_entry_empty($idsel,$classname) +function print_start_menu_entry_empty($idsel,$classname,$showmode) { - print ''; - print "\n"; + if ($showmode) + { + print '
'; + print "\n"; + } } /** From c5e742278e1f1592d28eebd0a549906e2fe568ea Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 24 Mar 2013 07:11:44 +0100 Subject: [PATCH 111/150] fix : trad error --- README | 2 +- README-FR | 2 +- README.md | 2 +- htdocs/admin/bank.php | 2 +- htdocs/admin/ecm.php | 2 +- htdocs/admin/mailing.php | 2 +- htdocs/admin/menus.php | 2 +- htdocs/admin/menus/index.php | 2 +- htdocs/admin/menus/other.php | 2 +- htdocs/admin/security_other.php | 4 ++-- htdocs/admin/stock.php | 2 +- htdocs/admin/taxes.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/cron.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/lib/invoice.lib.php | 2 +- htdocs/core/lib/member.lib.php | 2 +- htdocs/core/lib/price.lib.php | 2 +- htdocs/core/lib/propal.lib.php | 2 +- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/install/check.php | 2 +- htdocs/langs/ar_SA/admin.lang | 4 ++-- htdocs/langs/ar_SA/install.lang | 2 +- htdocs/langs/ar_SA/other.lang | 2 +- htdocs/langs/bg_BG/admin.lang | 4 ++-- htdocs/langs/bg_BG/install.lang | 2 +- htdocs/langs/bg_BG/other.lang | 2 +- htdocs/langs/ca_ES/admin.lang | 4 ++-- htdocs/langs/ca_ES/install.lang | 2 +- htdocs/langs/ca_ES/other.lang | 2 +- htdocs/langs/da_DK/admin.lang | 4 ++-- htdocs/langs/da_DK/install.lang | 2 +- htdocs/langs/da_DK/other.lang | 2 +- htdocs/langs/de_AT/admin.lang | 2 +- htdocs/langs/de_AT/install.lang | 2 +- htdocs/langs/de_AT/other.lang | 2 +- htdocs/langs/de_DE/admin.lang | 4 ++-- htdocs/langs/de_DE/install.lang | 2 +- htdocs/langs/de_DE/other.lang | 2 +- htdocs/langs/el_GR/admin.lang | 2 +- htdocs/langs/el_GR/install.lang | 2 +- htdocs/langs/el_GR/other.lang | 2 +- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/install.lang | 2 +- htdocs/langs/en_US/other.lang | 2 +- htdocs/langs/es_ES/admin.lang | 4 ++-- htdocs/langs/es_ES/install.lang | 2 +- htdocs/langs/es_ES/other.lang | 2 +- htdocs/langs/et_EE/admin.lang | 4 ++-- htdocs/langs/et_EE/install.lang | 2 +- htdocs/langs/et_EE/other.lang | 2 +- htdocs/langs/fa_IR/admin.lang | 2 +- htdocs/langs/fa_IR/install.lang | 2 +- htdocs/langs/fa_IR/other.lang | 2 +- htdocs/langs/fi_FI/admin.lang | 4 ++-- htdocs/langs/fi_FI/install.lang | 2 +- htdocs/langs/fi_FI/other.lang | 2 +- htdocs/langs/fr_FR/admin.lang | 4 ++-- htdocs/langs/fr_FR/install.lang | 2 +- htdocs/langs/fr_FR/other.lang | 2 +- htdocs/langs/he_IL/admin.lang | 4 ++-- htdocs/langs/he_IL/install.lang | 2 +- htdocs/langs/he_IL/other.lang | 2 +- htdocs/langs/hu_HU/admin.lang | 4 ++-- htdocs/langs/hu_HU/install.lang | 2 +- htdocs/langs/hu_HU/other.lang | 2 +- htdocs/langs/is_IS/admin.lang | 4 ++-- htdocs/langs/is_IS/install.lang | 2 +- htdocs/langs/is_IS/other.lang | 2 +- htdocs/langs/it_IT/admin.lang | 4 ++-- htdocs/langs/it_IT/install.lang | 2 +- htdocs/langs/it_IT/other.lang | 2 +- htdocs/langs/ja_JP/admin.lang | 4 ++-- htdocs/langs/ja_JP/install.lang | 2 +- htdocs/langs/ja_JP/other.lang | 2 +- htdocs/langs/nb_NO/admin.lang | 4 ++-- htdocs/langs/nb_NO/install.lang | 2 +- htdocs/langs/nb_NO/other.lang | 2 +- htdocs/langs/nl_BE/admin.lang | 4 ++-- htdocs/langs/nl_BE/install.lang | 2 +- htdocs/langs/nl_BE/other.lang | 2 +- htdocs/langs/nl_NL/admin.lang | 4 ++-- htdocs/langs/nl_NL/install.lang | 2 +- htdocs/langs/nl_NL/other.lang | 2 +- htdocs/langs/pl_PL/admin.lang | 4 ++-- htdocs/langs/pl_PL/install.lang | 4 ++-- htdocs/langs/pl_PL/other.lang | 2 +- htdocs/langs/pt_BR/admin.lang | 2 +- htdocs/langs/pt_BR/install.lang | 2 +- htdocs/langs/pt_BR/other.lang | 2 +- htdocs/langs/pt_PT/admin.lang | 4 ++-- htdocs/langs/pt_PT/install.lang | 2 +- htdocs/langs/pt_PT/other.lang | 2 +- htdocs/langs/ro_RO/admin.lang | 4 ++-- htdocs/langs/ro_RO/install.lang | 4 ++-- htdocs/langs/ro_RO/other.lang | 2 +- htdocs/langs/ru_RU/admin.lang | 4 ++-- htdocs/langs/ru_RU/install.lang | 4 ++-- htdocs/langs/ru_RU/other.lang | 2 +- htdocs/langs/ru_UA/install.lang | 2 +- htdocs/langs/sl_SI/admin.lang | 4 ++-- htdocs/langs/sl_SI/install.lang | 2 +- htdocs/langs/sl_SI/other.lang | 2 +- htdocs/langs/sv_SE/admin.lang | 4 ++-- htdocs/langs/sv_SE/install.lang | 2 +- htdocs/langs/sv_SE/other.lang | 2 +- htdocs/langs/tr_TR/admin.lang | 4 ++-- htdocs/langs/tr_TR/install.lang | 2 +- htdocs/langs/tr_TR/other.lang | 2 +- htdocs/langs/zh_CN/admin.lang | 4 ++-- htdocs/langs/zh_CN/install.lang | 2 +- htdocs/langs/zh_CN/other.lang | 2 +- htdocs/langs/zh_TW/admin.lang | 4 ++-- htdocs/langs/zh_TW/install.lang | 2 +- htdocs/langs/zh_TW/other.lang | 2 +- 119 files changed, 150 insertions(+), 150 deletions(-) diff --git a/README b/README index ad883d9aa57..2b320d665c1 100644 --- a/README +++ b/README @@ -107,7 +107,7 @@ Other modules: - ClickToDial phone numbers - RSS -Miscellanous: +Miscellaneous: - Multi-user, with several permissions levels for each feature. - Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with diff --git a/README-FR b/README-FR index 6988f3f263d..ac3a9ae2d8c 100644 --- a/README-FR +++ b/README-FR @@ -106,7 +106,7 @@ Autres modules: - Export PDF de tous les éléments (factures, propositions commerciales, commandes, bons expéditions, etc...) - De nombreuses autres fonctionnalités issues de modules officiels ou non (AWStats, Bittorrent, Gravatar, Google, Webcalendar...) -Miscellanous: +Divers: - Application multi-utilisateurs avec différents niveaux de permissions par module. - Plusieurs gestionnaires de menus (possibilité de différencier les menus pour les utilisateurs internes ou externes comme les clients ou fournisseurs). - Application simple à utiliser. diff --git a/README.md b/README.md index 0a8be8fd8fa..e3d86854a70 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ See ChangeLog file found into package. - ClickToDial phone numbers - RSS -### Miscellanous: +### Miscellaneous: - Multi-user, with several permissions levels for each feature. - Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions). diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 98a08708dff..6ba81a5cbee 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -91,7 +91,7 @@ print '
'; $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/bank.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $hselected=$h; $h++; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 45a142d8190..68782a2620d 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -75,7 +75,7 @@ print '
'; $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/ecm.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $hselected=$h; $h++; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 87252252d65..6074272ddc8 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -106,7 +106,7 @@ print_fiche_titre($langs->trans("MailingSetup"),$linkback,'setup'); $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/mailing.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $hselected=$h; $h++; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 64f063121fe..bd5074f01b1 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -149,7 +149,7 @@ $head[$h][2] = 'editor'; $h++; $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index cfe8fae2ddd..092e910c5cc 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -232,7 +232,7 @@ $head[$h][2] = 'editor'; $h++; $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 6f9269919d5..0ec3119c097 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -87,7 +87,7 @@ $head[$h][2] = 'editor'; $h++; $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 13c87d88bf7..f24a63ba76e 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -123,11 +123,11 @@ else if ($action == 'delete') $form = new Form($db); -llxHeader('',$langs->trans("Miscellanous")); +llxHeader('',$langs->trans("Miscellaneous")); print_fiche_titre($langs->trans("SecuritySetup"),'','setup'); -print $langs->trans("MiscellanousDesc")."
\n"; +print $langs->trans("MiscellaneousDesc")."
\n"; print "
\n"; $head=security_prepare_head(); diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index ba28ea15635..bbdbf3276db 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -101,7 +101,7 @@ print '
'; $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/stock.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $hselected=$h; $h++; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 8e547bd4e21..c5d19eb9109 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -126,7 +126,7 @@ print '
'; $h = 0; $head[$h][0] = DOL_URL_ROOT."/admin/taxes.php"; -$head[$h][1] = $langs->trans("Miscellanous"); +$head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $hselected=$h; $h++; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 66f6bb3874d..4545d4cd0ac 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -456,7 +456,7 @@ class Propal extends CommonObject * @param double $txlocaltax2 Local tax 2 rate * @param string $desc Description * @param double $price_base_type HT ou TTC - * @param int $info_bits Miscellanous informations + * @param int $info_bits Miscellaneous informations * @param int $special_code Special code (also used by externals modules!) * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 38995fdebb9..3b38ccb3fd0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2086,7 +2086,7 @@ class Facture extends CommonInvoice * @param double $txlocaltax1 Local tax 1 rate * @param double $txlocaltax2 Local tax 2 rate * @param string $price_base_type HT or TTC - * @param int $info_bits Miscellanous informations + * @param int $info_bits Miscellaneous informations * @param int $type Type of line (0=product, 1=service) * @param int $fk_parent_line Id of parent line (0 in most cases, used by modules adding sublevels into lines). * @param int $skip_update_total Keep fields total_xxx to 0 (used for special lines by some modules) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 85218aaee58..978f0896f65 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -519,7 +519,7 @@ function security_prepare_head() $h++; $head[$h][0] = DOL_URL_ROOT."/admin/security_other.php"; - $head[$h][1] = $langs->trans("Miscellanous"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index f06e8027e5f..b7d012cc51a 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -180,7 +180,7 @@ function societe_admin_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe.php'; - $head[$h][1] = $langs->trans("Miscellanous"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 7ba1e7b38a3..0ba077e1a3b 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -34,7 +34,7 @@ function cronadmin_prepare_head() $head = array(); $head[$h][0] = dol_buildpath('/cron/admin/cron.php', 1); - $head[$h][1] = $langs->trans("Miscellanous"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'setup'; $h++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 22e4892af5f..835e5a36ee1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2529,7 +2529,7 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr * * @param float $rate Rate value to format (19.6 19,6 19.6% 19,6%,...) * @param boolean $addpercent Add a percent % sign in output - * @param int $info_bits Miscellanous information on vat (0=Default, 1=French NPR vat) + * @param int $info_bits Miscellaneous information on vat (0=Default, 1=French NPR vat) * @param int $usestarfornpr 1=Use '*' for NPR vat rate intead of MAIN_LABEL_MENTION_NPR * @return string String with formated amounts (19,6 or 19,6% or 8.5% NPR or 8.5% *) */ diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 03b8fa7240d..b0d564c88d5 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -112,7 +112,7 @@ function invoice_admin_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/admin/facture.php'; - $head[$h][1] = $langs->trans("Miscellanous"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index e4ff07210e8..8ec1fdd4070 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -116,7 +116,7 @@ function member_admin_prepare_head() $head = array(); $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent.php'; - $head[$h][1] = $langs->trans("Miscellanous"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 06b71377c1c..c3af3e2e973 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -43,7 +43,7 @@ * @param float $uselocaltax2_rate 0=do not use this localtax, >0=apply, -1=autodetect according to seller * @param float $remise_percent_global 0 * @param string $price_base_type HT=on calcule sur le HT, TTC=on calcule sur le TTC - * @param int $info_bits Miscellanous informations on line + * @param int $info_bits Miscellaneous informations on line * @param int $type 0/1=Product/service * @param string $seller Thirdparty seller (we need $seller->country_code property). Provided only if seller is the supplier. * @return result[ 0=total_ht, diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index d6348bdcb0e..5d65032e421 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -117,7 +117,7 @@ function propal_admin_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/admin/propal.php'; - $head[$h][1] = $langs->trans("Miscellanous"); + $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index b74511f1419..d8487fc82b0 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1702,7 +1702,7 @@ class CommandeFournisseur extends CommonOrder * @param double $txlocaltax1 Localtax1 tax * @param double $txlocaltax2 Localtax2 tax * @param double $price_base_type Type of price base - * @param int $info_bits Miscellanous informations + * @param int $info_bits Miscellaneous informations * @param int $type Type of line (0=product, 1=service) * @param int $notrigger Disable triggers * @return int < 0 if error, > 0 if ok diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index cd106c3a120..60bdf26a8ab 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1065,7 +1065,7 @@ class FactureFournisseur extends CommonInvoice * @param double $qty Quantity * @param int $idproduct Id produit * @param double $price_base_type HT or TTC - * @param int $info_bits Miscellanous informations of line + * @param int $info_bits Miscellaneous informations of line * @param int $type Type of line (0=product, 1=service) * @param double $remise_percent Pourcentage de remise de la ligne * @param int $notrigger Disable triggers diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 5bd17604b9e..f0bda08bfc1 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -55,7 +55,7 @@ pHeader('',''); // No next step for navigation buttons. Next step is defined //print "
\n"; //print $langs->trans("InstallEasy")."

\n"; -print ''.$langs->trans("MiscellanousChecks").":
\n"; +print ''.$langs->trans("MiscellaneousChecks").":
\n"; // Check browser $useragent=$_SERVER['HTTP_USER_AGENT']; diff --git a/htdocs/langs/ar_SA/admin.lang b/htdocs/langs/ar_SA/admin.lang index 722231818d2..148055a3139 100644 --- a/htdocs/langs/ar_SA/admin.lang +++ b/htdocs/langs/ar_SA/admin.lang @@ -669,7 +669,7 @@ GeneratedPasswordDesc=هنا تعريف القاعدة التي تريد است DictionnaryDesc=تعرف هنا إشارة datas. يمكنك استكمال مسبقا مع قيمة لك. ConstDesc=تسمح لك هذه الصفحة لتحرير جميع البارامترات الأخرى غير المتوفرة في الصفحات السابقة. فهي محفوظة لمعايير متقدمة للمطورين أو troubleshouting. OnceSetupFinishedCreateUsers=تحذير فأنت Dolibarr مدير المستخدم. مدير المستخدمين تستخدم لإعداد Dolibarr. لالمعتاد استخدام Dolibarr ، يوصى باستخدام غير مستخدم مدير خلق مجموعات من المستخدمين & القائمة. -MiscellanousDesc=هنا تعريف جميع البارامترات الأخرى ذات الصلة بالأمن. +MiscellaneousDesc=هنا تعريف جميع البارامترات الأخرى ذات الصلة بالأمن. LimitsSetup=حدود / الدقيقة الإعداد LimitsDesc=يمكنك تحديد الحدود ، وoptimisations الايضاحات التي تستخدمها Dolibarr هنا MAIN_MAX_DECIMALS_UNIT=ماكس عشرية لأسعار الوحدات @@ -1268,7 +1268,7 @@ SendmailOptionMayHurtBuggedMTA=وميزة لإرسال رسائل باستخدا ModuleCompanyCodeAquarium=عودة رمز المحاسبة التي بناها:
يتبع %s بواسطة طرف ثالث رمز المورد عن مورد قانون المحاسبة،
يتبع %s بواسطة طرف ثالث رمز العملاء لعميل قانون المحاسبة. CompanyIdProfChecker=المهنية معرف فريد MustBeUnique=يجب أن تكون فريدة من نوعها؟ -Miscellanous=متفرقات +Miscellaneous=متفرقات ContractsSetup=عقود وحدة الإعداد ContractsNumberingModules=عقود ترقيم الوحدات AdherentLoginRequired=إدارة تسجيل الدخول لكل عضو diff --git a/htdocs/langs/ar_SA/install.lang b/htdocs/langs/ar_SA/install.lang index 57d561e631d..69a9dfc2c4d 100644 --- a/htdocs/langs/ar_SA/install.lang +++ b/htdocs/langs/ar_SA/install.lang @@ -10,7 +10,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=فقط اتبع التعليمات خطوة بخطوة. -MiscellanousChecks=التحقق من الشروط الأساسية +MiscellaneousChecks=التحقق من الشروط الأساسية DolibarrWelcome=مرحبا بكم في Dolibarr ConfFileExists=ملفات موجودة ٪ ق. ConfFileDoesNotExists=ملفات ل ٪ لا وجود له! diff --git a/htdocs/langs/ar_SA/other.lang b/htdocs/langs/ar_SA/other.lang index 4c419afc905..d32680de008 100644 --- a/htdocs/langs/ar_SA/other.lang +++ b/htdocs/langs/ar_SA/other.lang @@ -44,7 +44,7 @@ TotalSizeOfAttachedFiles=اجمالى حجم الملفات المرفقة / و MaxSize=الحجم الأقصى AttachANewFile=إرفاق ملف جديد / وثيقة LinkedObject=ربط وجوه -Miscellanous=متفرقات +Miscellaneous=متفرقات NbOfActiveNotifications=عدد الإخطارات WarningInstallDirExists=تحذير تركيب دليل (٪) لا تزال موجودة. هذه هي ثغرة أمنية خطيرة. يجب عليك إزالة عليه في أقرب وقت ممكن. WarningUntilDirRemoved=هذا التحذير وسوف تظل نشطة ما دام هذا الدليل هو هذا (يظهر فقط لمستخدمي المشرف). diff --git a/htdocs/langs/bg_BG/admin.lang b/htdocs/langs/bg_BG/admin.lang index 812767e5ab4..5a181549062 100644 --- a/htdocs/langs/bg_BG/admin.lang +++ b/htdocs/langs/bg_BG/admin.lang @@ -842,7 +842,7 @@ GeneratedPasswordDesc=Определете тук правилото, което DictionnaryDesc=Определете тук всички референтни презареждане на данните. Можете да попълните предварително зададена стойност с вашите. ConstDesc=Тази страница ви позволява да редактирате всички останали параметри не са налични в предишните страници. Те са запазени параметрите за напреднали разработчиците или за troubleshouting. OnceSetupFinishedCreateUsers=Внимание, вие сте на потребителя администратор Dolibarr. Администратор потребители не се използват да настроите Dolibarr. За обичайна употреба на Dolibarr, се препоръчва да използвате не потребителски администратора, създаден от Потребители и групи менюто. -MiscellanousDesc=Определете тук всички други параметри, свързани със сигурността. +MiscellaneousDesc=Определете тук всички други параметри, свързани със сигурността. LimitsSetup=Граници / Прецизно настройване LimitsDesc=Можете да дефинирате ограничения, уточнения и оптимизации, използвани от Dolibarr тук MAIN_MAX_DECIMALS_UNIT=Макс знака след десетичната запетая за единичните цени @@ -923,7 +923,7 @@ DocumentModelOdt=Генериране на документи от OpenDocuments WatermarkOnDraft=Воден знак върху проект на документ CompanyIdProfChecker=Професионална Id уникален MustBeUnique=Трябва да е уникален? -Miscellanous=Разни +Miscellaneous=Разни WebCalSetup=Настройка webcalendar връзка WebCalSyncro=Да Добавяне на Dolibarr събития да WebCalendar WebCalAllways=Винаги, не иска diff --git a/htdocs/langs/bg_BG/install.lang b/htdocs/langs/bg_BG/install.lang index aa18691f409..3e720835f7f 100644 --- a/htdocs/langs/bg_BG/install.lang +++ b/htdocs/langs/bg_BG/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US -> bg_BG CHARSET=UTF-8 InstallEasy=Просто следвайте инструкциите стъпка по стъпка. -MiscellanousChecks=Предпоставки проверка +MiscellaneousChecks=Предпоставки проверка DolibarrWelcome=Добре дошли в Dolibarr ConfFileExists=%s конфигурационен файл съществува. ConfFileDoesNotExists=%s конфигурационен файл не съществува! diff --git a/htdocs/langs/bg_BG/other.lang b/htdocs/langs/bg_BG/other.lang index a38a46300a2..08664887076 100644 --- a/htdocs/langs/bg_BG/other.lang +++ b/htdocs/langs/bg_BG/other.lang @@ -52,7 +52,7 @@ TotalSizeOfAttachedFiles=Общ размер на прикачените фай MaxSize=Максимален размер AttachANewFile=Прикрепете нов файл / документ LinkedObject=Свързан обект -Miscellanous=Разни +Miscellaneous=Разни NbOfActiveNotifications=Броят на нотификациите PredefinedMailTest=Това е тест поща. \ NПромените две линии са разделени с нов ред. \n\n __ SIGNATURE__ PredefinedMailTestHtml=Това е тест поща (тест дума трябва да бъде с удебелен шрифт).
Двете линии са разделени от връщане на каретката.

__SIGNATURE__ diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index de095a8ff62..f0e24d649bd 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -890,7 +890,7 @@ GeneratedPasswordDesc=Indiqui aquí que norma vol utilitzar per generar les cont DictionnaryDesc=Indiqui aquí les dades de referència. Pot completar/modificar les dades predefinides amb les seves ConstDesc=Qualsevol altre paràmetre no editable en les pàgines anteriors OnceSetupFinishedCreateUsers=Atenció, està sota un compte d'administrador de Dolibarr. Els administradors s'utilitzen per configurar Dolibarr. Per a un ús corrent de Dolibarr, es recomana utilitzar un compte no administrador creada des del menú "Usuaris i grups" -MiscellanousDesc=Definiu aquí els altres paràmetres relacionats amb la seguretat. +MiscellaneousDesc=Definiu aquí els altres paràmetres relacionats amb la seguretat. LimitsSetup=Configuració de límits i precisions LimitsDesc=Podeu definir aquí els límits i precisions utilitzats per Dolibarr MAIN_MAX_DECIMALS_UNIT=Decimals màxims per als preus unitaris @@ -982,7 +982,7 @@ CompanyIdProfChecker=Règles sobre els ID professionals MustBeUnique=Ha de ser únic? MustBeMandatory=Ha de ser obligatori per a crear tercers? MustBeInvoiceMandatory=Ha de ser obligatori per a validar factures? -Miscellanous=Miscel·lània +Miscellaneous=Miscel·lània ##### Webcal setup ##### WebCalSetup=Configuració d'enllaç amb el calendari webcalendar WebCalSyncro=Integrar els esdeveniments Dolibarr a webcalendar diff --git a/htdocs/langs/ca_ES/install.lang b/htdocs/langs/ca_ES/install.lang index b37e2c114c5..6cc42fd7674 100644 --- a/htdocs/langs/ca_ES/install.lang +++ b/htdocs/langs/ca_ES/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - ca_ES - install CHARSET=UTF-8 InstallEasy=Hem procurat que la instal·lació sigui el més simple possible, vostè només ha de seguir els passos un a un. -MiscellanousChecks=Comprovació dels Prerequisits +MiscellaneousChecks=Comprovació dels Prerequisits DolibarrWelcome=Benvingut a Dolibarr ConfFileExists=L'arxiu de configuració %s existeix. ConfFileDoesNotExists=El fitxer de configuració %s no existeix! diff --git a/htdocs/langs/ca_ES/other.lang b/htdocs/langs/ca_ES/other.lang index 04e0a957cf6..ae3011ed7f5 100644 --- a/htdocs/langs/ca_ES/other.lang +++ b/htdocs/langs/ca_ES/other.lang @@ -44,7 +44,7 @@ TotalSizeOfAttachedFiles=Mida total dels arxius/documents adjunts MaxSize=Tamany màxim AttachANewFile=Adjuntar nou arxiu/document LinkedObject=Objecte adjuntat -Miscellanous=Diversos +Miscellaneous=Diversos NbOfActiveNotifications=Número notificacions PredefinedMailTest=Això és un correu de prova.\nLes 2 línies estan separades per un retorn de carro a la línia. PredefinedMailTestHtml=Això és un e-mail de prova (la paraula prova ha d'estar en negreta).
Les 2 línies estan separades per un retorn de carro en la línia diff --git a/htdocs/langs/da_DK/admin.lang b/htdocs/langs/da_DK/admin.lang index 5dc84bdef04..c48977e64aa 100644 --- a/htdocs/langs/da_DK/admin.lang +++ b/htdocs/langs/da_DK/admin.lang @@ -599,7 +599,7 @@ GeneratedPasswordDesc=Definer her som regel, du vil bruge til at generere nye ad DictionnaryDesc=Definer her alle reference oplysningerne. Du kan færdiggøre foruddefineret værdi med dine. ConstDesc=Denne side giver dig mulighed for at redigere alle andre parametre, som ikke findes i de foregående sider. De er forbeholdt parametre for avancerede udviklere eller for troubleshouting. OnceSetupFinishedCreateUsers=Advarsel, du er en Dolibarr administrator bruger. Administrator brugere er vant til opsætningen Dolibarr. For en almindelig brug af Dolibarr, anbefales det at bruge en ikke administrator bruger oprettet fra Brugere & Grupper menuen. -MiscellanousDesc=Definer her alle andre parametre med relation til sikkerhed. +MiscellaneousDesc=Definer her alle andre parametre med relation til sikkerhed. LimitsSetup=Grænseværdier / Precision setup LimitsDesc=Du kan definere grænser, præciseringer og optimeringer bruges af Dolibarr her MAIN_MAX_DECIMALS_UNIT=Max decimaler for enhedspriser @@ -1271,7 +1271,7 @@ SendmailOptionNotComplete=Advarsel, på nogle Linux-systemer, for at sende e-mai SendmailOptionMayHurtBuggedMTA=Feature til at sende mails ved hjælp af metoden "PHP mail direkte" vil generere en mail, der måske ikke korrekt fortolket af nogle modtager mail-servere. Resultatet er, at nogle mails ikke kan læses af personer, der hostes af thoose aflyttet platforme. Det er tilfældet for nogle Internet-udbydere (Ex: Orange i Frankrig). Dette er ikke et problem i Dolibarr eller ind i PHP, men på at modtage e-mail-server. Du kan dog tilføje muligheden MAIN_FIX_FOR_BUGGED_MTA til 1 i setup - andet at ændre Dolibarr at undgå dette. Dog kan du opleve problemer med andre servere, nøje at overholde SMTP standard. Den anden løsning (monteringstid) er at bruge metoden "SMTP socket bibliotek", der ikke har nogen ulemper. CompanyIdProfChecker=Professionel Id unikke MustBeUnique=Skal være unik? -Miscellanous=Diverse +Miscellaneous=Diverse ContractsSetup=Kontrakter modul opsætning ContractsNumberingModules=Kontrakter nummerering moduler AdherentLoginRequired=Administrere et login for hvert medlem diff --git a/htdocs/langs/da_DK/install.lang b/htdocs/langs/da_DK/install.lang index 8bd455e6cee..2c2c2e566bb 100644 --- a/htdocs/langs/da_DK/install.lang +++ b/htdocs/langs/da_DK/install.lang @@ -12,7 +12,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=Vi forsøgte at gøre Dolibarr setup så let som muligt. Følg anvisningerne trin for trin. -MiscellanousChecks=Forudsætninger check +MiscellaneousChecks=Forudsætninger check DolibarrWelcome=Velkommen til Dolibarr ConfFileExists=Konfigurationsfil %s eksisterer. ConfFileDoesNotExists=Konfigurationsfil %s eksisterer ikke! diff --git a/htdocs/langs/da_DK/other.lang b/htdocs/langs/da_DK/other.lang index 5aee3d71a07..32826b83cea 100644 --- a/htdocs/langs/da_DK/other.lang +++ b/htdocs/langs/da_DK/other.lang @@ -25,7 +25,7 @@ TotalSizeOfAttachedFiles=Samlede størrelse på vedhæftede filer / dokumenter MaxSize=Maksimumstørrelse AttachANewFile=Vedhæfte en ny fil / dokument LinkedObject=Forbundet objekt -Miscellanous=Miscellaneous +Miscellaneous=Miscellaneous NbOfActiveNotifications=Antal anmeldelser ChooseYourDemoProfil=Vælg den demo profil, der passer til din virksomhed ... DemoCompanyShopWithCashDesk=Administrer en butik med et kontant desk diff --git a/htdocs/langs/de_AT/admin.lang b/htdocs/langs/de_AT/admin.lang index 50b20c94796..fa932d55014 100644 --- a/htdocs/langs/de_AT/admin.lang +++ b/htdocs/langs/de_AT/admin.lang @@ -594,7 +594,7 @@ GeneratedPasswordDesc=Definieren Sie hier das Schema nach dem automatisch generi DictionnaryDesc=Definieren Sie hier alle Referenzwerte. Sie können vordefinierte Werte mit ihren eigenen ergänzen. ConstDesc=Auf dieser Seite können Sie alle, auf bisherigen Seiten nicht aufgeführte, Parameter einstellen. Dieser Bereich ist primär für fortgeschrittene Entwickler und zur Fehlersuche gedacht. OnceSetupFinishedCreateUsers=Achtung: Sie sind derzeit als Systemadministrator angemeldet. Administratorenkonten dienen primär zur Einrichtung des Systems, für die reguläre Verwendung sollten Sie ein herkömmliches Benutzerkonto unter 'Benutzer&Gruppen' anlegen und verwenden. -MiscellanousDesc=Definieren Sie hier alle sonstigen Sicherheitseinstellungen +MiscellaneousDesc=Definieren Sie hier alle sonstigen Sicherheitseinstellungen LimitsSetup=Grenzwerte-/Genauigkeitseinstellungen LimitsDesc=Hier können Sie Grenzwerte, Genauigkeitseinstellungen und das Rundungsverhalten einstellen. MAIN_MAX_DECIMALS_UNIT=Dezimalstellen max. für Stückpreise diff --git a/htdocs/langs/de_AT/install.lang b/htdocs/langs/de_AT/install.lang index 765d366a219..d018b25e09d 100644 --- a/htdocs/langs/de_AT/install.lang +++ b/htdocs/langs/de_AT/install.lang @@ -7,7 +7,7 @@ CHARSET=UTF-8 InstallEasy=Wir haben uns bemüht, die Installation von dolibarr so einfach wie möglich zu gestalten. Folgen Sie einfach Schritt für Schritt den Anweisungen auf dem Bildschirm. -MiscellanousChecks=Systemvoraussetzungen prüfen +MiscellaneousChecks=Systemvoraussetzungen prüfen DolibarrWelcome=Willkommen bei dolibarr ConfFileExists=Die Konfigurationsdatei %s ist vorhanden. ConfFileDoesNotExists=Die Konfigurationsdatei %s existiert nicht! diff --git a/htdocs/langs/de_AT/other.lang b/htdocs/langs/de_AT/other.lang index ff3481857d3..b2771c7aede 100644 --- a/htdocs/langs/de_AT/other.lang +++ b/htdocs/langs/de_AT/other.lang @@ -20,7 +20,7 @@ TotalSizeOfAttachedFiles=Gesamtgröße der angehängten Dateien/Dokumente MaxSize=Maximalgröße AttachANewFile=Neue Datei/Dokument anhängen LinkedObject=Verknüpftes Objekt -Miscellanous=Verschiedenes +Miscellaneous=Verschiedenes NbOfActiveNotifications=Anzahl aktiver Benachrichtigungen PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Bitte entnehmen Sie dem Anhang die Rechnung __FACREF__\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Bedauerlicherweise scheint die Rechnung __FACREF__ bislang unbeglichen. Als Erinnerung übersenden wir Ihnen diese nochmals im Anhang\n\n__PERSONALIZED__Mit freundlichen Grüßen\n\n__SIGNATURE__ diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang index 7c56963166b..72f7f060e06 100644 --- a/htdocs/langs/de_DE/admin.lang +++ b/htdocs/langs/de_DE/admin.lang @@ -815,7 +815,7 @@ GeneratedPasswordDesc=Definieren Sie hier das Schema nach dem automatisch generi DictionnaryDesc=Definieren Sie hier alle Referenzwerte. Sie können vordefinierte Werte mit ihren eigenen ergänzen. ConstDesc=Auf dieser Seite können Sie alle, auf bisherigen Seiten nicht aufgeführte, Parameter einstellen. Dieser Bereich ist primär für fortgeschrittene Entwickler und zur Fehlersuche gedacht. OnceSetupFinishedCreateUsers=Achtung: Sie sind derzeit als Systemadministrator angemeldet. Administratorenkonten dienen primär zur Einrichtung des Systems, für die reguläre Verwendung sollten Sie ein herkömmliches Benutzerkonto unter 'Benutzer&Gruppen' anlegen und verwenden. -MiscellanousDesc=Definieren Sie hier alle sonstigen Sicherheitseinstellungen +MiscellaneousDesc=Definieren Sie hier alle sonstigen Sicherheitseinstellungen LimitsSetup=Grenzwerte-/Genauigkeitseinstellungen LimitsDesc=Hier können Sie Grenzwerte, Genauigkeitseinstellungen und das Rundungsverhalten einstellen. MAIN_MAX_DECIMALS_UNIT=Dezimalstellen max. für Stückpreise @@ -895,7 +895,7 @@ DocumentModelOdt=Erstellen von Dokumentvorlagen im OpenDocuments-Format (.odt-Da WatermarkOnDraft=Wasserzeichen auf Entwurf CompanyIdProfChecker=Berufs-Identifikation einzigartige MustBeUnique=Eindeutig sein müssen? -Miscellanous=Verschiedenes +Miscellaneous=Verschiedenes ##### Webcal setup ##### WebCalSetup=Webkalender-Verbindungseinstellungen WebCalSyncro=Termine an Webkalender übertragen diff --git a/htdocs/langs/de_DE/install.lang b/htdocs/langs/de_DE/install.lang index f7e0ae7654d..c185d289129 100644 --- a/htdocs/langs/de_DE/install.lang +++ b/htdocs/langs/de_DE/install.lang @@ -8,7 +8,7 @@ CHARSET=UTF-8 InstallEasy=Wir haben uns bemüht, die Installation von dolibarr so einfach wie möglich zu gestalten. Folgen Sie einfach Schritt für Schritt den Anweisungen auf dem Bildschirm. -MiscellanousChecks=Systemvoraussetzungen prüfen +MiscellaneousChecks=Systemvoraussetzungen prüfen DolibarrWelcome=Willkommen bei dolibarr ConfFileExists=Die Konfigurationsdatei %s ist vorhanden. ConfFileDoesNotExists=Die Konfigurationsdatei %s existiert nicht! diff --git a/htdocs/langs/de_DE/other.lang b/htdocs/langs/de_DE/other.lang index a8a8e18ae63..92dba590db1 100644 --- a/htdocs/langs/de_DE/other.lang +++ b/htdocs/langs/de_DE/other.lang @@ -51,7 +51,7 @@ TotalSizeOfAttachedFiles=Gesamtgröße der angehängten Dateien/Dokumente MaxSize=Maximalgröße AttachANewFile=Neue Datei/Dokument anhängen LinkedObject=Verknüpftes Objekt -Miscellanous=Verschiedenes +Miscellaneous=Verschiedenes NbOfActiveNotifications=Anzahl aktiver Benachrichtigungen PredefinedMailTest=Dies ist ein Test-Mail.\n Die beiden Zeilen sind durch eine Zeilenschaltung getrennt. PredefinedMailTestHtml=Dies ist ein (HTML)-Test Mail (das Wort Test muss in Fettschrift erscheinen).
Die beiden Zeilen sollteb durch eine Zeilenschaltung getrennt sein. diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index 9628acf2211..444eb49855c 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -378,7 +378,7 @@ SendmailOptionNotComplete=Προσοχή, σε μερικά συστήματα L SendmailOptionMayHurtBuggedMTA=Χαρακτηριστικό για να στείλετε μηνύματα χρησιμοποιώντας τη μέθοδο "PHP mail απευθείας" θα δημιουργήσει ένα μήνυμα ηλεκτρονικού ταχυδρομείου που μπορεί να μην αναλυθούν σωστά με ορισμένους εξυπηρετητές λήψης της αλληλογραφίας. Αποτέλεσμα είναι ότι ορισμένα μηνύματα δεν μπορούν να διαβαστούν από ανθρώπους που φιλοξενούνται από τις πλατφόρμες thoose bugged. Είναι υπόθεση για ορισμένους παρόχους Internet (Ex: Orange στη Γαλλία). Αυτό δεν είναι ένα πρόβλημα σε Dolibarr ούτε σε PHP, αλλά πάνω διακομιστής παραλαβής αλληλογραφίας. Μπορείτε να προσθέσετε ωστόσο MAIN_FIX_FOR_BUGGED_MTA δυνατότητα εγκατάστασης σε 1 - να τροποποιήσει άλλες Dolibarr να το αποφύγουμε αυτό. Ωστόσο, ενδέχεται να αντιμετωπίσετε πρόβλημα με άλλους διακομιστές που σέβονται αυστηρά το πρότυπο SMTP. Η άλλη λύση (κατά προτίμηση) είναι να χρησιμοποιήσουμε τη μέθοδο "SMTP υποδοχή βιβλιοθήκη» που δεν έχει μειονεκτήματα. CompanyIdProfChecker=Επαγγελματική ταυτότητα μοναδική MustBeUnique=Πρέπει να είναι μοναδικό; -Miscellanous=Διάφορα +Miscellaneous=Διάφορα ServiceSetup=Υπηρεσίες εγκατάστασης μονάδας ProductServiceSetup=Προϊόντα και Υπηρεσίες εγκατάστασης μονάδων ViewProductDescInThirdpartyLanguageAbility=Οπτικοποίηση των προϊόντων περιγραφών στη γλώσσα άλλους κατασκευαστές diff --git a/htdocs/langs/el_GR/install.lang b/htdocs/langs/el_GR/install.lang index 77b706254bc..c5c835a22a5 100644 --- a/htdocs/langs/el_GR/install.lang +++ b/htdocs/langs/el_GR/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - el_GR - install CHARSET=UTF-8 InstallEasy=Just follow the instructions step by step. -MiscellanousChecks=Prerequisites check +MiscellaneousChecks=Prerequisites check DolibarrWelcome=Welcome to Dolibarr ConfFileExists=Configuration file %s exists. ConfFileDoesNotExists=Configuration file %s does not exist ! diff --git a/htdocs/langs/el_GR/other.lang b/htdocs/langs/el_GR/other.lang index 2e2671f60a5..b3c717c3550 100644 --- a/htdocs/langs/el_GR/other.lang +++ b/htdocs/langs/el_GR/other.lang @@ -21,7 +21,7 @@ TotalSizeOfAttachedFiles=Συνολικό μέγεθος επισυναπτώμ MaxSize=Μέγιστο μέγεθος AttachANewFile=Επισύναψη νέου αρχείου/εγγράφου LinkedObject=Συνδεδεμένα αντικείμενα -Miscellanous=Διάφορα +Miscellaneous=Διάφορα NbOfActiveNotifications=Πλήθος ειδοποιήσεων PredefinedMailTest=Δοκιμαστικο mail.\nΟι δύο γραμμές είναι χωρισμένες με carriage return. CreatedBy=Δημιουργήθηκε από %s diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a9aae951692..2a010d4733b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -888,7 +888,7 @@ GeneratedPasswordDesc=Define here which rule you want to use to generate new pas DictionnaryDesc=Define here all reference datas. You can complete predefined value with yours. ConstDesc=This page allows you to edit all other parameters not available in previous pages. They are reserved parameters for advanced developers or for troubleshouting. OnceSetupFinishedCreateUsers=Warning, you are a Dolibarr administrator user. Administrator users are used to setup Dolibarr. For a usual usage of Dolibarr, it is recommended to use a non administrator user created from Users & Groups menu. -MiscellanousDesc=Define here all other parameters related to security. +MiscellaneousDesc=Define here all other parameters related to security. LimitsSetup=Limits/Precision setup LimitsDesc=You can define limits, precisions and optimisations used by Dolibarr here MAIN_MAX_DECIMALS_UNIT=Max decimals for unit prices @@ -983,7 +983,7 @@ CompanyIdProfChecker=Rules on Professional Ids MustBeUnique=Must be unique ? MustBeMandatory=Must be mandatory to create thirds? MustBeInvoiceMandatory=Must be mandatory to validate invoices? -Miscellanous=Miscellaneous +Miscellaneous=Miscellaneous ##### Webcal setup ##### WebCalSetup=Webcalendar link setup WebCalSyncro=Add Dolibarr events to WebCalendar diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index a5d3d5e7ce8..4954ffdf54c 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - en_US - install CHARSET=UTF-8 InstallEasy=Just follow the instructions step by step. -MiscellanousChecks=Prerequisites check +MiscellaneousChecks=Prerequisites check DolibarrWelcome=Welcome to Dolibarr ConfFileExists=Configuration file %s exists. ConfFileDoesNotExists=Configuration file %s does not exist ! diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index bcba133ba6d..b7885a8ca09 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -45,7 +45,7 @@ TotalSizeOfAttachedFiles=Total size of attached files/documents MaxSize=Maximum size AttachANewFile=Attach a new file/document LinkedObject=Linked object -Miscellanous=Miscellaneous +Miscellaneous=Miscellaneous NbOfActiveNotifications=Number of notifications PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__ PredefinedMailTestHtml=This is a test mail (the word test must be in bold).
The two lines are separated by a carriage return.

__SIGNATURE__ diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 7c5101ce143..ce9e2d6d6e2 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -890,7 +890,7 @@ GeneratedPasswordDesc=Indique aquí que norma quiere utilizar para generar las c DictionnaryDesc=Indique aquí los datos de referencia. Puede completar/modificar los datos predefinidos con los suyos. ConstDesc=Cualquier otro parámetro no editable en las páginas anteriores OnceSetupFinishedCreateUsers=Atención, está bajo una cuenta de administrador de Dolibarr. Los administradores se utilizan para configurar a Dolibarr. Para un uso corriente de Dolibarr, se recomienda utilizar una cuenta no administrador creada desde el menú "Usuarios y grupos" -MiscellanousDesc=Defina aquí los otros parámetros relacionados con la seguridad. +MiscellaneousDesc=Defina aquí los otros parámetros relacionados con la seguridad. LimitsSetup=Configuración de límites y precisiones LimitsDesc=Puede definir aquí los límites y precisiones utilizados por Dolibarr MAIN_MAX_DECIMALS_UNIT=Decimales máximos para los precios unitarios @@ -982,7 +982,7 @@ CompanyIdProfChecker=Reglas sobre los ID profesionales MustBeUnique=¿Debe ser único? MustBeMandatory=¿Debe ser obligatorio para crear terceros? MustBeInvoiceMandatory=¿Debe ser obligatorio para validar facturas? -Miscellanous=Miscelánea +Miscellaneous=Miscelánea ##### Webcal setup ##### WebCalSetup=Configuración de enlace con el calendario Webcalendar WebCalSyncro=Integrar los eventos Dolibarr en WebCalendar diff --git a/htdocs/langs/es_ES/install.lang b/htdocs/langs/es_ES/install.lang index d53dcc28407..9d42c609104 100644 --- a/htdocs/langs/es_ES/install.lang +++ b/htdocs/langs/es_ES/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - es_ES - install CHARSET=UTF-8 InstallEasy=Hemos procurado que la instalación sea lo más simple posible, usted sólo tiene que seguir los pasos uno a uno. -MiscellanousChecks=Comprobación de los prerrequisitos +MiscellaneousChecks=Comprobación de los prerrequisitos DolibarrWelcome=Bienvenido a Dolibarr ConfFileExists=El archivo de configuración %s existe. ConfFileDoesNotExists=¡El archivo de configuración %s no existe! diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index f86e7e74799..6c590d73f68 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -44,7 +44,7 @@ TotalSizeOfAttachedFiles=Tamaño total de los archivos/documentos adjuntos MaxSize=Tamaño máximo AttachANewFile=Adjuntar nuevo archivo/documento LinkedObject=Objeto adjuntado -Miscellanous=Miscelánea +Miscellaneous=Miscelánea NbOfActiveNotifications=Número notificaciones PredefinedMailTest=Esto es un correo de prueba.\nLas 2 líneas están separadas por un retorno de carro a la línea. PredefinedMailTestHtml=Esto es un e-mail de prueba(la palabra prueba debe de estar en negrita).
Las 2 líneas están separadas por un retorno de carro en la línea diff --git a/htdocs/langs/et_EE/admin.lang b/htdocs/langs/et_EE/admin.lang index b42ccb0a190..5bf1e057406 100644 --- a/htdocs/langs/et_EE/admin.lang +++ b/htdocs/langs/et_EE/admin.lang @@ -811,7 +811,7 @@ GeneratedPasswordDesc=Määratlege siin, mis reegel, mida soovite kasutada, et l DictionnaryDesc=Määratlege siin kõik viide andmete suhtes. Te võite täita eelnevalt kindlaksmääratud väärtus sinu. ConstDesc=Sellel leheküljel saab muuta kõik muud parameetrid ei ole kättesaadavad varasematel lehekülgedel. Need on ette nähtud parameetrid arenenud arendajad või troubleshouting. OnceSetupFinishedCreateUsers=Warning, olete Dolibarr administraatori. Administrator kasutajad on harjunud setup Dolibarr. Sest tavaline kasutamine Dolibarr, on soovitatav kasutada mitte administraatori loodud Kasutajad ja grupid menüü. -MiscellanousDesc=Määratlege siin kõik muud parameetrid, mis on seotud turvalisuse. +MiscellaneousDesc=Määratlege siin kõik muud parameetrid, mis on seotud turvalisuse. LimitsSetup=Piirid / Täppisseadmed setup LimitsDesc=Saate määrata piirid, täpsust ja optimeerimist, mida Dolibarr siin MAIN_MAX_DECIMALS_UNIT=Max kümnendkohtade jaoks ühikuhinnad @@ -885,7 +885,7 @@ DocumentModelOdt=Loo dokumente OpenDocuments mallid (. ODT faile OpenOffice, KOf WatermarkOnDraft=Vesimärgi dokumendi eelnõu CompanyIdProfChecker=Professional Id ainulaadne MustBeUnique=Peab olema unikaalne? -Miscellanous=Muu +Miscellaneous=Muu WebCalSetup=WebCalendar link setup WebCalSyncro=Lisa Dolibarr üritused WebCalendar WebCalAllways=Alati ei paludes diff --git a/htdocs/langs/et_EE/install.lang b/htdocs/langs/et_EE/install.lang index 6ec8e605c2a..02a3d958590 100644 --- a/htdocs/langs/et_EE/install.lang +++ b/htdocs/langs/et_EE/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US -> et_EE CHARSET=UTF-8 InstallEasy=Lihtsalt järgige samm-sammult. -MiscellanousChecks=Eeldused kontrollida +MiscellaneousChecks=Eeldused kontrollida DolibarrWelcome=Tere tulemast Dolibarr ConfFileExists=Konfiguratsioonifaili %s olemas. ConfFileDoesNotExists=Konfiguratsioonifaili %s ei eksisteeri! diff --git a/htdocs/langs/et_EE/other.lang b/htdocs/langs/et_EE/other.lang index 05f03c45749..8d83875f9c2 100644 --- a/htdocs/langs/et_EE/other.lang +++ b/htdocs/langs/et_EE/other.lang @@ -52,7 +52,7 @@ TotalSizeOfAttachedFiles=Kogusuurus lisatud faile / dokumente MaxSize=Maksimaalne suurus AttachANewFile=Lisada uue faili / dokumendi LinkedObject=Lingitud objekti -Miscellanous=Muu +Miscellaneous=Muu NbOfActiveNotifications=Teadete arv PredefinedMailTest=See on test mail. \ NThe kaks rida on eraldatud kelgutagastusmärgid. PredefinedMailTestHtml=See on test post (sõna test peab olema paksus kirjas).
2 rida on eraldatud kelgutagastusmärgid. diff --git a/htdocs/langs/fa_IR/admin.lang b/htdocs/langs/fa_IR/admin.lang index 2f703f61e92..e68113502ae 100644 --- a/htdocs/langs/fa_IR/admin.lang +++ b/htdocs/langs/fa_IR/admin.lang @@ -677,7 +677,7 @@ GeneratedPasswordDesc=هنا تعريف القاعدة التي تريد است DictionnaryDesc=تعرف هنا إشارة datas. يمكنك استكمال مسبقا مع قيمة لك. ConstDesc=تسمح لك هذه الصفحة لتحرير جميع البارامترات الأخرى غير المتوفرة في الصفحات السابقة. فهي محفوظة لمعايير متقدمة للمطورين أو troubleshouting. OnceSetupFinishedCreateUsers=تحذير فأنت Dolibarr مدير المستخدم. مدير المستخدمين تستخدم لإعداد Dolibarr. لالمعتاد استخدام Dolibarr ، يوصى باستخدام غير مستخدم مدير خلق مجموعات من المستخدمين & القائمة. -MiscellanousDesc=هنا تعريف جميع البارامترات الأخرى ذات الصلة بالأمن. +MiscellaneousDesc=هنا تعريف جميع البارامترات الأخرى ذات الصلة بالأمن. LimitsSetup=حدود / الدقيقة الإعداد LimitsDesc=يمكنك تحديد الحدود ، وoptimisations الايضاحات التي تستخدمها Dolibarr هنا MAIN_MAX_DECIMALS_UNIT=ماكس عشرية لأسعار الوحدات diff --git a/htdocs/langs/fa_IR/install.lang b/htdocs/langs/fa_IR/install.lang index 545d17c8f76..5e3f6f3d6c1 100644 --- a/htdocs/langs/fa_IR/install.lang +++ b/htdocs/langs/fa_IR/install.lang @@ -10,7 +10,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=فقط اتبع التعليمات خطوة بخطوة. -MiscellanousChecks=التحقق من الشروط الأساسية +MiscellaneousChecks=التحقق من الشروط الأساسية DolibarrWelcome=مرحبا بكم في Dolibarr ConfFileExists=ملفات موجودة ٪ ق. ConfFileDoesNotExists=ملفات ل ٪ لا وجود له! diff --git a/htdocs/langs/fa_IR/other.lang b/htdocs/langs/fa_IR/other.lang index c894874b674..482b40f4888 100644 --- a/htdocs/langs/fa_IR/other.lang +++ b/htdocs/langs/fa_IR/other.lang @@ -27,7 +27,7 @@ TotalSizeOfAttachedFiles=اجمالى حجم الملفات المرفقة / و MaxSize=الحجم الأقصى AttachANewFile=إرفاق ملف جديد / وثيقة LinkedObject=ربط وجوه -Miscellanous=متفرقات +Miscellaneous=متفرقات NbOfActiveNotifications=عدد الإخطارات ChooseYourDemoProfil=اختيار عرض ملف المباراة التي أنشطتك... DemoFundation=أعضاء في إدارة مؤسسة diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang index a79d9c9adbf..d8c9d5f70ed 100644 --- a/htdocs/langs/fi_FI/admin.lang +++ b/htdocs/langs/fi_FI/admin.lang @@ -595,7 +595,7 @@ GeneratedPasswordDesc=Määritä tässä joka sääntö, jota haluat käyttää DictionnaryDesc=Määritä tässä kaikki viittaukset datas. Voit täysin ennalta-arvon sinun. ConstDesc=Tällä sivulla voit muokata kaikkia muita muuttujia ei ole saatavilla edellinen sivua. Ne on varattu parametrit edistyneelle kehittäjät tai troubleshouting. OnceSetupFinishedCreateUsers=Varoitus, olet Dolibarr järjestelmänvalvojan käyttäjätili. Administrator käyttäjät ovat tottuneet setup Dolibarr. Jos kyseessä on tavanomainen käyttö Dolibarr, on suositeltavaa käyttää kuin järjestelmänvalvojan käyttäjätili luotu Käyttäjät & ryhmät valikosta. -MiscellanousDesc=Määritä tässä kaikki muut parametrit, jotka liittyvät turvallisuuteen. +MiscellaneousDesc=Määritä tässä kaikki muut parametrit, jotka liittyvät turvallisuuteen. LimitsSetup=Rajat / Precision setup LimitsDesc=Voit määrittää rajat, täsmennyksiä ja optimisations käyttää Dolibarr tästä MAIN_MAX_DECIMALS_UNIT=Max desimaalitarkkuuksia yksikkökohtaiseen hinnat @@ -1269,7 +1269,7 @@ SendmailOptionNotComplete=Varoitus, joissakin Linux-järjestelmissä, lähettä SendmailOptionMayHurtBuggedMTA=Ominaisuus lähettää sähköpostiviestejä käyttäen menetelmää "PHP mail suoraan" luo sähköpostiviestin, joka saattaa olla oikein jäsentää jotkut saavat sähköpostipalvelimia. Tulos on, että jotkut sähköpostit eivät voi lukea ihmisten isännöi thoose salakuunnella alustoilla. On kyse jostain Internet-palveluntarjoajien (Ex: Orange Ranskassa). Tämä ei ole ongelma tulee Dolibarr eikä osaksi PHP vaan päälle saa sähköpostipalvelimelle. Voit kuitenkin lisätä vaihtoehto MAIN_FIX_FOR_BUGGED_MTA 1 tulee setup - muuta muuttaa Dolibarr välttää. Kuitenkin saattaa ilmetä ongelmia muiden palvelimien mielessä tiukasti SMTP-standardin. Muut liuosta (Suositeltu) on käyttää menetelmää "SMTP liittimeen kirjasto", joka ei ole haittaa. CompanyIdProfChecker=Ammatillinen tunnus ainutlaatuinen MustBeUnique=Täytyy olla ainutlaatuinen? -Miscellanous=Muut +Miscellaneous=Muut ContractsSetup=Sopimukset moduuli setup ContractsNumberingModules=Sopimukset numerointi moduulit AdherentLoginRequired=Hallitse Sisään jokaiselle jäsenelle diff --git a/htdocs/langs/fi_FI/install.lang b/htdocs/langs/fi_FI/install.lang index 81448a6ab86..a8710768ef1 100644 --- a/htdocs/langs/fi_FI/install.lang +++ b/htdocs/langs/fi_FI/install.lang @@ -10,7 +10,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=Me yritimme tehdä Dolibarr setup mahdollisimman helppoa. Seuraa ohjeita vaihe vaiheelta. -MiscellanousChecks=Esitiedot tarkistaa +MiscellaneousChecks=Esitiedot tarkistaa DolibarrWelcome=Tervetuloa Dolibarr ConfFileExists=Configuration file %s on olemassa. ConfFileDoesNotExists=Configuration file %s ei ole olemassa! diff --git a/htdocs/langs/fi_FI/other.lang b/htdocs/langs/fi_FI/other.lang index 9f0e94160b8..f81601b4032 100644 --- a/htdocs/langs/fi_FI/other.lang +++ b/htdocs/langs/fi_FI/other.lang @@ -23,7 +23,7 @@ TotalSizeOfAttachedFiles=Kokonaiskoosta liitettyjen tiedostojen / asiakirjat MaxSize=Enimmäiskoko AttachANewFile=Liitä uusi tiedosto / asiakirjan LinkedObject=Linkitettyä objektia -Miscellanous=Miscellaneous +Miscellaneous=Miscellaneous NbOfActiveNotifications=Ilmoitusten lukumäärä ChooseYourDemoProfil=Valitse demo profil jotka vastaavat aktiviisuutesi ... DemoCompanyShopWithCashDesk=Hallinnoi liikkeen kanssa kassa diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index a20821cd61b..e688d9eab8c 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -891,7 +891,7 @@ GeneratedPasswordDesc= Definissez ici quelle règle vous voulez utiliser pour g DictionnaryDesc= Définissez ici les données de référence. Vous pouvez compléter/modifier les données prédéfinies avec les vôtres. ConstDesc= Cet écran permet d'éditer tout autre paramètre non éditable dans les pages précédentes. Ce sont en général des paramètres réservés aux développeurs avancés ou utilisés pour du dépannage. OnceSetupFinishedCreateUsers= Attention, vous êtes sous un compte administrateur de Dolibarr. Les administrateurs sont utilisés pour configurer Dolibarr. Pour une utilisation courante de Dolibarr, il est recommandé d'utiliser un compte non administrateur créé depuis le menu "Utilisateurs & Groupes". -MiscellanousDesc= Définissez ici les autres paramètres en rapport avec la sécurité. +MiscellaneousDesc= Définissez ici les autres paramètres en rapport avec la sécurité. LimitsSetup= Configuration des limites et précisions LimitsDesc= Vous pouvez définir ici les limites, précisions et optimisations utilisées par Dolibarr MAIN_MAX_DECIMALS_UNIT= Nombre de décimales maximum pour les prix unitaires @@ -984,7 +984,7 @@ CompanyIdProfChecker=Règles sur les Ids professionnels MustBeUnique=Doit être unique ? MustBeMandatory=Doit être obligatoire pour creer tiers ? MustBeInvoiceMandatory=Doit être obligatoire pour valider factures ? -Miscellanous=Divers +Miscellaneous=Divers ##### Webcal setup ##### WebCalSetup= Configuration du lien vers le calendrier Webcalendar WebCalSyncro= Intégrer les événements Dolibarr dans WebCalendar diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index 5a34feaf94e..bca39cf1bae 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - fr_FR - install CHARSET=UTF-8 InstallEasy=Veuillez suivre les étapes une à une. -MiscellanousChecks=Vérification de prérequis +MiscellaneousChecks=Vérification de prérequis DolibarrWelcome=Bienvenue sur Dolibarr ConfFileExists=Le fichier de configuration %s existe. ConfFileDoesNotExists=Le fichier de configuration %s n'existe pas ! diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index 9076dff82ba..e448feaa3b4 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -44,7 +44,7 @@ TotalSizeOfAttachedFiles=Taille total fichiers/documents liés MaxSize=Taille maximum AttachANewFile=Ajouter un nouveau fichier/document LinkedObject=Objet lié -Miscellanous=Divers +Miscellaneous=Divers NbOfActiveNotifications=Nombre de notifications PredefinedMailTest=Ceci est un mail de test.\nLes 2 lignes sont séparées par un retour à la ligne.\n\n__SIGNATURE__ PredefinedMailTestHtml=Ceci est un mail de test (le mot test doit être en gras).
Les 2 lignes sont séparées par un retour à la ligne.

__SIGNATURE__ diff --git a/htdocs/langs/he_IL/admin.lang b/htdocs/langs/he_IL/admin.lang index 4c9f6a55ec0..aa1b8cd5a70 100644 --- a/htdocs/langs/he_IL/admin.lang +++ b/htdocs/langs/he_IL/admin.lang @@ -811,7 +811,7 @@ GeneratedPasswordDesc=להגדיר כאן כלל שבו ברצונך להשתמ DictionnaryDesc=להגדיר כאן את כל datas הפניה. אתה יכול להשלים ערך מוגדר מראש עם שלך. ConstDesc=דף זה מאפשר לך לערוך את כל הפרמטרים האחרים לא זמין בעמודים הקודמים. הם שמורים הפרמטרים למפתחים מתקדמים או troubleshouting. OnceSetupFinishedCreateUsers=אזהרה, אתה משתמש שמנהל Dolibarr. מנהל משתמשים רגילים להגדיר Dolibarr. לשימוש הרגיל של Dolibarr, מומלץ להשתמש משתמש של מנהל מערכת לא נוצר משתמשים & תפריט קבוצות. -MiscellanousDesc=להגדיר כאן את כל הפרמטרים האחרים הקשורים לביטחון. +MiscellaneousDesc=להגדיר כאן את כל הפרמטרים האחרים הקשורים לביטחון. LimitsSetup=גבולות / הגדרת Precision LimitsDesc=ניתן להגדיר גבולות, precisions ו optimisations המשמשים Dolibarr כאן MAIN_MAX_DECIMALS_UNIT=מקס שברים עשרוניים עבור מחירי יחידה @@ -887,7 +887,7 @@ DocumentModelOdt=צור מסמכים מתבניות OpenDocuments (. ODT קבצ WatermarkOnDraft=סימן מים על מסמך טיוטה CompanyIdProfChecker=Professional מזהה ייחודי MustBeUnique=חייב להיות ייחודי? -Miscellanous=שונות +Miscellaneous=שונות WebCalSetup=קישור לוח השנה ההתקנה WebCalSyncro=הוסף אירוע Dolibarr אל לוח השנה WebCalAllways=תמיד, לא לשאול diff --git a/htdocs/langs/he_IL/install.lang b/htdocs/langs/he_IL/install.lang index 8fa0761a30c..0e9af490a47 100644 --- a/htdocs/langs/he_IL/install.lang +++ b/htdocs/langs/he_IL/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US -> he_IL CHARSET=UTF-8 InstallEasy=עקוב אחר ההוראות צעד אחר צעד. -MiscellanousChecks=תנאים מוקדמים לבדוק +MiscellaneousChecks=תנאים מוקדמים לבדוק DolibarrWelcome=ברוכים הבאים Dolibarr ConfFileExists=קובץ %s תצורת קיים. ConfFileDoesNotExists=קובץ %s תצורת לא קיים! diff --git a/htdocs/langs/he_IL/other.lang b/htdocs/langs/he_IL/other.lang index 1b3cf7c3de1..a39390e15b5 100644 --- a/htdocs/langs/he_IL/other.lang +++ b/htdocs/langs/he_IL/other.lang @@ -52,7 +52,7 @@ TotalSizeOfAttachedFiles=הגודל הכולל של הקבצים / מסמכים MaxSize=גודל מרבי של AttachANewFile=צירוף קובץ מסמך חדש / LinkedObject=אובייקט מקושר -Miscellanous=שונות +Miscellaneous=שונות NbOfActiveNotifications=מספר הודעות PredefinedMailTest=זהו אלקטרוני הבדיקה. \ NThe שני קווים מפרידים בהחזרת גררה. PredefinedMailTestHtml=זהו אלקטרוני המבחן (מבחן מילה חייב להיות מודגש).
שני קווים מפרידים בהחזרת גררה. diff --git a/htdocs/langs/hu_HU/admin.lang b/htdocs/langs/hu_HU/admin.lang index fd1a1715e7a..ea8420286e6 100644 --- a/htdocs/langs/hu_HU/admin.lang +++ b/htdocs/langs/hu_HU/admin.lang @@ -811,7 +811,7 @@ GeneratedPasswordDesc=Határozza meg itt, hogy melyik szabályt kívánja haszn DictionnaryDesc=Adjuk meg itt az összes referencia adatok. Készítse el előre meghatározott értéket a tiéd. ConstDesc=Ez az oldal lehetővé teszi, hogy módosítsuk az összes többi paraméter nem áll rendelkezésre az előző oldalakon. Ők tartják fenn paraméterek haladó fejlesztőknek vagy troubleshouting. OnceSetupFinishedCreateUsers=Figyelem, egy Dolibarr rendszergazdaként. Rendszergazda felhasználók használják Dolibarr beállítani. A szokásos használat Dolibarr, akkor ajánlatos használni egy nem adminisztrátori felhasználói létre Felhasználók és csoportok menüben. -MiscellanousDesc=Adjuk meg itt az összes többi paraméter a biztonsággal kapcsolatos. +MiscellaneousDesc=Adjuk meg itt az összes többi paraméter a biztonsággal kapcsolatos. LimitsSetup=Korlátok / Precision beállítás LimitsDesc=Megadhatjuk, korlátok, pontosítást és optimalizálás által használt Dolibarr itt MAIN_MAX_DECIMALS_UNIT=Max a tizedes egységár @@ -885,7 +885,7 @@ DocumentModelOdt=Generálása dokumentumok OpenDocuments sablonok (. ODT fájlok WatermarkOnDraft=Vízjel dokumentum tervezetét CompanyIdProfChecker=Professzionális egyedi azonosító MustBeUnique=Egyedinek kell lennie? -Miscellanous=Vegyes +Miscellaneous=Vegyes WebCalSetup=WebCalendar kapcsolat beállítása WebCalSyncro=Add Dolibarr események WebCalendar WebCalAllways=Mindig, nem kérdezi diff --git a/htdocs/langs/hu_HU/install.lang b/htdocs/langs/hu_HU/install.lang index b912875ca51..643ed52907d 100644 --- a/htdocs/langs/hu_HU/install.lang +++ b/htdocs/langs/hu_HU/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - hu_HU - install CHARSET=UTF-8 InstallEasy=Csak kövesse az utasitásokat lépésrõl lépésre. -MiscellanousChecks=Feltételek ellenörézse +MiscellaneousChecks=Feltételek ellenörézse DolibarrWelcome=Üdvözöljük a Dolibarr rendszerében ConfFileExists=%s konfigurációs fájl már létezik. ConfFileDoesNotExists=%s konfigurációs fájl NEM létezik! diff --git a/htdocs/langs/hu_HU/other.lang b/htdocs/langs/hu_HU/other.lang index 97c3c3e3470..a1f3fff1d0b 100644 --- a/htdocs/langs/hu_HU/other.lang +++ b/htdocs/langs/hu_HU/other.lang @@ -142,7 +142,7 @@ Notify_BILL_SUPPLIER_SENTBYMAIL=Szállító számlát postai úton Notify_CONTRACT_VALIDATE=A szerződés a validált Notify_FICHEINTER_VALIDATE=Beavatkozás érvényesített LinkedObject=Csatolt objektum -Miscellanous=Vegyes +Miscellaneous=Vegyes NbOfActiveNotifications=Bejelentések száma PredefinedMailTest=Ez egy teszt mailt. \ NA két vonal választja el egymástól kocsivissza. PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Meg fogja találni itt a számla __FACREF__ \n\n__PERSONALIZED__ Tisztelettel \n\n__SIGNATURE__ diff --git a/htdocs/langs/is_IS/admin.lang b/htdocs/langs/is_IS/admin.lang index 6ed5df3e4fb..2c4364cae88 100644 --- a/htdocs/langs/is_IS/admin.lang +++ b/htdocs/langs/is_IS/admin.lang @@ -734,7 +734,7 @@ GeneratedPasswordDesc=Veldu hér sem regla sem þú vilt nota til að búa til n DictionnaryDesc=Define hér öll tilvísun gögn. Þú getur lokið fyrirfram gildi við þitt. ConstDesc=Þessi síða leyfir þér að breyta öllum öðrum breytum ekki í boði í fyrri síður. Þau eru frátekin breytur fyrir háþróaður verktaki eða troubleshouting. OnceSetupFinishedCreateUsers=Aðvörun, ertu Dolibarr stjórnandi notandann. Stjórnandi notendur eru notuð til að skipulag Dolibarr. Fyrir venjulega notkun Dolibarr, það er mælt með að nota ekki stjórnandi notandi stofnaðar Notendur & Groups valmyndinni. -MiscellanousDesc=Veldu hér öllum öðrum þáttum sem tengjast öryggi. +MiscellaneousDesc=Veldu hér öllum öðrum þáttum sem tengjast öryggi. LimitsSetup=Mörk / Precision skipulag LimitsDesc=Þú getur skilgreint takmörk, precisions og optimisations notaður við Dolibarr hér MAIN_MAX_DECIMALS_UNIT=Max brotum um verð eining @@ -1260,7 +1260,7 @@ SendmailOptionNotComplete=Aðvörun, á sumum Linux kerfi, að senda tölvupóst SendmailOptionMayHurtBuggedMTA=Lögun að senda póst með aðferð "PHP póst-skrá" mun búa til tölvupóst sem gæti ekki rétt flokka af sumum sem fá póstur framreiðslumaður. Niðurstaðan er sú að sumir póstur er ekki hægt að lesa með því að fólk hýst hjá thoose bugged umhverfi. Það er raunin fyrir nokkrum Internet þjónustur (td: Orange í Frakklandi). Þetta er ekki vandamál í Dolibarr né í PHP en á móti póstur framreiðslumaður. Þú getur hins vegar bætt möguleika MAIN_FIX_FOR_BUGGED_MTA 1. í uppsetningu - annað að breyta Dolibarr að forðast þetta. Hins vegar getur þú lendir í vandræðum með öðrum netþjónum sem virðing stranglega SMTP staðall. Önnur lausn (recommanded) er að nota aðferðina "SMTP fals bókasafn" sem hefur enga ókosti. CompanyIdProfChecker=Professional Id einstakt MustBeUnique=Verður að vera einstakt? -Miscellanous=Ýmislegt +Miscellaneous=Ýmislegt ContractsSetup=Samningar mát skipulag ContractsNumberingModules=Samningar númera einingar AdherentLoginRequired=Stjórna Innskráning fyrir hvern meðlim diff --git a/htdocs/langs/is_IS/install.lang b/htdocs/langs/is_IS/install.lang index 6435b12fc13..7969cfea80c 100644 --- a/htdocs/langs/is_IS/install.lang +++ b/htdocs/langs/is_IS/install.lang @@ -113,7 +113,7 @@ ServerVersion=Gagnasafn framreiðslumaður útgáfa // START - Lines generated via autotranslator.php tool (2010-07-10 01:17:11). // Reference language: en_US InstallEasy=Fylgdu leiðbeiningunum skref fyrir skref. -MiscellanousChecks=Undanfarar stöðva +MiscellaneousChecks=Undanfarar stöðva DolibarrWelcome=Velkomin á Dolibarr ConfFileExists=Stillingar skrá %s til. ConfFileDoesNotExists=Stillingar %s er ekki til! diff --git a/htdocs/langs/is_IS/other.lang b/htdocs/langs/is_IS/other.lang index f0343871b02..1d8f5eb8816 100644 --- a/htdocs/langs/is_IS/other.lang +++ b/htdocs/langs/is_IS/other.lang @@ -28,7 +28,7 @@ TotalSizeOfAttachedFiles=Heildarstærð meðfylgjandi skrá / gögn MaxSize=Hámarks stærð AttachANewFile=Hengja nýja skrá / skjal LinkedObject=Tengd mótmæla -Miscellanous=Ýmislegt +Miscellaneous=Ýmislegt NbOfActiveNotifications=Fjöldi tilkynninga PredefinedMailTest=Þetta er prófun póst. \ NThe tvær línur eru aðskilin með vagn til baka. PredefinedMailTestHtml=Þetta er prófun póstur (orðið próf verður feitletruð).
Þessar tvær línur eru aðskilin með vagn til baka. diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index bb7757adb94..678da2c6fcb 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -606,8 +606,8 @@ MenuUseLayout =Permetti di nascondere il menu verticale (javascript no MessageLogin =Messaggio per la pagina di login MessageOfDay =Messaggio del giorno MinLength =Durata minima -MiscellanousDesc =Definire qui tutti gli altri parametri relativi alla sicurezza. -Miscellanous =Varie +MiscellaneousDesc =Definire qui tutti gli altri parametri relativi alla sicurezza. +Miscellaneous =Varie ModelModules =Modelli per i documenti ModifMenu =Modifica Menu ModifyProductDescAbility =Personalizzazione delle descrizioni dei prodotti nei form diff --git a/htdocs/langs/it_IT/install.lang b/htdocs/langs/it_IT/install.lang index 510d5a7abbe..d8ded8bdf16 100644 --- a/htdocs/langs/it_IT/install.lang +++ b/htdocs/langs/it_IT/install.lang @@ -154,7 +154,7 @@ MigrationStockDetail =Aggiornamento delle scorte dei prodotti MigrationSuccessfullUpdate =Aggiornamento completato con successo MigrationSupplierOrder =Migrazione dei dati degli ordini fornitori MigrationUpdateFailed =Aggiornamento fallito -MiscellanousChecks =Verificare prerequisiti +MiscellaneousChecks =Verificare prerequisiti NextStepMightLastALongTime =Il passaggio in corso può richiedere diverso tempo. Attendi il caricamento completo della schermata successiva prima di continuare. NotAvailable =Non disponibile OpenBaseDir =Parametro openbasedir diff --git a/htdocs/langs/it_IT/other.lang b/htdocs/langs/it_IT/other.lang index 33e575ca64f..9dee683f29f 100644 --- a/htdocs/langs/it_IT/other.lang +++ b/htdocs/langs/it_IT/other.lang @@ -90,7 +90,7 @@ MemberDeletedInDolibarr =Membro eliminato da Dolibarr MemberResiliatedInDolibarr =Membro %s revocato su Dolibarr MemberSubscriptionAddedInDolibarr =Adesione membro %s aggiunta a Dolibarr MemberValidatedInDolibarr =Membro %s convalidato su Dolibarr -Miscellanous =Varie +Miscellaneous =Varie ModifiedBy =Modificato da %s NbOfActiveNotifications =Numero di notifiche attive NbOfAttachedFiles =Numero di file/documenti allegati diff --git a/htdocs/langs/ja_JP/admin.lang b/htdocs/langs/ja_JP/admin.lang index f1a474fed1a..ae5819e0007 100644 --- a/htdocs/langs/ja_JP/admin.lang +++ b/htdocs/langs/ja_JP/admin.lang @@ -811,7 +811,7 @@ GeneratedPasswordDesc=あなたが自動生成されたパスワードを持つ DictionnaryDesc=ここですべての参照件のデータを定義します。あなたはあなたで定義済みの値を完了することができます。 ConstDesc=このページでは、前のページで使用できない他のすべてのパラメータを編集することができます。彼らは高度な開発者のためにまたはtroubleshoutingのパラメータを予約されています。 OnceSetupFinishedCreateUsers=警告は、あなたはDolibarr管理者のユーザーです。管理者ユーザーがDolibarrをセットアップするために使用されます。 Dolibarrの通常の使用方法については、それはユーザーとグループ]メニューから作成された非管理者ユーザーを使用することをお勧めします。 -MiscellanousDesc=ここでセキュリティに関連する他のすべてのパラメータを定義します。 +MiscellaneousDesc=ここでセキュリティに関連する他のすべてのパラメータを定義します。 LimitsSetup=制限/精密セットアップ LimitsDesc=ここDolibarrで使用される限界、精度と最適化を定義することができます。 MAIN_MAX_DECIMALS_UNIT=ユニット価格の最大小数点以下 @@ -885,7 +885,7 @@ DocumentModelOdt=OpenDocumentsテンプレートからドキュメントを生 WatermarkOnDraft=ドラフト文書に透かし CompanyIdProfChecker=ユニークなイドプロ MustBeUnique=一意である必要がありますか? -Miscellanous=雑多 +Miscellaneous=雑多 WebCalSetup=のwebcalendarリンクのセットアップ WebCalSyncro=のwebcalendar Dolibarrイベントを追加 WebCalAllways=常に、何を求めません diff --git a/htdocs/langs/ja_JP/install.lang b/htdocs/langs/ja_JP/install.lang index 0d74ebfdd7a..c39d1038bc7 100644 --- a/htdocs/langs/ja_JP/install.lang +++ b/htdocs/langs/ja_JP/install.lang @@ -137,7 +137,7 @@ MigrationActioncommElement=アクション上でデータを更新する // START - Lines generated via autotranslator.php tool (2012-02-29 16:41:06). // Reference language: en_US -> ja_JP -MiscellanousChecks=前提条件チェック +MiscellaneousChecks=前提条件チェック DolibarrWelcome=Dolibarrへようこそ ConfFileExists=コンフィギュレーションファイル%sが存在しています 。 ConfFileDoesNotExists=コンフィギュレーションファイル%sは存在しません! diff --git a/htdocs/langs/ja_JP/other.lang b/htdocs/langs/ja_JP/other.lang index af28cd1738d..d78c343cb5b 100644 --- a/htdocs/langs/ja_JP/other.lang +++ b/htdocs/langs/ja_JP/other.lang @@ -34,7 +34,7 @@ TotalSizeOfAttachedFiles=添付ファイル/文書の合計サイズ MaxSize=最大サイズ AttachANewFile=新しいファイル/文書を添付する LinkedObject=リンクされたオブジェクト -Miscellanous=その他 +Miscellaneous=その他 NbOfActiveNotifications=通知の数 DemoDesc=Dolibarrは、いくつかの機能モジュールで構成されるコンパクトなERP / CRMです。これが発生しないようにすべてのモジュールが含まれているデモは、何の意味もない。ので、いくつかのデモのプロファイルが用意されています。 ChooseYourDemoProfil=あなたの活動を一致させるデモのプロファイルを選択... diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang index f37656c62ab..d1800bfcd07 100644 --- a/htdocs/langs/nb_NO/admin.lang +++ b/htdocs/langs/nb_NO/admin.lang @@ -592,7 +592,7 @@ GeneratedPasswordDesc=Her angir du hvilken regel som skal generere nye passord d DictionnaryDesc=Her angir du alle referansedata/begreper. Du kan komplettere de forhåndsdefinerte dataene med dine egne. ConstDesc=Her kan du endre innstillinger som ikke er tilgjengelige på de foregående sidene. Dette er reserverte parametere, for avanserte utviklere eller for feilsøking. OnceSetupFinishedCreateUsers=OBS! Du er Dolibarr-administrator. Administratorer er brukere som kan sette opp programmet. For vanlig bruk av Dolibarr bør du lage en bruker uten administratorrettigheter ( i Brukere og grupper ). -MiscellanousDesc=Her angir du sikkerhetsinnstillinger for Dolibarr. +MiscellaneousDesc=Her angir du sikkerhetsinnstillinger for Dolibarr. LimitsSetup=Grenser/presisjon LimitsDesc=Her angir du grenser og presisjon som skal brukes i programmet MAIN_MAX_DECIMALS_UNIT=Desimaler i enhetspriser @@ -1282,7 +1282,7 @@ SendmailOptionNotComplete=Advarsel, på enkelte Linux-systemer, for å sende e-p SendmailOptionMayHurtBuggedMTA=Funksjon for å sende post ved hjelp av metoden "PHP mail direkte" vil generere en melding som kanskje ikke riktig analyseres av noen som fikk postservere. Resultatet er at enkelte poster ikke kan leses av folk vert thoose avlyttet plattformer. Det er tilfelle for enkelte Internett-leverandører (Ex: Orange i Frankrike). Dette er ikke et problem i Dolibarr heller inn PHP, men på motta e-post server. Du kan imidlertid legge til alternativ MAIN_FIX_FOR_BUGGED_MTA til 1 i oppsettet - andre til å endre Dolibarr å unngå dette. Imidlertid kan du oppleve problemer med andre servere som respekt strengt SMTP standard. Den andre løsningen (Anbefalte) er å bruke metoden "SMTP socket bibliotek" som ikke har noen ulemper. CompanyIdProfChecker=Profesjonell Id unik MustBeUnique=Må være unik? -Miscellanous=Diverse +Miscellaneous=Diverse ContractsSetup=Kontrakter modul oppsett ContractsNumberingModules=Kontrakter nummerering moduler AdherentLoginRequired=Behandle en Login for hvert medlem diff --git a/htdocs/langs/nb_NO/install.lang b/htdocs/langs/nb_NO/install.lang index 7597062d7ea..596b6160c3f 100644 --- a/htdocs/langs/nb_NO/install.lang +++ b/htdocs/langs/nb_NO/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=Bare følg instruksjonene trinn for trinn. -MiscellanousChecks=Forutsetninger sjekk +MiscellaneousChecks=Forutsetninger sjekk DolibarrWelcome=Velkommen til Dolibarr ConfFileExists=Konfigurasjonsfil %s eksisterer. ConfFileDoesNotExists=Konfigurasjonsfil %s finnes ikke! diff --git a/htdocs/langs/nb_NO/other.lang b/htdocs/langs/nb_NO/other.lang index 451d2c47fac..8e9428dc97d 100644 --- a/htdocs/langs/nb_NO/other.lang +++ b/htdocs/langs/nb_NO/other.lang @@ -22,7 +22,7 @@ TotalSizeOfAttachedFiles=Total størrelse på vedlagte filer/dokumenter MaxSize=Maksimal størrelse AttachANewFile=Legg ved ny fil/dokument LinkedObject=Lenkede objekter -Miscellanous=Diverse +Miscellaneous=Diverse NbOfActiveNotifications=Antall påminnelser PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Vedlagt oversendes faktura __FACREF__\n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n I følge våre noteringer ser det ut til at vår faktura __FACREF__ fortsatt står ubetalt hos oss. Dersom Deres betaling har krysset denne påminnelsen ber vi Dem vennligst se bort fra denne henvendelsen. \n\n__PERSONALIZED__Med vennlig hilsen\n\n__SIGNATURE__ diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang index 711478a2a6a..752ef761798 100644 --- a/htdocs/langs/nl_BE/admin.lang +++ b/htdocs/langs/nl_BE/admin.lang @@ -810,7 +810,7 @@ GeneratedPasswordDesc = Definieer hier de regel die u wilt gebruiken voor het ge DictionnaryDesc = Definieer hier alle referentie data. U kunt vooraf gedefinieerde waarde met de jouwe. ConstDesc = Deze pagina kunt u alle andere parameters die niet beschikbaar zijn in de voorgaande pagina's. Ze zijn voorbehouden parameters voor geavanceerde ontwikkelaars of voor troubleshouting. OnceSetupFinishedCreateUsers = Waarschuwing, u bent een Dolibarr administrator gebruiker. Administrators worden gebruikt voor het configureren van Dolibarr. Voor een normaal gebruik van Dolibarr wordt aangeraden om gebruik te maken van een niet-administrator gebruiker. Deze kan aangemaakt worden in het menu "Gebruikers en Groepen". -MiscellanousDesc = Definieer hier alle andere parameters die betrekking hebben op veiligheid. +MiscellaneousDesc = Definieer hier alle andere parameters die betrekking hebben op veiligheid. LimitsSetup = Grenzen / Precision setup LimitsDesc = U kunt definiëren grenzen, preciseringen en optimalisatie gebruikt door Dolibarr hier MAIN_MAX_DECIMALS_UNIT = Max decimalen voor eenheidsprijzen @@ -890,7 +890,7 @@ DocumentModelOdt = WatermarkOnDraft = CompanyIdProfChecker = MustBeUnique = Moet uniek zijn? -Miscellanous = Diverse +Miscellaneous = Diverse ##### Webcal setup ##### = WebCalSetup = Webcalendar link setup WebCalSyncro = Toevoegen Dolibarr evenementen WebCalendar diff --git a/htdocs/langs/nl_BE/install.lang b/htdocs/langs/nl_BE/install.lang index 6c013aa58c8..6bf989f5dc8 100644 --- a/htdocs/langs/nl_BE/install.lang +++ b/htdocs/langs/nl_BE/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - nl_BE - install CHARSET=UTF-8 InstallEasy=We hebben geprobeerd om de Dolibarr installatie zo eenvoudig mogelijk te maken. Volg de instructies stap voor stap. -MiscellanousChecks=Vereisten controleren +MiscellaneousChecks=Vereisten controleren DolibarrWelcome=Welkom bij Dolibarr ConfFileExists=Configuratiebestand %s bestaat. ConfFileDoesNotExists=Configuratiebestand %s bestaat niet! diff --git a/htdocs/langs/nl_BE/other.lang b/htdocs/langs/nl_BE/other.lang index 11bb7c4eb67..10913878f40 100644 --- a/htdocs/langs/nl_BE/other.lang +++ b/htdocs/langs/nl_BE/other.lang @@ -13,7 +13,7 @@ TotalSizeOfAttachedFiles=Totale omvang van de bijgevoegde bestanden / documenten MaxSize=Maximale grootte AttachANewFile=Voeg een nieuw bestand / document toe LinkedObject=Gekoppeld object -Miscellanous=Diversen +Miscellaneous=Diversen NbOfActiveNotifications=Aantal aanmeldingen DemoDesc=Dolibarr is geen compacte ERP maar is opgebouwd uit verschillende functionele modules. Een demo waarin alle modules zijn geactiveerd heeft geen zin, omdat niet alle modules in praktijk worden gebruikt. Het kan echter zijn dat alle modules wel worden gebruikt, dus zijn er verschillende demo-profielen beschikbaar. ChooseYourDemoProfil=Kies een demo profiel die overeenkomt met uw activiteit ... diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang index 5fe48ac0ab6..59259ffdb91 100644 --- a/htdocs/langs/nl_NL/admin.lang +++ b/htdocs/langs/nl_NL/admin.lang @@ -776,7 +776,7 @@ GeneratedPasswordDesc = Stel hier de regel in die u wilt gebruiken voor het gene DictionnaryDesc = Stel hier alle constanten in. U kunt vooraf ingestelde waarden aanpassen naar de uwe. ConstDesc = Op deze pagina vint u alle andere instellingen die niet beschikbaar zijn in de voorgaande pagina's. Ze zijn voorbehouden instellingen voor geavanceerde ontwikkelaars of voor 'troubleshouting'. OnceSetupFinishedCreateUsers = Waarschuwing, u bent een Dolibarr beheerder. Beheerdersaccounts worden gebruikt voor de installatie van Dolibarr. Voor een normaal gebruik van Dolibarr, wordt aangeraden gebruik te maken van een niet-beheerders account, aangemaakt onder: Gebruikers & Groepen menu. -MiscellanousDesc = Stel hier alle andere instellingen in die betrekking hebben op veiligheid. +MiscellaneousDesc = Stel hier alle andere instellingen in die betrekking hebben op veiligheid. LimitsSetup = Limieten- en precisieinstellingen LimitsDesc = U kunt hier limieten en preciseringen die Dolibarr gebruikt instellen MAIN_MAX_DECIMALS_UNIT = Maximaal aantal decimalen voor eenheidsprijzen @@ -1282,7 +1282,7 @@ SendingMailSetup=Instellen van verzendingen via e-mail SendmailOptionNotComplete=Waarschuwing, op sommige Linux-systemen, e-mail verzenden vanaf uw e-mail, sendmail uitvoering setup moet conatins optie-ba (parameter mail.force_extra_parameters in uw php.ini-bestand). Als sommige ontvangers nooit e-mails ontvangen, probeer dit PHP parameter bewerken met mail.force_extra_parameters =-ba). CompanyIdProfChecker=Professionele Id unieke MustBeUnique=Moet uniek zijn? -Miscellanous=Diversen +Miscellaneous=Diversen // STOP - Lines generated via autotranslator.php tool (2011-10-10 02:13:00). diff --git a/htdocs/langs/nl_NL/install.lang b/htdocs/langs/nl_NL/install.lang index b6bccb5d049..165e4e610be 100644 --- a/htdocs/langs/nl_NL/install.lang +++ b/htdocs/langs/nl_NL/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - nl_NL - install CHARSET = UTF-8 InstallEasy = Volg simpelweg stap voor stap de instructies -MiscellanousChecks = Vereisten controle +MiscellaneousChecks = Vereisten controle DolibarrWelcome = Welkom bij Dolibarr ConfFileExists = Configuratiebestand %s bestaat. ConfFileDoesNotExists = Configuratiebestand %s bestaat niet! diff --git a/htdocs/langs/nl_NL/other.lang b/htdocs/langs/nl_NL/other.lang index e2e7fba77f2..a7289d9e59a 100644 --- a/htdocs/langs/nl_NL/other.lang +++ b/htdocs/langs/nl_NL/other.lang @@ -23,7 +23,7 @@ TotalSizeOfAttachedFiles = Totale omvang van de bijgevoegde bestanden / document MaxSize = Maximale grootte AttachANewFile = Voeg een nieuw bestand / document bij LinkedObject = Gekoppeld object -Miscellanous = Diversen +Miscellaneous = Diversen NbOfActiveNotifications = Aantal kennisgevingen PredefinedMailTest = Dit is een test e-mail.\nDe twee lijnen worden gescheiden door een harde return. PredefinedMailTestHtml = Dit is een test e-mail (het woord test moet vetgedrukt worden weergegeven).
De twee lijnen worden gescheiden door een harde return. diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang index 1817660d665..f64a3185ca4 100644 --- a/htdocs/langs/pl_PL/admin.lang +++ b/htdocs/langs/pl_PL/admin.lang @@ -600,7 +600,7 @@ GeneratedPasswordDesc=Określ tutaj reguły, które chcesz użyć do wygenerowan DictionnaryDesc=Określ tutaj wszystkie odniesienia danych. Możesz zakończyć predefiniowane wartości Ciebie. ConstDesc=Ta strona pozwala edytować wszystkie inne parametry nie są dostępne w poprzedniej strony. Są one zastrzeżone dla zaawansowanych parametrów deweloperzy lub troubleshouting. OnceSetupFinishedCreateUsers=Ostrzeżenie, jesteś Dolibarr administratora użytkownika. Administrator użytkowników wykorzystywane są do konfiguracji Dolibarr. Dla Zazwyczaj korzystanie z Dolibarr, zaleca się używać nieujemnych administratora użytkownika tworzone Użytkownicy i grupy menu. -MiscellanousDesc=Określ tutaj wszystkie inne parametry związane z bezpieczeństwem. +MiscellaneousDesc=Określ tutaj wszystkie inne parametry związane z bezpieczeństwem. LimitsSetup=Ograniczenia / Precision konfiguracji LimitsDesc=Można określić limity, doprecyzowanie i optymalizacje stosowane przez Dolibarr tutaj MAIN_MAX_DECIMALS_UNIT=Max dziesiętnych na ceny jednostkowe @@ -1268,7 +1268,7 @@ SendmailOptionNotComplete=Uwaga, w niektórych systemach Linux, aby wysłać e-m SendmailOptionMayHurtBuggedMTA=Funkcja wysyłania wiadomości za pomocą metody "PHP mail bezpośrednie" wygeneruje wiadomość e-mail, które mogą nie być prawidłowo przetwarzany przez niektórych serwerach odbieraniem poczty. Powoduje to, że niektóre maile nie mogą być odczytywane przez ludzi hostowanych przez thoose podsłuchu platform. Jest tak w przypadku niektórych dostawców internetowych (np.: Orange w Francji). To nie jest problem w Dolibarr ani w PHP, ale na otrzymaniu serwera poczty jest. Można jednak dodać MAIN_FIX_FOR_BUGGED_MTA opcji do 1 w konfiguracji - inne zmiany Dolibarr aby tego uniknąć. Jednak może wystąpić problem z innych serwerów, które ścisłego przestrzegania standardowych SMTP. Innym rozwiązaniem (zaleciły) jest użycie metody "SMTP gniazdo biblioteki", który ma wady. CompanyIdProfChecker=Profesjonalny Identyfikator unikalny MustBeUnique=Musi być wyjątkowa? -Miscellanous=Różne +Miscellaneous=Różne ContractsSetup=Konfiguracja modułu umowy ContractsNumberingModules=Kontrakty numerowania modułów AdherentLoginRequired=Zarządzanie logowania dla każdego członka diff --git a/htdocs/langs/pl_PL/install.lang b/htdocs/langs/pl_PL/install.lang index aac038cf676..69765ee10b5 100644 --- a/htdocs/langs/pl_PL/install.lang +++ b/htdocs/langs/pl_PL/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - pl_PL - install CHARSET=UTF-8 InstallEasy=Staraliśmy się by instalacja Dolibarra była tak prosta jak to możliwe. Postępuj wg instrukcji krok po kroku. -MiscellanousChecks=Sprawdzenie wymagań +MiscellaneousChecks=Sprawdzenie wymagań DolibarrWelcome=Witaj w Dolibarrze ConfFileExists=Plik konfiguracyjny %s istnieje. ConfFileDoesNotExists=Plik konfiguracyjny %s nie istnieje! @@ -213,7 +213,7 @@ MigrationDeliveryAddress=Aktualizacja adresu dostarczenia przesyłki // Reference language: en_US CHARSET=UTF-8 InstallEasy=Bare følg instruksjonene trinn for trinn. -MiscellanousChecks=Forutsetninger sjekk +MiscellaneousChecks=Forutsetninger sjekk DolibarrWelcome=Velkommen til Dolibarr ConfFileExists=Konfigurasjonsfil %s eksisterer. ConfFileDoesNotExists=Konfigurasjonsfil %s finnes ikke! diff --git a/htdocs/langs/pl_PL/other.lang b/htdocs/langs/pl_PL/other.lang index 9caefe6bc0f..f27b2e78fa8 100644 --- a/htdocs/langs/pl_PL/other.lang +++ b/htdocs/langs/pl_PL/other.lang @@ -25,7 +25,7 @@ TotalSizeOfAttachedFiles=Całkowita wielkość załączonych plików / dokument MaxSize=Maksymalny rozmiar AttachANewFile=Załącz nowy plik / dokument LinkedObject=Związany obiektu -Miscellanous=Miscellaneous +Miscellaneous=Miscellaneous NbOfActiveNotifications=Liczba zgłoszeń ChooseYourDemoProfil=Wybierz demo, które pasują do profilu działalności ... DemoFundation=Zarządzanie użytkowników o fundacji diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index d001e6fb84c..2dc05d0d1e5 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -662,7 +662,7 @@ GeneratedPasswordDesc=Indique aqui que norma quer utilizar para Gerar as Senhas DictionnaryDesc=Indique aqui os dados de referencia. pode completar/modificar os dados predefinidos com os seus ConstDesc=qualquer outro parâmetro não editável em páginas anteriores OnceSetupFinishedCreateUsers=Atenção, está baixo de uma conta de administrador de Dolibarr. os administradores se utilizam para configurar a Dolibarr. Para um uso corrente de Dolibarr, recomenda-se utilizar uma conta não administrador criada a partir do menu "Usuários e grupos" -MiscellanousDesc=Defina aqui os Outros parâmetros relacionados com a segurança. +MiscellaneousDesc=Defina aqui os Outros parâmetros relacionados com a segurança. LimitsSetup=configuração de limites e precisões LimitsDesc=pode definir aqui os limites e precisões utilizados por Dolibarr MAIN_MAX_DECIMALS_UNIT=Casas decimais máximas para os preços unitários diff --git a/htdocs/langs/pt_BR/install.lang b/htdocs/langs/pt_BR/install.lang index c398d91fcbd..0a0f83e1d50 100644 --- a/htdocs/langs/pt_BR/install.lang +++ b/htdocs/langs/pt_BR/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - fr_PT - install CHARSET=UTF-8 InstallEasy=Tentámos tornar a instalação do Dolibarr o mais fácil possível. É favor seguir as instruções passo-a-passo. -MiscellanousChecks=Pré-requisitos check +MiscellaneousChecks=Pré-requisitos check DolibarrWelcome=Bem-vindo ao Dolibarr ConfFileExists=O arquivo de configuração conf.php existe. ConfFileDoesNotExists=Arquivo de configuração %s não existe! diff --git a/htdocs/langs/pt_BR/other.lang b/htdocs/langs/pt_BR/other.lang index 688fd19e32a..cb9fae3cdf9 100755 --- a/htdocs/langs/pt_BR/other.lang +++ b/htdocs/langs/pt_BR/other.lang @@ -17,7 +17,7 @@ TotalSizeOfAttachedFiles=Tamanho Total dos Arquivos/Documentos Anexos MaxSize=Tamanho Máximo AttachANewFile=Adicionar Novo Arquivo/Documento LinkedObject=Arquivo Anexo -Miscellanous=Diversos +Miscellaneous=Diversos NbOfActiveNotifications=Número Notificações PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Estimados senhores,\n\nem anexo enviamos a nossa fatura __FACREF__ .\n\nAtenciosamente\n\n PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Estimados senhores,\n\ninformamos que a fatura __FACREF__ nos consta como não paga. Por favor revisar a fatura anexada e nos dar uma posicao.\n\nAtenciosamente\n\n diff --git a/htdocs/langs/pt_PT/admin.lang b/htdocs/langs/pt_PT/admin.lang index 101386ac926..a3de0cb68dd 100644 --- a/htdocs/langs/pt_PT/admin.lang +++ b/htdocs/langs/pt_PT/admin.lang @@ -528,7 +528,7 @@ MenuUpgrade = Upgrade / Ampliar MessageLogin = Mensagem do login MessageOfDay = Mensagem do día MinLength = Prazo mínimo -MiscellanousDesc = Defina aquí os Outros parâmetros relacionados com a segurança. +MiscellaneousDesc = Defina aquí os Outros parâmetros relacionados com a segurança. ModelModules = Documentos modelos ModifMenu = Modificação do menu ModifyProductDescAbility = Personalização das descrições dos produtos nos formularios @@ -1207,7 +1207,7 @@ MAIN_PROXY_USER = Entrar para usar o servidor proxy MAIN_SMS_SENDMODE = Método a ser usado para enviar SMS MenuSmartphoneManager = Gestor de menu Smartphone MenuUseLayout = Faça menu vertical (javascript opção não deve ser desativado) -Miscellanous = Diversos +Miscellaneous = Diversos Module105Desc = Mailman ou Spip interface para o módulo membro Module105Name = Mailman e Sip Module50000Desc = Módulo para oferecer uma página de pagamento online por cartão de crédito com paybox diff --git a/htdocs/langs/pt_PT/install.lang b/htdocs/langs/pt_PT/install.lang index 4110c879efe..6d9829ca49f 100644 --- a/htdocs/langs/pt_PT/install.lang +++ b/htdocs/langs/pt_PT/install.lang @@ -149,7 +149,7 @@ MigrationStockDetail=Atualizar stock valor dos produtos MigrationSuccessfullUpdate=Actualização bem sucedida MigrationSupplierOrder=Migração de dados de Fornecedores' ordens MigrationUpdateFailed=Falha na atualização processo -MiscellanousChecks=Pré-requisitos check +MiscellaneousChecks=Pré-requisitos check NextStepMightLastALongTime=etapa atual pode durar vários minutos. Por favor, aguarde até a próxima tela é mostrada completamente antes de continuar. NotAvailable=Não disponível OpenBaseDir=parametr openbasedir PHP diff --git a/htdocs/langs/pt_PT/other.lang b/htdocs/langs/pt_PT/other.lang index 8fb2274b40d..78666607153 100644 --- a/htdocs/langs/pt_PT/other.lang +++ b/htdocs/langs/pt_PT/other.lang @@ -14,7 +14,7 @@ TotalSizeOfAttachedFiles=Tamanho Total dos Ficheiros/Documentos anexos MaxSize=Tamanho Máximo AttachANewFile=Adicionar Novo Ficheiro/documento LinkedObject=Objecto adjudicado -Miscellanous=Diversos +Miscellaneous=Diversos NbOfActiveNotifications=Número Notificações PredefinedMailContentSendInvoice=__CONTACTCIVNAME__ \n\n Juntamos a factura __FACREF__\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ PredefinedMailContentSendInvoiceReminder=__CONTACTCIVNAME__ \n\n Damos conhecimento que a factura __FACREF__ parece não estar paga. Segue em anexo, para que possa rever.\n\n__PERSONALIZED__Cordialmente\n\n__SIGNATURE__ diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang index e049b78fbbd..04bd74a5784 100644 --- a/htdocs/langs/ro_RO/admin.lang +++ b/htdocs/langs/ro_RO/admin.lang @@ -598,7 +598,7 @@ GeneratedPasswordDesc=Definiţi aici regulă care doriţi să-l utilizaţi pentr DictionnaryDesc=Definiţi aici toate datele de referinţă. Puteţi completa predefinite valoarea cu a ta. ConstDesc=Această pagină vă permite să editaţi toate alţi parametri care nu sunt disponibile în ultimele pagini. Acestea sunt rezervate pentru parametrii avansat dezvoltatorii sau pentru troubleshouting. OnceSetupFinishedCreateUsers=Atenţie, esti un utilizator Dolibarr administrator. Administrator utilizatori sunt utilizate pentru a instala Dolibarr. Pentru o utilizare obişnuită a Dolibarr, este recomandat să folosiţi un administrator de utilizator creat de utilizatori şi grupuri de meniu. -MiscellanousDesc=Definiţi parametrii de aici toate celelalte legate de securitate. +MiscellaneousDesc=Definiţi parametrii de aici toate celelalte legate de securitate. LimitsSetup=Limitele / precizie setup LimitsDesc=Puteţi defini limitele, precisions şi optimisations utilizate de către Dolibarr aici MAIN_MAX_DECIMALS_UNIT=Max zecimale pentru unitate de preţuri @@ -1269,7 +1269,7 @@ SendmailOptionNotComplete=Atenţie, pe unele sisteme Linux, pentru a trimite e-m SendmailOptionMayHurtBuggedMTA=Caracteristică pentru a trimite mesaje utilizând metoda "mail PHP directă" va genera un mesaj e-mail care nu s-ar putea să fie corect interpretat de către unele servere de e-mail primit. Rezultatul este că unele mail-uri nu pot fi citite de persoane găzduite de platforme thoose bugged. Este cazul unor furnizori de Internet (Ex: Orange în Franţa). Aceasta nu este o problemă în Dolibarr nici în PHP, dar primesc pe serverul de poştă electronică. Puteţi adăuga toate acestea, opţiunea MAIN_FIX_FOR_BUGGED_MTA la 1 în configurare - pentru a modifica alte Dolibarr pentru a evita acest lucru. Cu toate acestea, este posibil să aveţi probleme cu alte servere care sens strict standard SMTP. Altă soluţie (recommanded) este de a utiliza metoda "SMTP socket bibliotecă", care nu are dezavantaje. CompanyIdProfChecker=Professional ID unic MustBeUnique=Trebuie să fie unice? -Miscellanous=Diverse +Miscellaneous=Diverse ContractsSetup=Contracte de modul de configurare ContractsNumberingModules=Contracte de numerotare module AdherentLoginRequired=Gestiona un Autentificare pentru fiecare membru diff --git a/htdocs/langs/ro_RO/install.lang b/htdocs/langs/ro_RO/install.lang index bbf504158fc..84310cb029b 100644 --- a/htdocs/langs/ro_RO/install.lang +++ b/htdocs/langs/ro_RO/install.lang @@ -754,7 +754,7 @@ GeneratedPasswordDesc=Określ tutaj reguły, które chcesz użyć do wygenerowan DictionnaryDesc=Określ tutaj wszystkie odniesienia danych. Możesz zakończyć predefiniowane wartości Ciebie. ConstDesc=Ta strona pozwala edytować wszystkie inne parametry nie są dostępne w poprzedniej strony. Są one zastrzeżone dla zaawansowanych parametrów deweloperzy lub troubleshouting. OnceSetupFinishedCreateUsers=Ostrzeżenie, jesteś Dolibarr administratora użytkownika. Administrator użytkowników wykorzystywane są do konfiguracji Dolibarr. Dla Zazwyczaj korzystanie z Dolibarr, zaleca się używać nieujemnych administratora użytkownika tworzone Użytkownicy i grupy menu. -MiscellanousDesc=Określ tutaj wszystkie inne parametry związane z bezpieczeństwem. +MiscellaneousDesc=Określ tutaj wszystkie inne parametry związane z bezpieczeństwem. LimitsSetup=Ograniczenia / Precision konfiguracji LimitsDesc=Można określić limity, doprecyzowanie i optymalizacje stosowane przez Dolibarr tutaj MAIN_MAX_DECIMALS_UNIT=Max dziesiętnych na ceny jednostkowe @@ -804,7 +804,7 @@ WebCalAddE // START - Lines generated via autotranslator.php tool (2012-02-29 17:23:15). // Reference language: en_US -> ro_RO InstallEasy=Doar urmaţi instrucţiunile pas cu pas. -MiscellanousChecks=Cerinţe preliminare a verifica +MiscellaneousChecks=Cerinţe preliminare a verifica DolibarrWelcome=Bine ati venit la Dolibarr ConfFileExists=%s fişierul de configurare există. ConfFileDoesNotExists=%s fişier de configurare nu exista! diff --git a/htdocs/langs/ro_RO/other.lang b/htdocs/langs/ro_RO/other.lang index 3b46ab31625..0527aab3ee8 100644 --- a/htdocs/langs/ro_RO/other.lang +++ b/htdocs/langs/ro_RO/other.lang @@ -23,7 +23,7 @@ TotalSizeOfAttachedFiles=Total marimea ataşat fişiere / documente MaxSize=Mărimea maximă a AttachANewFile=Ataşaţi un fişier nou / document LinkedObject=Legate de obiectul -Miscellanous=Diverse +Miscellaneous=Diverse NbOfActiveNotifications=Număr de notificări ChooseYourDemoProfil=Alegeţi demo care se potrivesc cu profilul de activitate ... DemoFundation=Gestionare membrii unui Fundaţia diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang index 9f051c0f3ba..db77c166cf3 100644 --- a/htdocs/langs/ru_RU/admin.lang +++ b/htdocs/langs/ru_RU/admin.lang @@ -597,7 +597,7 @@ GeneratedPasswordDesc=Определить здесь правила, котор DictionnaryDesc=Определить здесь все ссылки данные. Вы можете заполнить заранее стоимость с вами. ConstDesc=На этой странице можно отредактировать все остальные параметры не доступны в предыдущих страницах. Они защищены параметров для продвинутых разработчиков или troubleshouting. OnceSetupFinishedCreateUsers=Внимание, вы Dolibarr администратора пользователю. Администратор пользователей используются для установки Dolibarr. Для обычного использования Dolibarr, рекомендуется для использования, не администратор пользователя создается из пользователей И группах меню. -MiscellanousDesc=Определить здесь все другие параметры, связанные с безопасностью. +MiscellaneousDesc=Определить здесь все другие параметры, связанные с безопасностью. LimitsSetup=Пределы / Точная настройка LimitsDesc=Вы можете определить лимиты, уточнения и optimisations используемой Dolibarr здесь MAIN_MAX_DECIMALS_UNIT=Макс десятичных цен за единицу @@ -1251,7 +1251,7 @@ SendingMailSetup=Настройка отправки по электронной SendmailOptionNotComplete=Предупреждение, на некоторых системах Linux, для отправки электронной почты из электронной почты, Sendmail выполнения установки должны conatins опцию-ба (параметр mail.force_extra_parameters в файле php.ini). Если некоторые получатели не получают электронные письма, попытке изменить этот параметр с PHP mail.force_extra_parameters =-ба). CompanyIdProfChecker=Профессиональные Id уникальным MustBeUnique=Должно быть уникальным? -Miscellanous=Разнообразный +Miscellaneous=Разнообразный ContractsSetup=Контракты модуль установки ContractsNumberingModules=Контракты нумерации модулей AdherentLoginRequired=Управление Логин для каждого члена diff --git a/htdocs/langs/ru_RU/install.lang b/htdocs/langs/ru_RU/install.lang index c1697be23ba..82b04b7c62a 100644 --- a/htdocs/langs/ru_RU/install.lang +++ b/htdocs/langs/ru_RU/install.lang @@ -10,7 +10,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=Мы постарались сделать Dolibarr настройки настолько прост, насколько это возможно. Просто следуйте инструкциям, шаг за шагом. -MiscellanousChecks=Условия проверки +MiscellaneousChecks=Условия проверки DolibarrWelcome=Добро пожаловать на Dolibarr ConfFileExists=Файл конфигурации %s существует. ConfFileDoesNotExists=Файл конфигурации %s не существует! @@ -197,7 +197,7 @@ MigrationUpdateFailed=Сбой процесса обновления // Reference language: en_US CHARSET=UTF-8 InstallEasy=Bare følg instruksjonene trinn for trinn. -MiscellanousChecks=Forutsetninger sjekk +MiscellaneousChecks=Forutsetninger sjekk DolibarrWelcome=Velkommen til Dolibarr ConfFileExists=Konfigurasjonsfil %s eksisterer. ConfFileDoesNotExists=Konfigurasjonsfil %s finnes ikke! diff --git a/htdocs/langs/ru_RU/other.lang b/htdocs/langs/ru_RU/other.lang index b68df84422a..e72505488e3 100644 --- a/htdocs/langs/ru_RU/other.lang +++ b/htdocs/langs/ru_RU/other.lang @@ -23,7 +23,7 @@ TotalSizeOfAttachedFiles=Общий размер присоединенных ф MaxSize=Максимальный размер AttachANewFile=Присоединить новый файл / документ LinkedObject=Связанные объект -Miscellanous=Разное +Miscellaneous=Разное NbOfActiveNotifications=Количество уведомлений ChooseYourDemoProfil=Выберите демо-профиль, которые соответствуют Вашей деятельности ... DemoFundation=Управление членов Фонда diff --git a/htdocs/langs/ru_UA/install.lang b/htdocs/langs/ru_UA/install.lang index 45d05d6eb5a..fd4081e26fe 100644 --- a/htdocs/langs/ru_UA/install.lang +++ b/htdocs/langs/ru_UA/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US -> ru_UA CHARSET=UTF-8 InstallEasy=Просто следуйте инструкциям шаг за шагом. -MiscellanousChecks=Проверка предварительных условий +MiscellaneousChecks=Проверка предварительных условий DolibarrWelcome=Добро пожаловать в Dolibarr ConfFileExists=%s конфигурационный файл существует. ConfFileDoesNotExists=%s конфигурационного файла не существует! diff --git a/htdocs/langs/sl_SI/admin.lang b/htdocs/langs/sl_SI/admin.lang index 6c83d1d141e..c59beab6ab0 100644 --- a/htdocs/langs/sl_SI/admin.lang +++ b/htdocs/langs/sl_SI/admin.lang @@ -793,7 +793,7 @@ GeneratedPasswordDesc = Tukaj določite, katero pravilo želite uporabiti za gen DictionnaryDesc = Tukaj definirate vse referenčne podatke. Vnaprej določene vrednosti lahko dopolnite z vašimi. ConstDesc = Ta stran omogoča urejanje vseh ostalih parametrov, ki niso na voljo na prejšnjih straneh. To so rezervirani parametri za napredne razvijalce ali za odpravljanje težav. OnceSetupFinishedCreateUsers = Pozor, vi ste Dolibarr administrator. Administrator lahko nastavlja Dolibarr. Za navadno uporabo aplikacije Dolibarr, se priporočajo nastavitve navadnega uporabnika, ki nima administratorskih pravic in ga kreirate preko menija 'Uporabniki & Skupine'. -MiscellanousDesc = Tukaj definirate vse ostale parametre, povezane z varnostjo. +MiscellaneousDesc = Tukaj definirate vse ostale parametre, povezane z varnostjo. LimitsSetup = Nastavitve omejitev/natančnosti LimitsDesc = Tukaj lahko definirate omejitve, natančnost in optimizacije, ki jih uporablja Dolibarr MAIN_MAX_DECIMALS_UNIT = Največje število decimalk za ceno enote @@ -1288,7 +1288,7 @@ ExtraFieldHasWrongValue=Pripišejo %s ima napačno vrednost. SendmailOptionMayHurtBuggedMTA=Funkcija za pošiljanje pošte z uporabo metode "PHP mail DIRECT" bo ustvarila poštno sporočilo, ki ga ni mogoče pravilno razčleniti z nekaterimi, ki so prejemali poštnih strežnikov. Posledica tega je, da so nekatere pošte ne berejo ljudje, ki jih gosti thoose bugged platforme. To je veljalo za nekaj internetnih ponudnikov (npr.: Orange v Franciji). To ni problem v Dolibarr niti v PHP, ampak na prejemanje poštni strežnik. Lahko pa dodate možnost MAIN_FIX_FOR_BUGGED_MTA 1. v setup - drugo spremeniti Dolibarr, da bi se temu izognili. Vendar pa lahko pride do težav z drugimi strežniki, ki spoštujejo strogo standardni SMTP. Druga rešitev (priporočile) je uporaba metode "SMTP socket knjižnice", ki nima slabosti. CompanyIdProfChecker=Strokovno Id edinstven MustBeUnique=Mora biti edinstven? -Miscellanous=Razno +Miscellaneous=Razno ServiceSetup=Storitve modul nastavitev ProductServiceSetup=Izdelki in storitve moduli za nastavitev ViewProductDescInThirdpartyLanguageAbility=Vizualizacija Poimenovanja izdelkov v thirdparty jeziku diff --git a/htdocs/langs/sl_SI/install.lang b/htdocs/langs/sl_SI/install.lang index ecc44497626..02a9f807fbb 100644 --- a/htdocs/langs/sl_SI/install.lang +++ b/htdocs/langs/sl_SI/install.lang @@ -1,7 +1,7 @@ # Dolibarr language file - en_US - install = CHARSET = UTF-8 InstallEasy = Sledite navodilom korak za korakom. -MiscellanousChecks = Kontrola pogojev +MiscellaneousChecks = Kontrola pogojev DolibarrWelcome = Dobrodošli v Dolibarr ConfFileExists = Konfiguracijska datoteka %s že obstaja. ConfFileDoesNotExists = Konfiguracijska datoteka %s ne obstaja ! diff --git a/htdocs/langs/sl_SI/other.lang b/htdocs/langs/sl_SI/other.lang index a9af5499b8d..eeaaa04bbc3 100644 --- a/htdocs/langs/sl_SI/other.lang +++ b/htdocs/langs/sl_SI/other.lang @@ -59,7 +59,7 @@ TotalSizeOfAttachedFiles = Skupna velikost pripetih datotek/dokumentov MaxSize = Največja velikost AttachANewFile = Pripni novo datoteko/dokument LinkedObject = Povezani objekti -Miscellanous = Razno +Miscellaneous = Razno NbOfActiveNotifications = Število sporočil WarningInstallDirExists = Pozor, instalacijska mapa (htdocs/install) še vedno obstaja. To je velika varnostna luknja. Odstranite jo, takoj ko je mogoče. WarningUntilDirRemoved = Vsa varnostna opozorila (ki jih vidi samo uporabnik admin) bodo ostala aktivna, dokler je prisotna ranljivost(oz. je konstanta MAIN_REMOVE_INSTALL_WARNING dodana v Nastavitev->Ostale nastavitve). diff --git a/htdocs/langs/sv_SE/admin.lang b/htdocs/langs/sv_SE/admin.lang index e7036e47db4..325debe46c5 100644 --- a/htdocs/langs/sv_SE/admin.lang +++ b/htdocs/langs/sv_SE/admin.lang @@ -740,7 +740,7 @@ GeneratedPasswordDesc=Ange här vilken regel du vill använda för att generera DictionnaryDesc=Ange här alla hänvisningar data seten. Du kan fylla i fördefinierade värde med din. ConstDesc=Denna sida kan du redigera alla andra parametrar som inte fanns i tidigare sidor. De är reserverade parametrar för avancerade utvecklare eller troubleshouting. OnceSetupFinishedCreateUsers=Varning, du är en Dolibarr administratör. Administratör användare används för att ställa in Dolibarr. För en vanlig användning av Dolibarr, rekommenderas att använda en icke administratör skapas från Användare & Grupper menyn. -MiscellanousDesc=Ange här alla andra parametrar som rör säkerhet. +MiscellaneousDesc=Ange här alla andra parametrar som rör säkerhet. LimitsSetup=Gränser / Precision setup LimitsDesc=Du kan definiera gränser, preciseringar och optimeringar som används av Dolibarr här MAIN_MAX_DECIMALS_UNIT=Max decimaler för priserna per enhet @@ -1254,7 +1254,7 @@ SendmailOptionNotComplete=Varning, på vissa Linux-system, för att skicka e-pos SendmailOptionMayHurtBuggedMTA=Funktion för att skicka e-post med hjälp av metoden "PHP mail direkt" kommer att generera ett e-postmeddelande som kanske inte korrekt tolkas av vissa som får e-postservrar. Resultatet är att vissa post inte kan läsas av människor som tillhandahålls av thoose avlyssnat plattformar. Det är fallet för vissa Internetleverantörer (Ex: Orange i Frankrike). Detta är inte ett problem till Dolibarr heller i PHP, men på inkommande e-post server. Du kan dock lägga möjlighet MAIN_FIX_FOR_BUGGED_MTA till 1 i Setup - andra att ändra Dolibarr att undvika detta. Du kan dock uppleva problem med andra servrar som strikt respektera SMTP standard. Den andra lösningen (Rekomenderad) är att använda metoden "SMTP socket bibliotek" som inte har några nackdelar. CompanyIdProfChecker=Professionell Id unik MustBeUnique=Måste vara unikt? -Miscellanous=Övrigt +Miscellaneous=Övrigt ClickToDialUrlDesc=Url anropas när ett klick på telefon picto görs. I URL kan du använda taggar
__PHONETO__ Som kommer att ersättas med telefonnumret för personen att ringa
__PHONEFROM__ Som ska ersättas med telefonnummer att ringa person (er)
__LOGIN__ Som ska ersättas med clicktodial inloggning (definierad på ditt användarnamn kort)
__PASS__ Som ska ersättas med ditt clicktodial lösenord (definierad på ditt användarnamn kort). ContractsSetup=Kontrakt modul konfiguration ContractsNumberingModules=Kontrakt numrering moduler diff --git a/htdocs/langs/sv_SE/install.lang b/htdocs/langs/sv_SE/install.lang index 27b3611032b..66ae3f7e504 100644 --- a/htdocs/langs/sv_SE/install.lang +++ b/htdocs/langs/sv_SE/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=Följ bara instruktionerna steg för steg. -MiscellanousChecks=Förutsättningarna läs +MiscellaneousChecks=Förutsättningarna läs DolibarrWelcome=Välkommen till Dolibarr ConfFileExists=Konfigurationsfilen %s finns. ConfFileDoesNotExists=Konfigurationsfilen %s finns inte! diff --git a/htdocs/langs/sv_SE/other.lang b/htdocs/langs/sv_SE/other.lang index 191f95768a5..6871665e7b0 100644 --- a/htdocs/langs/sv_SE/other.lang +++ b/htdocs/langs/sv_SE/other.lang @@ -28,7 +28,7 @@ TotalSizeOfAttachedFiles=Total storlek på bifogade filer / dokument MaxSize=Maximal storlek AttachANewFile=Bifoga en ny fil / dokument LinkedObject=Länkat objekt -Miscellanous=Diverse +Miscellaneous=Diverse NbOfActiveNotifications=Antal anmälningar PredefinedMailTest=Detta är en test post. \ NDet två linjerna är åtskilda av en vagnretur. PredefinedMailTestHtml=Detta är en test post (ordet Provningen skall i fetstil).
De två linjerna är åtskilda av en vagnretur. diff --git a/htdocs/langs/tr_TR/admin.lang b/htdocs/langs/tr_TR/admin.lang index e0be1ed27fe..75bc24ba808 100755 --- a/htdocs/langs/tr_TR/admin.lang +++ b/htdocs/langs/tr_TR/admin.lang @@ -883,7 +883,7 @@ GeneratedPasswordDesc=Eğer otomatik olarak yeni bir parola oluşturmak istersen DictionnaryDesc= Burada bütün referans verilerini tanımlayın. Önceden tanımlanmış bilgilere sizinkileri de ekleyebilirsiniz. ConstDesc=Bu sayfa, önceki sayfalarda mevcut olmayan diğer tüm parametreleri düzenleme olanağı sağlar. İleri geliştiriciler veya sorunbulma için ayrılmış parametrelerdir. OnceSetupFinishedCreateUsers=Uyarı, siz bir Dolibarr yönetici kullanıcısınız. Yönetici kullanıcılar Dolibarr kurulumu yapabilir. Dolibarr’ın olağan kullanımı için, Kullanıcılar ve Gruplar menüsünden oluşturulan yönetici kullanıcı olmayan bir kullanıcının kullanılması önerilir. -MiscellanousDesc=Burada güvenlik ile ilgili diğer tüm parametreleri tanımlayın. +MiscellaneousDesc=Burada güvenlik ile ilgili diğer tüm parametreleri tanımlayın. LimitsSetup=Sınırlar/Hassasiyet ayarı LimitsDesc=Burada Dolibarr’ın kullanımı için sınırlar, hassasiyet ve optimizasyon tanımlayabilirsiniz MAIN_MAX_DECIMALS_UNIT=Birim fiyatlar ençok ondalık @@ -974,7 +974,7 @@ WatermarkOnDraft=Taslak belge üzerinde filigran CompanyIdProfChecker=Benzersiz uzman Kimliği MustBeUnique=Eşsiz olmalıdır? MustBeMandatory=Zorunlu olmalı mı ? -Miscellanous=Çeşitli +Miscellaneous=Çeşitli ##### Webcal setup ##### WebCalSetup=WebTakvim bağlantısı kurulumu WebCalSyncro=WebTakvimi için Dolibarr etkinlikleri diff --git a/htdocs/langs/tr_TR/install.lang b/htdocs/langs/tr_TR/install.lang index c4ea75fcb4b..18510fddb30 100755 --- a/htdocs/langs/tr_TR/install.lang +++ b/htdocs/langs/tr_TR/install.lang @@ -9,7 +9,7 @@ CHARSET=UTF-8 InstallEasy=Sadece adım adım talimatları izleyin. -MiscellanousChecks=Önkoşulların onayı +MiscellaneousChecks=Önkoşulların onayı DolibarrWelcome=Dolibarr'a hoşgeldiniz ConfFileExists=Yapılandırma dosyası %s var. ConfFileDoesNotExists=Yapılandırma dosyası %s yok diff --git a/htdocs/langs/tr_TR/other.lang b/htdocs/langs/tr_TR/other.lang index 9f0ffa6f878..6f30088f662 100755 --- a/htdocs/langs/tr_TR/other.lang +++ b/htdocs/langs/tr_TR/other.lang @@ -52,7 +52,7 @@ TotalSizeOfAttachedFiles=Eklenen dosyaların/belgelerin toplam boyutu MaxSize=Ençok boyut AttachANewFile=Yeni bir dosya/belge ekle LinkedObject=Bağlantılı nesne -Miscellanous=Çeşitli +Miscellaneous=Çeşitli NbOfActiveNotifications=Number of notifications PredefinedMailTest=Bu bir deneme postasıdır.\nİki satır enter tuşu ile ayrılmıştır. PredefinedMailTestHtml=Bu bir deneme postası (deneme sözcüğü koyu olmalı).
İki satır enter tuşu ile ayrılmıştır. diff --git a/htdocs/langs/zh_CN/admin.lang b/htdocs/langs/zh_CN/admin.lang index 937e3dae058..8c43783bd7b 100644 --- a/htdocs/langs/zh_CN/admin.lang +++ b/htdocs/langs/zh_CN/admin.lang @@ -731,7 +731,7 @@ GeneratedPasswordDesc=这里定义的规定,你要用来生成新的密码, DictionnaryDesc=这里所有的参考定义景致。您可以完成预定义与你的价值。 ConstDesc=此页面允许你编辑所有没有先前网页提供的其他参数。他们是保留给高级开发人员或troubleshouting参数。 OnceSetupFinishedCreateUsers=警告,你是一个Dolibarr管理员用户。管理员用户用于安装Dolibarr。对于通常使用的Dolibarr,建议使用非管理员用户从菜单中创建用户和组。 -MiscellanousDesc=定义在这里与安全有关的所有其他参数。 +MiscellaneousDesc=定义在这里与安全有关的所有其他参数。 LimitsSetup=极限/精密安装 LimitsDesc=您可以定义范围,精度和Dolibarr这里使用的最佳化 MAIN_MAX_DECIMALS_UNIT=单位价格最高为小数 @@ -1250,7 +1250,7 @@ SendmailOptionNotComplete=警告,在某些Linux系统,从您的电子邮件 SendmailOptionMayHurtBuggedMTA=功能使用方法“PHP的mail直接”发送电子邮件,将生成一个邮件,可能会不正确地解析一些接收邮件服务器。结果是不能由thoose窃听平台的托管人阅读一些邮件。这是一些互联网服务提供商(例如:在法国Orange)的情况下。这不是一个将Dolibarr也不到PHP中,但到接收邮件服务器的问题。但是,您可以选项MAIN_FIX_FOR_BUGGED_MTA添加1,进入设置 - 其他,修改Dolibarr避免这种情况。然而,你可能会遇到与其他服务器的问题,严格遵守SMTP标准。其他的解决办法(建议报告)是使用的方法“SMTP套接字库”,有没有坏处。 CompanyIdProfChecker=专业ID的唯一 MustBeUnique=必须是唯一的吗? -Miscellanous=杂项 +Miscellaneous=杂项 ContractsSetup=合同模块的设置 ContractsNumberingModules=合同编号模块 AdherentLoginRequired=管理每个成员登录 diff --git a/htdocs/langs/zh_CN/install.lang b/htdocs/langs/zh_CN/install.lang index 9685a7b9f4b..2455b15eab3 100644 --- a/htdocs/langs/zh_CN/install.lang +++ b/htdocs/langs/zh_CN/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=只需按照分步说明。 -MiscellanousChecks=先决条件检查 +MiscellaneousChecks=先决条件检查 DolibarrWelcome=欢迎Dolibarr ConfFileExists=配置文件%s存在。 ConfFileDoesNotExists=配置文件%s不存在! diff --git a/htdocs/langs/zh_CN/other.lang b/htdocs/langs/zh_CN/other.lang index afac5cf36a8..f26ca065c39 100644 --- a/htdocs/langs/zh_CN/other.lang +++ b/htdocs/langs/zh_CN/other.lang @@ -44,7 +44,7 @@ TotalSizeOfAttachedFiles=所附文件的总大小/文件 MaxSize=最大尺寸 AttachANewFile=附加一个新的文件/文件 LinkedObject=链接对象 -Miscellanous=杂项 +Miscellaneous=杂项 NbOfActiveNotifications=号码的通知 WarningInstallDirExists=警告,安装目录(htdocs中/安装 )依然存在。这是一个严重的安全漏洞。您应该删除它尽快。 WarningUntilDirRemoved=所有安全警告(可见由管理员用户只)将保持活跃,只要是存在的脆弱性(或常数MAIN_REMOVE_INSTALL_WARNING是在安装程序->其他设置添加)。 diff --git a/htdocs/langs/zh_TW/admin.lang b/htdocs/langs/zh_TW/admin.lang index edf18ba2584..82aabb992d5 100644 --- a/htdocs/langs/zh_TW/admin.lang +++ b/htdocs/langs/zh_TW/admin.lang @@ -739,7 +739,7 @@ GeneratedPasswordDesc=這裡定義的規定,你要用來生成新的密碼, DictionnaryDesc=您可以在這裡新定義或修改表單中會用到選項清單,如營業稅率、語系等等。 ConstDesc=此頁面允許你編輯所有沒有先前網頁提供的其他參數。他們是保留給高級開發人員或troubleshouting參數。 OnceSetupFinishedCreateUsers=警告,你是一個Dolibarr管理員用戶。管理員用戶用於安裝Dolibarr。對於通常使用的Dolibarr,建議使用非管理員用戶從菜單中創建用戶和組。 -MiscellanousDesc=定義在這裡與安全有關的所有其他參數。 +MiscellaneousDesc=定義在這裡與安全有關的所有其他參數。 LimitsSetup=限制及精準度 LimitsDesc=您可以定義範圍,精度和Dolibarr這裡使用的最佳化 MAIN_MAX_DECIMALS_UNIT=單位價格最高為小數 @@ -1262,7 +1262,7 @@ SendmailOptionNotComplete=警告,在某些Linux系統,從您的電子郵件 SendmailOptionMayHurtBuggedMTA=功能使用方法“PHP的mail直接”發送電子郵件,將生成一個郵件,可能會不正確地解析一些接收郵件服務器。結果是不能由thoose竊聽平台的託管人閲讀一些郵件。這是一些互聯網服務提供商(例如:在法國Orange)的情況下。這不是一個將Dolibarr也不到PHP中,但到接收郵件服務器的問題。但是,您可以選項MAIN_FIX_FOR_BUGGED_MTA添加1,進入設置 - 其他,修改Dolibarr避免這種情況。然而,你可能會遇到與其他服務器的問題,嚴格遵守SMTP標準。其他的解決辦法(建議報告)是使用的方法“SMTP套接字庫”,有沒有壞處。 CompanyIdProfChecker=專業術語欄位ID是否獨一無二 MustBeUnique=必須是獨一無二的ID嗎? -Miscellanous=雜項設定 +Miscellaneous=雜項設定 ContractsSetup=合同模組的設置 ContractsNumberingModules=合同編號模組 AdherentLoginRequired=管理每個成員登錄 diff --git a/htdocs/langs/zh_TW/install.lang b/htdocs/langs/zh_TW/install.lang index 192528ec126..9753c6f171c 100644 --- a/htdocs/langs/zh_TW/install.lang +++ b/htdocs/langs/zh_TW/install.lang @@ -9,7 +9,7 @@ // Reference language: en_US CHARSET=UTF-8 InstallEasy=只需按照分步說明。 -MiscellanousChecks=先決條件檢查 +MiscellaneousChecks=先決條件檢查 DolibarrWelcome=歡迎Dolibarr ConfFileExists=配置文件%s存在。 ConfFileDoesNotExists=配置文件%s不存在! diff --git a/htdocs/langs/zh_TW/other.lang b/htdocs/langs/zh_TW/other.lang index e395882fec6..2c62efd1c04 100644 --- a/htdocs/langs/zh_TW/other.lang +++ b/htdocs/langs/zh_TW/other.lang @@ -44,7 +44,7 @@ TotalSizeOfAttachedFiles=附件大小總計 MaxSize=檔案最大 AttachANewFile=附加一個新的檔案/文件 LinkedObject=鏈接對象 -Miscellanous=雜項 +Miscellaneous=雜項 NbOfActiveNotifications=號碼的通知 WarningInstallDirExists=警告,安裝目錄(htdocs中/安裝 )依然存在。這是一個嚴重的安全漏洞。您應該刪除它盡快。 WarningUntilDirRemoved=所有安全警告(可見由管理員用戶只)將保持活躍,只要是存在的脆弱性(或常數MAIN_REMOVE_INSTALL_WARNING是在安裝程序->其他設置添加)。 From 59eb21431a15873c471d0d30884503d39d03245b Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sun, 24 Mar 2013 07:14:59 +0100 Subject: [PATCH 112/150] display enhancement and standardize --- htdocs/externalsite/admin/externalsite.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/externalsite/admin/externalsite.php b/htdocs/externalsite/admin/externalsite.php index 2c241fbf3c7..ba63a5389e4 100644 --- a/htdocs/externalsite/admin/externalsite.php +++ b/htdocs/externalsite/admin/externalsite.php @@ -77,6 +77,17 @@ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("ExternalSiteSetup"),$linkback,'setup'); +print '
'; + +$h = 0; + +$head[$h][0] = DOL_URL_ROOT."/admin/externalsite.php"; +$head[$h][1] = $langs->trans("Miscellaneous"); +$head[$h][2] = 'externalsite'; +$hselected=$h; +$h++; + +dol_fiche_head($head, $hselected, $langs->trans("Module100Name")); print $langs->trans("Module100Desc")."
\n"; print '
'; From 51bc985a7632e5f590aa6e795a438a95f08ed10e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 12:34:10 +0100 Subject: [PATCH 113/150] Add missing icon --- htdocs/theme/amarok/img/object_invoice.png | Bin 0 -> 3256 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 htdocs/theme/amarok/img/object_invoice.png diff --git a/htdocs/theme/amarok/img/object_invoice.png b/htdocs/theme/amarok/img/object_invoice.png new file mode 100755 index 0000000000000000000000000000000000000000..a9095ae91da010b3cbc91e813f46fa300cda39ee GIT binary patch literal 3256 zcmV;p3`g^cP)4Tx07!}LnP*T_X%~Rcy*E7}p@bTU0fKZ0MQMU`kRmQk0*HhV5TwKa3W_LV z0c;4C1slk&1y->Giqb3yE{h_H9kDI8wHHMBE-=o{eDm$E{rTn0oO_;m?|sXCe?2n? zfU{pDm8PHokeZe$3-)p6MF=B#6_${d# zfP*IhR{i%_oEAVmzMdxa?=k*909FLR$>o2Kz3U&pPehH9kzivzK7`Qg0f<{iN8il` zAR7aGyD>WYwSIK;+g^N+TL3K|#aXh26Y~jU4j9!&)eTEl>fw;TJdnhu|pGLld;Z1?Ykv=!07@0FU7ryoL|( z6+sX(!a$S}4TOsrAf|{FVvo2WUWh*uj0llfBmqf9vXES)04YXFk#eL8*^eAX8ju#G z1L;BfkpW}~d4mk2C`w1!s5WYVTA+5QE9!@apwVaoDn)b90(3pP4Xr|J(GzGh+KFC6 z@1xJq_vk1_!&EUIW{TNi?pPou#3Yy$%f$+@%~&P&8`g-O$F5@cu;C*%@}2|p9|5{?tv2v-RA39kqvL^@H6XhgIl`Vhm35@IHCC9#ZHO*}?y zC-xE_65o+95}U*)O(A)a!bypwY*G=af>cX7L+U0CklvCpvMSk->_846$B?Du0`gY! ze)4H@H~9hiJ%vKyP%J6#lyFKiC67`{*-JS^>83oSe4;X_y40yue`+i>i&{*rq@JL5 zQ3t3WX$+bk&4Cs~lhAT$rL+UI7TOKkD>{*`L${^-)5Y{9^fG!ay`6rW{*J+5@EOjG za7G$q4Wo*2iqXq>sX$WTDL5*GDx@hCD(q2cQn;b;hRI+WGToVTnAyxSW*xJW`GkeC zxGYCjI7`Obz^Y|+upTKQid;n}#R$cPie-vN6uT8)DAAORl)RPVl?s%qlvmgYx;XE&IoclDDcYO0&uBl< zVd~iF#Of659MieWC2H&KkWo)-w(>USr&7{K90CNwCQ(lLnLL zrd-ot)77S@OkbJlnT4Abn>CxgH#atqF)uUkF#l#@W07RB%i@|P-O|l+k>w%FM*@x@ zSWqNr6@0c5SS4ERwz^@>vi7xJZrx!0#>T`(Y_r3r&z5EDYrDd>$@b$E!Ib1FzfQS7 zRcmV4)RL)Pb|gD@yF9x_yASqO_Nn$Y_D>x29bz4JI^1$pcMNqbb^OCg!O7pL$m!xV z(lpO$1=HG`5ocHDWzNmc-(6f>@?6fke4jpj`m*UQuHfqCy2ACG8_~_jtuy#GoTVUuSvE z+BoaxPyCU#xABP=GI)Zxp{MY zV)bG(V=sy{MJb}@IORA=T%(vFjujt|r^H9cACV9xk&?OuLV_@%E|HKJnRs{}XOXvrV&$vY+O7T#h3lQ*=}>y7W$T~EdyKqww~C=+qQPw zr=R0~?k;yM-&>(vkyr72`|R!Kc3AD$y_2ysXXn#hVY}LQTkWo_WK}M$d{Gru)wRcQ zPffK}b#e9ZFUh~${x#s&ro9$>ckff&w_@M>{gVCt2mB5+)mYZ-sa35lto{01`fm>p zh9B%YH2u)AI-|Oshm{VmIXrS?!I7s&=N#=lHse_H@u|lTp5UL@ep2~lQ9V+hQ~#zR zso_CmWaHIS{-@5Jb~#<&BxtHR!#}g@tmfIWW@d9y3!!CM%W&($);DdbZA0w|?Stp$ zp1X5ic>el@kPBBX&b)ZJ!>{AgC7(+dI=wp2b$N8PU3S0R`n%ijt=;b3ZGU+D(ca_P zbK#25m5!@^S1VExz%fR^u0S|fyBL@c`CO>@pXz^q8@!BUUPj);tcv|# zb)Pw(YrZ&qxil;s{_|`02xX-FoAI|(-~GSe8BLSBfZPS-E+BUSxeLf$K<)x^7m&Mv z+y&$=Aa?<|3&>qS?gIb6E+7@jMB^%e;fW?B0KDA?pdbWL=>ec)|MvYvA7!FrG0_tm zC-^6x=(UW80HC@BAaprE0A9=SIvG!vE5Ix~LtO#2vH6h`eVOr~hvcM*14S8`650Q1 zFa5hnP09MP&sd9$AxR4h!7Ce2qXe0E@DGL%$bmH6ngT%t8ITDQkWKW6#v;HRpU(Al zvlg^ErR)Cp9+{Ht@jLTKm*&Wl66a;|+@#VJi5YK3n%KgOXDzT2z<&S^sy4pLf#qZX z00J0EL_t(Ijg68!PgGG9g};5dIy^#4U{DkcQ9uoi1Z$kspAG2?cgi z7%hyIEro?4{s9GfI0KlOAuynZ#EHNK=AN^+1#?Hppz%~YJL|0Tt(7BY2Eg6%@f)E? z8~-?NZ*S_w$jH~jyD%BlTl(39`xCKxoGMNgZw3ecWEQi$p89a_&e)i|8XjIw?ghzU z>O@UZ=TPT}%VqX=_lR~QcA_1kDB|U#hZC4xyEQu6U1Q+PM1W7344<=E*1!K?wYWx| z1c(TwQi(T{lU(oZeLg+6aI+?Yi{l^=;Ywd0YKEENRM~e999$h7#LQ@FY+`a|=4Xw8 z_g+MV+qo2G;Jio8a6UxUaO&}DyuEm!tu=5?0G>1#>27O1=+0naWsUP49e5SKWq zs@kIwRD-0DrHu{LdsK~vREkVt1+N}}IuV>|P-_s!L1KF$oyGt&W4=(}Qs-F=m|0#X z4C-)kTx$?lIsnM7uU82gQ}xW{3sr(J5aQ!HuyVQT+SA?+W*9J=&vUt}69cA~mIy?S zX#Ws67bFCkVzElll&WVom#-2?MSFY%pr<{JRbE$MKA)%mTo(p>TwElOzeI?(w?lx0 z0y6^O@vl?pbh+{mPV@ed79bRn2B5ihXegB|MFd2^jCcJfj}VCn-!?Z>BGLkEg+K$) qvbnliIx#Ttl>a$fTP2_caK8Z)uQp=4>Df;J0000 Date: Sun, 24 Mar 2013 14:01:03 +0100 Subject: [PATCH 114/150] Fix: Missing lang --- htdocs/exports/export.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 687bec342c0..fcd968eeeb0 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/export/modules_export.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("exports"); +$langs->load("users"); // Everybody should be able to go on this page //if (! $user->admin) From ff2407a454cb9d855ea5c8c3a1f9bb186aa9f32f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 14:01:33 +0100 Subject: [PATCH 115/150] Add hidden option to setup font size of information. --- htdocs/core/lib/pdf.lib.php | 13 ++++++++----- .../core/modules/facture/doc/pdf_crabe.modules.php | 10 ++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 87ec1643ef2..676f89b3547 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -451,11 +451,14 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default { global $mysoc, $conf; + $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); + $pdf->SetXY($curx, $cury); if (empty($onlynumber)) { - $pdf->SetFont('','B',$default_font_size - 3); + $pdf->SetFont('','B',$default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); $cury+=4; } @@ -472,7 +475,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default if (empty($onlynumber)) { - $pdf->SetFont('','',$default_font_size - 4); + $pdf->SetFont('','',$default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); $cury+=3; @@ -544,12 +547,12 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default } else { - $pdf->SetFont('','B',6); + $pdf->SetFont('','B',$default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': ' . $outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); $cury+=3; - $pdf->SetFont('','B',6); + $pdf->SetFont('','B',$default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); $cury+=3; @@ -561,7 +564,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; - $pdf->SetFont('','',6); + $pdf->SetFont('','',$default_font_size - $diffsizecontent); if (empty($onlynumber) && ! empty($account->domiciliation)) { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 15ee4e29aba..fb164f04876 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -731,20 +731,22 @@ class pdf_crabe extends ModelePDFFactures // Si mode reglement non force ou si force a CHQ if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { + $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); + if ($conf->global->FACTURE_CHQ_NUMBER > 0) { $account = new Account($this->db); $account->fetch($conf->global->FACTURE_CHQ_NUMBER); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - 3); + $pdf->SetFont('','B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio),0,'L',0); $posy=$pdf->GetY()+1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','', $default_font_size - 3); + $pdf->SetFont('','', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); $posy=$pdf->GetY()+2; } @@ -752,14 +754,14 @@ class pdf_crabe extends ModelePDFFactures if ($conf->global->FACTURE_CHQ_NUMBER == -1) { $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','B', $default_font_size - 3); + $pdf->SetFont('','B', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$this->emetteur->name),0,'L',0); $posy=$pdf->GetY()+1; if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) { $pdf->SetXY($this->marge_gauche, $posy); - $pdf->SetFont('','', $default_font_size - 3); + $pdf->SetFont('','', $default_font_size - $diffsizetitle); $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); $posy=$pdf->GetY()+2; } From d4d3b9900d0d77e0f45b528bbb089f874baf4b1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 14:11:10 +0100 Subject: [PATCH 116/150] Fix: creation of user --- htdocs/user/class/user.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 37ff6735df5..bd7095f4d03 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1133,8 +1133,8 @@ class User extends CommonObject $sql.= ", address = '".$this->db->escape($this->address)."'"; $sql.= ", zip = '".$this->db->escape($this->zip)."'"; $sql.= ", town = '".$this->db->escape($this->town)."'"; - $sql.= ", fk_state = '".$this->db->escape($this->state_id)."'"; - $sql.= ", fk_country = '".$this->db->escape($this->country_id)."'"; + $sql.= ", fk_state = ".($this->state_id > 0?"'".$this->db->escape($this->state_id)."'":"null"); + $sql.= ", fk_country = ".($this->country_id > 0?"'".$this->db->escape($this->country_id)."'":"null"); $sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; From 3ef8bf55fa0620a0e93d15f0f8f9c9724ad0f100 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 16:17:36 +0100 Subject: [PATCH 117/150] Fix: Better line position of information --- htdocs/core/lib/pdf.lib.php | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 676f89b3547..65816d52309 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -291,7 +291,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($usecontact) { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1)); - + if (!empty($targetcontact->address)) { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; }else { @@ -303,9 +303,9 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target } else if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n"; - } - - + } + + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { // Tel @@ -453,7 +453,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); - + $pdf->SetXY($curx, $cury); if (empty($onlynumber)) @@ -556,6 +556,8 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default $pdf->SetXY($curx, $cury); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); $cury+=3; + + if ($diffsizecontent <= 2) $cury+=1; } // Use correct name of bank id according to country @@ -571,16 +573,25 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default $pdf->SetXY($curx, $cury); $val=$outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation); $pdf->MultiCell(100, 3, $val, 0, 'L', 0); - $nboflines=dol_nboflines_bis($val,120); - //print $nboflines;exit; - $cury+=($nboflines*2)+2; + //$nboflines=dol_nboflines_bis($val,120); + //$cury+=($nboflines*3)+2; + $tmpy=$pdf->getStringHeight (100, $val); + $cury+=$tmpy; } else if (! $usedetailedbban) $cury+=1; - $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $outputlangs->convToOutputCharset($account->iban), 0, 'L', 0); - $pdf->SetXY($curx, $cury+3); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); + if (! empty($account->iban)) + { + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $outputlangs->convToOutputCharset($account->iban), 0, 'L', 0); + $cury+=3; + } + + if (! empty($account->bic)) + { + $pdf->SetXY($curx, $cury); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': ' . $outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); + } return $pdf->getY(); } From b3d4811b6fa0e8b5a81d95737c5cba2c7630eb80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Mar 2013 19:00:58 +0100 Subject: [PATCH 118/150] New: Another method to allow style tags into email. Preivous one was using encoding, but this create data to not be stored correctly into database. Old method is still available by adding '_encoded' at end of toolbar name. --- htdocs/comm/mailing/fiche.php | 29 ++++--- htdocs/core/class/doleditor.class.php | 12 +-- htdocs/main.inc.php | 10 +-- htdocs/theme/eldy/ckeditor/config.js | 7 ++ htdocs/user/fiche.php | 118 +++++++++++++------------- 5 files changed, 98 insertions(+), 78 deletions(-) diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index b0f32a3e69d..0147ec57dff 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -23,6 +23,8 @@ * \brief Fiche mailing, onglet general */ +if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -768,7 +770,7 @@ else $linkback = ''.$langs->trans("BackToList").''; - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print ''; print $form->showrefnav($object,'id', $linkback); print ''; @@ -789,10 +791,10 @@ else print ''; // Status - print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; // Nb of distinct emails - print ''; + print ''; print $langs->trans("TotalNbOfDistinctRecipients"); print ''; $nbemail = ($object->nbemail?$object->nbemail:img_warning('').' '.$langs->trans("NoTargetYet").''); @@ -979,7 +981,7 @@ else print ''; // Subject - print ''; + print ''; // Joined files print ''; print ''; print ''; @@ -1040,7 +1049,7 @@ else print ''; - print '
'.$langs->trans("MailTopic").''.$object->sujet.'
'.$langs->trans("MailTopic").''.$object->sujet.'
'.$langs->trans("MailFile").''; @@ -1007,7 +1009,14 @@ else // Message print '
'.$langs->trans("MailMessage").''; - print dol_htmlentitiesbr($object->body); + if (empty($object->bgcolor) || strtolower($object->bgcolor) == 'ffffff') + { + // Editeur wysiwyg + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('body',$object->body,'',320,'dolibarr_readonly','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,70); + $doleditor->Create(); + } + else print dol_htmlentitiesbr($object->body); print '
'; print $langs->trans("TotalNbOfDistinctRecipients"); print ''; - $nbemail = ($object->nbemail?$object->nbemail:''.$langs->trans("NoTargetYet").''); + $nbemail = ($object->nbemail?$object->nbemail:img_warning('').' '.$langs->trans("NoTargetYet").''); if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) { $text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB); @@ -1142,13 +1151,13 @@ else $doleditor->Create(); print '
'; + print '
'; + + print '
'; print ''; print '   '; print ''; - print ''; - - print ''; + print '
'; print ''; print '
'; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 9256e08318c..55cc984c12f 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -51,7 +51,7 @@ class DolEditor * @param string $content Content of WYSIWIG field * @param int $width Width in pixel of edit area (auto by default) * @param int $height Height in pixel of edit area (200px by default) - * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes', 'dolibarr_details', 'dolibarr_mailings') + * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]', 'dolibarr_mailings[_encoded]', ') * @param string $toolbarlocation Where bar is stored : * 'In' each window has its own toolbar * 'Out:name' share toolbar into the div called 'name' @@ -69,6 +69,7 @@ class DolEditor if (! $rows) $rows=round($height/20); if (! $cols) $cols=($width?round($width/6):80); + $shorttoolbarname=preg_replace('/_encoded$/','',$toolbarname); // Name of extended editor to use (FCKEDITOR_EDITORNAME can be 'ckeditor' or 'fckeditor') $defaulteditor='ckeditor'; @@ -97,7 +98,7 @@ class DolEditor $this->editor->Value = $content; $this->editor->Height = $height; if (! empty($width)) $this->editor->Width = $width; - $this->editor->ToolbarSet = $toolbarname; + $this->editor->ToolbarSet = $shorttoolbarname; $this->editor->Config['AutoDetectLanguage'] = 'true'; $this->editor->Config['ToolbarLocation'] = $toolbarlocation ? $toolbarlocation : 'In'; $this->editor->Config['ToolbarStartExpanded'] = $toolbarstartexpanded; @@ -124,7 +125,7 @@ class DolEditor { $this->content = $content; $this->htmlname = $htmlname; - $this->toolbarname = $toolbarname; + $this->toolbarname = $shorttoolbarname; $this->toolbarstartexpanded = $toolbarstartexpanded; $this->rows = max(ROWS_3,$rows); $this->cols = max(40,$cols); @@ -169,9 +170,8 @@ class DolEditor //$skin='office2003'; //$skin='v2'; $skin='kama'; - - if ($this->toolbarname=='dolibarr_mailings') {$htmlencode_force='true';} - else {$htmlencode_force='false';} + + $htmlencode_force=preg_match('/_encoded$/',$this->toolbarname)?'true':'false'; $out.= ''."\n"; } // jQuery File Upload + /* if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) || (defined('REQUIRE_JQUERY_FILEUPLOAD') && constant('REQUIRE_JQUERY_FILEUPLOAD'))) { print ''."\n"; @@ -1086,6 +1087,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print ''."\n"; print ''."\n"; } + */ // jQuery DataTables if (! empty($conf->global->MAIN_USE_JQUERY_DATATABLES) || (defined('REQUIRE_JQUERY_DATATABLES') && constant('REQUIRE_JQUERY_DATATABLES'))) { From da8932f9877fbc1755704ec71415fed19a2807e5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2013 13:24:26 +0100 Subject: [PATCH 145/150] Some fix for cron module --- htdocs/cron/card.php | 27 +++++++++++++++++++++------ htdocs/cron/list.php | 31 ++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 13ccb27cb0b..6148ed5d5f7 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -82,6 +82,8 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex setEventMessage($object->error,'errors'); $action=''; }else { + if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); + else setEventMessage($langs->trans("JobFinished"),'mesgs'); $action=''; } @@ -194,10 +196,13 @@ if ($action=='inactive') { llxHeader('',$langs->trans("CronAdd")); -if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') { +if ($action=='edit' || empty($action) || $action=='delete' || $action=='execute') +{ $head=cron_prepare_head($object); dol_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'bill'); -} elseif ($action=='create') { +} +elseif ($action=='create') +{ print_fiche_titre($langs->trans("CronTask"),'','setup'); } @@ -251,8 +256,8 @@ if (empty($object->status) && $action != 'create') dol_htmloutput_mesg($langs->trans("CronTaskInactive"),'','warning',1); } -if (($action=="create") || ($action=="edit")) { - +if (($action=="create") || ($action=="edit")) +{ print '
'; print ''."\n"; if (!empty($object->id)) { @@ -565,6 +570,10 @@ if (($action=="create") || ($action=="edit")) { print ''; + + dol_fiche_end(); + + print "\n\n
\n"; if (! $user->rights->cron->create) { print ''.$langs->trans("Edit").''; @@ -585,9 +594,15 @@ if (($action=="create") || ($action=="edit")) { print ''.$langs->trans("CronStatusInactiveBtn").''; } } - if ((! $user->rights->cron->execute) || (empty($object->status))) { + if ((empty($user->rights->cron->execute))) + { print ''.$langs->trans("CronExecute").''; - } else { + } + else if (empty($object->status)) + { + print ''.$langs->trans("CronExecute").''; + } + else { print ''.$langs->trans("CronExecute").''; } print '

'; diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index db36cc5d59b..efed9579d1f 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -203,7 +203,7 @@ if (count($object->lines)>0) { print ''; if(!empty($line->label)) { - print ''.$line->label.''; + print ''.$line->label.''; } else { print $langs->trans('CronNone'); @@ -229,19 +229,19 @@ if (count($object->lines)>0) { print ''; print ''; - if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhour');} else {print $langs->trans('CronNone');} print ''; print ''; - if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhour');} else {print $langs->trans('CronNone');} print ''; print ''; - if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhour');} else {print $langs->trans('CronNone');} print ''; print ''; - if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhourtext');} else {print $langs->trans('CronNone');} + if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhour');} else {print $langs->trans('CronNone');} print ''; print ''; @@ -283,13 +283,22 @@ if (count($object->lines)>0) { print $langs->trans('CronNoJobs'); } -print "\n\n
\n"; -if (! $user->rights->cron->create) { +print "\n
\n"; + +if (! $user->rights->cron->create) +{ print ''.$langs->trans("New").''; -} else { - print ''.$langs->trans("New").''; } -print '

'; +else +{ + print ''.$langs->trans("New").''; +} + +print '
'; + +print '
'; llxFooter(); -$db->close(); \ No newline at end of file + +$db->close(); +?> \ No newline at end of file From 982b3e9d66fdde2594e4aa245aaf103881824cdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2013 13:59:45 +0100 Subject: [PATCH 146/150] Add trigger into delete line for supplier invoice --- .../fourn/class/fournisseur.facture.class.php | 70 +++++++++++++++---- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 60bdf26a8ab..840c4cecb94 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1166,24 +1166,66 @@ class FactureFournisseur extends CommonInvoice } /** - * Delete a detail line from database + * Delete a detail line from database * - * @param int $rowid Id of line to delete - * @return void + * @param int $rowid Id of line to delete + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return void */ - function deleteline($rowid) + function deleteline($rowid, $notrigger=0) { - // Supprime ligne - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det '; - $sql .= ' WHERE rowid = '.$rowid.';'; - $resql = $this->db->query($sql); - if (! $resql) + global $user, $langs, $conf; + + if (! $rowid) $rowid=$this->id; + + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); + + $error=0; + $this->db->begin(); + + if (! $error && ! $notrigger) { - dol_print_error($this->db); + // Appel des triggers + include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); + $interface=new Interfaces($this->db); + $result=$interface->run_triggers('LINEBILL_SUPPLIER_DELETE',$this,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers } - // Mise a jour prix facture - $this->update_price(); - return 1; + + if (! $error) + { + // Supprime ligne + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det '; + $sql.= ' WHERE rowid = '.$rowid; + dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); + $resql = $this->db->query($sql); + if (! $resql) + { + $error++; + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); + } + } + + if (! $error) + { + // Mise a jour prix facture + $this->update_price(); + } + + if (! $error) + { + $this->db->commit(); + return 1; + } + else + { + $this->db->rollback(); + return -1; + } } @@ -1305,7 +1347,7 @@ class FactureFournisseur extends CommonInvoice $result.=$lien.($max?dol_trunc($this->ref,$max):$this->ref).$lienfin; return $result; } - + /** * Renvoie la reference de facture suivante non utilisee en fonction du modele * de numerotation actif defini dans INVOICE_SUPPLIER_ADDON_NUMBER From 393cecb1c23c67d7e32410e77ca03730a60fe374 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2013 14:08:15 +0100 Subject: [PATCH 147/150] New: Add hook --- htdocs/fourn/facture/paiement.php | 177 ++++++++++++++++-------------- 1 file changed, 92 insertions(+), 85 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index e9358624fe2..51b9972260e 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -185,8 +185,8 @@ $form=new Form($db); if ($action == 'create' || $action == 'add_paiement') { - $facture = new FactureFournisseur($db); - $facture->fetch($facid); + $object = new FactureFournisseur($db); + $object->fetch($facid); $datefacture=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture); @@ -248,91 +248,98 @@ if ($action == 'create' || $action == 'add_paiement') } print ''; - /* - * Autres factures impayees - */ - $sql = 'SELECT f.rowid as facid, f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc, f.datef as df'; - $sql.= ', SUM(pf.amount) as am'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; - $sql.= " WHERE f.entity = ".$conf->entity; - $sql.= ' AND f.fk_soc = '.$facture->socid; - $sql.= ' AND f.paye = 0'; - $sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee - $sql.= ' GROUP BY f.rowid, f.facnumber, f.total_ht, f.total_ttc, f.datef'; - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - if ($num > 0) - { - $i = 0; - print '
'; - print $langs->trans('Invoices').'
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + $parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas); + $reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $error=$hookmanager->error; $errors=$hookmanager->errors; + if (empty($reshook)) + { + /* + * Autres factures impayees + */ + $sql = 'SELECT f.rowid as facid, f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc, f.datef as df'; + $sql.= ', SUM(pf.amount) as am'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; + $sql.= " WHERE f.entity = ".$conf->entity; + $sql.= ' AND f.fk_soc = '.$object->socid; + $sql.= ' AND f.paye = 0'; + $sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee + $sql.= ' GROUP BY f.rowid, f.facnumber, f.total_ht, f.total_ttc, f.datef'; + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + if ($num > 0) + { + $i = 0; + print '
'; - $var=True; - $total=0; - $total_ttc=0; - $totalrecu=0; - while ($i < $num) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print ''; - print ''; - print ''; - if ($objp->df > 0 ) - { - print ''; - } - else - { - print ''; - } - print ''; - print ''; - print ''; - print '\n"; - $total+=$objp->total_ht; - $total_ttc+=$objp->total_ttc; - $totalrecu+=$objp->am; - $i++; - } - if ($i > 1) - { - // Print total - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - } - print "
'.$langs->trans('Ref').''.$langs->trans('RefSupplier').''.$langs->trans('Date').''.$langs->trans('AmountTTC').''.$langs->trans('AlreadyPaid').''.$langs->trans('RemainderToPay').''.$langs->trans('Amount').'
'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref; - print ''.$objp->facnumber.''; - print dol_print_date($db->jdate($objp->df)).'!!!'.price($objp->total_ttc).''.price($objp->am).''.price($objp->total_ttc - $objp->am).''; - $namef = 'amount_'.$objp->facid; - print ''; - print "
'.$langs->trans('TotalTTC').':'.price($total_ttc).''.price($totalrecu).''.price($total_ttc - $totalrecu).' 
\n"; - } - $db->free($resql); - } - else - { - dol_print_error($db); - } + print $langs->trans('Invoices').'
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $var=True; + $total=0; + $total_ttc=0; + $totalrecu=0; + while ($i < $num) + { + $objp = $db->fetch_object($resql); + $var=!$var; + print ''; + print ''; + print ''; + if ($objp->df > 0 ) + { + print ''; + } + else + { + print ''; + } + print ''; + print ''; + print ''; + print '\n"; + $total+=$objp->total_ht; + $total_ttc+=$objp->total_ttc; + $totalrecu+=$objp->am; + $i++; + } + if ($i > 1) + { + // Print total + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + } + print "
'.$langs->trans('Ref').''.$langs->trans('RefSupplier').''.$langs->trans('Date').''.$langs->trans('AmountTTC').''.$langs->trans('AlreadyPaid').''.$langs->trans('RemainderToPay').''.$langs->trans('Amount').'
'.img_object($langs->trans('ShowBill'),'bill').' '.$objp->ref; + print ''.$objp->facnumber.''; + print dol_print_date($db->jdate($objp->df)).'!!!'.price($objp->total_ttc).''.price($objp->am).''.price($objp->total_ttc - $objp->am).''; + $namef = 'amount_'.$objp->facid; + print ''; + print "
'.$langs->trans('TotalTTC').':'.price($total_ttc).''.price($totalrecu).''.price($total_ttc - $totalrecu).' 
\n"; + } + $db->free($resql); + } + else + { + dol_print_error($db); + } + } // print ''; print '

'.$langs->trans("ClosePaidInvoicesAutomatically"); From a22d39adfb789fd54b6cfcca3779ff85705cc10d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2013 14:11:15 +0100 Subject: [PATCH 148/150] Fix: Hook is a replaceadd hook. --- htdocs/core/class/hookmanager.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 9154aaa2fdd..72b49af418e 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -131,7 +131,7 @@ class HookManager // Define type of hook ('output', 'returnvalue' or 'addreplace') $hooktype='output'; if (preg_match('/^pdf_/',$method)) $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are returnvalue hooks. When there is 2 hooks of this type, only last one win. - if ($method == 'doActions' || $method == 'formObjectOptions' || $method == 'pdf_writelinedesc') $hooktype='addreplace'; + if (in_array($method,array('doActions','formObjectOptions','pdf_writelinedesc','paymentsupplierinvoices'))) $hooktype='addreplace'; // Loop on each hook to qualify modules that declared context $modulealreadyexecuted=array(); @@ -150,7 +150,7 @@ class HookManager // test to avoid to run twice a hook, when a module implements several active contexts if (in_array($module,$modulealreadyexecuted)) continue; $modulealreadyexecuted[$module]=$module; - // Hooks that return int + // Hooks that return int (doActions, formObjectOptions, pdf_writelinedesc, paymentsupplierinvoices) if ($hooktype == 'addreplace') { $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) @@ -159,7 +159,7 @@ class HookManager $error++; $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); - // TODO remove this. Change must be inside the method if required + // TODO remove this. Change must be inside the method of hook if required if ($method == 'doActions') { if ($action=='add') $action='create'; @@ -170,7 +170,7 @@ class HookManager // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) else { - // TODO. this should be done into the method by returning nothing + // TODO. this should be done into the method of hook by returning nothing if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) From 6c1bbd3aebed5e0121c4b484dfadefb593956de0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 Mar 2013 14:24:33 +0100 Subject: [PATCH 149/150] New: Uniformize hooks. --- htdocs/fourn/facture/fiche.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index b726d39231a..b8b4c209cb3 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -749,7 +749,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P { $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain " setEventMessage($mesg); - + $error=0; // Initialisation donnees @@ -1177,7 +1177,8 @@ if ($action == 'create') if (1==2 && ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) { print ''; - print ' '.$langs->trans('Label').''; + print ' '; + print ''.$langs->trans('Label').''; print ''.$langs->trans('PriceUHT').''; print ''.$langs->trans('VAT').''; print ''.$langs->trans('Qty').''; @@ -1201,7 +1202,7 @@ if ($action == 'create') } // Other options - $parameters=array(); + $parameters=array('colspan' => ' colspan="6"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook // Bouton "Create Draft" @@ -1571,7 +1572,7 @@ else } // Other options - $parameters=array('colspan' => ' colspan="3"'); + $parameters=array('colspan' => ' colspan="4"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook print ''; @@ -1736,6 +1737,12 @@ else // Show range print_date_range($date_start,$date_end); } + + if (is_object($hookmanager)) + { + $parameters=array('fk_parent_line'=>$line->fk_parent_line, 'line'=>$object->lines[$i],'var'=>$var,'num'=>$num,'i'=>$i); + $reshook=$hookmanager->executeHooks('formViewProductSupplierOptions',$parameters,$object,$action); + } print ''; // VAT @@ -1808,7 +1815,7 @@ else if (is_object($hookmanager)) { $parameters=array(); - $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); + $reshook=$hookmanager->executeHooks('formCreateSupplierProductOptions',$parameters,$object,$action); } // Editor wysiwyg @@ -2036,7 +2043,7 @@ else * Show mail form */ if ($action == 'presend') - { + { $ref = dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/')); @@ -2092,12 +2099,12 @@ else $formmail->substit['__SIGNATURE__']=$user->signature; $formmail->substit['__PERSONALIZED__']=''; $formmail->substit['__CONTACTCIVNAME__']=''; - + //Find the good contact adress $custcontact=''; $contactarr=array(); $contactarr=$object->liste_contact(-1,'external'); - + if (is_array($contactarr) && count($contactarr)>0) { foreach($contactarr as $contact) { if ($contact['libelle']==$langs->trans('TypeContact_invoice_supplier_external_BILLING')) { @@ -2107,12 +2114,12 @@ else $custcontact=$contactstatic->getFullName($langs,1); } } - + if (!empty($custcontact)) { $formmail->substit['__CONTACTCIVNAME__']=$custcontact; } } - + // Tableau des parametres complementaires $formmail->param['action']='send'; $formmail->param['models']='invoice_supplier_send'; From 47b6829e177e6228924d858159f87bbc0569b347 Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 27 Mar 2013 14:39:41 +0100 Subject: [PATCH 150/150] Remove DOS EOF (dos2unix utility used) --- htdocs/comm/propal.php | 4540 ++++++++++++++++++++-------------------- 1 file changed, 2270 insertions(+), 2270 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index de1a87ffe7e..c3a908fcea4 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1,2250 +1,2250 @@ - - * Copyright (C) 2004-2013 Laurent Destailleur - * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel -* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/comm/propal.php - * \ingroup propale - * \brief Page of commercial proposals card and list - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (! empty($conf->projet->enabled)) -{ - require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -} - -$langs->load('companies'); -$langs->load('propal'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('orders'); -$langs->load('products'); -$langs->load("deliveries"); -if (! empty($conf->margin->enabled)) - $langs->load('margins'); - -$error=0; - -$id=GETPOST('id','int'); -$ref=GETPOST('ref','alpha'); -$socid=GETPOST('socid','int'); -$action=GETPOST('action','alpha'); -$origin=GETPOST('origin','alpha'); -$originid=GETPOST('originid','int'); -$confirm=GETPOST('confirm','alpha'); -$lineid=GETPOST('lineid','int'); - -//PDF -$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); -$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); - -// Nombre de ligne pour choix de produit/service predefinis -$NBLINES=4; - -// Security check -if (! empty($user->societe_id)) $socid=$user->societe_id; -$result = restrictedArea($user, 'propal', $id); - -$object = new Propal($db); -$extrafields = new ExtraFields($db); - -// Load object -if ($id > 0 || ! empty($ref)) -{ - $ret=$object->fetch($id, $ref); - if ($ret > 0) $ret=$object->fetch_thirdparty(); - if ($ret < 0) dol_print_error('',$object->error); -} - -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('propalcard')); - - - -/* - * Actions - */ - -$parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - -// Action clone object -if ($action == 'confirm_clone' && $confirm == 'yes') -{ - if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) - { - setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); - } - else - { - if ($object->id > 0) - { - $result=$object->createFromClone($socid); - if ($result > 0) - { - header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); - exit; - } - else - { - setEventMessage($object->error, 'errors'); - $action=''; - } - } - } -} - -// Suppression de la propale -else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) -{ - $result=$object->delete($user); - if ($result > 0) - { - header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); - exit; - } - else - { - $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); - } -} - -// Remove line -else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) -{ - $result = $object->deleteline($lineid); - // reorder lines - if ($result) $object->line_order(true); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; -} - -// Validation -else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) -{ - $result=$object->valid($user); - if ($result >= 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - } - else - { - $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); - } -} - -else if ($action == 'setdate' && $user->rights->propal->creer) -{ - $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); - - if (empty($datep)) - { - $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - } - - if (! $error) - { - $result=$object->set_date($user,$datep); - if ($result < 0) dol_print_error($db,$object->error); - } -} -else if ($action == 'setecheance' && $user->rights->propal->creer) -{ - $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); - if ($result < 0) dol_print_error($db,$object->error); -} -else if ($action == 'setdate_livraison' && $user->rights->propal->creer) -{ - $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); - if ($result < 0) dol_print_error($db,$object->error); -} - -// Positionne ref client -else if ($action == 'set_ref_client' && $user->rights->propal->creer) -{ - $object->set_ref_client($user, $_POST['ref_client']); -} - -else if ($action == 'setnote_public' && $user->rights->propal->creer) -{ - $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); - if ($result < 0) dol_print_error($db,$object->error); -} - -else if ($action == 'setnote' && $user->rights->propal->creer) -{ - $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); - if ($result < 0) dol_print_error($db,$object->error); -} - -// Create proposal -else if ($action == 'add' && $user->rights->propal->creer) -{ - $object->socid=$socid; - $object->fetch_thirdparty(); - - $datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); - $duration=GETPOST('duree_validite'); - - if (empty($datep)) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); - $action='create'; - $error++; - } - if (empty($duration)) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); - $action='create'; - $error++; - } - - if ($socid<1) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); - $action='create'; - $error++; - } - - if (! $error) - { - $db->begin(); - - // Si on a selectionne une propal a copier, on realise la copie - if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) - { - if ($object->fetch(GETPOST('copie_propal')) > 0) - { - $object->ref = GETPOST('ref'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = $duration; - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - $object->remise_percent = GETPOST('remise_percent'); - $object->remise_absolue = GETPOST('remise_absolue'); - $object->socid = GETPOST('socid'); - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - $object->statut = 0; - - $id = $object->create_from($user); - } - else - { - setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); - } - } - else - { - $object->ref = GETPOST('ref'); - $object->ref_client = GETPOST('ref_client'); - $object->datep = $datep; - $object->date_livraison = $date_delivery; - $object->availability_id = GETPOST('availability_id'); - $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->fk_delivery_address = GETPOST('fk_address'); - $object->duree_validite = GETPOST('duree_validite'); - $object->cond_reglement_id = GETPOST('cond_reglement_id'); - $object->mode_reglement_id = GETPOST('mode_reglement_id'); - - $object->contactid = GETPOST('contactidp'); - $object->fk_project = GETPOST('projectid'); - $object->modelpdf = GETPOST('model'); - $object->author = $user->id; // deprecated - $object->note = GETPOST('note'); - - $object->origin = GETPOST('origin'); - $object->origin_id = GETPOST('originid'); - - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - if ($_POST['idprod'.$i]) - { - $xid = 'idprod'.$i; - $xqty = 'qty'.$i; - $xremise = 'remise'.$i; - $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); - } - } - - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=GETPOST($key); - } - } - - $id = $object->create($user); - } - - if ($id > 0) - { - // Insertion contact par defaut si defini - if (GETPOST('contactidp')) - { - $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); - if ($result < 0) - { - $error++; - setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); - } - } - - if (! $error) - { - $db->commit(); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); - exit; - } - else - { - $db->rollback(); - } - } - else - { - dol_print_error($db,$object->error); - $db->rollback(); - exit; - } - } -} - -// Classify billed -else if ($action == 'classifybilled' && $user->rights->propal->cloturer) -{ - $object->cloture($user, 4, ''); -} - -// Reopen proposal -else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) -{ - // prevent browser refresh from reopening proposal several times - if ($object->statut==2 || $object->statut==3) - { - $object->setStatut(1); - } -} - -// Close proposal -else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) -{ - if (! GETPOST('statut')) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")), 'errors'); - $action='statut'; - } - else - { - // prevent browser refresh from closing proposal several times - if ($object->statut==1) - { - $object->cloture($user, GETPOST('statut'), GETPOST('note')); - } - } -} - -/* - * Add file in email form - */ -if (GETPOST('addfile')) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - // Set tmp user directory TODO Use a dedicated directory for temp mails files - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir_tmp = $vardir.'/temp'; - - dol_add_file_process($upload_dir_tmp,0,0); - $action='presend'; -} - -/* - * Remove file in email form - */ -if (GETPOST('removedfile')) -{ - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - // Set tmp user directory - $vardir=$conf->user->dir_output."/".$user->id; - $upload_dir_tmp = $vardir.'/temp'; - - // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'],0); - $action='presend'; -} - -/* - * Send mail - */ -if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) -{ - $langs->load('mails'); - - if ($object->id > 0) - { - if ($_POST['sendto']) - { - // Le destinataire a ete fourni via le champ libre - $sendto = $_POST['sendto']; - $sendtoid = 0; - } - elseif ($_POST['receiver'] != '-1') - { - // Recipient was provided from combo list - if ($_POST['receiver'] == 'thirdparty') // Id of third party - { - $sendto = $object->client->email; - $sendtoid = 0; - } - else // Id du contact - { - $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); - $sendtoid = $_POST['receiver']; - } - } - - if (dol_strlen($sendto)) - { - $langs->load("commercial"); - - $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; - $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; - $message = $_POST['message']; - $sendtocc = $_POST['sendtocc']; - $deliveryreceipt = $_POST['deliveryreceipt']; - - if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; - else $subject = $langs->transnoentities('Propal').' '.$object->ref; - $actiontypecode='AC_PROP'; - $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; - if ($message) - { - $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; - $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; - $actionmsg.=$message; - } - $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); - - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $attachedfiles=$formmail->get_attached_files(); - $filepath = $attachedfiles['paths']; - $filename = $attachedfiles['names']; - $mimetype = $attachedfiles['mimes']; - - // Envoi de la propal - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); - if ($mailfile->error) - { - setEventMessage($mailfile->error, 'errors'); - } - else - { - $result=$mailfile->sendfile(); - if ($result) - { - // Initialisation donnees - $object->sendtoid = $sendtoid; - $object->actiontypecode = $actiontypecode; - $object->actionmsg = $actionmsg; - $object->actionmsg2 = $actionmsg2; - $object->fk_element = $object->id; - $object->elementtype = $object->element; - - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($db); - $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers - - if (! $error) - { - // Redirect here - // This avoid sending mail twice if going out and then back to page - $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); - setEventMessage($mesg); - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); - exit; - } - else - { - dol_print_error($db); - } - } - else - { - $langs->load("other"); - if ($mailfile->error) - { - $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); - $mesg.='
'.$mailfile->error; - } - else - { - $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; - } - setEventMessage($mesg, 'errors'); - } - } - } - else - { - $langs->load("other"); - setEventMessage($langs->trans('ErrorMailRecipientIsEmpty').'!', 'errors'); - dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); - } - } - else - { - $langs->load("other"); - setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")), 'errors'); - dol_syslog($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal"))); - } -} - -// Go back to draft -if ($action == 'modif' && $user->rights->propal->creer) -{ - $object->set_draft($user); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } -} - -else if ($action == "setabsolutediscount" && $user->rights->propal->creer) -{ - if ($_POST["remise_id"]) - { - if ($object->id > 0) - { - $result=$object->insert_discount($_POST["remise_id"]); - if ($result < 0) - { - setEventMessage($object->error, 'errors'); - } - } - } -} - -//Ajout d'une ligne produit dans la propale -else if ($action == "addline" && $user->rights->propal->creer) -{ - $idprod=GETPOST('idprod', 'int'); - $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); - $price_ht = GETPOST('price_ht'); - $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); - - if (empty($idprod) && GETPOST('type') < 0) - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); - $error++; - } - if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - if (empty($idprod) && empty($product_desc)) - { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors'); - $error++; - } - - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) - { - $pu_ht=0; - $pu_ttc=0; - $price_min=0; - $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); - - // Ecrase $pu par celui du produit - // Ecrase $desc par celui du produit - // Ecrase $txtva par celui du produit - if (! empty($idprod)) - { - $prod = new Product($db); - $prod->fetch($idprod); - - $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); - - // If prices fields are update - if (GETPOST('usenewaddlineform')) - { - $pu_ht=price2num($price_ht, 'MU'); - $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); - $tva_tx=str_replace('*','', $tva_tx); - $desc = $product_desc; - } - else - { - $tva_tx = get_default_tva($mysoc,$object->client,$prod->id); - $tva_npr = get_default_npr($mysoc,$object->client,$prod->id); - - // On defini prix unitaire - if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) - { - $pu_ht = $prod->multiprices[$object->client->price_level]; - $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; - $price_min = $prod->multiprices_min[$object->client->price_level]; - $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; - } - else - { - $pu_ht = $prod->price; - $pu_ttc = $prod->price_ttc; - $price_min = $prod->price_min; - $price_base_type = $prod->price_base_type; - } - - // On reevalue prix selon taux tva car taux tva transaction peut etre different - // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). - if ($tva_tx != $prod->tva_tx) - { - if ($price_base_type != 'HT') - { - $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); - } - else - { - $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); - } - } - - $desc=''; - - // Define output language - if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) - { - $outputlangs = $langs; - $newlang=''; - if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); - if (empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description; - } - else - { - $desc = $prod->description; - } - - $desc=dol_concatdesc($desc,$product_desc); - - // Add custom code and origin country into description - if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) - { - $tmptxt='('; - if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; - if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - '; - if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0); - $tmptxt.=')'; - $desc= dol_concatdesc($desc, $tmptxt); - } - } - - $type = $prod->type; - } - else - { - $pu_ht = price2num($price_ht, 'MU'); - $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); - $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); - $tva_tx = str_replace('*', '', $tva_tx); - $label = (GETPOST('product_label')?GETPOST('product_label'):''); - $desc = $product_desc; - $type = GETPOST('type'); - } - - // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); - - // Local Taxes - $localtax1_tx= get_localtax($tva_tx, 1, $object->client); - $localtax2_tx= get_localtax($tva_tx, 2, $object->client); - - $info_bits=0; - if ($tva_npr) $info_bits |= 0x01; - - if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) - { - $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); - setEventMessage($mesg, 'errors'); - } - else - { - // Insert line - $result=$object->addline( - $id, - $desc, - $pu_ht, - GETPOST('qty'), - $tva_tx, - $localtax1_tx, - $localtax2_tx, - $idprod, - GETPOST('remise_percent'), - $price_base_type, - $pu_ttc, - $info_bits, - $type, - -1, - 0, - GETPOST('fk_parent_line'), - $fournprice, - $buyingprice, - $label - ); - - if ($result > 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['idprod']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - - // old method - unset($_POST['np_desc']); - unset($_POST['dp_desc']); - } - else - { - setEventMessage($object->error, 'errors'); - } - } - } -} - -// Mise a jour d'une ligne dans la propale -else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save') == $langs->trans("Save")) -{ - // Define info_bits - $info_bits=0; - if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; - - // Clean parameters - $description=dol_htmlcleanlastbr(GETPOST('product_desc')); - - // Define vat_rate - $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); - $vat_rate=str_replace('*','',$vat_rate); - $localtax1_rate=get_localtax($vat_rate,1,$object->client); - $localtax2_rate=get_localtax($vat_rate,2,$object->client); - $pu_ht=GETPOST('price_ht'); - - // Add buying price - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); - - // Define special_code for special lines - $special_code=0; - if (! GETPOST('qty')) $special_code=3; - - // Check minimum price - $productid = GETPOST('productid', 'int'); - if (! empty($productid)) - { - $product = new Product($db); - $res=$product->fetch($productid); - - $type=$product->type; - - $price_min = $product->price_min; - if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) - $price_min = $product->multiprices_min[$object->client->price_level]; - - $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); - - if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) - { - setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); - $error++; - } - } - else - { - $type = GETPOST('type'); - $label = (GETPOST('product_label') ? GETPOST('product_label'):''); - - // Check parameters - if (GETPOST('type') < 0) { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); - $error++; - } - } - - if (! $error) - { - $result = $object->updateline( - GETPOST('lineid'), - $pu_ht, - GETPOST('qty'), - GETPOST('remise_percent'), - $vat_rate, - $localtax1_rate, - $localtax2_rate, - $description, - 'HT', - $info_bits, - $special_code, - GETPOST('fk_parent_line'), - 0, - $fournprice, - $buyingprice, - $label, - $type - ); - - if ($result >= 0) - { - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['productid']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['price_ttc']); - unset($_POST['tva_tx']); - unset($_POST['product_ref']); - unset($_POST['product_label']); - unset($_POST['product_desc']); - unset($_POST['fournprice']); - unset($_POST['buying_price']); - } - else - { - setEventMessage($object->error, 'errors'); - } - } -} - -else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) -{ - header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition - exit; -} - -// Generation doc (depuis lien ou depuis cartouche doc) -else if ($action == 'builddoc' && $user->rights->propal->creer) -{ - if (GETPOST('model')) - { - $object->setDocModel($user, GETPOST('model')); - } - - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - else - { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); - exit; - } -} - -// Remove file in doc form -else if ($action == 'remove_file' && $user->rights->propal->creer) -{ - if ($object->id > 0) - { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - $langs->load("other"); - $upload_dir = $conf->propal->dir_output; - $file = $upload_dir . '/' . GETPOST('file'); - $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); - } -} - -// Set project -else if ($action == 'classin' && $user->rights->propal->creer) -{ - $object->setProject($_POST['projectid']); -} - -// Delai de livraison -else if ($action == 'setavailability' && $user->rights->propal->creer) -{ - $result = $object->availability($_POST['availability_id']); -} - -// Origine de la propale -else if ($action == 'setdemandreason' && $user->rights->propal->creer) -{ - $result = $object->demand_reason($_POST['demand_reason_id']); -} - -// Conditions de reglement -else if ($action == 'setconditions' && $user->rights->propal->creer) -{ - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); -} - -else if ($action == 'setremisepercent' && $user->rights->propal->creer) -{ - $result = $object->set_remise_percent($user, $_POST['remise_percent']); -} - -else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) -{ - $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); -} - -// Mode de reglement -else if ($action == 'setmode' && $user->rights->propal->creer) -{ - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); -} - -/* - * Ordonnancement des lignes - */ - -else if ($action == 'up' && $user->rights->propal->creer) -{ - $object->line_up(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); - exit; -} - -else if ($action == 'down' && $user->rights->propal->creer) -{ - $object->line_down(GETPOST('rowid')); - - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) - { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); - $outputlangs->setDefaultLang($newlang); - } - $ret=$object->fetch($id); // Reload to get new records - propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - } - - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); - exit; -} -else if ($action == 'update_extras') -{ - // Get extra fields - foreach($_POST as $key => $value) - { - if (preg_match("/^options_/",$key)) - { - $object->array_options[$key]=$_POST[$key]; - } - } - // Actions on extra fields (by external module or standard code) - // FIXME le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('propaldao')); - $parameters=array('id'=>$object->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } - } - else if ($reshook < 0) $error++; - -} - -if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) -{ - if ($action == 'addcontact') - { - if ($object->id > 0) - { - $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); - } - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { - $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); - } - else - { - setEventMessage($object->error, 'errors'); - } - } - } - - // Bascule du statut d'un contact - else if ($action == 'swapstatut') - { - if ($object->fetch($id) > 0) - { - $result=$object->swapContactStatus(GETPOST('ligne')); - } - else - { - dol_print_error($db); - } - } - - // Efface un contact - else if ($action == 'deletecontact') - { - $object->fetch($id); - $result = $object->delete_contact($lineid); - - if ($result >= 0) - { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - dol_print_error($db); - } - } -} - - -/* - * View - */ - -llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); - -$form = new Form($db); -$formother = new FormOther($db); -$formfile = new FormFile($db); -$formpropal = new FormPropal($db); -$companystatic=new Societe($db); - -// fetch optionals attributes and labels -$extralabels=$extrafields->fetch_name_optionals_label('propal'); - -$now=dol_now(); - -// Add new proposal -if ($action == 'create') -{ - print_fiche_titre($langs->trans("NewProp")); - - $soc = new Societe($db); - if ($socid>0) $res=$soc->fetch($socid); - - $object = new Propal($db); - - print ''; - print ''; - print ''; - - if ($origin != 'project' && $originid) - { - print ''; - print ''; - } - - print ''; - - // Reference - print ''; - - // Ref customer - print ''; - print ''; - - // Third party - print ''; - print ''; - if($socid>0) - { - print ''; - } - else - { - print ''; - } - print ''."\n"; - - // Contacts - if($socid>0) - { - print "'; - - // Ligne info remises tiers - print ''; - } - - // Date - print ''; - - // Validaty duration - print ''; - - // Terms of payment - print ''; - - // Mode of payment - print ''; - - // What trigger creation - print ''; - - // Delivery delay - print ''; - - // Delivery date (or manufacturing) - print ''; - print ''; - - // Model - print ''; - print ''; - print '"; - - // Project - if (! empty($conf->projet->enabled) && $socid>0) - { - $projectid = 0; - if ($origin == 'project') $projectid = ($originid?$originid:0); - - print ''; - print ''; - print ''; - } - - // Other attributes - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - - // Show separator only - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''."\n"; - } - } - } - - print "
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; - print '
'.$langs->trans('Customer').''; - print $soc->getNomUrl(1); - print ''; - print ''; - print $form->select_company('','socid','s.client = 1 OR s.client = 2 OR s.client = 3',1); - print '
".$langs->trans("DefaultContact").''; - $form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); - print '
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - $absolute_discount=$soc->getAvailableDiscounts(); - print '. '; - if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); - else print $langs->trans("CompanyHasNoAbsoluteDiscount"); - print '.'; - print '
'.$langs->trans('Date').''; - $form->select_date('','','','','',"addprop"); - print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; - $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); - print '
'.$langs->trans('PaymentMode').''; - $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); - print '
'.$langs->trans('Source').''; - $form->select_demand_reason('','demand_reason_id',"SRC_PROP",1); - print '
'.$langs->trans('AvailabilityPeriod').''; - $form->select_availability('','availability_id','',1); - print '
'.$langs->trans("DeliveryDate").''; - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") - { - $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); - $syear = date("Y", $tmpdte); - $smonth = date("m", $tmpdte); - $sday = date("d", $tmpdte); - $form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop"); - } - else - { - $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; - $form->select_date($datepropal,'liv_','','','',"addprop"); - } - print '
'.$langs->trans("DefaultModel").''; - $liste=ModelePDFPropales::liste_modeles($db); - print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF); - print "
'.$langs->trans("Project").''; - - $numprojet=select_projects($soc->id,$projectid); - if ($numprojet==0) - { - print '   '.$langs->trans("AddProject").''; - } - print '
'; - print $extrafields->showInputField($key,$value); - print '
"; - print '
'; - - /* - * Combobox pour la fonction de copie - */ - - if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) - { - print ''; - } - - print ''; - if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) - { - // For backward compatibility - print ''; - print ''; - print ''; - print ''; - - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; - - print ''; - print ''; - } - - if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) - { - print ''; - } - print '
'.$langs->trans("CopyPropalFrom").' '; - $liste_propal = array(); - $liste_propal[0] = ''; - - $sql ="SELECT p.rowid as id, p.ref, s.nom"; - $sql.=" FROM ".MAIN_DB_PREFIX."propal p"; - $sql.= ", ".MAIN_DB_PREFIX."societe s"; - $sql.= " WHERE s.rowid = p.fk_soc"; - $sql.= " AND p.entity = ".$conf->entity; - $sql.= " AND p.fk_statut <> 0"; - $sql.= " ORDER BY Id"; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) - { - $row = $db->fetch_row($resql); - $propalRefAndSocName = $row[1]." - ".$row[2]; - $liste_propal[$row[0]]=$propalRefAndSocName; - $i++; - } - print $form->selectarray("copie_propal",$liste_propal, 0); - } - else - { - dol_print_error($db); - } - print '
 
'.$langs->trans("CreateEmptyPropal").'
'; - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $lib=$langs->trans("ProductsAndServices"); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) - { - print ''; - print ''; - print ''; - print ''; - } - - print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; - // multiprix - if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) - $form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level); - else - $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); - print '%
"; - - } - print '
'; - print '
'; - - $langs->load("bills"); - print '
'; - print ''; - print ' '; - print '
'; - - print ""; -} -else -{ - /* - * Show object in view mode - */ - - $soc = new Societe($db); - $soc->fetch($object->socid); - - $head = propal_prepare_head($object); - dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); - - $formconfirm=''; - - // Clone confirmation - if ($action == 'clone') - { - // Create an array for form - $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid','int'),'socid','(s.client=1 OR s.client=2 OR s.client=3)')) - ); - // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1); - } - - // Confirm delete - else if ($action == 'delete') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); - } - - // Confirm reopen - else if ($action == 'reopen') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); - } - - // Confirmation delete product/service line - else if ($action == 'ask_deleteline') - { - $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); - } - - // Confirm validate proposal - else if ($action == 'validate') - { - $error=0; - - // on verifie si l'objet est en numerotation provisoire - $ref = substr($object->ref, 1, 4); - if ($ref == 'PROV') - { - $numref = $object->getNextNumRef($soc); - if (empty($numref)) - { - $error++; - dol_htmloutput_errors($object->error); - } - } - else - { - $numref = $object->ref; - } - - $text=$langs->trans('ConfirmValidateProp',$numref); - if (! empty($conf->notification->enabled)) - { - require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; - $notify=new Notify($db); - $text.='
'; - $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); - } - - if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); - } - - if (! $formconfirm) - { - $parameters=array('lineid'=>$lineid); - $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - - // Print form confirm - print $formconfirm; - - - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Ref client - print ''; - print ''; - - // Company - print ''; - print ''; - - // Ligne info remises tiers - print ''; - - // Date of proposal - print ''; - print ''; - - // Date end proposal - print ''; - print ''; - print ''; - - // Payment term - print ''; - print ''; - - // Delivery date - $langs->load('deliveries'); - print ''; - print ''; - - // Delivery delay - print ''; - print ''; - - // Origin of demand - print ''; - print ''; - - // Payment mode - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - print ''; - } - else - { - print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); - print '
'; - print ''; - if ($action != 'refclient' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print ''.img_edit($langs->trans('Modify')).'
'; - print '
'; - if ($user->rights->propal->creer && $action == 'refclient') - { - print '
'; - print ''; - print ''; - print ''; - print ' '; - print '
'; - } - else - { - print $object->ref_client; - } - print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; - if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); - else print $langs->trans("CompanyHasNoRelativeDiscount"); - print '. '; - $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); - $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); - $absolute_discount=price2num($absolute_discount,'MT'); - $absolute_creditnote=price2num($absolute_creditnote,'MT'); - if ($absolute_discount) - { - if ($object->statut > 0) - { - print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); - } - else - { - // Remise dispo de type non avoir - $filter='fk_facture_source IS NULL'; - print '
'; - $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); - } - } - if ($absolute_creditnote) - { - print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; - } - if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; - print '
'; - print ''; - if ($action != 'editdate' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('Date'); - print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; - print '
'; - if (! empty($object->brouillon) && $action == 'editdate') - { - print '
'; - print ''; - print ''; - $form->select_date($object->date,'re','','',0,"editdate"); - print ''; - print '
'; - } - else - { - if ($object->date) - { - print dol_print_date($object->date,'daytext'); - } - else - { - print ' '; - } - } - print '
'; - print ''; - if ($action != 'editecheance' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('DateEndPropal'); - print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; - print '
'; - if (! empty($object->brouillon) && $action == 'editecheance') - { - print '
'; - print ''; - print ''; - $form->select_date($object->fin_validite,'ech','','','',"editecheance"); - print ''; - print '
'; - } - else - { - if (! empty($object->fin_validite)) - { - print dol_print_date($object->fin_validite,'daytext'); - if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); - } - else - { - print ' '; - } - } - print '
'; - print ''; - if ($action != 'editconditions' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('PaymentConditionsShort'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'),1).'
'; - print '
'; - if ($action == 'editconditions') - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); - } - else - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); - } - print '
'; - print ''; - if ($action != 'editdate_livraison' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('DeliveryDate'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'),1).'
'; - print '
'; - if ($action == 'editdate_livraison') - { - print '
'; - print ''; - print ''; - $form->select_date($object->date_livraison,'liv_','','','',"editdate_livraison"); - print ''; - print '
'; - } - else - { - print dol_print_date($object->date_livraison,'daytext'); - } - print '
'; - print ''; - if ($action != 'editavailability' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('AvailabilityPeriod'); - if (! empty($conf->commande->enabled)) print ' ('.$langs->trans('AfterOrder').')'; - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'),1).'
'; - print '
'; - if ($action == 'editavailability') - { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); - } - else - { - $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1); - } - - print '
'; - print ''; - if ($action != 'editdemandreason' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('Source'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'),1).'
'; - print '
'; - //print $object->demand_reason_id; - if ($action == 'editdemandreason') - { - $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); - } - else - { - $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none'); - } - - print '
'; - print ''; - if ($action != 'editmode' && ! empty($object->brouillon)) print ''; - print '
'; - print $langs->trans('PaymentMode'); - print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'),1).'
'; - print '
'; - if ($action == 'editmode') - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); - } - else - { - $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); - } - print '
'; - print ''; - if ($user->rights->propal->creer) - { - if ($action != 'classify') print ''; - print '
'; - print $langs->trans('Project').''.img_edit($langs->transnoentitiesnoconv('SetProject')).'
'; - print '
'; - if ($action == 'classify') - { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); - } - else - { - $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); - } - print '
'; - if (! empty($object->fk_project)) - { - print ''; - $proj = new Project($db); - $proj->fetch($object->fk_project); - print ''; - print $proj->ref; - print ''; - print ''; - } - else { - print ' '; - } - } - print ''; - } - - // Other attributes - $res=$object->fetch_optionals($object->id,$extralabels); - $parameters=array('colspan' => ' colspan="3"'); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - if (empty($reshook) && ! empty($extrafields->attribute_label)) - { - - if ($action == 'edit_extras') - { - print '
'; - print ''; - print ''; - print ''; - } - - - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - if ($extrafields->attribute_type[$key] == 'separate') - { - print $extrafields->showSeparator($key); - } - else - { - print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>'.$label.''; - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print $extrafields->showInputField($key,$value); - } - else - { - print $extrafields->showOutputField($key,$value); - } - print ''."\n"; - } - } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print ''; - print ''; - print ''; - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->propal->creer) - { - print ''.img_picto('','edit').' '.$langs->trans('Modify').''; - } - } - } - } - - // Amount HT - print ''.$langs->trans('AmountHT').''; - print ''.price($object->total_ht).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Margin Infos - if (! empty($conf->margin->enabled)) { - print ''; - $object->displayMarginInfos(); - print ''; - } - print ''; - - // Amount VAT - print ''.$langs->trans('AmountVAT').''; - print ''.price($object->total_tva).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Amount Local Taxes - if ($mysoc->localtax1_assuj=="1") //Localtax1 - { - print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; - print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - if ($mysoc->localtax2_assuj=="1") //Localtax2 - { - print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; - print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - - - // Amount TTC - print ''.$langs->trans('AmountTTC').''; - print ''.price($object->total_ttc).''; - print ''.$langs->trans("Currency".$conf->currency).''; - - // Statut - print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; - - print '
'; - - if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) - { - $blocname = 'contacts'; - $title = $langs->trans('ContactsAddresses'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) - { - $blocname = 'notes'; - $title = $langs->trans('Notes'); - include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; - } - - /* - * Lines - */ - - if (! empty($conf->use_javascript_ajax) && $object->statut == 0) - { - include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; - } - - print ''; - - // Show object lines - $result = $object->getLinesArray(); - if (! empty($object->lines)) - $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid); - - // Form to add new line - if ($object->statut == 0 && $user->rights->propal->creer) - { - if ($action != 'editline') - { - $var=true; - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { - // Add free or predefined products/services - $object->formAddObjectLine(0,$mysoc,$soc); - } - else - { - // Add free products/services - $object->formAddFreeProduct(0,$mysoc,$soc); - - // Add predefined products/services - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $var=!$var; - $object->formAddPredefinedProduct(0,$mysoc,$soc); - } - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } - } - - print '
'; - - print ''; - print "\n"; - - if ($action == 'statut') - { - /* - * Formulaire cloture (signe ou non) - */ - $form_close = '
'; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans("CloseAs").''; - $form_close.= ''; - $form_close.= ''; - $form_close.= '
'.$langs->trans('Note').'
'; - $form_close.= ''; - $form_close.= '   '; - $form_close.= ' '; - $form_close.= '
'; - - print $form_close; - } - - - /* - * Boutons Actions - */ - if ($action != 'presend') - { - print '
'; - - if ($action != 'statut' && $action <> 'editline') - { - // Validate - if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) - { - if (count($object->lines) > 0) print ''.$langs->trans('Validate').''; - //else print ''.$langs->trans('Validate').''; - } - - // Edit - if ($object->statut == 1 && $user->rights->propal->creer) - { - print ''.$langs->trans('Modify').''; - } - - // ReOpen - if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) - { - print 'global->MAIN_JUMP_TAG)?'':'#reopen').'"'; - print '>'.$langs->trans('ReOpen').''; - } - - // Send - if ($object->statut == 1 || $object->statut == 2) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) - { - print ''.$langs->trans('SendByMail').''; - } - else print ''.$langs->trans('SendByMail').''; - } - - // Create an order - if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) - { - if ($user->rights->commande->creer) - { - print ''.$langs->trans("AddOrder").''; - } - } - - // Create contract - if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) - { - $langs->load("contracts"); - - if ($user->rights->contrat->creer) - { - print ''.$langs->trans('AddContract').''; - } - } - - // Create an invoice and classify billed - if ($object->statut == 2 && $user->societe_id == 0) - { - if (! empty($conf->facture->enabled) && $user->rights->facture->creer) - { - print ''.$langs->trans("AddBill").''; - } - - $arraypropal=$object->getInvoiceArrayList(); - if (is_array($arraypropal) && count($arraypropal) > 0) - { - print 'socid.'">'.$langs->trans("ClassifyBilled").''; - } - } - - // Close - if ($object->statut == 1 && $user->rights->propal->cloturer) - { - print 'global->MAIN_JUMP_TAG)?'':'#close').'"'; - print '>'.$langs->trans('Close').''; - } - - // Clone - if ($user->rights->propal->creer) - { - print ''.$langs->trans("ToClone").''; - } - - // Delete - if ($user->rights->propal->supprimer) - { - print ''.$langs->trans('Delete').''; - } - - } - - print '
'; - print "
\n"; - } - - if ($action != 'presend') - { - print '
'; - print ''; // ancre - - - /* - * Documents generes - */ - $filename=dol_sanitizeFileName($object->ref); - $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); - $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed=$user->rights->propal->creer; - $delallowed=$user->rights->propal->supprimer; - - $var=true; - - $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang); - - - /* - * Linked object block - */ - $somethingshown=$object->showLinkedObjectBlock(); - - print ''; - - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'propal',$socid); - - print '
'; - } - - - /* - * Action presend - * - */ - if ($action == 'presend') - { - $ref = dol_sanitizeFileName($object->ref); - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); - $file=$fileparams['fullname']; - - // Build document if it not exists - if (! $file || ! is_readable($file)) - { - // Define output language - $outputlangs = $langs; - $newlang=''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; - if (! empty($newlang)) - { - $outputlangs = new Translate("",$conf); - $outputlangs->setDefaultLang($newlang); - } - - $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); - if ($result <= 0) - { - dol_print_error($db,$result); - exit; - } - $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); - $file=$fileparams['fullname']; - } - - print '
'; - print_titre($langs->trans('SendPropalByMail')); - - // Create form object - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - $formmail->fromtype = 'user'; - $formmail->fromid = $user->id; - $formmail->fromname = $user->getFullName($langs); - $formmail->frommail = $user->email; - $formmail->withfrom=1; - $liste=array(); - foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; - $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; - $formmail->withtocc=$liste; - $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); - $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); - $formmail->withfile=2; - $formmail->withbody=1; - $formmail->withdeliveryreceipt=1; - $formmail->withcancel=1; - - // Tableau des substitutions - $formmail->substit['__PROPREF__']=$object->ref; - $formmail->substit['__SIGNATURE__']=$user->signature; - $formmail->substit['__PERSONALIZED__']=''; - $formmail->substit['__CONTACTCIVNAME__']=''; - + + * Copyright (C) 2004-2013 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2010-2011 Philippe Grand + * Copyright (C) 2012 Christophe Battarel +* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/comm/propal.php + * \ingroup propale + * \brief Page of commercial proposals card and list + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +if (! empty($conf->projet->enabled)) +{ + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +} + +$langs->load('companies'); +$langs->load('propal'); +$langs->load('compta'); +$langs->load('bills'); +$langs->load('orders'); +$langs->load('products'); +$langs->load("deliveries"); +if (! empty($conf->margin->enabled)) + $langs->load('margins'); + +$error=0; + +$id=GETPOST('id','int'); +$ref=GETPOST('ref','alpha'); +$socid=GETPOST('socid','int'); +$action=GETPOST('action','alpha'); +$origin=GETPOST('origin','alpha'); +$originid=GETPOST('originid','int'); +$confirm=GETPOST('confirm','alpha'); +$lineid=GETPOST('lineid','int'); + +//PDF +$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); +$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); +$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); + +// Nombre de ligne pour choix de produit/service predefinis +$NBLINES=4; + +// Security check +if (! empty($user->societe_id)) $socid=$user->societe_id; +$result = restrictedArea($user, 'propal', $id); + +$object = new Propal($db); +$extrafields = new ExtraFields($db); + +// Load object +if ($id > 0 || ! empty($ref)) +{ + $ret=$object->fetch($id, $ref); + if ($ret > 0) $ret=$object->fetch_thirdparty(); + if ($ret < 0) dol_print_error('',$object->error); +} + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('propalcard')); + + + +/* + * Actions + */ + +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + +// Action clone object +if ($action == 'confirm_clone' && $confirm == 'yes') +{ + if (1==0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers')) + { + setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors'); + } + else + { + if ($object->id > 0) + { + $result=$object->createFromClone($socid); + if ($result > 0) + { + header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); + exit; + } + else + { + setEventMessage($object->error, 'errors'); + $action=''; + } + } + } +} + +// Suppression de la propale +else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) +{ + $result=$object->delete($user); + if ($result > 0) + { + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + exit; + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans($object->error), 'errors'); + } +} + +// Remove line +else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->propal->creer) +{ + $result = $object->deleteline($lineid); + // reorder lines + if ($result) $object->line_order(true); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; +} + +// Validation +else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propal->valider) +{ + $result=$object->valid($user); + if ($result >= 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + } + else + { + $langs->load("errors"); + setEventMessage($langs->trans($object->error), 'errors'); + } +} + +else if ($action == 'setdate' && $user->rights->propal->creer) +{ + $datep=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + + if (empty($datep)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + } + + if (! $error) + { + $result=$object->set_date($user,$datep); + if ($result < 0) dol_print_error($db,$object->error); + } +} +else if ($action == 'setecheance' && $user->rights->propal->creer) +{ + $result=$object->set_echeance($user,dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear'])); + if ($result < 0) dol_print_error($db,$object->error); +} +else if ($action == 'setdate_livraison' && $user->rights->propal->creer) +{ + $result=$object->set_date_livraison($user,dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); + if ($result < 0) dol_print_error($db,$object->error); +} + +// Positionne ref client +else if ($action == 'set_ref_client' && $user->rights->propal->creer) +{ + $object->set_ref_client($user, $_POST['ref_client']); +} + +else if ($action == 'setnote_public' && $user->rights->propal->creer) +{ + $result=$object->update_note_public(dol_html_entity_decode(GETPOST('note_public'), ENT_QUOTES)); + if ($result < 0) dol_print_error($db,$object->error); +} + +else if ($action == 'setnote' && $user->rights->propal->creer) +{ + $result=$object->update_note(dol_html_entity_decode(GETPOST('note'), ENT_QUOTES)); + if ($result < 0) dol_print_error($db,$object->error); +} + +// Create proposal +else if ($action == 'add' && $user->rights->propal->creer) +{ + $object->socid=$socid; + $object->fetch_thirdparty(); + + $datep=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $date_delivery=dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + $duration=GETPOST('duree_validite'); + + if (empty($datep)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); + $action='create'; + $error++; + } + if (empty($duration)) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); + $action='create'; + $error++; + } + + if ($socid<1) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors'); + $action='create'; + $error++; + } + + if (! $error) + { + $db->begin(); + + // Si on a selectionne une propal a copier, on realise la copie + if (GETPOST('createmode')=='copy' && GETPOST('copie_propal')) + { + if ($object->fetch(GETPOST('copie_propal')) > 0) + { + $object->ref = GETPOST('ref'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = $duration; + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + $object->remise_percent = GETPOST('remise_percent'); + $object->remise_absolue = GETPOST('remise_absolue'); + $object->socid = GETPOST('socid'); + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + $object->statut = 0; + + $id = $object->create_from($user); + } + else + { + setEventMessage($langs->trans("ErrorFailedToCopyProposal",GETPOST('copie_propal')), 'errors'); + } + } + else + { + $object->ref = GETPOST('ref'); + $object->ref_client = GETPOST('ref_client'); + $object->datep = $datep; + $object->date_livraison = $date_delivery; + $object->availability_id = GETPOST('availability_id'); + $object->demand_reason_id = GETPOST('demand_reason_id'); + $object->fk_delivery_address = GETPOST('fk_address'); + $object->duree_validite = GETPOST('duree_validite'); + $object->cond_reglement_id = GETPOST('cond_reglement_id'); + $object->mode_reglement_id = GETPOST('mode_reglement_id'); + + $object->contactid = GETPOST('contactidp'); + $object->fk_project = GETPOST('projectid'); + $object->modelpdf = GETPOST('model'); + $object->author = $user->id; // deprecated + $object->note = GETPOST('note'); + + $object->origin = GETPOST('origin'); + $object->origin_id = GETPOST('originid'); + + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + if ($_POST['idprod'.$i]) + { + $xid = 'idprod'.$i; + $xqty = 'qty'.$i; + $xremise = 'remise'.$i; + $object->add_product($_POST[$xid],$_POST[$xqty],$_POST[$xremise]); + } + } + + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=GETPOST($key); + } + } + + $id = $object->create($user); + } + + if ($id > 0) + { + // Insertion contact par defaut si defini + if (GETPOST('contactidp')) + { + $result=$object->add_contact(GETPOST('contactidp'),'CUSTOMER','external'); + if ($result < 0) + { + $error++; + setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); + } + } + + if (! $error) + { + $db->commit(); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db,$object->error); + $db->rollback(); + exit; + } + } +} + +// Classify billed +else if ($action == 'classifybilled' && $user->rights->propal->cloturer) +{ + $object->cloture($user, 4, ''); +} + +// Reopen proposal +else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel')) +{ + // prevent browser refresh from reopening proposal several times + if ($object->statut==2 || $object->statut==3) + { + $object->setStatut(1); + } +} + +// Close proposal +else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel')) +{ + if (! GETPOST('statut')) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("CloseAs")), 'errors'); + $action='statut'; + } + else + { + // prevent browser refresh from closing proposal several times + if ($object->statut==1) + { + $object->cloture($user, GETPOST('statut'), GETPOST('note')); + } + } +} + +/* + * Add file in email form + */ +if (GETPOST('addfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory TODO Use a dedicated directory for temp mails files + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + dol_add_file_process($upload_dir_tmp,0,0); + $action='presend'; +} + +/* + * Remove file in email form + */ +if (GETPOST('removedfile')) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + // Set tmp user directory + $vardir=$conf->user->dir_output."/".$user->id; + $upload_dir_tmp = $vardir.'/temp'; + + // TODO Delete only files that was uploaded from email form + dol_remove_file_process($_POST['removedfile'],0); + $action='presend'; +} + +/* + * Send mail + */ +if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) +{ + $langs->load('mails'); + + if ($object->id > 0) + { + if ($_POST['sendto']) + { + // Le destinataire a ete fourni via le champ libre + $sendto = $_POST['sendto']; + $sendtoid = 0; + } + elseif ($_POST['receiver'] != '-1') + { + // Recipient was provided from combo list + if ($_POST['receiver'] == 'thirdparty') // Id of third party + { + $sendto = $object->client->email; + $sendtoid = 0; + } + else // Id du contact + { + $sendto = $object->client->contact_get_property($_POST['receiver'],'email'); + $sendtoid = $_POST['receiver']; + } + } + + if (dol_strlen($sendto)) + { + $langs->load("commercial"); + + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; + $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; + $message = $_POST['message']; + $sendtocc = $_POST['sendtocc']; + $deliveryreceipt = $_POST['deliveryreceipt']; + + if (dol_strlen($_POST['subject'])) $subject = $_POST['subject']; + else $subject = $langs->transnoentities('Propal').' '.$object->ref; + $actiontypecode='AC_PROP'; + $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; + if ($message) + { + $actionmsg.=$langs->transnoentities('MailTopic').": ".$subject."\n"; + $actionmsg.=$langs->transnoentities('TextUsedInTheMessageBody').":\n"; + $actionmsg.=$message; + } + $actionmsg2=$langs->transnoentities('Action'.$actiontypecode); + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $attachedfiles=$formmail->get_attached_files(); + $filepath = $attachedfiles['paths']; + $filename = $attachedfiles['names']; + $mimetype = $attachedfiles['mimes']; + + // Envoi de la propal + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,'',$deliveryreceipt,-1); + if ($mailfile->error) + { + setEventMessage($mailfile->error, 'errors'); + } + else + { + $result=$mailfile->sendfile(); + if ($result) + { + // Initialisation donnees + $object->sendtoid = $sendtoid; + $object->actiontypecode = $actiontypecode; + $object->actionmsg = $actionmsg; + $object->actionmsg2 = $actionmsg2; + $object->fk_element = $object->id; + $object->elementtype = $object->element; + + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($db); + $result=$interface->run_triggers('PROPAL_SENTBYMAIL',$object,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + + if (! $error) + { + // Redirect here + // This avoid sending mail twice if going out and then back to page + $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); + setEventMessage($mesg); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else + { + dol_print_error($db); + } + } + else + { + $langs->load("other"); + if ($mailfile->error) + { + $mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto); + $mesg.='
'.$mailfile->error; + } + else + { + $mesg.='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + } + setEventMessage($mesg, 'errors'); + } + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorMailRecipientIsEmpty').'!', 'errors'); + dol_syslog($langs->trans('ErrorMailRecipientIsEmpty')); + } + } + else + { + $langs->load("other"); + setEventMessage($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal")), 'errors'); + dol_syslog($langs->trans('ErrorFailedToReadEntity',$langs->trans("Proposal"))); + } +} + +// Go back to draft +if ($action == 'modif' && $user->rights->propal->creer) +{ + $object->set_draft($user); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } +} + +else if ($action == "setabsolutediscount" && $user->rights->propal->creer) +{ + if ($_POST["remise_id"]) + { + if ($object->id > 0) + { + $result=$object->insert_discount($_POST["remise_id"]); + if ($result < 0) + { + setEventMessage($object->error, 'errors'); + } + } + } +} + +//Ajout d'une ligne produit dans la propale +else if ($action == "addline" && $user->rights->propal->creer) +{ + $idprod=GETPOST('idprod', 'int'); + $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); + $price_ht = GETPOST('price_ht'); + $tva_tx = (GETPOST('tva_tx')?GETPOST('tva_tx'):0); + + if (empty($idprod) && GETPOST('type') < 0) + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + $error++; + } + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. + { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); + $error++; + } + if (empty($idprod) && empty($product_desc)) + { + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), 'errors'); + $error++; + } + + if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + { + $pu_ht=0; + $pu_ttc=0; + $price_min=0; + $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); + + // Ecrase $pu par celui du produit + // Ecrase $desc par celui du produit + // Ecrase $txtva par celui du produit + if (! empty($idprod)) + { + $prod = new Product($db); + $prod->fetch($idprod); + + $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); + + // If prices fields are update + if (GETPOST('usenewaddlineform')) + { + $pu_ht=price2num($price_ht, 'MU'); + $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); + $tva_tx=str_replace('*','', $tva_tx); + $desc = $product_desc; + } + else + { + $tva_tx = get_default_tva($mysoc,$object->client,$prod->id); + $tva_npr = get_default_npr($mysoc,$object->client,$prod->id); + + // On defini prix unitaire + if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) + { + $pu_ht = $prod->multiprices[$object->client->price_level]; + $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; + $price_min = $prod->multiprices_min[$object->client->price_level]; + $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; + } + else + { + $pu_ht = $prod->price; + $pu_ttc = $prod->price_ttc; + $price_min = $prod->price_min; + $price_base_type = $prod->price_base_type; + } + + // On reevalue prix selon taux tva car taux tva transaction peut etre different + // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur). + if ($tva_tx != $prod->tva_tx) + { + if ($price_base_type != 'HT') + { + $pu_ht = price2num($pu_ttc / (1 + ($tva_tx/100)), 'MU'); + } + else + { + $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); + } + } + + $desc=''; + + // Define output language + if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) + { + $outputlangs = $langs; + $newlang=''; + if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id'); + if (empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $desc = (! empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description; + } + else + { + $desc = $prod->description; + } + + $desc=dol_concatdesc($desc,$product_desc); + + // Add custom code and origin country into description + if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) + { + $tmptxt='('; + if (! empty($prod->customcode)) $tmptxt.=$langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; + if (! empty($prod->customcode) && ! empty($prod->country_code)) $tmptxt.=' - '; + if (! empty($prod->country_code)) $tmptxt.=$langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code,0,$db,$langs,0); + $tmptxt.=')'; + $desc= dol_concatdesc($desc, $tmptxt); + } + } + + $type = $prod->type; + } + else + { + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label')?GETPOST('product_label'):''); + $desc = $product_desc; + $type = GETPOST('type'); + } + + // Margin + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + + // Local Taxes + $localtax1_tx= get_localtax($tva_tx, 1, $object->client); + $localtax2_tx= get_localtax($tva_tx, 2, $object->client); + + $info_bits=0; + if ($tva_npr) $info_bits |= 0x01; + + if (! empty($price_min) && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + { + $mesg = $langs->trans("CantBeLessThanMinPrice",price2num($price_min,'MU').$langs->getCurrencySymbol($conf->currency)); + setEventMessage($mesg, 'errors'); + } + else + { + // Insert line + $result=$object->addline( + $id, + $desc, + $pu_ht, + GETPOST('qty'), + $tva_tx, + $localtax1_tx, + $localtax2_tx, + $idprod, + GETPOST('remise_percent'), + $price_base_type, + $pu_ttc, + $info_bits, + $type, + -1, + 0, + GETPOST('fk_parent_line'), + $fournprice, + $buyingprice, + $label + ); + + if ($result > 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['idprod']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + + // old method + unset($_POST['np_desc']); + unset($_POST['dp_desc']); + } + else + { + setEventMessage($object->error, 'errors'); + } + } + } +} + +// Mise a jour d'une ligne dans la propale +else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('save') == $langs->trans("Save")) +{ + // Define info_bits + $info_bits=0; + if (preg_match('/\*/', GETPOST('tva_tx'))) $info_bits |= 0x01; + + // Clean parameters + $description=dol_htmlcleanlastbr(GETPOST('product_desc')); + + // Define vat_rate + $vat_rate=(GETPOST('tva_tx')?GETPOST('tva_tx'):0); + $vat_rate=str_replace('*','',$vat_rate); + $localtax1_rate=get_localtax($vat_rate,1,$object->client); + $localtax2_rate=get_localtax($vat_rate,2,$object->client); + $pu_ht=GETPOST('price_ht'); + + // Add buying price + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); + + // Define special_code for special lines + $special_code=0; + if (! GETPOST('qty')) $special_code=3; + + // Check minimum price + $productid = GETPOST('productid', 'int'); + if (! empty($productid)) + { + $product = new Product($db); + $res=$product->fetch($productid); + + $type=$product->type; + + $price_min = $product->price_min; + if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($object->client->price_level)) + $price_min = $product->multiprices_min[$object->client->price_level]; + + $label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label'):''); + + if ($price_min && (price2num($pu_ht)*(1-price2num(GETPOST('remise_percent'))/100) < price2num($price_min))) + { + setEventMessage($langs->trans("CantBeLessThanMinPrice", price2num($price_min,'MU')).$langs->getCurrencySymbol($conf->currency), 'errors'); + $error++; + } + } + else + { + $type = GETPOST('type'); + $label = (GETPOST('product_label') ? GETPOST('product_label'):''); + + // Check parameters + if (GETPOST('type') < 0) { + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); + $error++; + } + } + + if (! $error) + { + $result = $object->updateline( + GETPOST('lineid'), + $pu_ht, + GETPOST('qty'), + GETPOST('remise_percent'), + $vat_rate, + $localtax1_rate, + $localtax2_rate, + $description, + 'HT', + $info_bits, + $special_code, + GETPOST('fk_parent_line'), + 0, + $fournprice, + $buyingprice, + $label, + $type + ); + + if ($result >= 0) + { + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['productid']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['price_ttc']); + unset($_POST['tva_tx']); + unset($_POST['product_ref']); + unset($_POST['product_label']); + unset($_POST['product_desc']); + unset($_POST['fournprice']); + unset($_POST['buying_price']); + } + else + { + setEventMessage($object->error, 'errors'); + } + } +} + +else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) +{ + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition + exit; +} + +// Generation doc (depuis lien ou depuis cartouche doc) +else if ($action == 'builddoc' && $user->rights->propal->creer) +{ + if (GETPOST('model')) + { + $object->setDocModel($user, GETPOST('model')); + } + + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + $result=propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + else + { + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + exit; + } +} + +// Remove file in doc form +else if ($action == 'remove_file' && $user->rights->propal->creer) +{ + if ($object->id > 0) + { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $langs->load("other"); + $upload_dir = $conf->propal->dir_output; + $file = $upload_dir . '/' . GETPOST('file'); + $ret=dol_delete_file($file,0,0,0,$object); + if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); + else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); + } +} + +// Set project +else if ($action == 'classin' && $user->rights->propal->creer) +{ + $object->setProject($_POST['projectid']); +} + +// Delai de livraison +else if ($action == 'setavailability' && $user->rights->propal->creer) +{ + $result = $object->availability($_POST['availability_id']); +} + +// Origine de la propale +else if ($action == 'setdemandreason' && $user->rights->propal->creer) +{ + $result = $object->demand_reason($_POST['demand_reason_id']); +} + +// Conditions de reglement +else if ($action == 'setconditions' && $user->rights->propal->creer) +{ + $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); +} + +else if ($action == 'setremisepercent' && $user->rights->propal->creer) +{ + $result = $object->set_remise_percent($user, $_POST['remise_percent']); +} + +else if ($action == 'setremiseabsolue' && $user->rights->propal->creer) +{ + $result = $object->set_remise_absolue($user, $_POST['remise_absolue']); +} + +// Mode de reglement +else if ($action == 'setmode' && $user->rights->propal->creer) +{ + $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); +} + +/* + * Ordonnancement des lignes + */ + +else if ($action == 'up' && $user->rights->propal->creer) +{ + $object->line_up(GETPOST('rowid')); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + exit; +} + +else if ($action == 'down' && $user->rights->propal->creer) +{ + $object->line_down(GETPOST('rowid')); + + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id') ? GETPOST('lang_id') : $object->client->default_lang); + $outputlangs->setDefaultLang($newlang); + } + $ret=$object->fetch($id); // Reload to get new records + propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + exit; +} +else if ($action == 'update_extras') +{ + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=$_POST[$key]; + } + } + // Actions on extra fields (by external module or standard code) + // FIXME le hook fait double emploi avec le trigger !! + $hookmanager->initHooks(array('propaldao')); + $parameters=array('id'=>$object->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$object->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + +} + +if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) +{ + if ($action == 'addcontact') + { + if ($object->id > 0) + { + $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + } + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + $langs->load("errors"); + setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + } + else + { + setEventMessage($object->error, 'errors'); + } + } + } + + // Bascule du statut d'un contact + else if ($action == 'swapstatut') + { + if ($object->fetch($id) > 0) + { + $result=$object->swapContactStatus(GETPOST('ligne')); + } + else + { + dol_print_error($db); + } + } + + // Efface un contact + else if ($action == 'deletecontact') + { + $object->fetch($id); + $result = $object->delete_contact($lineid); + + if ($result >= 0) + { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + dol_print_error($db); + } + } +} + + +/* + * View + */ + +llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); + +$form = new Form($db); +$formother = new FormOther($db); +$formfile = new FormFile($db); +$formpropal = new FormPropal($db); +$companystatic=new Societe($db); + +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('propal'); + +$now=dol_now(); + +// Add new proposal +if ($action == 'create') +{ + print_fiche_titre($langs->trans("NewProp")); + + $soc = new Societe($db); + if ($socid>0) $res=$soc->fetch($socid); + + $object = new Propal($db); + + print '
'; + print ''; + print ''; + + if ($origin != 'project' && $originid) + { + print ''; + print ''; + } + + print ''; + + // Reference + print ''; + + // Ref customer + print ''; + print ''; + + // Third party + print ''; + print ''; + if($socid>0) + { + print ''; + } + else + { + print ''; + } + print ''."\n"; + + // Contacts + if($socid>0) + { + print "'; + + // Ligne info remises tiers + print ''; + } + + // Date + print ''; + + // Validaty duration + print ''; + + // Terms of payment + print ''; + + // Mode of payment + print ''; + + // What trigger creation + print ''; + + // Delivery delay + print ''; + + // Delivery date (or manufacturing) + print ''; + print ''; + + // Model + print ''; + print ''; + print '"; + + // Project + if (! empty($conf->projet->enabled) && $socid>0) + { + $projectid = 0; + if ($origin == 'project') $projectid = ($originid?$originid:0); + + print ''; + print ''; + print ''; + } + + // Other attributes + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + + // Show separator only + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } + } + } + + print "
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$langs->trans('RefCustomer').''; + print '
'.$langs->trans('Customer').''; + print $soc->getNomUrl(1); + print ''; + print ''; + print $form->select_company('','socid','s.client = 1 OR s.client = 2 OR s.client = 3',1); + print '
".$langs->trans("DefaultContact").''; + $form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist); + print '
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $absolute_discount=$soc->getAvailableDiscounts(); + print '. '; + if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency)); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '
'.$langs->trans('Date').''; + $form->select_date('','','','','',"addprop"); + print '
'.$langs->trans("ValidityDuration").' '.$langs->trans("days").'
'.$langs->trans('PaymentConditionsShort').''; + $form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id'); + print '
'.$langs->trans('PaymentMode').''; + $form->select_types_paiements($soc->mode_reglement,'mode_reglement_id'); + print '
'.$langs->trans('Source').''; + $form->select_demand_reason('','demand_reason_id',"SRC_PROP",1); + print '
'.$langs->trans('AvailabilityPeriod').''; + $form->select_availability('','availability_id','',1); + print '
'.$langs->trans("DeliveryDate").''; + if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") + { + $tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); + $syear = date("Y", $tmpdte); + $smonth = date("m", $tmpdte); + $sday = date("d", $tmpdte); + $form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop"); + } + else + { + $datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0; + $form->select_date($datepropal,'liv_','','','',"addprop"); + } + print '
'.$langs->trans("DefaultModel").''; + $liste=ModelePDFPropales::liste_modeles($db); + print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF); + print "
'.$langs->trans("Project").''; + + $numprojet=select_projects($soc->id,$projectid); + if ($numprojet==0) + { + print '   '.$langs->trans("AddProject").''; + } + print '
'; + print $extrafields->showInputField($key,$value); + print '
"; + print '
'; + + /* + * Combobox pour la fonction de copie + */ + + if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) + { + print ''; + } + + print ''; + if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) + { + // For backward compatibility + print ''; + print ''; + print ''; + print ''; + + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; + + print ''; + print ''; + } + + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) + { + print ''; + } + print '
'.$langs->trans("CopyPropalFrom").' '; + $liste_propal = array(); + $liste_propal[0] = ''; + + $sql ="SELECT p.rowid as id, p.ref, s.nom"; + $sql.=" FROM ".MAIN_DB_PREFIX."propal p"; + $sql.= ", ".MAIN_DB_PREFIX."societe s"; + $sql.= " WHERE s.rowid = p.fk_soc"; + $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND p.fk_statut <> 0"; + $sql.= " ORDER BY Id"; + + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($resql); + $propalRefAndSocName = $row[1]." - ".$row[2]; + $liste_propal[$row[0]]=$propalRefAndSocName; + $i++; + } + print $form->selectarray("copie_propal",$liste_propal, 0); + } + else + { + dol_print_error($db); + } + print '
 
'.$langs->trans("CreateEmptyPropal").'
'; + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $lib=$langs->trans("ProductsAndServices"); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++) + { + print ''; + print ''; + print ''; + print ''; + } + + print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; + // multiprix + if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level) + $form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level); + else + $form->select_produits('',"idprod".$i,'',$conf->product->limit_size); + print '%
"; + + } + print '
'; + print '
'; + + $langs->load("bills"); + print '
'; + print ''; + print ' '; + print '
'; + + print "
"; +} +else +{ + /* + * Show object in view mode + */ + + $soc = new Societe($db); + $soc->fetch($object->socid); + + $head = propal_prepare_head($object); + dol_fiche_head($head, 'comm', $langs->trans('Proposal'), 0, 'propal'); + + $formconfirm=''; + + // Clone confirmation + if ($action == 'clone') + { + // Create an array for form + $formquestion=array( + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid','int'),'socid','(s.client=1 OR s.client=2 OR s.client=3)')) + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1); + } + + // Confirm delete + else if ($action == 'delete') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); + } + + // Confirm reopen + else if ($action == 'reopen') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); + } + + // Confirmation delete product/service line + else if ($action == 'ask_deleteline') + { + $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); + } + + // Confirm validate proposal + else if ($action == 'validate') + { + $error=0; + + // on verifie si l'objet est en numerotation provisoire + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') + { + $numref = $object->getNextNumRef($soc); + if (empty($numref)) + { + $error++; + dol_htmloutput_errors($object->error); + } + } + else + { + $numref = $object->ref; + } + + $text=$langs->trans('ConfirmValidateProp',$numref); + if (! empty($conf->notification->enabled)) + { + require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; + $notify=new Notify($db); + $text.='
'; + $text.=$notify->confirmMessage('NOTIFY_VAL_PROPAL',$object->socid); + } + + if (! $error) $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate','',0,1); + } + + if (! $formconfirm) + { + $parameters=array('lineid'=>$lineid); + $formconfirm=$hookmanager->executeHooks('formConfirm',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + + // Print form confirm + print $formconfirm; + + + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Ref client + print ''; + print ''; + + // Company + print ''; + print ''; + + // Ligne info remises tiers + print ''; + + // Date of proposal + print ''; + print ''; + + // Date end proposal + print ''; + print ''; + print ''; + + // Payment term + print ''; + print ''; + + // Delivery date + $langs->load('deliveries'); + print ''; + print ''; + + // Delivery delay + print ''; + print ''; + + // Origin of demand + print ''; + print ''; + + // Payment mode + print ''; + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + print ''; + } + else + { + print '
'.$langs->trans('Ref').''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print '
'; + print ''; + if ($action != 'refclient' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Modify')).'
'; + print '
'; + if ($user->rights->propal->creer && $action == 'refclient') + { + print '
'; + print ''; + print ''; + print ''; + print ' '; + print '
'; + } + else + { + print $object->ref_client; + } + print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'.$langs->trans('Discounts').''; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + print '. '; + $absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL'); + $absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL'); + $absolute_discount=price2num($absolute_discount,'MT'); + $absolute_creditnote=price2num($absolute_creditnote,'MT'); + if ($absolute_discount) + { + if ($object->statut > 0) + { + print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->transnoentities("Currency".$conf->currency)); + } + else + { + // Remise dispo de type non avoir + $filter='fk_facture_source IS NULL'; + print '
'; + $form->form_remise_dispo($_SERVER["PHP_SELF"].'?id='.$object->id,0,'remise_id',$soc->id,$absolute_discount,$filter); + } + } + if ($absolute_creditnote) + { + print $langs->trans("CompanyHasCreditNote",price($absolute_creditnote),$langs->transnoentities("Currency".$conf->currency)).'. '; + } + if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount").'.'; + print '
'; + print ''; + if ($action != 'editdate' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('Date'); + print 'id.'">'.img_edit($langs->trans('SetDate'),1).'
'; + print '
'; + if (! empty($object->brouillon) && $action == 'editdate') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date,'re','','',0,"editdate"); + print ''; + print '
'; + } + else + { + if ($object->date) + { + print dol_print_date($object->date,'daytext'); + } + else + { + print ' '; + } + } + print '
'; + print ''; + if ($action != 'editecheance' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('DateEndPropal'); + print 'id.'">'.img_edit($langs->trans('SetConditions'),1).'
'; + print '
'; + if (! empty($object->brouillon) && $action == 'editecheance') + { + print '
'; + print ''; + print ''; + $form->select_date($object->fin_validite,'ech','','','',"editecheance"); + print ''; + print '
'; + } + else + { + if (! empty($object->fin_validite)) + { + print dol_print_date($object->fin_validite,'daytext'); + if ($object->statut == 1 && $object->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + } + else + { + print ' '; + } + } + print '
'; + print ''; + if ($action != 'editconditions' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('PaymentConditionsShort'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'),1).'
'; + print '
'; + if ($action == 'editconditions') + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'cond_reglement_id'); + } + else + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->cond_reglement_id,'none'); + } + print '
'; + print ''; + if ($action != 'editdate_livraison' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('DeliveryDate'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryDate'),1).'
'; + print '
'; + if ($action == 'editdate_livraison') + { + print '
'; + print ''; + print ''; + $form->select_date($object->date_livraison,'liv_','','','',"editdate_livraison"); + print ''; + print '
'; + } + else + { + print dol_print_date($object->date_livraison,'daytext'); + } + print '
'; + print ''; + if ($action != 'editavailability' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('AvailabilityPeriod'); + if (! empty($conf->commande->enabled)) print ' ('.$langs->trans('AfterOrder').')'; + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'),1).'
'; + print '
'; + if ($action == 'editavailability') + { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'availability_id',1); + } + else + { + $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id,$object->availability_id,'none',1); + } + + print '
'; + print ''; + if ($action != 'editdemandreason' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('Source'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'),1).'
'; + print '
'; + //print $object->demand_reason_id; + if ($action == 'editdemandreason') + { + $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'demand_reason_id',1); + } + else + { + $form->form_demand_reason($_SERVER['PHP_SELF'].'?id='.$object->id,$object->demand_reason_id,'none'); + } + + print '
'; + print ''; + if ($action != 'editmode' && ! empty($object->brouillon)) print ''; + print '
'; + print $langs->trans('PaymentMode'); + print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'),1).'
'; + print '
'; + if ($action == 'editmode') + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'mode_reglement_id'); + } + else + { + $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id,$object->mode_reglement_id,'none'); + } + print '
'; + print ''; + if ($user->rights->propal->creer) + { + if ($action != 'classify') print ''; + print '
'; + print $langs->trans('Project').''.img_edit($langs->transnoentitiesnoconv('SetProject')).'
'; + print '
'; + if ($action == 'classify') + { + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid'); + } + else + { + $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none'); + } + print '
'; + if (! empty($object->fk_project)) + { + print ''; + $proj = new Project($db); + $proj->fetch($object->fk_project); + print ''; + print $proj->ref; + print ''; + print ''; + } + else { + print ' '; + } + } + print ''; + } + + // Other attributes + $res=$object->fetch_optionals($object->id,$extralabels); + $parameters=array('colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + + if ($action == 'edit_extras') + { + print '
'; + print ''; + print ''; + print ''; + } + + + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + if ($extrafields->attribute_type[$key] == 'separate') + { + print $extrafields->showSeparator($key); + } + else + { + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print $extrafields->showInputField($key,$value); + } + else + { + print $extrafields->showOutputField($key,$value); + } + print ''."\n"; + } + } + + if(count($extrafields->attribute_label) > 0) { + + if ($action == 'edit_extras' && $user->rights->propal->creer) + { + print ''; + print ''; + print ''; + print ''; + + } + else { + if ($object->statut == 0 && $user->rights->propal->creer) + { + print ''.img_picto('','edit').' '.$langs->trans('Modify').''; + } + } + } + } + + // Amount HT + print ''.$langs->trans('AmountHT').''; + print ''.price($object->total_ht).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Margin Infos + if (! empty($conf->margin->enabled)) { + print ''; + $object->displayMarginInfos(); + print ''; + } + print ''; + + // Amount VAT + print ''.$langs->trans('AmountVAT').''; + print ''.price($object->total_tva).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Amount Local Taxes + if ($mysoc->localtax1_assuj=="1") //Localtax1 + { + print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; + print ''.price($object->total_localtax1).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 + { + print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; + print ''.price($object->total_localtax2).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + + + // Amount TTC + print ''.$langs->trans('AmountTTC').''; + print ''.price($object->total_ttc).''; + print ''.$langs->trans("Currency".$conf->currency).''; + + // Statut + print ''.$langs->trans('Status').''.$object->getLibStatut(4).''; + + print '
'; + + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) + { + $blocname = 'contacts'; + $title = $langs->trans('ContactsAddresses'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) + { + $blocname = 'notes'; + $title = $langs->trans('Notes'); + include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php'; + } + + /* + * Lines + */ + + if (! empty($conf->use_javascript_ajax) && $object->statut == 0) + { + include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; + } + + print ''; + + // Show object lines + $result = $object->getLinesArray(); + if (! empty($object->lines)) + $ret=$object->printObjectLines($action,$mysoc,$soc,$lineid); + + // Form to add new line + if ($object->statut == 0 && $user->rights->propal->creer) + { + if ($action != 'editline') + { + $var=true; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + // Add free or predefined products/services + $object->formAddObjectLine(0,$mysoc,$soc); + } + else + { + // Add free products/services + $object->formAddFreeProduct(0,$mysoc,$soc); + + // Add predefined products/services + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $var=!$var; + $object->formAddPredefinedProduct(0,$mysoc,$soc); + } + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } + } + + print '
'; + + print ''; + print "\n"; + + if ($action == 'statut') + { + /* + * Formulaire cloture (signe ou non) + */ + $form_close = '
'; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans("CloseAs").''; + $form_close.= ''; + $form_close.= ''; + $form_close.= '
'.$langs->trans('Note').'
'; + $form_close.= ''; + $form_close.= '   '; + $form_close.= ' '; + $form_close.= '
'; + + print $form_close; + } + + + /* + * Boutons Actions + */ + if ($action != 'presend') + { + print '
'; + + if ($action != 'statut' && $action <> 'editline') + { + // Validate + if ($object->statut == 0 && $object->total_ttc >= 0 && count($object->lines) > 0 && $user->rights->propal->valider) + { + if (count($object->lines) > 0) print ''.$langs->trans('Validate').''; + //else print ''.$langs->trans('Validate').''; + } + + // Edit + if ($object->statut == 1 && $user->rights->propal->creer) + { + print ''.$langs->trans('Modify').''; + } + + // ReOpen + if (($object->statut == 2 || $object->statut == 3) && $user->rights->propal->cloturer) + { + print 'global->MAIN_JUMP_TAG)?'':'#reopen').'"'; + print '>'.$langs->trans('ReOpen').''; + } + + // Send + if ($object->statut == 1 || $object->statut == 2) + { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->propal->propal_advance->send) + { + print ''.$langs->trans('SendByMail').''; + } + else print ''.$langs->trans('SendByMail').''; + } + + // Create an order + if (! empty($conf->commande->enabled) && $object->statut == 2 && $user->societe_id == 0) + { + if ($user->rights->commande->creer) + { + print ''.$langs->trans("AddOrder").''; + } + } + + // Create contract + if ($conf->contrat->enabled && $object->statut == 2 && $user->societe_id == 0) + { + $langs->load("contracts"); + + if ($user->rights->contrat->creer) + { + print ''.$langs->trans('AddContract').''; + } + } + + // Create an invoice and classify billed + if ($object->statut == 2 && $user->societe_id == 0) + { + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) + { + print ''.$langs->trans("AddBill").''; + } + + $arraypropal=$object->getInvoiceArrayList(); + if (is_array($arraypropal) && count($arraypropal) > 0) + { + print 'socid.'">'.$langs->trans("ClassifyBilled").''; + } + } + + // Close + if ($object->statut == 1 && $user->rights->propal->cloturer) + { + print 'global->MAIN_JUMP_TAG)?'':'#close').'"'; + print '>'.$langs->trans('Close').''; + } + + // Clone + if ($user->rights->propal->creer) + { + print ''.$langs->trans("ToClone").''; + } + + // Delete + if ($user->rights->propal->supprimer) + { + print ''.$langs->trans('Delete').''; + } + + } + + print '
'; + print "
\n"; + } + + if ($action != 'presend') + { + print '
'; + print ''; // ancre + + + /* + * Documents generes + */ + $filename=dol_sanitizeFileName($object->ref); + $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); + $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed=$user->rights->propal->creer; + $delallowed=$user->rights->propal->supprimer; + + $var=true; + + $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang); + + + /* + * Linked object block + */ + $somethingshown=$object->showLinkedObjectBlock(); + + print ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'propal',$socid); + + print '
'; + } + + + /* + * Action presend + * + */ + if ($action == 'presend') + { + $ref = dol_sanitizeFileName($object->ref); + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); + $file=$fileparams['fullname']; + + // Build document if it not exists + if (! $file || ! is_readable($file)) + { + // Define output language + $outputlangs = $langs; + $newlang=''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang; + if (! empty($newlang)) + { + $outputlangs = new Translate("",$conf); + $outputlangs->setDefaultLang($newlang); + } + + $result=propale_pdf_create($db, $object, GETPOST('model')?GETPOST('model'):$object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); + if ($result <= 0) + { + dol_print_error($db,$result); + exit; + } + $fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/')); + $file=$fileparams['fullname']; + } + + print '
'; + print_titre($langs->trans('SendPropalByMail')); + + // Create form object + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->fromtype = 'user'; + $formmail->fromid = $user->id; + $formmail->fromname = $user->getFullName($langs); + $formmail->frommail = $user->email; + $formmail->withfrom=1; + $liste=array(); + foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value; + $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste; + $formmail->withtocc=$liste; + $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); + $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); + $formmail->withfile=2; + $formmail->withbody=1; + $formmail->withdeliveryreceipt=1; + $formmail->withcancel=1; + + // Tableau des substitutions + $formmail->substit['__PROPREF__']=$object->ref; + $formmail->substit['__SIGNATURE__']=$user->signature; + $formmail->substit['__PERSONALIZED__']=''; + $formmail->substit['__CONTACTCIVNAME__']=''; + //Find the good contact adress $custcontact=''; $contactarr=array(); - $contactarr=$object->liste_contact(-1,'external'); - + $contactarr=$object->liste_contact(-1,'external'); + if (is_array($contactarr) && count($contactarr)>0) { foreach($contactarr as $contact) { if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) { @@ -2257,29 +2257,29 @@ else if (!empty($custcontact)) { $formmail->substit['__CONTACTCIVNAME__']=$custcontact; } - } - - // Tableau des parametres complementaires - $formmail->param['action']='send'; - $formmail->param['models']='propal_send'; - $formmail->param['id']=$object->id; - $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; - - - // Init list of files - if (GETPOST("mode")=='init') - { - $formmail->clear_attached_files(); - $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); - } - - $formmail->show_form(); - - print '
'; - } -} - -// End of page -llxFooter(); -$db->close(); -?> + } + + // Tableau des parametres complementaires + $formmail->param['action']='send'; + $formmail->param['models']='propal_send'; + $formmail->param['id']=$object->id; + $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + + + // Init list of files + if (GETPOST("mode")=='init') + { + $formmail->clear_attached_files(); + $formmail->add_attached_files($file,basename($file),dol_mimetype($file)); + } + + $formmail->show_form(); + + print '
'; + } +} + +// End of page +llxFooter(); +$db->close(); +?>