Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/compta/facture/class/api_invoices.class.php
This commit is contained in:
Laurent Destailleur 2019-02-25 15:16:23 +01:00
commit 8a9339a059
194 changed files with 2369 additions and 2199 deletions

View File

@ -48,7 +48,7 @@ if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.i
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
if (! $res) die("Failed to include master.inc.php file\n");
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -43,7 +43,7 @@ if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.i
if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
if (! $res) die("Failed to include master.inc.php file\n");
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -428,5 +428,6 @@
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
</ruleset>

View File

@ -173,17 +173,16 @@ while ($obj = $db->fetch_object($resql)) {
$sql.= $db->plimit($limit+1, $offset);
dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql)
{
if (! $resql) {
dol_print_error($db);
exit;
}
$num = $db->num_rows($resql);
dol_syslog ("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/thirdparty_lettrage_supplier.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.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
@ -661,13 +661,11 @@ class AccountancyCategory // extends CommonObject
/**
* Function to know all category from accounting account
*
* @return array Result in table
* @return array|integer Result in table (array), -1 if KO
*/
public function getCatsCpts()
{
global $mysoc,$conf;
$sql = "";
global $mysoc, $conf;
if (empty($mysoc->country_id)) {
dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined');

View File

@ -633,12 +633,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ;
@ -654,12 +654,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep;
print '"' . utf8_decode (dol_trunc($accountingaccount->label, 32)) . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . utf8_decode(dol_trunc($accountingaccount->label, 32)) . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"'. $sep;
print '"' . $journal . '"' ;
@ -679,7 +679,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep;
@ -700,12 +700,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["refsologest"] . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)). '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
print '"' . $langs->trans("Thirdparty") . '"' . $sep;
print '"' . utf8_decode (dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $val["refsuppliersologest"] . ' - ' . $langs->trans("VAT") . ' NPR"' . $sep;
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"'. $sep;
print '"' . $journal . '"' ;

View File

@ -151,14 +151,14 @@ print "<table class=\"noborder\" width=\"100%\">";
print "<tr class=\"liste_titre\">";
print '<td>'.$langs->trans("Parameter")."</td>";
print '<td align="center">'.$langs->trans("Value")."</td>";
print '<td class="center">'.$langs->trans("Value")."</td>";
print "</tr>";
// Show external agenda
print '<tr class="oddeven">';
print "<td>".$langs->trans("ExtSitesEnableThisTool")."</td>";
print '<td align="center">';
print '<td class="center">';
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('AGENDA_DISABLE_EXT', array('enabled'=>array(0=>'.hideifnotset')), null, 1);
@ -181,7 +181,7 @@ print "</tr>";
print '<tr class="oddeven">';
print "<td>".$langs->trans("ExtSitesNbOfAgenda")."</td>";
print '<td align="center">';
print '<td class="center">';
print '<input class="flat hideifnotset" type="text" size="2" id="AGENDA_EXT_NB" name="AGENDA_EXT_NB" value="'.$conf->global->AGENDA_EXT_NB.'">';
print "</td>";
print "</tr>";

View File

@ -225,10 +225,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
print '<tr class="liste_titre">'."\n";
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
print '<td>'.$langs->trans("Description").'</td>'."\n";
print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status").'</td>'."\n";
print '<td class="center" width="60">'.$langs->trans("Default").'</td>'."\n";
print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="40">'.$langs->trans("Preview").'</td>';
print '</tr>'."\n";
clearstatcache();
@ -269,7 +269,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
if (in_array($name, $def))
{
print '<td align="center">'."\n";
print '<td class="center">'."\n";
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">';
@ -284,13 +284,13 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
}
else
{
print '<td align="center">'."\n";
print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>";
}
// Default
print '<td align="center">';
print '<td class="center">';
if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name")
{
print img_picto($langs->trans("Default"), 'on');
@ -307,10 +307,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
print '<td align="center">';
print '<td class="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
print '</td>';
@ -330,7 +330,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n";
@ -338,7 +338,7 @@ print '</tr>'."\n";
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
//print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list
if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
@ -355,7 +355,7 @@ print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n";
$htmltext=$langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
$tmplist=array(''=>'&nbsp;', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
@ -367,8 +367,8 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->';
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="right" class="nowrap">'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right nowrap">'."\n";
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
print '</td></tr>'."\n";
}
@ -376,8 +376,8 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
// AGENDA_DEFAULT_FILTER_TYPE
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="right" class="nowrap">'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right nowrap">'."\n";
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1);
print '</td></tr>'."\n";
@ -385,7 +385,7 @@ print '</td></tr>'."\n";
// TODO Remove to use the default generic feature
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
print '</td></tr>'."\n";

View File

@ -185,7 +185,7 @@ print '<input type="hidden" name="action" value="set">';
print '<table class="noborder allwidth">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
print '</tr>'."\n";
@ -195,7 +195,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
@ -212,7 +212,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
@ -224,7 +224,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2)
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER_SOUND').'</td>'."\n";
print '<td align="center">&nbsp;</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {

View File

@ -183,8 +183,8 @@ print '<tr class="liste_titre">';
print '<td width="140">' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td>' . $langs->trans("Example") . '</td>';
print '<td align="center">' . $langs->trans("Status") . '</td>';
print '<td align="center" width="60">&nbsp;</td>';
print '<td class="center">' . $langs->trans("Status") . '</td>';
print '<td class="center" width="60">&nbsp;</td>';
print "</tr>\n";
$bankorder[0][0] = $langs->trans("BankOrderGlobal");
@ -213,12 +213,12 @@ while ($i < $nbofbank) {
print "</td>\n";
if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
print '<td align="center">';
print '<td class="center">';
print img_picto($langs->trans("Activated"), 'on');
print '</td>';
}
else {
print '<td align="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&amp;value=' . $i . '">';
print '<td class="center"><a href="' . $_SERVER['PHP_SELF'] . '?action=setbankorder&amp;value=' . $i . '">';
print img_picto($langs->trans("Disabled"), 'off');
print '</a></td>';
}
@ -263,10 +263,10 @@ print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n";
print '<td align="center" width="60">' . $langs->trans("Default") . "</td>\n";
print '<td align="center" width="38">' . $langs->trans("ShortInfo") . '</td>';
print '<td align="center" width="38">' . $langs->trans("Preview") . '</td>';
print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n";
print '<td class="center" width="60">' . $langs->trans("Default") . "</td>\n";
print '<td class="center" width="38">' . $langs->trans("ShortInfo") . '</td>';
print '<td class="center" width="38">' . $langs->trans("Preview") . '</td>';
print "</tr>\n";
clearstatcache();
@ -315,7 +315,7 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print '<td align="center">' . "\n";
print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
print img_picto($langs->trans("Enabled"),
'switch_on');
@ -323,14 +323,14 @@ foreach ($dirmodels as $reldir) {
print '</td>';
}
else {
print '<td align="center">' . "\n";
print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scan_dir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"),
'switch_off') . '</a>';
print "</td>";
}
// Default
print '<td align="center">';
print '<td class="center">';
if ($conf->global->BANKADDON_PDF == $name) {
print img_picto($langs->trans("Default"),
'on');
@ -358,13 +358,13 @@ foreach ($dirmodels as $reldir) {
// $htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
//$htmltooltip .= '<br>' . $langs->trans("WatermarkOnDraftOrders") . ': ' . yn($module->option_draft_watermark, 1, 1);
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1,
0);
print '</td>';
// Preview
print '<td align="center">';
print '<td class="center">';
if ($module->type == 'pdf') {
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"),
'bill') . '</a>';
@ -404,7 +404,7 @@ print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>' . $langs->trans("Name") . '</td>';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="center" width="60">' . $langs->trans("Status") . "</td>\n";
print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n";
print "</tr>\n";
print '<tr class="oddeven"><td width="100">';
@ -414,7 +414,7 @@ print $langs->trans('AutoReportLastAccountStatement');
print '</td>';
// Active
if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
print '<td align="center">' . "\n";
print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=unsetreportlastnumreleve">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
@ -422,7 +422,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
}
else
{
print '<td align="center">' . "\n";
print '<td class="center">' . "\n";
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setreportlastnumreleve">' . img_picto($langs->trans("Disabled"),
'switch_off') . '</a>';
print "</td>";

View File

@ -199,8 +199,8 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td width="200" align="center">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
print '<td width="200" class="center">'.$langs->trans("Example").'</td>';
print '<td class="center" width="60">'.$langs->trans("CodeBarGenerator").'</td>';
print "</tr>\n";
$sql = "SELECT rowid, code as encoding, libelle, coder, example";
@ -229,7 +229,7 @@ if ($resql)
print '</td>';
// Show example
print '<td align="center">';
print '<td class="center">';
if ($obj->coder && $obj->coder != -1)
{
$result=0;
@ -277,7 +277,7 @@ if ($resql)
}
print '</td>';
print '<td align="center">';
print '<td class="center">';
print $formbarcode->setBarcodeEncoder($obj->coder, $barcodelist, $obj->rowid, 'form'.$i);
print "</td></tr>\n";
@ -307,7 +307,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td width="60" align="center">'.$langs->trans("Value").'</td>';
print '<td width="60" class="center">'.$langs->trans("Value").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
@ -317,7 +317,7 @@ if (! isset($_SERVER['WINDIR']))
print '<tr class="oddeven">';
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
print '<td width="60" align="center">';
print '<td width="60" class="center">';
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.$conf->global->GENBARCODE_LOCATION.'">';
if (! empty($conf->global->GENBARCODE_LOCATION) && ! @file_exists($conf->global->GENBARCODE_LOCATION))
{
@ -369,8 +369,8 @@ if ($conf->produit->enabled)
print '<td width="140">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
print '<td align="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
print '<td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
$dirbarcodenum=array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
@ -406,17 +406,17 @@ if ($conf->produit->enabled)
if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file")
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&amp;value='.$file.'">';
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproductoff&amp;value='.$file.'">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&amp;value='.$file.'">';
print '<td class="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setbarcodeproducton&amp;value='.$file.'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '<td align="center">';
print '<td class="center">';
$s=$modBarCode->getToolTip($langs, null, -1);
print $form->textwithpicto('', $s, 1);
print '</td>';

View File

@ -337,7 +337,7 @@ print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td>'.$langs->trans("SourceFile").'</td>';
print '<td width="160" align="center">'.$langs->trans("ActivateOn").'</td>';
print '<td width="160" class="center">'.$langs->trans("ActivateOn").'</td>';
print "</tr>\n";
foreach($boxtoadd as $box)
@ -398,9 +398,9 @@ print '<table class="tagtable liste">'."\n";
print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td align="center" width="160">'.$langs->trans("ActiveOn").'</td>';
print '<td align="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
print '<td align="center" width="80">'.$langs->trans("Disable").'</td>';
print '<td class="center" width="160">'.$langs->trans("ActiveOn").'</td>';
print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
print '<td class="center" width="80">'.$langs->trans("Disable").'</td>';
print '</tr>'."\n";
$box_order=1;
@ -429,15 +429,15 @@ foreach($boxactivated as $key => $box)
}
else print ($box->note?$box->note:'&nbsp;');
print '</td>';
print '<td align="center">' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . '</td>';
print '<td class="center">' . (empty($pos_name[$box->position])?'':$langs->trans($pos_name[$box->position])) . '</td>';
$hasnext=($key < (count($boxactivated)-1));
$hasprevious=($key != 0);
print '<td align="center">'.($key+1).'</td>';
print '<td align="center">';
print '<td class="center">'.($key+1).'</td>';
print '<td class="center">';
print ($hasnext?'<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key+1]->rowid.'">'.img_down().'</a>&nbsp;':'');
print ($hasprevious?'<a href="boxes.php?action=switch&amp;switchfrom='.$box->rowid.'&amp;switchto='.$boxactivated[$key-1]->rowid.'">'.img_up().'</a>':'');
print '</td>';
print '<td align="center">';
print '<td class="center">';
print '<a href="boxes.php?rowid='.$box->rowid.'&amp;action=delete">'.img_delete().'</a>';
print '</td>';

View File

@ -116,8 +116,8 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n";
clearstatcache();
@ -177,7 +177,7 @@ foreach ($dirmodels as $reldir)
else print $tmp;
print '</td>'."\n";
print '<td align="center">';
print '<td class="center">';
if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file)
{
print img_picto($langs->trans("Activated"), 'switch_on');
@ -206,7 +206,7 @@ foreach ($dirmodels as $reldir)
}
}
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
if ($conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) // If module is the one used, we show existing errors
@ -244,7 +244,7 @@ print '<input type="hidden" name="action" value="set_BANK_CHEQUERECEIPT_FREE_TEX
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>';
print '<td align="center" width="60">&nbsp;</td>';
print '<td class="center" width="60">&nbsp;</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -267,8 +267,8 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '</tr>'."\n";
clearstatcache();
@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir)
else print $tmp;
print '</td>'."\n";
print '<td align="center">';
print '<td class="center">';
if ($conf->global->COMMANDE_ADDON == $file)
{
print img_picto($langs->trans("Activated"), 'switch_on');
@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
}
}
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
@ -393,10 +393,10 @@ print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td align="center" width="38">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="38">'.$langs->trans("Preview").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
print "</tr>\n";
clearstatcache();
@ -449,7 +449,7 @@ foreach ($dirmodels as $reldir)
// Active
if (in_array($name, $def))
{
print '<td align="center">'."\n";
print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
@ -457,13 +457,13 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<td align="center">'."\n";
print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>";
}
// Default
print '<td align="center">';
print '<td class="center">';
if ($conf->global->COMMANDE_ADDON_PDF == $name)
{
print img_picto($langs->trans("Default"), 'on');
@ -491,12 +491,12 @@ foreach ($dirmodels as $reldir)
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
// Preview
print '<td align="center">';
print '<td class="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
@ -528,7 +528,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";
@ -580,7 +580,7 @@ Whet is definition of "shippable" according to all different STOCK_CALCULATE_...
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
print '<td>&nbsp</td>';
print '<td align="center">';
print '<td class="center">';
if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=0">';
print img_picto($langs->trans("Activated"),'switch_on');
@ -598,7 +598,7 @@ if ($conf->banque->enabled)
{
print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp</td><td align="center">';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp</td><td class="center">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
@ -620,7 +620,7 @@ else
{
print '<tr class="oddeven"><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
// Ask for warehouse during order
@ -628,7 +628,7 @@ if ($conf->stock->enabled)
{
print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp</td><td align="center">';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp</td><td class="center">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
@ -650,7 +650,7 @@ else
{
print '<tr class="oddeven"><td>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td class="center">'.$langs->trans('NotAvailable').'</td></tr>';
}
*/
@ -666,7 +666,7 @@ print load_fiche_titre($langs->trans("Notifications"), '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60"></td>';
print '<td class="center" width="60"></td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";

View File

@ -190,7 +190,7 @@ print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Comment").'</td>';
if (! empty($conf->multicompany->enabled) && !$user->entity) print '<td>'.$langs->trans("Entity").'</td>';
print '<td align="center">'.$langs->trans("Action").'</td>';
print '<td class="center">'.$langs->trans("Action").'</td>';
print "</tr>\n";
@ -210,11 +210,11 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
print '<td>';
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
print '</td>';
print '<td align="center">';
print '<td class="center">';
}
else
{
print '<td align="center">';
print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
}
print '<input type="submit" class="button" value="'.$langs->trans("Add").'" name="add">';
@ -273,11 +273,11 @@ if ($result)
print '<td>';
print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
print '</td>';
print '<td align="center">';
print '<td class="center">';
}
else
{
print '<td align="center">';
print '<td class="center">';
print '<input type="hidden" name="const['.$i.'][entity]" value="'.$obj->entity.'">';
}

View File

@ -204,8 +204,8 @@ print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
print "</tr>\n";
clearstatcache();
@ -249,7 +249,7 @@ foreach ($dirmodels as $reldir)
else print $tmp;
print '</td>'."\n";
print '<td align="center">';
print '<td class="center">';
if ($conf->global->CONTRACT_ADDON == "$file")
{
print img_picto($langs->trans("Activated"), 'switch_on');
@ -280,7 +280,7 @@ foreach ($dirmodels as $reldir)
}
}
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
@ -329,10 +329,10 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
print "</tr>\n";
clearstatcache();
@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir)
// Active
if (in_array($name, $def))
{
print '<td align="center">'."\n";
print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
@ -392,13 +392,13 @@ foreach ($dirmodels as $reldir)
}
else
{
print '<td align="center">'."\n";
print '<td class="center">'."\n";
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>";
}
// Defaut
print '<td align="center">';
print '<td class="center">';
if ($conf->global->CONTRACT_ADDON_PDF == $name)
{
print img_picto($langs->trans("Default"), 'on');
@ -424,12 +424,12 @@ foreach ($dirmodels as $reldir)
$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
print '<td align="center">';
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
// Preview
print '<td align="center">';
print '<td class="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
@ -466,7 +466,7 @@ print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td class="center" width="60">'.$langs->trans("Value").'</td>';
print "</tr>\n";
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);

View File

@ -322,11 +322,11 @@ if (! empty($conf->multicompany->enabled) && !$user->entity)
}
else
{
print '<td align="center">';
print '<td class="center">';
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
print '</td>';
}
print '<td align="center">';
print '<td class="center">';
$disabled='';
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $disabled=' disabled="disabled"';
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
@ -385,7 +385,7 @@ if ($result)
print '<td></td>';
// Actions
print '<td align="center">';
print '<td class="center">';
if ($action != 'edit' || GETPOST('rowid') != $obj->rowid)
{
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.$mode.'&action=edit'.((empty($user->entity) && $debug)?'&debug=1':'').'">'.img_edit().'</a>';

View File

@ -1180,7 +1180,7 @@ if ($id)
}
if ($id == 4) print '<td></td>';
print '<td colspan="3" align="center">';
print '<td colspan="3" class="center">';
if ($action != 'edit')
{
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';

View File

@ -77,8 +77,8 @@ print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '<td class="center" width="20">&nbsp;</td>';
print '<td class="center" width="100">'.$langs->trans("Value").'</td>'."\n";
print '</tr>';
$form = new Form($db);
@ -87,9 +87,9 @@ $form = new Form($db);
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ECMAutoTree").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td class="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">';
print '<td class="center" width="100">';
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');

View File

@ -412,7 +412,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n";
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>'."\n";
@ -450,10 +450,10 @@ while ($i < min($num, $limit))
$cssforfield='';
if (in_array($val['type'], array('date','datetime','timestamp'))) $cssforfield.=($cssforfield?' ':'').'center';
elseif ($key == 'status') $cssforfield.=($cssforfield?' ':'').'center';
if (in_array($val['type'], array('timestamp'))) $cssforfield.=($cssforfield?' ':'').'nowrap';
elseif ($key == 'ref') $cssforfield.=($cssforfield?' ':'').'nowrap';
if (! empty($arrayfields['t.'.$key]['checked']))
{
print '<td';
@ -480,7 +480,7 @@ while ($i < min($num, $limit))
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="nowrap" align="center">';
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$action = GETPOST('action', 'alpha');
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset ($_SESSION['serObjFacturation']);
unset($_SESSION['serObjFacturation']);
switch($action)

View File

@ -359,7 +359,7 @@ switch ($action)
// End of case: valide_facture
}
unset ($_SESSION['serObjFacturation']);
unset($_SESSION['serObjFacturation']);
$_SESSION['serObjFacturation'] = serialize($obj_facturation);

View File

@ -220,7 +220,7 @@ class Categories extends DolibarrApi
if ($this->category->update(DolibarrApiAccess::$user) > 0)
{
return $this->get ($id);
return $this->get($id);
}
else
{

View File

@ -1472,8 +1472,7 @@ class Categorie extends CommonObject
// We want to reverse lookup
$map_type = array_flip($this->MAP_ID);
$type = $map_type[$type];
dol_syslog( get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead",
LOG_WARNING );
dol_syslog(get_class($this) . "::rechercher(): numeric types are deprecated, please use string instead", LOG_WARNING);
}
// Generation requete recherche

View File

@ -423,12 +423,15 @@ class AdvanceTargetingMailing extends CommonObject
$this->db->begin();
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $resql) {
$error++;
$this->errors[]="Error ".$this->db->lasterror();
}
if (! $error)
{
if (! $notrigger)
{
//if (! $error)
//{
// if (! $notrigger)
// {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger.
@ -438,8 +441,8 @@ class AdvanceTargetingMailing extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers
}
}
// }
//}
// Commit or rollback
if ($error)
@ -790,15 +793,15 @@ class AdvanceTargetingMailing extends CommonObject
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
}
}elseif ($extrafields->attribute_type[$key] == 'boolean') {
} elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key.'_cnct']!=''){
if ($arrayquery['options_'.$key.'_cnct']==0) {
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
}else {
} else {
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct'].")";
}
}
}else{
} else {
if (is_array($arrayquery['options_'.$key.'_cnct'])) {
$sqlwhere[]= " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key.'_cnct'])."'))";
} elseif (!empty($arrayquery['options_'.$key.'_cnct'])) {
@ -965,12 +968,12 @@ class AdvanceTargetingMailing extends CommonObject
}
if (count($return_sql_like)>0) {
$return_sql_criteria .= '(' . implode (' OR ', $return_sql_like) .')';
$return_sql_criteria .= '(' . implode(' OR ', $return_sql_like) .')';
}
if (count($return_sql_not_like)>0) {
$return_sql_criteria .= ' AND (' . implode (' AND ', $return_sql_not_like).')';
$return_sql_criteria .= ' AND (' . implode(' AND ', $return_sql_not_like).')';
}
}else {
} else {
$return_sql_criteria .= $column_to_test . ' LIKE \''.$this->db->escape($criteria).'\'';
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
/* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
@ -43,10 +44,10 @@ class FormAdvTargetEmailing extends Form
*/
function __construct($db)
{
global $langs;
global $langs;
$this->db = $db;
}
$this->db = $db;
}
/**
* Affiche un champs select contenant une liste
@ -64,7 +65,7 @@ class FormAdvTargetEmailing extends Form
$sql .= " FROM " . MAIN_DB_PREFIX . "c_prospectlevel";
$sql .= " WHERE active > 0";
$sql .= " ORDER BY sortorder";
dol_syslog (get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG);
dol_syslog(get_class($this) . '::multiselectProspectionStatus sql=' . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
@ -83,7 +84,7 @@ class FormAdvTargetEmailing extends Form
dol_print_error($this->db);
}
return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
}
}
/**
* Return combo list of activated countries, into language of user
@ -120,10 +121,10 @@ class FormAdvTargetEmailing extends Form
$foundselected = false;
while ($i < $num) {
$obj = $this->db->fetch_object ($resql);
$obj = $this->db->fetch_object($resql);
$countryArray [$i] ['rowid'] = $obj->rowid;
$countryArray [$i] ['code_iso'] = $obj->code_iso;
$countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv ("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
$countryArray [$i] ['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country" . $obj->code_iso) != "Country" . $obj->code_iso ? $langs->transnoentitiesnoconv("Country" . $obj->code_iso) : ($obj->label != '-' ? $obj->label : ''));
$label[$i] = $countryArray[$i]['label'];
$i ++;
}
@ -143,7 +144,7 @@ class FormAdvTargetEmailing extends Form
}
return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
}
}
/**
* Return select list for categories (to use in form search selectors)
@ -166,26 +167,26 @@ class FormAdvTargetEmailing extends Form
$sql_usr .= " WHERE u2.entity IN (0," . $conf->entity . ")";
$sql_usr .= " AND u2.rowid = sc.fk_user ";
if (! empty ($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX))
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX))
$sql_usr .= " AND u2.statut<>0 ";
$sql_usr .= " ORDER BY name ASC";
// print $sql_usr;exit;
$resql_usr = $this->db->query ($sql_usr);
$resql_usr = $this->db->query($sql_usr);
if ($resql_usr) {
while ( $obj_usr = $this->db->fetch_object ($resql_usr) ) {
while ( $obj_usr = $this->db->fetch_object($resql_usr) ) {
$label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')';
$options_array [$obj_usr->rowid] = $label;
}
$this->db->free ($resql_usr);
$this->db->free($resql_usr);
} else {
dol_print_error ($this->db);
dol_print_error($this->db);
}
return $this->advMultiselectarray ($htmlname, $options_array, $selected_array);
}
return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
}
/**
* Return select list for categories (to use in form search selectors)
@ -210,7 +211,7 @@ class FormAdvTargetEmailing extends Form
}
asort($options_array);
return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
}
}
/**
* Return multiselect list of entities for extrafeild type sellist
@ -227,8 +228,8 @@ class FormAdvTargetEmailing extends Form
if (is_array($sqlqueryparam))
{
$param_list = array_keys ($sqlqueryparam);
$InfoFieldList = explode (":", $param_list [0]);
$param_list = array_keys($sqlqueryparam);
$InfoFieldList = explode(":", $param_list [0]);
// 0 1 : tableName
// 1 2 : label field name Nom du champ contenant le libelle
@ -237,8 +238,8 @@ class FormAdvTargetEmailing extends Form
$keyList = 'rowid';
if (count ($InfoFieldList) >= 3) {
if (strpos ($InfoFieldList [3], 'extra.') !== false) {
if (count($InfoFieldList) >= 3) {
if (strpos($InfoFieldList [3], 'extra.') !== false) {
$keyList = 'main.' . $InfoFieldList [2] . ' as rowid';
} else {
$keyList = $InfoFieldList [2] . ' as rowid';
@ -247,10 +248,10 @@ class FormAdvTargetEmailing extends Form
$sql = 'SELECT ' . $keyList . ', ' . $InfoFieldList [1];
$sql .= ' FROM ' . MAIN_DB_PREFIX . $InfoFieldList [0];
if (! empty ($InfoFieldList [3])) {
if (! empty($InfoFieldList [3])) {
// We have to join on extrafield table
if (strpos ($InfoFieldList [3], 'extra') !== false) {
if (strpos($InfoFieldList [3], 'extra') !== false) {
$sql .= ' as main, ' . MAIN_DB_PREFIX . $InfoFieldList [0] . '_extrafields as extra';
$sql .= ' WHERE extra.fk_object=main.' . $InfoFieldList [2] . ' AND ' . $InfoFieldList [3];
} else {
@ -270,13 +271,13 @@ class FormAdvTargetEmailing extends Form
$i = 0;
if ($num) {
while ( $i < $num ) {
$obj = $this->db->fetch_object ($resql);
$labeltoshow = dol_trunc ($obj->$InfoFieldList [1], 90);
$obj = $this->db->fetch_object($resql);
$labeltoshow = dol_trunc($obj->$InfoFieldList [1], 90);
$options_array[$obj->rowid]=$labeltoshow;
$i ++;
}
}
$this->db->free ($resql);
$this->db->free($resql);
}
}
@ -328,7 +329,7 @@ class FormAdvTargetEmailing extends Form
dol_print_error($this->db);
}
return $this->advMultiselectarray ($htmlname, $options_array, $selected_array);
return $this->advMultiselectarray($htmlname, $options_array, $selected_array);
}
/**
@ -347,7 +348,7 @@ class FormAdvTargetEmailing extends Form
$form=new Form($this->db);
$return = $form->multiselectarray($htmlname, $options_array, $selected_array, 0, 0, '', 0, 295);
return $return;
}
}
/**
* Return combo list with customer categories
@ -438,19 +439,19 @@ class FormAdvTargetEmailing extends Form
$sql .= " WHERE type_element='$type_element'";
$sql .= " ORDER BY c.name";
dol_syslog (get_class ($this) . "::".__METHOD__, LOG_DEBUG);
$resql = $this->db->query ($sql);
dol_syslog(get_class($this) . "::".__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$out .= '<select id="' . $htmlname . '" class="flat" name="' . $htmlname . '">';
if ($showempty)
$out .= '<option value=""></option>';
$num = $this->db->num_rows ($resql);
$num = $this->db->num_rows($resql);
$i = 0;
if ($num) {
while ( $i < $num ) {
$obj = $this->db->fetch_object ($resql);
$obj = $this->db->fetch_object($resql);
$label = $obj->name;
if (empty($label)) {
$label=$obj->fk_element;
@ -466,9 +467,9 @@ class FormAdvTargetEmailing extends Form
}
$out .= '</select>';
} else {
dol_print_error ($this->db);
dol_print_error($this->db);
}
$this->db->free ($resql);
$this->db->free($resql);
return $out;
}
}
}

View File

@ -106,7 +106,7 @@ if ($action != 'edit')
print '<tr class="oddeven">';
print '<td>&nbsp;</td><td><input name="label" type="text" size="45"></td>';
print '<td align="center"><input type="submit" name="add" class="button" value="'.$langs->trans("Add").'"></td>';
print '<td class="center"><input type="submit" name="add" class="button" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
}

View File

@ -832,12 +832,12 @@ if ($mode == 'standard')
$link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
print '<tr><td class="right">'.$link.'</td></tr>';
print '<tr><td align="center">';
print '<tr><td class="center">';
$file = "movement".$account."-".$year.$month.".png";
print $show4;
print '</td></tr>';
print '<tr><td align="center">';
print '<tr><td class="center">';
print $show1;
print '</td></tr>';
@ -846,18 +846,18 @@ if ($mode == 'standard')
$link="<a href='".$_SERVER["PHP_SELF"]."?account=".$account.($_GET["option"]!='all'?'':'&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
print '<tr><td class="right">'.$link.'</td></tr>';
print '<tr><td align="center">';
print '<tr><td class="center">';
print $show5;
print '</td></tr>';
print '<tr><td align="center">';
print '<tr><td class="center">';
print $show2;
print '</td></tr>';
}
if ($mode == 'showalltime')
{
print '<tr><td align="center">';
print '<tr><td class="center">';
print $show3;
print '</td></tr>';
}

View File

@ -369,7 +369,7 @@ if (! empty($arrayfields['balance']['checked']))
print '<td class="liste_titre"></td>';
}
// Action column
print '<td class="liste_titre" align="middle">';
print '<td class="liste_titre valignmiddle">';
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
print $searchpicto;
print '</td>';
@ -383,19 +383,19 @@ if (! empty($arrayfields['accountype']['checked'])) print_liste_field_titr
if (! empty($arrayfields['b.number']['checked'])) print_liste_field_titre($arrayfields['b.number']['label'], $_SERVER["PHP_SELF"], 'b.number', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['b.account_number']['checked'])) print_liste_field_titre($arrayfields['b.account_number']['label'], $_SERVER["PHP_SELF"], 'b.account_number', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['b.fk_accountancy_journal']['checked'])) print_liste_field_titre($arrayfields['b.fk_accountancy_journal']['label'], $_SERVER["PHP_SELF"], 'b.fk_accountancy_journal', '', $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['b.currency_code']['checked'])) print_liste_field_titre($arrayfields['b.currency_code']['label'], $_SERVER["PHP_SELF"], 'b.currency_code', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['b.currency_code']['checked'])) print_liste_field_titre($arrayfields['b.currency_code']['label'], $_SERVER["PHP_SELF"], 'b.currency_code', '', $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['toreconcile']['checked'])) print_liste_field_titre($arrayfields['toreconcile']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['b.datec']['checked'])) print_liste_field_titre($arrayfields['b.datec']['label'], $_SERVER["PHP_SELF"], "b.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['b.tms']['checked'])) print_liste_field_titre($arrayfields['b.tms']['label'], $_SERVER["PHP_SELF"], "b.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'], $_SERVER["PHP_SELF"], 'b.clos', '', $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
if (! empty($arrayfields['b.datec']['checked'])) print_liste_field_titre($arrayfields['b.datec']['label'], $_SERVER["PHP_SELF"], "b.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['b.tms']['checked'])) print_liste_field_titre($arrayfields['b.tms']['label'], $_SERVER["PHP_SELF"], "b.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['b.clos']['checked'])) print_liste_field_titre($arrayfields['b.clos']['label'], $_SERVER["PHP_SELF"], 'b.clos', '', $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['balance']['checked'])) print_liste_field_titre($arrayfields['balance']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n";
@ -492,7 +492,7 @@ foreach ($accounts as $key=>$type)
// Currency
if (! empty($arrayfields['b.currency_code']['checked']))
{
print '<td align="center">';
print '<td class="center">';
print $obj->currency_code;
print '</td>';
if (! $i) $totalarray['nbfield']++;
@ -501,7 +501,7 @@ foreach ($accounts as $key=>$type)
// Transactions to reconcile
if (! empty($arrayfields['toreconcile']['checked']))
{
print '<td align="center">';
print '<td class="center">';
if ($obj->rappro)
{
$result=$obj->load_board($user, $obj->id);
@ -526,7 +526,7 @@ foreach ($accounts as $key=>$type)
// Date creation
if (! empty($arrayfields['b.datec']['checked']))
{
print '<td align="center">';
print '<td class="center">';
print dol_print_date($obj->date_creation, 'dayhour');
print '</td>';
if (! $i) $totalarray['nbfield']++;
@ -534,7 +534,7 @@ foreach ($accounts as $key=>$type)
// Date modification
if (! empty($arrayfields['b.tms']['checked']))
{
print '<td align="center">';
print '<td class="center">';
print dol_print_date($obj->date_update, 'dayhour');
print '</td>';
if (! $i) $totalarray['nbfield']++;
@ -543,7 +543,7 @@ foreach ($accounts as $key=>$type)
// Status
if (! empty($arrayfields['b.clos']['checked']))
{
print '<td align="center">'.$obj->getLibStatut(5).'</td>';
print '<td class="center">'.$obj->getLibStatut(5).'</td>';
if (! $i) $totalarray['nbfield']++;
}
@ -559,7 +559,7 @@ foreach ($accounts as $key=>$type)
}
// Action column
print '<td class="nowrap" align="center">';
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected=0;

View File

@ -496,7 +496,7 @@ if (empty($numref))
}
print '<td class="right">'.price(($balancestart[$objp->numr]+$content[$objp->numr]), '', $langs, 1, -1, -1, $conf->currency).'</td>';
print '<td align="center">';
print '<td class="center">';
if ($user->rights->banque->consolidate && $action != 'editbankreceipt') {
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$object->id.'&action=editbankreceipt&brref='.$objp->numr.'">'.img_edit().'</a>';
}
@ -540,10 +540,10 @@ else
print '<input type="hidden" name="action" value="add">';
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td align="center">'.$langs->trans("DateOperationShort").'</td>';
print '<td align="center">'.$langs->trans("DateValueShort").'</td>';
print '<td class="center">'.$langs->trans("DateOperationShort").'</td>';
print '<td class="center">'.$langs->trans("DateValueShort").'</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="right" width="60">'.$langs->trans("Debit").'</td>';
@ -589,10 +589,10 @@ else
print '<tr class="oddeven">';
// Date operation
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->do), "day").'</td>';
print '<td class="nowrap center">'.dol_print_date($db->jdate($objp->do), "day").'</td>';
// Date de valeur
print '<td align="center" valign="center" class="nowrap">';
print '<td valign="center" class="center nowrap">';
print dol_print_date($db->jdate($objp->dv), "day") .' ';
print '<a href="releve.php?action=dvprev&amp;num='.$numref.'&amp;account='.$object->id.'&amp;dvid='.$objp->rowid.'">';
print img_edit_remove() . "</a> ";
@ -778,13 +778,13 @@ else
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<td align="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?account='.$object->id.'&num='.$numref).'">';
print '<td class="center"><a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&account='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?account='.$object->id.'&num='.$numref).'">';
print img_edit();
print "</a></td>";
}
else
{
print "<td align=\"center\">&nbsp;</td>";
print "<td class=\"center\">&nbsp;</td>";
}
print "</tr>";
$i++;
@ -793,11 +793,11 @@ else
}
// Line Total
print "\n".'<tr class="liste_total"><td class="right" colspan="4">'.$langs->trans("Total")." :</td><td align=\"right\">".price($totald)."</td><td align=\"right\">".price($totalc)."</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
print "\n".'<tr class="liste_total"><td class="right" colspan="4">'.$langs->trans("Total")." :</td><td class=\"right\">".price($totald)."</td><td class=\"right\">".price($totalc)."</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
// Line Balance
print "\n<tr>";
print "<td align=\"right\" colspan=\"3\">&nbsp;</td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>";
print "<td class=\"right\" colspan=\"3\">&nbsp;</td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>";
print '<td class="right"><b>'.price(price2num($total, 'MT'))."</b></td><td>&nbsp;</td>";
print "</tr>\n";
print "</table>";

View File

@ -180,7 +180,7 @@ if ($result)
print '<tr class="liste_titre">';
// Ref
print '<td class="liste_titre" align="left">';
print '<td class="liste_titre left">';
print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
@ -195,7 +195,7 @@ if ($result)
print '</td>';
// Type
print '<td class="liste_titre" align="left">';
print '<td class="liste_titre left">';
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16);
print '</td>';
@ -233,13 +233,13 @@ if ($result)
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "v.rowid", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "v.label", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "v.label", "", $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "v.datep", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'left ');
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, 'class="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, 'class="right"', $sortfield, $sortorder);
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "v.accountancy_code", "", $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre("Debit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Credit", $_SERVER["PHP_SELF"], "v.amount", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print "</tr>\n";
@ -300,7 +300,7 @@ if ($result)
}
// Debit
print "<td align=\"right\">";
print "<td class=\"right\">";
if ($obj->sens == 0)
{
print price($obj->amount);
@ -309,7 +309,7 @@ if ($result)
print "</td>";
// Credit
print "<td align=\"right\">";
print "<td class=\"right\">";
if ($obj->sens == 1)
{
print price($obj->amount);

View File

@ -940,7 +940,6 @@ class Invoices extends DolibarrApi
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
@ -965,6 +964,9 @@ class Invoices extends DolibarrApi
// Loop on each vat rate
$i=0;
$amount_ht = array();
$amount_tva = array();
$amount_ttc = array();
foreach($this->invoice->lines as $line)
{
$amount_ht[$line->tva_tx]+=$line->total_ht;

View File

@ -126,11 +126,11 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
</tr>
<tr>
<td align="center" colspan="4"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></td>
<td class="center" colspan="4"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></td>
</tr>
</table><br>
</form>
<!-- END PHP TEMPLATE -->
<!-- END PHP TEMPLATE -->

View File

@ -149,7 +149,7 @@ echo $this->control->tpl['ajax_selectcountry'];
</tr>
<tr>
<td colspan="4" align="center">
<td colspan="4" class="center">
<input type="submit" class="button" name="save" value="<?php echo $langs->trans("Save"); ?>">&nbsp;
<input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>">
</td>
@ -159,4 +159,4 @@ echo $this->control->tpl['ajax_selectcountry'];
</form>
<!-- END PHP TEMPLATE -->
<!-- END PHP TEMPLATE -->

View File

@ -588,7 +588,7 @@ else
$rowspan=3;
if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
print '<td valign="middle" align="center" rowspan="'.$rowspan.'">';
print '<td class="valignmiddle center" rowspan="'.$rowspan.'">';
print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>';
print '</td>';
}

View File

@ -379,16 +379,16 @@ if ($sql_select)
print $formother->select_month($month?$month:-1, 'month', 1, 0, 'valignmiddle');
$formother->select_year($year?$year:-1, 'year', 1, 20, 1);
print '</td>';
print '<td class="liste_titre" align="center">';
print '<td class="liste_titre center">';
print '</td>';
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">';
print '</td>';
print '<td class="liste_titre" align="center">'; // TODO: Add filters !
print '<td class="liste_titre center">'; // TODO: Add filters !
print '</td>';
print '<td class="liste_titre" align="center">';
print '<td class="liste_titre center">';
print '</td>';
print '<td class="liste_titre" align="center">';
print '<td class="liste_titre center">';
print '</td>';
print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
@ -399,8 +399,8 @@ if ($sql_select)
// Titles with sort buttons
print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder);
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('ContactType', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
@ -427,10 +427,10 @@ if ($sql_select)
print '<td class="nobordernopadding nowrap" width="100">';
print $documentstatic->getNomUrl(1);
print '</td>';
print '<td align="center" width="80">'.dol_print_date($db->jdate($objp->dateprint), 'day').'</td>';
print '<td class="center" width="80">'.dol_print_date($db->jdate($objp->dateprint), 'day').'</td>';
// Status
print '<td align="center">';
print '<td class="center">';
if ($type_element == 'contract')
{
print $documentstaticline->getLibStatut(2);
@ -616,17 +616,15 @@ if ($sql_select)
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
}
$db->free($resql);
}
elseif (empty($type_element) || $type_element == -1)
{
} elseif (empty($type_element) || $type_element == -1) {
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print '<table class="liste" width="100%">'."\n";
// Titles with sort buttons
print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'align="center" width="150"', $sortfield, $sortorder);
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_status', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
print "</tr>\n";
@ -634,8 +632,7 @@ elseif (empty($type_element) || $type_element == -1)
print '<tr class="oddeven"><td class="opacitymedium" colspan="5">'.$langs->trans("SelectElementAndClick", $langs->transnoentitiesnoconv("Search")).'</td></tr>';
print "</table>";
}
else {
} else {
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, '', '');
print '<table class="liste" width="100%">'."\n";

View File

@ -688,7 +688,9 @@ if (! empty($arrayfields['p.zip']['checked'])) print_liste_field
if (! empty($arrayfields['p.town']['checked'])) print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder);
//if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
//if (! empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['country.code_iso']['checked'])) {
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (! empty($arrayfields['p.phone']['checked'])) print_liste_field_titre($arrayfields['p.phone']['label'], $_SERVER["PHP_SELF"], "p.phone", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_titre($arrayfields['p.phone_perso']['label'], $_SERVER["PHP_SELF"], "p.phone_perso", $begin, $param, '', $sortfield, $sortorder);
if (! empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
@ -702,14 +704,27 @@ if (! empty($arrayfields['p.priv']['checked'])) print_liste_field
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
);
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
if (! empty($arrayfields['p.statut']['checked'])) print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center ');
if (! empty($arrayfields['p.import_key']['checked'])) print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
if (! empty($arrayfields['p.datec']['checked'])) {
print_liste_field_titre($arrayfields['p.datec']['label'], $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
}
if (! empty($arrayfields['p.tms']['checked'])) {
print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
}
if (! empty($arrayfields['p.statut']['checked'])) {
print_liste_field_titre($arrayfields['p.statut']['label'], $_SERVER["PHP_SELF"], "p.statut", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (! empty($arrayfields['p.import_key']['checked'])) {
print_liste_field_titre($arrayfields['p.import_key']['label'], $_SERVER["PHP_SELF"], "p.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n";

View File

@ -157,13 +157,13 @@ if ($action == 'edit')
print '</td>';
// Photo
print '<td align="center" class="hideonsmartphone" valign="middle" rowspan="6">';
print '<td class="center hideonsmartphone valignmiddle" rowspan="6">';
print $form->showphoto('contact', $object)."\n";
if ($object->photo) print "<br>\n";
print '<table class="nobordernopadding">';
if ($object->photo) print '<tr><td align="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
if ($object->photo) print '<tr><td class="center"><input type="checkbox" class="flat photodelete" name="deletephoto" id="photodelete"> '.$langs->trans("Delete").'<br><br></td></tr>';
print '<tr><td>'.$langs->trans("PhotoFile").'</td></tr>';
print '<tr><td><input type="file" class="flat" name="photo" id="photoinput"></td></tr>';
print '</table>';

View File

@ -28,18 +28,18 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/
class box_graph_orders_supplier_permonth extends ModeleBoxes
{
var $boxcode="orderssupplierpermonth";
var $boximg="object_order";
var $boxlabel="BoxSuppliersOrdersPerMonth";
var $depends = array("fournisseur");
public $boxcode="orderssupplierpermonth";
public $boximg="object_order";
public $boxlabel="BoxSuppliersOrdersPerMonth";
public $depends = array("fournisseur");
/**
/**
* @var DoliDB Database handler.
*/
public $db;
var $info_box_head = array();
var $info_box_contents = array();
public $info_box_head = array();
public $info_box_contents = array();
/**

View File

@ -570,7 +570,7 @@ abstract class CommonDocGenerator
'line_multicurrency_total_ttc_locale' => price($line->multicurrency_total_ttc, 0, $outputlangs),
);
// Units
// Units
if ($conf->global->PRODUCT_USE_UNITS)
{
$resarray['line_unit']=$outputlangs->trans($line->getLabelOfUnit('long'));
@ -882,7 +882,7 @@ abstract class CommonDocGenerator
// Sorting
uasort ($this->cols, array( $this, 'columnSort' ));
uasort($this->cols, array($this, 'columnSort'));
// Positionning
$curX = $this->page_largeur-$this->marge_droite; // start from right
@ -945,10 +945,10 @@ abstract class CommonDocGenerator
}
/**
* get column content width from column key
* get column content width from column key
*
* @param string $colKey the column key
* @return float width in mm
* @param string $colKey the column key
* @return float width in mm
*/
function getColumnContentWidth($colKey)
{
@ -1025,13 +1025,13 @@ abstract class CommonDocGenerator
/**
* print standard column content
* print standard column content
*
* @param PDF $pdf pdf object
* @param float $curY curent Y position
* @param string $colKey the column key
* @param string $columnText column text
* @return int new rank on success and -1 on error
* @param PDF $pdf pdf object
* @param float $curY curent Y position
* @param string $colKey the column key
* @param string $columnText column text
* @return int new rank on success and -1 on error
*/
function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{

View File

@ -936,7 +936,7 @@ class DolGraph
$tag=dol_escape_htmltag(dol_string_unaccent(dol_string_nospecial(basename($file), '_', array('-','.'))));
$this->stringtoshow ='<!-- Build using '.$this->_library.' -->'."\n";
if (! empty($this->title)) $this->stringtoshow.='<div align="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
if (! empty($this->title)) $this->stringtoshow.='<div class="center" class="dolgraphtitle'.(empty($this->cssprefix)?'':' dolgraphtitle'.$this->cssprefix).'">'.$this->title.'</div>';
if (! empty($this->shownographyet))
{
$this->stringtoshow.='<div style="width:'.$this->width.'px;height:'.$this->height.'px;" class="nographyet"></div>';

View File

@ -9,7 +9,7 @@
* Copyright (C) 2015 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.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
@ -42,84 +42,138 @@ class ExtraFields
*/
public $db;
// type of element (for what object is the extrafield)
// @deprecated
var $attribute_elementtype;
// Array with type of the extra field
// @deprecated
var $attribute_type;
// Array with label of extra field
// @deprecated
var $attribute_label;
// Array with size of extra field
// @deprecated
var $attribute_size;
// array with list of possible values for some types of extra fields
// @deprecated
var $attribute_choice;
// Array to store compute formula for computed fields
// @deprecated
var $attribute_computed;
// Array to store default value
// @deprecated
var $attribute_default;
// Array to store if attribute is unique or not
// @deprecated
var $attribute_unique;
// Array to store if attribute is required or not
// @deprecated
var $attribute_required;
// Array to store parameters of attribute (used in select type)
// @deprecated
var $attribute_param;
// Array to store position of attribute
// @deprecated
var $attribute_pos;
// Array to store if attribute is editable regardless of the document status
// @deprecated
var $attribute_alwayseditable;
// Array to store permission to check
// @deprecated
var $attribute_perms;
// Array to store language file to translate label of values
// @deprecated
var $attribute_langfile;
// Array to store if field is visible by default on list
// @deprecated
var $attribute_list;
/**
* @var string type of element (for what object is the extrafield)
* @deprecated
*/
public $attribute_elementtype;
// New array to store extrafields definition
var $attributes;
/**
* @var array Array with type of the extra field
* @deprecated
*/
public $attribute_type;
/**
* @var array Array with label of extra field
* @deprecated
*/
public $attribute_label;
/**
* @var array Array with size of extra field
* @deprecated
*/
public $attribute_size;
/**
* @var array Array with list of possible values for some types of extra fields
* @deprecated
*/
public $attribute_choice;
/**
* @var array Array to store compute formula for computed fields
* @deprecated
*/
public $attribute_computed;
/**
* @var array Array to store default value
* @deprecated
*/
public $attribute_default;
/**
* @var array Array to store if attribute is unique or not
* @deprecated
*/
public $attribute_unique;
/**
* @var array Array to store if attribute is required or not
* @deprecated
*/
public $attribute_required;
/**
* @var array Array to store parameters of attribute (used in select type)
* @deprecated
*/
public $attribute_param;
/**
* @var array Array to store position of attribute
* @deprecated
*/
public $attribute_pos;
/**
* @var array Array to store if attribute is editable regardless of the document status
* @deprecated
*/
public $attribute_alwayseditable;
/**
* @var array Array to store permission to check
* @deprecated
*/
public $attribute_perms;
/**
* @var array Array to store language file to translate label of values
* @deprecated
*/
public $attribute_langfile;
/**
* @var array Array to store if field is visible by default on list
* @deprecated
*/
public $attribute_list;
/**
* @var array New array to store extrafields definition
*/
public $attributes;
/**
* @var string Error code (or message)
*/
public $error='';
var $errno;
/**
* @var string[] Array of Error code (or message)
*/
public $errors = array();
/**
* @var integer DB Error number
*/
public $errno;
public static $type2label=array(
'varchar'=>'String',
'text'=>'TextLong',
'html'=>'HtmlText',
'int'=>'Int',
'double'=>'Float',
'date'=>'Date',
'datetime'=>'DateAndTime',
'boolean'=>'Boolean',
'price'=>'ExtrafieldPrice',
'phone'=>'ExtrafieldPhone',
'mail'=>'ExtrafieldMail',
'url'=>'ExtrafieldUrl',
'password' => 'ExtrafieldPassword',
'select' => 'ExtrafieldSelect',
'sellist' => 'ExtrafieldSelectList',
'radio' => 'ExtrafieldRadio',
'checkbox' => 'ExtrafieldCheckBox',
'chkbxlst' => 'ExtrafieldCheckBoxFromList',
'link' => 'ExtrafieldLink',
'separate' => 'ExtrafieldSeparator',
'varchar'=>'String',
'text'=>'TextLong',
'html'=>'HtmlText',
'int'=>'Int',
'double'=>'Float',
'date'=>'Date',
'datetime'=>'DateAndTime',
'boolean'=>'Boolean',
'price'=>'ExtrafieldPrice',
'phone'=>'ExtrafieldPhone',
'mail'=>'ExtrafieldMail',
'url'=>'ExtrafieldUrl',
'password' => 'ExtrafieldPassword',
'select' => 'ExtrafieldSelect',
'sellist' => 'ExtrafieldSelectList',
'radio' => 'ExtrafieldRadio',
'checkbox' => 'ExtrafieldCheckBox',
'chkbxlst' => 'ExtrafieldCheckBoxFromList',
'link' => 'ExtrafieldLink',
'separate' => 'ExtrafieldSeparator',
);
@ -131,7 +185,8 @@ class ExtraFields
function __construct($db)
{
$this->db = $db;
$this->error = array();
$this->error = '';
$this->errors = array();
$this->attributes = array();
// For old usage
@ -430,6 +485,7 @@ class ExtraFields
if ($result < 0)
{
$this->error=$this->db->lasterror();
$this->errors[]=$this->db->lasterror();
$error++;
}
@ -450,6 +506,7 @@ class ExtraFields
if ($result < 0)
{
$this->error=$this->db->lasterror();
$this->errors[]=$this->db->lasterror();
$error++;
}
}
@ -1885,7 +1942,7 @@ class ExtraFields
/**
* Fill array_options property of object by extrafields value (using for data sent by forms)
*
* @param array $extralabels $array of extrafields (@deprecated)
* @param array $extralabels Deprecated $array of extrafields
* @param object $object Object
* @param string $onlykey Only following key is filled. When we make update of only one extrafield ($action = 'update_extras'), calling page must must set this to avoid to have other extrafields being reset.
* @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example)

View File

@ -7,7 +7,8 @@
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
* the Free Software Foundation; either version 3 of the License, or
@ -66,11 +67,12 @@ class FormFile
* @param int $addcancel 1=Add 'Cancel' button
* @param int $sectionid If upload must be done inside a particular ECM section (is sectionid defined, sectiondir must not be)
* @param int $perm Value of permission to allow upload
* @param int $size Length of input file area. Deprecated.
* @param int $size Length of input file area. Deprecated.
* @param Object $object Object to use (when attachment is done on an element)
* @param string $options Add an option column
* @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option). @deprecated 2 should never be used and if 1 is used, option should no be enabled.
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
* @param integer $useajax Use fileupload ajax (0=never, 1=if enabled, 2=always whatever is option).
* Deprecated 2 should never be used and if 1 is used, option should no be enabled.
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
* @param integer $linkfiles 1=Also add form to link files, 0=Do not show form to link files
* @param string $htmlname Name and id of HTML form ('formuserfile' by default, 'formuserfileecm' when used to upload a file in ECM)
* @param string $accept Specifies the types of files accepted (This is not a security check but an user interface facility. eg '.pdf,image/*' or '.png,.jpg' or 'video/*')
@ -83,6 +85,10 @@ class FormFile
global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));
// Deprecation warning
if ($useajax == 2) {
dol_syslog(__METHOD__ . ": using 2 for useajax is deprecated and should be not used", LOG_WARNING);
}
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
@ -271,7 +277,7 @@ class FormFile
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
* @param string $filedir Directory to scan
* @param string $urlsource Url of origin page (for return)
* @param int $genallowed Generation is allowed (1/0 or array list of templates)
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
* @param int $delallowed Remove is allowed (1/0)
* @param string $modelselected Model to preselect by default
* @param integer $allowgenifempty Allow generation even if list of template ($genallowed) is empty (show however a warning)

View File

@ -228,9 +228,9 @@ class FormMail extends Form
if (! empty($_SESSION["listofmimes".$keytoavoidconflict])) $listofmimes=explode(';', $_SESSION["listofmimes".$keytoavoidconflict]);
if ($keytodelete >= 0)
{
unset ($listofpaths[$keytodelete]);
unset ($listofnames[$keytodelete]);
unset ($listofmimes[$keytodelete]);
unset($listofpaths[$keytodelete]);
unset($listofnames[$keytodelete]);
unset($listofmimes[$keytodelete]);
$_SESSION["listofpaths".$keytoavoidconflict]=join(';', $listofpaths);
$_SESSION["listofnames".$keytoavoidconflict]=join(';', $listofnames);
$_SESSION["listofmimes".$keytoavoidconflict]=join(';', $listofmimes);

View File

@ -655,7 +655,7 @@ class SMTPs
$_retVal = true;
// if we have a path...
if ( ! empty ($_strConfigPath) )
if ( ! empty($_strConfigPath) )
{
// If the path is not valid, this will NOT generate an error,
// it will simply return false.
@ -989,7 +989,7 @@ class SMTPs
$aryHost = $this->_msgRecipients;
// Only run this if we have something
if ( !empty ($_addrList))
if ( !empty($_addrList))
{
// $_addrList can be a STRING or an array
if ( is_string($_addrList) )
@ -1409,7 +1409,7 @@ class SMTPs
// If we have ZERO, we have a problem
if( $keyCount === 0 )
die ("Sorry, no content");
die("Sorry, no content");
// If we have ONE, we can use the simple format
elseif( $keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART))

View File

@ -541,7 +541,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
/**
* On/off button for object
*
* @param int $object Id product to set
* @param Object $object Object to set
* @param string $code Name of constant : status or status_buy for product by example
* @param string $field Name of database field : tosell or tobuy for product by example
* @param string $text_on Text if on

View File

@ -1266,27 +1266,31 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket') $sql.= ", ".MAIN_DB_PREFIX."ticket as o";
$sql.= " WHERE a.entity IN (".getEntity('agenda').")";
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent')
{
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
if (is_object($objcon) && $objcon->id) {
$sql.= " AND a.fk_contact = ".$objcon->id;
} else {
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent')
{
$sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'order_supplier'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'Product')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
elseif (is_object($filterobj) && get_class($filterobj) == 'Ticket')
{
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'ticket'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
}
// Condition on actioncode
@ -1378,7 +1382,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
// Add also event from emailings. TODO This should be replaced by an automatic event ? May be it's too much for very large emailing.
if (! empty($conf->mailing->enabled) && ! empty($objcon->email))
if (! empty($conf->mailing->enabled) && ! empty($objcon->email)
&& (empty($actioncode) || $actioncode == 'AC_OTH_AUTO' || $actioncode == 'AC_EMAILING'))
{
$langs->load("mails");
@ -1528,7 +1533,13 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
// Ref
$out.='<td class="nowrap">';
$out.=$actionstatic->getNomUrl(1, -1);
if (isset($histo[$key]['type']) && $histo[$key]['type']=='mailing') {
$out.='<a href="'.DOL_URL_ROOT.'/comm/mailing/card.php?id='.$histo[$key]['id'].'">'.img_object($langs->trans("ShowEMailing"), "email").' ';
$out.=$histo[$key]['id'];
$out.='</a>';
} else {
$out.=$actionstatic->getNomUrl(1, -1);
}
$out.='</td>';
// Author of event

View File

@ -6610,12 +6610,12 @@ function dol_sort_array(&$array, $index, $order = 'asc', $natsort = 0, $case_sen
$temp = array();
foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index];
if (!$natsort) ($order=='asc') ? asort($temp) : arsort($temp);
else
{
($case_sensitive) ? natsort($temp) : natcasesort($temp);
if($order!='asc') $temp=array_reverse($temp, true);
}
if (! $natsort) {
($order=='asc') ? asort($temp) : arsort($temp);
} else {
($case_sensitive) ? natsort($temp) : natcasesort($temp);
if($order!='asc') $temp=array_reverse($temp, true);
}
$sorted = array();

View File

@ -2017,30 +2017,30 @@ function cleanCorruptedTree($db, $tabletocleantree, $fieldfkparent)
/**
* Get an array with properties of an element
*
* @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'...
* @return array (module, classpath, element, subelement, classfile, classname)
* @param string $element_type Element type: 'action', 'facture', 'project_task' or 'object@modulext'...
* @return array (module, classpath, element, subelement, classfile, classname)
*/
function getElementProperties($element_type)
{
// Parse element/subelement (ex: project_task)
$module = $element = $subelement = $element_type;
$module = $element_type;
$element = $element_type;
$subelement = $element_type;
// If we ask an resource form external module (instead of default path)
if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs))
{
if (preg_match('/^([^@]+)@([^@]+)$/i', $element_type, $regs)) {
$element = $subelement = $regs[1];
$module = $regs[2];
$module = $regs[2];
}
//print '<br>1. element : '.$element.' - module : '.$module .'<br>';
if ( preg_match('/^([^_]+)_([^_]+)/i', $element, $regs))
{
if ( preg_match('/^([^_]+)_([^_]+)/i', $element, $regs)) {
$module = $element = $regs[1];
$subelement = $regs[2];
}
// For compat
if($element_type == "action") {
if ($element_type == "action") {
$classpath = 'comm/action/class';
$subelement = 'Actioncomm';
$module = 'agenda';
@ -2049,13 +2049,13 @@ function getElementProperties($element_type)
// To work with non standard path
if ($element_type == 'facture' || $element_type == 'invoice') {
$classpath = 'compta/facture/class';
$module='facture';
$subelement='facture';
$module ='facture';
$subelement = 'facture';
}
if ($element_type == 'commande' || $element_type == 'order') {
$classpath = 'commande/class';
$module='commande';
$subelement='commande';
$module = 'commande';
$subelement = 'commande';
}
if ($element_type == 'propal') {
$classpath = 'comm/propal/class';
@ -2142,8 +2142,7 @@ function getElementProperties($element_type)
*/
function fetchObjectByElement($element_id, $element_type, $element_ref = '')
{
global $conf;
global $db,$conf;
global $conf, $db;
$element_prop = getElementProperties($element_type);
if (is_array($element_prop) && $conf->{$element_prop['module']}->enabled)
@ -2260,6 +2259,9 @@ function getModuleDirForApiClass($module)
elseif ($module == 'adherent' || $module == 'members' || $module == 'memberstypes' || $module == 'subscriptions') {
$moduledirforclass = 'adherents';
}
elseif ($module == 'don' || $module == 'donations') {
$moduledirforclass = 'don';
}
elseif ($module == 'banque' || $module == 'bankaccounts') {
$moduledirforclass = 'compta/bank';
}
@ -2270,7 +2272,7 @@ function getModuleDirForApiClass($module)
$moduledirforclass = 'commande';
}
elseif ($module == 'shipments') {
$moduledirforclass = 'expedition';
$moduledirforclass = 'expedition';
}
elseif ($module == 'facture' || $module == 'invoice' || $module == 'invoices') {
$moduledirforclass = 'compta/facture';

View File

@ -38,10 +38,10 @@ function dol_convertToWord($num, $langs, $currency = false, $centimes = false)
global $conf;
$num = str_replace(array(',', ' '), '', trim($num));
if(! $num) {
if (! $num) {
return false;
}
if($centimes && strlen($num) == 1) {
if ($centimes && strlen($num) == 1) {
$num = $num*10;
}
$TNum = explode('.', $num);
@ -151,7 +151,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
if ($numero >= 1000000000001)
return -1;
// Get 2 decimals to cents, another functions round or truncate
$strnumber = number_format ($numero, 10);
$strnumber = number_format($numero, 10);
$len=strlen($strnumber);
for ($i=0; $i<$len; $i++)
{
@ -187,7 +187,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $DdMMillon * 10000000000;
$UdMMillon = (int) ($numero / 1000000000);
$numero = $numero - $UdMMillon * 1000000000;
$entexto .= hundreds2text ($CdMMillon, $DdMMillon, $UdMMillon);
$entexto .= hundreds2text($CdMMillon, $DdMMillon, $UdMMillon);
$entexto .= " MIL ";
}
if ($number >= 1000000){
@ -197,7 +197,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $DdMILLON * 10000000;
$udMILLON = (int) ($numero / 1000000);
$numero = $numero - $udMILLON * 1000000;
$entexto .= hundreds2text ($CdMILLON, $DdMILLON, $udMILLON);
$entexto .= hundreds2text($CdMILLON, $DdMILLON, $udMILLON);
if (!$CdMMillon && !$DdMMillon && !$UdMMillon && !$CdMILLON && !$DdMILLON && $udMILLON==1)
$entexto .= " MILL&OacuteN ";
else
@ -210,7 +210,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $ddm * 10000;
$udm = (int) ($numero / 1000);
$numero = $numero - $udm * 1000;
$entexto .= hundreds2text ($cdm, $ddm, $udm);
$entexto .= hundreds2text($cdm, $ddm, $udm);
if ($cdm || $ddm || $udm)
$entexto .= " MIL ";
}
@ -218,7 +218,7 @@ function dolNumberToWord($numero, $langs, $numorcurrency = 'number')
$numero = $numero - $c * 100;
$d = (int) ($numero / 10);
$u = (int) $numero - $d * 10;
$entexto .= hundreds2text ($c, $d, $u);
$entexto .= hundreds2text($c, $d, $u);
if (!$cdm && !$ddm && !$udm && !$c && !$d && !$u && $number>1000000)
$entexto .= " DE";
$entexto .= " PESOS ".$parte_decimal." / 100 M.N.";

View File

@ -36,14 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
class pdf_ban extends ModeleBankAccountDoc
{
/**
* Issuer
* @var Societe
* @var Societe Issuer
*/
public $emetteur;
/**
* Dolibarr version of the loaded document
* @public string
* @var string Dolibarr version of the loaded document
*/
public $version = 'development';

View File

@ -53,8 +53,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string Dolibarr version of the loaded document
*/
public $version = 'dolibarr';

View File

@ -45,14 +45,14 @@ class doc_generic_contract_odt extends ModelePDFContract
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -47,14 +47,14 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -61,14 +61,14 @@ class pdf_standard extends ModeleExpenseReport
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -46,14 +46,14 @@ class doc_generic_invoice_odt extends ModelePDFFactures
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -69,14 +69,14 @@ class pdf_crabe extends ModelePDFFactures
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -76,7 +76,7 @@ class pdf_sponge extends ModelePDFFactures
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'development';

View File

@ -59,14 +59,14 @@ class pdf_soleil extends ModelePDFFicheinter
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -60,14 +60,14 @@ class pdf_typhon extends ModelePDFDeliveryOrder
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -418,6 +418,6 @@ class modAgenda extends DolibarrModules
$this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')';
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)';
if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id);
$this->export_sql_end[$r] .=' ORDER BY ac.datep';
$this->export_sql_order[$r] .=' ORDER BY ac.datep';
}
}

View File

@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2014-2019 Frédéric France <frederic.france@netlogic.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
@ -95,7 +95,7 @@ class printing_printgcp extends PrintingDriver
$storage = new DoliStorage($this->db, $this->conf);
//$storage->clearToken($this->OAUTH_SERVICENAME_GOOGLE);
// Setup the credentials for the requests
$credentials = new Credentials(
$credentials = new Credentials(
$this->google_id,
$this->google_secret,
$urlwithroot.'/core/modules/oauth/google_oauthcallback.php'
@ -234,6 +234,7 @@ class printing_printgcp extends PrintingDriver
*/
public function getlistAvailablePrinters()
{
$ret = array();
// Token storage
$storage = new DoliStorage($this->db, $this->conf);
// Setup the credentials for the requests
@ -335,8 +336,9 @@ class printing_printgcp extends PrintingDriver
return $error;
}
}
} else {
dol_print_error($this->db);
}
else dol_print_error($this->db);
$ret = $this->sendPrintToPrinter($printer_id, $file, $fileprint, $mimetype);
$this->error = 'PRINTGCP: '.$ret['errormessage'];
@ -358,7 +360,7 @@ class printing_printgcp extends PrintingDriver
public function sendPrintToPrinter($printerid, $printjobtitle, $filepath, $contenttype)
{
// Check if printer id
if(empty($printerid)) {
if (empty($printerid)) {
return array('status' =>0, 'errorcode' =>'','errormessage'=>'No provided printer ID');
}
// Open the file which needs to be print

View File

@ -44,14 +44,14 @@ class doc_generic_product_odt extends ModelePDFProduct
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -57,14 +57,14 @@ class pdf_standard extends ModelePDFProduct
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -61,14 +61,14 @@ class doc_generic_project_odt extends ModelePDFProjects
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -59,14 +59,14 @@ class pdf_baleine extends ModelePDFProjects
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -38,23 +38,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
*/
class doc_generic_proposal_odt extends ModelePDFPropales
{
/**
* Issuer
* @var Company object that emits
*/
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
/**
* @var Company Issuer object that emits
*/
public $version = 'dolibarr';
public $emetteur;
/**
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* @var string Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
/**
@ -369,7 +367,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
$odfHandler = new odf(
$odfHandler = new odf(
$srctemplatepath,
array(
'PATH_TO_TMP' => $conf->propal->multidir_temp[$object->entity],

View File

@ -67,14 +67,14 @@ class pdf_azur extends ModelePDFPropales
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -41,22 +41,25 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
*/
class pdf_cyan extends ModelePDFPropales
{
public $db;
/**
* @var DoliDb Database handler
*/
public $db;
public $name;
public $description;
public $update_main_doc_field; // Save the name of generated file as the main doc when generating a doc with this template
public $type;
public $phpmin = array(4,3,0); // Minimum version of PHP required by module
public $phpmin = array(5, 4); // Minimum version of PHP required by module
public $version = 'development';
public $page_largeur;
public $page_hauteur;
public $format;
public $marge_gauche;
public $marge_droite;
public $marge_haute;
public $marge_basse;
public $marge_droite;
public $marge_haute;
public $marge_basse;
public $emetteur; // Objet societe qui emet

View File

@ -1,20 +1,21 @@
<?php
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.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
* 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 <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
* 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 <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@ -35,10 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
*/
class doc_generic_reception_odt extends ModelePdfReception
{
var $emetteur; // Objet societe qui emet
/**
* @var Company Issuer object that emits
*/
public $emetteur; // Objet societe qui emet
var $phpmin = array(5,2,0); // Minimum version of PHP required by module
var $version = 'dolibarr';
/**
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4); // Minimum version of PHP required by module
/**
* @var string Dolibarr version of the loaded document
*/
public $version = 'dolibarr';
/**
@ -318,7 +330,7 @@ class doc_generic_reception_odt extends ModelePdfReception
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
$odfHandler = new odf(
$odfHandler = new odf(
$srctemplatepath,
array(
'PATH_TO_TMP' => $conf->reception->dir_temp,
@ -343,10 +355,9 @@ class doc_generic_reception_odt extends ModelePdfReception
// Make substitutions into odt of freetext
try {
$odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8');
}
catch(OdfException $e)
{
}
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
// Make substitutions into odt of user info
$tmparray=$this->get_substitutionarray_user($user, $outputlangs);
@ -364,9 +375,8 @@ class doc_generic_reception_odt extends ModelePdfReception
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
catch(OdfException $e)
{
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Make substitutions into odt of mysoc
@ -385,9 +395,8 @@ class doc_generic_reception_odt extends ModelePdfReception
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
catch(OdfException $e)
{
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Make substitutions into odt of thirdparty
@ -404,9 +413,8 @@ class doc_generic_reception_odt extends ModelePdfReception
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
catch(OdfException $e)
{
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of object + external modules
@ -427,9 +435,8 @@ class doc_generic_reception_odt extends ModelePdfReception
{
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
}
catch(OdfException $e)
{
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
// Replace tags of lines
@ -445,15 +452,12 @@ class doc_generic_reception_odt extends ModelePdfReception
$reshook=$hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
foreach($tmparray as $key => $val)
{
try
{
try {
$listlines->setVars($key, $val, true, 'UTF-8');
}
catch(OdfException $e)
{
}
catch(SegmentException $e)
{
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
} catch(SegmentException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
$listlines->merge();
@ -473,9 +477,8 @@ class doc_generic_reception_odt extends ModelePdfReception
{
try {
$odfHandler->setVars($key, $value, true, 'UTF-8');
}
catch(OdfException $e)
{
} catch(OdfException $e) {
dol_syslog($e->getMessage(), LOG_INFO);
}
}
@ -487,7 +490,7 @@ class doc_generic_reception_odt extends ModelePdfReception
if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
try {
$odfHandler->exportAsAttachedPDF($file);
}catch (Exception $e){
} catch (Exception $e){
$this->error=$e->getMessage();
return -1;
}
@ -495,7 +498,7 @@ class doc_generic_reception_odt extends ModelePdfReception
else {
try {
$odfHandler->saveToDisk($file);
}catch (Exception $e){
} catch (Exception $e){
$this->error=$e->getMessage();
return -1;
}

View File

@ -29,7 +29,7 @@
*/
abstract class ModelePdfReception extends CommonDocGenerator
{
var $error='';
public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps

View File

@ -43,7 +43,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);

View File

@ -43,15 +43,15 @@ class doc_generic_stock_odt extends ModelePDFStock
*/
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
/**
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -57,14 +57,14 @@ class pdf_standard extends ModelePDFStock
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -58,14 +58,14 @@ class pdf_stdmovement extends ModelePDFMovement
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';
@ -105,8 +105,7 @@ class pdf_stdmovement extends ModelePDFMovement
public $marge_basse;
/**
* Issuer
* @var Societe
* @var Societe Issuer
*/
public $emetteur;

View File

@ -58,14 +58,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -62,14 +62,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -59,14 +59,14 @@ class pdf_standard extends ModelePDFSuppliersPayments
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -45,14 +45,14 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -59,14 +59,14 @@ class pdf_aurore extends ModelePDFSupplierProposal
public $type;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';

View File

@ -37,21 +37,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/doc.lib.php';
class doc_generic_user_odt extends ModelePDFUser
{
/**
* Issuer
* @var Societe
* @var Societe Issuer
*/
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
*/
* Dolibarr version of the loaded document
* @var string
*/
public $version = 'dolibarr';

View File

@ -45,14 +45,14 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
public $emetteur;
/**
* @var array() Minimum version of PHP required by module.
* @var array Minimum version of PHP required by module.
* e.g.: PHP 5.4 = array(5, 4)
*/
*/
public $phpmin = array(5, 4);
/**
* Dolibarr version of the loaded document
* @public string
* @var string
*/
public $version = 'dolibarr';
@ -67,7 +67,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
global $conf, $langs, $mysoc;
// Load translation files required by the page
$langs->loadLangs(array("main","companies"));
$langs->loadLangs(array("main","companies"));
$this->db = $db;
$this->name = "ODT templates";

View File

@ -541,7 +541,7 @@ print '<script type="text/javascript" language="javascript">
print load_fiche_titre($langs->trans("ToClearAllRecipientsClickHere"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>';
print '<td class="liste_titre right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>';
print '</tr>';
print '</table>';
print '</form>';

View File

@ -48,7 +48,7 @@ print $doleditor->Create(1);
print '</td>';
print '<td align="center">';
print '<td class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
print '</td></tr>';
print '</table></form>';

View File

@ -175,11 +175,11 @@ if ($permission) {
?>
<form class="tagtr oddeven <?php echo ($var?'impair':'pair') ?>">
<div class="tagtd" align="left">
<div class="tagtd left">
<?php if ($tab[$i]['source']=='internal') echo $langs->trans("User"); ?>
<?php if ($tab[$i]['source']=='external') echo $langs->trans("ThirdPartyContact"); ?>
</div>
<div class="tagtd" align="left">
<div class="tagtd left">
<?php
if ($tab[$i]['socid'] > 0)
{

View File

@ -20,7 +20,7 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_
{
$align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey);
print '<td';
if ($align) print ' align="'.$align.'"';
if ($align) print ' class="'.$align.'"';
print '>';
$tmpkey='options_'.$key;
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey))

View File

@ -10,10 +10,10 @@ if (empty($conf) || ! is_object($conf))
// Loop to complete $param for extrafields
if (! empty($search_array_options)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
{
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/', '', $key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
foreach ($search_array_options as $key => $val)
{
$crit=$val;
$tmpkey=preg_replace('/search_options_/', '', $key);
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
}
}

View File

@ -122,7 +122,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
{
$fieldid='id';
if ($object->table_element == 'societe') $fieldid='socid';
print '<td align="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
}
print '</tr></table>';
print '</td>';

View File

@ -149,7 +149,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg
print '<!-- Title for manual directories -->'."\n";
print '<tr class="liste_titre">'."\n";
print '<th class="liste_titre" align="left">';
print '<th class="liste_titre left">';
print '&nbsp;'.$langs->trans("ECMSections");
print '</th></tr>';

View File

@ -143,7 +143,7 @@ $coldisplay=-1; // We remove first td
$coldisplay++;
if ($line->fk_prev_id == null) {
print '<td align="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>';
print '<td class="right">' . $form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1) . '</td>';
} else {
print '<td class="right"><input size="1" type="text" class="flat right" name="tva_tx" value="' . price($line->tva_tx) . '" readonly />%</td>';
}

View File

@ -30,16 +30,16 @@ if (empty($conf) || ! is_object($conf))
print '<tr class="oddeven'.(empty($this->tpl['strike'])?'':' strikefordisabled').'">';
print '<td>'.$this->tpl['label'].'</td>';
print '<td>'.$this->tpl['description'].'</td>';
print '<td align="right">'.$this->tpl['vat_rate'].'</td>';
print '<td align="right">'.$this->tpl['price'].'</td>';
print '<td class="right">'.$this->tpl['vat_rate'].'</td>';
print '<td class="right">'.$this->tpl['price'].'</td>';
if (!empty($conf->multicurrency->enabled))
print '<td align="right">'.$this->tpl['multicurrency_price'].'</td>';
print '<td class="right">'.$this->tpl['multicurrency_price'].'</td>';
print '<td align="right">'.$this->tpl['qty'].'</td>';
print '<td class="right">'.$this->tpl['qty'].'</td>';
if($conf->global->PRODUCT_USE_UNITS)
print '<td class="left">'.$langs->trans($this->tpl['unit']).'</td>';
print '<td align="right">'.$this->tpl['remise_percent'].'</td>';
print '<td class="right">'.$this->tpl['remise_percent'].'</td>';
print '</tr>'."\n";
?>
<!-- END PHP TEMPLATE originproductline.tpl.php -->

View File

@ -165,7 +165,7 @@ if (! empty($morelogincontent)) {
<br><input type="submit" <?php echo $disabled; ?> class="button" name="button_password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
<br>
<div align="center" style="margin-top: 15px;">
<div class="center" style="margin-top: 15px;">
<?php
$moreparam='';
if (! empty($conf->dol_hide_topmenu)) $moreparam.=(strpos($moreparam, '?')===false?'?':'&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;

View File

@ -34,7 +34,7 @@ $out .= '</div>';
$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy', (isset($_POST['busy'])?$_POST['busy']:1), 1).'</div>';
$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory', (isset($_POST['mandatory'])?$_POST['mandatory']:0), 1).'</div>';
$out .= '<div class="tagtd" align="right">';
$out .= '<div class="tagtd right">';
$out .='<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>';
$out .= '</div>';

View File

@ -18,8 +18,8 @@ if($mode == 'edit' )
print '<form class="tagtr liste_titre">';
print '<div class="tagtd liste_titre">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd liste_titre">'.$langs->trans('Type').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd liste_titre center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd liste_titre center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd liste_titre"></div>';
print '</form>';
}
@ -28,8 +28,8 @@ else
print '<form class="tagtr liste_titre">';
print '<div class="tagtd liste_titre">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd liste_titre">'.$langs->trans('Type').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd liste_titre" align="center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd liste_titre center">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd liste_titre center">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd liste_titre"></div>';
print '</form>';
}
@ -56,9 +56,9 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '<div class="tagtd">'.$object_resource->getNomUrl(1).'</div>';
print '<div class="tagtd">'.$object_resource->type_label.'</div>';
print '<div class="tagtd" align="center">'.$form->selectyesno('busy', $linked_resource['busy']?1:0, 1).'</div>';
print '<div class="tagtd" align="center">'.$form->selectyesno('mandatory', $linked_resource['mandatory']?1:0, 1).'</div>';
print '<div class="tagtd" align="right"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div>';
print '<div class="tagtd center">'.$form->selectyesno('busy', $linked_resource['busy']?1:0, 1).'</div>';
print '<div class="tagtd center">'.$form->selectyesno('mandatory', $linked_resource['mandatory']?1:0, 1).'</div>';
print '<div class="tagtd right"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div>';
print '</form>';
}
else
@ -77,15 +77,15 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print $object_resource->type_label;
print '</div>';
print '<div class="tagtd" align="center">';
print '<div class="tagtd center">';
print yn($linked_resource['busy']);
print '</div>';
print '<div class="tagtd" align="center">';
print '<div class="tagtd center">';
print yn($linked_resource['mandatory']);
print '</div>';
print '<div class="tagtd" align="right">';
print '<div class="tagtd right">';
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=edit&resource_type='.$linked_resource['resource_type'].'&element='.$element.'&element_id='.$element_id.'&lineid='.$linked_resource['rowid'].'">';
print img_edit();
print '</a>';

View File

@ -17,7 +17,7 @@
*/
/**
* \file datapolicy/admin/setup.php
* \file htdocs/datapolicy/admin/setup.php
* \ingroup datapolicy
* \brief datapolicy setup page.
*/
@ -25,7 +25,6 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php";
require_once '../lib/datapolicy.lib.php';
//require_once "../class/myclass.class.php";
// Translations
$langs->load('admin');
@ -61,22 +60,22 @@ $arrayofparameters=array(
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if (DOL_VERSION < '7' && $action == 'update') {
foreach ($arrayofparameters as $k => $v) {
$res = dolibarr_set_const($db, $k, GETPOST($k), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
}
if (! $error)
{
$db->commit();
if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors');
}
}
// if (DOL_VERSION < '7' && $action == 'update') {
// foreach ($arrayofparameters as $k => $v) {
// $res = dolibarr_set_const($db, $k, GETPOST($k), 'chaine', 0, '', $conf->entity);
// if (! $res > 0) $error++;
// }
// if (! $error)
// {
// $db->commit();
// if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
// }
// else
// {
// $db->rollback();
// if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors');
// }
// }
$arrayofparameters=array(
@ -108,8 +107,8 @@ $valTab = array(
'48' => $langs->trans('NB_YEARS', 4),
'60' => $langs->trans('NB_YEARS', 5),
'120' => $langs->trans('NB_YEARS', 10),
'180' => $langs->trans('NB_YEARS', 15),
'240' => $langs->trans('NB_YEARS', 20),
'180' => $langs->trans('NB_YEARS', 15),
'240' => $langs->trans('NB_YEARS', 20),
);
@ -135,15 +134,15 @@ echo '<span class="opacitymedium">'.$langs->trans("datapolicySetupPage").'</span
if ($action == 'edit')
{
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach($arrayofparameters as $title => $tab)
{
foreach($arrayofparameters as $title => $tab)
{
print '<tr class="liste_titre"><td class="titlefield" colspan="2">'.$langs->trans($title).'</td></tr>';
foreach($tab as $key => $val)
{
@ -159,21 +158,19 @@ if ($action == 'edit')
print '</select>';
print '</td></tr>';
}
}
}
print '</table>';
print '</table>';
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '<br><div class="center">';
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
print '<br>';
}
else
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '</form>';
print '<br>';
} else {
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach($arrayofparameters as $title => $tab)
{
@ -186,11 +183,11 @@ else
}
}
print '</table>';
print '</table>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
print '<div class="tabsAction">';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
print '</div>';
}

View File

@ -293,12 +293,12 @@ class ActionsDatapolicy
/**
* Execute action
*
* @param array $parameters Array of parameters
* @param Object $object Object output on PDF
* @param string $action 'add', 'update', 'view'
* @return int <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
* @param array $parameters Array of parameters
* @param Object $object Object output on PDF
* @param string $action 'add', 'update', 'view'
* @return int <0 if KO,
* =0 if OK but we want to process standard actions too,
* >0 if OK and we want to replace standard actions.
*/
function beforePDFCreation($parameters, &$object, &$action)
{
@ -336,46 +336,46 @@ class ActionsDatapolicy
if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS))
{
$dialog = '<div id="dialogdatapolicy" style="display:none;" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">';
$dialog .= '<div class="confirmmessage">' . img_help('', '') . ' ' . $langs->trans('DATAPOLICIES_PORTABILITE_CONFIRMATION') . '</div>';
$dialog .= "</div>";
$dialog .= '<script>
$( function() {
$("#rpgpdbtn").on("click", function(){
var href = $(this).attr("href");
$( "#dialogdatapolicy" ).dialog({
modal: true,
buttons: {
"OK": function() {
window.open(href);
$( this ).dialog( "close" );
},
"' . $langs->trans('Cancel') . '": function() {
$( this ).dialog( "close" );
}
}
});
$dialog = '<div id="dialogdatapolicy" style="display:none;" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">';
$dialog .= '<div class="confirmmessage">' . img_help('', '') . ' ' . $langs->trans('DATAPOLICIES_PORTABILITE_CONFIRMATION') . '</div>';
$dialog .= "</div>";
$dialog .= '<script>
$( function() {
$("#rpgpdbtn").on("click", function(){
var href = $(this).attr("href");
$( "#dialogdatapolicy" ).dialog({
modal: true,
buttons: {
"OK": function() {
window.open(href);
$( this ).dialog( "close" );
},
"' . $langs->trans('Cancel') . '": function() {
$( this ).dialog( "close" );
}
}
});
return false;
});
} );
</script>';
echo $dialog;
if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
} elseif ($parameters['currentcontext'] == 'membercard') {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
} elseif ($parameters['currentcontext'] == 'contactcard') {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
}
if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
}
return false;
});
} );
</script>';
echo $dialog;
if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
} elseif ($parameters['currentcontext'] == 'membercard') {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
} elseif ($parameters['currentcontext'] == 'contactcard') {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=datapolicy_portabilite" title="' . $langs->trans('DATAPOLICIES_PORTABILITE_TITLE') . '">' . $langs->trans("DATAPOLICIES_PORTABILITE") . '</a></div>';
}
if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?socid=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'membercard') {
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?rowid=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
} elseif (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'contactcard') {
echo '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?id=" . $object->id . '&action=send_datapolicy" title="' . $langs->trans('DATAPOLICIES_SEND') . '">' . $langs->trans("DATAPOLICIES_SEND") . '</a></div>';
}
}
}

View File

@ -30,11 +30,11 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
*/
Class DataPolicy
{
/**
* getAllContactNotInformed
*
* @return number
*/
/**
* getAllContactNotInformed
*
* @return number
*/
function getAllContactNotInformed()
{
global $langs, $conf, $db, $user;
@ -144,71 +144,71 @@ Class DataPolicy
*/
function sendMailDataPolicyContact($contact)
{
global $langs, $conf, $db, $user;
global $langs, $conf, $db, $user;
$error = 0;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$sendto = $contact->email;
$code= md5($contact->email);
if (!empty($contact->default_lang)) {
$l = $contact->default_lang;
} else {
$l = $langs->defaultlang;
}
$s = "DATAPOLICIESSUBJECT_" . $l;
$ma = "DATAPOLICIESCONTENT_" . $l;
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$sendto = $contact->email;
$code= md5($contact->email);
if (!empty($contact->default_lang)) {
$l = $contact->default_lang;
} else {
$l = $langs->defaultlang;
}
$s = "DATAPOLICIESSUBJECT_" . $l;
$ma = "DATAPOLICIESCONTENT_" . $l;
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
'__FIRSTNAME__' => $contact->firstname,
'__NAME__' => $contact->lastname,
'__CIVILITY__' => $contact->civility,
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
'__FIRSTNAME__' => $contact->firstname,
'__NAME__' => $contact->lastname,
'__CIVILITY__' => $contact->civility,
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc)
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc)
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
if (!$error) {
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$contact->update($contact->id);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$contact->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$contact->update($contact->id);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
}
/**
@ -219,44 +219,44 @@ Class DataPolicy
*/
function sendMailDataPolicyCompany($societe)
{
global $langs, $conf, $db, $user;
global $langs, $conf, $db, $user;
$error = 0;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$sendto = $societe->email;
$sendto = $societe->email;
$code= md5($societe->email);
if (!empty($societe->default_lang)) {
$l = $societe->default_lang;
} else {
$l = $langs->defaultlang;
}
$s = "DATAPOLICIESSUBJECT_" . $l;
$ma = "DATAPOLICIESCONTENT_" . $l;
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$code= md5($societe->email);
if (!empty($societe->default_lang)) {
$l = $societe->default_lang;
} else {
$l = $langs->defaultlang;
}
$s = "DATAPOLICIESSUBJECT_" . $l;
$ma = "DATAPOLICIESCONTENT_" . $l;
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array(
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
@ -264,23 +264,23 @@ Class DataPolicy
$actionmsg .= dol_concatdesc($actionmsg, $message);
}
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$societe->update($societe->id);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$societe->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$societe->update($societe->id);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
}
/**
@ -291,66 +291,66 @@ Class DataPolicy
*/
function sendMailDataPolicyAdherent($adherent)
{
global $langs, $conf, $db, $user;
global $langs, $conf, $db, $user;
$error = 0;
$error = 0;
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
$sendto = $adherent->email;
$sendto = $adherent->email;
$code= md5($adherent->email);
if (!empty($adherent->default_lang)) {
$l = $adherent->default_lang;
} else {
$l = $langs->defaultlang;
}
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$code= md5($adherent->email);
if (!empty($adherent->default_lang)) {
$l = $adherent->default_lang;
} else {
$l = $langs->defaultlang;
}
$la = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
$lr = 'TXTLINKDATAPOLICIESREFUSE_' . $l;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$subject = $conf->global->$s;
$message = $conf->global->$ma;
$linka = $conf->global->$la;
$linkr = $conf->global->$lr;
$sendtocc = $sendtobcc = '';
$filepath = $mimetype = $filename = array();
$deliveryreceipt = 0;
$substitutionarray = array(
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actiontypecode = 'AC_EMAIL';
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg .= dol_concatdesc($actionmsg, $message);
}
}
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
// Send mail
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error) {
$resultmasssend .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result4 = $mailfile->sendfile();
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$adherent->update($user);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
if (!$error) {
$resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "<br>";
$adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time());
$adherent->update($user);
} else {
dol_print_error($db);
}
}
setEventMessage($resultmasssend);
}
}

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software: you can redistribute it and/or modify
@ -17,7 +17,7 @@
*/
/**
* \file datapolicy/class/datapolicycron.class.php
* \file htdocs/datapolicy/class/datapolicycron.class.php
* \ingroup datapolicy
* \brief Example hook overload.
*/
@ -27,11 +27,11 @@
*/
class DataPolicyCron
{
/**
* Function exec
*
* @return boolean
*/
/**
* Function exec
*
* @return boolean
*/
public function exec()
{
global $conf, $db, $langs, $user;

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
@ -16,7 +17,7 @@
*/
/**
* \file datapolicy/lib/datapolicy.lib.php
* \file htdocs/datapolicy/lib/datapolicy.lib.php
* \ingroup datapolicy
* \brief Library files with common functions for datapolicy
*/
@ -28,27 +29,26 @@
*/
function datapolicyAdminPrepareHead()
{
global $langs, $conf;
global $langs, $conf;
$langs->load("datapolicy@datapolicy");
$langs->load("datapolicy@datapolicy");
$h = 0;
$head = array();
$h = 0;
$head = array();
$head[$h][0] = dol_buildpath("/datapolicy/admin/setup.php", 1);
$head[$h][1] = $langs->trans("Deletion");
$head[$h][2] = 'settings';
$h++;
$head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setup.php";
$head[$h][1] = $langs->trans("Deletion");
$head[$h][2] = 'settings';
$h++;
if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS))
{
$head[$h][0] = dol_buildpath("/datapolicy/admin/setupmail.php", 1);
$head[$h][1] = $langs->trans("DATAPOLICIESMail");
$head[$h][2] = 'settings';
$h++;
}
if (! empty($conf->global->DATAPOLICIES_ENABLE_EMAILS)) {
$head[$h][0] = DOL_URL_ROOT."/datapolicy/admin/setupmail.php";
$head[$h][1] = $langs->trans("DATAPOLICIESMail");
$head[$h][2] = 'settings';
$h++;
}
complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy');
return $head;
return $head;
}

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
/* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.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
@ -16,22 +17,22 @@
*/
/**
* \file datapolicy/mailing.php
* \file htdocs/datapolicy/mailing.php
* \ingroup datapolicy
* \brief datapolicy mailing page.
*/
require '../../main.inc.php';
dol_include_once('/contact/class/contact.class.php');
dol_include_once('/datapolicy/class/datapolicy.class.php');
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/datapolicy/class/datapolicy.class.php';
$idcontact = GETPOST('idc');
if(!empty($idcontact)){
if (!empty($idcontact)) {
$contact = new Contact($db);
$contact->fetch($idcontact);
DataPolicy::sendMailDataPolicyContact($contact);
}else{
} else {
$contacts = new DataPolicy($db);
$contacts->getAllContactNotInformed();

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