Merge branch 'develop' into patch-14

This commit is contained in:
Laurent Destailleur 2019-10-11 16:30:50 +02:00 committed by GitHub
commit 85b4403bb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
127 changed files with 1901 additions and 2486 deletions

View File

@ -23,6 +23,8 @@ Following changes may create regressions for some external modules, but were nec
* If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...) * If you have developed your own emailing target selector and used parent::add_to_target(...), you must now use parent::addToTargets(...)
* Removed function dol_micro_time. Use native PHP microtime instead. * Removed function dol_micro_time. Use native PHP microtime instead.
* The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * 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 ***** ***** ChangeLog for 10.0.2 compared to 10.0.1 *****

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

File diff suppressed because one or more lines are too long

View File

@ -17,14 +17,14 @@ fi
# To detec # To detec
if [ "x$1" = "xlist" ] if [ "x$1" = "xlist" ]
then then
find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep CRLF find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep CRLF
# find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'htdocs\/includes' | grep CRLF # find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep -v 'htdocs\/includes' | grep CRLF
fi fi
# To convert # To convert
if [ "x$1" = "xfix" ] if [ "x$1" = "xfix" ]
then then
for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep CRLF | awk -F':' '{ print $1 }' ` for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep CRLF | awk -F':' '{ print $1 }' `
do do
echo "Fix file $fic" echo "Fix file $fic"
dos2unix "$fic" dos2unix "$fic"

View File

@ -279,8 +279,8 @@ if ($action != 'export_csv')
print '</tr>'; print '</tr>';
} }
// Affiche le compte comptable en debut de ligne // Show first line of a break
print "<tr>"; print '<tr class="trforbreak">';
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '</td>'; print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">' . $line->numero_compte . ($root_account_description ? ' - ' . $root_account_description : '') . '</td>';
print '</tr>'; print '</tr>';

View File

@ -930,7 +930,7 @@ class AccountancyExport
{ {
$separator = ';'; $separator = ';';
$end_line = "\n"; $end_line = "\r\n";
foreach ($objectLines as $line) { foreach ($objectLines as $line) {
@ -984,8 +984,9 @@ class AccountancyExport
print $separator; print $separator;
} }
*/ */
print $separator; // deprecated CPTG & CPTA use instead
// MONT // MONT
print price(abs($line->montant)) . $separator; print price(abs($line->montant), 0, '', 1, 2) . $separator;
// CODC // CODC
print $line->sens . $separator; print $line->sens . $separator;
// CPTG // CPTG
@ -999,15 +1000,54 @@ class AccountancyExport
// CPTA // CPTA
if (! empty($line->subledger_account)) { if (! empty($line->subledger_account)) {
print length_accounta($line->subledger_account) . $separator; print length_accounta($line->subledger_account) . $separator;
} else {
print $separator;
} }
// CNAT // CNAT
if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) { if ($line->doc_type == 'supplier_invoice' && ! empty($line->subledger_account)) {
print 'F'; print 'F' . $separator;
} elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) { } elseif ($line->doc_type == 'customer_invoice' && ! empty($line->subledger_account)) {
print 'C'; print 'C' . $separator;
} else { } else {
print ''; 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; print $end_line;
} }
} }

View File

@ -413,7 +413,6 @@ if ($result) {
$objp->code_sell_l = ''; $objp->code_sell_l = '';
$objp->code_sell_p = ''; $objp->code_sell_p = '';
$objp->aarowid_suggest = '';
$product_static->ref = $objp->product_ref; $product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id; $product_static->id = $objp->product_id;
@ -425,7 +424,7 @@ if ($result) {
$facture_static->type = $objp->ftype; $facture_static->type = $objp->ftype;
$code_sell_p_notset = ''; $code_sell_p_notset = '';
$objp->aarowid_suggest = $objp->aarowid; $objp->aarowid_suggest = ''; // Will be set later
$isBuyerInEEC = isInEEC($objp); $isBuyerInEEC = isInEEC($objp);
@ -459,8 +458,9 @@ if ($result) {
} }
if ($objp->code_sell_l == -1) $objp->code_sell_l=''; if ($objp->code_sell_l == -1) $objp->code_sell_l='';
// Search suggested account for product/service
$suggestedaccountingaccountfor = ''; $suggestedaccountingaccountfor = '';
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country) if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
$objp->code_sell_p = $objp->code_sell; $objp->code_sell_p = $objp->code_sell;
$objp->aarowid_suggest = $objp->aarowid; $objp->aarowid_suggest = $objp->aarowid;
$suggestedaccountingaccountfor = ''; $suggestedaccountingaccountfor = '';
@ -549,12 +549,19 @@ if ($result) {
// Suggested accounting account // Suggested accounting account
print '<td>'; print '<td>';
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); $suggestedid = $objp->aarowid_suggest;
if (empty($suggestedid) && empty($objp->code_sell_p) && ! empty($objp->code_sell_l) && ! empty($conf->global->ACCOUNTANCY_AUTOFILL_ACCOUNT_WITH_GENERIC))
{
//$suggestedid = // id of $objp->code_sell_l
}
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
print '</td>'; print '</td>';
// Column with checkbox // Column with checkbox
print '<td class="center">'; print '<td class="center">';
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>'; //var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest);
$ischecked = $objp->aarowid_suggest;
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($ischecked ? "checked" : "") . '/>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -192,12 +192,12 @@ if ($search_lineid) {
if (strlen(trim($search_invoice))) { if (strlen(trim($search_invoice))) {
$sql .= natural_search("f.ref", $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))) { if (strlen(trim($search_ref))) {
$sql .= natural_search("p.ref", $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))) { if (strlen(trim($search_desc))) {
$sql .= natural_search("l.description", $search_desc); $sql .= natural_search("l.description", $search_desc);
} }
@ -300,14 +300,13 @@ if ($result) {
print '<tr class="liste_titre_filter">'; print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre center nowraponall">'; print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>'; print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>'; print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';

View File

@ -234,12 +234,12 @@ if ($search_lineid) {
if (strlen(trim($search_invoice))) { if (strlen(trim($search_invoice))) {
$sql .= natural_search("f.ref", $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))) { if (strlen(trim($search_ref))) {
$sql .= natural_search("p.ref", $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))) { if (strlen(trim($search_desc))) {
$sql .= natural_search("l.description", $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_year) $param.='&search_year='.urlencode($search_year);
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice); if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref); 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_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount); if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat); if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
@ -362,14 +363,13 @@ if ($result) {
print '<tr class="liste_titre_filter">'; print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth25" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre center nowraponall">'; print '<td class="liste_titre center nowraponall">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">'; if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">'; print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year, 'search_year', 1, 20, 5); $formother->select_year($search_year, 'search_year', 1, 20, 5);
print '</td>'; print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>'; print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>'; print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>'; print '<td class="liste_titre right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
@ -521,12 +521,14 @@ if ($result) {
// Suggested accounting account // Suggested accounting account
print '<td>'; print '<td>';
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'); $suggestedid = $objp->aarowid_suggest;
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
print '</td>'; print '</td>';
// Column with checkbox // Column with checkbox
print '<td class="center">'; print '<td class="center">';
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>'; $ischecked = $objp->aarowid_suggest;
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($ischecked ? "checked" : "") . '/>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -93,8 +93,6 @@ $countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst")
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
print "<br>\n"; print "<br>\n";
if ($action == 'edit' || $action == 'updateedit')
{
/** /**
* Edit parameters * Edit parameters
*/ */
@ -169,82 +167,13 @@ if ($action == 'edit' || $action == 'updateedit')
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; //print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; //print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
print '<br>'; //print '<br>';
print '</form>';
}
else
{
/*
* Show parameters
*/
// Actions buttons
//print '<div class="tabsAction">';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
//print '</div><br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="oddeven liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr><td class="titlefield wordbreak">'.$langs->trans("CompanyName").'</td><td>';
print $conf->global->MAIN_INFO_ACCOUNTANT_NAME;
print '</td></tr>';
print '<tr><td>'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) . '</td></tr>';
print '<tr><td>'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP)?'':$conf->global->MAIN_INFO_ACCOUNTANT_ZIP) . '</td></tr>';
print '<tr><td>'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN)?'':$conf->global->MAIN_INFO_ACCOUNTANT_TOWN) . '</td></tr>';
print '<tr><td>'.$langs->trans("CompanyCountry").'</td><td>';
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 '</td></tr>';
if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr><td>'.$langs->trans("Region-State").'</td><td>';
else print '<tr><td>'.$langs->trans("State").'</td><td>';
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 '&nbsp;';
print '</td></tr>';
print '<tr><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_PHONE, $mysoc->country_code) . '</td></tr>';
print '<tr><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_ACCOUNTANT_FAX, $mysoc->country_code) . '</td></tr>';
print '<tr><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_ACCOUNTANT_MAIL, 0, 0, 0, 80) . '</td></tr>';
print '<tr><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_ACCOUNTANT_WEB, '_blank', 80) . '</td></tr>';
print '<tr><td>'.$langs->trans("AccountantFileNumber").'</td><td>' . $conf->global->MAIN_INFO_ACCOUNTANT_CODE . '</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? nl2br($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) : '') . '</td></tr>';
print '</table>';
print "</div>";
print '</form>'; print '</form>';
// Actions buttons
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a></div>';
print '</div>';
}
llxFooter(); llxFooter();

View File

