Merge branch 'develop' into feature/intervention_ext_download
This commit is contained in:
commit
a01e628187
@ -23,7 +23,6 @@ Licence of dependencies of third-party components used by Dolibarr (all compatib
|
||||
Component Version License GPL Compatible Usage
|
||||
-------------------------------------------------------------------------------------
|
||||
PHP libraries:
|
||||
ADOdb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
|
||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||
Escpos-php 2.2 MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||
GeoIP2 0.2.0 Apache License 2.0 Yes Lib to make geoip convert
|
||||
|
||||
@ -19,7 +19,6 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
|
||||
php-pear, php-mail-mime,
|
||||
# php-tcpdf,
|
||||
# libfpdf-tpl-php, php-fpdf,
|
||||
# libphp-adodb,
|
||||
# libnusoap-php,
|
||||
# libphp-pclzip,
|
||||
# Required javascript libraries
|
||||
|
||||
@ -61,31 +61,6 @@ License: GPL-3+
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/adodbtime/*
|
||||
Copyright: 2003-2005, John Lim
|
||||
unknown, jackbbs
|
||||
License: BSD-3-Clause
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
.
|
||||
Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
.
|
||||
Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
.
|
||||
Neither the name of the John Lim nor the names of its contributors may be
|
||||
used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
Comment:
|
||||
Those files are not shipped in the binary package since we use
|
||||
the library as packaged in "libphp-adodb".
|
||||
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/ckeditor/*
|
||||
Copyright: 2003-2012 CKSource - Frederico Knabben
|
||||
License: GPL-2+
|
||||
|
||||
@ -146,7 +146,6 @@ case "$1" in
|
||||
#else
|
||||
# File already exist. We add params not found.
|
||||
#echo Add new params to overwrite path to use shared libraries/fonts
|
||||
#grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||
|
||||
@ -31,7 +31,6 @@ $force_install_distrib='debian';
|
||||
// - not removed from package (see rm in rules file),
|
||||
// - declared into dependencies (see Depends in control file)
|
||||
//$force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||
|
||||
@ -89,7 +89,6 @@ override_dh_install:
|
||||
rm -fr build/zip
|
||||
|
||||
# clean from all PHP embedded libraries (we use package dependencies instead)
|
||||
# rm -fr htdocs/includes/adodbtime
|
||||
# rm -fr htdocs/includes/geoip
|
||||
# rm -fr htdocs/includes/nusoap
|
||||
# rm -fr htdocs/includes/odtphp/zip/pclzip
|
||||
|
||||
@ -25,7 +25,7 @@ BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
Group: Applications/Productivity
|
||||
Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts
|
||||
Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-nusoap, dejavu-sans-fonts
|
||||
Requires: mysql-server, mysql
|
||||
#BuildRequires: desktop-file-utils
|
||||
|
||||
@ -104,7 +104,6 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
@ -274,7 +273,6 @@ if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -46,7 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
Group: Applications/Productivity
|
||||
Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml
|
||||
Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml
|
||||
Requires: mysql-server, mysql
|
||||
BuildRequires: desktop-file-utils
|
||||
%else
|
||||
@ -169,7 +169,6 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/adodbtime
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
%else
|
||||
@ -425,7 +424,6 @@ if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -271,7 +271,6 @@ if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -281,7 +281,6 @@ if [ -s $config ] && grep -q "File generated by" $config
|
||||
then
|
||||
# File already exist. We add params not found.
|
||||
echo Add new params to overwrite path to use shared libraries/fonts
|
||||
grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_FPDI_PATH" $config || [ ! -d "/usr/share/php/fpdi" ] || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
|
||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||
|
||||
@ -20,7 +20,6 @@ $force_install_lockinstall='444';
|
||||
$force_install_distrib='rpmfedora';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
|
||||
@ -20,7 +20,6 @@ $force_install_lockinstall='444';
|
||||
$force_install_distrib='rpmmandriva';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
|
||||
@ -20,7 +20,6 @@ $force_install_lockinstall='444';
|
||||
$force_install_distrib='rpmopensuse';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||
//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
|
||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||
|
||||
@ -985,7 +985,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth150');
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth75');
|
||||
print '</td>';
|
||||
}
|
||||
// Date document
|
||||
|
||||
@ -743,12 +743,12 @@ print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Movement number
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" class="width50" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||
}
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1);
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth75');
|
||||
print '</td>';
|
||||
}
|
||||
// Date document
|
||||
|
||||
@ -725,7 +725,7 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facture_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
|
||||
@ -503,7 +503,7 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
|
||||
@ -749,7 +749,7 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account(($default_account > 0 && $confirm === 'yes' && in_array($objp->rowid."_".$i, $toselect)) ? $default_account : $suggestedid, 'codeventil'.$facturefourn_static_det->id, 1, array(), 0, 0, 'codeventil maxwidth150 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
|
||||
@ -1728,7 +1728,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib('', 1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
|
||||
@ -520,21 +520,45 @@ class Adherent extends CommonObject
|
||||
* Return translated label by the nature of a adherent (physical or moral)
|
||||
*
|
||||
* @param string $morphy Nature of the adherent (physical or moral)
|
||||
* @param int $addbadge Add badge (1=Full label, 2=First letter only)
|
||||
* @return string Label
|
||||
*/
|
||||
public function getmorphylib($morphy = '')
|
||||
public function getmorphylib($morphy = '', $addbadge = 0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
// Clean var
|
||||
if (!$morphy) {
|
||||
$morphy = $this->morphy;
|
||||
}
|
||||
if ($morphy == 'phy') {
|
||||
return $langs->trans("Physical");
|
||||
|
||||
if ($addbadge) {
|
||||
$s = '';
|
||||
if ($morphy == 'phy') {
|
||||
if ($addbadge == 2) {
|
||||
$labeltoshow = dol_substr($langs->trans("Physical"), 0, 1);
|
||||
} else {
|
||||
$labeltoshow = $langs->trans("Physical");
|
||||
}
|
||||
$s .= '<span class="customer-back paddingleftimp paddingrightimp" title="'.$langs->trans("Physical").'">'.$labeltoshow.'</span>';
|
||||
}
|
||||
if ($morphy == 'mor') {
|
||||
if ($addbadge == 2) {
|
||||
$labeltoshow = dol_substr($langs->trans("Moral"), 0, 1);
|
||||
} else {
|
||||
$labeltoshow = $langs->trans("Moral");
|
||||
}
|
||||
$s .= '<span class="vendor-back paddingleftimp paddingrightimp" title="'.$langs->trans("Moral").'">'.$labeltoshow.'</span>';
|
||||
}
|
||||
} else {
|
||||
if ($morphy == 'phy') {
|
||||
$s = $langs->trans("Physical");
|
||||
} elseif ($morphy == 'mor') {
|
||||
$s = $langs->trans("Moral");
|
||||
}
|
||||
}
|
||||
if ($morphy == 'mor') {
|
||||
return $langs->trans("Moral");
|
||||
}
|
||||
return $morphy;
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -947,6 +947,7 @@ while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$datefin = $db->jdate($obj->datefin);
|
||||
|
||||
$memberstatic->id = $obj->rowid;
|
||||
$memberstatic->ref = $obj->ref;
|
||||
$memberstatic->civility_id = $obj->civility;
|
||||
@ -1063,14 +1064,7 @@ while ($i < min($num, $limit)) {
|
||||
// Nature (Moral/Physical)
|
||||
if (!empty($arrayfields['d.morphy']['checked'])) {
|
||||
print '<td class="center">';
|
||||
$s = '';
|
||||
if ($obj->morphy == 'phy') {
|
||||
$s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>';
|
||||
}
|
||||
if ($obj->morphy == 'mor') {
|
||||
$s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>';
|
||||
}
|
||||
print $s;
|
||||
print $memberstatic->getmorphylib('', 2);
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -720,7 +720,7 @@ if ($rowid > 0) {
|
||||
*/
|
||||
|
||||
// Moral/Physique
|
||||
print "<td>".$adh->getmorphylib($objp->morphy)."</td>\n";
|
||||
print "<td>".$adh->getmorphylib($objp->morphy, 1)."</td>\n";
|
||||
|
||||
// EMail
|
||||
print "<td>".dol_print_email($objp->email, 0, 0, 1)."</td>\n";
|
||||
@ -740,9 +740,9 @@ if ($rowid > 0) {
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap left">';
|
||||
print '<td class="nowrap center">';
|
||||
if (!empty($objp->subscription)) {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
print '<span class="opacitymedium">'.$langs->trans("SubscriptionNotReceived").'</span>';
|
||||
if ($objp->status > 0) {
|
||||
print " ".img_warning();
|
||||
}
|
||||
@ -758,7 +758,7 @@ if ($rowid > 0) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->rights->adherent->supprimer) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resign&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
@ -845,7 +845,7 @@ if ($rowid > 0) {
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('comment', $object->note, '', 280, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||
$doleditor = new DolEditor('comment', $object->note_public, '', 220, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
|
||||
$doleditor->Create();
|
||||
print "</td></tr>";
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ foreach ($modules as $const => $desc) {
|
||||
if ($action == 'enable_'.strtolower($const)) {
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity);
|
||||
// If fckeditor is active in the product/service description, it is activated in the forms
|
||||
if ($const == 'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
if ($const == 'PRODUCTDESC' && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
|
||||
@ -208,6 +208,32 @@ if ($action == 'updateMask') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") {
|
||||
$val = GETPOST('FICHINTER_ALLOW_ONLINE_SIGN', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") {
|
||||
$val = GETPOST('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@ -594,6 +620,39 @@ print '<input type="submit" class="button button-edit" value="'.$langs->trans("M
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// Allow online signing
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_ONLINE_SIGN">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("AllowOnlineSign");
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_ALLOW_ONLINE_SIGN"'.(getDolGlobalString("FICHINTER_ALLOW_ONLINE_SIGN") ? ' checked' : '').'>';
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// Allow external download
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("AllowExternalDownload");
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"'.(getDolGlobalString("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") ? ' checked' : '').'>';
|
||||
print '</td>';
|
||||
print '<td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -34,14 +34,15 @@ $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "err
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
|
||||
$trackid = GETPOST('trackid');
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$usersignature = $user->signature;
|
||||
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
|
||||
|
||||
if ($action == 'test' || $action == 'send') {
|
||||
// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html.
|
||||
if ($action == 'test' || ($action == 'send' && $trackid = 'test')) {
|
||||
$usersignature = dol_string_nohtmltag($usersignature, 2);
|
||||
}
|
||||
|
||||
@ -130,7 +131,7 @@ $actiontypecode = ''; // Not an event for agenda
|
||||
$triggersendname = ''; // Disable triggers
|
||||
$paramname = 'id';
|
||||
$mode = 'emailfortest';
|
||||
$trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||
$trackid = ($action == 'send' ? GETPOST('trackid', 'aZ09') : $action);
|
||||
$sendcontext = '';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
@ -143,7 +144,6 @@ if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') {
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
@ -73,7 +73,6 @@ $configfileparameters = array(
|
||||
'?dolibarr_main_auth_ldap_admin_pass',
|
||||
'?dolibarr_main_auth_ldap_debug',
|
||||
'separator',
|
||||
'?dolibarr_lib_ADODB_PATH',
|
||||
'?dolibarr_lib_FPDF_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_FPDI_PATH',
|
||||
@ -122,7 +121,6 @@ $configfilelib = array(
|
||||
'dolibarr_main_auth_ldap_admin_pass',
|
||||
'dolibarr_main_auth_ldap_debug',
|
||||
'separator',
|
||||
'dolibarr_lib_ADODB_PATH',
|
||||
'dolibarr_lib_TCPDF_PATH',
|
||||
'dolibarr_lib_FPDI_PATH',
|
||||
'dolibarr_lib_NUSOAP_PATH',
|
||||
|
||||
@ -342,7 +342,6 @@ $configfileparameters = array(
|
||||
'?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
|
||||
'?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
|
||||
'separator3' => '',
|
||||
'?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
|
||||
'?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
|
||||
|
||||
@ -212,10 +212,10 @@ function hideoptions(){
|
||||
|
||||
if (div.style.display === "none") {
|
||||
div.style.display = "block";
|
||||
lnk.innerText="'.$langs->trans("HideAdvancedoptions").'";
|
||||
lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'";
|
||||
} else {
|
||||
div.style.display = "none";
|
||||
lnk.innerText="'.$langs->trans("ShowAdvancedOptions").'...";
|
||||
lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'...";
|
||||
}
|
||||
}
|
||||
</script>';
|
||||
|
||||
@ -35,7 +35,7 @@ $langs->load("admin");
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$what = GETPOST('what', 'alpha');
|
||||
$export_type = GETPOST('export_type', 'alpha');
|
||||
$file = GETPOST('filename_template', 'alpha');
|
||||
$file = dol_sanitizeFileName(GETPOST('filename_template', 'alpha'));
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
|
||||
@ -113,9 +113,8 @@ class DolibarrApi
|
||||
unset($object->pass);
|
||||
unset($object->pass_indatabase);
|
||||
|
||||
// Remove linkedObjects. We should already have linkedObjectsIds that avoid huge responses
|
||||
// Remove linkedObjects. We should already have and keep only linkedObjectsIds that avoid huge responses
|
||||
unset($object->linkedObjects);
|
||||
unset($object->linkedObjectsFullLoaded);
|
||||
//unset($object->lines[$i]->linked_objects); // This is the array to create linked object during create
|
||||
|
||||
unset($object->fields);
|
||||
|
||||
@ -90,6 +90,14 @@ if ($fulldayevent) {
|
||||
$datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel');
|
||||
$datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel');
|
||||
}
|
||||
$reg = array();
|
||||
if (GETPOST('datep')) {
|
||||
if (GETPOST('datep') == 'now') {
|
||||
$datep = dol_now();
|
||||
} elseif (preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { // Try to not use this. Use insteead '&datep=now'
|
||||
$datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1], 'tzuser');
|
||||
}
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
@ -151,6 +159,8 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -1068,7 +1078,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -1181,9 +1190,10 @@ if ($action == 'create') {
|
||||
// Type of event
|
||||
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
$default = (empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT) ? 'AC_RDV' : $conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
|
||||
$default = getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT', 'AC_RDV');
|
||||
print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
|
||||
print $formactions->select_type_actions(GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default), "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot
|
||||
$selectedvalue = GETPOSTISSET("actioncode") ? GETPOST("actioncode", 'aZ09') : ($object->type_code ? $object->type_code : $default);
|
||||
print $formactions->select_type_actions($selectedvalue, "actioncode", "systemauto", 0, -1, 0, 1); // TODO Replace 0 with -2 in onlyautoornot
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -1495,11 +1505,6 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
$reg = array();
|
||||
if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) {
|
||||
$object->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]);
|
||||
}
|
||||
|
||||
// Priority
|
||||
if (!empty($conf->global->AGENDA_SUPPORT_PRIORITY_IN_EVENTS)) {
|
||||
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Priority").'</td><td colspan="3">';
|
||||
@ -2151,34 +2156,21 @@ if ($id > 0) {
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
$morehtmlref .= $langs->trans('Project').' ';
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
|
||||
//$morehtmlref .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button button-save valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1591,16 +1591,16 @@ class ActionComm extends CommonObject
|
||||
|
||||
$tooltip = img_picto('', $this->picto).' <u>'.$langs->trans('Action').'</u>';
|
||||
if (!empty($this->ref)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Ref').':</b> '.dol_escape_htmltag($this->ref);
|
||||
}
|
||||
if (!empty($label)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Title').':</b> '.$label;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Title').':</b> '.dol_escape_htmltag($label);
|
||||
}
|
||||
if (!empty($labeltype)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.$labeltype;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.dol_escape_htmltag($labeltype);
|
||||
}
|
||||
if (!empty($this->location)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.$this->location;
|
||||
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.dol_escape_htmltag($this->location);
|
||||
}
|
||||
if (isset($this->transparency)) {
|
||||
$tooltip .= '<br><b>'.$langs->trans('Busy').':</b> '.yn($this->transparency);
|
||||
@ -1609,7 +1609,7 @@ class ActionComm extends CommonObject
|
||||
$langs->load("mails");
|
||||
$tooltip .= '<br>';
|
||||
//$tooltip .= '<br><b>'.img_picto('', 'email').' '.$langs->trans("Email").'</b>';
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTopic').':</b> '.$this->email_subject;
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTopic').':</b> '.dol_escape_htmltag($this->email_subject);
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailFrom').':</b> '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_from);
|
||||
$tooltip .= '<br><b>'.$langs->trans('MailTo').':</b> '.str_replace(array('<', '>'), array('&lt', '&gt'), $this->email_to);
|
||||
if (!empty($this->email_tocc)) {
|
||||
@ -1697,7 +1697,7 @@ class ActionComm extends CommonObject
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
$result .= $labelshort;
|
||||
$result .= dol_escape_htmltag($labelshort);
|
||||
$result .= $linkend;
|
||||
|
||||
global $action;
|
||||
|
||||
@ -89,7 +89,8 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$permissiontoadd = $user->rights->agenda->myactions->read; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||
$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
$permissiontoadd = $usercancreate;
|
||||
|
||||
|
||||
/*
|
||||
@ -162,17 +163,22 @@ if ($object->id > 0) {
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
$morehtmlref .= $langs->trans('Project').': ';
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
//$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
@ -1272,9 +1272,9 @@ if (count($listofextcals)) {
|
||||
$event->datef = $dateend + $usertime;
|
||||
|
||||
if ($icalevent['SUMMARY']) {
|
||||
$event->label = $icalevent['SUMMARY'];
|
||||
$event->label = dol_string_nohtmltag($icalevent['SUMMARY']);
|
||||
} elseif ($icalevent['DESCRIPTION']) {
|
||||
$event->label = dol_nl2br($icalevent['DESCRIPTION'], 1);
|
||||
$event->label = dol_nl2br(dol_string_nohtmltag($icalevent['DESCRIPTION']), 1);
|
||||
} else {
|
||||
$event->label = $langs->trans("ExtSiteNoLabel");
|
||||
}
|
||||
@ -1985,7 +1985,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
// Show title
|
||||
$titletoshow = $daterange;
|
||||
$titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle);
|
||||
$titletoshow .= ($titletoshow ? ' ' : '').dol_escape_htmltag($event->label ? $event->label : $event->libelle);
|
||||
|
||||
if ($event->type_code != 'ICALEVENT') {
|
||||
$savlabel = $event->label ? $event->label : $event->libelle;
|
||||
|
||||
@ -50,6 +50,8 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -89,17 +91,22 @@ $morehtmlref = '<div class="refidno">';
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
$morehtmlref .= $langs->trans('Project').': ';
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
//$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
@ -84,6 +84,8 @@ if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -124,8 +126,6 @@ if (empty($reshook)) {
|
||||
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings');
|
||||
$action = '';
|
||||
} else {
|
||||
$upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing');
|
||||
|
||||
if ($object->statut == 0) {
|
||||
dol_print_error('', 'ErrorMailIsNotValidated');
|
||||
exit;
|
||||
@ -318,7 +318,8 @@ if (empty($reshook)) {
|
||||
|
||||
// Mail making
|
||||
$trackid = 'emailing-'.$obj->fk_mailing.'-'.$obj->rowid;
|
||||
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing');
|
||||
$upload_dir_tmp = $upload_dir;
|
||||
$mail = new CMailFile($newsubject, $sendto, $from, $newmessage, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $errorsto, $arr_css, $trackid, $moreinheader, 'emailing', '', $upload_dir_tmp);
|
||||
|
||||
if ($mail->error) {
|
||||
$res = 0;
|
||||
@ -478,7 +479,8 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
$trackid = 'emailing-test';
|
||||
$mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing');
|
||||
$upload_dir_tmp = $upload_dir;
|
||||
$mailfile = new CMailFile($tmpsujet, $object->sendto, $object->email_from, $tmpbody, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $object->email_errorsto, $arr_css, $trackid, '', 'emailing', '', $upload_dir_tmp);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
@ -729,8 +731,11 @@ if ($action == 'create') {
|
||||
print dol_get_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="title" value="'.dol_escape_htmltag(GETPOST('title')).'" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO) ? $conf->global->MAILING_EMAIL_ERRORSTO : $conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||
|
||||
// Other attributes
|
||||
@ -742,7 +747,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</br><br>';
|
||||
print '<br><br>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input class="flat minwidth200 quatrevingtpercent" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet', 'alphanohtml')).'"></td></tr>';
|
||||
@ -887,16 +892,16 @@ if ($action == 'create') {
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield">';
|
||||
print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||
print $form->editfieldkey("MailTitle", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||
print $form->editfieldval("MailTitle", 'title', $object->title, $object, $user->hasRight('mailing', 'creer'), 'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// From
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||
print $form->editfieldkey("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||
print $form->editfieldval("MailFrom", 'email_from', $object->email_from, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string');
|
||||
$email = CMailFile::getValidAddress($object->email_from, 2);
|
||||
if ($email && !isValidEmail($email)) {
|
||||
$langs->load("errors");
|
||||
@ -910,9 +915,9 @@ if ($action == 'create') {
|
||||
|
||||
// Errors to
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||
print $form->editfieldkey("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->rights->mailing->creer && $object->statut < 3, 'string');
|
||||
print $form->editfieldval("MailErrorsTo", 'email_errorsto', $object->email_errorsto, $object, $user->hasRight('mailing', 'creer') && $object->statut < 3, 'string');
|
||||
$email = CMailFile::getValidAddress($object->email_errorsto, 2);
|
||||
if ($email && !isValidEmail($email)) {
|
||||
$langs->load("errors");
|
||||
@ -977,11 +982,11 @@ if ($action == 'create') {
|
||||
if (GETPOST('cancel', 'alpha') || $confirm == 'no' || $action == '' || in_array($action, array('settodraft', 'valid', 'delete', 'sendall', 'clone', 'test'))) {
|
||||
print "\n\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if (($object->statut == 1) && ($user->rights->mailing->valider || $object->user_validation == $user->id)) {
|
||||
if (($object->statut == 1) && ($user->hasRight('mailing', 'valider') || $object->user_validation == $user->id)) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=settodraft&token='.newToken().'&id='.$object->id.'">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
|
||||
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) {
|
||||
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->hasRight('mailing', 'creer')) {
|
||||
if (isModEnabled('fckeditor') && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("EditWithEditor").'</a>';
|
||||
} else {
|
||||
@ -1011,7 +1016,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->rights->mailing->valider) {
|
||||
if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->hasRight('mailing', 'valider')) {
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("SendingFromWebInterfaceIsNotAllowed")).'">'.$langs->trans("SendMailing").'</a>';
|
||||
} elseif (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) {
|
||||
@ -1021,11 +1026,11 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user->rights->mailing->creer) {
|
||||
if ($user->hasRight('mailing', 'creer')) {
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=clone&object=emailing&id='.$object->id.'">'.$langs->trans("ToClone").'</a>';
|
||||
}
|
||||
|
||||
if (($object->statut == 2 || $object->statut == 3) && $user->rights->mailing->valider) {
|
||||
if (($object->statut == 2 || $object->statut == 3) && $user->hasRight('mailing', 'valider')) {
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("ResetMailing").'</a>';
|
||||
} else {
|
||||
@ -1033,7 +1038,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
if (($object->statut <= 1 && $user->rights->mailing->creer) || $user->rights->mailing->supprimer) {
|
||||
if (($object->statut <= 1 && $user->hasRight('mailing', 'creer')) || $user->hasRight('mailing', 'supprimer')) {
|
||||
if ($object->statut > 0 && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->delete)) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("DeleteMailing").'</a>';
|
||||
} else {
|
||||
@ -1262,8 +1267,9 @@ if ($action == 'create') {
|
||||
$out .= '<br></div>';
|
||||
}
|
||||
} else {
|
||||
$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
//$out .= '<span class="opacitymedium">'.$langs->trans("NoAttachedFiles").'</span><br>';
|
||||
}
|
||||
|
||||
// Add link to add file
|
||||
$maxfilesizearray = getMaxFileSizeArray();
|
||||
$maxmin = $maxfilesizearray['maxmin'];
|
||||
@ -1272,7 +1278,7 @@ if ($action == 'create') {
|
||||
}
|
||||
$out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="'.$langs->trans("Upload").'" />';
|
||||
$out .= ' ';
|
||||
$out .= '<input type="submit" class="button" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
$out .= '<input type="submit" class="button smallpaddingimp" id="'.$addfileaction.'" name="'.$addfileaction.'" value="'.$langs->trans("MailingAddFile").'" />';
|
||||
print $out;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -2297,39 +2297,28 @@ if ($action == 'create') {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br><span class="hideonsmartphone">'.$langs->trans('ThirdParty').' : </span>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br><span class="paddingrightonly">'.$langs->trans('Project').'</span>';
|
||||
$morehtmlref .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ': '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2343,7 +2332,7 @@ if ($action == 'create') {
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Link for thirdparty discounts
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
@ -2403,7 +2392,7 @@ if ($action == 'create') {
|
||||
// Date end proposal
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('DateEndPropal');
|
||||
print '</td>';
|
||||
if ($action != 'editecheance' && $usercancreate && $caneditfield) {
|
||||
|
||||
@ -109,9 +109,7 @@ class PropaleStats extends Stats
|
||||
}
|
||||
|
||||
if ($categid) {
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = p.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie';
|
||||
$this->where .= ' AND c.rowid = '.((int) $categid);
|
||||
$this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = p.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +69,8 @@ if (!empty($user->socid)) {
|
||||
}
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* Add a new contact
|
||||
@ -137,37 +139,25 @@ if ($object->id > 0) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +90,8 @@ if (!empty($user->socid)) {
|
||||
}
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -135,37 +137,25 @@ if ($object->id > 0) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,6 +53,8 @@ if (!empty($user->socid)) {
|
||||
}
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -82,37 +84,25 @@ $morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +59,8 @@ $hookmanager->initHooks(array('propalnote'));
|
||||
|
||||
restrictedArea($user, 'propal', $object->id, 'propal');
|
||||
|
||||
$usercancreate = $user->hasRight("propal", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -107,37 +109,25 @@ if ($object->id > 0) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->propal->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2326,39 +2326,28 @@ if ($action == 'create' && $usercancreate) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
$morehtmlref .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4200,6 +4200,12 @@ class OrderLine extends CommonOrderLine
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
if (!$objp) {
|
||||
$this->error = 'OrderLine with id '. $rowid .' not found sql='.$sql;
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->rowid = $objp->rowid;
|
||||
$this->id = $objp->rowid;
|
||||
$this->fk_commande = $objp->fk_commande;
|
||||
|
||||
@ -109,9 +109,7 @@ class CommandeStats extends Stats
|
||||
}
|
||||
|
||||
if ($categid) {
|
||||
$this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie';
|
||||
$this->where .= ' AND cat.rowid = '.((int) $categid);
|
||||
$this->where .= ' AND EXISTS (SELECT rowid FROM '.$this->categ_link.' as cats WHERE cats.fk_soc = c.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -47,8 +47,11 @@ if ($user->socid) {
|
||||
}
|
||||
$result = restrictedArea($user, 'commande', $id, '');
|
||||
|
||||
$usercancreate = $user->hasRight("commande", "creer");
|
||||
|
||||
$object = new Commande($db);
|
||||
|
||||
|
||||
/*
|
||||
* Ajout d'un nouveau contact
|
||||
*/
|
||||
@ -130,37 +133,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->commande->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,7 +73,8 @@ if (!$sortfield) {
|
||||
|
||||
$object = new Commande($db);
|
||||
|
||||
$permissiontoadd = $user->rights->commande->creer;
|
||||
$usercancreate = $user->hasRight("commande", "creer");
|
||||
$permissiontoadd = $usercancreate;
|
||||
|
||||
// Security check
|
||||
if ($user->socid) {
|
||||
@ -129,37 +130,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->commande->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +50,8 @@ if ($user->socid) {
|
||||
}
|
||||
$result = restrictedArea($user, 'commande', $comid, '');
|
||||
|
||||
$usercancreate = $user->hasRight("commande", "creer");
|
||||
|
||||
$object = new Commande($db);
|
||||
if (!$object->fetch($id, $ref) > 0) {
|
||||
dol_print_error($db);
|
||||
@ -82,37 +84,25 @@ $morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->commande->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +52,10 @@ $hookmanager->initHooks(array('ordernote'));
|
||||
|
||||
$result = restrictedArea($user, 'commande', $id, '');
|
||||
|
||||
$usercancreate = $user->hasRight("commande", "creer");
|
||||
|
||||
$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
$object = new Commande($db);
|
||||
if (!$object->fetch($id, $ref) > 0) {
|
||||
@ -59,8 +63,6 @@ if (!$object->fetch($id, $ref) > 0) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -101,37 +103,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->commande->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button button-edit valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4363,39 +4363,28 @@ if ($action == 'create') {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
$morehtmlref .= '<br>';
|
||||
if ($usercancreate) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5812,6 +5812,11 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if ($result) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
if (!$objp) {
|
||||
$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->rowid = $objp->rowid;
|
||||
$this->id = $objp->rowid;
|
||||
$this->fk_facture = $objp->fk_facture;
|
||||
|
||||
@ -118,9 +118,7 @@ class FactureStats extends Stats
|
||||
}
|
||||
|
||||
if ($categid) {
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = f.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie';
|
||||
$this->where .= ' AND c.rowid = '.((int) $categid);
|
||||
$this->where .= ' AND EXISTS (SELECT rowid FROM '.MAIN_DB_PREFIX.'categorie_societe as cats WHERE cats.fk_soc = f.fk_soc AND cats.fk_categorie = '.((int) $categid).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -58,6 +58,8 @@ if ($id > 0 || !empty($ref)) {
|
||||
|
||||
$result = restrictedArea($user, 'facture', $object->id);
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* Add a new contact
|
||||
@ -136,37 +138,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->facture->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,6 +81,8 @@ if ($user->socid) {
|
||||
}
|
||||
$result = restrictedArea($user, 'facture', $object->id, '');
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -140,37 +142,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->facture->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +59,8 @@ $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||
|
||||
$result = restrictedArea($user, 'facture', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -96,37 +98,25 @@ $morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->facture->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1420,13 +1420,13 @@ if ($resql) {
|
||||
// Payment mode
|
||||
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10, 1, '', 1);
|
||||
print $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 0, 1, 'minwidth100 maxwidth100', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Payment terms
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1);
|
||||
print $form->getSelectConditionsPaiements($search_paymentterms, 'search_paymentterms', -1, 1, 1, 'minwidth100 maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
// Module source
|
||||
@ -2129,8 +2129,9 @@ if ($resql) {
|
||||
|
||||
// Payment mode
|
||||
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
|
||||
$s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1);
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).'">';
|
||||
print $s;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -2139,8 +2140,9 @@ if ($resql) {
|
||||
|
||||
// Payment terms
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
print '<td>';
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none');
|
||||
$s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 0, '', -1, -1, 1);
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).'">';
|
||||
print $s;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@ -59,6 +59,8 @@ $hookmanager->initHooks(array('invoicenote'));
|
||||
|
||||
$result = restrictedArea($user, 'facture', $id, '');
|
||||
|
||||
$usercancreate = $user->hasRight("facture", "creer");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -118,37 +120,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->facture->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -349,7 +349,7 @@ if ($object->id > 0) {
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
}
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
if ($type == 'bank-transfer') {
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?socid='.$object->thirdparty->id.'&search_company='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
|
||||
@ -363,33 +363,20 @@ if ($object->id > 0) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($usercancreate) {
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= '<input type="hidden" name="type" value="'.$type.'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ if ($id > 0 || $ref) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $form->selectarray("methode", $object->methodes_trans);
|
||||
print '</td></tr>';
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.dol_escape_htmltag($proj->title);
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
|
||||
@ -1473,39 +1473,38 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Categories
|
||||
if (isModEnabled('categorie') && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!empty($object->socid)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ContactByDefaultFor").'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $formcompany->showRoles("roles", $object, 'view', $object->roles);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
$parameters = array('socid'=>$socid);
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
$object->load_ref_elements();
|
||||
|
||||
if (isModEnabled("propal")) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
|
||||
print '<tr><td class="titlefield tdoverflow">'.$langs->trans("ContactForProposals").'</td><td>';
|
||||
print $object->ref_propal ? $object->ref_propal : $langs->trans("NoContactForAnyProposal");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (isModEnabled('commande') || isModEnabled("expedition")) {
|
||||
print '<tr><td>';
|
||||
print '<tr><td class="titlefield tdoverflow">';
|
||||
if (isModEnabled("expedition")) {
|
||||
print $langs->trans("ContactForOrdersOrShipments");
|
||||
} else {
|
||||
print $langs->trans("ContactForOrders");
|
||||
}
|
||||
print '</td><td colspan="3">';
|
||||
print '</td><td>';
|
||||
$none = $langs->trans("NoContactForAnyOrder");
|
||||
if (isModEnabled("expedition")) {
|
||||
$none = $langs->trans("NoContactForAnyOrderOrShipments");
|
||||
@ -1515,18 +1514,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
if (isModEnabled('contrat')) {
|
||||
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
|
||||
print '<tr><td class="tdoverflow">'.$langs->trans("ContactForContracts").'</td><td>';
|
||||
print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (isModEnabled('facture')) {
|
||||
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
|
||||
print '<tr><td class="tdoverflow">'.$langs->trans("ContactForInvoices").'</td><td>';
|
||||
print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td colspan="3">';
|
||||
print '<tr><td>'.$langs->trans("DolibarrLogin").'</td><td>';
|
||||
if ($object->user_id) {
|
||||
$dolibarr_user = new User($db);
|
||||
$result = $dolibarr_user->fetch($object->user_id);
|
||||
|
||||
@ -520,7 +520,7 @@ if ($sql_select) {
|
||||
}
|
||||
|
||||
$text .= ' - '.(!empty($objp->label) ? $objp->label : $label);
|
||||
$description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description));
|
||||
$description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description));
|
||||
}
|
||||
|
||||
if (($objp->info_bits & 2) == 2) {
|
||||
@ -571,7 +571,7 @@ if ($sql_select) {
|
||||
echo get_date_range($objp->date_start, $objp->date_end);
|
||||
|
||||
// Add description in form
|
||||
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
|
||||
print (!empty($objp->description) && $objp->description != $objp->product_label) ? '<br>'.dol_htmlentitiesbr($objp->description) : '';
|
||||
}
|
||||
} else {
|
||||
@ -608,7 +608,7 @@ if ($sql_select) {
|
||||
// Show range
|
||||
$prodreftxt .= get_date_range($objp->date_start, $objp->date_end);
|
||||
// Add description in form
|
||||
if (!empty($conf->global->PRODUIT_DESC_IN_FORM))
|
||||
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE'))
|
||||
{
|
||||
$prodreftxt .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
||||
}
|
||||
|
||||
@ -76,6 +76,8 @@ if (!$sortorder) {
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('agendacontract', 'globalcard'));
|
||||
|
||||
$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -166,40 +168,28 @@ if ($id > 0) {
|
||||
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->contrat->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -694,6 +694,8 @@ if (empty($reshook)) {
|
||||
$error++;
|
||||
}
|
||||
$objectline->fetch_optionals();
|
||||
|
||||
$objectline->oldcopy = dol_clone($objectline);
|
||||
}
|
||||
|
||||
$db->begin();
|
||||
@ -977,7 +979,6 @@ if (empty($reshook)) {
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->contrat->multidir_output[$object->entity];
|
||||
$permissiontoadd = $user->rights->contrat->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
// Actions to send emails
|
||||
@ -1372,39 +1373,28 @@ if ($action == 'create') {
|
||||
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->contrat->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if ($permissiontoadd) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1589,7 +1579,7 @@ if ($action == 'create') {
|
||||
$description = $objp->description;
|
||||
|
||||
// Add description in form
|
||||
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
|
||||
$text .= (!empty($objp->description) && $objp->description != $objp->plabel) ? '<br>'.dol_htmlentitiesbr($objp->description) : '';
|
||||
$description = ''; // Already added into main visible desc
|
||||
}
|
||||
|
||||
@ -2441,18 +2441,15 @@ class Contrat extends CommonObject
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @return int 0 if KO, 1 if OK
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @return int < 0 if KO, 0 = no doc generated, > 0 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("contracts");
|
||||
$outputlangs->load("products");
|
||||
|
||||
if (!dol_strlen($modele)) {
|
||||
$modele = 'strato';
|
||||
$modele = ''; // No doc template/generation by default
|
||||
|
||||
if (!empty($this->model_pdf)) {
|
||||
$modele = $this->model_pdf;
|
||||
@ -2463,9 +2460,15 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$modelpath = "core/modules/contract/doc/";
|
||||
if (empty($modele)) {
|
||||
return 0;
|
||||
} else {
|
||||
$langs->load("contracts");
|
||||
$outputlangs->load("products");
|
||||
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
$modelpath = "core/modules/contract/doc/";
|
||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2805,7 +2808,8 @@ class ContratLigne extends CommonObjectLine
|
||||
public $table_element = 'contratdet';
|
||||
|
||||
/**
|
||||
* @var string Name to use for 'features' parameter to check module permissions with restrictedArea()
|
||||
* @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
|
||||
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
|
||||
*/
|
||||
public $element_for_permission = 'contrat';
|
||||
|
||||
@ -3388,7 +3392,7 @@ class ContratLigne extends CommonObjectLine
|
||||
}
|
||||
}
|
||||
|
||||
// If we change a planned date (start or end), sync dates for all services
|
||||
// If we change a planned date (start or end) of one contract line, sync dates for all other services too
|
||||
if (!$error && !empty($conf->global->CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES)) {
|
||||
dol_syslog(get_class($this)."::update CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES is on so we update date for all lines", LOG_DEBUG);
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@ $object = new Contrat($db);
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contractcard', 'globalcard'));
|
||||
|
||||
$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -153,37 +155,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->contrat->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,40 +139,28 @@ if ($object->id) {
|
||||
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
|
||||
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
|
||||
}
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->contrat->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,6 +54,7 @@ $result = restrictedArea($user, 'contrat', $id);
|
||||
$object = new Contrat($db);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$permissiontoadd = $user->rights->contrat->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
@ -110,37 +111,25 @@ if ($id > 0 || !empty($ref)) {
|
||||
$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if ($user->rights->contrat->creer) {
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
$morehtmlref .= ' : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->thirdparty->id, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->thirdparty->id, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,6 +108,10 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
|
||||
$trackid = GETPOST('trackid', 'aZ09');
|
||||
}
|
||||
|
||||
// Set tmp user directory (used to convert images embedded as img src=data:image)
|
||||
$vardir = $conf->user->dir_output."/".$user->id;
|
||||
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
|
||||
|
||||
$subject = '';
|
||||
//$actionmsg = '';
|
||||
$actionmsg2 = '';
|
||||
@ -359,7 +363,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
|
||||
if (empty($sendcontext)) {
|
||||
$sendcontext = 'standard';
|
||||
}
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid, '', $sendcontext);
|
||||
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', $trackid, '', $sendcontext, '', $upload_dir_tmp);
|
||||
|
||||
if (!empty($mailfile->error) || !empty($mailfile->errors)) {
|
||||
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
|
||||
|
||||
@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
$action = GETPOST('action', 'aZ09'); // set or del
|
||||
$name = GETPOST('name', 'alpha');
|
||||
$entity = GETPOST('entity', 'int');
|
||||
$value = ((GETPOST('value', 'int') || GETPOST('value', 'int') == '0') ? GETPOST('value', 'int') : 1);
|
||||
$value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : 1);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -314,6 +314,93 @@ if ($action == "importSignature") {
|
||||
// We should just create an image file with the signature.
|
||||
}
|
||||
}
|
||||
} elseif ($mode == 'fichinter') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
$object = new Fichinter($db);
|
||||
$object->fetch(0, $ref);
|
||||
|
||||
$upload_dir = !empty($conf->ficheinter->multidir_output[$object->entity])?$conf->ficheinter->multidir_output[$object->entity]:$conf->ficheinter->dir_output;
|
||||
$upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/';
|
||||
$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
|
||||
$filename = "signatures/".$date."_signature.png";
|
||||
if (!is_dir($upload_dir."signatures/")) {
|
||||
if (!dol_mkdir($upload_dir."signatures/")) {
|
||||
$response ="Error mkdir. Failed to create dir ".$upload_dir."signatures/";
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$return = file_put_contents($upload_dir.$filename, $data);
|
||||
if ($return == false) {
|
||||
$error++;
|
||||
$response = 'Error file_put_content: failed to create signature file.';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Defined modele of doc
|
||||
$last_main_doc_file = $object->last_main_doc;
|
||||
$directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc
|
||||
if (preg_match('/\.pdf/i', $last_main_doc_file)) {
|
||||
// TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
|
||||
$newpdffilename = $upload_dir.$ref."_signed-".$date.".pdf";
|
||||
$sourcefile = $upload_dir.$ref.".pdf";
|
||||
|
||||
if (dol_is_file($sourcefile)) {
|
||||
// We build the new PDF
|
||||
$pdf = pdf_getInstance();
|
||||
if (class_exists('TCPDF')) {
|
||||
$pdf->setPrintHeader(false);
|
||||
$pdf->setPrintFooter(false);
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($langs));
|
||||
|
||||
if (getDolGlobalString('MAIN_DISABLE_PDF_COMPRESSION')) {
|
||||
$pdf->SetCompression(false);
|
||||
}
|
||||
|
||||
|
||||
//$pdf->Open();
|
||||
$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
|
||||
$s = array(); // Array with size of each page. Exemple array(w'=>210, 'h'=>297);
|
||||
for ($i=1; $i<($pagecount+1); $i++) {
|
||||
try {
|
||||
$tppl = $pdf->importPage($i);
|
||||
$s = $pdf->getTemplatesize($tppl);
|
||||
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
||||
$pdf->useTemplate($tppl);
|
||||
} catch (Exception $e) {
|
||||
dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR);
|
||||
$response = $e->getMessage();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
|
||||
// TODO Get position of box from PDF template
|
||||
$xforimgstart = 105;
|
||||
$yforimgstart = (empty($s['h']) ? 250 : $s['h'] - 57);
|
||||
$wforimg = $s['w']/1 - ($xforimgstart + 16);
|
||||
$pdf->Image($upload_dir.$filename, $xforimgstart, $yforimgstart, $wforimg, round($wforimg / 4));
|
||||
//$pdf->Close();
|
||||
$pdf->Output($newpdffilename, "F");
|
||||
|
||||
// Index the new file and update the last_main_doc property of object.
|
||||
$object->indexFile($newpdffilename, 1);
|
||||
}
|
||||
if (!$error) {
|
||||
$response = "success";
|
||||
}
|
||||
} elseif (preg_match('/\.odt/i', $last_main_doc_file)) {
|
||||
// Adding signature on .ODT not yet supported
|
||||
// TODO
|
||||
} else {
|
||||
// Document format not supported to insert online signature.
|
||||
// We should just create an image file with the signature.
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
|
||||
@ -169,12 +169,6 @@ class box_services_contracts extends ModeleBoxes
|
||||
}
|
||||
$description = $objp->description;
|
||||
|
||||
// Add description in form
|
||||
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
//$text .= (!empty($objp->description) && $objp->description!=$objp->product_label)?'<br>'.dol_htmlentitiesbr($objp->description):'';
|
||||
$description = ''; // Already added into main visible desc
|
||||
}
|
||||
|
||||
$s = $form->textwithtooltip($text, $description, 3, '', '', '', 0, (!empty($objp->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
||||
} else {
|
||||
$s = img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description);
|
||||
|
||||
@ -120,6 +120,10 @@ class CMailFile
|
||||
* @var array filenames list (List of attached file name in message)
|
||||
*/
|
||||
public $mimefilename_list = array();
|
||||
/**
|
||||
* @var array filenames cid
|
||||
*/
|
||||
public $cid_list = array();
|
||||
|
||||
// Image
|
||||
public $html;
|
||||
@ -159,8 +163,9 @@ class CMailFile
|
||||
* @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'mail' and 'smtps' for the moment)
|
||||
* @param string $sendcontext 'standard', 'emailing', ... (used to define which sending mode and parameters to use)
|
||||
* @param string $replyto Reply-to email (will be set to same value than From by default if not provided)
|
||||
* @param string $upload_dir_tmp Temporary directory (used to convert images embedded as img src=data:image)
|
||||
*/
|
||||
public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '')
|
||||
public function __construct($subject, $to, $from, $msg, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = 0, $errors_to = '', $css = '', $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '')
|
||||
{
|
||||
global $conf, $dolibarr_main_data_root, $user;
|
||||
|
||||
@ -171,6 +176,8 @@ class CMailFile
|
||||
}
|
||||
}
|
||||
|
||||
$cid_list = array();
|
||||
|
||||
$this->sendcontext = $sendcontext;
|
||||
|
||||
// Define this->sendmode ('mail', 'smtps', 'siwftmailer', ...) according to $sendcontext ('standard', 'emailing', 'ticket')
|
||||
@ -248,26 +255,41 @@ class CMailFile
|
||||
|
||||
$findimg = 0;
|
||||
if (!empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS)) {
|
||||
// Search into the body for <img tags of links in medias files to replace them with an embedded file
|
||||
// Note because media links are public, this should be useless, except avoid blocking images with email browser.
|
||||
// This convert an embedd file with src="/viewimage.php?modulepart... into a cid link
|
||||
$findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias');
|
||||
}
|
||||
if (!empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_DATA)) {
|
||||
// Search into the body for <img src="data:image/ext;base64,..." to replace them with an embedded file
|
||||
// This convert an embedded file with src="data:image... into a cid link + attached file
|
||||
$findimg = $this->findHtmlImagesIsSrcData($upload_dir_tmp);
|
||||
}
|
||||
|
||||
// Define if there is at least one file
|
||||
// Set atleastoneimage if there is at least one embedded file (into ->html_images)
|
||||
if ($findimg) {
|
||||
foreach ($this->html_images as $i => $val) {
|
||||
if ($this->html_images[$i]) {
|
||||
$this->atleastoneimage = 1;
|
||||
if ($this->html_images[$i]['type'] == 'cidfromdata') {
|
||||
$posindice = count($filename_list);
|
||||
$filename_list[$posindice] = $this->html_images[$i]['fullpath'];
|
||||
$mimetype_list[$posindice] = $this->html_images[$i]['content_type'];
|
||||
$mimefilename_list[$posindice] = $this->html_images[$i]['name'];
|
||||
$cid_list[$posindice] = $this->html_images[$i]['cid'];
|
||||
}
|
||||
dol_syslog("CMailFile::CMailfile: html_images[$i]['name']=".$this->html_images[$i]['name'], LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Define if there is at least one file
|
||||
// Set atleastoneimage if there is at least one file (into $filename_list array)
|
||||
if (is_array($filename_list)) {
|
||||
foreach ($filename_list as $i => $val) {
|
||||
if ($filename_list[$i]) {
|
||||
$this->atleastonefile = 1;
|
||||
dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i], LOG_DEBUG);
|
||||
dol_syslog("CMailFile::CMailfile: filename_list[$i]=".$filename_list[$i].", mimetype_list[$i]=".$mimetype_list[$i]." mimefilename_list[$i]=".$mimefilename_list[$i]." cid_list[$i]=".$cid_list[$i], LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -303,9 +325,6 @@ class CMailFile
|
||||
$this->addr_to = $to;
|
||||
$this->addr_from = $from;
|
||||
$this->msg = $msg;
|
||||
$this->filename_list = $filename_list;
|
||||
$this->mimetype_list = $mimetype_list;
|
||||
$this->mimefilename_list = $mimefilename_list;
|
||||
$this->addr_cc = $addr_cc;
|
||||
$this->addr_bcc = $addr_bcc;
|
||||
$this->deliveryreceipt = $deliveryreceipt;
|
||||
@ -315,9 +334,11 @@ class CMailFile
|
||||
$this->reply_to = $replyto;
|
||||
$this->errors_to = $errors_to;
|
||||
$this->trackid = $trackid;
|
||||
// Set arrays with attached files info
|
||||
$this->filename_list = $filename_list;
|
||||
$this->mimetype_list = $mimetype_list;
|
||||
$this->mimefilename_list = $mimefilename_list;
|
||||
$this->cid_list = $cid_list;
|
||||
|
||||
if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) {
|
||||
$this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO;
|
||||
@ -368,7 +389,7 @@ class CMailFile
|
||||
|
||||
// Add attachments to text_encoded
|
||||
if (!empty($this->atleastonefile)) {
|
||||
$files_encoded = $this->write_files($filename_list, $mimetype_list, $mimefilename_list);
|
||||
$files_encoded = $this->write_files($filename_list, $mimetype_list, $mimefilename_list, $cid_list);
|
||||
}
|
||||
|
||||
// We now define $this->headers and $this->message
|
||||
@ -432,7 +453,7 @@ class CMailFile
|
||||
if (!empty($this->atleastonefile)) {
|
||||
foreach ($filename_list as $i => $val) {
|
||||
$content = file_get_contents($filename_list[$i]);
|
||||
$smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i]);
|
||||
$smtps->setAttachment($content, $mimefilename_list[$i], $mimetype_list[$i], $cid_list[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -487,6 +508,7 @@ class CMailFile
|
||||
if (!empty($conf->global->MAIN_FORCE_DISABLE_MAIL_SPOOFING)) {
|
||||
// Prevent email spoofing for smtp server with a strict configuration
|
||||
$regexp = '/([a-z0-9_\.\-\+])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i'; // This regular expression extracts all emails from a string
|
||||
$adressEmailFrom = array();
|
||||
$emailMatchs = preg_match_all($regexp, $from, $adressEmailFrom);
|
||||
$adressEmailFrom = reset($adressEmailFrom);
|
||||
if ($emailMatchs !== false && filter_var($conf->global->MAIN_MAIL_SMTPS_ID, FILTER_VALIDATE_EMAIL) && $conf->global->MAIN_MAIL_SMTPS_ID !== $adressEmailFrom) {
|
||||
@ -1380,7 +1402,8 @@ class CMailFile
|
||||
if ($this->msgishtml) {
|
||||
// Similar code to forge a text from html is also in smtps.class.php
|
||||
$strContentAltText = preg_replace("/<br\s*[^>]*>/", " ", $strContent);
|
||||
$strContentAltText = html_entity_decode(strip_tags($strContentAltText));
|
||||
// TODO We could replace <img ...> with [Filename.ext] like Gmail do.
|
||||
$strContentAltText = html_entity_decode(strip_tags($strContentAltText)); // Remove any HTML tags
|
||||
$strContentAltText = trim(wordwrap($strContentAltText, 75, empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA) ? "\r\n" : "\n"));
|
||||
|
||||
// Check if html header already in message, if not complete the message
|
||||
@ -1447,9 +1470,10 @@ class CMailFile
|
||||
* @param array $filename_list Tableau
|
||||
* @param array $mimetype_list Tableau
|
||||
* @param array $mimefilename_list Tableau
|
||||
* @return string Chaine fichiers encodes
|
||||
* @param array $cidlist Array of CID if file must be completed with CID code
|
||||
* @return string String with files encoded
|
||||
*/
|
||||
public function write_files($filename_list, $mimetype_list, $mimefilename_list)
|
||||
private function write_files($filename_list, $mimetype_list, $mimefilename_list, $cidlist)
|
||||
{
|
||||
// phpcs:enable
|
||||
$out = '';
|
||||
@ -1472,6 +1496,10 @@ class CMailFile
|
||||
$out .= "Content-Type: ".$mimetype_list[$i]."; name=\"".$filename_list[$i]."\"".$this->eol;
|
||||
$out .= "Content-Transfer-Encoding: base64".$this->eol;
|
||||
$out .= "Content-Description: ".$filename_list[$i].$this->eol;
|
||||
if (!empty($cidlist) && is_array($cidlist) && $cidlist[$i]) {
|
||||
$out .= "X-Attachment-Id: ".$cidlist[$i].$this->eol;
|
||||
$out .= "Content-ID: <".$cidlist[$i].'>'.$this->eol;
|
||||
}
|
||||
$out .= $this->eol;
|
||||
$out .= $encoded;
|
||||
$out .= $this->eol;
|
||||
@ -1628,41 +1656,46 @@ class CMailFile
|
||||
/**
|
||||
* Seearch images into html message and init array this->images_encoded if found
|
||||
*
|
||||
* @param string $images_dir Location of physical images files
|
||||
* @param string $images_dir Location of physical images files. For example $dolibarr_main_data_root.'/medias'
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function findHtmlImages($images_dir)
|
||||
private function findHtmlImages($images_dir)
|
||||
{
|
||||
// Build the list of image extensions
|
||||
// Build the array of image extensions
|
||||
$extensions = array_keys($this->image_types);
|
||||
|
||||
// We search (into mail body this->html), if we find some strings like "... file=xxx.img"
|
||||
// For example when:
|
||||
// <img alt="" src="/viewimage.php?modulepart=medias&entity=1&file=image/picture.jpg" style="height:356px; width:1040px" />
|
||||
$matches = array();
|
||||
preg_match_all('/(?:"|\')([^"\']+\.('.implode('|', $extensions).'))(?:"|\')/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found
|
||||
|
||||
if (!empty($matches)) {
|
||||
$i = 0;
|
||||
// We are interested in $matches[1] only (the second set of parenthesis into regex)
|
||||
foreach ($matches[1] as $full) {
|
||||
$regs = array();
|
||||
if (preg_match('/file=([A-Za-z0-9_\-\/]+[\.]?[A-Za-z0-9]+)?$/i', $full, $regs)) { // If xxx is 'file=aaa'
|
||||
$img = $regs[1];
|
||||
|
||||
if (file_exists($images_dir.'/'.$img)) {
|
||||
// Image path in src
|
||||
$src = preg_quote($full, '/');
|
||||
|
||||
// Image full path
|
||||
$this->html_images[$i]["fullpath"] = $images_dir.'/'.$img;
|
||||
|
||||
// Image name
|
||||
$this->html_images[$i]["name"] = $img;
|
||||
|
||||
// Content type
|
||||
if (preg_match('/^.+\.(\w{3,4})$/', $img, $reg)) {
|
||||
$ext = strtolower($reg[1]);
|
||||
$regext = array();
|
||||
if (preg_match('/^.+\.(\w{3,4})$/', $img, $regext)) {
|
||||
$ext = strtolower($regext[1]);
|
||||
$this->html_images[$i]["content_type"] = $this->image_types[$ext];
|
||||
}
|
||||
|
||||
// cid
|
||||
$this->html_images[$i]["cid"] = dol_hash(uniqid(time()), 3); // Force md5 hash (does not contains special chars)
|
||||
// type
|
||||
$this->html_images[$i]["type"] = 'cidfromurl';
|
||||
|
||||
$this->html = preg_replace("/src=\"$src\"|src='$src'/i", "src=\"cid:".$this->html_images[$i]["cid"]."\"", $this->html);
|
||||
}
|
||||
$i++;
|
||||
@ -1682,6 +1715,7 @@ class CMailFile
|
||||
// Read image file
|
||||
if ($image = file_get_contents($fullpath)) {
|
||||
// On garde que le nom de l'image
|
||||
$regs = array();
|
||||
preg_match('/([A-Za-z0-9_-]+[\.]?[A-Za-z0-9]+)?$/i', $img["name"], $regs);
|
||||
$imgName = $regs[1];
|
||||
|
||||
@ -1706,6 +1740,85 @@ class CMailFile
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seearch images with data:image format into html message
|
||||
*
|
||||
* @param string $images_dir Location of where to store physicaly images files. For example $dolibarr_main_data_root.'/medias'
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
private function findHtmlImagesIsSrcData($images_dir)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Build the array of image extensions
|
||||
$extensions = array_keys($this->image_types);
|
||||
|
||||
if ($images_dir && !dol_is_dir($images_dir)) {
|
||||
dol_mkdir($images_dir, DOL_DATA_ROOT);
|
||||
}
|
||||
|
||||
// Uncomment this for debug
|
||||
/*
|
||||
global $dolibarr_main_data_root;
|
||||
$outputfile = $dolibarr_main_data_root."/dolibarr_mail.log";
|
||||
$fp = fopen($outputfile, "w");
|
||||
fwrite($fp, $this->html);
|
||||
fclose($fp);
|
||||
*/
|
||||
|
||||
// We search (into mail body this->html), if we find some strings like "... file=xxx.img"
|
||||
// For example when:
|
||||
// <img alt="" src="/viewimage.php?modulepart=medias&entity=1&file=image/picture.jpg" style="height:356px; width:1040px" />
|
||||
$matches = array();
|
||||
preg_match_all('/src="data:image\/('.implode('|', $extensions).');base64,([^"]+)"/Ui', $this->html, $matches); // If "xxx.ext" or 'xxx.ext' found
|
||||
|
||||
if (!empty($matches) && !empty($matches[1])) {
|
||||
if (empty($images_dir)) {
|
||||
// No temp directory provided, so we are not able to support convertion of data:image into physical images.
|
||||
$this->error = 'NoTempDirProvidedInCMailConstructorSoCantConvertDataImgOnDisk';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($matches[1] as $key => $ext) {
|
||||
// We save the image to send in disk
|
||||
$filecontent = $matches[2][$key];
|
||||
$cid = dol_hash(uniqid(time()), 3);
|
||||
$destfiletmp = $images_dir.'/'.$cid.'.'.$ext;
|
||||
|
||||
$fhandle = @fopen($destfiletmp, 'w');
|
||||
if ($fhandle) {
|
||||
$nbofbyteswrote = fwrite($fhandle, base64_decode($filecontent));
|
||||
fclose($fhandle);
|
||||
@chmod($destfiletmp, octdec($conf->global->MAIN_UMASK));
|
||||
} else {
|
||||
$this->errors[] = "Failed to open file '".$destfiletmp."' for write";
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (file_exists($destfiletmp)) {
|
||||
// Image full path
|
||||
$this->html_images[$i]["fullpath"] = $destfiletmp;
|
||||
// Image name
|
||||
$this->html_images[$i]["name"] = basename($destfiletmp);
|
||||
// Content type
|
||||
$this->html_images[$i]["content_type"] = $this->image_types[strtolower($ext)];
|
||||
// cid
|
||||
$this->html_images[$i]["cid"] = $cid;
|
||||
// type
|
||||
$this->html_images[$i]["type"] = 'cidfromdata';
|
||||
|
||||
$this->html = preg_replace('/src="data:image\/'.$ext.';base64,'.preg_quote($filecontent, '/').'"/', 'src="cid:'.$this->html_images[$i]["cid"].'"', $this->html);
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a formatted address string for SMTP protocol
|
||||
*
|
||||
|
||||
@ -78,7 +78,7 @@ abstract class CommonObject
|
||||
/**
|
||||
* @var array To store error results of ->validateField()
|
||||
*/
|
||||
public $validateFieldsErrors = array();
|
||||
private $validateFieldsErrors = array();
|
||||
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
@ -86,7 +86,8 @@ abstract class CommonObject
|
||||
public $element;
|
||||
|
||||
/**
|
||||
* @var string Name to use for 'features' parameter to check module permissions with restrictedArea(). Undefined means same value than $element.
|
||||
* @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
|
||||
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
|
||||
*/
|
||||
public $element_for_permission;
|
||||
|
||||
@ -136,9 +137,9 @@ abstract class CommonObject
|
||||
public $linkedObjects;
|
||||
|
||||
/**
|
||||
* @var boolean Array of boolean with object id as key and value as true if linkedObjects full loaded. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction.
|
||||
* @var boolean[] Array of boolean with object id as key and value as true if linkedObjects full loaded for object id. Loaded by ->fetchObjectLinked. Important for pdf generation time reduction.
|
||||
*/
|
||||
public $linkedObjectsFullLoaded = array();
|
||||
private $linkedObjectsFullLoaded = array();
|
||||
|
||||
/**
|
||||
* @var CommonObject To store a cloned copy of object before to edit it and keep track of old properties
|
||||
@ -5015,7 +5016,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$text .= ' - '.(!empty($line->label) ? $line->label : $label);
|
||||
$description .= (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc.
|
||||
$description .= (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : (!empty($line->description) ? dol_htmlentitiesbr($line->description) : '')); // Description is what to show on popup. We shown nothing if already into desc.
|
||||
}
|
||||
|
||||
$line->pu_ttc = price2num((!empty($line->subprice) ? $line->subprice : 0) * (1 + ((!empty($line->tva_tx) ? $line->tva_tx : 0) / 100)), 'MU');
|
||||
@ -7834,7 +7835,7 @@ abstract class CommonObject
|
||||
* get field error message
|
||||
*
|
||||
* @param string $fieldKey Key of attribute
|
||||
* @return string
|
||||
* @return string Error message of validation ('' if no error)
|
||||
*/
|
||||
public function getFieldError($fieldKey)
|
||||
{
|
||||
|
||||
@ -347,7 +347,7 @@ class Conf
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
// Include other local consts.php files and fetch their values to the corresponding database constants.
|
||||
// Include other local file xxx/zzz_consts.php to overwrite some variables
|
||||
if (!empty($this->global->LOCAL_CONSTS_FILES)) {
|
||||
$filesList = explode(":", $this->global->LOCAL_CONSTS_FILES);
|
||||
foreach ($filesList as $file) {
|
||||
@ -675,6 +675,9 @@ class Conf
|
||||
}
|
||||
$this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
|
||||
|
||||
// Set PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE, may be modified later according to browser
|
||||
$this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
|
||||
|
||||
// conf->theme et $this->css
|
||||
if (empty($this->global->MAIN_THEME)) {
|
||||
$this->global->MAIN_THEME = "eldy";
|
||||
|
||||
@ -163,7 +163,7 @@ class DolEditor
|
||||
$skin = 'moono-lisa'; // default with ckeditor 4.6 : moono-lisa
|
||||
}
|
||||
|
||||
$pluginstodisable = 'elementspath,save,flash,div,specialchar';
|
||||
$pluginstodisable = 'elementspath,save,flash,div,specialchar,anchor';
|
||||
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||
$pluginstodisable .= ',scayt,wsc,find,undo';
|
||||
}
|
||||
@ -198,7 +198,7 @@ class DolEditor
|
||||
htmlEncodeOutput:'.$htmlencode_force.',
|
||||
allowedContent:'.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */
|
||||
extraAllowedContent: \'a[target];div{float,display}\', /* Add the style float and display into div to default other allowed tags */
|
||||
disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */
|
||||
disallowedContent: '.($disallowAnyContent ? '\'\'' : '\'\'').', /* Tags that are not allowed */
|
||||
fullPage: '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */
|
||||
toolbar: \''.$this->toolbarname.'\',
|
||||
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
|
||||
|
||||
@ -5384,9 +5384,10 @@ class Form
|
||||
* @param int $maxlength Max length
|
||||
* @param int $forcefocus Force focus on field (works with javascript only)
|
||||
* @param int $nooutput No print is done. String is returned.
|
||||
* @param string $textifnoproject Text to show if no project
|
||||
* @return string Return html content
|
||||
*/
|
||||
public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0)
|
||||
public function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0, $nooutput = 0, $textifnoproject = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@ -5400,7 +5401,6 @@ class Form
|
||||
|
||||
$langs->load("project");
|
||||
if ($htmlname != "none") {
|
||||
$out .= "\n";
|
||||
$out .= '<form method="post" action="'.$page.'">';
|
||||
$out .= '<input type="hidden" name="action" value="classin">';
|
||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -5412,9 +5412,9 @@ class Form
|
||||
if ($selected) {
|
||||
$projet = new Project($this->db);
|
||||
$projet->fetch($selected);
|
||||
$out .= $projet->getNomUrl(1, '', 1);
|
||||
$out .= $projet->getNomUrl(0, '', 1);
|
||||
} else {
|
||||
$out .= " ";
|
||||
$out .= '<span class="opacitymedium">'.$textifnoproject.'</span>';
|
||||
}
|
||||
$out .= '</span>';
|
||||
}
|
||||
@ -5439,22 +5439,26 @@ class Form
|
||||
* @param string $deposit_percent < 0 : deposit_percent input makes no sense (for example, in list filters)
|
||||
* 0 : use default deposit percentage from entry
|
||||
* > 0 : force deposit percentage (for example, from company object)
|
||||
* @param int $nooutput No print is done. String is returned.
|
||||
* @return void
|
||||
*/
|
||||
public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1)
|
||||
public function form_conditions_reglement($page, $selected = '', $htmlname = 'cond_reglement_id', $addempty = 0, $type = '', $filtertype = -1, $deposit_percent = -1, $nooutput = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$out = '';
|
||||
|
||||
if ($htmlname != "none") {
|
||||
print '<form method="POST" action="'.$page.'">';
|
||||
print '<input type="hidden" name="action" value="setconditions">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$out .= '<form method="POST" action="'.$page.'">';
|
||||
$out .= '<input type="hidden" name="action" value="setconditions">';
|
||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if ($type) {
|
||||
print '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
|
||||
$out .= '<input type="hidden" name="type" value="'.dol_escape_htmltag($type).'">';
|
||||
}
|
||||
print $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
|
||||
print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
$out .= $this->getSelectConditionsPaiements($selected, $htmlname, $filtertype, $addempty, 0, '', $deposit_percent);
|
||||
$out .= '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||
$out .= '</form>';
|
||||
} else {
|
||||
if ($selected) {
|
||||
$this->load_cache_conditions_paiements();
|
||||
@ -5465,15 +5469,21 @@ class Form
|
||||
$label = str_replace('__DEPOSIT_PERCENT__', $deposit_percent > 0 ? $deposit_percent : $this->cache_conditions_paiements[$selected]['deposit_percent'], $label);
|
||||
}
|
||||
|
||||
print $label;
|
||||
$out .= $label;
|
||||
} else {
|
||||
$langs->load('errors');
|
||||
print $langs->trans('ErrorNotInDictionaryPaymentConditions');
|
||||
$out .= $langs->trans('ErrorNotInDictionaryPaymentConditions');
|
||||
}
|
||||
} else {
|
||||
print " ";
|
||||
$out .= ' ';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($nooutput)) {
|
||||
print $out;
|
||||
return '';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
@ -5916,19 +5926,20 @@ class Form
|
||||
/**
|
||||
* Output html select to select thirdparty
|
||||
*
|
||||
* @param string $page Page
|
||||
* @param string $selected Id preselected
|
||||
* @param string $htmlname Name of HTML select
|
||||
* @param string $filter Optional filters criteras. Do not use a filter coming from input of users.
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param int $nooutput No print output. Return it only.
|
||||
* @param array $excludeids Exclude IDs from the select combo
|
||||
* @param string $page Page
|
||||
* @param string $selected Id preselected
|
||||
* @param string $htmlname Name of HTML select
|
||||
* @param string $filter Optional filters criteras. Do not use a filter coming from input of users.
|
||||
* @param int $showempty Add an empty field
|
||||
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
|
||||
* @param int $forcecombo Force to use combo box
|
||||
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param int $nooutput No print output. Return it only.
|
||||
* @param array $excludeids Exclude IDs from the select combo
|
||||
* @param string $textifnothirdparty Text to show if no thirdparty
|
||||
* @return void|string
|
||||
*/
|
||||
public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array())
|
||||
public function form_thirdparty($page, $selected = '', $htmlname = 'socid', $filter = '', $showempty = 0, $showtype = 0, $forcecombo = 0, $events = array(), $nooutput = 0, $excludeids = array(), $textifnothirdparty = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@ -5946,9 +5957,9 @@ class Form
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$soc = new Societe($this->db);
|
||||
$soc->fetch($selected);
|
||||
$out .= $soc->getNomUrl($langs);
|
||||
$out .= $soc->getNomUrl(0, '');
|
||||
} else {
|
||||
$out .= " ";
|
||||
$out .= '<span class="opacitymedium">'.$textifnothirdparty.'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -165,9 +165,10 @@ class FormActions
|
||||
* @param int $max Max number of record
|
||||
* @param string $moreparambacktopage More param for the backtopage
|
||||
* @param string $morehtmlcenter More html text on center of title line
|
||||
* @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions)
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '')
|
||||
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
@ -225,9 +226,21 @@ class FormActions
|
||||
$taskid = $object->id;
|
||||
}
|
||||
|
||||
$usercanaddaction = 0;
|
||||
if (empty($assignedtouser) || $assignedtouser == $user->id) {
|
||||
$usercanaddaction = $user->hasRight('agenda', 'myactions', 'create');
|
||||
$assignedtouser = 0;
|
||||
} else {
|
||||
$usercanaddaction = $user->hasRight('agenda', 'allactions', 'create');
|
||||
}
|
||||
|
||||
$newcardbutton = '';
|
||||
if (isModEnabled('agenda') && !empty($user->rights->agenda->myactions->create)) {
|
||||
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : '')).($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '').'&backtopage='.urlencode($urlbacktopage);
|
||||
if (isModEnabled('agenda') && $usercanaddaction) {
|
||||
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create&token='.newToken().'&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser'));
|
||||
$url .= '&origin='.urlencode($typeelement).'&originid='.((int) $object->id).((!empty($object->socid) && $object->socid > 0) ? '&socid='.((int) $object->socid) : ((!empty($socid) && $socid > 0) ? '&socid='.((int) $socid) : ''));
|
||||
$url .= ($projectid > 0 ? '&projectid='.((int) $projectid) : '').($taskid > 0 ? '&taskid='.((int) $taskid) : '');
|
||||
$url .= ($assignedtouser > 0 ? '&assignedtouser='.$assignedtouser : '');
|
||||
$url .= '&backtopage='.urlencode($urlbacktopage);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url);
|
||||
}
|
||||
|
||||
|
||||
@ -1193,7 +1193,7 @@ class FormMail extends Form
|
||||
$out .= "</td></tr>\n";
|
||||
} else {
|
||||
$out = '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td>';
|
||||
$out .= '<input size="30" id="errorstomail" name="errorstomail" value="'.$errorstomail.'" />';
|
||||
$out .= '<input class="minwidth200" id="errorstomail" name="errorstomail" value="'.$errorstomail.'" />';
|
||||
$out .= "</td></tr>\n";
|
||||
}
|
||||
return $out;
|
||||
|
||||
@ -1408,6 +1408,12 @@ class FormTicket
|
||||
$ticketstat = new Ticket($this->db);
|
||||
$res = $ticketstat->fetch('', '', $this->track_id);
|
||||
|
||||
print '<tr><td></td><td>';
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':''));
|
||||
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
|
||||
print '<label for="send_msg_email">'.$langs->trans('SendMessageByEmail').'</label>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Private message (not visible by customer/external user)
|
||||
if (!$user->socid) {
|
||||
print '<tr><td></td><td>';
|
||||
@ -1418,12 +1424,6 @@ class FormTicket
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td></td><td>';
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':''));
|
||||
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
|
||||
print '<label for="send_msg_email">'.$langs->trans('SendMessageByEmail').'</label>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Zone to select its email template
|
||||
if (count($modelmail_array) > 0) {
|
||||
print '<tr class="email_line"><td></td><td colspan="2"><div style="padding: 3px 0 3px 0">'."\n";
|
||||
@ -1610,7 +1610,7 @@ class FormTicket
|
||||
print '</table>';
|
||||
|
||||
print '<center><br>';
|
||||
print '<input type="submit" class="button" name="btn_add_message" value="'.$langs->trans("AddMessage").'" />';
|
||||
print '<input type="submit" class="button" name="btn_add_message" value="'.$langs->trans("Add").'" />';
|
||||
if ($this->withcancel) {
|
||||
print " ";
|
||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
|
||||
@ -1577,11 +1577,14 @@ class SMTPs
|
||||
// loop through all attachments
|
||||
foreach ($_content as $_file => $_data) {
|
||||
$content .= "--".$this->_getBoundary('mixed')."\r\n"
|
||||
. 'Content-Disposition: attachment; filename="'.$_data['fileName'].'"'."\r\n"
|
||||
. 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['fileName'].'"'."\r\n"
|
||||
. 'Content-Transfer-Encoding: base64'."\r\n"
|
||||
. 'Content-Description: '.$_data['fileName']."\r\n";
|
||||
|
||||
. 'Content-Disposition: attachment; filename="'.$_data['fileName'].'"'."\r\n"
|
||||
. 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['fileName'].'"'."\r\n"
|
||||
. 'Content-Transfer-Encoding: base64'."\r\n"
|
||||
. 'Content-Description: '.$_data['fileName']."\r\n";
|
||||
if (!empty($_data['cid'])) {
|
||||
$content .= "X-Attachment-Id: ".$_data['cid']."\r\n";
|
||||
$content .= "Content-ID: <".$_data['cid'].">\r\n";
|
||||
}
|
||||
if ($this->getMD5flag()) {
|
||||
$content .= 'Content-MD5: '.$_data['md5']."\r\n";
|
||||
}
|
||||
@ -1595,9 +1598,9 @@ class SMTPs
|
||||
$content .= "--".$this->_getBoundary('related')."\r\n"; // always related for an inline image
|
||||
|
||||
$content .= 'Content-Type: '.$_data['mimeType'].'; name="'.$_data['imageName'].'"'."\r\n"
|
||||
. 'Content-Transfer-Encoding: base64'."\r\n"
|
||||
. 'Content-Disposition: inline; filename="'.$_data['imageName'].'"'."\r\n"
|
||||
. 'Content-ID: <'.$_data['cid'].'> '."\r\n";
|
||||
. 'Content-Transfer-Encoding: base64'."\r\n"
|
||||
. 'Content-Disposition: inline; filename="'.$_data['imageName'].'"'."\r\n"
|
||||
. 'Content-ID: <'.$_data['cid'].'> '."\r\n";
|
||||
|
||||
if ($this->getMD5flag()) {
|
||||
$content .= 'Content-MD5: '.$_data['md5']."\r\n";
|
||||
@ -1664,9 +1667,10 @@ class SMTPs
|
||||
* @param string $strContent File data to attach to message
|
||||
* @param string $strFileName File Name to give to attachment
|
||||
* @param string $strMimeType File Mime Type of attachment
|
||||
* @param string $strCid File Cid of attachment (if defined, to be shown inline)
|
||||
* @return void
|
||||
*/
|
||||
public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown')
|
||||
public function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown', $strCid = '')
|
||||
{
|
||||
if ($strContent) {
|
||||
$strContent = rtrim(chunk_split(base64_encode($strContent), 76, "\r\n")); // 76 max is defined into http://tools.ietf.org/html/rfc2047
|
||||
@ -1674,6 +1678,7 @@ class SMTPs
|
||||
$this->_msgContent['attachment'][$strFileName]['mimeType'] = $strMimeType;
|
||||
$this->_msgContent['attachment'][$strFileName]['fileName'] = $strFileName;
|
||||
$this->_msgContent['attachment'][$strFileName]['data'] = $strContent;
|
||||
$this->_msgContent['attachment'][$strFileName]['cid'] = $strCid; // If defined, it means this attachment must be shown inline
|
||||
|
||||
if ($this->getMD5flag()) {
|
||||
$this->_msgContent['attachment'][$strFileName]['md5'] = dol_hash($strContent, 3);
|
||||
|
||||
@ -725,9 +725,9 @@ class Translate
|
||||
|
||||
return $str;
|
||||
} else {
|
||||
if ($key[0] == '$') {
|
||||
/*if ($key[0] == '$') {
|
||||
return dol_eval($key, 1, 1, '1');
|
||||
}
|
||||
}*/
|
||||
return $this->getTradFromKey($key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,6 +215,9 @@ class Utils
|
||||
dol_syslog("Utils::dumpDatabase type=".$type." compression=".$compression." file=".$file, LOG_DEBUG);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
// Clean data
|
||||
$file = dol_sanitizeFileName($file);
|
||||
|
||||
// Check compression parameter
|
||||
if (!in_array($compression, array('none', 'gz', 'bz', 'zip', 'zstd'))) {
|
||||
$langs->load("errors");
|
||||
@ -354,6 +357,8 @@ class Utils
|
||||
|
||||
$handle = '';
|
||||
|
||||
// If $lowmemorydump is set, it means we want to make the compression using an external pipe instead retreiving the
|
||||
// content of the dump in PHP memory array $output_arr and then print it into the PHP pipe open with xopen().
|
||||
$lowmemorydump = GETPOSTISSET("lowmemorydump") ? GETPOST("lowmemorydump") : getDolGlobalString('MAIN_LOW_MEMORY_DUMP');
|
||||
|
||||
// Start call method to execute dump
|
||||
@ -371,23 +376,23 @@ class Utils
|
||||
}
|
||||
} else {
|
||||
if ($compression == 'none') {
|
||||
$fullcommandclear .= " > ".$outputfile;
|
||||
$fullcommandcrypted .= " > ".$outputfile;
|
||||
$fullcommandclear .= ' > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$fullcommandcrypted .= ' > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$handle = 1;
|
||||
} elseif ($compression == 'gz') {
|
||||
$fullcommandclear .= " | gzip > ".$outputfile;
|
||||
$fullcommandcrypted .= " | gzip > ".$outputfile;
|
||||
$paramcrypted.=" | gzip";
|
||||
$fullcommandclear .= ' | gzip > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$fullcommandcrypted .= ' | gzip > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$paramcrypted .= ' | gzip';
|
||||
$handle = 1;
|
||||
} elseif ($compression == 'bz') {
|
||||
$fullcommandclear .= " | bzip2 > ".$outputfile;
|
||||
$fullcommandcrypted .= " | bzip2 > ".$outputfile;
|
||||
$paramcrypted.=" | bzip2";
|
||||
$fullcommandclear .= ' | bzip2 > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$fullcommandcrypted .= ' | bzip2 > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$paramcrypted .= ' | bzip2';
|
||||
$handle = 1;
|
||||
} elseif ($compression == 'zstd') {
|
||||
$fullcommandclear .= " | zstd > ".$outputfile;
|
||||
$fullcommandcrypted .= " | zstd > ".$outputfile;
|
||||
$paramcrypted.=" | zstd";
|
||||
$fullcommandclear .= ' | zstd > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$fullcommandcrypted .= ' | zstd > "'.dol_sanitizePathName($outputfile).'"';
|
||||
$paramcrypted .= ' | zstd';
|
||||
$handle = 1;
|
||||
}
|
||||
}
|
||||
@ -411,8 +416,8 @@ class Utils
|
||||
}
|
||||
|
||||
|
||||
// TODO Replace with executeCLI function but
|
||||
// we must first introduce a low memory mode
|
||||
// TODO Replace with Utils->executeCLI() function but
|
||||
// we must first introduce the variant with $lowmemorydump into this method.
|
||||
if ($execmethod == 1) {
|
||||
$output_arr = array();
|
||||
$retval = null;
|
||||
@ -471,15 +476,16 @@ class Utils
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($compression == 'none') {
|
||||
fclose($handle);
|
||||
} elseif ($compression == 'gz') {
|
||||
gzclose($handle);
|
||||
} elseif ($compression == 'bz') {
|
||||
bzclose($handle);
|
||||
} elseif ($compression == 'zstd') {
|
||||
fclose($handle);
|
||||
if (!$lowmemorydump) {
|
||||
if ($compression == 'none') {
|
||||
fclose($handle);
|
||||
} elseif ($compression == 'gz') {
|
||||
gzclose($handle);
|
||||
} elseif ($compression == 'bz') {
|
||||
bzclose($handle);
|
||||
} elseif ($compression == 'zstd') {
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_UMASK)) {
|
||||
@ -1249,9 +1255,10 @@ class Utils
|
||||
* @param string $message Message
|
||||
* @param string $filename List of files to attach (full path of filename on file system)
|
||||
* @param string $filter Filter file send
|
||||
* @param string $sizelimit Limit size to send file
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '')
|
||||
public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '', $sizelimit = 100000000)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -1309,9 +1316,13 @@ class Utils
|
||||
}
|
||||
|
||||
if ($filepath) {
|
||||
if ($filesize > 100000000) {
|
||||
$output = 'Sorry, last backup file is too large to be send by email';
|
||||
$error++;
|
||||
if ($filesize > $sizelimit) {
|
||||
$message .= '<br>'.$langs->trans("BackupIsTooLargeSend");
|
||||
$documenturl = $dolibarr_main_url_root.'/document.php?modulepart=systemtools&atachement=1&file=backup/'.urlencode($filename[0]);
|
||||
$message .= '<br><a href='.$documenturl.'>Lien de téléchargement</a>';
|
||||
$filepath = '';
|
||||
$mimetype = '';
|
||||
$filename = '';
|
||||
}
|
||||
} else {
|
||||
$output = 'No backup file found';
|
||||
|
||||
@ -131,7 +131,12 @@ function bank_prepare_head(Account $object)
|
||||
*/
|
||||
function bank_admin_prepare_head($object)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $langs, $conf, $user, $db;
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('bank_account');
|
||||
$extrafields->fetch_name_optionals_label('bank');
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@ -154,11 +159,19 @@ function bank_admin_prepare_head($object)
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')';
|
||||
$nbExtrafields = $extrafields->attributes['bank_account']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')';
|
||||
$nbExtrafields = $extrafields->attributes['bank']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'bankline_extrafields';
|
||||
$h++;
|
||||
|
||||
|
||||
@ -139,7 +139,11 @@ function fichinter_prepare_head($object)
|
||||
*/
|
||||
function fichinter_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $langs, $conf, $user, $db;
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('fichinter');
|
||||
$extrafields->fetch_name_optionals_label('fichinterdet');
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
@ -159,19 +163,25 @@ function fichinter_admin_prepare_head()
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = $extrafields->attributes['fichinter']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = $extrafields->attributes['fichinterdet']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributesdet';
|
||||
$h++;
|
||||
|
||||
|
||||
|
||||
complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove');
|
||||
|
||||
return $head;
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1160,26 +1160,26 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
||||
|
||||
/**
|
||||
* Create a clone of instance of object (new instance with same value for properties)
|
||||
* With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object is not valid.
|
||||
* With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object may not be valid.
|
||||
* With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object.
|
||||
*
|
||||
* @param object $object Object to clone
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method+destroy non scalar or array properties (recommended)
|
||||
* @return object Clone object
|
||||
* @see https://php.net/manual/language.oop5.cloning.php
|
||||
*/
|
||||
function dol_clone($object, $native = 0)
|
||||
{
|
||||
if (empty($native)) {
|
||||
if ($native == 0) {
|
||||
$tmpsavdb = null;
|
||||
if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') {
|
||||
$tmpsavdb = $object->db;
|
||||
unset($object->db); // Such property can not be serialized when PgSql/Connection
|
||||
unset($object->db); // Such property can not be serialized with pgsl (when object->db->db = 'PgSql\Connection')
|
||||
}
|
||||
|
||||
$myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields
|
||||
|
||||
if ($tmpsavdb) {
|
||||
if (!empty($tmpsavdb)) {
|
||||
$object->db = $tmpsavdb;
|
||||
}
|
||||
} else {
|
||||
@ -1233,6 +1233,7 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1)
|
||||
$tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars);
|
||||
$tmp = preg_replace('/\-\-+/', '_', $tmp);
|
||||
$tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp);
|
||||
$tmp = preg_replace('/\s+\-$/', '', $tmp);
|
||||
$tmp = str_replace('..', '', $tmp);
|
||||
return $tmp;
|
||||
}
|
||||
@ -1257,6 +1258,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1)
|
||||
$tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars);
|
||||
$tmp = preg_replace('/\-\-+/', '_', $tmp);
|
||||
$tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp);
|
||||
$tmp = preg_replace('/\s+\-$/', '', $tmp);
|
||||
$tmp = str_replace('..', '', $tmp);
|
||||
return $tmp;
|
||||
}
|
||||
@ -1818,7 +1820,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
|
||||
* @param array $links Array of tabs. Note that label into $links[$i][1] must be already HTML escaped.
|
||||
* @param string $active Active tab name
|
||||
* @param string $title Title
|
||||
* @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after)
|
||||
* @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after), -3=-2+'noborderbottom'
|
||||
* @param string $picto Add a picto on tab title
|
||||
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
|
||||
* @param string $morehtmlright Add more html content on right of tabs title
|
||||
@ -1992,8 +1994,8 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
||||
$out .= "</div>\n";
|
||||
}
|
||||
|
||||
if (!$notab || $notab == -1 || $notab == -2) {
|
||||
$out .= "\n".'<div class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : ' tabBarWithBottom')).'">'."\n";
|
||||
if (!$notab || $notab == -1 || $notab == -2 || $notab == -3) {
|
||||
$out .= "\n".'<div class="tabBar'.($notab == -1 ? '' : ($notab == -2 ? ' tabBarNoTop' : (($notab == -3 ? ' noborderbottom' : '').' tabBarWithBottom'))).'">'."\n";
|
||||
}
|
||||
|
||||
$parameters = array('tabname' => $active, 'out' => $out);
|
||||
@ -2300,13 +2302,13 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
||||
|
||||
// Add alias for thirdparty
|
||||
if (!empty($object->name_alias)) {
|
||||
$morehtmlref .= '<div class="refidno">'.$object->name_alias.'</div>';
|
||||
$morehtmlref .= '<div class="refidno opacitymedium">'.$object->name_alias.'</div>';
|
||||
}
|
||||
|
||||
// Add label
|
||||
if (in_array($object->element, array('product', 'bank_account', 'project_task'))) {
|
||||
if (!empty($object->label)) {
|
||||
$morehtmlref .= '<div class="refidno">'.$object->label.'</div>';
|
||||
$morehtmlref .= '<div class="refidno opacitymedium">'.$object->label.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -2321,7 +2323,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
||||
}
|
||||
if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && ($conf->global->MAIN_SHOW_TECHNICAL_ID == '1' || preg_match('/'.preg_quote($object->element, '/').'/i', $conf->global->MAIN_SHOW_TECHNICAL_ID)) && !empty($object->id)) {
|
||||
$morehtmlref .= '<div style="clear: both;"></div>';
|
||||
$morehtmlref .= '<div class="refidno">';
|
||||
$morehtmlref .= '<div class="refidno opacitymedium">';
|
||||
$morehtmlref .= $langs->trans("TechnicalID").': '.$object->id;
|
||||
$morehtmlref .= '</div>';
|
||||
}
|
||||
@ -2636,6 +2638,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
|
||||
$useadodb = getDolGlobalInt('MAIN_USE_LEGACY_ADODB_FOR_DATE', 0);
|
||||
//$useadodb = 1; // To switch to adodb
|
||||
if (!empty($useadodb)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/adodbtime/adodb-time.inc.php';
|
||||
}
|
||||
|
||||
// Analyze date
|
||||
$reg = array();
|
||||
@ -2665,8 +2670,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
$dtts->setTimestamp($time);
|
||||
$dtts->setTimezone($tzo);
|
||||
$newformat = str_replace(
|
||||
array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||
array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||
array('%Y', '%y', '%m', '%d', '%H', '%I', '%M', '%S', '%p', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||
array('Y', 'y', 'm', 'd', 'H', 'h', 'i', 's', 'A', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||
$format);
|
||||
$ret = $dtts->format($newformat);
|
||||
$ret = str_replace(
|
||||
@ -2691,8 +2696,8 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
$dtts->setTimestamp($timetouse);
|
||||
$dtts->setTimezone($tzo);
|
||||
$newformat = str_replace(
|
||||
array('%Y', '%y', '%m', '%d', '%H', '%M', '%S', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||
array('Y', 'y', 'm', 'd', 'H', 'i', 's', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||
array('%Y', '%y', '%m', '%d', '%H', '%I', '%M', '%S', '%p', 'T', 'Z', '__a__', '__A__', '__b__', '__B__'),
|
||||
array('Y', 'y', 'm', 'd', 'H', 'h', 'i', 's', 'A', '__£__', '__$__', '__{__', '__}__', '__[__', '__]__'),
|
||||
$format);
|
||||
$ret = $dtts->format($newformat);
|
||||
$ret = str_replace(
|
||||
@ -8161,7 +8166,7 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = '
|
||||
*
|
||||
* @param int $date_start Start date
|
||||
* @param int $date_end End date
|
||||
* @param string $format Output format
|
||||
* @param string $format Output date format ('day', 'dayhour', ...)
|
||||
* @param Translate $outputlangs Output language
|
||||
* @param integer $withparenthesis 1=Add parenthesis, 0=no parenthesis
|
||||
* @return string String
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2017 ATM-CONSULTING <contact@atm-consulting.fr>
|
||||
*
|
||||
@ -137,7 +137,13 @@ function facture_prepare_head($object)
|
||||
*/
|
||||
function invoice_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
global $langs, $conf, $user, $db;
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('facture');
|
||||
$extrafields->fetch_name_optionals_label('facturedet');
|
||||
$extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$extrafields->fetch_name_optionals_label('facturedet_rec');
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
@ -160,25 +166,41 @@ function invoice_admin_prepare_head()
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
|
||||
$nbExtrafields = $extrafields->attributes['facture']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = $extrafields->attributes['facturedet']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributeslines';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
|
||||
$nbExtrafields = $extrafields->attributes['facture_rec']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributesrec';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
|
||||
$nbExtrafields = $extrafields->attributes['facturedet_rec']['count'];
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributeslinesrec';
|
||||
$h++;
|
||||
|
||||
if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
|
||||
if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
|
||||
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
|
||||
$head[$h][1] = $langs->trans("InvoiceSituation");
|
||||
$head[$h][2] = 'situation';
|
||||
|
||||
@ -341,14 +341,14 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
|
||||
$product_static->status_batch = $objp->product_tobatch;
|
||||
$text = $product_static->getNomUrl(1);
|
||||
$text .= ' - '.$label;
|
||||
$description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($objp->description));
|
||||
$description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($objp->description));
|
||||
print $form->textwithtooltip($text, $description, 3, '', '', $i);
|
||||
|
||||
// Show range
|
||||
print_date_range($objp->date_start, $objp->date_end);
|
||||
|
||||
// Add description in form
|
||||
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
|
||||
print (!empty($objp->description) && $objp->description != $objp->product) ? '<br>'.dol_htmlentitiesbr($objp->description) : '';
|
||||
}
|
||||
|
||||
|
||||
@ -131,6 +131,21 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
|
||||
} else {
|
||||
$out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0');
|
||||
}
|
||||
} elseif ($type == 'fichinter') {
|
||||
$securekeyseed = isset($conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->FICHINTER_ONLINE_SIGNATURE_SECURITY_TOKEN : '';
|
||||
$out = $urltouse.'/public/onlinesign/newonlinesign.php?source=fichinter&ref='.($mode ? '<span style="color: #666666">' : '');
|
||||
if ($mode == 1) {
|
||||
$out .= 'fichinter_ref';
|
||||
}
|
||||
if ($mode == 0) {
|
||||
$out .= urlencode($ref);
|
||||
}
|
||||
$out .= ($mode ? '</span>' : '');
|
||||
if ($mode == 1) {
|
||||
$out .= "hash('".$securekeyseed."' + '".$type."' + fichinter_ref)";
|
||||
} else {
|
||||
$out .= '&securekey='.dol_hash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $object->entity), '0');
|
||||
}
|
||||
}
|
||||
|
||||
// For multicompany
|
||||
|
||||
@ -567,7 +567,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
}
|
||||
}
|
||||
|
||||
// Set $out to sow events
|
||||
// Set $out to show events
|
||||
$out = '';
|
||||
|
||||
if (!isModEnabled('agenda')) {
|
||||
|
||||
@ -51,7 +51,7 @@ class modStockTransfer extends DolibarrModules
|
||||
$this->rights_class = 'stocktransfer';
|
||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||
// It is used to group modules by family in module setup page
|
||||
$this->family = "other";
|
||||
$this->family = "products";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '90';
|
||||
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||
@ -125,7 +125,6 @@ class modStockTransfer extends DolibarrModules
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||
$this->langfiles = array("stocktransfer@stocktransfer");
|
||||
$this->phpmin = array(7, 0); // Minimum version of PHP required by module
|
||||
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
//$this->automatic_activation = array('FR'=>'StockTransferWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||
@ -138,12 +137,6 @@ class modStockTransfer extends DolibarrModules
|
||||
// );
|
||||
$this->const = array();
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
/*$this->overwrite_translation = array(
|
||||
'en_US:ParentCompany'=>'Parent company or reseller',
|
||||
'fr_FR:ParentCompany'=>'Maison mère ou revendeur'
|
||||
)*/
|
||||
|
||||
if (!isset($conf->stocktransfer) || !isset($conf->stocktransfer->enabled)) {
|
||||
$conf->stocktransfer = new stdClass();
|
||||
$conf->stocktransfer->enabled = 0;
|
||||
@ -435,15 +428,6 @@ class modStockTransfer extends DolibarrModules
|
||||
$result = $this->_load_tables('/install/mysql/tables/', 'stocktransfer');
|
||||
if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||
|
||||
// Create extrafields during init
|
||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
//$extrafields = new ExtraFields($this->db);
|
||||
//$result1=$extrafields->addExtraField('stocktransfer_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled');
|
||||
//$result2=$extrafields->addExtraField('stocktransfer_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled');
|
||||
//$result3=$extrafields->addExtraField('stocktransfer_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled');
|
||||
//$result4=$extrafields->addExtraField('stocktransfer_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled');
|
||||
//$result5=$extrafields->addExtraField('stocktransfer_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'stocktransfer@stocktransfer', '$conf->stocktransfer->enabled');
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// Discard if extrafield is a hidden field on form
|
||||
// Discard if field is a hidden field on form
|
||||
if (abs($val['visible']) != 1 && abs($val['visible']) != 3) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -49,19 +49,19 @@ print '<tr class="liste_titre nodrag nodrop">';
|
||||
|
||||
// Adds a line numbering column
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
print '<td class="linecolnum center"> </td>';
|
||||
print '<th class="linecolnum center"> </th>';
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
|
||||
print '<th class="linecoldescription">'.$langs->trans('Description').'</th>';
|
||||
|
||||
// Supplier ref
|
||||
if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier' || $this->element == 'invoice_supplier_rec') {
|
||||
print '<td class="linerefsupplier maxwidth125"><span id="title_fourn_ref">'.$langs->trans("SupplierRef").'</span></td>';
|
||||
print '<th class="linerefsupplier maxwidth125"><span id="title_fourn_ref">'.$langs->trans("SupplierRef").'</span></th>';
|
||||
}
|
||||
|
||||
// VAT
|
||||
print '<td class="linecolvat right nowraponall">';
|
||||
print '<th class="linecolvat right nowraponall">';
|
||||
if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || !empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) {
|
||||
print $langs->trans('Taxes');
|
||||
} else {
|
||||
@ -82,30 +82,30 @@ if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</th>';
|
||||
|
||||
// Price HT
|
||||
print '<td class="linecoluht right nowraponall">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<th class="linecoluht right nowraponall">'.$langs->trans('PriceUHT').'</th>';
|
||||
|
||||
// Multicurrency
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
|
||||
print '<td class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';
|
||||
print '<th class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</th>';
|
||||
}
|
||||
|
||||
if ($inputalsopricewithtax) {
|
||||
print '<td class="right nowraponall">'.$langs->trans('PriceUTTC').'</td>';
|
||||
print '<th class="right nowraponall">'.$langs->trans('PriceUTTC').'</th>';
|
||||
}
|
||||
|
||||
// Qty
|
||||
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||
print '<th class="linecolqty right">'.$langs->trans('Qty').'</th>';
|
||||
|
||||
// Unit
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>';
|
||||
print '<th class="linecoluseunit left">'.$langs->trans('Unit').'</th>';
|
||||
}
|
||||
|
||||
// Reduction short
|
||||
print '<td class="linecoldiscount right nowraponall">';
|
||||
print '<th class="linecoldiscount right nowraponall">';
|
||||
print $langs->trans('ReductionShort');
|
||||
|
||||
if (in_array($object->element, array('propal', 'commande', 'facture')) && $object->status == $object::STATUS_DRAFT) {
|
||||
@ -122,59 +122,59 @@ if (in_array($object->element, array('propal', 'commande', 'facture')) && $objec
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '</th>';
|
||||
|
||||
// Fields for situation invoice
|
||||
if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) {
|
||||
print '<td class="linecolcycleref right">'.$langs->trans('Progress').'</td>';
|
||||
print '<td class="linecolcycleref2 right">'.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).'</td>';
|
||||
print '<th class="linecolcycleref right">'.$langs->trans('Progress').'</th>';
|
||||
print '<th class="linecolcycleref2 right">'.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).'</th>';
|
||||
}
|
||||
|
||||
// Purchase price
|
||||
if ($usemargins && isModEnabled('margin') && empty($user->socid)) {
|
||||
if (!empty($user->rights->margins->creer)) {
|
||||
if ($conf->global->MARGIN_TYPE == "1") {
|
||||
print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('BuyingPrice').'</td>';
|
||||
print '<th class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('BuyingPrice').'</th>';
|
||||
} else {
|
||||
print '<td class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('CostPrice').'</td>';
|
||||
print '<th class="linecolmargin1 margininfos right" style="width: 80px">'.$langs->trans('CostPrice').'</th>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {
|
||||
print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarginRate').'</td>';
|
||||
print '<th class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarginRate').'</th>';
|
||||
}
|
||||
if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {
|
||||
print '<td class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarkRate').'</td>';
|
||||
print '<th class="linecolmargin2 margininfos right" style="width: 50px">'.$langs->trans('MarkRate').'</th>';
|
||||
}
|
||||
}
|
||||
|
||||
// Total HT
|
||||
print '<td class="linecolht right">'.$langs->trans('TotalHTShort').'</td>';
|
||||
print '<th class="linecolht right">'.$langs->trans('TotalHTShort').'</th>';
|
||||
|
||||
// Multicurrency
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code != $conf->currency) {
|
||||
print '<td class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';
|
||||
print '<th class="linecoltotalht_currency right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</th>';
|
||||
}
|
||||
|
||||
if ($outputalsopricetotalwithtax) {
|
||||
print '<td class="right" style="width: 80px">'.$langs->trans('TotalTTCShort').'</td>';
|
||||
print '<th class="right" style="width: 80px">'.$langs->trans('TotalTTCShort').'</th>';
|
||||
}
|
||||
|
||||
if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
|
||||
print '<td class="linecolasset"></td>';
|
||||
print '<th class="linecolasset"></th>';
|
||||
}
|
||||
|
||||
print '<td class="linecoledit"></td>'; // No width to allow autodim
|
||||
print '<th class="linecoledit"></th>'; // No width to allow autodim
|
||||
|
||||
print '<td class="linecoldelete" style="width: 10px"></td>';
|
||||
print '<th class="linecoldelete" style="width: 10px"></th>';
|
||||
|
||||
print '<td class="linecolmove" style="width: 10px"></td>';
|
||||
print '<th class="linecolmove" style="width: 10px"></th>';
|
||||
|
||||
if ($action == 'selectlines') {
|
||||
print '<td class="linecolcheckall center">';
|
||||
print '<th class="linecolcheckall center">';
|
||||
print '<input type="checkbox" class="linecheckboxtoggle" />';
|
||||
print '<script>$(document).ready(function() {$(".linecheckboxtoggle").click(function() {var checkBoxes = $(".linecheckbox");checkBoxes.prop("checked", this.checked);})});</script>';
|
||||
print '</td>';
|
||||
print '</th>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -213,7 +213,7 @@ if (($line->info_bits & 2) == 2) {
|
||||
}
|
||||
|
||||
// Add description in form
|
||||
if ($line->fk_product > 0 && !empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
if ($line->fk_product > 0 && getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
|
||||
if ($line->element == 'facturedetrec') {
|
||||
print (!empty($line->description) && $line->description != $line->product_label) ? (($line->date_start_fill || $line->date_end_fill) ? '' : '<br>').'<br>'.dol_htmlentitiesbr($line->description) : '';
|
||||
} elseif ($line->element == 'invoice_supplier_det_rec') {
|
||||
|
||||
@ -328,37 +328,25 @@ if ($action == 'create') {
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", '', $expedition->ref_customer, $expedition, $user->rights->expedition->creer, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.$conf->global->THIRDPARTY_REF_INPUT_SIZE : ''), '', null, null, '', 1);
|
||||
$morehtmlref .= '<br>'.$langs->trans("RefDeliveryReceipt").' : '.$object->ref;
|
||||
// Thirdparty
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1);
|
||||
$morehtmlref .= '<br>'.$expedition->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
|
||||
if (0) { // Do not change on shipment
|
||||
$morehtmlref .= '<br>';
|
||||
if (0) { // Do not change on shipment
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$expedition->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
// $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $expedition->id, $expedition->socid, $expedition->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$expedition->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($expedition->socid, $expedition->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$expedition->id, $expedition->socid, $expedition->fk_project, 'none', 0, 0, 0, 1);
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $objectsrc->socid, $objectsrc->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, ($action == 'classify' ? 1 : 0), 0, 1, '');
|
||||
} else {
|
||||
$morehtmlref .= ' : ';
|
||||
if (!empty($objectsrc->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($objectsrc->fk_project);
|
||||
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= ' - '.$proj->title;
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -577,11 +565,11 @@ if ($action == 'create') {
|
||||
}
|
||||
$text .= ' '.$object->lines[$i]->product_ref.'</a>';
|
||||
$text .= ' - '.$label;
|
||||
$description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($object->lines[$i]->description));
|
||||
$description = (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE') ? '' : dol_htmlentitiesbr($object->lines[$i]->description));
|
||||
//print $description;
|
||||
print $form->textwithtooltip($text, $description, 3, '', '', $i);
|
||||
print_date_range($object->lines[$i]->date_start, $object->lines[$i]->date_end);
|
||||
if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) {
|
||||
if (getDolGlobalInt('PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
|
||||
print (!empty($object->lines[$i]->description) && $object->lines[$i]->description != $object->lines[$i]->product_label) ? '<br>'.dol_htmlentitiesbr($object->lines[$i]->description) : '';
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -203,7 +203,7 @@ if (!empty($withproject)) {
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ if (!empty($withproject)) {
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ if (!empty($withproject)) {
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if (isset($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
@ -287,7 +287,7 @@ if ($projectid > 0) {
|
||||
$morehtmlref .= $project->title;
|
||||
// Thirdparty
|
||||
if (isset($project->thirdparty->id) && $project->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$project->thirdparty->getNomUrl(1, 'project');
|
||||
$morehtmlref .= '<br>'.$project->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
@ -348,8 +348,15 @@ if ($projectid > 0) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - end
|
||||
print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($project->budget_amount, '')) {
|
||||
print '<span class="amount">'.price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency).'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - end project
|
||||
print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Project").')</td><td>';
|
||||
$start = dol_print_date($project->date_start, 'day');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($project->date_end, 'day');
|
||||
@ -360,13 +367,23 @@ if ($projectid > 0) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($project->budget_amount, '')) {
|
||||
print price($project->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
||||
// Date start - end of event
|
||||
print '<tr><td>'.$langs->trans("Dates").' ('.$langs->trans("Event").')</td><td>';
|
||||
$start = dol_print_date($project->date_start_event, 'day');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($project->date_end_event, 'day');
|
||||
print ' - ';
|
||||
print ($end ? $end : '?');
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Location event
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td>';
|
||||
print $project->location;
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
$objectconf = $object;
|
||||
|
||||
@ -234,7 +234,7 @@ if (!empty($withproject)) {
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if ($projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user