Fix: Third party emails must not be visible into notification page
This commit is contained in:
parent
a8814eb99a
commit
5be5852cf4
@ -464,24 +464,24 @@ if ($nboftargetok) {
|
||||
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
|
||||
$ret=`$cmd`;
|
||||
|
||||
# print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n";
|
||||
# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" |
|
||||
# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/filefunc.inc.php\"";
|
||||
# $ret=`$cmd`;
|
||||
# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" |
|
||||
# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/install/inc.php\"";
|
||||
# $ret=`$cmd`;
|
||||
# $cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" |
|
||||
# sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
# sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
# sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/support/inc.php\"";
|
||||
# $ret=`$cmd`;
|
||||
|
||||
#print "Remove other files\n";
|
||||
print "Fix filefunc.inc.php, install/inc.php, support/inc.php\n";
|
||||
$cmd="cat \"$BUILDROOT/$PROJECT/htdocs/filefunc.inc.php\" |
|
||||
sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/filefunc.inc.php\"";
|
||||
$ret=`$cmd`;
|
||||
$cmd="cat \"$BUILDROOT/$PROJECT/htdocs/install/inc.php\" |
|
||||
sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/install/inc.php\"";
|
||||
$ret=`$cmd`;
|
||||
$cmd="cat \"$BUILDROOT/$PROJECT/htdocs/support/inc.php\" |
|
||||
sed -e 's/conffile = \"\\\.\\\.\\\/conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
sed -e 's/conffile = \"conf\\\/conf.php\"/conffile = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' |
|
||||
sed -e 's/conffiletoshow = \"htdocs\\\/conf\\\/conf.php\"/conffiletoshow = \"\\\/etc\\\/dolibarr\\\/conf.php\"/g' > \"$BUILDROOT/$FILENAMETGZ2/htdocs/support/inc.php\"";
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Remove other files\n";
|
||||
#$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/ChangeLog`;
|
||||
#$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/COPYING`;
|
||||
#$ret=`rm -f $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/INSTALL`;
|
||||
@ -503,13 +503,13 @@ if ($nboftargetok) {
|
||||
#$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/zip`;
|
||||
#$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/build/perl`;
|
||||
# We remove embedded libraries or fonts
|
||||
#if ($target !~ /GENE/i)
|
||||
#{
|
||||
# $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/artichow/font`,
|
||||
# $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/fonts`,
|
||||
#}
|
||||
if ($target !~ /GENE/i)
|
||||
{
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/artichow/font`,
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/barcode/php-barcode/fonts`,
|
||||
}
|
||||
#$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip`;
|
||||
#$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip/gnu-lgpl.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/usr/share/$PROJECT/htdocs/includes/odtphp/zip/pclzip/gnu-lgpl.txt`;
|
||||
|
||||
# Conf files
|
||||
#print "Copy config files into $BUILDROOT/$FILENAMETGZ2/etc/$PROJECT\n";
|
||||
@ -570,10 +570,6 @@ if ($nboftargetok) {
|
||||
close SPECFROM;
|
||||
close SPECTO;
|
||||
|
||||
print "Copy patch file to $RPMDIR/SOURCES\n";
|
||||
$ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`;
|
||||
$ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`;
|
||||
|
||||
print "Launch RPM build (rpmbuild --clean -ba $BUILDROOT/${BUILDFIC})\n";
|
||||
#$ret=`rpmbuild -vvvv --clean -ba $BUILDROOT/${BUILDFIC}`;
|
||||
$ret=`rpmbuild --clean -ba $BUILDROOT/${BUILDFIC}`;
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
diff -up htdocs/filefunc.inc.php.patch htdocs/filefunc.inc.php
|
||||
--- htdocs/filefunc.inc.php.patch 2011-09-03 02:32:48.666952000 +0200
|
||||
+++ htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200
|
||||
@@ -65,8 +65,8 @@ $conffiletoshowshort = "conf.php";
|
||||
$conffile = "conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
# For debian/redhat like systems
|
||||
-#$conffile = "/etc/dolibarr/conf.php";
|
||||
-#$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
// Include configuration
|
||||
diff -up htdocs/install/inc.php.patch htdocs/install/inc.php
|
||||
--- htdocs/install/inc.php.patch 2011-09-03 02:33:26.450952000 +0200
|
||||
+++ htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200
|
||||
@@ -75,8 +75,8 @@ $conffiletoshowshort = "conf.php";
|
||||
$conffile = "../conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
# For debian/redhat like systems
|
||||
-#$conffile = "/etc/dolibarr/conf.php";
|
||||
-#$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
|
||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||
diff -up htdocs/support/inc.php.patch htdocs/support/inc.php
|
||||
--- htdocs/support/inc.php.patch 2011-09-03 02:34:39.606952000 +0200
|
||||
+++ htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200
|
||||
@@ -69,8 +69,8 @@ $conffiletoshowshort = "conf.php";
|
||||
$conffile = "../conf/conf.php";
|
||||
$conffiletoshow = "htdocs/conf/conf.php";
|
||||
# For debian/redhat like systems
|
||||
-#$conffile = "/etc/dolibarr/conf.php";
|
||||
-#$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
+$conffile = "/etc/dolibarr/conf.php";
|
||||
+$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||
|
||||
$charset="UTF-8"; // If not output format found in any conf file
|
||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||
@ -20,7 +20,6 @@ Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/fedora/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
#BuildArchitectures: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -68,7 +67,6 @@ cui hai bisogno ed essere facile da usare.
|
||||
#---- prep
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p0 -b .patch
|
||||
|
||||
|
||||
|
||||
@ -195,13 +193,13 @@ fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
echo "----- Dolibarr %version-%release - (c) Dolibarr dev team -----"
|
||||
echo "----- Dolibarr %version - (c) Dolibarr dev team -----"
|
||||
echo "Dolibarr files are now installed (into /usr/share/dolibarr)."
|
||||
echo "To finish installation and use Dolibarr, click on the menu"
|
||||
echo "entry Dolibarr ERP-CRM or call the following page from your"
|
||||
echo "web browser:"
|
||||
echo "http://localhost/dolibarr/"
|
||||
echo "-------------------------------------------------------"
|
||||
echo "--------------------------------------------------"
|
||||
echo
|
||||
|
||||
|
||||
|
||||
@ -20,7 +20,6 @@ Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/fedora/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
#BuildArchitectures: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -69,7 +68,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
#---- prep
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p0 -b .patch
|
||||
|
||||
|
||||
|
||||
#---- build
|
||||
@ -259,7 +258,7 @@ fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
echo "----- Dolibarr %version-%release - (c) Dolibarr dev team -----"
|
||||
echo "----- Dolibarr %version - (c) Dolibarr dev team -----"
|
||||
echo "Dolibarr files are now installed (into /usr/share/dolibarr)."
|
||||
echo "To finish installation and use Dolibarr, click on the menu"
|
||||
echo "entry Dolibarr ERP-CRM or call the following page from your"
|
||||
@ -316,5 +315,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.1.0-0.2.beta1
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -20,7 +20,6 @@ Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/mandriva/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
#BuildArchitectures: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -68,7 +67,6 @@ cui hai bisogno ed essere facile da usare.
|
||||
#---- prep
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p0 -b .patch
|
||||
|
||||
|
||||
|
||||
@ -185,7 +183,7 @@ fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
echo "----- Dolibarr %version-%release - (c) Dolibarr dev team -----"
|
||||
echo "----- Dolibarr %version - (c) Dolibarr dev team -----"
|
||||
echo "Dolibarr files are now installed (into /usr/share/dolibarr)."
|
||||
echo "To finish installation and use Dolibarr, click on the menu"
|
||||
echo "entry Dolibarr ERP-CRM or call the following page from your"
|
||||
@ -225,5 +223,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.1.0-0.2.beta1
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -20,7 +20,6 @@ Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/opensuse/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
#BuildArchitectures: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -68,7 +67,6 @@ cui hai bisogno ed essere facile da usare.
|
||||
#---- prep
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p0 -b .patch
|
||||
|
||||
|
||||
#---- build
|
||||
@ -189,7 +187,7 @@ fi
|
||||
|
||||
# Show result
|
||||
echo
|
||||
echo "----- Dolibarr %version-%release - (c) Dolibarr dev team -----"
|
||||
echo "----- Dolibarr %version - (c) Dolibarr dev team -----"
|
||||
echo "Dolibarr files are now installed (into /usr/share/dolibarr)."
|
||||
echo "To finish installation and use Dolibarr, click on the menu"
|
||||
echo "entry Dolibarr ERP-CRM or call the following page from your"
|
||||
@ -229,5 +227,5 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.2.0-0.1.a
|
||||
* Wed Jul 31 2011 Laurent Destailleur 3.1.0-0.2.beta1
|
||||
- Initial version (#723326)
|
||||
|
||||
@ -116,9 +116,8 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* Adherent
|
||||
* @param DB base de donnees
|
||||
*/
|
||||
function Adherent($DB)
|
||||
{
|
||||
|
||||
@ -49,9 +49,8 @@ class AdherentType extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* \brief AdherentType
|
||||
* \param DB handler acces base de donnees
|
||||
*/
|
||||
function AdherentType($DB)
|
||||
{
|
||||
@ -195,7 +194,6 @@ class AdherentType extends CommonObject
|
||||
|
||||
/**
|
||||
* Return list of members' type
|
||||
*
|
||||
* @return array List of types of members
|
||||
*/
|
||||
function liste_array()
|
||||
@ -235,12 +233,11 @@ class AdherentType extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @param maxlen length max libelle
|
||||
* @param option Page lien
|
||||
* @return string Chaine avec URL
|
||||
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* \param maxlen length max libelle
|
||||
* \param option Page lien
|
||||
* \return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlen=0)
|
||||
{
|
||||
@ -263,7 +260,6 @@ class AdherentType extends CommonObject
|
||||
|
||||
/**
|
||||
* getMailOnValid
|
||||
*
|
||||
* @return Return mail model
|
||||
*/
|
||||
function getMailOnValid()
|
||||
@ -282,7 +278,6 @@ class AdherentType extends CommonObject
|
||||
|
||||
/**
|
||||
* getMailOnSubscription
|
||||
*
|
||||
* @return Return mail model
|
||||
*/
|
||||
function getMailOnSubscription()
|
||||
@ -301,7 +296,6 @@ class AdherentType extends CommonObject
|
||||
|
||||
/**
|
||||
* getMailOnResiliate
|
||||
*
|
||||
* @return Return mail model
|
||||
*/
|
||||
function getMailOnResiliate()
|
||||
|
||||
@ -45,12 +45,12 @@ class AdherentStats extends Stats
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* @param int $socid Id third party
|
||||
* @param int $userid Id user for filter
|
||||
* @return AdherentStats
|
||||
* @param $DB Database handler
|
||||
* @param $socid Id third party
|
||||
* @param $userid Id user for filter
|
||||
* @return AdherentStats
|
||||
*/
|
||||
function AdherentStats($DB, $socid=0, $userid=0)
|
||||
{
|
||||
|
||||
@ -49,9 +49,8 @@ class Cotisation extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* \brief Constructor
|
||||
* \param DB Handler base de donnees
|
||||
*/
|
||||
function Cotisation($DB)
|
||||
{
|
||||
@ -60,10 +59,9 @@ class Cotisation extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Fonction qui permet de creer la cotisation
|
||||
*
|
||||
* @param userid userid de celui qui insere
|
||||
* @return int <0 si KO, Id cotisation cree si OK
|
||||
* \brief Fonction qui permet de creer la cotisation
|
||||
* \param userid userid de celui qui insere
|
||||
* \return int <0 si KO, Id cotisation cree si OK
|
||||
*/
|
||||
function create($userid)
|
||||
{
|
||||
@ -97,10 +95,9 @@ class Cotisation extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Fonction qui permet de recuperer une cotisation
|
||||
*
|
||||
* @param rowid Id cotisation
|
||||
* @return int <0 si KO, =0 si OK mais non trouve, >0 si OK
|
||||
* \brief Fonction qui permet de recuperer une cotisation
|
||||
* \param rowid Id cotisation
|
||||
* \return int <0 si KO, =0 si OK mais non trouve, >0 si OK
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
@ -147,11 +144,10 @@ class Cotisation extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Met a jour en base la cotisation
|
||||
*
|
||||
* @param user Objet user qui met a jour
|
||||
* @param notrigger 0=Desactive les triggers
|
||||
* @param int <0 if KO, >0 if OK
|
||||
* \brief Met a jour en base la cotisation
|
||||
* \param user Objet user qui met a jour
|
||||
* \param notrigger 0=Desactive les triggers
|
||||
* \param int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user,$notrigger=0)
|
||||
{
|
||||
@ -188,10 +184,9 @@ class Cotisation extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a subscription
|
||||
*
|
||||
* @param rowid Id cotisation
|
||||
* @return int <0 si KO, 0 si OK mais non trouve, >0 si OK
|
||||
* \brief Delete a subscription
|
||||
* \param rowid Id cotisation
|
||||
* \return int <0 si KO, 0 si OK mais non trouve, >0 si OK
|
||||
*/
|
||||
function delete($user)
|
||||
{
|
||||
@ -255,10 +250,9 @@ class Cotisation extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Renvoie nom clicable (avec eventuellement le picto)
|
||||
*
|
||||
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* @return string Chaine avec URL
|
||||
* \brief Renvoie nom clicable (avec eventuellement le picto)
|
||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* \return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0)
|
||||
{
|
||||
@ -280,9 +274,8 @@ class Cotisation extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet cotisation
|
||||
*
|
||||
* @param id Id adhesion a charger
|
||||
* \brief Charge les informations d'ordre info dans l'objet cotisation
|
||||
* \param id Id adhesion a charger
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
|
||||
@ -168,7 +168,7 @@ dol_fiche_head($head, $tab, $langs->trans("Statistics"), 0, 'user');
|
||||
|
||||
|
||||
// Print title
|
||||
if ($mode && ! count($data))
|
||||
if ($mode && ! sizeof($data))
|
||||
{
|
||||
print $langs->trans("NoValidatedMemberYet").'<br>';
|
||||
print '<br>';
|
||||
@ -202,7 +202,7 @@ if ($mode == 'memberbycountry')
|
||||
print "function drawMap() {\n\tvar data = new google.visualization.DataTable();\n";
|
||||
|
||||
// Get the total number of rows
|
||||
print "\tdata.addRows(".count($data).");\n";
|
||||
print "\tdata.addRows(".sizeof($data).");\n";
|
||||
print "\tdata.addColumn('string', 'Country');\n";
|
||||
print "\tdata.addColumn('number', 'Number');\n";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/barcode.php
|
||||
* \file htdocs/includes/modules/barcode/admin/barcode.php
|
||||
* \ingroup barcode
|
||||
* \brief Page to setup barcode module
|
||||
* \brief Page d'administration/configuration du module Code barre
|
||||
*/
|
||||
|
||||
require("../main.inc.php");
|
||||
|
||||
@ -88,9 +88,9 @@ if ($action == 'COMPANY_USE_SEARCH_TO_SELECT')
|
||||
if ($action == 'setModuleOptions')
|
||||
{
|
||||
$post_size=count($_POST);
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
for($i=0;$i < $post_size;$i++)
|
||||
{
|
||||
if (array_key_exists('param'.$i,$_POST))
|
||||
@ -118,7 +118,7 @@ if ($action == 'set')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
|
||||
$type='company';
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
|
||||
$sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
|
||||
@ -150,7 +150,7 @@ if ($action == 'setdoc')
|
||||
{
|
||||
$label = GETPOST("label");
|
||||
$scandir = GETPOST("scandir");
|
||||
|
||||
|
||||
$db->begin();
|
||||
|
||||
if (dolibarr_set_const($db, "COMPANY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
|
||||
@ -189,7 +189,7 @@ if ($action == 'setdoc')
|
||||
if ($action == 'setprofid')
|
||||
{
|
||||
$status = GETPOST("status");
|
||||
|
||||
|
||||
$idprof="SOCIETE_IDPROF".$value."_UNIQUE";
|
||||
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
|
||||
{
|
||||
@ -518,8 +518,7 @@ $profid[3][1]=$langs->transcountry('ProfId4' ,$mysoc->pays_code);
|
||||
$var = true;
|
||||
$i=0;
|
||||
|
||||
$nbofloop=count($profid);
|
||||
while ($i < $nbofloop)
|
||||
while ($i < sizeof($profid))
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
|
||||
@ -2094,7 +2094,7 @@ class Propal extends CommonObject
|
||||
$this->nbtodolate++;
|
||||
}
|
||||
}
|
||||
// TODO Definir regle des propales a facturer en retard
|
||||
// \todo Definir regle des propales a facturer en retard
|
||||
// if ($mode == 'signed' && ! sizeof($this->FactureListeArray($obj->rowid))) $this->nbtodolate++;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@ -47,7 +47,7 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
|
||||
{
|
||||
$free = GETPOST("BANK_CHEQUERECEIPT_FREE_TEXT");
|
||||
$res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT",$free,'chaine',0,'',$conf->entity);
|
||||
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
@ -78,7 +78,7 @@ if ($action == 'setbankorder')
|
||||
* view
|
||||
*/
|
||||
|
||||
llxHeader("",$langs->trans("BankSetupModule"));
|
||||
llxHeader("","");
|
||||
|
||||
$html=new Form($db);
|
||||
|
||||
@ -144,8 +144,7 @@ $bankorder[1][2]='BankCode DeskCode BankAccountNumberKey AccountNumber';
|
||||
$var = true;
|
||||
$i=0;
|
||||
|
||||
$nbofbank=count($bankorder);
|
||||
while ($i < $nbofbank)
|
||||
while ($i < sizeof($bankorder))
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
@ -175,11 +174,11 @@ while ($i < $nbofbank)
|
||||
print '</a></td>';
|
||||
}
|
||||
print '<td> </td>';
|
||||
print '</tr>'."\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print "</table>\n";
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -44,9 +44,9 @@ class RemiseCheque extends CommonObject
|
||||
var $errno;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* \brief Constructeur de la classe
|
||||
* \param DB handler acces base de donnees
|
||||
* \param id id compte (0 par defaut)
|
||||
*/
|
||||
function RemiseCheque($DB)
|
||||
{
|
||||
@ -56,11 +56,10 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Load record
|
||||
*
|
||||
* @param id Id record
|
||||
* @param ref Ref record
|
||||
* @return int <0 if KO, > 0 if OK
|
||||
* \brief Load record
|
||||
* \param id Id record
|
||||
* \param ref Ref record
|
||||
* \return int <0 if KO, > 0 if OK
|
||||
*/
|
||||
function fetch($id,$ref='')
|
||||
{
|
||||
@ -114,7 +113,6 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Create a receipt to send cheques
|
||||
*
|
||||
* @param user User making creation
|
||||
* @param account_id Bank account for cheque receipt
|
||||
* @param limit Limit number of cheque to this
|
||||
@ -272,7 +270,6 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Supprime la remise en base
|
||||
*
|
||||
* @param user utilisateur qui effectue l'operation
|
||||
*/
|
||||
function delete($user='')
|
||||
@ -327,7 +324,6 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Validate a receipt
|
||||
*
|
||||
* @param user User
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@ -391,7 +387,7 @@ class RemiseCheque extends CommonObject
|
||||
/**
|
||||
* Old module for cheque receipt numbering
|
||||
*
|
||||
* @return int Next number of cheque
|
||||
* @return string
|
||||
*/
|
||||
function getNextNumber()
|
||||
{
|
||||
@ -425,7 +421,6 @@ class RemiseCheque extends CommonObject
|
||||
|
||||
/**
|
||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||
*
|
||||
* @param user Objet user
|
||||
* @param filteraccountid To get info for a particular account id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/prelevement/class/ligne-prelevement.class.php
|
||||
* \file htdocs/compta/prelevement/ligne-prelevement.class.php
|
||||
* \ingroup prelevement
|
||||
* \brief Fichier de la classe des lignes de prelevements
|
||||
*/
|
||||
@ -46,12 +46,12 @@ class LignePrelevement
|
||||
function LignePrelevement($DB, $user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
||||
$this->db = $DB ;
|
||||
$this->user = $user;
|
||||
|
||||
// List of language codes for status
|
||||
|
||||
|
||||
$langs->load("withdrawals");
|
||||
$this->statuts[0]=$langs->trans("StatusWaiting");
|
||||
$this->statuts[2]=$langs->trans("StatusCredited");
|
||||
@ -107,7 +107,7 @@ class LignePrelevement
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return status label of object
|
||||
* @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
||||
@ -132,7 +132,7 @@ class LignePrelevement
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
|
||||
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
@ -145,7 +145,7 @@ class LignePrelevement
|
||||
if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut4');
|
||||
if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8');
|
||||
}
|
||||
|
||||
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0');
|
||||
|
||||
@ -401,7 +401,7 @@ print "</table>";
|
||||
print '<br><table width="100%" class="noborder">';
|
||||
|
||||
// Factures non reglees
|
||||
// Y a bug ici. Il faut prendre le reste a payer et non le total des factures non reglees !
|
||||
// \todo Y a bug ici. Il faut prendre le reste a payer et non le total des factures non reglees !
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid, s.nom, s.rowid as socid, f.total_ttc, sum(pf.amount) as am";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f left join ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
|
||||
|
||||
@ -511,7 +511,7 @@ class Tva extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO devrait s'appeler paiementtva
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // \todo devrait s'appeler paiementtva
|
||||
if ($this->id > 0)
|
||||
{
|
||||
$ok=1;
|
||||
|
||||
@ -114,11 +114,10 @@ function tva_coll($db,$y,$q)
|
||||
/**
|
||||
* Gets VAT to pay for the given month of the given year
|
||||
* The function gets the VAT in split results, as the VAT declaration asks
|
||||
* to report the amounts for different VAT rates as different lines
|
||||
*
|
||||
* @param DoliDB $db Database handler object
|
||||
* @param int $y Year
|
||||
* @param int $q Year quarter (1-4)
|
||||
* to report the amounts for different VAT rates as different lines.
|
||||
* @param object Database handler object
|
||||
* @param y Year
|
||||
* @param q Year quarter (1-4)
|
||||
*/
|
||||
function tva_paye($db, $y,$q)
|
||||
{
|
||||
|
||||
@ -630,6 +630,58 @@ class FormMail
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Affiche la partie de formulaire pour saisie d'un mail
|
||||
* \param withtopic 1 pour proposer a la saisie le sujet
|
||||
* \param withbody 1 pour proposer a la saisie le corps du message
|
||||
* \param withfile 1 pour proposer a la saisie l'ajout d'un fichier joint
|
||||
* \todo Fonction a virer quand fichier /comm/mailing.php vire (= quand ecran dans /comm/mailing prets)
|
||||
*/
|
||||
function mail_topicmessagefile($withtopic=1,$withbody=1,$withfile=1,$defaultbody)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs->load("other");
|
||||
|
||||
print "<table class=\"border\" width=\"100%\">";
|
||||
|
||||
// Topic
|
||||
if ($withtopic)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td width=\"180\">".$langs->trans("MailTopic")."</td>";
|
||||
print "<td>";
|
||||
print "<input type=\"text\" size=\"60\" name=\"subject\" value=\"\">";
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Message
|
||||
if ($withbody)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td width=\"180\" valign=\"top\">".$langs->trans("MailText")."</td>";
|
||||
print "<td>";
|
||||
print "<textarea rows=\"8\" cols=\"72\" name=\"message\">";
|
||||
print $defaultbody;
|
||||
print "</textarea>";
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Si fichier joint
|
||||
if ($withfile)
|
||||
{
|
||||
print "<tr>";
|
||||
print "<td width=\"180\">".$langs->trans("MailFile")."</td>";
|
||||
print "<td>";
|
||||
print "<input type=\"file\" name=\"addedfile\" value=\"".$langs->trans("Upload")."\"/>";
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -42,11 +42,13 @@ class Notify
|
||||
var $fk_project;
|
||||
|
||||
// Les codes actions sont definis dans la table llx_notify_def
|
||||
// \todo utiliser des codes texte plutot que numerique
|
||||
// 1 = Validation fiche inter
|
||||
// 2 = Validation facture
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $DB Database handler
|
||||
* \brief Constructeur
|
||||
* \param DB Handler acces base
|
||||
*/
|
||||
function Notify($DB)
|
||||
{
|
||||
|
||||
@ -448,10 +448,10 @@ class RssParser
|
||||
* Triggered when CDATA is found
|
||||
*
|
||||
* @param $p
|
||||
* @param $text Tag
|
||||
* @param $element Tag
|
||||
* @param $attrs Attributes of tags
|
||||
*/
|
||||
function feed_cdata($p, $text)
|
||||
{
|
||||
function feed_cdata ($p, $text) {
|
||||
if ($this->_format == 'atom' and $this->incontent)
|
||||
{
|
||||
$this->append_content( $text );
|
||||
@ -466,10 +466,9 @@ class RssParser
|
||||
* Triggered when closed tag is found
|
||||
*
|
||||
* @param $p
|
||||
* @param $el Tag
|
||||
* @param $element Tag
|
||||
*/
|
||||
function feed_end_element($p, $el)
|
||||
{
|
||||
function feed_end_element ($p, $el) {
|
||||
$el = strtolower($el);
|
||||
|
||||
if ( $el == 'item' or $el == 'entry' )
|
||||
@ -521,8 +520,7 @@ class RssParser
|
||||
* @param $str1
|
||||
* @param $str2
|
||||
*/
|
||||
function concat(&$str1, $str2="")
|
||||
{
|
||||
function concat (&$str1, $str2="") {
|
||||
if (!isset($str1) ) {
|
||||
$str1="";
|
||||
}
|
||||
@ -531,8 +529,7 @@ class RssParser
|
||||
|
||||
/**
|
||||
*/
|
||||
function append_content($text)
|
||||
{
|
||||
function append_content($text) {
|
||||
if ( $this->initem ) {
|
||||
$this->concat( $this->current_item[ $this->incontent ], $text );
|
||||
}
|
||||
@ -544,8 +541,7 @@ class RssParser
|
||||
/**
|
||||
* smart append - field and namespace aware
|
||||
*/
|
||||
function append($el, $text)
|
||||
{
|
||||
function append($el, $text) {
|
||||
if (!$el) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2103,7 +2103,7 @@ class SMTPs
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function setAttachment($strContent, $strFileName = 'unknown', $strMimeType = 'unknown')
|
||||
function setAttachment ( $strContent, $strFileName = 'unknown', $strMimeType = 'unknown' )
|
||||
{
|
||||
if ( $strContent )
|
||||
{
|
||||
@ -2120,23 +2120,21 @@ class SMTPs
|
||||
|
||||
|
||||
// DOL_CHANGE LDR
|
||||
|
||||
/**
|
||||
* Method public void setImageInline( string )
|
||||
*
|
||||
* Image attachments are added to the content array as sub-arrays,
|
||||
* allowing for multiple images for each outbound email
|
||||
*
|
||||
* @param string $strContent Image data to attach to message
|
||||
* @param string $strImageName Image Name to give to attachment
|
||||
* @param string $strMimeType Image Mime Type of attachment
|
||||
* @param string $strImageCid CID
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function setImageInline($strContent, $strImageName = 'unknown', $strMimeType = 'unknown', $strImageCid = 'unknown')
|
||||
* Method public void setImageInline( string )
|
||||
*
|
||||
* Image attachments are added to the content array as sub-arrays,
|
||||
* allowing for multiple images for each outbound email
|
||||
*
|
||||
* @param string $strContent Image data to attach to message
|
||||
* @param string $strImageName Image Name to give to attachment
|
||||
* @param string $strMimeType Image Mime Type of attachment
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function setImageInline ( $strContent, $strImageName = 'unknown', $strMimeType = 'unknown', $strImageCid = 'unknown' )
|
||||
{
|
||||
if ($strContent)
|
||||
if ( $strContent )
|
||||
{
|
||||
$this->_msgContent['image'][$strImageName]['mimeType'] = $strMimeType;
|
||||
$this->_msgContent['image'][$strImageName]['imageName'] = $strImageName;
|
||||
@ -2172,7 +2170,7 @@ class SMTPs
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function setSensitivity($_value = 0)
|
||||
function setSensitivity ( $_value = 0 )
|
||||
{
|
||||
if ( ( is_numeric ($_value) ) &&
|
||||
( ( $_value >= 0 ) && ( $_value <= 3 ) ) )
|
||||
@ -2518,10 +2516,7 @@ class SMTPs
|
||||
// ** CSV Version Control Info
|
||||
|
||||
/**
|
||||
* $Log: smtps.class.php,v $
|
||||
* Revision 1.1 2011/09/03 00:14:27 eldy
|
||||
* Doxygen
|
||||
*
|
||||
* $Log: smtps.php,v $
|
||||
* Revision 1.4 2011/08/28 14:24:23 eldy
|
||||
* Doxygen
|
||||
*
|
||||
@ -12,7 +12,8 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
@ -30,189 +31,183 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/barcode/modules_barcode.php")
|
||||
*/
|
||||
class modBarcodeCoder extends ModeleBarCode
|
||||
{
|
||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
var $error='';
|
||||
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
var $error='';
|
||||
|
||||
|
||||
/**
|
||||
* Return if a module can be used or not
|
||||
* @return boolean true if module can be used
|
||||
*/
|
||||
function isEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return description
|
||||
* @return string Texte descripif
|
||||
*/
|
||||
function info()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
return 'Barcode Coder';
|
||||
}
|
||||
|
||||
/**
|
||||
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
|
||||
* de conflits qui empechera cette numerotation de fonctionner.
|
||||
* @return boolean false si conflit, true si ok
|
||||
*/
|
||||
function canBeActivated()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if encodinf is supported
|
||||
* @return int >0 if supported, 0 if not
|
||||
*/
|
||||
function encodingIsSupported($encoding)
|
||||
{
|
||||
global $genbarcode_loc;
|
||||
|
||||
$supported=0;
|
||||
if ($encoding == 'EAN13') $supported=1;
|
||||
if ($encoding == 'ISBN') $supported=1;
|
||||
if ($encoding == 'EAN8') $supported=1;
|
||||
if ($encoding == 'UPC') $supported=1;
|
||||
if ($encoding == 'C39') $supported=1;
|
||||
if ($encoding == 'C128') $supported=1;
|
||||
|
||||
return $supported;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if a module can be used or not
|
||||
*
|
||||
* @return boolean true if module can be used
|
||||
* Return an image file on the fly (no need to write on disk)
|
||||
* @param $code Value to encode
|
||||
* @param $encoding Mode of encoding
|
||||
* @param $readable Code can be read
|
||||
*/
|
||||
function isEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
function buildBarCode($code,$encoding,$readable='Y')
|
||||
{
|
||||
global $_GET,$_SERVER;
|
||||
global $conf;
|
||||
global $genbarcode_loc, $bar_color, $bg_color, $text_color, $font_loc;
|
||||
|
||||
if (! $this->encodingIsSupported($encoding)) return -1;
|
||||
|
||||
/**
|
||||
* Return description
|
||||
*
|
||||
* @return string Texte descripif
|
||||
*/
|
||||
function info()
|
||||
{
|
||||
global $langs;
|
||||
if ($encoding == 'EAN8' || $encoding == 'EAN13') $encoding = 'EAN';
|
||||
if ($encoding == 'C39' || $encoding == 'C128') $encoding = substr($encoding,1);
|
||||
|
||||
return 'Barcode Coder';
|
||||
}
|
||||
$scale=1; $mode='png';
|
||||
|
||||
/**
|
||||
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
|
||||
* de conflits qui empechera cette numerotation de fonctionner
|
||||
*
|
||||
* @return boolean false si conflit, true si ok
|
||||
*/
|
||||
function canBeActivated()
|
||||
{
|
||||
global $langs;
|
||||
$_GET["code"]=$code;
|
||||
$_GET["encoding"]=$encoding;
|
||||
$_GET["scale"]=$scale;
|
||||
$_GET["mode"]=$mode;
|
||||
|
||||
$font = DOL_DOCUMENT_ROOT.'/includes/barcode/barcode-coder/NOTTB___.TTF';
|
||||
|
||||
$fontSize = 10; // GD1 in px ; GD2 in point
|
||||
$marge = 10; // between barcode and hri in pixel
|
||||
$x = 125; // barcode center
|
||||
$y = 125; // barcode center
|
||||
$height = 50; // barcode height in 1D ; module size in 2D
|
||||
$width = 2; // barcode height in 1D ; not use in 2D
|
||||
$angle = 90; // rotation in degrees : nb : non horizontable barcode might not be usable because of pixelisation
|
||||
$type = 'ean13';
|
||||
|
||||
return true;
|
||||
}
|
||||
$im = imagecreatetruecolor(300, 300);
|
||||
$black = ImageColorAllocate($im,0x00,0x00,0x00);
|
||||
$white = ImageColorAllocate($im,0xff,0xff,0xff);
|
||||
$red = ImageColorAllocate($im,0xff,0x00,0x00);
|
||||
$blue = ImageColorAllocate($im,0x00,0x00,0xff);
|
||||
imagefilledrectangle($im, 0, 0, 300, 300, $white);
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/barcode/barcode-coder/php-barcode-latest.php');
|
||||
dol_syslog("modBarcodeCoder::buildBarCode $code,$encoding,$scale,$mode");
|
||||
|
||||
|
||||
if ($code) $data = Barcode::gd($im, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
|
||||
if ( isset($font) ){
|
||||
$box = imagettfbbox($fontSize, 0, $font, $data['hri']);
|
||||
$len = $box[2] - $box[0];
|
||||
Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);
|
||||
imagettftext($im, $fontSize, $angle, $x + $xt, $y + $yt, $blue, $font, $data['hri']);
|
||||
}
|
||||
|
||||
|
||||
$rot = imagerotate($im, 45, $white);
|
||||
//imagedestroy($im);
|
||||
$im = imagecreatetruecolor(900, 300);
|
||||
$black = ImageColorAllocate($im,0x00,0x00,0x00);
|
||||
$white = ImageColorAllocate($im,0xff,0xff,0xff);
|
||||
$red = ImageColorAllocate($im,0xff,0x00,0x00);
|
||||
$blue = ImageColorAllocate($im,0x00,0x00,0xff);
|
||||
imagefilledrectangle($im, 0, 0, 900, 300, $white);
|
||||
|
||||
// Barcode rotation : 90°
|
||||
$angle = 90;
|
||||
$data = Barcode::gd($im, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
|
||||
Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);
|
||||
imagettftext($im, $fontSize, $angle, $x + $xt, $y + $yt, $blue, $font, $data['hri']);
|
||||
imagettftext($im, 10, 0, 60, 290, $black, $font, 'BARCODE ROTATION : 90°');
|
||||
|
||||
// barcode rotation : 135
|
||||
$angle = 135;
|
||||
Barcode::gd($im, $black, $x+300, $y, $angle, $type, array('code'=>$code), $width, $height);
|
||||
Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);
|
||||
imagettftext($im, $fontSize, $angle, $x + 300 + $xt, $y + $yt, $blue, $font, $data['hri']);
|
||||
imagettftext($im, 10, 0, 360, 290, $black, $font, 'BARCODE ROTATION : 135°');
|
||||
|
||||
// last one : image rotation
|
||||
imagecopy($im, $rot, 580, -50, 0, 0, 300, 300);
|
||||
imagerectangle($im, 0, 0, 299, 299, $black);
|
||||
imagerectangle($im, 299, 0, 599, 299, $black);
|
||||
imagerectangle($im, 599, 0, 899, 299, $black);
|
||||
imagettftext($im, 10, 0, 690, 290, $black, $font, 'IMAGE ROTATION');
|
||||
|
||||
/*
|
||||
if (! is_array($result))
|
||||
{
|
||||
$this->error=$result;
|
||||
print $this->error;exit;
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
imagepng($im);
|
||||
imagedestroy($im);
|
||||
|
||||
/**
|
||||
* Return true if encodinf is supported
|
||||
*
|
||||
* @return int >0 if supported, 0 if not
|
||||
*/
|
||||
function encodingIsSupported($encoding)
|
||||
{
|
||||
global $genbarcode_loc;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$supported=0;
|
||||
if ($encoding == 'EAN13') $supported=1;
|
||||
if ($encoding == 'ISBN') $supported=1;
|
||||
if ($encoding == 'EAN8') $supported=1;
|
||||
if ($encoding == 'UPC') $supported=1;
|
||||
if ($encoding == 'C39') $supported=1;
|
||||
if ($encoding == 'C128') $supported=1;
|
||||
/**
|
||||
* Save an image file on disk (with no output)
|
||||
* @param $code Value to encode
|
||||
* @param $encoding Mode of encoding
|
||||
* @param $readable Code can be read
|
||||
*/
|
||||
function writeBarCode($code,$encoding,$readable='Y')
|
||||
{
|
||||
global $conf,$filebarcode;
|
||||
|
||||
return $supported;
|
||||
}
|
||||
create_exdir($conf->barcode->dir_temp);
|
||||
|
||||
/**
|
||||
* Return an image file on the fly (no need to write on disk)
|
||||
*
|
||||
* @param $code Value to encode
|
||||
* @param $encoding Mode of encoding
|
||||
* @param $readable Code can be read
|
||||
*/
|
||||
function buildBarCode($code,$encoding,$readable='Y')
|
||||
{
|
||||
global $_GET,$_SERVER;
|
||||
global $conf;
|
||||
global $genbarcode_loc, $bar_color, $bg_color, $text_color, $font_loc;
|
||||
$file=$conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
|
||||
|
||||
if (! $this->encodingIsSupported($encoding)) return -1;
|
||||
$filebarcode=$file; // global var to be used in barcode_outimage called by barcode_print in buildBarCode
|
||||
|
||||
if ($encoding == 'EAN8' || $encoding == 'EAN13') $encoding = 'EAN';
|
||||
if ($encoding == 'C39' || $encoding == 'C128') $encoding = substr($encoding,1);
|
||||
$result=$this->buildBarCode($code,$encoding,$readable);
|
||||
|
||||
$scale=1; $mode='png';
|
||||
|
||||
$_GET["code"]=$code;
|
||||
$_GET["encoding"]=$encoding;
|
||||
$_GET["scale"]=$scale;
|
||||
$_GET["mode"]=$mode;
|
||||
|
||||
$font = DOL_DOCUMENT_ROOT.'/includes/barcode/barcode-coder/NOTTB___.TTF';
|
||||
|
||||
$fontSize = 10; // GD1 in px ; GD2 in point
|
||||
$marge = 10; // between barcode and hri in pixel
|
||||
$x = 125; // barcode center
|
||||
$y = 125; // barcode center
|
||||
$height = 50; // barcode height in 1D ; module size in 2D
|
||||
$width = 2; // barcode height in 1D ; not use in 2D
|
||||
$angle = 90; // rotation in degrees : nb : non horizontable barcode might not be usable because of pixelisation
|
||||
$type = 'ean13';
|
||||
|
||||
$im = imagecreatetruecolor(300, 300);
|
||||
$black = ImageColorAllocate($im,0x00,0x00,0x00);
|
||||
$white = ImageColorAllocate($im,0xff,0xff,0xff);
|
||||
$red = ImageColorAllocate($im,0xff,0x00,0x00);
|
||||
$blue = ImageColorAllocate($im,0x00,0x00,0xff);
|
||||
imagefilledrectangle($im, 0, 0, 300, 300, $white);
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/barcode/barcode-coder/php-barcode-latest.php');
|
||||
dol_syslog("modBarcodeCoder::buildBarCode $code,$encoding,$scale,$mode");
|
||||
|
||||
|
||||
if ($code) $data = Barcode::gd($im, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
|
||||
if ( isset($font) ){
|
||||
$box = imagettfbbox($fontSize, 0, $font, $data['hri']);
|
||||
$len = $box[2] - $box[0];
|
||||
Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);
|
||||
imagettftext($im, $fontSize, $angle, $x + $xt, $y + $yt, $blue, $font, $data['hri']);
|
||||
}
|
||||
|
||||
|
||||
$rot = imagerotate($im, 45, $white);
|
||||
//imagedestroy($im);
|
||||
$im = imagecreatetruecolor(900, 300);
|
||||
$black = ImageColorAllocate($im,0x00,0x00,0x00);
|
||||
$white = ImageColorAllocate($im,0xff,0xff,0xff);
|
||||
$red = ImageColorAllocate($im,0xff,0x00,0x00);
|
||||
$blue = ImageColorAllocate($im,0x00,0x00,0xff);
|
||||
imagefilledrectangle($im, 0, 0, 900, 300, $white);
|
||||
|
||||
// Barcode rotation : 90°
|
||||
$angle = 90;
|
||||
$data = Barcode::gd($im, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);
|
||||
Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);
|
||||
imagettftext($im, $fontSize, $angle, $x + $xt, $y + $yt, $blue, $font, $data['hri']);
|
||||
imagettftext($im, 10, 0, 60, 290, $black, $font, 'BARCODE ROTATION : 90°');
|
||||
|
||||
// barcode rotation : 135
|
||||
$angle = 135;
|
||||
Barcode::gd($im, $black, $x+300, $y, $angle, $type, array('code'=>$code), $width, $height);
|
||||
Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);
|
||||
imagettftext($im, $fontSize, $angle, $x + 300 + $xt, $y + $yt, $blue, $font, $data['hri']);
|
||||
imagettftext($im, 10, 0, 360, 290, $black, $font, 'BARCODE ROTATION : 135°');
|
||||
|
||||
// last one : image rotation
|
||||
imagecopy($im, $rot, 580, -50, 0, 0, 300, 300);
|
||||
imagerectangle($im, 0, 0, 299, 299, $black);
|
||||
imagerectangle($im, 299, 0, 599, 299, $black);
|
||||
imagerectangle($im, 599, 0, 899, 299, $black);
|
||||
imagettftext($im, 10, 0, 690, 290, $black, $font, 'IMAGE ROTATION');
|
||||
|
||||
/*
|
||||
if (! is_array($result))
|
||||
{
|
||||
$this->error=$result;
|
||||
print $this->error;exit;
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
imagepng($im);
|
||||
imagedestroy($im);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save an image file on disk (with no output)
|
||||
*
|
||||
* @param $code Value to encode
|
||||
* @param $encoding Mode of encoding
|
||||
* @param $readable Code can be read
|
||||
*/
|
||||
function writeBarCode($code,$encoding,$readable='Y')
|
||||
{
|
||||
global $conf,$filebarcode;
|
||||
|
||||
create_exdir($conf->barcode->dir_temp);
|
||||
|
||||
$file=$conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
|
||||
|
||||
$filebarcode=$file; // global var to be used in barcode_outimage called by barcode_print in buildBarCode
|
||||
|
||||
$result=$this->buildBarCode($code,$encoding,$readable);
|
||||
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ else
|
||||
else
|
||||
{
|
||||
# If failed, we try to create an empty file
|
||||
dolibarr_install_syslog("failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.", LOG_WARNING);
|
||||
dolibarr_install_syslog("failed to copy file ".$conffile.".example into ".$conffile.". We try to create it.");
|
||||
|
||||
$fp = @fopen($conffile, "w");
|
||||
if ($fp)
|
||||
@ -203,7 +203,6 @@ else
|
||||
@fputs($fp,"?>");
|
||||
fclose($fp);
|
||||
}
|
||||
else dolibarr_install_syslog("failed to create a new file ".$conffile." into current dir ".getcwd().". Check permission.", LOG_ERR);
|
||||
}
|
||||
|
||||
// First install, on ne peut pas upgrader
|
||||
|
||||
@ -150,7 +150,7 @@ MigrationCustomerOrderShipping=Migrate shipping for customer orders storage
|
||||
MigrationShippingDelivery=Upgrade storage of shipping
|
||||
MigrationShippingDelivery2=Upgrade storage of shipping 2
|
||||
MigrationFinished=Migration finished
|
||||
LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others.
|
||||
LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do no loose this as it is the account to allow to administer all others.
|
||||
|
||||
#########
|
||||
# upgrade
|
||||
|
||||
@ -234,7 +234,7 @@ class CMailFile
|
||||
// Use SMTPS library
|
||||
// ------------------------------------------
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/smtps.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/smtps.php");
|
||||
$smtps = new SMTPs();
|
||||
$smtps->setCharSet($conf->file->character_set_client);
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
|
||||
// If vat paid on due invoices (non draft)
|
||||
if ($conf->global->MAIN_MODULE_ACCOUNTING)
|
||||
{
|
||||
// TODO a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// n'est pas stocke dans la table des payments.
|
||||
// Seul le module compta expert peut resoudre ce probleme.
|
||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||
@ -102,7 +102,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
|
||||
if ($conf->global->MAIN_MODULE_ACCOUNTING)
|
||||
{
|
||||
// If vat paid on payments
|
||||
// TODO a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// n'est pas stocke dans la table des payments.
|
||||
// Seul le module compta expert peut resoudre ce probleme.
|
||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||
@ -215,7 +215,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
||||
{
|
||||
if ($conf->global->MAIN_MODULE_ACCOUNTING)
|
||||
{
|
||||
// TODO a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// n'est pas stocke dans la table des payments.
|
||||
// Seul le module compta expert peut resoudre ce probleme.
|
||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||
@ -261,7 +261,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
||||
{
|
||||
if ($conf->global->MAIN_MODULE_ACCOUNTING)
|
||||
{
|
||||
// TODO a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// n'est pas stocke dans la table des payments.
|
||||
// Seul le module compta expert peut resoudre ce probleme.
|
||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||
@ -376,7 +376,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
||||
if ($conf->global->MAIN_MODULE_ACCOUNTING)
|
||||
{
|
||||
// Count on invoice date
|
||||
// TODO a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// n'est pas stocke dans la table des payments.
|
||||
// Seul le module compta expert peut resoudre ce probleme.
|
||||
// (Il faut quand un payment a lieu, stocker en plus du montant du paiement le
|
||||
@ -423,7 +423,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction,
|
||||
if ($conf->global->MAIN_MODULE_ACCOUNTING)
|
||||
{
|
||||
// Count on payments date
|
||||
// TODO a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// \todo a ce jour on se sait pas la compter car le montant tva d'un payment
|
||||
// n'est pas stocke dans la table des payments.
|
||||
// Seul le module compta expert peut resoudre ce probleme.
|
||||
// (Il faut quand un paiement a lieu, stocker en plus du montant du paiement le
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/product/canvas/service/actions_card_service.class.php
|
||||
* \file htdocs/product/canvas/service/product.service.class.php
|
||||
* \ingroup service
|
||||
* \brief Fichier de la classe des services par defaut
|
||||
*/
|
||||
|
||||
@ -2485,7 +2485,7 @@ class Product extends CommonObject
|
||||
if (file_exists($dir_osencoded))
|
||||
{
|
||||
// Cree fichier en taille vignette
|
||||
// TODO A faire
|
||||
// \todo A faire
|
||||
|
||||
// Cree fichier en taille origine
|
||||
$content = @file_get_contents($file);
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/societe/class/companybankaccount.class.php
|
||||
* \files htdocs/societe/class/companybankaccount.class.php
|
||||
* \ingroup societe
|
||||
* \brief File of class to manage bank accounts description of third parties
|
||||
*/
|
||||
@ -26,159 +26,159 @@ require_once(DOL_DOCUMENT_ROOT ."/compta/bank/class/account.class.php");
|
||||
|
||||
|
||||
/**
|
||||
* \brief Class to manage bank accounts description of third parties
|
||||
* \brief Class to manage bank accounts description of third parties
|
||||
*/
|
||||
class CompanyBankAccount extends Account
|
||||
{
|
||||
var $rowid;
|
||||
var $socid;
|
||||
var $rowid;
|
||||
var $socid;
|
||||
|
||||
var $bank;
|
||||
var $courant;
|
||||
var $clos;
|
||||
var $code_banque;
|
||||
var $code_guichet;
|
||||
var $number;
|
||||
var $cle_rib;
|
||||
var $bic;
|
||||
var $iban;
|
||||
var $iban_prefix; // deprecated
|
||||
var $proprio;
|
||||
var $adresse_proprio;
|
||||
var $bank;
|
||||
var $courant;
|
||||
var $clos;
|
||||
var $code_banque;
|
||||
var $code_guichet;
|
||||
var $number;
|
||||
var $cle_rib;
|
||||
var $bic;
|
||||
var $iban;
|
||||
var $iban_prefix; // deprecated
|
||||
var $proprio;
|
||||
var $adresse_proprio;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function CompanyBankAccount($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function CompanyBankAccount($DB)
|
||||
{
|
||||
$this->db = $DB;
|
||||
|
||||
$this->socid = 0;
|
||||
$this->clos = 0;
|
||||
$this->solde = 0;
|
||||
$this->error_number = 0;
|
||||
return 1;
|
||||
}
|
||||
$this->socid = 0;
|
||||
$this->clos = 0;
|
||||
$this->solde = 0;
|
||||
$this->error_number = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create bank information record
|
||||
*
|
||||
*/
|
||||
function create()
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, datec) values ($this->socid, ".$this->db->idate(mktime()).")";
|
||||
/**
|
||||
* Create bank information record
|
||||
*
|
||||
*/
|
||||
function create()
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, datec) values ($this->socid, ".$this->db->idate(mktime()).")";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->affected_rows($resql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->affected_rows($resql))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print $this->db->error();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function update($user='')
|
||||
{
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
function update($user='')
|
||||
{
|
||||
|
||||
$sql = "SELECT fk_soc FROM ".MAIN_DB_PREFIX."societe_rib";
|
||||
$sql .= " WHERE fk_soc = ".$this->socid;
|
||||
$sql = "SELECT fk_soc FROM ".MAIN_DB_PREFIX."societe_rib";
|
||||
$sql .= " WHERE fk_soc = ".$this->socid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->num_rows($result) == 0)
|
||||
{
|
||||
$this->create();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($this->db->num_rows($result) == 0)
|
||||
{
|
||||
$this->create();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET ";
|
||||
$sql .= " bank = '" .$this->db->escape($this->bank)."'";
|
||||
$sql .= ",code_banque='".$this->code_banque."'";
|
||||
$sql .= ",code_guichet='".$this->code_guichet."'";
|
||||
$sql .= ",number='".$this->number."'";
|
||||
$sql .= ",cle_rib='".$this->cle_rib."'";
|
||||
$sql .= ",bic='".$this->bic."'";
|
||||
$sql .= ",iban_prefix = '".$this->iban_prefix."'";
|
||||
$sql .= ",domiciliation='".$this->db->escape($this->domiciliation)."'";
|
||||
$sql .= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql .= ",adresse_proprio = '".$this->db->escape($this->adresse_proprio)."'";
|
||||
$sql .= " WHERE fk_soc = ".$this->socid;
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe_rib SET ";
|
||||
$sql .= " bank = '" .$this->db->escape($this->bank)."'";
|
||||
$sql .= ",code_banque='".$this->code_banque."'";
|
||||
$sql .= ",code_guichet='".$this->code_guichet."'";
|
||||
$sql .= ",number='".$this->number."'";
|
||||
$sql .= ",cle_rib='".$this->cle_rib."'";
|
||||
$sql .= ",bic='".$this->bic."'";
|
||||
$sql .= ",iban_prefix = '".$this->iban_prefix."'";
|
||||
$sql .= ",domiciliation='".$this->db->escape($this->domiciliation)."'";
|
||||
$sql .= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql .= ",adresse_proprio = '".$this->db->escape($this->adresse_proprio)."'";
|
||||
$sql .= " WHERE fk_soc = ".$this->socid;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load record from database
|
||||
* @param id Id of record
|
||||
* @param socid Id of company
|
||||
*/
|
||||
function fetch($id,$socid=0)
|
||||
{
|
||||
if (empty($id) && empty($socid)) return -1;
|
||||
/**
|
||||
* Load record from database
|
||||
* @param id Id of record
|
||||
* @param socid Id of company
|
||||
*/
|
||||
function fetch($id,$socid=0)
|
||||
{
|
||||
if (empty($id) && empty($socid)) return -1;
|
||||
|
||||
$sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio, adresse_proprio";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_rib";
|
||||
if ($id) $sql.= " WHERE rowid = ".$id;
|
||||
if ($socid) $sql.= " WHERE fk_soc = ".$socid;
|
||||
$sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio, adresse_proprio";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe_rib";
|
||||
if ($id) $sql.= " WHERE rowid = ".$id;
|
||||
if ($socid) $sql.= " WHERE fk_soc = ".$socid;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($this->db->num_rows($resql))
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->id = $obj->rowid;
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->bank = $obj->bank;
|
||||
$this->courant = $obj->courant;
|
||||
$this->clos = $obj->clos;
|
||||
$this->code_banque = $obj->code_banque;
|
||||
$this->code_guichet = $obj->code_guichet;
|
||||
$this->number = $obj->number;
|
||||
$this->cle_rib = $obj->cle_rib;
|
||||
$this->bic = $obj->bic;
|
||||
$this->iban = $obj->iban;
|
||||
$this->iban_prefix = $obj->iban; // deprecated
|
||||
$this->domiciliation = $obj->domiciliation;
|
||||
$this->proprio = $obj->proprio;
|
||||
$this->adresse_proprio = $obj->adresse_proprio;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
$this->bank = $obj->bank;
|
||||
$this->courant = $obj->courant;
|
||||
$this->clos = $obj->clos;
|
||||
$this->code_banque = $obj->code_banque;
|
||||
$this->code_guichet = $obj->code_guichet;
|
||||
$this->number = $obj->number;
|
||||
$this->cle_rib = $obj->cle_rib;
|
||||
$this->bic = $obj->bic;
|
||||
$this->iban = $obj->iban;
|
||||
$this->iban_prefix = $obj->iban; // deprecated
|
||||
$this->domiciliation = $obj->domiciliation;
|
||||
$this->proprio = $obj->proprio;
|
||||
$this->adresse_proprio = $obj->adresse_proprio;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -52,8 +52,6 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="c.name";
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -62,61 +60,33 @@ $now=dol_now();
|
||||
// Add a notification
|
||||
if ($action == 'add')
|
||||
{
|
||||
$error=0;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||
$sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$_POST["contactid"]." AND fk_action=".$_POST["actionid"];
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
|
||||
$sql .= " VALUES (".$db->idate(mktime()).",".$socid.",".$_POST["contactid"].",".$_POST["actionid"].")";
|
||||
|
||||
if (empty($contactid))
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Contact")).'</div>';
|
||||
$error++;
|
||||
}
|
||||
if ($actionid <= 0)
|
||||
{
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Action")).'</div>';
|
||||
$error++;
|
||||
}
|
||||
if ($db->query($sql))
|
||||
{
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
|
||||
$sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$contactid." AND fk_action=".$actionid;
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
|
||||
$sql .= " VALUES ('".$db->idate($now)."',".$socid.",".$contactid.",".$actionid.")";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove a notification
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
|
||||
$db->query($sql);
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";";
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -129,106 +99,80 @@ $form = new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$object = new Societe($db);
|
||||
$result=$object->fetch($socid);
|
||||
$soc = new Societe($db);
|
||||
$result=$soc->fetch($socid);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
$html = new Form($db);
|
||||
$langs->load("other");
|
||||
$html = new Form($db);
|
||||
$langs->load("other");
|
||||
|
||||
|
||||
$head = societe_prepare_head($object);
|
||||
$head = societe_prepare_head($soc);
|
||||
|
||||
dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company');
|
||||
dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company');
|
||||
|
||||
|
||||
print '<table class="border"width="100%">';
|
||||
print '<table class="border"width="100%">';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
|
||||
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
print '<tr><td width="20%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
|
||||
print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom');
|
||||
print '</td></tr>';
|
||||
|
||||
// Prefix
|
||||
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
}
|
||||
print '<tr><td width="30%">'.$langs->trans("NbOfActiveNotifications").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
||||
$sql.= " WHERE fk_soc = ".$soc->id;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nb=$obj->nb;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print $nb;
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
if ($object->client)
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||
print $object->code_client;
|
||||
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($object->fournisseur)
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||
print $object->code_fournisseur;
|
||||
if ($object->check_codefournisseur() <> 0) print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td width="30%">'.$langs->trans("NbOfActiveNotifications").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
||||
$sql.= " WHERE fk_soc = ".$object->id;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nb=$obj->nb;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print $nb;
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
// Help
|
||||
print '<br>'.$langs->trans("NotificationsDesc").'<br>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
// Help
|
||||
print $langs->trans("NotificationsDesc").'<br><br>';
|
||||
|
||||
|
||||
print "\n";
|
||||
print "\n";
|
||||
|
||||
// Add notification form
|
||||
print_fiche_titre($langs->trans("AddNewNotification"),'','');
|
||||
// Add notification form
|
||||
print_fiche_titre($langs->trans("AddNewNotification"),'','');
|
||||
|
||||
print '<form action="fiche.php?socid='.$socid.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<form action="fiche.php?socid='.$socid.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
$param="&socid=".$socid;
|
||||
|
||||
// Line with titles
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
||||
// Line with titles
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
$param="&socid=".$socid;
|
||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),"fiche.php","",'',$param,'"width="10%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
$var=false;
|
||||
$listofemails=$object->thirdparty_and_contact_email_array();
|
||||
if (count($listofemails) > 0)
|
||||
{
|
||||
$actions=array();
|
||||
$var=false;
|
||||
$listofemails=$soc->thirdparty_and_contact_email_array();
|
||||
if (count($listofemails) > 0)
|
||||
{
|
||||
$actions=array();
|
||||
|
||||
// Load array of available notifications
|
||||
$notificationtrigger=new InterfaceNotification($db);
|
||||
@ -239,172 +183,172 @@ if ($result > 0)
|
||||
$label=$langs->trans("Notify_".$notifiedevent['code'])!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
|
||||
$actions[$notifiedevent['rowid']]=$label;
|
||||
}
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $html->selectarray("contactid",$listofemails);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $html->selectarray("actionid",$actions,'',1);
|
||||
print '</td>';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print $html->selectarray("contactid",$listofemails);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $html->selectarray("actionid",$actions,'',1);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$type=array('email'=>$langs->trans("EMail"));
|
||||
print $html->selectarray("typeid",$type);
|
||||
print '</td>';
|
||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td colspan="4">';
|
||||
print $langs->trans("YouMustCreateContactFirst");
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr '.$bc[$var].'><td colspan="4">';
|
||||
print $langs->trans("YouMustCreateContactFirst");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
// List of active notifications
|
||||
print_fiche_titre($langs->trans("ListOfActiveNotifications"),'','');
|
||||
$var=true;
|
||||
// List of active notifications
|
||||
print_fiche_titre($langs->trans("ListOfActiveNotifications"),'','');
|
||||
$var=true;
|
||||
|
||||
// Line with titles
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
||||
// Line with titles
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'"width="45%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'"width="35%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Type"),"fiche.php","",'',$param,'"width="10%"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('','','');
|
||||
print '</tr>';
|
||||
print_liste_field_titre('','','');
|
||||
print '</tr>';
|
||||
|
||||
// List of notifications for contacts
|
||||
$sql = "SELECT n.rowid, n.type,";
|
||||
$sql.= " a.code, a.label,";
|
||||
// List of notifications for contacts
|
||||
$sql = "SELECT n.rowid, n.type,";
|
||||
$sql.= " a.code, a.label,";
|
||||
$sql.= " c.rowid as contactid, c.name, c.firstname, c.email";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."socpeople c";
|
||||
$sql.= " WHERE a.rowid = n.fk_action";
|
||||
$sql.= " AND c.rowid = n.fk_contact";
|
||||
$sql.= " AND c.fk_soc = ".$object->id;
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."socpeople c";
|
||||
$sql.= " WHERE a.rowid = n.fk_action";
|
||||
$sql.= " AND c.rowid = n.fk_contact";
|
||||
$sql.= " AND c.fk_soc = ".$soc->id;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$contactstatic=new Contact($db);
|
||||
$contactstatic=new Contact($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = !$var;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$contactstatic->id=$obj->contactid;
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
||||
if ($obj->type == 'email')
|
||||
{
|
||||
if (isValidEmail($obj->email))
|
||||
{
|
||||
print ' <'.$obj->email.'>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$obj->email);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||
print $label;
|
||||
print '</td>';
|
||||
$contactstatic->id=$obj->contactid;
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
||||
if ($obj->type == 'email')
|
||||
{
|
||||
if (isValidEmail($obj->email))
|
||||
{
|
||||
print ' <'.$obj->email.'>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$obj->email);
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||
print $label;
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($obj->type == 'email') print $langs->trans("Email");
|
||||
if ($obj->type == 'sms') print $langs->trans("SMS");
|
||||
print '</td>';
|
||||
print '<td align="right"><a href="fiche.php?socid='.$socid.'&action=delete&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// List of notifications done
|
||||
print_fiche_titre($langs->trans("ListOfNotificationsDone"),'','');
|
||||
$var=true;
|
||||
// List of notifications done
|
||||
print_fiche_titre($langs->trans("ListOfNotificationsDone"),'','');
|
||||
$var=true;
|
||||
|
||||
// Line with titles
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),"fiche.php","a.daten",'',$param,'align="right"',$sortfield,$sortorder);
|
||||
print '</tr>';
|
||||
// Line with titles
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Contact"),"fiche.php","c.name",'',"&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Action"),"fiche.php","a.titre",'',"&socid=$socid",'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Date"),"fiche.php","a.titre",'',"&socid=$socid",'align="right"',$sortfield,$sortorder);
|
||||
print '</tr>';
|
||||
|
||||
// List
|
||||
$sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id,";
|
||||
$sql.= " c.rowid as id, c.name, c.firstname, c.email,";
|
||||
$sql.= " a.code, a.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify as n, ";
|
||||
// List
|
||||
$sql = "SELECT n.rowid, n.daten, n.email, n.objet_type, n.objet_id,";
|
||||
$sql.= " c.rowid as id, c.name, c.firstname, c.email,";
|
||||
$sql.= " a.code, a.label";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."notify as n, ";
|
||||
$sql.= " ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$sql.= " WHERE a.rowid = n.fk_action";
|
||||
$sql.= " AND c.rowid = n.fk_contact";
|
||||
$sql.= " AND c.fk_soc = ".$object->id;
|
||||
$sql.= " AND c.fk_soc = ".$soc->id;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$contactstatic=new Contact($db);
|
||||
$contactstatic=new Contact($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = !$var;
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$contactstatic->id=$obj->id;
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
||||
print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||
print $label;
|
||||
print '</td>';
|
||||
// TODO Add link to object here
|
||||
// print
|
||||
print'<td align="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$contactstatic->id=$obj->id;
|
||||
$contactstatic->name=$obj->name;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
print '<tr '.$bc[$var].'><td>'.$contactstatic->getNomUrl(1);
|
||||
print $obj->email?' <'.$obj->email.'>':$langs->trans("NoMail");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$label=($langs->trans("Notify_".$obj->code)!="Notify_".$obj->code?$langs->trans("Notify_".$obj->code):$obj->label);
|
||||
print $label;
|
||||
print '</td>';
|
||||
// TODO Add link to object here
|
||||
// print
|
||||
print'<td align="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
}
|
||||
else dol_print_error('','RecordNotFound');
|
||||
|
||||
|
||||
@ -127,8 +127,8 @@ input.ui-input-text, textarea.ui-input-text {
|
||||
/* ============================================================================== */
|
||||
|
||||
div.fiche {
|
||||
margin-<?php print $left; ?>: <?php print (empty($conf->browser->phone)?'10':'2'); ?>px;
|
||||
margin-<?php print $right; ?>: <?php print (empty($conf->browser->phone)?'6':''); ?>px;
|
||||
margin-<?php print $left; ?>: <?php print empty($conf->browser->phone)?'10':'2'; ?>px;
|
||||
margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'6':''; ?>px;
|
||||
}
|
||||
|
||||
div.fichecenter {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user