@ -222,7 +222,7 @@ llxHeader('', $langs->trans("Boxes"));
print load_fiche_titre($langs->trans("Boxes"), '', 'title_setup'); print load_fiche_titre($langs->trans("Boxes"), '', 'title_setup');
print $langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n"; print '<span class="opacitymedium">'.$langs->trans("BoxesDesc")." ".$langs->trans("OnlyActiveElementsAreShown")."</span><br>\n";
/* /*
* Search for the default active boxes for each possible position * Search for the default active boxes for each possible position

View File

@ -105,9 +105,15 @@ 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_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode", 'alpha'), '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/'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
$arrayofimages = array('logo', 'logo_squarred');
foreach($arrayofimages as $varforimage)
{
if ($_FILES[$varforimage]["tmp_name"]) if ($_FILES[$varforimage]["tmp_name"])
{ {
$reg = array();
if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg))
{ {
$original_file=$reg[1]; $original_file=$reg[1];
@ -123,7 +129,10 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
$result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']);
if ($result > 0) if ($result > 0)
{ {
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO", $original_file, 'chaine', 0, '', $conf->entity); $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) // Create thumbs of logo (Note that PDF use original file and not thumbs)
if ($isimage > 0) if ($isimage > 0)
@ -136,7 +145,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg))
{ {
$imgThumbSmall = $reg[1]; // Save only basename $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); else dol_syslog($imgThumbSmall);
@ -145,7 +154,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg))
{ {
$imgThumbMini = $reg[1]; // Save only basename $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); else dol_syslog($imgThumbMini);
} }
@ -170,6 +179,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
} }
} }
} }
}
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity);
@ -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"])) if (file_exists($conf->mycompany->dir_output.'/logos/'.$_GET["file"]))
{ {
@ -256,6 +266,11 @@ if ($action == 'addthumb') // Regenerate thumbs
// Create thumbs of logo // Create thumbs of logo
if ($isimage > 0) if ($isimage > 0)
{ {
$constant = "MAIN_INFO_SOCIETE_LOGO";
if ($action == 'addthumbsquarred') $constant = "MAIN_INFO_SOCIETE_LOGO_SQUARRED";
$reg = array();
// Create thumbs // 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...
@ -264,7 +279,7 @@ if ($action == 'addthumb') // Regenerate thumbs
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg))
{ {
$imgThumbSmall = $reg[1]; // Save only basename $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); else dol_syslog($imgThumbSmall);
@ -273,7 +288,7 @@ if ($action == 'addthumb') // Regenerate thumbs
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg))
{ {
$imgThumbMini = $reg[1]; // Save only basename $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); 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'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; $logofilename = $mysoc->logo;
if ($mysoc->logo != '') dol_delete_file($logofile); $logofilenamebis = $mysoc->logo_squarred;
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO", $conf->entity); if ($action == 'removelogosquarred')
$mysoc->logo=''; {
$logofilename = $mysoc->logo_squarred;
$logofilenamebis = $mysoc->logo;
}
$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; $logofile=$conf->mycompany->dir_output.'/logos/'.$logofilename;
if ($mysoc->logo_small != '') dol_delete_file($logosmallfile); if ($logofilename != '' && $logofilename != $logofilenamebis) dol_delete_file($logofile);
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); dolibarr_del_const($db, $constant, $conf->entity);
$mysoc->logo_small=''; if ($action == 'removelogosquarred') $mysoc->logo_squarred='';
else $mysoc->logo='';
$logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; $logofilename = $mysoc->logo_small;
if ($mysoc->logo_mini != '') dol_delete_file($logominifile); $logofilenamebis = $mysoc->logo_squarred_small;
dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); if ($action == 'removelogosquarred')
$mysoc->logo_mini=''; {
$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,13 +383,12 @@ $head = company_admin_prepare_head();
dol_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company'); dol_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company');
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Modify"), $langs->transnoentities("Save"))."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."</span><br>\n";
print "<br>\n"; print "<br>\n";
if ($action == 'edit' || $action == 'updateedit')
{
/** /**
* Edition des parametres * Edit parameters
*/ */
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () { print '$(document).ready(function () {
@ -434,10 +479,10 @@ if ($action == 'edit' || $action == 'updateedit')
// Logo // Logo
print '<tr class="oddeven"><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>'; print '<tr class="oddeven"><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>';
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">'; print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
print '<input type="file" class="flat class=minwidth200" name="logo" id="logo" accept="image/*">'; print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
print '</td><td class="nocellnopadd right" valign="middle">'; print '</td><td class="nocellnopadd right" valign="middle">';
if (! empty($mysoc->logo_mini)) { if (! empty($mysoc->logo_mini)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
print ' &nbsp; '; print ' &nbsp; ';
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">'; print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
@ -448,6 +493,23 @@ if ($action == 'edit' || $action == 'updateedit')
print '</td></tr></table>'; print '</td></tr></table>';
print '</td></tr>'; print '</td></tr>';
// Logo (squarred)
print '<tr class="oddeven"><td><label for="logo_squarred">'.$langs->trans("LogoSquarred").' (png,jpg)</label></td><td>';
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
print '</td><td class="nocellnopadd right" valign="middle">';
if (! empty($mysoc->logo_squarred_mini)) {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
print ' &nbsp; ';
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">';
}
} else {
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
}
print '</td></tr></table>';
print '</td></tr>';
// Note // Note
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>'; print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note', 'none') ? GETPOST('note', 'none') : $conf->global->MAIN_INFO_SOCIETE_NOTE).'</textarea></td></tr>'; print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note', 'none') ? GETPOST('note', 'none') : $conf->global->MAIN_INFO_SOCIETE_NOTE).'</textarea></td></tr>';
@ -733,478 +795,10 @@ if ($action == 'edit' || $action == 'updateedit')
print '<br><div class="center">'; print '<br><div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
print '<br>';
print '</form>';
}
else
{
/*
* Show parameters
*/
// Actions buttons
//print '<div class="tabsAction">';
//print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
//print '</div><br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td class="titlefield wordbreak">'.$langs->trans("CompanyName").'</td><td>';
if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM;
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyName")).'</font>';
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CompanyCountry").'</td><td>';
if ($mysoc->country_code)
{
$img=picto_from_langcode($mysoc->country_code);
print $img?$img.' ':'';
print getCountry($mysoc->country_code, 1);
}
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
print '</td></tr>';
if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print '<tr class="oddeven"><td>'.$langs->trans("Region-State").'</td><td>';
else print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>';
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 '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("CompanyCurrency").'</td><td>';
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 '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '</td></tr>';
// Web
print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>';
$arrayofurl = preg_split('/\s/', $conf->global->MAIN_INFO_SOCIETE_WEB);
foreach($arrayofurl as $urltoshow)
{
if ($urltoshow) print dol_print_url($urltoshow, '_blank', 80);
}
print '</td></tr>';
// Barcode
if (! empty($conf->barcode->enabled))
{
print '<tr class="oddeven"><td>'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
}
// Logo
print '<tr class="oddeven"><td>'.$langs->trans("Logo").'</td><td>';
$tagtd='tagtd ';
if ($conf->browser->layout == 'phone') $tagtd='';
print '<div class="tagtable centpercent"><div class="tagtr inline-block centpercent valignmiddle"><div class="'.$tagtd.'inline-block valignmiddle left">';
print $mysoc->logo;
print '</div><div class="'.$tagtd.'inline-block valignmiddle left">';
// 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 '<a class="img_logo" href="'.$_SERVER["PHP_SELF"].'?action=addthumb&amp;file='.urlencode($mysoc->logo).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').'</a>&nbsp;&nbsp;';
}
elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
}
else
{
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
}
print '</div></div></div>';
print '</td></tr>';
print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
print '</table>';
print "</div>";
print '<br>';
// IDs of the company (country-specific)
print '<form name="formsoc" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield wordbreak">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
// Managing Director(s)
print '<tr class="oddeven"><td>'.$langs->trans("ManagingDirectors").'</td><td>';
print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '</td></tr>';
// GDPR Contact
print '<tr class="oddeven"><td>'.$langs->trans("GDPRContact").'</td><td>';
print $conf->global->MAIN_INFO_GDPR . '</td></tr>';
// Capital
print '<tr class="oddeven"><td>'.$langs->trans("Capital").'</td><td>';
print $conf->global->MAIN_INFO_CAPITAL . '</td></tr>';
// Juridical Status
print '<tr class="oddeven"><td>'.$langs->trans("JuridicalStatus").'</td><td>';
print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
print '</td></tr>';
// ProfId1
if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-')
{
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId1", $mysoc->country_code).'</td><td>';
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 '&nbsp;';
}
print '</td></tr>';
}
// ProfId2
if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-')
{
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId2", $mysoc->country_code).'</td><td>';
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 '&nbsp;';
}
print '</td></tr>';
}
// ProfId3
if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-')
{
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId3", $mysoc->country_code).'</td><td>';
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 '&nbsp;';
}
print '</td></tr>';
}
// ProfId4
if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-')
{
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId4", $mysoc->country_code).'</td><td>';
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 '&nbsp;';
}
print '</td></tr>';
}
// ProfId5
if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-')
{
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId5", $mysoc->country_code).'</td><td>';
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 '&nbsp;';
}
print '</td></tr>';
}
// ProfId6
if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-')
{
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId6", $mysoc->country_code).'</td><td>';
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 '&nbsp;';
}
print '</td></tr>';
}
// VAT
print '<tr class="oddeven"><td>'.$langs->trans("VATIntra").'</td>';
print '<td>';
if (! empty($conf->global->MAIN_INFO_TVAINTRA))
{
$s='';
$s.=$conf->global->MAIN_INFO_TVAINTRA;
$s.='<input type="hidden" name="tva_intra" size="12" maxlength="20" value="'.$conf->global->MAIN_INFO_TVAINTRA.'">';
if (empty($conf->global->MAIN_DISABLEVATCHECK) && $mysoc->isInEEC())
{
$s.=' - ';
if (! empty($conf->use_javascript_ajax))
{
print "\n";
print '<script language="JavaScript" type="text/javascript">';
print "function CheckVAT(a) {\n";
print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,285);\n";
print "}\n";
print '</script>';
print "\n";
$s.='<a href="#" onClick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
$s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->transnoentitiesnoconv("VATIntraCheck")), 1);
}
else
{
$s.='<a href="'.$langs->transcountry("VATIntraCheckURL", $soc->id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').'</a>';
}
}
print $s;
}
else
{
print '&nbsp;';
}
print '</td>';
print '</tr>';
print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
print '</table>';
print "</div>";
print '</form>'; print '</form>';
/*
* fiscal year beginning
*/
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td>'.$langs->trans("FiscalMonthStart").'</td><td>';
$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') . '</td></tr>';
print "</table>";
print "</div>";
/*
* tax options
*/
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>';
print "</tr>\n";
print '<tr class="oddeven"><td class="titlefield">';
print "<input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"use_vat\">".$langs->trans("VATIsUsedDesc")."</label></td></tr>";
if ($mysoc->country_code == 'FR') print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i></td></tr>\n";
print "</table>";
print "</td></tr>\n";
print '<tr class="oddeven"><td class="titlefield">';
print "<input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label=\"no_vat\">".$langs->trans("VATIsNotUsedDesc")."</label></td></tr>";
if ($mysoc->country_code == 'FR') print "<tr><td><i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i></td></tr>\n";
print "</table>";
print "</td></tr>\n";
print "</table>";
print "</div>";
/*
* 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 '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->transcountry("LocalTax1Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>';
print "</tr>\n";
print "<tr class=\"oddeven\"><td>";
print "<input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td></label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i></td></tr>\n":"");
if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0)
{
print '<tr><td>'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'</td></tr>';
}
print '<tr><td class="left">'.$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 '</td></tr>';
print "</table>";
print "</td></tr>\n";
print '<tr class="oddeven"><td>';
print "<input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"no_lt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
print ($example!="LocalTax1IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
print "</table>";
print "</div>";
}
if ($mysoc->useLocalTax(2)) // True if we found at least on vat with a setup adding a localtax 1
{
// Local Tax 2
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->transcountry("LocalTax2Management", $mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>';
print "</tr>\n";
print "<tr class=\"oddeven\"><td>";
print "<input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i></td></tr>\n":"");
if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0)
{
print '<tr><td>'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'</td></tr>';
}
print '<tr><td class="left">'.$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 '</td></tr>';
print "</table>";
print "</td></tr>\n";
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<table>";
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc", $mysoc->country_code)."</label></td></tr>";
$example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
print ($example!="LocalTax2IsNotUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."</i></td></tr>\n":"");
print "</table>";
print "</td></tr>\n";
print "</table>";
print "</div>";
}
// Actions buttons
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a></div>';
print '</div>';
}
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -174,8 +174,8 @@ llxHeader();
print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup'); print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup');
print $langs->transnoentities("DelaysOfToleranceDesc", img_warning()); print '<span class="opacitymedium">'.$langs->transnoentities("DelaysOfToleranceDesc", img_warning());
print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."<br>\n"; print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."</span><br>\n";
print "<br>\n"; print "<br>\n";
$countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>'; $countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';

View File

@ -222,11 +222,7 @@ $formadmin=new FormAdmin($db);
print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup'); print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup');
print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("DisplayDesc")."</span><br>\n";
print "<br>\n";
if ($action == 'edit') // Edit
{
//WYSIWYG Editor //WYSIWYG Editor
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -264,7 +260,7 @@ if ($action == 'edit') // Edit
// Other // Other
print '<table summary="otherparameters" class="noborder" width="100%">'; print '<table summary="otherparameters" class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>'; print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Miscellaneous").'</td><td></td>';
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -330,13 +326,6 @@ if ($action == 'edit') // Edit
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
// Show logo
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableShowLogo").'</td><td>';
print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide version link // Hide version link
/* /*
@ -416,9 +405,15 @@ if ($action == 'edit') // Edit
// Background // Background
print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">'; print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
print '<div class="centpercent inline-block">'; print '<div class="centpercent inline-block">';
print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground">'; $disabled = '';
if (! empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) $disabled = ' disabled="disabled"';
print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground"'.$disabled.'>';
if ($disabled)
{
print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
}
if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { if (! empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>'; print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) { if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
print ' &nbsp; '; print ' &nbsp; ';
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">'; print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
@ -435,162 +430,10 @@ if ($action == 'edit') // Edit
print '<br>'; print '<br>';
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
print '<br>';
print '</form>'; print '</form>';
}
else // Show
{
// Language
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Language").'</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
$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 '</td>';
print '<td width="20">';
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 '</td>';
print "</tr>";
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>' . yn($conf->global->MAIN_MULTILANGS) . '</td>';
print '<td width="20">&nbsp;</td>';
print "</tr>";
print '</table><br>'."\n";
// Themes
showSkins(null, 0);
print '<br>';
// Other
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td></tr>';
// Disable javascript/ajax
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableJavascript").'</td><td>';
print yn($conf->global->MAIN_DISABLE_JAVASCRIPT);
print ' <span class="opacitymedium"> &nbsp; - &nbsp; '.$langs->trans("DisableJavascriptNote").'</span>';
print "</td>";
print "</tr>";
// Max size of lists
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->MAIN_SIZE_LISTE_LIMIT . '</td>';
print "</tr>";
// Max size of short lists
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMaxSizeShortList").'</td><td>' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '</td>';
print "</tr>";
// First day for weeks
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'));
print '</td>';
print '</tr>';
// DefaultWorkingDays
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
print isset($conf->global->MAIN_DEFAULT_WORKING_DAYS)?$conf->global->MAIN_DEFAULT_WORKING_DAYS:'1-5';
print '</td>';
print '</tr>';
// DefaultWorkingHours
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
print isset($conf->global->MAIN_DEFAULT_WORKING_HOURS)?$conf->global->MAIN_DEFAULT_WORKING_HOURS:'9-18';
print '</td>';
print '</tr>';
// Firstname / Name position
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Lastname"); }
else { print $langs->trans("Lastname").' '.$langs->trans("Firstname"); }
print '</td>';
print '</tr>';
// Hide unauthorized button
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0), 1);
print '</td></tr>';
// Show logo
print '<tr class="oddeven"><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
print "</tr>";
// Hide version link
/*
print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
print yn($conf->global->MAIN_HIDE_VERSION);
print '</td>';
print '</tr>';
*/
// Show bugtrack link
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
print "</tr>";
// Link to wiki help
$pictohelp='<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp", $pictohelp).'</td><td>';
print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0), 1);
print '</td></tr>';
// Message of the day
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("MessageOfDay").'</td><td>';
if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
else print '&nbsp;';
print '</td></tr>'."\n";
print '</table>'."\n";
print '<br>';
// Login page
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("LoginPage").'</td><td></td></tr>';
// Message login
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("MessageLogin").'</td><td>';
if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
else print '&nbsp;';
print '</td></tr>'."\n";
// Link to help center
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0), 1);
print '</td></tr>';
// Background login
print '<tr class="oddeven"><td>'.$langs->trans("BackgroundImageLogin").'</td><td>';
print '<div class="centpercent inline-block">';
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 '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
}
else
{
print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
}
print '</div>';
print '</td></tr>';
print '</table>'."\n";
print '</div>';
print '<div class="tabsAction tabsActionNoBottom">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
}
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -90,7 +90,7 @@ llxHeader();
print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup'); print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup');
print $langs->trans("LimitsDesc")."<br>\n"; print '<span class="opacitymedium">'.$langs->trans("LimitsDesc")."</span><br>\n";
print "<br>\n"; print "<br>\n";
if ($action == 'edit') if ($action == 'edit')

View File

