diff --git a/ChangeLog b/ChangeLog index c8b7db19236..ede0e10a89f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ Following changes may create regressions for some external modules, but were nec * Removed function dol_micro_time. Use native PHP microtime instead. * The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS. +* If your logo was visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible agin in menu. ***** ChangeLog for 10.0.2 compared to 10.0.1 ***** diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 3c04548d7c6..7d48790348d 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -279,8 +279,8 @@ if ($action != 'export_csv') print ''; } - // Affiche le compte comptable en debut de ligne - print ""; + // Show first line of a break + print ''; print '' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . ''; print ''; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index dac238f97d6..f90d5797d09 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -926,91 +926,131 @@ class AccountancyExport * * @return void */ - public function exportLDCompta($objectLines) - { + public function exportLDCompta($objectLines) + { - $separator = ';'; - $end_line = "\n"; + $separator = ';'; + $end_line = "\r\n"; - foreach ($objectLines as $line) { + foreach ($objectLines as $line) { - $date_document = dol_print_date($line->doc_date, '%Y%m%d'); - $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); + $date_document = dol_print_date($line->doc_date, '%Y%m%d'); + $date_creation = dol_print_date($line->date_creation, '%Y%m%d'); - // TYPE - $type_enregistrement = 'E'; // For write movement - print $type_enregistrement . $separator; - // JNAL - print substr($line->code_journal, 0, 2) . $separator; - // NECR - print $line->id . $separator; - // NPIE - print $line->piece_num . $separator; - // DATP - print $date_document . $separator; - // LIBE - print $line->label_operation . $separator; - // DATH - print $line->date_lim_reglement . $separator; - // CNPI - if ($line->doc_type == 'supplier_invoice') { - if ($line->montant < 0) { - $nature_piece = 'AF'; - } else { - $nature_piece = 'FF'; - } - } elseif ($line->doc_type == 'customer_invoice') { - if ($line->montant < 0) { - $nature_piece = 'AC'; - } else { - $nature_piece = 'FC'; - } - } else { - $nature_piece = ''; - } - print $nature_piece . $separator; - // RACI - /* - if (! empty($line->subledger_account)) { - if ($line->doc_type == 'supplier_invoice') { - $racine_subledger_account = '40'; - } elseif ($line->doc_type == 'customer_invoice') { - $racine_subledger_account = '41'; - } else { - $nature_piece = ''; - } - print $racine_subledger_account . $separator; - } else { - print $separator; - } - */ - // MONT - print price(abs($line->montant)) . $separator; - // CODC - print $line->sens . $separator; - // CPTG - print length_accountg($line->numero_compte) . $separator; - // DATE - print $date_creation . $separator; - // CLET - print $line->lettering_code . $separator; - // DATL - print $line->date_lettering . $separator; - // CPTA - if (! empty($line->subledger_account)) { - print length_accounta($line->subledger_account) . $separator; - } - // CNAT - if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) { - print 'F'; - } elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) { - print 'C'; - } else { - print ''; - } - print $end_line; - } - } + // TYPE + $type_enregistrement = 'E'; // For write movement + print $type_enregistrement . $separator; + // JNAL + print substr($line->code_journal, 0, 2) . $separator; + // NECR + print $line->id . $separator; + // NPIE + print $line->piece_num . $separator; + // DATP + print $date_document . $separator; + // LIBE + print $line->label_operation . $separator; + // DATH + print $line->date_lim_reglement . $separator; + // CNPI + if ($line->doc_type == 'supplier_invoice') { + if ($line->montant < 0) { + $nature_piece = 'AF'; + } else { + $nature_piece = 'FF'; + } + } elseif ($line->doc_type == 'customer_invoice') { + if ($line->montant < 0) { + $nature_piece = 'AC'; + } else { + $nature_piece = 'FC'; + } + } else { + $nature_piece = ''; + } + print $nature_piece . $separator; + // RACI + /* + if (! empty($line->subledger_account)) { + if ($line->doc_type == 'supplier_invoice') { + $racine_subledger_account = '40'; + } elseif ($line->doc_type == 'customer_invoice') { + $racine_subledger_account = '41'; + } else { + $nature_piece = ''; + } + print $racine_subledger_account . $separator; + } else { + print $separator; + } + */ + print $separator; // deprecated CPTG & CPTA use instead + // MONT + print price(abs($line->montant), 0, '', 1, 2) . $separator; + // CODC + print $line->sens . $separator; + // CPTG + print length_accountg($line->numero_compte) . $separator; + // DATE + print $date_creation . $separator; + // CLET + print $line->lettering_code . $separator; + // DATL + print $line->date_lettering . $separator; + // CPTA + if (! empty($line->subledger_account)) { + print length_accounta($line->subledger_account) . $separator; + } else { + print $separator; + } + // CNAT + if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) { + print 'F' . $separator; + } elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) { + print 'C' . $separator; + } else { + print $separator; + } + // SECT + print $separator; + // CTRE + print $separator; + // NORL + print $separator; + // DATV + print $separator; + // REFD + print $line->doc_ref . $separator; + // CODH + print $separator; + // NSEQ + print $separator; + // MTDV + print '0' . $separator; + // CODV + print $separator; + // TXDV + print '0' . $separator; + // MOPM + print $separator; + // BONP + print $separator; + // BQAF + print $separator; + // ECES + print $separator; + // TXTL + print $separator; + // ECRM + print $separator; + // DATK + print $separator; + // HEUK + print $separator; + + print $end_line; + } + } /** * Export format : Charlemagne diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 97f1c771122..a815e5b858b 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -192,12 +192,12 @@ if ($search_lineid) { if (strlen(trim($search_invoice))) { $sql .= natural_search("f.ref", $search_invoice); } +if (strlen(trim($search_label))) { + $sql .= natural_search("f.libelle", $search_label); +} if (strlen(trim($search_ref))) { $sql .= natural_search("p.ref", $search_ref); } -if (strlen(trim($search_label))) { - $sql .= natural_search("p.label", $search_label); -} if (strlen(trim($search_desc))) { $sql .= natural_search("l.description", $search_desc); } @@ -300,14 +300,13 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; print ''; - //print ''; print ''; print ''; print ''; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 6ba3e244582..fc453a94250 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -234,12 +234,12 @@ if ($search_lineid) { if (strlen(trim($search_invoice))) { $sql .= natural_search("f.ref", $search_invoice); } +if (strlen(trim($search_label))) { + $sql .= natural_search("f.libelle", $search_label); +} if (strlen(trim($search_ref))) { $sql .= natural_search("p.ref", $search_ref); } -if (strlen(trim($search_label))) { - $sql .= natural_search("p.label", $search_label); -} if (strlen(trim($search_desc))) { $sql .= natural_search("l.description", $search_desc); } @@ -317,6 +317,7 @@ if ($result) { if ($search_year) $param.='&search_year='.urlencode($search_year); if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice); if ($search_ref) $param.='&search_ref='.urlencode($search_ref); + if ($search_label) $param.='&search_label='.urlencode($search_label); if ($search_desc) $param.='&search_desc='.urlencode($search_desc); if ($search_amount) $param.='&search_amount='.urlencode($search_amount); if ($search_vat) $param.='&search_vat='.urlencode($search_vat); @@ -362,14 +363,13 @@ if ($result) { print ''; print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($search_year, 'search_year', 1, 20, 5); print ''; print ''; - //print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index cba3fd822cc..e48f122c4b0 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -93,158 +93,87 @@ $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst") print ''.$langs->trans("AccountantDesc")."
\n"; print "
\n"; -if ($action == 'edit' || $action == 'updateedit') -{ - /** - * Edit parameters - */ - print "\n".''."\n"; +/** + * Edit parameters + */ +print "\n".''."\n"; - print '
'; - print ''; - print ''; +print ''; +print ''; +print ''; - print ''; - print ''."\n"; +print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; +print ''."\n"; - // Name - print ''."\n"; +// Name +print ''."\n"; - // Address - print ''."\n"; +// Address +print ''."\n"; - print ''."\n"; +print ''."\n"; - print ''."\n"; +print ''."\n"; - // Country - print ''."\n"; +// Country +print ''."\n"; - print ''."\n"; +print ''."\n"; - print ''; - print ''."\n"; +print ''; +print ''."\n"; - print ''; - print ''."\n"; +print ''; +print ''."\n"; - print ''; - print ''."\n"; +print ''; +print ''."\n"; - // Web - print ''; - print ''."\n"; +// Web +print ''; +print ''."\n"; - // Code - print ''."\n"; +// Code +print ''."\n"; - // Note - print ''; - print ''; +// Note +print ''; +print ''; - print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; - print '
'; +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; - //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization - print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - print '
'; +//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization +print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); +if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +print '
'; - $formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); - print '
'; +$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id'); +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; - print '
'; +print '
'; +print ''; - print '
'; - print ''; - print '     '; - print ''; - print '
'; - print '
'; +print '
'; +print ''; +//print '     '; +//print ''; +print '
'; +//print '
'; - print '
'; -} -else -{ - /* - * Show parameters - */ +print ''; - // Actions buttons - //print '
'; - //print ''.$langs->trans("Modify").''; - //print '

