From d032280a961e61ec2d1b90ea7e095a11729a3af1 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Tue, 17 Apr 2018 16:03:12 +0200 Subject: [PATCH 01/43] NEW add any predefined mail content --- htdocs/core/class/html.formmail.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a370684b191..555ad503693 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2015-2017 Marcos García + * Copyright (C) 2015-2017 Nicolas ZABOURI * * 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 @@ -1110,7 +1111,8 @@ class FormMail extends Form elseif ($type_template=='fichinter_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendFichInter"); } elseif ($type_template=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); } elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); } - + elseif (!empty($type_template)) { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContent".ucfirst($type_template)); } + $ret->label = 'default'; $ret->lang = $outputlangs->defaultlang; $ret->topic = ''; From fd7bc2e6076ff5ffdb5fa62b8a17abb72adf4b57 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 18 Apr 2018 06:20:34 +0200 Subject: [PATCH 02/43] Accountancy - move to loadLangs --- htdocs/accountancy/admin/account.php | 7 +------ htdocs/accountancy/admin/accountmodel.php | 20 +++++++++---------- htdocs/accountancy/admin/card.php | 4 +--- htdocs/accountancy/admin/categories.php | 3 +-- htdocs/accountancy/admin/categories_list.php | 4 ++-- htdocs/accountancy/admin/defaultaccounts.php | 7 +------ htdocs/accountancy/admin/export.php | 6 +----- htdocs/accountancy/admin/fiscalyear.php | 3 +-- htdocs/accountancy/admin/fiscalyear_card.php | 3 +-- htdocs/accountancy/admin/fiscalyear_info.php | 3 +-- htdocs/accountancy/admin/importaccounts.php | 7 +------ htdocs/accountancy/admin/index.php | 5 +---- htdocs/accountancy/admin/journals_list.php | 6 ++---- htdocs/accountancy/admin/productaccount.php | 8 +------- htdocs/accountancy/bookkeeping/balance.php | 2 +- .../bookkeeping/balancebymonth.php | 8 +------- htdocs/accountancy/bookkeeping/list.php | 3 +-- .../accountancy/bookkeeping/listbyaccount.php | 3 +-- .../bookkeeping/thirdparty_lettrage.php | 3 ++- .../thirdparty_lettrage_supplier.php | 3 ++- .../class/accountingaccount.class.php | 2 +- .../class/accountingjournal.class.php | 2 +- .../accountancy/class/bookkeeping.class.php | 2 +- htdocs/accountancy/customer/card.php | 5 +---- htdocs/accountancy/customer/lines.php | 8 +------- htdocs/accountancy/customer/list.php | 9 +-------- htdocs/accountancy/expensereport/card.php | 6 +----- htdocs/accountancy/expensereport/lines.php | 10 +--------- htdocs/accountancy/expensereport/list.php | 10 +--------- htdocs/accountancy/index.php | 16 +-------------- htdocs/accountancy/supplier/card.php | 5 +---- htdocs/accountancy/supplier/lines.php | 9 +-------- htdocs/accountancy/supplier/list.php | 9 +-------- 33 files changed, 46 insertions(+), 155 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 58bbd09fdf2..ac45b3993a4 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -28,12 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); -$langs->load("salaries"); +$langs->loadLangs(array("compta","bills","admin","accountancy","salaries")); $mesg = ''; $action = GETPOST('action','aZ09'); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 9728a9524ea..a06d8a3f8d1 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -880,7 +880,7 @@ if ($id) $valuetoshow=price($valuetoshow); } else if ($fieldlist[$field]=='libelle_facture') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentCondition".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); $valuetoshow=nl2br($valuetoshow); @@ -890,7 +890,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { - $langs->load("propal"); + $langs->loadLangs(array("propal")); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -915,17 +915,17 @@ if ($id) $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { - $langs->load('agenda'); + $langs->loadLangs(array("agenda")); $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -934,12 +934,12 @@ if ($id) $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { - $langs->load("orders"); + $langs->loadLangs(array("orders")); $key=$langs->trans($obj->code); $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]}; } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { - $langs->load("sendings"); + $langs->loadLangs(array("sendings")); $key=$langs->trans("SendingMethod".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -950,7 +950,7 @@ if ($id) } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') { - $langs->load('trips'); + $langs->loadLangs(array("trips")); $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); } @@ -961,11 +961,11 @@ if ($id) $valuetoshow = $langs->getCurrencySymbol($obj->code,1); } else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); + $langs->loadLangs(array("products")); $valuetoshow=$langs->trans($obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); + $langs->loadLangs(array("products")); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); } else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 61166f88d07..669283077d9 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -31,9 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $error = 0; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $mesg = ''; $action = GETPOST('action','aZ09'); diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 69d09ae301b..1a287b3d039 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $error = 0; -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $mesg = ''; $id = GETPOST('id', 'int'); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index fb7561dda94..dedc55b3fd5 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -178,7 +178,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } if (! is_numeric(GETPOST('position','alpha'))) { - $langs->load("errors"); + $langs->loadLangs(array("errors")); $ok=0; setEventMessages($langs->transnoentities('ErrorFieldMustBeANumeric', $langs->transnoentities("Position")), null, 'errors'); } @@ -735,7 +735,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { - $langs->load("propal"); + $langs->loadLangs(array("propal")); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index c4b31c0f169..9d254338526 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -34,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); -$langs->load("salaries"); -$langs->load("loan"); +$langs->loadLangs(array("compta","bills","admin","accountancy","salaries","loan")); // Security check if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index dbe2a3b0c1c..6845491d003 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -28,15 +28,11 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","admin","accountancy")); // Security access if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 147c140bdd1..f3a6c9feb75 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -39,8 +39,7 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="f.rowid"; // Set here default search field if (! $sortorder) $sortorder="ASC"; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 78c6510469b..db323881bdc 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -26,8 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index baadbdc0828..f8f0bd5668e 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -26,8 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 93d41b3cbc6..acc679cffd8 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -24,16 +24,11 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("main"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","accountancy")); // Security check if (! $user->admin) diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 44c816530dd..64857fbfbb4 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -32,10 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","admin","accountancy")); // Security access if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index a7811a2d606..8aea0463fc3 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -30,9 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -$langs->load("admin"); -$langs->load("compta"); -$langs->load("accountancy"); +$langs->loadLangs(array("admin","compta","accountancy")); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); @@ -629,7 +627,7 @@ if ($id) $valuetoshow=$langs->trans('All'); } else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { - $langs->load("accountancy"); + $langs->loadLangs(array("accountancy")); $key=$langs->trans("AccountingJournalType".strtoupper($obj->nature)); $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]}); } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index f6552d3d1e1..44b9f078914 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; @@ -35,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; -// Langs -$langs->load("companies"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("products"); +$langs->loadLangs(array("companies","compta","accountancy","products")); // Security check if (empty($conf->accounting->enabled)) { diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index d27da1afbe9..d8a59a5ba43 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; // Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 1d746b4d4df..decf962c8d5 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -26,16 +26,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -// Langs -$langs->load("main"); -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","other","accountancy")); // Filter $year = GETPOST("year",'int'); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d3bf948aaf7..368cf406185 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $action = GETPOST('action', 'alpha'); $search_mvt_num = GETPOST('search_mvt_num', 'int'); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 15be2255830..499865233db 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -33,8 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php index 550ea1d933a..67d89bcda90 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php @@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +$langs->loadLangs(array("compta")); + $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -141,7 +143,6 @@ if ($object->check_codeclient() != 0) print ''; print ''; -$langs->load('compta'); print ''; print ''; print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php index 35bdcfa23fe..96317a3a740 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php @@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +$langs->loadLangs(array("compta")); + $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -157,7 +159,6 @@ if ($object->check_codefournisseur() != 0) print ''; print ''; -$langs->load('compta'); print ''; print ''; print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer); diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0b0d42b0075..d1870fabc38 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -566,7 +566,7 @@ class AccountingAccount extends CommonObject function LibStatut($statut,$mode=0) { global $langs; - $langs->load('users'); + $langs->loadLangs(array("users")); if ($mode == 0) { diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 2e48fc8a54a..454de6d7b84 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -256,7 +256,7 @@ class AccountingJournal extends CommonObject { global $langs; - $langs->load("accountancy"); + $langs->loadLangs(array("accountancy")); if ($mode == 0) { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6c82672f311..f7fed2e2b5b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -170,7 +170,7 @@ class BookKeeping extends CommonObject // Check parameters if (empty($this->numero_compte) || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined') { - $langs->load("errors"); + $langs->loadLangs(array("errors")); if (in_array($this->doc_type, array('bank', 'expense_report'))) { $this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type); diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 92d8f7b1c37..d0e5adc97fd 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -24,13 +24,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index e696b4774d1..c2a0f553f00 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -35,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("bills"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("bills","compta","accountancy","productbatch")); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4d9d7532d7e..f277dfff268 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; @@ -36,13 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","accountancy","productbatch")); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 3b59847d84d..59237fd13b2 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -28,14 +28,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); -$langs->load("trips"); +$langs->loadLangs(array("bills","accountancy","trips")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 28a44d23a5e..7ab29657172 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; @@ -34,14 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("trips"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","accountancy","trips","productbatch")); $account_parent = GETPOST('account_parent','int'); $changeaccount = GETPOST('changeaccount'); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 2a24aa2f656..6f8be4c2715 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; @@ -35,14 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("trips"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","trips","accountancy","productbatch")); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index cad9547ec4c..8de7209ef93 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -26,26 +26,12 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict")); // Security check if ($user->societe_id > 0) accessforbidden(); -$langs->load("admin"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("accountancy"); -$langs->load("compta"); -$langs->load("banks"); -$langs->load("loans"); - - /* * Actions */ diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f74165251f3..847181b79cb 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -28,13 +28,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 6ad8731a415..3f4ecffe588 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -35,13 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","accountancy","productbatch")); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index c19e1d2716c..51db676f552 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; @@ -36,13 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","accountancy","productbatch")); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); From eaecf7190a2d8a57c6d74f6f872f6fdc2459a8ba Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 Apr 2018 08:34:48 +0200 Subject: [PATCH 03/43] Fix: avoid Warning: A non-numeric value encountered + wrong var name --- htdocs/admin/defaultvalues.php | 10 +++++----- htdocs/admin/tools/dolibarr_export.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 790445f7032..5c17fd32eb0 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2017-2018 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 @@ -212,9 +212,9 @@ print "
\n"; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($optioncss != '') $param.='&optioncss='.$optioncss; -if (defaulturl) $param.='&defaulturl='.urlencode(defaulturl); -if (defaultkey) $param.='&defaultkey='.urlencode(defaultkey); -if (defaultvalue) $param.='&defaultvalue='.urlencode(defaultvalue); +if ($defaulturl) $param.='&defaulturl='.urlencode($defaulturl); +if ($defaultkey) $param.='&defaultkey='.urlencode($defaultkey); +if ($defaultvalue) $param.='&defaultvalue='.urlencode($defaultvalue); print '
entity) && $debug)?'?debug=1':'').'" method="POST">'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 7b2c8805f55..c876d7cfd9a 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2012 Regis Houssin +/* Copyright (C) 2006-2018 Laurent Destailleur + * Copyright (C) 2006-2018 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 @@ -36,7 +36,7 @@ $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="date"; -if ($page < 0) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; From 85c93c26a90eda3cd091c7043e6c5ff53a34ee26 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 Apr 2018 09:27:54 +0200 Subject: [PATCH 04/43] Fix: dolibarrize --- htdocs/core/class/html.formticketsup.class.php | 13 +++++++------ htdocs/ticketsup/list.php | 14 ++++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 7248e2b9a8e..120d4c218be 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -148,7 +148,8 @@ class FormTicketsup } print ''; - print '
'; + dol_fiche_head(''); + print ''; @@ -181,7 +182,7 @@ class FormTicketsup print ''; if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { $htmlname = 'socid'; @@ -436,7 +437,7 @@ class FormTicketsup $ticketstat->loadCacheTypesTickets(); - print ''; if ($empty) { print ''; } @@ -536,7 +537,7 @@ class FormTicketsup $ticketstat->loadCacheCategoriesTickets(); - print ''; if ($empty) { print ''; } @@ -605,7 +606,7 @@ class FormTicketsup print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } - print ajax_combobox('select'.$htmlname); + print ajax_combobox('select'.$htmlname,'',0,0,'off'); } /** @@ -637,7 +638,7 @@ class FormTicketsup $ticketstat->loadCacheSeveritiesTickets(); - print ''; if ($empty) { print ''; } diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index a5552d854b1..61dcf45ba83 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -1,6 +1,7 @@ - * Copyright (C) 2016 Christophe Battarel +/* Copyright (C) 2013-2018 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2018 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 @@ -580,12 +581,13 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) -{ - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object +if (! empty($extrafields->attributes[$object->table_element]['computed'])) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) + { + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + } } - // Loop on record // -------------------------------------------------------------------- $i=0; From d841abd55ade6792f00448abed6e2401dfdfa5e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 Apr 2018 09:37:29 +0200 Subject: [PATCH 05/43] Fix: missing value when reload --- htdocs/core/class/html.formticketsup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 120d4c218be..9cc9a09dbc6 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -299,7 +299,7 @@ class FormTicketsup // Notify thirdparty at creation print ''; // TITLE From d6680b982a8ca775b295fa4fd70aeb5e415a8c1e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 Apr 2018 09:42:29 +0200 Subject: [PATCH 06/43] Fix: file not physically removed --- htdocs/public/ticketsup/create_ticket.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index 8c8a0dd2f60..56c81a8a530 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -93,9 +93,7 @@ if (GETPOST('addfile') && !GETPOST('add_ticket')) { // Remove file if (GETPOST('removedfile') && !GETPOST('add_ticket')) { - ////$res = $object->fetch('',GETPOST('track_id')); - ////if($res > 0) - ////{ + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; // Set tmp directory @@ -103,9 +101,8 @@ if (GETPOST('removedfile') && !GETPOST('add_ticket')) { $upload_dir_tmp = $vardir . '/temp'; // TODO Delete only files that was uploaded from email form - dol_remove_file_process($_POST['removedfile'], 0); + dol_remove_file_process($_POST['removedfile'], 0, 0); $action = 'create_ticket'; - ////} } if ($action == 'create_ticket' && GETPOST('add_ticket')) { $error = 0; From ff76e60c49685c71d034f2739609bdb8d08e615c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 18 Apr 2018 10:13:20 +0200 Subject: [PATCH 07/43] Fix: some bugs and warnings --- htdocs/core/class/commonobject.class.php | 27 ++++++++++--------- .../core/class/html.formticketsup.class.php | 4 +-- htdocs/ticketsup/card.php | 11 +++++--- htdocs/ticketsup/class/ticketsup.class.php | 4 +-- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 70342919792..1b750e59503 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3923,23 +3923,26 @@ abstract class CommonObject $var = true; $i = 0; - foreach ($this->lines as $line) + if (! empty($this->lines)) { - if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + foreach ($this->lines as $line) { - if (empty($line->fk_parent_line)) + if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) { - $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); - $action=''; - $hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($line->fk_parent_line)) + { + $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); + $action=''; + $hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + } + } + else + { + $this->printOriginLine($line, $var, $restrictlist); } - } - else - { - $this->printOriginLine($line, $var, $restrictlist); - } - $i++; + $i++; + } } } diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 9cc9a09dbc6..a7f1b7a8d34 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -858,7 +858,7 @@ class FormTicketsup // Destinataires print ''; print ''; -// Show logo for module -print ''; -print ''; + print ''; + print ''; + print ''; } -print ''; -print ''; -print ''; // Show logo for company print ''; @@ -446,19 +455,22 @@ print ''; print ''; // Also send to main email address -print ''; -print ''; + print ''; + print ''; + print ''; } -print ''; -print ''; -print ''; // Limiter la vue des tickets à ceux assignés à l'utilisateur print ''; diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 7248e2b9a8e..732d495efb2 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -113,10 +113,10 @@ class FormTicketsup /** * Show the form to input ticket * - * @param string $width Width of form + * @param int $withdolfichehead With dol_fiche_head * @return void */ - public function showForm($width = '100%') + public function showForm($withdolfichehead=0) { global $conf, $langs, $user, $hookmanager; @@ -140,7 +140,9 @@ class FormTicketsup print "\n\n"; - print ''; + if ($withdolfichehead) dol_fiche_head(null, 'card', '', 0, ''); + + print ''; print ''; print ''; foreach ($this->param as $key => $value) { @@ -149,7 +151,7 @@ class FormTicketsup print ''; print '
'; - print '
' . $langs->trans("ThirdParty") . ''; $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events); + print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events, 0, 'minwidth200'); print '
'; - print 'withnotifytiersatcreate?' checked="checked"':'').'>'; + print 'withnotifytiersatcreate?' checked="checked"':'')).'>'; print '
' . $langs->trans("TicketsShowModuleLogo") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKETS_SHOW_MODULE_LOGO'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKETS_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKETS_SHOW_MODULE_LOGO); +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) +{ + // Show logo for module + print '
' . $langs->trans("TicketsShowModuleLogo") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKETS_SHOW_MODULE_LOGO'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKETS_SHOW_MODULE_LOGO", $arrval, $conf->global->TICKETS_SHOW_MODULE_LOGO); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); + print '
'; -print $form->textwithpicto('', $langs->trans("TicketsShowModuleLogoHelp"), 1, 'help'); -print '
' . $langs->trans("TicketsShowCompanyLogo") . '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS); +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) +{ + print '
' . $langs->trans("TicketsEmailAlsoSendToMainAddress") . ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS", $arrval, $conf->global->TICKETS_NOTIFICATION_ALSO_MAIN_ADDRESS); + } + print ''; + print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); + print '
'; -print $form->textwithpicto('', $langs->trans("TicketsEmailAlsoSendToMainAddressHelp"), 1, 'help'); -print '
' . $langs->trans("TicketsLimitViewAssignedOnly") . '
'; + print '
'; if ($this->withref) { @@ -394,6 +396,8 @@ class FormTicketsup print '
'; print '
'; + if ($withdolfichehead) dol_fiche_end(); + print '
'; print ''; diff --git a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php index 96be9ba9c74..d46738d4318 100644 --- a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php @@ -110,189 +110,205 @@ class InterfaceTicketEmail extends DolibarrTriggers case 'TICKET_ASSIGNED': dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); - if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id) { + if ($object->fk_user_assign > 0 && $object->fk_user_assign != $user->id) + { $userstat = new User($this->db); $res = $userstat->fetch($object->fk_user_assign); - if ($res) { - // Send email to assigned user - $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketAssignedToYou'); - $message = '