@ -159,8 +159,6 @@ print '<span class="opacitymedium">'.$langs->trans("MenusDesc")."</span><br>\n";
print "<br>\n"; print "<br>\n";
if ($action == 'edit')
{
clearstatcache(); clearstatcache();
// Gestionnaires de menu // Gestionnaires de menu
@ -188,87 +186,36 @@ if ($action == 'edit')
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>'; print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
print '<td>'; print '<td>';
$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'); $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 '</td>';
print '<td>';
$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 '</td>';
print '</tr>';
print '</table>';
}
else
{
// Gestionnaires de menu
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="35%">'.$langs->trans("Menu").'</td>';
print '<td>';
print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc"));
print '</td>';
print '<td>';
print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc"));
print '</td>';
print '</tr>';
print '<tr class="oddeven"><td>'.$langs->trans("DefaultMenuManager").'</td>';
print '<td>';
$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 '</td>';
print '<td>';
$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 '</td>';
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("DefaultMenuSmartphoneManager").'</td>';
print '<td>';
$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))) || (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 ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
} }
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)); $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 $filelib;
if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) 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))) || (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 ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
}
dol_fiche_end(); dol_fiche_end();
if ($action == 'edit')
{
print '<div class="center">'; print '<div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">'; print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>'; print '</div>';
}
print '</form>'; print '</form>';
if ($action != 'edit')
{
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
}
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -123,8 +123,6 @@ print "<br>\n";
$noCountryCode = (empty($mysoc->country_code) ? true : false); $noCountryCode = (empty($mysoc->country_code) ? true : false);
if ($action == 'edit') // Edit
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
@ -300,222 +298,6 @@ if ($action == 'edit') // Edit
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '</form>';
print '<br>';
}
else // Show
{
// Misc options
print load_fiche_titre($langs->trans("DictionaryPaperFormat"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Show pdf format
print '<tr class="oddeven"><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
$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 '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>';
print empty($conf->global->MAIN_PDF_MARGIN_LEFT)?10:$conf->global->MAIN_PDF_MARGIN_LEFT;
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>';
print empty($conf->global->MAIN_PDF_MARGIN_RIGHT)?10:$conf->global->MAIN_PDF_MARGIN_RIGHT;
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>';
print empty($conf->global->MAIN_PDF_MARGIN_TOP)?10:$conf->global->MAIN_PDF_MARGIN_TOP;
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM;
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
print load_fiche_titre($langs->trans("PDFAddressForging"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
// Hide Intra VAT on address
print '<tr class="oddeven"><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS, 1);
print '</td></tr>';
// 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().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';
$keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS';
print yn($conf->global->$keyforconstant, 1);
print '</td></tr>';
}
}
print '</table>'."\n";
print '</div>';
print '<br>';
// Localtaxes
$locales ='';
$text='';
if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
{
if ($mysoc->useLocalTax(1))
{
$locales = $langs->transcountry("LT1", $mysoc->country_code);
$text ='<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF", $langs->transcountry("LT1", $mysoc->country_code)) . '</td><td>';
$text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX, 1);
$text .= '</td></tr>';
}
if ($mysoc->useLocalTax(2))
{
$locales.=($locales?' & ':'').$langs->transcountry("LT2", $mysoc->country_code);
$text.= '<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF", $langs->transcountry("LT2", $mysoc->country_code)) . '</td><td>';
$text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX, 1);
$text.= '</td></tr>';
}
}
// 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 '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT, 1);
print '</td></tr>';
print $text;
print '</table>';
print '<br>';
// Other
print load_fiche_titre($langs->trans("Other"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table summary="more" class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
// Encrypt and protect PDF
print '<tr class="oddeven">';
print '<td>';
$text = $langs->trans("ProtectAndEncryptPdfFiles");
$desc = $form->textwithpicto($text, $langs->transnoentities("ProtectAndEncryptPdfFilesDesc"), 1);
print $desc;
print '</td>';
print '<td width="60">';
if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
{
print img_picto($langs->trans("Active"), 'tick');
}
print '</td>';
print '<td align="center" width="140">';
if (empty($conf->global->PDF_SECURITY_ENCRYPTION))
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_pdfsecurity">'.$langs->trans("Activate").'</a>';
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_pdfsecurity">'.$langs->trans("Disable").'</a>';
}
print "</td>";
print "</td>";
print '</tr>';
// Hide Desc
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC, 1);
print '</td></tr>';
// Hide Ref
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF, 1);
print '</td></tr>';
// Hide Details
print '<tr class="oddeven"><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS, 1);
print '</td></tr>';
// Invert sender and recipient
print '<tr class="oddeven"><td>'.$langs->trans("SwapSenderAndRecipientOnPDF").'</td><td colspan="2">';
print yn($conf->global->MAIN_INVERT_SENDER_RECIPIENT, 1);
print '</td></tr>';
// Use French location
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td colspan="2">';
print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION, 1);
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td colspan="2">';
print $arraydetailsforpdffoot[($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS : 0)];
print '</td></tr>';
print '</table>';
print '</div>';
/* /*
* Library * Library
@ -571,11 +353,13 @@ else // Show
print "</table>\n"; print "</table>\n";
print '</div>'; print '</div>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>'; print '<br><div class="center">';
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
print '</div>'; print '</div>';
print '<br>';
} print '</form>';
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -88,7 +88,7 @@ llxHeader('', $langs->trans("Miscellaneous"), $wikihelp);
print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
print $langs->trans("MiscellaneousDesc")."<br>\n"; print '<span class="opacitymedium">'.$langs->trans("MiscellaneousDesc")."</span><br>\n";
print "<br>\n"; print "<br>\n";

View File

@ -147,7 +147,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp);
print load_fiche_titre($langs->trans("SmsSetup"), '', 'title_setup'); print load_fiche_titre($langs->trans("SmsSetup"), '', 'title_setup');
print $langs->trans("SmsDesc")."<br>\n"; print '<span class="opacitymedium">'.$langs->trans("SmsDesc")."</span><br>\n";
print "<br>\n"; print "<br>\n";
// List of sending methods // List of sending methods

View File

@ -229,7 +229,7 @@ print load_fiche_titre($langs->trans("Translation"), $enabledisablehtml, 'title_
$current_language_code=$langs->defaultlang; $current_language_code=$langs->defaultlang;
$s=picto_from_langcode($current_language_code); $s=picto_from_langcode($current_language_code);
print $form->textwithpicto($langs->trans("CurrentUserLanguage").': <strong>'.$s.' '.$current_language_code.'</strong>', $langs->trans("TranslationDesc")).'<br>'; print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("CurrentUserLanguage").': <strong>'.$s.' '.$current_language_code.'</strong>', $langs->trans("TranslationDesc")).'</span><br>';
print '<br>'; print '<br>';

View File

@ -953,6 +953,7 @@ class BOM extends CommonObject
public function initAsSpecimen() public function initAsSpecimen()
{ {
$this->initAsSpecimenCommon(); $this->initAsSpecimenCommon();
$this->ref = 'BOM-123';
$this->date = $this->date_creation; $this->date = $this->date_creation;
} }

View File

@ -100,14 +100,15 @@ if ($nolinesbefore) {
$filtertype=''; $filtertype='';
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1'; if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
$statustoshow = -1;
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
{ {
// hide products in closed warehouse, but show products for internal transfer // 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 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 '</span>'; echo '</span>';

View File

@ -864,11 +864,14 @@ class Categorie extends CommonObject
if ($type=="contact") { if ($type=="contact") {
$subcol_name="fk_socpeople"; $subcol_name="fk_socpeople";
} }
$idoftype = array_search($type, self::$MAP_ID_TO_CODE);
$sql = "SELECT s.rowid"; $sql = "SELECT s.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as s"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as s";
$sql.= " , ".MAIN_DB_PREFIX."categorie_".$sub_type." as sub "; $sql.= " , ".MAIN_DB_PREFIX."categorie_".$sub_type." as sub ";
$sql.= ' WHERE s.entity IN ('.getEntity('category').')'; $sql.= ' WHERE s.entity IN ('.getEntity('category').')';
$sql.= ' AND s.type='.array_search($type, self::$MAP_ID_TO_CODE); $sql.= ' AND s.type='.$idoftype;
$sql.= ' AND s.rowid = sub.fk_categorie'; $sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$id; $sql.= ' AND sub.'.$subcol_name.' = '.$id;
@ -887,7 +890,15 @@ class Categorie extends CommonObject
} }
} }
if ($limit) {
if ($page < 0)
{
$page = 0;
}
$offset = $limit * $page;
$sql.= $this->db->plimit($limit + 1, $offset); $sql.= $this->db->plimit($limit + 1, $offset);
}
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)

View File

@ -403,7 +403,7 @@ if ($object->id > 0)
print '<td><td class="right">'; print '<td><td class="right">';
if ($user->rights->societe->creer && !$user->societe_id > 0) if ($user->rights->societe->creer && !$user->societe_id > 0)
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>'; print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
} }
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -425,8 +425,6 @@ if ($object->id > 0)
print '</td><td>'; print '</td><td>';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
print $form->editfieldval("OutstandingBill", 'outstanding_limit', $object->outstanding_limit, $object, $user->rights->societe->creer, $limit_field_type, ($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); print $form->editfieldval("OutstandingBill", 'outstanding_limit', $object->outstanding_limit, $object, $user->rights->societe->creer, $limit_field_type, ($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -63,7 +63,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
} }
?> ?>
</td> </td>
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref" ><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> <td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
<td class="linkedcol-amount right"><?php <td class="linkedcol-amount right"><?php

View File

@ -53,7 +53,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-element" ><?php echo $langs->trans("CustomerOrder"); ?> <td class="linkedcol-element" ><?php echo $langs->trans("CustomerOrder"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?> <?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
</td> </td>
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
<td class="linkedcol-amount right"><?php <td class="linkedcol-amount right"><?php

View File

@ -3584,7 +3584,7 @@ class Facture extends CommonInvoice
* @param int $offset For pagination * @param int $offset For pagination
* @param string $sortfield Sort criteria * @param string $sortfield Sort criteria
* @param string $sortorder Sort order * @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') 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 * (Status validated or abandonned for a reason 'other') + not payed + no payment at all + not already replaced
* *
* @param int $socid Id thirdparty * @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) public function list_replacable_invoices($socid = 0)
{ {

View File

@ -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.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
$sql.= " f.datec, f.tms,"; $sql.= " f.datec, f.tms,";
$sql.= " f.fk_cond_reglement, f.fk_mode_reglement"; $sql.= " f.fk_cond_reglement, f.fk_mode_reglement";
// 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.= " 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) { if (! $user->rights->societe->client->voir && ! $socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $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.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.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); 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); 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_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'nomaxwidthsearch ')."\n";
print "</tr>\n"; print "</tr>\n";
@ -611,6 +623,15 @@ if ($resql)
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; 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'])) if (! empty($arrayfields['status']['checked']))
{ {
print '<td align="center">'; print '<td align="center">';

View File

@ -89,6 +89,8 @@ $search_montant_ttc=GETPOST('search_montant_ttc', 'alpha');
$search_status=GETPOST('search_status', 'intcomma'); $search_status=GETPOST('search_status', 'intcomma');
$search_paymentmode=GETPOST('search_paymentmode', 'int'); $search_paymentmode=GETPOST('search_paymentmode', 'int');
$search_paymentterms=GETPOST('search_paymentterms', 'int'); $search_paymentterms=GETPOST('search_paymentterms', 'int');
$search_module_source=GETPOST('search_module_source', 'alpha');
$search_pos_source=GETPOST('search_pos_source', 'alpha');
$search_town=GETPOST('search_town', 'alpha'); $search_town=GETPOST('search_town', 'alpha');
$search_zip=GETPOST('search_zip', 'alpha'); $search_zip=GETPOST('search_zip', 'alpha');
$search_state=trim(GETPOST("search_state")); $search_state=trim(GETPOST("search_state"));
@ -157,37 +159,39 @@ if (empty($user->socid)) $fieldstosearchall["f.note_private"]="NotePrivate";
$checkedtypetiers=0; $checkedtypetiers=0;
$arrayfields=array( $arrayfields=array(
'f.ref'=>array('label'=>"Ref", 'checked'=>1), 'f.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1), 'f.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1, 'position'=>10),
'f.type'=>array('label'=>"Type", 'checked'=>0), 'f.type'=>array('label'=>"Type", 'checked'=>0, 'position'=>15),
'f.date'=>array('label'=>"DateInvoice", 'checked'=>1), 'f.date'=>array('label'=>"DateInvoice", 'checked'=>1, 'position'=>20),
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1), 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)), 'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1)), 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1), 'position'=>40),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled)?0:1), 'position'=>40),
's.town'=>array('label'=>"Town", 'checked'=>1), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50),
's.zip'=>array('label'=>"Zip", 'checked'=>1), 's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>55),
'state.nom'=>array('label'=>"StateShort", 'checked'=>0), 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0), 'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>65),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers), 'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>70),
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1), 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>75),
'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1), 'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>80),
'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1), 'f.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>1, 'position'=>85),
'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0), 'f.module_source'=>array('label'=>"Module", 'checked'=>0, 'enabled'=>($conf->cashdesk->enabled || $conf->takepos->enabled || $conf->global->INVOICE_SHOW_POS), 'position'=>90),
'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj=="1")), 'f.pos_source'=>array('label'=>"Terminal", 'checked'=>0, 'enabled'=>($conf->cashdesk->enabled || $conf->takepos->enabled || $conf->global->INVOICE_SHOW_POS), 'position'=>91),
'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj=="1")), 'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>95),
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0), 'f.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>100),
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0), 'f.total_localtax1'=>array('label'=>$langs->transcountry("AmountLT1", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax1_assuj=="1"), 'position'=>110),
'rtp'=>array('label'=>"Rest", 'checked'=>0), 'f.total_localtax2'=>array('label'=>$langs->transcountry("AmountLT2", $mysoc->country_code), 'checked'=>0, 'enabled'=>($mysoc->localtax2_assuj=="1"), 'position'=>120),
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>130),
'dynamount_payed'=>array('label'=>"Received", 'checked'=>0, 'position'=>140),
'rtp'=>array('label'=>"Rest", 'checked'=>0, 'position'=>150),
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
); );
if($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) if($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY)
{ {
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0); $arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
} }
// Extra fields // Extra fields
@ -236,6 +240,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_status=''; $search_status='';
$search_paymentmode=''; $search_paymentmode='';
$search_paymentterms=''; $search_paymentterms='';
$search_module_source='';
$search_pos_source='';
$search_town=''; $search_town='';
$search_zip=""; $search_zip="";
$search_state=""; $search_state="";
@ -381,13 +387,10 @@ $sql = 'SELECT';
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT'; if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
$sql.= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,'; $sql.= ' f.rowid as id, f.ref, f.ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total as total_ht, f.tva as total_vat, f.total_ttc,';
$sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,'; $sql.= ' f.localtax1 as total_localtax1, f.localtax2 as total_localtax2,';
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,'; $sql.= ' f.datef as df, f.date_lim_reglement as datelimite, f.module_source, f.pos_source,';
$sql.= ' f.paye as paye, f.fk_statut,'; $sql.= ' f.paye as paye, f.fk_statut,';
$sql.= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,'; $sql.= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,';
if($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY)
{
$sql.= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; $sql.= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
}
$sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,';
$sql.= " typent.code as typent_code,"; $sql.= " typent.code as typent_code,";
$sql.= " state.code_departement as state_code, state.nom as state_name,"; $sql.= " state.code_departement as state_code, state.nom as state_name,";
@ -477,6 +480,8 @@ if ($search_status != '-1' && $search_status != '')
} }
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode); if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode);
if ($search_paymentterms > 0) $sql .= " AND f.fk_cond_reglement = ".$db->escape($search_paymentterms); if ($search_paymentterms > 0) $sql .= " AND f.fk_cond_reglement = ".$db->escape($search_paymentterms);
if ($search_module_source) $sql .= natural_search("f.module_source", $search_module_source);
if ($search_pos_source) $sql .= natural_search("f.pos_source", $search_pos_source);
$sql.= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year); $sql.= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year);
$sql.= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim); $sql.= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim);
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
@ -496,9 +501,10 @@ if (! $sall)
{ {
$sql.= ' GROUP BY f.rowid, f.ref, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total, f.tva, f.total_ttc,'; $sql.= ' GROUP BY f.rowid, f.ref, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total, f.tva, f.total_ttc,';
$sql.= ' f.localtax1, f.localtax2,'; $sql.= ' f.localtax1, f.localtax2,';
$sql.= ' f.datef, f.date_lim_reglement,'; $sql.= ' f.datef, f.date_lim_reglement, f.module_source, f.pos_source,';
$sql.= ' f.paye, f.fk_statut,'; $sql.= ' f.paye, f.fk_statut,';
$sql.= ' f.datec, f.tms, f.date_closing,'; $sql.= ' f.datec, f.tms, f.date_closing,';
$sql.= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,';
$sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,';
$sql.= ' typent.code,'; $sql.= ' typent.code,';
$sql.= ' state.code_departement, state.nom,'; $sql.= ' state.code_departement, state.nom,';
@ -591,6 +597,8 @@ if ($resql)
if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode); if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($search_paymentterms > 0) $param.='&search_paymentterms='.urlencode($search_paymentterms); if ($search_paymentterms > 0) $param.='&search_paymentterms='.urlencode($search_paymentterms);
if ($search_module_source) $param.='&search_module_source='.urlencode($search_module_source);
if ($search_pos_source) $param.='&search_pos_source='.urlencode($search_pos_source);
if ($show_files) $param.='&show_files='.urlencode($show_files); if ($show_files) $param.='&show_files='.urlencode($show_files);
if ($option) $param.="&search_option=".urlencode($option); if ($option) $param.="&search_option=".urlencode($option);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
@ -804,17 +812,31 @@ if ($resql)
// Payment mode // Payment mode
if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{ {
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10); $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
print '</td>'; print '</td>';
} }
// Payment terms // Payment terms
if (! empty($arrayfields['f.fk_cond_reglement']['checked'])) if (! empty($arrayfields['f.fk_cond_reglement']['checked']))
{ {
print '<td class="liste_titre" align="left">'; print '<td class="liste_titre">';
$form->select_conditions_paiements($search_paymentterms, 'search_paymentterms', -1, 1, 1); $form->select_conditions_paiements($search_paymentterms, 'search_paymentterms', -1, 1, 1);
print '</td>'; print '</td>';
} }
// Module source
if (! empty($arrayfields['f.module_source']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat maxwidth75" type="text" name="search_module_source" value="'.dol_escape_htmltag($search_module_source).'">';
print '</td>';
}
// POS Terminal
if (! empty($arrayfields['f.pos_source']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat maxwidth50" type="text" name="search_pos_source" value="'.dol_escape_htmltag($search_pos_source).'">';
print '</td>';
}
if (! empty($arrayfields['f.total_ht']['checked'])) if (! empty($arrayfields['f.total_ht']['checked']))
{ {
// Amount // Amount
@ -923,6 +945,8 @@ if ($resql)
if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['f.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_mode_reglement", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['f.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder); if (! empty($arrayfields['f.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "f.fk_cond_reglement", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['f.module_source']['checked'])) print_liste_field_titre($arrayfields['f.module_source']['label'], $_SERVER["PHP_SELF"], "f.module_source", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['f.pos_source']['checked'])) print_liste_field_titre($arrayfields['f.pos_source']['label'], $_SERVER["PHP_SELF"], "f.pos_source", "", $param, "", $sortfield, $sortorder);
if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['f.total_ht']['checked'])) print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], 'f.total', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'], $_SERVER['PHP_SELF'], 'f.tva', '', $param, 'class="right"', $sortfield, $sortorder);
if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'class="right"', $sortfield, $sortorder); if (! empty($arrayfields['f.total_localtax1']['checked'])) print_liste_field_titre($arrayfields['f.total_localtax1']['label'], $_SERVER['PHP_SELF'], 'f.localtax1', '', $param, 'class="right"', $sortfield, $sortorder);
@ -1186,6 +1210,24 @@ if ($resql)
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Module Source
if (! empty($arrayfields['f.module_source']['checked']))
{
print '<td>';
print $obj->module_source;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// POS Terminal
if (! empty($arrayfields['f.pos_source']['checked']))
{
print '<td>';
print $obj->pos_source;
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Amount HT // Amount HT
if (! empty($arrayfields['f.total_ht']['checked'])) if (! empty($arrayfields['f.total_ht']['checked']))
{ {

View File

@ -71,7 +71,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
break; break;
} }
?></td> ?></td>
<td class="linkedcol-name"><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name nowraponall"><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref left"><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref left"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td> <td class="linkedcol-date center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
<td class="linkedcol-amount right"><?php <td class="linkedcol-amount right"><?php

View File

@ -48,7 +48,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
?> ?>
<tr class="<?php echo $trclass; ?>" > <tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td> <td class="linkedcol-element"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td class="linkedcol-name"><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name nowraponall"><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"></td> <td class="linkedcol-ref" align="center"></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td>
<td class="linkedcol-amount right"><?php <td class="linkedcol-amount right"><?php

View File

@ -108,14 +108,14 @@ class box_accountancy_suspense_account extends ModeleBoxes
); );
} else { } else {
$this->info_box_contents[0][0] = array( $this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"', 'td' => 'class="nohover"',
'text' => $langs->trans("SuspenseAccountNotDefined") 'text' => '<span class="opacitymedium">'.$langs->trans("SuspenseAccountNotDefined").'</span>'
); );
} }
} else { } else {
$this->info_box_contents[0][0] = array( $this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"', 'td' => 'class="nohover"',
'text' => $langs->trans("ReadPermissionNotAllowed") 'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>'
); );
} }
} }

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2015-2019 Frederic France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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); $facturestatic = new Facture($this->db);
$societestatic = new Societe($this->db); $societestatic = new Societe($this->db);
$langs->load("bills");
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $max)); $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills", $max));
if ($user->rights->facture->lire) if ($user->rights->facture->lire)

View File

@ -316,7 +316,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // 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 * @param Translate $outputlangs Language object for output
* @return array Array of substitution key->code * @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_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'), $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_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') $array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
); );
@ -479,7 +479,7 @@ abstract class CommonDocGenerator
$totalUp = 0; $totalUp = 0;
foreach ($object->lines as $line) 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; 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_'.$line->tva_tx]+=$line->total_tva;
$resarray[$array_key.'_total_vat_locale_'.$line->tva_tx]=price($resarray[$array_key.'_total_vat_'.$line->tva_tx]); $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 $a PDF lines array fields configs
* @param array $b PDF lines array fields configs * @param array $b PDF lines array fields configs
@ -907,7 +907,7 @@ abstract class CommonDocGenerator
// Positionning // Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right $curX = $this->page_largeur-$this->marge_droite; // start from right
// Array witdh // Array width
$arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche; $arrayWidth = $this->page_largeur-$this->marge_droite-$this->marge_gauche;
// Count flexible column // Count flexible column
@ -915,10 +915,10 @@ abstract class CommonDocGenerator
$countFlexCol = 0; $countFlexCol = 0;
foreach ($this->cols as $colKey =>& $colDef) 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'])){ 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); $colDef['width'] = abs($arrayWidth * $colDef['scale'] / 100);
} }

View File

@ -115,12 +115,14 @@ class FormFile
if (empty($title)) $title=$langs->trans("AttachANewFile"); if (empty($title)) $title=$langs->trans("AttachANewFile");
if ($title != 'none') $out.=load_fiche_titre($title, null, null); if ($title != 'none') $out.=load_fiche_titre($title, null, null);
if (empty($usewithoutform)) if (empty($usewithoutform)) // Try to avoid this and set instead the form by the caller.
{ {
$out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">'; $out .= '<form name="'.$htmlname.'" id="'.$htmlname.'" action="'.$url.'" enctype="multipart/form-data" method="POST">';
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">'; $out .= '<input type="hidden" id="'.$htmlname.'_section_dir" name="section_dir" value="'.$sectiondir.'">';
$out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">'; $out .= '<input type="hidden" id="'.$htmlname.'_section_id" name="section_id" value="'.$sectionid.'">';
$out .= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $out .= '<input type="hidden" name="sortfield" value="'.GETPOST('sortfield', 'alpha').'">';
$out .= '<input type="hidden" name="sortorder" value="'.GETPOST('sortorder', 'aZ09').'">';
} }
$out .= '<table width="100%" class="nobordernopadding">'; $out .= '<table width="100%" class="nobordernopadding">';

View File

@ -334,6 +334,7 @@ class Link extends CommonObject
if($this->db->num_rows($resql) > 0) if($this->db->num_rows($resql) > 0)
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->datea = $this->db->jdate($obj->datea); $this->datea = $this->db->jdate($obj->datea);
@ -361,8 +362,6 @@ class Link extends CommonObject
*/ */
public function delete($user) public function delete($user)
{ {
global $langs, $conf;
dol_syslog(get_class($this)."::delete", LOG_DEBUG); dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$error = 0; $error = 0;

View File

@ -199,6 +199,12 @@ class DoliDBPgsql extends DoliDB
$line=$newline; $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 // tinyint type conversion
$line=preg_replace('/tinyint\(?[0-9]*\)?/', 'smallint', $line); $line=preg_replace('/tinyint\(?[0-9]*\)?/', 'smallint', $line);
$line=preg_replace('/tinyint/i', 'smallint', $line); $line=preg_replace('/tinyint/i', 'smallint', $line);

View File

@ -527,9 +527,9 @@ function measuring_units_string($unit, $measuring_style = '', $scale = '', $use_
} }
/** /**
* Transform a given unit into the square of that unit, if known * Transform a given unit scale into the square of that unit, if known.
* *
* @param int $unit Unit key (-3,-2,-1,0,98,99...) * @param int $unit Unit scale key (-3,-2,-1,0,98,99...)
* @return int Squared unit key (-6,-4,-2,0,98,99...) * @return int Squared unit key (-6,-4,-2,0,98,99...)
* @see formproduct->selectMeasuringUnits * @see formproduct->selectMeasuringUnits
*/ */
@ -547,9 +547,9 @@ function measuring_units_squared($unit)
/** /**
* Transform a given unit into the cube of that unit, if known * Transform a given unit scale into the cube of that unit, if known
* *
* @param int $unit Unit key (-3,-2,-1,0,98,99...) * @param int $unit Unit scale key (-3,-2,-1,0,98,99...)
* @return int Cubed unit key (-9,-6,-3,0,88,89...) * @return int Cubed unit key (-9,-6,-3,0,88,89...)
* @see formproduct->selectMeasuringUnits * @see formproduct->selectMeasuringUnits
*/ */

View File

@ -282,8 +282,11 @@ if (! function_exists('dol_loginfunction'))
// Set jquery theme // Set jquery theme
$dol_loginmesg = (! empty($_SESSION["dol_loginmesg"])?$_SESSION["dol_loginmesg"]:''); $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; if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
$jquerytheme = 'base'; $jquerytheme = 'base';
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME; if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;

View File

@ -348,23 +348,21 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
} }
else else
{ {
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("DefaultSkin").'</th>'; $dirthemestring = '';
foreach($dirthemes as $dirtheme)
{
$dirthemestring .= '"'.$dirtheme.'" ';
}
print '<tr class="liste_titre"><th class="titlefield">';
print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
print '</th>';
print '<th class="right">'; print '<th class="right">';
$url='https://www.dolistore.com/4-skins'; $url='https://www.dolistore.com/4-skins';
print '<a href="'.$url.'" target="_blank">'; print '<a href="'.$url.'" target="_blank">';
print $langs->trans('DownloadMoreSkins'); print $langs->trans('DownloadMoreSkins');
print '</a>'; print '</a>';
print '</th></tr>'; print '</th></tr>';
print '<tr>';
print '<td>'.$langs->trans("ThemeDir").'</td>';
print '<td>';
foreach($dirthemes as $dirtheme)
{
echo '"'.$dirtheme.'" ';
}
print '</td>';
print '</tr>';
} }
print '<tr><td colspan="'.$colspan.'">'; print '<tr><td colspan="'.$colspan.'">';
@ -399,7 +397,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '<a href="'.$_SERVER["PHP_SELF"].($edit?'?action=edit&theme=':'?theme=').$subdir.(GETPOST('optioncss', 'alpha', 1)?'&optioncss='.GETPOST('optioncss', 'alpha', 1):'').($fuser?'&id='.$fuser->id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">'; print '<a href="'.$_SERVER["PHP_SELF"].($edit?'?action=edit&theme=':'?theme=').$subdir.(GETPOST('optioncss', 'alpha', 1)?'&optioncss='.GETPOST('optioncss', 'alpha', 1):'').($fuser?'&id='.$fuser->id:'').'" style="font-weight: normal;" alt="'.$langs->trans("Preview").'">';
if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive"); if ($subdir == $conf->global->MAIN_THEME) $title=$langs->trans("ThemeCurrentlyActive");
else $title=$langs->trans("ShowPreview"); else $title=$langs->trans("ShowPreview");
print '<img src="'.$url.'" border="0" width="80" height="60" alt="'.$title.'" title="'.$title.'" style="margin-bottom: 5px;">'; print '<img class="shadow" src="'.$url.'" alt="'.$title.'" title="'.$title.'" style="width: 80px; height: 60px; border: none; margin-bottom: 5px;">';
print '</a><br>'; print '</a><br>';
if ($subdir == $selected_theme) if ($subdir == $selected_theme)
{ {
@ -422,6 +420,31 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '</td></tr>'; print '</td></tr>';
// Show logo
if ($foruserprofile)
{
// Nothing
}
else
{
// Show logo
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableShowLogo").'</td><td>';
if ($edit)
{
print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1);
}
else
{
print yn($conf->global->MAIN_SHOW_LOGO);
}
print '</td>';
print '</tr>';
/*
print '<tr class="oddeven"><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
print "</tr>";*/
}
// TopMenuDisableImages // TopMenuDisableImages
if ($foruserprofile) if ($foruserprofile)
{ {

View File

@ -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 = '') 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"]; $mainmenu=(empty($_SESSION["mainmenu"])?'':$_SESSION["mainmenu"]);
$leftmenu=$_SESSION["leftmenu"]; $leftmenu=(empty($_SESSION["leftmenu"])?'':$_SESSION["leftmenu"]);
$id='mainmenu'; $id='mainmenu';
$listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); $listofmodulesforexternal=explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
@ -56,14 +57,14 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
global $usemenuhider; global $usemenuhider;
$usemenuhider = 1; $usemenuhider = 1;
// Show/Hide vertical menu // Show/Hide vertical menu. The hamburger icon for .menuhider action.
if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{ {
$showmode=1; $showmode=1;
$classname = 'class="tmenu menuhider"'; $classname = 'class="tmenu menuhider"';
$idsel='menu'; $idsel='menu';
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname); $menu->add('#', (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE) ? '<span class="fa fa-bars"></span>' : ''), 0, $showmode, $atarget, "xxx", '', 0, $id, $idsel, $classname);
} }
$num = count($newTabMenu); $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'); $menu->liste = dol_sort_array($menu->liste, 'position');
// Output menu entries // 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']); //$mysoc->logo_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI);
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)); $mysoc->logo_squarred_mini=(empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI);
if (empty($noout)) print_end_menu_entry_auguria($menuval['enabled']); 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&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini);
}
else
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
}
$title=$langs->trans("GoIntoSetupToChangeLogo");
print "\n".'<!-- Show logo on menu -->'."\n";
print_start_menu_entry_auguria('companylogo', 'class="tmenu tmenucompanylogo"', 1);
print '<div class="center backgroundforcompanylogo"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\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; $showmode=1;
if (empty($noout)) print_start_menu_entry_auguria('', 'class="tmenuend"', $showmode); if (empty($noout)) {
if (empty($noout)) print_end_menu_entry_auguria($showmode); print_start_menu_entry_auguria('', 'class="tmenuend"', $showmode);
print_end_menu_entry_auguria($showmode);
if (empty($noout)) print_end_menu_array_auguria(); print_end_menu_array_auguria();
}
print "\n";
return 0; return 0;
} }
@ -193,16 +218,16 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla
if ($showmode == 1) if ($showmode == 1)
{ {
print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').' title="'.dol_escape_htmltag($text).'">';
print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>';
print '</a>'; print '</a>';
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').' title="'.dol_escape_htmltag($text).'">';
print '<span class="mainmenuaspan">'; print '<span class="mainmenuaspan">';
print $text; print $text;
print '</span>'; print '</span>';
print '</a>'; print '</a>';
} }
if ($showmode == 2) elseif ($showmode == 2)
{ {
print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>'; print '<div class="'.$id.' '.$idsel.' topmenuimage tmenudisabled"><span class="'.$id.'" id="mainmenuspan_'.$idsel.'"></span></div>';
print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'; print '<a class="tmenudisabled" id="mainmenua_'.$idsel.'" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">';
@ -244,17 +269,18 @@ function print_end_menu_array_auguria()
/** /**
* Core function to output left menu 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 DoliDB $db Database handler
* @param array $menu_array_before Table of menu entries to show before 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 * @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 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 Menu $menu Object Menu to return back list of menu entries
* @param int $noout Disable output (Initialise &$menu only). * @param int $noout Disable output (Initialise &$menu only).
* @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' * @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 * @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) 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; global $usemenuhider;
$usemenuhider = 0; $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&amp;modulepart=mycompany&amp;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&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
}
else
{
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png';
}
$title=$langs->trans("GoIntoSetupToChangeLogo");
print "\n".'<!-- Show logo on menu -->'."\n";
print '<div class="blockvmenuimpair blockvmenulogo">'."\n";
print '<div class="menu_titre" id="menu_titre_logo"></div>';
print '<div class="menu_top" id="menu_top_logo"></div>';
print '<div class="menu_contenu" id="menu_contenu_logo">';
print '<div class="center"><img title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 70%"></div>'."\n";
print '</div>';
print '<div class="menu_end" id="menu_end_logo"></div>';
print '</div>'."\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 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"; print "\n";
@ -355,9 +352,9 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$db->free($resql); $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 // Multi journal
$sql = "SELECT rowid, code, label, nature"; $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"; if ($objp->nature == 9) $nature="hasnew";
// To enable when page exists // 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=''; 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'); $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', ... $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++; $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; $MAXFTP=20;
$i=1; $i=1;

View File

@ -111,15 +111,18 @@ class MenuManager
$tabMenu=array(); $tabMenu=array();
$menuArbo = new Menubase($this->db, 'auguria'); $menuArbo = new Menubase($this->db, 'auguria');
$menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu); $menuArbo->menuLoad($mainmenu, $leftmenu, $this->type_user, 'auguria', $tabMenu);
$this->tabMenu=$tabMenu; $this->tabMenu=$tabMenu;
//var_dump($tabMenu);
//if ($forcemainmenu == 'all') { var_dump($this->tabMenu); exit; }
} }
/** /**
* Show menu * 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 * @param array $moredata An array with more data to output
* @return int 0 or nb of top menu entries if $mode = 'topnb' * @return int 0 or nb of top menu entries if $mode = 'topnb'
*/ */
@ -138,8 +141,17 @@ class MenuManager
require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/menu.class.php';
$this->menu=new Menu(); $this->menu=new Menu();
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 == '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 ($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') if ($mode == 'topnb')
{ {
@ -315,5 +327,8 @@ class MenuManager
} }
unset($this->menu); unset($this->menu);
//print 'xx'.$mode;
return 0;
} }
} }

