fix some translations

This commit is contained in:
Grand Philippe 2012-11-18 17:29:31 +01:00
commit 86ed4ba08c
164 changed files with 10415 additions and 6841 deletions

View File

@ -14,7 +14,7 @@ For users:
configured. Show also total number of activated modules. configured. Show also total number of activated modules.
- New: Can filter list of proposal, order or invoice on sales representative. - New: Can filter list of proposal, order or invoice on sales representative.
- New: Add supplier ref on supplier orders. - New: Add supplier ref on supplier orders.
- New: Can export supplier orders. - New: Can export supplier orders and customers shipments.
- New: First change to install external plugins from gui (experimental). - New: First change to install external plugins from gui (experimental).
- New: Monaco is like France for default vat calculation - New: Monaco is like France for default vat calculation
- New: Can list elements (invoices, orders or proposals) on a particular - New: Can list elements (invoices, orders or proposals) on a particular

View File

@ -337,6 +337,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-20100919`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
} }
# Build package for each target # Build package for each target

View File

@ -70,7 +70,7 @@
<Keywords>dolibarr, erp, crm, invoices, commercial proposals, orders, accounting, stock, products, agenda, bank, business, company, foundation, management, sme, doliwamp</Keywords> <Keywords>dolibarr, erp, crm, invoices, commercial proposals, orders, accounting, stock, products, agenda, bank, business, company, foundation, management, sme, doliwamp</Keywords>
<Char_Desc_45>Dolibarr ERP &amp; CRM</Char_Desc_45> <Char_Desc_45>Dolibarr ERP &amp; CRM</Char_Desc_45>
<Char_Desc_80>Dolibarr ERP &amp; CRM, the easy to use open source software to manage your activity</Char_Desc_80> <Char_Desc_80>Dolibarr ERP &amp; CRM, the easy to use open source software to manage your activity</Char_Desc_80>
<Char_Desc_250>Dolibarr ERP &amp; CRM, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs to follow.</Char_Desc_250> <Char_Desc_250>Dolibarr ERP &amp; CRM, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs to manage.</Char_Desc_250>
<Char_Desc_450>Dolibarr ERP &amp; CRM is a software built by modules addition (you enable only features you need), to manage small or medium companies, freelancers or foundations. We can say Dolibarr is an ERP or CRM. Dolibarr is also available with an auto-installer for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. See DoliWamp software for this.</Char_Desc_450> <Char_Desc_450>Dolibarr ERP &amp; CRM is a software built by modules addition (you enable only features you need), to manage small or medium companies, freelancers or foundations. We can say Dolibarr is an ERP or CRM. Dolibarr is also available with an auto-installer for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. See DoliWamp software for this.</Char_Desc_450>
<Char_Desc_2000>Dolibarr ERP &amp; CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. We can say Dolibarr is an ERP or CRM (or both depending on activated modules). It's an OpenSource project base on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems). Dolibarr differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: <Char_Desc_2000>Dolibarr ERP &amp; CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. We can say Dolibarr is an ERP or CRM (or both depending on activated modules). It's an OpenSource project base on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems). Dolibarr differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple:
Simple to install Simple to install
@ -83,8 +83,8 @@ Note that Dolibarr is also available with an auto-installer for Windows or Ubunt
<Char_Desc_45>Dolibarr ERP &amp; CRM</Char_Desc_45> <Char_Desc_45>Dolibarr ERP &amp; CRM</Char_Desc_45>
<Char_Desc_80>Dolibarr ERP &amp; CRM, le gestionnaire simple pour gérer votre activité</Char_Desc_80> <Char_Desc_80>Dolibarr ERP &amp; CRM, le gestionnaire simple pour gérer votre activité</Char_Desc_80>
<Char_Desc_250>Dolibarr ERP &amp; CRM, le logiciel simple et OpenSource pour gérer votre activité (factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations)</Char_Desc_250> <Char_Desc_250>Dolibarr ERP &amp; CRM, le logiciel simple et OpenSource pour gérer votre activité (factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations)</Char_Desc_250>
<Char_Desc_450>Dolibarr ERP/CRM est un logiciel modulaire (on n'active que les fonctions que l'on désire) de gestions de TPE/PME, d'indépendants, d'entrepreneurs ou d'associations. En terme plus techniques, c'est un ERP et CRM. C'est un projet OpenSource qui s'exécute au sein d'un serveur Web et peut donc être accessible depuis n'importe quel lieu disposant d'une connexion Internet (Projet basé sur un serveur WAMP, MAMP ou LAMP: Apache, MySQL, PHP).</Char_Desc_450> <Char_Desc_450>Dolibarr ERP &amp; CRM est un logiciel modulaire (on n'active que les fonctions que l'on désire) de gestions de TPE/PME, d'indépendants, d'entrepreneurs ou d'associations. En terme plus techniques, c'est un ERP et CRM. C'est un projet OpenSource qui s'exécute au sein d'un serveur Web et peut donc être accessible depuis n'importe quel lieu disposant d'une connexion Internet (Projet basé sur un serveur WAMP, MAMP ou LAMP: Apache, MySQL, PHP).</Char_Desc_450>
<Char_Desc_2000>Dolibarr ERP/CRM est un logiciel modulaire (on n'active que les fonctions que l'on désire) de gestions de TPE/PME, d'indépendants, d'entrepreneurs ou d'associations. En terme plus techniques, c'est un ERP et CRM. C'est un projet OpenSource qui s'exécute au sein d'un serveur Web et peut donc être accessible depuis n'importe quel lieu disposant d'une connexion Internet (Projet basé sur un serveur WAMP, MAMP ou LAMP: Apache, MySQL, PHP). Dolibarr vient compléter les offres déjà nombreuses de logiciels de cette catégorie (comme OpenBravo, OpenERP, SugarCRM, Neogia, Compiere, etc.) mais se démarque par le fait qu'ici tout est fait pour offrir de la simplicité (règle des 3 S): <Char_Desc_2000>Dolibarr ERP &amp; CRM est un logiciel modulaire (on n'active que les fonctions que l'on désire) de gestions de TPE/PME, d'indépendants, d'entrepreneurs ou d'associations. En terme plus techniques, c'est un ERP et CRM. C'est un projet OpenSource qui s'exécute au sein d'un serveur Web et peut donc être accessible depuis n'importe quel lieu disposant d'une connexion Internet (Projet basé sur un serveur WAMP, MAMP ou LAMP: Apache, MySQL, PHP). Dolibarr vient compléter les offres déjà nombreuses de logiciels de cette catégorie (comme OpenBravo, OpenERP, SugarCRM, Neogia, Compiere, etc.) mais se démarque par le fait qu'ici tout est fait pour offrir de la simplicité (règle des 3 S):
Simple pour l'installation (avec au choix des installeurs clé en main pour ceux qui ignorent comment installer un serveur Web, ou une installation manuelle) Simple pour l'installation (avec au choix des installeurs clé en main pour ceux qui ignorent comment installer un serveur Web, ou une installation manuelle)
Simple pour l'utilisation (fonctions modulaires pour ne pas surcharger les menus, informations claires à la saisie) Simple pour l'utilisation (fonctions modulaires pour ne pas surcharger les menus, informations claires à la saisie)
Simple pour le développement (pas de frameworks lourds). Simple pour le développement (pas de frameworks lourds).

File diff suppressed because one or more lines are too long

196
dev/initdata/savedemo.sh Executable file
View File

@ -0,0 +1,196 @@
#!/bin/sh
#------------------------------------------------------
# Script to extrac a database with demo values.
# Note: "dialog" tool need to be available if no parameter provided.
#
# Regis Houssin - regis@dolibarr.fr
# Laurent Destailleur - eldy@users.sourceforge.net
#------------------------------------------------------
# Usage: savedemo.sh
# usage: savedemo.sh mysqldump_dolibarr_x.x.x.sql database port login pass
#------------------------------------------------------
export mydir=`echo "$0" | sed -e 's/savedemo.sh//'`;
if [ "x$mydir" = "x" ]
then
export mydir="."
fi
export id=`id -u`;
# ----------------------------- check if root
if [ "x$id" != "x0" -a "x$id" != "x1001" ]
then
echo "Script must be ran as root"
exit
fi
# ----------------------------- command line params
dumpfile=$1;
base=$2;
port=$3;
admin=$4;
passwd=$5;
# ----------------------------- if no params on command line
if [ "x$passwd" = "x" ]
then
export dumpfile=`ls $mydir/mysqldump_dolibarr_*.sql | sort | tail -n 1`
export dumpfile=`basename $dumpfile`
# ----------------------------- input file
DIALOG=${DIALOG=dialog}
DIALOG="$DIALOG --ascii-lines"
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Save Dolibarr with demo values" --clear \
--inputbox "Output dump file :" 16 55 $dumpfile 2> $fichtemp
valret=$?
case $valret in
0)
dumpfile=`cat $fichtemp`;;
1)
exit;;
255)
exit;;
esac
# ----------------------------- database name
DIALOG=${DIALOG=dialog}
DIALOG="$DIALOG --ascii-lines"
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Save Dolibarr with demo values" --clear \
--inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp
valret=$?
case $valret in
0)
base=`cat $fichtemp`;;
1)
exit;;
255)
exit;;
esac
# ---------------------------- database port
DIALOG=${DIALOG=dialog}
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Save Dolibarr with demo values" --clear \
--inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp
valret=$?
case $valret in
0)
port=`cat $fichtemp`;;
1)
exit;;
255)
exit;;
esac
# ---------------------------- compte admin mysql
DIALOG=${DIALOG=dialog}
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Save Dolibarr with demo values" --clear \
--inputbox "Mysql root login (ex: root):" 16 55 root 2> $fichtemp
valret=$?
case $valret in
0)
admin=`cat $fichtemp`;;
1)
exit;;
255)
exit;;
esac
# ---------------------------- mot de passe admin mysql
DIALOG=${DIALOG=dialog}
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Save Dolibarr with demo values" --clear \
--inputbox "Password for Mysql root login :" 16 55 2> $fichtemp
valret=$?
case $valret in
0)
passwd=`cat $fichtemp`;;
1)
exit;;
255)
exit;;
esac
# ---------------------------- chemin d'acces du repertoire documents
#DIALOG=${DIALOG=dialog}
#fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
#trap "rm -f $fichtemp" 0 1 2 5 15
#$DIALOG --title "Save Dolibarr with demo values" --clear \
# --inputbox "Full path to documents directory (ex: /var/www/dolibarr/documents)- no / at end :" 16 55 2> $fichtemp
#valret=$?
#case $valret in
# 0)
#docs=`cat $fichtemp`;;
# 1)
#exit;;
# 255)
#exit;;
#esac
# ---------------------------- confirmation
DIALOG=${DIALOG=dialog}
$DIALOG --title "Save Dolibarr with demo values" --clear \
--yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : '$passwd'" 15 55
case $? in
0) echo "Ok, start process...";;
1) exit;;
255) exit;;
esac
fi
# ---------------------------- run sql file
if [ "x$passwd" != "x" ]
then
export passwd="-p$passwd"
fi
export list="
--ignore-table=$base.llx_abonne
--ignore-table=$base.llx_abonne_extrafields
--ignore-table=$base.llx_abonne_type
--ignore-table=$base.llx_abonnement
--ignore-table=$base.llx_dolicloud_customers
--ignore-table=$base.llx_c_dolicloud_plans
--ignore-table=$base.llx_cabinetmed_c_banques
--ignore-table=$base.llx_cabinetmed_c_ccam
--ignore-table=$base.llx_cabinetmed_c_examconclusion
--ignore-table=$base.llx_cabinetmed_cons
--ignore-table=$base.llx_cabinetmed_diaglec
--ignore-table=$base.llx_cabinetmed_examaut
--ignore-table=$base.llx_cabinetmed_exambio
--ignore-table=$base.llx_cabinetmed_examenprescrit
--ignore-table=$base.llx_cabinetmed_motifcons
--ignore-table=$base.llx_cabinetmed_patient"
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile
export res=$?
if [ "x$res" = "x0" ]
then
echo "Success, file successfully loaded."
else
echo "Error, load failed."
fi
echo

View File

@ -35,8 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("members"); $langs->load("members");
$mesg=isset($_GET["mesg"])?'<div class="ok">'.$_GET["mesg"].'</div>':'';
$id = GETPOST('id','int'); $id = GETPOST('id','int');
// Security check // Security check
@ -70,7 +68,7 @@ $form = new Form($db);
/* /*
* Fiche categorie de client et/ou fournisseur * Fiche categorie de client et/ou fournisseur
*/ */
if ($id) if ($object->id > 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
@ -133,9 +131,6 @@ if ($id)
print '</div>'; print '</div>';
dol_htmloutput_mesg($mesg);
/* /*
* Barre d'action * Barre d'action
*/ */
@ -144,7 +139,9 @@ if ($id)
if (! empty($conf->agenda->enabled)) if (! empty($conf->agenda->enabled))
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>'; // FIXME socid parameters is not valid, a member is not a thirparty
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create">'.$langs->trans("AddAction").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -473,7 +473,7 @@ llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adh
if ($rowid) if ($rowid)
{ {
$res=$object->fetch($rowid,$ref); $res=$object->fetch($rowid);
if ($res < 0) { dol_print_error($db,$object->error); exit; } if ($res < 0) { dol_print_error($db,$object->error); exit; }
//$res=$object->fetch_optionals($object->id,$extralabels); //$res=$object->fetch_optionals($object->id,$extralabels);
//if ($res < 0) { dol_print_error($db); exit; } //if ($res < 0) { dol_print_error($db); exit; }
@ -558,10 +558,10 @@ if ($rowid)
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty"); print $langs->trans("LinkedToDolibarrThirdParty");
print '</td>'; print '</td>';
if ($_GET['action'] != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>'; if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td class="valeur">'; print '</td><td class="valeur">';
if ($_GET['action'] == 'editthirdparty') if ($action == 'editthirdparty')
{ {
$htmlname='socid'; $htmlname='socid';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="form'.$htmlname.'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="form'.$htmlname.'">';
@ -813,7 +813,7 @@ if ($rowid)
print '<input type="hidden" name="action" value="cotisation">'; print '<input type="hidden" name="action" value="cotisation">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">'; print '<input type="hidden" name="memberlabel" id="memberlabel" value="'.dol_escape_htmltag($object->getFullName($langs)).'">';
print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($company->name).'">'; print '<input type="hidden" name="thirdpartylabel" id="thirdpartylabel" value="'.dol_escape_htmltag($object->name).'">';
print "<table class=\"border\" width=\"100%\">\n"; print "<table class=\"border\" width=\"100%\">\n";
$today=dol_now(); $today=dol_now();
@ -822,16 +822,16 @@ if ($rowid)
$paymentdate=-1; $paymentdate=-1;
// Date payment // Date payment
if ($_POST["paymentyear"] && $_POST["paymentmonth"] && $_POST["paymentday"]) if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday'))
{ {
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]); $paymentdate=dol_mktime(0, 0, 0, GETPOST('paymentmonth'), GETPOST('paymentday'), GETPOST('paymentyear'));
} }
// Date start subscription // Date start subscription
print '<tr><td width="30%" class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>'; print '<tr><td width="30%" class="fieldrequired">'.$langs->trans("DateSubscription").'</td><td>';
if ($_POST["reday"]) if (GETPOST('reday'))
{ {
$datefrom=dol_mktime(0,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); $datefrom=dol_mktime(0,0,0,GETPOST('remonth'),GETPOST('reday'),GETPOST('reyear'));
} }
if (! $datefrom) if (! $datefrom)
{ {
@ -848,9 +848,9 @@ if ($rowid)
print "</td></tr>"; print "</td></tr>";
// Date end subscription // Date end subscription
if ($_POST["endday"]) if (GETPOST('endday'))
{ {
$dateto=dol_mktime(0,0,0,$_POST["endmonth"],$_POST["endday"],$_POST["endyear"]); $dateto=dol_mktime(0,0,0,GETPOST('endmonth'),GETPOST('endday'),GETPOST('endyear'));
} }
if (! $dateto) if (! $dateto)
{ {
@ -863,7 +863,7 @@ if ($rowid)
if ($adht->cotisation) if ($adht->cotisation)
{ {
// Amount // Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.$_POST["cotisation"].'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="cotisation" size="6" value="'.GETPOST('cotisation').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Label // Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>'; print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
@ -926,33 +926,33 @@ if ($rowid)
// Bank account // Bank account
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("FinancialAccount").'</td><td>'; print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("FinancialAccount").'</td><td>';
$form->select_comptes($_POST["accountid"],'accountid',0,'',1); $form->select_comptes(GETPOST('accountid'),'accountid',0,'',1);
print "</td></tr>\n"; print "</td></tr>\n";
// Payment mode // Payment mode
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>'; print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements($_POST["operation"],'operation','',2); $form->select_types_paiements(GETPOST('operation'),'operation','',2);
print "</td></tr>\n"; print "</td></tr>\n";
// Date of payment // Date of payment
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>'; print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
$form->select_date($paymentdate?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1); $form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1);
print "</td></tr>\n"; print "</td></tr>\n";
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero'); print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>'; print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print '</td>'; print '</td>';
print '<td><input id="fieldnum_chq" name="num_chq" type="text" size="8" value="'.(empty($_POST['num_chq'])?'':$_POST['num_chq']).'"></td></tr>'; print '<td><input id="fieldnum_chq" name="num_chq" type="text" size="8" value="'.(! GETPOST('num_chq')?'':GETPOST('num_chq')).'"></td></tr>';
print '<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans('CheckTransmitter'); print '<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans('CheckTransmitter');
print ' <em>('.$langs->trans("ChequeMaker").')</em>'; print ' <em>('.$langs->trans("ChequeMaker").')</em>';
print '</td>'; print '</td>';
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->name:$_POST['chqemetteur']).'"></td></tr>'; print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(! GETPOST('chqemetteur')?'':GETPOST('chqemetteur')).'"></td></tr>';
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Bank'); print '<tr class="bankswitchclass2"><td>'.$langs->trans('Bank');
print ' <em>('.$langs->trans("ChequeBank").')</em>'; print ' <em>('.$langs->trans("ChequeBank").')</em>';
print '</td>'; print '</td>';
print '<td><input id="chqbank" name="chqbank" size="32" type="text" value="'.(empty($_POST['chqbank'])?'':$_POST['chqbank']).'"></td></tr>'; print '<td><input id="chqbank" name="chqbank" size="32" type="text" value="'.(! GETPOST('chqbank')?'':GETPOST('chqbank')).'"></td></tr>';
} }
} }
@ -972,7 +972,7 @@ if ($rowid)
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT); $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); $texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
$tmp='<input name="sendmail" type="checkbox"'.((isset($_POST["sendmail"])?$_POST["sendmail"]:$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked="checked"':'').'>'; $tmp='<input name="sendmail" type="checkbox"'.(GETPOST('sendmail')?GETPOST('sendmail'):(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked="checked"':'')).'>';
$helpcontent=''; $helpcontent='';
$helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n"; $helpcontent.='<b>'.$langs->trans("MailFrom").'</b>: '.$conf->global->ADHERENT_MAIL_FROM.'<br>'."\n";
$helpcontent.='<b>'.$langs->trans("MailRecipient").'</b>: '.$object->email.'<br>'."\n"; $helpcontent.='<b>'.$langs->trans("MailRecipient").'</b>: '.$object->email.'<br>'."\n";

View File

@ -1,10 +1,10 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org> * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -33,8 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/** /**
* \class Adherent * Class to manage members of a foundation
* \brief Class to manage members of a foundation
*/ */
class Adherent extends CommonObject class Adherent extends CommonObject
{ {
@ -318,7 +317,7 @@ class Adherent extends CommonObject
$this->ref=$id; $this->ref=$id;
// Update minor fields // Update minor fields
$result=$this->update($user,1,1); // nosync is 1 to avoid update data of user $result=$this->update($user,1,1,0,0,'add'); // nosync is 1 to avoid update data of user
if ($result < 0) if ($result < 0)
{ {
$this->db->rollback(); $this->db->rollback();
@ -390,9 +389,10 @@ class Adherent extends CommonObject
* @param int $nosyncuser 0=Synchronize linked user (standard info), 1=Do not synchronize linked user * @param int $nosyncuser 0=Synchronize linked user (standard info), 1=Do not synchronize linked user
* @param int $nosyncuserpass 0=Synchronize linked user (password), 1=Do not synchronize linked user * @param int $nosyncuserpass 0=Synchronize linked user (password), 1=Do not synchronize linked user
* @param int $nosyncthirdparty 0=Synchronize linked thirdparty (standard info), 1=Do not synchronize linked thirdparty * @param int $nosyncthirdparty 0=Synchronize linked thirdparty (standard info), 1=Do not synchronize linked thirdparty
* @param string $action Current action for hookmanager
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0) function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update')
{ {
global $conf, $langs; global $conf, $langs;
@ -470,11 +470,14 @@ class Adherent extends CommonObject
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
$result=$this->insertExtraFields(); if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
if ($result < 0) {
{ $result=$this->insertExtraFields();
$error++; if ($result < 0)
} {
$error++;
}
}
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;

View File

@ -28,8 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
/** /**
* \class AdherentType * Class to manage members type
* \brief Class to manage members type
*/ */
class AdherentType extends CommonObject class AdherentType extends CommonObject
{ {

View File

@ -28,8 +28,7 @@ include_once DOL_DOCUMENT_ROOT . '/adherents/class/cotisation.class.php';
/** /**
* \class AdherentStats * Class to manage statistics of members
* \brief Classe permettant la gestion des stats des adherents
*/ */
class AdherentStats extends Stats class AdherentStats extends Stats
{ {

View File

@ -26,8 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
/** /**
* \class Cotisation * Class to manage subscriptions of foundation members
* \brief Class to manage subscriptions of foundation members
*/ */
class Cotisation extends CommonObject class Cotisation extends CommonObject
{ {

View File

@ -196,8 +196,7 @@ if ($id > 0)
// List of document // List of document
$param='&socid='.$societe->id; $formfile->list_of_documents($filearray,$member,'member','', 0, get_exdir($member->id,2,0,1).'/'.$member->id.'/');
$formfile->list_of_documents($filearray,$member,'member',$param, 0, get_exdir($member->id,2,0,1).'/'.$member->id.'/');
print "<br><br>"; print "<br><br>";
} }

View File

@ -52,9 +52,6 @@ $typeid=GETPOST('typeid','int');
$userid=GETPOST('userid','int'); $userid=GETPOST('userid','int');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
// Security check
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
if (! empty($conf->mailmanspip->enabled)) if (! empty($conf->mailmanspip->enabled))
{ {
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -78,6 +75,9 @@ if (! empty($canvas))
$objcanvas->getCanvas('adherent', 'membercard', $canvas); $objcanvas->getCanvas('adherent', 'membercard', $canvas);
} }
// Security check
$result=restrictedArea($user,'adherent',$rowid,'','','fk_soc', 'rowid', $objcanvas);
$errmsg=''; $errmsgs=array(); $errmsg=''; $errmsgs=array();
if ($rowid > 0) if ($rowid > 0)
@ -735,7 +735,7 @@ else
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
$object->canvas=$canvas; $object->canvas=$canvas;
$object->fk_departement = $_POST["departement_id"]; $object->fk_departement = GETPOST('departement_id', 'int');
// We set country_id, country_code and country for the selected country // We set country_id, country_code and country for the selected country
$object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id; $object->country_id=GETPOST('country_id','int')?GETPOST('country_id','int'):$mysoc->country_id;
@ -905,7 +905,7 @@ else
{ {
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
$value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):$object->array_options["options_".$key]); $value=(isset($_POST["options_".$key])?GETPOST('options_'.$key,'alpha'):(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:''));
print '<tr><td'; print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td>'; print '>'.$label.'</td><td>';
@ -1235,7 +1235,7 @@ else
dol_htmloutput_errors($errmsg,$errmsgs); dol_htmloutput_errors($errmsg,$errmsgs);
// Confirm create user // Confirm create user
if ($_GET["action"] == 'create_user') if ($action == 'create_user')
{ {
$login=$object->login; $login=$object->login;
if (empty($login)) if (empty($login))
@ -1261,7 +1261,7 @@ else
} }
// Confirm create third party // Confirm create third party
if ($_GET["action"] == 'create_thirdparty') if ($action == 'create_thirdparty')
{ {
$name = $object->getFullName($langs); $name = $object->getFullName($langs);
if (! empty($name)) if (! empty($name))
@ -1348,7 +1348,7 @@ else
// Cree un tableau formulaire // Cree un tableau formulaire
$formquestion=array(); $formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?'true':'false')); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
$ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); $ret=$form->form_confirm("fiche.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
@ -1495,10 +1495,10 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty"); print $langs->trans("LinkedToDolibarrThirdParty");
print '</td>'; print '</td>';
if ($_GET['action'] != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>'; if ($action != 'editthirdparty' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2" class="valeur">'; print '</td><td colspan="2" class="valeur">';
if ($_GET['action'] == 'editthirdparty') if ($action == 'editthirdparty')
{ {
$htmlname='socid'; $htmlname='socid';
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="form'.$htmlname.'">'; print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'" name="form'.$htmlname.'">';
@ -1533,7 +1533,7 @@ else
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser"); print $langs->trans("LinkedToDolibarrUser");
print '</td>'; print '</td>';
if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer) if ($action != 'editlogin' && $user->rights->adherent->creer)
{ {
print '<td align="right">'; print '<td align="right">';
if ($user->rights->user->user->creer) if ($user->rights->user->user->creer)
@ -1544,7 +1544,7 @@ else
} }
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="2" class="valeur">'; print '</td><td colspan="2" class="valeur">';
if ($_GET['action'] == 'editlogin') if ($action == 'editlogin')
{ {
print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
} }

View File

@ -169,11 +169,11 @@ if ($conf->use_javascript_ajax)
{ {
$datalabels[]=array($i,$adhtype->getNomUrl(0,dol_size(16))); $datalabels[]=array($i,$adhtype->getNomUrl(0,dol_size(16)));
$dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0); $dataval['draft'][]=array($i,isset($MemberToValidate[$key])?$MemberToValidate[$key]:0);
$dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0); $dataval['notuptodate'][]=array($i,isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0);
$dataval['uptodate'][]=array($i,isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0); $dataval['uptodate'][]=array($i,isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0);
$dataval['resiliated'][]=array($i,isset($MembersResiliated[$key])?$MembersResiliated[$key]:0); $dataval['resiliated'][]=array($i,isset($MembersResiliated[$key])?$MembersResiliated[$key]:0);
$SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0; $SommeA+=isset($MemberToValidate[$key])?$MemberToValidate[$key]:0;
$SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-$MemberUpToDate[$key]:0; $SommeB+=isset($MembersValidated[$key])?$MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):0;
$SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0; $SommeC+=isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0;
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0; $SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
$i++; $i++;
@ -336,7 +336,7 @@ foreach ($AdherentType as $key => $adhtype)
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>'; print '<td>'.$adhtype->getNomUrl(1, dol_size(32)).'</td>';
print '<td align="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>'; print '<td align="right">'.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>'; print '<td align="right">'.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0) > 0) ? $MembersValidated[$key]-(isset($MemberUpToDate[$key])?$MemberUpToDate[$key]:0):'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>'; print '<td align="right">'.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).'</td>';
print '<td align="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>'; print '<td align="right">'.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -57,7 +57,7 @@ if ($action == 'update' && $user->rights->adherent->creer && ! $_POST["cancel"])
$res=$object->update_note($_POST["note"],$user); $res=$object->update_note($_POST["note"],$user);
if ($res < 0) if ($res < 0)
{ {
$mesg='<div class="error">'.$object->error.'</div>'; setEventMessage($object->error, 'errors');
$db->rollback(); $db->rollback();
} }
else else
@ -82,8 +82,6 @@ if ($id)
dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user'); dol_fiche_head($head, 'note', $langs->trans("Member"), 0, 'user');
dol_htmloutput_errors($msg);
print "<form method=\"post\" action=\"note.php\">"; print "<form method=\"post\" action=\"note.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -23,8 +23,7 @@
/** /**
* \class Bookmark * Class to manage bookmarks
* \brief Class to manage bookmarks
*/ */
class Bookmark class Bookmark
{ {

View File

@ -96,8 +96,8 @@ class Facturation
$societe = new Societe($db); $societe = new Societe($db);
$societe->fetch($thirdpartyid); $societe->fetch($thirdpartyid);
$product = new Product($db); $product = new Product($db);
$product->fetch($this->id); $product->fetch($this->id);
$sql = "SELECT taux"; $sql = "SELECT taux";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva";

View File

@ -68,15 +68,15 @@ class Categorie
*/ */
function fetch($id,$label='') function fetch($id,$label='')
{ {
global $conf; global $conf;
$sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type"; $sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie";
if ($id) if ($id)
{ {
$sql.= " WHERE rowid = '".$id."'"; $sql.= " WHERE rowid = '".$id."'";
} }
else else
{ {
if ($label) $sql.= " WHERE label = '".$this->db->escape($label)."' AND entity=".$conf->entity;; if ($label) $sql.= " WHERE label = '".$this->db->escape($label)."' AND entity=".$conf->entity;;
@ -86,10 +86,10 @@ class Categorie
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
if ($this->db->num_rows($resql) > 0) if ($this->db->num_rows($resql) > 0)
{ {
$res = $this->db->fetch_array($resql); $res = $this->db->fetch_array($resql);
$this->id = $res['rowid']; $this->id = $res['rowid'];
$this->fk_parent = $res['fk_parent']; $this->fk_parent = $res['fk_parent'];
$this->label = $res['label']; $this->label = $res['label'];
@ -98,9 +98,9 @@ class Categorie
$this->visible = $res['visible']; $this->visible = $res['visible'];
$this->type = $res['type']; $this->type = $res['type'];
$this->entity = $res['entity']; $this->entity = $res['entity'];
$this->db->free($resql); $this->db->free($resql);
return 1; return 1;
} }
else else
@ -702,9 +702,9 @@ class Categorie
/** /**
* Retourne toutes les categories * Retourne toutes les categories
* *
* @param int Type of category * @param int $type Type of category
* @param boolean Just parent categories if true * @param boolean $parent Just parent categories if true
* @return array Tableau d'objet Categorie * @return array Tableau d'objet Categorie
*/ */
function get_all_categories($type=null, $parent=false) function get_all_categories($type=null, $parent=false)
{ {
@ -807,7 +807,7 @@ class Categorie
/** /**
* Retourne les categories de premier niveau (qui ne sont pas filles) * Retourne les categories de premier niveau (qui ne sont pas filles)
* *
* @param int Type of category * @param int $type Type of category
* @return void * @return void
*/ */
function get_main_categories($type=null) function get_main_categories($type=null)

View File

@ -51,6 +51,7 @@ class ActionComm extends CommonObject
var $datep; // Date action start (datep) var $datep; // Date action start (datep)
var $datef; // Date action end (datep2) var $datef; // Date action end (datep2)
var $dateend; // ??
var $durationp = -1; // -1=Unkown duration var $durationp = -1; // -1=Unkown duration
var $fulldayevent = 0; // 1=Event on full day var $fulldayevent = 0; // 1=Event on full day
var $punctual = 1; // Milestone var $punctual = 1; // Milestone

View File

@ -381,54 +381,45 @@ if ($action == 'create')
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax))
{ {
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () { print '$(document).ready(function () {
function setdatefields() function setdatefields()
{ {
if (jQuery("#fullday:checked").val() == null) if ($("#fullday:checked").val() == null) {
{ $(".fulldaystarthour").removeAttr("disabled");
jQuery(".fulldaystarthour").attr(\'disabled\', false); $(".fulldaystartmin").removeAttr("disabled");
jQuery(".fulldaystartmin").attr(\'disabled\', false); $(".fulldayendhour").removeAttr("disabled");
jQuery(".fulldayendhour").attr(\'disabled\', false); $(".fulldayendmin").removeAttr("disabled");
jQuery(".fulldayendmin").attr(\'disabled\', false); } else {
} $(".fulldaystarthour").attr("disabled","disabled").val("00");
else $(".fulldaystartmin").attr("disabled","disabled").val("00");
{ $(".fulldayendhour").attr("disabled","disabled").val("23");
jQuery(".fulldaystarthour").attr(\'disabled\', true); $(".fulldayendmin").attr("disabled","disabled").val("59");
jQuery(".fulldaystartmin").attr(\'disabled\', true); }
jQuery(".fulldayendhour").attr(\'disabled\', true); }
jQuery(".fulldayendmin").attr(\'disabled\', true);
jQuery(".fulldaystarthour").val("00");
jQuery(".fulldaystartmin").val("00");
//jQuery(".fulldayendhour").val("00");
//jQuery(".fulldayendmin").val("00");
jQuery(".fulldayendhour").val("23");
jQuery(".fulldayendmin").val("59");
}
}
setdatefields(); setdatefields();
jQuery("#fullday").change(function() { $("#fullday").change(function() {
setdatefields(); setdatefields();
}); });
jQuery("#selectcomplete").change(function() { $("#selectcomplete").change(function() {
if (jQuery("#selectcomplete").val() == 100) if ($("#selectcomplete").val() == 100)
{ {
if (jQuery("#doneby").val() <= 0) jQuery("#doneby").val(\''.$user->id.'\'); if ($("#doneby").val() <= 0) $("#doneby").val(\''.$user->id.'\');
} }
if (jQuery("#selectcomplete").val() == 0) if ($("#selectcomplete").val() == 0)
{ {
jQuery("#doneby").val(-1); $("#doneby").val(-1);
} }
}); });
jQuery("#actioncode").change(function() { $("#actioncode").change(function() {
if (jQuery("#actioncode").val() == \'AC_RDV\') jQuery("#dateend").addClass("fieldrequired"); if ($("#actioncode").val() == \'AC_RDV\') $("#dateend").addClass("fieldrequired");
else jQuery("#dateend").removeClass("fieldrequired"); else $("#dateend").removeClass("fieldrequired");
}); });
})'; })';
print '</script>'."\n"; print '</script>'."\n";
} }
print '<form name="formaction" action="'.DOL_URL_ROOT.'/comm/action/fiche.php" method="POST">'; print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add_action">'; print '<input type="hidden" name="action" value="add_action">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">'; if ($backtopage) print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]).'">';
@ -647,43 +638,34 @@ if ($id)
if ($action == 'edit') if ($action == 'edit')
{ {
if ($conf->use_javascript_ajax) if (! empty($conf->use_javascript_ajax))
{ {
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () { print '$(document).ready(function () {
function setdatefields() function setdatefields()
{ {
if (jQuery("#fullday:checked").val() == null) if ($("#fullday:checked").val() == null) {
{ $(".fulldaystarthour").removeAttr("disabled");
jQuery(".fulldaystarthour").attr(\'disabled\', false); $(".fulldaystartmin").removeAttr("disabled");
jQuery(".fulldaystartmin").attr(\'disabled\', false); $(".fulldayendhour").removeAttr("disabled");
jQuery(".fulldayendhour").attr(\'disabled\', false); $(".fulldayendmin").removeAttr("disabled");
jQuery(".fulldayendmin").attr(\'disabled\', false); } else {
} $(".fulldaystarthour").attr("disabled","disabled").val("00");
else $(".fulldaystartmin").attr("disabled","disabled").val("00");
{ $(".fulldayendhour").attr("disabled","disabled").val("23");
jQuery(".fulldaystarthour").attr(\'disabled\', true); $(".fulldayendmin").attr("disabled","disabled").val("59");
jQuery(".fulldaystartmin").attr(\'disabled\', true); }
jQuery(".fulldayendhour").attr(\'disabled\', true); }
jQuery(".fulldayendmin").attr(\'disabled\', true); setdatefields();
jQuery(".fulldaystarthour").val("00"); $("#fullday").change(function() {
jQuery(".fulldaystartmin").val("00"); setdatefields();
//jQuery(".fulldayendhour").val("00"); });
//jQuery(".fulldayendmin").val("00");
jQuery(".fulldayendhour").val("23");
jQuery(".fulldayendmin").val("59");
}
}
setdatefields();
jQuery("#fullday").change(function() {
setdatefields();
});
})'; })';
print '</script>'."\n"; print '</script>'."\n";
} }
// Fiche action en mode edition // Fiche action en mode edition
print '<form name="formaction" action="'.DOL_URL_ROOT.'/comm/action/fiche.php" method="post">'; print '<form name="formaction" action="'.$_SERVER['PHP_SELF'].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$id.'">'; print '<input type="hidden" name="id" value="'.$id.'">';

View File

@ -981,8 +981,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Define $color and $cssclass of event // Define $color and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1; $color=-1; $cssclass=''; $colorindex=-1;
if ($event->author->id == $user->id || $event->usertodo->id == $user->id || $event->userdone->id == $user->id) { $nummytasks++; $colorindex=1; $cssclass='family_mytasks'; } if ((! empty($event->author->id) && $event->author->id == $user->id)
else if ($event->type_code == 'ICALEVENT') { $numical++; $numicals[dol_string_nospecial($event->icalname)]++; $color=$event->icalcolor; $cssclass=($event->icalname?'family_'.dol_string_nospecial($event->icalname):'family_other'); } || (! empty($event->usertodo->id) && $event->usertodo->id == $user->id)
|| (! empty($event->userdone->id) && $event->userdone->id == $user->id)) {
$nummytasks++; $colorindex=1; $cssclass='family_mytasks';
}
else if ($event->type_code == 'ICALEVENT') {
$numical++;
if (! empty($event->icalname)) {
if (! isset($numicals[dol_string_nospecial($event->icalname)])) {
$numicals[dol_string_nospecial($event->icalname)] = 0;
}
$numicals[dol_string_nospecial($event->icalname)]++;
}
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other');
}
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; } else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; }
else { $numother++; $colorindex=2; $cssclass='family_other'; } else { $numother++; $colorindex=2; $cssclass='family_other'; }
if ($color == -1) $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); if ($color == -1) $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);

View File

@ -473,7 +473,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$langs->load("propal"); $langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp"; $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -513,7 +513,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td width="18" class="nobordernopadding" nowrap="nowrap">'; print '<td width="18" class="nobordernopadding" nowrap="nowrap">';
if ($db->jdate($obj->dp) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); if ($db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
print '</td>'; print '</td>';
print '<td width="16" align="center" class="nobordernopadding">'; print '<td width="16" align="center" class="nobordernopadding">';
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);

View File

@ -136,7 +136,7 @@ if ($action == 'delete')
$classname = "MailingTargets"; $classname = "MailingTargets";
$obj = new $classname($db); $obj = new $classname($db);
$obj->update_nb($id); $obj->update_nb($id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit; exit;
} }
@ -298,7 +298,7 @@ if ($object->fetch($id) >= 0)
} }
print '<td>'; print '<td>';
if (! $obj->picto) $obj->picto='generic'; if (empty($obj->picto)) $obj->picto='generic';
print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc(); print img_object($langs->trans("Module").': '.get_class($obj),$obj->picto).' '.$obj->getDesc();
print '</td>'; print '</td>';

View File

@ -337,16 +337,30 @@ if ($action == 'sendallconfirmed' && $confirm == 'yes')
$i++; $i++;
} }
} }
else
{
setEventMessage($langs->transnoentitiesnoconv("NoMoreRecipientToSendTo"));
}
// Loop finished, set global statut of mail // Loop finished, set global statut of mail
if ($nbko > 0) if ($nbko > 0)
{ {
$statut=2; // Status 'sent partially' (because at least one error) $statut=2; // Status 'sent partially' (because at least one error)
if ($nbok > 0) setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
else setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
} }
else else
{ {
if ($nbok >= $num) $statut=3; // Send to everybody if ($nbok >= $num)
else $statut=2; // Status 'sent partially' (because not send to everybody) {
$statut=3; // Send to everybody
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
else
{
$statut=2; // Status 'sent partially' (because not send to everybody)
setEventMessage($langs->transnoentitiesnoconv("EMailSentToNRecipients",$nbok));
}
} }
$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id; $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id;
@ -388,8 +402,8 @@ if ($action == 'send' && empty($_POST["cancel"]))
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1; if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
// Pratique les substitutions sur le sujet et message // Pratique les substitutions sur le sujet et message
$object->sujet=make_substitutions($object->sujet,$object->substitutionarrayfortest); $tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
$object->body=make_substitutions($object->body,$object->substitutionarrayfortest); $tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
$arr_file = array(); $arr_file = array();
$arr_mime = array(); $arr_mime = array();
@ -412,7 +426,7 @@ if ($action == 'send' && empty($_POST["cancel"]))
} }
} }
$mailfile = new CMailFile($object->sujet,$object->sendto,$object->email_from,$object->body, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$object->email_errorsto,$arr_css); $mailfile = new CMailFile($tmpsujet,$object->sendto,$object->email_from,$tmpbody, $arr_file,$arr_mime,$arr_name,'', '', 0, $msgishtml,$object->email_errorsto,$arr_css);
$result=$mailfile->sendfile(); $result=$mailfile->sendfile();
if ($result) if ($result)
@ -1148,7 +1162,6 @@ else
} }
} }
llxFooter(); llxFooter();
$db->close(); $db->close();
?> ?>

View File

@ -36,6 +36,8 @@ $langs->load('companies');
$langs->load('projects'); $langs->load('projects');
$langs->load('propal'); $langs->load('propal');
$action=GETPOST('action', 'alpha');
// Security check // Security check
$socid = GETPOST('socid','int'); $socid = GETPOST('socid','int');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
@ -48,19 +50,19 @@ $object = new Prospect($db);
* Actions * Actions
*/ */
if ($_GET["action"] == 'cstc') if ($action == 'cstc')
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["stcomm"]; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["stcomm"];
$sql .= " WHERE rowid = ".$_GET["socid"]; $sql .= " WHERE rowid = ".$socid;
$db->query($sql); $db->query($sql);
} }
// set prospect level // set prospect level
if ($_POST["action"] == 'setprospectlevel' && $user->rights->societe->creer) if ($action == 'setprospectlevel' && $user->rights->societe->creer)
{ {
$object->fetch($_GET["socid"]); $object->fetch($socid);
$object->fk_prospectlevel=$_POST['prospect_level_id']; $object->fk_prospectlevel=$_POST['prospect_level_id'];
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id']; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_prospectlevel='".$_POST['prospect_level_id'];
$sql.= "' WHERE rowid='".$_GET["socid"]."'"; $sql.= " WHERE rowid = ".$socid;
$result = $db->query($sql); $result = $db->query($sql);
if (! $result) dol_print_error($result); if (! $result) dol_print_error($result);
} }
@ -111,7 +113,7 @@ if ($socid > 0)
print "</td></tr>"; print "</td></tr>";
// Zip / Town // Zip / Town
print '<tr><td nowrap="nowrap">'.$langs->trans('Zip').' / '.$langs->trans("Town").'</td><td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$societe->town.'</td>'; print '<tr><td nowrap="nowrap">'.$langs->trans('Zip').' / '.$langs->trans("Town").'</td><td colspan="3">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td>';
print '</tr>'; print '</tr>';
// Country // Country
@ -136,18 +138,13 @@ if ($socid > 0)
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('ProspectLevelShort'); print $langs->trans('ProspectLevelShort');
print '<td>'; print '<td>';
if (($_GET['action'] != 'editlevel') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$object->id.'">'.img_edit($langs->trans('SetLevel'),1).'</a></td>'; if ($action != 'editlevel' && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;socid='.$object->id.'">'.img_edit($langs->trans('SetLevel'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET['action'] == 'editlevel') if ($action == 'editlevel')
{
$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1); $formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_prospectlevel,'prospect_level_id',1);
}
else else
{
print $object->getLibLevel(); print $object->getLibLevel();
//$formcompany->form_prospect_level($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->mode_reglement,'none');
}
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';

View File

@ -18,7 +18,6 @@
/** /**
* \file htdocs/compta/ajaxpayment.php * \file htdocs/compta/ajaxpayment.php
* \brief File to return Ajax response on payment breakdown process * \brief File to return Ajax response on payment breakdown process
* \version ajaxpayment.php,v 1.0
*/ */
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
@ -32,9 +31,15 @@ if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't nee
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); //if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) //if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
$langs->Load('compta'); $langs->load('compta');
/*
* View
*/
//init var //init var
$amountPayment = $_POST['amountPayment']; $amountPayment = $_POST['amountPayment'];
@ -42,26 +47,31 @@ $amounts = $_POST['amounts']; // from text inputs : invoice amount payment (c
$remains = $_POST['remains']; // from dolibarr's object (no need to check) $remains = $_POST['remains']; // from dolibarr's object (no need to check)
$currentInvId = $_POST['imgClicked']; // from DOM elements : imgId (equals invoice id) $currentInvId = $_POST['imgClicked']; // from DOM elements : imgId (equals invoice id)
// Getting the posted keys=>values, sanitize the ones who are from text inputs // Getting the posted keys=>values, sanitize the ones who are from text inputs
// from text inputs : total amount // from text inputs : total amount
$amountPayment = $amountPayment!='' ? ( is_numeric(price2num($amountPayment)) ? price2num($amountPayment) $amountPayment = $amountPayment!='' ? ( is_numeric(price2num($amountPayment)) ? price2num($amountPayment) : '' ) : ''; // keep void if not a valid entry
: ''
) // Clean checkamounts
: ''; // keep void if not a valid entry foreach ($amounts as $key => $value)
// Checkamounts {
foreach ($amounts as $key => $value) $value = price2num($value);
{ $amounts[$key]=$value;
$value = price2num($value); if (empty($value)) unset($amounts[$key]);
if (!is_numeric($value)) unset($amounts[$key]); }
} // Clean remains
foreach ($remains as $key => $value)
{
$value = price2num($value);
$remains[$key]=$value;
if (empty($value)) unset($remains[$key]);
}
// Treatment // Treatment
$result = $amountPayment != '' ? $amountPayment - array_sum($amounts) : $amountPayment + array_sum($amounts); // Remaining amountPayment $result = $amountPayment != '' ? ($amountPayment - array_sum($amounts)) : ($amountPayment + array_sum($amounts)); // Remaining amountPayment
$toJsonArray = array(); $toJsonArray = array();
$totalRemaining = price2num(array_sum($remains)); $totalRemaining = price2num(array_sum($remains));
$toJsonArray['label'] = $amountPayment == '' ? $langs->transnoentities('AmountToBeCharged') : $langs->transnoentities('RemainingAmountPayment'); $toJsonArray['label'] = $amountPayment == '' ? '' : $langs->transnoentities('RemainingAmountPayment');
if($currentInvId) // Here to breakdown if ($currentInvId) // Here to breakdown
{ {
// Get the current amount (from form) and the corresponding remainToPay (from invoice) // Get the current amount (from form) and the corresponding remainToPay (from invoice)
$currentAmount = $amounts['amount_'.$currentInvId]; $currentAmount = $amounts['amount_'.$currentInvId];
@ -99,9 +109,11 @@ if($currentInvId) // Here to breakdown
} }
$toJsonArray['amount_'.$currentInvId] = price2num($currentAmount).""; // Param will exist only if an img has been clicked $toJsonArray['amount_'.$currentInvId] = price2num($currentAmount).""; // Param will exist only if an img has been clicked
} }
// Encode to JSON to return
$toJsonArray['makeRed'] = $totalRemaining < price2num($result) || price2num($result) < 0 ? true : false;
$toJsonArray['result'] = price2num($result);
echo json_encode($toJsonArray); // Printing the call's result
$toJsonArray['makeRed'] = ($totalRemaining < price2num($result) || price2num($result) < 0) ? true : false;
$toJsonArray['result'] = price($result); // Return value to user format
$toJsonArray['resultnum'] = price2num($result); // Return value to numeric format
// Encode to JSON to return
echo dol_json_encode($toJsonArray); // Printing the call's result
?> ?>

View File

@ -88,12 +88,12 @@ if ($_POST["action"] == 'add')
$action='create'; // Force chargement page en mode creation $action='create'; // Force chargement page en mode creation
$error++; $error++;
} }
if (empty($account->label)) if (empty($account->label))
{ {
setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors'); setEventMessage($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("LabelBankCashAccount")), 'errors');
$action='create'; // Force chargement page en mode creation $action='create'; // Force chargement page en mode creation
$error++; $error++;
} }
if (! $error) if (! $error)
{ {

View File

@ -280,14 +280,14 @@ else if ($action == 'setconditions' && $user->rights->facture->creer)
$object->cond_reglement_code=0; // To clean property $object->cond_reglement_code=0; // To clean property
$object->cond_reglement_id=0; // To clean property $object->cond_reglement_id=0; // To clean property
$result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int')); $result=$object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
$old_date_lim_reglement=$object->date_lim_reglement; $old_date_lim_reglement=$object->date_lim_reglement;
$new_date_lim_reglement=$object->calculate_date_lim_reglement(); $new_date_lim_reglement=$object->calculate_date_lim_reglement();
if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement; if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement=$new_date_lim_reglement;
if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date; if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date;
$result=$object->update($user); $result=$object->update($user);
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
else if ($action == 'setpaymentterm' && $user->rights->facture->creer) else if ($action == 'setpaymentterm' && $user->rights->facture->creer)
{ {

View File

@ -280,12 +280,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$(\'.fieldrequireddyn\').removeClass(\'fieldrequired\'); $(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
$(\'#fieldchqemetteur\').val(\'\'); $(\'#fieldchqemetteur\').val(\'\');
} }
}'; }
// For paiement auto-completion
if (! empty($conf->global->MAIN_JS_ON_PAYMENT)) function _elemToJson(selector)
{
print "\n".'
function elemToJson(selector)
{ {
var subJson = {}; var subJson = {};
$.map(selector.serializeArray(), function(n,i) $.map(selector.serializeArray(), function(n,i)
@ -300,14 +297,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
var form = $("#payment_form"); var form = $("#payment_form");
json["amountPayment"] = $("#amountpayment").attr("value"); json["amountPayment"] = $("#amountpayment").attr("value");
json["amounts"] = elemToJson(form.find("input[name*=\"amount_\"]")); json["amounts"] = _elemToJson(form.find("input[name*=\"amount_\"]"));
json["remains"] = elemToJson(form.find("input[name*=\"remain_\"]")); json["remains"] = _elemToJson(form.find("input[name*=\"remain_\"]"));
if (imgId != null) { if (imgId != null) {
json["imgClicked"] = imgId; json["imgClicked"] = imgId;
} }
$.post("ajaxpayment.php", json, function(data) $.post("'.DOL_URL_ROOT.'/compta/ajaxpayment.php", json, function(data)
{ {
json = $.parseJSON(data); json = $.parseJSON(data);
@ -317,9 +314,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{ {
if (key == "result") { if (key == "result") {
if (json["makeRed"]) { if (json["makeRed"]) {
$("#"+key).css("color", "red"); $("#"+key).addClass("error");
} else { } else {
$("#"+key).removeAttr("style"); $("#"+key).removeClass("error");
} }
json[key]=json["label"]+" "+json[key]; json[key]=json["label"]+" "+json[key];
$("#"+key).text(json[key]); $("#"+key).text(json[key]);
@ -331,27 +328,27 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
} }
}); });
} }
function callToBreakdown(imgSelector) {
var form = $("#payment_form"), imgId;
imgId = imgSelector.attr("id");
callForResult(imgId);
}
$("#payment_form").find("img").click(function() {
callToBreakdown(jQuery(this));
});
$("#payment_form").find("input[name*=\"amount_\"]").change(function() { $("#payment_form").find("input[name*=\"amount_\"]").change(function() {
callForResult(); callForResult();
}); });
$("#payment_form").find("input[name*=\"amount_\"]").keyup(function() {
callForResult();
});
';
if (! empty($conf->global->MAIN_JS_ON_PAYMENT))
{
print ' $("#payment_form").find("img").click(function() {
callForResult(jQuery(this).attr("id"));
});
$("#amountpayment").change(function() { $("#amountpayment").change(function() {
callForResult(); callForResult();
});'; });';
} }
print '});
</script>'."\n"; print ' });'."\n";
print ' </script>'."\n";
} }
print '<form id="payment_form" name="add_paiement" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form id="payment_form" name="add_paiement" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -573,7 +570,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if ($totalrecudeposits) print '+'.price($totalrecudeposits); if ($totalrecudeposits) print '+'.price($totalrecudeposits);
print '</b></td>'; print '</b></td>';
print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>'; print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
print '<td align="right" id="result" style="font-weight:bold;"></td>'; print '<td align="right" id="result" style="font-weight: bold;"></td>';
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }

View File

@ -28,9 +28,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
// FIXME don't include external module class
if (! empty($conf->esaeb->enabled))
dol_include_once('/esaeb/class/esaeb19.class.php');
/** /**
@ -481,7 +478,6 @@ class BonPrelevement extends CommonObject
/* /*
* End of procedure * End of procedure
*
*/ */
if ($error == 0) if ($error == 0)
{ {
@ -928,7 +924,7 @@ class BonPrelevement extends CommonObject
} }
/* /*
* Creation process * Create withdrawal receipt
*/ */
if (!$error) if (!$error)
{ {
@ -1181,12 +1177,15 @@ class BonPrelevement extends CommonObject
$this->file = fopen($this->filename,"w"); $this->file = fopen($this->filename,"w");
// TODO Move code for es and fr into an external module file with selection into setup of prelevement module
// Build file for Spain // Build file for Spain
if ($mysoc->country_code=='ES') if ($mysoc->country_code=='ES')
{ {
// TODO replace by a hook (external modules)
if (! empty($conf->esaeb->enabled)) if (! empty($conf->esaeb->enabled))
{ {
dol_include_once('/esaeb/class/esaeb19.class.php');
//Head //Head
$esaeb19 = new AEB19DocWritter; $esaeb19 = new AEB19DocWritter;
$esaeb19->configuraPresentador($this->numero_national_emetteur,$conf->global->ESAEB_SUFIX_PRESENTADOR,$this->raison_sociale,$this->emetteur_code_banque,$this->emetteur_code_guichet); $esaeb19->configuraPresentador($this->numero_national_emetteur,$conf->global->ESAEB_SUFIX_PRESENTADOR,$this->raison_sociale,$this->emetteur_code_banque,$this->emetteur_code_guichet);
@ -1239,7 +1238,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, $esaeb19->generaRemesa()); fputs($this->file, $esaeb19->generaRemesa());
} }
else else
{ {
$this->total = 0; $this->total = 0;
$sql = "SELECT pl.amount"; $sql = "SELECT pl.amount";
$sql.= " FROM"; $sql.= " FROM";
@ -1271,10 +1270,8 @@ class BonPrelevement extends CommonObject
$langs->load('withdrawals'); $langs->load('withdrawals');
fputs($this->file, $langs->trans('WithdrawalFileNotCapable')); fputs($this->file, $langs->trans('WithdrawalFileNotCapable'));
} }
} }
// Build file for France
//Build file for France
elseif ($mysoc->country_code=='FR') elseif ($mysoc->country_code=='FR')
{ {
/* /*
@ -1316,7 +1313,7 @@ class BonPrelevement extends CommonObject
} }
} }
else else
{ {
$result = -2; $result = -2;
} }
@ -1326,10 +1323,9 @@ class BonPrelevement extends CommonObject
$this->EnregTotal($this->total); $this->EnregTotal($this->total);
} }
// Build file for Other Countries with unknow format
//Build file for Other Countries with unknow format
else else
{ {
$this->total = 0; $this->total = 0;
$sql = "SELECT pl.amount"; $sql = "SELECT pl.amount";
$sql.= " FROM"; $sql.= " FROM";

View File

@ -214,11 +214,11 @@ if ($action == 'create')
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
// Label // Label
print '<td align="left"><input type="text" size="34" name="label" class="flat"></td>'; print '<td align="left"><input type="text" size="34" name="label" class="flat" value="'.GETPOST('label').'"></td>';
// Type // Type
print '<td align="left">'; print '<td align="left">';
$formsocialcontrib->select_type_socialcontrib(isset($_POST["actioncode"])?$_POST["actioncode"]:'','actioncode',1); $formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
print '</td>'; print '</td>';
// Date end period // Date end period

View File

@ -401,14 +401,12 @@ class ChargeSociales extends CommonObject
*/ */
function getSommePaiement() function getSommePaiement()
{ {
global $conf; $table='paiementcharge';
$field='fk_charge';
$sql = 'SELECT SUM(amount) as amount'; $sql = 'SELECT sum(amount) as amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiementcharge as pc'; $sql.= ' FROM '.MAIN_DB_PREFIX.$table;
$sql.= ', '.MAIN_DB_PREFIX.'chargesociales as c'; $sql.= ' WHERE '.$field.' = '.$this->id;
$sql.= ' WHERE c.entity = '.$conf->entity;
$sql.= ' AND pc.fk_charge = c.rowid';
$sql.= ' AND pc.fk_charge = '.$this->id;
dol_syslog(get_class($this)."::getSommePaiement sql=".$sql, LOG_DEBUG); dol_syslog(get_class($this)."::getSommePaiement sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
/** /**
* \class Contact * Class to manage contact/addresses
* \brief Classe permettant la gestion des contacts
*/ */
class Contact extends CommonObject class Contact extends CommonObject
{ {
@ -148,7 +147,7 @@ class Contact extends CommonObject
if (! $error) if (! $error)
{ {
$result=$this->update($this->id, $user, 1); $result=$this->update($this->id, $user, 1, 'add');
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
@ -203,10 +202,11 @@ class Contact extends CommonObject
* *
* @param int $id Id of contact/address to update * @param int $id Id of contact/address to update
* @param User $user Objet user making change * @param User $user Objet user making change
* @param int $notrigger 0=no, 1=yesi * @param int $notrigger 0=no, 1=yes
* @param string $action Current action for hookmanager
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($id, $user=0, $notrigger=0) function update($id, $user=0, $notrigger=0, $action='update')
{ {
global $conf, $langs; global $conf, $langs;
@ -271,10 +271,13 @@ class Contact extends CommonObject
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
$result=$this->insertExtraFields(); if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
if ($result < 0)
{ {
$error++; $result=$this->insertExtraFields();
if ($result < 0)
{
$error++;
}
} }
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;

View File

@ -104,11 +104,15 @@ class CMailFile
{ {
global $conf; global $conf;
// We define end of line (RFC 822bis section 2.3) // We define end of line (RFC 821).
$this->eol="\r\n"; $this->eol="\r\n";
// eol2 is for header fields to manage bugged MTA with option MAIN_FIX_FOR_BUGGED_MTA // We define end of line for header fields (RFC 822bis section 2.3 says header must contains \r\n).
$this->eol2=$this->eol; $this->eol2="\r\n";
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) $this->eol2="\n"; if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
{
$this->eol="\n";
$this->eol2="\n";
}
// On defini mixed_boundary // On defini mixed_boundary
$this->mixed_boundary = "multipart_x." . time() . ".x_boundary"; $this->mixed_boundary = "multipart_x." . time() . ".x_boundary";
@ -547,6 +551,7 @@ class CMailFile
/** /**
* Write content of a SMTP request into a dump file (mode = all) * Write content of a SMTP request into a dump file (mode = all)
* Used for debugging. * Used for debugging.
* Note that to see full SMTP protocol, you can use tcpdump -w /tmp/smtp -s 2000 port 25"
* *
* @return void * @return void
*/ */
@ -647,6 +652,10 @@ class CMailFile
// Sender // Sender
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2; //$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2; $out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA))
{
$out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2;
}
$out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2; $out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2;
if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2; if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2;
if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2; if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2;
@ -738,7 +747,11 @@ class CMailFile
// Make RFC821 Compliant, replace bare linefeeds // Make RFC821 Compliant, replace bare linefeeds
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent); $strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
{
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
}
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged //$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
$strContent = rtrim(wordwrap($strContent)); $strContent = rtrim(wordwrap($strContent));

View File

@ -160,19 +160,19 @@ class Conf
if ($value && preg_match('/^MAIN_MODULE_/',$key)) if ($value && preg_match('/^MAIN_MODULE_/',$key))
{ {
// If this is constant for a new tab page activated by a module. // If this is constant for a new tab page activated by a module.
if (preg_match('/^MAIN_MODULE_([A-Z_]+)_TABS_/i',$key)) if (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i',$key))
{ {
$params=explode(':',$value,2); $params=explode(':',$value,2);
$this->tabs_modules[$params[0]][]=$value; $this->tabs_modules[$params[0]][]=$value;
} }
// If this is constant for a sms engine // If this is constant for a sms engine
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_SMS$/i',$key,$reg))
{ {
$modulename=strtolower($reg[1]); $modulename=strtolower($reg[1]);
$this->sms_engine_modules[$modulename]=$modulename; // Add this module in list of modules that provide SMS $this->sms_engine_modules[$modulename]=$modulename; // Add this module in list of modules that provide SMS
} }
// If this is constant for all generic part activated by a module // If this is constant for all generic part activated by a module
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_([A-Z]+)$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i',$key,$reg))
{ {
$modulename = strtolower($reg[1]); $modulename = strtolower($reg[1]);
$partname = strtolower($reg[2]); $partname = strtolower($reg[2]);
@ -185,7 +185,7 @@ class Conf
$this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value));
} }
// If this is a module constant (must be at end) // If this is a module constant (must be at end)
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i',$key,$reg))
{ {
$modulename=strtolower($reg[1]); $modulename=strtolower($reg[1]);
if ($modulename == 'propale') $modulename='propal'; if ($modulename == 'propale') $modulename='propal';

View File

@ -967,7 +967,9 @@ class DoliDBMssql
{ {
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') $sql.="(".$field_desc['value'].")"; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
$sql.="(".$field_desc['value'].")";
}
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))

View File

@ -1010,9 +1010,11 @@ class DoliDBMysql
{ {
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') $sql.="(".$field_desc['value'].")"; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
$sql.="(".$field_desc['value'].")";
}
if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL";
dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))
return -1; return -1;

View File

@ -1004,9 +1004,11 @@ class DoliDBMysqli
{ {
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') $sql.="(".$field_desc['value'].")"; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
$sql.="(".$field_desc['value'].")";
}
if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL";
dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))
return -1; return -1;

View File

@ -297,7 +297,7 @@ class DoliDBPgsql
// To have postgresql case sensitive // To have postgresql case sensitive
$line=str_replace(' LIKE \'',' ILIKE \'',$line); $line=str_replace(' LIKE \'',' ILIKE \'',$line);
$line=str_replace(' LIKE BINARY \'',' LIKE \'',$line); $line=str_replace(' LIKE BINARY \'',' LIKE \'',$line);
// Delete using criteria on other table must not declare twice the deleted table // Delete using criteria on other table must not declare twice the deleted table
// DELETE FROM tabletodelete USING tabletodelete, othertable -> DELETE FROM tabletodelete USING othertable // DELETE FROM tabletodelete USING tabletodelete, othertable -> DELETE FROM tabletodelete USING othertable
if (preg_match('/DELETE FROM ([a-z_]+) USING ([a-z_]+), ([a-z_]+)/i',$line,$reg)) if (preg_match('/DELETE FROM ([a-z_]+) USING ([a-z_]+), ([a-z_]+)/i',$line,$reg))
@ -1219,11 +1219,13 @@ class DoliDBPgsql
{ {
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') $sql.="(".$field_desc['value'].")"; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
$sql.="(".$field_desc['value'].")";
}
// FIXME May not work with pgsql. May need to run a second request. If it works, just remove the FIXME tag // FIXME May not work with pgsql. May need to run a second request. If it works, just remove the FIXME tag
if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL"; if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL";
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))
return -1; return -1;

View File

@ -1153,7 +1153,9 @@ class DoliDBSqlite
{ {
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') $sql.="(".$field_desc['value'].")"; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
$sql.="(".$field_desc['value'].")";
}
dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLUpdateField ".$sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))

View File

@ -587,7 +587,9 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{ {
print '<td align="center"><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">'; print '<td align="center"><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
print img_object($langs->trans("Rendez-Vous"),"action"); print img_object($langs->trans("Rendez-Vous"),"action_rdv");
print '</a> <a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
print img_object($langs->trans("Event"),"action");
print '</a></td>'; print '</a></td>';
} }
@ -753,7 +755,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
{ {
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create'; $out.='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create';
if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id; if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id;
$out.='&amp;contactid='.$objcon->id.'&amp;backtopage=1&amp;percentage=-1">'; $out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' '; $out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew'); $out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>"; $out.="</a>";
@ -776,10 +778,13 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; if (get_class($object) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
$sql.= " WHERE u.rowid = a.fk_user_author"; $sql.= " WHERE u.rowid = a.fk_user_author";
$sql.= " AND a.entity IN (".getEntity('actioncomm').")"; $sql.= " AND a.entity IN (".getEntity('actioncomm').")";
if (get_class($object) == 'Adherent') $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; if (get_class($object) == 'Adherent') {
if (get_class($object) == 'Adherent' && $object->id) $sql.= " AND a.fk_element = ".$object->id; $sql.= " AND a.fk_element = m.rowid AND a.elementtype = 'member'";
if (! empty($object->id))
$sql.= " AND a.fk_element = ".$object->id;
}
if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id; if (get_class($object) == 'Societe' && $object->id) $sql.= " AND a.fk_soc = ".$object->id;
if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id; if (! empty($objcon->id)) $sql.= " AND a.fk_contact = ".$objcon->id;
$sql.= " AND c.id=a.fk_action"; $sql.= " AND c.id=a.fk_action";
$sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
$sql.= " ORDER BY a.datep DESC, a.id DESC"; $sql.= " ORDER BY a.datep DESC, a.id DESC";
@ -825,7 +830,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.='<td colspan="2">'.$actionstatic->getNomUrl(1,40).'</td>'; $out.='<td colspan="2">'.$actionstatic->getNomUrl(1,40).'</td>';
// Contact pour cette action // Contact pour cette action
if (! $objcon->id && $obj->fk_contact > 0) if (empty($objcon->id) && $obj->fk_contact > 0)
{ {
$contactstatic->name=$obj->name; $contactstatic->name=$obj->name;
$contactstatic->firstname=$obj->firstname; $contactstatic->firstname=$obj->firstname;
@ -1029,11 +1034,11 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0)
$out.='</td>'; $out.='</td>';
$out.='<td colspan="5" align="right">'; $out.='<td colspan="5" align="right">';
$permok=$user->rights->agenda->myactions->create; $permok=$user->rights->agenda->myactions->create;
if (($object->id || $objcon->id) && $permok) if ((! empty($object->id) || ! empty($objcon->id)) && $permok)
{ {
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create'; $out.='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create';
if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id; if (get_class($object) == 'Societe') $out.='&amp;socid='.$object->id;
$out.='&amp;contactid='.$objcon->id.'&amp;backtopage=1&amp;percentage=-1">'; $out.=(! empty($objcon->id)?'&amp;contactid='.$objcon->id:'').'&amp;backtopage=1&amp;percentage=-1">';
$out.=$langs->trans("AddAnAction").' '; $out.=$langs->trans("AddAnAction").' ';
$out.=img_picto($langs->trans("AddAnAction"),'filenew'); $out.=img_picto($langs->trans("AddAnAction"),'filenew');
$out.="</a>"; $out.="</a>";

View File

@ -2700,8 +2700,17 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller=".$thirdparty_seller->id); dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller=".$thirdparty_seller->id);
// Some test to guess with no need to make database access // Some test to guess with no need to make database access
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0; if ($mysoc->country_code == 'ES') // For spain, localtaxes are qualified if both supplier and seller use local taxe
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0; {
if ($local == 1 && (! $thirdparty_seller->localtax1_assuj || ! $thirdparty_buyer->localtax1_assuj)) return 0;
if ($local == 2 && (! $thirdparty_seller->localtax2_assuj || ! $thirdparty_buyer->localtax2_assuj)) return 0;
}
else
{
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0;
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
}
//if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0); //if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0);
$code_country=$thirdparty_seller->country_code; $code_country=$thirdparty_seller->country_code;
@ -2819,54 +2828,54 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
require DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
} }
$ret=0; $ret=0;
$found=0; $found=0;
if ($idprod > 0) if ($idprod > 0)
{ {
// Load product // Load product
$product=new Product($db); $product=new Product($db);
$result=$product->fetch($idprod); $result=$product->fetch($idprod);
if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours
{ {
/* Not defined yet, so we don't use this /* Not defined yet, so we don't use this
if ($local==1) $ret=$product->localtax1_tx; if ($local==1) $ret=$product->localtax1_tx;
elseif ($local==2) $ret=$product->localtax2_tx; elseif ($local==2) $ret=$product->localtax2_tx;
$found=1; $found=1;
*/ */
} }
else else
{ {
// TODO Read default product vat according to countrycode and product // TODO Read default product vat according to countrycode and product
} }
} }
if (! $found) if (! $found)
{ {
// If vat of product for the country not found or not defined, we return higher vat of country. // If vat of product for the country not found or not defined, we return higher vat of country.
$sql = "SELECT taux as vat_rate, localtax1, localtax2"; $sql = "SELECT taux as vat_rate, localtax1, localtax2";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; $sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
$sql.= $db->plimit(1); $sql.= $db->plimit(1);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$obj=$db->fetch_object($resql); $obj=$db->fetch_object($resql);
if ($obj) if ($obj)
{ {
if ($local==1) $ret=$obj->localtax1; if ($local==1) $ret=$obj->localtax1;
elseif ($local==2) $ret=$obj->localtax2; elseif ($local==2) $ret=$obj->localtax2;
} }
} }
else dol_print_error($db); else dol_print_error($db);
} }
dol_syslog("get_product_localtax_for_country: ret=".$ret); dol_syslog("get_product_localtax_for_country: ret=".$ret);
return $ret; return $ret;
} }
@ -3565,7 +3574,7 @@ function get_date_range($date_start,$date_end,$format = '',$outputlangs='')
*/ */
function setEventMessage($mesgs, $style='mesgs') function setEventMessage($mesgs, $style='mesgs')
{ {
if (! in_array($style,array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage'); if (! in_array((string) $style, array('mesgs','warnings','errors'))) dol_print_error('','Bad parameter for setEventMessage');
if (! is_array($mesgs)) // If mesgs is a string if (! is_array($mesgs)) // If mesgs is a string
{ {
if ($mesgs) $_SESSION['dol_events'][$style][] = $mesgs; if ($mesgs) $_SESSION['dol_events'][$style][] = $mesgs;

View File

@ -57,30 +57,30 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
if (empty($seller) || ! is_object($seller)) $seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc if (empty($seller) || ! is_object($seller)) $seller=$mysoc; // If seller is a customer, $seller is not provided, we use $mysoc
$countryid=$seller->country_id; $countryid=$seller->country_id;
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj; if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
// Now we search localtaxes information ourself (rates and types). // Now we search localtaxes information ourself (rates and types).
$sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type"; $sql = "SELECT taux, localtax1, localtax2, localtax1_type, localtax2_type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv";
//$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc"; //$sql.= ", ".MAIN_DB_PREFIX."c_pays as cc";
$sql.= " WHERE cv.taux = ".$txtva; $sql.= " WHERE cv.taux = ".$txtva;
//$sql.= " AND cv.fk_pays = cc.rowid and cc.code = '".$mysoc->country_code."'"; //$sql.= " AND cv.fk_pays = cc.rowid and cc.code = '".$mysoc->country_code."'";
$sql.= " AND cv.fk_pays = ".$countryid; $sql.= " AND cv.fk_pays = ".$countryid;
dol_syslog("search vat information sql=".$sql); dol_syslog("search vat information sql=".$sql);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($obj) if ($obj)
{ {
$localtax1_rate=$obj->localtax1; $localtax1_rate=$obj->localtax1;
$localtax2_rate=$obj->localtax2; $localtax2_rate=$obj->localtax2;
$localtax1_type=$obj->localtax1_type; $localtax1_type=$obj->localtax1_type;
$localtax2_type=$obj->localtax2_type; $localtax2_type=$obj->localtax2_type;
//var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);exit; //var_dump($localtax1_rate.' '.$localtax2_rate.' '.$localtax1_type.' '.$localtax2_type);exit;
} }
} }
else dol_print_error($db); else dol_print_error($db);
// initialize total (may be HT or TTC depending on price_base_type) // initialize total (may be HT or TTC depending on price_base_type)
$tot_sans_remise = $pu * $qty; $tot_sans_remise = $pu * $qty;
@ -177,8 +177,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
} }
// if there's some localtax without vat, we calculate localtaxes (we will add them at end) // if there's some localtax without vat, we calculate localtaxes (we will add them at end)
$apply_tax = false;
//If price is 'TTC' we need to have the totals without VAT for a correct calculation //If price is 'TTC' we need to have the totals without VAT for a correct calculation
if ($price_base_type=='TTC') if ($price_base_type=='TTC')
{ {
@ -186,7 +185,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
} }
switch($localtax1_type) { $apply_tax = false;
switch($localtax1_type) {
case '1': // localtax on product or service case '1': // localtax on product or service
$apply_tax = true; $apply_tax = true;
break; break;

View File

@ -415,6 +415,9 @@ abstract class DolibarrModules
global $db,$conf; global $db,$conf;
$error=0; $error=0;
$dirfound=0;
if (empty($reldir)) return 1;
include_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php'; include_once DOL_DOCUMENT_ROOT .'/core/lib/admin.lib.php';
@ -426,11 +429,13 @@ abstract class DolibarrModules
$dir = $dirroot.$reldir; $dir = $dirroot.$reldir;
$ok = 0; $ok = 0;
// Run llx_mytable.sql files
$handle=@opendir($dir); // Dir may not exists $handle=@opendir($dir); // Dir may not exists
if (is_resource($handle)) if (is_resource($handle))
{ {
while (($file = readdir($handle))!==false) $dirfound++;
// Run llx_mytable.sql files
while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{ {
@ -438,14 +443,11 @@ abstract class DolibarrModules
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
closedir($handle);
} rewinddir($handle);
// Run llx_mytable.key.sql files (Must be done after llx_mytable.sql) // Run llx_mytable.key.sql files (Must be done after llx_mytable.sql)
$handle=@opendir($dir); // Dir may not exist while (($file = readdir($handle))!==false)
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data') if (preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'llx_' && substr($file,0,4) != 'data')
{ {
@ -453,14 +455,11 @@ abstract class DolibarrModules
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
closedir($handle);
}
// Run data_xxx.sql files (Must be done after llx_mytable.key.sql) rewinddir($handle);
$handle=@opendir($dir); // Dir may not exist
if (is_resource($handle)) // Run data_xxx.sql files (Must be done after llx_mytable.key.sql)
{ while (($file = readdir($handle))!==false)
while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,4) == 'data')
{ {
@ -468,14 +467,11 @@ abstract class DolibarrModules
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
closedir($handle);
} rewinddir($handle);
// Run update_xxx.sql files // Run update_xxx.sql files
$handle=@opendir($dir); // Dir may not exist while (($file = readdir($handle))!==false)
if (is_resource($handle))
{
while (($file = readdir($handle))!==false)
{ {
if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update') if (preg_match('/\.sql$/i',$file) && ! preg_match('/\.key\.sql$/i',$file) && substr($file,0,6) == 'update')
{ {
@ -483,6 +479,7 @@ abstract class DolibarrModules
if ($result <= 0) $error++; if ($result <= 0) $error++;
} }
} }
closedir($handle); closedir($handle);
} }
@ -493,6 +490,7 @@ abstract class DolibarrModules
} }
} }
if (! $dirfound) dol_syslog("A module ask to load sql files into ".$reldir." but this directory was not found.", LOG_WARNING);
return $ok; return $ok;
} }

View File

@ -42,10 +42,10 @@ class CommActionRapport
var $title; var $title;
var $subject; var $subject;
var $marge_gauche; var $marge_gauche;
var $marge_droite; var $marge_droite;
var $marge_haute; var $marge_haute;
var $marge_basse; var $marge_basse;
/** /**

View File

@ -85,9 +85,9 @@ class ExportCsv extends ModeleExports
/** /**
* getDriverLabel * getDriverLabel
* *
* @return string * @return string Return driver label
*/ */
function getDriverLabel($key='') function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
@ -97,7 +97,7 @@ class ExportCsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getDriverDesc($key='') function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
@ -117,7 +117,7 @@ class ExportCsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getDriverVersion($key='') function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
@ -127,7 +127,7 @@ class ExportCsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getLibLabel($key='') function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
@ -137,7 +137,7 @@ class ExportCsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getLibVersion($key='') function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;
} }

View File

@ -85,9 +85,9 @@ class ExportExcel extends ModeleExports
/** /**
* getDriverLabel * getDriverLabel
* *
* @return string * @return string Return driver label
*/ */
function getDriverLabel($key='') function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
@ -97,7 +97,7 @@ class ExportExcel extends ModeleExports
* *
* @return string * @return string
*/ */
function getDriverDesc($key='') function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
@ -117,7 +117,7 @@ class ExportExcel extends ModeleExports
* *
* @return string * @return string
*/ */
function getDriverVersion($key='') function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
@ -127,7 +127,7 @@ class ExportExcel extends ModeleExports
* *
* @return string * @return string
*/ */
function getLibLabel($key='') function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
@ -137,7 +137,7 @@ class ExportExcel extends ModeleExports
* *
* @return string * @return string
*/ */
function getLibVersion($key='') function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;
} }

View File

@ -86,9 +86,9 @@ class ExportExcel2007 extends ExportExcel
/** /**
* getDriverLabel * getDriverLabel
* *
* @return string * @return string Return driver label
*/ */
function getDriverLabel($key='') function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
@ -98,7 +98,7 @@ class ExportExcel2007 extends ExportExcel
* *
* @return string * @return string
*/ */
function getDriverDesc($key='') function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
@ -118,7 +118,7 @@ class ExportExcel2007 extends ExportExcel
* *
* @return string * @return string
*/ */
function getDriverVersion($key='') function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
@ -128,7 +128,7 @@ class ExportExcel2007 extends ExportExcel
* *
* @return string * @return string
*/ */
function getLibLabel($key='') function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
@ -138,7 +138,7 @@ class ExportExcel2007 extends ExportExcel
* *
* @return string * @return string
*/ */
function getLibVersion($key='') function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;
} }

View File

@ -80,9 +80,9 @@ class ExportTsv extends ModeleExports
/** /**
* getDriverLabel * getDriverLabel
* *
* @return string * @return string Return driver label
*/ */
function getDriverLabel($key='') function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
@ -92,7 +92,7 @@ class ExportTsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getDriverDesc($key='') function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
@ -112,7 +112,7 @@ class ExportTsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getDriverVersion($key='') function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
@ -122,7 +122,7 @@ class ExportTsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getLibLabel($key='') function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
@ -132,7 +132,7 @@ class ExportTsv extends ModeleExports
* *
* @return string * @return string
*/ */
function getLibVersion($key='') function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;
} }

View File

@ -99,7 +99,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
* @param string $key Key of driver * @param string $key Key of driver
* @return string Picto string * @return string Picto string
*/ */
function getPicto($key) function getPictoForKey($key)
{ {
return $this->picto[$key]; return $this->picto[$key];
} }
@ -110,7 +110,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
* @param string $key Key of driver * @param string $key Key of driver
* @return string Label * @return string Label
*/ */
function getDriverLabel($key) function getDriverLabelForKey($key)
{ {
return $this->driverlabel[$key]; return $this->driverlabel[$key];
} }
@ -121,7 +121,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
* @param string $key Key of driver * @param string $key Key of driver
* @return string Description * @return string Description
*/ */
function getDriverDesc($key) function getDriverDescForKey($key)
{ {
return $this->driverdesc[$key]; return $this->driverdesc[$key];
} }
@ -132,7 +132,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
* @param string $key Key of driver * @param string $key Key of driver
* @return string Driver version * @return string Driver version
*/ */
function getDriverVersion($key) function getDriverVersionForKey($key)
{ {
return $this->driverversion[$key]; return $this->driverversion[$key];
} }
@ -143,7 +143,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
* @param string $key Key of driver * @param string $key Key of driver
* @return string Label of library * @return string Label of library
*/ */
function getLibLabel($key) function getLibLabelForKey($key)
{ {
return $this->liblabel[$key]; return $this->liblabel[$key];
} }
@ -154,7 +154,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
* @param string $key Key of driver * @param string $key Key of driver
* @return string Version of library * @return string Version of library
*/ */
function getLibVersion($key) function getLibVersionForKey($key)
{ {
return $this->libversion[$key]; return $this->libversion[$key];
} }

View File

@ -500,8 +500,8 @@ class pdf_crabe extends ModelePDFFactures
$tab3_top = $posy + 8; $tab3_top = $posy + 8;
$tab3_width = 80; $tab3_width = 80;
$tab3_height = 4; $tab3_height = 4;
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$tab3_posx -= 20; $tab3_posx -= 20;
} }

View File

@ -596,6 +596,7 @@ class pdf_soleil extends ModelePDFFicheinter
* @param PDF &$pdf PDF * @param PDF &$pdf PDF
* @param Object $object Object to show * @param Object $object Object to show
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return void * @return void
*/ */
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0) function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)

View File

@ -99,10 +99,9 @@ class ImportCsv extends ModeleImports
/** /**
* getDriverLabel * getDriverLabel
* *
* @param string $key Key
* @return string Label * @return string Label
*/ */
function getDriverLabel($key='') function getDriverLabel()
{ {
return $this->label; return $this->label;
} }
@ -110,10 +109,9 @@ class ImportCsv extends ModeleImports
/** /**
* getDriverDesc * getDriverDesc
* *
* @param string $key Key
* @return string Description * @return string Description
*/ */
function getDriverDesc($key='') function getDriverDesc()
{ {
return $this->desc; return $this->desc;
} }
@ -131,10 +129,9 @@ class ImportCsv extends ModeleImports
/** /**
* getDriverVersion * getDriverVersion
* *
* @param string $key Key
* @return string Driver version * @return string Driver version
*/ */
function getDriverVersion($key='') function getDriverVersion()
{ {
return $this->version; return $this->version;
} }
@ -142,10 +139,9 @@ class ImportCsv extends ModeleImports
/** /**
* getDriverLabel * getDriverLabel
* *
* @param string $key Key
* @return string Label of external lib * @return string Label of external lib
*/ */
function getLibLabel($key='') function getLibLabel()
{ {
return $this->label_lib; return $this->label_lib;
} }
@ -153,10 +149,9 @@ class ImportCsv extends ModeleImports
/** /**
* getLibVersion * getLibVersion
* *
* @param string $key Key
* @return string Version of external lib * @return string Version of external lib
*/ */
function getLibVersion($key='') function getLibVersion()
{ {
return $this->version_lib; return $this->version_lib;
} }

View File

@ -116,7 +116,7 @@ class ModeleImports
* @param string $key Key * @param string $key Key
* @return string * @return string
*/ */
function getPicto($key) function getPictoForKey($key)
{ {
return $this->picto[$key]; return $this->picto[$key];
} }
@ -127,7 +127,7 @@ class ModeleImports
* @param string $key Key * @param string $key Key
* @return string * @return string
*/ */
function getDriverLabel($key) function getDriverLabelForKey($key)
{ {
return $this->_driverlabel[$key]; return $this->_driverlabel[$key];
} }
@ -138,7 +138,7 @@ class ModeleImports
* @param string $key Key * @param string $key Key
* @return string * @return string
*/ */
function getDriverDesc($key) function getDriverDescForKey($key)
{ {
return $this->_driverdesc[$key]; return $this->_driverdesc[$key];
} }
@ -149,7 +149,7 @@ class ModeleImports
* @param string $key Key * @param string $key Key
* @return string * @return string
*/ */
function getDriverVersion($key) function getDriverVersionForKey($key)
{ {
return $this->_driverversion[$key]; return $this->_driverversion[$key];
} }
@ -160,7 +160,7 @@ class ModeleImports
* @param string $key Key * @param string $key Key
* @return string * @return string
*/ */
function getLibLabel($key) function getLibLabelForKey($key)
{ {
return $this->_liblabel[$key]; return $this->_liblabel[$key];
} }
@ -171,7 +171,7 @@ class ModeleImports
* @param string $key Key * @param string $key Key
* @return string * @return string
*/ */
function getLibVersion($key) function getLibVersionForKey($key)
{ {
return $this->_libversion[$key]; return $this->_libversion[$key];
} }

View File

@ -61,9 +61,8 @@ class mailing_framboise extends MailingTargets
$cibles = array(); $cibles = array();
// CHANGE THIS
// Select the members from category // Select the members from category
$sql = "SELECT a.rowid as id, a.email as email, a.nom as name, null as fk_contact, null as firstname,"; $sql = "SELECT a.rowid as id, a.email as email, a.nom as name, null as fk_contact, a.prenom as firstname,";
if ($_POST['filter']) $sql.= " c.label"; if ($_POST['filter']) $sql.= " c.label";
else $sql.=" null as label"; else $sql.=" null as label";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";

View File

@ -140,7 +140,8 @@ class modCategorie extends DolibarrModules
$this->export_enabled[$r]='$conf->produit->enabled'; $this->export_enabled[$r]='$conf->produit->enabled';
$this->export_permission[$r]=array(array("categorie","lire"),array("produit","lire")); $this->export_permission[$r]=array(array("categorie","lire"),array("produit","lire"));
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'ProductId','p.ref'=>'Ref'); $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'p.rowid'=>'ProductId','p.ref'=>'Ref');
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'p.rowid'=>'List:Product:label','p.ref'=>'Text'); //$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'p.rowid'=>'List:Product:label','p.ref'=>'Text');
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'p.ref'=>'Text');
$this->export_entities_array[$r]=array('p.rowid'=>'product','p.ref'=>'product'); // We define here only fields that use another picto $this->export_entities_array[$r]=array('p.rowid'=>'product','p.ref'=>'product'); // We define here only fields that use another picto
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_product as cp, '.MAIN_DB_PREFIX.'product as p';
@ -178,7 +179,7 @@ class modCategorie extends DolibarrModules
$this->import_regex_array[$r]=array('ca.type'=>'^[0|1|2|3]'); $this->import_regex_array[$r]=array('ca.type'=>'^[0|1|2|3]');
$this->import_examplevalues_array[$r]=array('ca.label'=>"Supplier Category",'ca.type'=>"1",'ca.description'=>"Imported category"); $this->import_examplevalues_array[$r]=array('ca.label'=>"Supplier Category",'ca.type'=>"1",'ca.description'=>"Imported category");
if (! empty($conf->product->enabled)) if (! empty($conf->product->enabled))
{ {
//Products //Products
@ -190,14 +191,14 @@ class modCategorie extends DolibarrModules
$this->import_tables_array[$r]=array('cp'=>MAIN_DB_PREFIX.'categorie_product'); $this->import_tables_array[$r]=array('cp'=>MAIN_DB_PREFIX.'categorie_product');
$this->import_fields_array[$r]=array('cp.fk_categorie'=>"Category*",'cp.fk_product'=>"Product*" $this->import_fields_array[$r]=array('cp.fk_categorie'=>"Category*",'cp.fk_product'=>"Product*"
); );
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
'cp.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'), 'cp.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'),
'cp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'product') 'cp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'product')
); );
$this->import_examplevalues_array[$r]=array('cp.fk_categorie'=>"Imported category",'cp.fk_product'=>"PREF123456"); $this->import_examplevalues_array[$r]=array('cp.fk_categorie'=>"Imported category",'cp.fk_product'=>"PREF123456");
} }
if (! empty($conf->societe->enabled)) if (! empty($conf->societe->enabled))
{ {
//Customers //Customers
@ -209,14 +210,14 @@ class modCategorie extends DolibarrModules
$this->import_tables_array[$r]=array('cs'=>MAIN_DB_PREFIX.'categorie_societe'); $this->import_tables_array[$r]=array('cs'=>MAIN_DB_PREFIX.'categorie_societe');
$this->import_fields_array[$r]=array('cs.fk_categorie'=>"Category*",'cs.fk_societe'=>"ThirdParty*" $this->import_fields_array[$r]=array('cs.fk_categorie'=>"Category*",'cs.fk_societe'=>"ThirdParty*"
); );
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
'cs.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'), 'cs.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'),
'cs.fk_societe'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty') 'cs.fk_societe'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty')
); );
$this->import_examplevalues_array[$r]=array('cs.fk_categorie'=>"Imported category",'cs.fk_societe'=>"MyBigCompany"); $this->import_examplevalues_array[$r]=array('cs.fk_categorie'=>"Imported category",'cs.fk_societe'=>"MyBigCompany");
} }
if (! empty($conf->fournisseur->enabled)) if (! empty($conf->fournisseur->enabled))
{ {
// Suppliers // Suppliers
@ -228,7 +229,7 @@ class modCategorie extends DolibarrModules
$this->import_tables_array[$r]=array('cs'=>MAIN_DB_PREFIX.'categorie_fournisseur'); $this->import_tables_array[$r]=array('cs'=>MAIN_DB_PREFIX.'categorie_fournisseur');
$this->import_fields_array[$r]=array('cs.fk_categorie'=>"Category*",'cs.fk_societe'=>"Supplier*" $this->import_fields_array[$r]=array('cs.fk_categorie'=>"Category*",'cs.fk_societe'=>"Supplier*"
); );
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
'cs.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'), 'cs.fk_categorie'=>array('rule'=>'fetchidfromref','classfile'=>'/categories/class/categorie.class.php','class'=>'Categorie','method'=>'fetch','element'=>'category'),
'cs.fk_societe'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty') 'cs.fk_societe'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty')

View File

@ -174,7 +174,8 @@ class modCommande extends DolibarrModules
$this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("commande","commande","export")); $this->export_permission[$r]=array(array("commande","commande","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@ -42,6 +42,8 @@ class modExpedition extends DolibarrModules
*/ */
function __construct($db) function __construct($db)
{ {
global $conf;
$this->db = $db; $this->db = $db;
$this->numero = 80; $this->numero = 80;
@ -71,6 +73,8 @@ class modExpedition extends DolibarrModules
// Dependances // Dependances
$this->depends = array("modCommande"); $this->depends = array("modCommande");
$this->requiredby = array(); $this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array('deliveries','sendings');
// Constantes // Constantes
$this->const = array(); $this->const = array();
@ -141,6 +145,14 @@ class modExpedition extends DolibarrModules
$this->rights[$r][4] = 'shipping_advance'; $this->rights[$r][4] = 'shipping_advance';
$this->rights[$r][5] = 'send'; $this->rights[$r][5] = 'send';
$r++;
$this->rights[$r][0] = 106;
$this->rights[$r][1] = 'Exporter les expeditions';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'shipment';
$this->rights[$r][5] = 'export';
$r++; $r++;
$this->rights[$r][0] = 109; $this->rights[$r][0] = 109;
$this->rights[$r][1] = 'Supprimer les expeditions'; $this->rights[$r][1] = 'Supprimer les expeditions';
@ -180,6 +192,25 @@ class modExpedition extends DolibarrModules
$this->rights[$r][4] = 'livraison'; $this->rights[$r][4] = 'livraison';
$this->rights[$r][5] = 'supprimer'; $this->rights[$r][5] = 'supprimer';
// Exports
//--------
$r=0;
$r++;
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("expedition","shipment","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note'=>"Note",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.libelle'=>'List:c_pays:libelle:rowid','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note'=>"Text",'ed.qty'=>"Number");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM ('.MAIN_DB_PREFIX.'expedition as c, '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd)';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
$this->export_sql_end[$r] .=' AND c.entity = '.$conf->entity;
} }

View File

@ -175,7 +175,8 @@ class modFacture extends DolibarrModules
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'fd.rowid'=>'LineId','fd.label'=>"Label",'fd.description'=>"LineDescription",'fd.price'=>"LineUnitPrice",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.total_ht'=>"LineTotalHT",'fd.total_tva'=>"LineTotalVAT",'fd.total_ttc'=>"LineTotalTTC",'fd.date_start'=>"DateStart",'fd.date_end'=>"DateEnd",'fd.product_type'=>"TypeOfLineServiceOrProduct",'fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Numeric",'f.total_ttc'=>"Numeric",'f.tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'fd.description'=>"Text",'fd.price'=>"Numeric",'fd.tva_tx'=>"Numeric",'fd.qty'=>"Numeric",'fd.total_ht'=>"Numeric",'fd.total_tva'=>"Numeric",'fd.total_ttc'=>"Numeric",'fd.date_start'=>"Date",'fd.date_end'=>"Date",'fd.product_type'=>"Numeric",'fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'fd.rowid'=>'invoice_line','fd.label'=>"invoice_line",'fd.description'=>"invoice_line",'fd.price'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_tva'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.date_start'=>"invoice_line",'fd.date_end'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
@ -194,7 +195,8 @@ class modFacture extends DolibarrModules
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("facture","facture","export")); $this->export_permission[$r]=array(array("facture","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.date_lim_reglement'=>"DateDue",'f.total'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"NotePrivate",'f.note_public'=>"NotePublic",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text','f.rowid'=>"List:facture:facnumber",'f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.date_lim_reglement'=>"Date",'f.total'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'f.note_public'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.date_lim_reglement'=>"invoice",'f.total'=>"invoice",'f.total_ttc'=>"invoice",'f.tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@ -139,7 +139,8 @@ class modFicheinter extends DolibarrModules
$this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("ficheinter","export")); $this->export_permission[$r]=array(array("ficheinter","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc"); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','s.fk_pays'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc");
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','s.fk_pays'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line');
$this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@ -243,7 +243,8 @@ class modFournisseur extends DolibarrModules
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_permission[$r]=array(array("fournisseur","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Text",'fd.qty'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'fd.rowid'=>'invoice_line','fd.description'=>"invoice_line",'fd.tva_tx'=>"invoice_line",'fd.qty'=>"invoice_line",'fd.remise_percent'=>"invoice_line",'fd.total_ht'=>"invoice_line",'fd.total_ttc'=>"invoice_line",'fd.tva'=>"invoice_line",'fd.product_type'=>'invoice_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('invoice_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
@ -261,7 +262,8 @@ class modFournisseur extends DolibarrModules
$this->export_icon[$r]='bill'; $this->export_icon[$r]='bill';
$this->export_permission[$r]=array(array("fournisseur","facture","export")); $this->export_permission[$r]=array(array("fournisseur","facture","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','c.code'=>'CountryCode','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.facnumber'=>"InvoiceRef",'f.datec'=>"InvoiceDateCreation",'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid",'f.fk_statut'=>'InvoiceStatus','f.note'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment','p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.tva_intra'=>'Text','f.facnumber'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.total_tva'=>"Number",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note'=>"Text",'pf.amount'=>'Number','p.datep'=>'Date','p.num_paiement'=>'Number');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','c.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"invoice",'f.facnumber'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice",'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment','p.datep'=>'payment','p.num_paiement'=>'payment');
$this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@ -220,7 +220,7 @@ class modGravatar extends DolibarrModules
*/ */
function load_tables() function load_tables()
{ {
return $this->_load_tables('/mymodule/sql/'); return $this->_load_tables('');
} }
} }

View File

@ -65,6 +65,8 @@ class modProjet extends DolibarrModules
// Dependancies // Dependancies
$this->depends = array(); $this->depends = array();
$this->requiredby = array(); $this->requiredby = array();
$this->conflictwith = array();
$this->langfiles = array('projects');
// Constants // Constants
$this->const = array(); $this->const = array();
@ -150,7 +152,8 @@ class modProjet extends DolibarrModules
'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote", 'p.rowid'=>"ProjectId",'p.ref'=>"ProjectRef",'p.datec'=>"DateCreation",'p.dateo'=>"DateDebutProjet",'p.datee'=>"DateFinProjet",'p.fk_statut'=>'ProjectStatus','p.description'=>"projectNote",
'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.duration_planned'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc"); 'pt.rowid'=>'RefTask','pt.dateo'=>"TaskDateo",'pt.datee'=>"TaskDatee",'pt.duration_effective'=>"DurationEffective",'pt.duration_planned'=>"DurationPlanned",'pt.progress'=>"Progress",'pt.description'=>"TaskDesc");
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.fk_pays'=>'List:c_pays:libelle', //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','s.fk_pays'=>'List:c_pays:libelle',
's.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', 's.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.duration_planned'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text"); 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.duration_planned'=>"Duree",'pt.progress'=>"Number",'pt.description'=>"Text");

View File

@ -168,7 +168,8 @@ class modPropale extends DolibarrModules
$this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("propale","export")); $this->export_permission[$r]=array(array("propale","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','cp.code'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.cp'=>'Zip','s.ville'=>'Town','cp.code'=>'Country','s.tel'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','cp.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','cp.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','cp.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','cp.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.cp'=>'company','s.ville'=>'company','cp.code'=>'company','s.tel'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@ -122,10 +122,13 @@ class modService extends DolibarrModules
$this->export_permission[$r]=array(array("service","export")); $this->export_permission[$r]=array(array("service","export"));
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock')); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock'));
//$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Number",'p.price_ttc'=>"Number",'p.tva_tx'=>'Number','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date');
$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Number",'p.price_ttc'=>"Number",'p.tva_tx'=>'Number','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date'); $this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.price_base_type'=>"Text",'p.price'=>"Number",'p.price_ttc'=>"Number",'p.tva_tx'=>'Number','p.tosell'=>"Boolean",'p.duration'=>"Duree",'p.datec'=>'Date','p.tms'=>'Date');
if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Number')); if (! empty($conf->stock->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Number'));
if (! empty($conf->barcode->enabled)) $this->export_TypeFields_array[$r]=array_merge($this->export_TypeFields_array[$r],array('p.barcode'=>'Text'));
$this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.tosell'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service"); $this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.tosell'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service");
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product')); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'service'));
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'service'));
// Add extra fields // Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'"; $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -247,9 +247,10 @@ class modSociete extends DolibarrModules
$this->export_label[$r]='ExportDataset_company_1'; $this->export_label[$r]='ExportDataset_company_1';
$this->export_icon[$r]='company'; $this->export_icon[$r]='company';
$this->export_permission[$r]=array(array("societe","export")); $this->export_permission[$r]=array(array("societe","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.address'=>"Address",'s.cp'=>"Zip",'s.ville'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','d.nom'=>'State'); $this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.address'=>"Address",'s.cp'=>"Zip",'s.ville'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.tel'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note'=>"Note",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','d.nom'=>'State');
if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix';
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.cp'=>"Text",'s.ville'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.cp'=>"Text",'s.ville'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
$this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.cp'=>"Text",'s.ville'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.tel'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
$this->export_entities_array[$r]=array(); // We define here only fields that use another picto $this->export_entities_array[$r]=array(); // We define here only fields that use another picto
// Add extra fields // Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'"; $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'";

View File

@ -173,7 +173,7 @@ class modWorkflow extends DolibarrModules
*/ */
function load_tables() function load_tables()
{ {
return $this->_load_tables('/workflow/sql/'); return $this->_load_tables('');
} }
} }
?> ?>

View File

@ -283,13 +283,13 @@ class pdf_azur extends ModelePDFPropales
$pdf->startTransaction(); $pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak if ($pageposafter > $pageposbefore) // There is a pagebreak
{ {
$pdf->rollbackTransaction(true); $pdf->rollbackTransaction(true);
$pageposafter=$pageposbefore; $pageposafter=$pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit; //print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,0,$hookmanager);
$pageposafter=$pdf->getPage(); $pageposafter=$pdf->getPage();
$posyafter=$pdf->GetY(); $posyafter=$pdf->GetY();
@ -298,15 +298,15 @@ class pdf_azur extends ModelePDFPropales
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
{ {
$pdf->AddPage('','',true); $pdf->AddPage('','',true);
if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (! empty($tplidx)) $pdf->useTemplate($tplidx);
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs, $hookmanager);
$pdf->setPage($pagenb+1); $pdf->setPage($pagenb+1);
} }
} }
else else
{ {
// We found a page break // We found a page break
$showpricebeforepagebreak=0; $showpricebeforepagebreak=0;
} }
} }
else // No pagebreak else // No pagebreak

View File

@ -739,9 +739,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tab3_top = $posy + 8; $tab3_top = $posy + 8;
$tab3_width = 80; $tab3_width = 80;
$tab3_height = 4; $tab3_height = 4;
if ($this->page_largeur < 210) // To work with US executive format if ($this->page_largeur < 210) // To work with US executive format
{ {
$tab3_posx -= 20; $tab3_posx -= 20;
} }
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);

View File

@ -28,7 +28,7 @@ class LogHandler
} }
/** /**
* ¿Is the module active? * Is the module active ?
* *
* @return boolean * @return boolean
*/ */

View File

@ -1,12 +1,58 @@
<?php <?php
/**
* LogHandlerInterface
*/
interface LogHandlerInterface interface LogHandlerInterface
{ {
/**
* Return name of logger
*
* @return string Name of logger
*/
public function getName(); public function getName();
/**
* Return version of logger
*
* @return string Version of logger
*/
public function getVersion(); public function getVersion();
/**
* Return information on logger
*
* @return string Version of logger
*/
public function getInfo(); public function getInfo();
/**
* Return array of configuration data
*
* @return array Return array of configuration data
*/
public function configure(); public function configure();
/**
* Return if configuration is valid
*
* @return boolean True if configuration ok
*/
public function checkConfiguration(); public function checkConfiguration();
/**
* Return if logger active
*
* @return boolen True if active
*/
public function isActive(); public function isActive();
/**
* Output log content
*
* @param string $content Content to log
* @return void
*/
public function export($content); public function export($content);
} }

View File

@ -2,10 +2,15 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
/**
* Class to manage logging to ChromPHP
*/
class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
{ {
/** /**
* {@inheritDoc} * Return name of logger
*
* @return string Name of logger
*/ */
public function getName() public function getName()
{ {
@ -13,7 +18,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
*
* @return string
*/ */
public function getVersion() public function getVersion()
{ {
@ -21,7 +28,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Content of the info tooltip.
*
* @return false|string
*/ */
public function getInfo() public function getInfo()
{ {
@ -31,7 +40,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Is the module active ?
*
* @return boolean
*/ */
public function isActive() public function isActive()
{ {
@ -56,7 +67,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Return array of configuration data
*
* @return array Return array of configuration data
*/ */
public function configure() public function configure()
{ {
@ -73,7 +86,9 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Return if configuration is valid
*
* @return boolean True if configuration ok
*/ */
public function checkConfiguration() public function checkConfiguration()
{ {
@ -95,7 +110,10 @@ class mod_syslog_chromephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Output log content
*
* @param string $content Content to log
* @return void
*/ */
public function export($content) public function export($content)
{ {

View File

@ -2,10 +2,15 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
/**
* Class to manage logging to a file
*/
class mod_syslog_file extends LogHandler implements LogHandlerInterface class mod_syslog_file extends LogHandler implements LogHandlerInterface
{ {
/** /**
* {@inheritDoc} * Return name of logger
*
* @return string Name of logger
*/ */
public function getName() public function getName()
{ {
@ -15,7 +20,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
*
* @return string
*/ */
public function getVersion() public function getVersion()
{ {
@ -23,7 +30,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Content of the info tooltip.
*
* @return false|string
*/ */
public function getInfo() public function getInfo()
{ {
@ -33,7 +42,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Is the module active ?
*
* @return boolean
*/ */
public function isActive() public function isActive()
{ {
@ -41,7 +52,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Return array of configuration data
*
* @return array Return array of configuration data
*/ */
public function configure() public function configure()
{ {
@ -58,7 +71,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Return if configuration is valid
*
* @return boolean True if configuration ok
*/ */
public function checkConfiguration() public function checkConfiguration()
{ {
@ -79,6 +94,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
/** /**
* Return the parsed logfile path * Return the parsed logfile path
*
* @return string * @return string
*/ */
private function getFilename() private function getFilename()
@ -88,7 +104,9 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
/** /**
* Export the message * Export the message
* @param array $content Array containing the info about the message *
* @param array $content Array containing the info about the message
* @return void
*/ */
public function export($content) public function export($content)
{ {

View File

@ -2,10 +2,15 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
/**
* Class to manage logging to a FirePHP
*/
class mod_syslog_firephp extends LogHandler implements LogHandlerInterface class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
{ {
/** /**
* {@inheritDoc} * Return name of logger
*
* @return string Name of logger
*/ */
public function getName() public function getName()
{ {
@ -13,7 +18,9 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
*
* @return string
*/ */
public function getVersion() public function getVersion()
{ {
@ -21,7 +28,9 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Content of the info tooltip.
*
* @return false|string
*/ */
public function getInfo() public function getInfo()
{ {
@ -31,7 +40,9 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Is the module active ?
*
* @return boolean
*/ */
public function isActive() public function isActive()
{ {
@ -53,9 +64,11 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
return -1; return -1;
} }
// /** ///**
// * {@inheritDoc} // * Return array of configuration data
// */ // *
// * @return array Return array of configuration data
// */
// public function configure() // public function configure()
// { // {
// global $langs; // global $langs;
@ -71,7 +84,9 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
// } // }
/** /**
* {@inheritDoc} * Return if configuration is valid
*
* @return boolean True if configuration ok
*/ */
public function checkConfiguration() public function checkConfiguration()
{ {
@ -93,7 +108,10 @@ class mod_syslog_firephp extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Output log content
*
* @param string $content Content to log
* @return void
*/ */
public function export($content) public function export($content)
{ {

View File

@ -2,10 +2,15 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/syslog/logHandler.php';
/**
* Class to manage logging to syslog
*/
class mod_syslog_syslog extends LogHandler implements LogHandlerInterface class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
{ {
/** /**
* {@inheritDoc} * Return name of logger
*
* @return string Name of logger
*/ */
public function getName() public function getName()
{ {
@ -13,7 +18,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
*
* @return string
*/ */
public function getVersion() public function getVersion()
{ {
@ -21,7 +28,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Content of the info tooltip.
*
* @return false|string
*/ */
public function getInfo() public function getInfo()
{ {
@ -31,7 +40,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Is the module active ?
*
* @return boolean
*/ */
public function isActive() public function isActive()
{ {
@ -45,7 +56,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Return array of configuration data
*
* @return array Return array of configuration data
*/ */
public function configure() public function configure()
{ {
@ -61,7 +74,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
} }
/** /**
* {@inheritDoc} * Return if configuration is valid
*
* @return boolean True if configuration ok
*/ */
public function checkConfiguration() public function checkConfiguration()
{ {
@ -87,7 +102,9 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
/** /**
* Export the message * Export the message
* @param array $content Array containing the info about the message *
* @param array $content Array containing the info about the message
* @return void
*/ */
public function export($content) public function export($content)
{ {

View File

@ -54,7 +54,6 @@ if (isset($conf->modules_parts['css']))
} }
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
print '<!-- Includes JS for JQuery -->'."\n"; print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n"; if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n"; else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";

View File

@ -53,7 +53,6 @@ if (isset($conf->modules_parts['css']))
} }
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
print '<!-- Includes JS for JQuery -->'."\n"; print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n"; if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n"; else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";

View File

@ -134,6 +134,12 @@ class InterfaceLdapsynchro
$ldap=new Ldap(); $ldap=new Ldap();
$ldap->connect_bind(); $ldap->connect_bind();
if (empty($object->oldcopy) || ! is_object($object->oldcopy))
{
dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
$object->oldcopy=dol_clone($object);
}
$oldinfo=$object->oldcopy->_load_ldap_info(); $oldinfo=$object->oldcopy->_load_ldap_info();
$olddn=$object->oldcopy->_load_ldap_dn($oldinfo); $olddn=$object->oldcopy->_load_ldap_dn($oldinfo);
@ -165,6 +171,12 @@ class InterfaceLdapsynchro
$ldap=new Ldap(); $ldap=new Ldap();
$ldap->connect_bind(); $ldap->connect_bind();
if (empty($object->oldcopy) || ! is_object($object->oldcopy))
{
dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
$object->oldcopy=dol_clone($object);
}
$oldinfo=$object->oldcopy->_load_ldap_info(); $oldinfo=$object->oldcopy->_load_ldap_info();
$olddn=$object->oldcopy->_load_ldap_dn($oldinfo); $olddn=$object->oldcopy->_load_ldap_dn($oldinfo);
@ -291,6 +303,7 @@ class InterfaceLdapsynchro
// Groupes // Groupes
elseif ($action == 'GROUP_CREATE') elseif ($action == 'GROUP_CREATE')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
{ {
$ldap=new Ldap(); $ldap=new Ldap();
@ -313,11 +326,18 @@ class InterfaceLdapsynchro
} }
elseif ($action == 'GROUP_MODIFY') elseif ($action == 'GROUP_MODIFY')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
{ {
$ldap=new Ldap(); $ldap=new Ldap();
$ldap->connect_bind(); $ldap->connect_bind();
if (empty($object->oldcopy) || ! is_object($object->oldcopy))
{
dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
$object->oldcopy=dol_clone($object);
}
$oldinfo=$object->oldcopy->_load_ldap_info(); $oldinfo=$object->oldcopy->_load_ldap_info();
$olddn=$object->oldcopy->_load_ldap_dn($oldinfo); $olddn=$object->oldcopy->_load_ldap_dn($oldinfo);
@ -343,6 +363,7 @@ class InterfaceLdapsynchro
} }
elseif ($action == 'GROUP_DELETE') elseif ($action == 'GROUP_DELETE')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
{ {
$ldap=new Ldap(); $ldap=new Ldap();
@ -388,6 +409,12 @@ class InterfaceLdapsynchro
$ldap=new Ldap(); $ldap=new Ldap();
$ldap->connect_bind(); $ldap->connect_bind();
if (empty($object->oldcopy) || ! is_object($object->oldcopy))
{
dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
$object->oldcopy=dol_clone($object);
}
$oldinfo=$object->oldcopy->_load_ldap_info(); $oldinfo=$object->oldcopy->_load_ldap_info();
$olddn=$object->oldcopy->_load_ldap_dn($oldinfo); $olddn=$object->oldcopy->_load_ldap_dn($oldinfo);
@ -511,6 +538,12 @@ class InterfaceLdapsynchro
$ldap=new Ldap(); $ldap=new Ldap();
$ldap->connect_bind(); $ldap->connect_bind();
if (empty($object->oldcopy) || ! is_object($object->oldcopy))
{
dol_syslog("Trigger ".$action." was called by a function that did not set previously the property ->oldcopy onto object", LOG_WARNING);
$object->oldcopy=dol_clone($object);
}
$oldinfo=$object->oldcopy->_load_ldap_info(); $oldinfo=$object->oldcopy->_load_ldap_info();
$olddn=$object->oldcopy->_load_ldap_dn($oldinfo); $olddn=$object->oldcopy->_load_ldap_dn($oldinfo);

View File

@ -709,12 +709,12 @@ class Expedition extends CommonObject
$sql.= " fk_expedition_methode=".((isset($this->expedition_method_id) && $this->expedition_method_id > 0)?$this->expedition_method_id:"null").","; $sql.= " fk_expedition_methode=".((isset($this->expedition_method_id) && $this->expedition_method_id > 0)?$this->expedition_method_id:"null").",";
$sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").","; $sql.= " tracking_number=".(isset($this->tracking_number)?"'".$this->db->escape($this->tracking_number)."'":"null").",";
$sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").","; $sql.= " fk_statut=".(isset($this->statut)?$this->statut:"null").",";
$sql.= " height=".(isset($this->trueHeight)?$this->trueHeight:"null").","; $sql.= " height=".(($this->trueHeight != '')?$this->trueHeight:"null").",";
$sql.= " width=".(isset($this->trueWidth)?$this->trueWidth:"null").","; $sql.= " width=".(($this->trueWidth != '')?$this->trueWidth:"null").",";
$sql.= " size_units=".(isset($this->size_units)?$this->size_units:"null").","; $sql.= " size_units=".(isset($this->size_units)?$this->size_units:"null").",";
$sql.= " size=".(isset($this->trueDepth)?$this->trueDepth:"null").","; $sql.= " size=".(($this->trueDepth != '')?$this->trueDepth:"null").",";
$sql.= " weight_units=".(isset($this->weight_units)?$this->weight_units:"null").","; $sql.= " weight_units=".(isset($this->weight_units)?$this->weight_units:"null").",";
$sql.= " weight=".(isset($this->trueWeight)?$this->trueWeight:"null").","; $sql.= " weight=".(($this->trueWeight != '')?$this->trueWeight:"null").",";
$sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").","; $sql.= " note=".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null").",";
$sql.= " model_pdf=".(isset($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null").","; $sql.= " model_pdf=".(isset($this->model_pdf)?"'".$this->db->escape($this->model_pdf)."'":"null").",";
$sql.= " entity=".$conf->entity; $sql.= " entity=".$conf->entity;
@ -858,7 +858,8 @@ class Expedition extends CommonObject
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva"; $sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice"; $sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice";
$sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot"; $sql.= ", ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type, p.weight, p.weight_units, p.volume, p.volume_units"; $sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units";
$sql.= " FROM (".MAIN_DB_PREFIX."expeditiondet as ed,"; $sql.= " FROM (".MAIN_DB_PREFIX."expeditiondet as ed,";
$sql.= " ".MAIN_DB_PREFIX."commandedet as cd)"; $sql.= " ".MAIN_DB_PREFIX."commandedet as cd)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product";
@ -900,6 +901,10 @@ class Expedition extends CommonObject
$line->qty_shipped = $obj->qty_shipped; $line->qty_shipped = $obj->qty_shipped;
$line->weight = $obj->weight; $line->weight = $obj->weight;
$line->weight_units = $obj->weight_units; $line->weight_units = $obj->weight_units;
$line->length = $obj->length;
$line->length_units = $obj->length_units;
$line->surface = $obj->surface;
$line->surface_units = $obj->surface_units;
$line->volume = $obj->volume; $line->volume = $obj->volume;
$line->volume_units = $obj->volume_units; $line->volume_units = $obj->volume_units;

View File

@ -285,10 +285,9 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl'
header("Location: fiche.php?id=".$shipping->id); header("Location: fiche.php?id=".$shipping->id);
exit; exit;
} }
$mesg=$shipping->error; setEventMessage($shipping->error,'errors');
} }
$mesg='<div class="error">'.$mesg.'</div>';
$action=""; $action="";
} }
@ -537,7 +536,7 @@ else if ($action == 'classifybilled')
/* /*
* View * View
*/ */
llxHeader('',$langs->trans('Sending'),'Expedition'); llxHeader('',$langs->trans('Sending'),'Expedition');
@ -904,7 +903,7 @@ else
/* /*
* Confirmation de la suppression * Confirmation de la suppression
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1); $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
@ -913,7 +912,7 @@ else
/* /*
* Confirmation de la validation * Confirmation de la validation
*/ */
if ($action == 'valid') if ($action == 'valid')
{ {
$objectref = substr($object->ref, 1, 4); $objectref = substr($object->ref, 1, 4);
@ -930,15 +929,15 @@ else
} }
/* /*
* Confirmation de l'annulation * Confirmation de l'annulation
*/ */
if ($action == 'annuler') if ($action == 'annuler')
{ {
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1); $ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
// Calculate ture totalVeight and totalVolume for all products // Calculate true totalWeight and totalVolume for all products
// by adding weight and volume of each line. // by adding weight and volume of each product line.
$totalWeight = ''; $totalWeight = '';
$totalVolume = ''; $totalVolume = '';
$weightUnit=0; $weightUnit=0;
@ -949,6 +948,7 @@ else
$volumeUnit=0; $volumeUnit=0;
if (! empty($lines[$i]->weight_units)) $weightUnit = $lines[$i]->weight_units; if (! empty($lines[$i]->weight_units)) $weightUnit = $lines[$i]->weight_units;
if (! empty($lines[$i]->volume_units)) $volumeUnit = $lines[$i]->volume_units; if (! empty($lines[$i]->volume_units)) $volumeUnit = $lines[$i]->volume_units;
// TODO Use a function addvalueunits(val1,unit1,val2,unit2)=>(val,unit) // TODO Use a function addvalueunits(val1,unit1,val2,unit2)=>(val,unit)
if ($lines[$i]->weight_units < 50) if ($lines[$i]->weight_units < 50)
{ {
@ -973,8 +973,6 @@ else
$totalVolume += $lines[$i]->volume*$lines[$i]->qty_shipped; $totalVolume += $lines[$i]->volume*$lines[$i]->qty_shipped;
} }
} }
$totalVolume=$totalVolume;
//print "totalVolume=".$totalVolume." volumeUnit=".$volumeUnit;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1053,49 +1051,50 @@ else
// Weight // Weight
print '<tr><td>'.$form->editfieldkey("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
print $form->editfieldval("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer); print $form->editfieldval("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer);
print $object->weight_units?measuring_units_string($object->weight_units,"weight"):''; print ($object->weight_units!='')?' '.measuring_units_string($object->weight_units,"weight"):'';
print '</td></tr>'; print '</td></tr>';
// Volume Total
print '<tr><td>'.$langs->trans("Volume").'</td>';
print '<td colspan="3">';
if (! empty($object->trueVolume)) // FIXME trueVolume not exist
{
// If sending volume defined
print $object->trueVolume.' '.measuring_units_string($object->volumeUnit,"volume");
}
else
{
// If sending volume not defined we use sum of products
if ($totalVolume > 0)
{
print $totalVolume.' ';
if ($volumeUnit < 50) print measuring_units_string(0,"volume");
else print measuring_units_string($volumeUnit,"volume");
}
else print '&nbsp;';
}
print "</td>\n";
print '</tr>';
// Width // Width
print '<tr><td>'.$form->editfieldkey("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
print $form->editfieldval("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer); print $form->editfieldval("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer);
print $object->trueWidth?measuring_units_string($object->width_units,"size"):''; print ($object->trueWidth!='')?' '.measuring_units_string($object->width_units,"size"):'';
print '</td></tr>'; print '</td></tr>';
// Height // Height
print '<tr><td>'.$form->editfieldkey("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
print $form->editfieldval("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer); print $form->editfieldval("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer);
print $object->trueHeight?measuring_units_string($object->height_units,"size"):''; print ($object->trueHeight!='')?' '.measuring_units_string($object->height_units,"size"):'';
print '</td></tr>'; print '</td></tr>';
// Depth // Depth
print '<tr><td>'.$form->editfieldkey("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer).'</td><td colspan="3">'; print '<tr><td>'.$form->editfieldkey("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
print $form->editfieldval("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer); print $form->editfieldval("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer);
print $object->trueDepth?measuring_units_string($object->depth_units,"size"):''; print ($object->trueDepth!='')?' '.measuring_units_string($object->depth_units,"size"):'';
print '</td></tr>'; print '</td></tr>';
// Volume
print '<tr><td>';
print $langs->trans("Volume");
print '</td>';
print '<td colspan="3">';
$calculatedVolume=0;
if ($object->trueWidth && $object->trueHeight && $object->trueDepth) $calculatedVolume=($object->trueWidth * $object->trueHeight * $object->trueDepth);
// If sending volume not defined we use sum of products
if ($calculatedVolume > 0)
{
print $calculatedVolume.' ';
if ($volumeUnit < 50) print measuring_units_string(0,"volume");
else print measuring_units_string($volumeUnit,"volume");
}
if ($totalVolume > 0)
{
if ($calculatedVolume) print ' ('.$langs->trans("SumOfProductVolumes").': ';
print $totalVolume;
if ($calculatedVolume) print ')';
}
print "</td>\n";
print '</tr>';
// Status // Status
print '<tr><td>'.$langs->trans("Status").'</td>'; print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td colspan="3">'.$object->getLibStatut(4)."</td>\n"; print '<td colspan="3">'.$object->getLibStatut(4)."</td>\n";

View File

@ -201,6 +201,8 @@ class Export
* *
* @param int $indice Indice of export * @param int $indice Indice of export
* @param array $array_selected Filter on array of fields to export * @param array $array_selected Filter on array of fields to export
* @param array $array_filterValue Filter on array of fields to export
* @param array $array_filtered Array with filters values
* @return string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..." * @return string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..."
*/ */
function build_sql($indice, $array_selected, $array_filterValue, $array_filtered) function build_sql($indice, $array_selected, $array_filterValue, $array_filtered)
@ -309,14 +311,16 @@ class Export
} }
/** /**
* conditionDate
* *
* @param unknown $Field * @param string $Field Field operand 1
* @param unknown $Value * @param string $Value Value operand 2
* @param unknown $Sens * @param string $Sens Comparison operator
* @return string * @return string
*/ */
function conditionDate($Field, $Value, $Sens) function conditionDate($Field, $Value, $Sens)
{ {
// FIXME date_format is forbidden, not performant and no portable. Use instead BETWEEN
if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." ".$Value; if (strlen($Value)==4) $Condition=" date_format(".$Field.",'%Y') ".$Sens." ".$Value;
elseif (strlen($Value)==6) $Condition=" date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'"; elseif (strlen($Value)==6) $Condition=" date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'";
else $Condition=" date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value; else $Condition=" date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value;
@ -341,21 +345,21 @@ class Export
case 'Date': case 'Date':
case 'Duree': case 'Duree':
case 'Numeric': case 'Numeric':
$szFilterField="<input type=Text name=".$NameField." value='".$ValueField."'>"; $szFilterField='<input type="text" name='.$NameField." value='".$ValueField."'>";
break; break;
case 'Boolean': case 'Boolean':
$szFilterField="<select name=".$NameField.">"; $szFilterField="<select name=".$NameField.'" class="flat">';
$szFilterField.='<option '; $szFilterField.='<option ';
if ($ValueField=='') $szFilterField.=' selected '; if ($ValueField=='') $szFilterField.=' selected ';
$szFilterField.=' value="">Sans</option>'; $szFilterField.=' value="">&nbsp;</option>';
$szFilterField.='<option '; $szFilterField.='<option ';
if ($ValueField=='1') $szFilterField.=' selected '; if ($ValueField=='1') $szFilterField.=' selected ';
$szFilterField.=' value="1">Oui</option>'; $szFilterField.=' value="1">'.yn(1).'</option>';
$szFilterField.='<option '; $szFilterField.='<option ';
if ($ValueField=='0') $szFilterField.=' selected '; if ($ValueField=='0') $szFilterField.=' selected ';
$szFilterField.=' value="0">Non</option>'; $szFilterField.=' value="0">'.yn(0).'</option>';
$szFilterField.="</select>"; $szFilterField.="</select>";
break; break;
case 'List': case 'List':
@ -396,6 +400,8 @@ class Export
} }
} }
$szFilterField.="</select>"; $szFilterField.="</select>";
$this->db->close();
} }
break; break;
} }
@ -450,6 +456,8 @@ class Export
* @param string $model Export format * @param string $model Export format
* @param string $datatoexport Name of dataset to export * @param string $datatoexport Name of dataset to export
* @param array $array_selected Filter on array of fields to export * @param array $array_selected Filter on array of fields to export
* @param array $array_filterValue Filter on array of fields with a filter
* @param array $array_filtered Values of filters
* @param string $sqlquery If set, transmit a sql query instead of building it from arrays * @param string $sqlquery If set, transmit a sql query instead of building it from arrays
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -708,7 +716,10 @@ class Export
} }
/** /**
* Output list all export models
* TODO Move this into a class htmlxxx.class.php
* *
* @return void
*/ */
function list_export_model() function list_export_model()
{ {

View File

@ -58,6 +58,8 @@ $entitytoicon = array(
'product' => 'product', 'product' => 'product',
'warehouse' => 'stock', 'warehouse' => 'stock',
'category' => 'category', 'category' => 'category',
'shipment' => 'sending',
'shipment_line'=> 'sending'
); );
// Translation code // Translation code
@ -86,7 +88,9 @@ $entitytolang = array(
'warehouse' => 'Warehouse', 'warehouse' => 'Warehouse',
'category' => 'Category', 'category' => 'Category',
'other' => 'Other', 'other' => 'Other',
'trip' => 'TripsAndExpenses' 'trip' => 'TripsAndExpenses',
'shipment' => 'Shipments',
'shipment_line'=> 'ShipmentLine'
); );
$array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array(); $array_selected=isset($_SESSION["export_selected_fields"])?$_SESSION["export_selected_fields"]:array();
@ -112,6 +116,9 @@ $sqlusedforexport='';
$upload_dir = $conf->export->dir_temp.'/'.$user->id; $upload_dir = $conf->export->dir_temp.'/'.$user->id;
$usefilters=($conf->global->MAIN_FEATURES_LEVEL > 1);
//$usefilters=1;
/* /*
* Actions * Actions
@ -182,6 +189,7 @@ if ($action=='unselectfield')
} }
} }
/*
if ($action=='selectFilterfield') if ($action=='selectFilterfield')
{ {
if ($_GET["field"]=='all') if ($_GET["field"]=='all')
@ -226,6 +234,7 @@ if ($action=='unselectFilterfield')
$_SESSION["export_filtered_fields"]=$array_filtered; $_SESSION["export_filtered_fields"]=$array_filtered;
} }
} }
*/
if ($action=='downfield' || $action=='upfield') if ($action=='downfield' || $action=='upfield')
{ {
@ -559,13 +568,13 @@ if ($step == 2 && $datatoexport)
// Select request if all fields are selected // Select request if all fields are selected
$sqlmaxforexport=$objexport->build_sql(0, array(), array(), array()); $sqlmaxforexport=$objexport->build_sql(0, array(), array(), array());
// $this->array_export_module[0]=$module; // $this->array_export_module[0]=$module;
// $this->array_export_code[0]=$module->export_code[$r]; // $this->array_export_code[0]=$module->export_code[$r];
// $this->array_export_label[0]=$module->export_label[$r]; // $this->array_export_label[0]=$module->export_label[$r];
// $this->array_export_sql[0]=$module->export_sql[$r]; // $this->array_export_sql[0]=$module->export_sql[$r];
// $this->array_export_fields[0]=$module->export_fields_array[$r]; // $this->array_export_fields[0]=$module->export_fields_array[$r];
// $this->array_export_entities[0]=$module->export_fields_entities[$r]; // $this->array_export_entities[0]=$module->export_fields_entities[$r];
// $this->array_export_alias[0]=$module->export_fields_alias[$r]; // $this->array_export_alias[0]=$module->export_fields_alias[$r];
$var=true; $var=true;
$i = 0; $i = 0;
@ -605,7 +614,6 @@ if ($step == 2 && $datatoexport)
print $form->textwithpicto($text,$htmltext); print $form->textwithpicto($text,$htmltext);
//print ' ('.$code.')'; //print ' ('.$code.')';
print '</td>'; print '</td>';
//$bit=1; FIXME not used ?
} }
else else
{ {
@ -617,11 +625,9 @@ if ($step == 2 && $datatoexport)
print '</td>'; print '</td>';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>'; print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
//$bit=0; FIXME not used ?
} }
print '</tr>'; print '</tr>';
//$save_select.=$bit; FIXME not used ?
} }
print '</table>'; print '</table>';
@ -639,7 +645,7 @@ if ($step == 2 && $datatoexport)
if (count($array_selected)) if (count($array_selected))
{ {
// If filters exist // If filters exist
if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0]))
{ {
print '<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>'; print '<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>';
} }
@ -714,26 +720,17 @@ if ($step == 3 && $datatoexport)
print '<br>'; print '<br>';
// Combo list of export models // Combo list of export models
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'; print $langs->trans("SelectFilterFields").'<br>';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="select_model">';
print '<input type="hidden" name="step" value="3">';
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
print '<table><tr><td colspan="2">';
print $langs->trans("SelectExportFields").' ';
$htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1);
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
print '</td></tr></table>';
print '</form>';
// un formulaire en plus pour recuperer les filtres // un formulaire en plus pour recuperer les filtres
print '<form action="export.php?step=4&action=submitFormField&datatoexport='.$datatoexport.'" name="FilterField" method="post">'; print '<form action="'.$_SERVER["PHP_SELF"].'?step=4&action=submitFormField&datatoexport='.$datatoexport.'" name="FilterField" method="post">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Entities").'</td>'; print '<td>'.$langs->trans("Entities").'</td>';
print '<td>'.$langs->trans("FilterableFields").'</td>'; //print '<td>'.$langs->trans("ExportableFields").'</td>';
print '<td align="center"></td>'; //print '<td align="center"></td>';
print '<td>'.$langs->trans("FilteredFields").'</td>'; print '<td>'.$langs->trans("ExportableFields").'</td>';
print '<td width="25%">'.$langs->trans("FilteredFieldsValues").'</td>'; print '<td width="25%">'.$langs->trans("FilteredFieldsValues").'</td>';
print '</tr>'; print '</tr>';
@ -748,14 +745,13 @@ if ($step == 3 && $datatoexport)
$var=true; $var=true;
$i = 0; $i = 0;
// on boucle sur les champs filtrable // on boucle sur les champs
foreach($Typefieldsarray as $code=>$label) foreach($fieldsarray as $code => $label)
{ {
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr ".$bc[$var].">";
$i++; $i++;
$entity=(! empty($objexport->array_export_entities[0][$code])?$objexport->array_export_entities[0][$code]:$objexport->array_export_icon[0]); $entity=(! empty($objexport->array_export_entities[0][$code])?$objexport->array_export_entities[0][$code]:$objexport->array_export_icon[0]);
$entityicon=(! empty($entitytoicon[$entity])?$entitytoicon[$entity]:$entity); $entityicon=(! empty($entitytoicon[$entity])?$entitytoicon[$entity]:$entity);
$entitylang=(! empty($entitytolang[$entity])?$entitytolang[$entity]:$entity); $entitylang=(! empty($entitytolang[$entity])?$entitytolang[$entity]:$entity);
@ -776,41 +772,28 @@ if ($step == 3 && $datatoexport)
$text=$langs->trans($labelName); $text=$langs->trans($labelName);
$tablename=getablenamefromfield($code,$sqlmaxforexport); $tablename=getablenamefromfield($code,$sqlmaxforexport);
$htmltext ='<b>'.$langs->trans("Name").':</b> '.$text.' ('.$label.')<br>'; $htmltext ='<b>'.$langs->trans("Name").':</b> '.$text.'<br>';
$htmltext.='<b>'.$langs->trans("Table")." -> ".$langs->trans("Field").":</b> ".$tablename." -> ".preg_replace('/^.*\./','',$code)."<br>"; $htmltext.='<b>'.$langs->trans("Table")." -> ".$langs->trans("Field").":</b> ".$tablename." -> ".preg_replace('/^.*\./','',$code)."<br>";
if (isset($array_filtered[$code]) && $array_filtered[$code]) print '<td>';
print $form->textwithpicto($text,$htmltext);
print '</td>';
print '<td>';
if (! empty($Typefieldsarray[$code]))
{ {
// Selected fields $szInfoFiltre=$objexport->genDocFilter($Typefieldsarray[$code]);
print '<td>&nbsp;</td>';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=unselectFilterfield&field='.$code.'">'.img_left().'</a></td>';
print '<td>';
print $form->textwithpicto($text,$htmltext);
print '</td>';
//$bit=1; FIXME not used?
// ici le filtre
print '<td>';
$szInfoFiltre=$objexport->genDocFilter($label);
if ($szInfoFiltre) if ($szInfoFiltre)
print $form->textwithpicto($objexport->build_filterField($label, $labelName, $ValueFilter), $szInfoFiltre); {
$tmp=$objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
print $form->textwithpicto($tmp, $szInfoFiltre);
}
else else
print $objexport->build_filterField($label, $labelName, $ValueFilter); {
print '</td>'; print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
} }
else
{
// Fields not selected
print '<td>';
//print $text.'-'.$htmltext."<br>";
print $form->textwithpicto($text,$htmltext);
//print ' ('.$code.')';
print '</td>';
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=selectFilterfield&field='.$code.'">'.img_right().'</a></td>';
print '<td colspan=2>&nbsp;</td>';
//$bit=0; FIXME not used?
} }
print '</td>';
print '</tr>'; print '</tr>';
//$save_selectFilter.=$bit; FIXME not used?
} }
print '</table>'; print '</table>';
@ -839,6 +822,7 @@ if ($step == 4 && $datatoexport)
/* /*
* Affichage onglets * Affichage onglets
*/ */
$stepoffset=0;
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1'; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
@ -850,15 +834,16 @@ if ($step == 4 && $datatoexport)
$h++; $h++;
// If filters exist // If filters exist
if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0]))
{ {
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport;
$head[$h][1] = $langs->trans("Step")." 3"; $head[$h][1] = $langs->trans("Step")." 3";
$h++; $h++;
$stepoffset++;
} }
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=4&datatoexport='.$datatoexport; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=4&datatoexport='.$datatoexport;
$head[$h][1] = $langs->trans("Step")." 4"; $head[$h][1] = $langs->trans("Step")." ".(3+$stepoffset);
$hselected=$h; $hselected=$h;
$h++; $h++;
@ -1055,6 +1040,7 @@ if ($step == 5 && $datatoexport)
* Affichage onglets * Affichage onglets
*/ */
$h = 0; $h = 0;
$stepoffset=0;
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1'; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
$head[$h][1] = $langs->trans("Step")." 1"; $head[$h][1] = $langs->trans("Step")." 1";
@ -1065,19 +1051,20 @@ if ($step == 5 && $datatoexport)
$h++; $h++;
// si le filtrage est parametre pour l'export ou pas // si le filtrage est parametre pour l'export ou pas
if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0]))
{ {
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport;
$head[$h][1] = $langs->trans("Step")." 3"; $head[$h][1] = $langs->trans("Step")." 3";
$h++; $h++;
$stepoffset++;
} }
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=4&datatoexport='.$datatoexport;
$head[$h][1] = $langs->trans("Step")." 4"; $head[$h][1] = $langs->trans("Step")." ".(3+$stepoffset);
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=5&datatoexport='.$datatoexport; $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=5&datatoexport='.$datatoexport;
$head[$h][1] = $langs->trans("Step")." 5"; $head[$h][1] = $langs->trans("Step")." ".(4+$stepoffset);
$hselected=$h; $hselected=$h;
$h++; $h++;
@ -1152,10 +1139,10 @@ if ($step == 5 && $datatoexport)
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="16">'.img_picto_common($key,$objmodelexport->getPicto($key)).'</td>'; print '<td width="16">'.img_picto_common($key,$objmodelexport->getPictoForKey($key)).'</td>';
$text=$objmodelexport->getDriverDesc($key); $text=$objmodelexport->getDriverDescForKey($key);
print '<td>'.$form->textwithpicto($objmodelexport->getDriverLabel($key),$text).'</td>'; print '<td>'.$form->textwithpicto($objmodelexport->getDriverLabelForKey($key),$text).'</td>';
print '<td>'.$objmodelexport->getLibLabel($key).'</td><td align="right">'.$objmodelexport->getLibVersion($key).'</td></tr>'."\n"; print '<td>'.$objmodelexport->getLibLabelForKey($key).'</td><td align="right">'.$objmodelexport->getLibVersionForKey($key).'</td></tr>'."\n";
} }
print '</table>'; print '</table>';

View File

@ -130,11 +130,11 @@ foreach($liste as $key => $val)
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="16">'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).'</td>'; print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
$text=$model->getDriverDesc($key); $text=$model->getDriverDescForKey($key);
print '<td>'.$form->textwithpicto($model->getDriverLabel($key),$text).'</td>'; print '<td>'.$form->textwithpicto($model->getDriverLabelForKey($key),$text).'</td>';
print '<td>'.$model->getLibLabel($key).'</td>'; print '<td>'.$model->getLibLabelForKey($key).'</td>';
print '<td nowrap="nowrap" align="right">'.$model->getLibVersion($key).'</td>'; print '<td nowrap="nowrap" align="right">'.$model->getLibVersionForKey($key).'</td>';
print '</tr>'; print '</tr>';
} }

View File

@ -79,7 +79,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("ExternalSiteSetup"),$linkback,'setup'); print_fiche_titre($langs->trans("ExternalSiteSetup"),$linkback,'setup');
print $langs->trans("Module100Desc")."<br>\n"; print $langs->trans("Module100Desc")."<br>\n";
print '<br>'; print '<br>';
print '<form name="externalsiteconfig" action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form name="externalsiteconfig" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@ -42,7 +42,7 @@ $confirm=GETPOST('confirm','alpha');
// Security check // Security check
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'fournisseur', $facid, 'facture_fourn', 'facture'); $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
// Get parameters // Get parameters
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
@ -130,7 +130,7 @@ if ($object->id > 0)
// Ref // Ref
print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">'; print '<tr><td width="30%" nowrap="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'facid', $linkback, 1, 'rowid', 'ref', $morehtmlref); print $form->showrefnav($object, 'facid', $linkback, 1, 'rowid', 'ref');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -172,12 +172,15 @@ if ($object->id > 0)
} }
print ')'; print ')';
} }
// FIXME $facidnext is not defined
/*
if ($facidnext > 0) if ($facidnext > 0)
{ {
$facthatreplace=new FactureFournisseur($db); $facthatreplace=new FactureFournisseur($db);
$facthatreplace->fetch($facidnext); $facthatreplace->fetch($facidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')'; print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')';
} }
*/
print '</td></tr>'; print '</td></tr>';
// Label // Label

View File

@ -1657,7 +1657,7 @@ else
print '<td>'; print '<td>';
if ($object->lines[$i]->fk_product) if ($object->lines[$i]->fk_product)
{ {
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne print '<a name="'.$object->lines[$i]->rowid.'"></a>'; // ancre pour retourner sur la ligne
$product_static=new ProductFournisseur($db); $product_static=new ProductFournisseur($db);
$product_static->fetch($object->lines[$i]->fk_product); $product_static->fetch($object->lines[$i]->fk_product);
@ -2049,4 +2049,4 @@ else
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();
?> ?>

View File

@ -36,7 +36,7 @@ $langs->load('bills');
$langs->load('banks'); $langs->load('banks');
$facid=GETPOST('facid','int'); $facid=GETPOST('facid','int');
$action=GETPOST('action'); $action=GETPOST('action','alpha');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
@ -86,7 +86,7 @@ if ($action == 'add_paiement')
// Effectue les verifications des parametres // Effectue les verifications des parametres
if ($_POST['paiementid'] <= 0) if ($_POST['paiementid'] <= 0)
{ {
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('PaymentMode')).'</div>'; setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
$error++; $error++;
} }
@ -96,20 +96,20 @@ if ($action == 'add_paiement')
// d'un paiement // d'un paiement
if (! $_POST['accountid']) if (! $_POST['accountid'])
{ {
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')).'</div>'; setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
$error++; $error++;
} }
} }
if ($total == 0) if ($total == 0)
{ {
$mesg = '<div class="error">'.$langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')).'</div>'; setEventMessage($langs->trans('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
$error++; $error++;
} }
if (empty($datepaye)) if (empty($datepaye))
{ {
$mesg = '<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Date')).'</div>'; setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
$error++; $error++;
} }
@ -129,7 +129,7 @@ if ($action == 'add_paiement')
$paiement_id = $paiement->create($user,(GETPOST('closepaidinvoices')=='on'?1:0)); $paiement_id = $paiement->create($user,(GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0) if ($paiement_id < 0)
{ {
$errmsg='<div class="error">'.$paiement->error.'</div>'; setEventMessage($paiement->error, 'errors');
$error++; $error++;
} }
} }
@ -139,7 +139,7 @@ if ($action == 'add_paiement')
$result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$_POST['accountid'],'',''); $result=$paiement->addPaymentToBank($user,'payment_supplier','(SupplierInvoicePayment)',$_POST['accountid'],'','');
if ($result < 0) if ($result < 0)
{ {
$errmsg='<div class="error">'.$paiement->error.'</div>'; setEventMessage($paiement->error, 'errors');
$error++; $error++;
} }
} }
@ -188,7 +188,7 @@ if ($action == 'create' || $action == 'add_paiement')
$facture = new FactureFournisseur($db); $facture = new FactureFournisseur($db);
$facture->fetch($facid); $facture->fetch($facid);
$datefacture=dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datefacture=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture); $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0):$datefacture);
$sql = 'SELECT s.nom, s.rowid as socid,'; $sql = 'SELECT s.nom, s.rowid as socid,';
@ -210,9 +210,6 @@ if ($action == 'create' || $action == 'add_paiement')
print_fiche_titre($langs->trans('DoPayment')); print_fiche_titre($langs->trans('DoPayment'));
if ($mesg) dol_htmloutput_mesg($mesg);
if ($errmsg) dol_htmloutput_errors($errmsg);
print '<form name="addpaiement" action="paiement.php" method="post">'; print '<form name="addpaiement" action="paiement.php" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add_paiement">'; print '<input type="hidden" name="action" value="add_paiement">';
@ -237,7 +234,7 @@ if ($action == 'create' || $action == 'add_paiement')
$form->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid'); $form->select_types_paiements(empty($_POST['paiementid'])?'':$_POST['paiementid'],'paiementid');
print '</td>'; print '</td>';
print '<td rowspan="3" valign="top">'; print '<td rowspan="3" valign="top">';
print '<textarea name="comment" wrap="soft" cols="60" rows="'._ROWS_3.'">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>'; print '<textarea name="comment" wrap="soft" cols="60" rows="'.ROWS_3.'">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>';
print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>'; print '<tr><td>'.$langs->trans('Numero').'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST['num_paiement'])?'':$_POST['num_paiement']).'"></td></tr>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
@ -254,15 +251,15 @@ if ($action == 'create' || $action == 'add_paiement')
/* /*
* Autres factures impayees * Autres factures impayees
*/ */
$sql = 'SELECT f.rowid as facid,f.rowid as ref,f.facnumber,f.total_ttc, f.datef as df'; $sql = 'SELECT f.rowid as facid, f.rowid as ref, f.facnumber, f.total_ht, f.total_ttc, f.datef as df';
$sql.= ', sum(pf.amount) as am'; $sql.= ', SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= ' AND f.fk_soc = '.$facture->socid; $sql.= ' AND f.fk_soc = '.$facture->socid;
$sql.= ' AND f.paye = 0'; $sql.= ' AND f.paye = 0';
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee $sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
$sql.= ' GROUP BY f.rowid,f.facnumber,f.total_ttc,f.datef'; $sql.= ' GROUP BY f.rowid, f.facnumber, f.total_ht, f.total_ttc, f.datef';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
@ -286,6 +283,7 @@ if ($action == 'create' || $action == 'add_paiement')
$var=True; $var=True;
$total=0; $total=0;
$total_ttc=0;
$totalrecu=0; $totalrecu=0;
while ($i < $num) while ($i < $num)
{ {
@ -311,7 +309,7 @@ if ($action == 'create' || $action == 'add_paiement')
$namef = 'amount_'.$objp->facid; $namef = 'amount_'.$objp->facid;
print '<input type="text" size="8" name="'.$namef.'" value="'.GETPOST($namef).'">'; print '<input type="text" size="8" name="'.$namef.'" value="'.GETPOST($namef).'">';
print "</td></tr>\n"; print "</td></tr>\n";
$total+=$objp->total; $total+=$objp->total_ht;
$total_ttc+=$objp->total_ttc; $total_ttc+=$objp->total_ttc;
$totalrecu+=$objp->am; $totalrecu+=$objp->am;
$i++; $i++;
@ -349,7 +347,7 @@ if ($action == 'create' || $action == 'add_paiement')
/* /*
* Show list * Show list
*/ */
if (! $_GET['action'] && ! $_POST['action']) if (empty($action))
{ {
if ($page == -1) $page = 0 ; if ($page == -1) $page = 0 ;
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
@ -358,6 +356,12 @@ if (! $_GET['action'] && ! $_POST['action'])
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
if (! $sortfield) $sortfield='p.datep'; if (! $sortfield) $sortfield='p.datep';
$search_ref=GETPOST('search_ref');
$search_account=GETPOST('search_account');
$search_paymenttype=GETPOST('search_paymenttype');
$search_amount=GETPOST('search_amount');
$search_company=GETPOST('search_company');
$sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,'; $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,';
$sql.= ' s.rowid as socid, s.nom,'; $sql.= ' s.rowid as socid, s.nom,';
$sql.= ' c.libelle as paiement_type,'; $sql.= ' c.libelle as paiement_type,';
@ -379,25 +383,25 @@ if (! $_GET['action'] && ! $_POST['action'])
$sql .= ' AND f.fk_soc = '.$socid; $sql .= ' AND f.fk_soc = '.$socid;
} }
// Search criteria // Search criteria
if ($_REQUEST["search_ref"]) if (! empty($search_ref))
{ {
$sql .= ' AND p.rowid='.$db->escape($_REQUEST["search_ref"]); $sql .= ' AND p.rowid='.$db->escape($search_ref);
} }
if ($_REQUEST["search_account"]) if (! empty($search_account))
{ {
$sql .= ' AND b.fk_account='.$db->escape($_REQUEST["search_account"]); $sql .= ' AND b.fk_account='.$db->escape($search_account);
} }
if ($_REQUEST["search_paymenttype"]) if (! empty($search_paymenttype))
{ {
$sql .= " AND c.code='".$db->escape($_REQUEST["search_paymenttype"])."'"; $sql .= " AND c.code='".$db->escape($search_paymenttype)."'";
} }
if ($_REQUEST["search_amount"]) if (! empty($search_amount))
{ {
$sql .= " AND p.amount=".price2num($_REQUEST["search_amount"]); $sql .= " AND p.amount=".price2num($search_amount);
} }
if ($_REQUEST["search_company"]) if (! empty($search_company))
{ {
$sql .= " AND s.nom LIKE '%".$db->escape($_REQUEST["search_company"])."%'"; $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
} }
$sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.libelle, ba.rowid, ba.label"; $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.libelle, ba.rowid, ba.label";
if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user";
@ -412,9 +416,9 @@ if (! $_GET['action'] && ! $_POST['action'])
$var=True; $var=True;
$paramlist=''; $paramlist='';
$paramlist.=($_REQUEST["search_ref"]?"&search_ref=".$_REQUEST["search_ref"]:""); $paramlist.=(! empty($search_ref)?"&search_ref=".$search_ref:"");
$paramlist.=($_REQUEST["search_company"]?"&search_company=".$_REQUEST["search_company"]:""); $paramlist.=(! empty($search_company)?"&search_company=".$search_company:"");
$paramlist.=($_REQUEST["search_amount"]?"&search_amount=".$_REQUEST["search_amount"]:""); $paramlist.=(! empty($search_amount)?"&search_amount=".$search_amount:"");
print_barre_liste($langs->trans('SupplierPayments'), $page, 'paiement.php',$paramlist,$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans('SupplierPayments'), $page, 'paiement.php',$paramlist,$sortfield,$sortorder,'',$num);
@ -436,20 +440,20 @@ if (! $_GET['action'] && ! $_POST['action'])
// Lines for filters fields // Lines for filters fields
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td align="left">'; print '<td align="left">';
print '<input class="fat" type="text" size="4" name="search_ref" value="'.$_REQUEST["search_ref"].'">'; print '<input class="fat" type="text" size="4" name="search_ref" value="'.$search_ref.'">';
print '</td>'; print '</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '<td align="left">'; print '<td align="left">';
print '<input class="fat" type="text" size="6" name="search_company" value="'.$_REQUEST["search_company"].'">'; print '<input class="fat" type="text" size="6" name="search_company" value="'.$search_company.'">';
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$form->select_types_paiements($_REQUEST["search_paymenttype"],'search_paymenttype','',2,1,1); $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$form->select_comptes($_REQUEST["search_account"],'search_account',0,'',1); $form->select_comptes($search_account,'search_account',0,'',1);
print '</td>'; print '</td>';
print '<td align="right">'; print '<td align="right">';
print '<input class="fat" type="text" size="4" name="search_amount" value="'.$_REQUEST["search_amount"].'">'; print '<input class="fat" type="text" size="4" name="search_amount" value="'.$search_amount.'">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -1,20 +1,21 @@
<?php <?php
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com> * Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * This program is free software; you can redistribute it and/or modify
* the Free Software Foundation; either version 2 of the License, or * it under the terms of the GNU General Public License as published by
* (at your option) any later version. * the Free Software Foundation; either version 2 of the License, or
* * (at your option) any later version.
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * This program is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License * 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, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* \file holiday.class.php * \file holiday.class.php
@ -88,6 +89,12 @@ class Holiday extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
$now=dol_now();
// Check parameters
if (empty($this->fk_user) || ! is_numeric($this->fk_user) || $this->fk_user < 0) { $this->error="ErrorBadParameter"; return -1; }
if (empty($this->fk_validator) || ! is_numeric($this->fk_validator) || $this->fk_validator < 0) { $this->error="ErrorBadParameter"; return -1; }
// Insert request // Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
@ -102,22 +109,13 @@ class Holiday extends CommonObject
$sql.= ") VALUES ("; $sql.= ") VALUES (";
// User // User
if(!empty($this->fk_user)) { $sql.= "'".$this->fk_user."',";
$sql.= "'".$this->fk_user."',"; $sql.= " '".$this->db->idate($now)."',";
} else {
$error++;
}
$sql.= " NOW(),";
$sql.= " '".addslashes($this->description)."',"; $sql.= " '".addslashes($this->description)."',";
$sql.= " '".$this->db->idate($this->date_debut)."',"; $sql.= " '".$this->db->idate($this->date_debut)."',";
$sql.= " '".$this->db->idate($this->date_fin)."',"; $sql.= " '".$this->db->idate($this->date_fin)."',";
$sql.= " '1',"; $sql.= " '1',";
if(is_numeric($this->fk_validator)) { $sql.= " '".$this->fk_validator."'";
$sql.= " '".$this->fk_validator."'";
}
else {
$error++;
}
$sql.= ")"; $sql.= ")";
@ -182,7 +180,6 @@ class Holiday extends CommonObject
$sql.= " cp.fk_user_cancel,"; $sql.= " cp.fk_user_cancel,";
$sql.= " cp.detail_refuse"; $sql.= " cp.detail_refuse";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp";
$sql.= " WHERE cp.rowid = ".$id; $sql.= " WHERE cp.rowid = ".$id;
@ -225,12 +222,12 @@ class Holiday extends CommonObject
} }
/** /**
* Liste les congés payés pour un utilisateur * List holidays for a particular user
* *
* @param int $user_id ID de l'utilisateur à lister * @param int $user_id ID of user to list
* @param string $order Filtrage par ordre * @param string $order Sort order
* @param string $filter Filtre de séléction * @param string $filter SQL Filter
* @return int -1 si erreur, 1 si OK et 2 si pas de résultat * @return int -1 if KO, 1 if OK, 2 if no result
*/ */
function fetchByUser($user_id,$order='',$filter='') function fetchByUser($user_id,$order='',$filter='')
{ {
@ -320,11 +317,11 @@ class Holiday extends CommonObject
} }
/** /**
* Liste les congés payés de tout les utilisateurs * List all holidays of all users
* *
* @param string $order Filtrage par ordre * @param string $order Sort order
* @param string $filter Filtre de séléction * @param string $filter SQL Filter
* @return int -1 si erreur, 1 si OK et 2 si pas de résultat * @return int -1 if KO, 1 if OK, 2 if no result
*/ */
function fetchAll($order,$filter) function fetchAll($order,$filter)
{ {
@ -1182,12 +1179,12 @@ class Holiday extends CommonObject
// On séléctionne les utilisateurs qui ne sont pas déjà dans le module // On séléctionne les utilisateurs qui ne sont pas déjà dans le module
$sql = "SELECT u.fk_user"; $sql = "SELECT u.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as u"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as u";
$sql.= " WHERE u.fk_user NOT IN(".$listUsersDolibarr.")"; $sql.= " WHERE u.fk_user NOT IN (".$listUsersDolibarr.")";
$result = $this->db->query($sql); $resql = $this->db->query($sql);
// Si pas d'erreur SQL // Si pas d'erreur SQL
if($result) { if ($resql) {
$i = 0; $i = 0;
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
@ -1594,5 +1591,27 @@ class Holiday extends CommonObject
} }
} }
/**
* Initialise an instance with random values.
* Used to build previews or test instances.
* id must be 0 if object instance is a specimen.
*
* @return void
*/
function initAsSpecimen()
{
global $user,$langs;
// Initialise parameters
$this->id=0;
$this->specimen=1;
$this->fk_user=1;
$this->description='SPECIMEN description';
$this->date_debut=dol_now();
$this->date_fin=dol_now()+(24*3600);
$this->fk_validator=1;
}
} }
?> ?>

View File

@ -43,14 +43,14 @@ if (empty($conf->holiday->enabled))
} }
$verifConf.= "SELECT value"; $sql = "SELECT value";
$verifConf.= " FROM ".MAIN_DB_PREFIX."holiday_config"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
$verifConf.= " WHERE name = 'userGroup'"; $sql.= " WHERE name = 'userGroup'";
$result = $db->query($verifConf); $result = $db->query($sql);
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
if($obj->value == NULL) if ($obj->value == NULL)
{ {
llxHeader('',$langs->trans('CPTitreMenu')); llxHeader('',$langs->trans('CPTitreMenu'));
print '<div class="tabBar">'; print '<div class="tabBar">';

View File

@ -1,20 +1,21 @@
<?php <?php
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com> * Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * This program is free software; you can redistribute it and/or modify
* the Free Software Foundation; either version 2 of the License, or * it under the terms of the GNU General Public License as published by
* (at your option) any later version. * the Free Software Foundation; either version 2 of the License, or
* * (at your option) any later version.
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * This program is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License * 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, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* \file fiche.php * \file fiche.php
@ -33,14 +34,14 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php';
// Get parameters // Get parameters
$myparam = GETPOST("myparam"); $myparam = GETPOST("myparam");
$action=GETPOST('action'); $action=GETPOST('action', 'alpha');
$id=GETPOST('id'); $id=GETPOST('id', 'int');
// Protection if external user // Protection if external user
if ($user->societe_id > 0) accessforbidden(); if ($user->societe_id > 0) accessforbidden();
$user_id = $user->id; $user_id = $user->id;
$now=dol_now();
/******************************************************************* /*******************************************************************
@ -50,7 +51,6 @@ $user_id = $user->id;
// Si création de la demande // Si création de la demande
if ($action == 'create') if ($action == 'create')
{ {
// Si pas le droit de créer une demande // Si pas le droit de créer une demande
if(!$user->rights->holiday->write) if(!$user->rights->holiday->write)
{ {
@ -262,48 +262,47 @@ if ($action == 'confirm_send')
$verif = $cp->update($user->id); $verif = $cp->update($user->id);
// Si pas d'erreur SQL on redirige vers la fiche de la demande // Si pas d'erreur SQL on redirige vers la fiche de la demande
if($verif > 0) { if ($verif > 0)
{
// A // To
$destinataire = new User($db); $destinataire = new User($db);
$destinataire->fetch($cp->fk_validator); $destinataire->fetch($cp->fk_validator);
$emailTo = $destinataire->email; $emailTo = $destinataire->email;
// De // From
$expediteur = new User($db); $expediteur = new User($db);
$expediteur->fetch($cp->fk_user); $expediteur->fetch($cp->fk_user);
$emailFrom = $expediteur->email; $emailFrom = $expediteur->email;
// Sujet // Subject
if($conf->global->MAIN_APPLICATION_TITLE != NULL) { $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
$societeName = addslashes($conf->global->MAIN_APPLICATION_TITLE); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
} else {
$societeName = addslashes($conf->global->MAIN_INFO_SOCIETE_NOM);
}
$subject = stripslashes($societeName)." - Demande de congés payés à valider"; $subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysToValidate");
// Contenu // Content
$message = "Bonjour {$destinataire->prenom},\n\n"; $message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n";
$message.= "\n";
$message.= "Veuillez trouver ci-dessous une demande de congés payés à valider.\n"; $message.= "Veuillez trouver ci-dessous une demande de congés payés à valider.\n";
$delayForRequest = $cp->getConfCP('delayForRequest'); $delayForRequest = $cp->getConfCP('delayForRequest');
//$delayForRequest = $delayForRequest * (60*60*24); //$delayForRequest = $delayForRequest * (60*60*24);
$now=dol_now();
$nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd'); $nextMonth = dol_time_plus_duree($now, $delayForRequest, 'd');
// Si l'option pour avertir le valideur en cas de délai trop court // Si l'option pour avertir le valideur en cas de délai trop court
if($cp->getConfCP('AlertValidatorDelay')) { if($cp->getConfCP('AlertValidatorDelay'))
if($cp->date_debut < $nextMonth) { {
if($cp->date_debut < $nextMonth)
{
$message.= "\n"; $message.= "\n";
$message.= "Cette demande de congés payés à été effectué dans un"; $message.= "Cette demande de congés payés à été effectué dans un délai de moins de ".$cp->getConfCP('delayForRequest')." jours avant ceux-ci.\n";
$message.= " délai de moins de ".$cp->getConfCP('delayForRequest')." jours avant ceux-ci.\n";
} }
} }
// Si l'option pour avertir le valideur en cas de solde inférieur à la demande // Si l'option pour avertir le valideur en cas de solde inférieur à la demande
if($cp->getConfCP('AlertValidatorSolde')) { if($cp->getConfCP('AlertValidatorSolde'))
{
$nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1); $nbopenedday=num_open_day($cp->date_debut,$cp->date_fin,0,1);
if ($nbopenedday > $cp->getCPforUser($cp->fk_user)) if ($nbopenedday > $cp->getCPforUser($cp->fk_user))
{ {
@ -313,24 +312,26 @@ if ($action == 'confirm_send')
} }
$message.= "\n"; $message.= "\n";
$message.= "- Demandeur : {$expediteur->prenom} {$expediteur->nom}\n"; $message.= "- ".$langs->transnoentitiesnoconv("Name")." : ".$expediteur->prenom." ".$expediteur->nom."\n";
$message.= "- Période : du ".date('d/m/Y',strtotime($cp->date_debut))." au ".date('d/m/Y',strtotime($cp->date_fin))."\n"; $message.= "- ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($cp->date_debut,'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($cp->date_fin,'day')."\n";
$message.= "- Lien : {$dolibarr_main_url_root}/holiday/fiche.php?id={$cp->rowid}\n\n"; $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n";
$message.= "Bien cordialement,\n".$societeName; $message.= "\n";
$mail = new CMailFile($subject,$emailTo,$emailFrom,$message); $mail = new CMailFile($subject,$emailTo,$emailFrom,$message);
// Envoi du mail // Envoi du mail
$result=$mail->sendfile(); $result=$mail->sendfile();
if(!$result) { if (!$result)
{
header('Location: fiche.php?id='.$_GET['id'].'&error=mail&error_content='.$mail->error); header('Location: fiche.php?id='.$_GET['id'].'&error=mail&error_content='.$mail->error);
exit; exit;
} }
header('Location: fiche.php?id='.$_GET['id']); header('Location: fiche.php?id='.$_GET['id']);
exit; exit;
} else { }
else
{
// Sinon on affiche le formulaire de demande avec le message d'erreur SQL // Sinon on affiche le formulaire de demande avec le message d'erreur SQL
header('Location: fiche.php?id='.$_GET['id'].'&error=SQL_Create&msg='.$cp->error); header('Location: fiche.php?id='.$_GET['id'].'&error=SQL_Create&msg='.$cp->error);
exit; exit;
@ -367,37 +368,34 @@ if($action == 'confirm_valid')
$newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted'));
// On ajoute la modification dans le LOG // On ajoute la modification dans le LOG
$cp->addLogCP($userID,$cp->fk_user,'Event : Prise de congés payés',$newSolde); $cp->addLogCP($userID,$cp->fk_user,'Event : '.$langs->transnoentitiesnoconv("Holiday"),$newSolde);
// Mise à jour du solde // Mise à jour du solde
$cp->updateSoldeCP($cp->fk_user,$newSolde); $cp->updateSoldeCP($cp->fk_user,$newSolde);
// A // To
$destinataire = new User($db); $destinataire = new User($db);
$destinataire->fetch($cp->fk_user); $destinataire->fetch($cp->fk_user);
$emailTo = $destinataire->email; $emailTo = $destinataire->email;
// De // From
$expediteur = new User($db); $expediteur = new User($db);
$expediteur->fetch($cp->fk_validator); $expediteur->fetch($cp->fk_validator);
$emailFrom = $expediteur->email; $emailFrom = $expediteur->email;
// Sujet // Subject
if($conf->global->MAIN_APPLICATION_TITLE != NULL) { $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
$societeName = addslashes($conf->global->MAIN_APPLICATION_TITLE); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
} else {
$societeName = addslashes($conf->global->MAIN_INFO_SOCIETE_NOM);
}
$subject = stripslashes($societeName)." - Demande de congés payés validée"; $subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysValidated");
// Contenu
$message = "Bonjour {$destinataire->prenom},\n\n";
$message.= "Votre demande de congés payés du ".$cp->date_debut." au ".$cp->date_fin." vient d'être validée!\n";
$message.= "- Valideur : {$expediteur->prenom} {$expediteur->nom}\n";
$message.= "- Lien : {$dolibarr_main_url_root}/holiday/fiche.php?id={$cp->rowid}\n\n";
$message.= "Bien cordialement,\n".$societeName;
// Content
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n";
$message.= "\n";
$message.= "Votre demande de congés payés du ".dol_print_date($cp->date_debut,'day')." au ".dol_print_date($cp->date_fin,'day')." vient d'être validée!\n";
$message.= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n";
$message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n";
$message.= "\n";
$mail = new CMailFile($subject,$emailTo,$emailFrom,$message); $mail = new CMailFile($subject,$emailTo,$emailFrom,$message);
@ -443,33 +441,30 @@ if ($action == 'confirm_refuse')
// Si pas d'erreur SQL on redirige vers la fiche de la demande // Si pas d'erreur SQL on redirige vers la fiche de la demande
if($verif > 0) { if($verif > 0) {
// A // To
$destinataire = new User($db); $destinataire = new User($db);
$destinataire->fetch($cp->fk_user); $destinataire->fetch($cp->fk_user);
$emailTo = $destinataire->email; $emailTo = $destinataire->email;
// De // From
$expediteur = new User($db); $expediteur = new User($db);
$expediteur->fetch($cp->fk_validator); $expediteur->fetch($cp->fk_validator);
$emailFrom = $expediteur->email; $emailFrom = $expediteur->email;
// Sujet // Subject
if($conf->global->MAIN_APPLICATION_TITLE != NULL) { $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
$societeName = addslashes($conf->global->MAIN_APPLICATION_TITLE); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
} else {
$societeName = addslashes($conf->global->MAIN_INFO_SOCIETE_NOM);
}
$subject = stripslashes($societeName)." - Demande de congés payés refusée"; $subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysRefused");
// Contenu // Content
$message = "Bonjour {$destinataire->prenom},\n\n"; $message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n";
$message.= "Votre demande de congés payés ".$cp->date_debut." au ".$cp->date_fin." vient d'être refusée pour le motif suivant :\n"; $message.= "\n";
$message.= "Votre demande de congés payés ".dol_print_date($cp->date_debut,'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($cp->date_fin,'day')." vient d'être refusée pour le motif suivant :\n";
$message.= $_POST['detail_refuse']."\n\n"; $message.= $_POST['detail_refuse']."\n\n";
$message.= "- Valideur : {$expediteur->prenom} {$expediteur->nom}\n"; $message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n";
$message.= "- Lien : {$dolibarr_main_url_root}/holiday/fiche.php?id={$cp->rowid}\n\n"; $message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n";
$message.= "Bien cordialement,\n".$societeName; $message.= "\n";
$mail = new CMailFile($subject,$emailTo,$emailFrom,$message); $mail = new CMailFile($subject,$emailTo,$emailFrom,$message);
@ -517,32 +512,29 @@ if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes')
// Si pas d'erreur SQL on redirige vers la fiche de la demande // Si pas d'erreur SQL on redirige vers la fiche de la demande
if($verif > 0) if($verif > 0)
{ {
// A // To
$destinataire = new User($db); $destinataire = new User($db);
$destinataire->fetch($cp->fk_user); $destinataire->fetch($cp->fk_user);
$emailTo = $destinataire->email; $emailTo = $destinataire->email;
// De // From
$expediteur = new User($db); $expediteur = new User($db);
$expediteur->fetch($cp->fk_validator); $expediteur->fetch($cp->fk_validator);
$emailFrom = $expediteur->email; $emailFrom = $expediteur->email;
// Sujet // Subject
if($conf->global->MAIN_APPLICATION_TITLE != NULL) { $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
$societeName = addslashes($conf->global->MAIN_APPLICATION_TITLE); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE;
} else {
$societeName = addslashes($conf->global->MAIN_INFO_SOCIETE_NOM);
}
$subject = stripslashes($societeName)."- Demande de congés payés annulée"; $subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysCanceled");
// Contenu
$message = "Bonjour {$destinataire->prenom},\n\n";
$message.= "Votre demande de congés payés ".$cp->date_debut." au ".$cp->date_fin." vient d'être annulée !\n";
$message.= "- Valideur : {$expediteur->prenom} {$expediteur->nom}\n";
$message.= "- Lien : {$dolibarr_main_url_root}/holiday/fiche.php?id={$cp->rowid}\n\n";
$message.= "Bien cordialement,\n".$societeName;
// Content
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->prenom.",\n";
$message.= "\n";
$message.= "Votre demande de congés ".dol_print_date($cp->date_debut,'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($cp->date_fin,'day')." va été annulée.\n";
$message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".$expediteur->prenom." ".$expediteur->nom."\n";
$message.= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/fiche.php?id=".$cp->rowid."\n\n";
$message.= "\n";
$mail = new CMailFile($subject,$emailTo,$emailFrom,$message); $mail = new CMailFile($subject,$emailTo,$emailFrom,$message);
@ -575,6 +567,9 @@ if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes')
* View * View
****************************************************/ ****************************************************/
$form = new Form($db);
llxHeader(array(),$langs->trans('CPTitreMenu')); llxHeader(array(),$langs->trans('CPTitreMenu'));
if (empty($id) || $action == 'add' || $action == 'request') if (empty($id) || $action == 'add' || $action == 'request')
@ -622,7 +617,6 @@ if (empty($id) || $action == 'add' || $action == 'request')
dol_htmloutput_mesg('',$errors,'error'); dol_htmloutput_mesg('',$errors,'error');
} }
$html = new Form($db);
$cp = new Holiday($db); $cp = new Holiday($db);
$delayForRequest = $cp->getConfCP('delayForRequest'); $delayForRequest = $cp->getConfCP('delayForRequest');
@ -679,10 +673,10 @@ if (empty($id) || $action == 'add' || $action == 'request')
print '<td>'; print '<td>';
// Si la demande ne vient pas de l'agenda // Si la demande ne vient pas de l'agenda
if(!isset($_GET['datep'])) { if(!isset($_GET['datep'])) {
$html->select_date(-1,'date_debut_'); $form->select_date(-1,'date_debut_');
} else { } else {
$tmpdate = dol_mktime(0, 0, 0, GETPOST('datepmonth'), GETPOST('datepday'), GETPOST('datepyear')); $tmpdate = dol_mktime(0, 0, 0, GETPOST('datepmonth'), GETPOST('datepday'), GETPOST('datepyear'));
$html->select_date($tmpdate,'date_debut_'); $form->select_date($tmpdate,'date_debut_');
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -691,10 +685,10 @@ if (empty($id) || $action == 'add' || $action == 'request')
print '<td>'; print '<td>';
// Si la demande ne vient pas de l'agenda // Si la demande ne vient pas de l'agenda
if(!isset($_GET['datep'])) { if(!isset($_GET['datep'])) {
$html->select_date(-1,'date_fin_'); $form->select_date(-1,'date_fin_');
} else { } else {
$tmpdate = dol_mktime(0, 0, 0, GETPOST('datefmonth'), GETPOST('datefday'), GETPOST('datefyear')); $tmpdate = dol_mktime(0, 0, 0, GETPOST('datefmonth'), GETPOST('datefday'), GETPOST('datefyear'));
$html->select_date($tmpdate,'date_fin_'); $form->select_date($tmpdate,'date_fin_');
} }
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -703,11 +697,11 @@ if (empty($id) || $action == 'add' || $action == 'request')
// Liste des utiliseurs du groupes choisi dans la config // Liste des utiliseurs du groupes choisi dans la config
$idGroupValid = $cp->getConfCP('userGroup'); $idGroupValid = $cp->getConfCP('userGroup');
$validator = new UserGroup($db,$idGroupValid); $validator = new UserGroup($db, $idGroupValid);
$valideurarray = $validator->listUsersForGroup(); $valideurarray = $validator->listUsersForGroup();
print '<td>'; print '<td>';
print $html->select_dolusers($valideur,"valideur",1,"",0,$valideurarray,''); print $form->select_dolusers($validator->id, "valideur", 1, "", 0, $valideurarray);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr>'; print '<tr>';
@ -799,44 +793,39 @@ else
{ {
if ($action == 'delete' && $cp->statut == 1) { if ($action == 'delete' && $cp->statut == 1) {
if($user->rights->holiday->delete) { if($user->rights->holiday->delete)
$html = new Form($db); {
$ret=$form->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1);
$ret=$html->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
} }
// Si envoi en validation // Si envoi en validation
if ($action == 'sendToValidate' && $cp->statut == 1 && $userID == $cp->fk_user) { if ($action == 'sendToValidate' && $cp->statut == 1 && $userID == $cp->fk_user)
$html = new Form($db); {
$ret=$form->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 0, 1);
$ret=$html->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 0, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
// Si validation de la demande // Si validation de la demande
if ($action == 'valid' && $cp->statut == 2 && $userID == $cp->fk_validator) { if ($action == 'valid' && $cp->statut == 2 && $userID == $cp->fk_validator)
$html = new Form($db); {
$ret=$form->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 0, 1);
$ret=$html->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 0, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
// Si refus de la demande // Si refus de la demande
if ($action == 'refuse' && $cp->statut == 2 && $userID == $cp->fk_validator) { if ($action == 'refuse' && $cp->statut == 2 && $userID == $cp->fk_validator)
$html = new Form($db); {
$array_input = array(array('type'=>"text",'label'=>"Entrez ci-dessous un motif de refus :",'name'=>"detail_refuse",'size'=>"50",'value'=>"")); $array_input = array(array('type'=>"text",'label'=>"Entrez ci-dessous un motif de refus :",'name'=>"detail_refuse",'size'=>"50",'value'=>""));
$ret=$html->form_confirm("fiche.php?id=".$_GET['id']."&action=confirm_refuse",$langs->trans("TitleRefuseCP"),"","confirm_refuse",$array_input,"",0); $ret=$form->form_confirm("fiche.php?id=".$_GET['id']."&action=confirm_refuse",$langs->trans("TitleRefuseCP"),"","confirm_refuse",$array_input,"",0);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
// Si annulation de la demande // Si annulation de la demande
if ($action == 'cancel' && $cp->statut == 2 && $userID == $cp->fk_validator) { if ($action == 'cancel' && $cp->statut == 2 && $userID == $cp->fk_validator)
$html = new Form($db); {
$ret=$form->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 0, 1);
$ret=$html->form_confirm("fiche.php?id=".$_GET['id'],$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 0, 1);
if ($ret == 'html') print '<br />'; if ($ret == 'html') print '<br />';
} }
@ -850,8 +839,6 @@ else
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$_GET['id'].'">'."\n"; print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$_GET['id'].'">'."\n";
print '<input type="hidden" name="action" value="update"/>'."\n"; print '<input type="hidden" name="action" value="update"/>'."\n";
print '<input type="hidden" name="holiday_id" value="'.$_GET['id'].'" />'."\n"; print '<input type="hidden" name="holiday_id" value="'.$_GET['id'].'" />'."\n";
$html = new Form($db);
} }
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -874,7 +861,7 @@ else
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('DateDebCP').'</td>'; print '<td>'.$langs->trans('DateDebCP').'</td>';
print '<td>'; print '<td>';
$html->select_date($cp->date_debut,'date_debut_'); $form->select_date($cp->date_debut,'date_debut_');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
@ -888,7 +875,7 @@ else
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('DateFinCP').'</td>'; print '<td>'.$langs->trans('DateFinCP').'</td>';
print '<td>'; print '<td>';
$html->select_date($cp->date_fin,'date_fin_'); $form->select_date($cp->date_fin,'date_fin_');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
@ -953,7 +940,7 @@ else
$valideur = $validator->listUsersForGroup(); $valideur = $validator->listUsersForGroup();
print '<td>'; print '<td>';
$html->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,''); $form->select_users($cp->fk_validator,"valideur",1,"",0,$valideur,'');
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
} }
@ -983,44 +970,44 @@ else
print '</tbody>'; print '</tbody>';
print '</table>'; print '</table>';
dol_fiche_end(); if ($edit && $user->id == $cp->fk_user && $cp->statut == 1)
print '<div style="clear: both;"></div>'."\n";
if ($edit)
{ {
print '<center>'; print '<br><div align="center">';
if($user->rights->holiday->write && $_GET['action'] == 'edit' && $cp->statut == 1) if($user->rights->holiday->write && $_GET['action'] == 'edit' && $cp->statut == 1)
{ {
print '<input type="submit" value="'.$langs->trans("UpdateButtonCP").'" class="button">'; print '<input type="submit" value="'.$langs->trans("UpdateButtonCP").'" class="button">';
} }
print '</center>'; print '</div>';
print '</form>'; print '</form>';
} }
dol_fiche_end();
if (! $edit) if (! $edit)
{ {
print '<br />'; print '<div class="tabsAction">';
print '<div style="float: right;">'."\n";
// Boutons d'actions // Boutons d'actions
if($user->rights->holiday->write && $_GET['action'] != 'edit' && $cp->statut == 1)
if($user->rights->holiday->write && $_GET['action'] != 'edit' && $cp->statut == 1) { {
print '<a href="fiche.php?id='.$_GET['id'].'&action=edit" class="butAction" style="float: left;">'.$langs->trans("EditCP").'</a>'; print '<a href="fiche.php?id='.$_GET['id'].'&action=edit" class="butAction">'.$langs->trans("EditCP").'</a>';
} }
if($user->rights->holiday->delete && $cp->statut == 1) { if($user->rights->holiday->delete && $cp->statut == 1)
print '<a href="fiche.php?id='.$_GET['id'].'&action=delete" class="butAction" style="float: left;">'.$langs->trans("DeleteCP").'</a>'; {
print '<a href="fiche.php?id='.$_GET['id'].'&action=delete" class="butAction">'.$langs->trans("DeleteCP").'</a>';
} }
if($user->id == $cp->fk_user && $cp->statut == 1) { if($user->id == $cp->fk_user && $cp->statut == 1)
print '<a href="fiche.php?id='.$_GET['id'].'&action=sendToValidate" class="butAction" style="float: left;">'.$langs->trans("SendToValidationCP").'</a>'; {
print '<a href="fiche.php?id='.$_GET['id'].'&action=sendToValidate" class="butAction">'.$langs->trans("SendToValidationCP").'</a>';
} }
// Si le statut est en attente de validation et que le valideur est connecté // Si le statut est en attente de validation et que le valideur est connecté
if($userID == $cp->fk_validator && $cp->statut == 2) { if($userID == $cp->fk_validator && $cp->statut == 2)
print '<a href="fiche.php?id='.$_GET['id'].'&action=valid" class="butAction" style="float: left;">'.$langs->trans("ActionValidCP").'</a>'; {
print '<a href="fiche.php?id='.$_GET['id'].'&action=refuse" class="butAction" style="float: left;">'.$langs->trans("ActionRefuseCP").'</a>'; print '<a href="fiche.php?id='.$_GET['id'].'&action=valid" class="butAction">'.$langs->trans("ActionValidCP").'</a>';
print '<a href="fiche.php?id='.$_GET['id'].'&action=cancel" class="butAction" style="float: left;">'.$langs->trans("ActionCancelCP").'</a>'; print '<a href="fiche.php?id='.$_GET['id'].'&action=refuse" class="butAction">'.$langs->trans("ActionRefuseCP").'</a>';
print '<a href="fiche.php?id='.$_GET['id'].'&action=cancel" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com> * Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -71,6 +71,7 @@ $search_statut = GETPOST('select_statut');
$max_year = 5; $max_year = 5;
$min_year = 10; $min_year = 10;
$filter='';
llxHeader(array(),$langs->trans('CPTitreMenu')); llxHeader(array(),$langs->trans('CPTitreMenu'));
@ -185,7 +186,7 @@ if($holiday_payes == '-1')
$var=true; $num = count($holiday->holiday); $var=true; $num = count($holiday->holiday);
$html = new Form($db); $html = new Form($db);
$htmlother = new FormOther($db); $htmlother = new FormOther($db);
print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num,$nbtotalofrecords); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num);
print '<div class="tabBar">'; print '<div class="tabBar">';

View File

@ -442,9 +442,9 @@ if ($step == 2 && $datatoimport)
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="16">'.img_picto_common($key,$objmodelimport->getPicto($key)).'</td>'; print '<td width="16">'.img_picto_common($key,$objmodelimport->getPictoForKey($key)).'</td>';
$text=$objmodelimport->getDriverDesc($key); $text=$objmodelimport->getDriverDescForKey($key);
print '<td>'.$form->textwithpicto($objmodelimport->getDriverLabel($key),$text).'</td>'; print '<td>'.$form->textwithpicto($objmodelimport->getDriverLabelForKey($key),$text).'</td>';
print '<td align="center"><a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample").'</a></td>'; print '<td align="center"><a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample").'</a></td>';
// Action button // Action button
print '<td align="right">'; print '<td align="right">';
@ -510,8 +510,8 @@ if ($step == 3 && $datatoimport)
// Source file format // Source file format
print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>'; print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>';
print '<td>'; print '<td>';
$text=$objmodelimport->getDriverDesc($format); $text=$objmodelimport->getDriverDescForKey($format);
print $form->textwithpicto($objmodelimport->getDriverLabel($format),$text); print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format),$text);
print '</td><td align="right" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$format.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample").'</a>'; print '</td><td align="right" nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$format.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample").'</a>';
print '</td></tr>'; print '</td></tr>';
@ -715,8 +715,8 @@ if ($step == 4 && $datatoimport)
// Source file format // Source file format
print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>'; print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>';
print '<td>'; print '<td>';
$text=$objmodelimport->getDriverDesc($format); $text=$objmodelimport->getDriverDescForKey($format);
print $form->textwithpicto($objmodelimport->getDriverLabel($format),$text); print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format),$text);
print '</td></tr>'; print '</td></tr>';
// Separator and enclosure // Separator and enclosure
@ -1164,8 +1164,8 @@ if ($step == 5 && $datatoimport)
// Source file format // Source file format
print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>'; print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>';
print '<td>'; print '<td>';
$text=$objmodelimport->getDriverDesc($format); $text=$objmodelimport->getDriverDescForKey($format);
print $form->textwithpicto($objmodelimport->getDriverLabel($format),$text); print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format),$text);
print '</td></tr>'; print '</td></tr>';
// File to import // File to import
@ -1499,7 +1499,7 @@ if ($step == 6 && $datatoimport)
print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>'; print '<tr><td width="25%">'.$langs->trans("SourceFileFormat").'</td>';
print '<td>'; print '<td>';
$text=$objmodelimport->getDriverDesc($format); $text=$objmodelimport->getDriverDesc($format);
print $form->textwithpicto($objmodelimport->getDriverLabel($format),$text); print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format),$text);
print '</td></tr>'; print '</td></tr>';
// File to import // File to import

View File

@ -121,11 +121,11 @@ foreach($liste as $key)
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td width="16">'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).'</td>'; print '<td width="16">'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'</td>';
$text=$model->getDriverDesc($key); $text=$model->getDriverDescForKey($key);
print '<td>'.$form->textwithpicto($model->getDriverLabel($key),$text).'</td>'; print '<td>'.$form->textwithpicto($model->getDriverLabelForKey($key),$text).'</td>';
print '<td>'.$model->getLibLabel($key).'</td>'; print '<td>'.$model->getLibLabelForKey($key).'</td>';
print '<td nowrap="nowrap" align="right">'.$model->getLibVersion($key).'</td>'; print '<td nowrap="nowrap" align="right">'.$model->getLibVersionForKey($key).'</td>';
print '</tr>'; print '</tr>';
} }

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