Merge branch 'PRODUCT_PRICE_BASE_TYPE' of https://github.com/bb2a/dolibarr into PRODUCT_PRICE_BASE_TYPE

This commit is contained in:
Anthony Berton 2020-05-20 14:50:45 +02:00
commit f32767239b
150 changed files with 1870 additions and 613 deletions

View File

@ -404,6 +404,10 @@ script:
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log
php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log
php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
# Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
echo $?

View File

@ -78,7 +78,7 @@ FIX: we must export company mail address on contact vcard only if contact email
FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create
FIX: Wrong Sql on getListOfTowns api method
FIX: wrong user right's name to top menu "commercial"
FIX: XSS Vulnerability
FIX: XSS Vulnerability reported by Mehmet Kelepçe / Gais Cyber Security
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
For Users:

View File

@ -55,7 +55,7 @@ $pagenext = $page + 1;
//if (! $sortfield) $sortfield="p.date_fin";
//if (! $sortorder) $sortorder="DESC";
$show_subgroup = GETPOST('show_subgroup', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
@ -130,10 +130,11 @@ if (!empty($search_accountancy_code_end)) {
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$show_subgroup = '';
$search_date_start = '';
$search_date_end = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$filter = array();
}
@ -223,6 +224,12 @@ if ($action != 'export_csv')
$moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0);
$moreforfilter .= $langs->trans('DateEnd').': ';
$moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0);
$moreforfilter .= ' - ';
$moreforfilter .= $langs->trans('ShowSubtotalByGroup').': ';
$moreforfilter .= '<input type="checkbox" name="show_subgroup" value="show_subgroup"'.($show_subgroup == 'show_subgroup' ? ' checked' : '').'>';
$moreforfilter .= '</div>';
if (!empty($moreforfilter)) {
@ -289,26 +296,31 @@ if ($action != 'export_csv')
}
print '<tr class="oddeven">';
// Permet d'afficher le compte comptable
if (empty($displayed_account) || $root_account_description != $displayed_account)
if (!empty($show_subgroup))
{
// Affiche un Sous-Total par compte comptable
if ($displayed_account != "") {
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
print "<td>&nbsp;</td>\n";
// Show accounting account
if (empty($displayed_account) || $root_account_description != $displayed_account) {
// Show subtotal per accounting account
if ($displayed_account != "") {
print '<tr class="liste_total">';
print '<td class="right" colspan="3">'.$langs->trans("SubTotal").':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
print "<td></td>\n";
print '</tr>';
}
// Show first line of a break
print '<tr class="trforbreak">';
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '</tr>';
$displayed_account = $root_account_description;
$sous_total_debit = 0;
$sous_total_credit = 0;
}
// Show first line of a break
print '<tr class="trforbreak">';
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '</tr>';
$displayed_account = $root_account_description;
$sous_total_debit = 0;
$sous_total_credit = 0;
}
// $object->get_compte_racine($line->numero_compte);
print '<td>'.length_accountg($line->numero_compte).'</td>';
@ -326,12 +338,15 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit;
}
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
if (!empty($show_subgroup))
{
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print "<td></td>\n";
print '</tr>';
}
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("AccountBalance").':</td><td class="nowrap right">'.price($total_debit).'</td><td class="nowrap right">'.price($total_credit).'</td><td class="nowrap right">'.price(price2num($total_debit - $total_credit)).'</td>';
print "<td>&nbsp;</td>\n";
print "<td></td>\n";
print '</tr>';
print "</table>";

View File

@ -438,7 +438,7 @@ if ($action == 'create')
print $langs->trans('Docdate');
print '</td>';
if ($action != 'editdate')
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdate') {
@ -462,7 +462,7 @@ if ($action == 'create')
print $langs->trans('Codejournal');
print '</td>';
if ($action != 'editjournal')
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editjournal') {
@ -486,7 +486,7 @@ if ($action == 'create')
print $langs->trans('Piece');
print '</td>';
if ($action != 'editdocref')
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editdocref') {
@ -650,8 +650,8 @@ if ($action == 'create')
print '<td class="nowrap right">'.price($line->credit).'</td>';
print '<td class="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">';
print img_edit();
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
$actiontodelete = 'delete';

View File

@ -644,6 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ($value == 'dayrule' && empty($_POST['dayrule'])) continue;
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((!isset($_POST[$value]) || $_POST[$value] == '')
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory

View File

@ -248,11 +248,8 @@ class Dolistore
// phpcs:enable
global $langs, $conf;
$html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ?
$newapp = '';
if ($last_month < strtotime($product->date_add)) {
@ -267,7 +264,7 @@ class Dolistore
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
@ -306,16 +303,16 @@ class Dolistore
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app '.$parity.' '.$compatible.'">
$html .= '<tr class="app oddeven '.$compatible.'">
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
.'<br/><small>'.$version.'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>
<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>
<td class="margeCote center">'.$price.'
</td>
<td class="margeCote">'.$download_link.'</td>
</tr>';
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
// do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.$price.'</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>';
}
return $html;
}

View File