View File

@ -478,16 +478,22 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Show logo company // 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($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); $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)) 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&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini); $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;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&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini); $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_mini);
} }*/
else else
{ {
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo_squarred.png'; $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".'<!-- Show logo on menu -->'."\n"; print "\n".'<!-- Show logo on menu -->'."\n";
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1); print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo"', 1);
print '<div class="center backgroundforcompanylogo"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\n";
print '<div class="center '.$logoContainerAdditionalClass.' menulogocontainer"><img class="mycompany" title="'.dol_escape_htmltag($title).'" alt="" src="'.$urllogo.'" style="max-width: 100px"></div>'."\n";
print_end_menu_entry(4); 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 $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 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 * @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) 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")); $warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete"));
} }
$newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto, 1); $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/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/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
$newmenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1); $newmenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);

View File

@ -64,6 +64,8 @@ class MenuManager
*/ */
public function loadMenu($forcemainmenu = '', $forceleftmenu = '') public function loadMenu($forcemainmenu = '', $forceleftmenu = '')
{ {
global $conf, $user, $langs;
// On sauve en session le menu principal choisi // On sauve en session le menu principal choisi
if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"]; if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"]=$_GET["mainmenu"];
if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"]; if (isset($_GET["idmenu"])) $_SESSION["idmenu"]=$_GET["idmenu"];
@ -117,7 +119,7 @@ class MenuManager
/** /**
* Show menu. * 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 string $mode 'top', 'topnb', 'left', 'jmobile' (used to get full xml ul/li menu)
* @param array $moredata An array with more data to output * @param array $moredata An array with more data to output

View File

@ -232,9 +232,9 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; $this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
} }
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS))
{ {
$this->export_fields_array[$r]['f.module_source']='POSModule'; $this->export_fields_array[$r]['f.module_source']='Module';
$this->export_fields_array[$r]['f.pos_source']='POSTerminal'; $this->export_fields_array[$r]['f.pos_source']='POSTerminal';
} }
$this->export_TypeFields_array[$r] = array( $this->export_TypeFields_array[$r] = array(
@ -248,7 +248,7 @@ class modFacture extends DolibarrModules
'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'fd.special_code'=>'Numeric', 'fd.product_type'=>"Numeric", 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text',
'p.accountancy_code_sell'=>'Text' 'p.accountancy_code_sell'=>'Text'
); );
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS))
{ {
$this->export_TypeFields_array[$r]['f.module_source']='Text'; $this->export_TypeFields_array[$r]['f.module_source']='Text';
$this->export_TypeFields_array[$r]['f.pos_source']='Text'; $this->export_TypeFields_array[$r]['f.pos_source']='Text';
@ -314,7 +314,7 @@ class modFacture extends DolibarrModules
$this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT'; $this->export_fields_array[$r]['f.multicurrency_total_tva'] = 'MulticurrencyAmountVAT';
$this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC'; $this->export_fields_array[$r]['f.multicurrency_total_ttc'] = 'MulticurrencyAmountTTC';
} }
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS))
{ {
$this->export_fields_array[$r]['f.module_source']='POSModule'; $this->export_fields_array[$r]['f.module_source']='POSModule';
$this->export_fields_array[$r]['f.pos_source']='POSTerminal'; $this->export_fields_array[$r]['f.pos_source']='POSTerminal';
@ -328,7 +328,7 @@ class modFacture extends DolibarrModules
'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.title'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric', 'pj.ref'=>'Text', 'p.amount'=>'Numeric', 'pf.amount'=>'Numeric', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.title'=>'Text', 'p.datep'=>'Date', 'p.num_paiement'=>'Numeric',
'p.fk_bank'=>'Numeric', 'p.note'=>'Text', 'pt.code'=>'Text', 'pt.libelle'=>'text', 'ba.ref'=>'Text' 'p.fk_bank'=>'Numeric', 'p.note'=>'Text', 'pt.code'=>'Text', 'pt.libelle'=>'text', 'ba.ref'=>'Text'
); );
if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS_IN_EXPORT)) if (! empty($conf->cashdesk->enabled) || ! empty($conf->takepos->enabled) || ! empty($conf->global->INVOICE_SHOW_POS))
{ {
$this->export_fields_array[$r]['f.module_source']='POSModule'; $this->export_fields_array[$r]['f.module_source']='POSModule';
$this->export_fields_array[$r]['f.pos_source']='POSTerminal'; $this->export_fields_array[$r]['f.pos_source']='POSTerminal';

View File

@ -176,9 +176,11 @@ class modProduct extends DolibarrModules
'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",
'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic', 'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic',
'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume", 'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume",
//'p.duration'=>"Duration", 'p.duration'=>"Duration",
'p.finished' => 'Nature',
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC", 'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
'p.tva_tx'=>'VATRate','p.datec'=>'DateCreation','p.tms'=>'DateModification' 'p.tva_tx'=>'VATRate',
'p.datec'=>'DateCreation','p.tms'=>'DateModification'
); );
if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
@ -191,13 +193,17 @@ class modProduct extends DolibarrModules
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
$this->export_TypeFields_array[$r]=array( $this->export_TypeFields_array[$r]=array(
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text", 'p.ref'=>"Text",'p.label'=>"Text",
'p.fk_product_type'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text", 'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
'p.note'=>"Text",'p.note_public'=>"Text", 'p.note'=>"Text",'p.note_public'=>"Text",
'p.weight'=>"Numeric",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric", 'p.weight'=>"Numeric",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean", 'p.customcode'=>'Text',
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date' 'p.duration'=>"Text",
//'p.duration'=>"Duree", 'p.finished' => 'Numeric',
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric',
'p.datec'=>'Date','p.tms'=>'Date'
); );
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric')); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
@ -552,6 +558,7 @@ class modProduct extends DolibarrModules
) )
); );
if (! is_array($this->import_convertvalue_array[$r])) $this->import_convertvalue_array[$r] = array();
$this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array( $this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array(
'p.fk_unit' => array( 'p.fk_unit' => array(
'rule' => 'fetchidfromcodeorlabel', 'rule' => 'fetchidfromcodeorlabel',

View File

@ -149,10 +149,12 @@ class modService extends DolibarrModules
'p.accountancy_code_sell'=>"ProductAccountancySellCode", 'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode", 'p.accountancy_code_sell'=>"ProductAccountancySellCode", 'p.accountancy_code_sell_intra'=>"ProductAccountancySellIntraCode",
'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode", 'p.accountancy_code_sell_export'=>"ProductAccountancySellExportCode", 'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",
'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic', 'p.note'=>"NotePrivate",'p.note_public'=>'NotePublic',
//'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume", 'p.weight'=>"Weight",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume",
'p.duration'=>"Duration", 'p.duration'=>"Duration",
'p.finished' => 'Nature',
'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC", 'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",
'p.tva_tx'=>'VATRate','p.datec'=>'DateCreation','p.tms'=>'DateModification' 'p.tva_tx'=>'VATRate',
'p.datec'=>'DateCreation','p.tms'=>'DateModification'
); );
if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR'; if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice')); if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('p.cost_price'=>'CostPrice'));
@ -165,13 +167,17 @@ class modService extends DolibarrModules
if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote')); if (! empty($conf->global->MAIN_MULTILANGS)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array('l.lang'=>'Language', 'l.label'=>'TranslatedLabel','l.description'=>'TranslatedDescription','l.note'=>'TranslatedNote'));
if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit'; if (! empty($conf->global->PRODUCT_USE_UNITS)) $this->export_fields_array[$r]['p.fk_unit'] = 'Unit';
$this->export_TypeFields_array[$r]=array( $this->export_TypeFields_array[$r]=array(
'p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text", 'p.ref'=>"Text",'p.label'=>"Text",
'p.fk_product_type'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",
'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",
'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text", 'p.accountancy_code_sell_intra'=>"Text",'p.accountancy_code_sell_export'=>"Text",'p.accountancy_code_buy'=>"Text",
'p.note'=>"Text",'p.note_public'=>"Text", 'p.note'=>"Text",'p.note_public'=>"Text",
'p.weight'=>"Numeric",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric", 'p.weight'=>"Numeric",'p.length'=>"Numeric",'p.width'=>"Numeric",'p.height'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",
'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean", 'p.customcode'=>'Text',
'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date', 'p.duration'=>"Text",
'p.duration'=>"Duree", 'p.finished' => 'Numeric',
'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric',
'p.datec'=>'Date','p.tms'=>'Date'
); );
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric')); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.stock'=>'Numeric','p.seuil_stock_alerte'=>'Numeric','p.desiredstock'=>'Numeric','p.pmp'=>'Numeric','p.cost_price'=>'Numeric'));
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text')); if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r], array('p.barcode'=>'Text'));
@ -527,6 +533,7 @@ class modService extends DolibarrModules
) )
); );
if (! is_array($this->import_convertvalue_array[$r])) $this->import_convertvalue_array[$r] = array();
$this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array( $this->import_convertvalue_array[$r] = array_merge($this->import_convertvalue_array[$r], array(
'p.fk_unit' => array( 'p.fk_unit' => array(
'rule' => 'fetchidfromcodeorlabel', 'rule' => 'fetchidfromcodeorlabel',

View File

@ -199,12 +199,8 @@ class pdf_cyan extends ModelePDFPropales
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO // 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'; if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
$outputlangs->load("main"); // Translations
$outputlangs->load("dict"); $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
$outputlangs->load("companies");
$outputlangs->load("bills");
$outputlangs->load("propal");
$outputlangs->load("products");
$nblines = count($object->lines); $nblines = count($object->lines);

View File

@ -177,7 +177,7 @@ class modGeneratePassPerso extends ModeleGenPassword
* Validate a password * Validate a password
* *
* @param string $password Password to check * @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) public function validatePassword($password)
{ {
@ -187,31 +187,31 @@ class modGeneratePassPerso extends ModeleGenPassword
$spe = str_split($this->Spe); $spe = str_split($this->Spe);
if (count(array_intersect($password_a, $maj)) < $this->NbMaj) { if (count(array_intersect($password_a, $maj)) < $this->NbMaj) {
return 0; return false;
} }
if (count(array_intersect($password_a, $num)) < $this->NbNum) { if (count(array_intersect($password_a, $num)) < $this->NbNum) {
return 0; return false;
} }
if (count(array_intersect($password_a, $spe)) < $this->NbSpe) { if (count(array_intersect($password_a, $spe)) < $this->NbSpe) {
return 0; return false;
} }
if (!$this->consecutiveInterationSameCharacter($password)) { if (!$this->consecutiveInterationSameCharacter($password)) {
return 0; return false;
} }
return 1; return true;
} }
/** /**
* Consecutive iterations of the same character * Check the consecutive iterations of the same character. Return false if the number doesn't match the maximum consecutive value allowed.
* *
* @param string $password Password to check * @param string $password Password to check
* @return int 0 if KO, >0 if OK * @return bool
*/ */
public function consecutiveInterationSameCharacter($password) private function consecutiveInterationSameCharacter($password)
{ {
$last = ""; $last = "";
@ -224,14 +224,16 @@ class modGeneratePassPerso extends ModeleGenPassword
if($c != $last) { if($c != $last) {
$last = $c; $last = $c;
$count = 0; $count = 0;
} else {
$count++; continue;
} }
if ($count >= $this->NbRepeat) { $count++;
return 0; if ($count > $this->NbRepeat) {
return false;
} }
} }
return 1;
return true;
} }
} }

