diff --git a/ChangeLog b/ChangeLog index 9e0b301edde..62f28b9bd6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,16 +13,17 @@ WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * Properties ->contactid has been renamed into ->contact_id -* Property $paiementid in API api_supplier_invoices has been renamed into into $payment_mode_id (english) +* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english) * The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in your email templates. * The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday. -* Property num_paiement has been renamed num_payment everywhere for better code consistency. -* If you build a class that implement CommonObject to use the incoterm properties or method (->fk_incoterm, ->label_incoterm, ->location_incoterm), - you must now also include declaration of the Trait CommonIncoterm in your class. All incoterm functions were moved into this Trait. -* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml'); - +* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency. +* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm), + you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait. +* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML. +* If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors. + ***** ChangeLog for 12.0.3 compared to 12.0.2 ***** FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename diff --git a/README.md b/README.md index 19a767c8232..648d5ef003d 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: -- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp) -- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian +- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_DoliWamp) +- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian) - DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia Releases can be downloaded from [official website](https://www.dolibarr.org/). @@ -77,8 +77,8 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate! - -- At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr + +- At first make a backup of your Dolibarr files & than [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr) - Check that your installed PHP version is supported by the new version [see PHP support](./doc/phpmatrix.md). - Overwrite all old files from 'dolibarr' directory with files provided into the new version's package. - At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process. diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index de8fd9a8cd6..0ac79bcc3aa 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -481,11 +481,11 @@ if ($resql) // Action print ''; if ($user->rights->accounting->chartofaccount) { - print ''; + print ''; print img_edit(); print ''; print ' '; - print ''; + print ''; print img_delete(); print ''; } diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index be3b49e41c1..d3bd17d95a5 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -669,11 +669,11 @@ if ($id) print ""; // Modify link - if ($canbemodified) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; else print ' '; // Delete link - if ($iserasable) print ''.img_delete().''; + if ($iserasable) print ''.img_delete().''; else print ' '; print "\n"; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 4ad131f5170..29ed90bb7be 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -372,13 +372,13 @@ if ($action == 'create') { print '
'; if (!empty($user->rights->accounting->chartofaccount)) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } else { print ''.$langs->trans('Modify').''; } if (!empty($user->rights->accounting->chartofaccount)) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 909d633c487..d605105f8e9 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -170,7 +170,7 @@ if ($action == 'display' || $action == 'delete') { print ''.length_accountg($cpt->account_number).''; print ''.$cpt->label.''; print ''; - print "rowid."'>"; + print ''; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink'); print ""; diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 84ea304a74d..3d03dc9c4b6 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -101,22 +101,6 @@ if ($conf->societe->enabled) { /* * Actions */ - -$accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE; - -if (GETPOST('change_chart', 'alpha')) -{ - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - - if (!empty($chartofaccounts)) { - if (!dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { - $error++; - } - } else { - $error++; - } -} - if ($action == 'update') { $error = 0; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 27ef1ea7bd1..a122d3acab5 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -305,9 +305,9 @@ if ($action == 'create') */ print '
'; - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; - // print '' . $langs->trans('Delete') . ''; + // print '' . $langs->trans('Delete') . ''; print '
'; } diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index e5c104298bf..516af988334 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -237,11 +237,11 @@ print "\n"; print ''; print ''.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").''; if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -251,11 +251,11 @@ print ''; print ''; print ''.$langs->trans("BANK_DISABLE_DIRECT_INPUT").''; if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -264,11 +264,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX").''; if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -277,11 +277,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_MANAGE_ZERO").''; if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -317,11 +317,11 @@ print "\n"; print ''; print ''.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").''; if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -330,11 +330,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").''; if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -366,11 +366,11 @@ foreach ($list_binding as $key) print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -379,11 +379,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -392,11 +392,11 @@ print ''; print ''; print ''.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").''; if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index a09a38c959c..e48ee43ef8d 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -22,6 +22,8 @@ * \brief Setup page to configure journals */ +if (!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -636,19 +638,19 @@ if ($id) // Active print ''; - if ($canbedisabled) print ''.$actl[$obj->active].''; + if ($canbedisabled) print ''.$actl[$obj->active].''; else print $langs->trans("AlwaysActive"); print ""; // Modify link - if ($canbemodified) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; else print ' '; // Delete link if ($iserasable) { print ''; - if ($user->admin) print ''.img_delete().''; + if ($user->admin) print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ''; } else print ' '; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 3e3fb104e70..d88800016a8 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -57,6 +57,7 @@ $changeaccount_sell = GETPOST('changeaccount_sell', 'array'); $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); $search_desc = GETPOST('search_desc', 'alpha'); +$search_vat = GETPOST('search_vat', 'alpha'); $search_current_account = GETPOST('search_current_account', 'alpha'); $search_current_account_valid = GETPOST('search_current_account_valid', 'alpha'); if ($search_current_account_valid == '') $search_current_account_valid = 'withoutvalidaccount'; @@ -102,6 +103,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_ref = ''; $search_label = ''; $search_desc = ''; + $search_vat = ''; $search_onsell = ''; $search_onpurchase = ''; $search_current_account = ''; @@ -136,7 +138,7 @@ if ($action == 'update') { if (!empty($chk_prod)) { $accounting = new AccountingAccount($db); - //$msg .= '
' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '
'; + //$msg .= '
' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '
'; $arrayofdifferentselectedvalues = array(); $cpt = 0; $ok = 0; $ko = 0; @@ -243,7 +245,7 @@ $pcgverid = $conf->global->CHARTOFACCOUNTS; $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); if (empty($pcgvercode)) $pcgvercode = $pcgverid; -$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy,"; +$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.tva_tx,"; $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,"; $sql .= " p.tms, p.fk_product_type as product_type,"; @@ -311,6 +313,9 @@ if (strlen(trim($search_label))) { if (strlen(trim($search_desc))) { $sql .= natural_search("p.description", $search_desc); } +if (strlen(trim($search_vat))) { + $sql .= natural_search("p.tva_tx", price2num($search_vat), 1); +} if ($search_onsell != '' && $search_onsell != '-1') $sql .= natural_search('p.tosell', $search_onsell, 1); if ($search_onpurchase != '' && $search_onpurchase != '-1') $sql .= natural_search('p.tobuy', $search_onpurchase, 1); @@ -343,6 +348,7 @@ if ($result) if ($search_ref > 0) $param .= "&search_desc=".urlencode($search_ref); if ($search_label > 0) $param .= "&search_desc=".urlencode($search_label); if ($search_desc > 0) $param .= "&search_desc=".urlencode($search_desc); + if ($search_vat > 0) $param .= '&search_vat='.urlencode($search_vat); if ($search_current_account > 0) $param .= "&search_current_account=".urlencode($search_current_account); if ($search_current_account_valid && $search_current_account_valid != '-1') $param .= "&search_current_account_valid=".urlencode($search_current_account_valid); if ($accounting_product_mode) $param .= '&accounting_product_mode='.urlencode($accounting_product_mode); @@ -411,6 +417,8 @@ if ($result) print ''; print ''; print ''; + print ''; + if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print ''; // On sell if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') { @@ -437,7 +445,8 @@ if ($result) print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder); - // On sell / On purchase + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "p.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + // On sell / On purchase if ($accounting_product_mode == 'ACCOUNTANCY_SELL') { print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center '); $fieldtosortaccount = "p.accountancy_code_sell"; @@ -553,11 +562,16 @@ if ($result) { // TODO ADJUST DESCRIPTION SIZE // print '' . $obj->description . ''; - // TODO: we shoul set a user defined value to adjust user square / wide screen size - $trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; - print ''.nl2br(dol_trunc($obj->description, $trunclengh)).''; + // TODO: we should set a user defined value to adjust user square / wide screen size + $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION; + print ''.nl2br(dol_trunc($obj->description, $trunclength)).''; } + // VAT + print ''; + print vatrate($obj->tva_tx); + print ''; + if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') print ''.$product_static->getLibStatut(3, 0).''; @@ -602,7 +616,7 @@ if ($result) // Accounting account buy intra (In EEC) print ''; //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code - if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy_intra; + if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy; $codesell = length_accountg($obj->accountancy_code_buy_intra); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid @@ -612,7 +626,7 @@ if ($result) // Accounting account buy export (Out of EEC) print ''; //$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code - if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy_export; + if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy; $codesell = length_accountg($obj->accountancy_code_buy_export); //var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell); if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 5ae9c3d4742..813dbd4a37f 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -630,9 +630,9 @@ else $buttonLabel = $langs->trans("ExportList"); // Button re-export if (!empty($conf->global->ACCOUNTING_REEXPORT)) { - $newcardbutton = ''.img_picto($langs->trans("Activated"), 'switch_on').' '; + $newcardbutton = ''.img_picto($langs->trans("Activated"), 'switch_on').' '; } else { - $newcardbutton = ''.img_picto($langs->trans("Disabled"), 'switch_off').' '; + $newcardbutton = ''.img_picto($langs->trans("Disabled"), 'switch_off').' '; } $newcardbutton .= ''.$langs->trans("IncludeDocsAlreadyExported").''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 4dd5df83152..7062c25b108 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -180,10 +180,10 @@ if ($result) { $account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word $account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word $account_employee = (!empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word - $account_pay_vat = (!empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word - $account_pay_donation = (!empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word - $account_pay_subscription = (!empty($conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT) ? $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word - $account_transfer = (!empty($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) ? $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH : 'NotDefined'); // NotDefined is a reserved word + $account_pay_vat = (!empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word + $account_pay_donation = (!empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word + $account_pay_subscription = (!empty($conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT) ? $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word + $account_transfer = (!empty($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) ? $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH : 'NotDefined'); // NotDefined is a reserved word $tabcompany = array(); $tabuser = array(); @@ -237,7 +237,7 @@ if ($result) { ); // Set accountancy code for user - $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee); + $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : ''); $tabuser[$obj->rowid] = array( 'id' => $obj->userid, diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 64f16f8ef57..d030c73f530 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -137,12 +137,12 @@ print ''.$langs->trans("BlankSubscriptionFormDesc"). $enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' '; if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 0a32398f307..d0a67153209 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1694,7 +1694,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Delete if ($user->rights->adherent->supprimer) { - print '\n"; + print '\n"; } else { print '
'.$langs->trans("Delete")."
"; } diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 3fad8c9db14..a79355de768 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -345,7 +345,7 @@ if ($rowid && $action != 'edit') { if ($user->rights->adherent->cotisation->creer) { if (!$bankline->rappro) { - print '"; + print '"; } else { print '"; } @@ -353,7 +353,7 @@ if ($rowid && $action != 'edit') { // Delete if ($user->rights->adherent->cotisation->creer) { - print '\n"; + print '\n"; } print '
'; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 853e22bfbc9..ecd709bdd17 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -455,7 +455,7 @@ if ($rowid > 0) { // Delete if ($user->rights->adherent->configurer) { - print '
'.$langs->trans("DeleteType").'
'; + print '
'.$langs->trans("DeleteType").'
'; } print ""; diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index dcd4a7aa981..10c43dadbe3 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -201,7 +201,7 @@ if ($action == 'edit') { if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $s = picto_from_langcode($key); - print "
".($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"')."
"; + print '
'.($s ? $s.' ' : '').' '.$langs->trans('Language_'.$key).': '.img_delete('', 'class="valigntextbottom"')."
"; print '
'; print ''; @@ -228,7 +228,7 @@ if ($action == 'edit') { if (!empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $s = picto_from_langcode($key); - print ($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; + print ($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; print '
'; print '
'; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index cd7e1752274..48368af45f2 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -268,7 +268,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print ""; } else { print '
"; } @@ -278,7 +278,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -325,9 +325,9 @@ print ''."\n"; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 982387b2ed6..e4b3c59781c 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -189,10 +189,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2) print ''."\n"; } else { - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; print ''."\n"; } } @@ -206,10 +206,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2) print ''."\n"; } else { - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; print ''."\n"; print ''."\n"; @@ -218,9 +218,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2) print ''."\n"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 6f669d900ba..772ef604ab5 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -258,7 +258,7 @@ while ($i < $nbofbank) { print img_picto($langs->trans("Activated"), 'on'); print ''; } else { - print ''; } @@ -350,13 +350,13 @@ foreach ($dirmodels as $reldir) { // Active if (in_array($name, $def)) { print ''; } else { print '"; } @@ -365,7 +365,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->BANKADDON_PDF == $name) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -424,13 +424,13 @@ print ""; // Active if ($conf->global->BANK_COLORIZE_MOVEMENT) { print ''; } else { print '"; } @@ -483,7 +483,7 @@ print ''; // Active if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { print ''; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index cddb91d0d49..529e3289a31 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -396,11 +396,11 @@ if ($conf->product->enabled) if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { - print ''; } else { - print ''; } diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 50c919a628a..3f331286aa2 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -242,7 +242,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -370,13 +370,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''; } else { print '"; } @@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 2dbcfe00015..31723888e44 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -429,7 +429,7 @@ foreach ($boxactivated as $key => $box) print ($hasprevious ? ''.img_up().'' : ''); print ''; print ''; print ''."\n"; diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 096ffbe02c8..6de752518c0 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -178,7 +178,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 288eac6de92..b920d9e6f9e 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -307,7 +307,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -441,7 +441,7 @@ foreach ($dirmodels as $reldir) print ''; } else { print '"; } @@ -451,7 +451,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -670,10 +670,10 @@ print ''; print ''; print ''; @@ -695,11 +695,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; @@ -725,11 +725,11 @@ if ($conf->stock->enabled) { if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 5a525cbe9ad..4aacdb3cfc2 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -299,7 +299,7 @@ if ($result) { print ''; } else { - print ''.img_delete().''; + print ''.img_delete().''; } print "\n"; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 971596d1c06..e8440963f9f 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -238,7 +238,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -371,7 +371,7 @@ foreach ($dirmodels as $reldir) print ''; } else { print '"; } @@ -381,7 +381,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index f4e33bb7259..17fa15af382 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -190,12 +190,12 @@ $enabledisablehtml .= $langs->trans("EnableDefaultValues").' '; if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } @@ -378,9 +378,9 @@ if ($result) print '"; // Modify link - if ($canbemodified) print ''; + if ($canbemodified) print ''; else print ''; // Delete link if ($iserasable) { print ''; } else print ''; diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 145dfc6cbf8..76bf86993e2 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -92,10 +92,10 @@ if ($conf->use_javascript_ajax) } else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } elseif (!empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 9d5dcbc32e3..eb9ffb52831 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -496,6 +496,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 'X3'=>'---', 'withtrackingid'=>array('label'=>'WithDolTrackingID', 'data-noparam'=>1), 'withouttrackingid'=>array('label'=>'WithoutDolTrackingID', 'data-noparam'=>1), + 'withtrackingidinmsgid'=>array('label'=>'WithDolTrackingIDInMsgId', 'data-noparam'=>1), + 'withouttrackingidinmsgid'=>array('label'=>'WithoutDolTrackingIDInMsgId', 'data-noparam'=>1), 'X4'=>'---', 'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1), 'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1) @@ -538,7 +540,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; print ''; print ''; } @@ -630,7 +632,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete print ''; print ''; $i++; @@ -677,7 +679,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'.$langs->trans("CollectNow").'
'; } - print '
'.$langs->trans('Delete').'
'; + print '
'.$langs->trans('Delete').'
'; } print ''."\n"; } diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index cf01d287d23..56f4f5a9be2 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -245,7 +245,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -379,7 +379,7 @@ foreach ($dirmodels as $reldir) print ''; } else { print '"; } @@ -389,7 +389,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 13b1b0277a6..3ac71cfa6b0 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -248,7 +248,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -371,13 +371,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print '"; } else { print '"; } @@ -387,7 +387,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 3ff8ad0c4ce..f55e78d4105 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -166,8 +166,8 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) echo ''; echo ''; } else { - echo ''.img_edit().''; - if (!empty($range->ik->id)) echo ''.img_delete().''; + echo ''.img_edit().''; + if (!empty($range->ik->id)) echo ''.img_delete().''; // TODO add delete link } } diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 6d08355b815..e0012139154 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -305,8 +305,8 @@ foreach ($rules as $rule) echo ''; @@ -500,13 +500,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''; } else { print '"; } @@ -516,7 +516,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index df97e9875a0..5199165d4f4 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -301,7 +301,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -425,13 +425,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ""; } else { print ""; } @@ -441,7 +441,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index bac8e99e70f..23a0cec8130 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -238,7 +238,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir) print ''; } else { print '"; } @@ -394,7 +394,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 4073b0a59a9..f3477e151a2 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -241,7 +241,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -366,13 +366,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ""; } else { print ""; } @@ -382,7 +382,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index cbc908f973f..d9d3ae8142d 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -156,7 +156,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) dol_fiche_head($head, 'mailman', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; - $link = ''; + $link = ''; //$link.=$langs->trans("Disable"); $link .= img_picto($langs->trans("Activated"), 'switch_on'); $link .= ''; @@ -206,7 +206,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) } else { dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); - $link = ''; + $link = ''; //$link.=img_$langs->trans("Activate") $link .= img_picto($langs->trans("Disabled"), 'switch_off'); $link .= ''; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index feca9bf582e..8971f5a69d4 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -773,11 +773,17 @@ if ($action == 'edit') if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') { - // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'. - if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) + if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) { - // List of IP show as record to add in SPF if we use the mail method - $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS); + // List of string to add in SPF if the setup use the mail method + $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD); + } else { + // MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'. + if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) + { + // List of IP show as record to add in SPF if we use the mail method + $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS); + } } } else { if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) @@ -785,7 +791,7 @@ if ($action == 'edit') // List of IP show as record to add as allowed IP if we use the smtp method $text .= ($text ? '

' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS); } - if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) + if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) // Should be required only if you have set to use your own SMTP and wat to warn users to update their domain name to match your SMTP server. { // List of string to add in SPF if we use the smtp method $text .= ($text ? '

' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 9a1a696e034..16ae12ffcc5 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -587,7 +587,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) if ($sortorder) $url .= '&page='.urlencode($sortorder); print ''.img_edit().''; //print '   '; - print ''.img_delete().'   '; + print ''.img_delete().'   '; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected = 0; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 610dd9c1ef2..7c79505158a 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -889,10 +889,10 @@ if ($resql) // Modify link / Delete link print ''; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 101e57970c0..b7b0060c778 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -320,20 +320,20 @@ if ($conf->use_javascript_ajax) $titre = $langs->trans($menu['titre']); $entry = '
'."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print '
'."\n"; if (empty($conf->global->AGENDA_REMINDER_EMAIL)) { - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; print '
'."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER)) { - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; print '
'."\n"; if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) { - print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; + print ''.img_picto($langs->trans('Disabled'), 'switch_off').''; } else { - print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; + print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; } print '
'; + print ''; print img_picto($langs->trans("Disabled"), 'off'); print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; - print ''.img_delete().''; + print ''.img_delete().''; print '
'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'.$langs->trans("ShippableOrderIconInList").' '; if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"),'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"),'switch_off'); } print '
'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($action != 'edit' || GETPOST('rowid') != $obj->rowid) { - print ''.img_edit().''; + print ''.img_edit().''; print '   '; - print ''.img_delete().''; + print ''.img_delete().''; } else { print ''; print ''; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index b6d5df3644a..1ac1e0f4ad4 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1671,14 +1671,14 @@ if ($id) print "'.img_edit().''.img_edit().' '; - if ($user->admin) print ''.img_delete().''; + if ($user->admin) print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ' 
'.$rulefilter['rulevalue'].''; - print ' '.img_delete().''; + print ' '.img_delete().''; print '
'; print ''.img_edit().''; - print ' '.img_delete().''; + print ' '.img_delete().''; print '
'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($object->id != $rule->id) { - echo ''.img_edit().' '; - echo ''.img_delete().''; + echo ''.img_edit().' '; + echo ''.img_delete().''; } else { echo ' '; echo ''.$langs->trans('Cancel').''; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index fe84cf12478..0c12f11b4a3 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -324,7 +324,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; - if ($canbemodified) print ''.img_edit().''; + if ($canbemodified) print ''.img_edit().''; if ($iserasable) { - print ''.img_delete().''; + print ''.img_delete().''; //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin } print '
'; - $entry .= '   '.$titre.''; + $entry .= '   '.$titre.''; $entry .= ''; - $entry .= ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; - $entry .= ''.img_edit_add('default').' '; - $entry .= ''.img_delete('default').' '; + $entry .= ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; + $entry .= ''.img_edit_add('default').' '; + $entry .= ''.img_delete('default').' '; $entry .= '     '; - $entry .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; + $entry .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; $entry .= '
'; - $buttons = ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; - $buttons .= ''.img_edit_add('default').' '; - $buttons .= ''.img_delete('default').' '; + $buttons = ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; + $buttons .= ''.img_edit_add('default').' '; + $buttons .= ''.img_delete('default').' '; $buttons .= '     '; - $buttons .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; + $buttons .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; $data[] = array( 'rowid'=>$menu['rowid'], diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 38cfe37265b..c61e352aad8 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -797,7 +797,7 @@ if ($mode == 'common' || $mode == 'commonkanban') } } $codeenabledisable .= ''."\n"; - $codeenabledisable .= 'trans("Disabled"), 'switch_off'); diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 10e992c7ac2..863633176bd 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -243,7 +243,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -371,13 +371,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -387,7 +387,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 0f12da3a02a..2d843a52577 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -148,7 +148,7 @@ if ($mode == 'setup' && $user->admin) // We pass this param list in to 'state' because we need it before and after the redirect. $shortscope = 'user,public_repo'; $urltorenew = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltodelete = $urlwithroot.'/core/modules/oauth/github_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://github.com/settings/applications/'; } elseif ($key[0] == 'OAUTH_GOOGLE_NAME') { @@ -161,7 +161,7 @@ if ($mode == 'setup' && $user->admin) } //$scope.=',gmail_full'; $urltorenew = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?shortscope='.$shortscope.'&state='.$shortscope.'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); - $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); + $urltodelete = $urlwithroot.'/core/modules/oauth/google_oauthcallback.php?action=delete&token='.newToken().'&backtourl='.urlencode(DOL_URL_ROOT.'/admin/oauthlogintokens.php'); $urltocheckperms = 'https://security.google.com/settings/security/permissions'; } elseif ($key[0] == 'OAUTH_STRIPE_TEST_NAME') { diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 926c102c25a..92b5c9511d5 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -182,7 +182,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 4056ce238e3..718e64e6446 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -299,7 +299,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -311,7 +311,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -465,7 +465,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).''; $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); print ''.$label.''; - print 'rowid.'">'.img_delete().''; + print 'rowid.'">'.img_delete().''; print ''; $i++; } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 95487fc0bc3..363edca6c80 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -89,18 +89,6 @@ 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; -} elseif ($action == 'disable_pdfsecurity') -{ - dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION", $conf->entity); - header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); - exit; -} - /* diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 24d4a379f83..50d01924364 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir) else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; print ""; } @@ -318,7 +318,7 @@ foreach ($dirmodels as $reldir) } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; } print ''; @@ -472,7 +472,7 @@ if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) print ''.dolGetFirstLastname($obj->firstname,$obj->lastname).''; $label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label); print ''.$label.''; - print 'rowid.'">'.img_delete().''; + print 'rowid.'">'.img_delete().''; print ''; $i++; } diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 843cf0cfd55..3b574956cd0 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -395,13 +395,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -661,11 +661,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 9b3563edd63..92b9ffbd8b4 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -340,11 +340,11 @@ if ($mode == 'config' && $user->admin) { print img_picto($langs->trans("Edit"), 'edit'); print ''; // delete icon - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; // test icon - print ''; + print ''; print img_picto($langs->trans("TestPrinter"), 'printer'); print ''; print ''; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 60833669753..f84d9a3a7f9 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -250,7 +250,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -379,13 +379,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -395,7 +395,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index aa23a24c526..f25cdf25958 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -265,7 +265,7 @@ foreach ($arrayhandler as $key => $module) { print img_picto('', 'tick'); } else { - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; } print "\n"; } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 686c0ddc21c..4eb6af14843 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -115,9 +115,9 @@ if (function_exists("imagecreatefrompng")) } else { if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } } else { @@ -136,9 +136,9 @@ if (!empty($conf->use_javascript_ajax)) } else { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ""; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index 34c83dbd434..ca44caac258 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -129,7 +129,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) dol_fiche_head($head, 'spip', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; - $link = ''; + $link = ''; //$link.=$langs->trans("Disable"); $link .= img_picto($langs->trans("Activated"), 'switch_on'); $link .= ''; @@ -154,7 +154,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) } else { dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); - $link = ''; + $link = ''; //$link.=$langs->trans("Activate"); $link .= img_picto($langs->trans("Disabled"), 'switch_off'); $link .= ''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 6983c228007..20b1252456e 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -594,13 +594,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -610,7 +610,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index 9b618fa3d31..c4f2e48ff4a 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -261,7 +261,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -395,7 +395,7 @@ foreach ($dirmodels as $reldir) print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -405,9 +405,9 @@ foreach ($dirmodels as $reldir) { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index c7026ca7327..9afa2bb2d1f 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -410,7 +410,7 @@ foreach ($dirmodels as $reldir) print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -493,11 +493,11 @@ if ($conf->banque->enabled) { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } print ''; diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 5541b8ff895..003c0247f20 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -267,7 +267,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -382,7 +382,7 @@ foreach ($dirmodels as $reldir) print ""; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -392,9 +392,9 @@ foreach ($dirmodels as $reldir) { //print img_picto($langs->trans("Default"),'on'); // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; } else { - print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index f2110687042..7bf34fa669a 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -261,7 +261,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -388,13 +388,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -404,7 +404,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -516,9 +516,9 @@ if ($conf->banque->enabled) } else { if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } } print ''; diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 4dd8a6fa5c1..b30dd9c5f13 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -253,7 +253,7 @@ foreach ($dirmodels as $reldir) { if ($conf->global->TICKET_ADDON == 'mod_'.$classname) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 02e6e6916ee..011de9422bf 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -182,12 +182,12 @@ $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 9259ac420b7..560530c9161 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -197,12 +197,12 @@ $enabledisablehtml .= $langs->trans("EnableOverwriteTranslation").' '; if (empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } @@ -350,7 +350,7 @@ if ($mode == 'overwrite') } else { print ''.img_edit().''; print '   '; - print ''.img_delete().''; + print ''.img_delete().''; } print ''; @@ -514,7 +514,7 @@ if ($mode == 'searchkey') } print ''.img_edit().''; print ' '; - print ''.img_delete().''; + print ''.img_delete().''; print '  '; $htmltext = $langs->trans("OriginalValueWas", ''.$newlangfileonly->tab_translate[$key].''); print $form->textwithpicto('', $htmltext, 1, 'info'); diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 723a4bb0063..620efb0540e 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -155,9 +155,9 @@ if ($conf->use_javascript_ajax) } else { if (empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -269,13 +269,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -285,7 +285,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 0b372bf3518..9ae01790bb2 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -201,13 +201,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -217,7 +217,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 83aeed6bd13..b8520ecc227 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -601,10 +601,10 @@ if ($id) print ""; // Modify link - print ''.img_edit().''; + print ''.img_edit().''; // Delete link - if ($iserasable) print ''.img_delete().''; + if ($iserasable) print ''.img_delete().''; else print ''.img_delete($langs->trans("DisableSiteFirst"), 'class="opacitymedium"').''; print "\n"; diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index dddcaf91c81..a8bcbcf8172 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -219,11 +219,11 @@ foreach ($workflowcodes as $key => $params) { print ajax_constantonoff($key); } else { if (!empty($conf->global->$key)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 8cc22578f2a..a7eab61211d 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -112,11 +112,11 @@ print ''.$langs->trans("ApiProductionMode").''; $production_mode = (empty($conf->global->API_PRODUCTION_MODE) ?false:true); if ($production_mode) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 3434b03da99..7ef3d9c011e 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -323,7 +323,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($user->rights->asset->delete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 01418fde201..1045e9135ee 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -507,7 +507,7 @@ if ($rowid > 0) // Delete if ($user->rights->asset->write) { - print '
'.$langs->trans("DeleteType").'
'; + print '
'.$langs->trans("DeleteType").'
'; } print ""; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 7bb252394c3..b8d0304c5eb 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -185,6 +185,13 @@ class BlockedLog // $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all POS modules $moduleposenabled = ($conf->cashdesk->enabled || $conf->takepos->enabled || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL)); if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE'; + + if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) { + $tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED); + foreach ($tmparrayofmoresupportedevents as $val) { + $this->trackedevents[$val] = 'log'.$val; + } + } } /** diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 1230a0e3269..7daf29416c2 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2020 Laurent Destailleur * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -181,6 +181,8 @@ if (empty($reshook)) unset($_POST['qty']); unset($_POST['qty_frozen']); unset($_POST['disable_stock_change']); + + $object->fetchLines(); } } } @@ -608,7 +610,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($permissiontoadd) { - print ''.$langs->trans("SetToDraft").''; + print ''.$langs->trans("SetToDraft").''; } } @@ -617,7 +619,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if ($permissiontoadd) { - print ''.$langs->trans("Modify").''."\n"; + print ''.$langs->trans("Modify").''."\n"; } else { print ''.$langs->trans('Modify').''."\n"; } @@ -630,7 +632,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { if (is_array($object->lines) && count($object->lines) > 0) { - print ''.$langs->trans("Validate").''; + print ''.$langs->trans("Validate").''; } else { $langs->load("errors"); print ''.$langs->trans("Validate").''; @@ -681,7 +683,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($permissiontodelete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index e1e94dc2076..c5ee3870272 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -121,7 +121,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') { $coldisplay++; if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation - print 'id.'">'; + print 'id.'">'; print img_delete(); print ''; } diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index b6552dbd89c..93926e4ba92 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -311,13 +311,13 @@ if ($id > 0 && !preg_match('/^add/i', $action)) // Edit if ($user->rights->bookmark->creer && $action != 'edit') { - print " id."&action=edit\">".$langs->trans("Edit")."\n"; + print ''.$langs->trans("Edit").''."\n"; } // Remove if ($user->rights->bookmark->supprimer && $action != 'edit') { - print " id."&action=delete\">".$langs->trans("Delete")."\n"; + print ''.$langs->trans("Delete").''."\n"; } print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 3b01efdeea8..7f70d74f5d9 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -241,11 +241,11 @@ while ($i < min($num, $limit)) print ''; if ($user->rights->bookmark->creer) { - print 'rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().""; + print 'rowid."&backtopage=".urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().""; } if ($user->rights->bookmark->supprimer) { - print 'rowid.'">'.img_delete().''; + print 'rowid.'">'.img_delete().''; } else { print " "; } diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index e8b3da0a525..dc0a980a6f8 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -254,7 +254,7 @@ if ($object->id) } if ($user->rights->categorie->creer) { - print ''; + print ''; print img_delete().''; } if ($nbbyrow) print ''; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index cf3db3444c7..f5755a697ca 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -301,7 +301,7 @@ if ($action == 'edit') { $s = picto_from_langcode($key); print ''; - print ''; + print ''; print ''; print ''; if (!empty($conf->global->CATEGORY_USE_OTHER_FIELD_IN_TRANSLATION)) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 616c97f3bb9..30b706a4b3a 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) if ($user->rights->categorie->supprimer) { - print "".$langs->trans("Delete").""; + print "".$langs->trans("Delete").""; } print ""; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 0fe69fa10ea..3c8ed94c2bf 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page -$langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda")); +$langs->loadLangs(array("companies", "other", "commercial", "bills", "orders", "agenda", "mails")); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); @@ -393,31 +393,36 @@ if (empty($reshook) && $action == 'add') $moreparam = ''; if ($user->id != $object->userownerid) $moreparam = "filtert=-1"; // We force to remove filter so created record is visible when going back to per user view. - //Create eminder + //Create reminders if ($addreminder == 'on'){ $actionCommReminder = new ActionCommReminder($db); - $dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'i'); + $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit); $actionCommReminder->dateremind = $dateremind; $actionCommReminder->typeremind = $remindertype; - $actionCommReminder->fk_user = $user; $actionCommReminder->offsetunit = $offsetunit; $actionCommReminder->offsetvalue = $offsetvalue; $actionCommReminder->status = $actionCommReminder::STATUS_TODO; $actionCommReminder->fk_actioncomm = $object->id; if ($remindertype == 'email') $actionCommReminder->fk_email_template = $modelmail; - $res = $actionCommReminder->create($user); + // the notification must be created for every user assigned to the event + foreach ($object->userassigned as $userassigned) + { + $actionCommReminder->fk_user = $userassigned['id']; + $res = $actionCommReminder->create($user); - if ($res <= 0){ - // If error - $error++; - $langs->load("errors"); - $error = $langs->trans('ErrorReminderActionCommCreation').' '.$actionCommReminder->error; - setEventMessages($error, $actionCommReminder->errors, 'errors'); - $action = 'create'; $donotclearsession = 1; - } + if ($res <= 0){ + // If error + $db->rollback(); + $langs->load("errors"); + $error = $langs->trans('ErrorReminderActionCommCreation'); + setEventMessages($error, null, 'errors'); + $action = 'create'; $donotclearsession = 1; + break; + } + } } if ($error) { @@ -634,9 +639,51 @@ if (empty($reshook) && $action == 'update') $categories = GETPOST('categories', 'array'); $object->setCategories($categories); + $object->loadReminders(); + if (!empty($object->reminders) && $object->datep > dol_now()) + { + foreach ($object->reminders as $reminder) + { + $reminder->delete($user); + } + $object->reminders = array(); + } + + //Create reminders + if ($addreminder == 'on' && $object->datep > dol_now()){ + $actionCommReminder = new ActionCommReminder($db); + + $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit); + + $actionCommReminder->dateremind = $dateremind; + $actionCommReminder->typeremind = $remindertype; + $actionCommReminder->offsetunit = $offsetunit; + $actionCommReminder->offsetvalue = $offsetvalue; + $actionCommReminder->status = $actionCommReminder::STATUS_TODO; + $actionCommReminder->fk_actioncomm = $object->id; + if ($remindertype == 'email') $actionCommReminder->fk_email_template = $modelmail; + + // the notification must be created for every user assigned to the event + foreach ($object->userassigned as $userassigned) + { + $actionCommReminder->fk_user = $userassigned['id']; + $res = $actionCommReminder->create($user); + + if ($res <= 0){ + // If error + $langs->load("errors"); + $error = $langs->trans('ErrorReminderActionCommCreation'); + setEventMessages($error, null, 'errors'); + $action = 'create'; $donotclearsession = 1; + break; + } + } + } + unset($_SESSION['assignedtouser']); - $db->commit(); + if (!$error) $db->commit(); + else $db->rollback(); } else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -1236,7 +1283,7 @@ if ($action == 'create') } }); - $("#selectremindertype").click(function(){ + $("#selectremindertype").change(function(){ var selected_option = $("#selectremindertype option:selected").val(); if(selected_option == "email") { $("#select_actioncommsendmodel_mail").closest("tr").show(); @@ -1662,43 +1709,81 @@ if ($id > 0) // Reminders if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) { - $filtreuserid = $user->id; - if ($user->rights->agenda->allactions->read) $filtreuserid = 0; - $object->loadReminders('', $filteruserid); + $filteruserid = $user->id; + if ($user->rights->agenda->allactions->read) $filteruserid = 0; + $object->loadReminders('', $filteruserid, false); print '
'; - print '
'.($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', '').'
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Description').''.$object->multilangs[$key]["description"].'
'; - - print ''; + + print '
'; + + print '
'.$langs->trans("Reminders").''; - if (count($object->reminders) > 0) { - if (count($object->reminders) > 0) { - $tmpuserstatic = new User($db); + $checked = 'checked'; + $keys = array_keys($object->reminders); + $firstreminderId = array_shift($keys); - foreach ($object->reminders as $actioncommreminderid => $actioncommreminder) { - print $TRemindTypes[$actioncommreminder->typeremind]; - if ($actioncommreminder->fk_user > 0) { - $tmpuserstatic->fetch($actioncommreminder->fk_user); - print ' ('.$tmpuser->getNomUrl(0, '', 0, 0, 16).')'; - } - print ' - '.$actioncommreminder->offsetvalue.' '.$TDurationTypes[$actioncommreminder->offsetunit]; - if ($actioncommreminder->status == $actioncommreminder::STATUS_TODO) { - print ' - '; - print $langs->trans("NotSent"); - print ' '; - } elseif ($actioncommreminder->status == $actioncommreminder::STATUS_DONE) { - print ' - '; - print $langs->trans("Done"); - print ' '; - } - } - } + $actionCommReminder = $object->reminders[$firstreminderId]; + } else { + $checked = ''; + $actionCommReminder = new ActionCommReminder($db); + $actionCommReminder->offsetvalue = 10; + $actionCommReminder->offsetunit = 'i'; + $actionCommReminder->typeremind = 'email'; } + print '
'.$langs->trans("AddReminder").'
'; + + //Reminder + print ''; + + //Time Type + print ''; + + //Reminder Type + $TRemindTypes = array(); + if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) $TRemindTypes['email'] = $langs->trans('EMail'); + if (!empty($conf->global->AGENDA_REMINDER_BROWSER)) $TRemindTypes['browser'] = $langs->trans('BrowserPush'); + print ''; + + $hide = ''; + if ($actionCommReminder->typeremind == 'browser') $hide = 'style="display:none;"'; + + //Mail Model + print ''; print '
'.$langs->trans("ReminderTime").''; + print ''; + print '
'.$langs->trans("TimeType").''; + print $form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit); + print '
'.$langs->trans("ReminderType").''; + print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind); + print '
'.$langs->trans("EMailTemplates").''; + print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1); print '
'; + + print "\n".''."\n"; } dol_fiche_end(); @@ -1980,7 +2065,7 @@ if ($id > 0) { $filtreuserid = $user->id; if ($user->rights->agenda->allactions->read) $filtreuserid = 0; - $object->loadReminders('', $filteruserid); + $object->loadReminders('', $filteruserid, false); print ''.$langs->trans("Reminders").''; @@ -1991,7 +2076,7 @@ if ($id > 0) print $TRemindTypes[$actioncommreminder->typeremind]; if ($actioncommreminder->fk_user > 0) { $tmpuserstatic->fetch($actioncommreminder->fk_user); - print ' ('.$tmpuser->getNomUrl(0, '', 0, 0, 16).')'; + print ' ('.$tmpuserstatic->getNomUrl(0, '', 0, 0, 16).')'; } print ' - '.$actioncommreminder->offsetvalue.' '.$TDurationTypes[$actioncommreminder->offsetunit]; if ($actioncommreminder->status == $actioncommreminder::STATUS_TODO) { @@ -2003,6 +2088,7 @@ if ($id > 0) print $langs->trans("Done"); print ' '; } + print '
'; } } @@ -2050,7 +2136,7 @@ if ($id > 0) if ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a5084bfac74..97896448a3f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -495,7 +495,7 @@ class ActionComm extends CommonObject $sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated $sql .= (isset($this->type_id) ? $this->type_id : "null").","; $sql .= ($code ? ("'".$this->db->escape($code)."'") : "null").", "; - $sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", "; + $sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").", "; $sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", "; $sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", "; $sql .= " '".$this->db->escape($this->note_private)."', "; @@ -925,6 +925,18 @@ class ActionComm extends CommonObject } } + if (!$error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; + $sql .= " WHERE fk_actioncomm = ".$this->id; + + $res = $this->db->query($sql); + if (!$res) { + $this->error = $this->db->lasterror(); + $error++; + } + } + // Removed extrafields if (!$error) { $result = $this->deleteExtraFields(); @@ -1958,9 +1970,10 @@ class ActionComm extends CommonObject * * @param string $type Type of reminder 'browser' or 'email' * @param int $fk_user Id of user + * @param bool $onlypast true = get only past reminder, false = get all reminders linked to this * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) */ - public function loadReminders($type = '', $fk_user = 0) + public function loadReminders($type = '', $fk_user = 0, $onlypast = true) { global $conf, $langs, $user; @@ -1971,7 +1984,10 @@ class ActionComm extends CommonObject //Select all action comm reminders for event $sql = "SELECT rowid as id, typeremind, dateremind, status, offsetvalue, offsetunit, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; - $sql .= " WHERE fk_actioncomm = ".$this->id." AND dateremind <= '".$this->db->idate(dol_now())."'"; + $sql .= " WHERE fk_actioncomm = ".$this->id; + if ($onlypast) { + $sql .= " AND dateremind <= '".$this->db->idate(dol_now())."'"; + } if ($type) { $sql .= " AND typeremind ='".$this->db->escape($type)."'"; } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 18bd6b22ce0..79278fef056 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -560,7 +560,7 @@ if ($object->id > 0) { $titlealt = 'default'; if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label']; - if ($object->stcomm_id != $val['id']) print ''.img_action($titlealt, $val['code'], $val['picto']).''; + if ($object->stcomm_id != $val['id']) print ''.img_action($titlealt, $val['code'], $val['picto']).''; } print ''; print ""; @@ -777,8 +777,6 @@ if ($object->id > 0) print ''; print ''; print ''; - //if($num2 > 0) print ''; - //else print ''; print '
'.$langs->trans("LastCustomerOrders", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllOrders").''.$num.''.img_picto($langs->trans("Statistics"), 'stats').''.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').''.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'
'; print ''; } @@ -1283,7 +1281,7 @@ if ($object->id > 0) { if ($object->client != 0 && $object->client != 2) { - if (!empty($orders2invoice) && $orders2invoice > 0) print ''; + if (!empty($orders2invoice) && $orders2invoice > 0) print ''; else print ''; } else print ''; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 13037b58769..78b9dea4bc6 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1014,7 +1014,7 @@ if ($action == 'create') { print ''.$langs->trans("DeleteMailing").''; } else { - print ''.$langs->trans("DeleteMailing").''; + print ''.$langs->trans("DeleteMailing").''; } } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 813a195007b..ef2f3cc772e 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -665,7 +665,7 @@ if ($object->fetch($id) >= 0) if ($obj->statut == 0) // Not sent yet { if ($user->rights->mailing->creer && $allowaddtarget) { - print ''.img_delete($langs->trans("RemoveRecipient")).''; + print ''.img_delete($langs->trans("RemoveRecipient")).''; } } /*if ($obj->statut == -1) // Sent with error diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 2c6b7a9dca6..8febd8868e9 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2491,12 +2491,12 @@ if ($action == 'create') // Clone if ($usercancreate) { - print ''.$langs->trans("ToClone").''; + print ''.$langs->trans("ToClone").''; } // Delete if ($usercandelete) { - print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index dde38d98489..e50078993f8 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -183,6 +183,8 @@ $arrayfields = array( 'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), + 'p.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), + 'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), 'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); // Extra fields @@ -791,6 +793,18 @@ if ($resql) print ''; print ''; } + if (!empty($arrayfields['p.note_public']['checked'])) + { + // Note public + print ''; + print ''; + } + if (!empty($arrayfields['p.note_private']['checked'])) + { + // Note private + print ''; + print ''; + } // Status if (!empty($arrayfields['p.fk_statut']['checked'])) { @@ -846,6 +860,8 @@ if ($resql) if (!empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (!empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (!empty($arrayfields['p.date_cloture']['checked'])) print_liste_field_titre($arrayfields['p.date_cloture']['label'], $_SERVER["PHP_SELF"], "p.date_cloture", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + if (!empty($arrayfields['p.note_public']['checked'])) print_liste_field_titre($arrayfields['p.note_public']['label'], $_SERVER["PHP_SELF"], "p.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + if (!empty($arrayfields['p.note_private']['checked'])) print_liste_field_titre($arrayfields['p.note_private']['label'], $_SERVER["PHP_SELF"], "p.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print ''."\n"; @@ -1226,6 +1242,22 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Note public + if (!empty($arrayfields['p.note_public']['checked'])) + { + print ''; + print dol_escape_htmltag($obj->note_public); + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Note private + if (!empty($arrayfields['p.note_private']['checked'])) + { + print ''; + print dol_escape_htmltag($obj->note_private); + print ''; + if (!$i) $totalarray['nbfield']++; + } // Status if (!empty($arrayfields['p.fk_statut']['checked'])) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b3cb465d70d..5de377930d7 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2602,7 +2602,7 @@ if ($action == 'create' && $usercancreate) // Delete order if ($usercandelete) { if ($numshipping == 0) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index f78d6ce2e84..f2f806cc7af 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -164,7 +164,7 @@ if ($resql) $result = ''; $link = $linkend = ''; - $link = ''; + $link = ''; $linkend = ''; $name = $obj->name; $result .= ($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 921e1de185b..ad422a8b930 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -158,6 +158,8 @@ $arrayfields = array( 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500), + 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), + 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) ); @@ -270,7 +272,7 @@ $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client, c.fk_user_author,'; $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva as multicurrency_total_vat, c.multicurrency_total_ttc,'; -$sql .= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,'; +$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,'; $sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,'; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; $sql .= " u.login"; @@ -622,6 +624,16 @@ if ($resql) $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); + if (GETPOST('autoselectall', 'int')) { + $selectedfields .= ''; + } + print '
'; print ''."\n"; @@ -792,6 +804,18 @@ if ($resql) print ''; } + // Note public + if (!empty($arrayfields['c.note_public']['checked'])) + { + print ''; + } + // Note private + if (!empty($arrayfields['c.note_private']['checked'])) + { + print ''; + } // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { @@ -855,6 +879,8 @@ if ($resql) if (!empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['c.date_cloture']['checked'])) print_liste_field_titre($arrayfields['c.date_cloture']['label'], $_SERVER["PHP_SELF"], "c.date_cloture", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + if (!empty($arrayfields['c.note_public']['checked'])) print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, 'right '); + if (!empty($arrayfields['c.note_private']['checked'])) print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right '); if (!empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center '); @@ -1076,7 +1102,7 @@ if ($resql) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { - print ' '; + print ' '; print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->name, 'object_bill', 'hideonsmartphone').''; } } @@ -1243,6 +1269,22 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Note public + if (!empty($arrayfields['c.note_public']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Note private + if (!empty($arrayfields['c.note_private']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Status if (!empty($arrayfields['c.fk_statut']['checked'])) { @@ -1257,7 +1299,7 @@ if ($resql) } // Action column - print '"; print ''; } print ""; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 7502d4644f5..4e2998792d8 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -32,6 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); @@ -246,16 +247,7 @@ foreach ($cats as $cat) { $arrayselected[] = $cat->id; } -$tabs = array( - array( - DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid, - $langs->trans('BankTransaction') - ), - array( - DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid, - $langs->trans('Info') - ) -); +$head = bankline_prepare_head($rowid); $sql = "SELECT b.rowid,b.dateo as do,b.datev as dv, b.amount, b.label, b.rappro,"; @@ -296,7 +288,7 @@ if ($result) print ''; print ''; - dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'accountline', 0); + dol_fiche_head($head, 'bankline', $langs->trans('LineRecord'), 0, 'accountline', 0); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 20eab8b349e..371dbaa65e2 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -550,7 +550,7 @@ if ($id) if ($alreadyaccounted) { print ''; } else { - print ''; + print ''; } } else { print ''; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 682981852d8..5b8b98135a1 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -521,7 +521,7 @@ if ($action == 'create') if ($user->rights->deplacement->supprimer) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 634a4a0e452..7b0d7fcf869 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3935,7 +3935,7 @@ if ($action == 'create') } } - if ($action == 'deletepaiement') + if ($action == 'deletepayment') { $payment_id = GETPOST('paiement_id'); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 'no', 1); @@ -4743,7 +4743,7 @@ if ($action == 'create') print ''; } + if (!empty($arrayfields['f.note_public']['checked'])) + { + // Note public + print ''; + } + if (!empty($arrayfields['f.note_private']['checked'])) + { + // Note private + print ''; + } // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { @@ -1097,6 +1111,8 @@ if ($resql) if (!empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER["PHP_SELF"], "f.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (!empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER["PHP_SELF"], "f.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); if (!empty($arrayfields['f.date_closing']['checked'])) print_liste_field_titre($arrayfields['f.date_closing']['label'], $_SERVER["PHP_SELF"], "f.date_closing", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder); + if (!empty($arrayfields['f.note_public']['checked'])) print_liste_field_titre($arrayfields['f.note_public']['label'], $_SERVER["PHP_SELF"], "f.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap '); + if (!empty($arrayfields['f.note_private']['checked'])) print_liste_field_titre($arrayfields['f.note_private']['label'], $_SERVER["PHP_SELF"], "f.note_private", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['f.fk_statut']['checked'])) print_liste_field_titre($arrayfields['f.fk_statut']['label'], $_SERVER["PHP_SELF"], "f.fk_statut,f.paye,f.type,dynamount_payed", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); print "\n"; @@ -1555,6 +1571,22 @@ if ($resql) print ''; if (!$i) $totalarray['nbfield']++; } + // Note public + if (!empty($arrayfields['f.note_public']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } + // Note private + if (!empty($arrayfields['f.note_private']['checked'])) + { + print ''; + if (!$i) $totalarray['nbfield']++; + } // Status if (!empty($arrayfields['f.fk_statut']['checked'])) { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 721c0b857ab..f69517c1037 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -752,7 +752,7 @@ if ($object->id > 0) print ''; print ''; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index cd7bbfd11c2..6353d394f20 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -280,7 +280,7 @@ if ($id) print "
\n"; if ($object->rappro == 0) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } else { print ''.$langs->trans("Delete").''; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 85f56d298df..dd7651a6147 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -306,7 +306,7 @@ dol_fiche_end(); * List of invoices */ -$sql = 'SELECT f.rowid as facid, f.ref, f.type, f.total_ttc, f.paye, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid'; +$sql = 'SELECT f.rowid as facid, f.ref, f.type, f.total_ttc, f.paye, f.entity, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid'; $sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s'; $sql .= ' WHERE pf.fk_facture = f.rowid'; $sql .= ' AND f.fk_soc = s.rowid'; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 24650ea343f..71cd900f915 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -734,12 +734,12 @@ print '
'; if ($user->socid == 0 && !empty($object->id) && $object->statut == 0 && $user->rights->banque->cheque) { - print ''.$langs->trans('Validate').''; + print ''.$langs->trans('Validate').''; } if ($user->socid == 0 && !empty($object->id) && $user->rights->banque->cheque) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print '
'; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 2819e492f7b..0e71c83f6cb 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -311,7 +311,7 @@ if ($action == '') { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index ad105c5e364..2691e14504d 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -317,15 +317,15 @@ if ($id > 0 || $ref) if (empty($object->date_trans) && $user->rights->prelevement->bons->send) { - print "id."\">".$langs->trans("SetToStatusSent").""; + print "id."\">".$langs->trans("SetToStatusSent").""; } if (!empty($object->date_trans) && $object->date_credit == 0) { - print "id."\">".$langs->trans("ClassCredited").""; + print "id."\">".$langs->trans("ClassCredited").""; } - print "id."\">".$langs->trans("Delete").""; + print "id."\">".$langs->trans("Delete").""; print "
"; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index bcdfe1f5238..c744bcc90e8 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -706,13 +706,13 @@ if ($id > 0) // Reopen if ($object->paye && $user->rights->tax->charges->creer) { - print ""; + print ''; } // Edit if ($object->paye == 0 && $user->rights->tax->charges->creer) { - print ""; + print ''; } // Emit payment @@ -724,19 +724,19 @@ if ($id > 0) // Classify 'paid' if ($object->paye == 0 && round($resteapayer) <= 0 && $user->rights->tax->charges->creer) { - print ""; + print ''; } // Clone if ($user->rights->tax->charges->creer) { - print ""; + print '"; } // Delete if ($user->rights->tax->charges->supprimer) { - print ""; + print ''; } print ""; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 717b584fe44..010fd112646 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -379,7 +379,7 @@ if ($id) { if (!empty($user->rights->tax->charges->supprimer)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php index bd0808aa8b5..43fd48e3ef0 100644 --- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php +++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php @@ -144,7 +144,7 @@ if (empty($user->socid)) { } if ($user->rights->societe->contact->supprimer) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print '
'; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 8428b257fac..e4e7ecaf5fb 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1392,7 +1392,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) foreach ($object->cacheprospectstatus as $key => $val) { $titlealt = 'default'; if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label']; - if ($object->stcomm_id != $val['id']) print ''.img_action($titlealt, $val['code'], $val['picto']).''; + if ($object->stcomm_id != $val['id']) print ''.img_action($titlealt, $val['code'], $val['picto']).''; } print ''; @@ -1526,7 +1526,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Delete if ($user->rights->societe->contact->supprimer) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0c2c3bf56ce..8ea6ebea0d4 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -60,6 +60,29 @@ class Contact extends CommonObject */ public $picto = 'contact'; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ // BEGIN MODULEBUILDER PROPERTIES /** @@ -69,38 +92,38 @@ class Contact extends CommonObject 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>15), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), - 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'position'=>25), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30, 'index'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), - 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>-1, 'position'=>40), - 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>-1, 'position'=>45, 'showoncombobox'=>1), - 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'showoncombobox'=>1), + 'fk_soc' =>array('type'=>'integer', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>1, 'position'=>25, 'searchall'=>1), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>30, 'index'=>1), + 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>3, 'position'=>35), + 'civility' =>array('type'=>'varchar(6)', 'label'=>'Civility', 'enabled'=>1, 'visible'=>3, 'position'=>40), + 'lastname' =>array('type'=>'varchar(50)', 'label'=>'Lastname', 'enabled'=>1, 'visible'=>1, 'position'=>45, 'showoncombobox'=>1, 'searchall'=>1), + 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>-1, 'position'=>70), - 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>-1, 'position'=>80), + 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60), + 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>1, 'position'=>65), + 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70), + 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75), + 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>3, 'position'=>80), 'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'Phone perso', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'Phone mobile', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>110), - 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'priv' =>array('type'=>'smallint(6)', 'label'=>'Private', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>175), - 'fk_stcomm' =>array('type'=>'integer', 'label'=>'Fk stcommcontact', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), + 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1), + 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>1, 'position'=>95, 'searchall'=>1), + 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1), + 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>1, 'position'=>105, 'searchall'=>1), + 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>1, 'position'=>110, 'searchall'=>1), + 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115), + 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170), + 'priv' =>array('type'=>'smallint(6)', 'label'=>'ContactVisibility', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>175), + 'fk_stcommcontact' =>array('type'=>'integer', 'label'=>'Fk stcommcontact', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), 'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255), - 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>195), - 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>200), - 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>210), - 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000), + 'no_email' =>array('type'=>'smallint(6)', 'label'=>'No_Email', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>180), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>185), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'position'=>190), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>195, 'searchall'=>1), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>200, 'searchall'=>1), + 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>3, 'position'=>205), + 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>3, 'position'=>210), + 'statut' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>1000), ); public $civility_id; // In fact we store civility_code @@ -228,16 +251,22 @@ class Contact extends CommonObject global $conf, $langs; $this->db = $db; - - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; - if (empty($conf->mailing->enabled)) $this->fields['no_email']['enabled'] = 0; - if (!empty($conf->global->SOCIETE_DISABLE_CONTACTS)) $this->fields['thirdparty']['enabled'] = 0; - if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour - $this->field['fk_stcomm']['enabled'] = 0; - $this->field['fk_prospectlevel']['enabled'] = 0; - } $this->statut = 1; // By default, status is enabled + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible'] = 0; + if (empty($conf->mailing->enabled)) $this->fields['no_email']['enabled'] = 0; + + // typical ['s.nom'] is used for third-parties + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { + $this->fields['fk_soc']['enabled'] = 0; + $this->fields['fk_soc']['searchall'] = 0; + } + + if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour + $this->field['fk_stcommcontact']['enabled'] = 0; + $this->field['fk_prospectcontactlevel']['enabled'] = 0; + } + // Unset fields that are disabled foreach ($this->fields as $key => $val) { diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 0f4f01a0916..531fb885f63 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -149,44 +149,45 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // List of fields to search into when doing a "search in all" -$fieldstosearchall = array( - 'p.lastname'=>'Lastname', - 'p.firstname'=>'Firstname', - 'p.email'=>'EMail', - 's.nom'=>"ThirdParty", - 'p.phone'=>"Phone", - 'p.phone_perso'=>"PhonePerso", - 'p.phone_mobile'=>"PhoneMobile", - 'p.fax'=>"Fax", - 'p.note_public'=>"NotePublic", - 'p.note_private'=>"NotePrivate", -); +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) +{ + // don't allow search in private notes for external users when doing "search in all" + if (!empty($user->socid) && $key == "note_private") { + continue; + } + + if (empty($val['searchall'])) { + continue; + } + + $fieldstosearchall['p.'.$key] = $val['label']; +} + +// Add none object fields for "search in all" +if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { + $fieldstosearchall['s.nom'] = "ThirdParty"; +} // Definition of fields for list -$arrayfields = array( - 'p.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)), - 'p.lastname'=>array('label'=>"Lastname", 'position'=>2, 'checked'=>1), - 'p.firstname'=>array('label'=>"Firstname", 'position'=>3, 'checked'=>1), - 'p.poste'=>array('label'=>"PostOrFunction", 'position'=>10, 'checked'=>1), - 'p.town'=>array('label'=>"Town", 'position'=>20, 'checked'=>0), - 'p.zip'=>array('label'=>"Zip", 'position'=>21, 'checked'=>0), - 'country.code_iso'=>array('label'=>"Country", 'position'=>22, 'checked'=>0), - 'p.phone'=>array('label'=>"Phone", 'position'=>30, 'checked'=>1), - 'p.phone_perso'=>array('label'=>"PhonePerso", 'position'=>31, 'checked'=>0), - 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'position'=>32, 'checked'=>1), - 'p.fax'=>array('label'=>"Fax", 'position'=>33, 'checked'=>0), - 'p.email'=>array('label'=>"EMail", 'position'=>40, 'checked'=>1), - 'p.no_email'=>array('label'=>"No_Email", 'position'=>41, 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled))), - 'p.thirdparty'=>array('label'=>"ThirdParty", 'position'=>50, 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), - 'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200), - 'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500), - 'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), - 'p.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), - 'p.import_key'=>array('label'=>"ImportId", 'checked'=>0, 'position'=>1100), -); -if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { - $arrayfields['p.fk_prospectcontactlevel'] = array('label'=>"ProspectLevelShort", 'checked'=>1, 'position'=>210); - $arrayfields['p.fk_stcommcontact'] = array('label'=>"StatusProsp", 'checked'=>1, 'position'=>215); +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (empty($val['visible'])) { + continue; + } + + $arrayfields['p.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($val['visible'] < 0) ? 0 : 1), + 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), + 'position'=>$val['position']); +} + +// Add none object fields to fields for list +$arrayfields['country.code_iso'] = array('label'=>"Country", 'position'=>22, 'checked'=>0); +if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { + $arrayfields['s.nom'] = array('label'=>"ThirdParty", 'position'=>25, 'checked'=>1); } if (!empty($conf->socialnetworks->enabled)) { @@ -200,6 +201,7 @@ if (!empty($conf->socialnetworks->enabled)) { } } } + // Extra fields if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { @@ -395,10 +397,10 @@ if (strlen($search_phone)) $sql .= natural_search(array('p.phone', 'p.p if (strlen($search_cti)) $sql .= natural_search(array('p.phone', 'p.phone_perso', 'p.phone_mobile'), $search_cti); if (strlen($search_firstlast_only)) $sql .= natural_search(array('p.lastname', 'p.firstname'), $search_firstlast_only); -if ($search_id > 0) $sql .= natural_search("p.rowid", $search_id, 1); +if ($search_id > 0) $sql .= natural_search('p.rowid', $search_id, 1); if ($search_lastname) $sql .= natural_search('p.lastname', $search_lastname); if ($search_firstname) $sql .= natural_search('p.firstname', $search_firstname); -if ($search_societe) $sql .= natural_search('s.nom', $search_societe); +if ($search_societe) $sql .= natural_search(empty($conf->global->SOCIETE_DISABLE_CONTACTS) ? 's.nom' : 'p.fk_soc', $search_societe); if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')'; if (strlen($search_poste)) $sql .= natural_search('p.poste', $search_poste); if (strlen($search_phone_perso)) $sql .= natural_search('p.phone_perso', $search_phone_perso); @@ -721,7 +723,7 @@ if (!empty($conf->socialnetworks->enabled)) { } } } -if (!empty($arrayfields['p.thirdparty']['checked'])) +if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index adb117b7b8f..dd06d9fed4b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1567,7 +1567,7 @@ if ($action == 'create') } if ($user->rights->contrat->creer && ($object->statut >= 0)) { - print ''; + print ''; print img_delete(); print ''; } @@ -2108,7 +2108,7 @@ if ($action == 'create') // - Droit de supprimer if (($user->rights->contrat->creer && $object->statut == $object::STATUS_DRAFT) || $user->rights->contrat->supprimer) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 4d4c12ce473..cee75415eee 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -141,8 +141,13 @@ if ($action == 'update' && !empty($permissiontoadd)) if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; // Set value to update - if (in_array($object->fields[$key]['type'], array('text', 'html'))) { - $value = GETPOST($key, 'restricthtml'); + if (preg_match('/^(text|html)/', $object->fields[$key]['type'])) { + $tmparray = explode(':', $object->fields[$key]['type']); + if (!empty($tmparray[1])) { + $value = GETPOST($key, $tmparray[1]); + } else { + $value = GETPOST($key, 'restricthtml'); + } } elseif ($object->fields[$key]['type'] == 'date') { $value = dol_mktime(12, 0, 0, GETPOST($key.'month'), GETPOST($key.'day'), GETPOST($key.'year')); } elseif ($object->fields[$key]['type'] == 'datetime') { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 98e936a2d7a..c2f0a314445 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -3,7 +3,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Frédéric France * * 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 @@ -615,7 +615,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders $cmd->fetch_optionals(); $objecttmp->socid = $cmd->socid; - $objecttmp->type = Facture::TYPE_STANDARD; + $objecttmp->type = $objecttmp::TYPE_STANDARD; $objecttmp->cond_reglement_id = $cmd->cond_reglement_id; $objecttmp->mode_reglement_id = $cmd->mode_reglement_id; $objecttmp->fk_project = $cmd->fk_project; @@ -742,7 +742,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders 'HT', 0, $product_type, - $ii, + $lines[$i]->rang, $lines[$i]->special_code, $objecttmp->origin, $lines[$i]->rowid, diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 10c539a48de..bb8086f9b90 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1544,6 +1544,7 @@ class CMailFile $i = 0; foreach ($arrayaddress as $val) { + $regs = array(); if (preg_match('/^(.*)<(.*)>$/i', trim($val), $regs)) { $name = trim($regs[1]); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 384c778d602..3ea4bba4a7f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5800,7 +5800,7 @@ abstract class CommonObject } elseif (in_array($type, array('mail', 'phone', 'url'))) { $out = ''; - } elseif ($type == 'text') + } elseif (preg_match('/^text/', $type)) { if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field { @@ -5810,7 +5810,7 @@ abstract class CommonObject } else { $out = ''; } - } elseif ($type == 'html') + } elseif (preg_match('/^html/', $type)) { if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field { @@ -6584,7 +6584,7 @@ abstract class CommonObject return 'Error bad setup of extrafield'; } } else $value = ''; - } elseif ($type == 'text' || $type == 'html') + } elseif (preg_match('/^(text|html)/', $type)) { $value = dol_htmlentitiesbr($value); } elseif ($type == 'password') @@ -7152,7 +7152,7 @@ abstract class CommonObject $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; // Link to delete - $return .= ''; + $return .= ''; $return .= img_delete().''; } } @@ -7178,7 +7178,7 @@ abstract class CommonObject $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; // Link to delete - $return .= ''; + $return .= ''; $return .= img_delete().''; } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e00d544ed22..0a186c02d92 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -647,7 +647,7 @@ class Form $disabled = 0; $ret = '
'; - $ret .= ''; // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. $parameters = array(); @@ -4047,7 +4047,7 @@ class Form { global $langs, $conf; - $more = ''; + $more = ''; $formconfirm = ''; $inputok = array(); $inputko = array(); @@ -4232,7 +4232,6 @@ class Form }); } var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options; - //alert(urljump); if (pageyes.length > 0) { location.href = urljump; } $(this).dialog("close"); }, @@ -7552,8 +7551,8 @@ class Form global $conf, $langs; $out = ''; - $id = uniqid(); - if (!empty($conf->use_javascript_ajax)) $out .= '
'; + + if (!empty($conf->use_javascript_ajax)) $out .= '
'; $out .= ''; + $(".' . $cssclass.'").change(function() { + $(this).closest("tr").toggleClass("highlight", this.checked); + }); + }); + '; return $out; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 2e06837563e..7264c83b152 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1337,7 +1337,7 @@ class FormFile if (!empty($conf->dol_use_jmobile)) $useajax = 0; if (empty($conf->use_javascript_ajax)) $useajax = 0; if (!empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax = 0; - print ''.img_delete().''; + print ''.img_delete().''; } print ""; @@ -1645,7 +1645,7 @@ class FormFile //if ($forcedownload) print '&attachment=1'; //print '&file='.urlencode($relativefile).'">'; //print img_view().'   '; - //if ($permissiontodelete) print ''.img_delete().''; + //if ($permissiontodelete) print ''.img_delete().''; //else print ' '; print "
\n"; } @@ -1819,7 +1819,7 @@ class FormFile print ''; // Del button - print ''; // Action button print ''; @@ -1213,10 +1213,10 @@ if ($step == 5 && $datatoimport) $nboflines = $obj->import_get_nb_of_lines($conf->import->dir_temp.'/'.$filetoimport); - $param = '&leftmenu=import&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines.'&separator='.urlencode($separator).'&enclosure='.urlencode($enclosure); + $param = '&leftmenu=import&format='.urlencode($format).'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.urlencode($nboflines).'&separator='.urlencode($separator).'&enclosure='.urlencode($enclosure); $param2 = $param; // $param2 = $param without excludefirstline and endatlinenb - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); if (!empty($updatekeys)) $param .= '&updatekeys[]='.implode('&updatekeys[]=', $updatekeys); llxHeader('', $langs->trans("NewImport"), 'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones'); @@ -1642,9 +1642,9 @@ if ($step == 6 && $datatoimport) $nboflines = (!empty($_GET["nboflines"]) ? $_GET["nboflines"] : dol_count_nb_of_line($conf->import->dir_temp.'/'.$filetoimport)); - $param = '&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport).'&nboflines='.$nboflines; - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + $param = '&format='.$format.'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.urlencode($nboflines); + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); if ($separator) $param .= '&separator='.urlencode($separator); if ($enclosure) $param .= '&enclosure='.urlencode($enclosure); diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index cd8bec8c4ff..ca8797ba577 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -231,14 +231,10 @@ class Segment implements IteratorAggregate, Countable //throw new SegmentException("var $key not found in {$this->getName()}"); } - $value=$this->odf->htmlToUTFAndPreOdf($value); + $tag = $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT'); - $value = $encode ? htmlspecialchars($value) : $value; - $value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value; - - $value=$this->odf->preOdfToOdf($value); - - $this->vars[$this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')] = $value; + $this->vars[$tag] = $this->odf->convertVarToOdf($value, $encode, $charset); + return $this; } /** diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 3d510fdbaf1..5ec9b8f8870 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -141,7 +141,23 @@ class Odf //} } + $this->vars[$tag] = $this->convertVarToOdf($value, $encode, $charset); + + return $this; + } + + /** + * Replaces html tags in odt tags and returns a compatible string + * @param string $key Name of the variable within the template + * @param string $value Replacement value + * @param bool $encode If true, special XML characters are encoded + * @param string $charset Charset + * @return string + */ + public function convertVarToOdf($value, $encode = true, $charset = 'ISO-8859') + { $value = ($charset == 'ISO-8859') ? utf8_encode($value) : $value; + $convertedValue = $value; // Check if the value includes html tags if ($this->_hasHtmlTag($value) === true) { @@ -155,7 +171,7 @@ class Odf '' ); - $this->vars[$tag] = $this->_replaceHtmlWithOdtTag($this->_getDataFromHtml($value), $customStyles, $fontDeclarations); + $convertedValue = $this->_replaceHtmlWithOdtTag($this->_getDataFromHtml($value), $customStyles, $fontDeclarations); foreach ($customStyles as $key => $val) { array_push($automaticStyles, '' . $val . ''); @@ -179,9 +195,9 @@ class Odf } $this->contentXml = str_replace('', $fonts . '', $this->contentXml); } - else $this->vars[$tag] = preg_replace('/(\r\n|\r|\n)/i', "", $value); - - return $this; + else $convertedValue = preg_replace('/(\r\n|\r|\n)/i', "", $value); + + return $convertedValue; } /** diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 83a502dbbff..b66d205ef40 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -98,7 +98,8 @@ ALTER TABLE llx_bom_bomline ADD COLUMN position integer NOT NULL DEFAULT 0; ALTER TABLE llx_bom_bomline ADD COLUMN qty_frozen smallint DEFAULT 0; ALTER TABLE llx_bom_bomline ADD COLUMN disable_stock_change smallint DEFAULT 0; -ALTER TABLE llx_bom_bomline DROP COLUMN `rank`; +-- VMYSQL4.1 ALTER TABLE llx_bom_bomline DROP COLUMN `rank`; +-- VPGSQL8.2 ALTER TABLE llx_bom_bomline DROP COLUMN rank; create table llx_categorie_warehouse ( diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index e76948808bb..cae368aea21 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -330,3 +330,6 @@ ALTER TABLE llx_bank ADD COLUMN origin_type varchar(64) NULL; ALTER TABLE llx_bank ADD COLUMN import_key varchar(14); ALTER TABLE llx_menu MODIFY COLUMN enabled text; + +ALTER TABLE llx_website_page ADD COLUMN object_type varchar(255); +ALTER TABLE llx_website_page ADD COLUMN fk_object varchar(255); diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 91c155d3d84..c0efe6d68b3 100644 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -315,6 +315,7 @@ ALTER TABLE llx_c_chargesociales ADD COLUMN accountancy_code varchar(15) DEFAULT -- Tables for accountancy expert DROP TABLE llx_accountingaccount; +DROP TABLE llx_accounting_account; DROP TABLE llx_accountingsystem; DROP TABLE llx_accounting_system; 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 0f84c92ef22..88d9ae1b685 100644 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -102,6 +102,10 @@ ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_shipping_method; ALTER TABLE llx_expedition DROP INDEX idx_expedition_fk_expedition_methode; ALTER TABLE llx_expedition CHANGE COLUMN fk_expedition_methode fk_shipping_method integer; +-- This table and constraint should not exists as it appears in more recent version, but we may have it if we load an old dump +-- on a newly created database and we want to be sure upgrade of rowid into autoincrement done later will works. +ALTER TABLE llx_reception DROP FOREIGN KEY fk_reception_fk_shipping_method; + ALTER TABLE llx_c_shipment_mode ADD COLUMN tracking VARCHAR(255) NOT NULL DEFAULT '' AFTER description; --ALTER TABLE llx_c_shipment_mode DROP COLUMN CASCADE; diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql index bacbc8e802b..e2bec4a8a24 100644 --- a/htdocs/install/mysql/tables/llx_website_page.sql +++ b/htdocs/install/mysql/tables/llx_website_page.sql @@ -39,5 +39,7 @@ CREATE TABLE llx_website_page author_alias varchar(64), date_creation datetime, tms timestamp, - import_key varchar(14) -- import key + import_key varchar(14), -- import key + object_type varchar(255), + fk_object varchar(255) ) ENGINE=innodb; diff --git a/htdocs/langs/am_ET/propal.lang b/htdocs/langs/am_ET/propal.lang index 273996ab1b1..95085002f66 100644 --- a/htdocs/langs/am_ET/propal.lang +++ b/htdocs/langs/am_ET/propal.lang @@ -85,3 +85,7 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature ProposalsStatisticsSuppliers=Vendor proposals statistics CaseFollowedBy=Case followed by SignedOnly=Signed only +IdProposal=Proposal ID +IdProduct=Product ID +PrParentLine=Proposal Parent Line +LineBuyPriceHT=Buy Price Amount net of tax for line diff --git a/htdocs/langs/de_DE/propal.lang b/htdocs/langs/de_DE/propal.lang index 78e3e09a746..0956cf4900f 100644 --- a/htdocs/langs/de_DE/propal.lang +++ b/htdocs/langs/de_DE/propal.lang @@ -85,3 +85,7 @@ ProposalCustomerSignature=Bei Beauftragung: Name in Klarschrift, Ort, Datum, Unt ProposalsStatisticsSuppliers=Statistik Lieferantenanfragen CaseFollowedBy=Fall gefolgt von SignedOnly=nur signiert +IdProposal=Angebots-ID +IdProduct=Produkt ID +PrParentLine=Übergeordnete Zeile des Vorschlags +LineBuyPriceHT=Kaufpreis Betrag abzüglich Steuern für Linie diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1498639d731..1e64a5bfd04 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -71,7 +71,7 @@ DisableJavascriptNote=Note: For test or debug purpose. For optimization for blin UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. DelaiedFullListToSelectCompany=Wait until a key is pressed before loading content of Third Parties combo list.
This may increase performance if you have a large number of third parties, but it is less convenient. -DelaiedFullListToSelectContact=Wait until a key is pressed before loading content of Contact combo list.
This may increase performance if you have a large number of contacts, but it is less convenient) +DelaiedFullListToSelectContact=Wait until a key is pressed before loading content of Contact combo list.
This may increase performance if you have a large number of contacts, but it is less convenient. NumberOfKeyToSearch=Number of characters to trigger search: %s NumberOfBytes=Number of Bytes SearchString=Search string @@ -484,7 +484,7 @@ WarningPHPMailA=- Using the server of the Email Service Provider increase the tr WarningPHPMailB=- Some Email Service Providers (like Yahoo) do not allow you to send an email from another server than their own server. Your current setup uses the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not theirs, so few of your sent Emails may not be accepted for delivery (be careful also of your email provider's sending quota). WarningPHPMailC=- Using the SMTP server of your own Email Service Provider to send emails is also interesting so all emails sent from application will also be saved into your "Sent" directory of your mailbox. WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of the mail user agent (MUA) for your ERP CRM application: %s. -WarningPHPMailSPF=If the domain name in your sender email address is protected by SPF (ask you email provider), you must include the following IPs in the SPF record of the DNS of your domain: %s. +WarningPHPMailSPF=If the domain name in your sender email address is protected by a SPF record (ask you domain name registar), you must add the following IPs in the SPF record of the DNS of your domain: %s. ClickToShowDescription=Click to show description DependsOn=This module needs the module(s) RequiredBy=This module is required by module(s) @@ -555,8 +555,6 @@ Module57Name=Payments by Direct Debit Module57Desc=Management of Direct Debit orders. It includes generation of SEPA file for European countries. Module58Name=ClickToDial Module58Desc=Integration of a ClickToDial system (Asterisk, ...) -Module59Name=Bookmark4u -Module59Desc=Add function to generate Bookmark4u account from a Dolibarr account Module60Name=Stickers Module60Desc=Management of stickers Module70Name=Interventions @@ -1988,6 +1986,8 @@ LoadThirdPartyFromName=Load third party searching on %s (load only) LoadThirdPartyFromNameOrCreate=Load third party searching on %s (create if not found) WithDolTrackingID=Message from a conversation initiated by a first email sent from Dolibarr WithoutDolTrackingID=Message from a conversation initiated by a first email NOT sent from Dolibarr +WithDolTrackingIDInMsgId=Message sent from Dolibarr +WithoutDolTrackingIDInMsgId=Message NOT sent from Dolibarr CreateCandidature=Create candidature FormatZip=Zip MainMenuCode=Menu entry code (mainmenu) @@ -2030,7 +2030,7 @@ ImportSetup=Setup of module Import InstanceUniqueID=Unique ID of the instance SmallerThan=Smaller than LargerThan=Larger than -IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID of an object is found into incoming email, or if the email is an answer of an email aready collected and linked to an object, the event will be automatically linked to the known related object too. +IfTrackingIDFoundEventWillBeLinked=Note that If a tracking ID of an object is found into email, or if the email is an answer of an email aready collected and linked to an object, the created event will be automatically linked to the known related object. WithGMailYouCanCreateADedicatedPassword=With a GMail account, if you enabled the 2 steps validation, it is recommanded to create a dedicated second password for the application instead of using your own account passsword from https://myaccount.google.com/. EmailCollectorTargetDir=It may be a desired behaviour to move the email into another tag/directory when it was processed successfully. Just set name of directory here to use this feature (Do NOT use special characters in name). Note that you must also use a read/write login account. EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it. In the parameter field you can use for example 'EXTRACT:BODY:Name:\s([^\s]*)' if you want to extract the name of the thirdparty from a string 'Name: name to find' found into the body. diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index aff922c4c23..4ab87aa8420 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -14,7 +14,7 @@ EventsNb=Number of events ListOfActions=List of events EventReports=Event reports Location=Location -ToUserOfGroup=Event assigned to any user in group +ToUserOfGroup=Event assigned to any user in the group EventOnFullDay=Event on all day(s) MenuToDoActions=All incomplete events MenuDoneActions=All terminated events diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 0289b381b23..427a5a80d45 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -371,6 +371,7 @@ MulticurrencyPaymentAmount=Payment amount, original currency MulticurrencyAmountHT=Amount (excl. tax), original currency MulticurrencyAmountTTC=Amount (inc. of tax), original currency MulticurrencyAmountVAT=Amount tax, original currency +MulticurrencySubPrice=Amount sub price multi currency AmountLT1=Amount tax 2 AmountLT2=Amount tax 3 AmountLT1ES=Amount RE @@ -1094,4 +1095,4 @@ PublicVendorName=Public name of vendor DateOfBirth=Date of birth SecurityTokenHasExpiredSoActionHasBeenCanceledPleaseRetry=Security token has expired, so action has been canceled. Please try again. UpToDate=Up-to-date -OutOfDate=Out-of-date \ No newline at end of file +OutOfDate=Out-of-date diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index c68574d9ae2..557df2f840f 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -84,3 +84,8 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature ProposalsStatisticsSuppliers=Vendor proposals statistics CaseFollowedBy=Case followed by SignedOnly=Signed only +IdProposal=Proposal ID +IdProduct=Product ID +PrParentLine=Proposal Parent Line +LineBuyPriceHT=Buy Price Amount net of tax for line + diff --git a/htdocs/langs/en_US/receiptprinter.lang b/htdocs/langs/en_US/receiptprinter.lang index 83a003f388d..284c4fa61fa 100644 --- a/htdocs/langs/en_US/receiptprinter.lang +++ b/htdocs/langs/en_US/receiptprinter.lang @@ -54,7 +54,7 @@ DOL_DOUBLE_WIDTH=Double width size DOL_DEFAULT_HEIGHT_WIDTH=Default height and width size DOL_UNDERLINE=Enable underline DOL_UNDERLINE_DISABLED=Disable underline -DOL_BEEP=Beed sound +DOL_BEEP=Beep sound DOL_PRINT_TEXT=Print text DateInvoiceWithTime=Invoice date and time YearInvoice=Invoice year diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index e6f9e612a59..cf370fbdca0 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -31,10 +31,8 @@ TicketDictType=Ticket - Types TicketDictCategory=Ticket - Groupes TicketDictSeverity=Ticket - Severities TicketDictResolution=Ticket - Resolution -TicketTypeShortBUGSOFT=Dysfonctionnement logiciel -TicketTypeShortBUGHARD=Dysfonctionnement matériel -TicketTypeShortCOM=Commercial question +TicketTypeShortCOM=Commercial question TicketTypeShortHELP=Request for functionnal help TicketTypeShortISSUE=Issue, bug or problem TicketTypeShortREQUEST=Change or enhancement request diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index 03981e2b17d..64199c5248d 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -98,3 +98,7 @@ ConfirmMassValidationQuestion = Voulez-vous confirmer la validation des devis br ConfirmMassSignatureQuestion = Voulez-vous confirmer la signature des devis ouvert selectionnés ? PropNoProductOrService = devis ne contient pas de produits ni de services PropsNoProductOrService = devis ne contiennent pas de produits ni de services +IdProposal=ID de proposition +IdProduct=ID produit +PrParentLine=Ligne parent de proposition +LineBuyPriceHT=Prix ​​d'achat Montant net de taxe pour la ligne diff --git a/htdocs/langs/ja_JP/propal.lang b/htdocs/langs/ja_JP/propal.lang index d2065e007a3..373ac4a2ce2 100644 --- a/htdocs/langs/ja_JP/propal.lang +++ b/htdocs/langs/ja_JP/propal.lang @@ -85,3 +85,7 @@ ProposalCustomerSignature=承諾書、会社印、日付、署名 ProposalsStatisticsSuppliers=Vendor proposals statistics CaseFollowedBy=Case followed by SignedOnly=Signed only +IdProposal=提案番号 +IdProduct=製品番号 +PrParentLine=提案親ライン +LineBuyPriceHT=購入価格ラインの税控除後の金額 diff --git a/htdocs/langs/ko_KR/propal.lang b/htdocs/langs/ko_KR/propal.lang index 93708eb0955..26a86464f91 100644 --- a/htdocs/langs/ko_KR/propal.lang +++ b/htdocs/langs/ko_KR/propal.lang @@ -85,3 +85,7 @@ ProposalCustomerSignature=Written acceptance, company stamp, date and signature ProposalsStatisticsSuppliers=Vendor proposals statistics CaseFollowedBy=Case followed by SignedOnly=Signed only +IdProposal=Proposal ID +IdProduct=Product ID +PrParentLine=Proposal Parent Line +LineBuyPriceHT=Buy Price Amount net of tax for line diff --git a/htdocs/langs/vi_VN/propal.lang b/htdocs/langs/vi_VN/propal.lang index 2a99f2a5577..a9e808d9f5a 100644 --- a/htdocs/langs/vi_VN/propal.lang +++ b/htdocs/langs/vi_VN/propal.lang @@ -85,3 +85,7 @@ ProposalCustomerSignature=Văn bản chấp nhận, dấu công ty, ngày và ch ProposalsStatisticsSuppliers=Thống kê đề xuất nhà cung cấp CaseFollowedBy=Theo bởi trường hợp SignedOnly=Signed only +IdProposal=ID đề xuất +IdProduct=ID sản phẩm +PrParentLine=Dòng mẹ đề xuất +LineBuyPriceHT=Giá mua Số lượng ròng của thuế cho dòng diff --git a/htdocs/langs/zh_CN/propal.lang b/htdocs/langs/zh_CN/propal.lang index 2c782854e14..79d10f5e2ba 100644 --- a/htdocs/langs/zh_CN/propal.lang +++ b/htdocs/langs/zh_CN/propal.lang @@ -85,3 +85,7 @@ ProposalCustomerSignature=书面接受,公司盖章,日期和签名 ProposalsStatisticsSuppliers=Vendor proposals statistics CaseFollowedBy=Case followed by SignedOnly=Signed only +IdProposal=提案编号 +IdProduct=产品编号 +PrParentLine=提案父行 +LineBuyPriceHT=购买价格扣除税额 diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 80594338ba1..2a1646a5d80 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -658,9 +658,9 @@ if ($action == 'create') // Create. Seems to no be used { if ($conf->expedition_bon->enabled) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 157bdbd53b8..1c4116b34c2 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -752,13 +752,13 @@ if ($id > 0) // Classify 'paid' if (($object->paid == 0 || $object->paid == 2) && round($staytopay) <= 0 && $user->rights->loan->write) { - print ''; + print ''; } // Delete if (($object->paid == 0 || $object->paid == 2) && $user->rights->loan->delete) { - print ''; + print ''; } print ""; diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 9b4da35e5d1..51aa3f85a92 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -281,7 +281,7 @@ if (empty($action) && !empty($user->rights->loan->delete)) { if (!$disable_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6cdf59a078a..1344287044e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -373,7 +373,9 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl || defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set { // Check all cases that need a token (all POST actions, all actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set, all sensitive GET actions) - if ($_SERVER['REQUEST_METHOD'] == 'POST' || ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deleteprof'))) + if ($_SERVER['REQUEST_METHOD'] == 'POST' || + ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || + in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deleteprof', 'deletepayment'))) { if (!GETPOSTISSET('token')) { dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused by CSRFCHECK_WITH_TOKEN protection. Token not provided."); diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index cea00dfdff6..cf2cde3e19d 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -159,9 +159,9 @@ if (!empty($conf->use_javascript_ajax)) } else { if (empty($conf->global->DISPLAY_MARGIN_RATES)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; @@ -197,9 +197,9 @@ if (!empty($conf->use_javascript_ajax)) } else { if (empty($conf->global->ForceBuyingPriceIfNull)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index c100c4a1ab0..b7cadf26341 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -123,9 +123,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print ajax_constantonoff('MODULEBUILDER_USE_ABOUT'); } else { if (empty($conf->global->MODULEBUILDER_USE_ABOUT)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 2404a81b101..49d097ffc8a 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1714,7 +1714,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { $linktoenabledisable .= '   '.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').''; } } else { - $linktoenabledisable .= ''; + $linktoenabledisable .= ''; $linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', '', false, 0, 0, '', 'classfortooltip', 1); $linktoenabledisable .= "\n"; } @@ -2713,7 +2713,7 @@ if ($module == 'initmodule') print '
'; diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php index b0ef752707c..11116fc33f4 100644 --- a/htdocs/modulebuilder/template/admin/setup.php +++ b/htdocs/modulebuilder/template/admin/setup.php @@ -321,7 +321,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -451,13 +451,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (in_array($name, $def)) { print ''; } else { print '"; } @@ -468,7 +468,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 399dd3b10b8..18ca9b5ea20 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -70,7 +70,7 @@ class MyObject extends CommonObject /** - * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) @@ -116,6 +116,7 @@ class MyObject extends CommonObject 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid'), 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), //'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), + 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'notnull'=>-1, 'position'=>1010), 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled')), @@ -171,6 +172,11 @@ class MyObject extends CommonObject */ public $fk_user_modif; + /** + * @var string public $last_main_doc + */ + public $last_main_doc; + /** * @var string import_key */ diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index f8fc8466349..694263e2ec5 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -899,7 +899,7 @@ class pdf_standard_myobject extends ModelePDFMyObject pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == Facture::STATUS_DRAFT && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) + if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->FACTURE_DRAFT_WATERMARK))) { pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->FACTURE_DRAFT_WATERMARK); } @@ -959,7 +959,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $textref = $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->ref); - if ($object->statut == Facture::STATUS_DRAFT) + if ($object->statut == $object::STATUS_DRAFT) { $pdf->SetTextColor(128, 0, 0); $textref .= ' - '.$outputlangs->transnoentities("NotValidated"); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index d97bc8f7f35..49841fe24b9 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -521,7 +521,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 3fc5032bced..e79128e1657 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -379,7 +379,6 @@ print ''; print ''; print ''; -//print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 49b29b7048b..add7de31b56 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -656,7 +656,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 2d714deeb2c..f5fa5a5ab78 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -371,7 +371,7 @@ if ($action != 'edit' && $user->rights->opensurvey->write) { } //Delete button - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 4c304201c6c..3cf751f7391 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -148,10 +148,10 @@ print ''; diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index f76b7d66fbe..2f906c68382 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -262,9 +262,9 @@ if ($mode == 'config' && $user->admin) } else { if (empty($conf->global->{$printer->conf})) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index bc9f1048b4b..aafc36ca256 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -178,8 +178,8 @@ if ($action != 'create_updater' && $action != 'edit_updater') print ''; print ''; print ''; - print ''; + print ''; print ''; } } else { @@ -270,7 +270,7 @@ if ($action != 'create_variable' && $action != 'edit_variable') print ''; print ''; print ''; + print 'id.'">'.img_delete().''; print ''; } } else { @@ -284,7 +284,7 @@ if ($action != 'create_variable' && $action != 'edit_variable') { //Action Buttons print ''; } } diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index f037dfb3d6f..09418b5e896 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -355,7 +355,7 @@ foreach ($dirproduct as $dirroot) $disabled = false; if (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true); print ''; @@ -463,7 +463,7 @@ foreach ($dirmodels as $reldir) print ''; } else { print '"; } @@ -473,7 +473,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -724,10 +724,10 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) { print img_picto($langs->trans("Active"), 'tick'); print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f86b94f314e..62b7d78b031 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -79,6 +79,14 @@ $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOST('socid', 'int'); $duration_value = GETPOST('duration_value', 'int'); $duration_unit = GETPOST('duration_unit', 'alpha'); + +$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); +$accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra', 'alpha'); +$accountancy_code_sell_export = GETPOST('accountancy_code_sell_export', 'alpha'); +$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); +$accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); +$accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); + if (!empty($user->socid)) $socid = $user->socid; $object = new Product($db); @@ -1316,6 +1324,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; } else // For external software { + if (!empty($accountancy_code_sell)) { $object->accountancy_code_sell = $accountancy_code_sell; } + if (!empty($accountancy_code_sell_intra)) { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; } + if (!empty($accountancy_code_sell_export)) { $object->accountancy_code_sell_export = $accountancy_code_sell_export; } + if (!empty($accountancy_code_buy)) { $object->accountancy_code_buy = $accountancy_code_buy; } + if (!empty($accountancy_code_buy_intra)) { $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; } + if (!empty($accountancy_code_buy_export)) { $object->accountancy_code_buy_export = $accountancy_code_buy_export; } + // Accountancy_code_sell print ''; print ''; print ''; print ''; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index c73e43dc6f0..847292fa367 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -913,7 +913,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ if (($user->rights->produit->creer || $user->rights->service->creer)) { print ''; print img_edit().''; - print ''; + print ''; print img_delete().''; } else { print ' '; @@ -1064,7 +1064,7 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ { print ''; print img_edit().''; - print ''; + print ''; print img_delete().''; } else { print ' '; @@ -1591,7 +1591,7 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul print ''; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 11aa5e860ae..81ae26390c9 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -485,13 +485,19 @@ if ($action == 'create') { if (empty($action)) { - if ($user->rights->stock->creer) - print "id."\">".$langs->trans("Modify").""; - else print "".$langs->trans("Modify").""; + if ($user->rights->stock->creer) { + print ''.$langs->trans("Modify").''; + } + else { + print ''.$langs->trans("Modify").''; + } - if ($user->rights->stock->supprimer) - print "id."\">".$langs->trans("Delete").""; - else print "".$langs->trans("Delete").""; + if ($user->rights->stock->supprimer) { + print ''.$langs->trans("Delete").''; + } + else { + print ''.$langs->trans("Delete").''; + } } } diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 534b9300158..0252e6a17ce 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1002,6 +1002,10 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php'; $origin = new Mo($this->db); break; + case 'user': + require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; + $origin = new User($this->db); + break; default: if ($origintype) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 54d57bf5d75..64c23814ec2 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -1006,7 +1006,7 @@ if (!$variants) { print ''; print ''; if (!empty($user->rights->produit->creer)) { - print ''; + print ''; } print ''; } diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index bdc68f5c3e5..dbedba85d99 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -371,7 +371,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($user->rights->stock->supprimer) { - print ''."\n"; + print ''."\n"; } */ } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 98b9f54b2ff..9ad848cf535 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -768,6 +768,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) } } + $stockwarehouse=0; if ($usevirtualstock) { // If option to increase/decrease is not on an object validation, virtual stock may differs from physical stock. @@ -793,8 +794,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) $desiredstock = $objp->desiredstock; $alertstock = $objp->seuil_stock_alerte; - $desiredstockwarehouse = ($objp->desiredstockpse ? $objp->desiredstockpse : ''); - $alertstockwarehouse = ($objp->seuil_stock_alertepse ? $objp->seuil_stock_alertepse : ''); + $desiredstockwarehouse = ($objp->desiredstockpse ? $objp->desiredstockpse : 0); + $alertstockwarehouse = ($objp->seuil_stock_alertepse ? $objp->seuil_stock_alertepse : 0); $warning = ''; if ($alertstock && ($stock < $alertstock)) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 502a15cd04e..c6a5d15a0b0 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -236,7 +236,7 @@ if ($action == 'edit') foreach ($object->multilangs as $key => $value) { $s = picto_from_langcode($key); - print "
".($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"')."
"; + print "
".($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"')."
"; print '
'; print '
'; print ''; + print ''; + print ''; + print dol_escape_htmltag($obj->note_public); + print ''; + print dol_escape_htmltag($obj->note_private); + print ''; + print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined { $selected = 0; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 950d0c7d3c6..974ba750dd1 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1490,7 +1490,7 @@ if ($resql) } if ($user->rights->banque->modifier) { - print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; + print 'rowid.'&id='.$objp->bankid.'&page='.$page.'">'; print img_delete('', 'class="marginleftonly"'); print ''; } diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 7d9e825ce08..bac2f974def 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -761,13 +761,13 @@ if ($action == 'create') if ($user->rights->banque->configurer) { - print 'id.'">'.$langs->trans("Modify").''; + print 'id.'">'.$langs->trans("Modify").''; } $canbedeleted = $object->can_be_deleted(); // Renvoi vrai si compte sans mouvements if ($user->rights->banque->configurer && $canbedeleted) { - print 'id.'">'.$langs->trans("Delete").''; + print 'id.'">'.$langs->trans("Delete").''; } print ''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 0f71134d08a..18b75bdea9b 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -135,8 +135,8 @@ if ($result) } else { print "".$objp->label."'; - print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_edit().''; + print ''.img_delete().''; print '
'; if ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) { - print 'rowid.'">'; + print 'rowid.'">'; print img_delete(); print ''; } @@ -5286,7 +5286,7 @@ if ($action == 'create') { print ''.$langs->trans('Delete').''; } else { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } else { print ''.$langs->trans('Delete').''; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 67dd4e304ea..c288251f56a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -155,7 +155,7 @@ class FactureRec extends CommonInvoice 'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), 'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), 'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120), + 'date_last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120), 'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'Unit frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>125), 'date_when' =>array('type'=>'datetime', 'label'=>'Date when', 'enabled'=>1, 'visible'=>-1, 'position'=>130), 'date_last_gen' =>array('type'=>'datetime', 'label'=>'Date last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>135), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index bbcdd2ab895..607afbc943f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -205,6 +205,8 @@ $arrayfields = array( 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), + 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), + 'f.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); @@ -1037,6 +1039,18 @@ if ($resql) print ''; print ''; + print ''; + print '
'; + print dol_escape_htmltag($obj->note_public); + print ''; + print dol_escape_htmltag($obj->note_private); + print ''.$langs->trans("OrderWaiting").''; - print ''; + print ''; print img_delete(); print '
'; print ''; @@ -819,10 +821,11 @@ if (!empty($conf->socialnetworks->enabled)) { } } } -if (!empty($arrayfields['p.thirdparty']['checked'])) print_liste_field_titre($arrayfields['p.thirdparty']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder); -if (!empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) print_liste_field_titre($arrayfields['p.fk_prospectcontactlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectcontactlevel", "", $param, '', $sortfield, $sortorder, 'center '); -if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) print_liste_field_titre($arrayfields['p.fk_stcommcontact']['label'], $_SERVER["PHP_SELF"], "p.fk_stcommcontact", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['p.fk_soc']['checked'])) print_liste_field_titre($arrayfields['p.fk_soc']['label'], $_SERVER["PHP_SELF"], "p.fk_soc", $begin, $param, '', $sortfield, $sortorder); +if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder); +if (!empty($arrayfields['p.priv']['checked'])) print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) print_liste_field_titre($arrayfields['p.fk_prospectcontactlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectcontactlevel", "", $param, '', $sortfield, $sortorder, 'center '); +if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) print_liste_field_titre($arrayfields['p.fk_stcommcontact']['label'], $_SERVER["PHP_SELF"], "p.fk_stcommcontact", "", $param, '', $sortfield, $sortorder, 'center '); // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields @@ -983,7 +986,7 @@ while ($i < min($num, $limit)) } } // Company - if (!empty($arrayfields['p.thirdparty']['checked'])) + if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { print ''; if ($obj->socid) @@ -1021,7 +1024,7 @@ while ($i < min($num, $limit)) foreach ($contactstatic->cacheprospectstatus as $key => $val) { $titlealt = 'default'; if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label']; - if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt, $val['code'], $val['picto']).''; + if ($obj->stcomm_id != $val['id']) print ''.img_action($titlealt, $val['code'], $val['picto']).''; } print '
'; print ''.img_edit().''; // id= is included into $param if ($permissiontodelete) { - print '   '.img_delete().''; // id= is included into $param + print '   '.img_delete().''; // id= is included into $param } else { print ' '; } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index fcd7199137c..e2749c5e183 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -653,7 +653,7 @@ class FormMail extends Form $out .= ' <'.$this->tomail.'>'; if ($this->withtofree) { - $out .= '
'.$langs->trans("and").' withto) : "").'" />'; + $out .= '
'.$langs->trans("and").' withto) : "").'" />'; } } else { // Note withto may be a text like 'AllRecipientSelected' @@ -663,7 +663,7 @@ class FormMail extends Form // The free input of email if (!empty($this->withtofree)) { - $out .= 'withto) : "")).'" />'; + $out .= 'withto) : "")).'" />'; } // The select combo if (!empty($this->withto) && is_array($this->withto)) @@ -675,7 +675,9 @@ class FormMail extends Form { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } - $withtoselected = GETPOST("receiver", 'restricthtml'); // Array of selected value + + $withtoselected = GETPOST("receiver", 'array'); // Array of selected value + if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { $withtoselected = array_keys($tmparray); @@ -699,7 +701,7 @@ class FormMail extends Form { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } - $withtoselected = GETPOST("receiveruser", 'restricthtml'); // Array of selected value + $withtoselected = GETPOST("receiveruser", 'array'); // Array of selected value if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { $withtoselected = array_keys($tmparray); @@ -743,7 +745,7 @@ class FormMail extends Form { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } - $withtoccselected = GETPOST("receivercc"); // Array of selected value + $withtoccselected = GETPOST("receivercc", 'array'); // Array of selected value $out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500', null, ""); } } @@ -763,7 +765,7 @@ class FormMail extends Form { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } - $withtoselected = GETPOST("receiverccuser", 'restricthtml'); // Array of selected value + $withtoselected = GETPOST("receiverccuser", 'array'); // Array of selected value if (empty($withtoselected) && count($tmparray) == 1 && GETPOST('action', 'aZ09') == 'presend') { $withtoselected = array_keys($tmparray); @@ -1060,7 +1062,7 @@ class FormMail extends Form if (!empty($this->withtocccreadonly)) { $out .= (!is_array($this->withtoccc) && !is_numeric($this->withtoccc)) ? $this->withtoccc : ""; } else { - $out .= 'withtoccc) && !is_numeric($this->withtoccc)) ? $this->withtoccc : '')).'" />'; + $out .= 'withtoccc) && !is_numeric($this->withtoccc)) ? $this->withtoccc : '')).'" />'; if (!empty($this->withtoccc) && is_array($this->withtoccc)) { $out .= " ".$langs->trans("and")."/".$langs->trans("or")." "; // multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time @@ -1068,7 +1070,7 @@ class FormMail extends Form foreach ($tmparray as $key => $val) { $tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true); } - $withtocccselected = GETPOST("receiverccc"); // Array of selected value + $withtocccselected = GETPOST("receiverccc", 'array'); // Array of selected value $out .= $form->multiselectarray("receiverccc", $tmparray, $withtocccselected, null, null, null, null, "90%"); } } diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 06c3106a5dc..a1de5813b46 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -476,7 +476,7 @@ class Ldap // For better compatibility with Samba4 AD if ($this->serverType == "activedirectory") { - unset($info['cn']); // For avoid error : Operation not allowed on RDN (Code 67) + unset($info['cn']); // To avoid error : Operation not allowed on RDN (Code 67) } $result = @ldap_modify($this->connection, $dn, $info); diff --git a/htdocs/core/filemanagerdol/browser/default/frmupload.php b/htdocs/core/filemanagerdol/browser/default/frmupload.php index 08c76f374e4..e0f0f03e430 100644 --- a/htdocs/core/filemanagerdol/browser/default/frmupload.php +++ b/htdocs/core/filemanagerdol/browser/default/frmupload.php @@ -122,6 +122,7 @@ window.onload = function()
+
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 6b77003e52e..10fa477600a 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -504,8 +504,8 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof if (empty($conf->use_javascript_ajax) || $forcenoajax) { - if (empty($conf->global->$code)) print ''.img_picto($langs->trans("Disabled"), 'off').''; - else print ''.img_picto($langs->trans("Enabled"), 'on').''; + if (empty($conf->global->$code)) print ''.img_picto($langs->trans("Disabled"), 'off').''; + else print ''.img_picto($langs->trans("Enabled"), 'on').''; } else { $out = "\n".' '; + } print '
'; print ''."\n"; @@ -933,6 +981,7 @@ if ($resql) print "\n"; + // Fields title print ''; if (!empty($arrayfields['cf.ref']['checked'])) print_liste_field_titre($arrayfields['cf.ref']['label'], $_SERVER["PHP_SELF"], "cf.ref", "", $param, '', $sortfield, $sortorder); if (!empty($arrayfields['cf.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['cf.ref_supplier']['label'], $_SERVER["PHP_SELF"], "cf.ref_supplier", "", $param, '', $sortfield, $sortorder, 'tdoverflowmax100imp '); @@ -983,6 +1032,12 @@ if ($resql) { $obj = $db->fetch_object($resql); + $notshippable = 0; + $warning = 0; + $text_info = ''; + $text_warning = ''; + $nbprod = 0; + $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; $objectstatic->ref_supplier = $obj->ref_supplier; @@ -1220,22 +1275,25 @@ if ($resql) if (!$i) $totalarray['nbfield']++; print "\n"; + + $total += $obj->total_ht; + $subtotal += $obj->total_ht; $i++; } // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - print "
\n"; - print '
'; - print "\n"; + print '
'."\n"; + print ''; - $db->free($resql); + print ''."\n"; $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 9470e408b70..b0f178c6fc4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2345,7 +2345,7 @@ if ($action == 'create') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); } - if ($action == 'deletepaiement') + if ($action == 'deletepayment') { $payment_id = GETPOST('paiement_id'); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1); @@ -2789,7 +2789,7 @@ if ($action == 'create') print '
'; if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0) { - print 'rowid.'">'; + print 'rowid.'">'; print img_delete(); print ''; } @@ -3178,7 +3178,7 @@ if ($action == 'create') { print ''; } else { - print ''; + print ''; } } print ''; diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 9a7af329f50..ffe4c95bf51 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -345,7 +345,7 @@ if ($result > 0) { if ($allow_delete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index cd76f74b278..7c0eab0f352 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -598,19 +598,19 @@ if (!function_exists('ftp_connect')) print ''; if ($is_directory) { - if ($file != '..') print ''.img_delete().''; + if ($file != '..') print ''.img_delete().''; else print ' '; } elseif ($is_link) { $newfile = $file; $newfile = preg_replace('/ ->.*/', '', $newfile); - print ''.img_delete().''; + print ''.img_delete().''; } else { - print ''.img_picto('', 'file').''; + print ''.img_picto('', 'file').''; print '   '; print ''; print '   '; - print ''.img_delete().''; + print ''.img_delete().''; print ''; print ''; } diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 3bacf8d6d6a..d9bbe6607bf 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -1470,7 +1470,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') } if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) // If draft or canceled or refused { - print ''.$langs->trans("DeleteCP").''; + print ''.$langs->trans("DeleteCP").''; } print ''; diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 0b000f879c2..1f43878babf 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -426,7 +426,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 72d1eb16f66..3684d4d2d7e 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2020 Ahmad Jamaly Rabib * * 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,6 +102,8 @@ class Import // Defined if module is enabled $enabled = true; $part = strtolower(preg_replace('/^mod/i', '', $modulename)); + // Adds condition for propal module + if ($part === 'propale') $part = 'propal'; if (empty($conf->$part->enabled)) $enabled = false; if (empty($enabled)) continue; @@ -278,7 +281,7 @@ class Import { $sql = 'SELECT em.rowid, em.field, em.label, em.type'; $sql .= ' FROM '.MAIN_DB_PREFIX.'import_model as em'; - $sql .= ' WHERE em.rowid = '.$id; + $sql .= ' WHERE em.rowid = '.((int) $id); dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 9fdc5330103..71fad9dee9b 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -148,9 +148,9 @@ if ($action == 'builddoc') if ($action == 'deleteprof') { - if ($_GET["id"]) + if (GETPOST("id", 'int')) { - $objimport->fetch($_GET["id"]); + $objimport->fetch(GETPOST("id", 'int')); $result = $objimport->delete($user); } } @@ -212,9 +212,9 @@ if ($step == 3 && $datatoimport) { $langs->load("other"); - $param = '&datatoimport='.$datatoimport.'&format='.$format; - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + $param = '&datatoimport='.urlencode($datatoimport).'&format='.urlencode($format); + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); $file = $conf->import->dir_temp.'/'.GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $ret = dol_delete_file($file); @@ -321,8 +321,8 @@ if ($step == 1 || !$datatoimport) $_SESSION["dol_array_match_file_to_database"] = ''; $param = ''; - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); if ($separator) $param .= '&separator='.urlencode($separator); if ($enclosure) $param .= '&enclosure='.urlencode($enclosure); @@ -380,9 +380,9 @@ if ($step == 1 || !$datatoimport) // STEP 2: Page to select input format file if ($step == 2 && $datatoimport) { - $param = '&datatoimport='.$datatoimport; - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + $param = '&datatoimport='.urlencode($datatoimport); + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); if ($separator) $param .= '&separator='.urlencode($separator); if ($enclosure) $param .= '&enclosure='.urlencode($enclosure); @@ -460,9 +460,9 @@ if ($step == 2 && $datatoimport) // STEP 3: Page to select file if ($step == 3 && $datatoimport) { - $param = '&datatoimport='.$datatoimport.'&format='.$format; - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + $param = '&datatoimport='.urlencode($datatoimport).'&format='.urlencode($format); + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); if ($separator) $param .= '&separator='.urlencode($separator); if ($enclosure) $param .= '&enclosure='.urlencode($enclosure); @@ -639,7 +639,7 @@ if ($step == 3 && $datatoimport) // Affiche date fichier print ''.dol_print_date(dol_filemtime($dir.'/'.$file), 'dayhour').''.img_delete().''; @@ -753,9 +753,9 @@ if ($step == 4 && $datatoimport) // Now $array_match_file_to_database contains fieldnb(1,2,3...)=>fielddatabase(key in $array_match_file_to_database) - $param = '&format='.$format.'&datatoimport='.$datatoimport.'&filetoimport='.urlencode($filetoimport); - if ($excludefirstline) $param .= '&excludefirstline='.$excludefirstline; - if ($endatlinenb) $param .= '&endatlinenb='.$endatlinenb; + $param = '&format='.$format.'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport); + if ($excludefirstline) $param .= '&excludefirstline='.urlencode($excludefirstline); + if ($endatlinenb) $param .= '&endatlinenb='.urlencode($endatlinenb); if ($separator) $param .= '&separator='.urlencode($separator); if ($enclosure) $param .= '&enclosure='.urlencode($enclosure); @@ -1160,7 +1160,7 @@ if ($step == 4 && $datatoimport) print '
'; print $obj->label; print ''; - print 'rowid.'&filetoimport='.urlencode($filetoimport).'">'; + print 'rowid.'&filetoimport='.urlencode($filetoimport).'">'; print img_delete(); print ''; print '
'; if ($propname != 'rowid') { - print ''.img_delete().''; + print ''.img_delete().''; } print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; print $langs->trans("PaypalLiveEnabled").''; if (empty($conf->global->PAYPAL_API_SANDBOX)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print '
'.img_picto('', 'setup').''.$entry->code.''.$entry->description.''.price($entry->value).'id.'">'.img_edit().'  '; - print 'id.'">'.img_delete().'id.'">'.img_edit().'  '; + print 'id.'">'.img_delete().'
'.$entry->update_interval.''.$entry->getLastUpdated().'id.'">'.img_edit().'  '; - print 'id.'">'.img_delete().'
'; - if (!$disabled) print ''; + if (!$disabled) print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); if (!$disabled) print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; - print ''.$langs->trans("Disable").''; + print ''.$langs->trans("Disable").''; } else { print ' '; - print ''.$langs->trans("Activate").''; + print ''.$langs->trans("Activate").''; } print '
'.$langs->trans("ProductAccountancySellCode").''; @@ -2238,7 +2253,7 @@ if ($action != 'create' && $action != 'edit') { print ''.$langs->trans('Delete').''."\n"; } else { - print 'id.'">'.$langs->trans("Delete").''; + print 'id.'">'.$langs->trans("Delete").''; } } else { print ''.$langs->trans("Delete").''; diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index a90c9dd5b1b..6c75d96fe89 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -72,15 +72,16 @@ class Products extends DolibarrApi * @param int $id ID of product * @param int $includestockdata Load also information about stock (slower) * @param bool $includesubproducts Load information about subproducts + * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product) * @return array|mixed Data without useless information * * @throws RestException 401 * @throws RestException 403 * @throws RestException 404 */ - public function get($id, $includestockdata = 0, $includesubproducts = false) + public function get($id, $includestockdata = 0, $includesubproducts = false, $includeparentid = false) { - return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts); + return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts, $includeparentid); } /** @@ -91,6 +92,7 @@ class Products extends DolibarrApi * @param string $ref Ref of element * @param int $includestockdata Load also information about stock (slower) * @param bool $includesubproducts Load information about subproducts + * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product) * * @return array|mixed Data without useless information * @@ -100,9 +102,9 @@ class Products extends DolibarrApi * @throws RestException 403 * @throws RestException 404 */ - public function getByRef($ref, $includestockdata = 0, $includesubproducts = false) + public function getByRef($ref, $includestockdata = 0, $includesubproducts = false, $includeparentid = false) { - return $this->_fetch('', $ref, '', '', $includestockdata, $includesubproducts); + return $this->_fetch('', $ref, '', '', $includestockdata, $includesubproducts, $includeparentid); } /** @@ -113,6 +115,7 @@ class Products extends DolibarrApi * @param string $ref_ext Ref_ext of element * @param int $includestockdata Load also information about stock (slower) * @param bool $includesubproducts Load information about subproducts + * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product) * * @return array|mixed Data without useless information * @@ -122,9 +125,9 @@ class Products extends DolibarrApi * @throws RestException 403 * @throws RestException 404 */ - public function getByRefExt($ref_ext, $includestockdata = 0, $includesubproducts = false) + public function getByRefExt($ref_ext, $includestockdata = 0, $includesubproducts = false, $includeparentid = false) { - return $this->_fetch('', '', $ref_ext, '', $includestockdata, $includesubproducts); + return $this->_fetch('', '', $ref_ext, '', $includestockdata, $includesubproducts, $includeparentid); } /** @@ -135,6 +138,7 @@ class Products extends DolibarrApi * @param string $barcode Barcode of element * @param int $includestockdata Load also information about stock (slower) * @param bool $includesubproducts Load information about subproducts + * @param bool $includeparentid Load also ID of parent product (if product is a variant of a parent product) * * @return array|mixed Data without useless information * @@ -144,9 +148,9 @@ class Products extends DolibarrApi * @throws RestException 403 * @throws RestException 404 */ - public function getByBarcode($barcode, $includestockdata = 0, $includesubproducts = false) + public function getByBarcode($barcode, $includestockdata = 0, $includesubproducts = false, $includeparentid = false) { - return $this->_fetch('', '', '', $barcode, $includestockdata, $includesubproducts); + return $this->_fetch('', '', '', $barcode, $includestockdata, $includesubproducts, $includeparentid); } /** diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php index c0bbf8388a2..b59319ad985 100644 --- a/htdocs/product/dynamic_price/editor.php +++ b/htdocs/product/dynamic_price/editor.php @@ -206,7 +206,7 @@ if ($eid == 0) { print '
'.$langs->trans('Delete').'
'."\n"; } else { - print ''; + print ''; } print ''; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 3053cc45d71..f7dbc1f6410 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -425,7 +425,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 504f8419685..37f1cb9721a 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -512,7 +512,7 @@ if ($object->id > 0) print 'rowid).'">'; print '
'; - print ''.img_delete().''; + print ''.img_delete().''; print '
'; if ($candelete) { - print 'id.'&lineid='.$objp->rowid.'">'; + print 'id.'&lineid='.$objp->rowid.'">'; print img_delete(); print ''; } else print ' '; // Can not delete last price (it's current price) @@ -2148,7 +2148,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; print ' '; - print 'id.'&lineid='.$line->id.'">'; + print 'id.'&lineid='.$line->id.'">'; print img_delete('default', 'style="vertical-align: middle;"'); print ''; print ''.$line['seuil_stock_alerte'].''.$line['desiredstock'].''.img_delete().''.img_delete().'
'; @@ -272,7 +272,7 @@ if ($action == 'edit') foreach ($object->multilangs as $key => $value) { $s = picto_from_langcode($key); - print ($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; + print ($s ? $s.' ' : '')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; print '
'; print '
'; diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 937a5d28f27..f66d305f688 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -360,7 +360,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -457,7 +457,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -585,13 +585,13 @@ foreach ($dirmodels as $reldir) if (in_array($name, $def)) { print "
"; } else { print ""; } @@ -601,7 +601,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -740,7 +740,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) print ""; } else { print ""; } @@ -750,7 +750,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c1c59bcd3b7..db38e3c02d7 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1324,7 +1324,7 @@ if ($action == 'create' && $user->rights->projet->creer) { if ($userDelete > 0 || ($object->statut == 0 && $user->rights->projet->creer)) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 30a2a0c242b..cc7e57a89df 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -150,6 +150,66 @@ class Project extends CommonObject */ public $lines; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed. + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'fk_soc' =>array('type'=>'integer', 'label'=>'Fk soc', 'enabled'=>1, 'visible'=>3, 'position'=>15), + 'datec' =>array('type'=>'datetime', 'label'=>'DateCreationShort', 'enabled'=>1, 'visible'=>1, 'position'=>20), + 'tms' =>array('type'=>'timestamp', 'label'=>'DateModificationShort', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>25), + 'dateo' =>array('type'=>'date', 'label'=>'DateStart', 'enabled'=>1, 'visible'=>1, 'position'=>30), + 'datee' =>array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>1, 'visible'=>1, 'position'=>35), + 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>40, 'searchall'=>1), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>45), + 'title' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1), + 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>55, 'searchall'=>1), + 'fk_user_creat' =>array('type'=>'integer', 'label'=>'Fk user creat', 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>60), + 'public' =>array('type'=>'integer', 'label'=>'Visibility', 'enabled'=>1, 'visible'=>1, 'position'=>65), + 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500), + 'fk_opp_status' =>array('type'=>'integer', 'label'=>'OpportunityStatusShort', 'enabled'=>1, 'visible'=>1, 'position'=>75), + 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'OpportunityProbabilityShort', 'enabled'=>1, 'visible'=>1, 'position'=>80), + 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>3, 'position'=>85, 'searchall'=>1), + 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>3, 'position'=>90, 'searchall'=>1), + 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>3, 'position'=>95), + 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget', 'enabled'=>1, 'visible'=>1, 'position'=>100), + 'date_close' =>array('type'=>'datetime', 'label'=>'Date close', 'enabled'=>1, 'visible'=>3, 'position'=>105), + 'fk_user_close' =>array('type'=>'integer', 'label'=>'Fk user close', 'enabled'=>1, 'visible'=>3, 'position'=>110), + 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'OpportunityAmountShort', 'enabled'=>1, 'visible'=>1, 'position'=>115), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>3, 'position'=>120), + 'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>3, 'position'=>125), + 'usage_bill_time' =>array('type'=>'integer', 'label'=>'UsageBillTimeShort', 'enabled'=>1, 'visible'=>1, 'position'=>130), + 'usage_opportunity' =>array('type'=>'integer', 'label'=>'UsageOpportunity', 'enabled'=>1, 'visible'=>1, 'position'=>135), + 'usage_task' =>array('type'=>'integer', 'label'=>'UsageTasks', 'enabled'=>1, 'visible'=>1, 'position'=>140), + 'usage_organize_event' =>array('type'=>'integer', 'label'=>'Usage organize event', 'enabled'=>1, 'visible'=>3, 'position'=>145), + ); + // END MODULEBUILDER PROPERTIES + /** * Draft status */ @@ -165,40 +225,6 @@ class Project extends CommonObject */ const STATUS_CLOSED = 2; - - public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'fk_soc' =>array('type'=>'integer', 'label'=>'Fk soc', 'enabled'=>1, 'visible'=>-1, 'position'=>15), - 'datec' =>array('type'=>'datetime', 'label'=>'Datec', 'enabled'=>1, 'visible'=>-1, 'position'=>20), - 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), - 'dateo' =>array('type'=>'date', 'label'=>'Dateo', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'showoncombobox'=>1, 'position'=>40), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>45), - 'title' =>array('type'=>'varchar(255)', 'label'=>'Title', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50, 'showoncombobox'=>1), - 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'fk_user_creat' =>array('type'=>'integer', 'label'=>'Fk user creat', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>60), - 'public' =>array('type'=>'integer', 'label'=>'Public', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Fk statut', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), - 'fk_opp_status' =>array('type'=>'integer', 'label'=>'Fk opp status', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'opp_percent' =>array('type'=>'double(5,2)', 'label'=>'Opp percent', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>85), - 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>90), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>95), - 'budget_amount' =>array('type'=>'double(24,8)', 'label'=>'Budget amount', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'date_close' =>array('type'=>'datetime', 'label'=>'Date close', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'fk_user_close' =>array('type'=>'integer', 'label'=>'Fk user close', 'enabled'=>1, 'visible'=>-1, 'position'=>110), - 'opp_amount' =>array('type'=>'double(24,8)', 'label'=>'Opp amount', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - 'fk_user_modif' =>array('type'=>'integer', 'label'=>'Fk user modif', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'usage_bill_time' =>array('type'=>'integer', 'label'=>'Usage bill time', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'usage_opportunity' =>array('type'=>'integer', 'label'=>'Usage opportunity', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'usage_task' =>array('type'=>'integer', 'label'=>'Usage task', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'usage_organize_event' =>array('type'=>'integer', 'label'=>'Usage organize event', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - ); - - /** * Constructor * @@ -210,6 +236,22 @@ class Project extends CommonObject $this->statuts_short = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); $this->statuts_long = array(0 => 'Draft', 1 => 'Opened', 2 => 'Closed'); + + global $conf; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible'] = 0; + + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + $this->fields['fk_opp_status']['enabled'] = 0; + $this->fields['opp_percent']['enabled'] = 0; + $this->fields['opp_amount']['enabled'] = 0; + $this->fields['usage_opportunity']['enabled'] = 0; + } + + if (empty($conf->global->PROJECT_HIDE_TASKS)) { + $this->fields['usage_bill_time']['visible'] = 0; + $this->fields['usage_task']['visible'] = 0; + } } /** diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index c73a68b98ee..a2eb2d1938c 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -123,34 +123,43 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // List of fields to search into when doing a "search in all" -$fieldstosearchall = array( - 'p.ref'=>"Ref", - 'p.title'=>"Label", - 's.nom'=>"ThirdPartyName", - "p.note_public"=>"NotePublic" -); -if (empty($user->socid)) $fieldstosearchall["p.note_private"] = "NotePrivate"; +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (empty($val['searchall'])) { + continue; + } + + // Don't allow search in private notes for external users when doing "search in all" + if (!empty($user->socid) && $key == "note_private") { + continue; + } + + $fieldstosearchall['p.'.$key] = $val['label']; +} + +// Add none object fields to "search in all" +$fieldstosearchall['s.nom'] = "ThirdPartyName"; + +// Definition of fields for list +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (empty($val['visible'])) { + continue; + } + + $arrayfields['p.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($val['visible'] < 0) ? 0 : 1), + 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), + 'position'=>$val['position']); +} + +// Add none object fields to fields for list +$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1)); +$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0); +$arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106); -$arrayfields = array( - 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>10), - 'p.title'=>array('label'=>$langs->trans("Label"), 'checked'=>1, 'position'=>11), - 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1), 'position'=>20), - 'commercial'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'css'=>'tdoverflowmax100', 'position'=>21), - 'p.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), - 'p.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), - 'p.public'=>array('label'=>$langs->trans("Visibility"), 'checked'=>1, 'position'=>102), - 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>103), - 'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>104), - 'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>105), - 'opp_weighted_amount'=>array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>106), - 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), - 'p.usage_opportunity'=>array('label'=>$langs->trans("UsageOpportunity"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES ? 1 : 0), 'position'=>115), - 'p.usage_task'=>array('label'=>$langs->trans("UsageTasks"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS ? 0 : 1), 'position'=>116), - 'p.usage_bill_time'=>array('label'=>$langs->trans("UsageBillTimeShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_HIDE_TASKS ? 0 : 1), 'position'=>117), - 'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500), - 'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), - 'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), -); // Extra fields if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { @@ -160,7 +169,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); } } -$object->fields = dol_sort_array($object->fields, 'position'); + $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 72e3a1bae32..313fec73721 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -518,7 +518,7 @@ if ($id > 0 || !empty($ref)) if ($user->rights->projet->creer) { print ' '; - print ''; + print ''; print img_picto($langs->trans('Unlink'), 'unlink'); print ''; } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 49e1a3e6866..096eb62d0d0 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -604,7 +604,7 @@ if ($id > 0 || !empty($ref)) { if (!$object->hasChildren() && !$object->hasTimeSpent()) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } else { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4ded7e9d197..dfeb73bb3cc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1462,7 +1462,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print ' '; - print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_delete('default', 'class="pictodelete paddingleft"'); print ''; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index d3a9521bf25..cc4d07b0a4b 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Frédéric France +/* Copyright (C) 2018-2020 Thibault FOUCART + * Copyright (C) 2018 Frédéric France * * 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 @@ -109,7 +109,7 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled { $sql = "SELECT entity"; $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token"; - $sql .= " WHERE service = '".$db->escape($service)."' and tokenstring = '%".$db->escape($event->account)."%'"; + $sql .= " WHERE service = '".$db->escape($service)."' and tokenstring LIKE '%".$db->escape($event->account)."%'"; dol_syslog(get_class($db)."::fetch", LOG_DEBUG); $result = $db->query($sql); @@ -126,8 +126,6 @@ if (!empty($conf->multicompany->enabled) && !empty($conf->stripeconnect->enabled $key = 1; } $ret = $mc->switchEntity($key); - if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; - if (!$res) die("Include of main fails"); } // list of action diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 0758e1456ce..d41ce8e6bf4 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1909,10 +1909,10 @@ if ($action == 'create') { // edit-delete buttons print ''; print ''; // Display lines extrafields @@ -2035,7 +2035,7 @@ if ($action == 'create') if ($user->rights->reception->supprimer) { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } } diff --git a/htdocs/recruitment/admin/public_interface.php b/htdocs/recruitment/admin/public_interface.php index 8f80a7ef48d..1c943ae1085 100644 --- a/htdocs/recruitment/admin/public_interface.php +++ b/htdocs/recruitment/admin/public_interface.php @@ -93,12 +93,12 @@ print ''.$langs->trans("PublicInterfaceRecruitmentDe $enabledisablehtml = $langs->trans("EnablePublicRecruitmentPages").' '; if (empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE)) { // Button off, click to enable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml .= ''; } else { // Button on, click to disable - $enabledisablehtml .= ''; + $enabledisablehtml .= ''; $enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml .= ''; } diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index 72d455d7a14..43ffd3af439 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -319,7 +319,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -450,13 +450,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (in_array($name, $def)) { print ''; } else { print '"; } @@ -467,7 +467,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php index e3738f57564..b2b6f25524b 100644 --- a/htdocs/recruitment/admin/setup_candidatures.php +++ b/htdocs/recruitment/admin/setup_candidatures.php @@ -319,7 +319,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } @@ -450,13 +450,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { if (in_array($name, $def)) { print ''; } else { print '"; } @@ -467,7 +467,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { { print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 5e790c0b993..e25de998a36 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -543,7 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/recruitment/recruitmentjobposition_candidature.php b/htdocs/recruitment/recruitmentjobposition_candidature.php index 219bb3469f6..a945df25bfc 100644 --- a/htdocs/recruitment/recruitmentjobposition_candidature.php +++ b/htdocs/recruitment/recruitmentjobposition_candidature.php @@ -520,7 +520,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index ee09413905d..d4a115962f2 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -544,7 +544,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Delete (need delete permission, or if draft, just need create/modify permission) if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index b1fec3058c0..e170b038e7a 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -369,7 +369,7 @@ if ($action == 'create' || $object->fetch($id, $ref) > 0) if ($user->rights->resource->delete) { print ''; } } diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index e2d10ffceef..a8a946e7578 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -269,11 +269,11 @@ if ($ret) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; print ''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 6a696aa4132..ec1184a77e6 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -484,7 +484,7 @@ if ($id) { if (!empty($user->rights->salaries->delete)) { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index a66f17ca915..d27ebd79207 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -383,7 +383,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) } else { $disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); print ''; @@ -464,7 +464,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; } @@ -666,33 +666,33 @@ foreach ($profid as $key => $val) if ($verif) { - print ''; } else { - print ''; } if ($mandatory) { - print ''; } else { - print ''; } if ($invoice_mandatory) { - print ''; } else { - print ''; } @@ -776,10 +776,10 @@ print ''; print ''; @@ -791,10 +791,10 @@ print ''; print ''; @@ -808,10 +808,10 @@ print ''; print ''; @@ -824,10 +824,10 @@ print ''; print ''; diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index d7f06763034..6591e38e1cb 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -246,7 +246,7 @@ for ($i = 1; $i <= 4; $i++) { use_javascript_ajax) { ?> trans('Delete'); ?> - ">trans('Delete'); ?> + ">trans('Delete'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 14c8822dc9e..a49dbcde698 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -189,7 +189,7 @@ if ($this->control->tpl['action_delete']) echo $this->control->tpl['action_delet use_javascript_ajax) { ?> trans('Delete'); ?> - ">trans('Delete'); ?> + ">trans('Delete'); ?> diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 8104d40d201..9e6ad514da6 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2657,7 +2657,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans('Delete').''."\n"; } else { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } } } diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index ea0b3a55d8e..0534d5d0346 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1258,7 +1258,7 @@ while ($i < min($num, $limit)) { $titlealt = 'default'; if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label']; - if ($obj->stcomm_id != $val['id']) print '' . img_action($titlealt, $val['code'], $val['picto']) . ''; + if ($obj->stcomm_id != $val['id']) print '' . img_action($titlealt, $val['code'], $val['picto']) . ''; } print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 18cc536d6b8..ba1ea5d54a5 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -339,7 +339,7 @@ if ($result > 0) if ($obj->type == 'email') print $langs->trans("Email"); if ($obj->type == 'sms') print $langs->trans("SMS"); print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 26828773753..3b2cc60cce4 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1067,7 +1067,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index a3199917f53..a710f092b89 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -83,16 +83,19 @@ class Stripe extends CommonObject * * @param string $mode 'StripeTest' or 'StripeLive' * @param int $fk_soc Id of thirdparty + * @param int $entity Id of entity (-1 = current environment) * @return string Stripe account 'acc_....' or '' if no OAuth token found */ - public function getStripeAccount($mode = 'StripeTest', $fk_soc = 0) + public function getStripeAccount($mode = 'StripeTest', $fk_soc = 0, $entity = -1) { global $conf; + if ($entity < 0) $entity = $conf->entity; + $sql = "SELECT tokenstring"; $sql .= " FROM ".MAIN_DB_PREFIX."oauth_token"; - $sql .= " WHERE entity = ".$conf->entity; - $sql .= " AND service = '".$this->db->escape($mode)."'"; + $sql .= " WHERE service = '".$this->db->escape($mode)."'"; + $sql .= " AND entity = ".((int) $entity); if ($fk_soc > 0) { $sql .= " AND fk_soc = ".$fk_soc; } else { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 1e884629791..1190b29aa3c 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1902,7 +1902,7 @@ if ($action == 'create') // Delete if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) { - print ''; } } diff --git a/htdocs/takepos/admin/receipt.php b/htdocs/takepos/admin/receipt.php index 62e08d2084d..d7162138fe3 100644 --- a/htdocs/takepos/admin/receipt.php +++ b/htdocs/takepos/admin/receipt.php @@ -104,7 +104,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; @@ -121,7 +121,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { if ($conf->global->TAKEPOS_PRINT_METHOD == "receiptprinter") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } } else { print ''; @@ -141,7 +141,7 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print "\n"; print '
\n"; - print 'scandir.'&label='.urlencode($module->name).'">'; + print 'scandir.'&label='.urlencode($module->name).'">'; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; - print 'id.'">'.img_edit().''; + print 'id.'">'.img_edit().''; print ''; - print 'id.'">'.img_delete().''; + print 'id.'">'.img_delete().''; print ''."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'."\n"; - print ''; + print ''; print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; - print ''; + print ''; print img_edit(); print ''; print ' '; - print ''; + print ''; print img_delete('', 'class="marginleftonly"'); print ''; print ''; - if (!$disabled) print ''; + if (!$disabled) print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); if (!$disabled) print ''; print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ' '; if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '; if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '; if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '; if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { - print ''; + print ''; print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); } print ' '.img_delete().''.img_delete().'
'; if (empty($companypaymentmodetemp->default_rib)) { - print ''; + print ''; print img_picto($langs->trans("Default"), 'off'); print ''; } else { @@ -1094,11 +1094,11 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''.$langs->trans("CreateCardOnStripe").''; } - print ''; + print ''; print img_picto($langs->trans("Modify"), 'edit'); print ''; print ' '; - print ''; // source='.$companypaymentmodetemp->stripe_card_ref.'& + print ''; // source='.$companypaymentmodetemp->stripe_card_ref.'& print img_picto($langs->trans("Delete"), 'delete'); print ''; } @@ -1225,7 +1225,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if ((empty($customerstripe->invoice_settings) && $customerstripe->default_source != $src->id) || (!empty($customerstripe->invoice_settings) && $customerstripe->invoice_settings->default_payment_method != $src->id)) { - print ''; + print ''; print img_picto($langs->trans("Default"), 'off'); print ''; } else { @@ -1248,7 +1248,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; if ($user->rights->societe->creer) { - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; } @@ -1270,7 +1270,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' } // List of Stripe payment modes - if (!empty($conf->stripe->enabled) && !empty($conf->stripeconnect->enabled) && $object->fournisseur && !empty($stripesupplieracc)) + if (!empty($conf->stripe->enabled) && !empty($conf->stripeconnect->enabled) && !empty($stripesupplieracc)) { print load_fiche_titre($langs->trans('StripeBalance').($stripesupplieracc ? ' (Stripe connection with StripeConnect account '.$stripesupplieracc.')' : ' (Stripe connection with keys from Stripe module setup)'), $morehtmlright, 'stripe-s'); $balance = \Stripe\Balance::retrieve(array("stripe_account" => $stripesupplieracc)); @@ -1420,7 +1420,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' // Default print ''; if (!$rib->default_rib) { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'off'); print ''; } else { @@ -1492,7 +1492,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print img_picto($langs->trans("Modify"), 'edit'); print ''; - print ''; + print ''; print img_picto($langs->trans("Delete"), 'delete'); print ''; } diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 8fb17a59e3f..4a709fb9009 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -593,7 +593,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print img_edit('default', 0, 'style="vertical-align: middle;"'); print ''; print ' '; - print 'id.'&lineid='.$line->id.'">'; + print 'id.'&lineid='.$line->id.'">'; print img_delete('default', 'style="vertical-align: middle;"'); print ''; print '
'; diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 48c713f4b66..9471e9d1ea4 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -194,7 +194,7 @@ foreach ($dirmodels as $reldir) { print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index 4666de59a8e..973bbabba2d 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -669,3 +669,71 @@ div#moreinfo, div#infowarehouse { padding-right: 4px; } } + +/* Modal box */ +.modal { + display: none; /* Hidden by default */ + position: fixed; + z-index: 20; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.4); +} + +/* The Close Button */ +.close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close:hover, +.close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +.modal-header { + padding: 2px 16px; + background-color: #2b4161; + color: white; +} + +.modal-body {padding: 2px 16px;} + +.modal-content { + position: relative; + background-color: #fefefe; + margin: 15% auto; /* 15% from the top and centered */ + padding: 0; + border: 1px solid #888; + width: 40%; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); + animation-name: animatetop; + animation-duration: 0.4s; + min-width: 200px; +} + +@keyframes animatetop { + from {top: -300px; opacity: 0} + to {top: 0; opacity: 1} +} + +.block { + display: block; + width: 100%; + border: none; + color: white; + background-color: #8c907e; + padding: 14px 28px; + font-size: 16px; + cursor: pointer; + text-align: center; + margin: 2px; +} diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 73b039d97e9..66212ab3203 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -432,7 +432,7 @@ function ChangeThirdparty(idcustomer) { function deleteline() { console.log("Delete line"); - $("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() { + $("#poslines").load("invoice.php?action=deleteline&token=&place="+place+"&idline="+selectedline, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); ClearSearch(); @@ -499,7 +499,7 @@ function New() { if (r == true) { // Reload section with invoice lines - $("#poslines").load("invoice.php?action=delete&place=" + place, function () { + $("#poslines").load("invoice.php?action=delete&token=&place=" + place, function () { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); ClearSearch(); @@ -728,27 +728,12 @@ function CashReport(rowid) // Popup to select the terminal to use function TerminalsDialog() { - jQuery("#dialog-info").dialog({ - resizable: false, - height: global->TAKEPOS_NUM_TERMINALS / 3 * 20); ?>, - width: dol_optimize_smallscreen ? 316 : 400); ?>, - modal: true, - buttons: { - 'trans("Terminal")) ?> 1': function() { - location.href='index.php?setterminal=1'; - } - global->TAKEPOS_NUM_TERMINALS; $i++) - { - print ", - '".dol_escape_js($langs->trans("Terminal"))." ".$i."': function() { - location.href='index.php?setterminal=".$i."'; - } - "; - } - ?> - } - }); + var modal = document.getElementById("ModalTerminal"); + var span = document.getElementsByClassName("close")[0]; + span.onclick = function() { + modal.style.display = "none"; + } + modal.style.display = "block"; } function DirectPayment(){ @@ -802,7 +787,6 @@ $( document ).ready(function() { '.$langs->trans('TerminalSelect').'
'; $keyCodeForEnter = $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} > 0 ? $conf->global->{'CASHDESK_READER_KEYCODE_FOR_ENTER'.$_SESSION['takeposterminal']} : ''; ?>
@@ -853,6 +837,28 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) { } ?> + + + + +
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 3a7d90cb732..f560fee0b44 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -233,29 +233,30 @@ if ($action == 'valid' && $user->rights->facture->creer) // $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; //} - $remaintopay = $invoice->getRemainToPay(); - // Add the payment - if (!$error && $res >= 0 && $remaintopay > 0) { - $payment = new Paiement($db); - $payment->datepaye = $now; - $payment->fk_account = $bankaccount; - $payment->amounts[$invoice->id] = $amountofpayment; - if ($pay == 'cash') $payment->pos_change = price2num(GETPOST('excess', 'alpha')); + if (!$error && $res >= 0) { + $remaintopay = $invoice->getRemainToPay(); + if ($remaintopay > 0) { + $payment = new Paiement($db); + $payment->datepaye = $now; + $payment->fk_account = $bankaccount; + $payment->amounts[$invoice->id] = $amountofpayment; + if ($pay == 'cash') $payment->pos_change = price2num(GETPOST('excess', 'alpha')); - // If user has not used change control, add total invoice payment - // Or if user has used change control and the amount of payment is higher than remain to pay, add the remain to pay - if ($amountofpayment == 0 || $amountofpayment > $remaintopay) $payment->amounts[$invoice->id] = $remaintopay; + // If user has not used change control, add total invoice payment + // Or if user has used change control and the amount of payment is higher than remain to pay, add the remain to pay + if ($amountofpayment == 0 || $amountofpayment > $remaintopay) $payment->amounts[$invoice->id] = $remaintopay; - $payment->paiementid = $paiementid; - $payment->num_payment = $invoice->ref; + $payment->paiementid = $paiementid; + $payment->num_payment = $invoice->ref; - if ($pay != "delayed") { - $payment->create($user); - $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + if ($pay != "delayed") { + $payment->create($user); + $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', ''); + $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded + } } - $remaintopay = $invoice->getRemainToPay(); // Recalculate remain to pay after the payment is recorded if ($remaintopay == 0) { dol_syslog("Invoice is paid, so we set it to status Paid"); $result = $invoice->set_paid($user); diff --git a/htdocs/takepos/phone.php b/htdocs/takepos/phone.php index 119752014a1..14ca718740b 100644 --- a/htdocs/takepos/phone.php +++ b/htdocs/takepos/phone.php @@ -250,7 +250,7 @@ function SetQty(place, selectedline, qty){ if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { ?> if (qty==0){ - $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() { + $("#phonediv2").load("auto_order.php?mobilepage=invoice&action=deleteline&token=&place="+place+"&idline="+selectedline, function() { }); } else{ @@ -262,7 +262,7 @@ function SetQty(place, selectedline, qty){ else { ?> if (qty==0){ - $("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&place="+place+"&idline="+selectedline, function() { + $("#phonediv2").load("invoice.php?mobilepage=invoice&action=deleteline&token=&place="+place+"&idline="+selectedline, function() { }); } else{ @@ -271,7 +271,7 @@ function SetQty(place, selectedline, qty){ } + ?> LoadCats(); } diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index c640fc1fb21..c866b187638 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -70,7 +70,6 @@ span.butAction, span.butActionDelete { margin: 0em em; padding: 0.6em em; - font-family: ; display: inline-block; text-align: center; cursor: pointer; @@ -277,6 +276,9 @@ div.pagination li:first-child a.btnTitle{ /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ @media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.95em; + } .btnTitle, a.btnTitle { display: inline-block; padding: 4px 4px 4px 4px; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 03e9fe52781..1719013bdf5 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1265,7 +1265,7 @@ elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action = // Delete ticket if ($user->rights->ticket->delete && !$user->socid) { - print ''; + print ''; } } print '
'."\n"; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 9a142ef4ba7..49185f093fc 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -408,7 +408,7 @@ class ActionsTicket { $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action } else { - $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&new_status='.$status; + $urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&token='.newToken().'&new_status='.$status; } print ''; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 96b9d55af6a..95a60804cfb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -117,6 +117,7 @@ $hookmanager->initHooks(array('usercard', 'globalcard')); /** * Actions */ + $parameters = array('id' => $id, 'socid' => $socid, 'group' => $group, 'caneditgroup' => $caneditgroup); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -1898,7 +1899,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($user->admin || !$object->admin) // If user edited is admin, delete is possible on for an admin { - print ''; + print ''; } else { print ''; } diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index febdf3373fe..e8ffbd7c1f7 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -385,12 +385,12 @@ else { if ($caneditperms) { - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } if ($candisableperms) { - print ''.$langs->trans("DeleteGroup").''; + print ''.$langs->trans("DeleteGroup").''; } print "
\n"; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 406401bdf38..0bed08c3c31 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -38,7 +38,15 @@ if (!$user->rights->user->user->lire && !$user->admin) { // Load translation files required by page $langs->loadLangs(array('users', 'companies', 'hrm')); +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Security check (for external users) $socid = 0; @@ -54,25 +62,33 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { $page = 0; } +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortfield) $sortfield = "u.login"; -if (!$sortorder) $sortorder = "ASC"; - -// Define value to know what current user can do on users -$canadduser = (!empty($user->admin) || $user->rights->user->user->creer); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new User($db); -$hookmanager->initHooks(array('userlist')); $extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('userlist')); -// fetch optionals attributes and labels +// Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); + $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); +if (!$sortfield) $sortfield = "u.login"; +if (!$sortorder) $sortorder = "ASC"; + +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) +{ + if (GETPOST('search_'.$key, 'alpha') !== '') $search[$key] = GETPOST('search_'.$key, 'alpha'); +} + $userstatic = new User($db); $companystatic = new Societe($db); $form = new Form($db); @@ -115,8 +131,16 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) - $arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { + $arrayfields["ef.".$key] = array( + 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], + 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), + 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], + 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]), + 'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key], + 'help'=>$extrafields->attributes[$object->table_element]['help'][$key] + ); + } } } $object->fields = dol_sort_array($object->fields, 'position'); @@ -144,6 +168,20 @@ $catid = GETPOST('catid', 'int'); if ($search_statut == '') $search_statut = '1'; if ($mode == 'employee' && !GETPOSTISSET('search_employee')) $search_employee = 1; +// Define value to know what current user can do on users +$permissiontoadd = (!empty($user->admin) || $user->rights->user->user->creer); +$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); +$canedituser = (!empty($user->admin) || $user->rights->user->user->creer); +$candisableuser = (!empty($user->admin) || $user->rights->user->user->supprimer); +$canreadgroup = $canreaduser; +$caneditgroup = $canedituser; +if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) +{ + $canreadgroup = (!empty($user->admin) || $user->rights->user->group_advance->read); + $caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write); +} + +$error = 0; /* @@ -154,7 +192,7 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction = ''; } $parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters); // Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -184,6 +222,72 @@ if (empty($reshook)) $search_array_options = array(); $search_categ = 0; } + + // Mass actions + $objectclass = 'User'; + $objectlabel = 'User'; + $uploaddir = $conf->user->dir_output; + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; + + // Disable or Enable records + if (!$error && ($massaction == 'disable' || $massaction == 'reactivate') && $permissiontoadd) + { + $objecttmp = new User($db); + + if (!$error) + { + $db->begin(); + + $nbok = 0; + foreach ($toselect as $toselectid) + { + if ($toselectid == $user->id) { + setEventMessages($langs->trans($massaction == 0 ? 'CantDisableYourself' : 'CanEnableYourself'), null, 'errors'); + $error++; + break; + } + + $result = $objecttmp->fetch($toselectid); + if ($result > 0) { + if ($objecttmp->admin) { + setEventMessages($langs->trans($massaction == 0 ? 'CantDisableAnAdminUserWithMassActions' : 'CantEnableAnAdminUserWithMassActions', $objecttmp->login), null, 'errors'); + $error++; + break; + } + + $result = $objecttmp->setstatus($massaction == 'disable' ? 0 : 1); + if ($result == 0) { + // Nothing is done + } elseif ($result < 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else $nbok++; + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (!$error && !empty($conf->file->main_limit_users)) { + $nb = $object->getNbOfUsers("active"); + if ($nb >= $conf->file->main_limit_users) { + $error++; + setEventMessages($langs->trans("YourQuotaOfUsersIsReached"), null, 'errors'); + } + } + + if (!$error) + { + if ($nbok > 1) setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + else setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + $db->commit(); + } else { + $db->rollback(); + } + } + } } @@ -191,7 +295,11 @@ if (empty($reshook)) * View */ -$htmlother = new FormOther($db); +$formother = new FormOther($db); + +//$help_url="EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject"; +$help_url = ''; +$text = $langs->trans("ListOfUsers"); $user2 = new User($db); @@ -203,11 +311,13 @@ $sql .= " u2.rowid as id2, u2.login as login2, u2.firstname as firstname2, u2.la $sql .= " s.nom as name, s.canvas"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); } // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook +$sql .= preg_replace('/^,/', '', $hookmanager->resPrint); +$sql = preg_replace('/,\s*$/', '', $sql); $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (u.rowid = ef.fk_object)"; @@ -246,29 +356,41 @@ if ($search_categ == -2) $sql .= " AND cu.fk_categorie IS NULL"; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); -$nbtotalofrecords = 0; -$result = $db->query($sql); -if ($result) +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + if (($page * $limit) > $nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0 + { + $page = 0; + $offset = 0; + } +} +// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) +{ + $num = $nbtotalofrecords; +} else { + if ($limit) $sql .= $db->plimit($limit + 1, $offset); + + $resql = $db->query($sql); + if (!$resql) + { + dol_print_error($db); + exit; + } + + $num = $db->num_rows($resql); } -$sql .= $db->plimit($limit + 1, $offset); - -$result = $db->query($sql); -if (!$result) -{ - dol_print_error($db); - exit; -} - -$num = $db->num_rows($result); - -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) +// Direct jump if only one record found +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; @@ -276,7 +398,10 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ exit; } -llxHeader('', $langs->trans("ListOfUsers")); +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $langs->trans("ListOfUsers"), $help_url); $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); @@ -299,11 +424,14 @@ if ($search_categ > 0) $param .= "&search_categ=".urlencode($search_categ); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; -$text = $langs->trans("ListOfUsers"); +// List of mass actions available +$arrayofmassactions = array(); +if ($permissiontoadd) $arrayofmassactions['disable'] = $langs->trans("DisableUser"); +if ($permissiontoadd) $arrayofmassactions['reactivate'] = $langs->trans("Reactivate"); +//if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); -$url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='; -if (!empty($socid)) $url .= '&socid='.$socid; -$newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $canadduser); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +$massactionbutton = $form->selectMassAction('', $arrayofmassactions); print '
'."\n"; if ($optioncss != '') print ''; @@ -314,12 +442,24 @@ print ''; print ''; print ''; -$param = array('morecss'=>'btnTitleSelected'); -$morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $param); -$param = array('morecss'=>'marginleftonly'); -$morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $param); +$url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='; +if (!empty($socid)) $url .= '&socid='.$socid; -print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'user', 0, $morehtmlright.' '.$newcardbutton, '', $limit, 0, 0, 1); +$newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); + +$moreparam = array('morecss'=>'btnTitleSelected'); +$morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); +$moreparam = array('morecss'=>'marginleftonly'); +$morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); + +print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'user', 0, $morehtmlright.' '.$newcardbutton, '', $limit, 0, 0, 1); + +// Add code for pre mass action (confirmation or email presend form) +$topicmail = "SendUserRef"; +$modelmail = "user"; +$objecttmp = new User($db); +$trackid = 'use'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if (!empty($catid)) { @@ -330,29 +470,32 @@ if (!empty($catid)) print "