' . $langs->transnoentities('TicketAssignedEmailBody', $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname)) . "

"; - $message .= '
  • ' . $langs->trans('Title') . ' : ' . $object->subject . '
  • '; - $message .= '
  • ' . $langs->trans('Type') . ' : ' . $object->type_label . '
  • '; - $message .= '
  • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
  • '; - $message .= '
  • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
  • '; - // Extrafields - if (is_array($object->array_options) && count($object->array_options) > 0) { - foreach ($object->array_options as $key => $value) { - $message .= '
  • ' . $langs->trans($key) . ' : ' . $value . '
  • '; + if ($res > 0) + { + if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS)) + { + // Init to avoid errors + $filepath = array(); + $filename = array(); + $mimetype = array(); + + // Send email to assigned user + $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketAssignedToYou'); + $message = '

    ' . $langs->transnoentities('TicketAssignedEmailBody', $object->track_id, dolGetFirstLastname($user->firstname, $user->lastname)) . "

    "; + $message .= '
    • ' . $langs->trans('Title') . ' : ' . $object->subject . '
    • '; + $message .= '
    • ' . $langs->trans('Type') . ' : ' . $object->type_label . '
    • '; + $message .= '
    • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
    • '; + $message .= '
    • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
    • '; + // Extrafields + if (is_array($object->array_options) && count($object->array_options) > 0) { + foreach ($object->array_options as $key => $value) { + $message .= '
    • ' . $langs->trans($key) . ' : ' . $value . '
    • '; + } + } + + $message .= '
    '; + $message .= '

    ' . $langs->trans('Message') . ' :
    ' . $object->message . '

    '; + $message .= '

    ' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

    '; + + $sendto = $userstat->email; + $from = dolGetFirstLastname($user->firstname, $user->lastname) . '<' . $user->email . '>'; + + $message = dol_nl2br($message); + + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } - } - - $message .= '