@ -680,7 +680,9 @@ if ($mode == 'common' || $mode == 'commonkanban')
if (preg_match('/development/i', $version)) $versiontrans .= img_warning($langs->trans("Development"), 'style="float: left"');
if (preg_match('/experimental/i', $version)) $versiontrans .= img_warning($langs->trans("Experimental"), 'style="float: left"');
if (preg_match('/deprecated/i', $version)) $versiontrans .= img_warning($langs->trans("Deprecated"), 'style="float: left"');
$versiontrans .= $objMod->getVersion(1);
if ($objMod->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
$versiontrans .= $objMod->getVersion(1);
}
// Define imginfo
$imginfo = "info";

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -70,11 +71,12 @@ if ($action == 'setmod')
if ($action == 'setparams')
{
$freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS', 'none'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
$res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($error)
{
setEventMessages($langs->trans("Error"), null, 'errors');
@ -253,6 +255,14 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $co
print '</td><td class="right">';
print "</td></tr>\n";
// Allow to group payments by mod in rapports
print '<tr class="oddeven"><td>';
print $langs->trans("GroupPaymentsByModOnReports");
print '</td><td width="60" align="center">';
print $form->selectyesno("PAYMENTS_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_REPORT_GROUP_BY_MOD, 1);
print '</td><td class="right">';
print "</td></tr>\n";
print '</table>';
print '</div>';

View File

@ -177,7 +177,11 @@ $sessiontimeout = ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SessionTimeOut").'</td><td class="right">';
print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor")));
if (ini_get("session.gc_probability") == 0) {
print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", ini_get("session.gc_maxlifetime")));
} else {
print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"), ini_get("session.gc_maxlifetime")));
}
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
@ -185,7 +189,6 @@ print '</td>';
print '</tr>';
$sessiontimeout = ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = "";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -144,6 +145,23 @@ elseif ($action == 'specimen')
}
}
elseif ($action == 'setparams')
{
$res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($error)
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
}
/*
* View
*/
@ -428,8 +446,46 @@ foreach ($dirmodels as $reldir)
print '</table>';
/*
* Other Options
*/
print "<br>";
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="action" value="setparams" />';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
// Allow to group payments by mod in rapports
print '<tr class="oddeven"><td>';
print $langs->trans("GroupPaymentsByModOnReports");
print '</td><td width="60" align="center">';
print $form->selectyesno("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD, 1);
print '</td><td class="right">';
print "</td></tr>\n";
print '</table>';
dol_fiche_end();
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print '</div>';
print '<br>';
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -135,7 +135,7 @@ elseif (in_array($compression, array('gz', 'bz')))
$file .= '.tar';
// We also exclude '/temp/' dir and 'documents/admin/documents'
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$result = $utils->executeCLI($cmd, $outputfile);

View File

@ -79,7 +79,7 @@ function bomPrepareHead($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("BOM");
$head[$h][2] = 'card';
$h++;

View File

@ -135,7 +135,7 @@ $head = array();
$h = 1;
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id ? 'id='.$object->id : '');
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Bookmark");
$head[$h][2] = 'card';
$h++;

View File

@ -8,7 +8,7 @@ CACHE MANIFEST
# Files listed under CACHE will be ALWAYS cached after they are loaded.
# And they will be always used from Cache after (even after refresh).
CACHE:
theme/dolibarr_logo.png
theme/dolibarr_logo.svg
support/
support/index.php

View File

@ -735,7 +735,7 @@ if ($type == Categorie::TYPE_CONTACT)
$num = count($contacts);
$nbtotalofrecords = '';
$newcardbutton = '';
print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contacts', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit);
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Ref").'</td></tr>'."\n";
@ -989,7 +989,7 @@ if ($type == Categorie::TYPE_WAREHOUSE)
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";

View File

@ -679,6 +679,7 @@ class ActionComm extends CommonObject
$sql = "SELECT a.id,";
$sql .= " a.id as ref,";
$sql .= " a.entity,";
$sql .= " a.ref_ext,";
$sql .= " a.datep,";
$sql .= " a.datep2,";
@ -715,6 +716,7 @@ class ActionComm extends CommonObject
$obj = $this->db->fetch_object($resql);
$this->id = $obj->id;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext;

View File

@ -5,7 +5,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
@ -582,7 +582,7 @@ if ($object->id > 0)
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
$boxstat .= '<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
if (!empty($conf->propal->enabled))
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
{
// Box proposals
$tmp = $object->getOutstandingProposals();
@ -600,7 +600,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '</a>';
}
if (!empty($conf->commande->enabled))
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
{
// Box commandes
$tmp = $object->getOutstandingOrders();
@ -618,7 +618,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '</a>';
}
if (!empty($conf->facture->enabled))
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
// Box factures
$tmp = $object->getOutstandingBills();

View File

@ -157,6 +157,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$limit = 10;
$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql .= " WHERE m.entity = ".$conf->entity;
$sql .= " ORDER BY m.date_creat DESC";
$sql .= " LIMIT ".$limit;
$result = $db->query($sql);

View File

@ -499,7 +499,7 @@ if ($resql)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendPropalRef";
$modelmail = "proposal_send";
$modelmail = "propal_send";
$objecttmp = new Propal($db);
$trackid = 'pro'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -37,8 +38,16 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php';
$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips"));
// Constant to define payment sens
const PAY_DEBIT = 0;
const PAY_CREDIT = 1;
$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks", "loan"));
$date_start = GETPOST('date_start', 'alpha');
$date_startDay = GETPOST('date_startday', 'int');
@ -140,7 +149,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Customer invoices
if (GETPOST('selectinvoices')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum";
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -149,7 +158,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Vendor invoices
if (GETPOST('selectsupplierinvoices')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -158,7 +167,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Expense reports
if (GETPOST('selectexpensereports')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql .= " WHERE date_fin between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -167,7 +176,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Donations
if (GETPOST('selectdonations')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country";
$sql .= " WHERE datedon between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -176,7 +185,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Paiements of salaries
if (GETPOST('selectpaymentsofsalaries')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
$sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -185,12 +194,28 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Social contributions
if (GETPOST('selectsocialcontributions')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum";
$sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t";
$sql .= " WHERE date_creation between ".$wheretail;
$sql .= " WHERE t.date_ech between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
//$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT;
}
// Various payments
if (GETPOST('selectvariouspayment')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
}
// Loan payments
if (GETPOST('selectloanspayment')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX."loan as l ON l.rowid = t.fk_loan";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND l.entity IN (".($entity == 1 ? '0,1' : $entity).')';
}
if ($sql) {
$sql .= $db->order($sortfield, $sortorder);
@ -221,6 +246,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->facture->dir_output.'/'.$subdir;
$link = "document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "facture";
break;
case "SupplierInvoice":
$tmpinvoicesupplier->fetch($objd->id);
@ -228,18 +254,21 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
$link = "document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "facture_fournisseur";
break;
case "ExpenseReport":
$subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->expensereport->dir_output.'/'.$subdir;
$link = "document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "expensereport";
break;
case "SalaryPayment":
$subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->salaries->dir_output.'/'.$subdir;
$link = "document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "salaries";
break;
case "Donation":
$tmpdonation->fetch($objp->id);
@ -247,12 +276,28 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->don->dir_output.'/'.$subdir;
$link = "document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "don";
break;
case "SocialContributions":
$subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->tax->dir_output.'/'.$subdir;
$link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "tax";
break;
case "VariousPayment":
$subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->bank->dir_output.'/'.$subdir;
$link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "banque";
break;
case "LoanPayment":
// Loan payment has no linked file
$subdir = '';
$upload_dir = $conf->loan->dir_output.'/'.$subdir;
$link = "";
$modulepart = "";
break;
default:
$subdir = '';
@ -286,6 +331,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$nofile['thirdparty_code'] = $objd->thirdparty_code;
$nofile['country_code'] = $objd->country_code;
$nofile['vatnum'] = $objd->vatnum;
$nofile['sens'] = $objd->sens;
$filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile;
}
@ -304,11 +350,11 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$file['ref'] = ($objd->ref ? $objd->ref : $objd->id);
$file['fk'] = $objd->fk_soc;
$file['item'] = $objd->item;
$file['thirdparty_name'] = $objd->thirdparty_name;
$file['thirdparty_code'] = $objd->thirdparty_code;
$file['country_code'] = $objd->country_code;
$file['vatnum'] = $objd->vatnum;
$file['sens'] = $objd->sens;
// Save record into array (only the first time it is found)
if (empty($filesarray[$file['item'].'_'.$file['id']])) {
@ -319,7 +365,16 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (empty($filesarray[$file['item'].'_'.$file['id']]['files'])) {
$filesarray[$file['item'].'_'.$file['id']]['files'] = array();
}
$filesarray[$file['item'].'_'.$file['id']]['files'][] = array('link' => $link.$file['name'], 'name'=>$file['name'], 'ref'=>$file['ref'], 'fullname' => $file['fullname'], 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name']);
$filesarray[$file['item'].'_'.$file['id']]['files'][] = array(
'link' => $link.urlencode($file['name']),
'name'=>$file['name'],
'ref'=>$file['ref'],
'fullname' => $file['fullname'],
'relpath' => '/'.$file['name'],
'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name'],
'modulepart' => $modulepart,
'subdir' => $subdir,
);
//var_dump($file['item'].'_'.$file['id']);
//var_dump($filesarray[$file['item'].'_'.$file['id']]['files']);
}
@ -383,7 +438,8 @@ if ($result && $action == "dl" && !$error)
$log .= ','.$langs->transnoentitiesnoconv("ThirdParty");
$log .= ','.$langs->transnoentitiesnoconv("Code");
$log .= ','.$langs->transnoentitiesnoconv("Country");
$log .= ','.$langs->transnoentitiesnoconv("VATIntra")."\n";
$log .= ','.$langs->transnoentitiesnoconv("VATIntra");
$log .= ','.$langs->transnoentitiesnoconv("Sens")."\n";
$zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip';
dol_delete_file($zipname);
@ -394,11 +450,13 @@ if ($result && $action == "dl" && !$error)
{
foreach ($filesarray as $key => $file)
{
foreach ($file['files'] as $filecursor) {
if (file_exists($filecursor["fullname"])) {
$zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]);
}
}
if (!empty($file['files'])) {
foreach ($file['files'] as $filecursor) {
if (file_exists($filecursor["fullname"])) {
$zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]);
}
}
}
$log .= '"'.$langs->trans($file['item']).'"';
if (!empty($conf->multicompany->enabled) && is_object($mc))
@ -418,6 +476,7 @@ if ($result && $action == "dl" && !$error)
$log .= ',"'.$file['thirdparty_code'].'"';
$log .= ',"'.$file['country_code'].'"';
$log .= ',"'.$file['vatnum'].'"';
$log .= ',"'.$file['sens'].'"';
$log .= "\n";
}
$zip->addFromString('transactions.csv', $log);
@ -444,10 +503,17 @@ if ($result && $action == "dl" && !$error)
* View
*/
$form = new Form($db);
$form = new form($db);
$formfile = new FormFile($db);
$userstatic = new User($db);
$invoice = new Facture($db);
$supplier_invoice = new FactureFournisseur($db);
$expensereport = new ExpenseReport($db);
$don = new Don($db);
$salary_payment = new PaymentSalary($db);
$charge_sociales = new ChargeSociales($db);
$various_payment = new PaymentVarious($db);
$payment_loan = new PaymentLoan($db);
$title = $langs->trans("ComptaFiles").' - '.$langs->trans("List");
$help_url = '';
@ -492,7 +558,9 @@ $listofchoices = array(
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips'),
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'),
'selectsocialcontributions'=>array('label'=>'SocialContributions')
'selectsocialcontributions'=>array('label'=>'SocialContributions'),
'selectvariouspayment'=>array('label'=>'VariousPayment'),
'selectloanspayment'=>array('label'=>'PaymentLoan'),
);
foreach ($listofchoices as $choice => $val) {
$checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : '');
@ -562,11 +630,12 @@ if (!empty($date_start) && !empty($date_stop))
{
// Sort array by date ASC to calculate balance
$totalET = 0;
$totalIT = 0;
$totalVAT = 0;
$totalDebit = 0;
$totalCredit = 0;
$totalET_debit = 0;
$totalIT_debit = 0;
$totalVAT_debit = 0;
$totalET_credit = 0;
$totalIT_credit = 0;
$totalVAT_credit = 0;
// Display array
foreach ($TData as $data)
@ -592,25 +661,49 @@ if (!empty($date_start) && !empty($date_stop))
// Ref
print '<td class="nowraponall">';
if ($data['item'] == 'Invoice') {
$invoice->id = $data['id'];
if ($data['item'] == 'Invoice') {
$invoice->id = $data['id'];
$invoice->ref = $data['ref'];
print $invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'SupplierInvoice') {
} elseif ($data['item'] == 'SupplierInvoice') {
$supplier_invoice->id = $data['id'];
$supplier_invoice->ref = $data['ref'];
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} else {
} elseif ($data['item'] == 'ExpenseReport') {
$expensereport->id = $data['id'];
$expensereport->ref = $data['ref'];
print $expensereport->getNomUrl(1, 0, 0, '', 0, 0);
} elseif ($data['item'] == 'SalaryPayment') {
$salary_payment->id = $data['id'];
$salary_payment->ref = $data['ref'];
print $salary_payment->getNomUrl(1, '', 0, '', 0);
} elseif ($data['item'] == 'Donation') {
$don->id = $data['id'];
$don->ref = $data['ref'];
print $don->getNomUrl(1, 0, '', 0);
} elseif ($data['item'] == 'SocialContributions') {
$charge_sociales->id = $data['id'];
$charge_sociales->ref = $data['ref'];
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
} elseif ($data['item'] == 'VariousPayment') {
$various_payment->id = $data['id'];
$various_payment->ref = $data['ref'];
print $various_payment->getNomUrl(1, '', 0, 0);
} elseif ($data['item'] == 'LoanPayment') {
$payment_loan->id = $data['id'];
$payment_loan->ref = $data['ref'];
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
} else {
print $data['ref'];
}
}
print '</td>';
// File link
print '<td>';
if (!empty($data['files']))
{
foreach ($data['files'] as $filecursor) {
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a><br>';
foreach ($data['files'] as $id=>$filecursor) {
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a>&nbsp;'.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'<br>';
}
}
print "</td>\n";
@ -619,11 +712,11 @@ if (!empty($date_start) && !empty($date_stop))
print '<td aling="left">'.$data['paid'].'</td>';
// Total ET
print '<td align="right">'.price($data['amount_ht'])."</td>\n";
print '<td align="right">'.price($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'])."</td>\n";
// Total IT
print '<td align="right">'.price($data['amount_ttc'])."</td>\n";
print '<td align="right">'.price($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'])."</td>\n";
// Total VAT
print '<td align="right">'.price($data['amount_vat'])."</td>\n";
print '<td align="right">'.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."</td>\n";
print '<td>'.$data['thirdparty_name']."</td>\n";
@ -633,42 +726,42 @@ if (!empty($date_start) && !empty($date_stop))
print '<td align="right">'.$data['vatnum']."</td>\n";
// Debit
//print '<td align="right">'.(($data['amount_ttc'] > 0) ? price(abs($data['amount_ttc'])) : '')."</td>\n";
// Credit
//print '<td align="right">'.(($data['amount_ttc'] > 0) ? '' : price(abs($data['amount_ttc'])))."</td>\n";
$totalET += $data['amount_ht'];
$totalIT += $data['amount_ttc'];
$totalVAT += $data['amount_vat'];
$totalDebit += ($data['amount_ttc'] > 0) ? abs($data['amount_ttc']) : 0;
$totalCredit += ($data['amount_ttc'] > 0) ? 0 : abs($data['amount_ttc']);
// Balance
//print '<td align="right">'.price($data['balance'])."</td>\n";
if ($data['sens']) {
$totalET_credit += $data['amount_ht'];
$totalIT_credit += $data['amount_ttc'];
$totalVAT_credit += $data['amount_vat'];
} else {
$totalET_debit -= $data['amount_ht'];
$totalIT_debit -= $data['amount_ttc'];
$totalVAT_debit -= $data['amount_vat'];
}
print "</tr>\n";
}
// Total credits
print '<tr class="liste_total">';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td align="right">'.price(price2num($totalET, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT, 'MT')).'</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
/*print '<td align="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
*/
print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Income').'</td>';
print '<td align="right">'.price(price2num($totalET_credit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>';
print '<td colspan="4"></td>';
print "</tr>\n";
// Total debits
print '<tr class="liste_total">';
print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Outcome').'</td>';
print '<td align="right">'.price(price2num($totalET_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>';
print "</tr>\n";
// Balance
print '<tr class="liste_total">';
print '<td colspan="6" class="right">'.$langs->trans('Total').'</td>';
print '<td align="right">'.price(price2num($totalET_credit + $totalET_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>';
print "</tr>\n";
}
}

View File

@ -131,15 +131,14 @@ if ($result)
print '<input type="hidden" name="categid" value="'.$objp->rowid.'">';
print '<input name="label" type="text" size=45 value="'.$objp->label.'">';
print '<input type="submit" name="update" class="button" value="'.$langs->trans("Edit").'">';
print "</td>";
}
else
{
print "<td >".$objp->label."</td>";
print '<td style="text-align: center;">';
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=edit">'.img_edit().'</a>&nbsp;&nbsp;';
print '<a href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=delete">'.img_delete().'</a>';
print '<td class="center">';
print '<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=edit">'.img_edit().'</a>';
print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=delete">'.img_delete().'</a>';
print '</td>';
}
print "</tr>";

View File

@ -46,7 +46,7 @@ $object->info($id);
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("BankTransaction");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id;

View File

@ -257,7 +257,7 @@ foreach ($cats as $cat) {
$tabs = array(
array(
DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid,
$langs->trans('Card')
$langs->trans('BankTransaction')
),
array(
DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid,

View File

@ -612,7 +612,7 @@ if (empty($action) || $action == "view" || $action == "close")
else {
$head = array();
$head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id;
$head[0][1] = $langs->trans("Card");
$head[0][1] = $langs->trans("CashControl");
$head[0][2] = 'cashcontrol';
dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account');

View File

@ -5282,7 +5282,7 @@ elseif ($id > 0 || !empty($ref))
{
if (!$objectidnext)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').''.$object->id.'&amp;action=create&amp;type=2'.($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').''.($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
}
}

View File

@ -342,7 +342,7 @@ if ($resql)
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Bill').'</td>';
print '<td>'.$langs->trans('Company').'</td>';
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)print '<td>'.$langs->trans('Entity').'</td>';
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) print '<td>'.$langs->trans('Entity').'</td>';
print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
@ -379,7 +379,7 @@ if ($resql)
print '</td>';
// Expected to pay
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) {
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
print '<td>';
$mc->getInfo($objp->entity);
print $mc->label;

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -26,6 +27,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Security check
@ -84,6 +86,7 @@ if ($action == 'builddoc')
*/
$formother = new FormOther($db);
$formfile = new FormFile($db);
llxHeader();
@ -155,7 +158,7 @@ if ($year)
$tfile = $dir.'/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print '<tr class="oddeven">';
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a>'.$formfile->showPreview($file, 'facture_paiement', $relativepath, 0).'</td>';
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td>';
print '</tr>';

View File

@ -128,7 +128,7 @@ $form = new Form($db);
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("PaymentSocialContribution");
$hselected = $h;
$h++;

View File

@ -0,0 +1,234 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/paymentbybanktransfer/index.php
* \ingroup paymentbybanktransfer
* \brief Payment by bank transfer index page
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'withdrawals'));
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'paymentbybanktransfer', '', '');
/*
* Actions
*/
/*
* View
*/
llxHeader('', $langs->trans("SuppliersStandingOrdersArea"));
if (prelevement_check_config() < 0)
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors');
}
print load_fiche_titre($langs->trans("SuppliersStandingOrdersArea"));
print '<div class="fichecenter"><div class="fichethirdleft">';
$thirdpartystatic = new Societe($db);
$invoicestatic = new Facture($db);
$bprev = new BonPrelevement($db);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("NbOfInvoiceToWithdraw").'</td>';
print '<td class="right">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/demandes.php?status=0">';
print $bprev->NbFactureAPrelever();
print '</a>';
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("AmountToWithdraw").'</td>';
print '<td class="right">';
print price($bprev->SommeAPrelever(), '', '', 1, -1, -1, 'auto');
print '</td></tr></table></div><br>';
/*
* Invoices waiting for withdraw
*/
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql .= " pfd.date_demande, pfd.amount,";
$sql .= " s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE s.rowid = f.fk_soc";
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND f.total_ttc > 0";
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql .= " AND pfd.traite = 0 AND pfd.fk_facture_fourn = f.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th colspan="5">'.$langs->trans("SupplierInvoiceWaitingWithdraw").' ('.$num.')</th></tr>';
if ($num)
{
while ($i < $num && $i < 20)
{
$obj = $db->fetch_object($resql);
$invoicestatic->id = $obj->rowid;
$invoicestatic->ref = $obj->ref;
$invoicestatic->statut = $obj->fk_statut;
$invoicestatic->paye = $obj->paye;
$invoicestatic->type = $obj->type;
$alreadypayed = $invoicestatic->getSommePaiement();
print '<tr class="oddeven"><td>';
print $invoicestatic->getNomUrl(1, 'withdraw');
print '</td>';
print '<td>';
$thirdpartystatic->id = $obj->socid;
$thirdpartystatic->name = $obj->name;
print $thirdpartystatic->getNomUrl(1, 'customer');
print '</td>';
print '<td class="right">';
print price($obj->amount);
print '</td>';
print '<td class="right">';
print dol_print_date($db->jdate($obj->date_demande), 'day');
print '</td>';
print '<td class="right">';
print $invoicestatic->getLibStatut(3, $alreadypayed);
print '</td>';
print '</tr>';
$i++;
}
}
else
{
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).'</td></tr>';
}
print "</table></div><br>";
}
else
{
dol_print_error($db);
}
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Withdraw receipts
*/
$limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
print"\n<!-- debut table -->\n";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th>'.$langs->trans("LatestBankTransferReceipts", $limit).'</th>';
print '<th>'.$langs->trans("Date").'</th>';
print '<th class="right">'.$langs->trans("Amount").'</th>';
print '<th class="right">'.$langs->trans("Status").'</th>';
print '</tr>';
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print "<td>";
$bprev->id = $obj->rowid;
$bprev->ref = $obj->ref;
$bprev->statut = $obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec), "dayhour")."</td>\n";
print '<td class="right">'.price($obj->amount)."</td>\n";
print '<td class="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n";
$i++;
}
print "</table></div><br>";
$db->free($result);
}
else
{
dol_print_error($db);
}
print '</div></div></div>';
// End of page
llxFooter();
$db->close();

View File

@ -65,6 +65,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
/*
* Actions
*/

View File

@ -126,7 +126,7 @@ llxHeader('', $langs->trans("StandingOrder"));
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("StandingOrder");
$hselected = $h;
$h++;

View File

@ -1454,7 +1454,7 @@ else
print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$object->id.'">';
print img_picto($langs->trans("Download"), 'vcard.png').' ';
print img_picto($langs->trans("Download"), 'vcard.png', 'class="paddingrightonly"');
print $langs->trans("Download");
print '</a>';
print '</td></tr>';

View File

@ -1590,7 +1590,7 @@ class Contact extends CommonObject
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{
$tables = array(
'socpeople'
'socpeople', 'societe_contacts'
);
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);

View File

@ -43,9 +43,9 @@ if (!empty($user->socid)) {
$socid = $user->socid;
}
if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
/*if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set');
}
}*/
/*
@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) {
$triggerkey = 'COMPANY_UPDATE';
}
$object->setValueFrom($field, $value, $element, $id, $user, $triggerkey);
$tablename = $element;
if ($tablename == 'websitepage') $tablename = 'website_page';
$format = 'int';
$object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey);
}

View File

@ -140,7 +140,10 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedManualEntries"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedManualEntries")
);
$this->db->free($result);
} else {

View File

@ -153,7 +153,10 @@ class box_boms extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedOrders")
);
$this->db->free($result);
} else {

View File

@ -148,7 +148,10 @@ class box_clients extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedCustomers")
);
$this->db->free($result);
}

View File

@ -174,7 +174,10 @@ class box_commandes extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedOrders")
);
$this->db->free($result);
} else {

View File

@ -180,7 +180,10 @@ class box_factures_imp extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoUnpaidCustomerBills"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoUnpaidCustomerBills")
);
$this->db->free($result);
}

View File

@ -145,13 +145,16 @@ class box_ficheinter extends ModeleBoxes
$i++;
}
if ($num == 0) $this->info_box_contents[$i][] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedInterventions"));
if ($num == 0) $this->info_box_contents[$i][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedInterventions")
);
$this->db->free($resql);
}
else
{
$this->info_box_contents[0][] = array(
$this->info_box_contents[0][0] = array(
'td' => '',
'maxlength'=>500,
'text' => ($this->db->error().' sql='.$sql),
@ -160,7 +163,7 @@ class box_ficheinter extends ModeleBoxes
}
else
{
$this->info_box_contents[0][] = array(
$this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"',
'text' => $langs->trans("ReadPermissionNotAllowed")
);

View File

@ -136,7 +136,7 @@ class box_fournisseurs extends ModeleBoxes
}
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedSuppliers"),
);

View File

@ -142,7 +142,10 @@ class box_goodcustomers extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedCustomers")
);
$this->db->free($result);
}

View File

@ -149,7 +149,10 @@ class box_mos extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedOrders")
);
$this->db->free($result);
} else {

View File

@ -149,8 +149,8 @@ class box_prospect extends ModeleBoxes
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text'=>$langs->trans("NoRecordedProspects"),
'td' => 'class="center opacitymedium"',
'text'=> $langs->trans("NoRecordedProspects"),
);
}

View File

@ -223,7 +223,10 @@ class box_services_contracts extends ModeleBoxes
$i++;
}
if ($num == 0) $this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoContractedProducts"));
if ($num == 0) $this->info_box_contents[$i][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoContractedProducts")
);
$this->db->free($result);
}

View File

@ -158,7 +158,10 @@ class box_shipments extends ModeleBoxes
$line++;
}
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedShipments"));
if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedShipments")
);
$this->db->free($result);
} else {

View File

@ -8070,7 +8070,10 @@ abstract class CommonObject
{
if (empty($id) && empty($ref) && empty($morewhere)) return -1;
$sql = 'SELECT '.$this->getFieldList();
$fieldlist = $this->getFieldList();
if (empty($fieldlist)) return 0;
$sql = 'SELECT '.$fieldlist;
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
if (!empty($id)) $sql .= ' WHERE rowid = '.$id;

View File

@ -665,16 +665,18 @@ class Form
* @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
* @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param int $alwaysvisible 1=select button always visible
* @param string $name Name for massaction
* @param string $cssclass CSS class used to check for select
* @return string|void Select list
*/
public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0)
public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect')
{
global $conf, $langs, $hookmanager;
$disabled = 0;
$ret = '<div class="centpercent center">';
$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' massaction massactionselect valignmiddle" name="massaction"'.($disabled ? ' disabled="disabled"' : '').'>';
$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' ' . $name . ' ' . $name . 'select valignmiddle" name="' . $name . '"'.($disabled ? ' disabled="disabled"' : '').'>';
// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
$parameters = array();
@ -693,46 +695,46 @@ class Form
$ret .= '</select>';
if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.massactionselect');
if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.' . $name . 'select');
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
$ret .= '<input type="submit" disabled name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '<input type="submit" disabled name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' ' . $name . ' ' . $name . 'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '</div>';
if (!empty($conf->use_javascript_ajax))
{
$ret .= '<!-- JS CODE TO ENABLE mass action select -->
<script>
function initCheckForSelect(mode) /* mode is 0 during init of page or click all, 1 when we click on 1 checkbox */
function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */
{
atleastoneselected=0;
jQuery(".checkforselect").each(function( index ) {
jQuery("."+cssclass).each(function( index ) {
/* console.log( index + ": " + $( this ).text() ); */
if ($(this).is(\':checked\')) atleastoneselected++;
});
console.log("initCheckForSelect mode="+mode+" atleastoneselected="+atleastoneselected);
console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
if (atleastoneselected || '.$alwaysvisible.')
{
jQuery(".massaction").show();
'.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').'
'.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').'
jQuery("."+name).show();
'.($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
'.($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
}
else
{
jQuery(".massaction").hide();
jQuery(".massactionother").hide();
jQuery("."+name).hide();
jQuery("."+name+"other").hide();
}
}
jQuery(document).ready(function () {
initCheckForSelect(0);
jQuery(".checkforselect").click(function() {
initCheckForSelect(1);
});
jQuery(".massactionselect").change(function() {
initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
jQuery(".' . $cssclass . '").click(function() {
initCheckForSelect(1, "'.$name.'", "' . $cssclass . '");
});
jQuery(".' . $name . 'select").change(function() {
var massaction = $( this ).val();
var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
if (massaction == "builddoc")
@ -744,13 +746,13 @@ class Form
/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
if ($(this).val() != \'0\')
{
jQuery(".massactionconfirmed").prop(\'disabled\', false);
jQuery(".massactionother").show();
jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
jQuery(".' . $name . 'other").show();
}
else
{
jQuery(".massactionconfirmed").prop(\'disabled\', true);
jQuery(".massactionother").hide();
jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
jQuery(".' . $name . 'other").hide();
}
});
});
@ -2882,7 +2884,7 @@ class Form
}
if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
if ($socid) $sql .= " AND pfp.fk_soc = ".$socid;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
// Units
@ -7831,18 +7833,19 @@ class Form
*
* @param string $cssclass CSS class
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
* @param string $massactionname Mass action button name that will launch an action on the selected items
* @return string
*/
public function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0)
public function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction")
{
global $conf, $langs;
$out = '';
$id = uniqid();
if (!empty($conf->use_javascript_ajax)) $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="checkallactions'.$id.'" name="checkallactions" class="checkallactions"></div>';
if (!empty($conf->use_javascript_ajax)) $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
$out .= '<script>
$(document).ready(function() {
$("#checkallactions'.$id.'").click(function() {
$("#' . $cssclass . 's").click(function() {
if($(this).is(\':checked\')){
console.log("We check all '.$cssclass.'");
$(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\');
@ -7852,10 +7855,10 @@ class Form
console.log("We uncheck all");
$(".'.$cssclass.'").prop(\'checked\', false).trigger(\'change\');
}'."\n";
if ($calljsfunction) $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
if ($calljsfunction) $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
$out .= ' });
$(".checkforselect").change(function() {
$(".' . $cssclass . '").change(function() {
$(this).closest("tr").toggleClass("highlight", this.checked);
});
@ -7871,14 +7874,15 @@ class Form
* @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this
* @param string $cssclass CSS class
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
* @param string $massactionname Mass action name
* @return string
*/
public function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0)
public function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction")
{
$out = $this->showFilterButtons();
if ($addcheckuncheckall)
{
$out .= $this->showCheckAddButtons($cssclass, $calljsfunction);
$out .= $this->showCheckAddButtons($cssclass, $calljsfunction, $massactionname);
}
return $out;
}

View File

@ -620,11 +620,12 @@ class FormProjets
* @param int $showallnone Add choice "All" and "None"
* @param int $showpercent Show default probability for status
* @param string $morecss Add more css
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/
public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '')
public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0)
{
global $conf, $langs;
global $conf, $langs, $user;
$sql = "SELECT rowid, code, label, percent";
$sql .= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
@ -670,6 +671,7 @@ class FormProjets
$i++;
}
$sellist .= '</select>';
if ($user->admin && !$noadmininfo) $sellist .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
/*else
{

View File

@ -328,48 +328,61 @@ class Interfaces
continue;
}
$objMod = new $modName($db);
$text = '';
// Define disabledbyname and disabledbymodule
$disabledbyname = 0;
$disabledbymodule = 1;
$module = '';
try {
$objMod = new $modName($db);
// Check if trigger file is disabled by name
if (preg_match('/NORUN$/i', $files[$key])) $disabledbyname = 1;
// Check if trigger file is for a particular module
if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg))
{
$module = preg_replace('/^mod/i', '', $reg[2]);
$constparam = 'MAIN_MODULE_'.strtoupper($module);
if (strtolower($module) == 'all') $disabledbymodule = 0;
elseif (empty($conf->global->$constparam)) $disabledbymodule = 2;
$triggers[$j]['module'] = strtolower($module);
if (is_subclass_of($objMod, 'DolibarrTriggers'))
{
// Define disabledbyname and disabledbymodule
$disabledbyname = 0;
$disabledbymodule = 1;
$module = '';
// Check if trigger file is disabled by name
if (preg_match('/NORUN$/i', $files[$key])) $disabledbyname = 1;
// Check if trigger file is for a particular module
if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg))
{
$module = preg_replace('/^mod/i', '', $reg[2]);
$constparam = 'MAIN_MODULE_'.strtoupper($module);
if (strtolower($module) == 'all') $disabledbymodule = 0;
elseif (empty($conf->global->$constparam)) $disabledbymodule = 2;
$triggers[$j]['module'] = strtolower($module);
}
// We set info of modules
$triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "');
$triggers[$j]['file'] = $files[$key];
$triggers[$j]['fullpath'] = $fullpath[$key];
$triggers[$j]['relpath'] = $relpath[$key];
$triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key];
$triggers[$j]['version'] = $objMod->getVersion();
$triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick');
if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = '';
$text = '<b>'.$langs->trans("Description").':</b><br>';
$text .= $objMod->getDesc().'<br>';
$text .= '<br><b>'.$langs->trans("Status").':</b><br>';
if ($disabledbyname == 1)
{
$text .= $langs->trans("TriggerDisabledByName").'<br>';
if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>';
}
else
{
if ($disabledbymodule == 0) $text .= $langs->trans("TriggerAlwaysActive").'<br>';
if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'<br>';
if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>';
}
}
else {
print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers<br>';
}
}
// We set info of modules
$triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "');
$triggers[$j]['file'] = $files[$key];
$triggers[$j]['fullpath'] = $fullpath[$key];
$triggers[$j]['relpath'] = $relpath[$key];
$triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key];
$triggers[$j]['version'] = $objMod->getVersion();
$triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick');
if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = '';
$text = '<b>'.$langs->trans("Description").':</b><br>';
$text .= $objMod->getDesc().'<br>';
$text .= '<br><b>'.$langs->trans("Status").':</b><br>';
if ($disabledbyname == 1)
{
$text .= $langs->trans("TriggerDisabledByName").'<br>';
if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>';
}
else
{
if ($disabledbymodule == 0) $text .= $langs->trans("TriggerAlwaysActive").'<br>';
if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'<br>';
if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>';
catch (Exception $e) {
print $e->getMessage();
}
$triggers[$j]['info'] = $text;

View File

@ -56,7 +56,7 @@ function accounting_prepare_head(AccountingAccount $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Asset");
$head[$h][2] = 'card';
$h++;

View File

@ -20,7 +20,7 @@
/**
* \file htdocs/core/lib/ajax.lib.php
* \brief Page called by Ajax request for produts
* \brief Page called to enhance interface with Javascript and Ajax features.
*/

View File

@ -39,7 +39,7 @@ function bank_prepare_head(Account $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("BankAccount");
$head[$h][2] = 'bankname';
$h++;
@ -211,7 +211,7 @@ function various_payment_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("VariousPayment");
$head[$h][2] = 'card';
$h++;

View File

@ -40,7 +40,7 @@ function categories_prepare_head(Categorie $object, $type)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&amp;type='.$type;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Category");
$head[$h][2] = 'card';
$h++;

View File

@ -46,7 +46,7 @@ function societe_prepare_head(Societe $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("ThirdParty");
$head[$h][2] = 'card';
$h++;
@ -367,7 +367,7 @@ function societe_prepare_head2($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("ThirdParty");
$head[$h][2] = 'company';
$h++;

View File

@ -38,7 +38,7 @@ function contact_prepare_head(Contact $object)
$head = array();
$head[$tab][0] = DOL_URL_ROOT.'/contact/card.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Card");
$head[$tab][1] = $langs->trans("Contact");
$head[$tab][2] = 'card';
$tab++;

View File

@ -910,9 +910,9 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0,
if ($numholidays == 1) return 0;
}
$nbOpenDay=$lastday;
$nbOpenDay = $lastday;
if ($inhour == 1) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort");
if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24);
return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
}
else

View File

@ -68,7 +68,7 @@ function donation_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/don/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Donation");
$head[$h][2] = 'card';
$h++;

View File

@ -81,14 +81,14 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '')
if ($module == 'ecm')
{
$head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Directory");
$head[$h][2] = 'card';
$h++;
}
else
{
$head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Directory");
$head[$h][2] = 'card';
$h++;
}
@ -109,7 +109,7 @@ function ecm_file_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("File");
$head[$h][2] = 'card';
$h++;

View File

@ -35,7 +35,7 @@ function expensereport_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/expensereport/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("ExpenseReport");
$head[$h][2] = 'card';
$h++;
@ -94,7 +94,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("ExpenseReport");
$head[$h][2] = 'payment';
$h++;

View File

@ -42,7 +42,7 @@ function fichinter_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/fichinter/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Intervention");
$head[$h][2] = 'card';
$h++;

View File

@ -35,7 +35,7 @@ function fiscalyear_prepare_head(Fiscalyear $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("FiscalPeriod");
$head[$h][2] = 'card';
$h++;

View File

@ -3149,7 +3149,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
'cash-register', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes',
'cash-register', 'category', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes',
'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help',
'intervention', 'label', 'language', 'list', 'listlight', 'lot',
@ -3167,7 +3167,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website',
'off', 'on', 'order',
'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip',
'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench',
'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic',
@ -3178,7 +3178,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = $pictowithouttext;
$facolor = ''; $fasize = '';
$fa = 'fas';
if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark'))) {
if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) {
$fa = 'far';
}
if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp'))) {
@ -3212,7 +3212,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'title_agenda'=>'calendar-alt',
'uparrow'=>'mail-forward',
'uparrow'=>'mail-forward', 'vcard'=>'address-card',
'jabber'=>'comment-o',
'website'=>'globe-americas'
);

View File

@ -35,7 +35,7 @@ function holiday_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Holiday");
$head[$h][2] = 'card';
$h++;

View File

@ -37,7 +37,7 @@ function establishment_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Establishment");
$head[$h][2] = 'card';
$h++;

View File

@ -38,7 +38,7 @@ function member_prepare_head(Adherent $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Member");
$head[$h][2] = 'general';
$h++;
@ -124,7 +124,7 @@ function member_type_prepare_head(AdherentType $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("MemberType");
$head[$h][2] = 'card';
$h++;
@ -276,7 +276,7 @@ function subscription_prepare_head(Subscription $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Subscription");
$head[$h][2] = 'general';
$h++;

View File

@ -34,7 +34,7 @@ function payment_prepare_head(Paiement $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Payment");
$head[$h][2] = 'payment';
$h++;
@ -69,7 +69,7 @@ function payment_supplier_prepare_head(Paiement $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Payment");
$head[$h][2] = 'payment';
$h++;

View File

@ -40,7 +40,7 @@ function prelevement_prepare_head(BonPrelevement $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("WithdrawalsReceipts");
$head[$h][2] = 'prelevement';
$h++;

View File

@ -41,7 +41,7 @@ function product_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("ProductOrService");
$head[$h][2] = 'card';
$h++;
@ -216,7 +216,7 @@ function productlot_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Lot");
$head[$h][2] = 'card';
$h++;

View File

@ -168,7 +168,7 @@ function task_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : '');
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Project");
$head[$h][2] = 'task_task';
$h++;
@ -2226,10 +2226,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
print '<tr class="oddeven">';
print '<td>';
print $projectstatic->getNomUrl(1);
print $projectstatic->getNomUrl(1, '', 0, '', '-', 0 , -1, 'nowraponall');
if (!in_array('projectlabel', $hiddenfields)) print '<br><span class="opacitymedium">'.dol_trunc($objp->title, 24).'</span>';
print '</td>';
print '<td>';
print '<td class="nowraponall tdoverflowmax100">';
if ($objp->fk_soc > 0)
{
$thirdpartystatic->id = $objp->fk_soc;

View File

@ -34,7 +34,7 @@ function salaries_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/salaries/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("SalaryPayment");
$head[$h][2] = 'card';
$h++;

View File

@ -192,6 +192,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
if ($features == 'mo') $features = 'mrp';
if ($features == 'member') $features = 'adherent';
if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; };
if ($features == 'websitepage') $features = 'website';
// Get more permissions checks from hooks
$parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select);

View File

@ -35,7 +35,7 @@ function stock_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/product/stock/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Warehouse");
$head[$h][2] = 'card';
$h++;

View File

@ -78,7 +78,7 @@ function ticket_prepare_head($object)
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?action=view&track_id='.$object->track_id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Ticket");
$head[$h][2] = 'tabTicket';
$h++;
@ -230,8 +230,8 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 150;
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png';
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
}
}
}
@ -254,7 +254,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
}
print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>';
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
}
print '</div>';
}

View File

@ -35,7 +35,7 @@ function trip_prepare_head(Deplacement $object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Trip");
$head[$h][2] = 'card';
$h++;

View File

@ -520,7 +520,7 @@ function includeContainer($containerref)
$tmpoutput = ob_get_contents();
ob_end_clean();
print "\n".'<!-- include '.$fullpathfile.' level = '.$includehtmlcontentopened.' -->'."\n";
print "\n".'<!-- include '.$websitekey.'/'.$containerref.' level = '.$includehtmlcontentopened.' -->'."\n";
print preg_replace(array('/^.*<body[^>]*>/ims', '/<\/body>.*$/ims'), array('', ''), $tmpoutput);
if (!$res)
@ -533,14 +533,15 @@ function includeContainer($containerref)
/**
* Return HTML content to add structured data for an article, news or Blog Post.
* Use the json-ld format.
*
* @param string $type 'blogpost', 'product', 'software'...
* @param string $type 'blogpost', 'product', 'software', 'organization', ...
* @param array $data Array of data parameters for structured data
* @return string HTML content
*/
function getStructuredData($type, $data = array())
{
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs; // Very important. Required to have var available when running inluded containers.
global $conf, $db, $hookmanager, $langs, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs; // Very important. Required to have var available when running inluded containers.
if ($type == 'software')
{
@ -551,7 +552,7 @@ function getStructuredData($type, $data = array())
"@type": "SoftwareApplication",
"name": "'.dol_escape_json($data['name']).'",
"operatingSystem": "'.dol_escape_json($data['os']).'",
"applicationCategory": "https://schema.org/GameApplication",
"applicationCategory": "https://schema.org/'.$data['applicationCategory'].'",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "'.$data['ratingvalue'].'",
@ -565,6 +566,44 @@ function getStructuredData($type, $data = array())
}'."\n";
$ret .= '</script>'."\n";
}
elseif ($type == 'organization')
{
$companyname = $mysoc->name;
$url = $mysoc->url;
$ret = '<!-- Add structured data for blog post -->'."\n";
$ret .= '<script type="application/ld+json">'."\n";
$ret .= '{
"@context": "https://schema.org",
"@type": "Organization",
"name": "'.dol_escape_json($data['name'] ? $data['name'] : $companyname).'",
"url": "'.dol_escape_json($data['url'] ? $data['url'] : $url).'",
"logo": "'.($data['logo'] ? dol_escape_json($data['logo']) : '/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo)).'",
"contactPoint": {
"@type": "ContactPoint",
"contactType": "Contact",
"email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'"
},'."\n";
if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) {
$ret .= '"sameAs": [';
$i = 0;
foreach($mysoc->socialnetworks as $key => $value) {
if ($key == 'linkedin') {
$ret.= '"https://www.'.$key.'.com/company/'.dol_escape_json($value).'"';
} elseif ($key == 'youtube') {
$ret.= '"https://www.'.$key.'.com/user/'.dol_escape_json($value).'"';
}
else {
$ret.= '"https://www.'.$key.'.com/'.dol_escape_json($value).'"';
}
$i++;
if ($i < count($mysoc->socialnetworks)) $ret .= ', ';
}
$ret .= '],'."\n";
}
$ret .= "\n".'}'."\n";
$ret .= '</script>'."\n";
}
elseif ($type == 'blogpost')
{
if (!empty($websitepage->author_alias))
@ -581,7 +620,7 @@ function getStructuredData($type, $data = array())
$pageurl = str_replace('__WEBSITE_KEY__', $website->ref, $pageurl);
$title = str_replace('__WEBSITE_KEY__', $website->ref, $title);
$image = str_replace('__WEBSITE_KEY__', $website->ref, $image);
$image = 'medias/'.str_replace('__WEBSITE_KEY__', $website->ref, $image);
$companyname = str_replace('__WEBSITE_KEY__', $website->ref, $companyname);
$description = str_replace('__WEBSITE_KEY__', $website->ref, $description);
@ -598,6 +637,7 @@ function getStructuredData($type, $data = array())
"image": [
"'.dol_escape_json($image).'"
],
"dateCreated": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'",
"datePublished": "'.dol_print_date($websitepage->date_creation, 'dayhourrfc').'",
"dateModified": "'.dol_print_date($websitepage->date_modification, 'dayhourrfc').'",
"author": {
@ -609,11 +649,22 @@ function getStructuredData($type, $data = array())
"name": "'.dol_escape_json($companyname).'",
"logo": {
"@type": "ImageObject",
"url": "/viewimage.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'"
"url": "/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo).'"
}
},
"description": "'.dol_escape_json($description).'"
}'."\n";
},'."\n";
if ($websitepage->keywords) {
$ret .= '"keywords": [';
$i = 0;
$arrayofkeywords = explode(',', $websitepage->keywords);
foreach($arrayofkeywords as $keyword) {
$ret.= '"'.dol_escape_json($keyword).'"';
$i++;
if ($i < count($arrayofkeywords)) $ret .= ', ';
}
$ret .= '],'."\n";
}
$ret .= '"description": "'.dol_escape_json($description).'"';
$ret .= "\n".'}'."\n";
$ret .= '</script>'."\n";
}
}

View File

@ -196,7 +196,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage)
else dol_print_error($db);
}
// Add canonical reference
$tplcontent .= '<link href="'.(($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')).'" rel="canonical" />'."\n";
if ($object->virtualhost) {
$tplcontent .= '<link rel="canonical" href="'.$object->virtualhost.(($objectpage->id == $object->fk_default_home) ? '/' : (($shortlangcode != substr($object->lang, 0, 2) ? '/'.$shortlangcode : '').'/'.$objectpage->pageurl.'.php')).'" />'."\n";
}
// Add manifest.json on homepage
$tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";
$tplcontent .= '<!-- Include link to CSS file -->'."\n";

View File

@ -308,8 +308,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Bank
$tmpentry = array(
'enabled'=>(!empty($conf->banque->enabled) || !empty($conf->prelevement->enabled)),
'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire)),
'module'=>'banque|prelevement'
'perms'=>(!empty($user->rights->banque->lire) || !empty($user->rights->prelevement->lire) || !empty($user->rights->paymentbybanktransfer->read)),
'module'=>'banque|prelevement|paymentbybanktransfer'
);
$menu_arr[] = array(
'name' => 'Bank',
@ -1464,7 +1464,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Load translation files required by the page
$langs->loadLangs(array("withdrawals", "banks", "bills", "categories"));
// Bank-Caisse
// Bank-Cash account
if (!empty($conf->banque->enabled))
{
$newmenu->add("/compta/bank/list.php?leftmenu=bank&amp;mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->rights->banque->lire, '', $mainmenu, 'bank');
@ -1484,14 +1484,12 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->rights->categorie->creer, '', $mainmenu, 'tags');
}
// Prelevements
// Direct debit order
if (!empty($conf->prelevement->enabled))
{
$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&amp;mainmenu=bank", $langs->trans("StandingOrders"), 0, $user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw');
if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") {
//$newmenu->add("/compta/prelevement/demandes.php?status=0&amp;mainmenu=bank",$langs->trans("StandingOrderToProcess"),1,$user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->rights->prelevement->bons->creer);
$newmenu->add("/compta/prelevement/bons.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire);
@ -1503,7 +1501,22 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
}
}
// Gestion cheques
// Bank transfer order
if (!empty($conf->paymentbybanktransfer->enabled))
{
$newmenu->add("/compta/paymentbybanktransfer/index.php?leftmenu=banktransfer&amp;mainmenu=bank", $langs->trans("PaymentByBankTransfer"), 0, $user->rights->paymentbybanktransfer->read, '', $mainmenu, 'banktransfer');
if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") {
$newmenu->add("/compta/paymentbybanktransfer/create.php?mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create);
$newmenu->add("/compta/paymentbybanktransfer/bons.php?mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/paymentbybanktransfer/list.php?mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/paymentbybanktransfer/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/paymentbybanktransfer/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read);
}
}
// Management of checks
if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && !empty($conf->banque->enabled) && (!empty($conf->facture->enabled) || !empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON)))
{
$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&amp;mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->rights->banque->cheque, '', $mainmenu, 'checks');

View File

@ -2295,9 +2295,17 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
{
print img_object($alttext, 'generic', 'class="inline-block valignmiddle"');
}
print '<span class="info-box-icon-version" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
print $this->getVersion(1);
print '</span>';
$version = $this->getVersion(0);
$versiontrans = '';
if (preg_match('/development/i', $version)) $versiontrans .= 'warning';
if (preg_match('/experimental/i', $version)) $versiontrans .= 'warning';
if (preg_match('/deprecated/i', $version)) $versiontrans .= 'warning';
if ($this->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
print '<span class="info-box-icon-version'.($versiontrans ? ' '.$versiontrans : '').'" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';
print $this->getVersion(1);
print '</span>';
}
/*print '<span class="info-box-icon-action">';
print '<div class="valignmiddle inline-block">';
@ -2313,7 +2321,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
print '</div>
<div class="info-box-content info-box-text-module">
<span class="info-box-title">'.$this->getName().'</span>
<span class="info-box-title marginbottomonly">'.$this->getName().'</span>
<span class="info-box-desc twolinesmax opacitymedium" title="'.dol_escape_htmltag($this->getDesc()).'">'.nl2br($this->getDesc()).'</span>';
/*print '<span class="info-box-icon-version" title="'.$langs->trans("Version").' '.$this->getVersion(1).'">';

View File

@ -0,0 +1,148 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \defgroup paymentbybanktransfer Module paymentbybanktransfer
* \brief Module to manage payment by bank transfer
* \file htdocs/core/modules/modPaymentByBankTransfer.class.php
* \ingroup paymentbybanktransfer
* \brief File to describe and activate the module PaymentByBankTransfer
*/
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
/**
* Class to describe and enable module of payment by Bank transfer
*/
class modPaymentByBankTransfer extends DolibarrModules
{
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
* @param DoliDB $db Database handler
*/
public function __construct($db)
{
global $conf;
$this->db = $db;
$this->numero = 56;
$this->family = "financial";
$this->module_position = '52';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Management of payment by bank transfer";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'development';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of png file (without png) used for this module
$this->picto = 'payment';
// Data directories to create when module is enabled
$this->dirs = array("/paymentbybanktransfer/temp", "/paymentbybanktransfer/receipts");
// Dependencies
$this->hidden = false; // A condition to hide module
$this->depends = array("modFournisseur", "modBanque"); // List of module class names as string that must be enabled if this module is enabled
$this->requiredby = array(); // List of module ids to disable if this one is disabled
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
$this->phpmin = array(5, 4); // Minimum version of PHP required by module
// Config pages
$this->config_page_url = array("paymentbybanktransfer.php");
// Constants
$this->const = array();
$r = 0;
/*$this->const[$r][0] = "BANK_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "sepamandate";
$this->const[$r][3] = 'Name of manager to generate SEPA mandate';
$this->const[$r][4] = 0;
$r++;*/
// Boxes
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'paymentbybanktransfer';
$r = 0;
$r++;
$this->rights[$r][0] = 561;
$this->rights[$r][1] = 'Read bank transfer payment orders';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'read';
$r++;
$this->rights[$r][0] = 562;
$this->rights[$r][1] = 'Create/modify a bank transfer payment order';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'create';
$r++;
$this->rights[$r][0] = 563;
$this->rights[$r][1] = 'Send/Transmit bank transfer payment order';
$this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'send';
$r++;
$this->rights[$r][0] = 564;
$this->rights[$r][1] = 'Record Debits/Rejects of bank transfer payment order';
$this->rights[$r][2] = 'a';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'debit';
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
}
/**
* Function called when module is enabled.
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
* It also creates data directories
*
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
public function init($options = '')
{
global $conf;
// Permissions
$this->remove($options);
$sql = array();
return $this->_init($sql, $options);
}
}

View File

@ -20,17 +20,17 @@
/**
* \defgroup prelevement Module prelevement
* \brief Module de gestion des prelevements bancaires
* \brief Module to manage Direct debit orders
* \file htdocs/core/modules/modPrelevement.class.php
* \ingroup prelevement
* \brief Fichier de description et activation du module Prelevement
* \brief File to describe and enable the module Prelevement
*/
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
/**
* Class to describe and enable module Prelevement
* Class to describe and enable module of payment by Direct Debit
*/
class modPrelevement extends DolibarrModules
{
@ -51,7 +51,7 @@ class modPrelevement extends DolibarrModules
$this->module_position = '52';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Gestion des Prelevements";
$this->description = "Management of Direct Debit orders";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
@ -124,15 +124,6 @@ class modPrelevement extends DolibarrModules
$this->rights[$r][4] = 'bons';
$this->rights[$r][5] = 'credit';
/*
$this->rights[2][0] = 154;
$this->rights[2][1] = 'Setup withdraw account';
$this->rights[2][2] = 'w';
$this->rights[2][3] = 0;
$this->rights[2][4] = 'bons';
$this->rights[2][5] = 'configurer';
*/
// Menus
//-------
$this->menu = 1; // This module add menu entries. They are coded into menu manager.

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015-2018 Charlene BENKE <charlie@patas-monkey.com>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -207,7 +208,11 @@ class pdf_paiement
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
}
if (!empty($socid)) $sql .= " AND s.rowid = ".$socid;
$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
// If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code
if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD))
$sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiement ASC";
else
$sql .= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
break;
case "fourn":
$sql = "SELECT p.datep as dp, f.ref as ref";
@ -237,7 +242,11 @@ class pdf_paiement
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
}
if (!empty($socid)) $sql .= " AND s.rowid = ".$socid;
$sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC";
// If global param PAYMENTS_FOURN_REPORT_GROUP_BY_MOD is set, payement fourn are ordered by paiement_code
if (!empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))
$sql .= " ORDER BY paiement_code ASC, p.datep ASC, pf.fk_paiementfourn ASC";
else
$sql .= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC";
break;
}
@ -425,7 +434,7 @@ class pdf_paiement
public function Body(&$pdf, $page, $lines, $outputlangs)
{
// phpcs:enable
global $langs;
global $langs, $conf;
$default_font_size = pdf_getPDFFontSize($outputlangs);
$pdf->SetFont('', '', $default_font_size - 1);
@ -435,6 +444,11 @@ class pdf_paiement
$pdf->SetFillColor(220, 220, 220);
$yp = 0;
$numlines = count($lines);
if (($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD)))
{
$mod = $lines[0][2];
$total_mod = 0;
}
for ($j = 0; $j < $numlines; $j++)
{
$i = $j;
@ -450,8 +464,17 @@ class pdf_paiement
{
if ($yp > $this->tab_height - 15)
{
$pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0);
$pdf->SetFillColor(255, 255, 255);
$pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array());
$pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1));
$pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp);
$pdf->SetFont('', 'B', $default_font_size - 1);
$pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_page), 0, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->SetFillColor(220, 220, 220);
$page++;
$pdf->AddPage();
$this->_pagehead($pdf, $page, 0, $outputlangs);
@ -474,6 +497,7 @@ class pdf_paiement
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1);
$yp = $yp + 5;
$total_page += $lines[$j][9];
if (($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) $total_mod += $lines[$j][9];
}
// Invoice number
@ -497,9 +521,44 @@ class pdf_paiement
{
$oldprowid = $lines[$j][7];
}
// Add line to add total by payment mode if mode reglement for nex line change
if ((($this->doc_type == 'client' && !empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) || ($this->doc_type == 'fourn' && !empty($conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD))) && ($mod != $lines[$j + 1][2]))
{
$pdf->SetFillColor(245, 245, 245);
$pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array());
$pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1));
$pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp);
$pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
$pdf->SetFont('', 'I', $default_font_size - 1);
$pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_mod), 0, 'R', 1);
$pdf->SetFont('', '', $default_font_size - 1);
$mod = $lines[$j + 1][2];
$total_mod = 0;
$yp = $yp + 5;
if ($yp > $this->tab_height - 5)
{
$page++;
$pdf->AddPage();
$this->_pagehead($pdf, $page, 0, $outputlangs);
$pdf->SetFont('', '', $default_font_size - 1);
$yp = 0;
}
$pdf->SetFillColor(220, 220, 220);
}
}
$total += $total_page;
$pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('Total')." : ".price($total), 0, 'R', 0);
$pdf->SetFillColor(255, 255, 255);
$pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array());
$pdf->line($this->marge_gauche, $this->tab_top + 10 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 10 + $yp, array('dash'=>1));
$pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp);
$pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
$pdf->SetFont('', 'B');
$pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1);
$pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total), 0, 'R', 1);
$pdf->SetFillColor(220, 220, 220);
}
}