View File

@ -38,7 +38,6 @@ if (empty($object) || ! is_object($object)) {
exit; exit;
} }
$usemargins=0; $usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element, array('facture','facturerec','propal','commande'))) 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)) if (empty($senderissupplier))
{ {
$statustoshow = 1;
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS)) if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
{ {
// hide products in closed warehouse, but show products for internal transfer // 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 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)) if (! empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS))

View File

@ -333,9 +333,9 @@ class TraceableDB extends DoliDB
'sql' => $sql, 'sql' => $sql,
'duration' => $duration, 'duration' => $duration,
'memory_usage' => $memoryDelta, 'memory_usage' => $memoryDelta,
'is_success' => $resql, 'is_success' => $resql ? true : false,
'error_code' => ! $resql ? $this->db->lasterrno() : null, 'error_code' => $resql ? null : $this->db->lasterrno(),
'error_message' => ! $resql ? $this->db->lasterror() : null 'error_message' => $resql ? null : $this->db->lasterror()
); );
} }

View File

@ -684,7 +684,7 @@ class CommandeFournisseur extends CommonOrder
$billedtext = ' - '.$langs->trans("Billed"); $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]); $statusShort = $langs->trans($this->statutshort[$status]);
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -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_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); 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 create table llx_entrepot_extrafields