'; - $message .= '

' . $langs->trans('Message') . ' :
' . $object->message . '

'; - $message .= '

' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

'; - - $sendto = $userstat->email; - $from = dolGetFirstLastname($user->firstname, $user->lastname) . '<' . $user->email . '>'; - - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); - - $message = dol_nl2br($message); - - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { - $result = $mailfile->sendfile(); - } - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } + include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1); + if ($mailfile->error) { + setEventMessage($mailfile->error, 'errors'); + } else { + $result = $mailfile->sendfile(); + } + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } + } $ok = 1; } + else + { + $this->error = $userstat->error; + $this->errors = $userstat->errors; + } } break; - case 'TICKET_CREATE': dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); - $langs->load('ticketsup'); - $object->fetch('', $object->track_id); + $object->fetch('', $object->track_id); // Should be useless + + + // Send email to notification email - /* Send email to admin */ $sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO; - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin'); - $message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n"; - $message_admin.='
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; - $message_admin.='
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; - $message_admin.='
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; - $message_admin.='
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; - $message_admin.='
  • '.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'
  • '; - // Extrafields - if (is_array($object->array_options) && count($object->array_options) > 0) { - foreach ($object->array_options as $key => $value) { - $message_admin.='
  • '.$langs->trans($key).' : '.$value.'
  • '; - } - } - $message_admin.='