View File

@ -46,7 +46,7 @@ $text = $langs->trans("Tools");
print load_fiche_titre($text, '', 'wrench');
// Show description of content
print '<div class="justify">'.$langs->trans("ToolsDesc").'</div><br><br>';
print '<div class="justify opacitymedium">'.$langs->trans("ToolsDesc").'</div><br><br>';
// Show logo

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
/**
* Class of triggers for stripe module
*/
class InterfaceStripe
class InterfaceStripe extends DolibarrTriggers
{
/**
* @var DoliDB Database handler.

View File

@ -27,6 +27,18 @@
include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
// Detection browser (copy of code from main.inc.php)
if (isset($_SERVER["HTTP_USER_AGENT"]) && is_object($conf) && empty($conf->browser->name))
{
$tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
$conf->browser->name = $tmp['browsername'];
$conf->browser->os = $tmp['browseros'];
$conf->browser->version = $tmp['browserversion'];
$conf->browser->layout = $tmp['layout']; // 'classic', 'phone', 'tablet'
//var_dump($conf->browser);
if ($conf->browser->layout == 'phone') $conf->dol_no_mouse_hover = 1;
}
// Define $website
if (!is_object($website))
{
@ -48,11 +60,16 @@ if (!is_object($weblangs))
{
$weblangs = new Translate('', $conf);
}
if (!is_object($pagelangs))
{
$pagelangs = new Translate('', $conf);
}
if ($pageid > 0)
{
$websitepage->fetch($pageid);
$weblangs->setDefaultLang($websitepage->lang ? $websitepage->lang : 'auto');
$weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : $_COOKIE['weblangs-shortcode']));
$pagelangs->setDefaultLang($websitepage->lang ? $websitepage->lang : $weblangs->shortlang);
if (!defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other')))
{

View File

@ -470,15 +470,15 @@ class DataPolicyCron
{
$sql = sprintf($params['sql'], (int) $conf->entity, (int) $conf->global->$key, (int) $conf->global->$key);
$resql = $db->query($sql);
$resql = $this->db->query($sql);
if ($resql && $db->num_rows($resql) > 0)
if ($resql && $this->db->num_rows($resql) > 0)
{
$num = $db->num_rows($resql);
$num = $this->db->num_rows($resql);
$i = 0;
require_once $params['file'];
$object = new $params['class']($db);
$object = new $params['class']($this->db);
while ($i < $num && !$error)
{

View File

@ -916,11 +916,13 @@ class Don extends CommonObject
/**
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $notooltip 1=Disable tooltip
* @return string Chaine avec URL
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @param int $notooltip 1=Disable tooltip
* @param string $moretitle Add more text to title tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL
*/
public function getNomUrl($withpicto = 0, $notooltip = 0)
public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1)
{
global $conf, $langs;
@ -928,10 +930,18 @@ class Don extends CommonObject
$result = '';
$label = '<u>'.$langs->trans("Donation").'</u>';
if (!empty($this->id))
if (!empty($this->id)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
}
if ($moretitle) $label .= ' - '.$moretitle;
$linkstart = '<a href="'.DOL_URL_ROOT.'/don/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$url = DOL_URL_ROOT.'/don/card.php?id='.$this->id;
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend = '</a>';
$result .= $linkstart;

View File

@ -122,7 +122,7 @@ $form = new Form($db);
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/don/payment/card.php?id='.$id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("DonationPayment");
$hselected = $h;
$h++;

View File

@ -1092,7 +1092,7 @@ class EmailCollector extends CommonObject
$i++;
$header = imap_fetchheader($connection, $imapemail, 0);
$header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines
$header = preg_replace('/\r\n\s+/m', ' ', $header); // When a header line is on several lines, merge lines
$matches = array();
preg_match_all('/([^: ]+): (.+?(?:\r\n\s(?:.+?))*)\r\n/m', $header, $matches);
$headers = array_combine($matches[1], $matches[2]);

View File

@ -26,7 +26,7 @@
* Prepare array of tabs for EmailCollector
*
* @param EmailCollector $object EmailCollector
* @return array Array of tabs
* @return array Array of tabs
*/
function emailcollectorPrepareHead($object)
{
@ -38,7 +38,7 @@ function emailcollectorPrepareHead($object)
$head = array();
$head[$h][0] = dol_buildpath("/admin/emailcollector_card.php", 1).'?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("EmailCollector");
$head[$h][2] = 'card';
$h++;

View File

@ -539,7 +539,7 @@ class Expedition extends CommonObject
// Check parameters
if (empty($id) && empty($ref) && empty($ref_ext)) return -1;
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
$sql .= ", e.date_valid";
$sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql .= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
@ -568,6 +568,7 @@ class Expedition extends CommonObject
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->socid = $obj->socid;
$this->ref_customer = $obj->ref_customer;

View File

@ -31,7 +31,7 @@
*/
if (!defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr');
if (!defined('DOL_VERSION')) define('DOL_VERSION', '12.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('DOL_VERSION')) define('DOL_VERSION', '13.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
if (!defined('EURO')) define('EURO', chr(128));

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 ATM-Consulting <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -24,6 +25,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement_fourn.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->loadLangs(array('bills'));
@ -86,6 +88,7 @@ if ($action == 'builddoc')
*/
$formother = new FormOther($db);
$formfile = new FormFile($db);
$titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports"));
@ -157,7 +160,7 @@ if ($year)
{
$tfile = $dir.'/'.$year.'/'.$file;
$relativepath = $year.'/'.$file;
print '<tr class="oddeven"><td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_fournisseur&amp;file=payments/'.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>';
print '<tr class="oddeven"><td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_fournisseur&amp;file=payments/'.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a>'.$formfile->showPreview($file, 'facture_fournisseur', 'payments/'.$relativepath, 0).'</td>';
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td></tr>';
}

View File

@ -479,7 +479,8 @@ else
array('from'=>'8.0.0', 'to'=>'9.0.0'),
array('from'=>'9.0.0', 'to'=>'10.0.0'),
array('from'=>'10.0.0', 'to'=>'11.0.0'),
array('from'=>'11.0.0', 'to'=>'12.0.0')
array('from'=>'11.0.0', 'to'=>'12.0.0'),
array('from'=>'12.0.0', 'to'=>'13.0.0')
);
$count = 0;

View File

@ -53,7 +53,7 @@ div.titre {
}
span.titre {
font-weight: bold;
/* font-weight: bold; */
background: #FFFFFF;
color: rgb(0,113,121);
border: 1px solid #bbb;

View File

@ -1 +1,37 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 13.0.0 or higher.
--
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field);
-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table
-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex
-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- To make pk to be auto increment (postgres):
-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid;
-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid);
-- -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN rowid SET DEFAULT nextval('llx_table_rowid_seq');
-- -- VPGSQL8.2 SELECT setval('llx_table_rowid_seq', MAX(rowid)) FROM llx_table;
-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL;
-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL;
-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL;
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- Note: fields with type BLOB/TEXT can't have default value.
-- Missing in v12
-- For v13
ALTER TABLE llx_website ADD COLUMN position integer DEFAULT 0;
INSERT INTO llx_const (rowid, name, entity, value, type, visible, note, tms) VALUES (NULL, 'PRODUCT_PRICE_BASE_TYPE', '1', 'HT', 'string', '0', NULL, CURRENT_TIMESTAMP);

View File

@ -35,6 +35,7 @@ CREATE TABLE llx_website
fk_user_creat integer,
fk_user_modif integer,
date_creation datetime,
position integer DEFAULT 0,
tms timestamp,
import_key varchar(14) -- import key
) ENGINE=innodb;

View File

@ -384,10 +384,10 @@ if ($action == "set" && $success)
print "<br>";
print $langs->trans("YouNeedToPersonalizeSetup")."<br><br>";
print $langs->trans("YouNeedToPersonalizeSetup")."<br><br><br>";
print '<div class="center"><a href="../admin/index.php?mainmenu=home&leftmenu=setup'.(isset($login) ? '&username='.urlencode($login) : '').'">';
print $langs->trans("GoToSetupArea");
print '<span class="fas fa-external-link-alt"></span> '.$langs->trans("GoToSetupArea");
print '</a></div>';
}
else
@ -399,7 +399,7 @@ if ($action == "set" && $success)
print "<br>";
print '<div class="center"><a href="'.$dolibarr_main_url_root.'/install/index.php">';
print $langs->trans("GoToUpgradePage");
print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToUpgradePage");
print '</a></div>';
}
}
@ -435,7 +435,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action))
print "<br><br>";
print '<div class="center"><a href="../index.php?mainmenu=home'.(isset($login) ? '&username='.urlencode($login) : '').'">';
print $langs->trans("GoToDolibarr").'...';
print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToDolibarr").'...';
print '</a></div><br>';
}
else
@ -447,7 +447,7 @@ elseif (empty($action) || preg_match('/upgrade/i', $action))
print "<br>";
print '<div class="center"><a href="../install/index.php">';
print $langs->trans("GoToUpgradePage");
print '<span class="fas fa-link-alt"></span> '.$langs->trans("GoToUpgradePage");
print '</a></div>';
}
}