"; } -if ($sall) +if ($search_all) { foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val); - print '
'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'
'; } $moreforfilter = ''; +/*$moreforfilter.='
'; + $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= '
';*/ // Filter on categories if (!empty($conf->categorie->enabled)) { $moreforfilter .= '
'; $moreforfilter .= $langs->trans('Categories').': '; - $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1); + $moreforfilter .= $formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1); $moreforfilter .= '
'; } $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; else $moreforfilter = $hookmanager->resPrint; -if ($moreforfilter) +if (!empty($moreforfilter)) { print '
'; print $moreforfilter; @@ -360,14 +503,14 @@ if ($moreforfilter) } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); +print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''."\n"; -print '
'; -print '
'."\n"; - -// Search bar +// Fields title search +// -------------------------------------------------------------------- print ''; if (!empty($arrayfields['u.login']['checked'])) { @@ -433,7 +576,7 @@ if (!empty($arrayfields['u.datepreviouslogin']['checked'])) include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['u.datec']['checked'])) { @@ -456,11 +599,10 @@ if (!empty($arrayfields['u.statut']['checked'])) } // Action column print ''; - -print "\n"; +print ''."\n"; print ''; @@ -481,21 +623,38 @@ if (!empty($arrayfields['u.datepreviouslogin']['checked'])) print_liste_field_ti include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['u.datec']['checked'])) print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "u.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['u.tms']['checked'])) print_liste_field_titre("DateModificationShort", $_SERVER["PHP_SELF"], "u.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); if (!empty($arrayfields['u.statut']['checked'])) print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "u.statut", "", $param, '', $sortfield, $sortorder, 'center '); -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); -print "\n"; +// Action column +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +print ''."\n"; +// Detect if we need a fetch on each output line +$needToFetchEachLine = 0; +if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 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 + } +} + +// Loop on record +// -------------------------------------------------------------------- $i = 0; $totalarray = array(); -while ($i < min($num, $limit)) +while ($i < ($limit ? min($num, $limit) : $num)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); + if (empty($obj)) break; // Should not happen + + // Store properties in $object + $object->setVarsFromFetchObj($obj); $userstatic->id = $obj->rowid; $userstatic->admin = $obj->admin; @@ -512,7 +671,7 @@ while ($i < min($num, $limit)) $li = $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1); - print ""; + print ''; if (!empty($arrayfields['u.login']['checked'])) { print ''; + print ''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['u.firstname']['checked'])) { - print ''; + print ''; if (!$i) $totalarray['nbfield']++; } if (!empty($arrayfields['u.gender']['checked'])) @@ -645,8 +804,8 @@ while ($i < min($num, $limit)) // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['u.datec']['checked'])) @@ -672,23 +831,44 @@ while ($i < min($num, $limit)) if (!$i) $totalarray['nbfield']++; } // Action column - print ''; + print ''; if (!$i) $totalarray['nbfield']++; - print "\n"; + print ''."\n"; $i++; } +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) +{ + $colspan = 1; + foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + print ''; +} + + +$db->free($resql); + $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print "
'; -$searchpicto = $form->showFilterAndCheckAddButtons(0); +$searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'; @@ -529,12 +688,12 @@ while ($i < min($num, $limit)) } if (!empty($arrayfields['u.lastname']['checked'])) { - print ''.$obj->lastname.''.$obj->lastname.''.$obj->firstname.''.$obj->firstname.''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected = 0; + if (in_array($object->id, $arrayofselected)) $selected = 1; + print ''; + } + print '
'.$langs->trans("NoRecordFound").'
"; -print '
'; -print "\n"; +print ''."\n"; +print '
'."\n"; + +print ''."\n"; -$db->free($result); // End of page llxFooter(); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index bc07dc0270d..ca90e7f60e9 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -313,7 +313,7 @@ if ($result > 0) if ($obj->type == 'email') print $langs->trans("Email"); if ($obj->type == 'sms') print $langs->trans("SMS"); print ''; - print ''.img_delete().''; + print ''.img_delete().''; print ''; $i++; } diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 13b7408fc93..c1bbc6fe6e2 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -219,8 +219,8 @@ if ($action == 'edit') { @@ -263,7 +263,7 @@ if ($action == 'edit') { value) ?> - + '.$prodstatic->getLibStatut(2, 1).''; print ''; print 'id.'">'.img_edit().''; - print 'id.'">'.img_delete().''; + print 'id.'">'.img_delete().''; print ''; print ''; if ($productCombinations || $massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 971533bdd25..7973553f6d0 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -126,7 +126,7 @@ foreach ($variants as $key => $attribute) { print ''.$attribute->countChildProducts().''; print ''; print ''.img_edit().''; - print ''.img_delete().''; + print ''.img_delete().''; print ''; print ''; if ($key > 0) { diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index b5e29e04176..8e9584a86ac 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2020 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 @@ -104,6 +105,15 @@ class WebsitePage extends CommonObject */ public $author_alias; + /** + * @var string path of external object + */ + public $object_type; + + /** + * @var string id of external object + */ + public $fk_object; const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; @@ -161,6 +171,8 @@ class WebsitePage extends CommonObject 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-1, 'position'=>512), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-1, 'index'=>1, 'position'=>1000, 'notnull'=>-1), + 'object_type' => array('type' => 'varchar(255)','label' => 'ObjectType', 'enabled'=>1, 'visible'=>1, 'position'=>46, 'searchall'=>0, 'help'=>''), + 'fk_object' => array('type' => 'varchar(255)','label' => 'ObjectId', 'enabled'=>1, 'visible'=>1, 'position'=>47, 'searchall'=>0, 'help'=>'') ); // END MODULEBUILDER PROPERTIES @@ -260,7 +272,9 @@ class WebsitePage extends CommonObject $sql .= " t.fk_user_creat,"; $sql .= " t.author_alias,"; $sql .= " t.fk_user_modif,"; - $sql .= " t.import_key"; + $sql .= " t.import_key,"; + $sql .= " t.object_type,"; + $sql .= " t.fk_object"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; //$sql .= ' WHERE entity IN ('.getEntity('website').')'; // entity is on website level $sql .= ' WHERE 1 = 1'; @@ -319,6 +333,8 @@ class WebsitePage extends CommonObject $this->author_alias = $obj->author_alias; $this->fk_user_modif = $obj->fk_user_modif; $this->import_key = $obj->import_key; + $this->object_type = $obj->object_type; + $this->fk_object = $obj->fk_object; } $this->db->free($resql); @@ -374,7 +390,9 @@ class WebsitePage extends CommonObject $sql .= " t.fk_user_creat,"; $sql .= " t.author_alias,"; $sql .= " t.fk_user_modif,"; - $sql .= " t.import_key"; + $sql .= " t.import_key,"; + $sql .= " t.object_type,"; + $sql .= " t.fk_object"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.fk_website = '.$websiteid; // Manage filter @@ -443,6 +461,8 @@ class WebsitePage extends CommonObject $record->author_alias = $obj->author_alias; $record->fk_user_modif = $obj->fk_user_modif; $record->import_key = $obj->import_key; + $record->object_type = $obj->object_type; + $record->fk_object = $obj->fk_object; //var_dump($record->id); $records[$record->id] = $record; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 7614f6cc876..fed5be51e87 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 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 @@ -941,7 +942,8 @@ if ($action == 'addcontainer') $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); $objectpage->htmlheader = GETPOST('htmlheader', 'none'); $objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'); - + $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS'); + $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID'); $substitutionarray = array(); $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); @@ -1657,6 +1659,8 @@ if ($action == 'updatemeta') $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); $objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); $objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); + $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); + $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID', 'aZ09'); $newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int')); if ($newdatecreation) $objectpage->date_creation = $newdatecreation; @@ -2429,7 +2433,7 @@ if (!GETPOST('hide_websitemenu')) print ''; } } else { - print ''; + print ''; } @@ -2734,10 +2738,10 @@ if (!GETPOST('hide_websitemenu')) //print ''; if (empty($conf->global->WEBSITE_EDITINLINE)) { - print ''.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').''; + print ''.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').''; } else { - print ''.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').''; + print ''.img_picto($langs->trans("EditInLineOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').''; } } @@ -2746,10 +2750,10 @@ if (!GETPOST('hide_websitemenu')) print $langs->trans("ShowSubcontainers"); if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE)) { - print ''.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').''; + print ''.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').''; } else { - print ''.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').''; + print ''.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("On")), 'switch_on', '', false, 0, 0, '', 'nomarginleft').''; } /*}*/ print ''; @@ -2766,7 +2770,7 @@ if (!GETPOST('hide_websitemenu')) else { //$disabled=''; //print ''; - print 'ref.'&pageid='.$pageid.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'">'; + print 'ref.'&pageid='.$pageid.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'">'; } print ''; print ''; @@ -3578,6 +3582,18 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ""; } + print ''; + print 'ObjectClass'; + print ''; + print ''; + print ''; + + print ''; + print 'ObjectID'; + print ''; + print ''; + print ''; + $fuser = new User($db); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index c1057935e31..403128a0f8b 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -331,7 +331,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($user->rights->website->delete) { - print ''."\n"; + print ''."\n"; } } print ''."\n"; diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index efb02395e7b..721b40ebfd9 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -353,7 +353,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ if ($user->rights->mymodule->delete) { - print ''.$langs->trans('Delete').''."\n"; + print ''.$langs->trans('Delete').''."\n"; } else { print ''.$langs->trans('Delete').''."\n"; }