'; - - if ($object->fk_soc > 0) { - $object->fetch_thirdparty(); - $message_admin.='

'.$langs->trans('Company'). ' : '.$object->thirdparty->name.'

'; - } - - $message_admin.='

'.$langs->trans('Message').' :
'.$object->message.'

'; - $message_admin.='

'.$langs->trans('SeeThisTicketIntomanagementInterface').'

'; - - $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>'; - $replyto = $from; - - $message_admin = dol_nl2br($message_admin); - - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - dol_syslog($mailfile->error, LOG_DEBUG); - } else { - $result=$mailfile->sendfile(); - } - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } - - /* Send email to customer */ - $sendto = ''; - if (empty($user->socid) && empty($user->email)) { - $object->fetch_thirdparty(); - $sendto = $object->thirdparty->email; - } else { - $sendto = $user->email; - } - - if ($sendto && $object->notify_tiers_at_create) { - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer'); - $message_customer= $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id)."\n\n"; - $message_customer.='
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; - $message_customer.='
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; - $message_customer.='
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; - $message_customer.='
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; + if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && $sendto) + { + // Init to avoid errors + $filepath = array(); + $filename = array(); + $mimetype = array(); + /* Send email to admin */ + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin'); + $message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n"; + $message_admin.='
    • '.$langs->trans('Title').' : '.$object->subject.'
    • '; + $message_admin.='
    • '.$langs->trans('Type').' : '.$object->type_label.'
    • '; + $message_admin.='
    • '.$langs->trans('Category').' : '.$object->category_label.'
    • '; + $message_admin.='
    • '.$langs->trans('Severity').' : '.$object->severity_label.'
    • '; + $message_admin.='
    • '.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'
    • '; // Extrafields - foreach ($this->attributes[$object->table_element]['label'] as $key => $value) - { - $enabled = 1; - if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) - { - $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); - } - $perms = 1; - if ($perms && isset($this->attributes[$object->table_element]['perms'][$key])) - { - $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); - } + if (is_array($object->array_options) && count($object->array_options) > 0) { + foreach ($object->array_options as $key => $value) { + $message_admin.='
    • '.$langs->trans($key).' : '.$value.'
    • '; + } + } + $message_admin.='
    '; - $qualified = true; - if (empty($enabled)) $qualified = false; - if (empty($perms)) $qualified = false; - - if ($qualified) $message_customer.='
  • '.$langs->trans($key).' : '.$value.'
  • '; + if ($object->fk_soc > 0) { + $object->fetch_thirdparty(); + $message_admin.='

    '.$langs->trans('Company'). ' : '.$object->thirdparty->name.'

    '; } - - $message_customer.='
'; - $message_customer.='

'.$langs->trans('Message').' :
'.$object->message.'

'; - $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/ticketsup/public/view.php', 2)).'?track_id='.$object->track_id; - $message_customer.='

' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : '.$url_public_ticket.'

'; - $message_customer.='

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; - + $message_admin.='

'.$langs->trans('Message').' :
'.$object->message.'

'; + $message_admin.='

'.$langs->trans('SeeThisTicketIntomanagementInterface').'

'; $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>'; $replyto = $from; - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); + $message_admin = dol_nl2br($message_admin); - $message_customer = dol_nl2br($message_customer); - - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; + } + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); if ($mailfile->error) { - dol_syslog($mailfile->error, LOG_DEBUG); + dol_syslog($mailfile->error, LOG_DEBUG); } else { - $result=$mailfile->sendfile(); + $result=$mailfile->sendfile(); } - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } - } - $ok = 1; + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } + } + // Send email to customer + + if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableemailtothirdparty']) && $object->notify_tiers_at_create) + { + $sendto = ''; + if (empty($user->socid) && empty($user->email)) { + $object->fetch_thirdparty(); + $sendto = $object->thirdparty->email; + } else { + $sendto = $user->email; + } + + if ($sendto) { + // Init to avoid errors + $filepath = array(); + $filename = array(); + $mimetype = array(); + + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer'); + $message_customer= $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id)."\n\n"; + $message_customer.='
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; + $message_customer.='
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; + $message_customer.='
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; + $message_customer.='
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; + + // Extrafields + foreach ($this->attributes[$object->table_element]['label'] as $key => $value) + { + $enabled = 1; + if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) + { + $enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1); + } + $perms = 1; + if ($perms && isset($this->attributes[$object->table_element]['perms'][$key])) + { + $perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1); + } + + $qualified = true; + if (empty($enabled)) $qualified = false; + if (empty($perms)) $qualified = false; + + if ($qualified) $message_customer.='
  • '.$langs->trans($key).' : '.$value.'
  • '; + } + + $message_customer.='
'; + $message_customer.='

'.$langs->trans('Message').' :
'.$object->message.'

'; + $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/ticketsup/public/view.php', 2)).'?track_id='.$object->track_id; + $message_customer.='

' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : '.$url_public_ticket.'