'; - - print '
'; - print ''; - print ''; - - - print ''; - - - print ''; - - - print ''; - - - print ''; - - - print ''; - - - if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; - print $conf->global->MAIN_INFO_ACCOUNTANT_NAME; - print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '
'.$langs->trans("CompanyCountry").''; - if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY)) - { - $code = getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 2); - $img=picto_from_langcode($code); - print $img?$img.' ':''; - print getCountry($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 1); - } - print '
'.$langs->trans("Region-State").''; - else print '
'.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE)) print getState($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); - else print ' '; - print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '
'.$langs->trans("Web").'' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '
'.$langs->trans("AccountantFileNumber").'' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '
'; - print "
"; - - print ''; - - // Actions buttons - print '
'; - print ''; - print '
'; -} llxFooter(); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 58c07b5ca3e..ca90c836929 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -222,7 +222,7 @@ llxHeader('', $langs->trans("Boxes")); print load_fiche_titre($langs->trans("Boxes"), '', 'title_setup'); -print $langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; +print ''.$langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."
\n"; /* * Search for the default active boxes for each possible position diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index a3534d3bc5a..dde962fe9bc 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -105,69 +105,79 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode", 'alpha'), 'chaine', 0, '', $conf->entity); - $varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; - if ($_FILES[$varforimage]["tmp_name"]) + $dirforimage=$conf->mycompany->dir_output.'/logos/'; + + $arrayofimages = array('logo', 'logo_squarred'); + + foreach($arrayofimages as $varforimage) { - if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) + if ($_FILES[$varforimage]["tmp_name"]) { - $original_file=$reg[1]; - - $isimage=image_format_supported($original_file); - if ($isimage >= 0) + $reg = array(); + if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { - dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); - if (! is_dir($dirforimage)) - { - dol_mkdir($dirforimage); - } - $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); - if ($result > 0) - { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO", $original_file, 'chaine', 0, '', $conf->entity); + $original_file=$reg[1]; - // Create thumbs of logo (Note that PDF use original file and not thumbs) - if ($isimage > 0) + $isimage=image_format_supported($original_file); + if ($isimage >= 0) + { + dol_syslog("Move file ".$_FILES[$varforimage]["tmp_name"]." to ".$dirforimage.$original_file); + if (! is_dir($dirforimage)) { - // Create thumbs - //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... - - // Create small thumb, Used on logon for example - $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) - { - $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbSmall); - - // Create mini thumb, Used on menu or for setup page for example - $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); - if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) - { - $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); - } - else dol_syslog($imgThumbMini); + dol_mkdir($dirforimage); + } + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); + if ($result > 0) + { + $constant = "MAIN_INFO_SOCIETE_LOGO"; + if ($varforimage == 'logo_squarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; + + dolibarr_set_const($db, $constant, $original_file, 'chaine', 0, '', $conf->entity); + + // Create thumbs of logo (Note that PDF use original file and not thumbs) + if ($isimage > 0) + { + // Create thumbs + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + + // Create small thumb, Used on logon for example + $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) + { + $imgThumbSmall = $reg[1]; // Save only basename + dolibarr_set_const($db, $constant."_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); + } + else dol_syslog($imgThumbSmall); + + // Create mini thumb, Used on menu or for setup page for example + $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); + if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) + { + $imgThumbMini = $reg[1]; // Save only basename + dolibarr_set_const($db, $constant."_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); + } + else dol_syslog($imgThumbMini); + } + else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); + } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { + $error++; + $langs->load("errors"); + $tmparray=explode(':', $result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); + } + else + { + $error++; + setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } - else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); - } elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { - $error++; - $langs->load("errors"); - $tmparray=explode(':', $result); - setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } else { $error++; - setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); } } - else - { - $error++; - $langs->load("errors"); - setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); - } } } @@ -247,7 +257,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) } } -if ($action == 'addthumb') // Regenerate thumbs +if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumbs { if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"])) { @@ -256,15 +266,20 @@ if ($action == 'addthumb') // Regenerate thumbs // Create thumbs of logo if ($isimage > 0) { + $constant = "MAIN_INFO_SOCIETE_LOGO"; + if ($action == 'addthumbsquarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; + + $reg = array(); + // Create thumbs - //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... // Create small thumb. Used on logon for example $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small', $quality); if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) { $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, $constant."_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbSmall); @@ -273,7 +288,7 @@ if ($action == 'addthumb') // Regenerate thumbs if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) { $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, $constant."_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbMini); @@ -297,24 +312,55 @@ if ($action == 'addthumb') // Regenerate thumbs } } -if ($action == 'removelogo') + +if ($action == 'removelogo' || $action == 'removelogosquarred') { + $constant = "MAIN_INFO_SOCIETE_LOGO"; + if ($action == 'removelogosquarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED"; + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; - if ($mysoc->logo != '') dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO", $conf->entity); - $mysoc->logo=''; + $logofilename = $mysoc->logo; + $logofilenamebis = $mysoc->logo_squarred; + if ($action == 'removelogosquarred') + { + $logofilename = $mysoc->logo_squarred; + $logofilenamebis = $mysoc->logo; + } - $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; - if ($mysoc->logo_small != '') dol_delete_file($logosmallfile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); - $mysoc->logo_small=''; + $logofile=$conf->mycompany->dir_output.'/logos/'.$logofilename; + if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logofile); + dolibarr_del_const($db, $constant, $conf->entity); + if ($action == 'removelogosquarred') $mysoc->logo_squarred=''; + else $mysoc->logo=''; - $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; - if ($mysoc->logo_mini != '') dol_delete_file($logominifile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); - $mysoc->logo_mini=''; + $logofilename = $mysoc->logo_small; + $logofilenamebis = $mysoc->logo_squarred_small; + if ($action == 'removelogosquarred') + { + $logofilename = $mysoc->logo_squarred_small; + $logofilenamebis = $mysoc->logo_small; + } + + $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; + if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logosmallfile); + dolibarr_del_const($db, $constant."_SMALL", $conf->entity); + if ($action == 'removelogosquarred') $mysoc->logo_squarred_small=''; + else $mysoc->logo_small=''; + + $logofilename = $mysoc->logo_mini; + $logofilenamebis = $mysoc->logo_squarred_mini; + if ($action == 'removelogosquarred') + { + $logofilename = $mysoc->logo_squarred_mini; + $logofilenamebis = $mysoc->logo_mini; + } + + $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$logofilename; + if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logominifile); + dolibarr_del_const($db, $constant."_MINI", $conf->entity); + if ($action == 'removelogosquarred') $mysoc->logo_squarred_mini=''; + else $mysoc->logo_mini=''; } @@ -337,875 +383,423 @@ $head = company_admin_prepare_head(); dol_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company'); -print ''.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Modify"), $langs->transnoentities("Save"))."
\n"; +print ''.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."
\n"; print "
\n"; -if ($action == 'edit' || $action == 'updateedit') + +/** + * Edit parameters + */ +print "\n".''."\n"; + +print '
'; +print ''; +print ''; + +print ''; +print ''."\n"; + +// Name + +print ''."\n"; + +// Addresse + +print ''."\n"; + + +print ''."\n"; + + +print ''."\n"; + +// Country + +print ''."\n"; + + +print ''; +// Fiscal year start +print '
'; +print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; +print '
'; +print '
'; +print '
'; +print '
'; +//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization +print $form->select_country($mysoc->country_id, 'country_id'); +if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +print '
'; +$state_id=0; +if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) { - /** - * Edition des parametres - */ - print "\n".''."\n"; - - print ''; - print ''; - print ''; - - print ''; - print ''."\n"; - - // Name - - print ''."\n"; - - // Addresse - - print ''."\n"; + $tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE); + $state_id=$tmp[0]; +} +$formcompany->select_departement($state_id, $mysoc->country_code, 'state_id'); +print ''."\n"; - print ''."\n"; +print ''."\n"; - print ''."\n"; - - // Country - - print ''."\n"; +print ''; +print ''."\n"; - print ''; +print ''."\n"; + + +print ''; +print ''."\n"; + +// Web +print ''; +print ''."\n"; + +// Barcode +if (! empty($conf->barcode->enabled)) { + + print ''; + print ''; +} + +// Logo +print ''; + +// Logo (squarred) +print ''; + +// Note +print ''; +print ''; + +print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; - print '
'; - print '
'; - print '
'; +print $form->selectCurrency($conf->currency, "currency"); +print '
'; - print '
'; - //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization - print $form->select_country($mysoc->country_id, 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - print '
'; +print '
'; - $state_id=0; - if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) +print '
'; +print '
'; +print '
'; +print '
'; + print '
'; +print '
'; +print ''; +print ''; +if (! empty($mysoc->logo_mini)) { + print ''.img_delete($langs->trans("Delete")).''; + if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { + print '   '; + print ''; + } +} else { + print ''; +} +print '
'; +print '
'; +print '
'; +print ''; +print ''; +if (! empty($mysoc->logo_squarred_mini)) { + print ''.img_delete($langs->trans("Delete")).''; + if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { + print '   '; + print ''; + } +} else { + print ''; +} +print '
'; +print '
'; +print '
'; + +print '
'; + +// IDs of the company (country-specific) +print ''; +print ''; + +$langs->load("companies"); + +// Managing Director(s) + +print ''; + +// GDPR contact + +print ''; + +// Capital + +print ''; + +// Juridical Status + +print ''; + +// ProfID1 +if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') +{ + + print ''."\n"; - - - print ''."\n"; - - - print ''; - print ''."\n"; - - - print ''; - print ''."\n"; - - - print ''; - print ''."\n"; - - // Web - print ''; - print ''."\n"; - - // Barcode - if (! empty($conf->barcode->enabled)) { - - print ''; - print ''; - } - - // Logo - print ''; - - // Note - print ''; - print ''; - - print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; +print '
'; +print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); +print ''; +print '
'; +print '
'; +if ($mysoc->country_code) { + print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code'); +} else { + print $countrynotdefined; +} +print '
'; + if (! empty($mysoc->country_code)) { - $tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE); - $state_id=$tmp[0]; + print ''; } - $formcompany->select_departement($state_id, $mysoc->country_code, 'state_id'); - print '
'; - print $form->selectCurrency($conf->currency, "currency"); - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print '
'; - print ''; - print ''; - if (! empty($mysoc->logo_mini)) { - print ''.img_delete($langs->trans("Delete")).''; - if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - print '   '; - print ''; - } - } else { - print ''; - } - print '
'; - print '
'; - print '
'; - - print '
'; - - // IDs of the company (country-specific) - print ''; - print ''; - - $langs->load("companies"); - - // Managing Director(s) - - print ''; - - // GDPR contact - - print ''; - - // Capital - - print ''; - - // Juridical Status - - print ''; - - // ProfID1 - if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId2 - if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId3 - if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId4 - if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId5 - if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId6 - if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') - { - - print ''; - } - - // TVA Intra - - print ''; - - // Object of the company - - print ''; - print ''; - - print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; - print '
'; - print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); - print ''; - print '
'; - print '
'; - if ($mysoc->country_code) { - print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code'); - } else { + else + { print $countrynotdefined; } print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; - if (! empty($mysoc->country_code)) - { - print ''; - } - else - { - print $countrynotdefined; - } - print '
'; - print ''; - print '
'; - print '
'; - - - // Fiscal year start - print '
'; - print ''; - print ''; - print ''; - print "\n"; - - print ''; - - print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'; - print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100') . '
"; - - - // Fiscal options - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - - print ""; - print '\n"; - - - print ""; - print '\n"; - - print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; - print ""; - print ""; - if ($mysoc->country_code == 'FR') print "\n"; - print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; - print "
'; - print ""; - print ""; - if ($mysoc->country_code == 'FR') print "\n"; - print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; - print "
"; - - /* - * Local Taxes - */ - if ($mysoc->useLocalTax(1)) - { - // Local Tax 1 - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; - print '\n"; - - - print ""; - print '\n"; - print "
'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."'; - print ''; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); - if(! isOnlyOneLocalTax(1)) - { - print ''; - } - - $opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); - - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
: '; - $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); - print '
'.$langs->trans("CalcLocaltax").': '; - print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); - print '
"; - print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; - print "
"; - } - if ($mysoc->useLocalTax(2)) - { - // Local Tax 2 - print '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - - // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; - print '\n"; - - - print ""; - print '\n"; - print "
'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."'; - print ''; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); - if(! isOnlyOneLocalTax(2)) - { - print ''; - } - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
: '; - $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); - print '
: '; - print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); - print '
"; - print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; - print "
"; - } - - - print '
'; - print ''; - print '     '; - print ''; - print '
'; - print '
'; - - print ''; } -else + +// ProfId2 +if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { - /* - * Show parameters - */ - // Actions buttons - //print '
'; - //print ''.$langs->trans("Modify").''; - //print '