View File

@ -107,6 +107,7 @@ create table llx_societe
supplier_order_min_amount double(24,8) DEFAULT NULL, -- min amount for supplier orders supplier_order_min_amount double(24,8) DEFAULT NULL, -- min amount for supplier orders
default_lang varchar(6), -- default language default_lang varchar(6), -- default language
logo varchar(255) DEFAULT NULL, logo varchar(255) DEFAULT NULL,
logo_squarred varchar(255) DEFAULT NULL,
canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default) 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 fk_entrepot integer DEFAULT 0, -- if we need a link between third party and warehouse
webservices_url varchar(255), -- supplier webservice url webservices_url varchar(255), -- supplier webservice url

View File

@ -875,9 +875,9 @@ Permission1251=Run mass imports of external data into database (data load)
Permission1321=Export customer invoices, attributes and payments Permission1321=Export customer invoices, attributes and payments
Permission1322=Reopen a paid bill Permission1322=Reopen a paid bill
Permission1421=Export sales orders and attributes Permission1421=Export sales orders and attributes
Permission2401=Read 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 account 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 account Permission2403=Delete actions (events or tasks) linked to his user account (if owner of event)
Permission2411=Read actions (events or tasks) of others Permission2411=Read actions (events or tasks) of others
Permission2412=Create/modify actions (events or tasks) of others Permission2412=Create/modify actions (events or tasks) of others
Permission2413=Delete actions (events or tasks) of others Permission2413=Delete actions (events or tasks) of others
@ -1070,6 +1070,9 @@ CompanyCountry=Country
CompanyCurrency=Main currency CompanyCurrency=Main currency
CompanyObject=Object of the company CompanyObject=Object of the company
Logo=Logo 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 DoNotSuggestPaymentMode=Do not suggest
NoActiveBankAccountDefined=No active bank account defined NoActiveBankAccountDefined=No active bank account defined
OwnerOfBankAccount=Owner of bank account %s 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 <b>administrator users</b> only. AreaForAdminOnly=Setup parameters can be set by <b>administrator users</b> only.
SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators 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. 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. AccountantDesc=If you have an external accountant/bookkeeper, you can edit here its information.
AccountantFileNumber=Accountant code AccountantFileNumber=Accountant code
DisplayDesc=Parameters affecting the look and behaviour of Dolibarr can be modified here. DisplayDesc=Parameters affecting the look and behaviour of Dolibarr can be modified here.

View File

@ -16,6 +16,7 @@ MarginDetails=Margin details
ProductMargins=Product margins ProductMargins=Product margins
CustomerMargins=Customer margins CustomerMargins=Customer margins
SalesRepresentativeMargins=Sales representative margins SalesRepresentativeMargins=Sales representative margins
ContactOfInvoice=Contact of invoice
UserMargins=User margins UserMargins=User margins
ProductService=Product or Service ProductService=Product or Service
AllProducts=All products and services AllProducts=All products and services
@ -36,7 +37,7 @@ CostPrice=Cost price
UnitCharges=Unit charges UnitCharges=Unit charges
Charges=Charges Charges=Charges
AgentContactType=Commercial agent contact type AgentContactType=Commercial agent contact type
AgentContactTypeDetails=Define what contact type (linked on invoices) will be used for margin report per sale representative. Note that reading statistics on a sale representative as a contact is not reliable since in most cases the contact may not be defined explicitely on the invoices. AgentContactTypeDetails=Define what contact type (linked on invoices) will be used for margin report per contact/address. Note that reading statistics on a contact is not reliable since in most cases the contact may not be defined explicitely on the invoices.
rateMustBeNumeric=Rate must be a numeric value rateMustBeNumeric=Rate must be a numeric value
markRateShouldBeLesserThan100=Mark rate should be lower than 100 markRateShouldBeLesserThan100=Mark rate should be lower than 100
ShowMarginInfos=Show margin infos ShowMarginInfos=Show margin infos

View File

@ -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) 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(); top_httphead();
@ -1224,15 +1224,17 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print '<meta name="author" content="Dolibarr Development Team">'."\n"; print '<meta name="author" content="Dolibarr Development Team">'."\n";
// Favicon // Favicon
$favicon = DOL_MAIN_URL_ROOT . '/theme/'.$conf->theme.'/img/favicon.ico'; $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->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
if (empty($conf->dol_use_jmobile)) print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview if (empty($conf->dol_use_jmobile)) print '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>'."\n"; // Not required into an Android webview
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n"; //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="top" title="'.$langs->trans("Home").'" href="'.(DOL_URL_ROOT?DOL_URL_ROOT:'/').'">'."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="copyright" title="GNU General Public License" href="https://www.gnu.org/copyleft/gpl.html#SEC1">'."\n"; //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="copyright" title="GNU General Public License" href="https://www.gnu.org/copyleft/gpl.html#SEC1">'."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n"; //if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print '<link rel="author" title="Dolibarr Development Team" href="https://www.dolibarr.org">'."\n";
// Mobile appli like icon // 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)){ if(!empty($manifest)){
print '<link rel="manifest" href="'.$manifest.'" />'."\n"; print '<link rel="manifest" href="'.$manifest.'" />'."\n";
} }
@ -1614,9 +1616,6 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
print '<div class="login_block usedropdown">'."\n"; print '<div class="login_block usedropdown">'."\n";
// Add login user link // Add login user link
$toprightmenu.='<div class="login_block_user">'; $toprightmenu.='<div class="login_block_user">';
@ -1634,7 +1633,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
$toprightmenu .= top_menu_bookmark($user, $langs); $toprightmenu .= top_menu_bookmark($user, $langs);
} }
// add user dropdown // Add user dropdown
$toprightmenu.= top_menu_user($user, $langs); $toprightmenu.= top_menu_user($user, $langs);
$toprightmenu.='</div></div>'; $toprightmenu.='</div></div>';

View File

