';
print '';
- print ''.$langs->trans("VATManagement").' '.$langs->trans("Description").' ';
+ print ''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).' '.$langs->trans("Description").' ';
print ' ';
print " \n";
- print '';
- print " global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")." ";
+ // Note: When option is not set, it must not appears as set on on, because there is no default value for this option
+ print " global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)." ";
print '';
- print "";
- print "".$langs->trans("VATIsUsedDesc")." ";
- if ($mysoc->country_code == 'FR') print "".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")." \n";
+ print '';
+ print "".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)." ";
+ $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
+ print ($example!="LocalTax2IsUsedExample"?"".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)." \n":"");
+ if(! isOnlyOneLocalTax(2))
+ {
+ print ''.$langs->trans("LTRate").' : ';
+ $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
+ print ' ';
+ }
+ print ''.$langs->trans("CalcLocaltax").' : ';
+ print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
+ print ' ';
print "
";
print "\n";
- print '';
- print " global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")." ";
+ print " global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)." ";
print '';
print "";
- print "".$langs->trans("VATIsNotUsedDesc")." ";
- if ($mysoc->country_code == 'FR') print "".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")." \n";
+ print "".$langs->transcountry("LocalTax2IsNotUsedDesc", $mysoc->country_code)." ";
+ $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
+ print ($example!="LocalTax2IsNotUsedExample"?"".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)." \n":"");
print "
";
print " \n";
-
print "
";
- print "";
-
- /*
- * Local Taxes
- */
- if ($mysoc->useLocalTax(1)) // True if we found at least on vat with a setup adding a localtax 1
- {
- // Local Tax 1
- print ' ';
- print '";
- }
- if ($mysoc->useLocalTax(2)) // True if we found at least on vat with a setup adding a localtax 1
- {
- // Local Tax 2
- print ' ';
- print '";
- }
-
-
- // Actions buttons
- print '';
}
+
+print '';
+print ' ';
+print '
';
+
+print '';
+
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index 47f668f69c3..d69a14deb2e 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -174,8 +174,8 @@ llxHeader();
print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup');
-print $langs->transnoentities("DelaysOfToleranceDesc", img_warning());
-print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')." \n";
+print ''.$langs->transnoentities("DelaysOfToleranceDesc", img_warning());
+print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')." \n";
print " \n";
$countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").') ';
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index b07a7984e09..dfbb548f5e0 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -222,375 +222,218 @@ $formadmin=new FormAdmin($db);
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
print ''.$langs->trans("DisplayDesc")." \n";
-print " \n";
+//WYSIWYG Editor
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
-if ($action == 'edit') // Edit
+print '';
+
// End of page
llxFooter();
diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php
index c9e69cc469e..ea19b7034a6 100644
--- a/htdocs/admin/limits.php
+++ b/htdocs/admin/limits.php
@@ -90,7 +90,7 @@ llxHeader();
print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup');
-print $langs->trans("LimitsDesc")." \n";
+print ''.$langs->trans("LimitsDesc")." \n";
print " \n";
if ($action == 'edit')
diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php
index b334ccadf45..4187c4d3eb4 100644
--- a/htdocs/admin/menus.php
+++ b/htdocs/admin/menus.php
@@ -159,116 +159,63 @@ print ''.$langs->trans("MenusDesc")." \n";
print " \n";
-if ($action == 'edit')
-{
- clearstatcache();
+clearstatcache();
- // Gestionnaires de menu
- print '';
- print ''.$langs->trans("Menu").' ';
- print '';
- print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc"));
- print ' ';
- print '';
- print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc"));
- print ' ';
- print ' ';
+// Gestionnaires de menu
+print '';
+print ''.$langs->trans("Menu").' ';
+print '';
+print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc"));
+print ' ';
+print '';
+print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc"));
+print ' ';
+print ' ';
- // Menu top
- print ''.$langs->trans("DefaultMenuManager").' ';
- print '';
- $formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled');
- print ' ';
- print '';
- $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled');
- print ' ';
- print ' ';
+// Menu top
+print ''.$langs->trans("DefaultMenuManager").' ';
+print '';
+$formadmin->select_menu(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED, 'MAIN_MENU_STANDARD', $dirstandard, empty($conf->global->MAIN_MENU_STANDARD_FORCED)?'':' disabled');
+print ' ';
+print '';
+$formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED, 'MAIN_MENUFRONT_STANDARD', $dirstandard, empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?'':' disabled');
+print ' ';
+print ' ';
- // Menu smartphone
- print ''.$langs->trans("DefaultMenuSmartphoneManager").' ';
- print '';
- $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled');
- print ' ';
- print '';
- $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled');
- print ' ';
- print ' ';
+// Menu smartphone
+print ''.$langs->trans("DefaultMenuSmartphoneManager").' ';
+print '';
+$formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled');
- print '
';
-}
-else
-{
- // Gestionnaires de menu
- print '';
- print ''.$langs->trans("Menu").' ';
- print '';
- print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc"));
- print ' ';
- print '';
- print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc"));
- print ' ';
- print ' ';
-
-
- print ''.$langs->trans("DefaultMenuManager").' ';
- print '';
- $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED));
- print $filelib;
- print ' ';
- print '';
- $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED));
- print $filelib;
- print ' ';
- print ' ';
-
-
- print '';
- print ''.$langs->trans("DefaultMenuSmartphoneManager").' ';
- print '';
- $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED));
- print $filelib;
- if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED)
+if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED)
|| (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE)))
- {
- print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
- }
- print ' ';
- print '';
- $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED));
- print $filelib;
- if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)
- || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE)))
- {
- print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
- }
- print ' ';
- print ' ';
-
- print '
';
+{
+ print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
}
+print '';
+print '';
+$formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled');
+
+if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)
+ || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE)))
+{
+ print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
+}
+
+print ' ';
+print '';
+
+print '
';
+
dol_fiche_end();
-
-if ($action == 'edit')
-{
- print '';
- print ' ';
- print ' ';
- print ' ';
- print '
';
-}
+print '';
+print ' ';
+print '
';
print '';
-
-if ($action != 'edit')
-{
- print '';
-}
-
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index a8c1aa41b5f..e9346f49a3a 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -123,460 +123,244 @@ print " \n";
$noCountryCode = (empty($mysoc->country_code) ? true : false);
-if ($action == 'edit') // Edit
+print '';
+print ' ';
+print ' ';
+
+clearstatcache();
+
+
+// Misc options
+print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', '');
+
+print '';
+
+print ' ';
+
+
+// Addresses
+print load_fiche_titre($langs->trans("PDFAddressForging"), '', '');
+
+print '';
+print '
';
+print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+
+// Hide VAT Intra on address
+
+print ''.$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);
+print ' ';
+
+// Show prof id in address into pdf
+for($i=1; $i<=6; $i++)
{
- print '';
- print ' ';
- print ' ';
-
- clearstatcache();
-
-
- // Misc options
- print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', '');
-
- print '';
-
- print ' ';
-
-
- // Addresses
- print load_fiche_titre($langs->trans("PDFAddressForging"), '', '');
-
- print '';
- print '
';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- // Hide VAT Intra on address
-
- print ''.$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);
- print ' ';
-
- // Show prof id in address into pdf
- for($i=1; $i<=6; $i++)
- {
- if (! $noCountryCode)
- {
- $pid=$langs->transcountry("ProfId".$i, $mysoc->country_code);
- if ($pid == '-') $pid=false;
- }
- else
- {
- $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).' ';
- }
- 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);
- print ' ';
- }
- }
-
- print '
';
- print '
';
-
-
- print ' ';
-
-
- // Localtaxes
- $locales ='';
- $text='';
- 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);
- $text .= ' ';
- }
-
- if ($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);
- $text.= ' ';
- }
- }
-
- $title = $langs->trans("PDFRulesForSalesTax");
- if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
- {
- $title.=' - '.$langs->trans("PDFLocaltax", $locales);
- }
-
- print load_fiche_titre($title, '', '');
-
- print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- // Hide any information on Sale tax / VAT
-
- print ''.$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);
- print ' ';
-
- // Locataxes
- print $text;
-
- print '
';
- print ' ';
-
-
- // Other
- print load_fiche_titre($langs->trans("Other"), '', '');
-
- print '';
- print '
';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- //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);
- 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);
- 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);
- print ' ';
-
- //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);
- 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);
- print ' ';
-
-
- print ''.$langs->trans("ShowDetailsInPDFPageFoot").' ';
- print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
- print ' ';
-
- print '
';
- print '
';
-
- print '';
- print ' ';
- print ' ';
- print ' ';
- print '
';
-
- print ' ';
- print ' ';
-}
-else // Show
-{
- // Misc options
- print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', '');
-
-
- print '';
- print '
';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- // Show pdf format
-
- print ''.$langs->trans("DictionaryPaperFormat").' ';
-
- $pdfformatlabel='';
- if (empty($conf->global->MAIN_PDF_FORMAT))
- {
- include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $pdfformatlabel=dol_getDefaultFormat();
- }
- else $pdfformatlabel=$conf->global->MAIN_PDF_FORMAT;
- if (! empty($pdfformatlabel))
- {
- $sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format";
- $sql.=" WHERE code LIKE '%".$db->escape($pdfformatlabel)."%'";
-
- $resql=$db->query($sql);
- if ($resql)
- {
- $obj=$db->fetch_object($resql);
- $paperKey = $langs->trans('PaperFormat'.$obj->code);
- $unitKey = $langs->trans('SizeUnit'.$obj->unit);
- $pdfformatlabel = ($paperKey == 'PaperFormat'.$obj->code ? $obj->label : $paperKey).' - '.round($obj->width).'x'.round($obj->height).' '.($unitKey == 'SizeUnit'.$obj->unit ? $obj->unit : $unitKey);
- }
- }
- print $pdfformatlabel;
- print ' ';
-
- print ''.$langs->trans("MAIN_PDF_MARGIN_LEFT").' ';
- print empty($conf->global->MAIN_PDF_MARGIN_LEFT)?10:$conf->global->MAIN_PDF_MARGIN_LEFT;
- print ' ';
- print ''.$langs->trans("MAIN_PDF_MARGIN_RIGHT").' ';
- print empty($conf->global->MAIN_PDF_MARGIN_RIGHT)?10:$conf->global->MAIN_PDF_MARGIN_RIGHT;
- print ' ';
- print ''.$langs->trans("MAIN_PDF_MARGIN_TOP").' ';
- print empty($conf->global->MAIN_PDF_MARGIN_TOP)?10:$conf->global->MAIN_PDF_MARGIN_TOP;
- print ' ';
- print ''.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").' ';
- print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM;
- print ' ';
-
- print '
';
- print '
';
-
- print ' ';
-
- print load_fiche_titre($langs->trans("PDFAddressForging"), '', '');
-
- print '';
- print '
';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- // Hide Intra VAT on address
-
- print ''.$langs->trans("ShowVATIntaInAddress").' ';
- print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS, 1);
- print ' ';
-
- // Show prof id in address into pdf
- for ($i=1; $i<=6; $i++)
+ if (! $noCountryCode)
{
- if (! $noCountryCode)
- {
- $pid=$langs->transcountry("ProfId".$i, $mysoc->country_code);
- if ($pid == '-') $pid=false;
- }
- else
- {
- $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).' ';
- }
- if ($pid)
- {
- print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid.' ';
- $keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS';
- print yn($conf->global->$keyforconstant, 1);
- print ' ';
- }
- }
-
- print '
'."\n";
- print '
';
-
- print ' ';
-
- // Localtaxes
- $locales ='';
- $text='';
- 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 .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX, 1);
- $text .= ' ';
- }
-
- if ($mysoc->useLocalTax(2))
- {
- $locales.=($locales?' & ':'').$langs->transcountry("LT2", $mysoc->country_code);
-
- $text.= '' . $langs->trans("HideLocalTaxOnPDF", $langs->transcountry("LT2", $mysoc->country_code)) . ' ';
- $text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX, 1);
- $text.= ' ';
- }
- }
-
- // Sales TAX / VAT information
- $title=$langs->trans("PDFRulesForSalesTax", $locales);
- if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) $title.=' - '.$langs->trans("PDFLocaltax", $locales);
-
- print load_fiche_titre($title, '', '');
-
- print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- print ''.$langs->trans("HideAnyVATInformationOnPDF").' ';
- print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT, 1);
- print ' ';
-
- print $text;
-
- print '
';
- print ' ';
-
-
- // Other
- print load_fiche_titre($langs->trans("Other"), '', '');
-
- print '';
- print '
';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
-
- // Encrypt and protect PDF
-
- print '';
- print '';
- $text = $langs->trans("ProtectAndEncryptPdfFiles");
- $desc = $form->textwithpicto($text, $langs->transnoentities("ProtectAndEncryptPdfFilesDesc"), 1);
- print $desc;
- print ' ';
- print '';
- if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
- {
- print img_picto($langs->trans("Active"), 'tick');
- }
- print ' ';
- print '';
- if (empty($conf->global->PDF_SECURITY_ENCRYPTION))
- {
- print ''.$langs->trans("Activate").' ';
+ $pid=$langs->transcountry("ProfId".$i, $mysoc->country_code);
+ if ($pid == '-') $pid=false;
}
else
{
- print ''.$langs->trans("Disable").' ';
+ $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).' ';
}
- print " ";
-
- print "";
- print ' ';
-
- // Hide Desc
-
- print ''.$langs->trans("HideDescOnPDF").' ';
- print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC, 1);
- print ' ';
-
- // Hide Ref
-
- print ''.$langs->trans("HideRefOnPDF").' ';
- print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF, 1);
- print ' ';
-
- // Hide Details
-
- print ''.$langs->trans("HideDetailsOnPDF").' ';
- print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS, 1);
- print ' ';
-
- // Invert sender and recipient
- print ''.$langs->trans("SwapSenderAndRecipientOnPDF").' ';
- print yn($conf->global->MAIN_INVERT_SENDER_RECIPIENT, 1);
- print ' ';
-
- // Use French location
- print ''.$langs->trans("PlaceCustomerAddressToIsoLocation").' ';
- print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION, 1);
- print ' ';
-
-
- print ''.$langs->trans("ShowDetailsInPDFPageFoot").' ';
- print $arraydetailsforpdffoot[($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS : 0)];
- print ' ';
-
- print '
';
- print '
';
-
-
- /*
- * Library
- */
-
- print ' ';
- print load_fiche_titre($langs->trans("Library"), '', '');
-
- print '';
- print '
'."\n";
-
- print ''."\n";
- print ''.$langs->trans("Name").' '."\n";
- print ''.$langs->trans("Value").' '."\n";
- print " \n";
-
- print ''."\n";
- print ''.$langs->trans("LibraryToBuildPDF").' '."\n";
- print '';
- $i=0;
- $pdf=pdf_getInstance('A4');
- if (class_exists('FPDF') && ! class_exists('TCPDF'))
+ if ($pid)
{
- if ($i) print ' + ';
- print 'FPDF';
- print ' ('.@constant('FPDF_PATH').')';
- $i++;
+ 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);
+ print ' ';
}
- if (class_exists('TCPDF'))
- {
- if ($i) print ' + ';
- print 'TCPDF';
- print ' ('.@constant('TCPDF_PATH').')';
- $i++;
- }
- if (class_exists('FPDI'))
- {
- if ($i) print ' + ';
- print 'FPDI';
- print ' ('.@constant('FPDI_PATH').')';
- $i++;
- }
- if (class_exists('TCPDI'))
- {
- if ($i) print ' + ';
- print 'TCPDI';
- print ' ('.@constant('TCPDI_PATH').')';
- $i++;
- }
- print ''."\n";
- print ''."\n";
-
- print "
\n";
- print '
';
-
- print '';
- print ' ';
}
+print '
';
+print '
';
+
+
+print ' ';
+
+
+// Localtaxes
+$locales ='';
+$text='';
+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);
+ $text .= ' ';
+ }
+
+ if ($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);
+ $text.= ' ';
+ }
+}
+
+$title = $langs->trans("PDFRulesForSalesTax");
+if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
+{
+ $title.=' - '.$langs->trans("PDFLocaltax", $locales);
+}
+
+print load_fiche_titre($title, '', '');
+
+print '';
+print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+
+// Hide any information on Sale tax / VAT
+
+print ''.$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);
+print ' ';
+
+// Locataxes
+print $text;
+
+print '
';
+print ' ';
+
+
+// Other
+print load_fiche_titre($langs->trans("Other"), '', '');
+
+print '';
+print '
';
+print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+
+//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);
+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);
+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);
+print ' ';
+
+//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);
+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);
+print ' ';
+
+
+print ''.$langs->trans("ShowDetailsInPDFPageFoot").' ';
+print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
+print ' ';
+
+print '
';
+print '
';
+
+
+/*
+ * Library
+ */
+
+print ' ';
+print load_fiche_titre($langs->trans("Library"), '', '');
+
+print '';
+print '
'."\n";
+
+print ''."\n";
+print ''.$langs->trans("Name").' '."\n";
+print ''.$langs->trans("Value").' '."\n";
+print " \n";
+
+print ''."\n";
+print ''.$langs->trans("LibraryToBuildPDF").' '."\n";
+print '';
+$i=0;
+$pdf=pdf_getInstance('A4');
+if (class_exists('FPDF') && ! class_exists('TCPDF'))
+{
+ if ($i) print ' + ';
+ print 'FPDF';
+ print ' ('.@constant('FPDF_PATH').')';
+ $i++;
+}
+if (class_exists('TCPDF'))
+{
+ if ($i) print ' + ';
+ print 'TCPDF';
+ print ' ('.@constant('TCPDF_PATH').')';
+ $i++;
+}
+if (class_exists('FPDI'))
+{
+ if ($i) print ' + ';
+ print 'FPDI';
+ print ' ('.@constant('FPDI_PATH').')';
+ $i++;
+}
+if (class_exists('TCPDI'))
+{
+ if ($i) print ' + ';
+ print 'TCPDI';
+ print ' ('.@constant('TCPDI_PATH').')';
+ $i++;
+}
+print ' '."\n";
+print ' '."\n";
+
+print "
\n";
+print '
';
+
+
+print '';
+print ' ';
+print '
';
+
+print ' ';
+
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index 28c3db6f1d3..c9bf1ba4357 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -88,7 +88,7 @@ llxHeader('', $langs->trans("Miscellaneous"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
-print $langs->trans("MiscellaneousDesc")." \n";
+print ''.$langs->trans("MiscellaneousDesc")." \n";
print " \n";
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index e08c2c5eca8..73cad8f69ad 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -147,7 +147,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp);
print load_fiche_titre($langs->trans("SmsSetup"), '', 'title_setup');
-print $langs->trans("SmsDesc")." \n";
+print ''.$langs->trans("SmsDesc")." \n";
print " \n";
// List of sending methods
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index ad7a2278991..ba2dde77bec 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -229,7 +229,7 @@ print load_fiche_titre($langs->trans("Translation"), $enabledisablehtml, 'title_
$current_language_code=$langs->defaultlang;
$s=picto_from_langcode($current_language_code);
-print $form->textwithpicto($langs->trans("CurrentUserLanguage").': '.$s.' '.$current_language_code.' ', $langs->trans("TranslationDesc")).' ';
+print ''.$form->textwithpicto($langs->trans("CurrentUserLanguage").': '.$s.' '.$current_language_code.' ', $langs->trans("TranslationDesc")).' ';
print ' ';
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index 3835baf3b25..44370b40720 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -953,6 +953,7 @@ class BOM extends CommonObject
public function initAsSpecimen()
{
$this->initAsSpecimenCommon();
+ $this->ref = 'BOM-123';
$this->date = $this->date_creation;
}
diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php
index b574efc81df..b7eb1608e9e 100644
--- a/htdocs/bom/tpl/objectline_create.tpl.php
+++ b/htdocs/bom/tpl/objectline_create.tpl.php
@@ -100,14 +100,15 @@ if ($nolinesbefore) {
$filtertype='';
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
+ $statustoshow = -1;
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
{
// hide products in closed warehouse, but show products for internal transfer
- $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
+ $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
}
else
{
- $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
+ $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
}
echo '';
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 09d3351fb4d..baaed787023 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -3584,7 +3584,7 @@ class Facture extends CommonInvoice
* @param int $offset For pagination
* @param string $sortfield Sort criteria
* @param string $sortorder Sort order
- * @return int -1 if KO, array with result if OK
+ * @return array|int -1 if KO, array with result if OK
*/
public function liste_array($shortlist = 0, $draft = 0, $excluser = '', $socid = 0, $limit = 0, $offset = 0, $sortfield = 'f.datef,f.rowid', $sortorder = 'DESC')
{
@@ -3655,7 +3655,7 @@ class Facture extends CommonInvoice
* (Status validated or abandonned for a reason 'other') + not payed + no payment at all + not already replaced
*
* @param int $socid Id thirdparty
- * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
+ * @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
*/
public function list_replacable_invoices($socid = 0)
{
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index cab7f36a5a7..3e9011bb74b 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -222,7 +222,17 @@ $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as tit
$sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
$sql.= " f.datec, f.tms,";
$sql.= " f.fk_cond_reglement, f.fk_mode_reglement";
-$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
+// 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 : '');
+// Add fields from hooks
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
+$sql.=preg_replace('/^,/', '', $hookmanager->resPrint);
+$sql =preg_replace('/,\s*$/', '', $sql);
+
+$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as f";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture_rec_extrafields as ef ON ef.fk_object = f.rowid";
if (! $user->rights->societe->client->voir && ! $socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
@@ -473,6 +483,8 @@ if ($resql)
if (! empty($arrayfields['f.date_when']['checked'])) print_liste_field_titre($arrayfields['f.date_when']['label'], $_SERVER['PHP_SELF'], "f.date_when", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER['PHP_SELF'], "f.datec", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER['PHP_SELF'], "f.tms", "", $param, 'align="center"', $sortfield, $sortorder);
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
if (! empty($arrayfields['status']['checked'])) print_liste_field_titre($arrayfields['status']['label'], $_SERVER['PHP_SELF'], "f.suspended,f.frequency", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'nomaxwidthsearch ')."\n";
print " \n";
@@ -611,6 +623,15 @@ if ($resql)
print '';
if (! $i) $totalarray['nbfield']++;
}
+
+ $obj = $objp;
+ // Extra fields
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
+ // Fields from hook
+ $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
+ $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
+ print $hookmanager->resPrint;
+ // Status
if (! empty($arrayfields['status']['checked']))
{
print '';
diff --git a/htdocs/core/boxes/box_accountancy_suspense_account.php b/htdocs/core/boxes/box_accountancy_suspense_account.php
index 9740de82fbc..03c0f0ab7ae 100644
--- a/htdocs/core/boxes/box_accountancy_suspense_account.php
+++ b/htdocs/core/boxes/box_accountancy_suspense_account.php
@@ -108,14 +108,14 @@ class box_accountancy_suspense_account extends ModeleBoxes
);
} else {
$this->info_box_contents[0][0] = array(
- 'td' => 'class="nohover opacitymedium left"',
- 'text' => $langs->trans("SuspenseAccountNotDefined")
+ 'td' => 'class="nohover"',
+ 'text' => ''.$langs->trans("SuspenseAccountNotDefined").' '
);
}
} else {
$this->info_box_contents[0][0] = array(
- 'td' => 'class="nohover opacitymedium left"',
- 'text' => $langs->trans("ReadPermissionNotAllowed")
+ 'td' => 'class="nohover"',
+ 'text' => ''.$langs->trans("ReadPermissionNotAllowed").' '
);
}
}
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index 494950927a9..3c4ba1c9736 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville
* Copyright (C) 2004-2007 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
- * Copyright (C) 2015 Frederic France
+ * Copyright (C) 2015-2019 Frederic 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
@@ -82,6 +82,8 @@ class box_factures_imp extends ModeleBoxes
$facturestatic = new Facture($this->db);
$societestatic = new Societe($this->db);
+ $langs->load("bills");
+
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $max));
if ($user->rights->facture->lire)
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 74253a19f51..84f49bafe3f 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -316,7 +316,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Define array with couple subtitution key => subtitution value
+ * Define array with couple substitution key => substitution value
*
* @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code
@@ -445,7 +445,7 @@ abstract class CommonDocGenerator
$array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
- // Remain to pay with all know infrmation (except open direct debit requests)
+ // Remain to pay with all know information (except open direct debit requests)
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs),
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
);
@@ -479,7 +479,7 @@ abstract class CommonDocGenerator
$totalUp = 0;
foreach ($object->lines as $line)
{
- // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward comaptibility
+ // $line->tva_tx format depends on database field accuraty, no reliable. This is kept for backward compatibility
if (empty($resarray[$array_key.'_total_vat_'.$line->tva_tx])) $resarray[$array_key.'_total_vat_'.$line->tva_tx]=0;
$resarray[$array_key.'_total_vat_'.$line->tva_tx]+=$line->total_tva;
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]);
@@ -868,7 +868,7 @@ abstract class CommonDocGenerator
/**
- * uasort callback function to Sort colums fields
+ * uasort callback function to Sort columns fields
*
* @param array $a PDF lines array fields configs
* @param array $b PDF lines array fields configs
@@ -907,7 +907,7 @@ abstract class CommonDocGenerator
// Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right
- // Array witdh
+ // Array width
$arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche;
// Count flexible column
@@ -915,10 +915,10 @@ abstract class CommonDocGenerator
$countFlexCol = 0;
foreach ($this->cols as $colKey =>& $colDef)
{
- if(!$this->getColumnStatus($colKey)) continue; // continue if desable
+ if(!$this->getColumnStatus($colKey)) continue; // continue if disabled
if(!empty($colDef['scale'])){
- // In case of column widht is defined by percentage
+ // In case of column width is defined by percentage
$colDef['width'] = abs($arrayWidth * $colDef['scale'] / 100);
}
diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php
index 53e85adcec1..a70605612fe 100644
--- a/htdocs/core/class/link.class.php
+++ b/htdocs/core/class/link.class.php
@@ -334,7 +334,8 @@ class Link extends CommonObject
if($this->db->num_rows($resql) > 0)
{
$obj = $this->db->fetch_object($resql);
- $this->id=$obj->rowid;
+
+ $this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->datea = $this->db->jdate($obj->datea);
$this->url = $obj->url;
@@ -361,8 +362,6 @@ class Link extends CommonObject
*/
public function delete($user)
{
- global $langs, $conf;
-
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$error = 0;
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 637aac02545..2347d3d77e5 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -199,6 +199,12 @@ class DoliDBPgsql extends DoliDB
$line=$newline;
}
+ if (preg_match('/[\s\t\(]*(\w*)[\s\t]+bigint.*auto_increment/i', $line, $reg)) {
+ $newline=preg_replace('/([\s\t\(]*)([a-zA-Z_0-9]*)[\s\t]+int.*auto_increment[^,]*/i', '\\1 \\2 BIGSERIAL PRIMARY KEY', $line);
+ //$line = "-- ".$line." replaced by --\n".$newline;
+ $line=$newline;
+ }
+
// tinyint type conversion
$line=preg_replace('/tinyint\(?[0-9]*\)?/', 'smallint', $line);
$line=preg_replace('/tinyint/i', 'smallint', $line);
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 07eecf0f352..c81ea9d98d7 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -282,8 +282,11 @@ if (! function_exists('dol_loginfunction'))
// Set jquery theme
$dol_loginmesg = (! empty($_SESSION["dol_loginmesg"])?$_SESSION["dol_loginmesg"]:'');
- $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1);
+
+ $favicon = DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png';
+ if (! empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
+
$jquerytheme = 'base';
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index ef875675ed7..66698be76cc 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -348,23 +348,21 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
}
else
{
- print ''.$langs->trans("DefaultSkin").' ';
+ $dirthemestring = '';
+ foreach($dirthemes as $dirtheme)
+ {
+ $dirthemestring .= '"'.$dirtheme.'" ';
+ }
+
+ print '';
+ print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
+ print ' ';
print '';
$url='https://www.dolistore.com/4-skins';
print '';
print $langs->trans('DownloadMoreSkins');
print ' ';
print ' ';
-
- print '';
- print ''.$langs->trans("ThemeDir").' ';
- print '';
- foreach($dirthemes as $dirtheme)
- {
- echo '"'.$dirtheme.'" ';
- }
- print ' ';
- print ' ';
}
print '';
@@ -399,7 +397,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print 'id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">';
if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive");
else $title=$langs->trans("ShowPreview");
- print ' ';
+ print ' ';
print ' ';
if ($subdir == $selected_theme)
{
@@ -422,6 +420,31 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print ' ';
+ // Show logo
+ if ($foruserprofile)
+ {
+ // Nothing
+ }
+ else
+ {
+ // Show logo
+ print ''.$langs->trans("EnableShowLogo").' ';
+ if ($edit)
+ {
+ print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1);
+ }
+ else
+ {
+ print yn($conf->global->MAIN_SHOW_LOGO);
+ }
+ print ' ';
+ print ' ';
+ /*
+ print ''.$langs->trans("EnableShowLogo").' ' . yn($conf->global->MAIN_SHOW_LOGO) . ' ';
+ print " ";*/
+ }
+
+
// TopMenuDisableImages
if ($foruserprofile)
{
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index 66f4dac2a44..39e2150280e 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -39,10 +39,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
*/
function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 0, $mode = '')
{
- global $user,$conf,$langs,$dolibarr_main_db_name;
+ global $user,$conf,$langs,$mysoc;
+ global $dolibarr_main_db_name;
- $mainmenu=$_SESSION["mainmenu"];
- $leftmenu=$_SESSION["leftmenu"];
+ $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]);
+ $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]);
$id='mainmenu';
$listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
@@ -53,17 +54,17 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
if (empty($noout)) print_start_menu_array_auguria();
- global $usemenuhider;
- $usemenuhider = 1;
+ global $usemenuhider;
+ $usemenuhider = 1;
- // Show/Hide vertical menu
- if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ // Show/Hide vertical menu. The hamburger icon for .menuhider action.
+ if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$showmode=1;
$classname = 'class="tmenu menuhider"';
$idsel='menu';
- $menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
+ $menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? ' ' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
}
$num = count($newTabMenu);
@@ -125,20 +126,44 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
$menu->liste = dol_sort_array($menu->liste, 'position');
// Output menu entries
- foreach($menu->liste as $menkey => $menuval)
+ // Show logo company
+ if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- if (empty($noout)) print_start_menu_entry_auguria($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
- if (empty($noout)) print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget));
- if (empty($noout)) print_end_menu_entry_auguria($menuval['enabled']);
+ //$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
+ $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
+ if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini))
+ {
+ $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
+ }
+ else
+ {
+ $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
+ }
+ $title=$langs->trans("GoIntoSetupToChangeLogo");
+
+ print "\n".''."\n";
+ print_start_menu_entry_auguria('companylogo', 'class="tmenu tmenucompanylogo"', 1);
+
+ print ''."\n";
+
+ print_end_menu_entry_auguria(4);
+ }
+
+ if (empty($noout)) {
+ foreach($menu->liste as $menuval)
+ {
+ print_start_menu_entry_auguria($menuval['idsel'], $menuval['classname'], $menuval['enabled']);
+ print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget));
+ print_end_menu_entry_auguria($menuval['enabled']);
+ }
}
$showmode=1;
- if (empty($noout)) print_start_menu_entry_auguria('', 'class="tmenuend"', $showmode);
- if (empty($noout)) print_end_menu_entry_auguria($showmode);
-
- if (empty($noout)) print_end_menu_array_auguria();
-
- print "\n";
+ if (empty($noout)) {
+ print_start_menu_entry_auguria('', 'class="tmenuend"', $showmode);
+ print_end_menu_entry_auguria($showmode);
+ print_end_menu_array_auguria();
+ }
return 0;
}
@@ -193,16 +218,16 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
if ($showmode == 1)
{
- print '';
- print '';
+ print ' ';
print '';
print $text;
print ' ';
print ' ';
}
- if ($showmode == 2)
+ elseif ($showmode == 2)
{
print '';
print '';
@@ -244,17 +269,18 @@ function print_end_menu_array_auguria()
/**
* Core function to output left menu auguria
+ * Fill &$menu (example with $forcemainmenu='home' $forceleftmenu='all', return left menu tree of Home)
*
* @param DoliDB $db Database handler
- * @param array $menu_array_before Table of menu entries to show before entries of menu handler
- * @param array $menu_array_after Table of menu entries to show after entries of menu handler
+ * @param array $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add)
+ * @param array $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add)
* @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
* @param Menu $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
- * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all)
+ * @param string $forceleftmenu 'all'=Force leftmenu to '' (= all). If value come being '', we change it to value in session and 'none' if not defined in session.
* @param array $moredata An array with more data to output
- * @return int Nb of entries
+ * @return int Nb of menu entries
*/
function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null)
{
@@ -268,35 +294,6 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
global $usemenuhider;
$usemenuhider = 0;
- // Show logo company
- if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
- {
- $mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
- $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
- if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini))
- {
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
- }
- elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
- {
- $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
- }
- else
- {
- $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
- }
- $title=$langs->trans("GoIntoSetupToChangeLogo");
- print "\n".''."\n";
- print ''."\n";
- }
-
if (is_array($moredata) && ! empty($moredata['searchform'])) // searchform can contains select2 code or link to show old search form or link to switch on search page
{
print "\n";
@@ -355,9 +352,9 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$db->free($resql);
}
- if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account
+ if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account
{
- $newmenu->add('', $langs->trans("Journalization"), 0, $user->rights->accounting->comptarapport->lire, '', 'accountancy', 'accountancy');
+ $newmenu->add('', $langs->trans("RegistrationInAccounting"), 1, $user->rights->accounting->comptarapport->lire, '', 'accountancy', 'accountancy');
// Multi journal
$sql = "SELECT rowid, code, label, nature";
@@ -390,7 +387,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
if ($objp->nature == 9) $nature="hasnew";
// To enable when page exists
- if (! empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL))
+ if (empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL))
{
if ($nature == 'various' || $nature == 'hasnew' || $nature == 'inventory') $nature='';
}
@@ -399,7 +396,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
{
$langs->load('accountancy');
$journallabel=$langs->transnoentities($objp->label); // Labels in this table are set by loading llx_accounting_abc.sql. Label can be 'ACCOUNTING_SELL_JOURNAL', 'InventoryJournal', ...
- if (empty($leftmenu) || preg_match('/accountancy/', $leftmenu)) $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire);
+ $newmenu->add('/accountancy/journal/'.$nature.'journal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal='.$objp->rowid, $journallabel, 2, $user->rights->accounting->comptarapport->lire);
}
$i++;
}
@@ -444,7 +441,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
*/
}
- if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
+ if (! empty($conf->ftp->enabled) && $mainmenu == 'ftp') // Entry for FTP
{
$MAXFTP=20;
$i=1;
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index c4622f2d6ee..b3c5814240c 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/htdocs/core/menus/standard/auguria_menu.php
@@ -111,15 +111,18 @@ class MenuManager
$tabMenu=array();
$menuArbo = new Menubase($this->db, 'auguria');
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu);
-
$this->tabMenu=$tabMenu;
- }
+ //var_dump($tabMenu);
+
+ //if ($forcemainmenu == 'all') { var_dump($this->tabMenu); exit; }
+ }
/**
* Show menu
+ * Menu defined in sql tables were stored into $this->tabMenu BEFORE this is called.
*
- * @param string $mode 'top', 'left', 'jmobile' (used to get full xml ul/li menu)
+ * @param string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu)
* @param array $moredata An array with more data to output
* @return int 0 or nb of top menu entries if $mode = 'topnb'
*/
@@ -138,9 +141,18 @@ class MenuManager
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$this->menu=new Menu();
- if ($mode == 'top') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode);
- if ($mode == 'left') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata);
-
+ if (empty($conf->global->MAIN_MENU_INVERT))
+ {
+ if ($mode == 'top') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode);
+ if ($mode == 'left') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0, '', '', $moredata);
+ }
+ else
+ {
+ $conf->global->MAIN_SHOW_LOGO=0;
+ if ($mode == 'top') print_left_auguria_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0);
+ if ($mode == 'left') print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode);
+ }
+
if ($mode == 'topnb')
{
print_auguria_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode);
@@ -315,5 +327,8 @@ class MenuManager
}
unset($this->menu);
+
+ //print 'xx'.$mode;
+ return 0;
}
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index dbf56429086..5d6bf501d82 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -478,16 +478,22 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Show logo company
if (empty($conf->global->MAIN_MENU_INVERT) && empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
- $mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
+ //$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
$mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
+
+ $logoContainerAdditionalClass = 'backgroundforcompanylogo';
+ if(!empty($conf->global->MAIN_INFO_SOCIETE_LOGO_NO_BACKGROUND)){
+ $logoContainerAdditionalClass = '';
+ }
+
if (! empty($mysoc->logo_squarred_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini))
{
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
}
- elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
+ /*elseif (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
- }
+ }*/
else
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
@@ -497,7 +503,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
print "\n".''."\n";
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1);
- print ''."\n";
+
+ print ''."\n";
print_end_menu_entry(4);
}
@@ -629,7 +636,7 @@ function print_end_menu_array()
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x'
* @param string $forceleftmenu 'all'=Force leftmenu to '' (= all). If value come being '', we change it to value in session and 'none' if not defined in session.
* @param array $moredata An array with more data to output
- * @return int nb of menu entries
+ * @return int Nb of menu entries
*/
function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null)
{
@@ -702,8 +709,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete"));
}
$newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto, 1);
- $newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"), 1);
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"), 1);
+ $newmenu->add("/admin/menus.php?mainmenu=home", $langs->trans("Menus"), 1);
$newmenu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
$newmenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index d8a47d45c68..8389db029be 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -64,6 +64,8 @@ class MenuManager
*/
public function loadMenu($forcemainmenu = '', $forceleftmenu = '')
{
+ global $conf, $user, $langs;
+
// On sauve en session le menu principal choisi
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
@@ -117,7 +119,7 @@ class MenuManager
/**
* Show menu.
- * Module defined in sql tables were stored into $this->tabMenu BEFORE this is called.
+ * Menu defined in sql tables were stored into $this->tabMenu BEFORE this is called.
*
* @param string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu)
* @param array $moredata An array with more data to output
diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
index c678f0380fd..3049214679e 100644
--- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php
@@ -198,13 +198,9 @@ class pdf_cyan extends ModelePDFPropales
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
-
- $outputlangs->load("main");
- $outputlangs->load("dict");
- $outputlangs->load("companies");
- $outputlangs->load("bills");
- $outputlangs->load("propal");
- $outputlangs->load("products");
+
+ // Translations
+ $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
$nblines = count($object->lines);
diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
index 5a7d22670c7..8abcc41c263 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
@@ -177,7 +177,7 @@ class modGeneratePassPerso extends ModeleGenPassword
* Validate a password
*
* @param string $password Password to check
- * @return int 0 if KO, >0 if OK
+ * @return bool false if KO, true if OK
*/
public function validatePassword($password)
{
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 7f860586909..f8c80c3a0c8 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -38,7 +38,6 @@ if (empty($object) || ! is_object($object)) {
exit;
}
-
$usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element, array('facture','facturerec','propal','commande')))
{
@@ -248,14 +247,15 @@ if ($nolinesbefore) {
if (empty($senderissupplier))
{
+ $statustoshow = 1;
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
{
// hide products in closed warehouse, but show products for internal transfer
- $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, -1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
+ $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
}
else
{
- $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, -1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array'));
+ $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth300', 0, '', GETPOST('combinations', 'array'));
}
if (! empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS))
diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php
index db84d3f9fd0..3cb5db2c013 100644
--- a/htdocs/debugbar/class/TraceableDB.php
+++ b/htdocs/debugbar/class/TraceableDB.php
@@ -333,9 +333,9 @@ class TraceableDB extends DoliDB
'sql' => $sql,
'duration' => $duration,
'memory_usage' => $memoryDelta,
- 'is_success' => $resql,
- 'error_code' => ! $resql ? $this->db->lasterrno() : null,
- 'error_message' => ! $resql ? $this->db->lasterror() : null
+ 'is_success' => $resql ? true : false,
+ 'error_code' => $resql ? null : $this->db->lasterrno(),
+ 'error_message' => $resql ? null : $this->db->lasterror()
);
}
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index daadfa913ec..7b8138f1f3a 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -279,7 +279,7 @@ $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.tota
$sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,";
$sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo";
// Add fields from extrafields
-foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
+foreach ($extrafields->attributes['expensereport']['type'] as $key => $val) $sql.=($extrafields->attribute_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
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 4536cdc5bbd..56ad1f9481f 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -684,7 +684,7 @@ class CommandeFournisseur extends CommonOrder
$billedtext = ' - '.$langs->trans("Billed");
}
- $statusLong = $langs->trans($this->statuts_long[$status]).$billedtext;
+ $statusLong = $langs->trans($this->statuts[$status]).$billedtext;
$statusShort = $langs->trans($this->statutshort[$status]);
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);
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 1948ce28a57..a857898f5dc 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
@@ -76,6 +76,8 @@ ALTER TABLE llx_holiday_extrafields ADD INDEX idx_holiday_extrafields (fk_object
ALTER TABLE llx_societe_rib MODIFY label varchar(200);
+ALTER TABLE llx_societe ADD COLUMN logo_squarred varchar(255);
+
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300);
create table llx_entrepot_extrafields
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index 4db88defc68..f312015a662 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -107,6 +107,7 @@ create table llx_societe
supplier_order_min_amount double(24,8) DEFAULT NULL, -- min amount for supplier orders
default_lang varchar(6), -- default language
logo varchar(255) DEFAULT NULL,
+ logo_squarred varchar(255) DEFAULT NULL,
canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default)
fk_entrepot integer DEFAULT 0, -- if we need a link between third party and warehouse
webservices_url varchar(255), -- supplier webservice url
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index afce2e4fa34..0546b472225 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -875,9 +875,9 @@ Permission1251=Run mass imports of external data into database (data load)
Permission1321=Export customer invoices, attributes and payments
Permission1322=Reopen a paid bill
Permission1421=Export sales orders and attributes
-Permission2401=Read actions (events or tasks) linked to his account
-Permission2402=Create/modify actions (events or tasks) linked to his account
-Permission2403=Delete actions (events or tasks) linked to his account
+Permission2401=Read actions (events or tasks) linked to his user account (if owner of event)
+Permission2402=Create/modify actions (events or tasks) linked to his user account (if owner of event)
+Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event)
Permission2411=Read actions (events or tasks) of others
Permission2412=Create/modify actions (events or tasks) of others
Permission2413=Delete actions (events or tasks) of others
@@ -1070,6 +1070,9 @@ CompanyCountry=Country
CompanyCurrency=Main currency
CompanyObject=Object of the company
Logo=Logo
+LogoDesc=Main logo of company. Will be used into generated documents (PDF, ...)
+LogoSquarred=Logo (squarred)
+LogoSquarredDesc=Must be a squarred icon (width = height). This logo will be used as the favorite icon or other need like for the top menu bar (if not disabled into display setup).
DoNotSuggestPaymentMode=Do not suggest
NoActiveBankAccountDefined=No active bank account defined
OwnerOfBankAccount=Owner of bank account %s
@@ -1115,7 +1118,7 @@ LogEventDesc=Enable logging for specific security events. Administrators the log
AreaForAdminOnly=Setup parameters can be set by administrator users only.
SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators only.
SystemAreaForAdminOnly=This area is available to administrator users only. Dolibarr user permissions cannot change this restriction.
-CompanyFundationDesc=Edit the information of the company/entity. Click on "%s" or "%s" button at the bottom of the page.
+CompanyFundationDesc=Edit the information of the company/entity. Click on "%s" button at the bottom of the page.
AccountantDesc=If you have an external accountant/bookkeeper, you can edit here its information.
AccountantFileNumber=Accountant code
DisplayDesc=Parameters affecting the look and behaviour of Dolibarr can be modified here.
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index aa778a111bc..b7bef1aa46a 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1195,7 +1195,7 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
*/
function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disablejmobile = 0, $disablenofollow = 0)
{
- global $db, $conf, $langs, $user, $hookmanager;
+ global $db, $conf, $langs, $user, $mysoc, $hookmanager;
top_httphead();
@@ -1224,15 +1224,17 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print ' '."\n";
// Favicon
- $favicon = dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico', 1);
+ $favicon = DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png';
+ if (! empty($mysoc->logo_squarred_mini)) $favicon = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
if (empty($conf->dol_use_jmobile)) print ' '."\n"; // Not required into an Android webview
+
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' '."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' '."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ' '."\n";
// Mobile appli like icon
- $manifest = DOL_MAIN_URL_ROOT . '/theme/'.$conf->theme.'/manifest.json.php';
+ $manifest = DOL_URL_ROOT . '/theme/'.$conf->theme.'/manifest.json.php';
if(!empty($manifest)){
print ' '."\n";
}
@@ -1614,9 +1616,6 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
print ''."\n";
-
-
-
// Add login user link
$toprightmenu.='
';
@@ -1624,17 +1623,17 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$mode=-1;
$toprightmenu.='
';
- if(!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
+ if (!empty($conf->global->MAIN_USE_TOP_MENU_SEARCH_DROPDOWN)){
// Add search dropdown
$toprightmenu.= top_menu_search($user, $langs);
}
- if(!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
+ if (!empty($conf->global->MAIN_USE_TOP_MENU_BOOKMARK_DROPDOWN)) {
// Add bookmark dropdown
$toprightmenu .= top_menu_bookmark($user, $langs);
}
- // add user dropdown
+ // Add user dropdown
$toprightmenu.= top_menu_user($user, $langs);
$toprightmenu.='
';
@@ -1967,10 +1966,10 @@ function top_menu_bookmark(User $user, Translate $langs)
if( e.which === 77 && e.ctrlKey && e.shiftKey ){
console.log(\'control + shift + m : trigger open bookmark dropdown\');
openBookMarkDropDown();
- }
+ }
});
-
-
+
+
var openBookMarkDropDown = function() {
event.preventDefault();
$("#topmenu-bookmark-dropdown").toggleClass("open");
@@ -2054,26 +2053,26 @@ function top_menu_search(User $user, Translate $langs)