'; - - print '
'; - print ''; - print ''; - - - print ''; - - - print ''; - - - print ''; - - - print ''; - - - print ''; - - - if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; - - - print ''; - - - print ''; - - - print ''; - - - print ''; - - // Web - - print ''; - - // Barcode - - if (! empty($conf->barcode->enabled)) - { - print ''; - } - - // Logo - - print ''; +} +// ProfId3 +if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') +{ - print ''; - - print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyName").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyName")).''; - print '
'.$langs->trans("CompanyAddress").'' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '
'.$langs->trans("CompanyZip").'' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '
'.$langs->trans("CompanyTown").'' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '
'.$langs->trans("CompanyCountry").''; - if ($mysoc->country_code) + print '
'; + if (! empty($mysoc->country_code)) { - $img=picto_from_langcode($mysoc->country_code); - print $img?$img.' ':''; - print getCountry($mysoc->country_code, 1); - } - else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; - print '
'.$langs->trans("Region-State").''; - else print '
'.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) - { - $tmp=explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE); - $state_id=$tmp[0]; - print getState($state_id, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); - } - print '
'.$langs->trans("CompanyCurrency").''; - print currency_name($conf->currency, 0); - print ' ('.$conf->currency; - print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); - print ')'; - print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333', 'MT'), 1, $langs, 1, -1, -1, $conf->currency); - print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '
'.$langs->trans("Web").''; - $arrayofurl = preg_split('/\s/', $conf->global->MAIN_INFO_SOCIETE_WEB); - foreach($arrayofurl as $urltoshow) - { - if ($urltoshow) print dol_print_url($urltoshow, '_blank', 80); - } - print '
'.$langs->trans("Gencod").'' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '
'.$langs->trans("Logo").''; - - $tagtd='tagtd '; - if ($conf->browser->layout == 'phone') $tagtd=''; - print '
'; - print $mysoc->logo; - print '
'; - - // It offers the generation of the thumbnail if it does not exist - if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i', $mysoc->logo)) - { - print '  '; - } - elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) - { - print ''; + print ''; } else { - print ''; + print $countrynotdefined; } - print '
'; - print '
'.$langs->trans("Note").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '
'; - print "
"; - - print '
'; - - - // IDs of the company (country-specific) - print '
'; - print ''; - - print '
'; - print ''; - print ''; - - // Managing Director(s) - - print ''; - - // GDPR Contact - - print ''; - - // Capital - - print ''; - - // Juridical Status - - print ''; - - // ProfId1 - if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') + print ''; - } - - // ProfId2 - if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId3 - if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId4 - if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId5 - if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') - { - - print ''; - } - - // ProfId6 - if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') - { - - print ''; - } - - // VAT - - print ''; - print ''; - print ''; + print ''; +} + +// ProfId4 +if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') +{ + + print ''; +} + +// ProfId5 +if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') +{ + + print ''; +} + +// ProfId6 +if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') +{ + + print ''; +} + +// TVA Intra + +print ''; + +// Object of the company + +print ''; +print ''; + +print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("ManagingDirectors").''; - print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '
'.$langs->trans("GDPRContact").''; - print $conf->global->MAIN_INFO_GDPR . '
'.$langs->trans("Capital").''; - print $conf->global->MAIN_INFO_CAPITAL . '
'.$langs->trans("JuridicalStatus").''; - print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); - print '
'; + if (! empty($mysoc->country_code)) { - - print '
'.$langs->transcountry("ProfId1", $mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_SIREN)) - { - print $conf->global->MAIN_INFO_SIREN; - $s = $mysoc->id_prof_url(1, $mysoc); - if ($s) print ' - '.$s; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId2", $mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_SIRET)) - { - print $conf->global->MAIN_INFO_SIRET; - $s = $mysoc->id_prof_url(2, $mysoc); - if ($s) print ' - '.$s; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId3", $mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_APE)) - { - print $conf->global->MAIN_INFO_APE; - $s = $mysoc->id_prof_url(3, $mysoc); - if ($s) print ' - '.$s; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId4", $mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_RCS)) - { - print $conf->global->MAIN_INFO_RCS; - $s = $mysoc->id_prof_url(4, $mysoc); - if ($s) print ' - '.$s; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId5", $mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_PROFID5)) - { - print $conf->global->MAIN_INFO_PROFID5; - $s = $mysoc->id_prof_url(5, $mysoc); - if ($s) print ' - '.$s; - } else { - print ' '; - } - print '
'.$langs->transcountry("ProfId6", $mysoc->country_code).''; - if (! empty($conf->global->MAIN_INFO_PROFID6)) - { - print $conf->global->MAIN_INFO_PROFID6; - $s = $mysoc->id_prof_url(6, $mysoc); - if ($s) print ' - '.$s; - } else { - print ' '; - } - print '
'.$langs->trans("VATIntra").''; - if (! empty($conf->global->MAIN_INFO_TVAINTRA)) - { - $s=''; - $s.=$conf->global->MAIN_INFO_TVAINTRA; - $s.=''; - if (empty($conf->global->MAIN_DISABLEVATCHECK) && $mysoc->isInEEC()) - { - $s.=' - '; - if (! empty($conf->use_javascript_ajax)) - { - print "\n"; - print ''; - print "\n"; - $s.=''.$langs->trans("VATIntraCheck").''; - $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1); - } - else - { - $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; - } - } - print $s; + print ''; } else { - print ' '; + print $countrynotdefined; } - print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; + if (! empty($mysoc->country_code)) + { + print ''; + } + else + { + print $countrynotdefined; + } + print '
'; +print ''; +print '
'; +print '
'; - print '
'.$langs->trans("CompanyObject").'' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '
'; +print ''; +print ''; +print "\n"; - print '
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").'
'; - print ""; +print ''; +print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100') . ''; - print ''; +print ""; - /* - * fiscal year beginning - */ + +// Fiscal options +print '
'; +print ''; +print ''; +print ''; +print ''; +print "\n"; + + +print ""; +print '\n"; + + +print ""; +print '\n"; + +print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").' 
'; +print ""; +print ""; +if ($mysoc->country_code == 'FR') print "\n"; +print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; +print "
'; +print ""; +print ""; +if ($mysoc->country_code == 'FR') print "\n"; +print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; +print "
"; + +/* + * Local Taxes + */ +if ($mysoc->useLocalTax(1)) +{ + // Local Tax 1 print '
'; - - print '
'; print ''; print ''; - print ''; + print ''; + print ''; print "\n"; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; + print '\n"; - /* - * tax options - */ + + print ""; + print '\n"; + print "
'.$langs->trans("FiscalYearInformation").''.$langs->trans("Value").''.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."'; + print ''; + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); + if(! isOnlyOneLocalTax(1)) + { + print ''; + } - print ''; + $opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc")); + print ''; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
: '; + $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); + print '
'.$langs->trans("FiscalMonthStart").''; - $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; - print dol_print_date(dol_mktime(12, 0, 0, $monthstart, 1, 2000, 1), '%B', 'gm') . '
'.$langs->trans("CalcLocaltax").': '; + print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1); + print '
"; - print ""; + print "
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."'; + print ""; + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; + print "
"; +} +if ($mysoc->useLocalTax(2)) +{ + // Local Tax 2 print '
'; - print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; - print '"; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; print '\n"; - print '"; + print ""; print '\n"; - print "
'.$langs->trans("VATManagement").''.$langs->trans("Description").''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
'; - print "global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."'; - print ""; - print ""; - if ($mysoc->country_code == 'FR') print "\n"; + print '
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
'; + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); + if(! isOnlyOneLocalTax(2)) + { + print ''; + } + print ''; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
: '; + $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); + print '
: '; + print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); + print '
"; print "
'; - print "global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - if ($mysoc->country_code == 'FR') print "\n"; + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; 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 '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - - print ""; - print '\n"; - - - print '"; - print '\n"; - - print "
'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
"; - print "global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); - if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) - { - print ''; - } - print ''; - print "
".$langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'.$langs->trans("CalcLocaltax").': '; - if($conf->global->MAIN_INFO_LOCALTAX_CALC1==0) - { - print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); - } - elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1) - { - print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); - } - elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){ - print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); - } - - print '
"; - print "
'; - print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; - 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 '
'; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - - print ""; - print '\n"; - - - print ""; - print '\n"; - - print "
'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
"; - print "global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); - if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) - { - print ''; - } - print ''; - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'
'.$langs->trans("CalcLocaltax").': '; - if($conf->global->MAIN_INFO_LOCALTAX_CALC2==0) - { - print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc"); - } - elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1) - { - print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"); - } - elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2) - { - print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"); - } - - print '
"; - print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; - print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); - print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; - print "
"; - print "
"; - } - - - // Actions buttons - print '
'; - print ''; - 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 '
'; +print ''; +print ''; + +clearstatcache(); + +print '
'; +print ''; +print ''; +print ''; +print ''; + +// Default language +print ''; +print ''; +print ''; + +// Multilingual GUI +print ''; +print ''; +print ''; + +print '
'.$langs->trans("Language").' 
'.$langs->trans("DefaultLanguage").''; +print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, 0, 0, 0, 0, 'minwidth300', 2); +print ' 
'.$langs->trans("EnableMultilangInterface").''; +print $form->selectyesno('MAIN_MULTILANGS', $conf->global->MAIN_MULTILANGS, 1); +print ' 