@ -109,7 +109,7 @@ dol_fiche_head($head, 'agentMargins', $titre, 0, $picto);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td class="titlefield">'.$langs->trans('SalesRepresentative').'</td>'; print '<tr><td class="titlefield">'.$langs->trans('ContactOfInvoice').'</td>';
print '<td class="maxwidthonsmartphone" colspan="4">'; print '<td class="maxwidthonsmartphone" colspan="4">';
print $form->select_dolusers($agentid, 'agentid', 1, '', $user->rights->margins->read->all ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print $form->select_dolusers($agentid, 'agentid', 1, '', $user->rights->margins->read->all ? 0 : 1, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td></tr>'; print '</td></tr>';

View File

@ -17,6 +17,7 @@
* Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr> * Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.fr>
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -299,6 +300,8 @@ if (empty($reshook))
$object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0; $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte')?GETPOST('seuil_stock_alerte'):0;
$object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0; $object->desiredstock = GETPOST('desiredstock')?GETPOST('desiredstock'):0;
$object->canvas = GETPOST('canvas'); $object->canvas = GETPOST('canvas');
$object->net_measure = GETPOST('net_measure');
$object->net_measure_units = GETPOST('net_measure_units'); // This is not the fk_unit but the power of unit
$object->weight = GETPOST('weight'); $object->weight = GETPOST('weight');
$object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit
$object->length = GETPOST('size'); $object->length = GETPOST('size');
@ -403,6 +406,8 @@ if (empty($reshook))
$object->duration_unit = GETPOST('duration_unit', 'alpha'); $object->duration_unit = GETPOST('duration_unit', 'alpha');
$object->canvas = GETPOST('canvas'); $object->canvas = GETPOST('canvas');
$object->net_measure = GETPOST('net_measure');
$object->net_measure_units = GETPOST('net_measure_units'); // This is not the fk_unit but the power of unit
$object->weight = GETPOST('weight'); $object->weight = GETPOST('weight');
$object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit
$object->length = GETPOST('size'); $object->length = GETPOST('size');
@ -1054,12 +1059,19 @@ else
print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1); print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1);
print '</td></tr>'; print '</td></tr>';
// Weight // Net Measure
print '<tr><td>'.$langs->trans("NetMeasure").'</td><td colspan="3">';
print '<input name="net_measure" size="4" value="'.GETPOST('net_measure').'">';
print $formproduct->selectMeasuringUnits("net_measure_units", "net_measure", GETPOSTISSET('net_measure_units')?GETPOST('net_measure_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
print '</td></tr>';
// Brut Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="4" value="'.GETPOST('weight').'">'; print '<input name="weight" size="4" value="'.GETPOST('weight').'">';
print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units')?GETPOST('weight_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units')?GETPOST('weight_units', 'alpha'):(empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?0:$conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2);
print '</td></tr>'; print '</td></tr>';
// Length
// Brut Length
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{ {
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">';
@ -1071,7 +1083,7 @@ else
} }
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) if (empty($conf->global->PRODUCT_DISABLE_SURFACE))
{ {
// Surface // Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Surface").'</td><td colspan="3">';
print '<input name="surface" size="4" value="'.GETPOST('surface').'">'; print '<input name="surface" size="4" value="'.GETPOST('surface').'">';
print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units')?GETPOST('surface_units', 'alpha'):'0', 0, 2); print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units')?GETPOST('surface_units', 'alpha'):'0', 0, 2);
@ -1079,7 +1091,7 @@ else
} }
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) if (empty($conf->global->PRODUCT_DISABLE_VOLUME))
{ {
// Volume // Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="3">';
print '<input name="volume" size="4" value="'.GETPOST('volume').'">'; print '<input name="volume" size="4" value="'.GETPOST('volume').'">';
print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units')?GETPOST('volume_units', 'alpha'):'0', 0, 2); print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units')?GETPOST('volume_units', 'alpha'):'0', 0, 2);
@ -1427,14 +1439,21 @@ else
print $form->selectarray('finished', $statutarray, $object->finished); print $form->selectarray('finished', $statutarray, $object->finished);
print '</td></tr>'; print '</td></tr>';
// Weight // Net Measure
print '<tr><td>'.$langs->trans("NetMeasure").'</td><td colspan="3">';
print '<input name="net_measure" size="5" value="'.$object->net_measure.'"> ';
print $form->selectUnits($object->net_measure_units, 'units');
//print $formproduct->selectMeasuringUnits("net_measure_units", "weight", $object->net_measure_units, 0, 2);
print '</td></tr>';
// Brut Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Weight").'</td><td colspan="3">';
print '<input name="weight" size="5" value="'.$object->weight.'"> '; print '<input name="weight" size="5" value="'.$object->weight.'"> ';
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2); print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
print '</td></tr>'; print '</td></tr>';
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{ {
// Length // Brut Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="3">';
print '<input name="size" size="5" value="'.$object->length.'">x'; print '<input name="size" size="5" value="'.$object->length.'">x';
print '<input name="sizewidth" size="5" value="'.$object->width.'">x'; print '<input name="sizewidth" size="5" value="'.$object->width.'">x';
@ -1444,7 +1463,7 @@ else
} }
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) if (empty($conf->global->PRODUCT_DISABLE_SURFACE))
{ {
// Surface // Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Surface").'</td><td colspan="3">';
print '<input name="surface" size="5" value="'.$object->surface.'"> '; print '<input name="surface" size="5" value="'.$object->surface.'"> ';
print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2); print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2);
@ -1452,7 +1471,7 @@ else
} }
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) if (empty($conf->global->PRODUCT_DISABLE_VOLUME))
{ {
// Volume // Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="3">';
print '<input name="volume" size="5" value="'.$object->volume.'"> '; print '<input name="volume" size="5" value="'.$object->volume.'"> ';
print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2); print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2);
@ -1834,7 +1853,18 @@ else
print $object->getLibFinished(); print $object->getLibFinished();
print '</td></tr>'; print '</td></tr>';
// Weight // Net Measure
print '<tr><td class="titlefield">'.$langs->trans("NetMeasure").'</td><td colspan="2">';
if ($object->net_measure != '')
{
print $object->net_measure." ".measuring_units_string(0, "weight", $object->net_measure_units);
}
else
{
print '&nbsp;';
}
// Brut Weight
print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td colspan="2">'; print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td colspan="2">';
if ($object->weight != '') if ($object->weight != '')
{ {
@ -1847,7 +1877,7 @@ else
print "</td></tr>\n"; print "</td></tr>\n";
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) if (empty($conf->global->PRODUCT_DISABLE_SIZE))
{ {
// Length // Brut Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td colspan="2">';
if ($object->length != '' || $object->width != '' || $object->height != '') if ($object->length != '' || $object->width != '' || $object->height != '')
{ {
@ -1864,7 +1894,7 @@ else
} }
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) if (empty($conf->global->PRODUCT_DISABLE_SURFACE))
{ {
// Surface // Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Surface").'</td><td colspan="2">';
if ($object->surface != '') if ($object->surface != '')
{ {
@ -1878,7 +1908,7 @@ else
} }
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) if (empty($conf->global->PRODUCT_DISABLE_VOLUME))
{ {
// Volume // Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Volume").'</td><td colspan="2">';
if ($object->volume != '') if ($object->volume != '')
{ {

View File

@ -27,7 +27,6 @@ if (empty($usedolheader))
<head> <head>
<meta name="robots" content="noindex,nofollow" /> <meta name="robots" content="noindex,nofollow" />
<meta name="author" content="Dolibarr Development Team"> <meta name="author" content="Dolibarr Development Team">
<link rel="shortcut icon" type="image/x-icon" href="<?php echo DOL_URL_ROOT ?>/theme/eldy/img/favicon.ico"/>
<title>Test page</title> <title>Test page</title>
<!-- Includes for JQuery (Ajax library) --> <!-- Includes for JQuery (Ajax library) -->
<link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/css/base/jquery-ui.css" /> <link rel="stylesheet" type="text/css" href="<?php echo DOL_URL_ROOT ?>/includes/jquery/css/base/jquery-ui.css" />

View File

@ -53,7 +53,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-element"><?php echo $langs->trans("Reception"); ?> <td class="linkedcol-element"><?php echo $langs->trans("Reception"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?> <?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
</td> </td>
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"></td> <td class="linkedcol-ref" align="center"></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_delivery, 'day'); ?></td>
<td class="linkedcol-amount right"><?php <td class="linkedcol-amount right"><?php

View File

@ -465,6 +465,9 @@ class Societe extends CommonObject
public $logo; public $logo;
public $logo_small; public $logo_small;
public $logo_mini; public $logo_mini;
public $logo_squarred;
public $logo_squarred_small;
public $logo_squarred_mini;
public $array_options; public $array_options;
@ -1072,6 +1075,7 @@ class Societe extends CommonObject
$sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null"); $sql .= ",barcode = ".(! empty($this->barcode)?"'".$this->db->escape($this->barcode)."'":"null");
$sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->db->escape($this->default_lang)."'":"null"); $sql .= ",default_lang = ".(! empty($this->default_lang)?"'".$this->db->escape($this->default_lang)."'":"null");
$sql .= ",logo = ".(! empty($this->logo)?"'".$this->db->escape($this->logo)."'":"null"); $sql .= ",logo = ".(! empty($this->logo)?"'".$this->db->escape($this->logo)."'":"null");
$sql .= ",logo_squarred = ".(! empty($this->logo_squarred)?"'".$this->db->escape($this->logo_squarred)."'":"null");
$sql .= ",outstanding_limit= ".($this->outstanding_limit!=''?$this->outstanding_limit:'null'); $sql .= ",outstanding_limit= ".($this->outstanding_limit!=''?$this->outstanding_limit:'null');
$sql .= ",order_min_amount= ".($this->order_min_amount!=''?$this->order_min_amount:'null'); $sql .= ",order_min_amount= ".($this->order_min_amount!=''?$this->order_min_amount:'null');
$sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount!=''?$this->supplier_order_min_amount:'null'); $sql .= ",supplier_order_min_amount= ".($this->supplier_order_min_amount!=''?$this->supplier_order_min_amount:'null');
@ -1266,7 +1270,7 @@ class Societe extends CommonObject
$sql .= ', s.webservices_url, s.webservices_key'; $sql .= ', s.webservices_url, s.webservices_key';
$sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode'; $sql .= ', s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.parent, s.barcode';
$sql .= ', s.fk_departement as state_id, s.fk_pays as country_id, s.fk_stcomm, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj'; $sql .= ', s.fk_departement as state_id, s.fk_pays as country_id, s.fk_stcomm, s.remise_supplier, s.mode_reglement, s.cond_reglement, s.fk_account, s.tva_assuj';
$sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo'; $sql .= ', s.mode_reglement_supplier, s.cond_reglement_supplier, s.localtax1_assuj, s.localtax1_value, s.localtax2_assuj, s.localtax2_value, s.fk_prospectlevel, s.default_lang, s.logo, s.logo_squarred';
$sql .= ', s.fk_shipping_method'; $sql .= ', s.fk_shipping_method';
$sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms'; $sql .= ', s.outstanding_limit, s.import_key, s.canvas, s.fk_incoterms, s.location_incoterms';
$sql .= ', s.order_min_amount, s.supplier_order_min_amount'; $sql .= ', s.order_min_amount, s.supplier_order_min_amount';
@ -1420,6 +1424,7 @@ class Societe extends CommonObject
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->default_lang = $obj->default_lang; $this->default_lang = $obj->default_lang;
$this->logo = $obj->logo; $this->logo = $obj->logo;
$this->logo_squarred = $obj->logo_squarred;
$this->webservices_url = $obj->webservices_url; $this->webservices_url = $obj->webservices_url;
$this->webservices_key = $obj->webservices_key; $this->webservices_key = $obj->webservices_key;
@ -2110,6 +2115,12 @@ class Societe extends CommonObject
$label.= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip. $label.= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip.
$label.= '</div><div style="clear: both;"></div>'; $label.= '</div><div style="clear: both;"></div>';
} }
elseif (! empty($this->logo_squarred) && class_exists('Form'))
{
/*$label.= '<div class="photointooltip">';
$label.= Form::showphoto('societe', $this, 0, 40, 0, 'photowithmargin', 'mini', 0); // Important, we must force height so image will have height tags and if image is inside a tooltip, the tooltip manager can calculate height and position correctly the tooltip.
$label.= '</div><div style="clear: both;"></div>';*/
}
$label.= '<div class="centpercent">'; $label.= '<div class="centpercent">';
@ -3522,6 +3533,9 @@ class Societe extends CommonObject
$this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO;
$this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
$this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
$this->logo_squarred=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED;
$this->logo_squarred_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL;
$this->logo_squarred_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI;
// Define if company use vat or not // Define if company use vat or not
$this->tva_assuj=$conf->global->FACTURE_TVAOPTION; $this->tva_assuj=$conf->global->FACTURE_TVAOPTION;

View File

@ -165,14 +165,14 @@ print "</td></tr>\n";
// Use Takepos printing // Use Takepos printing
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("DolibarrReceiptPrinter").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)'; print $langs->trans("DolibarrReceiptPrinter").' (<a href="http://en.takepos.com/connector" target="_blank">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->selectyesno("TAKEPOSCONNECTOR", $conf->global->TAKEPOSCONNECTOR, 1); print $form->selectyesno("TAKEPOSCONNECTOR", $conf->global->TAKEPOSCONNECTOR, 1);
print "</td></tr>\n"; print "</td></tr>\n";
if ($conf->global->TAKEPOSCONNECTOR) { if ($conf->global->TAKEPOSCONNECTOR) {
print '<tr class="oddeven value"><td>'; print '<tr class="oddeven value"><td>';
print $langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector">'.$langs->trans("TakeposConnectorNecesary").'</a>)'; print $langs->trans("IPAddress").' (<a href="http://en.takepos.com/connector" target="_blank">'.$langs->trans("TakeposConnectorNecesary").'</a>)';
print '<td colspan="2">'; print '<td colspan="2">';
print '<input type="text" size="20" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">'; print '<input type="text" size="20" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
print '</td></tr>'; print '</td></tr>';
@ -189,7 +189,7 @@ print "</td></tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){ if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOSCONNECTOR){
print '<tr class="oddeven value"><td>'; print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)'; print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1); print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
print '</td></tr>'; print '</td></tr>';

View File

@ -794,7 +794,7 @@ table[summary="list_of_modules"] .fa-cog {
.hideobject { display: none; } .hideobject { display: none; }
.minwidth50 { min-width: 50px; } .minwidth50 { min-width: 50px; }
/* rule for not too small screen only */ /* rule for not too small screen only */
@media only screen and (min-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) @media only screen and (min-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px)
{ {
.width25 { width: 25px; } .width25 { width: 25px; }
.width50 { width: 50px; } .width50 { width: 50px; }
@ -902,6 +902,17 @@ table[summary="list_of_modules"] .fa-cog {
font-size: <?php print is_numeric($fontsize) ? ($fontsize+3).'px' : $fontsize; ?> !important; font-size: <?php print is_numeric($fontsize) ? ($fontsize+3).'px' : $fontsize; ?> !important;
} }
div#login_left, div#login_right {
min-width: 150px !important;
max-width: 200px !important;
padding-left: 5px !important;
padding-right: 5px !important;
}
div.login_block {
height: 64px !important;
}
.divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; } .divmainbodylarge { margin-left: 20px !important; margin-right: 20px !important; }
.tdoverflowonsmartphone { .tdoverflowonsmartphone {
@ -923,11 +934,14 @@ table[summary="list_of_modules"] .fa-cog {
padding-bottom: 5px; padding-bottom: 5px;
} }
.login_table .tdinputlogin {
min-width: unset !important;
}
input, input[type=text], input[type=password], select, textarea { input, input[type=text], input[type=password], select, textarea {
min-width: 20px; min-width: 20px;
} }
.trinputlogin input[type=text], input[type=password] { .trinputlogin input[type=text], input[type=password] {
max-width: 180px; max-width: 140px;
} }
.vmenu .searchform input { .vmenu .searchform input {
max-width: 138px; /* length of input text in the quick search box when using a smartphone and without dolidroid */ max-width: 138px; /* length of input text in the quick search box when using a smartphone and without dolidroid */
@ -1085,19 +1099,21 @@ div.blockvmenulogo
{ {
border-bottom: 0 !important; border-bottom: 0 !important;
} }
.backgroundforcompanylogo { .menulogocontainer {
margin: <?php echo $disableimages?'0':'6'; ?>px; margin: <?php echo $disableimages?'0':'6'; ?>px;
margin-left: 8px; margin-left: 8px;
margin-right: 8px; margin-right: 8px;
background-color: rgba(255,255,255,0.7);
padding: 0; padding: 0;
border-radius: 5px;
height: <?php echo $disableimages?'20':'32'; ?>px; height: <?php echo $disableimages?'20':'32'; ?>px;
/* width: 100px; */ /* width: 100px; */
max-width: 100px; max-width: 100px;
vertical-align: middle; vertical-align: middle;
} }
.backgroundforcompanylogo img.mycompany { .backgroundforcompanylogo {
background-color: rgba(255,255,255,0.7);
border-radius: 4px;
}
.menulogocontainer img.mycompany {
object-fit: contain; object-fit: contain;
width: inherit; width: inherit;
height: inherit; height: inherit;
@ -1152,7 +1168,7 @@ div.vmenu, td.vmenu {
.menuhider { display: none !important; } .menuhider { display: none !important; }
/* rule to reduce top menu - 3rd reduction: The menu for user is on left */ /* rule to reduce top menu - 3rd reduction: The menu for user is on left */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ @media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
{ {
body.sidebar-collapse .side-nav { body.sidebar-collapse .side-nav {
display: none; display: none;
@ -2942,7 +2958,9 @@ td.evenodd, tr.nohoverpair td, #trlinefordates td {
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important; background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
} }
.trforbreak td { .trforbreak td {
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinebreak)); ?> !important; font-weight: bold;
border-bottom: 1pt solid black !important;
/* background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinebreak)); ?> !important; */
} }
table.dataTable td { table.dataTable td {
@ -5743,7 +5761,7 @@ div.tabsElem a.tab {
} }
} }
/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ @media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */
{ {
li.tmenucompanylogo { li.tmenucompanylogo {
display: none; display: none;
@ -5770,7 +5788,7 @@ div.tabsElem a.tab {
} }
} }
/* rule to reduce top menu - 3rd reduction: The menu for user is on left */ /* rule to reduce top menu - 3rd reduction: The menu for user is on left */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 140 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ @media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
{ {
.side-nav { .side-nav {
z-index: 200; z-index: 200;

View File

@ -25,14 +25,14 @@
* \brief File for The Web App * \brief File for The Web App
*/ */
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url. if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
if (! defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login if (! defined('NOLOGIN')) define('NOLOGIN', 1);
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
@ -46,7 +46,7 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_AP
"name": "<?php echo $appli; ?>", "name": "<?php echo $appli; ?>",
"icons": [ "icons": [
{ {
"src": "<?php echo dol_buildpath('/theme/common/dolibarr_logo_256x256.png', 2); ?>", "src": "<?php echo DOL_URL_ROOT.'/theme/common/dolibarr_logo_256x256.png'; ?>",
"sizes": "256x256", "sizes": "256x256",
"type": "image/png" "type": "image/png"
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -6,6 +6,11 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
* Component: Info Box * Component: Info Box
* ------------------- * -------------------
*/ */
span.info-box-icon-text { /* hide box text number due to problems */
display: none;
}
.info-box { .info-box {
display: block; display: block;
min-height: 90px; min-height: 90px;

View File

@ -1061,6 +1061,10 @@ table[summary="list_of_modules"] .fa-cog {
font-size: <?php print $fontsize+3; ?>px !important; font-size: <?php print $fontsize+3; ?>px !important;
} }
.login_vertical_align {
padding-left: 0;
}
.divmainbodylarge { margin-left: 20px; margin-right: 20px; } .divmainbodylarge { margin-left: 20px; margin-right: 20px; }
.tdoverflowonsmartphone { .tdoverflowonsmartphone {
@ -1782,7 +1786,7 @@ div.mainmenu {
position : relative; position : relative;
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:center top; background-position:center top;
height: <?php echo ($heightmenu-19); ?>px; height: <?php echo ($heightmenu-22); ?>px;
margin-left: 0px; margin-left: 0px;
min-width: 40px; min-width: 40px;
} }
@ -2253,19 +2257,21 @@ div.blockvmenulogo
{ {
border-bottom: 0 !important; border-bottom: 0 !important;
} }
.backgroundforcompanylogo { .menulogocontainer {
margin: <?php echo $disableimages?'0':'6'; ?>px; margin: <?php echo $disableimages?'0':'6'; ?>px;
margin-left: 12px; margin-left: 12px;
margin-right: 6px; margin-right: 6px;
background-color: rgba(255,255,255,0.7);
padding: 0; padding: 0;
border-radius: 5px;
height: <?php echo $disableimages?'20':'32'; ?>px; height: <?php echo $disableimages?'20':'32'; ?>px;
/* width: 100px; */ /* width: 100px; */
max-width: 100px; max-width: 100px;
vertical-align: middle; vertical-align: middle;
} }
.backgroundforcompanylogo img.mycompany { .backgroundforcompanylogo {
background-color: rgba(255,255,255,0.7);
border-radius: 5px;
}
.menulogocontainer img.mycompany {
object-fit: contain; object-fit: contain;
width: inherit; width: inherit;
height: inherit; height: inherit;
@ -3046,7 +3052,9 @@ td.evenodd, tr.nohoverpair td {
background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important; background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
} }
.trforbreak td { .trforbreak td {
background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinebreak)); ?> !important; font-weight: bold;
border-bottom: 1pt solid black !important;
/* background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinebreak)); ?> !important; */
} }
table.dataTable td { table.dataTable td {
@ -3213,6 +3221,10 @@ tr.liste_sub_total, tr.liste_sub_total td {
-webkit-box-shadow: 0px 0px 0px #f4f4f4 !important; -webkit-box-shadow: 0px 0px 0px #f4f4f4 !important;
box-shadow: 0px 0px 0px #f4f4f4 !important; box-shadow: 0px 0px 0px #f4f4f4 !important;
} }
.shadow {
-webkit-box-shadow: 2px 2px 5px #CCC !important;
box-shadow: 2px 2px 5px #CCC !important;
}
div.tabBar .noborder { div.tabBar .noborder {
-webkit-box-shadow: 0px 0px 0px #f4f4f4 !important; -webkit-box-shadow: 0px 0px 0px #f4f4f4 !important;
@ -3971,7 +3983,7 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
.cal_peruserviewname { max-width: 140px; height: 22px; } .cal_peruserviewname { max-width: 140px; height: 22px; }
.topmenuimage { .topmenuimage {
background-size: 28px auto; background-size: 24px auto;
} }
/* ============================================================================== */ /* ============================================================================== */
@ -5682,7 +5694,7 @@ border-top-right-radius: 6px;
} }
.menuhider { .menuhider {
width: <?php echo $disableimages ? 'auto' : '40'; ?>px; width: <?php echo $disableimages ? 'auto' : '44'; ?>px;
} }
/* nboftopmenuentries = <?php echo $nbtopmenuentries ?>, fontsize=<?php echo $fontsize ?> */ /* nboftopmenuentries = <?php echo $nbtopmenuentries ?>, fontsize=<?php echo $fontsize ?> */
@ -5701,7 +5713,7 @@ border-top-right-radius: 6px;
font-size: 12px; font-size: 12px;
} }
.topmenuimage { .topmenuimage {
background-size: 26px auto; background-size: 24px auto;
margin-top: 0px; margin-top: 0px;
} }
li.tmenu, li.tmenusel { li.tmenu, li.tmenusel {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -50,7 +50,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td class="linkedcol-element" ><?php echo $langs->trans("Ticket"); ?> <td class="linkedcol-element" ><?php echo $langs->trans("Ticket"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?> <?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; ?>
</td> </td>
<td class="linkedcol-name" ><?php echo $objectlink->getNomUrl(1); ?></td> <td class="linkedcol-name nowraponall" ><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td> <td class="linkedcol-ref" align="center"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td> <td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td>
<?php <?php

View File

@ -54,6 +54,7 @@ $ok=false;
if ($user->id == $id) $ok=true; // A user can always read its own card if ($user->id == $id) $ok=true; // A user can always read its own card
if (! empty($user->rights->salaries->read)) $ok=true; if (! empty($user->rights->salaries->read)) $ok=true;
if (! empty($user->rights->hrm->read)) $ok=true; if (! empty($user->rights->hrm->read)) $ok=true;
if (! empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall)) $ok=true;
if (! $ok) if (! $ok)
{ {
accessforbidden(); accessforbidden();

View File

@ -1297,7 +1297,7 @@ class User extends CommonObject
$this->db->begin(); $this->db->begin();
// Cree et positionne $this->id // Create user and set $this->id. Trigger is disabled because executed later.
$result=$this->create($user, 1); $result=$this->create($user, 1);
if ($result > 0) if ($result > 0)
{ {

View File

@ -22,89 +22,126 @@
* \brief PHPUnit test for BillOfMaterials class. * \brief PHPUnit test for BillOfMaterials class.
*/ */
namespace test\unit; global $conf,$user,$langs,$db;
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
require_once dirname(__FILE__).'/../../htdocs/bom/class/bom.class.php';
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
$user->getrights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
$langs->load("main");
/** /**
* Class BillOfMaterialsTest * Class BillOfMaterialsTest
* @package Testbillofmaterials * @package Testbillofmaterials
*/ */
class BOMTest extends \PHPUnit\Framework\TestCase class BOMTest extends PHPUnit\Framework\TestCase
{ {
protected $savconf;
protected $savuser;
protected $savlangs;
protected $savdb;
/** /**
* Global test setup * Constructor
* @return void * We save global variables into local variables
*
* @return BOMTest
*/ */
public function __construct()
{
parent::__construct();
//$this->sharedFixture
global $conf,$user,$langs,$db;
$this->savconf=$conf;
$this->savuser=$user;
$this->savlangs=$langs;
$this->savdb=$db;
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
//print " - db ".$db->db;
print "\n";
}
// Static methods
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
fwrite(STDOUT, __METHOD__ . "\n"); global $conf,$user,$langs,$db;
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) {
print "\n".__METHOD__." Company must be setup to have name-firstname in order 'Firstname Lastname'\n";
die();
}
if (! empty($conf->global->MAIN_MODULE_LDAP)) { print "\n".__METHOD__." module LDAP must be disabled.\n"; die(); }
if (! empty($conf->global->MAIN_MODULE_MAILMANSPIP)) { print "\n".__METHOD__." module MailmanSpip must be disabled.\n"; die(); }
print __METHOD__."\n";
}
// tear down after class
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;
$db->rollback();
print __METHOD__."\n";
} }
/** /**
* Unit test setup * Init phpunit tests
*
* @return void * @return void
*/ */
protected function setUp() protected function setUp()
{ {
fwrite(STDOUT, __METHOD__ . "\n"); global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
print __METHOD__."\n";
} }
/** /**
* Verify pre conditions * End phpunit tests
* @return void *
*/
protected function assertPreConditions()
{
fwrite(STDOUT, __METHOD__ . "\n");
}
/**
* A sample test
* @return bool
*/
public function testSomething()
{
fwrite(STDOUT, __METHOD__ . "\n");
// TODO: test something
$this->assertTrue(true);
}
/**
* Verify post conditions
* @return void
*/
protected function assertPostConditions()
{
fwrite(STDOUT, __METHOD__ . "\n");
}
/**
* Unit test teardown
* @return void * @return void
*/ */
protected function tearDown() protected function tearDown()
{ {
fwrite(STDOUT, __METHOD__ . "\n"); print __METHOD__."\n";
} }
/** /**
* Global test teardown * testBOMCreate
* @return void
*/
public static function tearDownAfterClass()
{
fwrite(STDOUT, __METHOD__ . "\n");
}
/**
* Unsuccessful test
* *
* @param Exception $e Exception * @return int
* @return void
* @throws Exception
*/ */
protected function onNotSuccessfulTest(Exception $e) public function testBOMCreate()
{ {
fwrite(STDOUT, __METHOD__ . "\n"); global $conf,$user,$langs,$db;
throw $e; $conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new BOM($this->savdb);
$localobject->initAsSpecimen();
$result=$localobject->create($user);
print __METHOD__." result=".$result."\n";
$this->assertLessThan($result, 0);
return $localobject;
} }
} }