'; + $message_customer.='

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; + + $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>'; + $replyto = $from; + + $message_customer = dol_nl2br($message_customer); + + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; + } + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message_customer, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + if ($mailfile->error) { + dol_syslog($mailfile->error, LOG_DEBUG); + } else { + $result=$mailfile->sendfile(); + } + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } + } + } + $ok = 1; break; case 'TICKET_DELETE': diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index 8c8a0dd2f60..7dc6da87bcc 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -175,7 +175,10 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { if (!is_object($user)) { $user = new User($db); } - $id = $object->create($user, 1); // Disable trigger for email (send by this page) + + $object->context['disableemailtothirdparty']=1; // Disable email sent by ticketsup trigger when creation is done from this page + + $id = $object->create($user); if ($id <= 0) { $error++; $errors = ($object->error ? array($object->error) : $object->errors); diff --git a/htdocs/ticketsup/new.php b/htdocs/ticketsup/new.php index 0428f5286c2..9fe7411186a 100644 --- a/htdocs/ticketsup/new.php +++ b/htdocs/ticketsup/new.php @@ -88,7 +88,7 @@ if ($action == 'create_ticket') { $defaultref = ''; } - $formticket->showForm(); + $formticket->showForm(1); } //$somethingshown=$object->showLinkedObjectBlock(); From 0358e0f29f3aa049d17cd52004426743434f2169 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Apr 2018 15:11:26 +0200 Subject: [PATCH 26/43] Debug ticketsup --- .../core/class/html.formticketsup.class.php | 11 +- htdocs/core/lib/ticketsup.lib.php | 2 +- ...face_50_modTicketsup_TicketEmail.class.php | 108 ++++++------ htdocs/public/ticketsup/create_ticket.php | 161 ++++++++++-------- htdocs/public/ticketsup/index.php | 6 +- htdocs/public/ticketsup/list.php | 10 +- htdocs/public/ticketsup/view.php | 4 +- .../class/actions_ticketsup.class.php | 4 +- htdocs/ticketsup/class/ticketsup.class.php | 2 +- 9 files changed, 164 insertions(+), 144 deletions(-) diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 732d495efb2..9090fae90ca 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -272,7 +272,7 @@ class FormTicketsup dol_include_once('/' . $element . '/class/' . $subelement . '.class.php'); $classname = ucfirst($subelement); $objectsrc = new $classname($this->db); - $objectsrc->fetch(GETPOST('originid')); + $objectsrc->fetch(GETPOST('originid','int')); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { $objectsrc->fetch_lines(); @@ -299,9 +299,12 @@ class FormTicketsup print ''; // Notify thirdparty at creation - print ''; - print 'withnotifytiersatcreate?' checked="checked"':'').'>'; - print ''; + if (empty($this->ispublic)) + { + print ''; + print 'withnotifytiersatcreate?' checked="checked"':'').'>'; + print ''; + } // TITLE if ($this->withtitletopic) { diff --git a/htdocs/core/lib/ticketsup.lib.php b/htdocs/core/lib/ticketsup.lib.php index 040dad6c656..e377fb5e064 100644 --- a/htdocs/core/lib/ticketsup.lib.php +++ b/htdocs/core/lib/ticketsup.lib.php @@ -195,7 +195,7 @@ function showlogo() $urllogo = DOL_URL_ROOT . '/theme/dolibarr_logo.png'; } print '
'; - print 'Logo
'; + print 'Logo
'; print '' . ($conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC ? $conf->global->TICKETS_PUBLIC_INTERFACE_TOPIC : $langs->trans("TicketSystem")) . ''; print '

'; } diff --git a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php index d46738d4318..d27f0d6aa67 100644 --- a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php @@ -182,62 +182,66 @@ class InterfaceTicketEmail extends DolibarrTriggers // Send email to notification email - $sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO; - if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && $sendto) - { - // Init to avoid errors - $filepath = array(); - $filename = array(); - $mimetype = array(); + if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail'])) + { + $sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO; - /* Send email to admin */ - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin'); - $message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n"; - $message_admin.='
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; - $message_admin.='
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; - $message_admin.='
  • '.$langs->trans('Category').' : '.$object->category_label.'
  • '; - $message_admin.='
  • '.$langs->trans('Severity').' : '.$object->severity_label.'
  • '; - $message_admin.='
  • '.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'
  • '; - // Extrafields - if (is_array($object->array_options) && count($object->array_options) > 0) { - foreach ($object->array_options as $key => $value) { - $message_admin.='
  • '.$langs->trans($key).' : '.$value.'
  • '; + if ($sendto) + { + // Init to avoid errors + $filepath = array(); + $filename = array(); + $mimetype = array(); + + /* Send email to admin */ + $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin'); + $message_admin= $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id)."\n\n"; + $message_admin.='
    • '.$langs->trans('Title').' : '.$object->subject.'
    • '; + $message_admin.='
    • '.$langs->trans('Type').' : '.$object->type_label.'
    • '; + $message_admin.='
    • '.$langs->trans('Category').' : '.$object->category_label.'
    • '; + $message_admin.='
    • '.$langs->trans('Severity').' : '.$object->severity_label.'
    • '; + $message_admin.='
    • '.$langs->trans('From').' : '.( $object->email_from ? $object->email_from : ( $object->fk_user_create > 0 ? $langs->trans('Internal') : '') ).'
    • '; + // Extrafields + if (is_array($object->array_options) && count($object->array_options) > 0) { + foreach ($object->array_options as $key => $value) { + $message_admin.='
    • '.$langs->trans($key).' : '.$value.'
    • '; + } + } + $message_admin.='
    '; + + if ($object->fk_soc > 0) { + $object->fetch_thirdparty(); + $message_admin.='

    '.$langs->trans('Company'). ' : '.$object->thirdparty->name.'

    '; + } + + $message_admin.='

    '.$langs->trans('Message').' :
    '.$object->message.'

    '; + $message_admin.='

    '.$langs->trans('SeeThisTicketIntomanagementInterface').'

    '; + + $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>'; + $replyto = $from; + + $message_admin = dol_nl2br($message_admin); + + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } - } - $message_admin.='
'; - - if ($object->fk_soc > 0) { - $object->fetch_thirdparty(); - $message_admin.='

'.$langs->trans('Company'). ' : '.$object->thirdparty->name.'

'; - } - - $message_admin.='

'.$langs->trans('Message').' :
'.$object->message.'

'; - $message_admin.='

'.$langs->trans('SeeThisTicketIntomanagementInterface').'