'."\n"; + +// Themes and themes options +showSkins(null, 1); +print '
'; + +// Other +print ''; +print ''; +print ''; +print ''; + +// Disable javascript and ajax +print ''; +print ''; +print ''; + +// Max size of lists +print ''; +print ''; +print ''; + +// Max size of short lists on customer card +print ''; +print ''; +print ''; + +// show input border +/* + print ''; + print ''; + print ''; + */ + +// First day for weeks +print ''; +print ''; +print ''; + +// DefaultWorkingDays +print ''; +print ''; +print ''; + +// DefaultWorkingHours +print ''; +print ''; +print ''; + +// Firstname/Name +print ''; +print ''; +print ''; + +// Hide unauthorized button +print ''; +print ''; +print ''; + +// Hide version link +/* + +print ''; +print ''; +print ''; +*/ + +// Show bugtrack link +print ''; +print ''; +print ''; + +// Hide wiki link on login page +$pictohelp=''; +print ''; +print ''; +print ''; + +// Message of the day on home page +$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount')); +complete_substitutions_array($substitutionarray, $langs); + +print ''."\n"; + +print '
'.$langs->trans("Miscellaneous").' 
'.$langs->trans("DisableJavascript").''; +print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); +print ' 
'.$langs->trans("DefaultMaxSizeList").' 
'.$langs->trans("DefaultMaxSizeShortList").' 
'.$langs->trans("showInputBorder").''; + print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1); + print ' 
'.$langs->trans("WeekStartOnDay").''; +print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'), 'MAIN_START_WEEK', 0); +print ' 
'.$langs->trans("DefaultWorkingDays").''; +print ''; +print ' 
'.$langs->trans("DefaultWorkingHours").''; +print ''; +print ' 
'.$langs->trans("FirstnameNamePosition").''; +$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname")); +print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0)); +print ' 
'.$langs->trans("ButtonHideUnauthorized").''; +print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0, 1); +print ' 
'.$langs->trans("HideVersionLink").''; +print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1); +print ' 
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; +print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); +print ' 
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; +print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0, 1); +print ' 
'; +$texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
'; +foreach($substitutionarray as $key => $val) { - //WYSIWYG Editor - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - - print ''; - print ''; - print ''; - - clearstatcache(); - - print '
'; - print ''; - print ''; - print ''; - print ''; - - // Default language - print ''; - print ''; - print ''; - - // Multilingual GUI - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Language").' 
'.$langs->trans("DefaultLanguage").''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, 0, 0, 0, 0, 'minwidth300', 2); - print ' 
'.$langs->trans("EnableMultilangInterface").''; - print $form->selectyesno('MAIN_MULTILANGS', $conf->global->MAIN_MULTILANGS, 1); - print ' 