View File

@ -234,8 +234,10 @@ ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unkno
ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Third-party account not defined or third party unknown. Blocking error.
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error
PaymentsNotLinkedToProduct=Payment not linked to any product / service
OpeningBalance=Opening balance
ShowOpeningBalance=Show opening balance
HideOpeningBalance=Hide opening balance
ShowSubtotalByGroup=Show subtotal by group
Pcgtype=Group of account
PcgtypeDesc=Group of account are used as predefined 'filter' and 'grouping' criteria for some accounting reports. For example, 'INCOME' or 'EXPENSE' are used as groups for accounting accounts of products to build the expense/income report.

View File

@ -541,8 +541,8 @@ Module54Name=Contracts/Subscriptions
Module54Desc=Management of contracts (services or recurring subscriptions)
Module55Name=Barcodes
Module55Desc=Barcode management
Module56Name=Telephony
Module56Desc=Telephony integration
Module56Name=Payment by bank transfer
Module56Desc=Management of payment by bank transfer orders. It includes generation of SEPA file for European countries.
Module57Name=Bank Direct Debit payments
Module57Desc=Management of Direct Debit payment orders. It includes generation of SEPA file for European countries.
Module58Name=ClickToDial
@ -1145,6 +1145,7 @@ AvailableModules=Available app/modules
ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules).
SessionTimeOut=Time out for session
SessionExplanation=This number guarantees that the session will never expire before this delay, if the session cleaner is done by Internal PHP session cleaner (and nothing else). Internal PHP session cleaner does not guarantee that the session will expire after this delay. It will expire, after this delay, and when the session cleaner is run, so every <b>%s/%s</b> access, but only during access made by other sessions (if value is 0, it means clearing of session is done only by an external process).<br>Note: on some servers with an external session cleaning mechanism (cron under debian, ubuntu ...), the sessions can be destroyed after a period defined by an external setup, no matter what the value entered here is.
SessionsPurgedByExternalSystem=Sessions on this server seems to be cleaned by an external mechanism (cron under debian, ubuntu ...), probably every <b>%s</b> seconds (= value of parameter <b>session.gc_maxlifetime</b>), so changing the value here has no effect. You must ask the server administrator to change session delay.
TriggersAvailable=Available triggers
TriggersDesc=Triggers are files that will modify the behavior of Dolibarr workflow once copied into the directory <b>htdocs/core/triggers</b>. They realize new actions, activated on Dolibarr events (new company creation, invoice validation, ...).
TriggerDisabledByName=Triggers in this file are disabled by the <b>-NORUN</b> suffix in their name.

Some files were not shown because too many files have changed in this diff Show More