'; - - $from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKETS_NOTIFICATION_EMAIL_FROM.'>'; - $replyto = $from; - - $message_admin = dol_nl2br($message_admin); - - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - dol_syslog($mailfile->error, LOG_DEBUG); - } else { - $result=$mailfile->sendfile(); - } - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } - } + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + if ($mailfile->error) { + dol_syslog($mailfile->error, LOG_DEBUG); + } else { + $result=$mailfile->sendfile(); + } + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } + } + } // Send email to customer - if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableemailtothirdparty']) && $object->notify_tiers_at_create) + if (empty($conf->global->TICKETS_DISABLE_ALL_MAILS) && empty($object->context['disableticketsupemail']) && $object->notify_tiers_at_create) { $sendto = ''; if (empty($user->socid) && empty($user->email)) { @@ -283,7 +287,7 @@ class InterfaceTicketEmail extends DolibarrTriggers $message_customer.=''; $message_customer.='

'.$langs->trans('Message').' :
'.$object->message.'

'; - $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/ticketsup/public/view.php', 2)).'?track_id='.$object->track_id; + $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE?$conf->global->TICKETS_URL_PUBLIC_INTERFACE.'/':dol_buildpath('/public/ticketsup/view.php', 2)).'?track_id='.$object->track_id; $message_customer.='

' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : '.$url_public_ticket.'

'; $message_customer.='

'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'

'; diff --git a/htdocs/public/ticketsup/create_ticket.php b/htdocs/public/ticketsup/create_ticket.php index 7dc6da87bcc..6ac1fa6c33a 100644 --- a/htdocs/public/ticketsup/create_ticket.php +++ b/htdocs/public/ticketsup/create_ticket.php @@ -17,9 +17,9 @@ */ /** - * Display public form to add new ticket - * - * \ingroup ticketsup + * \file htdocs/public/ticketsup/index.php + * \ingroup ticketsup + * \brief Display public form to add new ticket */ if (!defined('NOREQUIREUSER')) { define('NOREQUIREUSER', '1'); @@ -130,11 +130,11 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { } } - if (!GETPOST("subject")) { + if (!GETPOST("subject","none")) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject"))); $action = ''; - } elseif (!GETPOST("message")) { + } elseif (!GETPOST("message","none")) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("message"))); $action = ''; @@ -152,13 +152,13 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $object->track_id = generate_random_id(16); - $object->subject = GETPOST("subject"); - $object->message = GETPOST("message"); + $object->subject = GETPOST("subject","none"); + $object->message = GETPOST("message","none"); $object->origin_email = $origin_email; - $object->type_code = GETPOST("type_code"); - $object->category_code = GETPOST("category_code"); - $object->severity_code = GETPOST("severity_code"); + $object->type_code = GETPOST("type_code", 'az09'); + $object->category_code = GETPOST("category_code", 'az09'); + $object->severity_code = GETPOST("severity_code", 'az09'); if (is_array($searched_companies)) { $object->fk_soc = $searched_companies[0]->id; } @@ -176,7 +176,7 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $user = new User($db); } - $object->context['disableemailtothirdparty']=1; // Disable email sent by ticketsup trigger when creation is done from this page + $object->context['disableticketsupemail']=1; // Disable emails sent by ticketsup trigger when creation is done from this page, emails are already sent later $id = $object->create($user); if ($id <= 0) { @@ -190,9 +190,20 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { if ($usertoassign > 0) { $object->add_contact($usertoassign, "SUPPORTCLI", 'external', $notrigger = 0); } + } - $object->db->commit(); + if (! $error) + { + $object->db->commit(); + $action = "infos_success"; + } else { + $object->db->rollback(); + setEventMessage($object->errors, 'errors'); + $action = 'create_ticket'; + } + if (! $error) + { $res = $object->fetch($id); if ($res) { // Create form object @@ -211,18 +222,19 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $mimetype = $attachedfiles['mimes']; // Send email to customer + $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubject'); $message .= ($conf->global->TICKETS_MESSAGE_MAIL_NEW ? $conf->global->TICKETS_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')) . "\n\n"; $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket') . "\n"; - $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/ticketsup/public/view.php', 2)) . '?track_id=' . $object->track_id; + $url_public_ticket = ($conf->global->TICKETS_URL_PUBLIC_INTERFACE ? $conf->global->TICKETS_URL_PUBLIC_INTERFACE . '/' : dol_buildpath('/public/ticketsup/view.php', 2)) . '?track_id=' . $object->track_id; $infos_new_ticket = $langs->transnoentities('TicketNewEmailBodyInfosTrackId', '' . $object->track_id . '') . "\n"; $infos_new_ticket .= $langs->transnoentities('TicketNewEmailBodyInfosTrackUrl') . "\n\n"; $message .= dol_nl2br($infos_new_ticket); $message .= $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE ? $conf->global->TICKETS_MESSAGE_MAIL_SIGNATURE : $langs->transnoentities('TicketMessageMailSignatureText'); - $sendto = GETPOST('email'); + $sendto = GETPOST('email','alpha'); $from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>'; $replyto = $from; @@ -244,79 +256,80 @@ if ($action == 'create_ticket' && GETPOST('add_ticket')) { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } - /* Send email to admin */ + + // Send email to TICKETS_NOTIFICATION_EMAIL_TO + $sendto = $conf->global->TICKETS_NOTIFICATION_EMAIL_TO; - $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin'); - $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n"; - $message_admin .= '
  • ' . $langs->trans('Title') . ' : ' . $object->subject . '
  • '; - $message_admin .= '
  • ' . $langs->trans('Type') . ' : ' . $object->type_label . '
  • '; - $message_admin .= '
  • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
  • '; - $message_admin .= '
  • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
  • '; - $message_admin .= '
  • ' . $langs->trans('From') . ' : ' . $object->origin_email . '
  • '; - if (is_array($extrafields->attributes[$object->table_element]['label'])) + if ($sendto) { - foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) - { - $enabled = 1; - if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key])) - { - $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); - } - $perms = 1; - if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) - { - $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); - } + $subject = '[' . $conf->global->MAIN_INFO_SOCIETE_NOM . '] ' . $langs->transnoentities('TicketNewEmailSubjectAdmin'); + $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id) . "\n\n"; + $message_admin .= '
    • ' . $langs->trans('Title') . ' : ' . $object->subject . '
    • '; + $message_admin .= '
    • ' . $langs->trans('Type') . ' : ' . $object->type_label . '
    • '; + $message_admin .= '
    • ' . $langs->trans('Category') . ' : ' . $object->category_label . '
    • '; + $message_admin .= '
    • ' . $langs->trans('Severity') . ' : ' . $object->severity_label . '
    • '; + $message_admin .= '
    • ' . $langs->trans('From') . ' : ' . $object->origin_email . '
    • '; - $qualified=true; - if (empty($enabled) || $enabled == 2) $qualified = false; - if (empty($perms)) $qualified = false; - if ($qualified) $message_admin .= '
    • ' . $langs->trans($key) . ' : ' . $value . '
    • '; - } - } + if (is_array($extrafields->attributes[$object->table_element]['label'])) + { + foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val) + { + $enabled = 1; + if ($qualified && isset($extrafields->attributes[$object->table_element]['list'][$key])) + { + $enabled = dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); + } + $perms = 1; + if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) + { + $perms = dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); + } - $message_admin .= '
    '; - $message_admin .= '

    ' . $langs->trans('Message') . ' :
    ' . $object->message . '

    '; - $message_admin .= '

    ' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

    '; + $qualified=true; + if (empty($enabled) || $enabled == 2) $qualified = false; + if (empty($perms)) $qualified = false; + if ($qualified) $message_admin .= '
  • ' . $langs->trans($key) . ' : ' . $value . '
  • '; + } + } - $from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>'; - $replyto = $from; + $message_admin .= '