'."\n"; - - // Themes and themes options - showSkins(null, 1); - print '
'; - - // Other - print ''; - print ''; - print ''; - print ''; - - // Disable javascript and ajax - print ''; - print ''; - print ''; - - // Max size of lists - print ''; - print ''; - print ''; - - // Max size of short lists on customer card - print ''; - print ''; - print ''; - - // show input border - /* - print ''; - print ''; - print ''; - */ - - // First day for weeks - print ''; - print ''; - print ''; - - // DefaultWorkingDays - print ''; - print ''; - print ''; - - // DefaultWorkingHours - print ''; - print ''; - print ''; - - // Firstname/Name - print ''; - print ''; - print ''; - - // Hide unauthorized button - print ''; - print ''; - print ''; - - // Show logo - print ''; - print ''; - print ''; - - // Hide version link - /* - - print ''; - print ''; - print ''; - */ - - // Show bugtrack link - print ''; - print ''; - print ''; - - // Hide wiki link on login page - $pictohelp=''; - print ''; - print ''; - print ''; - - // Message of the day on home page - $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount')); - complete_substitutions_array($substitutionarray, $langs); - - print ''."\n"; - - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").' 
'.$langs->trans("DisableJavascript").''; - print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); - print ' 
'.$langs->trans("DefaultMaxSizeList").' 
'.$langs->trans("DefaultMaxSizeShortList").' 
'.$langs->trans("showInputBorder").''; - print $form->selectyesno('main_showInputBorder',isset($conf->global->THEME_ELDY_SHOW_BORDER_INPUT)?$conf->global->THEME_ELDY_SHOW_BORDER_INPUT:0,1); - print ' 
'.$langs->trans("WeekStartOnDay").''; - print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'), 'MAIN_START_WEEK', 0); - print ' 
'.$langs->trans("DefaultWorkingDays").''; - print ''; - print ' 
'.$langs->trans("DefaultWorkingHours").''; - print ''; - print ' 
'.$langs->trans("FirstnameNamePosition").''; - $array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname")); - print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0)); - print ' 
'.$langs->trans("ButtonHideUnauthorized").''; - print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0, 1); - print ' 
'.$langs->trans("EnableShowLogo").''; - print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1); - print ' 
'.$langs->trans("HideVersionLink").''; - print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1); - print ' 
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; - print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); - print ' 
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; - print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0, 1); - print ' 
'; - $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
'; - foreach($substitutionarray as $key => $val) - { - $texthelp.=$key.'
'; - } - print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday'); - - print '
'; - - $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); - $doleditor->Create(); - - print '
'."\n"; - - print '
'; - - // Other - print ''; - print ''; - print ''; - print ''; - - // Message on login page - $substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount','user')); - complete_substitutions_array($substitutionarray, $langs); - print ''."\n"; - - // Hide helpcenter link on login page - print ''; - print ''; - print ''; - - // Background - print ''; - - print '
'.$langs->trans("LoginPage").' 
'; - $texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
'; - foreach($substitutionarray as $key => $val) - { - $texthelp.=$key.'
'; - } - print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin'); - print '
'; - $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); - $doleditor->Create(); - print '
'.$langs->trans("DisableLinkToHelpCenter").''; - print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0, 1); - print ' 
'; - print '
'; - print ''; - if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { - print ''.img_delete($langs->trans("Delete")).''; - if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) { - print '   '; - print ''; - } - } else { - print ''; - } - print '
'; - print '
'."\n"; - - - print '
'; - print '
'; - print ''; - print '   '; - print ''; - print '
'; - print '
'; - - print ''; + $texthelp.=$key.'
'; } -else // Show +print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday'); + +print '
'; + +$doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); +$doleditor->Create(); + +print '
'."\n"; + +print '
'; + +// Other +print ''; +print ''; +print ''; +print ''; + +// Message on login page +$substitutionarray=getCommonSubstitutionArray($langs, 0, array('object','objectamount','user')); +complete_substitutions_array($substitutionarray, $langs); +print ''."\n"; + +// Hide helpcenter link on login page +print ''; +print ''; +print ''; + +// Background +print ''; + +print '
'.$langs->trans("LoginPage").' 
'; +$texthelp=$langs->trans("FollowingConstantsWillBeSubstituted").'
'; +foreach($substitutionarray as $key => $val) { - // Language - print ''; - print ''; - - print ''; - print ''; - print ""; - - print ''; - print ''; - print ""; - - print '
'.$langs->trans("Language").'  
'.$langs->trans("DefaultLanguage").''; - $s=picto_from_langcode($conf->global->MAIN_LANG_DEFAULT); - print ($s?$s.' ':''); - print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); - print ''; - if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''), $conf->global->MAIN_LANG_DEFAULT), 1); - print '
'.$langs->trans("EnableMultilangInterface").'' . yn($conf->global->MAIN_MULTILANGS) . ' 

