diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 348f1e30cb5..01645c6cccc 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -224,7 +224,11 @@ print ''.$langs->trans("Parameter").''.$langs->trans("ShowVATIntaInAddress").''; -print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS', (!empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS)) ? $conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_TVAINTRA_NOT_IN_ADDRESS'); +} else { + print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS', (!empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS)) ? $conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS : 0, 1); +} print ''; // Show prof id in address into pdf @@ -240,7 +244,11 @@ for ($i = 1; $i <= 6; $i++) { if ($pid) { print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid.''; $keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS'; - print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant) ? $conf->global->$keyforconstant : 0, 1, $noCountryCode); + if ($conf->use_javascript_ajax) { + print ajax_constantonoff($keyforconstant); + } else { + print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant) ? $conf->global->$keyforconstant : 0, 1, $noCountryCode); + } print ''; } } @@ -259,7 +267,11 @@ if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) { if ($mysoc->useLocalTax(1)) { $locales = $langs->transcountry("LT1", $mysoc->country_code); $text = ''.$langs->trans("HideLocalTaxOnPDF", $langs->transcountry("LT1", $mysoc->country_code)).''; - $text .= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1); + if ($conf->use_javascript_ajax) { + $text .= ajax_constantonoff('MAIN_PDF_MAIN_HIDE_SECOND_TAX'); + } else { + $text .= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1); + } $text .= ''; } @@ -267,7 +279,11 @@ if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) { $locales .= ($locales ? ' & ' : '').$langs->transcountry("LT2", $mysoc->country_code); $text .= ''.$langs->trans("HideLocalTaxOnPDF", $langs->transcountry("LT2", $mysoc->country_code)).''; - $text .= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); + if ($conf->use_javascript_ajax) { + $text .= ajax_constantonoff('MAIN_PDF_MAIN_HIDE_THIRD_TAX'); + } else { + $text .= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); + } $text .= ''; } } @@ -285,7 +301,11 @@ print ''.$langs->trans("Parameter").''.$langs->trans("HideAnyVATInformationOnPDF").''; -print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT'); +} else { + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT : 0, 1); +} print ''; // Locataxes @@ -321,13 +341,21 @@ if (!empty($conf->projet->enabled)) { //Invert sender and recipient print ''.$langs->trans("SwapSenderAndRecipientOnPDF").''; -print $form->selectyesno('MAIN_INVERT_SENDER_RECIPIENT', (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) ? $conf->global->MAIN_INVERT_SENDER_RECIPIENT : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_INVERT_SENDER_RECIPIENT'); +} else { + print $form->selectyesno('MAIN_INVERT_SENDER_RECIPIENT', (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) ? $conf->global->MAIN_INVERT_SENDER_RECIPIENT : 0, 1); +} print ''; // Place customer adress to the ISO location print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").''; -print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION', (!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION)) ? $conf->global->MAIN_PDF_USE_ISO_LOCATION : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_PDF_USE_ISO_LOCATION'); +} else { + print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION', (!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION)) ? $conf->global->MAIN_PDF_USE_ISO_LOCATION : 0, 1); +} print ''; // Use 2 languages into PDF @@ -345,25 +373,41 @@ print ''; //Desc print ''.$langs->trans("HideDescOnPDF").''; -print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC'); +} else { + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1); +} print ''; //Ref print ''.$langs->trans("HideRefOnPDF").''; -print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_REF'); +} else { + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF : 0, 1); +} print ''; //Details print ''.$langs->trans("HideDetailsOnPDF").''; -print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS'); +} else { + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS : 0, 1); +} print ''; // SHOW_SUBPRODUCT_REF_IN_PDF - Option to show the detail of product ref for kits. print ''.$langs->trans("SHOW_SUBPRODUCT_REF_IN_PDF", $langs->transnoentitiesnoconv("AssociatedProductsAbility"), $langs->transnoentitiesnoconv("Products")).''; -print $form->selectyesno('SHOW_SUBPRODUCT_REF_IN_PDF', (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) ? $conf->global->SHOW_SUBPRODUCT_REF_IN_PDF : 0, 1); +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SHOW_SUBPRODUCT_REF_IN_PDF'); +} else { + print $form->selectyesno('SHOW_SUBPRODUCT_REF_IN_PDF', (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) ? $conf->global->SHOW_SUBPRODUCT_REF_IN_PDF : 0, 1); +} print ''; // Show more details in footer