'; + $message_admin .= '

' . $langs->trans('Message') . ' :
' . $object->message . '

'; + $message_admin .= '

' . $langs->trans('SeeThisTicketIntomanagementInterface') . '

'; - $message_admin = dol_nl2br($message_admin); + $from = $conf->global->MAIN_INFO_SOCIETE_NOM . '<' . $conf->global->TICKETS_NOTIFICATION_EMAIL_FROM . '>'; + $replyto = $from; - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; - $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; - } - include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); - if ($mailfile->error) { - setEventMessage($mailfile->error, 'errors'); - } else { - $result = $mailfile->sendfile(); - } - if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { - $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; - } + $message_admin = dol_nl2br($message_admin); - // Copy files into ticket directory - $destdir = $conf->ticketsup->dir_output . '/' . $object->track_id; - if (!dol_is_dir($destdir)) { - dol_mkdir($destdir); - } - foreach ($filename as $i => $val) { - dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1); - $formmail->remove_attached_files($i); + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $old_MAIN_MAIL_AUTOCOPY_TO = $conf->global->MAIN_MAIL_AUTOCOPY_TO; + $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; + } + include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1); + if ($mailfile->error) { + setEventMessage($mailfile->error, 'errors'); + } else { + $result = $mailfile->sendfile(); + } + if (!empty($conf->global->TICKETS_DISABLE_MAIL_AUTOCOPY_TO)) { + $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; + } } } + // Copy files into ticket directory + $destdir = $conf->ticketsup->dir_output . '/' . $object->track_id; + if (! dol_is_dir($destdir)) { + dol_mkdir($destdir); + } + foreach ($filename as $i => $val) { + dol_move($filepath[$i], $destdir . '/' . $filename[$i], 0, 1); + $formmail->remove_attached_files($i); + } + setEventMessage($langs->trans('YourTicketSuccessfullySaved')); - $action = "infos_success"; - } else { - $object->db->rollback(); - setEventMessage($object->errors, 'errors'); - $action = 'create_ticket'; } } else { setEventMessage($object->errors, 'errors'); diff --git a/htdocs/public/ticketsup/index.php b/htdocs/public/ticketsup/index.php index 576eee32bc4..bbb0be1d471 100644 --- a/htdocs/public/ticketsup/index.php +++ b/htdocs/public/ticketsup/index.php @@ -16,9 +16,9 @@ */ /** - * \file ticketsup/public/index.php - * \ingroup ticketsup - * \brief Public file to add and manage ticket + * \file htdocs/public/ticketsup/index.php + * \ingroup ticketsup + * \brief Public file to add and manage ticket */ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); diff --git a/htdocs/public/ticketsup/list.php b/htdocs/public/ticketsup/list.php index 2b8f3d821d2..d0388841c7e 100644 --- a/htdocs/public/ticketsup/list.php +++ b/htdocs/public/ticketsup/list.php @@ -16,9 +16,9 @@ */ /** - * \file ticketsup/public/index.php - * \ingroup ticketsup - * \brief Public file to add and manage ticket + * \file htdocs/public/ticketsup/list.php + * \ingroup ticketsup + * \brief Public file to add and manage ticket */ if (!defined('NOCSRFCHECK')) { @@ -155,7 +155,7 @@ if ($action == "view_ticketlist") { $search_fk_user_assign = GETPOST("search_fk_user_assign", 'int'); // Store current page url - $url_page_current = dol_buildpath('/ticketsup/public/list.php', 1); + $url_page_current = dol_buildpath('/public/ticketsup/list.php', 1); // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) { @@ -635,7 +635,7 @@ if ($action == "view_ticketlist") { print ''; print ''; - print '