'."\n"; - - - // Themes - showSkins(null, 0); - print '
'; - - - // Other - print ''; - print ''; - - // Disable javascript/ajax - print '"; - print ""; - - // Max size of lists - print ''; - print ""; - - // Max size of short lists - print ''; - print ""; - - // First day for weeks - print ''; - print ''; - - // DefaultWorkingDays - print ''; - print ''; - - // DefaultWorkingHours - print ''; - print ''; - - // Firstname / Name position - print ''; - print ''; - - // Hide unauthorized button - print ''; - - // Show logo - print ''; - print ""; - - // Hide version link - /* - print ''; - print ''; - */ - - // Show bugtrack link - print '"; - print ""; - - // Link to wiki help - $pictohelp=''; - print ''; - - // Message of the day - print ''."\n"; - - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("DisableJavascript").''; - print yn($conf->global->MAIN_DISABLE_JAVASCRIPT); - print '   -   '.$langs->trans("DisableJavascriptNote").''; - print "
'.$langs->trans("DefaultMaxSizeList").'' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '
'.$langs->trans("DefaultMaxSizeShortList").'' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '
'.$langs->trans("WeekStartOnDay").''; - print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1')); - print '
'.$langs->trans("DefaultWorkingDays").''; - print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5'; - print '
'.$langs->trans("DefaultWorkingHours").''; - print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18'; - print '
'.$langs->trans("FirstnameNamePosition").''; - if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); } - else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); } - print '
'.$langs->trans("ButtonHideUnauthorized").''; - print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0), 1); - print '
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . '
'.$langs->trans("HideVersionLink").''; - print yn($conf->global->MAIN_HIDE_VERSION); - print '
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; - print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; - print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0), 1); - print '
'.$langs->trans("MessageOfDay").''; - if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD); - else print ' '; - print '
'."\n"; - - print '
'; - - // Login page - print '
'; - - print ''; - print ''; - - // Message login - print ''."\n"; - - // Link to help center - print ''; - - // Background login - print ''; - - print '
'.$langs->trans("LoginPage").'
'.$langs->trans("MessageLogin").''; - if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME); - else print ' '; - print '
'.$langs->trans("DisableLinkToHelpCenter").''; - print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0), 1); - print '
'.$langs->trans("BackgroundImageLogin").''; - print '
'; - print $conf->global->MAIN_LOGIN_BACKGROUND; - if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) - { - print ''; - } - else - { - print ''; - } - print '
'; - print '
'."\n"; - print '
'; - - print '
'; - print ''.$langs->trans("Modify").''; - print '
'; + $texthelp.=$key.'
'; } +print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin'); +print '
'; +$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); +$doleditor->Create(); +print '
'.$langs->trans("DisableLinkToHelpCenter").''; +print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0, 1); +print ' 
'; +print '
'; +$disabled = ''; +if (! empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) $disabled = ' disabled="disabled"'; +print ''; +if ($disabled) +{ + print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') '; +} +if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { + print ''.img_delete($langs->trans("Delete")).''; + if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) { + print '   '; + print ''; + } +} else { + print ''; +} +print '
'; +print '
'."\n"; + + +print '
'; +print '
'; +print ''; +print '
'; + +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 ''; - print ''; - print ''; - print ''; +// Gestionnaires de menu +print '
'.$langs->trans("Menu").''; - print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); - print ''; - print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); - print '
'; +print ''; +print ''; +print ''; +print ''; - // Menu top - print ''; - print ''; - print ''; - print ''; +// Menu top +print ''; +print ''; +print ''; +print ''; - // Menu smartphone - print ''; - print ''; - print ''; - print ''; +// Menu smartphone +print ''; +print '
'.$langs->trans("Menu").''; +print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); +print ''; +print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); +print '
'.$langs->trans("DefaultMenuManager").''; - $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 ''; - $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 '
'.$langs->trans("DefaultMenuManager").''; +$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 ''; +$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 '
'.$langs->trans("DefaultMenuSmartphoneManager").''; - $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 ''; - $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 '
'.$langs->trans("DefaultMenuSmartphoneManager").''; +$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 ''; - print ''; - print ''; - print ''; - - - print ''; - print ''; - print ''; - print ''; - - - print ''; - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Menu").''; - print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); - print ''; - print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); - print '
'.$langs->trans("DefaultMenuManager").''; - $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 ''; - $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 '
'.$langs->trans("DefaultMenuSmartphoneManager").''; - $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 ''; - $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 ' '.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 '
'; - print ''.$langs->trans("Modify").''; - 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 ''; +print ''; + +$selected=$conf->global->MAIN_PDF_FORMAT; +if (empty($selected)) $selected=dol_getDefaultFormat(); + +// Show pdf format + +print ''; + +print ''; +print ''; +print ''; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DictionaryPaperFormat").''; +print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT'); +print '
'.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; +print ''; +print '
'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; +print ''; +print '
'.$langs->trans("MAIN_PDF_MARGIN_TOP").''; +print ''; +print '
'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; +print ''; +print '
'; +print '
'; + +print '
'; + + +// Addresses +print load_fiche_titre($langs->trans("PDFAddressForging"), '', ''); + +print '
'; +print ''; +print ''; + +// Hide VAT Intra on address + +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 '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'; - print ''; - - $selected=$conf->global->MAIN_PDF_FORMAT; - if (empty($selected)) $selected=dol_getDefaultFormat(); - - // Show pdf format - - print ''; - - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DictionaryPaperFormat").''; - print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT'); - print '
'.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; - print ''; - print '
'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; - print ''; - print '
'.$langs->trans("MAIN_PDF_MARGIN_TOP").''; - print ''; - print '
'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").''; - print ''; - print '
'; - print '
'; - - print '
'; - - - // Addresses - print load_fiche_titre($langs->trans("PDFAddressForging"), '', ''); - - print '
'; - print ''; - print ''; - - // Hide VAT Intra on address - - 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 ''; - } - } - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'.$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 '
'; - - - // 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 ''; - - // Hide any information on Sale tax / VAT - - print ''; - - // Locataxes - print $text; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'; - print '
'; - - - // Other - print load_fiche_titre($langs->trans("Other"), '', ''); - - print '
'; - print ''; - print ''; - - //Desc - - print ''; - - //Ref - - print ''; - - //Details - - print ''; - - //Invert sender and recipient - - print ''; - - // Place customer adress to the ISO location - - print ''; - - - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'.$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 '
'.$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 '
'.$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 '
'.$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 '
'.$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 '
'; -} -else // Show -{ - // Misc options - print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', ''); - - - print '
'; - print ''; - print ''; - - // Show pdf format - - print ''; - - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'.$langs->trans("MAIN_PDF_MARGIN_LEFT").''; - print empty($conf->global->MAIN_PDF_MARGIN_LEFT)?10:$conf->global->MAIN_PDF_MARGIN_LEFT; - print '
'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").''; - print empty($conf->global->MAIN_PDF_MARGIN_RIGHT)?10:$conf->global->MAIN_PDF_MARGIN_RIGHT; - print '
'.$langs->trans("MAIN_PDF_MARGIN_TOP").''; - print empty($conf->global->MAIN_PDF_MARGIN_TOP)?10:$conf->global->MAIN_PDF_MARGIN_TOP; - 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 load_fiche_titre($langs->trans("PDFAddressForging"), '', ''); - - print '
'; - print ''; - print ''; - - // Hide Intra VAT on address - - 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 ''; - } - } - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowVATIntaInAddress").''; - print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS, 1); - print '
'.$langs->trans("ShowProfIdInAddress").' - '.$pid.''; - $keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS'; - print yn($conf->global->$keyforconstant, 1); - 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 ''; - - print ''; - - print $text; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("HideAnyVATInformationOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT, 1); - print '
'; - print '
'; - - - // Other - print load_fiche_titre($langs->trans("Other"), '', ''); - - print '
'; - print ''; - print ''; - - // Encrypt and protect PDF - - print ''; - print ''; - print ''; - print '"; - - print ""; - print ''; - - // Hide Desc - - print ''; - - // Hide Ref - - print ''; - - // Hide Details - - print ''; - - // Invert sender and recipient - print ''; - - // Use French location - print ''; - - - print ''; - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $text = $langs->trans("ProtectAndEncryptPdfFiles"); - $desc = $form->textwithpicto($text, $langs->transnoentities("ProtectAndEncryptPdfFilesDesc"), 1); - print $desc; - print ''; - if($conf->global->PDF_SECURITY_ENCRYPTION == 1) - { - print img_picto($langs->trans("Active"), 'tick'); - } - print ''; - if (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 "
'.$langs->trans("HideDescOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC, 1); - print '
'.$langs->trans("HideRefOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF, 1); - print '
'.$langs->trans("HideDetailsOnPDF").''; - print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS, 1); - print '
'.$langs->trans("SwapSenderAndRecipientOnPDF").''; - print yn($conf->global->MAIN_INVERT_SENDER_RECIPIENT, 1); - print '
'.$langs->trans("PlaceCustomerAddressToIsoLocation").''; - print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION, 1); - 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 '
'; - - - /* - * Library - */ - - print '
'; - print load_fiche_titre($langs->trans("Library"), '', ''); - - print '
'; - print ''."\n"; - - print ''."\n"; - print ''."\n"; - print ''."\n"; - print "\n"; - - print ''."\n"; - print ''."\n"; - 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 "
'.$langs->trans("Name").''.$langs->trans("Value").'
'.$langs->trans("LibraryToBuildPDF").''; - $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 '
\n"; - print '
'; - - print '
'; - print ''.$langs->trans("Modify").''; - 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 ''; + +// Hide any information on Sale tax / VAT + +print ''; + +// Locataxes +print $text; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'; +print '
'; + + +// Other +print load_fiche_titre($langs->trans("Other"), '', ''); + +print '
'; +print ''; +print ''; + +//Desc + +print ''; + +//Ref + +print ''; + +//Details + +print ''; + +//Invert sender and recipient + +print ''; + +// Place customer adress to the ISO location + +print ''; + + +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$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 '
'.$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 '
'.$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 '
'.$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 '
'.$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 '
'.$langs->trans("ShowDetailsInPDFPageFoot").''; +print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS); +print '
'; +print '
'; + + +/* + * Library + */ + +print '
'; +print load_fiche_titre($langs->trans("Library"), '', ''); + +print '
'; +print ''."\n"; + +print ''."\n"; +print ''."\n"; +print ''."\n"; +print "\n"; + +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + +print "
'.$langs->trans("Name").''.$langs->trans("Value").'
'.$langs->trans("LibraryToBuildPDF").''; +$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 '
'; + + +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 ''; if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); else $title=$langs->trans("ShowPreview"); - print ''.$title.''; + print ''.$title.''; 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 ''; + 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 '